Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge from master #46

Merged
merged 11 commits into from
Sep 11, 2018
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Atenção este repositório já esta em desenvolvimento para a versão NF-e 4.00, para a versão 3.10 utilize a última [release](https://github.com/leotada/PyNFe/releases).
Atualizado para a versão 4.00 NF-e/NFC-e
-----------

Visão Geral
Expand Down
4 changes: 2 additions & 2 deletions pynfe/processamento/comunicacao.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ def _get_url(self, modelo, consulta):
# nfe Ex: https://nfe.fazenda.pr.gov.br/nfe/NFeStatusServico3
self.url = NFE[self.uf.upper()][ambiente] + NFE[self.uf.upper()][consulta]
elif modelo == 'nfce':
# PE é o unico UF que possiu NFE proprio e SVRS para NFCe
if self.uf.upper() == 'PE':
# PE e BA são as únicas UF'sque possuem NFE proprio e SVRS para NFCe
if self.uf.upper() == 'PE' or self.uf.upper() == 'BA':
self.url = NFCE['SVRS'][ambiente] + NFCE['SVRS'][consulta]
else:
# nfce Ex: https://homologacao.nfce.fazenda.pr.gov.br/nfce/NFeStatusServico3
Expand Down
10 changes: 9 additions & 1 deletion pynfe/processamento/serializacao.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,9 @@ def _serializar_nota_fiscal(self, nota_fiscal, tag_raiz='infNFe', retorna_string
Para as notas com finalidade de Ajuste ou Devolução o campo Forma de Pagamento deve ser preenchido com 90=Sem Pagamento. """
pag = etree.SubElement(raiz, 'pag')
detpag = etree.SubElement(pag, 'detPag')
if nota_fiscal.finalidade_emissao == 3 or nota_fiscal.finalidade_emissao == 4:
if nota_fiscal.finalidade_emissao == '3' or nota_fiscal.finalidade_emissao == '4':
etree.SubElement(detpag, 'tPag').text = '90'
etree.SubElement(detpag, 'vPag').text = '{:.2f}'.format(0)
else:
etree.SubElement(detpag, 'tPag').text = str(nota_fiscal.tipo_pagamento).zfill(2)
etree.SubElement(detpag, 'vPag').text = '{:.2f}'.format(nota_fiscal.totais_icms_total_nota)
Expand Down Expand Up @@ -726,6 +727,13 @@ def gerar_qrcode(self, token, csc, xml, return_qr=False):
else:
qrcode = NFCE[uf.upper()]['HTTPS'] + 'www.homologacao.' + NFCE[uf.upper()]['QR'] + url
url_chave = NFCE[uf.upper()]['HTTPS'] + 'www.homologacao.' + NFCE[uf.upper()]['URL'] + url
# BA tem comportamento distindo para qrcode e url
elif uf.upper() == 'BA':
if tpamb == '1':
qrcode = NFCE[uf.upper()]['HTTPS'] + NFCE[uf.upper()]['QR'] + url
else:
qrcode = NFCE[uf.upper()]['HOMOLOGACAO'] + NFCE[uf.upper()]['QR'] + url
url_chave = url_chave = NFCE[uf.upper()]['URL']
# AC, AM, RR, PA,
else:
if tpamb == '1':
Expand Down
19 changes: 11 additions & 8 deletions pynfe/utils/webservices.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@
'CHAVE': '',
'INUTILIZACAO': '',
'EVENTOS': '',
'QR': ''
'QR': 'sefaz.ba.gov.br/servicos/nfce/qrcode.aspx?',
'HTTPS': 'http://nfe.',
'HOMOLOGACAO': 'http://hnfe.',
'URL': 'http://hinternet.sefaz.ba.gov.br/nfce/consulta'
},
'MG': {
'STATUS': '',
Expand Down Expand Up @@ -249,14 +252,14 @@
'HOMOLOGACAO': 'http://homologacao.'
},
'GO': {
'STATUS': 'sefaz.go.gov.br/nfe/services/v2/NfeStatusServico2',
'AUTORIZACAO': 'sefaz.go.gov.br/nfe/services/v2/NfeAutorizacao',
'RECIBO': 'sefaz.go.gov.br/nfe/services/v2/NfeRetAutorizacao',
'CHAVE': 'sefaz.go.gov.br/nfe/services/v2/NfeConsulta2',
'INUTILIZACAO': 'sefaz.go.gov.br/nfe/services/v2/NfeInutilizacao2',
'EVENTOS': 'sefaz.go.gov.br/nfe/services/v2/RecepcaoEvento',
'STATUS': 'sefaz.go.gov.br/nfe/services/NFeStatusServico4?wsdl',
'AUTORIZACAO': 'sefaz.go.gov.br/nfe/services/NFeAutorizacao4?wsdl',
'RECIBO': 'sefaz.go.gov.br/nfe/services/NFeRetAutorizacao4?wsdl',
'CHAVE': 'sefaz.go.gov.br/nfe/services/NFeConsultaProtocolo4?wsdl',
'INUTILIZACAO': 'sefaz.go.gov.br/nfe/services/NFeInutilizacao4?wsdl',
'EVENTOS': 'sefaz.go.gov.br/nfe/services/NFeRecepcaoEvento4?wsdl',
'QR': 'sefaz.go.gov.br/nfeweb/sites/nfce/danfeNFCe?',
'CADASTRO': 'sefaz.go.gov.br/nfe/services/v2/CadConsultaCadastro2',
'CADASTRO': 'sefaz.go.gov.br/nfe/services/CadConsultaCadastro4?wsdl',
'HTTPS': 'http://nfe.',
'HOMOLOGACAO': 'http://homolog.'
},
Expand Down