Skip to content

Commit 7a8509e

Browse files
authored
Merge pull request #215 from leogregianin/main
Altera geração da URL de DistribuicaoDFe em Homologação
2 parents bb992e7 + 7223d61 commit 7a8509e

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

pynfe/processamento/comunicacao.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,10 @@ def _get_url_an(self, consulta):
367367
ambiente = 'https://www.'
368368
# homologacao
369369
else:
370-
ambiente = 'https://hom.'
370+
if consulta == 'DISTRIBUICAO':
371+
ambiente = 'https://hom1.'
372+
else:
373+
ambiente = 'https://hom.'
371374

372375
self.url = ambiente + NFE['AN'][consulta]
373376
return self.url
@@ -1071,15 +1074,9 @@ def consulta_distribuicao(self, cnpj=None, cpf=None, chave=None, nsu=0):
10711074
return self._post(url, xml)
10721075

10731076
def _get_url_an(self, consulta):
1074-
# producao
1075-
if self._ambiente == 1:
1076-
if consulta == 'DISTRIBUICAO':
1077-
ambiente = 'https://www1.'
1078-
else:
1079-
ambiente = 'https://www.'
1080-
# homologacao
1081-
else:
1082-
ambiente = 'https://hom.'
1077+
ambiente = 'https://www1.' # produção
1078+
if self._ambiente == 2: # homologacao
1079+
ambiente = 'https://hom1.'
10831080

10841081
self.url = ambiente + CTE['AN'][consulta]
10851082
return self.url

0 commit comments

Comments
 (0)