Plantilla Nómina #173
This commit is contained in:
parent
d3419b5878
commit
d622975a89
|
@ -737,7 +737,7 @@ class LIBO(object):
|
||||||
|
|
||||||
def _comprobante(self, data):
|
def _comprobante(self, data):
|
||||||
for k, v in data.items():
|
for k, v in data.items():
|
||||||
if k in ('total', 'descuento', 'subtotal'):
|
if k.lower() in ('total', 'descuento', 'subtotal', 'totalgravado', 'totalexento'):
|
||||||
self._set_cell('{cfdi.%s}' % k, v, value=True)
|
self._set_cell('{cfdi.%s}' % k, v, value=True)
|
||||||
else:
|
else:
|
||||||
self._set_cell('{cfdi.%s}' % k, v)
|
self._set_cell('{cfdi.%s}' % k, v)
|
||||||
|
@ -750,6 +750,9 @@ class LIBO(object):
|
||||||
|
|
||||||
def _receptor(self, data):
|
def _receptor(self, data):
|
||||||
for k, v in data.items():
|
for k, v in data.items():
|
||||||
|
if k.lower() in ('salariobasecotapor', 'salariodiariointegrado'):
|
||||||
|
self._set_cell('{receptor.%s}' % k, v, value=True)
|
||||||
|
else:
|
||||||
self._set_cell('{receptor.%s}' % k, v)
|
self._set_cell('{receptor.%s}' % k, v)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -788,6 +791,7 @@ class LIBO(object):
|
||||||
col4 = []
|
col4 = []
|
||||||
col5 = []
|
col5 = []
|
||||||
col6 = []
|
col6 = []
|
||||||
|
col7 = []
|
||||||
count = len(data)-1
|
count = len(data)-1
|
||||||
for concepto in data:
|
for concepto in data:
|
||||||
key = concepto.get('noidentificacion', '')
|
key = concepto.get('noidentificacion', '')
|
||||||
|
@ -796,6 +800,7 @@ class LIBO(object):
|
||||||
cantidad = concepto['cantidad']
|
cantidad = concepto['cantidad']
|
||||||
valor_unitario = concepto['valorunitario']
|
valor_unitario = concepto['valorunitario']
|
||||||
importe = concepto['importe']
|
importe = concepto['importe']
|
||||||
|
descuento = concepto.get('descuento', 0.0)
|
||||||
if first:
|
if first:
|
||||||
first = False
|
first = False
|
||||||
cell_1 = self._set_cell('{noidentificacion}', key)
|
cell_1 = self._set_cell('{noidentificacion}', key)
|
||||||
|
@ -804,6 +809,7 @@ class LIBO(object):
|
||||||
cell_4 = self._set_cell('{cantidad}', cantidad, value=True)
|
cell_4 = self._set_cell('{cantidad}', cantidad, value=True)
|
||||||
cell_5 = self._set_cell('{valorunitario}', valor_unitario, value=True)
|
cell_5 = self._set_cell('{valorunitario}', valor_unitario, value=True)
|
||||||
cell_6 = self._set_cell('{importe}', importe, value=True)
|
cell_6 = self._set_cell('{importe}', importe, value=True)
|
||||||
|
cell_7 = self._set_cell('{descuento}', descuento, value=True)
|
||||||
if len(data) > 1:
|
if len(data) > 1:
|
||||||
row = cell_1.getCellAddress().Row + 1
|
row = cell_1.getCellAddress().Row + 1
|
||||||
self._sheet.getRows().insertByIndex(row, count)
|
self._sheet.getRows().insertByIndex(row, count)
|
||||||
|
@ -816,6 +822,7 @@ class LIBO(object):
|
||||||
col4.append((float(cantidad),))
|
col4.append((float(cantidad),))
|
||||||
col5.append((float(valor_unitario),))
|
col5.append((float(valor_unitario),))
|
||||||
col6.append((float(importe),))
|
col6.append((float(importe),))
|
||||||
|
col7.append((float(descuento),))
|
||||||
|
|
||||||
if not count:
|
if not count:
|
||||||
return
|
return
|
||||||
|
@ -955,6 +962,10 @@ class LIBO(object):
|
||||||
otrospagos = data.pop('otrospagos', [])
|
otrospagos = data.pop('otrospagos', [])
|
||||||
|
|
||||||
for k, v in data.items():
|
for k, v in data.items():
|
||||||
|
if k.lower() in ('totalpercepciones', 'totaldeducciones',
|
||||||
|
'totalotrospagos', 'subsidiocausado'):
|
||||||
|
self._set_cell('{nomina.%s}' % k, v, value=True)
|
||||||
|
else:
|
||||||
self._set_cell('{nomina.%s}' % k, v)
|
self._set_cell('{nomina.%s}' % k, v)
|
||||||
|
|
||||||
count = len(percepciones)
|
count = len(percepciones)
|
||||||
|
@ -1389,6 +1400,8 @@ def _comprobante(doc, options):
|
||||||
|
|
||||||
is_nomina = options.get('is_nomina', False)
|
is_nomina = options.get('is_nomina', False)
|
||||||
if is_nomina:
|
if is_nomina:
|
||||||
|
data['formadepago'] = options['formadepago']
|
||||||
|
data['periodicidaddepago'] = options['periodicidaddepago']
|
||||||
return data
|
return data
|
||||||
|
|
||||||
if data['version'] == '3.3':
|
if data['version'] == '3.3':
|
||||||
|
@ -1402,6 +1415,7 @@ def _comprobante(doc, options):
|
||||||
'C.P. de Expedición: {}'.format(data['lugarexpedicion'])
|
'C.P. de Expedición: {}'.format(data['lugarexpedicion'])
|
||||||
data['metododepago'] = options['metododepago']
|
data['metododepago'] = options['metododepago']
|
||||||
data['formadepago'] = options['formadepago']
|
data['formadepago'] = options['formadepago']
|
||||||
|
|
||||||
if 'condicionesdepago' in data:
|
if 'condicionesdepago' in data:
|
||||||
data['condicionesdepago'] = \
|
data['condicionesdepago'] = \
|
||||||
'Condiciones de pago: {}'.format(data['condicionesdepago'])
|
'Condiciones de pago: {}'.format(data['condicionesdepago'])
|
||||||
|
|
|
@ -6420,7 +6420,15 @@ class CfdiNomina(BaseModel):
|
||||||
if invoice.version == '3.2':
|
if invoice.version == '3.2':
|
||||||
return values
|
return values
|
||||||
|
|
||||||
values['regimenfiscal'] = invoice.regimen_fiscal
|
obj = SATRegimenes.get(SATRegimenes.key==invoice.regimen_fiscal)
|
||||||
|
values['regimenfiscal'] = str(obj)
|
||||||
|
|
||||||
|
obj = SATFormaPago.get(SATFormaPago.key==invoice.forma_pago)
|
||||||
|
values['formadepago'] = '{} ({})'.format(obj.name, obj.key)
|
||||||
|
|
||||||
|
obj = SATPeriodicidadPago.get(SATPeriodicidadPago.id==invoice.empleado.periodicidad_pago)
|
||||||
|
values['periodicidaddepago'] = '{} ({})'.format(obj.name, obj.key)
|
||||||
|
|
||||||
values['usocfdi'] = invoice.uso_cfdi
|
values['usocfdi'] = invoice.uso_cfdi
|
||||||
values['receptor'] = {}
|
values['receptor'] = {}
|
||||||
values['fechadof'] = None
|
values['fechadof'] = None
|
||||||
|
|
Loading…
Reference in New Issue