mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04: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:
@@ -50,7 +50,7 @@ def item2(event2):
|
||||
|
||||
@pytest.fixture
|
||||
def taxrule(event):
|
||||
return event.tax_rules.create(rate=Decimal('19.00'))
|
||||
return event.tax_rules.create(rate=Decimal('19.00'), code="S/standard")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -111,9 +111,9 @@ def order(event, item, device, taxrule, question):
|
||||
amount=Decimal('23.00'),
|
||||
)
|
||||
o.fees.create(fee_type=OrderFee.FEE_TYPE_PAYMENT, value=Decimal('0.25'), tax_rate=Decimal('19.00'),
|
||||
tax_value=Decimal('0.05'), tax_rule=taxrule)
|
||||
tax_value=Decimal('0.05'), tax_rule=taxrule, tax_code=taxrule.code)
|
||||
o.fees.create(fee_type=OrderFee.FEE_TYPE_PAYMENT, value=Decimal('0.25'), tax_rate=Decimal('19.00'),
|
||||
tax_value=Decimal('0.05'), tax_rule=taxrule, canceled=True)
|
||||
tax_value=Decimal('0.05'), tax_rule=taxrule, tax_code=taxrule.code, canceled=True)
|
||||
InvoiceAddress.objects.create(order=o, company="Sample company", country=Country('NZ'),
|
||||
vat_id="DE123", vat_id_validated=True, custom_field="Custom info")
|
||||
op = OrderPosition.objects.create(
|
||||
@@ -196,6 +196,7 @@ TEST_ORDERPOSITION_RES = {
|
||||
"tax_rate": "0.00",
|
||||
"tax_value": "0.00",
|
||||
"tax_rule": None,
|
||||
"tax_code": None,
|
||||
"secret": "z3fsn8jyufm5kpk768q69gkbyr5f4h6w",
|
||||
"addon_to": None,
|
||||
"pseudonymization_id": "ABCDEFGHKL",
|
||||
@@ -297,6 +298,7 @@ TEST_ORDER_RES = {
|
||||
"description": "",
|
||||
"internal_type": "",
|
||||
"tax_rate": "19.00",
|
||||
"tax_code": "S/standard",
|
||||
"tax_value": "0.05"
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user