Decimal places in the invoice line net amount

Error BR-DEC-23 EN 16931

The allowed maximum number of decimals for the Invoice line net amount (BT-131) is 2.

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

The invoice line net amount has more than two digits after the decimal point.

What the rule means

The net amount of an invoice line may have no more than two decimal places.

Affected fields BT-131
Please limit the decimal places in the net amount

The net amount of an invoice line has more than two decimal places. Adjust the value to no more than two digits after the decimal point.

What to do
  1. Check the value of TradeLineItem.LineTotalAmount.
  2. Limit the decimal places to no more than two.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeSettlementLineMonetarySummation>
  <ram:LineTotalAmount>12.345</ram:LineTotalAmount>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
✓ Correct
<ram:SpecifiedTradeSettlementLineMonetarySummation>
  <ram:LineTotalAmount>12.34</ram:LineTotalAmount>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
Check in FactoorSharp
  • TradeLineItem.LineTotalAmount (BT-131)
Technical details

The test counts the characters after the decimal point in LineTotalAmount and requires the count to be no more than two.

Where the rule applies

The rule applies to SpecifiedLineTradeSettlement/SpecifiedTradeSettlementLineMonetarySummation/LineTotalAmount on each invoice line.

Context (rule/@context)
//ram:IncludedSupplyChainTradeLineItem
Test expression (assert/@test)
string-length(substring-after(ram:SpecifiedLineTradeSettlement/ram:SpecifiedTradeSettlementLineMonetarySummation/ ram:LineTotalAmount,'.'))<=2