Changeset - 3651d7a7fb2a
[Not reviewed]
0 1 0
Brett Smith - 23 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:
0 comments (0 inline, 0 general)
pinaxcon/templatetags/nbpy_tags.py
Show inline comments
...
 
@@ -38,7 +38,7 @@ def donation_income(context, invoice):
 
    cheapest_ticket = tickets.order_by('price').first()
 
    ticket_rbi = nonvat_price(cheapest_ticket)
 
    return sum(
 
        (nonvat_price(ticket) - ticket_rbi
 
        (max(nonvat_price(ticket) - ticket_rbi, 0)
 
         for ticket in invoice.lineitem_set.filter(product__in=tickets)),
 
        Decimal(0)).quantize(CENTS_QUANT)
 

	
0 comments (0 inline, 0 general)