{ "name" : "Pman.Dialog.XtupleItem", "parent" : "", "title" : "", "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleItem.bjs", "permname" : "", "modOrder" : "001", "items" : [ { "listeners" : { "show" : "function (_self)\n{\n _this.dialog.layout.getRegion('center').showPanel(0);\n}" }, "modal" : true, "collapsible" : false, "title" : "Edit / Create item", "xtype" : "LayoutDialog", "width" : 800, "$ xns" : "Roo", "closable" : false, "resizable" : false, "height" : 550, "items" : [ { "alwaysShowTabs" : true, "xtype" : "LayoutRegion", "tabPosition" : "top", "$ xns" : "Roo", "* prop" : "center" }, { "region" : "center", "xtype" : "ContentPanel", "title" : "Detail", "$ xns" : "Roo", "items" : [ { "listeners" : { "|actioncomplete" : "function(_self,action)\n{\n if (action.type == 'setdata') {\n _this.form.findField('item_number').el.dom.readOnly = true;\n _this.form.findField('item_type').disabled = true; \n \n if(_this.data.item_id * 1 > 0){\n \n this.load({ \n method: 'GET', \n params: {\n '_id' : _this.data.item_id,\n '_with_itemsite' : 1,\n '_with_itemcost' : 1,\n '_with_prodcat' : 1 ,\n '_with_salesaccnt' : 1 \n }\n });\n return;\n }\n // if it's new..\n _this.form.findField('item_number').el.dom.readOnly = false;\n _this.form.findField('item_type').disabled = false; \n _this.form.findField('item_salesaccnt').setValue('');\n \n _this.form.findField('item_type').showHide();\n \n return;\n }\n if (action.type == 'load') {\n _this.form.findField('item_type').showHide();\n return;\n }\n if (action.type =='submit') {\n \n var id = _this.form.findField('item_id').getValue() * 1;\n if (id < 1) {\n \n this.load({ \n method: 'GET', \n params: {\n '_id' : action.result.data.item_id,\n '_with_itemsite' : 1,\n '_with_itemcost' : 1,\n '_with_prodcat' : 1 ,\n '_with_salesaccnt' : 1 \n }\n });\n return;\n }\n _this.dialog.hide();\n \n if (_this.callback) {\n _this.callback.call(_this, _this.form.getValues());\n }\n _this.form.reset();\n return;\n }\n}\n", "|rendered" : "function (form)\n{\n _this.form= form;\n}\n" }, "$ url" : "baseURL + '/Roo/item.php'", "style" : "margin:10px;", "method" : "POST", "xtype" : "Form", "labelWidth" : 120, "$ xns" : "Roo.form", "items" : [ { "fieldLabel" : "SKU", "xtype" : "TextField", "allowBlank" : false, "width" : 200, "$ xns" : "Roo.form", "name" : "item_number" }, { "fieldLabel" : "Description", "xtype" : "TextField", "width" : 400, "$ xns" : "Roo.form", "name" : "item_descrip1" }, { "fieldLabel" : "Description (2)", "xtype" : "TextField", "width" : 400, "$ xns" : "Roo.form", "name" : "item_descrip2" }, { "xtype" : "Column", "labelWidth" : 120, "$ xns" : "Roo.form", "items" : [ { "listeners" : { "beforeselect" : "function (combo, record, index)\n{\n (function() { combo.showHide(); }).defer(100);\n}" }, "listWidth" : 200, "triggerAction" : "all", "fieldLabel" : "Type", "displayField" : "fname", "emptyText" : "Select Type", "hiddenName" : "item_type", "valueField" : "ftype", "xtype" : "ComboBox", "allowBlank" : false, "$ showHide" : "function() {\n\n var it = this.getValue();\n \n var options = [ \n 'item_itemcost_id_itemcost_curr_id',\n 'item_itemcost_id_itemcost_actcost',\n 'item_itemsite_id_itemsite_reorderlevel',\n 'item_itemsite_id_itemsite_leadtime',\n 'item_itemsite_id_itemsite_location_id',\n 'item_itemsite_id_itemsite_loccntrl',\n 'item_itemsite_id_itemsite_stocked',\n 'item_itemsite_id_itemsite_perishable',\n \n 'item_itemsite_id_itemsite_safetystock',\n 'item_itemsite_id_itemsite_controlmethod',\n 'item_itemsite_id_itemsite_plancode_id',\n 'item_itemsite_id_itemsite_costcat_id',\n 'item_itemsite_id_itemsite_active',\n 'item_itemsite_id_itemsite_sold'\n \n ];\n \n var r_req = [ \n 'item_listprice'\n ];\n \n var state = true;\n \n _this.standardCostFieldSet.show();\n _this.itemsiteFieldSet.show();\n\n \n switch(it) {\n case 'K':\n state = false;\n\n _this.form.findField('item_listprice').allowBlank = false;\n _this.form.findField('item_listprice').actionMode = 'fieldEl';\n _this.form.findField('item_listprice').hideMode = 'display';\n _this.form.findField('item_listprice').show();\n \n break;\n \n case 'R': // refrence\n options = options.concat(r_req);\n state = false;\n _this.standardCostFieldSet.hide();\n break;\n \n case 'P': // purchased..\n options = options.concat(r_req);\n // must have\n break;\n }\n \n Roo.each(options, function(n) {\n var ff = _this.form.findField(n);\n ff.allowBlank = !state;\n ff.actionMode = 'fieldEl';\n ff.hideMode = 'display';\n state ? ff.show() : ff.hide(); \n \n });\n \n \n if(!state){\n _this.standardCostFieldSet.hide();\n _this.itemsiteFieldSet.hide();\n\n }\n \n \n \n}\n", "editable" : false, "width" : 200, "$ xns" : "Roo.form", "mode" : "local", "name" : "item_type_name", "tpl" : "
{fname}
", "items" : [ { "xtype" : "SimpleStore", "$ data" : "[ \n [ 'P', \"Purchased (eg. a standard product)\"],\n [ 'R' , \"Reference (Non-Product)\"],\n [ 'K', \"Kit (made up of products)\"] \n]\n", "$ fields" : "[ 'ftype', 'fname']", "$ xns" : "Roo.data", "* prop" : "store" } ] }, { "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Class", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "classcode_code", "emptyText" : "Select classcode", "hiddenName" : "item_classcode_id", "minChars" : 2, "valueField" : "classcode_id", "xtype" : "ComboBox", "allowBlank" : false, "typeAhead" : true, "editable" : false, "width" : 200, "$ xns" : "Roo.form", "name" : "item_classcode_id_classcode_code", "qtip" : "Select classcode", "queryParam" : "", "tpl" : "
{classcode_code}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'id' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/classcode.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"classcode_code\",\"type\":\"string\"}]", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Invoice UOM", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "uom_descrip", "emptyText" : "Select uom", "hiddenName" : "item_inv_uom_id", "minChars" : 2, "valueField" : "uom_id", "xtype" : "ComboBox", "allowBlank" : false, "typeAhead" : true, "editable" : false, "width" : 200, "$ xns" : "Roo.form", "name" : "item_inv_uom_id_uom_descrip", "qtip" : "Select classcode", "queryParam" : "", "tpl" : "
{uom_descrip}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'uom_name' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/uom.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[\n {\"name\":\"id\",\"type\":\"int\"},\n {\"name\":\"uom_name\",\"type\":\"string\"},\n {\"name\":\"uom_descrip\",\"type\":\"string\"},\n]", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Price UOM", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "uom_descrip", "emptyText" : "Select uom", "hiddenName" : "item_price_uom_id", "minChars" : 2, "valueField" : "uom_id", "xtype" : "ComboBox", "allowBlank" : false, "typeAhead" : true, "editable" : false, "width" : 200, "$ xns" : "Roo.form", "name" : "item_price_uom_id_uom_descrip", "qtip" : "Select classcode", "queryParam" : "", "tpl" : "
{uom_descrip}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'uom_name' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/uom.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[\n {\"name\":\"id\",\"type\":\"int\"},\n {\"name\":\"uom_name\",\"type\":\"string\"},\n {\"name\":\"uom_descrip\",\"type\":\"string\"},\n]", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "fieldLabel" : "Weight", "xtype" : "NumberField", "allowBlank" : false, "allowDecimals" : true, "decimalPrecision" : 2, "width" : 200, "$ xns" : "Roo.form", "name" : "item_prodweight" }, { "fieldLabel" : "Item comments", "xtype" : "TextArea", "width" : 200, "$ xns" : "Roo.form", "name" : "item_comments", "height" : 100 }, { "fieldLabel" : "Item sold", "inputValue" : true, "xtype" : "Checkbox", "valueOff" : 0, "width" : 75, "$ xns" : "Roo.form", "name" : "item_sold" }, { "fieldLabel" : "Item active", "inputValue" : true, "xtype" : "Checkbox", "valueOff" : 0, "width" : 75, "$ xns" : "Roo.form", "name" : "item_active" }, { "listeners" : { "add" : "function (combo)\n{\n Pman.Dialog.XtupleProdcat.show({prodcat_id : 0});\n}", "edit" : "function (combo, record)\n{\n var s = _this.form.findField('item_prodcat_id').getValue() * 1;\n if(s < 1){\n Roo.MessageBox.alert('Error','Please select a account assignment');\n return;\n }\n Pman.Dialog.XtupleProdcat.show({prodcat_id : s});\n}" }, "alwaysQuery" : true, "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Product Category", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "prodcat_code", "emptyText" : "Select Category", "hiddenName" : "item_prodcat_id", "minChars" : 2, "valueField" : "prodcat_id", "xtype" : "ComboBox", "allowBlank" : false, "typeAhead" : true, "editable" : false, "width" : 200, "$ xns" : "Roo.form", "name" : "item_prodcat_id_prodcat_code", "qtip" : "Select prodcat", "queryParam" : "", "tpl" : "
{prodcat_code}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ xns" : "Roo.data", "$ sortInfo" : "{ direction : 'ASC', field: 'id' }", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/prodcat.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"prodcat_code\",\"type\":\"string\"}]", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "fieldLabel" : "Sales Account", "xtype" : "DisplayField", "$ xns" : "Roo.form", "name" : "item_salesaccnt" }, { "fieldLabel" : "Item listprice", "xtype" : "NumberField", "width" : 200, "$ xns" : "Roo.form", "name" : "item_listprice" }, { "listeners" : { "render" : "function (_self)\n{\n _this.standardCostFieldSet = _self;\n}" }, "xtype" : "FieldSet", "legend" : "Standard Cost", "style" : "width:320px", "$ xns" : "Roo.form", "items" : [ { "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Currency", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "curr_name", "emptyText" : "Select Currency", "hiddenName" : "item_itemcost_id_itemcost_curr_id", "minChars" : 2, "valueField" : "curr_id", "xtype" : "ComboBox", "allowBlank" : false, "typeAhead" : true, "editable" : false, "width" : 200, "$ xns" : "Roo.form", "name" : "curr_name", "qtip" : "Select Currency", "queryParam" : "query[curr_name]", "tpl" : "
{curr_name}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n \n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'curr_symbol' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/curr_symbol.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "curr_id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[{\"name\":\"curr_id\",\"type\":\"int\"},\"curr_symbol\"]", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "fieldLabel" : "Value", "xtype" : "NumberField", "allowBlank" : false, "width" : 200, "$ xns" : "Roo.form", "name" : "item_itemcost_id_itemcost_actcost" } ] } ] }, { "xtype" : "Column", "$ xns" : "Roo.form", "items" : [ { "listeners" : { "render" : "function (_self)\n{\n _this.itemsiteFieldSet = _self;\n}" }, "xtype" : "FieldSet", "legend" : "Itemsite Settings", "$ xns" : "Roo.form", "String/Object/Function style" : "width:335px;", "Number labelWidth" : 120, "items" : [ { "fieldLabel" : "Reorder Level", "xtype" : "NumberField", "allowBlank" : false, "width" : 200, "$ xns" : "Roo.form", "name" : "item_itemsite_id_itemsite_reorderlevel" }, { "fieldLabel" : "Stock Safety Level", "xtype" : "NumberField", "allowBlank" : false, "width" : 200, "$ xns" : "Roo.form", "name" : "item_itemsite_id_itemsite_safetystock" }, { "fieldLabel" : "Lead time (Days)", "xtype" : "NumberField", "allowBlank" : false, "width" : 200, "$ xns" : "Roo.form", "name" : "item_itemsite_id_itemsite_leadtime" }, { "listWidth" : 200, "triggerAction" : "all", "fieldLabel" : "Control Method", "displayField" : "fname", "hiddenName" : "item_itemsite_id_itemsite_controlmethod", "valueField" : "ftype", "xtype" : "ComboBox", "allowBlank" : false, "editable" : false, "width" : 200, "$ xns" : "Roo.form", "mode" : "local", "name" : "item_itemsite_id_itemsite_controlmethod_name", "tpl" : "
{fname}
", "items" : [ { "xtype" : "SimpleStore", "$ data" : "[ \n [ 'N', \"None\"],\n [ 'R' , \"Regular\"]\n]\n", "$ fields" : "[ 'ftype', 'fname']", "$ xns" : "Roo.data", "* prop" : "store" } ] }, { "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Planner Code", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "plancode_name", "emptyText" : "Select plancode", "hiddenName" : "item_itemsite_id_itemsite_plancode_id", "minChars" : 2, "valueField" : "plancode_id", "xtype" : "ComboBox", "allowBlank" : false, "typeAhead" : true, "editable" : false, "width" : 200, "$ xns" : "Roo.form", "name" : "plancode_name", "qtip" : "Select plancode", "queryParam" : "", "tpl" : "
{plancode_name}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ xns" : "Roo.data", "$ sortInfo" : "{ direction : 'ASC', field: 'id' }", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/plancode.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"plancode_code\",\"type\":\"string\"}]", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Costcat", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "costcat_code", "emptyText" : "Select costcat", "hiddenName" : "item_itemsite_id_itemsite_costcat_id", "minChars" : 2, "valueField" : "costcat_id", "xtype" : "ComboBox", "allowBlank" : false, "typeAhead" : true, "editable" : false, "width" : 200, "$ xns" : "Roo.form", "name" : "costcat_code", "qtip" : "Select costcat", "queryParam" : "", "tpl" : "
{costcat_code}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ xns" : "Roo.data", "$ sortInfo" : "{ direction : 'ASC', field: 'id' }", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/costcat.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"costcat_code\",\"type\":\"string\"}]", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "fieldLabel" : "Active", "inputValue" : true, "xtype" : "Checkbox", "valueOff" : 0, "width" : 75, "$ xns" : "Roo.form", "name" : "item_itemsite_id_itemsite_active" }, { "fieldLabel" : "Sold", "inputValue" : true, "xtype" : "Checkbox", "valueOff" : 0, "width" : 75, "$ xns" : "Roo.form", "name" : "item_itemsite_id_itemsite_sold" }, { "fieldLabel" : "Stocked", "inputValue" : true, "xtype" : "Checkbox", "valueOff" : 0, "width" : 75, "$ xns" : "Roo.form", "name" : "item_itemsite_id_itemsite_stocked" }, { "fieldLabel" : "Perishable", "inputValue" : true, "xtype" : "Checkbox", "valueOff" : 0, "width" : 75, "$ xns" : "Roo.form", "name" : "item_itemsite_id_itemsite_perishable" }, { "fieldLabel" : "Multi Location", "inputValue" : true, "xtype" : "Checkbox", "valueOff" : 0, "width" : 100, "$ xns" : "Roo.form", "name" : "item_itemsite_id_itemsite_loccntrl" }, { "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Default Location", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 200, "displayField" : "location_name", "emptyText" : "Default Location", "hiddenName" : "item_itemsite_id_itemsite_location_id", "minChars" : 2, "valueField" : "location_id", "xtype" : "ComboBox", "allowBlank" : false, "typeAhead" : false, "editable" : true, "width" : 200, "$ xns" : "Roo.form", "name" : "location_name", "qtip" : "Select terms", "queryParam" : "query[location_name]", "tpl" : "
{location_name}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params.location_netable = 1;\n o.params._notinternalcompany = 1;\n o.params.location_restrict = 0;\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'location_name' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/location.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "location_id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[{\"name\":\"location_id\",\"type\":\"int\"},\"location_name\"]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] } ] } ] }, { "xtype" : "Hidden", "width" : 75, "$ xns" : "Roo.form", "name" : "item_id" } ] } ] }, { "listeners" : { "|activate" : "function() {\n _this.partspanel = this;\n \n try { if (MODULE.isBuilder) {\n return;\n } } catch(e) { }\n \n var id = _this.form.findField('item_id').getValue() * 1;\n if (id < 1) {\n Roo.MessageBox.alert(\"Save First\", \"Save the item first, before adding parts\");\n _this.dialog.layout.getRegion('center').showPanel(0);\n return;\n }\n \n var type = _this.form.findField('item_type').getValue();\n \n if(!type.length || type != 'K'){\n Roo.MessageBox.alert(\"Error\", \"Can't add parts to non-kit item\");\n _this.dialog.layout.getRegion('center').showPanel(0);\n return;\n }\n \n if (_this.partsgrid) {\n _this.partsgrid.footer.onClick('first');\n \n }\n}" }, "region" : "center", "fitToframe" : true, "background" : true, "title" : "Item Parts", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "tableName" : "bomitem", "items" : [ { "listeners" : { "beforeedit" : "function (e)\n{\n if(e.field != 'bomitem_qtyper'){\n return false;\n }\n \n}", "|render" : "function() \n{\n _this.partsgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.partspanel.active) {\n this.footer.onClick('first');\n }\n}", "afteredit" : "function (e)\n{\n if(e.originalValue == e.value){\n return false;\n }\n \n \n new Pman.Request({\n method : 'POST',\n url : baseURL + '/Roo/bomitem.php',\n mask : 'Saving',\n params : {\n bomitem_id : e.record.data.bomitem_id,\n bomitem_qtyper : e.value\n },\n success : function() {\n e.record.set('bomitem_qtyper', e.value);\n }\n \n });\n \n \n \n \n}" }, "autoExpandColumn" : "bomitem_item_id_item_descrip1", "xtype" : "EditorGrid", "loadMask" : true, "clicksToEdit" : 1, "$ xns" : "Roo.grid", "* prop" : "grid", "items" : [ { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "listeners" : { "render" : "function (_self)\n{\n _this.partsBox = _self;\n}", "select" : "function (combo, record, index)\n{\n var item_id = _this.form.findField('item_id').getValue() * 1;\n \n if(typeof(record) == 'undefined' || !record || record.data.id * 1 < 1 || item_id < 1){\n return;\n }\n \n var err = false;\n\n _this.partsgrid.ds.each(function(d){\n if(record.data.item_id == d.data.bomitem_item_id){\n err = true;\n }\n });\n\n if(err){\n Roo.MessageBox.alert('Error', record.data.item_number + ' already exists!');\n _this.partsBox.reset();\n return;\n }\n \n new Pman.Request({\n url : baseURL + '/Roo/bomitem.php',\n method : 'POST',\n params : {\n bomitem_parent_item_id : item_id,\n bomitem_item_id : record.data.item_id,\n bomitem_qtyper : 1\n }, \n success : function(res) {\n _this.partsBox.reset();\n _this.partsgrid.footer.onClick('first');\n }\n }); \n}" }, "alwaysQuery" : true, "triggerAction" : "all", "fieldLabel" : "Item", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "item_number", "emptyText" : "Select item", "minChars" : 2, "valueField" : "id", "xtype" : "ComboBox", "allowBlank" : true, "typeAhead" : true, "editable" : true, "width" : 200, "$ xns" : "Roo.bootstrap", "qtip" : "Select item", "queryParam" : "query[number_or_name]", "tpl" : "
{item_number}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n \n o.params.item_active = 1;\n o.params['!item_type'] = 'K';\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'item_number' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/item.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n {\"name\":\"id\",\"type\":\"int\"},\n {\"name\":\"item_number\",\"type\":\"string\"}\n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "xtype" : "Fill", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "|click" : "function ()\n{\n var sel = _this.partsgrid.getSelectionModel().getSelectedCell();\n \n if(!sel || !sel.length){\n Roo.MessageBox.alert(\"Error\", \"Please select a item from below list\");\n return;\n }\n \n var d = _this.partsgrid.ds.getAt(sel[0]); \n \n if(d.data.bomitem_id * 1 < 1){\n Roo.MessageBox.alert(\"Error\", \"Invaild selection\");\n return;\n }\n \n new Pman.Request({\n url : baseURL + '/Roo/bomitem.php',\n method : 'POST',\n params : {\n _delete : d.data.bomitem_id\n }, \n success : function(res) {\n _this.partsgrid.footer.onClick('first');\n }\n }); \n \n}" }, "text" : "Remove", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'", "$ xns" : "Roo" } ] }, { "listeners" : { "beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n \n var id = _this.form.findField('item_id').getValue() * 1;\n if(id < 1){\n return false;\n }\n \n o.params.bom_parent_item_id = id;\n}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field : 'bomitem_item_id_item_name', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "dataSource", "items" : [ { "$ url" : "baseURL + '/Roo/bomitem.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "bom_id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n {\n 'name': 'bomitem_id',\n 'type': 'int'\n }\n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] }, { "pageSize" : 50, "xtype" : "PagingToolbar", "emptyMsg" : "Nothing found", "$ xns" : "Roo", "displayMsg" : "Displaying parts {0} - {1} of {2}", "displayInfo" : true, "* prop" : "footer" }, { "xtype" : "ColumnModel", "width" : 150, "header" : "Name", "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "bomitem_item_id_item_number" }, { "xtype" : "ColumnModel", "width" : 150, "header" : "Description", "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "bomitem_item_id_item_descrip1" }, { "xtype" : "ColumnModel", "String align" : "right", "header" : "Qty", "width" : 100, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "bomitem_qtyper", "items" : [ { "xtype" : "GridEditor", "$ xns" : "Roo.grid", "* prop" : "editor", "items" : [ { "Boolean allowBlank" : false, "String cls" : "align-right", "xtype" : "NumberField", "Number decimalPrecision" : 0, "$ xns" : "Roo.form", "* prop" : "field", "Number minValue" : 0 } ] } ] } ] } ] }, { "listeners" : { "|activate" : "function() {\n _this.panel = this;\n \n try { if (MODULE.isBuilder) {\n return;\n } } catch(e) { }\n \n var id = _this.form.findField('item_id').getValue() * 1;\n if (id < 1) {\n Roo.MessageBox.alert(\"Save First\", \"Save the item first, before adding image\");\n _this.dialog.layout.getRegion('center').showPanel(0);\n return;\n }\n \n if (_this.grid) {\n _this.grid.footer.onClick('first');\n \n }\n}" }, "fitToframe" : true, "background" : true, "region" : "center", "title" : "Reference Files", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "tableName" : "Images", "items" : [ { "listeners" : { "|rowdblclick" : "function (_self, rowIndex, e)\n{\n \n var s = _self.getDataSource().getAt(rowIndex);\n new Pman.Download({\n url : baseURL + '/Images/Download/' + s.data.id\n });\n \n}", "|render" : "function() { \n _this.grid = this; \n\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}" }, "autoExpandColumn" : "id", "xtype" : "Grid", "loadMask" : true, "$ xns" : "Roo.grid", "* prop" : "grid", "items" : [ { "listeners" : { "beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n \n var id = _this.form.findField('item_id').getValue();\n \n if(id * 1 < 1){\n return false;\n }\n \n o.params.onid = id;\n o.params.ontable = 'item';\n \n}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field: 'created' , direction: 'DESC' }", "$ xns" : "Roo.data", "* prop" : "dataSource", "items" : [ { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'filename',\n 'type': 'string'\n },\n {\n 'name': 'ontable',\n 'type': 'string'\n },\n {\n 'name': 'onid',\n 'type': 'int'\n },\n {\n 'name': 'mimetype',\n 'type': 'string'\n },\n {\n 'name': 'width',\n 'type': 'int'\n },\n {\n 'name': 'height',\n 'type': 'int'\n },\n {\n 'name': 'filesize',\n 'type': 'int'\n },\n {\n 'name': 'displayorder',\n 'type': 'int'\n },\n {\n 'name': 'language',\n 'type': 'string'\n },\n {\n 'name': 'parent_image_id',\n 'type': 'int'\n },\n {\n 'name': 'created',\n 'type': 'date',\n 'dateFormat' : 'Y-m-d H:i:s'\n },\n {\n 'name': 'imgtype',\n 'type': 'string'\n },\n {\n 'name': 'linkurl',\n 'type': 'string'\n },\n {\n 'name': 'descript',\n 'type': 'string'\n },\n {\n 'name': 'title',\n 'type': 'string'\n }\n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" }, { "$ url" : "baseURL + '/Roo/Images.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" } ] }, { "pageSize" : 25, "xtype" : "PagingToolbar", "emptyMsg" : "No Images found", "$ xns" : "Roo", "displayInfo" : true, "displayMsg" : "Displaying Images {0} - {1} of {2}", "* prop" : "footer" }, { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "listeners" : { "|click" : "function()\n{\n Pman.Dialog.Image.show({\n id : 0, \n ontable: 'item',\n onid: _this.form.findField('item_id').getValue() * 1,\n imgtype : ''\n }, function(data){\n if (!data) { return; } \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 Pman.genericDelete(_this, 'Images'); \n}\n " }, "text" : "Delete", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'", "$ xns" : "Roo.Toolbar" } ] }, { "xtype" : "ColumnModel", "sortable" : true, "header" : "Created", "width" : 200, "$ renderer" : "function(v,x,r) {\n return String.format('{0}
{1}
{2}
{3}x{4}',\n v.format('d/M/Y'), r.data.mimetype, r.data.filename,\n r.data.width, r.data.height\n ); \n}\n ", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "created" }, { "xtype" : "ColumnModel", "header" : "Image", "width" : 100, "$ renderer" : "function(v,x,r) { return String.format('', baseURL, v, r.data.filename); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "id" } ] } ] }, { "listeners" : { "|activate" : "function() {\n _this.lpanel = this;\n \n try { if (MODULE.isBuilder) {\n return;\n } } catch(e) { }\n \n var id = _this.form.findField('item_id').getValue() * 1;\n if (id < 1) {\n Roo.MessageBox.alert(\"Save First\", \"Save the item first, before adding image\");\n _this.dialog.layout.getRegion('center').showPanel(0);\n return;\n }\n \n if (_this.lgrid) {\n _this.lgrid.footer.onClick('first');\n \n }\n}" }, "fitToframe" : true, "background" : true, "region" : "center", "title" : "Price List", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "tableName" : "ipshead", "items" : [ { "listeners" : { "beforeedit" : "function (e)\n{\n if(e.field != 'ipshead_ipsitem_price'){\n return false;\n }\n \n}", "|render" : "function() \n{\n _this.lgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.lpanel.active) {\n this.footer.onClick('first');\n }\n}", "afteredit" : "function (e)\n{\n if(e.originalValue == e.value){\n return false;\n }\n \n var id = _this.form.findField('item_id').getValue() * 1;\n if(id < 1){\n return false;\n }\n \n new Pman.Request({\n method : 'POST',\n url : baseURL + '/Roo/ipsiteminfo',\n mask : 'Saving',\n params : {\n ipsitem_ipshead_id : e.record.data.ipshead_id,\n ipsitem_item_id : id,\n ipsitem_price : e.record.data.ipshead_ipsitem_price,\n ipsitem_id : e.record.data.ipshead_ipsitem_id\n }\n \n });\n \n \n \n \n}" }, "autoExpandColumn" : "ipshead_descrip", "xtype" : "EditorGrid", "loadMask" : true, "clicksToEdit" : 1, "$ xns" : "Roo.grid", "* prop" : "grid", "items" : [ { "listeners" : { "beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n \n var id = _this.form.findField('item_id').getValue() * 1;\n if(id < 1){\n return false;\n }\n \n o.params._with_item = id;\n}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field : 'ipshead_id', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "dataSource", "items" : [ { "$ url" : "baseURL + '/Roo/ipshead.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "ipshead_id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n {\n 'name': 'ipshead_id',\n 'type': 'int'\n },\n {\n 'name': 'ipshead_name',\n 'type': 'string'\n }\n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] }, { "pageSize" : 50, "xtype" : "PagingToolbar", "emptyMsg" : "Nothing found", "$ xns" : "Roo", "displayMsg" : "Displaying records {0} - {1} of {2}", "displayInfo" : true, "* prop" : "footer" }, { "xtype" : "ColumnModel", "header" : "Name", "width" : 150, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "ipshead_name" }, { "xtype" : "ColumnModel", "header" : "Description", "width" : 150, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "ipshead_descrip" }, { "xtype" : "ColumnModel", "header" : "Currency", "width" : 100, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "ipshead_curr_id_curr_name" }, { "align" : "right", "xtype" : "ColumnModel", "header" : "Price", "width" : 120, "$ renderer" : "function(v) { return String.format('{0}', Roo.util.Format.number(v*1,2)); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "ipshead_ipsitem_price", "items" : [ { "xtype" : "GridEditor", "$ xns" : "Roo.grid", "* prop" : "editor", "items" : [ { "xtype" : "NumberField", "cls" : "align-right", "decimalPrecision" : 2, "$ xns" : "Roo.form", "* prop" : "field" } ] } ] } ] } ] }, { "listeners" : { "|activate" : "function() {\n _this.itemsrcpanel = this;\n \n try { if (MODULE.isBuilder) {\n return;\n } } catch(e) { }\n \n var id = _this.form.findField('item_id').getValue() * 1;\n if (id < 1) {\n Roo.MessageBox.alert(\"Save First\", \"Save the item first, before adding suppliers\");\n _this.dialog.layout.getRegion('center').showPanel(0);\n return false;\n }\n \n var type = _this.form.findField('item_type').getValue();\n \n if(type == 'K'){\n Roo.MessageBox.alert(\"Error\", \"Can't add suppliers to kit item\");\n _this.dialog.layout.getRegion('center').showPanel(0);\n return false;\n }\n \n if (_this.itemsrcgrid) {\n _this.itemsrcgrid.footer.onClick('first');\n }\n}" }, "fitToframe" : true, "background" : true, "region" : "center", "title" : "Suppliers", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "tableName" : "itemsrc", "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.itemsrcgrid = this; \n \n if (_this.itemsrcpanel.active) {\n this.footer.onClick('first');\n }\n}", "afteredit" : "function (e)\n{\n e.record.commit();\n}" }, "autoExpandColumn" : "itemsrc_comments", "xtype" : "EditorGrid", "loadMask" : true, "clicksToEdit" : 1, "$ xns" : "Roo.grid", "* prop" : "grid", "items" : [ { "listeners" : { "update" : "function (_self, record, operation)\n{\n Roo.log(operation);\n Roo.log(record);\n \n if (operation != 'commit') {\n return;\n }\n if (record.data.itemsrc_vend_id * 1 < 1) {\n return; // do not save.\n }\n if (record.data.itemsrc_id * 1 < 0) {\n return; // do not save. -- updating at present...\n }\n \n var p = Roo.apply({}, record.data);\n record.set('itemsrc_id', -1); \n \n new Pman.Request({\n url : baseURL + '/Roo/Itemsrc',\n params : p,\n method : 'POST',\n success: function(res) {\n if (record.data.itemsrc_id *1 < 1) { \n record.set('itemsrc_id', res.data.itemsrc_id);\n }\n }\n });\n \n \n}", "beforeload" : "function (_self, o)\n{\n \n var id = 1 * _this.form.findField('item_id').getValue();\n if (!id) {\n this.removeAll();\n return false;\n }\n o.params.itemsrc_item_id = id;\n}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field : 'itemsrc_vend_id_vend_name', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "dataSource", "items" : [ { "$ url" : "baseURL + '/Roo/itemsrc.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[\n {\n 'name': 'itemsrc_id',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_item_id',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_item_id',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_vend_id',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_vend_id',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_vend_item_number',\n 'type': 'string'\n },\n {\n 'name': 'itemsrc_vend_item_descrip',\n 'type': 'string'\n },\n {\n 'name': 'itemsrc_comments',\n 'type': 'string'\n },\n {\n 'name': 'itemsrc_vend_uom',\n 'type': 'string'\n },\n {\n 'name': 'itemsrc_invvendoruomratio',\n 'type': 'float'\n },\n {\n 'name': 'itemsrc_minordqty',\n 'type': 'float'\n },\n {\n 'name': 'itemsrc_multordqty',\n 'type': 'float'\n },\n {\n 'name': 'itemsrc_leadtime',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_ranking',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_active',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_manuf_name',\n 'type': 'string'\n },\n {\n 'name': 'itemsrc_manuf_item_number',\n 'type': 'string'\n },\n {\n 'name': 'itemsrc_manuf_item_descrip',\n 'type': 'string'\n },\n {\n 'name': 'itemsrc_default',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_upccode',\n 'type': 'string'\n }\n]", "* prop" : "reader", "totalProperty" : "total" } ] }, { "pageSize" : 25, "xtype" : "PagingToolbar", "emptyMsg" : "No itemsrc found", "$ xns" : "Roo", "displayInfo" : true, "displayMsg" : "Displaying itemsrc{0} - {1} of {2}", "* prop" : "footer" }, { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "listeners" : { "|click" : "function()\n{\n \n Roo.log(\"add presed\");\n \n // work out last \n var grid = _this.itemsrcgrid;\n \n // uses form defaults or last row value.\n var nr = grid.ds.reader.newRow({\n itemsrc_id : 0,\n itemsrc_item_id : _this.form.findField('item_id').getValue(),\n itemsrc_vend_id : 0,\n itemsrc_vend_id_vend_name : '',\n itemsrc_vend_item_number : '',\n itemsrc_vend_item_descrip : '',\n itemsrc_comments : '',\n itemsrc_vend_uom : 'EA',\n itemsrc_invvendoruomratio : 1.0,\n itemsrc_minordqty : 0,\n itemsrc_multordqty : 0,\n itemsrc_leadtime : 30,\n itemsrc_ranking : 0,\n itemsrc_active : true,\n itemsrc_manuf_name : '',\n itemsrc_manuf_item_number : '',\n itemsrc_manuf_item_descrip: '',\n itemsrc_default : true,\n itemsrc_upccode : ''\n \n });\n grid.stopEditing();\n grid.ds.insert(0, nr); \n grid.startEditing(0, 0); // type..\n\n}\n \n" }, "text" : "Add", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'", "$ xns" : "Roo.Toolbar" } ] }, { "xtype" : "ColumnModel", "header" : "Vendor", "width" : 120, "$ renderer" : "function(v,x,r) { return String.format('{0}', r.data.itemsrc_vend_id_vend_name); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "itemsrc_vend_id", "items" : [ { "xtype" : "GridEditor", "$ xns" : "Roo.grid", "* prop" : "editor", "items" : [ { "listWidth" : 400, "triggerAction" : "all", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "vend_name", "emptyText" : "Select Vendor", "hiddenName" : "itemsrc_vend_id", "minChars" : 2, "valueField" : "vend_id", "xtype" : "ComboBox", "allowBlank" : false, "typeAhead" : true, "editable" : true, "width" : 300, "$ xns" : "Roo.form", "* prop" : "field", "name" : "itemsrc_vend_id_vend_name", "qtip" : "Select vendinfo", "queryParam" : "q[search]", "tpl" : "
{vend_name}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ xns" : "Roo.data", "$ sortInfo" : "{ direction : 'ASC', field: 'id' }", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/vendinfo.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"vend_name\",\"type\":\"string\"}]", "* prop" : "reader", "totalProperty" : "total" } ] } ] } ] } ] }, { "xtype" : "ColumnModel", "header" : "Vendor Ref#", "width" : 100, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "itemsrc_vend_item_number", "items" : [ { "xtype" : "GridEditor", "$ xns" : "Roo.grid", "* prop" : "editor", "items" : [ { "xtype" : "TextField", "$ xns" : "Roo.form", "* prop" : "field" } ] } ] }, { "xtype" : "ColumnModel", "header" : "Comments", "width" : 200, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "itemsrc_comments", "items" : [ { "xtype" : "GridEditor", "$ xns" : "Roo.grid", "* prop" : "editor", "items" : [ { "xtype" : "TextField", "$ xns" : "Roo.form", "* prop" : "field" } ] } ] }, { "xtype" : "ColumnModel", "header" : "UOM", "width" : 50, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "itemsrc_vend_uom" }, { "align" : "right", "xtype" : "ColumnModel", "header" : "Min Qty", "width" : 50, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "itemsrc_minordqty", "items" : [ { "xtype" : "GridEditor", "$ xns" : "Roo.grid", "* prop" : "editor", "items" : [ { "minValue" : 0, "xtype" : "NumberField", "decimalPrecision" : 0, "$ xns" : "Roo.form", "* prop" : "field" } ] } ] }, { "align" : "right", "xtype" : "ColumnModel", "header" : "Lead time", "width" : 75, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "itemsrc_leadtime", "items" : [ { "xtype" : "GridEditor", "$ xns" : "Roo.grid", "* prop" : "editor", "items" : [ { "minValue" : 0, "xtype" : "NumberField", "decimalPrecision" : 0, "$ xns" : "Roo.form", "* prop" : "field" } ] } ] }, { "xtype" : "ColumnModel", "header" : "Active", "width" : 50, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "itemsrc_active" } ] } ] }, { "listeners" : { "|activate" : "function() {\n _this.hpanel = this;\n if (_this.hgrid) {\n _this.hgrid.footer.onClick('first');\n }\n}" }, "fitToframe" : true, "background" : true, "region" : "center", "title" : "History", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "tableName" : "events", "items" : [ { "listeners" : { "|render" : "function() \n{\n _this.hgrid = this; \n if (_this.hpanel.active) {\n this.footer.onClick('first');\n }\n}" }, "autoExpandColumn" : "remarks", "xtype" : "Grid", "loadMask" : true, "$ xns" : "Roo.grid", "* prop" : "grid", "items" : [ { "listeners" : { "beforeload" : "function (_self, options)\n{\n options.params = options.params || {};\n \n options.params.on_table = 'item';\n options.params.on_id = _this.form.findField('item_id').getValue();\n}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field : 'event_when', direction: 'DESC' }", "$ xns" : "Roo.data", "* prop" : "dataSource", "items" : [ { "$ url" : "baseURL + '/Roo/events.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n {\n 'name': 'event_when',\n 'type': 'date'\n },\n {\n 'name': 'action',\n 'type': 'string'\n },\n {\n 'name': 'ipaddr',\n 'type': 'string'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n }\n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] }, { "pageSize" : 25, "xtype" : "PagingToolbar", "emptyMsg" : "No Events found", "$ xns" : "Roo", "displayMsg" : "Displaying events{0} - {1} of {2}", "displayInfo" : true, "* prop" : "footer" }, { "xtype" : "ColumnModel", "header" : "Changed", "width" : 120, "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "event_when" }, { "xtype" : "ColumnModel", "header" : "Action", "width" : 200, "$ renderer" : "function(v,x,r) { return String.format('{0} - {1}', v, r.data.on_table); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "action" }, { "xtype" : "ColumnModel", "header" : "IP Address", "width" : 200, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "ipaddr" }, { "xtype" : "ColumnModel", "header" : "Who", "width" : 75, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "person_id_name" }, { "xtype" : "ColumnModel", "header" : "Notes", "width" : 200, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "remarks" } ] } ] }, { "listeners" : { "click" : "function (_self, e)\n{\n _this.dialog.hide();\n}" }, "text" : "Cancel", "xtype" : "Button", "$ xns" : "Roo", "* prop" : "buttons[]" }, { "listeners" : { "render" : "function (_self)\n{\n _this.saveBtn = this;\n}", "click" : "function (_self, e)\n{\n // do some checks?\n \n \n // _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}" }, "text" : "Save", "xtype" : "Button", "$ xns" : "Roo", "* prop" : "buttons[]" } ] } ] }