Hide or show controls for warehouses

This commit is contained in:
Mauricio Baeza 2021-07-22 22:25:07 -05:00
parent f2af10c2df
commit 896be35e3b
2 changed files with 33 additions and 7 deletions

View File

@ -517,13 +517,23 @@ function get_config_values(opt){
$$('lst_pac').setValue(values[key])
}else{
$$(key).setValue(values[key])
if(key=='chk_config_leyendas_fiscales'){
const chk_obj = [
'chk_config_leyendas_fiscales',
'chk_llevar_inventario',
'chk_multi_stock',
]
if(chk_obj.indexOf(key) > 0){
admin_config_other_options(key)
}else if(key=='chk_multi_stock'){
if($$(key).getValue()){
$$('chk_multi_stock').enable()
}
}
//~ if(key=='chk_config_leyendas_fiscales'){
//~ admin_config_other_options(key)
//~ }else if(key=='chk_llevar_inventario'){
//~ admin_config_other_options(key)
//~ }else if(key=='chk_multi_stock'){
//~ if($$(key).getValue()){
//~ $$('chk_multi_stock').enable()
//~ }
//~ }
}
})
}
@ -2494,7 +2504,6 @@ function opt_make_pdf_from_on_change(new_value, old_value){
}
}
})
}
@ -2514,6 +2523,23 @@ function admin_config_other_options(id){
$$('chk_multi_stock').disable()
disable_config_option('chk_multi_stock')
}
}else if(id=='chk_multi_stock'){
set_visible_wharehouse(value)
}
}
function set_visible_wharehouse(value){
if(value){
//~ $$('template_add_wharehouse').show()
$$('txt_add_wharehouse').show()
$$('cmd_add_wharehouse').show()
$$('grid_warehouse').show()
}else{
//~ $$('template_add_wharehouse').hide()
$$('txt_add_wharehouse').hide()
$$('cmd_add_wharehouse').hide()
$$('grid_warehouse').hide()
}
}

View File

@ -800,7 +800,7 @@ var options_admin_products = [
{cols: [{maxWidth: 30}, {view: 'checkbox', id: 'chk_multi_stock', labelWidth: 15,
labelRight: 'Multialmacen', disabled: true}]},
{cols: [{maxWidth: 30}, {rows: [
{template: 'Agregar Almacen', type: 'section'},
{template: 'Agregar Almacen', type: 'section', id: 'template_add_wharehouse'},
{cols: [
{view: 'text', id: 'txt_add_wharehouse', label: 'Nombre: ',
labelPosition: 'left', required: true},