From 7fdafd854e77b9611fbb9e211ca329f154ca4527 Mon Sep 17 00:00:00 2001 From: Tom Price Date: Tue, 23 May 2017 19:18:19 +0100 Subject: [PATCH] Add payments to invoice PDF --- RIGS/templates/RIGS/event_print_page.xml | 97 +++++++++++++++++++----- 1 file changed, 76 insertions(+), 21 deletions(-) diff --git a/RIGS/templates/RIGS/event_print_page.xml b/RIGS/templates/RIGS/event_print_page.xml index 4e2d194f..9b8362eb 100644 --- a/RIGS/templates/RIGS/event_print_page.xml +++ b/RIGS/templates/RIGS/event_print_page.xml @@ -34,6 +34,13 @@ {{ invoice.invoice_date|date:"d/m/Y" }} + + {% if not object.internal %} + + PO + {{ object.purchase_order }} + + {% endif %} {% elif quote %} @@ -210,19 +217,78 @@ - - - Total - - - - - £ {{ object.total|floatformat:2 }} - - + {% if invoice %} + Total + £ {{ object.total|floatformat:2 }} + {% else %} + + + Total + + + + + £ {{ object.total|floatformat:2 }} + + + {% endif %} + +{% if invoice %} + + +

Payments

+ + + + + Method + + + + + Date + + + + + Amount + + + + {% for payment in object.invoice.payment_set.all %} + + {{ payment.get_method_display }} + {{ payment.date }} + £ {{ payment.amount|floatformat:2 }} + + {% endfor %} + + + + + Payment Total + £ {{ object.invoice.payment_total|floatformat:2 }} + + + + + + Balance (ex. VAT) + + + + + £ {{ object.invoice.balance|floatformat:2 }} + + + + +
+{% endif %} + {% if quote %} @@ -267,17 +333,6 @@ £ {{ object.authorisation.amount|floatformat:2 }} - {% elif not object.internal and object.purchase_order %} - - - - Purchase Order - - - - {{ object.purchase_order }} - - {% endif %}