Limit the decimal places of the charge amount

Error BR-DEC-05 EN 16931

The allowed maximum number of decimals for the Document level charge amount (BT-99) 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 ActualAmount contains more than two digits after the decimal point. The charge amount may have no more than two decimal places.

What the rule means

This limit ensures that the charge amount is stated with the permitted precision for this invoice amount.

Affected fields BT-99
Please enter the charge amount with no more than two decimal places

The charge amount has more than two decimal places. You can state the invoice amount with no more than two decimal places.

What to do
  1. Locate the charge amount in the ActualAmount element.
  2. Enter the amount with no more than two decimal places.
  3. Check the value of AbstractTradeAllowanceCharge.ActualAmount.
  4. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ActualAmount>12.345</ram:ActualAmount>
</ram:SpecifiedTradeAllowanceCharge>
✓ Correct
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ActualAmount>12.34</ram:ActualAmount>
</ram:SpecifiedTradeAllowanceCharge>
Check in FactoorSharp
  • AbstractTradeAllowanceCharge.ActualAmount (Document level charge: BT-99)
Technical details

The test counts the characters after a period in the first ActualAmount and allows no more than two.

Where the rule applies

The rule applies to the ActualAmount of a document-level charge within ApplicableHeaderTradeSettlement.

Context (rule/@context)
//ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge/ram:ChargeIndicator[udt:Indicator='true']
Test expression (assert/@test)
string-length(substring-after(../ram:ActualAmount[1],'.'))<=2