From 964fe380da0974089fbb21602a6d3f2ffbe8edc4 Mon Sep 17 00:00:00 2001 From: Christopher Neugebauer Date: Fri, 2 Sep 2016 15:57:44 +1000 Subject: [PATCH] Attendee manifest page now reports the items a user has pending and purchased. --- registrasion/reporting/views.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/registrasion/reporting/views.py b/registrasion/reporting/views.py index f52c2d79..ec1e03db 100644 --- a/registrasion/reporting/views.py +++ b/registrasion/reporting/views.py @@ -8,6 +8,7 @@ from django.db.models import Count, Sum from django.db.models import Case, When, Value from django.shortcuts import render +from registrasion.controllers.item import ItemController from registrasion.models import commerce from registrasion.models import people from registrasion import views @@ -215,15 +216,29 @@ def attendee(request, form, attendee_id=None): # TODO: METADATA. - + ic = ItemController(attendee.user) # Paid products headings = ["Product", "Quantity"] data = [] + + for pq in ic.items_purchased(): + data.append([ + pq.product, + pq.quantity, + ]) + reports.append(Report("Paid Products", headings, data)) # Unpaid products headings = ["Product", "Quantity"] data = [] + + for pq in ic.items_pending(): + data.append([ + pq.product, + pq.quantity, + ]) + reports.append( Report("Unpaid Products", headings, data)) # Invoices