# ibr-co-12

Source: https://xmlvalid.com/rules/ibr-co-12

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

- Level: error
- Rule sets: PINT Billing rules 1.1.3, PINT Billing rules (as shipped with PINT AE) 1.0.4
- 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()]))`

Validate a document against these rules: https://xmlvalid.com/validate
