3 "name": "Pman.Tab.XtupleCustomer",
4 "parent": "Pman.Tab.XtupleSales",
6 "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleCustomer.bjs",
10 "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
12 ".builderCfg": "{\"cols\":[{\"table\":\"custinfo\",\"column\":\"cust_active\",\"columnshort\":\"cust_active\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Active\"},{\"table\":\"custtype\",\"column\":\"cust_custtype_id_custtype_descrip\",\"columnshort\":\"custtype_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Customer type\"},{\"table\":\"salesrep\",\"column\":\"cust_salesrep_id_salesrep_name\",\"columnshort\":\"salesrep_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":0,\"title\":\"Sales Rep\"},{\"table\":\"custinfo\",\"column\":\"cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Name\"}],\"cols_ex\":[\"cust_name\"],\"table\":\"custinfo\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
17 "tableName": "custinfo",
24 "|render": "function() \n{\n _this.grid = this; \n _this.dialog = Pman.Dialog.XtupleCustomer;\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}",
25 "|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 }); \n}\n"
28 ".builderCfg": "{\"cols\":[{\"table\":\"custinfo\",\"column\":\"cust_active\",\"columnshort\":\"cust_active\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Active\"},{\"table\":\"custtype\",\"column\":\"cust_custtype_id_custtype_descrip\",\"columnshort\":\"custtype_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Customer type\"},{\"table\":\"salesrep\",\"column\":\"cust_salesrep_id_salesrep_name\",\"columnshort\":\"salesrep_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":0,\"title\":\"Sales Rep\"},{\"table\":\"custinfo\",\"column\":\"cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Name\"}],\"cols_ex\":[\"cust_name\"],\"table\":\"custinfo\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
29 "autoExpandColumn": "cust_name",
36 "beforeload": "function (_self, o)\n{\n if (!_this.officeCombo) {\n return false;\n }\n \n o.params = o.params || {};\n o.params['search[cust_name]'] = _this.searchBox.getValue();\n if (!_this.activeBtn.pressed) {\n o.params.cust_active = 1;\n } \n var dt = _this.dateSearch.getValue(); \n if (dt) {\n o.params['search[orders_since]'] = dt.format('Y-m-d');\n }\n dt = _this.dateSearchNo.getValue(); \n if (dt) {\n o.params['search[no_orders_since]'] = dt.format('Y-m-d');\n }\n \n o.params['search[with_orders_since]'] = 1; //\n o.params['search[with_balance]'] = 1;\n o.params['search[with_address]'] = 1;\n o.params['_with_char'] = 1; \n o.params['_with_group_data'] = 1;\n o.params['search[_country]'] = _this.country.getValue();\n o.params._get = 1; // for download\n \n o.params['cust_char_internalcompany'] = _this.officeCombo.getValue();\n}"
38 "*prop": "dataSource",
41 "|sortInfo": "{ field : 'cust_name', direction: 'ASC' }",
48 "|url": "baseURL + '/Roo/custinfo.php'",
53 "xtype": "JsonReader",
54 "totalProperty": "total",
56 ".builderCfg": "{\"cols\":[{\"table\":\"custinfo\",\"column\":\"cust_active\",\"columnshort\":\"cust_active\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Active\"},{\"table\":\"custtype\",\"column\":\"cust_custtype_id_custtype_descrip\",\"columnshort\":\"custtype_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Customer type\"},{\"table\":\"salesrep\",\"column\":\"cust_salesrep_id_salesrep_name\",\"columnshort\":\"salesrep_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":0,\"title\":\"Sales Rep\"},{\"table\":\"custinfo\",\"column\":\"cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Name\"}],\"cols_ex\":[\"cust_name\"],\"table\":\"custinfo\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
59 "|fields": "[\n {\n 'name': 'cust_active',\n 'type': 'boolean'\n },\n {\n 'name': 'cust_custtype_id_custtype_descrip',\n 'type': 'string'\n },\n {\n 'name': 'cust_salesrep_id_salesrep_name',\n 'type': 'string'\n },\n {\n 'name': 'cust_name',\n 'type': 'string'\n }\n]"
65 "xtype": "PagingToolbar",
68 "displayMsg": "Displaying custinfo{0} - {1} of {2}",
69 "emptyMsg": "No custinfo found",
73 "text": "Upload/Download",
75 "|xns": "Roo.Toolbar",
84 "click": "function (_self, e)\n{\n \n if (!Pman.hasPerm('Xtuple.CustomerDownload','S')) {\n Roo.MessageBox.alert(\"Error\", \"Permission Denied\");\n return;\n }\n _this.grid.ds.proxy.conn.method = 'POST';\n new Pman.Download({\n grid : _this.grid\n });\n \n}"
86 "text": "Download Customers",
92 "click": "function (_self, e)\n{\n \n if (!Pman.hasPerm('Admin.Admin_Tab','S')) {\n Roo.MessageBox.alert(\"Error\", \"Permission Denied\");\n return;\n }\n \n var c = _this.country.getValue();\n if(!c.length){\n Roo.MessageBox.alert(\"Error\", \"Please select a country\");\n return;\n }\n \n new Pman.Download({\n url : baseURL + '/Roo/custinfo',\n method : 'GET',\n params : {\n _my_json : 1,\n limit : 9999,\n 'search[_country]' : c,\n 'search[with_address]' : 1\n }\n \n });\n}"
94 "text": "Download Customers As Json",
100 "click": "function (_self, e)\n{\n \n if (!Pman.hasPerm('Admin.Admin_Tab','S')) {\n Roo.MessageBox.alert(\"Error\", \"Permission Denied\");\n return;\n }\n \n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Xtuple/Import/Customers' \n \n },\n function (data) {\n _this.grid.footer.onClick('first');\n Roo.MessageBox.alert(\"Notice\", \"DONE\");\n// Roo.MessageBox.alert(\"Notice\", msg.join(\"\\n\"));\n\n }\n );\n \n}"
102 "text": "Upload Customers",
108 "click": "function (_self, e)\n{\n \n if (!Pman.hasPerm('Admin.Admin_Tab','S')) {\n Roo.MessageBox.alert(\"Error\", \"Permission Denied\");\n return;\n }\n \n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Xtuple/Import/MyCustomers' \n \n },\n function (data) {\n _this.grid.footer.onClick('first');\n Roo.MessageBox.alert(\"Notice\", \"DONE\");\n// Roo.MessageBox.alert(\"Notice\", msg.join(\"\\n\"));\n\n }\n );\n \n}"
110 "text": "Upload Customers Json File",
116 "click": "function (_self, e)\n{\n \n if (!Pman.hasPerm('Admin.Admin_Tab','S')) {\n Roo.MessageBox.alert(\"Error\", \"Permission Denied\");\n return;\n }\n \n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Xtuple/Import/AUPostAccounts' \n \n },\n function (data) {\n _this.grid.footer.onClick('first');\n Roo.MessageBox.alert(\"Notice\", data);\n\n }\n );\n \n}"
118 "text": "Upload AU Post Accounts",
136 "|xns": "Roo.Toolbar"
140 "render": "function (_self)\n{\n _this.searchBox = _self;\n}",
141 "specialkey": "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}"
143 "xtype": "TextField",
148 "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
152 "|icon": "rootURL + '/Pman/templates/images/search.gif'",
153 "|xns": "Roo.Toolbar"
157 "|click": "function (_self, e)\n{\n _this.searchBox.setValue('');\n \n \n _this.grid.footer.onClick('first');\n}"
161 "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
162 "|xns": "Roo.Toolbar"
166 "render": "function (_self)\n{\n _this.officeCombo = _self;\n}",
167 "select": "function (combo, record, index)\n{\n\n _this.grid.footer.onClick('first');\n}"
171 "displayField": "office",
173 "fieldLabel": "Office",
174 "hiddenName": "office",
178 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{office}</b> </div>",
179 "triggerAction": "all",
180 "valueField": "office",
186 "xtype": "SimpleStore",
187 "|data": "[ \n [ ''] ,\n [ 'hk' ],\n [ 'sg' ],\n [ 'my' ],\n [ 'cn' ],\n [ 'au' ]\n]\n ",
188 "|fields": "['office']",
195 "render": "function (_self)\n{\n _this.country = _self;\n}",
196 "select": "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}"
200 "displayField": "addr_country",
202 "emptyText": "Select Country",
203 "fieldLabel": "Country",
204 "forceSelection": true,
205 "hiddenName": "addr_country",
207 "loadingText": "Searching...",
209 "name": "addr_country",
211 "qtip": "Select Country",
212 "queryParam": "query[addr_country]",
213 "selectOnFocus": true,
214 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{addr_country}</b> </div>",
215 "triggerAction": "all",
217 "valueField": "addr_country",
224 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n o.params._distinct = 'addr_country';\n o.params._columns ='addr_country';\n}\n"
229 "|sortInfo": "{ direction : 'ASC', field: 'addr_country' }",
235 "xtype": "HttpProxy",
236 "|url": "baseURL + '/Roo/Addr.php'",
243 "totalProperty": "total",
244 "xtype": "JsonReader",
245 "|fields": "[{\"name\":\"addr_id\",\"type\":\"int\"},{\"name\":\"addr_country\",\"type\":\"string\"}]",
254 "toggle": "function (_self, pressed)\n{\n _this.grid.footer.onClick('first');\n}",
255 "render": "function (_self)\n{\n _this.activeBtn = _self;\n}"
257 "enableToggle": true,
259 "text": "Show / Hide Inactive",
261 "|xns": "Roo.Toolbar"
264 "text": "Has orders since",
266 "|xns": "Roo.Toolbar"
270 "render": "function (_self)\n{\n _this.dateSearch = _self\n}",
271 "select": "function (combo, date)\n{\n _this.grid.footer.onClick('first');\n}",
272 "specialkey": "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}"
275 "xtype": "DateField",
279 "text": "No orders since",
281 "|xns": "Roo.Toolbar"
285 "render": "function (_self)\n{\n _this.dateSearchNo = _self\n}",
286 "select": "function (combo, date)\n{\n _this.grid.footer.onClick('first');\n}",
287 "specialkey": "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}"
290 "xtype": "DateField",
295 "|xns": "Roo.Toolbar"
299 "|click": "function()\n{\n if (!_this.dialog) return;\n _this.dialog.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
301 "cls": "x-btn-text-icon",
304 "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
305 "|xns": "Roo.Toolbar"
309 "|click": "function()\n{\n var s = _this.grid.getSelectionModel().getSelections();\n if (!s.length || (s.length > 1)) {\n Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n return;\n }\n if (!_this.dialog) return;\n _this.dialog.show(s[0].data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n}\n"
311 "cls": "x-btn-text-icon",
314 "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
315 "|xns": "Roo.Toolbar"
320 "*prop": "colModel[]",
321 ".builderCfg": "{\"table\":\"custinfo\",\"column\":\"cust_active\",\"columnshort\":\"cust_active\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Active\"}",
322 "dataIndex": "cust_active",
325 "xtype": "ColumnModel",
326 "|renderer": "function(v) { return String.format('{0}', v? 'Y' : 'N'); }",
330 "*prop": "colModel[]",
331 "dataIndex": "last_order",
332 "header": "Last Order",
334 "xtype": "ColumnModel",
335 "|renderer": "function(v) { \n if (!v) { \n return '-none-';\n }\n var vv = Date.parseDate(v, 'Y-m-d');\n return String.format('{0}', vv.format('d/M/Y') ); \n}",
339 "*prop": "colModel[]",
340 ".builderCfg": "{\"table\":\"custtype\",\"column\":\"cust_custtype_id_custtype_descrip\",\"columnshort\":\"custtype_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Customer type\"}",
341 "dataIndex": "cust_taxzone_id_taxzone_descrip",
342 "header": "Tax Status",
345 "xtype": "ColumnModel",
346 "|renderer": "function(v) { return String.format('{0}', v); }",
350 "*prop": "colModel[]",
351 ".builderCfg": "{\"table\":\"custtype\",\"column\":\"cust_custtype_id_custtype_descrip\",\"columnshort\":\"custtype_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Customer type\"}",
352 "dataIndex": "cust_terms_id_terms_descrip",
356 "xtype": "ColumnModel",
357 "|renderer": "function(v) { return String.format('{0}', v); }",
361 "*prop": "colModel[]",
362 ".builderCfg": "{\"table\":\"salesrep\",\"column\":\"cust_salesrep_id_salesrep_name\",\"columnshort\":\"salesrep_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":0,\"title\":\"Sales Rep\"}",
363 "dataIndex": "cust_salesrep_id_salesrep_name",
364 "header": "Sales Rep",
367 "xtype": "ColumnModel",
368 "|renderer": "function(v) { return String.format('{0}', v); }",
372 "*prop": "colModel[]",
373 "dataIndex": "ipshead_id_name",
374 "header": "Curr/Price List",
377 "xtype": "ColumnModel",
378 "|renderer": "function(v,x,r) { \n if (!v.length) {\n return String.format('{0}<br/><span style=\"color:red\">No price list</span>', \n r.data.cust_curr_id_curr_name );\n } \n\n return String.format('{0}<br/>{1}', \n r.data.cust_curr_id_curr_name,\n v ); \n }",
382 "*prop": "colModel[]",
383 "dataIndex": "cust_number",
387 "xtype": "ColumnModel",
388 "|renderer": "function(v) { return String.format('{0}', v); }",
392 "*prop": "colModel[]",
393 "dataIndex": "cust_name",
397 "xtype": "ColumnModel",
398 "|renderer": "function(v,x,r) {\n if (!r.data.cust_char_internalcompany.length) {\n return String.format('{0}', v); \n }\n return String.format('<span style=\"color:red\">[Internal company : {0}] {1}</span>',\n r.data.cust_char_internalcompany, v); \n }",
402 "*prop": "colModel[]",
403 "dataIndex": "cust_bill_info",
404 "header": "Billing Address",
407 "xtype": "ColumnModel",
408 "|renderer": "function(v,x,r) \n{ \n if(!v.length){\n var add = [];\r\n Roo.each([ 'line1', 'line2', 'line3', 'city', 'state', 'country'], function (k) {\r\n if (!r.data['cntct_addr_' + k].length) {\r\n return;\r\n }\r\n add.push(String.format(\"{0}\", r.data['cntct_addr_' + k]));\r\n \r\n });\n return add.join('<BR/>');\n }\n \n var v = v.split(\"\\r\\n\").join(\"<br/>\");\n return v; \n}",
412 "*prop": "colModel[]",
413 "dataIndex": "cust_ship_info",
414 "header": "Shipping Address",
417 "xtype": "ColumnModel",
418 "|renderer": "function(v,x,r) \n{ \n if(!v.length){\n var add = [];\r\n Roo.each([ 'line1', 'line2', 'line3', 'city', 'state', 'country'], function (k) {\r\n if (!r.data['cntct_addr_' + k].length) {\r\n return;\r\n }\r\n add.push(String.format(\"{0}\", r.data['cntct_addr_' + k]));\r\n \r\n });\n return add.join('<BR/>');\n }\n \n var v = v.split(\"\\r\\n\").join(\"<br/>\");\n return v; \n}",
422 "*prop": "colModel[]",
423 "dataIndex": "cust_cntct_id_cntct_first_name",
427 "xtype": "ColumnModel",
428 "|renderer": "function(v,x,r) \n{ \n return String.format(\n 'Name: {0}<br/>' + \n 'Phone: {1}<br/>' + \n 'Email: <a href=\"mailto:{2}\">{2}</a>',\n \n r.data.cust_cntct_id_cntct_first_name,\n r.data.cust_cntct_id_cntct_phone,\n r.data.cust_cntct_id_cntct_email\n );\n}",
432 "*prop": "colModel[]",
433 "dataIndex": "cust_char_au_post_accno",
434 "header": "AU Post#",
438 "xtype": "ColumnModel",
439 "|renderer": "function(v,x,r) \n{ \n return String.format('{0}', v);\n}",
443 "*prop": "colModel[]",
444 "dataIndex": "cust_cntct_id_cntct_phone",
445 "header": "Contact Number",
449 "xtype": "ColumnModel",
450 "|renderer": "function(v,x,r) \n{ \n return String.format('{0}',v);\n}",
454 "*prop": "colModel[]",
455 "dataIndex": "cust_cntct_id_cntct_email",
460 "xtype": "ColumnModel",
461 "|renderer": "function(v,x,r) \n{ \n return String.format('<a href=\"mailto:{0}\">{0}</a>', v);\n}",
465 "*prop": "colModel[]",
467 "dataIndex": "cntct_addr_city",
472 "xtype": "ColumnModel",
473 "|renderer": "function(v) { return String.format('{0}', v ? v : ''); }",
477 "*prop": "colModel[]",
479 "dataIndex": "cntct_addr_state",
484 "xtype": "ColumnModel",
485 "|renderer": "function(v) { return String.format('{0}', v ? v : ''); }",
489 "*prop": "colModel[]",
491 "dataIndex": "cntct_addr_country",
495 "xtype": "ColumnModel",
496 "|renderer": "function(v) { return String.format('{0}', v ? v : ''); }",
500 "*prop": "colModel[]",
501 ".builderCfg": "{\"table\":\"custtype\",\"column\":\"cust_custtype_id_custtype_descrip\",\"columnshort\":\"custtype_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Customer type\"}",
502 "dataIndex": "cust_curr_id_curr_name",
503 "header": "Currency",
506 "xtype": "ColumnModel",
507 "|renderer": "function(v) { return String.format('{0}', v); }",
511 "*prop": "colModel[]",
513 "dataIndex": "balance",
516 "xtype": "ColumnModel",
517 "|renderer": "function(v,x,r) { \n\n \n return String.format('{0}{1}', r.data.cust_curr_id_curr_symbol, Roo.util.Format.number(v,2)); \n}",