Skip to content

[Bug]: Support unlimited decimal places for Quantity and Unit Price and five for VAT % for XRechnung and ZUGFeRD#29754

Open
miljance wants to merge 7 commits intomicrosoft:mainfrom
miljance:DEQuantityDecimalPlacesForEDocs
Open

[Bug]: Support unlimited decimal places for Quantity and Unit Price and five for VAT % for XRechnung and ZUGFeRD#29754
miljance wants to merge 7 commits intomicrosoft:mainfrom
miljance:DEQuantityDecimalPlacesForEDocs

Conversation

@miljance
Copy link
Contributor

@miljance miljance commented Feb 25, 2026

Summary

This pull request updates the XRechnung and ZUGFeRD document export logic to comply with EN 16931 by exporting quantity and unit price fields with unlimited precision and VAT percentages with up to five decimal places. It also updates related test code to ensure consistency and accuracy with the new formatting logic.

Work Item(s)

Fixes #29745
AB#622989

@miljance miljance requested a review from a team as a code owner February 25, 2026 09:15
@miljance miljance requested a review from thloke February 25, 2026 09:15
djukicmilica
djukicmilica previously approved these changes Feb 25, 2026
@github-actions github-actions bot added the linked Issue is linked to a Azure Boards work item label Feb 25, 2026
djukicmilica
djukicmilica previously approved these changes Feb 25, 2026
@JesperSchulz JesperSchulz added Finance GitHub request for Finance area processing-PR The PR is currently being reviewed labels Feb 25, 2026
@JesperSchulz JesperSchulz self-assigned this Feb 25, 2026
@github-actions
Copy link
Contributor

Processing this PR. The branch is now locked 🔒 Please don't push updates unless otherwise agreed.

@JesperSchulz
Copy link
Contributor

Looks like maybe you forgot to refactor a few lines? At least this code doesn't compile:

App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(27,1): error AL0792: Unused using directive 'using System.Reflection;'.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(1892,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(1901,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(1946,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(1948,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(1950,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(1952,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(1963,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(1965,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(1967,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(1969,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(2003,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(2005,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(2011,25): error AL0118: The name 'FormatFourDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(2021,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(2023,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(2029,25): error AL0118: The name 'FormatFourDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(2051,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(2053,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(2059,25): error AL0118: The name 'FormatFourDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(2069,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(2071,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\XRechnungXMLDocumentTests.Codeunit.al(2077,25): error AL0118: The name 'FormatFourDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(1942,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(1951,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(1996,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(1998,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2000,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2002,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2013,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2015,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2017,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2019,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2205,25): error AL0118: The name 'FormatFourDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2207,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2211,25): error AL0118: The name 'FormatFourDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2221,25): error AL0118: The name 'FormatFourDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2223,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2227,25): error AL0118: The name 'FormatFourDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2249,25): error AL0118: The name 'FormatFourDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2251,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2255,25): error AL0118: The name 'FormatFourDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2265,25): error AL0118: The name 'FormatFourDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2267,25): error AL0118: The name 'FormatDecimal' does not exist in the current context.
App\Apps\DE\EDocumentDE\TempSource\test\src\ZUGFeRDXMLDocumentTests.Codeunit.al(2271,25): error AL0118: The name 'FormatFourDecimal' does not exist in the current context.

@miljance
Copy link
Contributor Author

@JesperSchulz I need to rebase on main obviously. The code compiles but not with the latest main.

@miljance
Copy link
Contributor Author

The main branch has been merged and tests fixed in order to support Service Documents

@JesperSchulz
Copy link
Contributor

The main branch has been merged and tests fixed in order to support Service Documents

Sorry, just got back from vacation and simply tried to throw as much code into the build pipeline as I could. Didn't really look much deeper into states of PRs. Thanks for fixing. Let's get this in.

…nto DEQuantityDecimalPlacesForEDocs

# Conflicts:
#	Apps/DE/EDocumentDE/test/src/XRechnungXMLDocumentTests.Codeunit.al
@miljance miljance force-pushed the DEQuantityDecimalPlacesForEDocs branch 3 times, most recently from a730f26 to fb6cea7 Compare February 26, 2026 13:29
@miljance miljance force-pushed the DEQuantityDecimalPlacesForEDocs branch from fb6cea7 to 1e21a98 Compare February 26, 2026 13:31
@miljance
Copy link
Contributor Author

@JesperSchulz merged the newly synced main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Finance GitHub request for Finance area linked Issue is linked to a Azure Boards work item processing-PR The PR is currently being reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: XRechnung export rounds Quantity to 2 decimals instead of unlimited, causing calculation mismatch

5 participants