NFE-529
Rejeição: CST incompatível na operação com Contribuinte Isento de Inscrição Estadual [nItem: …] (CST …).
In English A sale to a receiver exempt from state registration (indIEDest 2) has CST 50 or 51 (CST 50 is allowed with the repair, demonstration, exhibition and industrialisation CFOPs).
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 = '2' and $cst = ('50', '51')) or ($cst = '50' and $cfop = ('1915', '1916', '2915', '2916', '5915', '5916', '6915', '6916', '1912', '1913', '5912', '5913', '1901', '2901', '5901', '6901'))
Checked with NF-e 4.00, NF-e 4.00 with authorisation protocol