Skip to content

Commit

Permalink
Corrects the attribute order of ApplicableTradeTax (#19)
Browse files Browse the repository at this point in the history
* 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 #18

* adds test case

* fix formatting

* sync readme with test_minimal
  • Loading branch information
MAKOMO authored Jan 19, 2024
1 parent 75617a8 commit 4019506
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
14 changes: 7 additions & 7 deletions drafthorse/models/accounting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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
)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_mininal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 4019506

Please sign in to comment.