Skip to content

Commit

Permalink
correções referente ao preenchimento das tags de importação e exportação
Browse files Browse the repository at this point in the history
  • Loading branch information
renatonlima committed Jul 2, 2015
1 parent 35cb2c5 commit c1b1fea
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pysped/nfe/leiaute/nfe_110.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ class II(XMLNFe):
def __init__(self):
super(II, self).__init__()
self.vBC = TagDecimal(nome='vBC' , codigo='P02', tamanho=[1, 15, 1], decimais=[0, 2, 2], raiz='//det/imposto/II')
self.vDespAdu = TagDecimal(nome='vDespAd', codigo='P03', tamanho=[1, 15, 1], decimais=[0, 2, 2], raiz='//det/imposto/II')
self.vDespAdu = TagDecimal(nome='vDespAdu', codigo='P03', tamanho=[1, 15, 1], decimais=[0, 2, 2], raiz='//det/imposto/II')
self.vII = TagDecimal(nome='vII' , codigo='P04', tamanho=[1, 15, 1], decimais=[0, 2, 2], raiz='//det/imposto/II')
self.vIOF = TagDecimal(nome='vIOF' , codigo='P05', tamanho=[1, 15, 1], decimais=[0, 2, 2], raiz='//det/imposto/II')

Expand Down
1 change: 1 addition & 0 deletions pysped/nfe/leiaute/nfe_200.py
Original file line number Diff line number Diff line change
Expand Up @@ -1802,6 +1802,7 @@ def set_xml(self, arquivo):
class Total(nfe_110.Total):
def __init__(self):
super(Total, self).__init__()
self.ICMSTot = ICMSTot()


class Entrega(nfe_110.Entrega):
Expand Down
58 changes: 50 additions & 8 deletions pysped/nfe/leiaute/nfe_310.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,53 @@
DIRNAME = os.path.dirname(__file__)


class Exporta(XMLNFe):
def __init__(self):
super(Exporta, self).__init__()
self.UFSaidaPais = TagCaracter(nome='UFSaidaPais' , codigo='ZA02', tamanho=[2, 2], raiz='//NFe/infNFe/exporta', obrigatorio=False)
self.xLocExporta = TagCaracter(nome='xLocExporta', codigo='ZA03', tamanho=[1, 60], raiz='//NFe/infNFe/exporta', obrigatorio=False)
self.xLocDespacho = TagCaracter(nome='xLocDespacho', codigo='ZA04', tamanho=[1, 60], raiz='//NFe/infNFe/exporta', obrigatorio=False)

def get_xml(self):
if not (self.UFSaidaPais.valor or self.xLocExporta.valor):
return ''

xml = XMLNFe.get_xml(self)
xml += '<exporta>'
xml += self.UFSaidaPais.xml
xml += self.xLocExporta.xml
xml += self.xLocDespacho.xml
xml += '</exporta>'
return xml

def set_xml(self, arquivo):
if self._le_xml(arquivo):
self.UFSaidaPais.xml = arquivo
self.xLocExporta.xml = arquivo
self.xLocDespacho.xml = arquivo

xml = property(get_xml, set_xml)

def get_txt(self):
if not (self.UFSaidaPais.valor or self.xLocExporta.valor):
return ''

txt = 'ZA|'
txt += self.UFSaidaPais.txt + '|'
txt += self.xLocExporta.txt + '|'
txt += self.xLocDespacho.txt + '|'
txt += '\n'
return txt

txt = property(get_txt)


class InfNFe(nfe_200.InfNFe):
def __init__(self):
super(InfNFe, self).__init__()
self.exporta = Exporta()


class Deduc(nfe_200.Deduc):
def __init__(self):
super(Deduc, self).__init__()
Expand Down Expand Up @@ -904,9 +951,9 @@ def __init__(self):
class DI(nfe_200.DI):
def __init__(self):
super(DI, self).__init__()
self.tpViaTransp = TagCaracter(nome='tpViaTransp', codigo='I23a', tamanho=[2, 2], raiz='//DI')
self.vAFRMM = TagDecimal(nome='vafrmm' , codigo='I23b', tamanho=[1, 15, 1], decimais=[0, 2, 2], raiz='//DI', obrigatorio=False)
self.tpIntermedio = TagCaracter(nome='tpIntermedio', codigo='I23c', tamanho=[2, 2], raiz='//DI')
self.tpViaTransp = TagCaracter(nome='tpViaTransp', codigo='I23a', tamanho=[1, 1], raiz='//DI')
self.vAFRMM = TagDecimal(nome='vAFRMM', codigo='I23b', tamanho=[1, 15, 1], decimais=[0, 2, 2], raiz='//DI', obrigatorio=False)
self.tpIntermedio = TagCaracter(nome='tpIntermedio', codigo='I23c', tamanho=[1, 1], raiz='//DI')
self.CNPJ = TagCaracter(nome='CNPJ' , codigo='I23d', tamanho=[14, 14], raiz='//DI', obrigatorio=False)
self.UFTerceiro = TagCaracter(nome='UFTerceiro', codigo='I23e', tamanho=[2, 2], raiz='//DI', obrigatorio=False)

Expand Down Expand Up @@ -1114,11 +1161,6 @@ def __init__(self):
super(Compra, self).__init__()


class Exporta(nfe_200.Exporta):
def __init__(self):
super(Exporta, self).__init__()


class ProcRef(nfe_200.ProcRef):
def __init__(self):
super(ProcRef, self).__init__()
Expand Down

0 comments on commit c1b1fea

Please sign in to comment.