Reconcile document-level allowances

Error BR-FXEXT-CO-11 Factur-X

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

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

If document-level allowances are present, ram:AllowanceTotalAmount must match their sum. The permitted difference is at most 0.01 per allowance (BT-92); the rule is violated if the total is missing when allowances exist or differs by more than this tolerance.

What the rule means

BT-107 is the total amount of document-level allowances and must agree with the individual BT-92 amounts, subject to the defined rounding tolerance.

Affected fields BT-107 BT-92
Please reconcile the total for document-level allowances

The stated total for document-level allowances does not sufficiently match the individual allowances, or the total is missing. You can reconcile the amounts against the recorded allowances.

What to do
  1. Compare ram:AllowanceTotalAmount with the ram:ActualAmount values of the allowances in ram:SpecifiedTradeAllowanceCharge.
  2. Check the total through AllowanceTotalAmount and the individual amounts through ActualAmount.
  3. Allow for the permitted tolerance of 0.01 per allowance.
  4. Generate the invoice again and validate it.
Check in FactoorSharp
  • FacturXInvoice.AllowanceTotalAmount (BT-107)
  • AbstractTradeAllowanceCharge.ActualAmount (Document level allowance: BT-92)
Technical details

The test compares ram:AllowanceTotalAmount with the rounded sum of ram:ActualAmount values in ram:SpecifiedTradeAllowanceCharge where ram:ChargeIndicator/udt:Indicator is false. The permitted absolute difference is 0.01 multiplied by the number of allowances; the test also passes when neither allowances nor a total amount is present.

Where the rule applies

Applies to the allowance total in ram:SpecifiedTradeSettlementHeaderMonetarySummation and the individual document-level allowances in ram:SpecifiedTradeAllowanceCharge.

Context (rule/@context)
//ram:SpecifiedTradeSettlementHeaderMonetarySummation
Test expression (assert/@test)
( 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)* 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 )