3 "name": "Pman.Dialog.XtuplePurchaseOrder",
6 "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtuplePurchaseOrder.bjs",
10 "show": "function () \n{\n this.layout.getRegion('center').showPanel(0);\n}"
17 "title": "New Purchase Order",
19 "xtype": "LayoutDialog",
24 "xtype": "LayoutRegion",
26 "alwaysShowTabs": true,
35 "|xns": "Roo.Toolbar",
40 "click": "function ()\n{\n var hid = _this.form.findField('pohead_id').getValue();\n\n if(!hid.length){\n Roo.MessageBox.alert(\"Error\", \"Please save your purchase order first\"); \n return false;\n }\n\n \n if (!_this.grid) {\n _dialog.layout.showPanel(1);\n doit.defer(500);\n return;\n }\n \n \n \n var doit = function () { \n new Pman.Download({\n grid : _this.grid\n });\n }\n doit();\n \n \n}"
42 "cls": "x-btn-text-icon",
43 "text": "Download Purchase Order Items (Excel)",
45 "|icon": "rootURL + '/Pman/templates/images/save.gif'",
50 "render": "function (_self)\n{\n _this.uploadBtn = _self;\n}"
52 "text": "Upload Purchase Order",
54 "|xns": "Roo.Toolbar",
63 "click": "function (_self, e)\n{\n var hid = _this.form.findField('pohead_id').getValue();\n \n if(!hid.length){\n Roo.MessageBox.alert(\"Error\", \"Please save your purchase order first\"); \n return false;\n }\n Pman.Dialog.Image.show(\n {\n timeout : 60000,\n _url : baseURL+'/Xtuple/Import/PurchaseOrder?' + Roo.urlEncode({'pohead_id' : hid})\n \n },\n function () {\n if(_this.grid){\n _this.grid.footer.onClick('first');\n }\n Roo.MessageBox.alert(\"Notice\", 'UPLOADED');\n }\n );\n}"
65 "text": "Upload Standard Excel",
71 "click": "function (_self, e)\n{\n\n var hid = _this.form.findField('pohead_id').getValue();\n \n if(!hid.length){\n Roo.MessageBox.alert(\"Error\", \"Please save your purchase order first\"); \n return false;\n }\n \n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Xtuple/Import/AUPurchaseOrder?' + Roo.urlEncode({'pohead_id' :hid})\n \n },\n function (data) {\n if(_this.grid){\n _this.grid.footer.onClick('first');\n }\n Roo.MessageBox.alert(\"Notice\", 'IMPORTED');\n\n });\n}"
73 "text": "Upload AU Import Excel",
87 "title": "Order Details",
88 "xtype": "ContentPanel",
93 "|actioncomplete": "function(_self,action)\n{\n if (action.type == 'setdata') {\n _this.uploadBtn.disabled = false;\n if(!_this.data.pohead_id && Pman.Login.authUser.name.length){\n _this.saveBtn.show();\n _this.form.findField('pohead_agent_username').setValue(Pman.Login.authUser.name);\n _this.form.findField('pohead_orderdate').setValue(new Date());\n _this.form.findField('pohead_bg_arrival_est_day').setValue(new Date());\n _this.form.findField('pohead_bg_available_est_day').setValue(new Date());\n _this.form.findField('pohead_bg_available_latest_day').setValue(new Date());\n return;\n }\n _this.dialog.setTitle(\"Edit Purchase Order\");\n var params = {\n '_id' : _this.data.pohead_id\n }\n if(_this.data.office){\n params['_roo_office'] = _this.data.office;\n }\n \n this.load({ method: 'GET', params: params});\n return;\n }\n if (action.type == 'load') {\n _this.dontClose = false;\n if(_this.data.office){\n _this.uploadBtn.disabled = true;\n }\n _this.saveBtn.hide();\n if (action.result.data.pohead_status == 'U') {\n _this.saveBtn.show();\n }\n var cn = _this.form.findField('pohead_curr_id');\n cn.setDisabled(true);\n if (action.result.data.pohead_id * 1 < 1) {\n cn.setDisabled(false);\n }\n \n if(_this.grid){\n _this.grid.footer.onClick('first');\n }\n \n return;\n }\n if (action.type =='submit') {\n \n\n var cid = this.findField('pohead_id').getValue()*1;\n if (cid && !_this.dontClose) {\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 Roo.log(action);\n _this.dontClose = false;\n _this.data.pohead_id = action.result.data.pohead_id;\n this.fireEvent('actioncomplete', this, { \n type: 'setdata', \n data: { \n pohead_id : action.result.data.pohead_id\n } \n });\n\n \n }\n}\n",
94 "|rendered": "function (form)\n{\n _this.form= form;\n}\n",
95 "actionfailed": "function (_self, action)\n{\n _this.dialog.el.unmask();\n if (action.failureType == 'client') {\n Roo.MessageBox.alert(\"Error\", \"Please fill in all the required fields\");\n }\n if (action.failureType == 'server') {\n Roo.MessageBox.alert(\"Error\", action.result.errorMsg);\n }\n _this.dialog.layout.getRegion('center').showPanel(0);\n\n}"
99 "style": "margin:10px;",
101 "|url": "baseURL + '/Xtuple/Roo/Pohead.php'",
105 "emptyText": "Automatic",
106 "fieldLabel": "Order #",
107 "name": "pohead_number",
110 "xtype": "TextField",
115 "fieldLabel": "Order Date",
117 "name": "pohead_orderdate",
119 "xtype": "DateField",
123 "fieldLabel": "Estimated Arrival Date",
125 "name": "pohead_bg_arrival_est_day",
127 "xtype": "DateField",
131 "fieldLabel": "Estimated Available Date",
133 "name": "pohead_bg_available_est_day",
135 "xtype": "DateField",
139 "fieldLabel": "Latest Estimated Available Date",
141 "name": "pohead_bg_available_latest_day",
143 "xtype": "DateField",
148 "name": "pohead_bg_va",
150 "xtype": "TextField",
154 "fieldLabel": "Vendor",
155 "name": "pohead_vend_id_vend_name",
158 "xtype": "TextField",
163 "displayField": "fname",
165 "fieldLabel": "Status",
166 "hiddenName": "pohead_status",
169 "name": "pohead_status",
171 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>",
172 "triggerAction": "all",
174 "valueField": "ftype",
181 "xtype": "SimpleStore",
182 "|data": "[ \n [ 'U', \"Unreleased\"],\n [ 'O', \"Open\"],\n [ 'C' , \"Closed\"]\n]\n",
183 "|fields": "[ 'ftype', 'fname']",
190 "displayField": "curr_name",
192 "emptyText": "Select Currency",
193 "fieldLabel": "Currency",
194 "forceSelection": true,
195 "hiddenName": "pohead_curr_id",
197 "loadingText": "Searching...",
199 "name": "pohead_curr_id_curr_name",
201 "qtip": "Select Currency",
202 "queryParam": "query[curr_name]",
203 "selectOnFocus": true,
204 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{curr_name}</b> </div>",
205 "triggerAction": "all",
207 "valueField": "curr_id",
214 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n}\n"
219 "|sortInfo": "{ direction : 'ASC', field: 'curr_id' }",
224 "xtype": "HttpProxy",
227 "|url": "baseURL + '/Roo/curr_symbol.php'"
233 "totalProperty": "total",
234 "xtype": "JsonReader",
235 "|fields": "[\n {\"name\":\"curr_id\",\"type\":\"int\"},\n {\"name\":\"curr_name\",\"type\":\"string\"}\n]",
244 "displayField": "location_name",
246 "emptyText": "Select a location",
247 "fieldLabel": "Location",
248 "forceSelection": true,
249 "hiddenName": "pohead_location_id",
251 "loadingText": "Searching...",
253 "name": "pohead_location_id_location_name",
255 "qtip": "Select terms",
256 "queryParam": "query[location_name]",
257 "selectOnFocus": true,
258 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{location_name}</b> </div>",
259 "triggerAction": "all",
261 "valueField": "location_id",
268 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params.location_netable = 1;\n o.params._viewType = 'local';\n}\n"
273 "|sortInfo": "{ direction : 'ASC', field: 'location_name' }",
279 "xtype": "HttpProxy",
280 "|url": "baseURL + '/Roo/location.php'",
287 "totalProperty": "total",
288 "xtype": "JsonReader",
289 "|fields": "[{\"name\":\"location_id\",\"type\":\"int\"},\"location_name\"]",
298 "displayField": "terms_descrip",
300 "emptyText": "Select Terms",
301 "fieldLabel": "Terms",
302 "forceSelection": true,
303 "hiddenName": "pohead_terms_id",
305 "loadingText": "Searching...",
307 "name": "pohead_terms_id_terms_descrip",
309 "qtip": "Select Terms",
310 "queryParam": "query[terms_descrip]",
311 "selectOnFocus": true,
312 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{terms_descrip}</b> </div>",
313 "triggerAction": "all",
315 "valueField": "terms_id",
322 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n}\n"
327 "|sortInfo": "{ direction : 'ASC', field: 'terms_descrip' }",
333 "xtype": "HttpProxy",
334 "|url": "baseURL + '/Roo/Terms.php'",
341 "totalProperty": "total",
342 "xtype": "JsonReader",
343 "|fields": "[\n {\"name\":\"terms_id\",\"type\":\"int\"},\n {\"name\":\"terms_descrip\",\"type\":\"string\"}\n]",
352 "displayField": "taxzone_descrip",
354 "emptyText": "Select Tax Zone",
355 "fieldLabel": "Tax Zone",
356 "forceSelection": true,
357 "hiddenName": "pohead_taxzone_id",
359 "loadingText": "Searching...",
361 "name": "pohead_taxzone_id_taxzone_descrip",
363 "qtip": "Select Tax Zone",
364 "queryParam": "query[taxzone_descrip]",
365 "selectOnFocus": true,
366 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{taxzone_descrip}</b> </div>",
367 "triggerAction": "all",
369 "valueField": "taxzone_id",
376 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n}\n"
381 "|sortInfo": "{ direction : 'ASC', field: 'taxzone_id' }",
387 "xtype": "HttpProxy",
388 "|url": "baseURL + '/Roo/Taxzone.php'",
395 "totalProperty": "total",
396 "xtype": "JsonReader",
397 "|fields": "[\n {\"name\":\"taxzone_id\",\"type\":\"int\"},\n {\"name\":\"taxzone_descrip\",\"type\":\"string\"}\n]",
406 "displayField": "emp_name",
408 "emptyText": "Select Purchasing Agent",
409 "fieldLabel": "Purchase Agent",
410 "forceSelection": true,
411 "hiddenName": "pohead_agent_username",
413 "loadingText": "Searching...",
415 "name": "pohead_agent_username",
417 "qtip": "Select Purchasing Agent",
418 "queryParam": "query[emp_name]",
419 "selectOnFocus": true,
420 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{emp_name}</b> </div>",
421 "triggerAction": "all",
423 "valueField": "emp_name",
430 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n}\n"
435 "|sortInfo": "{ direction : 'ASC', field: 'emp_id' }",
441 "xtype": "HttpProxy",
442 "|url": "baseURL + '/Roo/Emp.php'",
449 "totalProperty": "total",
450 "xtype": "JsonReader",
451 "|fields": "[\n {\"name\":\"emp_id\",\"type\":\"int\"},\n {\"name\":\"emp_name\",\"type\":\"string\"}\n]",
459 "fieldLabel": "Comments",
461 "name": "pohead_comments",
467 "name": "pohead_vend_id",
487 "|activate": "function() {\n _this.panel = this;\n \n \n var pid = _this.form.findField('pohead_id').getValue() * 1;\n if (pid < 1) {\n Roo.MessageBox.alert(\"Save First\", \"Please save the purchase order first, before adding items\");\n _this.dialog.layout.getRegion('center').showPanel(0);\n return;\n }\n \n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}",
488 "deactivate": "function (_self)\n{\n if(_this.grid){\n var ar = [];\n\n _this.grid.ds.each(function(r) {\n ar.push({\n poitem_id : r.data.poitem_id,\n poitem_itemsite_id : r.data.poitem_itemsite_id,\n poitem_unitprice : r.data.poitem_unitprice,\n poitem_qty_ordered : r.data.poitem_qty_ordered\n });\n \n });\n \n _this.form.findField('items').setValue(JSON.stringify(ar));\n }\n _this.dontClose = true;\n _this.form.doAction(\"submit\");\n\n}"
491 "fitContainer": true,
494 "tableName": "poitem",
495 "title": "Order Items",
496 "xtype": "GridPanel",
501 "|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}",
502 "beforeedit": "function (e)\n{\n var r = e.record.data.poitem_qty_received * 1;\n \n if(r > 0){\n Roo.MessageBox.alert(\"Error\", \"This item has been receipted\");\n return false;\n }\n \n var status = _this.form.findField('pohead_status').getValue();\n \n if(status == 'C'){\n Roo.MessageBox.alert(\"Error\", \"This PO has been closed\");\n return false;\n }\n \n \n}"
505 "autoExpandColumn": "item_descrip1",
508 "xtype": "EditorGrid",
513 "beforeload": "function (_self, o){\n o.params = o.params || {};\n var hid = _this.form.findField('pohead_id').getValue();\n \n if(!hid.length){\n return false;\n }\n \n o.params.poitem_pohead_id = hid;\n o.params._with_item = 1;\n o.params._roo_office = _this.data.office ? _this.data.office : baseURL.split('/').pop().substr(0,2);\n\n}\n",
514 "load": "function (_self, records, options)\n{\n _this.grid.footer.updateSummary();\n}"
516 "*prop": "dataSource",
519 "|sortInfo": "{ field : 'poitem_linenumber', direction: 'ASC' }",
526 "xtype": "HttpProxy",
527 "|url": "baseURL + '/Xtuple/Roo/Poitem.php'",
534 "totalProperty": "total",
535 "xtype": "JsonReader",
536 "|fields": "[\n {\n 'name': 'poitem_id',\n 'type': 'int'\n }\n]",
548 "|click": "function()\n{\n var status = _this.form.findField('pohead_status').getValue();\n \n if(status == 'C'){\n Roo.MessageBox.alert(\"Error\", \"This PO has been closed\");\n return;\n }\n \n var ct = _this.grid.ds.getCount();\n \n var last = ct ? _this.grid.ds.getAt(ct-1).data.poitem_linenumber * 1 + 1 : 1;\n \n var dt = _this.form.findField('pohead_orderdate').getValue();\n \n var nr = _this.grid.ds.reader.newRow({\n poitem_id : 0,\n poitem_linenumber : last,\n item_number : '',\n item_descrip1 : '',\n poitem_duedate : dt,\n poitem_qty_ordered : 1,\n poitem_unitprice : 0\n });\n \n _this.grid.stopEditing();\n _this.grid.ds.insert(_this.grid.ds.getCount(), nr); \n _this.grid.startEditing(_this.grid.ds.getCount()-1, 1);\n}\n"
550 "cls": "x-btn-text-icon",
553 "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
554 "|xns": "Roo.Toolbar"
558 "|click": "function ()\n{\n var status = _this.form.findField('pohead_status').getValue();\n \n if(status == 'C'){\n Roo.MessageBox.alert(\"Error\", \"This PO has been closed\");\n return;\n }\n \n var cs = _this.grid.getSelectionModel().getSelectedCell();\n if (!cs) {\n Roo.MessageBox.alert(\"Error\", \"Select a cell\");\n return;\n }\n _this.grid.stopEditing();\n var r = _this.grid.ds.getAt(cs[0]);\n \n if(r.data.poitem_qty_received * 1 > 0){\n Roo.MessageBox.alert(\"Error\", \"This item has been receipted\");\n return;\n }\n \n \n _this.grid.ds.remove(r);\n \n}"
560 "cls": "x-btn-text-icon",
563 "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
564 "|xns": "Roo.Toolbar"
571 "emptyMsg": "No Item found",
573 "xtype": "PagingToolbar",
574 "|updateSummary": "function() {\n\r\n var f = this;\r\n new Pman.Request({\r\n url : baseURL + '/Xtuple/Roo/Poitem',\r\n method : 'GET',\r\n params : {\n _roo_office : _this.data.office ? _this.data.office : baseURL.split('/').pop().substr(0,2),\r\n _totals : 1,\r\n poitem_pohead_id : _this.form.findField('pohead_id').getValue()\r\n },\r\n success : function(d) {\n Roo.log(d);\r\n f.displayEl.update(String.format(\r\n \"{0} items | Total : {1} {2}\",\r\n d.data[0].count_item,\r\n _this.form.findField('pohead_curr_id').el.dom.value,\r\n d.data[0].totals\r\n ));\r\n \r\n }\r\n });\r\n\n}\n",
578 "*prop": "colModel[]",
580 "dataIndex": "poitem_linenumber",
583 "xtype": "ColumnModel",
584 "|renderer": "function(v) { return String.format('{0}', v); }",
588 "*prop": "colModel[]",
589 "dataIndex": "item_number",
590 "header": "Item code",
592 "xtype": "ColumnModel",
593 "|renderer": "function(v) { return String.format('{0}', v); }",
598 "xtype": "GridEditor",
603 "beforeselect": "function (combo, record, index)\n{\n var ar = _this.grid.activeEditor.record;\n \n (function() { \n ar.set('item_descrip1', record.data.itemsite_item_id_item_descrip1);\n ar.set('poitem_itemsite_id', record.data.itemsite_id);\n }).defer(100);\n \n}"
607 "displayField": "itemsite_item_id_item_number",
609 "emptyText": "Select item",
610 "forceSelection": true,
611 "hiddenName": "itemsite_item_id_item_number",
613 "loadingText": "Searching...",
615 "name": "item_number",
617 "qtip": "Select item",
618 "queryParam": "query[number]",
619 "selectOnFocus": true,
620 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{itemsite_item_id_item_number}</b> - {itemsite_item_id_item_descrip1} </div>",
621 "triggerAction": "all",
623 "valueField": "item_number",
629 "|beforeload": "function (_self, o){\n o.params = o.params || {}; \n o.params.itemsite_posupply = 1;\n}\n"
634 "|sortInfo": "{ direction : 'ASC', field: 'item_number' }",
640 "xtype": "HttpProxy",
641 "|url": "baseURL + '/Roo/itemsite.php'",
648 "totalProperty": "total",
649 "xtype": "JsonReader",
650 "|fields": "[{\"name\":\"item_id\",\"type\":\"int\"},\"item_number\"]",
662 "*prop": "colModel[]",
663 "dataIndex": "item_descrip1",
664 "header": "Item description",
666 "xtype": "ColumnModel",
667 "|renderer": "function(v) { return String.format('{0}', v); }",
671 "*prop": "colModel[]",
672 "dataIndex": "poitem_duedate",
673 "header": "Due date",
675 "xtype": "ColumnModel",
676 "|renderer": "function(v) { return String.format('{0}', v ? v.format('Y-m-d') : ''); }",
680 "*prop": "colModel[]",
682 "dataIndex": "poitem_qty_ordered",
685 "xtype": "ColumnModel",
686 "|renderer": "function(v) { return String.format('{0}', v); }",
691 "xtype": "GridEditor",
696 "allowDecimals": false,
697 "decimalPrecision": 0,
699 "style": "text-align:right",
700 "xtype": "NumberField",
708 "*prop": "colModel[]",
710 "dataIndex": "poitem_qty_received",
711 "header": "Received",
713 "xtype": "ColumnModel",
714 "|renderer": "function(v,x,r) { \n return String.format(\n r.data.poitem_qty_ordered != (v-r.data.poitem_qty_returned) ? '<span style=\"color:red\">{0}</span>': '{0}',\n v - r.data.poitem_qty_returned);\n}",
718 "*prop": "colModel[]",
720 "dataIndex": "poitem_qty_vouchered",
721 "header": "Vouchered",
723 "xtype": "ColumnModel",
724 "|renderer": "function(v,x,r) { \n return String.format(\n r.data.poitem_qty_ordered != v ? '<span style=\"color:red\">{0}</span>': '{0}',\n v);\n}",
728 "*prop": "colModel[]",
730 "dataIndex": "poitem_unitprice",
731 "header": "Unit price",
733 "xtype": "ColumnModel",
734 "|renderer": "function(v) { return String.format('{0}', (v || v == 0) ? parseFloat(v).toFixed(3) : ''); }",
739 "xtype": "GridEditor",
745 "allowDecimals": false,
746 "decimalPrecision": 0,
748 "style": "text-align:right",
749 "xtype": "NumberField",
763 "xtype": "NestedLayoutPanel",
768 "xtype": "BorderLayout",
773 "xtype": "LayoutRegion",
780 "xtype": "LayoutRegion",
785 "|activate": "function() {\n _this.itempanel = this;\n \n \n if (_this.itemgrid) {\n _this.itemgrid.footer.onClick('first');\n }\n}"
788 "fitContainer": true,
791 "tableName": "poitem",
793 "xtype": "GridPanel",
798 "|render": "function() \n{\n _this.itemgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.itempanel.active) {\n this.footer.onClick('first');\n }\n}",
799 "rowclick": "function (_self, rowIndex, e)\n{\n \n _this.gltransgrid.footer.onClick('first');\n}"
802 "autoExpandColumn": "item_number",
814 "click": "function (_self, e)\n{\n \n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n method : 'GET',\n timeout: 600000,\n params : {\n _group : 'gltrans_stock',\n _name : 'byorder',\n 'pohead_number:text' : _this.form.findField('pohead_number').getValue(),\n csvCols : '*',\n csvTitles : '*', \n limit : 9999 \n }\n });\n}"
816 "text": "PO analysis",
818 "|xns": "Roo.Toolbar"
824 "singleSelect": true,
825 "xtype": "RowSelectionModel",
830 "beforeload": "function (_self, o)\n{\n o.params = o.params || {};\n var hid = _this.form.findField('pohead_id').getValue();\n \n if(!hid.length){\n return false;\n }\n \n o.params.poitem_pohead_id = hid;\n \n o.params._with_item = 1;\n \n}",
831 "load": "function (_self, records, options)\n{\n _this.gltransgrid.footer.onClick('first');\n}"
833 "*prop": "dataSource",
836 "|sortInfo": "{ field : 'poitem_id', direction: 'ASC' }",
842 "xtype": "HttpProxy",
843 "|url": "baseURL + '/Roo/poitem.php'",
848 "xtype": "JsonReader",
849 "totalProperty": "total",
853 "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'type',\n 'type': 'int'\n },\n {\n 'name': 'leader',\n 'type': 'int'\n },\n {\n 'name': 'leader_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_office_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_name',\n 'type': 'string'\n },\n {\n 'name': 'leader_phone',\n 'type': 'string'\n },\n {\n 'name': 'leader_fax',\n 'type': 'string'\n },\n {\n 'name': 'leader_email',\n 'type': 'string'\n },\n {\n 'name': 'leader_company_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_role',\n 'type': 'string'\n },\n {\n 'name': 'leader_active',\n 'type': 'int'\n },\n {\n 'name': 'leader_remarks',\n 'type': 'string'\n },\n {\n 'name': 'leader_passwd',\n 'type': 'string'\n },\n {\n 'name': 'leader_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_lang',\n 'type': 'string'\n },\n {\n 'name': 'leader_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'leader_action_type',\n 'type': 'string'\n },\n {\n 'name': 'leader_project_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'leader_deleted_dt',\n 'type': 'date'\n },\n {\n 'name': 'leader_firstname',\n 'type': 'string'\n },\n {\n 'name': 'leader_lastname',\n 'type': 'string'\n },\n {\n 'name': 'leader_name_facebook',\n 'type': 'string'\n },\n {\n 'name': 'leader_url_blog',\n 'type': 'string'\n },\n {\n 'name': 'leader_url_twitter',\n 'type': 'string'\n },\n {\n 'name': 'leader_url_linkedin',\n 'type': 'string'\n },\n {\n 'name': 'leader_crm_lead_percentage',\n 'type': 'int'\n },\n {\n 'name': 'leader_crm_industry_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_crm_updated_action_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_crm_created_action_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_crm_type_id',\n 'type': 'int'\n }\n]"
859 "displayInfo": false,
860 "displayMsg": "Displaying poitem{0} - {1} of {2}",
861 "emptyMsg": "No item found",
863 "xtype": "PagingToolbar",
867 "*prop": "colModel[]",
868 "dataIndex": "poitem_linenumber",
871 "xtype": "ColumnModel",
872 "|renderer": "function(v) { return String.format('{0}', v); }",
876 "*prop": "colModel[]",
877 "dataIndex": "item_number",
880 "xtype": "ColumnModel",
881 "|renderer": "function(v) { return String.format('{0}', v); }",
885 "*prop": "colModel[]",
886 "dataIndex": "poitem_qty_ordered",
889 "xtype": "ColumnModel",
890 "|renderer": "function(v) { return String.format('{0}', v); }",
894 "*prop": "colModel[]",
895 "dataIndex": "poitem_qty_received",
896 "header": "Received",
898 "xtype": "ColumnModel",
899 "|renderer": "function(v,x,r) \n{\n \n\n var recv = (v- r.data.poitem_qty_returned);\n if (recv != r.data.tx_qty) {\n return String.format('<s style=\"color:red;font-weight:bold\">{0}</s>{1} ', recv, \n (r.data.tx_qty *1).toFixed(0) ) ; \n }\n return String.format('{0}', (v- r.data.poitem_qty_returned)) ; \n \n}",
903 "*prop": "colModel[]",
904 "dataIndex": "poitem_unitprice",
905 "header": "Unit Price",
907 "xtype": "ColumnModel",
908 "|renderer": "function(v,x,r) \n{\n \n return String.format('{0}', (v- r.data.poitem_qty_returned) ? parseFloat(v- r.data.poitem_qty_returned).toFixed(3) : '') ; \n \n}",
917 "|activate": "function() {\n _this.gltranspanel = this;\n //if (_this.gltransgrid) {\n // _this.gltransgrid.footer.onClick('first');\n // }\n}"
920 "fitContainer": true,
923 "tableName": "Gltrans",
925 "xtype": "GridPanel",
930 "|render": "function() \n{\n _this.gltransgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n // if (_this.gltranspanel.active) {\n // this.footer.onClick('first');\n // }\n}"
933 "autoExpandColumn": "gltrans_notes",
940 "singleSelect": true,
941 "xtype": "RowSelectionModel",
946 "beforeload": "function (_self, o)\n{\n o.params = o.params || {};\n \n var s = _this.itemgrid.getSelectionModel().getSelected();\n if(!s){\n this.removeAll();\n return false;\n }\n \n o.params._poview = 1;\n o.params.gltrans_deleted = 0;\n o.params.gltrans_doctype = 'PO';\n o.params._linenumber = s.data.poitem_linenumber;\n o.params._item = s.data.item_number;\n o.params._ponumber = _this.form.findField('pohead_number').getValue();\n \n}"
948 "*prop": "dataSource",
951 "|sortInfo": "{ field : 'gltrans_id', direction: 'ASC' }",
957 "xtype": "HttpProxy",
958 "|url": "baseURL + '/Roo/gltrans.php'",
963 "xtype": "JsonReader",
964 "totalProperty": "total",
968 "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'type',\n 'type': 'int'\n },\n {\n 'name': 'leader',\n 'type': 'int'\n },\n {\n 'name': 'leader_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_office_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_name',\n 'type': 'string'\n },\n {\n 'name': 'leader_phone',\n 'type': 'string'\n },\n {\n 'name': 'leader_fax',\n 'type': 'string'\n },\n {\n 'name': 'leader_email',\n 'type': 'string'\n },\n {\n 'name': 'leader_company_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_role',\n 'type': 'string'\n },\n {\n 'name': 'leader_active',\n 'type': 'int'\n },\n {\n 'name': 'leader_remarks',\n 'type': 'string'\n },\n {\n 'name': 'leader_passwd',\n 'type': 'string'\n },\n {\n 'name': 'leader_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_lang',\n 'type': 'string'\n },\n {\n 'name': 'leader_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'leader_action_type',\n 'type': 'string'\n },\n {\n 'name': 'leader_project_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'leader_deleted_dt',\n 'type': 'date'\n },\n {\n 'name': 'leader_firstname',\n 'type': 'string'\n },\n {\n 'name': 'leader_lastname',\n 'type': 'string'\n },\n {\n 'name': 'leader_name_facebook',\n 'type': 'string'\n },\n {\n 'name': 'leader_url_blog',\n 'type': 'string'\n },\n {\n 'name': 'leader_url_twitter',\n 'type': 'string'\n },\n {\n 'name': 'leader_url_linkedin',\n 'type': 'string'\n },\n {\n 'name': 'leader_crm_lead_percentage',\n 'type': 'int'\n },\n {\n 'name': 'leader_crm_industry_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_crm_updated_action_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_crm_created_action_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_crm_type_id',\n 'type': 'int'\n }\n]"
975 "displayMsg": "Displaying gltrans{0} - {1} of {2}",
976 "emptyMsg": "No gltrans found",
978 "xtype": "PagingToolbar",
987 "|xns": "Roo.Toolbar",
991 "text": "Apply fixes",
993 "|xns": "Roo.Toolbar",
1002 "|click": "function()\n{\n var pohead_number = _this.form.findField('pohead_number').getValue();\n var pohead_id = _this.form.findField('pohead_id').getValue();\n \n \n new Pman.Request({\n url : baseURL + '/Roo/pohead.php',\n mask : 'sending',\n method :'POST',\n params : {\n pohead_id : pohead_id,\n _recv_fix : 1\n \n },\n success : function(res) {\n Roo.MessageBox.alert('Notice', 'DONE');\n }\n });\n \n \n \n \n \n}\n"
1004 "cls": "x-btn-text-icon",
1005 "text": "Repost goods reciept",
1007 "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
1012 "xtype": "Separator"
1016 "|click": "function()\n{\n var pohead_number = _this.form.findField('pohead_number').getValue();\n var pohead_id = _this.form.findField('pohead_id').getValue();\n \n var fixit = function(){\n new Pman.Request({\n url : baseURL + '/Roo/pohead.php',\n method :'POST',\n params : {\n pohead_id : pohead_id,\n _unitcost : 1\n \n },\n success : function(res) {\n Roo.MessageBox.alert('Notice', 'DONE');\n }\n });\n }\n \n Roo.MessageBox.confirm(\n \"Confirm\",\n \"Are you sure to fix the unit cost of \" + pohead_number + \" ?\",\n function(r) {\n if (r != 'yes') {\n return;\n }\n\n fixit();\n return;\n }\n ); \n \n \n}\n"
1018 "cls": "x-btn-text-icon",
1019 "text": "Fix Unit Cost",
1021 "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
1026 "xtype": "Separator"
1030 "|click": "function()\n{\n var pohead_number = _this.form.findField('pohead_number').getValue();\n var pohead_id = _this.form.findField('pohead_id').getValue();\n \n var addv = function(){\n new Pman.Request({\n url : baseURL + '/Roo/pohead.php',\n method :'POST',\n params : {\n pohead_id : pohead_id,\n _variance : 1\n \n },\n success : function(res) {\n Roo.MessageBox.alert('Notice', 'DONE');\n }\n });\n }\n \n Roo.MessageBox.confirm(\n \"Confirm\",\n \"Are you sure to add all the variance for \" + pohead_number + \" ?\",\n function(r) {\n if (r != 'yes') {\n return;\n }\n\n addv();\n return;\n }\n ); \n \n \n}\n"
1032 "cls": "x-btn-text-icon",
1033 "text": "Add All Variance",
1035 "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
1040 "|click": "function()\n{\n var s = _this.gltransgrid.getSelectionModel().getSelected();\n \n if(!s){\n Roo.MessageBox.alert('Error','Please select a transaction');\n return;\n }\n \n if(s.data.gltrans_misc_id != -1){\n Roo.MessageBox.alert('Error','Just allow to delete the variance');\n return;\n }\n \n var delit = function(){\n new Pman.Request({\n url : baseURL + '/Roo/Gltrans.php',\n method :'POST',\n params : {\n gltrans_id : s.data.gltrans_id,\n _del : 1\n \n },\n success : function(res) {\n _this.gltransgrid.footer.onClick('refresh');\n \n }\n });\n }\n \n Roo.MessageBox.confirm(\n \"Confirm\",\n \"Are you sure to delete ?\",\n function(r) {\n if (r != 'yes') {\n return;\n }\n\n delit();\n return;\n }\n ); \n \n \n}\n"
1042 "cls": "x-btn-text-icon",
1043 "text": "Delete Variance",
1045 "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
1050 "|click": "function()\n{\n var pohead_number = _this.form.findField('pohead_number').getValue();\n var pohead_id = _this.form.findField('pohead_id').getValue();\n \n var delv = function(){\n new Pman.Request({\n url : baseURL + '/Roo/pohead.php',\n method :'POST',\n params : {\n pohead_id : pohead_id,\n _del : 1\n \n },\n success : function(res) {\n Roo.MessageBox.alert('Notice', 'DONE');\n }\n });\n }\n \n Roo.MessageBox.confirm(\n \"Confirm\",\n \"Are you sure to delete the variance on voucher of \" + pohead_number + \" ?\",\n function(r) {\n if (r != 'yes') {\n return;\n }\n\n delv();\n return;\n }\n ); \n \n \n}\n"
1052 "cls": "x-btn-text-icon",
1053 "text": "Delete Varinace on voucher",
1055 "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
1060 "xtype": "Separator"
1064 "|click": "function()\n{\n var pohead_number = _this.form.findField('pohead_number').getValue();\n var pohead_id = _this.form.findField('pohead_id').getValue();\n \n var addv = function(){\n new Pman.Request({\n url : baseURL + '/Roo/pohead.php',\n method :'POST',\n params : {\n pohead_id : pohead_id,\n _fix_voids : 1\n \n },\n success : function(res) {\n Roo.MessageBox.alert('Notice', 'DONE');\n }\n });\n }\n \n Roo.MessageBox.confirm(\n \"Confirm\",\n \"Are you sure to add all the fix the voids for \" + pohead_number + \" ?\",\n function(r) {\n if (r != 'yes') {\n return;\n }\n\n addv();\n return;\n }\n ); \n \n \n}\n"
1066 "cls": "x-btn-text-icon",
1067 "text": "Recalculate voids",
1069 "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
1078 "|click": "function()\n{\n var s = _this.gltransgrid.selModel.getSelected();\n if (!s) {\n Roo.MessageBox.alert(\"Error\", \"Select an item to reverse\");\n return;\n }\n \n var fixit = function(){\n new Pman.Request({\n url : baseURL + '/Roo/invdetail.php',\n method :'POST',\n params : {\n \n _reverse : s.data.invdetail_id \n },\n success : function(res) {\n Roo.MessageBox.alert('Notice', 'DONE');\n }\n });\n }\n \n Roo.MessageBox.confirm(\n \"Confirm\",\n \"Are you sure to reverse that line\",\n function(r) {\n if (r != 'yes') {\n return;\n }\n\n fixit();\n return;\n }\n ); \n \n \n}\n"
1080 "cls": "x-btn-text-icon",
1083 "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
1084 "|xns": "Roo.Toolbar"
1089 "*prop": "colModel[]",
1090 "dataIndex": "gltrans_id",
1093 "xtype": "ColumnModel",
1094 "|renderer": "function(v) { return String.format('{0}', v); }",
1098 "*prop": "colModel[]",
1099 "dataIndex": "gltrans_date",
1102 "xtype": "ColumnModel",
1103 "|renderer": "function(v) { return String.format('{0}', v ? v.format('Y-m-d') : ''); }",
1107 "*prop": "colModel[]",
1108 "dataIndex": "gltrans_docnumber",
1111 "xtype": "ColumnModel",
1112 "|renderer": "function(v) { return String.format('{0}', v); }",
1116 "*prop": "colModel[]",
1118 "dataIndex": "location_name",
1119 "header": "Location",
1121 "xtype": "ColumnModel",
1122 "|renderer": "function(v,x,r) {\n \n \n return String.format('{0}', v); \n\n}",
1126 "*prop": "colModel[]",
1128 "dataIndex": "gltrans_amount",
1131 "xtype": "ColumnModel",
1132 "|renderer": "function(v,x,r) { \n return String.format('{0}', v); \n\n}",
1136 "*prop": "colModel[]",
1138 "dataIndex": "invdetail_qty",
1141 "xtype": "ColumnModel",
1142 "|renderer": "function(v,x,r) {\n var f = r.data.invfifo_void * 1 ? '<s>{0}</s>' : '{0}';\n \n return String.format(f, (v*1).toFixed(0)); \n\n}",
1146 "*prop": "colModel[]",
1147 "dataIndex": "gltrans_notes",
1150 "xtype": "ColumnModel",
1151 "|renderer": "function(v) { return String.format('{0}', v); }",
1165 "xtype": "NestedLayoutPanel",
1170 "xtype": "BorderLayout",
1175 "xtype": "LayoutRegion",
1182 "xtype": "LayoutRegion",
1187 "|activate": "function() {\n _this.gltxpanel = this;\n if (_this.gltxgrid) {\n _this.gltxgrid.footer.onClick('first');\n }\n}"
1189 "background": false,
1190 "fitContainer": true,
1193 "tableName": "invdetail",
1194 "title": "invdetail",
1195 "xtype": "GridPanel",
1200 "|render": "function() \n{\n _this.gltxgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.gltxpanel.active) {\n this.footer.onClick('first');\n }\n}",
1201 "cellclick": "function (_self, rowIndex, columnIndex, e)\n{\n if (columnIndex > 0) {\n return;\n }\n var rec = this.ds.getAt(rowIndex);\n rec.set('gltrans_as_summary', rec.data.gltrans_as_summary *1 ? 0 : 1);\n _this.gltxdgrid.footer.onClick('first');\n}"
1204 "autoExpandColumn": "gltrans_accnt_id_accnt_descrip",
1211 "selectionchange": "function (_self)\n{\n _this.gltxdgrid.footer.onClick('first');;\n}"
1214 "singleSelect": true,
1215 "xtype": "RowSelectionModel",
1220 "beforeload": "function (_self, o)\n{\n o.params.pohead_id = _this.form.findField('pohead_id').getValue();\n if (! o.params.pohead_id ) {\n this.removeAll();\n return false;\n }\n o.params._split_sales = _this.glsalesbtn.pressed ? 1 : 0;\n}",
1221 "load": "function (_self, records, options)\n{\n _this.gltxdgrid.footer.onClick('first');\n}"
1223 "*prop": "dataSource",
1226 "|sortInfo": "{ field : 'item_number', direction: 'ASC' }",
1232 "xtype": "HttpProxy",
1233 "|url": "baseURL + '/Roo/gltrans.php'",
1238 "xtype": "JsonReader",
1239 "totalProperty": "total",
1243 "|fields": "[\n {\n 'name': 'invdetail_id',\n 'type': 'int'\n },\n {\n 'name': 'invdetail_transtype',\n 'type': 'string'\n },\n {\n 'name': 'invdetail_invhist_id',\n 'type': 'int'\n },\n {\n 'name': 'invdetail_location_id',\n 'type': 'int'\n },\n {\n 'name': 'invdetail_qty',\n 'type': 'float'\n },\n {\n 'name': 'invdetail_comments',\n 'type': 'string'\n },\n {\n 'name': 'invdetail_qty_before',\n 'type': 'float'\n },\n {\n 'name': 'invdetail_qty_after',\n 'type': 'float'\n },\n {\n 'name': 'invdetail_invcitem_id',\n 'type': 'int'\n },\n {\n 'name': 'invdetail_expiration',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'invdetail_warrpurc',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'invdetail_ls_id',\n 'type': 'int'\n }\n]"
1249 "displayInfo": true,
1250 "displayMsg": "Displaying invdetail{0} - {1} of {2}",
1251 "emptyMsg": "No invdetail found",
1253 "xtype": "PagingToolbar",
1258 "render": "function (_self)\n{\n _this.glsalesbtn = _self;\n}",
1259 "click": "function (_self, e)\n{\n (function() { _this.gltxgrid.footer.onClick('first'); }).defer(100);\n}"
1261 "enableToggle": true,
1263 "text": "Split sales",
1265 "|xns": "Roo.Toolbar"
1270 "*prop": "colModel[]",
1271 "dataIndex": "gltrans_as_summary",
1272 "header": "Summary",
1274 "xtype": "ColumnModel",
1275 "|renderer": "function(v,x,r) { \n \n var state = v*1 ? '-checked' : '';\n \n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n }",
1279 "*prop": "colModel[]",
1280 "dataIndex": "gltrans_accnt_id_accnt_descrip",
1281 "header": "Account",
1283 "xtype": "ColumnModel",
1284 "|renderer": "function(v) { return String.format('{0}', v); }",
1288 "*prop": "colModel[]",
1290 "dataIndex": "gltrans_amount_credit",
1293 "xtype": "ColumnModel",
1294 "|renderer": "function(v) { return String.format('{0}', Roo.util.Format.number(v,3)); }",
1298 "*prop": "colModel[]",
1300 "dataIndex": "gltrans_amount_debit",
1303 "xtype": "ColumnModel",
1304 "|renderer": "function(v) { return String.format('{0}', Roo.util.Format.number(v,3)); }",
1308 "*prop": "colModel[]",
1310 "dataIndex": "gltrans_amount_total",
1313 "xtype": "ColumnModel",
1314 "|renderer": "function(v) { return String.format('<b>{0}</b>', Roo.util.Format.number(v,3)); }",
1318 "*prop": "colModel[]",
1320 "dataIndex": "gltrans_amount_total_unposted",
1321 "header": "Unposted",
1323 "xtype": "ColumnModel",
1324 "|renderer": "function(v) { return String.format('<span style=\"color:red\">{0}</span>', Roo.util.Format.number(v,3)); }",
1333 "|activate": "function() {\n _this.gltxdpanel = this;\n if (_this.gltxdgrid) {\n _this.gltxdgrid.footer.onClick('first');\n }\n}"
1335 "background": false,
1336 "fitContainer": true,
1339 "tableName": "invdetail",
1340 "title": "invdetail",
1341 "xtype": "GridPanel",
1346 "|render": "function() \n{\n _this.gltxdgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.gltxdpanel.active) {\n this.footer.onClick('first');\n }\n}",
1347 "cellclick": "function (_self, ri, ci, e)\n{\n \n var deleteSel = function() {\n \n new Pman.Request({\n mask : \"Reversing\",\n url : baseURL + '/Roo/gltrans',\n method : 'POST',\n params : { \n _void : 1,\n gltrans_id : rec.data.gltrans_id\n \n }, \n success : function() {\n rec.set('gltrans_posted', false);\n rec.set('gltrans_deleted', true);\n rec.set('gltrans_docnumber', rec.data.gltrans_docnumber);\n _this.gltxgrid.footer.onClick('first');\n }\n });\n \n }\n var undeleteSel = function() {\n \n new Pman.Request({\n mask : \"Reversing\",\n url : baseURL + '/Roo/gltrans',\n method : 'POST',\n params : { \n _unvoid : 1,\n gltrans_id : rec.data.gltrans_id\n \n }, \n success : function() {\n rec.set('gltrans_posted', true);\n rec.set('gltrans_deleted', false);\n rec.set('gltrans_docnumber', rec.data.gltrans_docnumber);\n _this.gltxgrid.footer.onClick('first');\n }\n });\n \n }\n \n var di = this.colModel.config[ci].dataIndex;\n if (di != 'gltrans_posted') {\n return;\n }\n \n \n \n var rec = this.ds.getAt(ri);\n if (rec.data.gltrans_deleted) {\n \n Roo.MessageBox.confirm(\n \"Confirm\", \n \"This should only be used by System Administrators - are you sure you know what you are doing!\",\n function(x) {\n if (x != 'yes') {\n return;\n }\n undeleteSel();\n }\n );\n \n return false;\n }\n\n \n \n if (!rec.data.gltrans_posted) {\n\n \n \n new Pman.Request({\n method : 'POST',\n url : baseURL + '/Roo/gltrans',\n mask : \"Posting\",\n params : {\n _post : 1,\n gltrans_id : rec.data.gltrans_id\n },\n success : function (res)\n {\n rec.set('gltrans_posted', true);\n _this.gltxgrid.footer.onClick('first');\n \n }\n \n \n });\n return;\n }\n \n // we have a posted transaction.\n // only allow recalled to be deleted..\n if (!rec.data.gltrans_notes.match(/(Recall|Ship Order)/)) {\n return false;\n }\n \n \n \n \n \n\n Roo.MessageBox.confirm(\n \"Confirm\", \n \"This should only be used by System Administrators - are you sure you know what you are doing!\",\n function(x) {\n if (x != 'yes') {\n return;\n }\n deleteSel();\n }\n );\n \n \n \n}"
1350 "autoExpandColumn": "gltrans_notes",
1362 "render": "function (_self)\n{\n _this.glvoidshow = _self;\n}",
1363 "click": "function (_self, e)\n{\n (function() { _this.gltxgrid.footer.onClick('first'); }).defer(100);\n}"
1365 "enableToggle": true,
1367 "text": "Hide Void",
1369 "|xns": "Roo.Toolbar"
1372 "|xns": "Roo.Toolbar",
1377 "click": "function (_self, e)\n{\n new Pman.Request( {\n url : baseURL + '/Roo/Gltrans',\n method : 'GET',\n mask: 'sending',\n params : {\n pohead_id : _this.form.findField('pohead_id').getValue(),\n _autovoid : 1\n },\n success : function() {\n _this.gltxpanel.footer.onClick('first');\n }\n \n \n });\n}"
1381 "|xns": "Roo.Toolbar"
1387 "beforeload": "function (_self, o)\n{\n o.params.pohead_id = _this.form.findField('pohead_id').getValue();\n var s = _this.gltxgrid.selModel.getSelected();\n if (!s) { \n this.removeAll();\n return false;\n }\n o.params.gltrans_accnt_id = s.data.gltrans_accnt_id;\n o.params.gltrans_is_ship = s.data.gltrans_is_ship;\n o.params.gltrans_as_summary = s.data.gltrans_as_summary;\n o.params._hide_void = _this.glvoidshow.pressed ? 1 : 0;\n //glvoidshow\n \n}"
1389 "*prop": "dataSource",
1392 "|sortInfo": "{ field : 'gltrans_docnumber', direction: 'ASC' }",
1398 "xtype": "HttpProxy",
1399 "|url": "baseURL + '/Roo/gltrans.php'",
1404 "xtype": "JsonReader",
1405 "totalProperty": "total",
1409 "|fields": "[\n {\n 'name': 'invdetail_id',\n 'type': 'int'\n },\n {\n 'name': 'invdetail_transtype',\n 'type': 'string'\n },\n {\n 'name': 'invdetail_invhist_id',\n 'type': 'int'\n },\n {\n 'name': 'invdetail_location_id',\n 'type': 'int'\n },\n {\n 'name': 'invdetail_qty',\n 'type': 'float'\n },\n {\n 'name': 'invdetail_comments',\n 'type': 'string'\n },\n {\n 'name': 'invdetail_qty_before',\n 'type': 'float'\n },\n {\n 'name': 'invdetail_qty_after',\n 'type': 'float'\n },\n {\n 'name': 'invdetail_invcitem_id',\n 'type': 'int'\n },\n {\n 'name': 'invdetail_expiration',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'invdetail_warrpurc',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'invdetail_ls_id',\n 'type': 'int'\n }\n]"
1415 "displayInfo": true,
1416 "displayMsg": "Displaying invdetail{0} - {1} of {2}",
1417 "emptyMsg": "No invdetail found",
1419 "xtype": "PagingToolbar",
1424 "click": "function (_self, e)\n{\n new Pman.Download( {\n grid : _this.gltxdgrid\n \n });\n}"
1428 "|xns": "Roo.Toolbar"
1433 "*prop": "colModel[]",
1434 "dataIndex": "gltrans_id",
1438 "xtype": "ColumnModel",
1439 "|renderer": "function(v) { return String.format('{0}', v ); }",
1443 "*prop": "colModel[]",
1444 "dataIndex": "gltrans_date",
1447 "xtype": "ColumnModel",
1448 "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
1452 "*prop": "colModel[]",
1453 "dataIndex": "gltrans_docnumber",
1456 "xtype": "ColumnModel",
1457 "|renderer": "function(v,x,r) { \n\n var style = '';\n if (r.data.gltrans_misc_id > 0 && (r.data.invdetail_id *1) < 1) {\n style = ' style=\"color:red;font-weight:bold\"';\n }\n if (r.data.gltrans_deleted) {\n return String.format('<s'+style+'>{0}</s>', v); \n }\n return String.format('<span' + style + '>{0}</span>', v); \n}",
1461 "*prop": "colModel[]",
1462 "dataIndex": "gltrans_source",
1465 "xtype": "ColumnModel",
1466 "|renderer": "function(v) { return String.format('{0}', v); }",
1470 "*prop": "colModel[]",
1471 "dataIndex": "gltrans_notes",
1474 "xtype": "ColumnModel",
1475 "|renderer": "function(v) { return String.format('{0}', v); }",
1479 "*prop": "colModel[]",
1481 "dataIndex": "gltrans_amount",
1484 "xtype": "ColumnModel",
1485 "|renderer": "function(v) { return String.format('{0}', Roo.util.Format.number(v,3)); }",
1489 "*prop": "colModel[]",
1490 "dataIndex": "gltrans_posted",
1493 "xtype": "ColumnModel",
1494 "|renderer": "function(v,x,r) { \n \n var state = v ? '-checked' : '';\n \n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n }",
1507 "click": "function (_self, e)\n{\n _this.dialog.hide();\n}"
1509 "*prop": "buttons[]",
1516 "click": "function (_self, e)\n{\n if(_this.grid){\n var ar = [];\n var err = false;\n _this.grid.ds.each(function(r) {\n if(r.data.poitem_unitprice < 1){\n err = true;\n return;\n }\n ar.push({\n poitem_id : r.data.poitem_id,\n poitem_itemsite_id : r.data.poitem_itemsite_id,\n poitem_unitprice : r.data.poitem_unitprice,\n poitem_qty_ordered : r.data.poitem_qty_ordered\n });\n \n });\n \n if(err){\n Roo.MessageBox.alert('Error','Unit Price does not allow $0' );\n return;\n } \n \n _this.form.findField('items').setValue(JSON.stringify(ar));\n }\n \n _this.form.doAction(\"submit\");\n\n}",
1517 "render": "function (_self)\n{\n _this.saveBtn = _self;\n}"
1519 "*prop": "buttons[]",