fatalEN 16931EN 16931 business ruleCIIUBLBT-107BT-92
Sum of allowances on document level (BT-107) = Σ Document level allowance amount (BT-92).
The Sum of allowances on document level (BT-107) does not equal the sum of the document level allowance amounts (BT-92).
Add up every BG-20 allowance's BT-92 and put the total in BT-107. Line-level allowances (BG-27) must NOT be included here - they are already inside each line's BT-131. If there are no document level allowances, omit BT-107 rather than sending 0.00.
CII — context $Document_totals
(not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator=false()])and not (ram:AllowanceTotalAmount)) or ram:AllowanceTotalAmount = (round(sum(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator=false()]/ram:ActualAmount[1])* 10 * 10 ) div 100)
UBL — context $Document_totals
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()]))