forked from elmau/empresa-libre
Obtener registro de nómina
This commit is contained in:
parent
069136d4c5
commit
5466726898
|
@ -2963,3 +2963,12 @@ def log_file(name, msg='', kill=False):
|
|||
line = '{} : {}\n'.format(str(now()), msg)
|
||||
fh.write(line)
|
||||
return
|
||||
|
||||
|
||||
def get_log(name):
|
||||
data = ''
|
||||
name = '{}.log'.format(name)
|
||||
path = _join(PATH_MEDIA, 'tmp', name)
|
||||
if is_file(path):
|
||||
data = open(path).read()
|
||||
return data, name
|
||||
|
|
|
@ -171,6 +171,7 @@ def get_doc(type_doc, id, rfc):
|
|||
'xml': 'application/xml',
|
||||
'ods': 'application/octet-stream',
|
||||
'zip': 'application/octet-stream',
|
||||
'nomlog': 'application/txt',
|
||||
}
|
||||
content_type = types.get(type_doc, 'application/pdf')
|
||||
if type_doc == 'xml':
|
||||
|
@ -187,6 +188,8 @@ def get_doc(type_doc, id, rfc):
|
|||
data, file_name = Tickets.get_pdf(id)
|
||||
elif type_doc == 'xmlnom':
|
||||
data, file_name = CfdiNomina.get_xml(id)
|
||||
elif type_doc == 'nomlog':
|
||||
data, file_name = util.get_log('nomina')
|
||||
|
||||
return data, file_name, content_type
|
||||
|
||||
|
@ -6018,9 +6021,9 @@ class CfdiNomina(BaseModel):
|
|||
nomina_receptor['Puesto'] = empleado.puesto.nombre
|
||||
|
||||
if empleado.clabe:
|
||||
nomina_receptor['CuentaBancaria'] = empleado.clabe
|
||||
nomina_receptor['CuentaBancaria'] = empleado.clabe.replace('-', '')
|
||||
elif empleado.cuenta_bancaria:
|
||||
nomina_receptor['CuentaBancaria'] = empleado.cuenta_bancaria
|
||||
nomina_receptor['CuentaBancaria'] = empleado.cuenta_bancaria.replace('-', '')
|
||||
nomina_receptor['Banco'] = empleado.banco.key
|
||||
|
||||
if empleado.salario_base:
|
||||
|
|
|
@ -12,6 +12,7 @@ var nomina_controllers = {
|
|||
$$('cmd_nomina_without_stamp').attachEvent('onItemClick', cmd_nomina_without_stamp_click)
|
||||
$$('cmd_nomina_delete').attachEvent('onItemClick', cmd_nomina_delete_click)
|
||||
$$('cmd_nomina_timbrar').attachEvent('onItemClick', cmd_nomina_timbrar_click)
|
||||
$$('cmd_nomina_log').attachEvent('onItemClick', cmd_nomina_log_click)
|
||||
$$('cmd_nomina_cancel').attachEvent('onItemClick', cmd_nomina_cancel_click)
|
||||
$$('grid_nomina').attachEvent('onItemClick', grid_nomina_click)
|
||||
$$('filter_year_nomina').attachEvent('onChange', filter_year_nomina_change)
|
||||
|
@ -468,4 +469,9 @@ function cancel_nomina(id){
|
|||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function cmd_nomina_log_click(){
|
||||
location = '/doc/nomlog/0'
|
||||
}
|
|
@ -18,6 +18,8 @@ var toolbar_nomina_util = [
|
|||
type: 'iconButton', autowidth: true, icon: 'ticket'},
|
||||
{view: 'button', id: 'cmd_nomina_sat', label: 'SAT',
|
||||
type: 'iconButton', autowidth: true, icon: 'check-circle'},
|
||||
{view: 'button', id: 'cmd_nomina_log', label: 'Log',
|
||||
type: 'iconButton', autowidth: true, icon: 'download'},
|
||||
{},
|
||||
{view: 'button', id: 'cmd_nomina_cancel', label: 'Cancelar',
|
||||
type: 'iconButton', autowidth: true, icon: 'ban'},
|
||||
|
|
Loading…
Reference in New Issue