templatetags: Don't let the donation amount go negative.
To account for ticket vouchers.
This commit is contained in:
parent
3f6e5ac3d1
commit
3651d7a7fb
1 changed files with 1 additions and 1 deletions
|
@ -38,7 +38,7 @@ def donation_income(context, invoice):
|
||||||
cheapest_ticket = tickets.order_by('price').first()
|
cheapest_ticket = tickets.order_by('price').first()
|
||||||
ticket_rbi = nonvat_price(cheapest_ticket)
|
ticket_rbi = nonvat_price(cheapest_ticket)
|
||||||
return sum(
|
return sum(
|
||||||
(nonvat_price(ticket) - ticket_rbi
|
(max(nonvat_price(ticket) - ticket_rbi, 0)
|
||||||
for ticket in invoice.lineitem_set.filter(product__in=tickets)),
|
for ticket in invoice.lineitem_set.filter(product__in=tickets)),
|
||||||
Decimal(0)).quantize(CENTS_QUANT)
|
Decimal(0)).quantize(CENTS_QUANT)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue