Skip to content

Conversation

@RST-J
Copy link
Contributor

@RST-J RST-J commented Feb 20, 2025

VAT may be calculated horizontally or vertically. The current implementation can only produce schema compliant Factur-X XML when the tax amount is calculated horizontally (calculating the tax amount for each line item and then adding up these values). At least in Germany it is also legal to add up the net amounts of all items within the same tax rate and then applying the tax percentage only once on that.

The Factur-X schema's business rules require TaxTotalAmount and CalculatedAmount within ApplicableTradeTax to be equal. There are inevitable rounding differences possible between the two, so the tax handling must take this into account.

I used https://github.com/ZUGFeRD/mustangproject to verify my changes yield a valid Factur-X XML.

I also added an :UNKNOWN constant because code that has to generate a Factur-X may not know for sure which variant was used and luckily it can be inferred. I plan to work on that but for know want to finish my project but still wanted to let potential users know about this detail.

@halfbyte halfbyte merged commit 077123c into halfbyte:main Mar 12, 2025
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants