Attempt to show relevant lines when we have more than 1 line item
This commit is contained in:
		
					parent
					
						
							
								3fbc4528d9
							
						
					
				
			
			
				commit
				
					
						e782d27739
					
				
			
		
					 2 changed files with 81 additions and 68 deletions
				
			
		| 
						 | 
				
			
			@ -1322,6 +1322,9 @@ class InvoiceDetailView(LoginRequiredMixin, DetailView):
 | 
			
		|||
            context['total_in_chf'] = obj.total_in_chf()
 | 
			
		||||
            context['invoice_number'] = obj.invoice_number
 | 
			
		||||
            context['discount_on_stripe'] = obj.discount_in_chf()
 | 
			
		||||
            if obj.lines_data_count > 1:
 | 
			
		||||
                # special case, we pass the details of each of the line items
 | 
			
		||||
                context['line_items'] = obj.hostingbilllineitem_set.all()
 | 
			
		||||
            return context
 | 
			
		||||
        else:
 | 
			
		||||
            raise Http404
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue