NFE-269

Rejeição: CNPJ/CPF Emitente da NF-e difere do CNPJ/CPF da NF Referenciada (emitente …).

In English The referenced document of a complementary NF-e or credit note was issued by another CNPJ or CPF.

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
nfe:infNFe
Test
not($fin = '2' or $credit = ('03', '04')) or ((every $k in $refs/nfe:refNFe satisfies substring($k, 7, 14) = $emitDoc) and (every $n in $refs/nfe:refNF satisfies string($n/nfe:CNPJ) = $emitDoc))

Checked with NF-e 4.00, NF-e 4.00 with authorisation protocol