# BR-CO-12-SG

Source: https://xmlvalid.com/rules/BR-CO-12-SG

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

- Level: error
- Rule sets: PINT SG rules (Singapore) 1.4.1
- Context: `cac:LegalMonetaryTotal`
- Test: `round(xs:decimal(cbc:ChargeTotalAmount) * 10 * 10) div 100 = (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
