Correctly calculate fees if one of them is zero

This commit is contained in:
Thomas Hollstegge 2019-04-03 17:06:17 +02:00 committed by Raphael Michel
parent 54025208aa
commit 17e418e8b8
1 changed files with 4 additions and 1 deletions

View File

@ -35,7 +35,10 @@ def get_fees(event, total, invoice_address, mod=''):
if mod and fee_percent is None:
fee_percent = event.settings.get('service_fee_percent', as_type=Decimal)
if fee_abs and fee_percent and total != Decimal('0.00'):
fee_abs = Decimal("0") if fee_abs is None else fee_abs
fee_percent = Decimal("0") if fee_percent is None else fee_percent
if (fee_abs or fee_percent) and total != Decimal('0.00'):
fee = round_decimal(fee_abs + total * (fee_percent / 100), event.currency)
tax_rule = event.settings.tax_rate_default or TaxRule.zero()
if tax_rule.tax_applicable(invoice_address):