From 0e16d4cd7e5ef57cff5a866bc08d0c3b9eab5bda Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 8 Jul 2020 15:00:49 +0200 Subject: [PATCH] Taxation compatibility --- pretix_servicefees/signals.py | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/pretix_servicefees/signals.py b/pretix_servicefees/signals.py index 9d26e7d..3ef6a92 100644 --- a/pretix_servicefees/signals.py +++ b/pretix_servicefees/signals.py @@ -66,25 +66,15 @@ 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) - return [OrderFee( - fee_type=OrderFee.FEE_TYPE_SERVICE, - internal_type='', - value=fee, - tax_rate=tax.rate, - 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 - )] + tax = tax_rule.tax(fee, invoice_address=invoice_address, base_price_is='gross') + return [OrderFee( + fee_type=OrderFee.FEE_TYPE_SERVICE, + internal_type='', + value=fee, + tax_rate=tax.rate, + tax_value=tax.tax, + tax_rule=tax_rule + )] return []