Skip to content

Commit

Permalink
Corrige metódos e layout para consulta de protocolo da NF-e.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioluna authored and danimaribeiro committed Mar 23, 2018
1 parent d4cf24b commit 93af113
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pytrustnfe/Servidores.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
WS_NFE_RET_AUTORIZACAO = 'NfeRetAutorizacao'
WS_NFE_CANCELAMENTO = 'RecepcaoEventoCancelamento'
WS_NFE_INUTILIZACAO = 'NfeInutilizacao'
WS_NFE_CONSULTA = 'NfeConsultaProtocolo'
WS_NFE_CONSULTA = 'NfeConsulta2'
WS_NFE_SITUACAO = 'NfeStatusServico'
WS_NFE_CADASTRO = 'NfeConsultaCadastro'

Expand Down
5 changes: 3 additions & 2 deletions pytrustnfe/nfe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def _build_header(method, **kwargs):
'NFeDistribuicaoDFe': ('NFeDistribuicaoDFe/nfeDistDFeInteresse',
'1.00'),
'RecepcaoEventoManifesto': ('RecepcaoEvento', '1.00'),
'NfeConsulta2': ('NfeConsulta2', '3.10')
}
vals = {'estado': kwargs['estado'],
'soap_action': action[method][0],
Expand Down Expand Up @@ -139,7 +140,7 @@ def _send(certificado, method, sign, **kwargs):
pagamento.append(tipo_pagamento)
pagamento.append(valor)
transp = xmlElem_send.find(
".//{http://www.portalfiscal.inf.br/nfe}transp")
".//{http://www.portalfiscal.inf.br/nfe}transp")
transp.addnext(pagamento)

if sign:
Expand Down Expand Up @@ -212,7 +213,7 @@ def inutilizar_nfe(certificado, **kwargs): # Assinar


def consultar_protocolo_nfe(certificado, **kwargs):
return _send(certificado, 'NfeConsultaProtocolo', True, **kwargs)
return _send(certificado, 'NfeConsulta2', False, **kwargs)


def nfe_status_servico(certificado, **kwargs):
Expand Down
5 changes: 5 additions & 0 deletions pytrustnfe/nfe/templates/NfeConsulta2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<consSitNFe xmlns="http://www.portalfiscal.inf.br/nfe" versao="3.10">
<tpAmb>{{ ambiente }}</tpAmb>
<xServ>CONSULTAR</xServ>
<chNFe>{{ chave_nfe }}</chNFe>
</consSitNFe>
6 changes: 0 additions & 6 deletions pytrustnfe/nfe/templates/NfeConsultaProtocolo.xml

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding=utf-8
from setuptools import setup, find_packages

VERSION = "0.1.44"
VERSION = "0.1.45"

setup(
name="PyTrustNFe",
Expand Down

0 comments on commit 93af113

Please sign in to comment.