From aafb2cf92a6ffc61c67acc655dd116a9afaf8776 Mon Sep 17 00:00:00 2001 From: Johny Chen Jy Date: Mon, 27 Aug 2018 14:56:58 -0300 Subject: [PATCH] DSF - xml decode and url fix (#171) * [WIP]NFS-e DSF * [WIP]NFS-e url * Update setup.py --- pytrustnfe/nfse/dsf/__init__.py | 14 +++++++------- pytrustnfe/nfse/dsf/templates/enviar.xml | 24 ++++++++---------------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/pytrustnfe/nfse/dsf/__init__.py b/pytrustnfe/nfse/dsf/__init__.py index df4ce4a..ecca317 100644 --- a/pytrustnfe/nfse/dsf/__init__.py +++ b/pytrustnfe/nfse/dsf/__init__.py @@ -20,8 +20,7 @@ def _render(certificado, method, **kwargs): if type(xml_send) != str: xml_send = etree.tostring(xml_send) - - return xml_send + return xml_send.decode() def _get_url(**kwargs): @@ -33,17 +32,18 @@ def _get_url(**kwargs): urls = { # Belém - PA - '2715': 'http://www.issdigitalbel.com.br/WsNFe2/LoteRps.jws', + '2715': 'http://www.issdigitalbel.com.br/WsNFe2/LoteRps.jws?wsdl', # Sorocaba - SP - '7145': 'http://issdigital.sorocaba.sp.gov.br/WsNFe2/LoteRps.jws', + '7145': 'http://issdigital.sorocaba.sp.gov.br/WsNFe2/LoteRps.jws?wsdl', # Teresina - PI - '1219': 'http://www.issdigitalthe.com.br/WsNFe2/LoteRps.jws', + '1219': 'http://www.issdigitalthe.com.br/WsNFe2/LoteRps.jws?wsdl', # Campinas - SP '6291': 'http://issdigital.campinas.sp.gov.br/WsNFe2/LoteRps.jws?wsdl', # Uberlandia - MG - '5403': 'http://udigital.uberlandia.mg.gov.br/WsNFe2/LoteRps.jws', + '5403': 'http://udigital.uberlandia.mg.gov.br/WsNFe2/LoteRps.jws?wsdl', # São Luis - MA - '0921': 'https://stm.semfaz.saoluis.ma.gov.br/WsNFe2/LoteRps?wsdl', + '0921': + 'http://sistemas.semfaz.saoluis.ma.gov.br/WsNFe2/LoteRps.jws?wsdl', # Campo Grande - MS '2729': 'http://issdigital.pmcg.ms.gov.br/WsNFe2/LoteRps.jws?wsdl', } diff --git a/pytrustnfe/nfse/dsf/templates/enviar.xml b/pytrustnfe/nfse/dsf/templates/enviar.xml index 7e4b178..8ced990 100644 --- a/pytrustnfe/nfse/dsf/templates/enviar.xml +++ b/pytrustnfe/nfse/dsf/templates/enviar.xml @@ -18,14 +18,12 @@ {% for rps in nfse.lista_rps -%} {{ rps.assinatura }} - {{ rps.prestador.inscricao_municipal }} - + {{ rps.prestador.inscricao_municipal }} {{ rps.prestador.razao_social }} RPS {{ rps.serie }} {{ rps.numero }} - {{ rps.data_emissao|format_datetime }} - + {{ rps.data_emissao|format_datetime }} {{ rps.situacao }} 0 @@ -34,27 +32,21 @@ {{ rps.serie_prestacao }} {{ rps.tomador.inscricao_municipal }} {{ rps.tomador.cpf_cnpj }} - {{ rps.tomador.razao_social }} - - {{ rps.tomador.tipo_logradouro }} - + {{ rps.tomador.razao_social }} + {{ rps.tomador.tipo_logradouro }} {{ rps.tomador.logradouro }} - {{ rps.tomador.numero }} - + {{ rps.tomador.numero }} {{ rps.tomador.tipo_bairro }} {{ rps.tomador.bairro }} {{ rps.tomador.cidade }} - {{ rps.tomador.cidade_descricao }} - + {{ rps.tomador.cidade_descricao }} {{ rps.tomador.cep }} {{ rps.tomador.email }} {{ rps.codigo_atividade }} {{ rps.aliquota_atividade }} {{ rps.tipo_recolhimento }} - {{ rps.municipio_prestacao }} - - {{ rps.municipio_descricao_prestacao }} - + {{ rps.municipio_prestacao }} + {{ rps.municipio_prestacao_descricao }} {{ rps.operacao }} {{ rps.tributacao }} {{ rps.valor_pis }}