From 93af1134514ef2af6f03d0ed8210601fe57a399e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Luna?= Date: Fri, 23 Mar 2018 15:38:13 -0300 Subject: [PATCH] =?UTF-8?q?Corrige=20met=C3=B3dos=20e=20layout=20para=20co?= =?UTF-8?q?nsulta=20de=20protocolo=20da=20NF-e.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pytrustnfe/Servidores.py | 2 +- pytrustnfe/nfe/__init__.py | 5 +++-- pytrustnfe/nfe/templates/NfeConsulta2.xml | 5 +++++ pytrustnfe/nfe/templates/NfeConsultaProtocolo.xml | 6 ------ setup.py | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 pytrustnfe/nfe/templates/NfeConsulta2.xml delete mode 100644 pytrustnfe/nfe/templates/NfeConsultaProtocolo.xml diff --git a/pytrustnfe/Servidores.py b/pytrustnfe/Servidores.py index 181462b..72a0573 100644 --- a/pytrustnfe/Servidores.py +++ b/pytrustnfe/Servidores.py @@ -6,7 +6,7 @@ WS_NFE_AUTORIZACAO = 'NfeAutorizacao' 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' diff --git a/pytrustnfe/nfe/__init__.py b/pytrustnfe/nfe/__init__.py index f00ee9f..ea57408 100644 --- a/pytrustnfe/nfe/__init__.py +++ b/pytrustnfe/nfe/__init__.py @@ -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], @@ -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: @@ -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): diff --git a/pytrustnfe/nfe/templates/NfeConsulta2.xml b/pytrustnfe/nfe/templates/NfeConsulta2.xml new file mode 100644 index 0000000..e34f47a --- /dev/null +++ b/pytrustnfe/nfe/templates/NfeConsulta2.xml @@ -0,0 +1,5 @@ + + {{ ambiente }} + CONSULTAR + {{ chave_nfe }} + \ No newline at end of file diff --git a/pytrustnfe/nfe/templates/NfeConsultaProtocolo.xml b/pytrustnfe/nfe/templates/NfeConsultaProtocolo.xml deleted file mode 100644 index 0156d9e..0000000 --- a/pytrustnfe/nfe/templates/NfeConsultaProtocolo.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - {{ obj.ambiente }} - CONSULTAR - {{ obj.chave_nfe }} - \ No newline at end of file diff --git a/setup.py b/setup.py index 2b186be..d862966 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ # coding=utf-8 from setuptools import setup, find_packages -VERSION = "0.1.44" +VERSION = "0.1.45" setup( name="PyTrustNFe",