Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for vertical VAT calculation #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RST-J
Copy link

@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.

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.

1 participant