mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Add codification of tax rates (#4372)
* draft * . * Rebase migration * Update src/pretix/base/models/tax.py Co-authored-by: Mira <weller@rami.io> * Test, isort, flake, migration rebase * carry data & API * Fix failing tests * docs fixes * Improve validation * Tests * More fixes --------- Co-authored-by: Mira <weller@rami.io>
This commit is contained in:
@@ -598,6 +598,7 @@ class AddOnsStep(CartMixin, AsyncAction, TemplateFlowStep):
|
||||
tax=a.tax_value,
|
||||
name=a.item.tax_rule.name if a.item.tax_rule else "",
|
||||
rate=a.tax_rate,
|
||||
code=a.item.tax_rule.code if a.item.tax_rule else None,
|
||||
)
|
||||
else:
|
||||
v.initial_price = v.suggested_price
|
||||
@@ -612,6 +613,7 @@ class AddOnsStep(CartMixin, AsyncAction, TemplateFlowStep):
|
||||
tax=a.tax_value,
|
||||
name=a.item.tax_rule.name if a.item.tax_rule else "",
|
||||
rate=a.tax_rate,
|
||||
code=a.item.tax_rule.code if a.item.tax_rule else None,
|
||||
)
|
||||
else:
|
||||
i.initial_price = i.suggested_price
|
||||
|
||||
@@ -98,7 +98,8 @@ class OrderPositionChangeForm(forms.Form):
|
||||
new_price = get_price(i, v, voucher=instance.voucher, subevent=instance.subevent,
|
||||
invoice_address=invoice_address)
|
||||
current_price = TaxedPrice(tax=instance.tax_value, gross=instance.price, net=instance.price - instance.tax_value,
|
||||
name=instance.tax_rule.name if instance.tax_rule else '', rate=instance.tax_rate)
|
||||
name=instance.tax_rule.name if instance.tax_rule else '', rate=instance.tax_rate,
|
||||
code=instance.tax_code)
|
||||
if new_price.gross < current_price.gross and event.settings.change_allow_user_price == 'gte':
|
||||
continue
|
||||
if new_price.gross <= current_price.gross and event.settings.change_allow_user_price == 'gt':
|
||||
|
||||
@@ -1410,6 +1410,7 @@ class OrderChangeMixin:
|
||||
gross=a.price,
|
||||
tax=a.tax_value,
|
||||
name=a.item.tax_rule.name if a.item.tax_rule else "",
|
||||
code=a.item.tax_rule.code if a.item.tax_rule else None,
|
||||
rate=a.tax_rate,
|
||||
)
|
||||
else:
|
||||
@@ -1424,6 +1425,7 @@ class OrderChangeMixin:
|
||||
gross=a.price,
|
||||
tax=a.tax_value,
|
||||
name=a.item.tax_rule.name if a.item.tax_rule else "",
|
||||
code=a.item.tax_rule.name if a.item.tax_rule else None,
|
||||
rate=a.tax_rate,
|
||||
)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user