Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Tab.XtuplePurchaseStock.bjs
1 {
2     "id": "roo-file-46",
3     "name": "Pman.Tab.XtuplePurchaseStock",
4     "parent": "Pman.Tab.XtuplePurchases",
5     "title": "Pman.Tab.XtuplePurchaseStock",
6     "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtuplePurchaseStock.bjs",
7     "items": [
8         {
9             "background": true,
10             "title": "Incoming Stock Schedule",
11             "xtype": "NestedLayoutPanel",
12             "|xns": "Roo",
13             "items": [
14                 {
15                     "|xns": "Roo",
16                     "xtype": "BorderLayout",
17                     "*prop": "layout",
18                     "items": [
19                         {
20                             "|xns": "Roo",
21                             "xtype": "LayoutRegion",
22                             "*prop": "center"
23                         },
24                         {
25                             "listeners": {
26                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
27                             },
28                             "background": true,
29                             "fitContainer": true,
30                             "fitToframe": true,
31                             "region": "center",
32                             "tableName": "poitem",
33                             "title": "Incoming Stock Schedule",
34                             "xtype": "GridPanel",
35                             "|xns": "Roo",
36                             "items": [
37                                 {
38                                     "listeners": {
39                                         "|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}",
40                                         "afteredit": "function (e)\n{\n    if (e.originalValue == e.value || e.field == 'join_poitem_location_name') {\n        return;\n    }\n    \n    e.record.commit();\n    \n}",
41                                         "rowdblclick": "function (_self, rowIndex, e)\r\n{\r\n    \n    var r = _this.grid.ds.getAt(rowIndex);\r\n    Pman.Dialog.XtuplePurchaseOrder.show( { pohead_id : r.data.join_poitem_pohead_id , office : _this.office.getValue()}, function() {\r\n        _this.grid.footer.onClick('refresh');\r\n    }); \r\n}\r",
42                                         "beforeedit": "function (e)\n{\n    var office = _this.office.getValue();\n    var local = baseURL.split('/').pop().split('.').shift();\n    \n    if(office != local){\n        return false;\n    }\n}",
43                                         "rowclick": "function (_self, rowIndex, e)\n{\n\n}"
44                                     },
45                                     "*prop": "grid",
46                                     "autoExpandColumn": "item_descrip",
47                                     "clicksToEdit": 1,
48                                     "loadMask": true,
49                                     "xtype": "EditorGrid",
50                                     "|xns": "Roo.grid",
51                                     "items": [
52                                         {
53                                             "listeners": {
54                                                 "beforeload": "function (_self, o)\n{\n    o.params = o.params || {};\n    \n    o.params._incoming_stock = 1;\n    \n    o.params.poitem_status = _this.status.getValue();\n    \n    o.params._roo_office = _this.office.getValue();\n    \n    o.params['search[location]'] = _this.location.getValue();\n    \n    o.params['search[name]'] = _this.searchBox.getValue();\n\n}",
55                                                 "update": "function (_self, record, operation)\n{\n    if (operation != 'commit') {\n        Roo.log(operation);\n        return;\n    }\n    var params = {\n            pohead_id : record.data.join_poitem_pohead_id,\n            pohead_comments : record.data.join_poitem_pohead_comments,\n            pohead_bg_va : record.data.join_poitem_pohead_bg_va,\n            pohead_bg_arrival_est_day : record.data.join_poitem_pohead_bg_arrival_est_day,\n            pohead_bg_available_est_day : record.data.join_poitem_pohead_bg_available_est_day,\n            pohead_bg_available_latest_day : record.data.join_poitem_pohead_bg_available_latest_day,\n            pohead_notes : record.data.join_poitem_pohead_notes\n    };\n        \n\n    new Pman.Request({\n        method : 'POST',\n        url : baseURL + '/Roo/pohead',\n        params :  params\n    });\n    \n\n    _this.grid.footer.onClick('refresh');\n}"
56                                             },
57                                             "*prop": "dataSource",
58                                             "remoteSort": true,
59                                             "xtype": "Store",
60                                             "|sortInfo": "{ field : 'name', direction: 'ASC' }",
61                                             "|xns": "Roo.data",
62                                             "items": [
63                                                 {
64                                                     "*prop": "proxy",
65                                                     "method": "GET",
66                                                     "xtype": "HttpProxy",
67                                                     "|url": "baseURL + '/Xtuple/Roo/Poitem.php'",
68                                                     "|xns": "Roo.data"
69                                                 },
70                                                 {
71                                                     "|xns": "Roo.data",
72                                                     "xtype": "JsonReader",
73                                                     "totalProperty": "total",
74                                                     "root": "data",
75                                                     "*prop": "reader",
76                                                     "id": "id",
77                                                     "|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]"
78                                                 }
79                                             ]
80                                         },
81                                         {
82                                             "|xns": "Roo",
83                                             "xtype": "Toolbar",
84                                             "*prop": "toolbar",
85                                             "items": [
86                                                 {
87                                                     "listeners": {
88                                                         "specialkey": "function (_self, e)\n{\n  _this.grid.footer.onClick('first');\n}",
89                                                         "render": "function (_self)\n{\n    _this.searchBox = _self;\n}"
90                                                     },
91                                                     "xtype": "TextField",
92                                                     "|xns": "Roo.form"
93                                                 },
94                                                 {
95                                                     "listeners": {
96                                                         "click": "function (_self, e)\n{\n    _this.grid.footer.onClick('first');\n}"
97                                                     },
98                                                     "cls": "x-btn-icon",
99                                                     "xtype": "Button",
100                                                     "|icon": "rootURL + '/Pman/templates/images/search.gif'",
101                                                     "|xns": "Roo.Toolbar"
102                                                 },
103                                                 {
104                                                     "listeners": {
105                                                         "click": "function (_self, e)\n{\n    _this.searchBox.setValue('');\r\n    _this.grid.footer.onClick('first');\r\n}"
106                                                     },
107                                                     "cls": "x-btn-icon",
108                                                     "xtype": "Button",
109                                                     "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
110                                                     "|xns": "Roo.Toolbar"
111                                                 },
112                                                 {
113                                                     "listeners": {
114                                                         "render": "function (_self)\n{\n  _this.status = _self;\n}",
115                                                         "select": "function (combo, record, index)\n{\n\n    _this.grid.footer.onClick('first');\n}"
116                                                     },
117                                                     "allowBlank": true,
118                                                     "displayField": "fname",
119                                                     "editable": false,
120                                                     "emptyText": "Select Status",
121                                                     "fieldLabel": "Status",
122                                                     "hiddenName": "poitem_status",
123                                                     "listWidth": 200,
124                                                     "mode": "local",
125                                                     "name": "poitem_status",
126                                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>",
127                                                     "triggerAction": "all",
128                                                     "value": "",
129                                                     "valueField": "ftype",
130                                                     "width": 150,
131                                                     "xtype": "ComboBox",
132                                                     "|xns": "Roo.form",
133                                                     "items": [
134                                                         {
135                                                             "*prop": "store",
136                                                             "xtype": "SimpleStore",
137                                                             "|data": "[ \n    [ 'O', \"Open\"],\n    [ 'C' , \"Closed\"],\n    [ 'U', \"Unreleased\"] \n]\n",
138                                                             "|fields": "[  'ftype', 'fname']",
139                                                             "|xns": "Roo.data"
140                                                         }
141                                                     ]
142                                                 },
143                                                 {
144                                                     "listeners": {
145                                                         "render": "function (_self)\n{\n    _this.location = _self;\n}",
146                                                         "select": "function (combo, record, index)\n{\n    _this.grid.footer.onClick('first');\n}"
147                                                     },
148                                                     "allowBlank": true,
149                                                     "alwaysQuery": true,
150                                                     "displayField": "location_name",
151                                                     "editable": true,
152                                                     "emptyText": "Select a location",
153                                                     "fieldLabel": "Location",
154                                                     "forceSelection": true,
155                                                     "hiddenName": "pohead_location_id",
156                                                     "listWidth": 400,
157                                                     "loadingText": "Searching...",
158                                                     "minChars": 2,
159                                                     "name": "pohead_location_id",
160                                                     "pageSize": 200,
161                                                     "qtip": "Select terms",
162                                                     "queryParam": "query[location_name]",
163                                                     "selectOnFocus": true,
164                                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{location_name}</b> </div>",
165                                                     "triggerAction": "all",
166                                                     "typeAhead": false,
167                                                     "valueField": "location_id",
168                                                     "width": 200,
169                                                     "xtype": "ComboBox",
170                                                     "|xns": "Roo.form",
171                                                     "items": [
172                                                         {
173                                                             "listeners": {
174                                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n     o.params.location_netable = 1;\n     o.params._roo_office = _this.office.getValue();\n     o.params._notinternalcompany = 1;\n}\n"
175                                                             },
176                                                             "*prop": "store",
177                                                             "remoteSort": true,
178                                                             "xtype": "Store",
179                                                             "|sortInfo": "{ direction : 'ASC', field: 'location_name' }",
180                                                             "|xns": "Roo.data",
181                                                             "items": [
182                                                                 {
183                                                                     "*prop": "proxy",
184                                                                     "method": "GET",
185                                                                     "xtype": "HttpProxy",
186                                                                     "|url": "baseURL + '/Xtuple/Roo/location.php'",
187                                                                     "|xns": "Roo.data"
188                                                                 },
189                                                                 {
190                                                                     "*prop": "reader",
191                                                                     "id": "location_id",
192                                                                     "root": "data",
193                                                                     "totalProperty": "total",
194                                                                     "xtype": "JsonReader",
195                                                                     "|fields": "[{\"name\":\"location_id\",\"type\":\"int\"},\"location_name\"]",
196                                                                     "|xns": "Roo.data"
197                                                                 }
198                                                             ]
199                                                         }
200                                                     ]
201                                                 },
202                                                 {
203                                                     "listeners": {
204                                                         "render": "function (_self)\n{\n  _this.office = _self;\n}",
205                                                         "select": "function (combo, record, index)\n{\n    _this.location.reset();\n    _this.grid.footer.onClick('first');\n}"
206                                                     },
207                                                     "allowBlank": false,
208                                                     "displayField": "office",
209                                                     "editable": false,
210                                                     "fieldLabel": "Office",
211                                                     "hiddenName": "office",
212                                                     "listWidth": 200,
213                                                     "mode": "local",
214                                                     "name": "office",
215                                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{office}</b> </div>",
216                                                     "triggerAction": "all",
217                                                     "valueField": "office",
218                                                     "width": 150,
219                                                     "xtype": "ComboBox",
220                                                     "|value": "(function() {  \n    if(uiConfig.incomming_default_company){\n        return uiConfig.incomming_default_company;\n    }\n    return 'hk';  \n})()",
221                                                     "|xns": "Roo.form",
222                                                     "items": [
223                                                         {
224                                                             "*prop": "store",
225                                                             "xtype": "SimpleStore",
226                                                             "|data": "(function() {             \n    var officeList = []; \n    if(uiConfig.incomming_default_company){\n        officeList.push([uiConfig.incomming_default_company]);\n    }            \n    officeList.push(['hk']);             \n  return officeList;\n})()",
227                                                             "|fields": "['office']",
228                                                             "|xns": "Roo.data"
229                                                         }
230                                                     ]
231                                                 },
232                                                 {
233                                                     "listeners": {
234                                                         "|click": "function()\n{\n    var sel = _this.grid.getSelectionModel().getSelectedCell();\n    if (!sel)  {\n        Roo.MessageBox.alert(\"Error\", \"Select a Row\");\n        return;\n    } \n    var s = _this.grid.ds.getAt(sel[0]);\n    if(!s.data.join_poitem_pohead_id.length){\n        return;\n    }\n    \n    var office = _this.office.getValue();\n    var local = baseURL.split('/').pop().split('.').shift();\n\n    if(office != local){\n        Roo.MessageBox.alert(\"Error\", \"You cannot edit the remote date, Only local data can be edited!\");\n        return;\n    }\n    \n     Pman.Dialog.XtuplePurchaseOrderEdit.show({pohead_id : s.data.join_poitem_pohead_id} , function () {\n           _this.grid.footer.onClick('refresh');\n     });\n    \n}\n"
235                                                     },
236                                                     "cls": "x-btn-text-icon",
237                                                     "text": "Fill location",
238                                                     "xtype": "Button",
239                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
240                                                     "|xns": "Roo.Toolbar"
241                                                 }
242                                             ]
243                                         },
244                                         {
245                                             "*prop": "footer",
246                                             "displayInfo": true,
247                                             "displayMsg": "Displaying poitem{0} - {1} of {2}",
248                                             "emptyMsg": "No poitem found",
249                                             "pageSize": 25,
250                                             "xtype": "PagingToolbar",
251                                             "|xns": "Roo",
252                                             "items": [
253                                                 {
254                                                     "listeners": {
255                                                         "click": "function ()\n{\n    \n     new Pman.Download({\n        grid : _this.grid\n    });\n            \n   \n}"
256                                                     },
257                                                     "cls": "x-btn-text-icon",
258                                                     "text": "Download Schedule",
259                                                     "xtype": "Button",
260                                                     "|icon": "rootURL + '/Pman/templates/images/spreadsheet.gif'",
261                                                     "|xns": "Roo.Toolbar"
262                                                 }
263                                             ]
264                                         },
265                                         {
266                                             "*prop": "colModel[]",
267                                             "dataIndex": "join_poitem_pohead_number",
268                                             "header": "P/O No#",
269                                             "sortable": true,
270                                             "width": 50,
271                                             "xtype": "ColumnModel",
272                                             "|renderer": "function(v) { return String.format('{0}', v); }",
273                                             "|xns": "Roo.grid"
274                                         },
275                                         {
276                                             "*prop": "colModel[]",
277                                             "dataIndex": "brand_value",
278                                             "header": "Brand",
279                                             "width": 50,
280                                             "xtype": "ColumnModel",
281                                             "|renderer": "function(v) { return String.format('{0}', v); }",
282                                             "|xns": "Roo.grid"
283                                         },
284                                         {
285                                             "*prop": "colModel[]",
286                                             "dataIndex": "item_name",
287                                             "header": "Item (SKU)",
288                                             "sortable": true,
289                                             "width": 70,
290                                             "xtype": "ColumnModel",
291                                             "|renderer": "function(v) { return String.format('{0}', v); }",
292                                             "|xns": "Roo.grid"
293                                         },
294                                         {
295                                             "*prop": "colModel[]",
296                                             "dataIndex": "item_descrip",
297                                             "header": "Description",
298                                             "width": 300,
299                                             "xtype": "ColumnModel",
300                                             "|renderer": "function(v) { return String.format('{0}', v); }",
301                                             "|xns": "Roo.grid"
302                                         },
303                                         {
304                                             "*prop": "colModel[]",
305                                             "dataIndex": "join_poitem_pohead_comments",
306                                             "header": "B&G reference",
307                                             "width": 100,
308                                             "xtype": "ColumnModel",
309                                             "|renderer": "function(v) { return String.format('{0}', v); }",
310                                             "|xns": "Roo.grid",
311                                             "items": [
312                                                 {
313                                                     "|xns": "Roo.grid",
314                                                     "xtype": "GridEditor",
315                                                     "*prop": "editor",
316                                                     "items": [
317                                                         {
318                                                             "*prop": "field",
319                                                             "xtype": "TextField",
320                                                             "|xns": "Roo.form"
321                                                         }
322                                                     ]
323                                                 }
324                                             ]
325                                         },
326                                         {
327                                             "*prop": "colModel[]",
328                                             "dataIndex": "join_poitem_pohead_bg_va",
329                                             "header": "VA?",
330                                             "width": 50,
331                                             "xtype": "ColumnModel",
332                                             "|renderer": "function(v) { return String.format('{0}', v); }",
333                                             "|xns": "Roo.grid",
334                                             "items": [
335                                                 {
336                                                     "|xns": "Roo.grid",
337                                                     "xtype": "GridEditor",
338                                                     "*prop": "editor",
339                                                     "items": [
340                                                         {
341                                                             "*prop": "field",
342                                                             "xtype": "TextField",
343                                                             "|xns": "Roo.form"
344                                                         }
345                                                     ]
346                                                 }
347                                             ]
348                                         },
349                                         {
350                                             "*prop": "colModel[]",
351                                             "dataIndex": "join_poitem_pohead_bg_arrival_est_day",
352                                             "header": "Est. Arrival",
353                                             "width": 70,
354                                             "xtype": "ColumnModel",
355                                             "|renderer": "function(v) { \n    if(typeof(v) == 'object'){\n       return String.format('{0}',v.format('d/M/Y'));\n    }\n    var d = Date.parseDate(v, 'Y-m-d');\n    return String.format('{0}', d ? d.format('d/M/Y') : '');\n}",
356                                             "|xns": "Roo.grid",
357                                             "items": [
358                                                 {
359                                                     "|xns": "Roo.grid",
360                                                     "xtype": "GridEditor",
361                                                     "*prop": "editor",
362                                                     "items": [
363                                                         {
364                                                             "*prop": "field",
365                                                             "format": "d/M/Y",
366                                                             "useIso": true,
367                                                             "xtype": "DateField",
368                                                             "|xns": "Roo.form"
369                                                         }
370                                                     ]
371                                                 }
372                                             ]
373                                         },
374                                         {
375                                             "*prop": "colModel[]",
376                                             "dataIndex": "join_poitem_pohead_bg_available_est_day",
377                                             "header": "Est. Avail",
378                                             "width": 70,
379                                             "xtype": "ColumnModel",
380                                             "|renderer": "function(v) { \n    if(typeof(v) == 'object'){\n       return String.format('{0}',v.format('d/M/Y'));\n    }\n    var d = Date.parseDate(v, 'Y-m-d');\n    return String.format('{0}', d ? d.format('d/M/Y') : '');\n}",
381                                             "|xns": "Roo.grid",
382                                             "items": [
383                                                 {
384                                                     "|xns": "Roo.grid",
385                                                     "xtype": "GridEditor",
386                                                     "*prop": "editor",
387                                                     "items": [
388                                                         {
389                                                             "*prop": "field",
390                                                             "format": "d/M/Y",
391                                                             "useIso": true,
392                                                             "xtype": "DateField",
393                                                             "|xns": "Roo.form"
394                                                         }
395                                                     ]
396                                                 }
397                                             ]
398                                         },
399                                         {
400                                             "*prop": "colModel[]",
401                                             "dataIndex": "join_poitem_pohead_bg_available_latest_day",
402                                             "header": "Confirm Avail",
403                                             "sortable": true,
404                                             "width": 70,
405                                             "xtype": "ColumnModel",
406                                             "|renderer": "function(v) { \n    if(typeof(v) == 'object'){\n       return String.format('{0}',v.format('d/M/Y'));\n    }\n    var d = Date.parseDate(v, 'Y-m-d');\n    return String.format('{0}', d ? d.format('d/M/Y') : '');\n}",
407                                             "|xns": "Roo.grid",
408                                             "items": [
409                                                 {
410                                                     "|xns": "Roo.grid",
411                                                     "xtype": "GridEditor",
412                                                     "*prop": "editor",
413                                                     "items": [
414                                                         {
415                                                             "*prop": "field",
416                                                             "format": "d/M/Y",
417                                                             "useIso": true,
418                                                             "xtype": "DateField",
419                                                             "|xns": "Roo.form"
420                                                         }
421                                                     ]
422                                                 }
423                                             ]
424                                         },
425                                         {
426                                             "*prop": "colModel[]",
427                                             "dataIndex": "join_poitem_location_name",
428                                             "header": "Location",
429                                             "sortable": true,
430                                             "width": 100,
431                                             "xtype": "ColumnModel",
432                                             "|renderer": "function(v,x,r) \n{\n    \n    return String.format('{0}', v ? v : ''); \n}",
433                                             "|xns": "Roo.grid",
434                                             "items": [
435                                                 {
436                                                     "|xns": "Roo.grid",
437                                                     "xtype": "GridEditor",
438                                                     "*prop": "editor",
439                                                     "items": [
440                                                         {
441                                                             "listeners": {
442                                                                 "beforeselect": "function (combo, record, index)\n{\n    var ar = _this.grid.activeEditor.record;\n    \n    if(record.data.location_id == ar.data.join_poitem_location_id){\n        return;\n    }\n    \n    var params = {\r\n            poitem_id : ar.data.poitem_id,\r\n            poitem_location_id : record.data.location_id\r\n    };\r\n        \r\n\r\n    new Pman.Request({\r\n        method : 'POST',\r\n        url : baseURL + '/Roo/poitem',\r\n        params :  params\r\n    });\n    \n\r\n}"
443                                                             },
444                                                             "*prop": "field",
445                                                             "displayField": "location_name",
446                                                             "editable": true,
447                                                             "emptyText": "Select a location",
448                                                             "forceSelection": true,
449                                                             "hiddenName": "join_poitem_location_id",
450                                                             "listWidth": 400,
451                                                             "loadingText": "Searching...",
452                                                             "minChars": 2,
453                                                             "name": "join_poitem_location_name",
454                                                             "pageSize": 20,
455                                                             "qtip": "Select a location",
456                                                             "queryParam": "query[location_name]",
457                                                             "selectOnFocus": true,
458                                                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{location_name}</b> </div>",
459                                                             "triggerAction": "all",
460                                                             "typeAhead": false,
461                                                             "valueField": "location_id",
462                                                             "xtype": "ComboBox",
463                                                             "|xns": "Roo.form",
464                                                             "items": [
465                                                                 {
466                                                                     "listeners": {
467                                                                         "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    o.params.location_netable = 1;\n}\n"
468                                                                     },
469                                                                     "*prop": "store",
470                                                                     "remoteSort": true,
471                                                                     "xtype": "Store",
472                                                                     "|sortInfo": "{ direction : 'ASC', field: 'location_name' }",
473                                                                     "|xns": "Roo.data",
474                                                                     "items": [
475                                                                         {
476                                                                             "*prop": "proxy",
477                                                                             "method": "GET",
478                                                                             "xtype": "HttpProxy",
479                                                                             "|url": "baseURL + '/Roo/location.php'",
480                                                                             "|xns": "Roo.data"
481                                                                         },
482                                                                         {
483                                                                             "*prop": "reader",
484                                                                             "id": "location_id",
485                                                                             "root": "data",
486                                                                             "totalProperty": "total",
487                                                                             "xtype": "JsonReader",
488                                                                             "|fields": "[{\"name\":\"location_id\",\"type\":\"int\"},\"location_name\"]",
489                                                                             "|xns": "Roo.data"
490                                                                         }
491                                                                     ]
492                                                                 }
493                                                             ]
494                                                         }
495                                                     ]
496                                                 }
497                                             ]
498                                         },
499                                         {
500                                             "*prop": "colModel[]",
501                                             "dataIndex": "join_poitem_vend_name",
502                                             "header": "Originating from",
503                                             "sortable": true,
504                                             "width": 100,
505                                             "xtype": "ColumnModel",
506                                             "|renderer": "function(v,x,r) \n{\n    if(v && r.data.join_poitem_pohead_vendcountry)\n    {\n        return String.format('{0}', v + ' (' + r.data.join_poitem_pohead_vendcountry + ')'); \n    }\n    return String.format('{0}', v); \n}",
507                                             "|xns": "Roo.grid"
508                                         },
509                                         {
510                                             "*prop": "colModel[]",
511                                             "dataIndex": "poitem_qty_ordered",
512                                             "header": "Qty",
513                                             "width": 50,
514                                             "xtype": "ColumnModel",
515                                             "|renderer": "function(v) { return String.format('{0}', v ? v : '' ); }",
516                                             "|xns": "Roo.grid"
517                                         },
518                                         {
519                                             "*prop": "colModel[]",
520                                             "dataIndex": "join_poitem_pohead_orderdate",
521                                             "header": "Order Created",
522                                             "sortable": true,
523                                             "width": 100,
524                                             "xtype": "ColumnModel",
525                                             "|renderer": "function(v) \n{ \n    var d = Date.parseDate(v, 'Y-m-d');\n    return String.format('{0}', d ? d.format('d/M/Y') : '');\n}",
526                                             "|xns": "Roo.grid"
527                                         },
528                                         {
529                                             "*prop": "colModel[]",
530                                             "dataIndex": "poitem_duedate",
531                                             "header": "ETA Date",
532                                             "sortable": true,
533                                             "width": 100,
534                                             "xtype": "ColumnModel",
535                                             "|renderer": "function(v) \n{ \n   // var d = Date.parseDate(v, 'Y-m-d');\n    return String.format('{0}', v ? v.format('d/M/Y') : '');\n}",
536                                             "|xns": "Roo.grid"
537                                         },
538                                         {
539                                             "*prop": "colModel[]",
540                                             "dataIndex": "join_poitem_pohead_last_updated",
541                                             "header": "Last Updated",
542                                             "width": 100,
543                                             "xtype": "ColumnModel",
544                                             "|renderer": "function(v,x,r) \r\n{\r\n   if(!v){\r\n    return '';\r\n   }\r\n   var d = (new Date()).add(Date.DAY, -15);\r\n   v = new Date(v);\r\n   \r\n   if(v > d){\r\n        return '<span style=\"color:red\">' + v.format('d/M/Y') + '</span>';\r\n   }\r\n   \r\n   return String.format('{0}', v ? v.format('d/M/Y') : '');\r\n}",
545                                             "|xns": "Roo.grid"
546                                         },
547                                         {
548                                             "*prop": "colModel[]",
549                                             "dataIndex": "join_poitem_pohead_notes",
550                                             "header": "Notes",
551                                             "width": 100,
552                                             "xtype": "ColumnModel",
553                                             "|renderer": "function(v) { return String.format('{0}', v); }",
554                                             "|xns": "Roo.grid",
555                                             "items": [
556                                                 {
557                                                     "|xns": "Roo.grid",
558                                                     "xtype": "GridEditor",
559                                                     "*prop": "editor",
560                                                     "items": [
561                                                         {
562                                                             "*prop": "field",
563                                                             "xtype": "TextField",
564                                                             "|xns": "Roo.form"
565                                                         }
566                                                     ]
567                                                 }
568                                             ]
569                                         }
570                                     ]
571                                 }
572                             ]
573                         }
574                     ]
575                 }
576             ]
577         }
578     ],
579     "permname": "",
580     "modOrder": "200"
581 }