Attendee manifest page now reports the items a user has pending and purchased.

This commit is contained in:
Christopher Neugebauer 2016-09-02 15:57:44 +10:00
parent 68aa9b067b
commit 964fe380da

View file

@ -8,6 +8,7 @@ from django.db.models import Count, Sum
from django.db.models import Case, When, Value from django.db.models import Case, When, Value
from django.shortcuts import render from django.shortcuts import render
from registrasion.controllers.item import ItemController
from registrasion.models import commerce from registrasion.models import commerce
from registrasion.models import people from registrasion.models import people
from registrasion import views from registrasion import views
@ -215,15 +216,29 @@ def attendee(request, form, attendee_id=None):
# TODO: METADATA. # TODO: METADATA.
ic = ItemController(attendee.user)
# Paid products # Paid products
headings = ["Product", "Quantity"] headings = ["Product", "Quantity"]
data = [] data = []
for pq in ic.items_purchased():
data.append([
pq.product,
pq.quantity,
])
reports.append(Report("Paid Products", headings, data)) reports.append(Report("Paid Products", headings, data))
# Unpaid products # Unpaid products
headings = ["Product", "Quantity"] headings = ["Product", "Quantity"]
data = [] data = []
for pq in ic.items_pending():
data.append([
pq.product,
pq.quantity,
])
reports.append( Report("Unpaid Products", headings, data)) reports.append( Report("Unpaid Products", headings, data))
# Invoices # Invoices