0 1 0
Brett Smith - 11 months ago 2019-12-16 20:16:00
brettcsmith@brettcsmith.org
templatetags: Don't let the donation amount go negative. To account for ticket vouchers.
1 file changed with 1 insertions and 1 deletions:
↑ Collapse Diff ↑
...
 
@@ -38,7 +38,7 @@ def donation_income(context, invoice):
38 38
 
    cheapest_ticket = tickets.order_by('price').first()
39 39
 
    ticket_rbi = nonvat_price(cheapest_ticket)
40 40
 
    return sum(
41
 
        (nonvat_price(ticket) - ticket_rbi
41
 
        (max(nonvat_price(ticket) - ticket_rbi, 0)
42 42
 
         for ticket in invoice.lineitem_set.filter(product__in=tickets)),
43 43
 
        Decimal(0)).quantize(CENTS_QUANT)
44 44
 

	
0 comments (0 inline, 0 general)