Skip to content

Commit

Permalink
Merge 95ae715 into 8de6521
Browse files Browse the repository at this point in the history
  • Loading branch information
danimaribeiro committed Dec 6, 2018
2 parents 8de6521 + 95ae715 commit 09098da
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions pytrustnfe/nfse/bh/__init__.py
Expand Up @@ -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')


Expand Down
4 changes: 2 additions & 2 deletions pytrustnfe/nfse/bh/templates/CancelarNfse.xml
@@ -1,4 +1,4 @@
<CancelarNfseEnvio xmlns="http://www.abrasf.org.br/ABRASF/arquivos/nfse.xsd">
<CancelarNfseEnvio xmlns="http://www.abrasf.org.br/nfse.xsd">
<Pedido xmlns="http://www.abrasf.org.br/nfse.xsd">
<InfPedidoCancelamento Id="pedidoCancelamento_{{ cancelamento.numero_nfse }}">
<IdentificacaoNfse>
Expand All @@ -7,7 +7,7 @@
<InscricaoMunicipal>{{ cancelamento.inscricao_municipal }}</InscricaoMunicipal>
<CodigoMunicipio>{{ cancelamento.cidade }}</CodigoMunicipio>
</IdentificacaoNfse>
<CodigoCancelamento>1</CodigoCancelamento>
<CodigoCancelamento>2</CodigoCancelamento>
</InfPedidoCancelamento>
</Pedido>
</CancelarNfseEnvio>
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -2,7 +2,7 @@
from setuptools import setup, find_packages


VERSION = "1.0.27"
VERSION = "1.0.28"


setup(
Expand Down

0 comments on commit 09098da

Please sign in to comment.