Limit decimal places in the third-party payment amount

Error BR-DEX-13 XRechnung

The maximum number of decimal places allowed for the element "Third party payment amount" (BT-DEX-002) 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 cbc:PaidAmount contains more than two characters after the decimal point. The rule limits the number of decimal places to two.

What the rule means

The third-party payment amount must be stated with no more than two decimal places so that its precision follows the required format.

Please use no more than two decimal places for the third-party payment amount

The value in cbc:PaidAmount has too many decimal places. Adjust the amount to no more than two digits after the decimal point.

What to do
  1. Locate the amount in cbc:PaidAmount within cac:PrepaidPayment.
  2. Limit the characters after the decimal point to no more than two.
  3. Regenerate the invoice and check it again.
What it looks like
✗ Triggers the message
<cac:PrepaidPayment>
  <cbc:PaidAmount>10.123</cbc:PaidAmount>
</cac:PrepaidPayment>
✓ Correct
<cac:PrepaidPayment>
  <cbc:PaidAmount>10.12</cbc:PaidAmount>
</cac:PrepaidPayment>
Technical details

The test counts the characters after the decimal point in cbc:PaidAmount and allows at most two. It checks the string following the point.

Where the rule applies

The rule applies to the numeric value of cbc:PaidAmount within cac:PrepaidPayment.

Original message from the Schematron
Die maximale Anzahl zulässiger Nachkommastellen für das Element "Third party payment amount" (BT-DEX-002) ist 2.
Context (rule/@context)
/ubl:Invoice/cac:PrepaidPayment[$isExtension]
Test expression (assert/@test)
string-length(substring-after(cbc:PaidAmount, '.')) <= 2