Referenciar NF-e de devolução

283 views
Skip to first unread message

Bruno M.

unread,
May 5, 2017, 9:55:44 AM5/5/17
to NFePHP
Pessoal estou tentando referenciar a nfe só que da o seguinte erro:

  • Falha de Esquema: O elemento pai: 'ide' não estava esperando o elemento 'NFRef'.
o que devo fazer, meu xml ficou assim:

<ide>
<cUF>52</cUF>
<cNF>27510669</cNF>
<natOp>DEVOLUCAO DE COMPRA</natOp>
<indPag>0</indPag>
<mod>55</mod>
<serie>1</serie>
<nNF>965</nNF>
<dhEmi>2017-05-05T10:52:41-02:00</dhEmi>
<dhSaiEnt>2017-05-05T10:52:41-02:00</dhSaiEnt>
<tpNF>1</tpNF>
<idDest>1</idDest>
<cMunFG>5221197</cMunFG>
<tpImp>1</tpImp>
<tpEmis>1</tpEmis>
<cDV>0</cDV>
<tpAmb>1</tpAmb>
<finNFe>4</finNFe>
<indFinal>0</indFinal>
<indPres>9</indPres>
<procEmi>0</procEmi>
<verProc>1.0</verProc>
<NFRef>
<refNFe>52170322555994000145550010962573231311762998</refNFe>
</NFRef>
</ide>

Roberto Machado

unread,
May 5, 2017, 10:26:18 AM5/5/17
to nfe...@googlegroups.com
Não passe fragmentos do XML isso impede qualquer analise.

Valide seu XML com o validador da SEFAZ

Roberto

Bruno M.

unread,
May 5, 2017, 10:36:00 AM5/5/17
to NFePHP
Essa mensagem e do validador:

Schema XML: The element 'ide' in namespace 'http://www.portalfiscal.inf.br/nfe' has invalid child element 'NFRef' in namespace 'http://www.portalfiscal.inf.br/nfe'. List of possible elements expected: 'dhCont, NFref' in namespace 'http://www.portalfiscal.inf.br/nfe'.
Caminho: NFe[1]/infNFe/ide/NFRef

segue o xml em anexo tambem.
52170522555994000145550010000009651275106690-nfe.xml

Roberto Machado

unread,
May 5, 2017, 10:42:19 AM5/5/17
to nfe...@googlegroups.com
O nome da TAG está errado 

<NFRef>
<refNFe>52170322555994000145550010962573231311762998</refNFe>
</NFRef>


CORRETO

<NFref>
<refNFe>52170322555994000145550010962573231311762998</refNFe>
</NFref>

Roberto

Bruno M.

unread,
May 5, 2017, 3:39:33 PM5/5/17
to NFePHP
Obrigado Roberto era isso mesmo.
Reply all
Reply to author
Forward
0 new messages