diff --git a/source/static/js/controller/admin.js b/source/static/js/controller/admin.js index f22aa1e..594da5a 100644 --- a/source/static/js/controller/admin.js +++ b/source/static/js/controller/admin.js @@ -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() } } diff --git a/source/static/js/ui/admin.js b/source/static/js/ui/admin.js index a2833e2..3d949cd 100644 --- a/source/static/js/ui/admin.js +++ b/source/static/js/ui/admin.js @@ -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},