Attendee manifest page now reports the items a user has pending and purchased.
This commit is contained in:
		
							parent
							
								
									68aa9b067b
								
							
						
					
					
						commit
						964fe380da
					
				
					 1 changed files with 16 additions and 1 deletions
				
			
		|  | @ -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 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Christopher Neugebauer
						Christopher Neugebauer