From f6b1bc990f99f8b8d41a5ea81e409ea94559e51a Mon Sep 17 00:00:00 2001 From: carcaroff Date: Thu, 9 Aug 2018 20:10:54 -0300 Subject: [PATCH] nfse_mga minor changes in singnature, removed encode for byte type response and id on cancel template is now correct --- pytrustnfe/nfse/mga/__init__.py | 2 +- pytrustnfe/nfse/mga/assinatura.py | 2 +- pytrustnfe/nfse/mga/templates/CancelarNfse.xml | 4 ++-- setup.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pytrustnfe/nfse/mga/__init__.py b/pytrustnfe/nfse/mga/__init__.py index ee0cbbc..486b009 100644 --- a/pytrustnfe/nfse/mga/__init__.py +++ b/pytrustnfe/nfse/mga/__init__.py @@ -47,7 +47,7 @@ def _send(certificado, method, **kwargs): client = Client(base_url, transport=transport) response = client.service[method](xml_send) - response, obj = sanitize_response(response.encode('utf-8')) + response, obj = sanitize_response(response) return { 'sent_xml': str(xml_send), 'received_xml': str(response), diff --git a/pytrustnfe/nfse/mga/assinatura.py b/pytrustnfe/nfse/mga/assinatura.py index 3b302fe..aaa48fd 100644 --- a/pytrustnfe/nfse/mga/assinatura.py +++ b/pytrustnfe/nfse/mga/assinatura.py @@ -34,7 +34,7 @@ class Assinatura(object): signed_root = signer.sign( element_to_be_signed, key=key.encode(), cert=cert.encode()) if reference: - element_signed = signed_root.find(".//*[@Id='%s']" % reference) + element_signed = xml_element.find(".//*[@Id='%s']" % reference) signature = signed_root.find( ".//{http://www.w3.org/2000/09/xmldsig#}Signature") diff --git a/pytrustnfe/nfse/mga/templates/CancelarNfse.xml b/pytrustnfe/nfse/mga/templates/CancelarNfse.xml index 6c95398..46cdd74 100644 --- a/pytrustnfe/nfse/mga/templates/CancelarNfse.xml +++ b/pytrustnfe/nfse/mga/templates/CancelarNfse.xml @@ -1,6 +1,6 @@ - + - + {{ cancelamento.numero_nfse }} diff --git a/setup.py b/setup.py index 9f9c851..5cebe76 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages -VERSION = "1.0.0" +VERSION = "1.0.1" setup(