From 3fb6930d797c62b98c5a3bb894a583aa9c993fdb Mon Sep 17 00:00:00 2001 From: Carlos Date: Sat, 30 Jul 2022 13:26:38 -0300 Subject: [PATCH 1/3] =?UTF-8?q?Emiss=C3=A3o=20NFe-MS=20apresenta=20problem?= =?UTF-8?q?as=20no=20SOAP,=20envio=20e=20resposta.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Quanto verificava o Status do Serviço, e tbem Consultar NFe, dava o erro : cStat>404Rejeicao: Uso de prefixo de namespace nao permitido50 No Retorno dava erro pois vem " + if 'consSitNFe' in contents and self.uf == 50: + contents = "" + contents + "" output.close() return contents, etree.fromstring(contents) @@ -148,7 +152,7 @@ def processar_documento(self, edoc): # # Deu errado? # - if not proc_envio.resposta: + if not hasattr(proc_envio, 'resposta') or not proc_envio.resposta: return if not self._verifica_resposta_envio_sucesso(proc_envio): diff --git a/src/erpbrasil/edoc/resposta.py b/src/erpbrasil/edoc/resposta.py index b65ac9f..29e29c4 100644 --- a/src/erpbrasil/edoc/resposta.py +++ b/src/erpbrasil/edoc/resposta.py @@ -19,7 +19,15 @@ def __init__(self, webservice, raiz, xml, retorno, resposta): def analisar_retorno_raw(operacao, raiz, xml, retorno, classe): retorno.raise_for_status() - match = re.search('(.*?)', + match = False + if '' in retorno.text: + match = re.search('(.*?)', + retorno.text.replace('\n', '')) + if '' in retorno.text: + match = re.search('(.*?)', + retorno.text.replace('\n', '')) + if '' in retorno.text: + match = re.search('(.*?)', retorno.text.replace('\n', '')) if match: xml_resposta = match.group(1) From 9f4884f6c1eef0e3c54e347688cee3335391143a Mon Sep 17 00:00:00 2001 From: Carlos Date: Thu, 11 Aug 2022 12:09:43 -0300 Subject: [PATCH 2/3] Alteracao necessaria para pegar o retorno do envio da NFe-MS --- src/erpbrasil/edoc/edoc.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/erpbrasil/edoc/edoc.py b/src/erpbrasil/edoc/edoc.py index 89b79e9..e1551bf 100644 --- a/src/erpbrasil/edoc/edoc.py +++ b/src/erpbrasil/edoc/edoc.py @@ -70,6 +70,10 @@ def _generateds_to_string_etree(self, ds, pretty_print=False): contents = "" + contents + "" if 'consSitNFe' in contents and self.uf == 50: contents = "" + contents + "" + if 'retConsReciNFe' in contents and self.uf == 50: + contents = "" + contents + "" + if 'nfeProc' in contents and self.uf == 50: + contents = contents[:contents.find("ds:Signature")-1] + "" output.close() return contents, etree.fromstring(contents) From 778996d3e486159d848ad6ccf6207b207722fa9f Mon Sep 17 00:00:00 2001 From: Carlos Date: Fri, 12 Aug 2022 18:13:10 -0300 Subject: [PATCH 3/3] =?UTF-8?q?Quando=20d=C3=A1=20algum=20erro=20o=20retor?= =?UTF-8?q?no=20n=C3=A3o=20pode=20entrar=20aqui.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/erpbrasil/edoc/edoc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/erpbrasil/edoc/edoc.py b/src/erpbrasil/edoc/edoc.py index e1551bf..404fd93 100644 --- a/src/erpbrasil/edoc/edoc.py +++ b/src/erpbrasil/edoc/edoc.py @@ -72,7 +72,7 @@ def _generateds_to_string_etree(self, ds, pretty_print=False): contents = "" + contents + "" if 'retConsReciNFe' in contents and self.uf == 50: contents = "" + contents + "" - if 'nfeProc' in contents and self.uf == 50: + if 'nfeProc' in contents and '100' in contents and self.uf == 50: contents = contents[:contents.find("ds:Signature")-1] + "" output.close() return contents, etree.fromstring(contents)