Maximum of two decimal places for the VAT amount

Error BR-DEC-20 EN 16931

The allowed maximum number of decimals for the VAT category tax amount (BT-117) is 2.

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

ram:CalculatedAmount contains more than two digits after the decimal point. The VAT amount (BT-117) may have no more than two decimal places.

What the rule means

The two-decimal limit ensures consistent decimal precision for the VAT amount in the VAT breakdown.

Affected fields BT-117
Please limit the VAT amount to two decimal places

The VAT amount in ram:CalculatedAmount has more than two decimal places. Reduce or round the value to no more than two decimal places.

What to do
  1. Check the value in ram:CalculatedAmount.
  2. Limit the decimal places to no more than two.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:ApplicableTradeTax>
  <ram:CalculatedAmount>19.001</ram:CalculatedAmount>
</ram:ApplicableTradeTax>
✓ Correct
<ram:ApplicableTradeTax>
  <ram:CalculatedAmount>19.00</ram:CalculatedAmount>
</ram:ApplicableTradeTax>
Technical details

The test counts the characters after the decimal point in ram:CalculatedAmount and permits no more than two.

Where the rule applies

The rule applies to ram:CalculatedAmount within each ram:ApplicableTradeTax in the invoice header settlement data.

Context (rule/@context)
//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax
Test expression (assert/@test)
string-length(substring-after(ram:CalculatedAmount,'.'))<=2