# CFDI40119

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

> El campo Total no corresponde con la suma del subtotal, menos los descuentos aplicables, más las contribuciones recibidas (impuestos trasladados - federales o locales, derechos, productos, aprovechamientos, aportaciones de seguridad social, contribuciones de mejoras) menos los impuestos retenidos y/o locales (Total …, calculado …).

- 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: `/cfdi:Comprobante`
- Test: `abs(mx:dec(@Total) - $total) le $half`

In English: Total must be SubTotal minus Descuento plus the taxes transferred (federal and local) minus the taxes withheld.

## Why it fails

- Withholdings (ISR, IVA retenido) on the lines that are not subtracted from Total, or not in the comprobante's tax summary.
- Local taxes added to Total without the ImpuestosLocales complement.

## How to fix it

- Compute Total from the comprobante's own SubTotal, Descuento, TotalImpuestosTrasladados and TotalImpuestosRetenidos, plus the local tax complement's totals when there is one.

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