-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
Quantity Decimal Places Limitation Conflicts with XRechnung Compliance (Needs Immediate Fix) #494
Comments
Thank you for your immediate update. Failed tests: testDXExport(org.mustangproject.ZUGFeRD.DXTest): expected:<400.0000> but was:<400.000000000000000000> |
PR #497 created to fix these issues. |
@fktrdui can you provide one or two tests? |
@jstaerk I would be happy to modify the previous tests to reflect the changes in the ZUGFeRD2PullProvider.
With these changes, unnecessary trailing zeros are eliminated, and the quantities are formatted as required by the specification. |
Modified Test Cases:
|
According to the XRechnung specification, as highlighted in the attached screenshot (section 8.8 "Quantity"), the quantity values should not have a limitation on decimal places. The specification explicitly mentions that the quantity field should allow a floating-point number without limitation on decimal places ("ohne Limitierung der Nachkommastellen").
However, the Mustang project appears to limit the number of decimal places for quantities in certain methods.
Specifically, in the ZUGFeRD2PullProvider class, the quantityFormat method restricts quantities to 4 decimal places:
This method is called by:
Additionally, in the IZUGFeRDExportableItem interface, the getBasisQuantity() method also uses BigDecimal.ONE.setScale(4), which imposes a restriction of 4 decimal places for the quantity.
Request for Immediate Action
This issue requires urgent attention as it directly impacts XRechnung compliance. Non-compliant e-invoices could lead to legal and financial risks, such as invoice rejections.
Proposed Fix:
Modify the following methods to allow arbitrary precision for quantity values:
quantityFormat in the ZUGFeRD2PullProvider class.
getBasisQuantity in the IZUGFeRDExportableItem interface.
The text was updated successfully, but these errors were encountered: