Update nbpy_tags.py
Fixes donation amount
This commit is contained in:
parent
ff8d0f4c41
commit
e144ebf41d
1 changed files with 1 additions and 1 deletions
|
@ -40,5 +40,5 @@ def donation_income(context, invoice):
|
||||||
elif line.product.category.name == "T-Shirt":
|
elif line.product.category.name == "T-Shirt":
|
||||||
rbi.append(line.total_price * fsa_rate)
|
rbi.append(line.total_price * fsa_rate)
|
||||||
|
|
||||||
donation = (invoice.value - sum(rbi))
|
donation = max(Decimal('0'), (invoice.value - sum(rbi)))
|
||||||
return donation.quantize(Decimal('.01'))
|
return donation.quantize(Decimal('.01'))
|
||||||
|
|
Loading…
Reference in a new issue