fatalEN 16931EN 16931 business ruleCIIUBLBT-108BT-99
Sum of charges on document level (BT-108) = Σ Document level charge amount (BT-99).
The Sum of charges on document level (BT-108) does not equal the sum of the document level charge amounts (BT-99).
Add up every BG-21 charge's BT-99. Line-level charges (BG-28) do not belong here. Omit BT-108 entirely when there are no document level charges.
CII — context $Document_totals
(not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator=true()])and not (ram:ChargeTotalAmount)) or ram:ChargeTotalAmount = (round(sum(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator=true()]/ram:ActualAmount[1])* 10 * 10 ) div 100)
UBL — context $Document_totals
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()]))