Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Tab.XtupleAdjustment.bjs
1 {
2     "id": "roo-file-360",
3     "name": "Pman.Tab.XtupleAdjustment",
4     "parent": "Pman.Tab.XtupleAdjustmentTab",
5     "title": "Pman.Tab.XtupleAdjustment",
6     "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleAdjustment.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             "background": true,
13             "fitContainer": true,
14             "fitToframe": true,
15             "region": "center",
16             "tableName": "invadj",
17             "title": "Inventory Adjustments",
18             "xtype": "GridPanel",
19             "|xns": "Roo",
20             "items": [
21                 {
22                     "listeners": {
23                         "|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}",
24                         "afteredit": "function (e)\n{\n   if (e.record.data.invadj_posted) {\n     return;\n   }\n   var req = [ 'invadj_transdate', 'invadj_location_id', 'invadj_itemsite_id',  \n        'invadj_qty_by', 'invadj_comments' ];\n   var valid = true;\n    Roo.each(req, function(c) {\n        var val = '' + e.record.get(c);\n        if (!val.length) {\n            valid = false;\n        }\n    });\n    if (!valid) {\n        return;\n    }\n    e.record.commit();\n        \n   \n   \n}",
25                         "validateedit": "function (e)\n{\n    switch(e.field) {\n        case 'invadj_transdate':\n           // e.record.setValue('invadj_transdate', Date.parseDate(e.value, 'Y-m-d'));\n            e.value = Date.parseDate(e.value, 'Y-m-d');\n            break;\n    }\n}",
26                         "beforeedit": "function (e)\n{\n    Roo.log(e.record);\n    if (e.record.data.invadj_posted) {\n \n        e.cancel = true;\n        return false;\n    }\n}",
27                         "cellclick": "function (_self, rowIndex, columnIndex, e)\n{\n    var c = _this.grid.colModel.config[columnIndex];\n    var di = c.dataIndex;\n    if (di != 'invadj_posted') {\n        return;\n    }\n    \n    var r = _this.grid.ds.getAt(rowIndex);\n    if (r.data.invadj_posted || !r.data.invadj_id) {\n        return;\n    }\n    // attempting to post..\n    // validation - done at other end..\n    new Pman.Request({\n        url : baseURL + '/Roo/Invadj',\n        method  : 'POST',\n        mask : 'Posting',\n        params : {\n            invadj_id : r.data.invadj_id,\n            _post : 1\n        },\n        success : function(res) {\n            r.set('invadj_posted', true);\n            if (r.data.invadj_voids_id > 0) {\n                _this.grid.ds.each(function(rr) {\n                    if (rr.data.invadj_id == r.data.invadj_voids_id) {\n                        rr.set('invadj_voided_by_id', r.data.invadj_id);\n                        rr.set('invadj_comments', rr.data.invadj_comments);\n                    }\n                });\n            \n            \n            }\n            \n            \n            \n        },\n        failure : function (res) {\n            Roo.log(res);\n            Roo.MessageBox.alert(\"Error\",res.errorMsg);\n            if (res.errors.trandate) {\n                r.set('invadj_transdate', Date.parseDate(res.errors.trandate,'Y-m-d'));\n                r.commit();\n            }\n        \n        }\n    });\n    \n    \n    \n    \n}"
28                     },
29                     "*prop": "grid",
30                     "autoExpandColumn": "invadj_comments",
31                     "clicksToEdit": 1,
32                     "loadMask": true,
33                     "xtype": "EditorGrid",
34                     "|xns": "Roo.grid",
35                     "items": [
36                         {
37                             "listeners": {
38                                 "tabend": "function (eventdata)\n{\n    _this.addBtn.fireEvent('click', this); \n\n}"
39                             },
40                             "*prop": "sm",
41                             "xtype": "CellSelectionModel",
42                             "|xns": "Roo.grid"
43                         },
44                         {
45                             "listeners": {
46                                 "beforeload": "function (_self, options)\n{\n    options.params.invadj_location_id = _this.locationCombo.getValue();\n    options.params.invadj_itemsite_id = _this.itemCombo.getValue();   \n    switch(_this.status.getValue()) {\n        case 'ALL':\n        \n            break;\n       case 'ALL-WITHVOID':\n           options.params._show_void = 2;        \n            break; \n                 \n       case 'VOID':\n           options.params._show_void = 1;\n        \n            break;\n            \n        case 'POSTED':\n\n            options.params.invadj_posted = 1;\n            break;\n            \n        case 'UNPOSTED':\n            options.params.invadj_posted = 0;\n            options.params._show_void = 2;                            \n            break;    \n\n        case 'ALL-NOGROUP':\n           options.params._hide_group = 1;        \n            break;\n\n       case 'ALL-NOGROUP-WITHVOID':\n           options.params._show_void = 2;        \n         options.params._hide_group = 1;                \n            break; \n            \n       case 'VOID-NOGROUP':\n           options.params._show_void = 1;       \n            options.params._hide_group = 1;                     \n            break;\n            \n        case 'POSTED-NOGROUP':\n            options.params.invadj_posted = 1;\n            options.params._hide_group = 1;                     \n            break;\n            \n        case 'UNPOSTED-NOGROUP':\n            options.params._hide_group = 1;                     \n            options.params.invadj_posted = 0;\n            options.params._show_void = 2;                \n            break;    \n            \n            \n    }\n    options.params['query[comment]'] = _this.search.getValue();\n}",
47                                 "update": "function (_self, record, operation)\n{\n    \n    Roo.log(operation);\n    if (operation != 'commit' || _this.incom) {\n        return;\n    }\n\n    \n    var    p = Roo.apply({}, record.data);\n    \n    if (p.invadj_posted) {\n        return;\n    }\n    p.invadj_transdate = record.data.invadj_transdate.format('Y-m-d');\n     p.invadj_posted = 0; \n\n    _this.incom = true;    \n    new Pman.Request( {\n        url : baseURL + '/Roo/Invadj',\n        mask : 'Saving',\n        method : 'POST',\n        params : p,\n        success : function(res) {\n            record.set('invadj_id', res.data.invadj_id);\n            _this.incom = false;\n        },\n        failure : function()\n        {\n            Roo.MessageBox.alert(\"Error\", \"Saving failed\");\n            _this.incom = false;            \n        }\n    \n    });\n    \n    \n    \n}"
48                             },
49                             "*prop": "dataSource",
50                             "remoteSort": true,
51                             "xtype": "Store",
52                             "|sortInfo": "{ field : 'invadj_id', direction: 'DESC' }",
53                             "|xns": "Roo.data",
54                             "items": [
55                                 {
56                                     "*prop": "proxy",
57                                     "xtype": "HttpProxy",
58                                     "method": "GET",
59                                     "|url": "baseURL + '/Roo/invadj.php'",
60                                     "|xns": "Roo.data"
61                                 },
62                                 {
63                                     "|xns": "Roo.data",
64                                     "xtype": "JsonReader",
65                                     "totalProperty": "total",
66                                     "root": "data",
67                                     "*prop": "reader",
68                                     "id": "id",
69                                     "|fields": "[\n    {\n        'name': 'invadj_id',\n        'type': 'int'\n    },\n    {\n        'name': 'invadj_transdate',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'invadj_location_id',\n        'type': 'int'\n    },\n    {\n        'name': 'invadj_itemsite_id',\n        'type': 'int'\n    },\n    {\n        'name': 'invadj_qty_by',\n        'type': 'int'\n    },\n    {\n        'name': 'invadj_posted',\n        'type': 'int'\n    }\n]"
70                                 }
71                             ]
72                         },
73                         {
74                             "*prop": "footer",
75                             "xtype": "PagingToolbar",
76                             "pageSize": 25,
77                             "displayInfo": true,
78                             "displayMsg": "Displaying invadj{0} - {1} of {2}",
79                             "emptyMsg": "No invadj found",
80                             "|xns": "Roo"
81                         },
82                         {
83                             "*prop": "toolbar",
84                             "xtype": "Toolbar",
85                             "|xns": "Roo",
86                             "items": [
87                                 {
88                                     "listeners": {
89                                         "render": "function (_self)\n{\n    _this.locationCombo = _self;\n}",
90                                         "select": "function (combo, record, index)\n{\n    Roo.log('select');\n    _this.grid.footer.onClick('first');\n}"
91                                     },
92                                     "allowBlank": true,
93                                     "displayField": "location_name",
94                                     "editable": true,
95                                     "emptyText": "Select location",
96                                     "fieldLabel": "location",
97                                     "forceSelection": true,
98                                     "hiddenName": "invadj_location_id",
99                                     "listWidth": 400,
100                                     "loadingText": "Searching...",
101                                     "minChars": 2,
102                                     "name": "invadj_location_id_location_name",
103                                     "pageSize": 100,
104                                     "qtip": "Select location",
105                                     "queryParam": "query[location_name]",
106                                     "selectOnFocus": true,
107                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{location_name}</b> </div>",
108                                     "triggerAction": "all",
109                                     "typeAhead": false,
110                                     "valueField": "location_id",
111                                     "width": 150,
112                                     "xtype": "ComboBox",
113                                     "|xns": "Roo.form",
114                                     "items": [
115                                         {
116                                             "listeners": {
117                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
118                                             },
119                                             "*prop": "store",
120                                             "remoteSort": true,
121                                             "xtype": "Store",
122                                             "|sortInfo": "{ direction : 'ASC', field: 'location_name' }",
123                                             "|xns": "Roo.data",
124                                             "items": [
125                                                 {
126                                                     "*prop": "proxy",
127                                                     "xtype": "HttpProxy",
128                                                     "method": "GET",
129                                                     "|xns": "Roo.data",
130                                                     "|url": "baseURL + '/Roo/location.php'"
131                                                 },
132                                                 {
133                                                     "*prop": "reader",
134                                                     "xtype": "JsonReader",
135                                                     "|xns": "Roo.data",
136                                                     "id": "id",
137                                                     "root": "data",
138                                                     "totalProperty": "total",
139                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"location_name\",\"type\":\"string\"}]"
140                                                 }
141                                             ]
142                                         }
143                                     ]
144                                 },
145                                 {
146                                     "listeners": {
147                                         "render": "function (_self)\n{\n    _this.itemCombo = _self;\n}",
148                                         "select": "function (combo, record, index)\n{\n    Roo.log('select');\n    _this.grid.footer.onClick('first');\n}"
149                                     },
150                                     "allowBlank": true,
151                                     "displayField": "itemsite_item_id_item_number",
152                                     "editable": true,
153                                     "emptyText": "Select itemsite",
154                                     "fieldLabel": "itemsite",
155                                     "forceSelection": true,
156                                     "hiddenName": "invadj_itemsite_id",
157                                     "listWidth": 400,
158                                     "loadingText": "Searching...",
159                                     "minChars": 2,
160                                     "name": "invadj_itemsite_id_item_number",
161                                     "pageSize": 20,
162                                     "qtip": "Select itemsite",
163                                     "queryParam": "query[number]",
164                                     "selectOnFocus": true,
165                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{itemsite_item_id_item_number}</b> </div>",
166                                     "triggerAction": "all",
167                                     "typeAhead": false,
168                                     "valueField": "itemsite_id",
169                                     "width": 150,
170                                     "xtype": "ComboBox",
171                                     "|xns": "Roo.form",
172                                     "items": [
173                                         {
174                                             "listeners": {
175                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
176                                             },
177                                             "*prop": "store",
178                                             "remoteSort": true,
179                                             "xtype": "Store",
180                                             "|sortInfo": "{ direction : 'ASC', field: 'itemsite_item_id_item_number' }",
181                                             "|xns": "Roo.data",
182                                             "items": [
183                                                 {
184                                                     "*prop": "proxy",
185                                                     "xtype": "HttpProxy",
186                                                     "method": "GET",
187                                                     "|xns": "Roo.data",
188                                                     "|url": "baseURL + '/Roo/itemsite.php'"
189                                                 },
190                                                 {
191                                                     "*prop": "reader",
192                                                     "xtype": "JsonReader",
193                                                     "|xns": "Roo.data",
194                                                     "id": "id",
195                                                     "root": "data",
196                                                     "totalProperty": "total",
197                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"itemsite_abcclass\",\"type\":\"string\"}]"
198                                                 }
199                                             ]
200                                         }
201                                     ]
202                                 },
203                                 {
204                                     "listeners": {
205                                         "render": "function (_self)\n{\n  _this.status = _self;\n}",
206                                         "select": "function (combo, record, index)\n{\n    Roo.log('select');\n    _this.grid.footer.onClick('first');\n}"
207                                     },
208                                     "allowBlank": false,
209                                     "displayField": "fname",
210                                     "editable": false,
211                                     "fieldLabel": "Status",
212                                     "hiddenName": "cm_status",
213                                     "listWidth": 200,
214                                     "mode": "local",
215                                     "name": "cm_status_name",
216                                     "triggerAction": "all",
217                                     "value": "ALL-NOGROUP",
218                                     "valueField": "ftype",
219                                     "width": 150,
220                                     "xtype": "ComboBox",
221                                     "|xns": "Roo.form",
222                                     "items": [
223                                         {
224                                             "*prop": "store",
225                                             "xtype": "SimpleStore",
226                                             "|data": "[ \n    [ 'ALL-NOGROUP', \"All (not in Group)\"],\n    [ 'ALL-NOGROUP WITHVOID', \"All (not in Group) (with Void)\"],     \n    [ 'UNPOSTED-NOGROUP', \"Unposted only (not in Group)\"] ,\n    [ 'POSTED-NOGROUP', \"Posted only (not in Group)\"] ,\n    [ 'VOID-NOGROUP' ,\"Void (not in Group)\"],\n    [ 'ALL', \"All\"],\n    [ 'ALL-WITHVOID', \"All (with Void)\"],    \n    [ 'UNPOSTED', \"Unposted only\"] ,\n    [ 'POSTED', \"Posted only\"] ,\n    [ 'VOID', \"Void only\"]  \n    \n]\n\n",
227                                             "|fields": "[  'ftype', 'fname']",
228                                             "|xns": "Roo.data"
229                                         }
230                                     ]
231                                 },
232                                 {
233                                     "listeners": {
234                                         "specialkey": "function (_self, e)\n{\n    _this.grid.footer.onClick('first');\n}",
235                                         "render": "function (_self)\n{\n    _this.search = _self;\n}"
236                                     },
237                                     "width": 100,
238                                     "xtype": "TextField",
239                                     "|xns": "Roo.form"
240                                 },
241                                 {
242                                     "listeners": {
243                                         "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
244                                     },
245                                     "cls": "x-btn-icon",
246                                     "xtype": "Button",
247                                     "|icon": "rootURL + '/Pman/templates/images/search.gif'",
248                                     "|xns": "Roo.Toolbar"
249                                 },
250                                 {
251                                     "listeners": {
252                                         "|click": "function (_self, e)\n{\n    _this.locationCombo.reset();\n    _this.itemCombo.reset();\n    \n    _this.grid.footer.onClick('first');\n}"
253                                     },
254                                     "cls": "x-btn-icon",
255                                     "xtype": "Button",
256                                     "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
257                                     "|xns": "Roo.Toolbar"
258                                 },
259                                 {
260                                     "|xns": "Roo.Toolbar",
261                                     "xtype": "Fill"
262                                 },
263                                 {
264                                     "listeners": {
265                                         "click": "function ()\n{   \n    new Pman.Download({\n        grid : _this.grid\n    });\n   \n}"
266                                     },
267                                     "cls": "x-btn-text-icon",
268                                     "text": "Download Excel",
269                                     "xtype": "Button",
270                                     "|icon": "rootURL + '/Pman/templates/images/spreadsheet.gif'",
271                                     "|xns": "Roo.Toolbar"
272                                 },
273                                 {
274                                     "listeners": {
275                                         "|click": "function()\n{\n   \n    Roo.log(\"add presed\");\n     \n    // work out last \n    var grid = _this.grid;\n     \n    // uses form defaults or last row value.\n    var nr = _this.grid.ds.reader.newRow({\n        invadj_id : 0,\n        invadj_transdate : (new Date()),\n        invadj_location_id :  0,\n        invadj_location_id_location_name : '',        \n        invadj_itemsite_id : 0,                \n        invadj_itemsite_id_item_number : '',        \n        invadj_qty_by : '',  \n        invadj_comments: '',      \n        invadj_posted: false\n                \n    });\n    grid.stopEditing();\n    grid.ds.insert(0, nr); \n    grid.startEditing(0, 1); // type..\n\n}\n",
276                                         "render": "function (_self)\n{\n    _this.addBtn = _self;\n}"
277                                     },
278                                     "cls": "x-btn-text-icon",
279                                     "text": "Add",
280                                     "xtype": "Button",
281                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
282                                     "|xns": "Roo.Toolbar"
283                                 },
284                                 {
285                                     "listeners": {
286                                         "|click": "function()\n{\n   \n    Roo.log(\"add presed\");\n    \n    var grid = _this.grid;\n    var r = grid.selModel.getSelectedCell();\n    \n    \n    if (!r) {\n        Roo.MessageBox.alert(\"Error\", \"Select an adjustment\");\n        return;\n    }    \n    var rec = grid.ds.getAt(r[0]);\n    \n    var nrec = Roo.apply({}, rec.data);\n    nrec.invadj_qty_by *= -1;\n    nrec.invadj_comments = (rec.data.invadj_voids_id * 1 > 1) ? 'Restore of Adjustment #' + rec.data.invadj_voids_id : 'Void of Adjustment #' + rec.data.invadj_id;\n    nrec.invadj_posted = 0;\n    nrec.invadj_id = 0;    \n    nrec.invadj_invdetail_id  = '';\n    nrec.invadj_voids_id   =  rec.data.invadj_id;\n    //nrec.invadj_transdate = rec.data.invadj_transdate.format('Y-m-d');\n    \n    var nr = _this.grid.ds.reader.newRow(nrec);\n    grid.stopEditing();\n    grid.ds.insert(r[0], nr); \n    (function() { \n        grid.ds.getAt(r[0]).commit();\n    }).defer(100);\n    \n}\n        "
287                                     },
288                                     "cls": "x-btn-text-icon",
289                                     "text": "Void",
290                                     "xtype": "Button",
291                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
292                                     "|xns": "Roo.Toolbar"
293                                 },
294                                 {
295                                     "listeners": {
296                                         "|click": "function()\n{\n   \n   var g = _this.grid;\n   var s = g.selModel.getSelectedCell();\n   if (!s) {\n        Roo.MessageBox.alert(\"Error\", \"Select Adjustment\");\n        return;\n    }\n    var r = g.ds.getAt(s[0]);\n    if (r.data.invadj_posted) {\n        Roo.MessageBox.alert(\"Error\", \"You can not delete posted adjustments - try voiding them\");\n        return;\n    }\n    new Pman.Request({\n        url : baseURL + '/Roo/Invadj',\n        method : 'POST',\n        params  : { _delete : r.data.invadj_id },\n        mask : 'Deleteing',\n        success : function(res) {\n            g.ds.remove(r);\n        }\n    \n    });\n   \n   \n}\n        "
297                                     },
298                                     "cls": "x-btn-text-icon",
299                                     "text": "Delete",
300                                     "xtype": "Button",
301                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
302                                     "|xns": "Roo.Toolbar"
303                                 }
304                             ]
305                         },
306                         {
307                             "*prop": "colModel[]",
308                             "dataIndex": "invadj_id",
309                             "header": "Ref#",
310                             "sortable": true,
311                             "width": 50,
312                             "xtype": "ColumnModel",
313                             "|renderer": "function(v) { return String.format('{0}', v); }",
314                             "|xns": "Roo.grid"
315                         },
316                         {
317                             "*prop": "colModel[]",
318                             "dataIndex": "invadj_transdate",
319                             "header": "Date",
320                             "sortable": true,
321                             "width": 75,
322                             "xtype": "ColumnModel",
323                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
324                             "|xns": "Roo.grid",
325                             "items": [
326                                 {
327                                     "|xns": "Roo.grid",
328                                     "xtype": "GridEditor",
329                                     "*prop": "editor",
330                                     "items": [
331                                         {
332                                             "*prop": "field",
333                                             "format": "Y-m-d",
334                                             "useIso": true,
335                                             "xtype": "DateField",
336                                             "|xns": "Roo.form"
337                                         }
338                                     ]
339                                 }
340                             ]
341                         },
342                         {
343                             "*prop": "colModel[]",
344                             "dataIndex": "invadj_location_id",
345                             "header": "Location",
346                             "width": 150,
347                             "xtype": "ColumnModel",
348                             "|renderer": "function(v,x,r) { \n\n    return String.format('{0}', \n        r.data.invadj_location_id_location_name\n     ); \n }",
349                             "|xns": "Roo.grid",
350                             "items": [
351                                 {
352                                     "|xns": "Roo.grid",
353                                     "xtype": "GridEditor",
354                                     "*prop": "editor",
355                                     "items": [
356                                         {
357                                             "*prop": "field",
358                                             "allowBlank": false,
359                                             "displayField": "location_name",
360                                             "editable": true,
361                                             "emptyText": "Select location",
362                                             "fieldLabel": "location",
363                                             "forceSelection": true,
364                                             "hiddenName": "invadj_location_id",
365                                             "listWidth": 400,
366                                             "loadingText": "Searching...",
367                                             "minChars": 2,
368                                             "name": "invadj_location_id_location_name",
369                                             "pageSize": 200,
370                                             "qtip": "Select location",
371                                             "queryParam": "query[location_name]",
372                                             "selectOnFocus": true,
373                                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{location_name}</b> </div>",
374                                             "triggerAction": "all",
375                                             "typeAhead": false,
376                                             "valueField": "location_id",
377                                             "width": 300,
378                                             "xtype": "ComboBox",
379                                             "|xns": "Roo.form",
380                                             "items": [
381                                                 {
382                                                     "listeners": {
383                                                         "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
384                                                     },
385                                                     "*prop": "store",
386                                                     "remoteSort": true,
387                                                     "xtype": "Store",
388                                                     "|sortInfo": "{ direction : 'ASC', field: 'location_name' }",
389                                                     "|xns": "Roo.data",
390                                                     "items": [
391                                                         {
392                                                             "*prop": "proxy",
393                                                             "xtype": "HttpProxy",
394                                                             "method": "GET",
395                                                             "|xns": "Roo.data",
396                                                             "|url": "baseURL + '/Roo/location.php'"
397                                                         },
398                                                         {
399                                                             "*prop": "reader",
400                                                             "xtype": "JsonReader",
401                                                             "|xns": "Roo.data",
402                                                             "id": "id",
403                                                             "root": "data",
404                                                             "totalProperty": "total",
405                                                             "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"location_name\",\"type\":\"string\"}]"
406                                                         }
407                                                     ]
408                                                 }
409                                             ]
410                                         }
411                                     ]
412                                 }
413                             ]
414                         },
415                         {
416                             "*prop": "colModel[]",
417                             "dataIndex": "invadj_itemsite_id_item_number",
418                             "header": "Item Number",
419                             "hidden": true,
420                             "sortable": true,
421                             "width": 50,
422                             "xtype": "ColumnModel",
423                             "|renderer": "function(v) { return String.format('{0}', v); }",
424                             "|xns": "Roo.grid"
425                         },
426                         {
427                             "*prop": "colModel[]",
428                             "dataIndex": "invadj_itemsite_id",
429                             "header": "Item",
430                             "width": 100,
431                             "xtype": "ColumnModel",
432                             "|renderer": "function(v,x,r) { return String.format('{0}', r.data.invadj_itemsite_id_item_number); }",
433                             "|xns": "Roo.grid",
434                             "items": [
435                                 {
436                                     "|xns": "Roo.grid",
437                                     "xtype": "GridEditor",
438                                     "*prop": "editor",
439                                     "items": [
440                                         {
441                                             "*prop": "field",
442                                             "allowBlank": false,
443                                             "displayField": "itemsite_item_id_item_number",
444                                             "editable": true,
445                                             "emptyText": "Select itemsite",
446                                             "fieldLabel": "itemsite",
447                                             "forceSelection": true,
448                                             "hiddenName": "invadj_itemsite_id",
449                                             "listWidth": 400,
450                                             "loadingText": "Searching...",
451                                             "minChars": 2,
452                                             "name": "invadj_itemsite_id_item_number",
453                                             "pageSize": 20,
454                                             "qtip": "Select itemsite",
455                                             "queryParam": "query[number]",
456                                             "selectOnFocus": true,
457                                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{itemsite_item_id_item_number}</b> </div>",
458                                             "triggerAction": "all",
459                                             "typeAhead": false,
460                                             "valueField": "itemsite_id",
461                                             "width": 300,
462                                             "xtype": "ComboBox",
463                                             "|xns": "Roo.form",
464                                             "items": [
465                                                 {
466                                                     "listeners": {
467                                                         "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
468                                                     },
469                                                     "*prop": "store",
470                                                     "remoteSort": true,
471                                                     "xtype": "Store",
472                                                     "|sortInfo": "{ direction : 'ASC', field: 'itemsite_item_id_item_number' }",
473                                                     "|xns": "Roo.data",
474                                                     "items": [
475                                                         {
476                                                             "*prop": "proxy",
477                                                             "xtype": "HttpProxy",
478                                                             "method": "GET",
479                                                             "|xns": "Roo.data",
480                                                             "|url": "baseURL + '/Roo/itemsite.php'"
481                                                         },
482                                                         {
483                                                             "*prop": "reader",
484                                                             "xtype": "JsonReader",
485                                                             "|xns": "Roo.data",
486                                                             "id": "id",
487                                                             "root": "data",
488                                                             "totalProperty": "total",
489                                                             "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"itemsite_abcclass\",\"type\":\"string\"}]"
490                                                         }
491                                                     ]
492                                                 }
493                                             ]
494                                         }
495                                     ]
496                                 }
497                             ]
498                         },
499                         {
500                             "*prop": "colModel[]",
501                             "align": "right",
502                             "dataIndex": "invadj_qty_by",
503                             "header": "Adjust By #",
504                             "width": 75,
505                             "xtype": "ColumnModel",
506                             "|renderer": "function(v) { return String.format('{0}', v); }",
507                             "|xns": "Roo.grid",
508                             "items": [
509                                 {
510                                     "|xns": "Roo.grid",
511                                     "xtype": "GridEditor",
512                                     "*prop": "editor",
513                                     "items": [
514                                         {
515                                             "*prop": "field",
516                                             "allowDecimals": false,
517                                             "cls": "align-right",
518                                             "xtype": "NumberField",
519                                             "|xns": "Roo.form"
520                                         }
521                                     ]
522                                 }
523                             ]
524                         },
525                         {
526                             "*prop": "colModel[]",
527                             "dataIndex": "invadj_comments",
528                             "header": "Comments",
529                             "width": 75,
530                             "xtype": "ColumnModel",
531                             "|renderer": "function(v,x,r) {\n   return String.format(r.data.invfifo_void * 1 > 0 ? '<s style=\"color:#ccc\">{0}</s>' : '{0}', v); \n }\n     ",
532                             "|xns": "Roo.grid",
533                             "items": [
534                                 {
535                                     "|xns": "Roo.grid",
536                                     "xtype": "GridEditor",
537                                     "*prop": "editor",
538                                     "items": [
539                                         {
540                                             "|xns": "Roo.form",
541                                             "xtype": "TextField",
542                                             "*prop": "field"
543                                         }
544                                     ]
545                                 }
546                             ]
547                         },
548                         {
549                             "*prop": "colModel[]",
550                             "dataIndex": "invadj_posted",
551                             "header": "Posted",
552                             "width": 75,
553                             "xtype": "ColumnModel",
554                             "|renderer": "function(v) {  \n    var state = v * 1 > 0 ?  '-checked' : '';\n\n    return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n                \n }",
555                             "|xns": "Roo.grid"
556                         }
557                     ]
558                 }
559             ]
560         }
561     ],
562     "permname": "",
563     "modOrder": "100"
564 }