XRechnung 2.4.0 · UBL

BR-DEC-09

XRechnung 2.4.0 · UBL

fatalcountry

Original rule text

[BR-DEC-09]-The allowed maximum number of decimals for the Sum of Invoice line net amount (BT-106) is 2.

Stored validation assertion
string-length(substring-after(cbc:LineExtensionAmount,'.'))<=2

What this rule requires

The rule requires the Sum of Invoice line net amount (BT-106) to have at most 2 decimal places. In UBL, this is the value of cac:LegalMonetaryTotal/cbc:LineExtensionAmount; in CII, it is //ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:LineTotalAmount. The test checks the number of characters after the decimal point; if there are more than 2, the document fails validation (fatal).

How to fix

Set the monetary amount to a value with no more than 2 digits after the decimal point. For example, use 123.45 instead of 123.456. Round or format the value so that the substring after '.' has length ≤ 2. Note that trailing zeros beyond two decimal places also cause failure (e.g., 123.450 fails).

Guidance on this rule. The original text above is authoritative.