fatalEN 16931EN 16931 business ruleCIIUBLBT-106BT-131
Sum of Invoice line net amount (BT-106) = Σ Invoice line net amount (BT-131).
The Sum of invoice line net amounts (BT-106) does not equal the sum of the individual line net amounts (BT-131).
Recompute BT-106 by adding up every line's BT-131 exactly as written in the XML, then round once to 2 decimals. Mismatches nearly always come from rounding line amounts for display while summing unrounded floats, or from forgetting that BT-131 is already net of line allowances and charges.
CII — context $Document_totals
xs:decimal(ram:LineTotalAmount) = round(xs:decimal(sum(../../ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:SpecifiedTradeSettlementLineMonetarySummation/ram:LineTotalAmount)) * xs:decimal(100)) div xs:decimal(100)
UBL — context $Document_totals
(xs:decimal(cbc:LineExtensionAmount) = xs:decimal(round(sum(//(cac:InvoiceLine|cac:CreditNoteLine)/xs:decimal(cbc:LineExtensionAmount)) * 10 * 10) div 100))