NFE-508
Rejeição: CST incompatível na operação com Não Contribuinte [nItem: …] (CST …).
In English A sale to a non-contributor (indIEDest 9) has an ICMS CST outside 00, 02, 20, 40, 41, 50, 60 and 61 (51, 10 and 30 only in the cases the rule lists; new vehicles excepted).
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.
nfe:infNFe/nfe:det
not($indIEDest = '9' and $tpNF = '1' and $cst) or ../nfe:det/nfe:prod/nfe:veicProd or $cst = ('00', '20', '40', '41', '60', '61', '02', '50') or ($cst = '51' and ($fin = '4' or $idDest = '1' or $cfop = ('5123', '5922', '6123', '6922'))) or ($cst = '10' and $idDest = '1') or ($cst = '30' and $idDest = '2' and $comb)
Checked with NF-e 4.00, NF-e 4.00 with authorisation protocol