From c6592a61bd09f64dd73fb1489d8d2e1ecdc0cea1 Mon Sep 17 00:00:00 2001 From: renato Date: Fri, 9 Sep 2016 17:22:24 -0300 Subject: [PATCH 1/9] fix campo do ICMS --- pysped/nfe/leiaute/nfe_310.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pysped/nfe/leiaute/nfe_310.py b/pysped/nfe/leiaute/nfe_310.py index 7b94aa6f..524babc8 100644 --- a/pysped/nfe/leiaute/nfe_310.py +++ b/pysped/nfe/leiaute/nfe_310.py @@ -586,8 +586,8 @@ def get_xml(self): xml += self.vICMSST.xml else: xml += self.modBC.xml - xml += self.vBC.xml xml += self.pRedBC.xml + xml += self.vBC.xml xml += self.pICMS.xml xml += self.vICMS.xml xml += self.modBCST.xml @@ -646,8 +646,8 @@ def get_xml(self): elif self.CST.valor == '70': xml += self.modBC.xml - xml += self.vBC.xml xml += self.pRedBC.xml + xml += self.vBC.xml xml += self.pICMS.xml xml += self.vICMS.xml xml += self.modBCST.xml @@ -665,8 +665,8 @@ def get_xml(self): elif self.CST.valor == '90': xml += self.modBC.xml - xml += self.vBC.xml xml += self.pRedBC.xml + xml += self.vBC.xml xml += self.pICMS.xml xml += self.vICMS.xml xml += self.modBCST.xml @@ -729,8 +729,8 @@ def get_xml(self): elif self.CSOSN.valor == '900': xml += self.modBC.xml - xml += self.vBC.xml xml += self.pRedBC.xml + xml += self.vBC.xml xml += self.pICMS.xml xml += self.vICMS.xml xml += self.modBCST.xml From ec86caaca9fa4bd8407294ff369786283c0f2936 Mon Sep 17 00:00:00 2001 From: Magno Date: Wed, 6 Jun 2018 13:28:17 -0300 Subject: [PATCH 2/9] =?UTF-8?q?[FIX]=20TAGs=20referentes=20a=20Informa?= =?UTF-8?q?=C3=A7=C3=B5es=20de=20Pagamento.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pysped/nfe/leiaute/nfe_400.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pysped/nfe/leiaute/nfe_400.py b/pysped/nfe/leiaute/nfe_400.py index c6d61ecf..dd0f0f98 100644 --- a/pysped/nfe/leiaute/nfe_400.py +++ b/pysped/nfe/leiaute/nfe_400.py @@ -934,7 +934,7 @@ class Pag(XMLNFe): def __init__(self): super(Pag, self).__init__() self.detPag = [] - self.vTroco = TagDecimal(nome='vTroco' , codigo='', tamanho=[1, 13, 1], decimais=[0, 2, 2], raiz='//pag') + self.vTroco = TagDecimal(nome='vTroco' , codigo='YA09', tamanho=[1, 13, 1], decimais=[0, 2, 2], raiz='//pag') def get_xml(self): # @@ -946,7 +946,8 @@ def get_xml(self): for d in self.detPag: xml += d.xml - xml += self.vTroco.xml + if self.vTroco.valor: + xml += self.vTroco.xml xml += '' return xml @@ -1348,7 +1349,7 @@ def set_xml(self, arquivo): self.transp.xml = arquivo self.cobr.xml = arquivo - self.pag = self.le_grupo('//NFe/infNFe/pag', Pag) + self.pag.xml = arquivo self.infAdic.xml = arquivo self.exporta.xml = arquivo From af975c0d8b9dcb8fbb9f91c5b3b7df46f593d644 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 14 Jun 2018 12:36:59 -0300 Subject: [PATCH 3/9] [FIX] corrigida algumas tags da NFe --- pysped/nfe/leiaute/nfe_400.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/pysped/nfe/leiaute/nfe_400.py b/pysped/nfe/leiaute/nfe_400.py index dd0f0f98..0e2a47e8 100644 --- a/pysped/nfe/leiaute/nfe_400.py +++ b/pysped/nfe/leiaute/nfe_400.py @@ -249,9 +249,10 @@ def get_xml(self): xml += self.pICMSST.xml xml += self.vICMSST.xml - xml += self.vBCFCPST.xml - xml += self.pFCPST.xml - xml += self.vFCPST.xml + if self.vFCP.valor: + xml += self.vBCFCPST.xml + xml += self.pFCPST.xml + xml += self.vFCPST.xml else: xml += self.modBC.xml @@ -353,8 +354,9 @@ def get_xml(self): xml += self.vICMSST.xml xml += self.vBCFCPST.xml - xml += self.pFCPST.xml - xml += self.vFCPST.xml + if self.vFCP.valor: + xml += self.pFCPST.xml + xml += self.vFCPST.xml xml += self.vICMSDeson.xml xml += self.motDesICMS.xml @@ -1043,17 +1045,17 @@ def get_xml(self): xml += self.vBC.xml xml += self.vICMS.xml xml += self.vICMSDeson.xml + if self.vFCPUFDest.valor: + xml += self.vFCPUFDest.xml + if self.vICMSUFDest.valor: + xml += self.vICMSUFDest.xml + if self.vICMSUFRemet.valor: + xml += self.vICMSUFRemet.xml xml += self.vFCP.xml xml += self.vBCST.xml xml += self.vST.xml xml += self.vFCPST.xml xml += self.vFCPSTRet.xml - if self.vICMSUFDest.valor: - xml += self.vICMSUFDest.xml - if self.vICMSUFRemet.valor: - xml += self.vICMSUFRemet.xml - if self.vFCPUFDest.valor: - xml += self.vFCPUFDest.xml xml += self.vProd.xml xml += self.vFrete.xml xml += self.vSeg.xml @@ -1075,9 +1077,9 @@ def set_xml(self, arquivo): self.vICMS.xml = arquivo self.vICMSDeson.xml = arquivo self.vFCPUFDest.xml = arquivo + self.vFCP.xml = arquivo self.vICMSUFDest.xml = arquivo self.vICMSUFRemet.xml = arquivo - self.vFCP.xml = arquivo self.vBCST.xml = arquivo self.vST.xml = arquivo self.vFCPST.xml = arquivo From e001d5830e9620b17a54a06f25245d5d0f53041e Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 14 Jun 2018 12:39:10 -0300 Subject: [PATCH 4/9] [FIX] corrigido atributo na abertura do arquivo --- pysped/nfe/processador_nfe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysped/nfe/processador_nfe.py b/pysped/nfe/processador_nfe.py index d390d77e..fca555bb 100644 --- a/pysped/nfe/processador_nfe.py +++ b/pysped/nfe/processador_nfe.py @@ -497,7 +497,7 @@ def enviar_lote(self, numero_lote=None, lista_nfes=[]): arq.write(n.xml) arq.close - arq = open(self.caminho + str(envio.idLote.valor).strip().rjust(15, '0') + '-env-lot.xml', 'w') + arq = open(self.caminho + str(envio.idLote.valor).strip().rjust(15, '0') + '-env-lot.xml', 'w', encoding='utf-8') arq.write(envio.xml) arq.close() From a5fdd7ee4d0cdd9c1816ad4c43195021bce9c142 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 14 Jun 2018 18:13:22 -0300 Subject: [PATCH 5/9] [FIX] tag ICMS 70 --- pysped/nfe/leiaute/nfe_400.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysped/nfe/leiaute/nfe_400.py b/pysped/nfe/leiaute/nfe_400.py index 0e2a47e8..05ce8299 100644 --- a/pysped/nfe/leiaute/nfe_400.py +++ b/pysped/nfe/leiaute/nfe_400.py @@ -353,8 +353,8 @@ def get_xml(self): xml += self.pICMSST.xml xml += self.vICMSST.xml - xml += self.vBCFCPST.xml if self.vFCP.valor: + xml += self.vBCFCPST.xml xml += self.pFCPST.xml xml += self.vFCPST.xml From 678b2c332aa1b1d9473c5dc8c37a6da029a7810b Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Fri, 15 Jun 2018 10:28:23 -0300 Subject: [PATCH 6/9] [FIX] ICMS cst 70 tag --- pysped/nfe/leiaute/nfe_400.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pysped/nfe/leiaute/nfe_400.py b/pysped/nfe/leiaute/nfe_400.py index 05ce8299..58166cca 100644 --- a/pysped/nfe/leiaute/nfe_400.py +++ b/pysped/nfe/leiaute/nfe_400.py @@ -338,8 +338,8 @@ def get_xml(self): elif self.CST.valor == '70': xml += self.modBC.xml - xml += self.vBC.xml xml += self.pRedBC.xml + xml += self.vBC.xml xml += self.pICMS.xml xml += self.vICMS.xml xml += self.modBCST.xml @@ -363,8 +363,8 @@ def get_xml(self): elif self.CST.valor == '90': xml += self.modBC.xml - xml += self.vBC.xml xml += self.pRedBC.xml + xml += self.vBC.xml xml += self.pICMS.xml xml += self.vICMS.xml From dfb10b8092753f75c7d69b427af988bae9132dbd Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 20 Jun 2018 23:59:42 -0300 Subject: [PATCH 7/9] update PySPED 1.2.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0e0a9e7c..e1085ad0 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup( name = "PySPED", - version = "1.1.0", + version = "1.2.0", author = "Aristides Caldeira", author_email = 'aristides.caldeira@tauga.com.br', test_suite='tests', From eca02a7018b6b06afbbe399629edc6822842c64e Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 21 Jun 2018 13:02:21 -0300 Subject: [PATCH 8/9] [FIX] fix danfe with geraldo in python 2 --- pysped/nfe/danfe/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pysped/nfe/danfe/__init__.py b/pysped/nfe/danfe/__init__.py index b75d8939..28bc62ea 100644 --- a/pysped/nfe/danfe/__init__.py +++ b/pysped/nfe/danfe/__init__.py @@ -39,7 +39,14 @@ # # -from pysped.nfe.danfe.danfe import DANFE -#from pysped.nfe.danfe.daede import DAEDE +import sys + + +if sys.version_info.major == 2: + from pysped.nfe.danfe.danfe_geraldo import DANFE +else: + from pysped.nfe.danfe.danfe import DANFE + +from pysped.nfe.danfe.daede import DAEDE from pysped.nfe.danfe.danfce import DANFCE from pysped.nfe.danfe.danfse import DANFSE From 0706ad9b54215519cd2c826b9bd1a2adf162b0ef Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 28 Jun 2018 12:23:55 -0300 Subject: [PATCH 9/9] =?UTF-8?q?[fix]=20gera=C3=A7=C3=A3o=20da=20chave=20de?= =?UTF-8?q?=20acesso=20para=20NFe=204.00?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pysped/nfe/leiaute/nfe_110.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysped/nfe/leiaute/nfe_110.py b/pysped/nfe/leiaute/nfe_110.py index fb238975..814c28e8 100644 --- a/pysped/nfe/leiaute/nfe_110.py +++ b/pysped/nfe/leiaute/nfe_110.py @@ -4007,7 +4007,7 @@ def _calcula_dv(self, valor): def gera_nova_chave(self): chave = str(self.infNFe.ide.cUF.valor).zfill(2) - if str(self.infNFe.versao.valor) == '3.10': + if str(self.infNFe.versao.valor) in ('3.10', '4.00'): chave += str(self.infNFe.ide.dhEmi.valor.strftime('%y%m')).zfill(4) else: