-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Having two items with different VATs and adding a charge/allowance will generate an invalid or wrong XML #640
Comments
I looked into the code and I think the problem is related to the fact, that the In the method
First confusing part is, that the charges needs to have set the taxPercent. where as all VATs can be get from the keys of the Second, if percent are set inside the
This code is problematic, because Setting the totalAmount to the calculated charge will work as expected. In case it is a bug, I can create a PR. |
Hi, |
It looks like that there is an issue when having an invoice with two items and different VAT. Adding a charge/allowance will generate an invalid XML or has a wrong calculation. A n invoice where all items have the same VAT works as expected.
Generate an invoice with the following two items:
item 1: quantity: 10, price: 10, VAT 19 %
item 2: quantity: 1, price: 10, VAT: 19 %
invoice with two items and same VAT without a charge/allowance -> works (XML is valid)
invoice with two items and same VAT with a charge/allowance -> works (XML is valid)
invoice with two items (one item 19% VAT, second 7 % VAT) without a charge/allowance -> works (XML is valid)
invoice with two items (one item 19% VAT, second 7 % VAT) with a charge/allowance -> works (XML is invalid or calculation is wrong depending on the input)
In the first case the XML for the charges look like this:
The XML is invalid due to the fact that the tax percents are missing/is by default BigDEcimal.ZERO.
In the second case adding two charges (one for VAT 19% and a second one for 7 %) generates the following XML:
Now, the XML is valid, but the totalamount is now the amount of all items and not the sum of items with VAT 19 % or VAT 7%.
Expected behavior
Setting up a charge using
should result in the following XML:
macOS, Java 17 & version 2.15.2
The text was updated successfully, but these errors were encountered: