Sum of invoice line net amounts

Error BR-CO-10 EN 16931

Sum of Invoice line net amount (BT-106) = Σ Invoice line net amount (BT-131).

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

The amount in the invoice-total ram:LineTotalAmount does not equal the sum of all invoice-line ram:LineTotalAmount values after the line amounts have been summed and rounded to two decimal places.

What the rule means

BT-106 must represent the sum of the net amounts of all invoice lines, BT-131. This keeps the invoice’s stated net total consistent with its individual lines.

Affected fields BT-106 BT-131
Please reconcile the invoice total with the invoice line net amounts

The invoice net amount does not match the sum of the net amounts of its invoice lines. You can correct the invoice total or the line amounts accordingly.

What to do
  1. Compare FacturXInvoice.LineTotalAmount with the sum of the line amounts.
  2. Check the TradeLineItem.LineTotalAmount values for all invoice lines.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
  <ram:LineTotalAmount>29.00</ram:LineTotalAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:IncludedSupplyChainTradeLineItem>
  <ram:SpecifiedLineTradeSettlement>
    <ram:SpecifiedTradeSettlementLineMonetarySummation>
      <ram:LineTotalAmount>10.00</ram:LineTotalAmount>
    </ram:SpecifiedTradeSettlementLineMonetarySummation>
  </ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>
<ram:IncludedSupplyChainTradeLineItem>
  <ram:SpecifiedLineTradeSettlement>
    <ram:SpecifiedTradeSettlementLineMonetarySummation>
      <ram:LineTotalAmount>20.00</ram:LineTotalAmount>
    </ram:SpecifiedTradeSettlementLineMonetarySummation>
  </ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>
✓ Correct
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
  <ram:LineTotalAmount>30.00</ram:LineTotalAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:IncludedSupplyChainTradeLineItem>
  <ram:SpecifiedLineTradeSettlement>
    <ram:SpecifiedTradeSettlementLineMonetarySummation>
      <ram:LineTotalAmount>10.00</ram:LineTotalAmount>
    </ram:SpecifiedTradeSettlementLineMonetarySummation>
  </ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>
<ram:IncludedSupplyChainTradeLineItem>
  <ram:SpecifiedLineTradeSettlement>
    <ram:SpecifiedTradeSettlementLineMonetarySummation>
      <ram:LineTotalAmount>20.00</ram:LineTotalAmount>
    </ram:SpecifiedTradeSettlementLineMonetarySummation>
  </ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>
Check in FactoorSharp
  • FacturXInvoice.LineTotalAmount (BT-106)
  • TradeLineItem.LineTotalAmount (BT-131)
Technical details

The test compares the invoice-level ram:LineTotalAmount with the sum of the line values, rounded to two decimal places before comparison.

Where the rule applies

The rule applies to the invoice total in ram:SpecifiedTradeSettlementHeaderMonetarySummation and the net amounts of the corresponding ram:IncludedSupplyChainTradeLineItem invoice lines.

Context (rule/@context)
//ram:SpecifiedTradeSettlementHeaderMonetarySummation
Test expression (assert/@test)
xs:decimal(ram:LineTotalAmount) = round(xs:decimal(sum(../../ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedLineTradeSettlement/ram:SpecifiedTradeSettlementLineMonetarySummation/ ram:LineTotalAmount)) * xs:decimal(100)) div xs:decimal(100)