mirror of
https://github.com/pretix/pretix-servicefees.git
synced 2024-11-23 22:50:21 +01:00
Taxation compatibility
This commit is contained in:
parent
e4f33304b1
commit
0e16d4cd7e
1 changed files with 9 additions and 19 deletions
|
@ -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'):
|
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)
|
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()
|
tax_rule = event.settings.tax_rate_default or TaxRule.zero()
|
||||||
if tax_rule.tax_applicable(invoice_address):
|
tax = tax_rule.tax(fee, invoice_address=invoice_address, base_price_is='gross')
|
||||||
tax = tax_rule.tax(fee)
|
return [OrderFee(
|
||||||
return [OrderFee(
|
fee_type=OrderFee.FEE_TYPE_SERVICE,
|
||||||
fee_type=OrderFee.FEE_TYPE_SERVICE,
|
internal_type='',
|
||||||
internal_type='',
|
value=fee,
|
||||||
value=fee,
|
tax_rate=tax.rate,
|
||||||
tax_rate=tax.rate,
|
tax_value=tax.tax,
|
||||||
tax_value=tax.tax,
|
tax_rule=tax_rule
|
||||||
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 []
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue