mirror of
https://github.com/pretix/pretix-servicefees.git
synced 2024-12-26 04:53:09 +01:00
Correctly calculate fees if one of them is zero
This commit is contained in:
parent
54025208aa
commit
17e418e8b8
1 changed files with 4 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue