PintLint

Rules / IBR-CO-11

Sum of allowances on document level = Σ Document level allowance amount

Sum of allowances on document level (ibt-107) = Σ Document level allowance amount (ibt-092).

Fails

<cbc:AllowanceTotalAmount currencyID="AED">150.00</cbc:AllowanceTotalAmount>
<!-- document-level allowances (ChargeIndicator false) add up to 100.00 -->

Fix

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

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

Official text: Sum of allowances on document level (ibt-107) = Σ Document level allowance amount (ibt-092).

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

Check your invoice for this rule