diff --git a/RIGS/finance.py b/RIGS/finance.py index 38d8b883..2c458c82 100644 --- a/RIGS/finance.py +++ b/RIGS/finance.py @@ -51,6 +51,7 @@ class InvoiceIndex(generic.ListView): class InvoiceDetail(generic.DetailView): model = models.Invoice + template_name = 'invoice_detail.html' class InvoicePrint(generic.View): @@ -155,7 +156,7 @@ class InvoiceArchive(generic.ListView): class InvoiceWaiting(generic.ListView): model = models.Event paginate_by = 25 - template_name = 'event_invoice.html' + template_name = 'invoice_list_waiting.html' def get_context_data(self, **kwargs): context = super(InvoiceWaiting, self).get_context_data(**kwargs) @@ -203,6 +204,7 @@ class InvoiceEvent(generic.View): class PaymentCreate(generic.CreateView): model = models.Payment fields = ['invoice', 'date', 'amount', 'method'] + template_name = 'payment_form.html' def get_initial(self): initial = super(generic.CreateView, self).get_initial() diff --git a/RIGS/models.py b/RIGS/models.py index e7f0d689..dd6f2cfc 100644 --- a/RIGS/models.py +++ b/RIGS/models.py @@ -499,6 +499,7 @@ class EventAuthorisation(models.Model, RevisionMixin): return str("N%05d" % self.event.pk + ' (requested by ' + self.sent_by.initials + ')') +@reversion.register(follow=['payment_set']) class Invoice(models.Model): event = models.OneToOneField('Event', on_delete=models.CASCADE) invoice_date = models.DateField(auto_now_add=True) diff --git a/RIGS/templates/event_detail.html b/RIGS/templates/event_detail.html index edf6d5d8..a1401912 100644 --- a/RIGS/templates/event_detail.html +++ b/RIGS/templates/event_detail.html @@ -70,143 +70,11 @@ {% endif %}
These events have happened, but paperwork has not yet been sent to treasury
- {% if is_paginated %} -| Event # | -Start Date | -Event Name | -Client | -Cost | -MIC | -- |
|---|---|---|---|---|---|---|
| N{{ object.pk|stringformat:"05d" }} - {{ object.get_status_display }} |
- {{ object.start_date }} | -- {{ object.name }} - {% if object.is_rig and perms.RIGS.view_event and object.authorised %} - - {% endif %} - | -
- {{ object.organisation.name }}
- - {{ object.internal|yesno:'Internal,External' }} - |
-
- {{ object.sum_total|floatformat:2 }}
- - {% if not object.internal %}{{ object.purchase_order }}{% endif %} - |
-
- {% if object.mic %}
- {{ object.mic.initials }} - |
- - - - - | -
| Date | -Amount | -Method | -- | ||||||||
| Date + | Amount + | Method + | + | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ payment.date }} | +{{ payment.date }} | {{ payment.amount|floatformat:2 }} | {{ payment.get_method_display }} | - + |
| Invoice # | -Event | -Client | -Event Date | -Invoice Date | -Balance | -- | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Invoice # | +Event | +Client | +Event Date | +Invoice Date | +Balance | ++ | |||||
| {{ object.pk }} - {% if object.void %}(VOID){% elif object.is_closed %}(PAID){% else %}(O/S){% endif %} |
- N{{ object.event.pk|stringformat:"05d" }}: {{ object.event.name }} - {{ object.event.get_status_display }}{% if not object.event.mic %}, No MIC{% endif %} + {% for invoice in invoice_list %} + {{ invoice.pk }} |
+ + {% if invoice.void %}(VOID){% elif invoice.is_closed %}(PAID){% else %}(O/S){% endif %} N{{ invoice.event.pk|stringformat:"05d" }}: {{ invoice.event.name }} |
- + {{ invoice.event.get_status_display }}{% if not invoice.event.mic %}, No MIC{% endif %} {% if object.event.organisation %}
- {{ object.event.organisation.name }}
+ | {% if invoice.event.organisation %}
+ {{ invoice.event.organisation.name }}
|
- - {{ object.event.internal|yesno:'Internal,External' }} - {% else %} - {{ object.event.person.name }} + {{ invoice.event.internal|yesno:'Internal,External' }} + {% elif invoice.event.person %} + {{ invoice.event.person.name }} - External + Individual {% endif %} {{ object.event.start_date }} |
- {{ object.invoice_date }} |
+ {{ invoice.event.start_date }} |
+ {{ invoice.invoice_date }} |
- {{ object.balance|floatformat:2 }}
+ {{ invoice.balance|floatformat:2 }}
+ {% if not invoice.event.internal %}
|
- {{ object.event.purchase_order }} + {{ invoice.event.purchase_order }} + {% endif %}
-
-
+
+
|
|
Paperwork for these events has been sent to treasury, but the full balance has not yet appeared on a ledger
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/RIGS/templates/invoice_list_archive.html b/RIGS/templates/invoice_list_archive.html index f0335f2f..32585657 100644 --- a/RIGS/templates/invoice_list_archive.html +++ b/RIGS/templates/invoice_list_archive.html @@ -1,4 +1,4 @@ -{% extends 'RIGS/invoice_list.html' %} +{% extends 'invoice_list.html' %} {% block title %} Invoice Archive @@ -13,12 +13,12 @@ All Invoices {% endblock %} {% block search %} -These events have happened, but paperwork has not yet been sent to treasury
+| Event # | +Start Date | +Event Name | +Client | +Cost | +MIC | ++ |
|---|---|---|---|---|---|---|
| N{{ event.pk|stringformat:"05d" }} + {{ event.get_status_display }} |
+ {{ event.start_date }} | ++ {{ event.name }} + {% if event.is_rig and perms.RIGS.view_event and event.authorised %} + + {% endif %} + | +
+ {% if event.organisation %}
+ {{ event.organisation.name }}
+ + {{ event.internal|yesno:'Internal,External' }} + {% elif event.person %} + {{ event.person.name }} + + Individual + {% else %} + + {% endif %} + |
+
+ {{ event.sum_total|floatformat:2 }}
+ + {% if not event.internal %}{{ event.purchase_order }}{% endif %} + |
+
+ {% if event.mic %}
+ {{ event.mic.initials }} + |
+ + + Paperwork Sent + + | +