Total charges at document level

Error BR-CO-12 EN 16931

Sum of charges on document level (BT-108) = Σ Document level charge amount (BT-99).

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

ChargeTotalAmount does not equal the sum of the document-level charge amounts. Amounts from SpecifiedLogisticsServiceCharge are also included in the check. If there are no charges, ChargeTotalAmount may be omitted.

What the rule means

The total amount of charges at document level must reflect the individual charge amounts included in it. This ensures that BT-108 matches the amounts from which it is calculated.

Affected fields BT-108 BT-99
Please reconcile the total charges at document level

The total charge amount does not match the individual charge amounts. You can adjust the invoice so that the amounts match.

What to do
  1. Compare ChargeTotalAmount with the document-level charge amounts.
  2. Also include the amounts in SpecifiedLogisticsServiceCharge.
  3. Check the ChargeTotalAmount property and the amounts in ActualAmount.
  4. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
  <ram:ChargeTotalAmount>16.00</ram:ChargeTotalAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>true</udt:Indicator>
  </ram:ChargeIndicator>
  <ram:ActualAmount>10.00</ram:ActualAmount>
</ram:SpecifiedTradeAllowanceCharge>
<ram:SpecifiedLogisticsServiceCharge>
  <ram:AppliedAmount>5.00</ram:AppliedAmount>
</ram:SpecifiedLogisticsServiceCharge>
✓ Correct
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
  <ram:ChargeTotalAmount>15.00</ram:ChargeTotalAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>true</udt:Indicator>
  </ram:ChargeIndicator>
  <ram:ActualAmount>10.00</ram:ActualAmount>
</ram:SpecifiedTradeAllowanceCharge>
<ram:SpecifiedLogisticsServiceCharge>
  <ram:AppliedAmount>5.00</ram:AppliedAmount>
</ram:SpecifiedLogisticsServiceCharge>
Check in FactoorSharp
  • FacturXInvoice.ChargeTotalAmount (BT-108)
  • AbstractTradeAllowanceCharge.ActualAmount (Document level charge: BT-99)
Technical details

The rule compares ChargeTotalAmount, rounded to two decimal places, with the sum of ActualAmount values for entries whose ChargeIndicator is true and AppliedAmount values from SpecifiedLogisticsServiceCharge.

Where the rule applies

The rule applies to the total amounts in SpecifiedTradeSettlementHeaderMonetarySummation and to document-level charges in ApplicableHeaderTradeSettlement.

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 (round (/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:ChargeTotalAmount * 10 * 10) div 100)= round(((round(sum(/ rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator='true']/ ram:ActualAmount)* 10 * 10 ) div 100) + (round(sum(/rsm:CrossIndustryInvoice/ rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedLogisticsServiceCharge/ram:AppliedAmount)* 10 * 10 ) div 100))*10*10) div 100