Reconcile charges and logistics service fees

Error BR-FXEXT-CO-12 Factur-X

Absolute Value of (Sum of charges on document level (BT-108) - Σ Document level charge amounts (BT-99) - Σ Logistics Service fee amounts (BT-x-272))<= 0,01 * (Number of Document level charge amounts (BT-99) + Number of Logistics Service fee amounts (BT-X-272)).

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

ram:ChargeTotalAmount must equal the sum of document-level charges (BT-99) and logistics service fees (BT-X-272). The permitted difference is at most 0.01 for each recorded charge or logistics service fee; the total must not be missing when such amounts are present.

What the rule means

BT-108 represents the total amount of document-level charges. It includes individual charges BT-99 and logistics service fees BT-X-272, subject to the defined rounding tolerance.

Affected fields BT-108 BT-99 BT-X-272
Please reconcile the total for charges and logistics service fees

The total for charges does not sufficiently match the document-level charges and logistics service fees, or the total is missing. Reconcile the total against the recorded individual amounts.

What to do
  1. Compare ram:ChargeTotalAmount with the ram:ActualAmount values for charges and the ram:AppliedAmount values for logistics service fees.
  2. Check the total through ChargeTotalAmount and the individual charge amounts through ActualAmount.
  3. Allow for the permitted tolerance of 0.01 per charge or logistics service fee.
  4. Generate the invoice again and validate it.
Check in FactoorSharp
  • FacturXInvoice.ChargeTotalAmount (BT-108)
  • AbstractTradeAllowanceCharge.ActualAmount (Document level charge: BT-99)
Technical details

The test compares ram:ChargeTotalAmount with the rounded sum of ram:ActualAmount for charges where ram:ChargeIndicator/udt:Indicator='true', together with ram:AppliedAmount from ram:SpecifiedLogisticsServiceCharge. The absolute tolerance is 0.01 multiplied by the total number of these entries; the condition is also satisfied when neither entries nor a total are present.

Where the rule applies

Applies to the charge total in ram:SpecifiedTradeSettlementHeaderMonetarySummation, document-level ram:SpecifiedTradeAllowanceCharge entries, and ram:SpecifiedLogisticsServiceCharge.

Context (rule/@context)
//ram:SpecifiedTradeSettlementHeaderMonetarySummation
Test expression (assert/@test)
( not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator='true']) and not (ram:ChargeTotalAmount) ) or ( for $calculatedAmount in xs:decimal(xs:decimal(round(sum(/rsm:CrossIndustryInvoice/ rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator='true']/ ram:ActualAmount)* 100 ) div 100)+ xs:decimal(round(sum(/rsm:CrossIndustryInvoice/ rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedLogisticsServiceCharge/ram:AppliedAmount)* 10 * 10 ) div 100)), $totalAmount in xs:decimal(ram:ChargeTotalAmount), $nbChargeItems in xs:decimal(count(../ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/ udt:Indicator='true']) + count(../ram:SpecifiedLogisticsServiceCharge)), $tolerance in xs:decimal(0.01), $maxTolerance in $nbChargeItems * $tolerance, $diff in xs:decimal($totalAmount - $calculatedAmount), $abs in xs:decimal(abs($diff)) return $abs le $maxTolerance )