NFE-1003

Rejeição: NF-e de crédito faz referência a documento fiscal diferente de NF-e modelo 55.

In English A credit note references a document that is not an NF-e model 55 (an NFC-e only for a return, type 03).

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
$fin != '5' or (every $k in $refs/nfe:refNFe satisfies substring($k, 21, 2) = '55' or ($credit = '03' and substring($k, 21, 2) = '65'))

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