-
Notifications
You must be signed in to change notification settings - Fork 688
Description
Describe the issue
When exporting an E-Document using the XRechnung format in Business Central, the Quantity field in the generated XML is being rounded to 2 decimal places. This occurs even when the source Sales Invoice Line contains a quantity with higher precision (e.g., 4 decimals).
While ZUGFeRD handles this correctly, the XRechnung implementation leads to an invalid XML structure because the calculation Unit Price * Quantity no longer matches the Line Amount due to the loss of precision. This results in rejection when the file is uploaded to official German portals or validated online.
Expected behavior
The XRechnung export should support unlimited decimal places for the quantity, matching the ZUGFeRD implementation and the EN 16931 standard. The XML should reflect the exact precision entered in Business Central to ensure that Quantity * Price correctly equals the Line Amount.
Steps to reproduce
-
Use Business Central for Germany.
-
Enable E-Document Service for XRechnung.
-
In setup:
- Buyer Reference Mandatory = Yes
- Buyer Reference = Customer Reference
-
Configure a Workflow and a Document Sending Profile for XRechnung (per docs).
-
Mark this sending profile as the default profile and assign it to a Customer.
-
Create a new Sales Invoice for this Customer.
-
Create a Sales Invoice line with:
- Quantity: 1.2345
- Unit Price: 100.00
- (Verify Line Amount is 123.45)
-
Post the Sales Invoice.
-
Open the Posted Sales Invoice and navigate to Related -> E-Document -> Open E-Document.
-
From E-Document Logs, export the XML file.
-
Observe the XML:
<cbc:InvoicedQuantity>is exported as1.23instead of1.2345. -
Upload the file to the https://erechnungs-validator.de/
-
Observe the validation error
Additional context
No response
I will provide a fix for a bug
- I will provide a fix for a bug