forked from elmau/empresa-libre
Merge branch 'develop'
Quitar namespace de Nómina cuando no se usa
This commit is contained in:
commit
e1424e2e70
|
@ -167,7 +167,7 @@ class CFDI(object):
|
||||||
schema_edu = SAT['edu']['schema']
|
schema_edu = SAT['edu']['schema']
|
||||||
|
|
||||||
schema_nomina = ''
|
schema_nomina = ''
|
||||||
if self._nomina:
|
if self._is_nomina:
|
||||||
name = 'xmlns:{}'.format(SAT['nomina']['prefix'])
|
name = 'xmlns:{}'.format(SAT['nomina']['prefix'])
|
||||||
attributes[name] = SAT['nomina']['xmlns']
|
attributes[name] = SAT['nomina']['xmlns']
|
||||||
schema_nomina = SAT['nomina']['schema']
|
schema_nomina = SAT['nomina']['schema']
|
||||||
|
|
|
@ -3127,6 +3127,13 @@ class ImportCFDI(object):
|
||||||
self._doc = xml
|
self._doc = xml
|
||||||
self._pre = ''
|
self._pre = ''
|
||||||
|
|
||||||
|
def _relacionados(self):
|
||||||
|
data = {}
|
||||||
|
node = self._doc.find('{}CfdiRelacionados'.format(self._pre))
|
||||||
|
if not node is None:
|
||||||
|
data = CaseInsensitiveDict(node.attrib.copy())
|
||||||
|
return data
|
||||||
|
|
||||||
def _emisor(self):
|
def _emisor(self):
|
||||||
emisor = self._doc.find('{}Emisor'.format(self._pre))
|
emisor = self._doc.find('{}Emisor'.format(self._pre))
|
||||||
data = CaseInsensitiveDict(emisor.attrib.copy())
|
data = CaseInsensitiveDict(emisor.attrib.copy())
|
||||||
|
@ -3173,12 +3180,14 @@ class ImportCFDI(object):
|
||||||
invoice.pop('sello', '')
|
invoice.pop('sello', '')
|
||||||
self._pre = PRE[invoice['version']]
|
self._pre = PRE[invoice['version']]
|
||||||
|
|
||||||
|
relacionados = self._relacionados()
|
||||||
emisor = self._emisor()
|
emisor = self._emisor()
|
||||||
receptor = self._receptor()
|
receptor = self._receptor()
|
||||||
conceptos = self._conceptos()
|
conceptos = self._conceptos()
|
||||||
impuestos = self._impuestos()
|
impuestos = self._impuestos()
|
||||||
timbre = self._timbre()
|
timbre = self._timbre()
|
||||||
|
|
||||||
|
invoice.update(relacionados)
|
||||||
invoice.update(emisor)
|
invoice.update(emisor)
|
||||||
invoice.update(receptor)
|
invoice.update(receptor)
|
||||||
invoice.update(impuestos)
|
invoice.update(impuestos)
|
||||||
|
|
|
@ -3212,6 +3212,7 @@ class Facturas(BaseModel):
|
||||||
if invoice.tipo_relacion:
|
if invoice.tipo_relacion:
|
||||||
obj = SATTipoRelacion.get(SATTipoRelacion.key==invoice.tipo_relacion)
|
obj = SATTipoRelacion.get(SATTipoRelacion.key==invoice.tipo_relacion)
|
||||||
values['tiporelacion'] = str(obj)
|
values['tiporelacion'] = str(obj)
|
||||||
|
print(values['tiporelacion'])
|
||||||
|
|
||||||
receptor = Socios.select().where(Socios.id==invoice.cliente.id).dicts()[0]
|
receptor = Socios.select().where(Socios.id==invoice.cliente.id).dicts()[0]
|
||||||
values['receptor'] = {}
|
values['receptor'] = {}
|
||||||
|
@ -4111,9 +4112,9 @@ class Facturas(BaseModel):
|
||||||
'estatus': 'Importada',
|
'estatus': 'Importada',
|
||||||
'regimen_fiscal': invoice['RegimenFiscal'],
|
'regimen_fiscal': invoice['RegimenFiscal'],
|
||||||
'pagada': True,
|
'pagada': True,
|
||||||
|
'tipo_relacion': invoice.get('TipoRelacion', '')
|
||||||
}
|
}
|
||||||
# ~ donativo = BooleanField(default=False)
|
# ~ donativo = BooleanField(default=False)
|
||||||
# ~ tipo_relacion = TextField(default='')
|
|
||||||
|
|
||||||
conceptos = []
|
conceptos = []
|
||||||
for concepto in data['conceptos']:
|
for concepto in data['conceptos']:
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue