Simplifies a bunch of older reports.
This commit is contained in:
		
							parent
							
								
									f7326eedf7
								
							
						
					
					
						commit
						4c9f426a47
					
				
					 1 changed files with 12 additions and 24 deletions
				
			
		|  | @ -271,39 +271,27 @@ def attendee(request, form, user_id=None): | ||||||
|     )) |     )) | ||||||
|     reports.append(Links("Actions for " + name, links)) |     reports.append(Links("Actions for " + name, links)) | ||||||
| 
 | 
 | ||||||
|  |     # Paid and pending  products | ||||||
|     ic = ItemController(attendee.user) |     ic = ItemController(attendee.user) | ||||||
|     # Paid products |     reports.append(ListReport( | ||||||
|     headings = ["Product", "Quantity"] |         "Paid Products", | ||||||
|     data = [] |         ["Product", "Quantity"], | ||||||
| 
 |         [(pq.product, pq.quantity) for pq in ic.items_purchased()], | ||||||
|     for pq in ic.items_purchased(): |     )) | ||||||
|         data.append([ |     reports.append(ListReport( | ||||||
|             pq.product, |         "Unpaid Products", | ||||||
|             pq.quantity, |         ["Product", "Quantity"], | ||||||
|         ]) |         [(pq.product, pq.quantity) for pq in ic.items_pending()], | ||||||
| 
 |     )) | ||||||
|     reports.append(ListReport("Paid Products", headings, data)) |  | ||||||
| 
 |  | ||||||
|     # Unpaid products |  | ||||||
|     headings = ["Product", "Quantity"] |  | ||||||
|     data = [] |  | ||||||
| 
 |  | ||||||
|     for pq in ic.items_pending(): |  | ||||||
|         data.append([ |  | ||||||
|             pq.product, |  | ||||||
|             pq.quantity, |  | ||||||
|         ]) |  | ||||||
| 
 |  | ||||||
|     reports.append(ListReport("Unpaid Products", headings, data)) |  | ||||||
| 
 | 
 | ||||||
|     # Invoices |     # Invoices | ||||||
|  |     # TODO make this a querysetreport | ||||||
|     headings = ["Invoice ID", "Status", "Value"] |     headings = ["Invoice ID", "Status", "Value"] | ||||||
|     data = [] |     data = [] | ||||||
| 
 | 
 | ||||||
|     invoices = commerce.Invoice.objects.filter( |     invoices = commerce.Invoice.objects.filter( | ||||||
|         user=attendee.user, |         user=attendee.user, | ||||||
|     ) |     ) | ||||||
|     # TODO make this a querysetreport |  | ||||||
|     for invoice in invoices: |     for invoice in invoices: | ||||||
|         data.append([ |         data.append([ | ||||||
|             invoice.id, invoice.get_status_display(), invoice.value, |             invoice.id, invoice.get_status_display(), invoice.value, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Christopher Neugebauer
						Christopher Neugebauer