Add subhire detail view

This commit is contained in:
2022-10-20 00:00:57 +01:00
parent 8b0cd13159
commit 4449efcced
6 changed files with 103 additions and 24 deletions

View File

@@ -572,10 +572,16 @@ class EventAuthorisation(models.Model, RevisionMixin):
return f"{self.event.display_id} (requested by {self.sent_by.initials})"
@reversion.register
class Subhire(BaseEvent):
insurance_value = models.DecimalField(max_digits=10, decimal_places=2) # TODO Validate if this is over notifiable threshold
# TODO Associated events
@property
def display_id(self):
return f"S{self.pk:05d}"
class InvoiceManager(models.Manager):
def outstanding_invoices(self):
# Manual query is the only way I have found to do this efficiently. Not ideal but needs must