From 2055a904f6a56e0d166eeec8467a41c2c33333b4 Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Sun, 5 Sep 2021 19:48:05 -0500 Subject: [PATCH] Add dialog for show exists in warehouse --- source/static/js/controller/products.js | 5 +++ source/static/js/ui/products.js | 47 +++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/source/static/js/controller/products.js b/source/static/js/controller/products.js index e95f6bf..6c90ab8 100644 --- a/source/static/js/controller/products.js +++ b/source/static/js/controller/products.js @@ -482,6 +482,11 @@ function cmd_show_exists_click(id, e, node){ } +function cmd_win_show_exists_close_click(id, e, node){ + $$('win_show_exists').close() +} + + //~ Add products function cmd_products_add_click(id, e, node){ $$("multi_products").setValue("product_add") diff --git a/source/static/js/ui/products.js b/source/static/js/ui/products.js index fa40ff0..d9436e7 100644 --- a/source/static/js/ui/products.js +++ b/source/static/js/ui/products.js @@ -460,3 +460,50 @@ var win_add_inventory = { $$('cmd_add_inventory_cancel').attachEvent('onItemClick', cmd_add_inventory_cancel_click) } } + + +var grid_warehouse_exists_cols = [ + { id: 'id', header: 'ID', width: 75, hidden: true}, + { id: 'warehouse', header: ['Almacen'], fillspace:true}, + { id: 'exists', header: ['Existencia'], width: 100, sort: 'int', + format: webix.i18n.numberFormat, css: 'right' }, +] + + +var grid_warehouse_exists = { + view: 'datatable', + id: 'grid_warehouse_exists', + adjust: true, + //~ footer: true, + columns: grid_warehouse_exists_cols, +} + + +var body_win_show_exists = {rows: [{maxHeight: 10}, + {cols: [ + {maxWidth: 10}, + grid_warehouse_exists, + {maxWidth: 10} + ]}, + {maxHeight: 20}, + {cols: [{}, + {view: 'button', id: 'cmd_win_show_exists_close', label: 'Cerrar', type: 'danger'}, {} + ]}, + {maxHeight: 20}, +]} + + +var win_show_exists = { + init: function(){ + webix.ui({ + view: 'window', + id: 'win_show_exists', + width: 400, + modal: true, + position: 'center', + head: 'Existencia por Almacen', + body: body_win_show_exists, + }) + $$('cmd_win_show_exists_close').attachEvent('onItemClick', cmd_win_show_exists_close_click) + } +}