BR-FREXT-CO-11
The rule sets below word this rule differently; each wording is shown with its rule set.
What the rule checks
As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.
Somme calculée : … , Total HT (BT-107) : … , nbelements : … , Ecart calculé : … , [BR-FREXT-CO-11] - Écart absolu entre le total des remises (BT-107) et la somme des montants de remise (BT-92) ≤ 0,01 € * nombre de remises.
cac:LegalMonetaryTotal
(abs($totalAmountBT107 - $calculatedAmountBT92) le ($nbAllowanceItems* 0.01)) or (not(cbc:AllowanceTotalAmount) and not(../cac:AllowanceCharge[cbc:ChargeIndicator=false()]))
Checked with France EXTENDED-CTC-FR (UBL)
Absolute Value of (Sum of allowances on document level (BT-107) - Σ Document level allowance amounts (BT-92))<= 0,01 * Number of Document level allowance amounts (BT-92).
//ram:SpecifiedTradeSettlementHeaderMonetarySummation
(not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator='false']) and not (ram:AllowanceTotalAmount)) or (for $calculatedAmount in xs:decimal(round(sum(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator='false']/ram:ActualAmount/xs:decimal(.))* 10 * 10 ) div 100), $totalAmount in xs:decimal(ram:AllowanceTotalAmount), $nbAllowanceItems in xs:decimal(count(../ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator='false'])), $tolerance in xs:decimal(0.01), $maxTolerance in $nbAllowanceItems * $tolerance, $diff in xs:decimal($totalAmount - $calculatedAmount), $abs in xs:decimal(abs($diff)) return $abs le $maxTolerance)
Checked with France EXTENDED-CTC-FR (CII)