# BR-FREXT-CO-10

Source: https://xmlvalid.com/rules/BR-FREXT-CO-10

> 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

- Level: error
- Rule sets: EXTENDED-CTC-FR rules (UBL) 1.4.0.04
- Context: `cac:LegalMonetaryTotal`
- Test: `$resultCO10 le ($nbLineItems * 0.01)`

> 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.

- Level: error
- Rule sets: EXTENDED-CTC-FR rules (CII) 1.4.0.04
- 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`

Validate a document against these rules: https://xmlvalid.com/validate
