3 "name": "Pman.Tab.XtupleSalesOrder",
4 "parent": "Pman.Tab.XtupleSales",
6 "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleSalesOrder.bjs",
10 "activate": "function (_self)\n{\n this.setTitle('Sales Orders (' + Pman.Login.authUser.dbname +')');\n}"
13 "title": "Sales Orders",
14 "xtype": "NestedLayoutPanel",
18 "xtype": "BorderLayout",
23 "xtype": "LayoutRegion",
31 "xtype": "LayoutRegion",
37 "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
39 ".builderCfg": "{\"cols\":[{\"table\":\"cohead\",\"column\":\"cohead_number\",\"columnshort\":\"cohead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#order\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"},{\"table\":\"cohead\",\"column\":\"cohead_custponumber\",\"columnshort\":\"cohead_custponumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Cust. PO#\"},{\"table\":\"cohead\",\"column\":\"cohead_type\",\"columnshort\":\"cohead_type\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Type\"},{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_name\",\"columnshort\":\"shipto_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to\"},{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_descrip\",\"columnshort\":\"terms_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Terms\"},{\"table\":\"curr_symbol\",\"column\":\"cohead_curr_id_curr_name\",\"columnshort\":\"curr_name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Currency\"}],\"cols_ex\":[\"cohead_cust_id_cust_name\"],\"table\":\"cohead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
44 "tableName": "cohead",
51 "|render": "function() \n{\n _this.grid = this; \n try { \n _this.dialog = Pman.Dialog.XtupleSalesOrder;\n } catch(e) {}\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}",
52 "|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('refresh');\n Pman.Tab.XtupleSales.grid.footer.onClick('first');\n }); \n}\n"
55 "autoExpandColumn": "cohead_cust_id_cust_name",
62 "beforeload": "function (_self, options)\n{\n var vl;\n try { \n vl = _this.form.getFieldValues();\n } catch (e) {\n vl = {};\n }\n\n \n \n for(var x in vl) {\n if (!(new String(vl[x])).length) {\n continue;\n }\n options.params[x] = vl[x];\n \n }\n try {\n if (options.params['query[cohead_number]'].length) {\n options.params.viewtype = 'REALALL';\n }\n } catch (e) {}\n}"
64 "*prop": "dataSource",
65 ".builderCfg": "{\"cols\":[{\"table\":\"cohead\",\"column\":\"cohead_number\",\"columnshort\":\"cohead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#order\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"},{\"table\":\"cohead\",\"column\":\"cohead_custponumber\",\"columnshort\":\"cohead_custponumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Cust. PO#\"},{\"table\":\"cohead\",\"column\":\"cohead_type\",\"columnshort\":\"cohead_type\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Type\"},{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_name\",\"columnshort\":\"shipto_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to\"},{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_descrip\",\"columnshort\":\"terms_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Terms\"},{\"table\":\"curr_symbol\",\"column\":\"cohead_curr_id_curr_name\",\"columnshort\":\"curr_name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Currency\"}],\"cols_ex\":[\"cohead_cust_id_cust_name\"],\"table\":\"cohead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
68 "|sortInfo": "{ field : 'cohead_orderdate', direction: 'DESC' }",
76 "|url": "baseURL + '/Roo/cohead.php'",
81 "xtype": "JsonReader",
82 "totalProperty": "total",
84 ".builderCfg": "{\"cols\":[{\"table\":\"cohead\",\"column\":\"cohead_number\",\"columnshort\":\"cohead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#order\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"},{\"table\":\"cohead\",\"column\":\"cohead_custponumber\",\"columnshort\":\"cohead_custponumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Cust. PO#\"},{\"table\":\"cohead\",\"column\":\"cohead_type\",\"columnshort\":\"cohead_type\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Type\"},{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_name\",\"columnshort\":\"shipto_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to\"},{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_descrip\",\"columnshort\":\"terms_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Terms\"},{\"table\":\"curr_symbol\",\"column\":\"cohead_curr_id_curr_name\",\"columnshort\":\"curr_name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Currency\"}],\"cols_ex\":[\"cohead_cust_id_cust_name\"],\"table\":\"cohead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
87 "|fields": "[\n {\n 'name': 'cohead_number',\n 'type': 'string'\n },\n {\n 'name': 'cohead_cust_id_cust_name',\n 'type': 'string'\n },\n {\n 'name': 'cohead_custponumber',\n 'type': 'string'\n },\n {\n 'name': 'cohead_type'\n },\n {\n 'name': 'cohead_orderdate',\n 'type': 'date'\n },\n {\n 'name': 'cohead_shipto_id_shipto_name',\n 'type': 'string'\n },\n {\n 'name': 'cohead_terms_id_terms_descrip',\n 'type': 'string'\n },\n {\n 'name': 'cohead_curr_id_curr_name',\n 'type': 'string'\n }\n]"
93 "xtype": "PagingToolbar",
96 "displayMsg": "Displaying cohead{0} - {1} of {2}",
97 "emptyMsg": "No cohead found",
102 "click": "function ()\n{\n new Pman.Download({\n grid : _this.grid\n }); \n \n}"
104 "cls": "x-btn-text-icon",
105 "text": "Download Results",
107 "|icon": "rootURL + '/Pman/templates/images/spreadsheet.gif'",
108 "|xns": "Roo.Toolbar"
119 "click": "function (_self, e)\n{\n Pman.Dialog.XtupleInvHistory.show({\n \n \n });\n}"
121 "text": "Quick Stock Check",
123 "|xns": "Roo.Toolbar"
127 "click": "function (_self, e)\n{\n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Xtuple/Import/Magento',\n timeout : 90000\n \n },\n function (data) {\n Roo.MessageBox.alert(\"Notice\", data); \n _this.grid.footer.onClick('first');\n\n }\n );\n}"
129 "text": "Magento Upload",
131 "|xns": "Roo.Toolbar"
134 "cls": "x-btn-text-icon",
137 "|icon": "rootURL + '/Pman/templates/images/spreadsheet.gif'",
138 "|xns": "Roo.Toolbar",
157 "click": "function (_self, e)\n{\n var from = _this.form.findField('_fromdate').getValue();\n var to = _this.form.findField('_todate').getValue();\n \n if(!from || !to){\n Roo.Msg.alert('Error', 'Please select a date range for the report');\n return;\n }\n \n var params = {\n template: 'ARAging',\n filename : 'ARAging-' + to.format('Y-m-d'),\n 'param[0]': \"startDate:string='\" + from.format('Y-m-d') + \"'\",\n 'param[1]': \"relDate:string='\" + to.format('Y-m-d') + \"'\",\n 'param[2]': \"useDocDate:number=1\"\n };\n var cust_id = _this.form.findField('cohead_cust_id').getValue();\n if (cust_id * 1 > 0) {\n params['param[3]'] = 'cust_id:number=' + cust_id;\n }\n \n new Pman.Download({\n url : baseURL + '/Xtuple/Print',\n params : params,\n method : 'GET'\n });\n Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}"
165 "click": "function (_self, e)\n{\n var from = _this.form.findField('_fromdate').getValue();\n var to = _this.form.findField('_todate').getValue();\n \n \n \n var params = {\n '_group' : 'arAging',\n '_name' : 'bydate',\n 'limit' : 99999,\n \n 'startDate:text' : from ? from.format('Y-m-d') : '2000-01-01' ,\n 'relDate:text' : to ? to.format('Y-m-d') : '2100-01-01',\n \n \n \n 'useDocDate:text' : 'TRUE',\n 'csvTitles' : '*',\n 'csvCols' : '*'\n };\n \n \n var cust_id = _this.form.findField('cohead_cust_id').getValue();\n if (cust_id * 1 > 0) {\n params['cust_id:number'] = cust_id;\n }\n \n new Pman.Download({\r\n url : baseURL + '/Roo/Metasql',\r\n params : params,\r\n method : 'GET'\r\n });\r\n Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\r\n \r\n}"
173 "click": "function (_self, e)\n{\n var from = _this.form.findField('_fromdate').getValue();\n var to = _this.form.findField('_todate').getValue();\n \n \n \n var params = {\n '_group' : 'arAging',\n '_name' : 'summary',\n 'limit' : 99999,\n \n \n \n 'startDate:text' : from ? from.format('Y-m-d') : '2000-01-01' ,\n 'relDate:text' : to ? to.format('Y-m-d') : '2100-01-01',\n \n \n 'useDocDate:text' : 'TRUE',\n 'csvTitles' : '*',\n 'csvCols' : '*'\n };\n \n var cust_id = _this.form.findField('cohead_cust_id').getValue();\n if (cust_id * 1 > 0) {\n params['cust_id:number'] = cust_id;\n }\n \n new Pman.Download({\r\n url : baseURL + '/Roo/Metasql',\r\n params : params,\r\n method : 'GET'\r\n });\r\n Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\r\n \r\n}"
175 "text": "Summary Excel",
184 "text": "Customer History",
195 "click": "function (_self, e)\n{\n var cust_id = _this.form.findField('cohead_cust_id').getValue();\n if (cust_id * 1 < 1) {\n Roo.Msg.alert('Error', 'Please select a customer');\n return;\n }\n \n var from = _this.form.findField('_fromdate').getValue();\n var to = _this.form.findField('_todate').getValue();\n \n if(!from || !to){\n Roo.Msg.alert('Error', 'Please select a date range for the report');\n return;\n }\n \n var params = {\n template: 'customer_ar_history',\n filename : 'customer_ar_history-' + to.format('Y-m-d'),\n 'param[0]': \"startDate:string='\" + from.format('Y-m-d') + \"'\",\n 'param[1]': \"endDate:string='\" + to.format('Y-m-d') + \"'\",\n 'param[2]': \"cust_id:number=\" + cust_id\n };\n \n new Pman.Download({\n url : baseURL + '/Xtuple/Print',\n params : params,\n method : 'GET'\n });\n Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}"
203 "click": "function (_self, e)\n{\n var cust_id = _this.form.findField('cohead_cust_id').getValue();\n if (cust_id * 1 < 1) {\n Roo.Msg.alert('Error', 'Please select a customer');\n return;\n }\n \n var from = _this.form.findField('_fromdate').getValue();\n var to = _this.form.findField('_todate').getValue();\n \n \n \n var params = {\n '_group' : 'customerHistory',\n '_name' : 'detail',\n 'limit' : 99999,\n \n 'startDate:text' : from ? from.format('Y-m-d') : '2000-01-01' ,\n 'endDate:text' : to ? to.format('Y-m-d') : '2100-01-01',\n \n 'cust_id:number' : cust_id,\n 'csvTitles' : '*',\n 'csvCols' : '*'\n };\n \n \n new Pman.Download({\r\n url : baseURL + '/Roo/Metasql',\r\n params : params,\r\n method : 'GET'\r\n });\r\n Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}"
214 "text": "Customer Statement",
225 "click": "function (_self, e)\n{\n var cust_id = _this.form.findField('cohead_cust_id').getValue();\n if (cust_id * 1 < 1) {\n Roo.Msg.alert('Error', 'Please select a customer');\n return;\n }\n \n var from = _this.form.findField('_fromdate').getValue();\n var to = _this.form.findField('_todate').getValue();\n \n \n \n var params = {\n template: 'customer_ar_statement',\n filename : 'customer_ar_statement-' +(to ? to.format('Y-m-d') : '2100-01-01'),\n 'param[0]': \"startDate:string='\" + (from ? from.format('Y-m-d') : '2000-01-01') + \"'\",\n 'param[1]': \"asofdate:string='\" + (to ? to.format('Y-m-d') : '2100-01-01')+ \"'\",\n 'param[2]': \"cust_id:number=\" + cust_id\n };\n \n new Pman.Download({\n url : baseURL + '/Xtuple/Print',\n params : params,\n method : 'GET'\n });\n Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}"
233 "click": "function (_self, e)\n{\n var cust_id = _this.form.findField('cohead_cust_id').getValue();\n if (cust_id * 1 < 1) {\n Roo.Msg.alert('Error', 'Please select a customer');\n return;\n }\n \n var from = _this.form.findField('_fromdate').getValue();\n var to = _this.form.findField('_todate').getValue();\n\n //if(!from || !to){\n // Roo.Msg.alert('Error', 'Please select a date range for the report');\n // return;\n //}\n \n var params = {\n '_group' : 'customerStatement',\n '_name' : 'detail',\n 'limit' : 99999,\n 'startDate:text' : from ? from.format('Y-m-d') : '2000-01-01' ,\n 'asofdate:text' : to ? to.format('Y-m-d') : '2100-01-01',\n 'cust_id:number' : cust_id,\n 'csvTitles' : '*',\n 'csvCols' : '*'\n };\n\n \n new Pman.Download({\r\n url : baseURL + '/Roo/Metasql',\r\n params : params,\r\n method : 'GET'\r\n });\r\n Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}"
249 "|click": "function (_self, e)\n{\n var s = _this.grid.getSelectionModel().getSelected();\n if (!s) {\n Roo.MessageBox.alert(\"Error\", \"Select an order\");\n return;\n }\n \n new Pman.Download({\r\n url : baseURL + '/Xtuple/Reports/SalesOrderBookingDetail',\r\n params : {\n cohead_id : s.data.cohead_id\n },\r\n method : 'GET'\r\n });\r\n \n Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}"
251 "cls": "x-btn-text-icon",
252 "text": "Email to warehouse",
254 "|icon": "Roo.rootURL + 'images/default/dd/email.gif'",
255 "|xns": "Roo.Toolbar"
259 "|click": "function()\n{\n var s = _this.grid.getSelectionModel().getSelected();\n if (!s) {\n Roo.MessageBox.alert(\"Error\", \"Select an order to close\");\n return;\n }\n \n if(s.data.cohead_status == 'C'){\n Roo.MessageBox.alert(\"Error\", \"This order has been closed\");\n return;\n }\n \n new Pman.Request({\n url: baseURL + '/Roo/cohead',\n method : 'POST',\n params : {\n cohead_id : s.data.cohead_id,\n _close : 1\n },\n mask : 'Sending',\n success : function()\n {\n Roo.MessageBox.alert(\"Notice\", \"DONE\");\n _this.grid.footer.onClick('first');\n }\n });\n \n}\n"
261 "cls": "x-btn-text-icon",
262 "text": "Complete and Close",
264 "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
265 "|xns": "Roo.Toolbar"
269 "|xns": "Roo.Toolbar"
273 "|click": "function()\n{\n // check if the login in user have more than 25 open orders..\n // if yes, warning...\n new Pman.Request({\n url : baseURL + '/Roo/cohead.php',\n method :'GET',\n params : {\n viewtype : 'MYOPEN',\n _count_order : 1 // make the search faster!\n },\n success : function(res) {\n if(res.data[0].order_totals * 1 > 25){\n Roo.MessageBox.alert(\"Warning\", \"Can you please close old orders before creating new ones\");\n }\n }\n });\n \n Pman.Dialog.XtupleSalesOrderNew.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
275 "cls": "x-btn-text-icon",
278 "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
279 "|xns": "Roo.Toolbar"
283 "|click": "function()\n{\n var s = _this.grid.getSelectionModel().getSelected();\n if (!s) {\n Roo.MessageBox.alert(\"Error\", \"Select an order to copy\");\n return;\n }\n \n \n Pman.Dialog.XtupleSalesOrderCopy.show( { _copy_cohead_id : s.data.cohead_id } , function(data) {\n \n // get the id from the data, then \n \n _this.grid.footer.onClick('first');\n Pman.Tab.XtupleSales.grid.footer.onClick('first');\n // get the id from the data, then start editing it..\n Roo.log(data);\n _this.dialog.show(data, function() {\n _this.grid.footer.onClick('refresh');\n Pman.Tab.XtupleSales.grid.footer.onClick('first');\n }); \n \n }); \n}\n"
285 "cls": "x-btn-text-icon",
288 "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
289 "|xns": "Roo.Toolbar"
294 "*prop": "colModel[]",
295 ".builderCfg": "{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"}",
296 "dataIndex": "cohead_orderdate",
300 "xtype": "ColumnModel",
301 "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
305 "*prop": "colModel[]",
306 "dataIndex": "cohead_targetdate",
307 "header": "Target Delivery",
311 "xtype": "ColumnModel",
312 "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
316 "*prop": "colModel[]",
317 ".builderCfg": "{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"}",
318 "dataIndex": "cohead_salesrep_id_salesrep_name",
319 "header": "Staff IC.",
322 "xtype": "ColumnModel",
323 "|renderer": "function(v,x,r) { \n\n if (r.data.cohead_display_salesrep_id) {\n return String.format('{0} ({1})', v, r.data.cohead_display_salesrep_id_salesrep_name);\n }\n return String.format('{0}', v );\n \n \n }",
327 "*prop": "colModel[]",
328 "dataIndex": "cohead_number",
332 "xtype": "ColumnModel",
333 "|renderer": "function(v,x,r) {\n\n \n // we want to show more detail about status..\n // like payment status / delivery etc...\n \n // I = invoiced\n // R = Reserved\n // S = shipped (or partial shipped)\n // P = paid (or partial paid)\n // online payment failed? >> on terms?\n // \n var tags = {\n invoiced : '<span class=\"dragon-so-complete\" qtip=\"Invoiced\">I</>',\n invoiced_not : '<span class=\"dragon-so-complete-not\" qtip=\"Not Invoiced\">I</>',\n stock_not : '<span class=\"dragon-so-complete-not\" qtip=\"Stock not reserved or shipped\">S</>', \n stock_reserved : '<span class=\"dragon-so-complete-not\" qtip=\"Stock Reserved / Not shipped\">R</>',\n stock_shipped : '<span class=\"dragon-so-complete\" qtip=\"Shipped\">S</>'\n }; \n \n \n \n if (r.data.cohead_status == 'C') {\n return String.format('<i qtip=\"closed\">{0}</i>', v); \n }\n if (r.data.cohead_status == 'X') {\n return String.format('<s qtip=\"void\">{0}</s>', v); \n }\n return String.format('{0}', v); \n }",
337 "*prop": "colModel[]",
338 ".builderCfg": "{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"}",
339 "dataIndex": "cohead_cust_id_cust_number",
340 "header": "Customer#",
343 "xtype": "ColumnModel",
344 "|renderer": "function(v) { return String.format('{0}', v); }",
348 "*prop": "colModel[]",
349 ".builderCfg": "{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"}",
350 "dataIndex": "cohead_cust_id_cust_name",
351 "header": "Customer",
354 "xtype": "ColumnModel",
355 "|renderer": "function(v) { return String.format('{0}', v); }",
359 "*prop": "colModel[]",
360 ".builderCfg": "{\"table\":\"cohead\",\"column\":\"cohead_custponumber\",\"columnshort\":\"cohead_custponumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Cust. PO#\"}",
361 "dataIndex": "cohead_custponumber",
362 "header": "Cust. PO#",
364 "xtype": "ColumnModel",
365 "|renderer": "function(v) { return String.format('{0}', v); }",
369 "*prop": "colModel[]",
370 ".builderCfg": "{\"table\":\"cohead\",\"column\":\"cohead_type\",\"columnshort\":\"cohead_type\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Type\"}",
371 "dataIndex": "cohead_type",
374 "xtype": "ColumnModel",
375 "|renderer": "function(v) { return String.format('{0}', v); }",
379 "*prop": "colModel[]",
380 "dataIndex": "cohead_src_locations",
383 "xtype": "ColumnModel",
384 "|renderer": "function(v) { return String.format('{0}', v); }",
388 "*prop": "colModel[]",
389 ".builderCfg": "{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_name\",\"columnshort\":\"shipto_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to\"}",
390 "dataIndex": "cohead_shiptoaddress1",
393 "xtype": "ColumnModel",
394 "|renderer": "function(v) { return String.format('{0}', v); }",
398 "*prop": "colModel[]",
399 ".builderCfg": "{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_descrip\",\"columnshort\":\"terms_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Terms\"}",
400 "dataIndex": "cohead_terms_id_terms_descrip",
403 "xtype": "ColumnModel",
404 "|renderer": "function(v) { return String.format('{0}', v); }",
408 "*prop": "colModel[]",
410 "dataIndex": "cohead_total",
413 "xtype": "ColumnModel",
414 "|renderer": "function(v,x,r) { \n var ret = String.format('{0} {1}',\n r.data.cohead_curr_id_curr_name, v ? parseFloat(v).toFixed(3) : '---'\n ); \n \n if (parseInt(r.data.cohead_qtyordered) != 0 && \n parseInt(r.data.cohead_unshipped) == 0 && \n parseInt(r.data.cohead_qtyunshipped) == 0 &&\n parseInt(r.data.cohead_qtyuninvoiced) == 0 && \n parseInt(r.data.cohead_unshipped) == 0 &&\n parseInt(r.data.cohead_uninvoiced) == 0 \n ) {\n return ret;\n }\n \n return String.format('<b style=\"color:red\" ' + \n 'qtip=\"Products: {3} ({4}) <BR/>Unshipped: {1} ({5})<BR>Uninvoiced: {2} ({6})\">{0}</b>',\n ret, \n r.data.cohead_unshipped, r.data.cohead_uninvoiced, r.data.cohead_subtotal,\n r.data.cohead_qtyordered, r.data.cohead_qtyunshipped, r.data.cohead_qtyuninvoiced\n );\n \n }",
424 "xtype": "ContentPanel",
433 "|xns": "Roo.Toolbar",
438 "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
442 "|icon": "rootURL + '/Pman/templates/images/search.gif'",
443 "|xns": "Roo.Toolbar"
447 "|click": "function (_self, e)\n{\n _this.form.reset('');\n\n \n _this.grid.footer.onClick('first');\n}"
451 "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
452 "|xns": "Roo.Toolbar"
458 "|rendered": "function (form)\n{\n _this.form= form;\n}\n"
462 "style": "margin:5px;",
468 "|select": "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}",
469 "|render": "function (_self)\n{\n _this.viewtypeSel = _self;\n}"
472 "displayField": "value",
474 "emptyText": "View type",
475 "fieldLabel": "View",
476 "forceSelection": true,
478 "loadingText": "Searching...",
482 "qtip": "Select Action",
483 "queryParam": "query[action]",
484 "selectOnFocus": true,
485 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{value}</b> </div>",
486 "triggerAction": "all",
497 "xtype": "SimpleStore",
498 "|data": "[\n [ 'MYOPEN', 'My Open orders' ],\n [ 'MYCLOSED', 'My Closed orders' ],\n [ 'MYALL', 'My orders (all)' ], \n [ 'MYVOID', 'My Voided orders' ], \n [ 'OPEN', 'All Open orders' ],\n [ 'CLOSED', 'All Closed orders' ],\n [ 'ALL', 'All orders' ],\n [ 'VOID', 'Voided orders' ],\n [ 'INCOMPLETE', 'Incomplete orders' ], \n [ 'DRAFTSHIP', 'Have Un-confirmed Shipments' ],\n// [ 'SHIPPOSTBUG', 'Bugs with Posted transactions' ], \n// [ 'SHIPQTYBUG', 'Bugs with Shipment Qty' ] ,\n [ 'FIFOBUG', 'Problems with FIFO' ] \n \n]",
499 "|fields": "[ 'key', 'value' ]",
506 "select": "function (combo, record, index)\n{\n (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}",
507 "specialkey": "function (_self, e)\n{\n //Roo.log(e.getKey());\n if (e.getKey() == 13) {\n (function() { _this.grid.footer.onClick('first'); }).defer(100);\n e.stopEvent();\n _this.rsearch = true;\n }\n \n}",
508 "beforequery": "function (combo, query, forceAll, cancel, e)\n{\n \n if( _this.rsearch) {\n _this.rsearch =false;\n return false;\n }\n \n}"
511 "displayField": "cohead_number",
513 "emptyText": "Select Order",
514 "fieldLabel": "Order #",
515 "forceSelection": false,
517 "loadingText": "Searching...",
519 "name": "query[cohead_number]",
521 "qtip": "Select Order",
522 "queryParam": "query[cohead_number]",
523 "selectOnFocus": true,
524 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{cohead_number}</b> </div>",
525 "triggerAction": "all",
527 "valueField": "cohead_number",
534 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n o.params['_columns'] = 'cohead_number';\n // set more here\n}\n"
539 "|sortInfo": "{ direction : 'ASC', field: 'cohead_number' }",
545 "xtype": "HttpProxy",
546 "|url": "baseURL + '/Roo/cohead.php'",
551 "id": "cohead_number",
553 "totalProperty": "total",
554 "xtype": "JsonReader",
555 "|fields": "[\"cohead_number\"]",
564 "select": "function (combo, record, index)\n{\n (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}"
567 "displayField": "cust_name",
569 "emptyText": "Select custinfo",
570 "fieldLabel": "Customer",
571 "forceSelection": true,
572 "hiddenName": "cohead_cust_id",
574 "loadingText": "Searching...",
576 "name": "cohead_cust_id_cust_name",
578 "qtip": "Select custinfo",
579 "queryParam": "query[cust_name]",
580 "selectOnFocus": true,
581 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{cust_name}</b> ({cust_number})</div>",
582 "triggerAction": "all",
584 "valueField": "cust_id",
592 "|sortInfo": "{ direction : 'ASC', field: 'cust_name' }",
596 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
601 "xtype": "HttpProxy",
604 "|url": "baseURL + '/Roo/custinfo.php'"
608 "xtype": "JsonReader",
612 "totalProperty": "total",
613 "|fields": "[{\"name\":\"cust_id\",\"type\":\"int\"},\"cust_name\"]"
621 "select": "function (combo, date)\n{\n _this.grid.footer.onClick('first');\n}"
623 "fieldLabel": "From",
627 "xtype": "DateField",
632 "select": "function (combo, date)\n{\n _this.grid.footer.onClick('first');\n}"
638 "xtype": "DateField",