{
- "name" : "Pman.Tab.XtupleItem",
- "parent" : "Pman.Tab.XtupleManage",
- "title" : "Pman.Tab.XtupleItem",
- "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleItem.bjs",
- "permname" : "",
- "modOrder" : "001",
- "items" : [
+ "name" : "Pman.Tab.XtupleItem",
+ "parent" : "Pman.Tab.XtupleManage",
+ "title" : "Pman.Tab.XtupleItem",
+ "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleItem.bjs",
+ "permname" : "",
+ "modOrder" : "001",
+ "strings" : {
+ "be53a0541a6d36f6ecb879fa2c584b08" : "Image",
+ "41e902bb1b2db625736ede3bacc41fe0" : "is Sold?",
+ "ce4ee01637f4279d02d0f232459dc9a4" : "Purchased",
+ "1be6f9eb563f3bf85c78b4219bf09de9" : "Brand",
+ "aa554e9e2270df2127bfe9096f1bd9ce" : "Displaying item{0} - {1} of {2}",
+ "ce5bf551379459c1c61d2a204061c455" : "Location",
+ "44ca8ce0e02dee5d520525ac21bcbee9" : "Sync Product from HK (Based on Search)",
+ "068f80c7519d0528fb08e82137a72131" : "Products",
+ "68f43fdcf074903d65da764642a4b968" : "is Active?",
+ "759d259249621c817551c5fe726d5c57" : "itemloc",
+ "89217b1527e14cced20e78111a8f5027" : "Item prodcat",
+ "e924991fc4c883bc237e69efe884d674" : "Download Sales Report",
+ "ee3585dbcb1e8f8826f3403c1e9d898c" : "Rename SKU",
+ "20b4f77bd00b4f63a49ec8e08f3bf6a6" : "Cost",
+ "fe78f3efbfa84d8485d589031596c5b8" : "Pallet",
+ "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
+ "19029645d5286771ac708d1bcd118bf4" : "Displaying itemloc{0} - {1} of {2}",
+ "1243daf593fa297e07ab03bf06d925af" : "Searching...",
+ "99a808d8d16122d70e44bd7f709d30fb" : "Balance",
+ "9a8faafb674c03474827bcb6fcde43a3" : "Search Product",
+ "f1c3ca6cadc4a9f57a08d5f7482a3f83" : "No item found",
+ "d6ea9efa48916e9563d76ddc233ebe2a" : "Sync Product from HK (New Products Only)",
+ "2cfd827c6e37453fe1ddde82a5bd9474" : "No itemloc found",
+ "d8ab3576a67fe0cc175ee77d57d0fd85" : "Pickface",
+ "5bc3fd20294c17c9803942958fd7f26d" : "Show Inactive",
+ "70cd7e06502a63356290711ec3b11223" : "Upload new products and costs",
+ "c6ca371871d835c79c8654b5cd788cc7" : "Product Group",
+ "695dbdb13fad32669a68d8fec8541c7f" : "Download Standard costs",
+ "156567f65fc207d39cadbf045687c521" : "Itemloc qty",
+ "c2f1d503b95bf9f3aa4d775a216c5c73" : "Sync Product Data from HK",
+ "36c454c4130e4444e8410f11d6d998f0" : "Tools - Upload/Download",
+ "b5a7adde1af5c87d7fd797b6245c2a39" : "Description",
+ "7fee866379427143414dd7a72e56414b" : "Report start :",
+ "a9e35d03ee7f31f5bb199379a6d3547a" : "Select Brand",
+ "35be52be39d3efcd0cd2b3721fc3c298" : "Cost (base)",
+ "750587d31c68779e7f615c190a9dc23f" : "Last purchase price",
+ "b2ee912b91d69b435159c7c3f6df7f5f" : "Number",
+ "173cf046739c17fd7c97ec3540d58807" : "(function() { return (new Date()).format('Y') + '-01-01'; })()",
+ "c20ad4d76fe97759aa27a0c99bff6710" : "12"
+ },
+ "items" : [
+ {
+ "background" : false,
+ "region" : "center",
+ "title" : "Products",
+ "xtype" : "NestedLayoutPanel",
+ "$ xns" : "Roo",
+ "items" : [
+ {
+ "xtype" : "BorderLayout",
+ "$ xns" : "Roo",
+ "* prop" : "layout",
+ "items" : [
+ {
+ "xtype" : "LayoutRegion",
+ "$ xns" : "Roo",
+ "* prop" : "center"
+ },
+ {
+ "xtype" : "LayoutRegion",
+ "$ xns" : "Roo",
+ "width" : 200,
+ "split" : true,
+ "* prop" : "east"
+ },
+ {
+ "listeners" : {
+ "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
+ },
+ "region" : "center",
+ "fitToframe" : true,
+ "background" : false,
+ "title" : "Products",
+ "xtype" : "GridPanel",
+ "fitContainer" : true,
+ "$ xns" : "Roo",
+ "tableName" : "item",
+ "items" : [
{
- "background" : false,
- "region" : "center",
- "title" : "Products",
- "xtype" : "NestedLayoutPanel",
- "$ xns" : "Roo",
- "items" : [
+ "listeners" : {
+ "celldblclick" : "function (_self, rowIndex, columnIndex, e)\n{\n var s = _this.grid.ds.getAt(rowIndex);\n \n Pman.Dialog.XtupleItem.show( { item_id : s.data.item_id } , function() {\n _this.grid.footer.onClick('first');\n }); \n}",
+ "|render" : "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}",
+ "cellclick" : "function (_self, row, col, e)\n{\n var di = _this.grid.colModel.getDataIndex(col);\n \n var rec = _this.grid.ds.getAt(row);\n \n \n if (di == 'item_active') {\n \n var nv = rec.data.item_active ? 0 : 1;\n new Pman.Request({\n mask : 'Saving',\n url : baseURL + '/Roo/Item',\n params : {\n item_id : rec.data.item_id,\n item_active : nv\n },\n success : function() {\n rec.set('item_active', nv);\n }\n });\n return;\n \n \n }\n \n if(di == 'itemsrc_active'){\n \n \n \n\n if(rec.data.itemsrc_active * 1){\n Roo.MessageBox.confirm(\"Confirm\", \"Are you sure this product is no longer purchased\",\n function (res) {\n if(res!='yes') {\n return;\n }\n rec.set('itemsrc_active', 0);\n rec.commit();\n });\n return;\n }\n \n Pman.Dialog.XtupleItem.show( { item_id : rec.data.item_id } , function() {\n _this.grid.footer.onClick('first');\n }); \n return;\n \n }\n \n _this.locgrid.footer.onClick('first');\n \n \n \n \n}",
+ "afteredit" : "function (e)\n{\n \n \n Roo.log(e);\n new Pman.Request({\n url : baseURL +'/Roo/Charass',\n params : {\n charass_char_id_char_name : e.field.replace(/^item_char_/,'').toUpperCase(),\n charass_value : e.value,\n charass_target_type : 'I',\n charass_default : 1,\n charass_target_id : e.record.data.item_id\n },\n method : 'POST'\n });\n \n \n e.record.commit();\n \n \n \n}"
+ },
+ "autoExpandColumn" : "item_descrip1",
+ "xtype" : "EditorGrid",
+ "loadMask" : true,
+ "clicksToEdit" : 1,
+ "$ xns" : "Roo.grid",
+ "* prop" : "grid",
+ "items" : [
+ {
+ "listeners" : {
+ "update" : "function (_self, record, operation)\n{\n if(operation != 'commit'){\n return;\n }\n \n var nv = record.data.itemsrc_active ? 0 : 1;\n new Pman.Request({\n mask : 'Saving',\n url : baseURL + '/Roo/Itemsrc',\n params : {\n _update_by_item : 1,\n item_id : record.data.item_id,\n itemsrc_active : nv\n },\n success : function(res) {\n record.set('itemsrc_active', nv);\n }\n });\n}",
+ "beforeload" : "function (_self, o)\n{\n o.params._with_prodcat = 1;\n o.params._with_char = 1;\n o.params._with_itemsrc_active = 1;\n o.params._with_last_purchase_price = 1;\n o.params._with_image = 1;\n var s = _this.search.getValue();\n if (s.length) {\n o.params['query[number_or_name]'] = s;\n }\n if (!_this.active.pressed) {\n o.params.item_active = 1;\n }\n if (_this.brandSel.getValue().length) {\n o.params._with_brand = _this.brandSel.getValue()\n }\n \n o.params._with_stock_balance = 1;\n}",
+ "load" : "function (_self, records, options)\n{\n\n var cm = _this.grid.getColumnModel();\n if(records.length){\n cm.setColumnHeader(cm.getIndexByDataIndex('item_stock_balance'),records[0].data.default_location_name);\n }\n}"
+ },
+ "xtype" : "Store",
+ "remoteSort" : true,
+ "$ sortInfo" : "{ field : 'item_number', direction: 'ASC' }",
+ "$ xns" : "Roo.data",
+ "* prop" : "dataSource",
+ "items" : [
+ {
+ "$ url" : "baseURL + '/Roo/item.php'",
+ "xtype" : "HttpProxy",
+ "method" : "GET",
+ "$ xns" : "Roo.data",
+ "* prop" : "proxy"
+ },
+ {
+ "id" : "id",
+ "root" : "data",
+ "xtype" : "JsonReader",
+ "$ xns" : "Roo.data",
+ "$ fields" : "[\n {\n 'name': 'item_id',\n 'type': 'int'\n },\n {\n 'name': 'item_number',\n 'type': 'string'\n },\n {\n 'name': 'item_descrip1',\n 'type': 'string'\n },\n {\n 'name': 'item_descrip2',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id',\n 'type': 'int'\n },\n {\n 'name': 'item_picklist',\n 'type': 'int'\n },\n {\n 'name': 'item_comments',\n 'type': 'string'\n },\n {\n 'name': 'item_sold',\n 'type': 'int'\n },\n {\n 'name': 'item_fractional',\n 'type': 'int'\n },\n {\n 'name': 'item_active',\n 'type': 'int'\n },\n {\n 'name': 'item_type',\n 'type': 'string'\n },\n {\n 'name': 'item_prodweight',\n 'type': 'float'\n },\n {\n 'name': 'item_packweight',\n 'type': 'float'\n },\n {\n 'name': 'item_prodcat_id',\n 'type': 'int'\n },\n {\n 'name': 'item_exclusive',\n 'type': 'int'\n },\n {\n 'name': 'item_listprice',\n 'type': 'float'\n },\n {\n 'name': 'item_config',\n 'type': 'int'\n },\n {\n 'name': 'item_extdescrip',\n 'type': 'string'\n },\n {\n 'name': 'item_upccode',\n 'type': 'string'\n },\n {\n 'name': 'item_maxcost',\n 'type': 'float'\n },\n {\n 'name': 'item_inv_uom_id',\n 'type': 'int'\n },\n {\n 'name': 'item_price_uom_id',\n 'type': 'int'\n },\n {\n 'name': 'item_warrdays',\n 'type': 'int'\n },\n {\n 'name': 'item_freightclass_id',\n 'type': 'int'\n },\n {\n 'name': 'item_tax_recoverable',\n 'type': 'int'\n },\n {\n 'name': 'item_price_uom_id_uom_id',\n 'type': 'int'\n },\n {\n 'name': 'item_price_uom_id_uom_name',\n 'type': 'string'\n },\n {\n 'name': 'item_price_uom_id_uom_descrip',\n 'type': 'string'\n },\n {\n 'name': 'item_price_uom_id_uom_item_weight',\n 'type': 'int'\n },\n {\n 'name': 'item_inv_uom_id_uom_id',\n 'type': 'int'\n },\n {\n 'name': 'item_inv_uom_id_uom_name',\n 'type': 'string'\n },\n {\n 'name': 'item_inv_uom_id_uom_descrip',\n 'type': 'string'\n },\n {\n 'name': 'item_inv_uom_id_uom_item_weight',\n 'type': 'int'\n },\n {\n 'name': 'item_freightclass_id_freightclass_id',\n 'type': 'int'\n },\n {\n 'name': 'item_freightclass_id_freightclass_code',\n 'type': 'string'\n },\n {\n 'name': 'item_freightclass_id_freightclass_descrip',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_id',\n 'type': 'int'\n },\n {\n 'name': 'item_classcode_id_classcode_code',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_descrip',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_mfg',\n 'type': 'int'\n },\n {\n 'name': 'item_classcode_id_classcode_creator',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_created',\n 'type': 'date'\n },\n {\n 'name': 'item_classcode_id_classcode_modifier',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_modified',\n 'type': 'date'\n },\n {\n 'name': 'item_classcode_id_classcode_type',\n 'type': 'string'\n }\n]",
+ "* prop" : "reader",
+ "totalProperty" : "total"
+ }
+ ]
+ },
+ {
+ "xtype" : "Toolbar",
+ "$ xns" : "Roo",
+ "* prop" : "toolbar",
+ "items" : [
+ {
+ "listeners" : {
+ "render" : "function (_self)\n{\n _this.brandSel = _self;\n}",
+ "select" : "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}"
+ },
+ "alwaysQuery" : true,
+ "listWidth" : 300,
+ "triggerAction" : "all",
+ "forceSelection" : true,
+ "selectOnFocus" : true,
+ "pageSize" : 20,
+ "displayField" : "charass_value",
+ "emptyText" : "Select Brand",
+ "minChars" : 2,
+ "xtype" : "ComboBox",
+ "allowBlank" : true,
+ "editable" : true,
+ "width" : 150,
+ "$ xns" : "Roo.form",
+ "qtip" : "Select Brand",
+ "queryParam" : "query[charass_value]",
+ "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
+ "loadingText" : "Searching...",
+ "items" : [
+ {
+ "listeners" : {
+ "|beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n // staff can see all logs, other companies can only see their own.\n // look for all of the charass 's with the same type= eg. brand.\n \n o.params.charass_char_id_char_name = 'BRAND';\n o.params.charass_target_type ='I';\n o.params._distinct = 'charass_value';\n o.params._columns = 'charass_value';\n\n}"
+ },
+ "xtype" : "Store",
+ "remoteSort" : true,
+ "$ sortInfo" : "{ field : 'charass_value' , direction : 'ASC' }",
+ "$ xns" : "Roo.data",
+ "* prop" : "store",
+ "items" : [
{
- "xtype" : "BorderLayout",
- "$ xns" : "Roo",
- "* prop" : "layout",
- "items" : [
- {
- "xtype" : "LayoutRegion",
- "$ xns" : "Roo",
- "* prop" : "center"
- },
- {
- "xtype" : "LayoutRegion",
- "width" : 200,
- "$ xns" : "Roo",
- "split" : true,
- "* prop" : "east"
- },
- {
- "listeners" : {
- "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
- },
- "fitToframe" : true,
- "background" : false,
- "region" : "center",
- "title" : "Products",
- "xtype" : "GridPanel",
- "fitContainer" : true,
- "$ xns" : "Roo",
- "tableName" : "item",
- "items" : [
- {
- "listeners" : {
- "|render" : "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}",
- "cellclick" : "function (_self, row, col, e)\n{\n var di = _this.grid.colModel.getDataIndex(col);\n \n var rec = _this.grid.ds.getAt(row);\n \n \n if (di == 'item_active') {\n \n var nv = rec.data.item_active ? 0 : 1;\n new Pman.Request({\n mask : 'Saving',\n url : baseURL + '/Roo/Item',\n params : {\n item_id : rec.data.item_id,\n item_active : nv\n },\n success : function() {\n rec.set('item_active', nv);\n }\n });\n return;\n \n \n }\n \n if(di == 'itemsrc_active'){\n \n \n \n\n if(rec.data.itemsrc_active * 1){\n Roo.MessageBox.confirm(\"Confirm\", \"Are you sure this product is no longer purchased\",\n function (res) {\n if(res!='yes') {\n return;\n }\n rec.set('itemsrc_active', 0);\n rec.commit();\n });\n return;\n }\n \n Pman.Dialog.XtupleItem.show( { item_id : rec.data.item_id } , function() {\n _this.grid.footer.onClick('first');\n }); \n return;\n \n }\n \n _this.locgrid.footer.onClick('first');\n \n \n \n \n}",
- "celldblclick" : "function (_self, rowIndex, columnIndex, e)\n{\n var s = _this.grid.ds.getAt(rowIndex);\n \n Pman.Dialog.XtupleItem.show( { item_id : s.data.item_id } , function() {\n _this.grid.footer.onClick('first');\n }); \n}",
- "afteredit" : "function (e)\n{\n \n \n Roo.log(e);\n new Pman.Request({\n url : baseURL +'/Roo/Charass',\n params : {\n charass_char_id_char_name : e.field.replace(/^item_char_/,'').toUpperCase(),\n charass_value : e.value,\n charass_target_type : 'I',\n charass_default : 1,\n charass_target_id : e.record.data.item_id\n },\n method : 'POST'\n });\n \n \n e.record.commit();\n \n \n \n}"
- },
- "autoExpandColumn" : "item_descrip1",
- "xtype" : "EditorGrid",
- "loadMask" : true,
- "clicksToEdit" : 1,
- "$ xns" : "Roo.grid",
- "* prop" : "grid",
- "items" : [
- {
- "listeners" : {
- "update" : "function (_self, record, operation)\n{\n if(operation != 'commit'){\n return;\n }\n \n var nv = record.data.itemsrc_active ? 0 : 1;\n new Pman.Request({\n mask : 'Saving',\n url : baseURL + '/Roo/Itemsrc',\n params : {\n _update_by_item : 1,\n item_id : record.data.item_id,\n itemsrc_active : nv\n },\n success : function(res) {\n record.set('itemsrc_active', nv);\n }\n });\n}",
- "beforeload" : "function (_self, o)\n{\n o.params._with_prodcat = 1;\n o.params._with_char = 1;\n o.params._with_itemsrc_active = 1;\n o.params._with_last_purchase_price = 1;\n o.params._with_image = 1;\n var s = _this.search.getValue();\n if (s.length) {\n o.params['query[number_or_name]'] = s;\n }\n if (!_this.active.pressed) {\n o.params.item_active = 1;\n }\n if (_this.brandSel.getValue().length) {\n o.params._with_brand = _this.brandSel.getValue()\n }\n \n o.params._with_stock_balance = 1;\n}",
- "load" : "function (_self, records, options)\n{\n\n var cm = _this.grid.getColumnModel();\n if(records.length){\n cm.setColumnHeader(cm.getIndexByDataIndex('item_stock_balance'),records[0].data.default_location_name);\n }\n}"
- },
- "xtype" : "Store",
- "remoteSort" : true,
- "$ sortInfo" : "{ field : 'item_number', direction: 'ASC' }",
- "$ xns" : "Roo.data",
- "* prop" : "dataSource",
- "items" : [
- {
- "$ url" : "baseURL + '/Roo/item.php'",
- "method" : "GET",
- "xtype" : "HttpProxy",
- "$ xns" : "Roo.data",
- "* prop" : "proxy"
- },
- {
- "id" : "id",
- "root" : "data",
- "xtype" : "JsonReader",
- "$ xns" : "Roo.data",
- "$ fields" : "[\n {\n 'name': 'item_id',\n 'type': 'int'\n },\n {\n 'name': 'item_number',\n 'type': 'string'\n },\n {\n 'name': 'item_descrip1',\n 'type': 'string'\n },\n {\n 'name': 'item_descrip2',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id',\n 'type': 'int'\n },\n {\n 'name': 'item_picklist',\n 'type': 'int'\n },\n {\n 'name': 'item_comments',\n 'type': 'string'\n },\n {\n 'name': 'item_sold',\n 'type': 'int'\n },\n {\n 'name': 'item_fractional',\n 'type': 'int'\n },\n {\n 'name': 'item_active',\n 'type': 'int'\n },\n {\n 'name': 'item_type',\n 'type': 'string'\n },\n {\n 'name': 'item_prodweight',\n 'type': 'float'\n },\n {\n 'name': 'item_packweight',\n 'type': 'float'\n },\n {\n 'name': 'item_prodcat_id',\n 'type': 'int'\n },\n {\n 'name': 'item_exclusive',\n 'type': 'int'\n },\n {\n 'name': 'item_listprice',\n 'type': 'float'\n },\n {\n 'name': 'item_config',\n 'type': 'int'\n },\n {\n 'name': 'item_extdescrip',\n 'type': 'string'\n },\n {\n 'name': 'item_upccode',\n 'type': 'string'\n },\n {\n 'name': 'item_maxcost',\n 'type': 'float'\n },\n {\n 'name': 'item_inv_uom_id',\n 'type': 'int'\n },\n {\n 'name': 'item_price_uom_id',\n 'type': 'int'\n },\n {\n 'name': 'item_warrdays',\n 'type': 'int'\n },\n {\n 'name': 'item_freightclass_id',\n 'type': 'int'\n },\n {\n 'name': 'item_tax_recoverable',\n 'type': 'int'\n },\n {\n 'name': 'item_price_uom_id_uom_id',\n 'type': 'int'\n },\n {\n 'name': 'item_price_uom_id_uom_name',\n 'type': 'string'\n },\n {\n 'name': 'item_price_uom_id_uom_descrip',\n 'type': 'string'\n },\n {\n 'name': 'item_price_uom_id_uom_item_weight',\n 'type': 'int'\n },\n {\n 'name': 'item_inv_uom_id_uom_id',\n 'type': 'int'\n },\n {\n 'name': 'item_inv_uom_id_uom_name',\n 'type': 'string'\n },\n {\n 'name': 'item_inv_uom_id_uom_descrip',\n 'type': 'string'\n },\n {\n 'name': 'item_inv_uom_id_uom_item_weight',\n 'type': 'int'\n },\n {\n 'name': 'item_freightclass_id_freightclass_id',\n 'type': 'int'\n },\n {\n 'name': 'item_freightclass_id_freightclass_code',\n 'type': 'string'\n },\n {\n 'name': 'item_freightclass_id_freightclass_descrip',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_id',\n 'type': 'int'\n },\n {\n 'name': 'item_classcode_id_classcode_code',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_descrip',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_mfg',\n 'type': 'int'\n },\n {\n 'name': 'item_classcode_id_classcode_creator',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_created',\n 'type': 'date'\n },\n {\n 'name': 'item_classcode_id_classcode_modifier',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_modified',\n 'type': 'date'\n },\n {\n 'name': 'item_classcode_id_classcode_type',\n 'type': 'string'\n }\n]",
- "* prop" : "reader",
- "totalProperty" : "total"
- }
- ]
- },
- {
- "xtype" : "Toolbar",
- "$ xns" : "Roo",
- "* prop" : "toolbar",
- "items" : [
- {
- "listeners" : {
- "render" : "function (_self)\n{\n _this.brandSel = _self;\n}",
- "select" : "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}"
- },
- "alwaysQuery" : true,
- "listWidth" : 300,
- "triggerAction" : "all",
- "forceSelection" : true,
- "selectOnFocus" : true,
- "pageSize" : 20,
- "displayField" : "charass_value",
- "emptyText" : "Select Brand",
- "minChars" : 2,
- "xtype" : "ComboBox",
- "allowBlank" : true,
- "editable" : true,
- "width" : 150,
- "$ xns" : "Roo.form",
- "qtip" : "Select Brand",
- "queryParam" : "query[charass_value]",
- "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
- "loadingText" : "Searching...",
- "items" : [
- {
- "listeners" : {
- "|beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n // staff can see all logs, other companies can only see their own.\n // look for all of the charass 's with the same type= eg. brand.\n \n o.params.charass_char_id_char_name = 'BRAND';\n o.params.charass_target_type ='I';\n o.params._distinct = 'charass_value';\n o.params._columns = 'charass_value';\n\n}"
- },
- "xtype" : "Store",
- "remoteSort" : true,
- "$ sortInfo" : "{ field : 'charass_value' , direction : 'ASC' }",
- "$ xns" : "Roo.data",
- "* prop" : "store",
- "items" : [
- {
- "$ url" : "baseURL + '/Roo/Charass.php'",
- "xtype" : "HttpProxy",
- "method" : "GET",
- "$ xns" : "Roo.data",
- "* prop" : "proxy"
- },
- {
- "id" : "id",
- "root" : "data",
- "xtype" : "JsonReader",
- "$ xns" : "Roo.data",
- "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'person_name',\n 'type': 'string'\n },\n {\n 'name': 'event_when',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'action',\n 'type': 'string'\n },\n {\n 'name': 'ipaddr',\n 'type': 'string'\n },\n {\n 'name': 'on_id',\n 'type': 'int'\n },\n {\n 'name': 'on_table',\n 'type': 'string'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'person_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'person_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'person_id_email',\n 'type': 'string'\n },\n {\n 'name': 'person_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_role',\n 'type': 'string'\n },\n {\n 'name': 'person_id_active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'person_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'person_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'person_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'person_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_dt',\n 'type': 'date'\n }\n]",
- "* prop" : "reader",
- "totalProperty" : "total"
- }
- ]
- }
- ]
- },
- {
- "listeners" : {
- "specialkey" : "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}",
- "render" : "function (_self)\n{\n _this.search = _self;\n}"
- },
- "emptyText" : "Search Product",
- "xtype" : "TextField",
- "$ xns" : "Roo.form"
- },
- {
- "listeners" : {
- "|click" : "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
- },
- "xtype" : "Button",
- "cls" : "x-btn-icon",
- "$ icon" : "rootURL + '/Pman/templates/images/search.gif'",
- "$ xns" : "Roo.Toolbar"
- },
- {
- "listeners" : {
- "|click" : "function (_self, e)\n{\n _this.search.setValue('');\n \n\n \n _this.grid.footer.onClick('first');\n}"
- },
- "xtype" : "Button",
- "cls" : "x-btn-icon",
- "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'",
- "$ xns" : "Roo.Toolbar"
- },
- {
- "xtype" : "Separator",
- "$ xns" : "Roo.Toolbar"
- },
- {
- "listeners" : {
- "toggle" : "function (_self, pressed)\n{\n\n this.setText(pressed ? \"Hide Inactive\" : \"Show Inactive\");\n (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}",
- "render" : "function (_self)\n{\n _this.active = _self;\n}"
- },
- "text" : "Show Inactive",
- "enableToggle" : true,
- "xtype" : "Button",
- "$ xns" : "Roo.Toolbar"
- },
- {
- "xtype" : "Fill",
- "$ xns" : "Roo.Toolbar"
- },
- {
- "listeners" : {
- "|click" : "function()\n{\n\n Pman.Dialog.XtupleItem.show( { item_id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
- },
- "text" : "Add",
- "xtype" : "Button",
- "cls" : "x-btn-text-icon",
- "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
- "$ xns" : "Roo.Toolbar"
- },
- {
- "listeners" : {
- "|click" : "function()\n{\n var s = _this.grid.selModel.getSelectedCell();\n if (!s) {\n Roo.MessageBox.alert(\"Error\", \"Select a product\");\n return;\n } \n var rec = _this.grid.ds.getAt(s[0]);\n \n var params = [];\n \n Roo.MessageBox.prompt(\n \"Rename SKU\", \n \"Warning changing SKU names affects historical data, and should only be done if you are sure that this is ok\",\n function(r,v) {\n if (r != 'ok') {\n return;\n \n }\n params = {\n _rename_sku : v,\n item_id : rec.data.item_id,\n _check : 1\n }\n\n change(params);\n \n return;\n \n \n\n }\n );\n \n var change = function(params){\n new Pman.Request({\n url : baseURL + '/Roo/Item',\n mask : \"Renaming\",\n method : 'POST',\n params : params,\n success : function(res) {\n Roo.log(res);\n _this.grid.footer.onClick('refresh');\n if(typeof(res.data) == 'string'){\n Roo.MessageBox.alert(\"Notice\", 'SKU has been renamed');\n return\n }\n var offices = [];\n Roo.each(res.data, function(o){\n offices.push(Pman.Xtuple.offices[o]);\n })\n Roo.MessageBox.alert(\"Notice\", 'SKU has been renamed in ' + offices.join(\", \"));\n \n },\n failure : function(res) {\n Roo.log(res);\n try {\n if (res.errors.confirm.length) {\n var offices = [];\n Roo.each(res.errors.confirm, function(o){\n offices.push(Pman.Xtuple.offices[o]);\n })\n Roo.MessageBox.confirm(\n \"Confirm\", \n \" Do you want to change the name in \" + offices.join(\", \") + \"?\",\n function(x) {\n if (x != 'yes') {\n Roo.MessageBox.alert(\"Notice\", 'SKU was not changed');\n return;\n }\n delete params['_check'];\n params._can_change_sku = 1;\n change(params);\n }\n );\n return;\n }\n } catch(e) { }\n Roo.MessageBox.alert(\"Error\", res.errorMsg);\n \n }\n });\n }\n \n}\n"
- },
- "text" : "Rename SKU",
- "xtype" : "Button",
- "$ xns" : "Roo.Toolbar"
- },
- {
- "xtype" : "Separator",
- "$ xns" : "Roo.Toolbar"
- },
- {
- "text" : "Report start :",
- "xtype" : "TextItem",
- "$ xns" : "Roo.Toolbar"
- },
- {
- "listeners" : {
- "render" : "function (_self)\n{\n _this.dateFrom = _self;\n}"
- },
- "format" : "d/M/Y",
- "xtype" : "DateField",
- "useIso" : true,
- "| value" : "(function() { return (new Date()).format('Y') + '-01-01'; })()",
- "$ xns" : "Roo.form"
- },
- {
- "listeners" : {
- "render" : "function (_self)\n{\n _this.datespan = _self;\n}"
- },
- "listWidth" : 200,
- "triggerAction" : "all",
- "fieldLabel" : "Status",
- "displayField" : "fname",
- "hiddenName" : "cm_status",
- "value" : 12,
- "valueField" : "ftype",
- "xtype" : "ComboBox",
- "allowBlank" : false,
- "editable" : false,
- "width" : 150,
- "$ xns" : "Roo.form",
- "mode" : "local",
- "name" : "cm_status_name",
- "items" : [
- {
- "xtype" : "SimpleStore",
- "$ data" : "[ \n [ '1', \"Single Month Sales\"],\n [ '3', \"Quarter Sales\"],\n [ '6', \"Half year Sales\"] ,\n [ '12', \"Full Year Sales\"] \n]\n",
- "$ fields" : "[ 'ftype', 'fname']",
- "$ xns" : "Roo.data",
- "* prop" : "store"
- }
- ]
- },
- {
- "listeners" : {
- "click" : "function (_self, e)\n{\n if (!_this.brandSel.getValue().length) {\n Roo.MessageBox.alert(\"Error\", \"Select a brand to download\");\n return;\n }\n\n new Pman.Download({\n url : baseURL + '/Xtuple/Reports/SalesByCountryItemYear',\n params: { \n date_from : _this.dateFrom.getValue(),\n brand : _this.brandSel.getValue(),\n span : _this.datespan.getValue()\n }\n });\n \n\n}"
- },
- "text" : "Download Sales Report",
- "xtype" : "Button",
- "$ xns" : "Roo.Toolbar"
- }
- ]
- },
- {
- "pageSize" : 25,
- "xtype" : "PagingToolbar",
- "emptyMsg" : "No item found",
- "$ xns" : "Roo",
- "displayInfo" : true,
- "displayMsg" : "Displaying item{0} - {1} of {2}",
- "* prop" : "footer",
- "items" : [
- {
- "text" : "Tools - Upload/Download",
- "xtype" : "Button",
- "$ xns" : "Roo.Toolbar",
- "items" : [
- {
- "xtype" : "Menu",
- "$ xns" : "Roo.menu",
- "* prop" : "menu",
- "items" : [
- {
- "listeners" : {
- "click" : "function (_self, e)\n{\n new Pman.Download({\n method: 'GET',\n url : baseURL + '/Roo/item',\n params : {\n _costgrid : 1\n }\n });\n}"
- },
- "text" : "Download Standard costs",
- "xtype" : "Item",
- "$ xns" : "Roo.menu"
- },
- {
- "listeners" : {
- "click" : "function (_self, e)\n{\n// Roo.MessageBox.alert(\"Disabled\", \"Can you please send Alan the test file for this - there is a problem and we need to fix it before you use this again\");\n // return;\n \n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Xtuple/Import/Products',\n timeout : 60000\n \n },\n function (data) {\n var msg = [];\n \n if (data.updated) {\n msg.push(\"Updated \" + data.updated + \" Products(s)\");\n } \n if (data.inserted) {\n msg.push(\"Added \" + data.inserted + \" Products(s)\");\n }\n if (data.skipped) {\n msg.push(\"Skipped \" + data.skipped);\n }\n \n if (!msg.length) {\n msg.push(\"No data changed\");\n }\n Roo.MessageBox.alert(\"Notice\", msg.join(\"\\n\"));\n\n }\n );\n}"
- },
- "text" : "Upload new products and costs",
- "xtype" : "Item",
- "$ xns" : "Roo.menu"
- },
- {
- "xtype" : "Separator",
- "$ xns" : "Roo.menu"
- },
- {
- "listeners" : {
- "click" : "function (_self, e)\n{\n Roo.MessageBox.progress (\"Syncing Stock\", \"Sending\");\n \n var offset = 0;\n \n function runSync() {\n \n new Pman.Request( {\n url : baseURL+'/Roo/Item',\n method : 'GET',\n timeout: 60000,\n params : {\n _syncFromHK : 1,\n offset : offset\n },\n success : function(res) {\n Roo.log(res);\n if (!res.data.total) {\n Roo.MessageBox.hide();\n return;\n }\n offset += res.data.limit;\n Roo.MessageBox.updateProgress ( offset / res.data.total, \"Done \" + offset + '/' + res.data.total);\n runSync();\n }\n \n \n });\n }\n runSync();\n}"
- },
- "text" : "Sync Product Data from HK",
- "xtype" : "Item",
- "$ xns" : "Roo.menu",
- "| hidden" : "(function() {\n\n return baseURL.match(/hk\\.php$/) ? true : false;\n})()"
- },
- {
- "listeners" : {
- "click" : "function (_self, e)\n{\n Roo.MessageBox.progress (\"Syncing Stock\", \"Sending\");\n \n var offset = 0;\n \n \n \n new Pman.Request( {\n url : baseURL+'/Roo/Item',\n method : 'GET',\n params : {\n _syncFromHK : 1,\n _new_only : 1\n },\n success : function(res) {\n Roo.log(res);\n \n Roo.MessageBox.hide();\n _this.grid.footer.onClick('refresh');\n \n \n }\n \n \n });\n \n}"
- },
- "text" : "Sync Product from HK (New Products Only)",
- "xtype" : "Item",
- "$ xns" : "Roo.menu",
- "| hidden" : "(function() {\n\n return baseURL.match(/hk\\.php$/) ? true : false;\n})()"
- },
- {
- "listeners" : {
- "click" : "function (_self, e)\n{\n Roo.MessageBox.progress (\"Syncing Stock\", \"Sending\");\n \n var offset = 0;\n \n \n \n new Pman.Request( {\n url : baseURL+'/Roo/Item',\n method : 'GET',\n params : {\n _syncFromHK : 1,\n item_number : _this.search.getValue()\n },\n success : function(res) {\n Roo.log(res);\n \n Roo.MessageBox.hide();\n _this.grid.footer.onClick('refresh');\n \n \n }\n \n \n });\n \n}"
- },
- "text" : "Sync Product from HK (Based on Search)",
- "xtype" : "Item",
- "$ xns" : "Roo.menu",
- "| hidden" : "(function() {\n\n return baseURL.match(/hk\\.php$/) ? true : false;\n})()"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "xtype" : "ColumnModel",
- "sortable" : false,
- "header" : "Image",
- "width" : 150,
- "$ renderer" : "function(v,x,r) { return String.format('<img src=\"{0}/Images/Thumb/50/{1}/{2}\" height=\"50\">', baseURL, v, r.data.item_image_filename); }",
- "$ xns" : "Roo.grid",
- "* prop" : "colModel[]",
- "dataIndex" : "item_image_id"
- },
- {
- "xtype" : "ColumnModel",
- "sortable" : true,
- "header" : "Brand",
- "width" : 100,
- "$ renderer" : "function(v) { return String.format('{0}', v); }",
- "$ xns" : "Roo.grid",
- "* prop" : "colModel[]",
- "dataIndex" : "item_char_brand",
- "items" : [
- {
- "xtype" : "GridEditor",
- "$ xns" : "Roo.grid",
- "* prop" : "editor",
- "items" : [
- {
- "alwaysQuery" : true,
- "listWidth" : 300,
- "triggerAction" : "all",
- "forceSelection" : false,
- "selectOnFocus" : true,
- "pageSize" : 20,
- "displayField" : "charass_value",
- "minChars" : 2,
- "xtype" : "ComboBox",
- "allowBlank" : true,
- "editable" : true,
- "width" : 150,
- "$ xns" : "Roo.form",
- "* prop" : "field",
- "qtip" : "Select Brand",
- "queryParam" : "query[charass_value]",
- "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
- "loadingText" : "Searching...",
- "items" : [
- {
- "listeners" : {
- "|beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n // staff can see all logs, other companies can only see their own.\n // look for all of the charass 's with the same type= eg. brand.\n \n o.params.charass_char_id_char_name = 'BRAND';\n o.params.charass_target_type ='I';\n o.params._distinct = 'charass_value';\n o.params._columns = 'charass_value';\n\n}"
- },
- "xtype" : "Store",
- "remoteSort" : true,
- "$ sortInfo" : "{ field : 'charass_value' , direction : 'ASC' }",
- "$ xns" : "Roo.data",
- "* prop" : "store",
- "items" : [
- {
- "$ url" : "baseURL + '/Roo/Charass.php'",
- "xtype" : "HttpProxy",
- "method" : "GET",
- "$ xns" : "Roo.data",
- "* prop" : "proxy"
- },
- {
- "id" : "id",
- "root" : "data",
- "xtype" : "JsonReader",
- "$ xns" : "Roo.data",
- "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'person_name',\n 'type': 'string'\n },\n {\n 'name': 'event_when',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'action',\n 'type': 'string'\n },\n {\n 'name': 'ipaddr',\n 'type': 'string'\n },\n {\n 'name': 'on_id',\n 'type': 'int'\n },\n {\n 'name': 'on_table',\n 'type': 'string'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'person_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'person_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'person_id_email',\n 'type': 'string'\n },\n {\n 'name': 'person_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_role',\n 'type': 'string'\n },\n {\n 'name': 'person_id_active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'person_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'person_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'person_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'person_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_dt',\n 'type': 'date'\n }\n]",
- "* prop" : "reader",
- "totalProperty" : "total"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "xtype" : "ColumnModel",
- "sortable" : true,
- "header" : "Product Group",
- "width" : 100,
- "$ renderer" : "function(v) { return String.format('{0}', v); }",
- "$ xns" : "Roo.grid",
- "* prop" : "colModel[]",
- "dataIndex" : "item_char_productgroup",
- "items" : [
- {
- "xtype" : "GridEditor",
- "$ xns" : "Roo.grid",
- "* prop" : "editor",
- "items" : [
- {
- "alwaysQuery" : true,
- "listWidth" : 300,
- "triggerAction" : "all",
- "forceSelection" : false,
- "selectOnFocus" : true,
- "pageSize" : 20,
- "displayField" : "charass_value",
- "minChars" : 2,
- "xtype" : "ComboBox",
- "allowBlank" : true,
- "editable" : true,
- "width" : 150,
- "$ xns" : "Roo.form",
- "* prop" : "field",
- "qtip" : "Select Brand",
- "queryParam" : "query[charass_value]",
- "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
- "loadingText" : "Searching...",
- "items" : [
- {
- "listeners" : {
- "|beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n // staff can see all logs, other companies can only see their own.\n // look for all of the charass 's with the same type= eg. brand.\n \n o.params.charass_char_id_char_name = 'PRODUCTGROUP';\n o.params.charass_target_type ='I';\n o.params._distinct = 'charass_value';\n o.params._columns = 'charass_value'; \n}"
- },
- "xtype" : "Store",
- "remoteSort" : true,
- "$ sortInfo" : "{ field : 'charass_value' , direction : 'ASC' }",
- "$ xns" : "Roo.data",
- "* prop" : "store",
- "items" : [
- {
- "$ url" : "baseURL + '/Roo/Charass.php'",
- "xtype" : "HttpProxy",
- "method" : "GET",
- "$ xns" : "Roo.data",
- "* prop" : "proxy"
- },
- {
- "id" : "id",
- "root" : "data",
- "xtype" : "JsonReader",
- "$ xns" : "Roo.data",
- "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'person_name',\n 'type': 'string'\n },\n {\n 'name': 'event_when',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'action',\n 'type': 'string'\n },\n {\n 'name': 'ipaddr',\n 'type': 'string'\n },\n {\n 'name': 'on_id',\n 'type': 'int'\n },\n {\n 'name': 'on_table',\n 'type': 'string'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'person_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'person_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'person_id_email',\n 'type': 'string'\n },\n {\n 'name': 'person_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_role',\n 'type': 'string'\n },\n {\n 'name': 'person_id_active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'person_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'person_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'person_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'person_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_dt',\n 'type': 'date'\n }\n]",
- "* prop" : "reader",
- "totalProperty" : "total"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "xtype" : "ColumnModel",
- "sortable" : true,
- "header" : "Number",
- "width" : 100,
- "$ renderer" : "function(v) { return String.format('<B>{0}</B>', v); }",
- "$ xns" : "Roo.grid",
- "* prop" : "colModel[]",
- "dataIndex" : "item_number"
- },
- {
- "xtype" : "ColumnModel",
- "sortable" : true,
- "header" : "Pickface",
- "width" : 100,
- "$ renderer" : "function(v) { return String.format('{0}', v); }",
- "$ xns" : "Roo.grid",
- "* prop" : "colModel[]",
- "dataIndex" : "item_char_pickface_location",
- "items" : [
- {
- "xtype" : "GridEditor",
- "$ xns" : "Roo.grid",
- "* prop" : "editor",
- "items" : [
- {
- "xtype" : "TextField",
- "$ xns" : "Roo.form",
- "* prop" : "field"
- }
- ]
- }
- ]
- },
- {
- "xtype" : "ColumnModel",
- "sortable" : true,
- "header" : "Pallet",
- "width" : 100,
- "$ renderer" : "function(v) { return String.format('{0}', v); }",
- "$ xns" : "Roo.grid",
- "* prop" : "colModel[]",
- "dataIndex" : "item_char_pallet_location",
- "items" : [
- {
- "xtype" : "GridEditor",
- "$ xns" : "Roo.grid",
- "* prop" : "editor",
- "items" : [
- {
- "xtype" : "TextField",
- "$ xns" : "Roo.form",
- "* prop" : "field"
- }
- ]
- }
- ]
- },
- {
- "xtype" : "ColumnModel",
- "sortable" : true,
- "header" : "Description",
- "width" : 200,
- "$ renderer" : "function(v) { return String.format('{0}', v); }",
- "$ xns" : "Roo.grid",
- "* prop" : "colModel[]",
- "dataIndex" : "item_descrip1"
- },
- {
- "xtype" : "ColumnModel",
- "sortable" : true,
- "header" : "Purchased",
- "width" : 55,
- "$ renderer" : "function(v) { \n var state = v * 1 > 0 ? '-checked' : '';\n\n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n \n }",
- "$ xns" : "Roo.grid",
- "* prop" : "colModel[]",
- "dataIndex" : "itemsrc_active"
- },
- {
- "xtype" : "ColumnModel",
- "sortable" : true,
- "header" : "is Sold?",
- "width" : 50,
- "$ renderer" : "function(v) { \n var state = v * 1 > 0 ? '-checked' : '';\n\n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n \n }",
- "$ xns" : "Roo.grid",
- "* prop" : "colModel[]",
- "dataIndex" : "item_sold"
- },
- {
- "xtype" : "ColumnModel",
- "sortable" : true,
- "header" : "is Active?",
- "width" : 50,
- "$ renderer" : "function(v) { \n var state = v * 1 > 0 ? '-checked' : '';\n\n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n \n }",
- "$ xns" : "Roo.grid",
- "* prop" : "colModel[]",
- "dataIndex" : "item_active"
- },
- {
- "align" : "right",
- "xtype" : "ColumnModel",
- "header" : "Last purchase price",
- "width" : 120,
- "$ renderer" : "function(v,x,r) {\n\n return String.format('{0}{1}', r.data.last_purchase_price_curr_name, Roo.util.Format.number(v,2)) ; \n \n }",
- "$ xns" : "Roo.grid",
- "* prop" : "colModel[]",
- "dataIndex" : "last_purchase_price"
- },
- {
- "xtype" : "ColumnModel",
- "header" : "Item prodcat",
- "width" : 100,
- "$ renderer" : "function(v,x,r) { \n return String.format('{0}/{1}', r.data.item_type, v); \n }",
- "$ xns" : "Roo.grid",
- "* prop" : "colModel[]",
- "dataIndex" : "item_prodcat_id_prodcat_code"
- },
- {
- "align" : "right",
- "xtype" : "ColumnModel",
- "header" : "Cost",
- "width" : 75,
- "$ renderer" : "function(v,x,r) {\n\n return String.format('{0}{1}', r.data.item_curr_name, Roo.util.Format.number(v,2)) ; \n \n }",
- "$ xns" : "Roo.grid",
- "* prop" : "colModel[]",
- "dataIndex" : "item_actcost"
- },
- {
- "align" : "right",
- "xtype" : "ColumnModel",
- "header" : "Cost (base)",
- "width" : 75,
- "$ renderer" : "function(v,x,r) {\n\n return String.format('{0}{1}', r.data.item_base_curr, Roo.util.Format.number(v,2)) ; \n \n }",
- "$ xns" : "Roo.grid",
- "* prop" : "colModel[]",
- "dataIndex" : "item_base_cost"
- },
- {
- "align" : "right",
- "xtype" : "ColumnModel",
- "header" : "Balance",
- "width" : 100,
- "$ renderer" : "function(v) { return String.format('{0}', v ? parseInt( v) : ''); }",
- "$ xns" : "Roo.grid",
- "* prop" : "colModel[]",
- "dataIndex" : "item_stock_balance"
- }
- ]
- }
- ]
- },
- {
- "listeners" : {
- "|activate" : "function() {\n _this.locpanel = this;\n \n}"
- },
- "fitToframe" : true,
- "background" : true,
- "region" : "east",
- "title" : "itemloc",
- "xtype" : "GridPanel",
- "fitContainer" : true,
- "$ xns" : "Roo",
- "tableName" : "itemloc",
- "items" : [
- {
- "listeners" : {
- "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n",
- "|render" : "function() \n{\n _this.locgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n \n}"
- },
- "autoExpandColumn" : "location_name",
- "xtype" : "Grid",
- "loadMask" : true,
- "$ xns" : "Roo.grid",
- "* prop" : "grid",
- "items" : [
- {
- "listeners" : {
- "beforeload" : "function (_self, o)\n{\n var sel = _this.grid.selModel.getSelectedCell();\n if (!sel) {\n this.removeAll();\n return false;\n }\n var rec = _this.grid.ds.getAt(sel[0]);\n o.params._stock_for_item_id = rec.data.item_id;\n //o.params['!itemloc_qty'] = 0;\n \n \n}"
- },
- "xtype" : "Store",
- "remoteSort" : true,
- "$ sortInfo" : "{ field : 'location_name', direction: 'ASC' }",
- "$ xns" : "Roo.data",
- "* prop" : "dataSource",
- "items" : [
- {
- "$ url" : "baseURL + '/Roo/location.php'",
- "xtype" : "HttpProxy",
- "method" : "GET",
- "$ xns" : "Roo.data",
- "* prop" : "proxy"
- },
- {
- "id" : "id",
- "root" : "data",
- "xtype" : "JsonReader",
- "$ xns" : "Roo.data",
- "$ fields" : "[\n {\n 'name': 'itemloc_id',\n 'type': 'int'\n },\n {\n 'name': 'itemloc_itemsite_id',\n 'type': 'int'\n },\n {\n 'name': 'itemloc_location_id',\n 'type': 'int'\n },\n {\n 'name': 'itemloc_qty',\n 'type': 'float'\n },\n {\n 'name': 'itemloc_expiration',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'itemloc_consolflag',\n 'type': 'int'\n },\n {\n 'name': 'itemloc_ls_id',\n 'type': 'int'\n },\n {\n 'name': 'itemloc_warrpurc',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n }\n]",
- "* prop" : "reader",
- "totalProperty" : "total"
- }
- ]
- },
- {
- "pageSize" : 25,
- "xtype" : "PagingToolbar",
- "emptyMsg" : "No itemloc found",
- "$ xns" : "Roo",
- "displayInfo" : true,
- "displayMsg" : "Displaying itemloc{0} - {1} of {2}",
- "* prop" : "footer"
- },
- {
- "xtype" : "ColumnModel",
- "header" : "Location",
- "width" : 75,
- "$ renderer" : "function(v) { return String.format('{0}', v); }",
- "$ xns" : "Roo.grid",
- "* prop" : "colModel[]",
- "dataIndex" : "location_name"
- },
- {
- "xtype" : "ColumnModel",
- "header" : "Itemloc qty",
- "width" : 75,
- "$ renderer" : "function(v) { return String.format('{0}', v*1 ? (v*1).toFixed(0) : ''); }",
- "$ xns" : "Roo.grid",
- "* prop" : "colModel[]",
- "dataIndex" : "itemloc_realqty"
- }
- ]
- }
- ]
- }
- ]
+ "$ url" : "baseURL + '/Roo/Charass.php'",
+ "method" : "GET",
+ "xtype" : "HttpProxy",
+ "$ xns" : "Roo.data",
+ "* prop" : "proxy"
+ },
+ {
+ "id" : "id",
+ "root" : "data",
+ "xtype" : "JsonReader",
+ "$ xns" : "Roo.data",
+ "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'person_name',\n 'type': 'string'\n },\n {\n 'name': 'event_when',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'action',\n 'type': 'string'\n },\n {\n 'name': 'ipaddr',\n 'type': 'string'\n },\n {\n 'name': 'on_id',\n 'type': 'int'\n },\n {\n 'name': 'on_table',\n 'type': 'string'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'person_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'person_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'person_id_email',\n 'type': 'string'\n },\n {\n 'name': 'person_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_role',\n 'type': 'string'\n },\n {\n 'name': 'person_id_active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'person_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'person_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'person_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'person_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_dt',\n 'type': 'date'\n }\n]",
+ "* prop" : "reader",
+ "totalProperty" : "total"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "listeners" : {
+ "specialkey" : "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}",
+ "render" : "function (_self)\n{\n _this.search = _self;\n}"
+ },
+ "emptyText" : "Search Product",
+ "xtype" : "TextField",
+ "$ xns" : "Roo.form"
+ },
+ {
+ "listeners" : {
+ "|click" : "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
+ },
+ "xtype" : "Button",
+ "cls" : "x-btn-icon",
+ "$ icon" : "rootURL + '/Pman/templates/images/search.gif'",
+ "$ xns" : "Roo.Toolbar"
+ },
+ {
+ "listeners" : {
+ "|click" : "function (_self, e)\n{\n _this.search.setValue('');\n \n\n \n _this.grid.footer.onClick('first');\n}"
+ },
+ "xtype" : "Button",
+ "cls" : "x-btn-icon",
+ "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'",
+ "$ xns" : "Roo.Toolbar"
+ },
+ {
+ "xtype" : "Separator",
+ "$ xns" : "Roo.Toolbar"
+ },
+ {
+ "listeners" : {
+ "toggle" : "function (_self, pressed)\n{\n\n this.setText(pressed ? \"Hide Inactive\" : \"Show Inactive\");\n (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}",
+ "render" : "function (_self)\n{\n _this.active = _self;\n}"
+ },
+ "text" : "Show Inactive",
+ "enableToggle" : true,
+ "xtype" : "Button",
+ "$ xns" : "Roo.Toolbar"
+ },
+ {
+ "xtype" : "Fill",
+ "$ xns" : "Roo.Toolbar"
+ },
+ {
+ "listeners" : {
+ "|click" : "function()\n{\n\n Pman.Dialog.XtupleItem.show( { item_id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
+ },
+ "text" : "Add",
+ "xtype" : "Button",
+ "cls" : "x-btn-text-icon",
+ "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
+ "$ xns" : "Roo.Toolbar"
+ },
+ {
+ "listeners" : {
+ "|click" : "function()\n{\n var s = _this.grid.selModel.getSelectedCell();\n if (!s) {\n Roo.MessageBox.alert(\"Error\", \"Select a product\");\n return;\n } \n var rec = _this.grid.ds.getAt(s[0]);\n \n var params = [];\n \n Roo.MessageBox.prompt(\n \"Rename SKU\", \n \"Warning changing SKU names affects historical data, and should only be done if you are sure that this is ok\",\n function(r,v) {\n if (r != 'ok') {\n return;\n \n }\n params = {\n _rename_sku : v,\n item_id : rec.data.item_id,\n _check : 1\n }\n\n change(params);\n \n return;\n \n \n\n }\n );\n \n var change = function(params){\n new Pman.Request({\n url : baseURL + '/Roo/Item',\n mask : \"Renaming\",\n method : 'POST',\n params : params,\n success : function(res) {\n Roo.log(res);\n _this.grid.footer.onClick('refresh');\n if(typeof(res.data) == 'string'){\n Roo.MessageBox.alert(\"Notice\", 'SKU has been renamed');\n return\n }\n var offices = [];\n Roo.each(res.data, function(o){\n offices.push(Pman.Xtuple.offices[o]);\n })\n Roo.MessageBox.alert(\"Notice\", 'SKU has been renamed in ' + offices.join(\", \"));\n \n },\n failure : function(res) {\n Roo.log(res);\n try {\n if (res.errors.confirm.length) {\n var offices = [];\n Roo.each(res.errors.confirm, function(o){\n offices.push(Pman.Xtuple.offices[o]);\n })\n Roo.MessageBox.confirm(\n \"Confirm\", \n \" Do you want to change the name in \" + offices.join(\", \") + \"?\",\n function(x) {\n if (x != 'yes') {\n Roo.MessageBox.alert(\"Notice\", 'SKU was not changed');\n return;\n }\n delete params['_check'];\n params._can_change_sku = 1;\n change(params);\n }\n );\n return;\n }\n } catch(e) { }\n Roo.MessageBox.alert(\"Error\", res.errorMsg);\n \n }\n });\n }\n \n}\n"
+ },
+ "text" : "Rename SKU",
+ "xtype" : "Button",
+ "$ xns" : "Roo.Toolbar"
+ },
+ {
+ "xtype" : "Separator",
+ "$ xns" : "Roo.Toolbar"
+ },
+ {
+ "text" : "Report start :",
+ "xtype" : "TextItem",
+ "$ xns" : "Roo.Toolbar"
+ },
+ {
+ "listeners" : {
+ "render" : "function (_self)\n{\n _this.dateFrom = _self;\n}"
+ },
+ "format" : "d/M/Y",
+ "useIso" : true,
+ "xtype" : "DateField",
+ "| value" : "(function() { return (new Date()).format('Y') + '-01-01'; })()",
+ "$ xns" : "Roo.form"
+ },
+ {
+ "listeners" : {
+ "render" : "function (_self)\n{\n _this.datespan = _self;\n}"
+ },
+ "listWidth" : 200,
+ "triggerAction" : "all",
+ "fieldLabel" : "Status",
+ "displayField" : "fname",
+ "hiddenName" : "cm_status",
+ "value" : 12,
+ "valueField" : "ftype",
+ "xtype" : "ComboBox",
+ "allowBlank" : false,
+ "editable" : false,
+ "width" : 150,
+ "$ xns" : "Roo.form",
+ "mode" : "local",
+ "name" : "cm_status_name",
+ "items" : [
+ {
+ "xtype" : "SimpleStore",
+ "$ data" : "[ \n [ '1', \"Single Month Sales\"],\n [ '3', \"Quarter Sales\"],\n [ '6', \"Half year Sales\"] ,\n [ '12', \"Full Year Sales\"] \n]\n",
+ "$ fields" : "[ 'ftype', 'fname']",
+ "$ xns" : "Roo.data",
+ "* prop" : "store"
+ }
+ ]
+ },
+ {
+ "listeners" : {
+ "click" : "function (_self, e)\n{\n if (!_this.brandSel.getValue().length) {\n Roo.MessageBox.alert(\"Error\", \"Select a brand to download\");\n return;\n }\n\n new Pman.Download({\n url : baseURL + '/Xtuple/Reports/SalesByCountryItemYear',\n params: { \n date_from : _this.dateFrom.getValue(),\n brand : _this.brandSel.getValue(),\n span : _this.datespan.getValue()\n }\n });\n \n\n}"
+ },
+ "text" : "Download Sales Report",
+ "xtype" : "Button",
+ "$ xns" : "Roo.Toolbar"
+ }
+ ]
+ },
+ {
+ "pageSize" : 25,
+ "xtype" : "PagingToolbar",
+ "emptyMsg" : "No item found",
+ "$ xns" : "Roo",
+ "displayInfo" : true,
+ "displayMsg" : "Displaying item{0} - {1} of {2}",
+ "* prop" : "footer",
+ "items" : [
+ {
+ "text" : "Tools - Upload/Download",
+ "xtype" : "Button",
+ "$ xns" : "Roo.Toolbar",
+ "items" : [
+ {
+ "xtype" : "Menu",
+ "$ xns" : "Roo.menu",
+ "* prop" : "menu",
+ "items" : [
+ {
+ "listeners" : {
+ "click" : "function (_self, e)\n{\n new Pman.Download({\n method: 'GET',\n url : baseURL + '/Roo/item',\n params : {\n _costgrid : 1\n }\n });\n}"
+ },
+ "text" : "Download Standard costs",
+ "xtype" : "Item",
+ "$ xns" : "Roo.menu"
+ },
+ {
+ "listeners" : {
+ "click" : "function (_self, e)\n{\n// Roo.MessageBox.alert(\"Disabled\", \"Can you please send Alan the test file for this - there is a problem and we need to fix it before you use this again\");\n // return;\n \n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Xtuple/Import/Products',\n timeout : 60000\n \n },\n function (data) {\n var msg = [];\n \n if (data.updated) {\n msg.push(\"Updated \" + data.updated + \" Products(s)\");\n } \n if (data.inserted) {\n msg.push(\"Added \" + data.inserted + \" Products(s)\");\n }\n if (data.skipped) {\n msg.push(\"Skipped \" + data.skipped);\n }\n \n if (!msg.length) {\n msg.push(\"No data changed\");\n }\n Roo.MessageBox.alert(\"Notice\", msg.join(\"\\n\"));\n\n }\n );\n}"
+ },
+ "text" : "Upload new products and costs",
+ "xtype" : "Item",
+ "$ xns" : "Roo.menu"
+ },
+ {
+ "xtype" : "Separator",
+ "$ xns" : "Roo.menu"
+ },
+ {
+ "listeners" : {
+ "click" : "function (_self, e)\n{\n Roo.MessageBox.progress (\"Syncing Stock\", \"Sending\");\n \n var offset = 0;\n \n function runSync() {\n \n new Pman.Request( {\n url : baseURL+'/Roo/Item',\n method : 'GET',\n timeout: 60000,\n params : {\n _syncFromHK : 1,\n offset : offset\n },\n success : function(res) {\n Roo.log(res);\n if (!res.data.total) {\n Roo.MessageBox.hide();\n return;\n }\n offset += res.data.limit;\n Roo.MessageBox.updateProgress ( offset / res.data.total, \"Done \" + offset + '/' + res.data.total);\n runSync();\n }\n \n \n });\n }\n runSync();\n}"
+ },
+ "text" : "Sync Product Data from HK",
+ "xtype" : "Item",
+ "$ xns" : "Roo.menu",
+ "| hidden" : "(function() {\n\n return baseURL.match(/hk\\.php$/) ? true : false;\n})()"
+ },
+ {
+ "listeners" : {
+ "click" : "function (_self, e)\n{\n Roo.MessageBox.progress (\"Syncing Stock\", \"Sending\");\n \n var offset = 0;\n \n \n \n new Pman.Request( {\n url : baseURL+'/Roo/Item',\n method : 'GET',\n params : {\n _syncFromHK : 1,\n _new_only : 1\n },\n success : function(res) {\n Roo.log(res);\n \n Roo.MessageBox.hide();\n _this.grid.footer.onClick('refresh');\n \n \n }\n \n \n });\n \n}"
+ },
+ "text" : "Sync Product from HK (New Products Only)",
+ "xtype" : "Item",
+ "$ xns" : "Roo.menu",
+ "| hidden" : "(function() {\n\n return baseURL.match(/hk\\.php$/) ? true : false;\n})()"
+ },
+ {
+ "listeners" : {
+ "click" : "function (_self, e)\n{\n Roo.MessageBox.progress (\"Syncing Stock\", \"Sending\");\n \n var offset = 0;\n \n \n \n new Pman.Request( {\n url : baseURL+'/Roo/Item',\n method : 'GET',\n params : {\n _syncFromHK : 1,\n item_number : _this.search.getValue()\n },\n success : function(res) {\n Roo.log(res);\n \n Roo.MessageBox.hide();\n _this.grid.footer.onClick('refresh');\n \n \n }\n \n \n });\n \n}"
+ },
+ "text" : "Sync Product from HK (Based on Search)",
+ "xtype" : "Item",
+ "$ xns" : "Roo.menu",
+ "| hidden" : "(function() {\n\n return baseURL.match(/hk\\.php$/) ? true : false;\n})()"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "xtype" : "ColumnModel",
+ "sortable" : false,
+ "header" : "Image",
+ "width" : 150,
+ "$ renderer" : "function(v,x,r) { return String.format('<img src=\"{0}/Images/Thumb/50/{1}/{2}\" height=\"50\">', baseURL, v, r.data.item_image_filename); }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "item_image_id"
+ },
+ {
+ "xtype" : "ColumnModel",
+ "sortable" : true,
+ "header" : "Brand",
+ "width" : 100,
+ "$ renderer" : "function(v) { return String.format('{0}', v); }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "item_char_brand",
+ "items" : [
+ {
+ "xtype" : "GridEditor",
+ "$ xns" : "Roo.grid",
+ "* prop" : "editor",
+ "items" : [
+ {
+ "alwaysQuery" : true,
+ "listWidth" : 300,
+ "triggerAction" : "all",
+ "forceSelection" : false,
+ "selectOnFocus" : true,
+ "pageSize" : 20,
+ "displayField" : "charass_value",
+ "minChars" : 2,
+ "xtype" : "ComboBox",
+ "allowBlank" : true,
+ "editable" : true,
+ "width" : 150,
+ "$ xns" : "Roo.form",
+ "* prop" : "field",
+ "qtip" : "Select Brand",
+ "queryParam" : "query[charass_value]",
+ "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
+ "loadingText" : "Searching...",
+ "items" : [
+ {
+ "listeners" : {
+ "|beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n // staff can see all logs, other companies can only see their own.\n // look for all of the charass 's with the same type= eg. brand.\n \n o.params.charass_char_id_char_name = 'BRAND';\n o.params.charass_target_type ='I';\n o.params._distinct = 'charass_value';\n o.params._columns = 'charass_value';\n\n}"
+ },
+ "xtype" : "Store",
+ "remoteSort" : true,
+ "$ sortInfo" : "{ field : 'charass_value' , direction : 'ASC' }",
+ "$ xns" : "Roo.data",
+ "* prop" : "store",
+ "items" : [
+ {
+ "$ url" : "baseURL + '/Roo/Charass.php'",
+ "method" : "GET",
+ "xtype" : "HttpProxy",
+ "$ xns" : "Roo.data",
+ "* prop" : "proxy"
+ },
+ {
+ "id" : "id",
+ "root" : "data",
+ "xtype" : "JsonReader",
+ "$ xns" : "Roo.data",
+ "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'person_name',\n 'type': 'string'\n },\n {\n 'name': 'event_when',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'action',\n 'type': 'string'\n },\n {\n 'name': 'ipaddr',\n 'type': 'string'\n },\n {\n 'name': 'on_id',\n 'type': 'int'\n },\n {\n 'name': 'on_table',\n 'type': 'string'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'person_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'person_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'person_id_email',\n 'type': 'string'\n },\n {\n 'name': 'person_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_role',\n 'type': 'string'\n },\n {\n 'name': 'person_id_active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'person_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'person_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'person_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'person_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_dt',\n 'type': 'date'\n }\n]",
+ "* prop" : "reader",
+ "totalProperty" : "total"
+ }
+ ]
}
- ]
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "xtype" : "ColumnModel",
+ "sortable" : true,
+ "header" : "Product Group",
+ "width" : 100,
+ "$ renderer" : "function(v) { return String.format('{0}', v); }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "item_char_productgroup",
+ "items" : [
+ {
+ "xtype" : "GridEditor",
+ "$ xns" : "Roo.grid",
+ "* prop" : "editor",
+ "items" : [
+ {
+ "alwaysQuery" : true,
+ "listWidth" : 300,
+ "triggerAction" : "all",
+ "forceSelection" : false,
+ "selectOnFocus" : true,
+ "pageSize" : 20,
+ "displayField" : "charass_value",
+ "minChars" : 2,
+ "xtype" : "ComboBox",
+ "allowBlank" : true,
+ "editable" : true,
+ "width" : 150,
+ "$ xns" : "Roo.form",
+ "* prop" : "field",
+ "qtip" : "Select Brand",
+ "queryParam" : "query[charass_value]",
+ "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
+ "loadingText" : "Searching...",
+ "items" : [
+ {
+ "listeners" : {
+ "|beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n // staff can see all logs, other companies can only see their own.\n // look for all of the charass 's with the same type= eg. brand.\n \n o.params.charass_char_id_char_name = 'PRODUCTGROUP';\n o.params.charass_target_type ='I';\n o.params._distinct = 'charass_value';\n o.params._columns = 'charass_value'; \n}"
+ },
+ "xtype" : "Store",
+ "remoteSort" : true,
+ "$ sortInfo" : "{ field : 'charass_value' , direction : 'ASC' }",
+ "$ xns" : "Roo.data",
+ "* prop" : "store",
+ "items" : [
+ {
+ "$ url" : "baseURL + '/Roo/Charass.php'",
+ "method" : "GET",
+ "xtype" : "HttpProxy",
+ "$ xns" : "Roo.data",
+ "* prop" : "proxy"
+ },
+ {
+ "id" : "id",
+ "root" : "data",
+ "xtype" : "JsonReader",
+ "$ xns" : "Roo.data",
+ "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'person_name',\n 'type': 'string'\n },\n {\n 'name': 'event_when',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'action',\n 'type': 'string'\n },\n {\n 'name': 'ipaddr',\n 'type': 'string'\n },\n {\n 'name': 'on_id',\n 'type': 'int'\n },\n {\n 'name': 'on_table',\n 'type': 'string'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'person_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'person_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'person_id_email',\n 'type': 'string'\n },\n {\n 'name': 'person_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_role',\n 'type': 'string'\n },\n {\n 'name': 'person_id_active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'person_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'person_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'person_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'person_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_dt',\n 'type': 'date'\n }\n]",
+ "* prop" : "reader",
+ "totalProperty" : "total"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "xtype" : "ColumnModel",
+ "sortable" : true,
+ "header" : "Number",
+ "width" : 100,
+ "$ renderer" : "function(v) { return String.format('<B>{0}</B>', v); }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "item_number"
+ },
+ {
+ "xtype" : "ColumnModel",
+ "sortable" : true,
+ "header" : "Pickface",
+ "width" : 100,
+ "$ renderer" : "function(v) { return String.format('{0}', v); }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "item_char_pickface_location",
+ "items" : [
+ {
+ "xtype" : "GridEditor",
+ "$ xns" : "Roo.grid",
+ "* prop" : "editor",
+ "items" : [
+ {
+ "xtype" : "TextField",
+ "$ xns" : "Roo.form",
+ "* prop" : "field"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "xtype" : "ColumnModel",
+ "sortable" : true,
+ "header" : "Pallet",
+ "width" : 100,
+ "$ renderer" : "function(v) { return String.format('{0}', v); }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "item_char_pallet_location",
+ "items" : [
+ {
+ "xtype" : "GridEditor",
+ "$ xns" : "Roo.grid",
+ "* prop" : "editor",
+ "items" : [
+ {
+ "xtype" : "TextField",
+ "$ xns" : "Roo.form",
+ "* prop" : "field"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "xtype" : "ColumnModel",
+ "sortable" : true,
+ "header" : "Description",
+ "width" : 200,
+ "$ renderer" : "function(v) { return String.format('{0}', v); }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "item_descrip1"
+ },
+ {
+ "xtype" : "ColumnModel",
+ "sortable" : true,
+ "header" : "Purchased",
+ "width" : 55,
+ "$ renderer" : "function(v) { \n var state = v * 1 > 0 ? '-checked' : '';\n\n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n \n }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "itemsrc_active"
+ },
+ {
+ "xtype" : "ColumnModel",
+ "sortable" : true,
+ "header" : "is Sold?",
+ "width" : 50,
+ "$ renderer" : "function(v) { \n var state = v * 1 > 0 ? '-checked' : '';\n\n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n \n }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "item_sold"
+ },
+ {
+ "xtype" : "ColumnModel",
+ "sortable" : true,
+ "header" : "is Active?",
+ "width" : 50,
+ "$ renderer" : "function(v) { \n var state = v * 1 > 0 ? '-checked' : '';\n\n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n \n }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "item_active"
+ },
+ {
+ "align" : "right",
+ "xtype" : "ColumnModel",
+ "header" : "Last purchase price",
+ "width" : 120,
+ "$ renderer" : "function(v,x,r) {\n\n return String.format('{0}{1}', r.data.last_purchase_price_curr_name, Roo.util.Format.number(v,2)) ; \n \n }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "last_purchase_price"
+ },
+ {
+ "xtype" : "ColumnModel",
+ "width" : 100,
+ "header" : "Item prodcat",
+ "$ renderer" : "function(v,x,r) { \n return String.format('{0}/{1}', r.data.item_type, v); \n }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "item_prodcat_id_prodcat_code"
+ },
+ {
+ "align" : "right",
+ "xtype" : "ColumnModel",
+ "header" : "Cost",
+ "width" : 75,
+ "$ renderer" : "function(v,x,r) {\n\n return String.format('{0}{1}', r.data.item_curr_name, Roo.util.Format.number(v,2)) ; \n \n }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "item_actcost"
+ },
+ {
+ "align" : "right",
+ "xtype" : "ColumnModel",
+ "header" : "Cost (base)",
+ "width" : 75,
+ "$ renderer" : "function(v,x,r) {\n\n return String.format('{0}{1}', r.data.item_base_curr, Roo.util.Format.number(v,2)) ; \n \n }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "item_base_cost"
+ },
+ {
+ "align" : "right",
+ "xtype" : "ColumnModel",
+ "header" : "Balance",
+ "width" : 100,
+ "$ renderer" : "function(v) { return String.format('{0}', v ? parseInt( v) : ''); }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "item_stock_balance"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "listeners" : {
+ "|activate" : "function() {\n _this.locpanel = this;\n \n}"
+ },
+ "region" : "east",
+ "fitToframe" : true,
+ "background" : true,
+ "title" : "itemloc",
+ "xtype" : "GridPanel",
+ "fitContainer" : true,
+ "$ xns" : "Roo",
+ "tableName" : "itemloc",
+ "items" : [
+ {
+ "listeners" : {
+ "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n",
+ "|render" : "function() \n{\n _this.locgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n \n}"
+ },
+ "autoExpandColumn" : "location_name",
+ "xtype" : "Grid",
+ "loadMask" : true,
+ "$ xns" : "Roo.grid",
+ "* prop" : "grid",
+ "items" : [
+ {
+ "listeners" : {
+ "beforeload" : "function (_self, o)\n{\n var sel = _this.grid.selModel.getSelectedCell();\n if (!sel) {\n this.removeAll();\n return false;\n }\n var rec = _this.grid.ds.getAt(sel[0]);\n o.params._stock_for_item_id = rec.data.item_id;\n //o.params['!itemloc_qty'] = 0;\n \n \n}"
+ },
+ "xtype" : "Store",
+ "remoteSort" : true,
+ "$ sortInfo" : "{ field : 'location_name', direction: 'ASC' }",
+ "$ xns" : "Roo.data",
+ "* prop" : "dataSource",
+ "items" : [
+ {
+ "$ url" : "baseURL + '/Roo/location.php'",
+ "method" : "GET",
+ "xtype" : "HttpProxy",
+ "$ xns" : "Roo.data",
+ "* prop" : "proxy"
+ },
+ {
+ "id" : "id",
+ "root" : "data",
+ "xtype" : "JsonReader",
+ "$ xns" : "Roo.data",
+ "$ fields" : "[\n {\n 'name': 'itemloc_id',\n 'type': 'int'\n },\n {\n 'name': 'itemloc_itemsite_id',\n 'type': 'int'\n },\n {\n 'name': 'itemloc_location_id',\n 'type': 'int'\n },\n {\n 'name': 'itemloc_qty',\n 'type': 'float'\n },\n {\n 'name': 'itemloc_expiration',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'itemloc_consolflag',\n 'type': 'int'\n },\n {\n 'name': 'itemloc_ls_id',\n 'type': 'int'\n },\n {\n 'name': 'itemloc_warrpurc',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n }\n]",
+ "* prop" : "reader",
+ "totalProperty" : "total"
+ }
+ ]
+ },
+ {
+ "pageSize" : 25,
+ "xtype" : "PagingToolbar",
+ "emptyMsg" : "No itemloc found",
+ "$ xns" : "Roo",
+ "displayInfo" : true,
+ "displayMsg" : "Displaying itemloc{0} - {1} of {2}",
+ "* prop" : "footer"
+ },
+ {
+ "xtype" : "ColumnModel",
+ "width" : 75,
+ "header" : "Location",
+ "$ renderer" : "function(v) { return String.format('{0}', v); }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "location_name"
+ },
+ {
+ "xtype" : "ColumnModel",
+ "width" : 75,
+ "header" : "Itemloc qty",
+ "$ renderer" : "function(v) { return String.format('{0}', v*1 ? (v*1).toFixed(0) : ''); }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "itemloc_realqty"
+ }
+ ]
}
- ]
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
}
\ No newline at end of file
Roo.namespace('Pman.Tab');
Pman.Tab.XtupleItem = new Roo.XComponent({
- part : ["Xtuple", "Item" ],
- order : '001-Pman.Tab.XtupleItem',
- region : 'center',
- parent : 'Pman.Tab.XtupleManage',
- name : "Pman.Tab.XtupleItem",
- disabled : false,
- permname : '',
- _tree : function()
- {
- var _this = this;
- var MODULE = this;
- return {
- layout : {
- center : {
- '|xns' : 'Roo',
- xtype : 'LayoutRegion',
- xns : Roo
- },
- east : {
- '|xns' : 'Roo',
- xtype : 'LayoutRegion',
- width : 200,
- xns : Roo,
- split : true
- },
- '|xns' : 'Roo',
- xtype : 'BorderLayout',
- xns : Roo,
- items : [
- {
- grid : {
- dataSource : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/item.php',
- method : 'GET',
- xtype : 'HttpProxy',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'id',
- root : 'data',
- xtype : 'JsonReader',
- xns : Roo.data,
- fields : [
- {
- 'name': 'item_id',
- 'type': 'int'
- },
- {
- 'name': 'item_number',
- 'type': 'string'
- },
- {
- 'name': 'item_descrip1',
- 'type': 'string'
- },
- {
- 'name': 'item_descrip2',
- 'type': 'string'
- },
- {
- 'name': 'item_classcode_id',
- 'type': 'int'
- },
- {
- 'name': 'item_picklist',
- 'type': 'int'
- },
- {
- 'name': 'item_comments',
- 'type': 'string'
- },
- {
- 'name': 'item_sold',
- 'type': 'int'
- },
- {
- 'name': 'item_fractional',
- 'type': 'int'
- },
- {
- 'name': 'item_active',
- 'type': 'int'
- },
- {
- 'name': 'item_type',
- 'type': 'string'
- },
- {
- 'name': 'item_prodweight',
- 'type': 'float'
- },
- {
- 'name': 'item_packweight',
- 'type': 'float'
- },
- {
- 'name': 'item_prodcat_id',
- 'type': 'int'
- },
- {
- 'name': 'item_exclusive',
- 'type': 'int'
- },
- {
- 'name': 'item_listprice',
- 'type': 'float'
- },
- {
- 'name': 'item_config',
- 'type': 'int'
- },
- {
- 'name': 'item_extdescrip',
- 'type': 'string'
- },
- {
- 'name': 'item_upccode',
- 'type': 'string'
- },
- {
- 'name': 'item_maxcost',
- 'type': 'float'
- },
- {
- 'name': 'item_inv_uom_id',
- 'type': 'int'
- },
- {
- 'name': 'item_price_uom_id',
- 'type': 'int'
- },
- {
- 'name': 'item_warrdays',
- 'type': 'int'
- },
- {
- 'name': 'item_freightclass_id',
- 'type': 'int'
- },
- {
- 'name': 'item_tax_recoverable',
- 'type': 'int'
- },
- {
- 'name': 'item_price_uom_id_uom_id',
- 'type': 'int'
- },
- {
- 'name': 'item_price_uom_id_uom_name',
- 'type': 'string'
- },
- {
- 'name': 'item_price_uom_id_uom_descrip',
- 'type': 'string'
- },
- {
- 'name': 'item_price_uom_id_uom_item_weight',
- 'type': 'int'
- },
- {
- 'name': 'item_inv_uom_id_uom_id',
- 'type': 'int'
- },
- {
- 'name': 'item_inv_uom_id_uom_name',
- 'type': 'string'
- },
- {
- 'name': 'item_inv_uom_id_uom_descrip',
- 'type': 'string'
- },
- {
- 'name': 'item_inv_uom_id_uom_item_weight',
- 'type': 'int'
- },
- {
- 'name': 'item_freightclass_id_freightclass_id',
- 'type': 'int'
- },
- {
- 'name': 'item_freightclass_id_freightclass_code',
- 'type': 'string'
- },
- {
- 'name': 'item_freightclass_id_freightclass_descrip',
- 'type': 'string'
- },
- {
- 'name': 'item_classcode_id_classcode_id',
- 'type': 'int'
- },
- {
- 'name': 'item_classcode_id_classcode_code',
- 'type': 'string'
- },
- {
- 'name': 'item_classcode_id_classcode_descrip',
- 'type': 'string'
- },
- {
- 'name': 'item_classcode_id_classcode_mfg',
- 'type': 'int'
- },
- {
- 'name': 'item_classcode_id_classcode_creator',
- 'type': 'string'
- },
- {
- 'name': 'item_classcode_id_classcode_created',
- 'type': 'date'
- },
- {
- 'name': 'item_classcode_id_classcode_modifier',
- 'type': 'string'
- },
- {
- 'name': 'item_classcode_id_classcode_modified',
- 'type': 'date'
- },
- {
- 'name': 'item_classcode_id_classcode_type',
- 'type': 'string'
- }
- ],
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- sortInfo : { field : 'item_number', direction: 'ASC' },
- xns : Roo.data,
- listeners : {
- update : function (_self, record, operation)
- {
- if(operation != 'commit'){
- return;
- }
-
- var nv = record.data.itemsrc_active ? 0 : 1;
- new Pman.Request({
- mask : 'Saving',
- url : baseURL + '/Roo/Itemsrc',
- params : {
- _update_by_item : 1,
- item_id : record.data.item_id,
- itemsrc_active : nv
- },
- success : function(res) {
- record.set('itemsrc_active', nv);
- }
- });
- },
- beforeload : function (_self, o)
- {
- o.params._with_prodcat = 1;
- o.params._with_char = 1;
- o.params._with_itemsrc_active = 1;
- o.params._with_last_purchase_price = 1;
- o.params._with_image = 1;
- var s = _this.search.getValue();
- if (s.length) {
- o.params['query[number_or_name]'] = s;
- }
- if (!_this.active.pressed) {
- o.params.item_active = 1;
- }
- if (_this.brandSel.getValue().length) {
- o.params._with_brand = _this.brandSel.getValue()
- }
-
- o.params._with_stock_balance = 1;
- },
- load : function (_self, records, options)
- {
-
- var cm = _this.grid.getColumnModel();
- if(records.length){
- cm.setColumnHeader(cm.getIndexByDataIndex('item_stock_balance'),records[0].data.default_location_name);
- }
- }
- },
- items : [
- ]
+ _strings : {
+ 'be53a0541a6d36f6ecb879fa2c584b08' :"Image",
+ '41e902bb1b2db625736ede3bacc41fe0' :"is Sold?",
+ 'ce4ee01637f4279d02d0f232459dc9a4' :"Purchased",
+ '1be6f9eb563f3bf85c78b4219bf09de9' :"Brand",
+ 'aa554e9e2270df2127bfe9096f1bd9ce' :"Displaying item{0} - {1} of {2}",
+ 'ce5bf551379459c1c61d2a204061c455' :"Location",
+ '44ca8ce0e02dee5d520525ac21bcbee9' :"Sync Product from HK (Based on Search)",
+ '068f80c7519d0528fb08e82137a72131' :"Products",
+ '68f43fdcf074903d65da764642a4b968' :"is Active?",
+ '759d259249621c817551c5fe726d5c57' :"itemloc",
+ '89217b1527e14cced20e78111a8f5027' :"Item prodcat",
+ 'e924991fc4c883bc237e69efe884d674' :"Download Sales Report",
+ 'ee3585dbcb1e8f8826f3403c1e9d898c' :"Rename SKU",
+ '20b4f77bd00b4f63a49ec8e08f3bf6a6' :"Cost",
+ 'fe78f3efbfa84d8485d589031596c5b8' :"Pallet",
+ 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
+ '19029645d5286771ac708d1bcd118bf4' :"Displaying itemloc{0} - {1} of {2}",
+ '1243daf593fa297e07ab03bf06d925af' :"Searching...",
+ '99a808d8d16122d70e44bd7f709d30fb' :"Balance",
+ '9a8faafb674c03474827bcb6fcde43a3' :"Search Product",
+ 'f1c3ca6cadc4a9f57a08d5f7482a3f83' :"No item found",
+ 'd6ea9efa48916e9563d76ddc233ebe2a' :"Sync Product from HK (New Products Only)",
+ '2cfd827c6e37453fe1ddde82a5bd9474' :"No itemloc found",
+ 'd8ab3576a67fe0cc175ee77d57d0fd85' :"Pickface",
+ '5bc3fd20294c17c9803942958fd7f26d' :"Show Inactive",
+ '70cd7e06502a63356290711ec3b11223' :"Upload new products and costs",
+ 'c6ca371871d835c79c8654b5cd788cc7' :"Product Group",
+ '695dbdb13fad32669a68d8fec8541c7f' :"Download Standard costs",
+ '156567f65fc207d39cadbf045687c521' :"Itemloc qty",
+ 'c2f1d503b95bf9f3aa4d775a216c5c73' :"Sync Product Data from HK",
+ '36c454c4130e4444e8410f11d6d998f0' :"Tools - Upload/Download",
+ 'b5a7adde1af5c87d7fd797b6245c2a39' :"Description",
+ '7fee866379427143414dd7a72e56414b' :"Report start :",
+ 'a9e35d03ee7f31f5bb199379a6d3547a' :"Select Brand",
+ '35be52be39d3efcd0cd2b3721fc3c298' :"Cost (base)",
+ '750587d31c68779e7f615c190a9dc23f' :"Last purchase price",
+ 'b2ee912b91d69b435159c7c3f6df7f5f' :"Number",
+ '173cf046739c17fd7c97ec3540d58807' :"(function() { return (new Date()).format('Y') + '-01-01'; })()",
+ 'c20ad4d76fe97759aa27a0c99bff6710' :"12"
+ },
- },
- toolbar : {
- '|xns' : 'Roo',
- xtype : 'Toolbar',
- xns : Roo,
- items : [
- {
- store : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/Charass.php',
- xtype : 'HttpProxy',
- method : 'GET',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'id',
- root : 'data',
- xtype : 'JsonReader',
- xns : Roo.data,
- fields : [
- {
- 'name': 'id',
- 'type': 'int'
- },
- {
- 'name': 'person_name',
- 'type': 'string'
- },
- {
- 'name': 'event_when',
- 'type': 'date',
- 'dateFormat': 'Y-m-d'
- },
- {
- 'name': 'action',
- 'type': 'string'
- },
- {
- 'name': 'ipaddr',
- 'type': 'string'
- },
- {
- 'name': 'on_id',
- 'type': 'int'
- },
- {
- 'name': 'on_table',
- 'type': 'string'
- },
- {
- 'name': 'person_id',
- 'type': 'int'
- },
- {
- 'name': 'remarks',
- 'type': 'string'
- },
- {
- 'name': 'person_id_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_office_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_name',
- 'type': 'string'
- },
- {
- 'name': 'person_id_phone',
- 'type': 'string'
- },
- {
- 'name': 'person_id_fax',
- 'type': 'string'
- },
- {
- 'name': 'person_id_email',
- 'type': 'string'
- },
- {
- 'name': 'person_id_company_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_role',
- 'type': 'string'
- },
- {
- 'name': 'person_id_active',
- 'type': 'int'
- },
- {
- 'name': 'person_id_remarks',
- 'type': 'string'
- },
- {
- 'name': 'person_id_passwd',
- 'type': 'string'
- },
- {
- 'name': 'person_id_owner_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_lang',
- 'type': 'string'
- },
- {
- 'name': 'person_id_no_reset_sent',
- 'type': 'int'
- },
- {
- 'name': 'person_id_action_type',
- 'type': 'string'
- },
- {
- 'name': 'person_id_project_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_deleted_by',
- 'type': 'int'
- },
- {
- 'name': 'person_id_deleted_dt',
- 'type': 'date'
- }
- ],
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- sortInfo : { field : 'charass_value' , direction : 'ASC' },
- xns : Roo.data,
- listeners : {
- beforeload : function (_self, o)
- {
- o.params = o.params || {};
- // staff can see all logs, other companies can only see their own.
- // look for all of the charass 's with the same type= eg. brand.
-
- o.params.charass_char_id_char_name = 'BRAND';
- o.params.charass_target_type ='I';
- o.params._distinct = 'charass_value';
- o.params._columns = 'charass_value';
-
- }
- },
- items : [
+ part : ["Xtuple", "Item" ],
+ order : '001-Pman.Tab.XtupleItem',
+ region : 'center',
+ parent : 'Pman.Tab.XtupleManage',
+ name : "Pman.Tab.XtupleItem",
+ disabled : false,
+ permname : '',
+ _tree : function()
+ {
+ var _this = this;
+ var MODULE = this;
+ return {
+ layout : {
+ center : {
+ '|xns' : 'Roo',
+ xns : Roo,
+ xtype : 'LayoutRegion'
+ },
+ east : {
+ '|xns' : 'Roo',
+ split : true,
+ width : 200,
+ xns : Roo,
+ xtype : 'LayoutRegion'
+ },
+ '|xns' : 'Roo',
+ xns : Roo,
+ xtype : 'BorderLayout',
+ items : [
+ {
+ grid : {
+ dataSource : {
+ proxy : {
+ '|xns' : 'Roo.data',
+ method : 'GET',
+ url : baseURL + '/Roo/item.php',
+ xns : Roo.data,
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ '|xns' : 'Roo.data',
+ fields : [
+ {
+ 'name': 'item_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_number',
+ 'type': 'string'
+ },
+ {
+ 'name': 'item_descrip1',
+ 'type': 'string'
+ },
+ {
+ 'name': 'item_descrip2',
+ 'type': 'string'
+ },
+ {
+ 'name': 'item_classcode_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_picklist',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_comments',
+ 'type': 'string'
+ },
+ {
+ 'name': 'item_sold',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_fractional',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_active',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_type',
+ 'type': 'string'
+ },
+ {
+ 'name': 'item_prodweight',
+ 'type': 'float'
+ },
+ {
+ 'name': 'item_packweight',
+ 'type': 'float'
+ },
+ {
+ 'name': 'item_prodcat_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_exclusive',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_listprice',
+ 'type': 'float'
+ },
+ {
+ 'name': 'item_config',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_extdescrip',
+ 'type': 'string'
+ },
+ {
+ 'name': 'item_upccode',
+ 'type': 'string'
+ },
+ {
+ 'name': 'item_maxcost',
+ 'type': 'float'
+ },
+ {
+ 'name': 'item_inv_uom_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_price_uom_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_warrdays',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_freightclass_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_tax_recoverable',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_price_uom_id_uom_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_price_uom_id_uom_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'item_price_uom_id_uom_descrip',
+ 'type': 'string'
+ },
+ {
+ 'name': 'item_price_uom_id_uom_item_weight',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_inv_uom_id_uom_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_inv_uom_id_uom_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'item_inv_uom_id_uom_descrip',
+ 'type': 'string'
+ },
+ {
+ 'name': 'item_inv_uom_id_uom_item_weight',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_freightclass_id_freightclass_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_freightclass_id_freightclass_code',
+ 'type': 'string'
+ },
+ {
+ 'name': 'item_freightclass_id_freightclass_descrip',
+ 'type': 'string'
+ },
+ {
+ 'name': 'item_classcode_id_classcode_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_classcode_id_classcode_code',
+ 'type': 'string'
+ },
+ {
+ 'name': 'item_classcode_id_classcode_descrip',
+ 'type': 'string'
+ },
+ {
+ 'name': 'item_classcode_id_classcode_mfg',
+ 'type': 'int'
+ },
+ {
+ 'name': 'item_classcode_id_classcode_creator',
+ 'type': 'string'
+ },
+ {
+ 'name': 'item_classcode_id_classcode_created',
+ 'type': 'date'
+ },
+ {
+ 'name': 'item_classcode_id_classcode_modifier',
+ 'type': 'string'
+ },
+ {
+ 'name': 'item_classcode_id_classcode_modified',
+ 'type': 'date'
+ },
+ {
+ 'name': 'item_classcode_id_classcode_type',
+ 'type': 'string'
+ }
+ ],
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ xtype : 'JsonReader'
+ },
+ '|xns' : 'Roo.data',
+ remoteSort : true,
+ sortInfo : { field : 'item_number', direction: 'ASC' },
+ xns : Roo.data,
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o)
+ {
+ o.params._with_prodcat = 1;
+ o.params._with_char = 1;
+ o.params._with_itemsrc_active = 1;
+ o.params._with_last_purchase_price = 1;
+ o.params._with_image = 1;
+ var s = _this.search.getValue();
+ if (s.length) {
+ o.params['query[number_or_name]'] = s;
+ }
+ if (!_this.active.pressed) {
+ o.params.item_active = 1;
+ }
+ if (_this.brandSel.getValue().length) {
+ o.params._with_brand = _this.brandSel.getValue()
+ }
+
+ o.params._with_stock_balance = 1;
+ },
+ load : function (_self, records, options)
+ {
+
+ var cm = _this.grid.getColumnModel();
+ if(records.length){
+ cm.setColumnHeader(cm.getIndexByDataIndex('item_stock_balance'),records[0].data.default_location_name);
+ }
+ },
+ update : function (_self, record, operation)
+ {
+ if(operation != 'commit'){
+ return;
+ }
+
+ var nv = record.data.itemsrc_active ? 0 : 1;
+ new Pman.Request({
+ mask : 'Saving',
+ url : baseURL + '/Roo/Itemsrc',
+ params : {
+ _update_by_item : 1,
+ item_id : record.data.item_id,
+ itemsrc_active : nv
+ },
+ success : function(res) {
+ record.set('itemsrc_active', nv);
+ }
+ });
+ }
+ },
+ items : [
- ]
+ ]
- },
- '|xns' : 'Roo.form',
- alwaysQuery : true,
- listWidth : 300,
- triggerAction : 'all',
- forceSelection : true,
- selectOnFocus : true,
- pageSize : 20,
- displayField : 'charass_value',
- emptyText : "Select Brand",
- minChars : 2,
- xtype : 'ComboBox',
- allowBlank : true,
- editable : true,
- width : 150,
- xns : Roo.form,
- qtip : "Select Brand",
- queryParam : 'query[charass_value]',
- tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>',
- loadingText : "Searching...",
- listeners : {
- render : function (_self)
- {
- _this.brandSel = _self;
- },
- select : function (combo, record, index)
- {
- _this.grid.footer.onClick('first');
- }
- },
- items : [
+ },
+ toolbar : {
+ '|xns' : 'Roo',
+ xns : Roo,
+ xtype : 'Toolbar',
+ items : [
+ {
+ store : {
+ proxy : {
+ '|xns' : 'Roo.data',
+ method : 'GET',
+ url : baseURL + '/Roo/Charass.php',
+ xns : Roo.data,
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ '|xns' : 'Roo.data',
+ fields : [
+ {
+ 'name': 'id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'event_when',
+ 'type': 'date',
+ 'dateFormat': 'Y-m-d'
+ },
+ {
+ 'name': 'action',
+ 'type': 'string'
+ },
+ {
+ 'name': 'ipaddr',
+ 'type': 'string'
+ },
+ {
+ 'name': 'on_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'on_table',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'remarks',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_office_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_phone',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_fax',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_email',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_company_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_role',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_active',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_remarks',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_passwd',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_owner_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_lang',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_no_reset_sent',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_action_type',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_project_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_deleted_by',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_deleted_dt',
+ 'type': 'date'
+ }
+ ],
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ xtype : 'JsonReader'
+ },
+ '|xns' : 'Roo.data',
+ remoteSort : true,
+ sortInfo : { field : 'charass_value' , direction : 'ASC' },
+ xns : Roo.data,
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o)
+ {
+ o.params = o.params || {};
+ // staff can see all logs, other companies can only see their own.
+ // look for all of the charass 's with the same type= eg. brand.
+
+ o.params.charass_char_id_char_name = 'BRAND';
+ o.params.charass_target_type ='I';
+ o.params._distinct = 'charass_value';
+ o.params._columns = 'charass_value';
+
+ }
+ },
+ items : [
- ]
+ ]
- },
- {
- '|xns' : 'Roo.form',
- emptyText : "Search Product",
- xtype : 'TextField',
- xns : Roo.form,
- listeners : {
- specialkey : function (_self, e)
- {
- _this.grid.footer.onClick('first');
- },
- render : function (_self)
- {
- _this.search = _self;
- }
- }
- },
- {
- '|xns' : 'Roo.Toolbar',
- xtype : 'Button',
- cls : 'x-btn-icon',
- icon : rootURL + '/Pman/templates/images/search.gif',
- xns : Roo.Toolbar,
- listeners : {
- click : function (_self, e)
- {
- _this.grid.footer.onClick('first');
- }
- }
- },
- {
- '|xns' : 'Roo.Toolbar',
- xtype : 'Button',
- cls : 'x-btn-icon',
- icon : rootURL + '/Pman/templates/images/edit-clear.gif',
- xns : Roo.Toolbar,
- listeners : {
- click : function (_self, e)
- {
- _this.search.setValue('');
-
-
-
- _this.grid.footer.onClick('first');
- }
- }
- },
- {
- '|xns' : 'Roo.Toolbar',
- xtype : 'Separator',
- xns : Roo.Toolbar
- },
- {
- '|xns' : 'Roo.Toolbar',
- text : "Show Inactive",
- enableToggle : true,
- xtype : 'Button',
- xns : Roo.Toolbar,
- listeners : {
- toggle : function (_self, pressed)
- {
-
- this.setText(pressed ? "Hide Inactive" : "Show Inactive");
- (function() { _this.grid.footer.onClick('first'); }).defer(100);
- },
- render : function (_self)
- {
- _this.active = _self;
- }
- }
- },
- {
- '|xns' : 'Roo.Toolbar',
- xtype : 'Fill',
- xns : Roo.Toolbar
- },
- {
- '|xns' : 'Roo.Toolbar',
- text : "Add",
- xtype : 'Button',
- cls : 'x-btn-text-icon',
- icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
- xns : Roo.Toolbar,
- listeners : {
- click : function()
- {
-
- Pman.Dialog.XtupleItem.show( { item_id : 0 } , function() {
- _this.grid.footer.onClick('first');
- });
- }
- }
- },
- {
- '|xns' : 'Roo.Toolbar',
- text : "Rename SKU",
- xtype : 'Button',
- xns : Roo.Toolbar,
- listeners : {
- click : function()
- {
- var s = _this.grid.selModel.getSelectedCell();
- if (!s) {
- Roo.MessageBox.alert("Error", "Select a product");
- return;
- }
- var rec = _this.grid.ds.getAt(s[0]);
-
- var params = [];
-
- Roo.MessageBox.prompt(
- "Rename SKU",
- "Warning changing SKU names affects historical data, and should only be done if you are sure that this is ok",
- function(r,v) {
- if (r != 'ok') {
- return;
-
- }
- params = {
- _rename_sku : v,
- item_id : rec.data.item_id,
- _check : 1
- }
-
- change(params);
-
- return;
-
-
-
- }
- );
-
- var change = function(params){
- new Pman.Request({
- url : baseURL + '/Roo/Item',
- mask : "Renaming",
- method : 'POST',
- params : params,
- success : function(res) {
- Roo.log(res);
- _this.grid.footer.onClick('refresh');
- if(typeof(res.data) == 'string'){
- Roo.MessageBox.alert("Notice", 'SKU has been renamed');
- return
- }
- var offices = [];
- Roo.each(res.data, function(o){
- offices.push(Pman.Xtuple.offices[o]);
- })
- Roo.MessageBox.alert("Notice", 'SKU has been renamed in ' + offices.join(", "));
-
- },
- failure : function(res) {
- Roo.log(res);
- try {
- if (res.errors.confirm.length) {
- var offices = [];
- Roo.each(res.errors.confirm, function(o){
- offices.push(Pman.Xtuple.offices[o]);
- })
- Roo.MessageBox.confirm(
- "Confirm",
- " Do you want to change the name in " + offices.join(", ") + "?",
- function(x) {
- if (x != 'yes') {
- Roo.MessageBox.alert("Notice", 'SKU was not changed');
- return;
- }
- delete params['_check'];
- params._can_change_sku = 1;
- change(params);
- }
- );
- return;
- }
- } catch(e) { }
- Roo.MessageBox.alert("Error", res.errorMsg);
-
- }
- });
- }
-
- }
- }
- },
- {
- '|xns' : 'Roo.Toolbar',
- xtype : 'Separator',
- xns : Roo.Toolbar
- },
- {
- '|xns' : 'Roo.Toolbar',
- text : "Report start :",
- xtype : 'TextItem',
- xns : Roo.Toolbar
- },
- {
- '|xns' : 'Roo.form',
- format : 'd/M/Y',
- xtype : 'DateField',
- useIso : true,
- value : (function() { return (new Date()).format('Y') + '-01-01'; })(),
- xns : Roo.form,
- listeners : {
- render : function (_self)
- {
- _this.dateFrom = _self;
- }
- }
- },
- {
- store : {
- '|xns' : 'Roo.data',
- xtype : 'SimpleStore',
- data : [
- [ '1', "Single Month Sales"],
- [ '3', "Quarter Sales"],
- [ '6', "Half year Sales"] ,
- [ '12', "Full Year Sales"]
- ],
- fields : [ 'ftype', 'fname'],
- xns : Roo.data
- },
- '|xns' : 'Roo.form',
- listWidth : 200,
- triggerAction : 'all',
- fieldLabel : 'Status',
- displayField : 'fname',
- hiddenName : 'cm_status',
- value : 12,
- valueField : 'ftype',
- xtype : 'ComboBox',
- allowBlank : false,
- editable : false,
- width : 150,
- xns : Roo.form,
- mode : 'local',
- name : 'cm_status_name',
- listeners : {
- render : function (_self)
- {
- _this.datespan = _self;
- }
- },
- items : [
+ },
+ '|xns' : 'Roo.form',
+ allowBlank : true,
+ alwaysQuery : true,
+ displayField : 'charass_value',
+ editable : true,
+ emptyText : _this._strings['a9e35d03ee7f31f5bb199379a6d3547a'],
+ forceSelection : true,
+ listWidth : 300,
+ loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
+ minChars : 2,
+ pageSize : 20,
+ qtip : _this._strings['a9e35d03ee7f31f5bb199379a6d3547a'],
+ queryParam : 'query[charass_value]',
+ selectOnFocus : true,
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>',
+ triggerAction : 'all',
+ width : 150,
+ xns : Roo.form,
+ xtype : 'ComboBox',
+ listeners : {
+ render : function (_self)
+ {
+ _this.brandSel = _self;
+ },
+ select : function (combo, record, index)
+ {
+ _this.grid.footer.onClick('first');
+ }
+ },
+ items : [
- ]
+ ]
- },
- {
- '|xns' : 'Roo.Toolbar',
- text : "Download Sales Report",
- xtype : 'Button',
- xns : Roo.Toolbar,
- listeners : {
- click : function (_self, e)
- {
- if (!_this.brandSel.getValue().length) {
- Roo.MessageBox.alert("Error", "Select a brand to download");
- return;
- }
-
- new Pman.Download({
- url : baseURL + '/Xtuple/Reports/SalesByCountryItemYear',
- params: {
- date_from : _this.dateFrom.getValue(),
- brand : _this.brandSel.getValue(),
- span : _this.datespan.getValue()
- }
- });
-
-
- }
+ },
+ {
+ '|xns' : 'Roo.form',
+ emptyText : _this._strings['9a8faafb674c03474827bcb6fcde43a3'],
+ xns : Roo.form,
+ xtype : 'TextField',
+ listeners : {
+ render : function (_self)
+ {
+ _this.search = _self;
+ },
+ specialkey : function (_self, e)
+ {
+ _this.grid.footer.onClick('first');
+ }
+ }
+ },
+ {
+ '|xns' : 'Roo.Toolbar',
+ cls : 'x-btn-icon',
+ icon : rootURL + '/Pman/templates/images/search.gif',
+ xns : Roo.Toolbar,
+ xtype : 'Button',
+ listeners : {
+ click : function (_self, e)
+ {
+ _this.grid.footer.onClick('first');
+ }
+ }
+ },
+ {
+ '|xns' : 'Roo.Toolbar',
+ cls : 'x-btn-icon',
+ icon : rootURL + '/Pman/templates/images/edit-clear.gif',
+ xns : Roo.Toolbar,
+ xtype : 'Button',
+ listeners : {
+ click : function (_self, e)
+ {
+ _this.search.setValue('');
+
+
+
+ _this.grid.footer.onClick('first');
+ }
+ }
+ },
+ {
+ '|xns' : 'Roo.Toolbar',
+ xns : Roo.Toolbar,
+ xtype : 'Separator'
+ },
+ {
+ '|xns' : 'Roo.Toolbar',
+ enableToggle : true,
+ text : _this._strings['5bc3fd20294c17c9803942958fd7f26d'],
+ xns : Roo.Toolbar,
+ xtype : 'Button',
+ listeners : {
+ render : function (_self)
+ {
+ _this.active = _self;
+ },
+ toggle : function (_self, pressed)
+ {
+
+ this.setText(pressed ? "Hide Inactive" : "Show Inactive");
+ (function() { _this.grid.footer.onClick('first'); }).defer(100);
+ }
+ }
+ },
+ {
+ '|xns' : 'Roo.Toolbar',
+ xns : Roo.Toolbar,
+ xtype : 'Fill'
+ },
+ {
+ '|xns' : 'Roo.Toolbar',
+ cls : 'x-btn-text-icon',
+ icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
+ text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'],
+ xns : Roo.Toolbar,
+ xtype : 'Button',
+ listeners : {
+ click : function()
+ {
+
+ Pman.Dialog.XtupleItem.show( { item_id : 0 } , function() {
+ _this.grid.footer.onClick('first');
+ });
+ }
+ }
+ },
+ {
+ '|xns' : 'Roo.Toolbar',
+ text : _this._strings['ee3585dbcb1e8f8826f3403c1e9d898c'],
+ xns : Roo.Toolbar,
+ xtype : 'Button',
+ listeners : {
+ click : function()
+ {
+ var s = _this.grid.selModel.getSelectedCell();
+ if (!s) {
+ Roo.MessageBox.alert("Error", "Select a product");
+ return;
+ }
+ var rec = _this.grid.ds.getAt(s[0]);
+
+ var params = [];
+
+ Roo.MessageBox.prompt(
+ "Rename SKU",
+ "Warning changing SKU names affects historical data, and should only be done if you are sure that this is ok",
+ function(r,v) {
+ if (r != 'ok') {
+ return;
+
+ }
+ params = {
+ _rename_sku : v,
+ item_id : rec.data.item_id,
+ _check : 1
+ }
+
+ change(params);
+
+ return;
+
+
+
+ }
+ );
+
+ var change = function(params){
+ new Pman.Request({
+ url : baseURL + '/Roo/Item',
+ mask : "Renaming",
+ method : 'POST',
+ params : params,
+ success : function(res) {
+ Roo.log(res);
+ _this.grid.footer.onClick('refresh');
+ if(typeof(res.data) == 'string'){
+ Roo.MessageBox.alert("Notice", 'SKU has been renamed');
+ return
+ }
+ var offices = [];
+ Roo.each(res.data, function(o){
+ offices.push(Pman.Xtuple.offices[o]);
+ })
+ Roo.MessageBox.alert("Notice", 'SKU has been renamed in ' + offices.join(", "));
+
+ },
+ failure : function(res) {
+ Roo.log(res);
+ try {
+ if (res.errors.confirm.length) {
+ var offices = [];
+ Roo.each(res.errors.confirm, function(o){
+ offices.push(Pman.Xtuple.offices[o]);
+ })
+ Roo.MessageBox.confirm(
+ "Confirm",
+ " Do you want to change the name in " + offices.join(", ") + "?",
+ function(x) {
+ if (x != 'yes') {
+ Roo.MessageBox.alert("Notice", 'SKU was not changed');
+ return;
+ }
+ delete params['_check'];
+ params._can_change_sku = 1;
+ change(params);
}
- }
- ]
+ );
+ return;
+ }
+ } catch(e) { }
+ Roo.MessageBox.alert("Error", res.errorMsg);
+
+ }
+ });
+ }
+
+ }
+ }
+ },
+ {
+ '|xns' : 'Roo.Toolbar',
+ xns : Roo.Toolbar,
+ xtype : 'Separator'
+ },
+ {
+ '|xns' : 'Roo.Toolbar',
+ text : _this._strings['7fee866379427143414dd7a72e56414b'],
+ xns : Roo.Toolbar,
+ xtype : 'TextItem'
+ },
+ {
+ '|xns' : 'Roo.form',
+ format : 'd/M/Y',
+ useIso : true,
+ value : (function() { return (new Date()).format('Y') + '-01-01'; })(),
+ xns : Roo.form,
+ xtype : 'DateField',
+ listeners : {
+ render : function (_self)
+ {
+ _this.dateFrom = _self;
+ }
+ }
+ },
+ {
+ store : {
+ '|xns' : 'Roo.data',
+ data : [
+ [ '1', "Single Month Sales"],
+ [ '3', "Quarter Sales"],
+ [ '6', "Half year Sales"] ,
+ [ '12', "Full Year Sales"]
+ ],
+ fields : [ 'ftype', 'fname'],
+ xns : Roo.data,
+ xtype : 'SimpleStore'
+ },
+ '|xns' : 'Roo.form',
+ allowBlank : false,
+ displayField : 'fname',
+ editable : false,
+ fieldLabel : 'Status',
+ hiddenName : 'cm_status',
+ listWidth : 200,
+ mode : 'local',
+ name : 'cm_status_name',
+ triggerAction : 'all',
+ value : 12,
+ valueField : 'ftype',
+ width : 150,
+ xns : Roo.form,
+ xtype : 'ComboBox',
+ listeners : {
+ render : function (_self)
+ {
+ _this.datespan = _self;
+ }
+ },
+ items : [
+
+ ]
+
+ },
+ {
+ '|xns' : 'Roo.Toolbar',
+ text : _this._strings['e924991fc4c883bc237e69efe884d674'],
+ xns : Roo.Toolbar,
+ xtype : 'Button',
+ listeners : {
+ click : function (_self, e)
+ {
+ if (!_this.brandSel.getValue().length) {
+ Roo.MessageBox.alert("Error", "Select a brand to download");
+ return;
+ }
+
+ new Pman.Download({
+ url : baseURL + '/Xtuple/Reports/SalesByCountryItemYear',
+ params: {
+ date_from : _this.dateFrom.getValue(),
+ brand : _this.brandSel.getValue(),
+ span : _this.datespan.getValue()
+ }
+ });
+
+
+ }
+ }
+ }
+ ]
- },
- footer : {
- '|xns' : 'Roo',
- pageSize : 25,
- xtype : 'PagingToolbar',
- emptyMsg : "No item found",
- xns : Roo,
- displayInfo : true,
- displayMsg : "Displaying item{0} - {1} of {2}",
- items : [
- {
- menu : {
- '|xns' : 'Roo.menu',
- xtype : 'Menu',
- xns : Roo.menu,
- items : [
- {
- '|xns' : 'Roo.menu',
- text : "Download Standard costs",
- xtype : 'Item',
- xns : Roo.menu,
- listeners : {
- click : function (_self, e)
- {
- new Pman.Download({
- method: 'GET',
- url : baseURL + '/Roo/item',
- params : {
- _costgrid : 1
- }
- });
- }
- }
- },
- {
- '|xns' : 'Roo.menu',
- text : "Upload new products and costs",
- xtype : 'Item',
- xns : Roo.menu,
- listeners : {
- click : function (_self, e)
- {
- // Roo.MessageBox.alert("Disabled", "Can you please send Alan the test file for this - there is a problem and we need to fix it before you use this again");
- // return;
-
- Pman.Dialog.Image.show(
- {
- _url : baseURL+'/Xtuple/Import/Products',
- timeout : 60000
-
- },
- function (data) {
- var msg = [];
-
- if (data.updated) {
- msg.push("Updated " + data.updated + " Products(s)");
- }
- if (data.inserted) {
- msg.push("Added " + data.inserted + " Products(s)");
- }
- if (data.skipped) {
- msg.push("Skipped " + data.skipped);
- }
-
- if (!msg.length) {
- msg.push("No data changed");
- }
- Roo.MessageBox.alert("Notice", msg.join("\n"));
-
- }
- );
- }
- }
- },
- {
- '|xns' : 'Roo.menu',
- xtype : 'Separator',
- xns : Roo.menu
- },
- {
- '|xns' : 'Roo.menu',
- text : "Sync Product Data from HK",
- xtype : 'Item',
- xns : Roo.menu,
- hidden : (function() {
-
- return baseURL.match(/hk\.php$/) ? true : false;
- })(),
- listeners : {
- click : function (_self, e)
- {
- Roo.MessageBox.progress ("Syncing Stock", "Sending");
-
- var offset = 0;
-
- function runSync() {
-
- new Pman.Request( {
- url : baseURL+'/Roo/Item',
- method : 'GET',
- timeout: 60000,
- params : {
- _syncFromHK : 1,
- offset : offset
- },
- success : function(res) {
- Roo.log(res);
- if (!res.data.total) {
- Roo.MessageBox.hide();
- return;
- }
- offset += res.data.limit;
- Roo.MessageBox.updateProgress ( offset / res.data.total, "Done " + offset + '/' + res.data.total);
- runSync();
- }
-
-
- });
- }
- runSync();
- }
- }
- },
- {
- '|xns' : 'Roo.menu',
- text : "Sync Product from HK (New Products Only)",
- xtype : 'Item',
- xns : Roo.menu,
- hidden : (function() {
-
- return baseURL.match(/hk\.php$/) ? true : false;
- })(),
- listeners : {
- click : function (_self, e)
- {
- Roo.MessageBox.progress ("Syncing Stock", "Sending");
-
- var offset = 0;
-
-
-
- new Pman.Request( {
- url : baseURL+'/Roo/Item',
- method : 'GET',
- params : {
- _syncFromHK : 1,
- _new_only : 1
- },
- success : function(res) {
- Roo.log(res);
-
- Roo.MessageBox.hide();
- _this.grid.footer.onClick('refresh');
-
-
- }
-
-
- });
-
- }
- }
- },
- {
- '|xns' : 'Roo.menu',
- text : "Sync Product from HK (Based on Search)",
- xtype : 'Item',
- xns : Roo.menu,
- hidden : (function() {
-
- return baseURL.match(/hk\.php$/) ? true : false;
- })(),
- listeners : {
- click : function (_self, e)
- {
- Roo.MessageBox.progress ("Syncing Stock", "Sending");
-
- var offset = 0;
-
-
-
- new Pman.Request( {
- url : baseURL+'/Roo/Item',
- method : 'GET',
- params : {
- _syncFromHK : 1,
- item_number : _this.search.getValue()
- },
- success : function(res) {
- Roo.log(res);
-
- Roo.MessageBox.hide();
- _this.grid.footer.onClick('refresh');
-
-
- }
-
-
- });
-
- }
- }
- }
- ]
+ },
+ footer : {
+ '|xns' : 'Roo',
+ displayInfo : true,
+ displayMsg : _this._strings['aa554e9e2270df2127bfe9096f1bd9ce'],
+ emptyMsg : _this._strings['f1c3ca6cadc4a9f57a08d5f7482a3f83'],
+ pageSize : 25,
+ xns : Roo,
+ xtype : 'PagingToolbar',
+ items : [
+ {
+ menu : {
+ '|xns' : 'Roo.menu',
+ xns : Roo.menu,
+ xtype : 'Menu',
+ items : [
+ {
+ '|xns' : 'Roo.menu',
+ text : _this._strings['695dbdb13fad32669a68d8fec8541c7f'],
+ xns : Roo.menu,
+ xtype : 'Item',
+ listeners : {
+ click : function (_self, e)
+ {
+ new Pman.Download({
+ method: 'GET',
+ url : baseURL + '/Roo/item',
+ params : {
+ _costgrid : 1
+ }
+ });
+ }
+ }
+ },
+ {
+ '|xns' : 'Roo.menu',
+ text : _this._strings['70cd7e06502a63356290711ec3b11223'],
+ xns : Roo.menu,
+ xtype : 'Item',
+ listeners : {
+ click : function (_self, e)
+ {
+ // Roo.MessageBox.alert("Disabled", "Can you please send Alan the test file for this - there is a problem and we need to fix it before you use this again");
+ // return;
+
+ Pman.Dialog.Image.show(
+ {
+ _url : baseURL+'/Xtuple/Import/Products',
+ timeout : 60000
+
+ },
+ function (data) {
+ var msg = [];
+
+ if (data.updated) {
+ msg.push("Updated " + data.updated + " Products(s)");
+ }
+ if (data.inserted) {
+ msg.push("Added " + data.inserted + " Products(s)");
+ }
+ if (data.skipped) {
+ msg.push("Skipped " + data.skipped);
+ }
+
+ if (!msg.length) {
+ msg.push("No data changed");
+ }
+ Roo.MessageBox.alert("Notice", msg.join("\n"));
+
+ }
+ );
+ }
+ }
+ },
+ {
+ '|xns' : 'Roo.menu',
+ xns : Roo.menu,
+ xtype : 'Separator'
+ },
+ {
+ '|xns' : 'Roo.menu',
+ hidden : (function() {
+
+ return baseURL.match(/hk\.php$/) ? true : false;
+ })(),
+ text : _this._strings['c2f1d503b95bf9f3aa4d775a216c5c73'],
+ xns : Roo.menu,
+ xtype : 'Item',
+ listeners : {
+ click : function (_self, e)
+ {
+ Roo.MessageBox.progress ("Syncing Stock", "Sending");
+
+ var offset = 0;
+
+ function runSync() {
+
+ new Pman.Request( {
+ url : baseURL+'/Roo/Item',
+ method : 'GET',
+ timeout: 60000,
+ params : {
+ _syncFromHK : 1,
+ offset : offset
+ },
+ success : function(res) {
+ Roo.log(res);
+ if (!res.data.total) {
+ Roo.MessageBox.hide();
+ return;
+ }
+ offset += res.data.limit;
+ Roo.MessageBox.updateProgress ( offset / res.data.total, "Done " + offset + '/' + res.data.total);
+ runSync();
+ }
+
+
+ });
+ }
+ runSync();
+ }
+ }
+ },
+ {
+ '|xns' : 'Roo.menu',
+ hidden : (function() {
+
+ return baseURL.match(/hk\.php$/) ? true : false;
+ })(),
+ text : _this._strings['d6ea9efa48916e9563d76ddc233ebe2a'],
+ xns : Roo.menu,
+ xtype : 'Item',
+ listeners : {
+ click : function (_self, e)
+ {
+ Roo.MessageBox.progress ("Syncing Stock", "Sending");
+
+ var offset = 0;
+
+
+
+ new Pman.Request( {
+ url : baseURL+'/Roo/Item',
+ method : 'GET',
+ params : {
+ _syncFromHK : 1,
+ _new_only : 1
+ },
+ success : function(res) {
+ Roo.log(res);
+
+ Roo.MessageBox.hide();
+ _this.grid.footer.onClick('refresh');
+
+
+ }
+
+
+ });
+
+ }
+ }
+ },
+ {
+ '|xns' : 'Roo.menu',
+ hidden : (function() {
+
+ return baseURL.match(/hk\.php$/) ? true : false;
+ })(),
+ text : _this._strings['44ca8ce0e02dee5d520525ac21bcbee9'],
+ xns : Roo.menu,
+ xtype : 'Item',
+ listeners : {
+ click : function (_self, e)
+ {
+ Roo.MessageBox.progress ("Syncing Stock", "Sending");
+
+ var offset = 0;
+
+
+
+ new Pman.Request( {
+ url : baseURL+'/Roo/Item',
+ method : 'GET',
+ params : {
+ _syncFromHK : 1,
+ item_number : _this.search.getValue()
+ },
+ success : function(res) {
+ Roo.log(res);
+
+ Roo.MessageBox.hide();
+ _this.grid.footer.onClick('refresh');
+
+
+ }
+
+
+ });
+
+ }
+ }
+ }
+ ]
- },
- '|xns' : 'Roo.Toolbar',
- text : "Tools - Upload/Download",
- xtype : 'Button',
- xns : Roo.Toolbar,
- items : [
+ },
+ '|xns' : 'Roo.Toolbar',
+ text : _this._strings['36c454c4130e4444e8410f11d6d998f0'],
+ xns : Roo.Toolbar,
+ xtype : 'Button',
+ items : [
- ]
+ ]
- }
- ]
+ }
+ ]
- },
- '|xns' : 'Roo.grid',
- autoExpandColumn : 'item_descrip1',
- xtype : 'EditorGrid',
- loadMask : true,
- clicksToEdit : 1,
- xns : Roo.grid,
- colModel : [
- {
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- sortable : false,
- header : 'Image',
- width : 150,
- renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/50/{1}/{2}" height="50">', baseURL, v, r.data.item_image_filename); },
- xns : Roo.grid,
- dataIndex : 'item_image_id'
- },
+ },
+ '|xns' : 'Roo.grid',
+ autoExpandColumn : 'item_descrip1',
+ clicksToEdit : 1,
+ loadMask : true,
+ xns : Roo.grid,
+ xtype : 'EditorGrid',
+ colModel : [
+ {
+ '|xns' : 'Roo.grid',
+ dataIndex : 'item_image_id',
+ header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'],
+ renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/50/{1}/{2}" height="50">', baseURL, v, r.data.item_image_filename); },
+ sortable : false,
+ width : 150,
+ xns : Roo.grid,
+ xtype : 'ColumnModel'
+ },
{
- editor : {
- field : {
- store : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/Charass.php',
- xtype : 'HttpProxy',
- method : 'GET',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'id',
- root : 'data',
- xtype : 'JsonReader',
- xns : Roo.data,
- fields : [
- {
- 'name': 'id',
- 'type': 'int'
- },
- {
- 'name': 'person_name',
- 'type': 'string'
- },
- {
- 'name': 'event_when',
- 'type': 'date',
- 'dateFormat': 'Y-m-d'
- },
- {
- 'name': 'action',
- 'type': 'string'
- },
- {
- 'name': 'ipaddr',
- 'type': 'string'
- },
- {
- 'name': 'on_id',
- 'type': 'int'
- },
- {
- 'name': 'on_table',
- 'type': 'string'
- },
- {
- 'name': 'person_id',
- 'type': 'int'
- },
- {
- 'name': 'remarks',
- 'type': 'string'
- },
- {
- 'name': 'person_id_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_office_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_name',
- 'type': 'string'
- },
- {
- 'name': 'person_id_phone',
- 'type': 'string'
- },
- {
- 'name': 'person_id_fax',
- 'type': 'string'
- },
- {
- 'name': 'person_id_email',
- 'type': 'string'
- },
- {
- 'name': 'person_id_company_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_role',
- 'type': 'string'
- },
- {
- 'name': 'person_id_active',
- 'type': 'int'
- },
- {
- 'name': 'person_id_remarks',
- 'type': 'string'
- },
- {
- 'name': 'person_id_passwd',
- 'type': 'string'
- },
- {
- 'name': 'person_id_owner_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_lang',
- 'type': 'string'
- },
- {
- 'name': 'person_id_no_reset_sent',
- 'type': 'int'
- },
- {
- 'name': 'person_id_action_type',
- 'type': 'string'
- },
- {
- 'name': 'person_id_project_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_deleted_by',
- 'type': 'int'
- },
- {
- 'name': 'person_id_deleted_dt',
- 'type': 'date'
- }
- ],
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- sortInfo : { field : 'charass_value' , direction : 'ASC' },
- xns : Roo.data,
- listeners : {
- beforeload : function (_self, o)
- {
- o.params = o.params || {};
- // staff can see all logs, other companies can only see their own.
- // look for all of the charass 's with the same type= eg. brand.
-
- o.params.charass_char_id_char_name = 'BRAND';
- o.params.charass_target_type ='I';
- o.params._distinct = 'charass_value';
- o.params._columns = 'charass_value';
-
- }
- },
- items : [
+ editor : {
+ field : {
+ store : {
+ proxy : {
+ '|xns' : 'Roo.data',
+ method : 'GET',
+ url : baseURL + '/Roo/Charass.php',
+ xns : Roo.data,
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ '|xns' : 'Roo.data',
+ fields : [
+ {
+ 'name': 'id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'event_when',
+ 'type': 'date',
+ 'dateFormat': 'Y-m-d'
+ },
+ {
+ 'name': 'action',
+ 'type': 'string'
+ },
+ {
+ 'name': 'ipaddr',
+ 'type': 'string'
+ },
+ {
+ 'name': 'on_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'on_table',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'remarks',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_office_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_phone',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_fax',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_email',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_company_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_role',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_active',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_remarks',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_passwd',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_owner_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_lang',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_no_reset_sent',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_action_type',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_project_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_deleted_by',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_deleted_dt',
+ 'type': 'date'
+ }
+ ],
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ xtype : 'JsonReader'
+ },
+ '|xns' : 'Roo.data',
+ remoteSort : true,
+ sortInfo : { field : 'charass_value' , direction : 'ASC' },
+ xns : Roo.data,
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o)
+ {
+ o.params = o.params || {};
+ // staff can see all logs, other companies can only see their own.
+ // look for all of the charass 's with the same type= eg. brand.
+
+ o.params.charass_char_id_char_name = 'BRAND';
+ o.params.charass_target_type ='I';
+ o.params._distinct = 'charass_value';
+ o.params._columns = 'charass_value';
+
+ }
+ },
+ items : [
- ]
+ ]
- },
- '|xns' : 'Roo.form',
- alwaysQuery : true,
- listWidth : 300,
- triggerAction : 'all',
- forceSelection : false,
- selectOnFocus : true,
- pageSize : 20,
- displayField : 'charass_value',
- minChars : 2,
- xtype : 'ComboBox',
- allowBlank : true,
- editable : true,
- width : 150,
- xns : Roo.form,
- qtip : "Select Brand",
- queryParam : 'query[charass_value]',
- tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>',
- loadingText : "Searching...",
- items : [
+ },
+ '|xns' : 'Roo.form',
+ allowBlank : true,
+ alwaysQuery : true,
+ displayField : 'charass_value',
+ editable : true,
+ forceSelection : false,
+ listWidth : 300,
+ loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
+ minChars : 2,
+ pageSize : 20,
+ qtip : _this._strings['a9e35d03ee7f31f5bb199379a6d3547a'],
+ queryParam : 'query[charass_value]',
+ selectOnFocus : true,
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>',
+ triggerAction : 'all',
+ width : 150,
+ xns : Roo.form,
+ xtype : 'ComboBox',
+ items : [
- ]
+ ]
- },
- '|xns' : 'Roo.grid',
- xtype : 'GridEditor',
- xns : Roo.grid,
- items : [
+ },
+ '|xns' : 'Roo.grid',
+ xns : Roo.grid,
+ xtype : 'GridEditor',
+ items : [
- ]
+ ]
- },
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- sortable : true,
- header : 'Brand',
- width : 100,
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'item_char_brand',
- items : [
+ },
+ '|xns' : 'Roo.grid',
+ dataIndex : 'item_char_brand',
+ header : _this._strings['1be6f9eb563f3bf85c78b4219bf09de9'],
+ renderer : function(v) { return String.format('{0}', v); },
+ sortable : true,
+ width : 100,
+ xns : Roo.grid,
+ xtype : 'ColumnModel',
+ items : [
- ]
+ ]
- },
+ },
{
- editor : {
- field : {
- store : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/Charass.php',
- xtype : 'HttpProxy',
- method : 'GET',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'id',
- root : 'data',
- xtype : 'JsonReader',
- xns : Roo.data,
- fields : [
- {
- 'name': 'id',
- 'type': 'int'
- },
- {
- 'name': 'person_name',
- 'type': 'string'
- },
- {
- 'name': 'event_when',
- 'type': 'date',
- 'dateFormat': 'Y-m-d'
- },
- {
- 'name': 'action',
- 'type': 'string'
- },
- {
- 'name': 'ipaddr',
- 'type': 'string'
- },
- {
- 'name': 'on_id',
- 'type': 'int'
- },
- {
- 'name': 'on_table',
- 'type': 'string'
- },
- {
- 'name': 'person_id',
- 'type': 'int'
- },
- {
- 'name': 'remarks',
- 'type': 'string'
- },
- {
- 'name': 'person_id_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_office_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_name',
- 'type': 'string'
- },
- {
- 'name': 'person_id_phone',
- 'type': 'string'
- },
- {
- 'name': 'person_id_fax',
- 'type': 'string'
- },
- {
- 'name': 'person_id_email',
- 'type': 'string'
- },
- {
- 'name': 'person_id_company_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_role',
- 'type': 'string'
- },
- {
- 'name': 'person_id_active',
- 'type': 'int'
- },
- {
- 'name': 'person_id_remarks',
- 'type': 'string'
- },
- {
- 'name': 'person_id_passwd',
- 'type': 'string'
- },
- {
- 'name': 'person_id_owner_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_lang',
- 'type': 'string'
- },
- {
- 'name': 'person_id_no_reset_sent',
- 'type': 'int'
- },
- {
- 'name': 'person_id_action_type',
- 'type': 'string'
- },
- {
- 'name': 'person_id_project_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_deleted_by',
- 'type': 'int'
- },
- {
- 'name': 'person_id_deleted_dt',
- 'type': 'date'
- }
- ],
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- sortInfo : { field : 'charass_value' , direction : 'ASC' },
- xns : Roo.data,
- listeners : {
- beforeload : function (_self, o)
- {
- o.params = o.params || {};
- // staff can see all logs, other companies can only see their own.
- // look for all of the charass 's with the same type= eg. brand.
-
- o.params.charass_char_id_char_name = 'PRODUCTGROUP';
- o.params.charass_target_type ='I';
- o.params._distinct = 'charass_value';
- o.params._columns = 'charass_value';
- }
- },
- items : [
+ editor : {
+ field : {
+ store : {
+ proxy : {
+ '|xns' : 'Roo.data',
+ method : 'GET',
+ url : baseURL + '/Roo/Charass.php',
+ xns : Roo.data,
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ '|xns' : 'Roo.data',
+ fields : [
+ {
+ 'name': 'id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'event_when',
+ 'type': 'date',
+ 'dateFormat': 'Y-m-d'
+ },
+ {
+ 'name': 'action',
+ 'type': 'string'
+ },
+ {
+ 'name': 'ipaddr',
+ 'type': 'string'
+ },
+ {
+ 'name': 'on_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'on_table',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'remarks',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_office_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_phone',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_fax',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_email',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_company_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_role',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_active',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_remarks',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_passwd',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_owner_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_lang',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_no_reset_sent',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_action_type',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_project_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_deleted_by',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_deleted_dt',
+ 'type': 'date'
+ }
+ ],
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ xtype : 'JsonReader'
+ },
+ '|xns' : 'Roo.data',
+ remoteSort : true,
+ sortInfo : { field : 'charass_value' , direction : 'ASC' },
+ xns : Roo.data,
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o)
+ {
+ o.params = o.params || {};
+ // staff can see all logs, other companies can only see their own.
+ // look for all of the charass 's with the same type= eg. brand.
+
+ o.params.charass_char_id_char_name = 'PRODUCTGROUP';
+ o.params.charass_target_type ='I';
+ o.params._distinct = 'charass_value';
+ o.params._columns = 'charass_value';
+ }
+ },
+ items : [
- ]
+ ]
- },
- '|xns' : 'Roo.form',
- alwaysQuery : true,
- listWidth : 300,
- triggerAction : 'all',
- forceSelection : false,
- selectOnFocus : true,
- pageSize : 20,
- displayField : 'charass_value',
- minChars : 2,
- xtype : 'ComboBox',
- allowBlank : true,
- editable : true,
- width : 150,
- xns : Roo.form,
- qtip : "Select Brand",
- queryParam : 'query[charass_value]',
- tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>',
- loadingText : "Searching...",
- items : [
+ },
+ '|xns' : 'Roo.form',
+ allowBlank : true,
+ alwaysQuery : true,
+ displayField : 'charass_value',
+ editable : true,
+ forceSelection : false,
+ listWidth : 300,
+ loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
+ minChars : 2,
+ pageSize : 20,
+ qtip : _this._strings['a9e35d03ee7f31f5bb199379a6d3547a'],
+ queryParam : 'query[charass_value]',
+ selectOnFocus : true,
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>',
+ triggerAction : 'all',
+ width : 150,
+ xns : Roo.form,
+ xtype : 'ComboBox',
+ items : [
- ]
+ ]
- },
- '|xns' : 'Roo.grid',
- xtype : 'GridEditor',
- xns : Roo.grid,
- items : [
+ },
+ '|xns' : 'Roo.grid',
+ xns : Roo.grid,
+ xtype : 'GridEditor',
+ items : [
- ]
+ ]
- },
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- sortable : true,
- header : 'Product Group',
- width : 100,
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'item_char_productgroup',
- items : [
+ },
+ '|xns' : 'Roo.grid',
+ dataIndex : 'item_char_productgroup',
+ header : _this._strings['c6ca371871d835c79c8654b5cd788cc7'],
+ renderer : function(v) { return String.format('{0}', v); },
+ sortable : true,
+ width : 100,
+ xns : Roo.grid,
+ xtype : 'ColumnModel',
+ items : [
- ]
+ ]
- },
+ },
{
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- sortable : true,
- header : 'Number',
- width : 100,
- renderer : function(v) { return String.format('<B>{0}</B>', v); },
- xns : Roo.grid,
- dataIndex : 'item_number'
- },
+ '|xns' : 'Roo.grid',
+ dataIndex : 'item_number',
+ header : _this._strings['b2ee912b91d69b435159c7c3f6df7f5f'],
+ renderer : function(v) { return String.format('<B>{0}</B>', v); },
+ sortable : true,
+ width : 100,
+ xns : Roo.grid,
+ xtype : 'ColumnModel'
+ },
{
- editor : {
- field : {
- '|xns' : 'Roo.form',
- xtype : 'TextField',
- xns : Roo.form
- },
- '|xns' : 'Roo.grid',
- xtype : 'GridEditor',
- xns : Roo.grid,
- items : [
+ editor : {
+ field : {
+ '|xns' : 'Roo.form',
+ xns : Roo.form,
+ xtype : 'TextField'
+ },
+ '|xns' : 'Roo.grid',
+ xns : Roo.grid,
+ xtype : 'GridEditor',
+ items : [
- ]
+ ]
- },
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- sortable : true,
- header : 'Pickface',
- width : 100,
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'item_char_pickface_location',
- items : [
+ },
+ '|xns' : 'Roo.grid',
+ dataIndex : 'item_char_pickface_location',
+ header : _this._strings['d8ab3576a67fe0cc175ee77d57d0fd85'],
+ renderer : function(v) { return String.format('{0}', v); },
+ sortable : true,
+ width : 100,
+ xns : Roo.grid,
+ xtype : 'ColumnModel',
+ items : [
- ]
+ ]
- },
+ },
{
- editor : {
- field : {
- '|xns' : 'Roo.form',
- xtype : 'TextField',
- xns : Roo.form
- },
- '|xns' : 'Roo.grid',
- xtype : 'GridEditor',
- xns : Roo.grid,
- items : [
+ editor : {
+ field : {
+ '|xns' : 'Roo.form',
+ xns : Roo.form,
+ xtype : 'TextField'
+ },
+ '|xns' : 'Roo.grid',
+ xns : Roo.grid,
+ xtype : 'GridEditor',
+ items : [
- ]
+ ]
- },
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- sortable : true,
- header : 'Pallet',
- width : 100,
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'item_char_pallet_location',
- items : [
+ },
+ '|xns' : 'Roo.grid',
+ dataIndex : 'item_char_pallet_location',
+ header : _this._strings['fe78f3efbfa84d8485d589031596c5b8'],
+ renderer : function(v) { return String.format('{0}', v); },
+ sortable : true,
+ width : 100,
+ xns : Roo.grid,
+ xtype : 'ColumnModel',
+ items : [
- ]
+ ]
- },
+ },
{
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- sortable : true,
- header : 'Description',
- width : 200,
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'item_descrip1'
- },
+ '|xns' : 'Roo.grid',
+ dataIndex : 'item_descrip1',
+ header : _this._strings['b5a7adde1af5c87d7fd797b6245c2a39'],
+ renderer : function(v) { return String.format('{0}', v); },
+ sortable : true,
+ width : 200,
+ xns : Roo.grid,
+ xtype : 'ColumnModel'
+ },
{
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- sortable : true,
- header : 'Purchased',
- width : 55,
- renderer : function(v) {
- var state = v * 1 > 0 ? '-checked' : '';
-
- return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
-
- },
- xns : Roo.grid,
- dataIndex : 'itemsrc_active'
- },
+ '|xns' : 'Roo.grid',
+ dataIndex : 'itemsrc_active',
+ header : _this._strings['ce4ee01637f4279d02d0f232459dc9a4'],
+ renderer : function(v) {
+ var state = v * 1 > 0 ? '-checked' : '';
+
+ return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
+
+ },
+ sortable : true,
+ width : 55,
+ xns : Roo.grid,
+ xtype : 'ColumnModel'
+ },
{
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- sortable : true,
- header : 'is Sold?',
- width : 50,
- renderer : function(v) {
- var state = v * 1 > 0 ? '-checked' : '';
-
- return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
-
- },
- xns : Roo.grid,
- dataIndex : 'item_sold'
- },
+ '|xns' : 'Roo.grid',
+ dataIndex : 'item_sold',
+ header : _this._strings['41e902bb1b2db625736ede3bacc41fe0'],
+ renderer : function(v) {
+ var state = v * 1 > 0 ? '-checked' : '';
+
+ return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
+
+ },
+ sortable : true,
+ width : 50,
+ xns : Roo.grid,
+ xtype : 'ColumnModel'
+ },
{
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- sortable : true,
- header : 'is Active?',
- width : 50,
- renderer : function(v) {
- var state = v * 1 > 0 ? '-checked' : '';
-
- return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
-
- },
- xns : Roo.grid,
- dataIndex : 'item_active'
- },
+ '|xns' : 'Roo.grid',
+ dataIndex : 'item_active',
+ header : _this._strings['68f43fdcf074903d65da764642a4b968'],
+ renderer : function(v) {
+ var state = v * 1 > 0 ? '-checked' : '';
+
+ return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
+
+ },
+ sortable : true,
+ width : 50,
+ xns : Roo.grid,
+ xtype : 'ColumnModel'
+ },
{
- '|xns' : 'Roo.grid',
- align : 'right',
- xtype : 'ColumnModel',
- header : 'Last purchase price',
- width : 120,
- renderer : function(v,x,r) {
-
- return String.format('{0}{1}', r.data.last_purchase_price_curr_name, Roo.util.Format.number(v,2)) ;
-
- },
- xns : Roo.grid,
- dataIndex : 'last_purchase_price'
- },
+ '|xns' : 'Roo.grid',
+ align : 'right',
+ dataIndex : 'last_purchase_price',
+ header : _this._strings['750587d31c68779e7f615c190a9dc23f'],
+ renderer : function(v,x,r) {
+
+ return String.format('{0}{1}', r.data.last_purchase_price_curr_name, Roo.util.Format.number(v,2)) ;
+
+ },
+ width : 120,
+ xns : Roo.grid,
+ xtype : 'ColumnModel'
+ },
{
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- header : 'Item prodcat',
- width : 100,
- renderer : function(v,x,r) {
- return String.format('{0}/{1}', r.data.item_type, v);
- },
- xns : Roo.grid,
- dataIndex : 'item_prodcat_id_prodcat_code'
- },
+ '|xns' : 'Roo.grid',
+ dataIndex : 'item_prodcat_id_prodcat_code',
+ header : _this._strings['89217b1527e14cced20e78111a8f5027'],
+ renderer : function(v,x,r) {
+ return String.format('{0}/{1}', r.data.item_type, v);
+ },
+ width : 100,
+ xns : Roo.grid,
+ xtype : 'ColumnModel'
+ },
{
- '|xns' : 'Roo.grid',
- align : 'right',
- xtype : 'ColumnModel',
- header : 'Cost',
- width : 75,
- renderer : function(v,x,r) {
-
- return String.format('{0}{1}', r.data.item_curr_name, Roo.util.Format.number(v,2)) ;
-
- },
- xns : Roo.grid,
- dataIndex : 'item_actcost'
- },
+ '|xns' : 'Roo.grid',
+ align : 'right',
+ dataIndex : 'item_actcost',
+ header : _this._strings['20b4f77bd00b4f63a49ec8e08f3bf6a6'],
+ renderer : function(v,x,r) {
+
+ return String.format('{0}{1}', r.data.item_curr_name, Roo.util.Format.number(v,2)) ;
+
+ },
+ width : 75,
+ xns : Roo.grid,
+ xtype : 'ColumnModel'
+ },
{
- '|xns' : 'Roo.grid',
- align : 'right',
- xtype : 'ColumnModel',
- header : 'Cost (base)',
- width : 75,
- renderer : function(v,x,r) {
-
- return String.format('{0}{1}', r.data.item_base_curr, Roo.util.Format.number(v,2)) ;
-
- },
- xns : Roo.grid,
- dataIndex : 'item_base_cost'
- },
+ '|xns' : 'Roo.grid',
+ align : 'right',
+ dataIndex : 'item_base_cost',
+ header : _this._strings['35be52be39d3efcd0cd2b3721fc3c298'],
+ renderer : function(v,x,r) {
+
+ return String.format('{0}{1}', r.data.item_base_curr, Roo.util.Format.number(v,2)) ;
+
+ },
+ width : 75,
+ xns : Roo.grid,
+ xtype : 'ColumnModel'
+ },
{
- '|xns' : 'Roo.grid',
- align : 'right',
- xtype : 'ColumnModel',
- header : 'Balance',
- width : 100,
- renderer : function(v) { return String.format('{0}', v ? parseInt( v) : ''); },
- xns : Roo.grid,
- dataIndex : 'item_stock_balance'
- }
- ],
- listeners : {
- render : function()
- {
- _this.grid = this;
- //_this.dialog = Pman.Dialog.FILL_IN
- if (_this.panel.active) {
- this.footer.onClick('first');
- }
- },
- cellclick : function (_self, row, col, e)
- {
- var di = _this.grid.colModel.getDataIndex(col);
-
- var rec = _this.grid.ds.getAt(row);
-
-
- if (di == 'item_active') {
-
- var nv = rec.data.item_active ? 0 : 1;
- new Pman.Request({
- mask : 'Saving',
- url : baseURL + '/Roo/Item',
- params : {
- item_id : rec.data.item_id,
- item_active : nv
- },
- success : function() {
- rec.set('item_active', nv);
- }
- });
- return;
-
-
- }
-
- if(di == 'itemsrc_active'){
-
-
-
-
- if(rec.data.itemsrc_active * 1){
- Roo.MessageBox.confirm("Confirm", "Are you sure this product is no longer purchased",
- function (res) {
- if(res!='yes') {
- return;
- }
- rec.set('itemsrc_active', 0);
- rec.commit();
- });
- return;
- }
-
- Pman.Dialog.XtupleItem.show( { item_id : rec.data.item_id } , function() {
- _this.grid.footer.onClick('first');
- });
- return;
-
- }
-
- _this.locgrid.footer.onClick('first');
-
-
-
-
- },
- celldblclick : function (_self, rowIndex, columnIndex, e)
- {
- var s = _this.grid.ds.getAt(rowIndex);
-
- Pman.Dialog.XtupleItem.show( { item_id : s.data.item_id } , function() {
- _this.grid.footer.onClick('first');
- });
- },
- afteredit : function (e)
- {
-
-
- Roo.log(e);
- new Pman.Request({
- url : baseURL +'/Roo/Charass',
- params : {
- charass_char_id_char_name : e.field.replace(/^item_char_/,'').toUpperCase(),
- charass_value : e.value,
- charass_target_type : 'I',
- charass_default : 1,
- charass_target_id : e.record.data.item_id
- },
- method : 'POST'
- });
-
-
- e.record.commit();
-
-
-
- }
- },
- items : [
+ '|xns' : 'Roo.grid',
+ align : 'right',
+ dataIndex : 'item_stock_balance',
+ header : _this._strings['99a808d8d16122d70e44bd7f709d30fb'],
+ renderer : function(v) { return String.format('{0}', v ? parseInt( v) : ''); },
+ width : 100,
+ xns : Roo.grid,
+ xtype : 'ColumnModel'
+ }
+ ],
+ listeners : {
+ afteredit : function (e)
+ {
+
+
+ Roo.log(e);
+ new Pman.Request({
+ url : baseURL +'/Roo/Charass',
+ params : {
+ charass_char_id_char_name : e.field.replace(/^item_char_/,'').toUpperCase(),
+ charass_value : e.value,
+ charass_target_type : 'I',
+ charass_default : 1,
+ charass_target_id : e.record.data.item_id
+ },
+ method : 'POST'
+ });
+
+
+ e.record.commit();
+
+
+
+ },
+ cellclick : function (_self, row, col, e)
+ {
+ var di = _this.grid.colModel.getDataIndex(col);
+
+ var rec = _this.grid.ds.getAt(row);
+
+
+ if (di == 'item_active') {
+
+ var nv = rec.data.item_active ? 0 : 1;
+ new Pman.Request({
+ mask : 'Saving',
+ url : baseURL + '/Roo/Item',
+ params : {
+ item_id : rec.data.item_id,
+ item_active : nv
+ },
+ success : function() {
+ rec.set('item_active', nv);
+ }
+ });
+ return;
+
+
+ }
+
+ if(di == 'itemsrc_active'){
+
+
+
+
+ if(rec.data.itemsrc_active * 1){
+ Roo.MessageBox.confirm("Confirm", "Are you sure this product is no longer purchased",
+ function (res) {
+ if(res!='yes') {
+ return;
+ }
+ rec.set('itemsrc_active', 0);
+ rec.commit();
+ });
+ return;
+ }
+
+ Pman.Dialog.XtupleItem.show( { item_id : rec.data.item_id } , function() {
+ _this.grid.footer.onClick('first');
+ });
+ return;
+
+ }
+
+ _this.locgrid.footer.onClick('first');
+
+
+
+
+ },
+ celldblclick : function (_self, rowIndex, columnIndex, e)
+ {
+ var s = _this.grid.ds.getAt(rowIndex);
+
+ Pman.Dialog.XtupleItem.show( { item_id : s.data.item_id } , function() {
+ _this.grid.footer.onClick('first');
+ });
+ },
+ render : function()
+ {
+ _this.grid = this;
+ //_this.dialog = Pman.Dialog.FILL_IN
+ if (_this.panel.active) {
+ this.footer.onClick('first');
+ }
+ }
+ },
+ items : [
- ]
+ ]
- },
- '|xns' : 'Roo',
- fitToframe : true,
- background : false,
- region : 'center',
- title : "Products",
- xtype : 'GridPanel',
- fitContainer : true,
- xns : Roo,
- tableName : 'item',
- listeners : {
- activate : function() {
- _this.panel = this;
- if (_this.grid) {
- _this.grid.footer.onClick('first');
- }
- }
- },
- items : [
+ },
+ '|xns' : 'Roo',
+ background : false,
+ fitContainer : true,
+ fitToframe : true,
+ region : 'center',
+ tableName : 'item',
+ title : _this._strings['068f80c7519d0528fb08e82137a72131'],
+ xns : Roo,
+ xtype : 'GridPanel',
+ listeners : {
+ activate : function() {
+ _this.panel = this;
+ if (_this.grid) {
+ _this.grid.footer.onClick('first');
+ }
+ }
+ },
+ items : [
- ]
+ ]
- },
- {
- grid : {
- dataSource : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/location.php',
- xtype : 'HttpProxy',
- method : 'GET',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'id',
- root : 'data',
- xtype : 'JsonReader',
- xns : Roo.data,
- fields : [
- {
- 'name': 'itemloc_id',
- 'type': 'int'
- },
- {
- 'name': 'itemloc_itemsite_id',
- 'type': 'int'
- },
- {
- 'name': 'itemloc_location_id',
- 'type': 'int'
- },
- {
- 'name': 'itemloc_qty',
- 'type': 'float'
- },
- {
- 'name': 'itemloc_expiration',
- 'type': 'date',
- 'dateFormat': 'Y-m-d'
- },
- {
- 'name': 'itemloc_consolflag',
- 'type': 'int'
- },
- {
- 'name': 'itemloc_ls_id',
- 'type': 'int'
- },
- {
- 'name': 'itemloc_warrpurc',
- 'type': 'date',
- 'dateFormat': 'Y-m-d'
- }
- ],
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- sortInfo : { field : 'location_name', direction: 'ASC' },
- xns : Roo.data,
- listeners : {
- beforeload : function (_self, o)
- {
- var sel = _this.grid.selModel.getSelectedCell();
- if (!sel) {
- this.removeAll();
- return false;
- }
- var rec = _this.grid.ds.getAt(sel[0]);
- o.params._stock_for_item_id = rec.data.item_id;
- //o.params['!itemloc_qty'] = 0;
-
-
- }
- },
- items : [
+ },
+ {
+ grid : {
+ dataSource : {
+ proxy : {
+ '|xns' : 'Roo.data',
+ method : 'GET',
+ url : baseURL + '/Roo/location.php',
+ xns : Roo.data,
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ '|xns' : 'Roo.data',
+ fields : [
+ {
+ 'name': 'itemloc_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'itemloc_itemsite_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'itemloc_location_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'itemloc_qty',
+ 'type': 'float'
+ },
+ {
+ 'name': 'itemloc_expiration',
+ 'type': 'date',
+ 'dateFormat': 'Y-m-d'
+ },
+ {
+ 'name': 'itemloc_consolflag',
+ 'type': 'int'
+ },
+ {
+ 'name': 'itemloc_ls_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'itemloc_warrpurc',
+ 'type': 'date',
+ 'dateFormat': 'Y-m-d'
+ }
+ ],
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ xtype : 'JsonReader'
+ },
+ '|xns' : 'Roo.data',
+ remoteSort : true,
+ sortInfo : { field : 'location_name', direction: 'ASC' },
+ xns : Roo.data,
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o)
+ {
+ var sel = _this.grid.selModel.getSelectedCell();
+ if (!sel) {
+ this.removeAll();
+ return false;
+ }
+ var rec = _this.grid.ds.getAt(sel[0]);
+ o.params._stock_for_item_id = rec.data.item_id;
+ //o.params['!itemloc_qty'] = 0;
+
+
+ }
+ },
+ items : [
- ]
+ ]
- },
- footer : {
- '|xns' : 'Roo',
- pageSize : 25,
- xtype : 'PagingToolbar',
- emptyMsg : "No itemloc found",
- xns : Roo,
- displayInfo : true,
- displayMsg : "Displaying itemloc{0} - {1} of {2}"
- },
- '|xns' : 'Roo.grid',
- autoExpandColumn : 'location_name',
- xtype : 'Grid',
- loadMask : true,
- xns : Roo.grid,
- colModel : [
- {
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- header : 'Location',
- width : 75,
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'location_name'
- },
+ },
+ footer : {
+ '|xns' : 'Roo',
+ displayInfo : true,
+ displayMsg : _this._strings['19029645d5286771ac708d1bcd118bf4'],
+ emptyMsg : _this._strings['2cfd827c6e37453fe1ddde82a5bd9474'],
+ pageSize : 25,
+ xns : Roo,
+ xtype : 'PagingToolbar'
+ },
+ '|xns' : 'Roo.grid',
+ autoExpandColumn : 'location_name',
+ loadMask : true,
+ xns : Roo.grid,
+ xtype : 'Grid',
+ colModel : [
+ {
+ '|xns' : 'Roo.grid',
+ dataIndex : 'location_name',
+ header : _this._strings['ce5bf551379459c1c61d2a204061c455'],
+ renderer : function(v) { return String.format('{0}', v); },
+ width : 75,
+ xns : Roo.grid,
+ xtype : 'ColumnModel'
+ },
{
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- header : 'Itemloc qty',
- width : 75,
- renderer : function(v) { return String.format('{0}', v*1 ? (v*1).toFixed(0) : ''); },
- xns : Roo.grid,
- dataIndex : 'itemloc_realqty'
- }
- ],
- listeners : {
- rowdblclick : function (_self, rowIndex, e)
- {
- if (!_this.dialog) return;
- _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
- _this.grid.footer.onClick('first');
- });
- },
- render : function()
- {
- _this.locgrid = this;
- //_this.dialog = Pman.Dialog.FILL_IN
-
- }
- },
- items : [
+ '|xns' : 'Roo.grid',
+ dataIndex : 'itemloc_realqty',
+ header : _this._strings['156567f65fc207d39cadbf045687c521'],
+ renderer : function(v) { return String.format('{0}', v*1 ? (v*1).toFixed(0) : ''); },
+ width : 75,
+ xns : Roo.grid,
+ xtype : 'ColumnModel'
+ }
+ ],
+ listeners : {
+ render : function()
+ {
+ _this.locgrid = this;
+ //_this.dialog = Pman.Dialog.FILL_IN
+
+ },
+ rowdblclick : function (_self, rowIndex, e)
+ {
+ if (!_this.dialog) return;
+ _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
+ _this.grid.footer.onClick('first');
+ });
+ }
+ },
+ items : [
- ]
+ ]
- },
- '|xns' : 'Roo',
- fitToframe : true,
- background : true,
- region : 'east',
- title : "itemloc",
- xtype : 'GridPanel',
- fitContainer : true,
- xns : Roo,
- tableName : 'itemloc',
- listeners : {
- activate : function() {
- _this.locpanel = this;
-
- }
- },
- items : [
+ },
+ '|xns' : 'Roo',
+ background : true,
+ fitContainer : true,
+ fitToframe : true,
+ region : 'east',
+ tableName : 'itemloc',
+ title : _this._strings['759d259249621c817551c5fe726d5c57'],
+ xns : Roo,
+ xtype : 'GridPanel',
+ listeners : {
+ activate : function() {
+ _this.locpanel = this;
+
+ }
+ },
+ items : [
- ]
+ ]
- }
- ]
+ }
+ ]
- },
- '|xns' : 'Roo',
- background : false,
- region : 'center',
- title : "Products",
- xtype : 'NestedLayoutPanel',
- xns : Roo,
- items : [
+ },
+ '|xns' : 'Roo',
+ background : false,
+ region : 'center',
+ title : _this._strings['068f80c7519d0528fb08e82137a72131'],
+ xns : Roo,
+ xtype : 'NestedLayoutPanel',
+ items : [
- ]
+ ]
- }; }
+ }; }
});