BR-FREXT-CO-10

The rule sets below word this rule differently; each wording is shown with its rule set.

error: the document is invalid

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.

Message

Num Fact : … , Somme calculée : … , Total HT (BT-106) : … , nblineItem : … , Ecart calculé : … , [BR-FREXT-CO-10] - Écart absolu entre le montant total des lignes (BT-106) et la somme des montants nets ligne (BT-131) ≤ 0,01 € * nombre de lignes, pour lesquels le sous-type est absent ou égal à DETAIL

Context
cac:LegalMonetaryTotal
Test
$resultCO10 le ($nbLineItems * 0.01)

Checked with France EXTENDED-CTC-FR (UBL)

Message

Absolute Value of (Sum of Invoice line net amount (BT-106) - Σ Invoice line net amounts (BT-131))<= 0,01 * Number of line net amounts (BT-131), only for lines where the "Subtype of invoice item" (BT-X-8) has the value "Regular item (standard case)" (DETAIL) or is not specified.

Context
//ram:SpecifiedTradeSettlementHeaderMonetarySummation
Test
for $calculatedAmount in xs:decimal(round(sum(../../ram:IncludedSupplyChainTradeLineItem[not(ram:AssociatedDocumentLineDocument/ram:LineStatusReasonCode) or ram:AssociatedDocumentLineDocument/ram:LineStatusReasonCode = 'DETAIL']/ram:SpecifiedLineTradeSettlement/ram:SpecifiedTradeSettlementLineMonetarySummation/ram:LineTotalAmount/xs:decimal(.)) * xs:decimal(100)) div xs:decimal(100)), $totalAmount in xs:decimal(ram:LineTotalAmount), $nbLineItems in xs:decimal(count(../../ram:IncludedSupplyChainTradeLineItem)), $tolerance in xs:decimal(0.01), $maxTolerance in $nbLineItems * $tolerance, $diff in xs:decimal($totalAmount - $calculatedAmount), $abs in xs:decimal(abs($diff)) return $abs le $maxTolerance

Checked with France EXTENDED-CTC-FR (CII)