BR-CO-16
The amount due for payment (BT-115) must add up: invoice total with VAT (BT-112) minus any amount already paid (BT-113) plus the rounding amount (BT-114).
- Severity
- Error
- Applies to
- CII, UBL
- Rule set
- v2026-01-31
Official rule text
Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) -Paid amount (BT-113) +Rounding amount (BT-114).
Why it happens
The classic rounding bug. When amounts are computed as floating-point numbers the total drifts by a cent, and nothing reveals it until validation.
How to fix it
Use decimal arithmetic throughout rather than float or double, and round only when writing the output to two decimal places. Also check whether a prepaid amount (BT-113) is set that your calculation ignores.
NormAPI provides technical validation, not tax or legal advice.