From 5a85580ba4c11e1b6cf05ba1a20799f2c8c20768 Mon Sep 17 00:00:00 2001 From: Danimar Ribeiro Date: Fri, 15 Dec 2017 16:30:49 -0200 Subject: [PATCH] [WIP] - NFSE Floripa --- pytrustnfe/nfse/floripa/__init__.py | 12 +++++++++++- pytrustnfe/nfse/floripa/templates/processar_nota.xml | 4 ++-- setup.py | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pytrustnfe/nfse/floripa/__init__.py b/pytrustnfe/nfse/floripa/__init__.py index 9c13bcb..7dceb10 100644 --- a/pytrustnfe/nfse/floripa/__init__.py +++ b/pytrustnfe/nfse/floripa/__init__.py @@ -54,7 +54,7 @@ def _send(certificado, method, **kwargs): else: url = 'https://nfps-e-hml.pmf.sc.gov.br/api/v1/processamento/notas/processa' - xml_send = '' + kwargs['xml'] + xml_send = kwargs['xml'] base = dict( ambiente='homologacao', client_id="trustcode-tecnologia-client", @@ -91,6 +91,16 @@ def processar_nota(certificado, **kwargs): return _send(certificado, 'processar_nota', **kwargs) +def xml_cancelar_nota(certificado, **kwargs): + return _render(certificado, 'cancelar_nota', **kwargs) + + +def cancelar_nota(certificado, **kwargs): + if "xml" not in kwargs: + kwargs['xml'] = xml_cancelar_nota(certificado, **kwargs) + return _send(certificado, 'cancelar_nota', **kwargs) + + def consultar_nota(certificado, **kwargs): url = "https://nfps-e-hml.pmf.sc.gov.br/api/v1/consultas/notas/numero/%s" % (kwargs["numero"]) url = 'https://nfps-e-hml.pmf.sc.gov.br/api/v1/consultas/notas/prestador/24158233000185?pagina=1' diff --git a/pytrustnfe/nfse/floripa/templates/processar_nota.xml b/pytrustnfe/nfse/floripa/templates/processar_nota.xml index 7a31ae3..08a7a2e 100644 --- a/pytrustnfe/nfse/floripa/templates/processar_nota.xml +++ b/pytrustnfe/nfse/floripa/templates/processar_nota.xml @@ -34,7 +34,7 @@ {{ rps.tomador.razao_social }} {{ rps.tomador.telefone }} {{ rps.tomador.uf }} - {{rps.valor_iss }} + {{rps.valor_issqn }} 0.0 - {{ rps.valor_liquido_nfse }} + {{ rps.valor_total }} diff --git a/setup.py b/setup.py index a1add7c..2ebafd0 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,7 @@ later (LGPLv2+)', 'nfse/simpliss/templates/*xml', 'nfse/betha/templates/*xml', 'nfse/susesu/templates/*xml', + 'nfse/floripa/templates/*xml', 'xml/schemas/*xsd', ]}, url='https://github.com/danimaribeiro/PyTrustNFe',