]> git.ipfire.org Git - thirdparty/python-drafthorse.git/commitdiff
Corrects the attribute order of ApplicableTradeTax (#19)
authorMarko Luther <marko.luther@gmx.net>
Fri, 19 Jan 2024 17:12:14 +0000 (18:12 +0100)
committerGitHub <noreply@github.com>
Fri, 19 Jan 2024 17:12:14 +0000 (18:12 +0100)
* aligns the attribute order of the ApplicableTradeTax class to the TradeTaxType in FACTUR-X_EXTENDED_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd to fix https://github.com/pretix/python-drafthorse/issues/18

* adds test case

* fix formatting

* sync readme with test_minimal

README.rst
drafthorse/models/accounting.py
tests/test_mininal.py

index 4666ec513e033f08fcb67bce38a7984a3876b2b0..357809d7b7833a568b4c3773616a95422f730a93 100644 (file)
@@ -84,7 +84,8 @@ Generating::
     trade_tax.calculated_amount = Decimal("0.00")
     trade_tax.basis_amount = Decimal("999.00")
     trade_tax.type_code = "VAT"
-    trade_tax.category_code = "E"
+    trade_tax.category_code = "AE"
+    trade_tax.exemption_reason_code = 'VATEX-EU-AE'
     trade_tax.rate_applicable_percent = Decimal("0.00")
     doc.trade.settlement.trade_tax.add(trade_tax)
 
index f5d2865b1f39ad28b487f43b4ec81c3165959e9b..0bae75d37a341dab86820e5dc1ba3dacf5db5be1 100644 (file)
@@ -83,13 +83,6 @@ class ApplicableTradeTax(Element):
         profile=COMFORT,
         _d="Grund der Steuerbefreiung (Freitext)",
     )
-    exemption_reason_code = StringField(
-        NS_RAM,
-        "ExemptionReasonCode",
-        required=False,
-        profile=EXTENDED,
-        _d="Grund der Steuerbefreiung (Code)",
-    )
     tax_point_date = DateTimeField(
         NS_RAM, "TaxPointDate", required=False, profile=COMFORT
     )
@@ -127,6 +120,13 @@ class ApplicableTradeTax(Element):
         profile=COMFORT,
         _d="Steuerkategorie (Wert)",
     )
+    exemption_reason_code = StringField(
+        NS_RAM,
+        "ExemptionReasonCode",
+        required=False,
+        profile=EXTENDED,
+        _d="Grund der Steuerbefreiung (Code)",
+    )
     rate_applicable_percent = DecimalField(
         NS_RAM, "RateApplicablePercent", required=True, profile=BASIC
     )
index a0da38ff446d4b1670b0556713ba372e40cbb3d3..0bd7f53c68da56ba3b9ecac6654214f62c8a67b4 100644 (file)
@@ -54,7 +54,8 @@ def test_readme_construction_example():
     trade_tax.calculated_amount = Decimal("0.00")
     trade_tax.basis_amount = Decimal("999.00")
     trade_tax.type_code = "VAT"
-    trade_tax.category_code = "E"
+    trade_tax.category_code = "AE"
+    trade_tax.exemption_reason_code = "VATEX-EU-AE"
     trade_tax.rate_applicable_percent = Decimal("0.00")
     doc.trade.settlement.trade_tax.add(trade_tax)