PintLint

Rules / IBR-CO-12

Sum of charges on document level = Σ Document level charge amount

Sum of charges on document level (ibt-108) = Σ Document level charge amount (ibt-099).

Fails

<cbc:ChargeTotalAmount currencyID="AED">150.00</cbc:ChargeTotalAmount>
<!-- document-level charges (ChargeIndicator true) add up to 100.00 -->

Fix

Set cbc:ChargeTotalAmount to the sum of cbc:Amount of the document-level charges (cac:AllowanceCharge with cbc:ChargeIndicator true), rounded to 2 decimals. With no charges, leave cbc:ChargeTotalAmount out.

Schematron
Context
cac:LegalMonetaryTotal
Test
xs:decimal(cbc:ChargeTotalAmount) = (round(sum(../cac:AllowanceCharge[cbc:ChargeIndicator=true()]/xs:decimal(cbc:Amount)) * 10 * 10) div 100) or (not(cbc:ChargeTotalAmount) and not(../cac:AllowanceCharge[cbc:ChargeIndicator=true()]))

Official text: Sum of charges on document level (ibt-108) = Σ Document level charge amount (ibt-099).

Official · PINT shared rules. Severity: error. Runs on UBL XML.

Check your invoice for this rule