diff --git a/pytrustnfe/nfe/templates/NfeAutorizacao.xml b/pytrustnfe/nfe/templates/NfeAutorizacao.xml
index feb0df0..cead740 100644
--- a/pytrustnfe/nfe/templates/NfeAutorizacao.xml
+++ b/pytrustnfe/nfe/templates/NfeAutorizacao.xml
@@ -128,32 +128,194 @@
{{ imposto.ICMS.CST }}
{% endif %}
+ {% if imposto.ICMS.CST == '201' -%}
+
+ {{ imposto.ICMS.orig }}
+ {{ imposto.ICMS.CST }}
+ {{ imposto.ICMS.modBCST }}
+ {{ imposto.ICMS.pMVAST }}
+ {{ imposto.ICMS.pRedBCST }}
+ {{ imposto.ICMS.vBCST }}
+ {{ imposto.ICMS.pICMSST }}
+ {{ imposto.ICMS.vICMSST }}
+ {{ imposto.ICMS.pCredSN }}
+ {{ imposto.ICMS.vCredICMSSN }}
+
+ {% endif %}
+ {% if imposto.ICMS.CST == '202' -%}
+
+ {{ imposto.ICMS.orig }}
+ {{ imposto.ICMS.CST }}
+ {{ imposto.ICMS.modBCST }}
+ {{ imposto.ICMS.pMVAST }}
+ {{ imposto.ICMS.pRedBCST }}
+ {{ imposto.ICMS.vBCST }}
+ {{ imposto.ICMS.pICMSST }}
+ {{ imposto.ICMS.vICMSST }}
+
+ {% endif %}
+ {% if imposto.ICMS.CST == '500' -%}
+
+ {{ imposto.ICMS.orig }}
+ {{ imposto.ICMS.CST }}
+ {{ imposto.ICMS.vBCSTRet }}
+ {{ imposto.ICMS.vICMSSTRet }}
+
+ {% endif %}
+ {% if imposto.ICMS.CST == '900' -%}
+
+ {{ imposto.ICMS.orig }}
+ {{ imposto.ICMS.CST }}
+ {{ imposto.ICMS.modBC }}
+ {{ imposto.ICMS.vBC }}
+ {{ imposto.ICMS.pRedBC }}
+ {{ imposto.ICMS.pICMS }}
+ {{ imposto.ICMS.vICMS }}
+ {{ imposto.ICMS.modBCST }}
+ {{ imposto.ICMS.pMVAST }}
+ {{ imposto.ICMS.pRedBCST }}
+ {{ imposto.ICMS.vBCST }}
+ {{ imposto.ICMS.pICMSST }}
+ {{ imposto.ICMS.vICMSST }}
+ {{ imposto.ICMS.pCredSN }}
+ {{ imposto.ICMS.vCredICMSSN }}
+
+ {% endif %}
+ {{ imposto.IPI.clEnq }}
+ {{ imposto.IPI.CNPJProd }}
+ {{ imposto.IPI.cSelo }}
+ {{ imposto.IPI.qSelo }}
{{ imposto.IPI.cEnq }}
+ {% if imposto.IPI.CST in ('00', '49', '50', '99') %}
- {{ imposto.IPI.IPITrib.CST }}
- {{ imposto.IPI.IPITrib.vBC }}
- {{ imposto.IPI.IPITrib.pIPI }}
- {{ imposto.IPI.IPITrib.vIPI }}
+ {{ imposto.IPI.CST }}
+ {{ imposto.IPI.vBC }}
+ {{ imposto.IPI.pIPI }}
+ {{ imposto.IPI.qUnid }}
+ {{ imposto.IPI.vUnid }}
+ {{ imposto.IPI.vIPI }}
+ {% endif %}
+ {% if imposto.IPI.CST in ('01', '02', '03', '04', '51', '52', '53', '54', '55') %}
+
+ {{ imposto.IPI.CST }}
+
+ {% endif %}
+ {% if imposto.II is defined %}
+
+ {{ imposto.II.vBC }}
+ {{ imposto.II.vDespAdu }}
+ {{ imposto.II.vII }}
+ {{ imposto.II.vIOF }}
+
+ {% endif %}
+ {% if imposto.PIS.CST in ('01', '02') %}
- {{ imposto.PIS.PISAliq.CST }}
- {{ imposto.PIS.PISAliq.vBC }}
- {{ imposto.PIS.PISAliq.pPIS }}
- {{ imposto.PIS.PISAliq.vPIS }}
+ {{ imposto.PIS.CST }}
+ {{ imposto.PIS.vBC }}
+ {{ imposto.PIS.pPIS }}
+ {{ imposto.PIS.vPIS }}
+ {% endif %}
+ {% if imposto.PIS.CST == '03' %}
+
+ {{ imposto.PIS.CST }}
+ {{ imposto.PIS.qBCProd }}
+ {{ imposto.PIS.vAliqProd }}
+ {{ imposto.PIS.vPIS }}
+
+ {% endif %}
+ {% if imposto.PIS.CST in ('04', '05', '05', '06', '07', '08', '09') %}
+
+ {{ imposto.PIS.CST }}
+
+ {% endif %}
+ {% if imposto.PIS.CST in ('49', '50', '51', '52', '53', '54', '55', '56', '60', '61', '62', '63', '64', '65', '66', '67', '70', '71', '72', '73', '74', '75', '98', '99') %}
+
+ {{ imposto.PIS.CST }}
+ {{ imposto.PIS.vBC }}
+ {{ imposto.PIS.pPIS }}
+ {{ imposto.PIS.qBCProd }}
+ {{ imposto.PIS.vAliqProd }}
+ {{ imposto.PIS.vPIS }}
+
+ {% endif %}
+ {% if imposto.PISST is defined %}
+
+ {{ imposto.PISST.vBC }}
+ {{ imposto.PISST.pPIS }}
+ {{ imposto.PISST.qBCProd }}
+ {{ imposto.PISST.vAliqProd }}
+ {{ imposto.PISST.vPIS }}
+
+ {% endif %}
+ {% if imposto.COFINS.CST in ('01', '02') %}
- {{ imposto.COFINS.COFINSAliq.CST }}
- {{ imposto.COFINS.COFINSAliq.vBC }}
- {{ imposto.COFINS.COFINSAliq.pCOFINS }}
- {{ imposto.COFINS.COFINSAliq.vCOFINS }}
+ {{ imposto.COFINS.CST }}
+ {{ imposto.COFINS.vBC }}
+ {{ imposto.COFINS.pCOFINS }}
+ {{ imposto.COFINS.vCOFINS }}
+ {% endif %}
+ {% if imposto.COFINS.CST == '03' %}
+
+ {{ imposto.COFINS.CST }}
+ {{ imposto.COFINS.qBCProd }}
+ {{ imposto.COFINS.vAliqProd }}
+ {{ imposto.COFINS.vCOFINS }}
+
+ {% endif %}
+ {% if imposto.COFINS.CST in ('04', '05', '05', '06', '07', '08', '09') %}
+
+ {{ imposto.COFINS.CST }}
+
+ {% endif %}
+ {% if imposto.COFINS.CST in ('49', '50', '51', '52', '53', '54', '55', '56', '60', '61', '62', '63', '64', '65', '66', '67', '70', '71', '72', '73', '74', '75', '98', '99') %}
+
+ {{ imposto.COFINS.CST }}
+ {{ imposto.COFINS.vBC }}
+ {{ imposto.COFINS.pCOFINS }}
+ {{ imposto.COFINS.qBCProd }}
+ {{ imposto.COFINS.vAliqProd }}
+ {{ imposto.COFINS.vCOFINS }}
+
+ {% endif %}
+ {% if imposto.COFINSST is defined %}
+
+ {{ imposto.COFINSST.vBC }}
+ {{ imposto.COFINSST.pCOFINS }}
+ {{ imposto.COFINSST.qBCProd }}
+ {{ imposto.COFINSST.vAliqProd }}
+ {{ imposto.COFINSST.vCOFINS }}
+
+ {% endif %}
+ {% if imposto.ISSQN is defined %}
+
+ {{ imposto.ISSQN.vBC }}
+ {{ imposto.ISSQN.vAliq }}
+ {{ imposto.ISSQN.vISSQN }}
+ {{ imposto.ISSQN.cMunFG }}
+ {{ imposto.ISSQN.cListServ }}
+ {{ imposto.ISSQN.vDeducao }}
+ {{ imposto.ISSQN.vOutro }}
+ {{ imposto.ISSQN.vDescIncond }}
+ {{ imposto.ISSQN.vDescCond }}
+ {{ imposto.ISSQN.vDeducao }}
+ {{ imposto.ISSQN.indISS }}
+ {{ imposto.ISSQN.cServico }}
+ {{ imposto.ISSQN.cMun }}
+ {{ imposto.ISSQN.cPais }}
+ {{ imposto.ISSQN.nProcesso }}
+ {{ imposto.ISSQN.vDeducao }}
+
+ {% endif %}
0.00
0.00
@@ -166,6 +328,16 @@
{% endwith %}
+ {% if det.impostoDevol is defined %}
+
+ {{ det.impostoDevol.pDevol }}
+ {{ det.impostoDevol.IPI }}
+ {{ det.impostoDevol.vIPIDevol }}
+
+ {% endif %}
+ {% if det.infAdProd %}
+ {{ det.infAdProd }}
+ {% endif %}
{% endfor %}
@@ -189,19 +361,105 @@
{{ total.vTotTrib }}
{% endwith %}
+ {% if NFe.infNFe.ISSQNtot is defined %}
+
+ {% with issqntotal = NFe.infNFe.ISSQNtot %}
+ {{ issqntotal.vServ }}
+ {{ issqntotal.vBC }}
+ {{ issqntotal.vISS }}
+ {{ issqntotal.vPIS }}
+ {{ issqntotal.vCOFINS }}
+ {{ issqntotal.dCompet }}
+ {{ issqntotal.vDeducao }}
+ {{ issqntotal.vOutro }}
+ {{ issqntotal.vDescIncond }}
+ {{ issqntotal.vDescCond }}
+ {{ issqntotal.vISSRet }}
+ {{ issqntotal.cRegTrib }}
+ {% endwith %}
+
+ {% endif %}
{{ NFe.infNFe.transp.modFrete }}
+ {% if NFe.infNFe.transp.transporta is defined %}
+
+ {{ NFe.infNFe.transp.transporta.CNPJ }}
+ {{ NFe.infNFe.transp.transporta.CPF }}
+ {{ NFe.infNFe.transp.transporta.xNome }}
+ {{ NFe.infNFe.transp.transporta.IE }}
+ {{ NFe.infNFe.transp.transporta.xEnder }}
+ {{ NFe.infNFe.transp.transporta.xMun }}
+ {{ NFe.infNFe.transp.transporta.UF }}
+
+ {% endif %}
+ {% if NFe.infNFe.transp.veicTransp is defined %}
+
+ {{ NFe.infNFe.transp.veicTransp.placa }}
+ {{ NFe.infNFe.transp.veicTransp.UF }}
+ {{ NFe.infNFe.transp.veicTransp.RNTC }}
+
+ {% endif %}
+ {% if NFe.infNFe.transp.vol is defined %}
+ {% for volume in NFe.infNFe.transp.vol %}
+
+ {{ volume.qVol }}
+ {{ volume.esp }}
+ {{ volume.marca }}
+ {{ volume.nVol }}
+ {{ volume.pesoL }}
+ {{ volume.pesoB }}
+
+ {% endfor %}
+ {% endif %}
+ {% if NFe.infNFe.transp.lacres is defined %}
+ {% for lacre in NFe.infNFe.transp.lacres %}
+
+ {{ lacre.nLacre }}
+
+ {% endfor %}
+ {% endif %}
+ {% if NFe.infNFe.cobr is defined %}
+ {% if NFe.infNFe.cobr.fat is defined %}
+
+ {{ NFe.infNFe.cobr.fat.nFat }}
+ {{ NFe.infNFe.cobr.fat.vOrig }}
+ {{ NFe.infNFe.cobr.fat.vDesc }}
+ {{ NFe.infNFe.cobr.fat.vLiq }}
+
+ {% endif %}
+ {% if NFe.infNFe.cobr.dup is defined %}
+ {% for duplicata in NFe.infNFe.cobr.dup %}
- 339/1
- 2016-06-02
- 8611.76
+ {{ duplicata.nDup }}
+ {{ duplicata.dVenc }}
+ {{ duplicata.vDup }}
+ {% endfor %}
+ {% endif %}
+ {% endif %}
+ {{ NFe.infNFe.infAdic.infAdFisco }}
{{ NFe.infNFe.infAdic.infCpl }}
+ {% if NFe.infNFe.infAdic.obsCont is defined %}
+ {% for obs in NFe.infNFe.infAdic.obsCont %}
+
+ {{ obs.xCampo }}
+ {{ obs.xTexto }}
+
+ {% endfor %}
+ {% endif %}
+ {% if NFe.infNFe.infAdic.obsFisco is defined %}
+ {% for obs in NFe.infNFe.infAdic.obsFisco %}
+
+ {{ obs.xCampo }}
+ {{ obs.xTexto }}
+
+ {% endfor %}
+ {% endif %}