Browse Source

nfse_mga minor changes in singnature, removed encode for byte type response and id on cancel template is now correct

pull/169/head
carcaroff 7 years ago
committed by Danimar Ribeiro
parent
commit
eea7fd74f4
  1. 2
      pytrustnfe/nfse/mga/__init__.py
  2. 2
      pytrustnfe/nfse/mga/assinatura.py
  3. 4
      pytrustnfe/nfse/mga/templates/CancelarNfse.xml
  4. 2
      setup.py

2
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),

2
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")

4
pytrustnfe/nfse/mga/templates/CancelarNfse.xml

@ -1,6 +1,6 @@
<CancelarNfseEnvio xmlns="http://www.abrasf.org.br/ABRASF/arquivos/nfse.xsd">
<CancelarNfseEnvio xmlns="http://www.abrasf.org.br/nfse.xsd">
<Pedido>
<InfPedidoCancelamento Id="pedidoCancelamento_{{ cancelamento.numero_nfse }}">
<InfPedidoCancelamento Id="Cancelamento_NF{{ cancelamento.numero_nfse }}">
<IdentificacaoNfse>
<Numero>{{ cancelamento.numero_nfse }}</Numero>
<CpfCnpj>

2
setup.py

@ -2,7 +2,7 @@
from setuptools import setup, find_packages
VERSION = "1.0.0"
VERSION = "1.0.1"
setup(

Loading…
Cancel
Save