Skip to content

Commit

Permalink
[FIX] Ajustando as urls de consulta da danfce
Browse files Browse the repository at this point in the history
  • Loading branch information
danimaribeiro committed Oct 3, 2018
1 parent a252d86 commit 790543d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions pytrustnfe/Servidores.py
Expand Up @@ -152,7 +152,7 @@ def localizar_qrcode(estado, ambiente=2):
WS_NFE_RECEPCAO_EVENTO: 'ws/recepcaoevento/recepcaoevento4.asmx?wsdl',
WS_NFE_AUTORIZACAO: 'ws/NfeAutorizacao/NFeAutorizacao4.asmx?wsdl',
WS_NFE_RET_AUTORIZACAO: 'ws/NfeRetAutorizacao/NFeRetAutorizacao4.asmx?wsdl', # noqa
WS_NFCE_QR_CODE: 'http://dec.fazenda.df.gov.br/ConsultarNFCe.aspx',
WS_NFCE_QR_CODE: 'http://www.fazenda.df.gov.br/nfce/qrcode',
},
AMBIENTE_HOMOLOGACAO: {
'servidor': 'nfce-homologacao.svrs.rs.gov.br',
Expand All @@ -162,7 +162,7 @@ def localizar_qrcode(estado, ambiente=2):
WS_NFE_RECEPCAO_EVENTO: 'ws/recepcaoevento/recepcaoevento4.asmx?wsdl',
WS_NFE_AUTORIZACAO: 'ws/NfeAutorizacao/NFeAutorizacao4.asmx?wsdl',
WS_NFE_RET_AUTORIZACAO: 'ws/NfeRetAutorizacao/NFeRetAutorizacao4.asmx?wsdl', # noqa
WS_NFCE_QR_CODE: 'http://dec.fazenda.df.gov.br/ConsultarNFCe.aspx',
WS_NFCE_QR_CODE: 'http://www.fazenda.df.gov.br/nfce/qrcode',
}
}
}
Expand Down
46 changes: 23 additions & 23 deletions pytrustnfe/nfe/danfce.py
Expand Up @@ -72,7 +72,7 @@ def format_telefone(telefone):

class danfce(object):

def __init__(self, list_xml, logo=None):
def __init__(self, list_xml, logo=None, timezone=None):

self.current_font_size = 7
self.current_font_name = 'NimbusSanL-Regu'
Expand Down Expand Up @@ -188,14 +188,14 @@ def totais(self, oXML=None):
# Impostos
el_total = oXML.find(".//{http://www.portalfiscal.inf.br/nfe}total")

total_tributo = format_number(tagtext(oNode=el_total, cTag='vTotTrib'),
precision=2)
valor_total = format_number(tagtext(oNode=el_total, cTag='vProd'),
precision=2)
desconto = format_number(tagtext(oNode=el_total, cTag='vDesc'),
precision=2)
valor_a_pagar = format_number(tagtext(oNode=el_total, cTag='vNF'),
precision=2)
total_tributo = format_number(
tagtext(oNode=el_total, cTag='vTotTrib'), precision=2)
valor_total = format_number(
tagtext(oNode=el_total, cTag='vProd'), precision=2)
desconto = format_number(
tagtext(oNode=el_total, cTag='vDesc'), precision=2)
valor_a_pagar = format_number(
tagtext(oNode=el_total, cTag='vNF'), precision=2)
el_pag = oXML.find(".//{http://www.portalfiscal.inf.br/nfe}pag")
troco = format_number(tagtext(oNode=el_pag, cTag="vTroco"))

Expand All @@ -216,26 +216,26 @@ def totais(self, oXML=None):
".//{http://www.portalfiscal.inf.br/nfe}det"))

payment_methods = []

for pagId, item in enumerate(el_pag):
if 'tPag' not in item.tag:
continue

payment = []
method = payment_method_list[item.text]
tipo_pagamento = tagtext(oNode=item, cTag="tPag")
val = format_number(tagtext(oNode=item, cTag="vPag"), precision=2)

method = payment_method_list[tipo_pagamento]

payment.append(method)
payment.append(format_number(item.getnext().text, precision=2))
payment.append(val)
payment_methods.append(payment)

values = {'quantidade_itens': quant_produtos,
'total_tributo': total_tributo,
'valor_total': valor_total,
'desconto': desconto,
'valor_a_pagar': valor_a_pagar,
'formas_de_pagamento': payment_methods,
'troco': troco,
}
values = {
'quantidade_itens': quant_produtos,
'total_tributo': total_tributo,
'valor_total': valor_total,
'desconto': desconto,
'valor_a_pagar': valor_a_pagar,
'formas_de_pagamento': payment_methods,
'troco': troco,
}

self.draw_totals_table(values)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -2,7 +2,7 @@
from setuptools import setup, find_packages


VERSION = "1.0.12"
VERSION = "1.0.13"


setup(
Expand Down

0 comments on commit 790543d

Please sign in to comment.