Taxation compatibility

This commit is contained in:
Raphael Michel 2020-07-08 15:00:49 +02:00
parent e4f33304b1
commit 0e16d4cd7e

View file

@ -66,8 +66,7 @@ def get_fees(event, total, invoice_address, mod='', request=None, positions=[],
if (fee_per_ticket or fee_abs or fee_percent) and total != Decimal('0.00'):
fee = round_decimal(fee_abs + total * (fee_percent / 100) + len(positions) * fee_per_ticket, event.currency)
tax_rule = event.settings.tax_rate_default or TaxRule.zero()
if tax_rule.tax_applicable(invoice_address):
tax = tax_rule.tax(fee)
tax = tax_rule.tax(fee, invoice_address=invoice_address, base_price_is='gross')
return [OrderFee(
fee_type=OrderFee.FEE_TYPE_SERVICE,
internal_type='',
@ -76,15 +75,6 @@ def get_fees(event, total, invoice_address, mod='', request=None, positions=[],
tax_value=tax.tax,
tax_rule=tax_rule
)]
else:
return [OrderFee(
fee_type=OrderFee.FEE_TYPE_SERVICE,
internal_type='',
value=fee,
tax_rate=Decimal('0.00'),
tax_value=Decimal('0.00'),
tax_rule=tax_rule
)]
return []