# CRP20244

Source: https://xmlvalid.com/rules/CRP20244

> El campo ImpSaldoInsoluto debe ser mayor o igual a cero y calcularse con la suma de los campos ImpSaldoAnt menos el ImpPagado (… - …, …).

- Level: error
- Rule sets: SAT validations of CFDI 4.0 and Pagos 2.0 Matrices of 25 March 2026 and Pagos 2.0 rev. B
- Context: `pago20:Pago/pago20:DoctoRelacionado`
- Test: `mx:dec(@ImpSaldoInsoluto) ge 0 and mx:dec(@ImpSaldoInsoluto) = mx:dec(@ImpSaldoAnt) - mx:dec(@ImpPagado)`

In English: The balance left (ImpSaldoInsoluto) must be ImpSaldoAnt minus ImpPagado, and not negative.

## Why it fails

- A second instalment that starts from the invoice's total instead of the balance the first receipt left.

## How to fix it

- Take ImpSaldoAnt from the previous receipt's ImpSaldoInsoluto (the invoice's total for the first payment) and subtract what this payment covers.

Validate a document against these rules: https://xmlvalid.com/validate
