XRechnung 2.0.2 · UBL

BR-DEC-18

XRechnung 2.0.2 · UBL

fatalcountry

Original rule text

[BR-DEC-18]-The allowed maximum number of decimals for the Amount due for payment (BT-115) is 2.

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

What this rule requires

The rule requires that cbc:PayableAmount (CII: ram:DuePayableAmount) for the Amount due for payment (BT-115) contains no more than two digits after the decimal point. The validator checks the part of the value after the '.' character and fails the document if that part has a length greater than 2. For example, 123.456 would fail, while 123.45 or 123 would pass.

How to fix

Change the cbc:PayableAmount in cac:LegalMonetaryTotal (CII: ram:DuePayableAmount in ram:SpecifiedTradeSettlementHeaderMonetarySummation) to a value with at most two digits after the decimal point, e.g. round to two decimal places or remove excess decimal digits. If your system generates amounts with more precision, ensure it outputs no more than two decimal places for this element.

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