NFE-805
Rejeição: A SEFAZ do destinatário não permite Contribuinte Isento de Inscrição Estadual (UF …).
In English The receiver's state does not accept receivers exempt from state registration (indIEDest 2) unless an item has ICMS-ST or is exempt.
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
not($dest/nfe:indIEDest = '2' and $idDest = ('1', '2') and $destUF = ('AL', 'AM', 'BA', 'CE', 'DF', 'ES', 'GO', 'MG', 'MS', 'MT', 'PB', 'PE', 'RJ', 'RN', 'RS', 'SE', 'SP')) or $icms[br:dec(nfe:vICMSST) gt 0 or br:dec(nfe:vICMSSTRet) gt 0] or (every $i in $icms satisfies $i/nfe:CST = ('40', '41') or $i/nfe:CSOSN = ('103', '300', '400'))
Checked with NF-e 4.00, NF-e 4.00 with authorisation protocol