diff --git a/pytrustnfe/nfse/bh/__init__.py b/pytrustnfe/nfse/bh/__init__.py index 21156254..2172d4aa 100644 --- a/pytrustnfe/nfse/bh/__init__.py +++ b/pytrustnfe/nfse/bh/__init__.py @@ -17,15 +17,17 @@ def _render(certificado, method, **kwargs): xml_send = render_xml(path, '%s.xml' % method, True, **kwargs) reference = '' + ref_lote = '' if method == 'GerarNfse': reference = 'rps:%s' % kwargs['rps']['numero'] ref_lote = 'lote%s' % kwargs['rps']['numero_lote'] elif method == 'CancelarNfse': - reference = 'Cancelamento_NF%s' % kwargs['cancelamento']['numero_nfse'] + reference = 'pedidoCancelamento_%s' % kwargs['cancelamento']['numero_nfse'] signer = Assinatura(certificado.pfx, certificado.password) xml_send = signer.assina_xml(xml_send, reference) - xml_send = signer.assina_xml(etree.fromstring(xml_send), ref_lote) + if ref_lote: + xml_send = signer.assina_xml(etree.fromstring(xml_send), ref_lote) return xml_send.encode('utf-8') diff --git a/pytrustnfe/nfse/bh/templates/CancelarNfse.xml b/pytrustnfe/nfse/bh/templates/CancelarNfse.xml index 137897e6..764ab18b 100644 --- a/pytrustnfe/nfse/bh/templates/CancelarNfse.xml +++ b/pytrustnfe/nfse/bh/templates/CancelarNfse.xml @@ -1,4 +1,4 @@ - + @@ -7,7 +7,7 @@ {{ cancelamento.inscricao_municipal }} {{ cancelamento.cidade }} - 1 + 2 diff --git a/setup.py b/setup.py index 72e449b6..a18369c4 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages -VERSION = "1.0.27" +VERSION = "1.0.28" setup(