Message

The sum of charges at document level MUST be equal to the sum of document level charge amounts

Context
//cac:LegalMonetaryTotal
Test
(xs:decimal(cbc:ChargeTotalAmount)) = (round(xs:decimal(sum(/ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator="true"]/cbc:Amount)) * 10 * 10) div 100) or not(cbc:ChargeTotalAmount)
Usage
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:ChargeTotalAmount