CRP20279

Cuando se registre el valor "07" en el campo ObjetoImpDR, el valor del campo ImpuestoDR de los nodos hijo RetencionDR y/o TrasladoDR del nodo DoctoRelacionado debe ser distinto del valor "002" (IVA); debe existir al menos un nodo hijo TrasladoDR con el valor "003" (IEPS).

In English A related document with ObjetoImpDR 07 (no VAT, IEPS broken down) must have no VAT (002) and must have a transferred IEPS (003).

error: the document is invalid

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.

Context
pago20:Pago/pago20:DoctoRelacionado
Test
not(@ObjetoImpDR = '07') or (not($imp/*/*[@ImpuestoDR = '002']) and $imp/pago20:TrasladosDR/pago20:TrasladoDR[@ImpuestoDR = '003'])

Checked with CFDI 4.0