From da42bb2baca8915b21cac39e180cee46bad0146b Mon Sep 17 00:00:00 2001 From: Christopher Neugebauer Date: Sat, 3 Sep 2016 11:51:12 +1000 Subject: [PATCH] Shows all the payments an attendee has made. Fixes #66 --- registrasion/reporting/views.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/registrasion/reporting/views.py b/registrasion/reporting/views.py index 0f1fa1c9..39518480 100644 --- a/registrasion/reporting/views.py +++ b/registrasion/reporting/views.py @@ -271,6 +271,23 @@ def attendee(request, form, attendee_id=None): Report("Credit Notes", headings, data, link_view="credit_note") ) + # All payments + headings = ["To Invoice", "Payment ID", "Reference", "Amount"] + data = [] + + payments = commerce.PaymentBase.objects.filter( + invoice__user=attendee.user, + ) + for payment in payments: + data.append([ + payment.invoice.id, payment.id, payment.reference, payment.amount, + ]) + + reports.append( + Report("Payments", headings, data, link_view="invoice") + ) + + return reports