From d7adc5ec1a7127f7c853babb3609fb34a420006a Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Thu, 31 May 2018 13:42:17 -0300 Subject: [PATCH] =?UTF-8?q?[NEW][MDF-E]=20Consulta=20n=C3=A3o=20encerrados?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pynfe/processamento/mdfe.py | 22 +++++++++++++++++++--- pynfe/utils/webservices.py | 4 ++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/pynfe/processamento/mdfe.py b/pynfe/processamento/mdfe.py index 8760599..7c2bf26 100644 --- a/pynfe/processamento/mdfe.py +++ b/pynfe/processamento/mdfe.py @@ -14,12 +14,12 @@ from pynfe.utils.flags import ( from pynfe.utils.webservices import ( MDFE_WS_URL, MDFE_WS_METODO, - WS_MDFE_RECEPCAO, - WS_MDFE_RET_RECEPCAO, - WS_MDFE_RECEPCAO_EVENTO, WS_MDFE_CONSULTA, WS_MDFE_STATUS_SERVICO, WS_MDFE_CONSULTA_NAO_ENCERRADOS, + WS_MDFE_RECEPCAO, + WS_MDFE_RET_RECEPCAO, + WS_MDFE_RECEPCAO_EVENTO, ) from .comunicacao import ComunicacaoSefaz @@ -79,3 +79,19 @@ class ComunicacaoMDFE(ComunicacaoSefaz): self._construir_etree_ds(raiz) ) return self._post(url, xml) + + def consulta_nao_encerrados(self, cnpj): + + url, metodo = self._get_url_metodo(WS_MDFE_CONSULTA_NAO_ENCERRADOS) + raiz = TConsMDFeNaoEnc( + versao=self._versao, + tpAmb=str(self._ambiente), + xServ='CONSULTAR NÃO ENCERRADOS', + CNPJ=cnpj, + ) + raiz.original_tagname_ = 'consMDFeNaoEnc' + xml = self._construir_xml_soap( + metodo, + self._construir_etree_ds(raiz) + ) + return self._post(url, xml) diff --git a/pynfe/utils/webservices.py b/pynfe/utils/webservices.py index a1afe53..ffd5ad8 100644 --- a/pynfe/utils/webservices.py +++ b/pynfe/utils/webservices.py @@ -538,7 +538,7 @@ MDFE_WS_URL = { WS_MDFE_RECEPCAO_EVENTO: 'ws/MDFeRecepcaoEvento/MDFeRecepcaoEvento.asmx', WS_MDFE_CONSULTA: 'ws/MDFeConsulta/MDFeConsulta.asmx', WS_MDFE_STATUS_SERVICO: 'ws/MDFeStatusServico/MDFeStatusServico.asmx', - WS_MDFE_CONSULTA_NAO_ENCERRADOS: 'ws/MDFeConsNaoEnc/MDFeConsNaoEnc.asmx ', + WS_MDFE_CONSULTA_NAO_ENCERRADOS: 'ws/MDFeConsNaoEnc/MDFeConsNaoEnc.asmx', }, AMBIENTE_HOMOLOGACAO: { 'servidor': 'mdfe-homologacao.svrs.rs.gov.br', @@ -547,6 +547,6 @@ MDFE_WS_URL = { WS_MDFE_RECEPCAO_EVENTO: 'ws/MDFeRecepcaoEvento/MDFeRecepcaoEvento.asmx', WS_MDFE_CONSULTA: 'ws/MDFeConsulta/MDFeConsulta.asmx', WS_MDFE_STATUS_SERVICO: 'ws/MDFeStatusServico/MDFeStatusServico.asmx', - WS_MDFE_CONSULTA_NAO_ENCERRADOS: 'ws/MDFeConsNaoEnc/MDFeConsNaoEnc.asmx ', + WS_MDFE_CONSULTA_NAO_ENCERRADOS: 'ws/MDFeConsNaoEnc/MDFeConsNaoEnc.asmx', }, }