diff --git a/registrasion/controllers/invoice.py b/registrasion/controllers/invoice.py index e9a654e4..b8087c98 100644 --- a/registrasion/controllers/invoice.py +++ b/registrasion/controllers/invoice.py @@ -122,7 +122,7 @@ class InvoiceController(object): ) payment.save() - payments = rego.Payment.objects .filter(invoice=self.invoice) + payments = rego.Payment.objects.filter(invoice=self.invoice) agg = payments.aggregate(Sum("amount")) total = agg["amount__sum"] diff --git a/registrasion/templates/invoice.html b/registrasion/templates/invoice.html index a66132cf..bd503657 100644 --- a/registrasion/templates/invoice.html +++ b/registrasion/templates/invoice.html @@ -33,5 +33,19 @@ + + + + + + + {% for payment in invoice.payment_set.all %} + + + + + + {% endfor %} +
Payment timeReferenceAmount
{{payment.time}}{{payment.reference}}{{payment.amount}}
{% endblock %} diff --git a/registrasion/views.py b/registrasion/views.py index 6288f4b2..64f4e4b1 100644 --- a/registrasion/views.py +++ b/registrasion/views.py @@ -217,7 +217,7 @@ def pay_invoice(request, invoice_id): invoice_id = int(invoice_id) inv = rego.Invoice.objects.get(pk=invoice_id) current_invoice = InvoiceController(inv) - if not inv.paid and not current_invoice.is_valid(): + if not inv.paid and current_invoice.is_valid(): current_invoice.pay("Demo invoice payment", inv.value) return redirect("invoice", current_invoice.invoice.id)