Sum of 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 differs from the sum of their ram:ActualAmount values by more than the permitted tolerance. The tolerance is 0.01 for each allowance.

What the rule means

The document-level allowance total must reflect the individual allowance amounts. A limited rounding difference is allowed.

Affected fields BT-107 BT-92
Please reconcile the total allowance amount

The document-level allowance total does not agree sufficiently with the individual allowance amounts. You can compare and reconcile the relevant amounts.

What to do
  1. Compare FacturXInvoice.AllowanceTotalAmount with the sum of AbstractTradeAllowanceCharge.ActualAmount values for document-level allowances.
  2. Check that the relevant allowances are included in the total.
  3. Generate the invoice again and validate it once more.
Check in FactoorSharp
  • FacturXInvoice.AllowanceTotalAmount (BT-107)
  • AbstractTradeAllowanceCharge.ActualAmount (Document level allowance: BT-92)
Technical details

The ram:ActualAmount values of entries whose udt:Indicator is false are summed and rounded to two decimal places. When allowances are present, the absolute difference is evaluated using 0.01 per entry; the test also permits the case where there are no allowances and no ram:AllowanceTotalAmount.

Where the rule applies

The rule applies to ram:SpecifiedTradeSettlementHeaderMonetarySummation and compares ram:AllowanceTotalAmount with the document-level allowance amounts 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 )