Can select month in global invoice
This commit is contained in:
parent
f3d827364b
commit
0826b0cea2
|
@ -149,7 +149,9 @@ function configuracion_inicial_ticket_to_invoice(){
|
|||
var grid = $$('grid_tickets_active')
|
||||
var gridt = $$('grid_tickets_invoice')
|
||||
var form = $$('form_ticket_invoice')
|
||||
var chk = $$('chk_is_invoice_day')
|
||||
|
||||
chk.setValue(false)
|
||||
get_active_tickets(grid)
|
||||
form.setValues({id_partner: 0, lbl_tclient: 'Ninguno'})
|
||||
gridt.attachEvent('onAfterAdd', function(id, index){
|
||||
|
@ -613,7 +615,12 @@ function chk_is_invoice_day_change(new_value, old_value){
|
|||
var value = Boolean(new_value)
|
||||
|
||||
show('fs_ticket_search_client', !value)
|
||||
enable('lst_periodicidad', value)
|
||||
enable('lst_global_periodicidad_2', value)
|
||||
enable('lst_global_months_2', value)
|
||||
|
||||
var current_date = new Date()
|
||||
var current_month = (current_date.getMonth() + 1).toString().padStart(2, '0')
|
||||
$$('lst_global_months_2').setValue(current_month)
|
||||
}
|
||||
|
||||
|
||||
|
@ -645,6 +652,7 @@ function save_ticket_to_invoice(data){
|
|||
if(values.ok){
|
||||
msg_ok(values.msg)
|
||||
send_timbrar_invoice(values.id)
|
||||
$$('chk_is_invoice_day').setValue(false)
|
||||
$$('multi_tickets').setValue('tickets_home')
|
||||
}else{
|
||||
msg_error(values.msg)
|
||||
|
@ -681,13 +689,26 @@ function cmd_new_invoice_from_ticket_click(){
|
|||
})
|
||||
|
||||
var data = new Object()
|
||||
data['opt'] = 'invoice'
|
||||
|
||||
data['client'] = values.id_partner
|
||||
data['tickets'] = tickets
|
||||
data['is_invoice_day'] = chk.getValue()
|
||||
data['periodicidad'] = $$('lst_periodicidad').getValue()
|
||||
data['opt'] = 'invoice'
|
||||
|
||||
msg = 'Todos los datos son correctos.<BR><BR>¿Estás seguro de generar esta factura?'
|
||||
var periodicidad = ''
|
||||
if(data['is_invoice_day']){
|
||||
periodicidad = $$('lst_global_periodicidad_2').getValue() + '|'
|
||||
periodicidad += $$('lst_global_months_2').getValue() + '|'
|
||||
periodicidad += new Date().getFullYear()
|
||||
}
|
||||
data['periodicidad'] = periodicidad
|
||||
|
||||
msg = 'Todos los datos son correctos.<BR><BR>'
|
||||
if(data['is_invoice_day']){
|
||||
msg += 'Es Factura Global.<BR><BR>'
|
||||
}
|
||||
msg += '¿Estás seguro de generar esta factura?'
|
||||
|
||||
webix.confirm({
|
||||
title: 'Generar Factura',
|
||||
ok: 'Si',
|
||||
|
|
|
@ -245,8 +245,10 @@ var opt_periodicidad = [
|
|||
var toolbar_ticket_invoice = {view: 'toolbar', elements: [{},
|
||||
{view: 'checkbox', id: 'chk_is_invoice_day', labelWidth: 0, width: 150,
|
||||
labelRight: 'Es factura del día'},
|
||||
{view: 'richselect', id: 'lst_periodicidad', labelWidth: 90, width: 250,
|
||||
label: 'Periodicidad:', options: opt_periodicidad, value: '01', disabled: true},
|
||||
{view: 'richselect', id: 'lst_global_periodicidad_2', labelWidth: 90, width: 225,
|
||||
label: 'Periodicidad:', options: opt_global_periodicidad, value: '01', disabled: true},
|
||||
{view: 'richselect', id: 'lst_global_months_2', labelWidth: 50, width: 250,
|
||||
label: 'Mes:', options: opt_global_months, value: '01', disabled: true},
|
||||
{},
|
||||
{view: 'button', id: 'cmd_close_ticket_invoice', label: 'Cerrar',
|
||||
type: 'danger', autowidth: true, align: 'center'}
|
||||
|
|
Loading…
Reference in New Issue