Skip to content

Commit

Permalink
Correções na emissão de nota fiscal
Browse files Browse the repository at this point in the history
  • Loading branch information
martini97 committed Oct 10, 2016
1 parent 8cd61d3 commit 482480f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions pytrustnfe/nfe/assinatura.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def assina_xml(self, xml_element, reference):
digest_algorithm='sha1',
c14n_algorithm='http://www.w3.org/TR/2001/REC-xml-c14n-20010315')

ns = {}
ns[None] = signer.namespaces['ds']
signer.namespaces = ns

signed_root = signer.sign(
xml_element, key=key, cert=cert,
reference_uri=('#%s' % reference))
Expand Down
5 changes: 4 additions & 1 deletion pytrustnfe/nfe/templates/NfeAutorizacao.xml
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,17 @@
</autXML>
{% endfor %}
{% endif %}
{% set count = 1 %}
{% for det in NFe.infNFe.detalhes %}
<det nItem="1">
<det nItem="{{ count }}">
<prod>
{% with prod = det.prod %}
<cProd>{{ prod.cProd }}</cProd>
<cEAN>{{ prod.cEAN }}</cEAN>
<xProd>{{ prod.xProd }}</xProd>
<NCM>{{ prod.NCM }}</NCM>
<NVE>{{ prod.NVE }}</NVE>
<CEST>{{ prod.CEST }}</CEST>
<EXTIPI>{{ prod.EXTIPI }}</EXTIPI>
<CFOP>{{ prod.CFOP }}</CFOP>
<uCom>{{ prod.uCom }}</uCom>
Expand Down Expand Up @@ -611,6 +613,7 @@
{% if det.infAdProd %}
<infAdProd>{{ det.infAdProd }}<infAdProd>
{% endif %}
{% set count = count + 1 %}
</det>
{% endfor %}
<total>
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="PyTrustNFe",
version="0.1.3",
version="0.1.4",
author="Danimar Ribeiro",
author_email='[email protected]',
keywords=['nfe', 'mdf-e'],
Expand Down

0 comments on commit 482480f

Please sign in to comment.