Limit the decimal places of the charge base amount

Error BR-DEC-06 EN 16931

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

What the rule means

This limit defines the permitted precision for the charge base amount.

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

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

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

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

Where the rule applies

The rule applies to the BasisAmount 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:BasisAmount,'.'))<=2