2 "name" : "Pman.Dialog.XtupleItem",
5 "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleItem.bjs",
11 "show" : "function (_self)\n{\n _this.dialog.layout.getRegion('center').showPanel(0);\n}"
14 "collapsible" : false,
15 "title" : "Edit / Create item",
16 "xtype" : "LayoutDialog",
24 "alwaysShowTabs" : true,
25 "xtype" : "LayoutRegion",
26 "tabPosition" : "top",
33 "xtype" : "ContentPanel",
38 "|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 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",
39 "|rendered" : "function (form)\n{\n _this.form= form;\n}\n"
41 "$ url" : "baseURL + '/Roo/item.php'",
43 "style" : "margin:10px;",
50 "xtype" : "TextField",
54 "name" : "item_number"
57 "fieldLabel" : "Description",
58 "xtype" : "TextField",
61 "name" : "item_descrip1"
64 "fieldLabel" : "Description (2)",
65 "xtype" : "TextField",
68 "name" : "item_descrip2"
77 "beforeselect" : "function (combo, record, index)\n{\n (function() { combo.showHide(); }).defer(100);\n}"
80 "triggerAction" : "all",
81 "fieldLabel" : "Type",
82 "displayField" : "fname",
83 "emptyText" : "Select Type",
84 "hiddenName" : "item_type",
85 "valueField" : "ftype",
88 "$ 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 _this.form.findField('_update_related').setValue(1);\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 _this.form.findField('_update_related').setValue(0);\n }\n \n \n \n}\n",
93 "name" : "item_type_name",
94 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>",
97 "xtype" : "SimpleStore",
98 "$ data" : "[ \n [ 'P', \"Purchased (eg. a standard product)\"],\n [ 'R' , \"Reference (Non-Product)\"],\n [ 'K', \"Kit (made up of products)\"] \n]\n",
99 "$ fields" : "[ 'ftype', 'fname']",
100 "$ xns" : "Roo.data",
107 "triggerAction" : "all",
108 "fieldLabel" : "Class",
109 "forceSelection" : true,
110 "selectOnFocus" : true,
112 "displayField" : "classcode_code",
113 "emptyText" : "Select classcode",
114 "hiddenName" : "item_classcode_id",
116 "valueField" : "classcode_id",
117 "xtype" : "ComboBox",
118 "allowBlank" : false,
122 "$ xns" : "Roo.form",
123 "name" : "item_classcode_id_classcode_code",
124 "qtip" : "Select classcode",
126 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{classcode_code}</b> </div>",
127 "loadingText" : "Searching...",
131 "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
135 "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
136 "$ xns" : "Roo.data",
140 "$ url" : "baseURL + '/Roo/classcode.php'",
141 "xtype" : "HttpProxy",
143 "$ xns" : "Roo.data",
149 "xtype" : "JsonReader",
150 "$ xns" : "Roo.data",
151 "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"classcode_code\",\"type\":\"string\"}]",
153 "totalProperty" : "total"
160 "fieldLabel" : "Weight",
161 "xtype" : "NumberField",
162 "allowBlank" : false,
163 "allowDecimals" : true,
164 "decimalPrecision" : 2,
166 "$ xns" : "Roo.form",
167 "name" : "item_prodweight"
170 "fieldLabel" : "Item comments",
171 "xtype" : "TextArea",
173 "$ xns" : "Roo.form",
174 "name" : "item_comments",
178 "fieldLabel" : "Item sold",
180 "xtype" : "Checkbox",
183 "$ xns" : "Roo.form",
187 "fieldLabel" : "Item active",
189 "xtype" : "Checkbox",
192 "$ xns" : "Roo.form",
193 "name" : "item_active"
197 "add" : "function (combo)\n{\n Pman.Dialog.XtupleProdcat.show({prodcat_id : 0});\n}",
198 "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}"
200 "alwaysQuery" : true,
202 "triggerAction" : "all",
203 "fieldLabel" : "Product Category",
204 "forceSelection" : true,
205 "selectOnFocus" : true,
207 "displayField" : "prodcat_code",
208 "emptyText" : "Select Category",
209 "hiddenName" : "item_prodcat_id",
211 "valueField" : "prodcat_id",
212 "xtype" : "ComboBox",
213 "allowBlank" : false,
217 "$ xns" : "Roo.form",
218 "name" : "item_prodcat_id_prodcat_code",
219 "qtip" : "Select prodcat",
221 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{prodcat_code}</b> </div>",
222 "loadingText" : "Searching...",
226 "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
230 "$ xns" : "Roo.data",
231 "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
235 "$ url" : "baseURL + '/Roo/prodcat.php'",
236 "xtype" : "HttpProxy",
238 "$ xns" : "Roo.data",
244 "xtype" : "JsonReader",
245 "$ xns" : "Roo.data",
246 "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"prodcat_code\",\"type\":\"string\"}]",
248 "totalProperty" : "total"
255 "fieldLabel" : "Sales Account",
256 "xtype" : "DisplayField",
257 "$ xns" : "Roo.form",
258 "name" : "item_salesaccnt"
261 "fieldLabel" : "Item listprice",
262 "xtype" : "NumberField",
264 "$ xns" : "Roo.form",
265 "name" : "item_listprice"
269 "render" : "function (_self)\n{\n _this.standardCostFieldSet = _self;\n}"
271 "style" : "width:320px",
272 "xtype" : "FieldSet",
273 "legend" : "Standard Cost",
274 "$ xns" : "Roo.form",
278 "triggerAction" : "all",
279 "fieldLabel" : "Currency",
280 "forceSelection" : true,
281 "selectOnFocus" : true,
283 "displayField" : "curr_name",
284 "emptyText" : "Select Currency",
285 "hiddenName" : "item_itemcost_id_itemcost_curr_id",
287 "valueField" : "curr_id",
288 "xtype" : "ComboBox",
289 "allowBlank" : false,
293 "$ xns" : "Roo.form",
294 "name" : "curr_name",
295 "qtip" : "Select Currency",
296 "queryParam" : "query[curr_name]",
297 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{curr_name}</b> </div>",
298 "loadingText" : "Searching...",
302 "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n \n}\n"
306 "$ sortInfo" : "{ direction : 'ASC', field: 'curr_symbol' }",
307 "$ xns" : "Roo.data",
311 "$ url" : "baseURL + '/Roo/curr_symbol.php'",
312 "xtype" : "HttpProxy",
314 "$ xns" : "Roo.data",
320 "xtype" : "JsonReader",
321 "$ xns" : "Roo.data",
322 "$ fields" : "[{\"name\":\"curr_id\",\"type\":\"int\"},\"curr_symbol\"]",
324 "totalProperty" : "total"
331 "fieldLabel" : "Value",
332 "xtype" : "NumberField",
333 "allowBlank" : false,
335 "$ xns" : "Roo.form",
336 "name" : "item_itemcost_id_itemcost_actcost"
344 "$ xns" : "Roo.form",
348 "render" : "function (_self)\n{\n _this.itemsiteFieldSet = _self;\n}"
350 "xtype" : "FieldSet",
351 "legend" : "Itemsite Settings",
352 "$ xns" : "Roo.form",
353 "String/Object/Function style" : "width:335px;",
354 "Number labelWidth" : 120,
357 "fieldLabel" : "Reorder Level",
358 "xtype" : "NumberField",
359 "allowBlank" : false,
361 "$ xns" : "Roo.form",
362 "name" : "item_itemsite_id_itemsite_reorderlevel"
365 "fieldLabel" : "Stock Safety Level",
366 "xtype" : "NumberField",
367 "allowBlank" : false,
369 "$ xns" : "Roo.form",
370 "name" : "item_itemsite_id_itemsite_safetystock"
373 "fieldLabel" : "Lead time (Days)",
374 "xtype" : "NumberField",
375 "allowBlank" : false,
377 "$ xns" : "Roo.form",
378 "name" : "item_itemsite_id_itemsite_leadtime"
382 "triggerAction" : "all",
383 "fieldLabel" : "Control Method",
384 "displayField" : "fname",
385 "hiddenName" : "item_itemsite_id_itemsite_controlmethod",
386 "valueField" : "ftype",
387 "xtype" : "ComboBox",
388 "allowBlank" : false,
391 "$ xns" : "Roo.form",
393 "name" : "item_itemsite_id_itemsite_controlmethod_name",
394 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>",
397 "xtype" : "SimpleStore",
398 "$ data" : "[ \n [ 'N', \"None\"],\n [ 'R' , \"Regular\"]\n]\n",
399 "$ fields" : "[ 'ftype', 'fname']",
400 "$ xns" : "Roo.data",
407 "triggerAction" : "all",
408 "fieldLabel" : "Planner Code",
409 "forceSelection" : true,
410 "selectOnFocus" : true,
412 "displayField" : "plancode_name",
413 "emptyText" : "Select plancode",
414 "hiddenName" : "item_itemsite_id_itemsite_plancode_id",
416 "valueField" : "plancode_id",
417 "xtype" : "ComboBox",
418 "allowBlank" : false,
422 "$ xns" : "Roo.form",
423 "name" : "plancode_name",
424 "qtip" : "Select plancode",
426 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{plancode_name}</b> </div>",
427 "loadingText" : "Searching...",
431 "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
435 "$ xns" : "Roo.data",
436 "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
440 "$ url" : "baseURL + '/Roo/plancode.php'",
441 "xtype" : "HttpProxy",
443 "$ xns" : "Roo.data",
449 "xtype" : "JsonReader",
450 "$ xns" : "Roo.data",
451 "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"plancode_code\",\"type\":\"string\"}]",
453 "totalProperty" : "total"
461 "triggerAction" : "all",
462 "fieldLabel" : "Costcat",
463 "forceSelection" : true,
464 "selectOnFocus" : true,
466 "displayField" : "costcat_code",
467 "emptyText" : "Select costcat",
468 "hiddenName" : "item_itemsite_id_itemsite_costcat_id",
470 "valueField" : "costcat_id",
471 "xtype" : "ComboBox",
472 "allowBlank" : false,
476 "$ xns" : "Roo.form",
477 "name" : "costcat_code",
478 "qtip" : "Select costcat",
480 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{costcat_code}</b> </div>",
481 "loadingText" : "Searching...",
485 "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
489 "$ xns" : "Roo.data",
490 "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
494 "$ url" : "baseURL + '/Roo/costcat.php'",
495 "xtype" : "HttpProxy",
497 "$ xns" : "Roo.data",
503 "xtype" : "JsonReader",
504 "$ xns" : "Roo.data",
505 "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"costcat_code\",\"type\":\"string\"}]",
507 "totalProperty" : "total"
514 "fieldLabel" : "Active",
516 "xtype" : "Checkbox",
519 "$ xns" : "Roo.form",
520 "name" : "item_itemsite_id_itemsite_active"
523 "fieldLabel" : "Sold",
525 "xtype" : "Checkbox",
528 "$ xns" : "Roo.form",
529 "name" : "item_itemsite_id_itemsite_sold"
532 "fieldLabel" : "Stocked",
534 "xtype" : "Checkbox",
537 "$ xns" : "Roo.form",
538 "name" : "item_itemsite_id_itemsite_stocked"
541 "fieldLabel" : "Perishable",
543 "xtype" : "Checkbox",
546 "$ xns" : "Roo.form",
547 "name" : "item_itemsite_id_itemsite_perishable"
550 "fieldLabel" : "Multi Location",
552 "xtype" : "Checkbox",
555 "$ xns" : "Roo.form",
556 "name" : "item_itemsite_id_itemsite_loccntrl"
560 "triggerAction" : "all",
561 "fieldLabel" : "Default Location",
562 "forceSelection" : true,
563 "selectOnFocus" : true,
565 "displayField" : "location_name",
566 "emptyText" : "Default Location",
567 "hiddenName" : "item_itemsite_id_itemsite_location_id",
569 "valueField" : "location_id",
570 "xtype" : "ComboBox",
571 "allowBlank" : false,
575 "$ xns" : "Roo.form",
576 "name" : "location_name",
577 "qtip" : "Select terms",
578 "queryParam" : "query[location_name]",
579 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{location_name}</b> </div>",
580 "loadingText" : "Searching...",
584 "|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"
588 "$ sortInfo" : "{ direction : 'ASC', field: 'location_name' }",
589 "$ xns" : "Roo.data",
593 "$ url" : "baseURL + '/Roo/location.php'",
595 "xtype" : "HttpProxy",
596 "$ xns" : "Roo.data",
600 "id" : "location_id",
602 "xtype" : "JsonReader",
603 "$ fields" : "[{\"name\":\"location_id\",\"type\":\"int\"},\"location_name\"]",
604 "$ xns" : "Roo.data",
606 "totalProperty" : "total"
618 "$ xns" : "Roo.form",
626 "$ xns" : "Roo.form",
627 "name" : "_update_related"
635 "|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 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}"
640 "title" : "Item Parts",
641 "xtype" : "GridPanel",
642 "fitContainer" : true,
644 "tableName" : "bomitem",
648 "beforeedit" : "function (e)\n{\n if(e.field != 'ipshead_ipsitem_price'){\n return false;\n }\n \n}",
649 "|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}",
650 "afteredit" : "function (e)\n{\n if(e.originalValue == e.value){\n return false;\n }\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}"
652 "autoExpandColumn" : "bomitem_item_id_item_descrip1",
653 "xtype" : "EditorGrid",
656 "$ xns" : "Roo.grid",
662 "* prop" : "toolbar",
666 "render" : "function (_self)\n{\n _this.partsBox = _self;\n}",
667 "select" : "function (combo, record, index)\n{\n Roo.log('record');\n Roo.log(record);\n /* var event_id = _this.form.findField('id').getValue() * 1;\n \n if(typeof(record) == 'undefined' || !record || record.data.id * 1 < 1 || event_id < 1){\n return;\n }\n \n var err = false;\n\n _this.fgrid.ds.each(function(d){\n if(record.data.id == d.data.interest_id){\n err = true;\n }\n });\n\n if(err){\n Roo.MessageBox.alert('Error', record.data.display_name + ' already exists!');\n _this.focusBox.reset();\n return;\n }\n \n new Pman.Request({\n url : baseURL + '/Roo/cal_event_focus.php',\n method : 'POST',\n params : {\n cal_event_id : event_id,\n interest_id : record.data.id\n }, \n success : function(res) {\n _this.focusBox.reset();\n _this.fgrid.footer.onClick('first');\n }\n }); */\n}"
669 "alwaysQuery" : true,
670 "triggerAction" : "all",
671 "fieldLabel" : "Item",
672 "forceSelection" : true,
673 "selectOnFocus" : true,
675 "displayField" : "name",
676 "emptyText" : "Select item",
679 "xtype" : "ComboBox",
684 "$ xns" : "Roo.bootstrap",
685 "qtip" : "Select item",
686 "queryParam" : "query[search]",
687 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{item_name}</b> </div>",
688 "loadingText" : "Searching...",
692 "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n \n o.params.etype = 'crm_interest';\n o.params.active = 1;\n}\n"
696 "$ sortInfo" : "{ direction : 'ASC', field: 'name' }",
697 "$ xns" : "Roo.data",
701 "$ url" : "baseURL + '/Roo/Core_enum.php'",
703 "xtype" : "HttpProxy",
704 "$ xns" : "Roo.data",
710 "xtype" : "JsonReader",
711 "$ fields" : "[\n {\"name\":\"id\",\"type\":\"int\"},\n {\"name\":\"name\",\"type\":\"string\"},\n {\"name\":\"display_name\",\"type\":\"string\"}\n]",
712 "$ xns" : "Roo.data",
714 "totalProperty" : "total"
721 "xtype" : "Separator",
722 "$ xns" : "Roo.Toolbar"
726 "|click" : "function()\n{\n Pman.Dialog.CoreEnum.show( {id : 0, etype : 'crm_interest'}, function(res){\n _this.focusBox.setFromData(res);\n var record = {};\n \n record.data = res;\n \n _this.focusBox.fireEvent('select', _this.focusBox, record);\n \n }); \n}"
730 "cls" : "x-btn-text-icon",
731 "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
736 "$ xns" : "Roo.Toolbar"
740 "|click" : "function ()\n{\n var sel = _this.fgrid.getSelectionModel().getSelections();\n \n if(!sel || !sel.length){\n Roo.MessageBox.alert(\"Error\", \"Please select interests from below list\");\n return;\n }\n \n Roo.log(sel);\n \n var id = [];\n \n Roo.each(sel, function(s){\n if(s.data.id * 1 < 1){ // bad data?\n return;\n }\n \n id.push(s.data.id);\n });\n \n new Pman.Request({\n url : baseURL + '/Roo/cal_event_focus.php',\n method : 'POST',\n params : {\n _delete : id.join(',')\n }, \n success : function(res) {\n _this.fgrid.footer.onClick('first');\n }\n }); \n \n}"
744 "cls" : "x-btn-text-icon",
745 "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
752 "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}"
756 "$ sortInfo" : "{ field : 'bomitem_item_id_item_name', direction: 'ASC' }",
757 "$ xns" : "Roo.data",
758 "* prop" : "dataSource",
761 "$ url" : "baseURL + '/Roo/bomitem.php'",
762 "xtype" : "HttpProxy",
764 "$ xns" : "Roo.data",
770 "xtype" : "JsonReader",
771 "$ fields" : "[\n {\n 'name': 'bomitem_id',\n 'type': 'int'\n }\n]",
772 "$ xns" : "Roo.data",
774 "totalProperty" : "total"
780 "xtype" : "PagingToolbar",
781 "emptyMsg" : "Nothing found",
783 "displayMsg" : "Displaying parts {0} - {1} of {2}",
784 "displayInfo" : true,
788 "xtype" : "ColumnModel",
791 "$ renderer" : "function(v) { return String.format('{0}', v); }",
792 "$ xns" : "Roo.grid",
793 "* prop" : "colModel[]",
794 "dataIndex" : "bomitem_item_id_item_name"
797 "xtype" : "ColumnModel",
798 "header" : "Description",
800 "$ renderer" : "function(v) { return String.format('{0}', v); }",
801 "$ xns" : "Roo.grid",
802 "* prop" : "colModel[]",
803 "dataIndex" : "bomitem_item_id_item_descrip1"
806 "xtype" : "ColumnModel",
809 "$ renderer" : "function(v) { return String.format('{0}', v); }",
810 "$ xns" : "Roo.grid",
811 "* prop" : "colModel[]",
812 "dataIndex" : "bomitem_qtyper"
820 "|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}"
825 "title" : "Reference Files",
826 "xtype" : "GridPanel",
827 "fitContainer" : true,
829 "tableName" : "Images",
833 "|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}",
834 "|render" : "function() { \n _this.grid = this; \n\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}"
836 "autoExpandColumn" : "id",
839 "$ xns" : "Roo.grid",
844 "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}"
848 "$ sortInfo" : "{ field: 'created' , direction: 'DESC' }",
849 "$ xns" : "Roo.data",
850 "* prop" : "dataSource",
855 "xtype" : "JsonReader",
856 "$ 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]",
857 "$ xns" : "Roo.data",
859 "totalProperty" : "total"
862 "$ url" : "baseURL + '/Roo/Images.php'",
863 "xtype" : "HttpProxy",
865 "$ xns" : "Roo.data",
872 "xtype" : "PagingToolbar",
873 "emptyMsg" : "No Images found",
875 "displayInfo" : true,
876 "displayMsg" : "Displaying Images {0} - {1} of {2}",
882 "* prop" : "toolbar",
886 "|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} "
890 "cls" : "x-btn-text-icon",
891 "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
892 "$ xns" : "Roo.Toolbar"
896 "|click" : "function()\n{\n Pman.genericDelete(_this, 'Images'); \n}\n "
900 "cls" : "x-btn-text-icon",
901 "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
902 "$ xns" : "Roo.Toolbar"
907 "xtype" : "ColumnModel",
909 "header" : "Created",
911 "$ renderer" : "function(v,x,r) {\n return String.format('{0}<br/><i>{1}</i><br/>{2}<br/><i>{3}x{4}</i>',\n v.format('d/M/Y'), r.data.mimetype, r.data.filename,\n r.data.width, r.data.height\n ); \n}\n ",
912 "$ xns" : "Roo.grid",
913 "* prop" : "colModel[]",
914 "dataIndex" : "created"
917 "xtype" : "ColumnModel",
920 "$ renderer" : "function(v,x,r) { return String.format('<img src=\"{0}/Images/Thumb/100/{1}/{2}\" height=\"100\">', baseURL, v, r.data.filename); }",
921 "$ xns" : "Roo.grid",
922 "* prop" : "colModel[]",
931 "|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}"
936 "title" : "Price List",
937 "xtype" : "GridPanel",
938 "fitContainer" : true,
940 "tableName" : "ipshead",
944 "beforeedit" : "function (e)\n{\n if(e.field != 'ipshead_ipsitem_price'){\n return false;\n }\n \n}",
945 "|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}",
946 "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}"
948 "autoExpandColumn" : "ipshead_descrip",
949 "xtype" : "EditorGrid",
952 "$ xns" : "Roo.grid",
957 "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}"
961 "$ sortInfo" : "{ field : 'ipshead_id', direction: 'ASC' }",
962 "$ xns" : "Roo.data",
963 "* prop" : "dataSource",
966 "$ url" : "baseURL + '/Roo/ipshead.php'",
968 "xtype" : "HttpProxy",
969 "$ xns" : "Roo.data",
975 "xtype" : "JsonReader",
976 "$ fields" : "[\n {\n 'name': 'ipshead_id',\n 'type': 'int'\n },\n {\n 'name': 'ipshead_name',\n 'type': 'string'\n }\n]",
977 "$ xns" : "Roo.data",
979 "totalProperty" : "total"
985 "xtype" : "PagingToolbar",
986 "emptyMsg" : "Nothing found",
988 "displayMsg" : "Displaying records {0} - {1} of {2}",
989 "displayInfo" : true,
993 "xtype" : "ColumnModel",
996 "$ renderer" : "function(v) { return String.format('{0}', v); }",
997 "$ xns" : "Roo.grid",
998 "* prop" : "colModel[]",
999 "dataIndex" : "ipshead_name"
1002 "xtype" : "ColumnModel",
1004 "header" : "Description",
1005 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1006 "$ xns" : "Roo.grid",
1007 "* prop" : "colModel[]",
1008 "dataIndex" : "ipshead_descrip"
1011 "xtype" : "ColumnModel",
1013 "header" : "Currency",
1014 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1015 "$ xns" : "Roo.grid",
1016 "* prop" : "colModel[]",
1017 "dataIndex" : "ipshead_curr_id_curr_name"
1021 "xtype" : "ColumnModel",
1024 "$ renderer" : "function(v) { return String.format('{0}', Roo.util.Format.number(v*1,2)); }",
1025 "$ xns" : "Roo.grid",
1026 "* prop" : "colModel[]",
1027 "dataIndex" : "ipshead_ipsitem_price",
1030 "xtype" : "GridEditor",
1031 "$ xns" : "Roo.grid",
1032 "* prop" : "editor",
1035 "xtype" : "NumberField",
1036 "cls" : "align-right",
1037 "decimalPrecision" : 2,
1038 "$ xns" : "Roo.form",
1051 "|activate" : "function() {\n _this.itemsrcpanel = this;\n if (_this.itemsrcgrid) {\n _this.itemsrcgrid.footer.onClick('first');\n }\n}"
1053 "region" : "center",
1054 "fitToframe" : true,
1055 "background" : true,
1056 "title" : "Suppliers",
1057 "xtype" : "GridPanel",
1058 "fitContainer" : true,
1060 "tableName" : "itemsrc",
1064 "|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",
1065 "|render" : "function() \n{\n _this.itemsrcgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n \n}",
1066 "afteredit" : "function (e)\n{\n e.record.commit();\n}"
1068 "autoExpandColumn" : "itemsrc_comments",
1069 "xtype" : "EditorGrid",
1072 "$ xns" : "Roo.grid",
1077 "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}",
1078 "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}"
1081 "remoteSort" : true,
1082 "$ sortInfo" : "{ field : 'itemsrc_vend_id_vend_name', direction: 'ASC' }",
1083 "$ xns" : "Roo.data",
1084 "* prop" : "dataSource",
1087 "$ url" : "baseURL + '/Roo/itemsrc.php'",
1088 "xtype" : "HttpProxy",
1090 "$ xns" : "Roo.data",
1096 "xtype" : "JsonReader",
1097 "$ xns" : "Roo.data",
1098 "$ 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]",
1099 "* prop" : "reader",
1100 "totalProperty" : "total"
1106 "xtype" : "PagingToolbar",
1107 "emptyMsg" : "No itemsrc found",
1109 "displayInfo" : true,
1110 "displayMsg" : "Displaying itemsrc{0} - {1} of {2}",
1114 "xtype" : "Toolbar",
1116 "* prop" : "toolbar",
1120 "|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\n itemsrc_vend_id : 0,\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"
1124 "cls" : "x-btn-text-icon",
1125 "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
1126 "$ xns" : "Roo.Toolbar"
1131 "xtype" : "ColumnModel",
1133 "header" : "Vendor",
1134 "$ renderer" : "function(v,x,r) { return String.format('{0}', r.data.itemsrc_vend_id_vend_name); }",
1135 "$ xns" : "Roo.grid",
1136 "* prop" : "colModel[]",
1137 "dataIndex" : "itemsrc_vend_id",
1140 "xtype" : "GridEditor",
1141 "$ xns" : "Roo.grid",
1142 "* prop" : "editor",
1146 "triggerAction" : "all",
1147 "forceSelection" : true,
1148 "selectOnFocus" : true,
1150 "displayField" : "vend_name",
1151 "emptyText" : "Select Vendor",
1152 "hiddenName" : "itemsrc_vend_id",
1154 "valueField" : "vend_id",
1155 "xtype" : "ComboBox",
1156 "allowBlank" : false,
1160 "$ xns" : "Roo.form",
1162 "name" : "itemsrc_vend_id_vend_name",
1163 "qtip" : "Select vendinfo",
1164 "queryParam" : "q[search]",
1165 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{vend_name}</b> </div>",
1166 "loadingText" : "Searching...",
1170 "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
1173 "remoteSort" : true,
1174 "$ xns" : "Roo.data",
1175 "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
1179 "$ url" : "baseURL + '/Roo/vendinfo.php'",
1180 "xtype" : "HttpProxy",
1182 "$ xns" : "Roo.data",
1188 "xtype" : "JsonReader",
1189 "$ xns" : "Roo.data",
1190 "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"vend_name\",\"type\":\"string\"}]",
1191 "* prop" : "reader",
1192 "totalProperty" : "total"
1203 "xtype" : "ColumnModel",
1205 "header" : "Vendor Ref#",
1206 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1207 "$ xns" : "Roo.grid",
1208 "* prop" : "colModel[]",
1209 "dataIndex" : "itemsrc_vend_item_number",
1212 "xtype" : "GridEditor",
1213 "$ xns" : "Roo.grid",
1214 "* prop" : "editor",
1217 "xtype" : "TextField",
1218 "$ xns" : "Roo.form",
1226 "xtype" : "ColumnModel",
1228 "header" : "Comments",
1229 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1230 "$ xns" : "Roo.grid",
1231 "* prop" : "colModel[]",
1232 "dataIndex" : "itemsrc_comments",
1235 "xtype" : "GridEditor",
1236 "$ xns" : "Roo.grid",
1237 "* prop" : "editor",
1240 "xtype" : "TextField",
1241 "$ xns" : "Roo.form",
1249 "xtype" : "ColumnModel",
1252 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1253 "$ xns" : "Roo.grid",
1254 "* prop" : "colModel[]",
1255 "dataIndex" : "itemsrc_vend_uom"
1259 "xtype" : "ColumnModel",
1260 "header" : "Min Qty",
1262 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1263 "$ xns" : "Roo.grid",
1264 "* prop" : "colModel[]",
1265 "dataIndex" : "itemsrc_minordqty",
1268 "xtype" : "GridEditor",
1269 "$ xns" : "Roo.grid",
1270 "* prop" : "editor",
1274 "xtype" : "NumberField",
1275 "decimalPrecision" : 0,
1276 "$ xns" : "Roo.form",
1285 "xtype" : "ColumnModel",
1286 "header" : "Lead time",
1288 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1289 "$ xns" : "Roo.grid",
1290 "* prop" : "colModel[]",
1291 "dataIndex" : "itemsrc_leadtime",
1294 "xtype" : "GridEditor",
1295 "$ xns" : "Roo.grid",
1296 "* prop" : "editor",
1300 "xtype" : "NumberField",
1301 "decimalPrecision" : 0,
1302 "$ xns" : "Roo.form",
1310 "xtype" : "ColumnModel",
1312 "header" : "Active",
1313 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1314 "$ xns" : "Roo.grid",
1315 "* prop" : "colModel[]",
1316 "dataIndex" : "itemsrc_active"
1324 "|activate" : "function() {\n _this.hpanel = this;\n if (_this.hgrid) {\n _this.hgrid.footer.onClick('first');\n }\n}"
1326 "region" : "center",
1327 "fitToframe" : true,
1328 "background" : true,
1329 "title" : "History",
1330 "xtype" : "GridPanel",
1331 "fitContainer" : true,
1333 "tableName" : "events",
1337 "|render" : "function() \n{\n _this.hgrid = this; \n if (_this.hpanel.active) {\n this.footer.onClick('first');\n }\n}"
1339 "autoExpandColumn" : "remarks",
1342 "$ xns" : "Roo.grid",
1347 "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}"
1350 "remoteSort" : true,
1351 "$ sortInfo" : "{ field : 'event_when', direction: 'DESC' }",
1352 "$ xns" : "Roo.data",
1353 "* prop" : "dataSource",
1356 "$ url" : "baseURL + '/Roo/events.php'",
1358 "xtype" : "HttpProxy",
1359 "$ xns" : "Roo.data",
1365 "xtype" : "JsonReader",
1366 "$ 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]",
1367 "$ xns" : "Roo.data",
1368 "* prop" : "reader",
1369 "totalProperty" : "total"
1375 "xtype" : "PagingToolbar",
1376 "emptyMsg" : "No Events found",
1378 "displayMsg" : "Displaying events{0} - {1} of {2}",
1379 "displayInfo" : true,
1383 "xtype" : "ColumnModel",
1385 "header" : "Changed",
1386 "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); }",
1387 "$ xns" : "Roo.grid",
1388 "* prop" : "colModel[]",
1389 "dataIndex" : "event_when"
1392 "xtype" : "ColumnModel",
1394 "header" : "Action",
1395 "$ renderer" : "function(v,x,r) { return String.format('{0} - {1}', v, r.data.on_table); }",
1396 "$ xns" : "Roo.grid",
1397 "* prop" : "colModel[]",
1398 "dataIndex" : "action"
1401 "xtype" : "ColumnModel",
1403 "header" : "IP Address",
1404 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1405 "$ xns" : "Roo.grid",
1406 "* prop" : "colModel[]",
1407 "dataIndex" : "ipaddr"
1410 "xtype" : "ColumnModel",
1413 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1414 "$ xns" : "Roo.grid",
1415 "* prop" : "colModel[]",
1416 "dataIndex" : "person_id_name"
1419 "xtype" : "ColumnModel",
1422 "$ renderer" : "function(v) { return String.format('{0}', v); }",
1423 "$ xns" : "Roo.grid",
1424 "* prop" : "colModel[]",
1425 "dataIndex" : "remarks"
1433 "click" : "function (_self, e)\n{\n _this.dialog.hide();\n}"
1438 "* prop" : "buttons[]"
1442 "render" : "function (_self)\n{\n _this.saveBtn = this;\n}",
1443 "click" : "function (_self, e)\n{\n // do some checks?\n \n \n // _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}"
1448 "* prop" : "buttons[]"