CFDI40221
El campo Importe correspondiente a Traslado no es igual al redondeo de la suma de los importes de los impuestos trasladados registrados en los conceptos donde el impuesto del concepto sea igual al campo impuesto de este elemento y la TasaOCuota del concepto sea igual al campo TasaOCuota de este elemento (…, conceptos …).
In English The Importe of a transferred tax in the summary must be the sum of the lines' amounts with the same tax, factor and rate, rounded to the currency's decimals.
What the rule checks
As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.
/cfdi:Comprobante/cfdi:Impuestos/cfdi:Traslados/cfdi:Traslado
not(@Importe) or abs(mx:dec(@Importe) - $amounts) le $half
Checked with CFDI 4.0