first upload
[Pman.Xtuple] / Pman.Tab.XtupleCustomer.bjs
1 {
2     "id": "roo-file-351",
3     "name": "Pman.Tab.XtupleCustomer",
4     "parent": "Pman.Tab.XtupleSales",
5     "title": "",
6     "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleCustomer.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
11             },
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\"}",
13             "background": true,
14             "fitContainer": true,
15             "fitToframe": true,
16             "region": "center",
17             "tableName": "custinfo",
18             "title": "Customers",
19             "xtype": "GridPanel",
20             "|xns": "Roo",
21             "items": [
22                 {
23                     "listeners": {
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"
26                     },
27                     "*prop": "grid",
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",
30                     "loadMask": true,
31                     "xtype": "Grid",
32                     "|xns": "Roo.grid",
33                     "items": [
34                         {
35                             "listeners": {
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}"
37                             },
38                             "*prop": "dataSource",
39                             "remoteSort": true,
40                             "xtype": "Store",
41                             "|sortInfo": "{ field : 'cust_name', direction: 'ASC' }",
42                             "|xns": "Roo.data",
43                             "items": [
44                                 {
45                                     "*prop": "proxy",
46                                     "method": "GET",
47                                     "xtype": "HttpProxy",
48                                     "|url": "baseURL + '/Roo/custinfo.php'",
49                                     "|xns": "Roo.data"
50                                 },
51                                 {
52                                     "|xns": "Roo.data",
53                                     "xtype": "JsonReader",
54                                     "totalProperty": "total",
55                                     "root": "data",
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\"}",
57                                     "*prop": "reader",
58                                     "id": "id",
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]"
60                                 }
61                             ]
62                         },
63                         {
64                             "*prop": "footer",
65                             "xtype": "PagingToolbar",
66                             "pageSize": 25,
67                             "displayInfo": true,
68                             "displayMsg": "Displaying custinfo{0} - {1} of {2}",
69                             "emptyMsg": "No custinfo found",
70                             "|xns": "Roo",
71                             "items": [
72                                 {
73                                     "text": "Upload/Download",
74                                     "xtype": "Button",
75                                     "|xns": "Roo.Toolbar",
76                                     "items": [
77                                         {
78                                             "|xns": "Roo.menu",
79                                             "xtype": "Menu",
80                                             "*prop": "menu",
81                                             "items": [
82                                                 {
83                                                     "listeners": {
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}"
85                                                     },
86                                                     "text": "Download Customers",
87                                                     "xtype": "Item",
88                                                     "|xns": "Roo.menu"
89                                                 },
90                                                 {
91                                                     "listeners": {
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}"
93                                                     },
94                                                     "text": "Download Customers As Json",
95                                                     "xtype": "Item",
96                                                     "|xns": "Roo.menu"
97                                                 },
98                                                 {
99                                                     "listeners": {
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}"
101                                                     },
102                                                     "text": "Upload Customers",
103                                                     "xtype": "Item",
104                                                     "|xns": "Roo.menu"
105                                                 },
106                                                 {
107                                                     "listeners": {
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}"
109                                                     },
110                                                     "text": "Upload Customers Json File",
111                                                     "xtype": "Item",
112                                                     "|xns": "Roo.menu"
113                                                 },
114                                                 {
115                                                     "listeners": {
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}"
117                                                     },
118                                                     "text": "Upload AU Post Accounts",
119                                                     "xtype": "Item",
120                                                     "|xns": "Roo.menu"
121                                                 }
122                                             ]
123                                         }
124                                     ]
125                                 }
126                             ]
127                         },
128                         {
129                             "*prop": "toolbar",
130                             "xtype": "Toolbar",
131                             "|xns": "Roo",
132                             "items": [
133                                 {
134                                     "text": "Search : ",
135                                     "xtype": "TextItem",
136                                     "|xns": "Roo.Toolbar"
137                                 },
138                                 {
139                                     "listeners": {
140                                         "render": "function (_self)\n{\n    _this.searchBox = _self;\n}",
141                                         "specialkey": "function (_self, e)\n{\n    _this.grid.footer.onClick('first');\n}"
142                                     },
143                                     "xtype": "TextField",
144                                     "|xns": "Roo.form"
145                                 },
146                                 {
147                                     "listeners": {
148                                         "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
149                                     },
150                                     "cls": "x-btn-icon",
151                                     "xtype": "Button",
152                                     "|icon": "rootURL + '/Pman/templates/images/search.gif'",
153                                     "|xns": "Roo.Toolbar"
154                                 },
155                                 {
156                                     "listeners": {
157                                         "|click": "function (_self, e)\n{\n    _this.searchBox.setValue('');\n    \n    \n    _this.grid.footer.onClick('first');\n}"
158                                     },
159                                     "cls": "x-btn-icon",
160                                     "xtype": "Button",
161                                     "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
162                                     "|xns": "Roo.Toolbar"
163                                 },
164                                 {
165                                     "listeners": {
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}"
168                                     },
169                                     "xtype": "ComboBox",
170                                     "allowBlank": true,
171                                     "displayField": "office",
172                                     "editable": false,
173                                     "fieldLabel": "Office",
174                                     "hiddenName": "office",
175                                     "listWidth": 200,
176                                     "mode": "local",
177                                     "name": "office",
178                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{office}</b> </div>",
179                                     "triggerAction": "all",
180                                     "valueField": "office",
181                                     "width": 75,
182                                     "|xns": "Roo.form",
183                                     "items": [
184                                         {
185                                             "*prop": "store",
186                                             "xtype": "SimpleStore",
187                                             "|data": "[ \n    [ ''] ,\n    [ 'hk' ],\n    [ 'sg' ],\n    [ 'my' ],\n    [ 'cn' ],\n    [ 'au' ]\n]\n        ",
188                                             "|fields": "['office']",
189                                             "|xns": "Roo.data"
190                                         }
191                                     ]
192                                 },
193                                 {
194                                     "listeners": {
195                                         "render": "function (_self)\n{\n    _this.country = _self;\n}",
196                                         "select": "function (combo, record, index)\n{\n    _this.grid.footer.onClick('first');\n}"
197                                     },
198                                     "allowBlank": true,
199                                     "alwaysQuery": true,
200                                     "displayField": "addr_country",
201                                     "editable": true,
202                                     "emptyText": "Select Country",
203                                     "fieldLabel": "Country",
204                                     "forceSelection": true,
205                                     "hiddenName": "addr_country",
206                                     "listWidth": 300,
207                                     "loadingText": "Searching...",
208                                     "minChars": 2,
209                                     "name": "addr_country",
210                                     "pageSize": 20,
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",
216                                     "typeAhead": true,
217                                     "valueField": "addr_country",
218                                     "width": 150,
219                                     "xtype": "ComboBox",
220                                     "|xns": "Roo.form",
221                                     "items": [
222                                         {
223                                             "listeners": {
224                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    o.params._distinct = 'addr_country';\n    o.params._columns ='addr_country';\n}\n"
225                                             },
226                                             "*prop": "store",
227                                             "remoteSort": true,
228                                             "xtype": "Store",
229                                             "|sortInfo": "{ direction : 'ASC', field: 'addr_country' }",
230                                             "|xns": "Roo.data",
231                                             "items": [
232                                                 {
233                                                     "*prop": "proxy",
234                                                     "method": "GET",
235                                                     "xtype": "HttpProxy",
236                                                     "|url": "baseURL + '/Roo/Addr.php'",
237                                                     "|xns": "Roo.data"
238                                                 },
239                                                 {
240                                                     "*prop": "reader",
241                                                     "id": "addr_id",
242                                                     "root": "data",
243                                                     "totalProperty": "total",
244                                                     "xtype": "JsonReader",
245                                                     "|fields": "[{\"name\":\"addr_id\",\"type\":\"int\"},{\"name\":\"addr_country\",\"type\":\"string\"}]",
246                                                     "|xns": "Roo.data"
247                                                 }
248                                             ]
249                                         }
250                                     ]
251                                 },
252                                 {
253                                     "listeners": {
254                                         "toggle": "function (_self, pressed)\n{\n    _this.grid.footer.onClick('first');\n}",
255                                         "render": "function (_self)\n{\n    _this.activeBtn = _self;\n}"
256                                     },
257                                     "enableToggle": true,
258                                     "pressed": false,
259                                     "text": "Show / Hide Inactive",
260                                     "xtype": "Button",
261                                     "|xns": "Roo.Toolbar"
262                                 },
263                                 {
264                                     "text": "Has orders since",
265                                     "xtype": "TextItem",
266                                     "|xns": "Roo.Toolbar"
267                                 },
268                                 {
269                                     "listeners": {
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}"
273                                     },
274                                     "format": "Y-m-d",
275                                     "xtype": "DateField",
276                                     "|xns": "Roo.form"
277                                 },
278                                 {
279                                     "text": "No orders since",
280                                     "xtype": "TextItem",
281                                     "|xns": "Roo.Toolbar"
282                                 },
283                                 {
284                                     "listeners": {
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}"
288                                     },
289                                     "format": "Y-m-d",
290                                     "xtype": "DateField",
291                                     "|xns": "Roo.form"
292                                 },
293                                 {
294                                     "xtype": "Fill",
295                                     "|xns": "Roo.Toolbar"
296                                 },
297                                 {
298                                     "listeners": {
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"
300                                     },
301                                     "cls": "x-btn-text-icon",
302                                     "text": "Add",
303                                     "xtype": "Button",
304                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
305                                     "|xns": "Roo.Toolbar"
306                                 },
307                                 {
308                                     "listeners": {
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"
310                                     },
311                                     "cls": "x-btn-text-icon",
312                                     "text": "Edit",
313                                     "xtype": "Button",
314                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
315                                     "|xns": "Roo.Toolbar"
316                                 }
317                             ]
318                         },
319                         {
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",
323                             "header": "Active",
324                             "width": 50,
325                             "xtype": "ColumnModel",
326                             "|renderer": "function(v) { return String.format('{0}', v? 'Y' : 'N'); }",
327                             "|xns": "Roo.grid"
328                         },
329                         {
330                             "*prop": "colModel[]",
331                             "dataIndex": "last_order",
332                             "header": "Last Order",
333                             "width": 80,
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}",
336                             "|xns": "Roo.grid"
337                         },
338                         {
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",
343                             "sortable": true,
344                             "width": 100,
345                             "xtype": "ColumnModel",
346                             "|renderer": "function(v) { return String.format('{0}', v); }",
347                             "|xns": "Roo.grid"
348                         },
349                         {
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",
353                             "header": "Terms",
354                             "sortable": true,
355                             "width": 100,
356                             "xtype": "ColumnModel",
357                             "|renderer": "function(v) { return String.format('{0}', v); }",
358                             "|xns": "Roo.grid"
359                         },
360                         {
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",
365                             "sortable": true,
366                             "width": 100,
367                             "xtype": "ColumnModel",
368                             "|renderer": "function(v) { return String.format('{0}', v); }",
369                             "|xns": "Roo.grid"
370                         },
371                         {
372                             "*prop": "colModel[]",
373                             "dataIndex": "ipshead_id_name",
374                             "header": "Curr/Price List",
375                             "sortable": true,
376                             "width": 80,
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   }",
379                             "|xns": "Roo.grid"
380                         },
381                         {
382                             "*prop": "colModel[]",
383                             "dataIndex": "cust_number",
384                             "header": "Ref No.",
385                             "sortable": true,
386                             "width": 80,
387                             "xtype": "ColumnModel",
388                             "|renderer": "function(v) { return String.format('{0}', v); }",
389                             "|xns": "Roo.grid"
390                         },
391                         {
392                             "*prop": "colModel[]",
393                             "dataIndex": "cust_name",
394                             "header": "Name",
395                             "sortable": true,
396                             "width": 200,
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 }",
399                             "|xns": "Roo.grid"
400                         },
401                         {
402                             "*prop": "colModel[]",
403                             "dataIndex": "cust_bill_info",
404                             "header": "Billing Address",
405                             "sortable": true,
406                             "width": 200,
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}",
409                             "|xns": "Roo.grid"
410                         },
411                         {
412                             "*prop": "colModel[]",
413                             "dataIndex": "cust_ship_info",
414                             "header": "Shipping Address",
415                             "sortable": true,
416                             "width": 200,
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}",
419                             "|xns": "Roo.grid"
420                         },
421                         {
422                             "*prop": "colModel[]",
423                             "dataIndex": "cust_cntct_id_cntct_first_name",
424                             "header": "Contact",
425                             "sortable": true,
426                             "width": 150,
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}",
429                             "|xns": "Roo.grid"
430                         },
431                         {
432                             "*prop": "colModel[]",
433                             "dataIndex": "cust_char_au_post_accno",
434                             "header": "AU Post#",
435                             "hidden": true,
436                             "sortable": true,
437                             "width": 150,
438                             "xtype": "ColumnModel",
439                             "|renderer": "function(v,x,r) \n{ \n    return String.format('{0}', v);\n}",
440                             "|xns": "Roo.grid"
441                         },
442                         {
443                             "*prop": "colModel[]",
444                             "dataIndex": "cust_cntct_id_cntct_phone",
445                             "header": "Contact Number",
446                             "hidden": true,
447                             "sortable": true,
448                             "width": 150,
449                             "xtype": "ColumnModel",
450                             "|renderer": "function(v,x,r) \n{ \n    return String.format('{0}',v);\n}",
451                             "|xns": "Roo.grid"
452                         },
453                         {
454                             "*prop": "colModel[]",
455                             "dataIndex": "cust_cntct_id_cntct_email",
456                             "header": "Email",
457                             "hidden": true,
458                             "sortable": true,
459                             "width": 150,
460                             "xtype": "ColumnModel",
461                             "|renderer": "function(v,x,r) \n{ \n    return String.format('<a href=\"mailto:{0}\">{0}</a>', v);\n}",
462                             "|xns": "Roo.grid"
463                         },
464                         {
465                             "*prop": "colModel[]",
466                             "align": "right",
467                             "dataIndex": "cntct_addr_city",
468                             "header": "City",
469                             "hidden": true,
470                             "sortable": true,
471                             "width": 75,
472                             "xtype": "ColumnModel",
473                             "|renderer": "function(v) { return String.format('{0}', v ? v : ''); }",
474                             "|xns": "Roo.grid"
475                         },
476                         {
477                             "*prop": "colModel[]",
478                             "align": "right",
479                             "dataIndex": "cntct_addr_state",
480                             "header": "State",
481                             "hidden": true,
482                             "sortable": true,
483                             "width": 75,
484                             "xtype": "ColumnModel",
485                             "|renderer": "function(v) { return String.format('{0}', v ? v : ''); }",
486                             "|xns": "Roo.grid"
487                         },
488                         {
489                             "*prop": "colModel[]",
490                             "align": "right",
491                             "dataIndex": "cntct_addr_country",
492                             "header": "Country",
493                             "sortable": true,
494                             "width": 75,
495                             "xtype": "ColumnModel",
496                             "|renderer": "function(v) { return String.format('{0}', v ? v : ''); }",
497                             "|xns": "Roo.grid"
498                         },
499                         {
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",
504                             "sortable": true,
505                             "width": 50,
506                             "xtype": "ColumnModel",
507                             "|renderer": "function(v) { return String.format('{0}', v); }",
508                             "|xns": "Roo.grid"
509                         },
510                         {
511                             "*prop": "colModel[]",
512                             "align": "right",
513                             "dataIndex": "balance",
514                             "header": "Balance",
515                             "width": 75,
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}",
518                             "|xns": "Roo.grid"
519                         }
520                     ]
521                 }
522             ]
523         }
524     ],
525     "permname": "",
526     "modOrder": "700"
527 }