Invoice line net amount may have at most two decimal places

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 value of ram:LineTotalAmount has more than two digits after the decimal point.

What the rule means

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

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

The invoice line net amount has more than two decimal places. Adjust the LineTotalAmount value to no more than two decimal places.

What to do
  1. Check the LineTotalAmount value in the invoice line.
  2. Make sure there are no more than two digits after the decimal point.
  3. Check the mapping in TradeLineItem.LineTotalAmount.
  4. Generate the invoice again and validate it.
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 a period in ram:LineTotalAmount and allows no more than two.

Where the rule applies

The rule applies to the net amount ram:LineTotalAmount in the invoice line summary.

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