Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleSalesProductList.bjs
1 {
2     "id": "roo-file-352",
3     "name": "Pman.Dialog.XtupleSalesProductList",
4     "parent": "",
5     "title": "",
6     "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleSalesProductList.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "show": "function (_self)\n{\n   _this.grid.footer.onClick('first');\n}"
11             },
12             "closable": false,
13             "collapsible": false,
14             "height": 600,
15             "modal": true,
16             "resizable": false,
17             "title": "Products List",
18             "width": 1000,
19             "xtype": "LayoutDialog",
20             "|xns": "Roo",
21             "items": [
22                 {
23                     "|xns": "Roo",
24                     "xtype": "LayoutRegion",
25                     "*prop": "center"
26                 },
27                 {
28                     "listeners": {
29                         "|activate": "function() {\n    _this.panel = this;\n    \n //   if (_this.grid) {\n //       _this.grid.footer.onClick('first');\n //   }\n}"
30                     },
31                     "background": false,
32                     "fitContainer": true,
33                     "fitToframe": true,
34                     "region": "center",
35                     "tableName": "item",
36                     "title": "Products List",
37                     "xtype": "GridPanel",
38                     "|xns": "Roo",
39                     "items": [
40                         {
41                             "listeners": {
42                                 "|render": "function() \n{\n    _this.grid = this; \n  //  if (_this.panel.active) {\n//      this.footer.onClick('first');\n  //  }\n    \n}",
43                                 "rowdblclick": "function (_self, rowIndex, e)\n{\n    _this.dialog.hide();\n    if(!_this.callback){\n        return;\n    }\n    var s = this.ds.getAt(rowIndex);\n    if (s.data.item_id * 1 < 1 ) {\n        return;\n    }\n    \n    _this.callback.call(_this,s.data);\n}"
44                             },
45                             "*prop": "grid",
46                             "autoExpandColumn": "item_descrip1",
47                             "loadMask": true,
48                             "xtype": "Grid",
49                             "|xns": "Roo.grid",
50                             "items": [
51                                 {
52                                     "*prop": "sm",
53                                     "singleSelect": false,
54                                     "xtype": "RowSelectionModel",
55                                     "|xns": "Roo.grid"
56                                 },
57                                 {
58                                     "listeners": {
59                                         "beforeload": "function (_self, o)\n{\n      o.params._with_prodcat = 1;\n      o.params._with_char = 1;\n      if (!_this.data.exclude_itemsrc_vendor) {\n      \n          o.params._with_itemsrc_active = 1;\n      }\n      o.params._with_last_purchase_price = 1;\n      o.params._with_itemsite = 1;\n      o.params._with_image = 1;\n\n      if(typeof(_this.data.cohead_cust_id) != 'undefined'){\n        o.params.cohead_cust_id = _this.data.cohead_cust_id;\n      }\n      \n      if(typeof(_this.data.cohead_id) != 'undefined'){\n        o.params.cohead_id = _this.data.cohead_id;\n      }\n      \n      var s = _this.searchBox.getValue();\n      if (s.length) {\n            o.params['query[number_or_name]'] = s;\n       }\n       if (_this.data.exclude_itemsrc_vendor) {\n            o.params._exclude_itemsrc_vendor = _this.data.exclude_itemsrc_vendor;\n       } \n        \n      _this.addSelected.show();\n      if (!_this.data.multi_select) {\n            _this.addSelected.hide();\n      }\n      \n}"
60                                     },
61                                     "*prop": "dataSource",
62                                     "remoteSort": true,
63                                     "xtype": "Store",
64                                     "|sortInfo": "{ field : 'item_number', direction: 'ASC' }",
65                                     "|xns": "Roo.data",
66                                     "items": [
67                                         {
68                                             "*prop": "proxy",
69                                             "method": "GET",
70                                             "xtype": "HttpProxy",
71                                             "|url": "baseURL + '/Roo/item.php'",
72                                             "|xns": "Roo.data"
73                                         },
74                                         {
75                                             "*prop": "reader",
76                                             "id": "item_id",
77                                             "root": "data",
78                                             "totalProperty": "total",
79                                             "xtype": "JsonReader",
80                                             "|fields": "[\n    {\n        'name': 'item_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_number',\n        'type': 'string'\n    },\n    {\n        'name': 'item_descrip1',\n        'type': 'string'\n    },\n    {\n        'name': 'item_descrip2',\n        'type': 'string'\n    },\n    {\n        'name': 'item_classcode_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_picklist',\n        'type': 'int'\n    },\n    {\n        'name': 'item_comments',\n        'type': 'string'\n    },\n    {\n        'name': 'item_sold',\n        'type': 'int'\n    },\n    {\n        'name': 'item_fractional',\n        'type': 'int'\n    },\n    {\n        'name': 'item_active',\n        'type': 'int'\n    },\n    {\n        'name': 'item_type',\n        'type': 'string'\n    },\n    {\n        'name': 'item_prodweight',\n        'type': 'float'\n    },\n    {\n        'name': 'item_packweight',\n        'type': 'float'\n    },\n    {\n        'name': 'item_prodcat_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_exclusive',\n        'type': 'int'\n    },\n    {\n        'name': 'item_listprice',\n        'type': 'float'\n    },\n    {\n        'name': 'item_config',\n        'type': 'int'\n    },\n    {\n        'name': 'item_extdescrip',\n        'type': 'string'\n    },\n    {\n        'name': 'item_upccode',\n        'type': 'string'\n    },\n    {\n        'name': 'item_maxcost',\n        'type': 'float'\n    },\n    {\n        'name': 'item_inv_uom_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_price_uom_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_warrdays',\n        'type': 'int'\n    },\n    {\n        'name': 'item_freightclass_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_tax_recoverable',\n        'type': 'int'\n    },\n    {\n        'name': 'item_price_uom_id_uom_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_price_uom_id_uom_name',\n        'type': 'string'\n    },\n    {\n        'name': 'item_price_uom_id_uom_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'item_price_uom_id_uom_item_weight',\n        'type': 'int'\n    },\n    {\n        'name': 'item_inv_uom_id_uom_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_inv_uom_id_uom_name',\n        'type': 'string'\n    },\n    {\n        'name': 'item_inv_uom_id_uom_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'item_inv_uom_id_uom_item_weight',\n        'type': 'int'\n    },\n    {\n        'name': 'item_freightclass_id_freightclass_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_freightclass_id_freightclass_code',\n        'type': 'string'\n    },\n    {\n        'name': 'item_freightclass_id_freightclass_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'item_classcode_id_classcode_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_classcode_id_classcode_code',\n        'type': 'string'\n    },\n    {\n        'name': 'item_classcode_id_classcode_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'item_classcode_id_classcode_mfg',\n        'type': 'int'\n    },\n    {\n        'name': 'item_classcode_id_classcode_creator',\n        'type': 'string'\n    },\n    {\n        'name': 'item_classcode_id_classcode_created',\n        'type': 'date'\n    },\n    {\n        'name': 'item_classcode_id_classcode_modifier',\n        'type': 'string'\n    },\n    {\n        'name': 'item_classcode_id_classcode_modified',\n        'type': 'date'\n    },\n    {\n        'name': 'item_classcode_id_classcode_type',\n        'type': 'string'\n    }\n]",
81                                             "|xns": "Roo.data"
82                                         }
83                                     ]
84                                 },
85                                 {
86                                     "*prop": "footer",
87                                     "displayInfo": true,
88                                     "displayMsg": "Double click to select the item",
89                                     "emptyMsg": "No item found",
90                                     "pageSize": 25,
91                                     "xtype": "PagingToolbar",
92                                     "|xns": "Roo"
93                                 },
94                                 {
95                                     "*prop": "toolbar",
96                                     "xtype": "Toolbar",
97                                     "|xns": "Roo",
98                                     "items": [
99                                         {
100                                             "listeners": {
101                                                 "specialkey": "function (_self, e)\n{\n  _this.grid.footer.onClick('first');\n}",
102                                                 "render": "function (_self)\n{\n    _this.searchBox = _self;\n}"
103                                             },
104                                             "xtype": "TextField",
105                                             "|xns": "Roo.form"
106                                         },
107                                         {
108                                             "listeners": {
109                                                 "click": "function (_self, e)\n{\n    _this.grid.footer.onClick('first');\n}"
110                                             },
111                                             "cls": "x-btn-icon",
112                                             "xtype": "Button",
113                                             "|icon": "rootURL + '/Pman/templates/images/search.gif'",
114                                             "|xns": "Roo.Toolbar"
115                                         },
116                                         {
117                                             "listeners": {
118                                                 "click": "function (_self, e)\n{\n    _this.searchBox.setValue('');\r\n    _this.status_type.setValue('');\r\n    _this.grid.footer.onClick('first');\r\n}"
119                                             },
120                                             "cls": "x-btn-icon",
121                                             "xtype": "Button",
122                                             "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
123                                             "|xns": "Roo.Toolbar"
124                                         }
125                                     ]
126                                 },
127                                 {
128                                     "*prop": "colModel[]",
129                                     "dataIndex": "item_image_id",
130                                     "header": "Image",
131                                     "width": 100,
132                                     "xtype": "ColumnModel",
133                                     "|renderer": "function(v,x,r) { return String.format('<img src=\"{0}/Images/Thumb/50/{1}/{2}\" height=\"50\">', baseURL, v, r.data.item_image_filename); }",
134                                     "|xns": "Roo.grid"
135                                 },
136                                 {
137                                     "*prop": "colModel[]",
138                                     "dataIndex": "item_char_brand",
139                                     "header": "Brand",
140                                     "sortable": true,
141                                     "width": 100,
142                                     "xtype": "ColumnModel",
143                                     "|renderer": "function(v) { return String.format('{0}', v); }",
144                                     "|xns": "Roo.grid"
145                                 },
146                                 {
147                                     "*prop": "colModel[]",
148                                     "dataIndex": "item_char_productgroup",
149                                     "header": "Product Group",
150                                     "width": 100,
151                                     "xtype": "ColumnModel",
152                                     "|renderer": "function(v) { return String.format('{0}', v); }",
153                                     "|xns": "Roo.grid"
154                                 },
155                                 {
156                                     "*prop": "colModel[]",
157                                     "dataIndex": "item_number",
158                                     "header": "Number",
159                                     "width": 75,
160                                     "xtype": "ColumnModel",
161                                     "|renderer": "function(v) { return String.format('{0}', v); }",
162                                     "|xns": "Roo.grid"
163                                 },
164                                 {
165                                     "*prop": "colModel[]",
166                                     "dataIndex": "item_descrip1",
167                                     "header": "Description",
168                                     "width": 200,
169                                     "xtype": "ColumnModel",
170                                     "|renderer": "function(v) { return String.format('{0}', v); }",
171                                     "|xns": "Roo.grid"
172                                 },
173                                 {
174                                     "*prop": "colModel[]",
175                                     "dataIndex": "itemsrc_active",
176                                     "header": "Purchased",
177                                     "width": 75,
178                                     "xtype": "ColumnModel",
179                                     "|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 }",
180                                     "|xns": "Roo.grid"
181                                 },
182                                 {
183                                     "*prop": "colModel[]",
184                                     "dataIndex": "item_sold",
185                                     "header": "is Sold?",
186                                     "width": 50,
187                                     "xtype": "ColumnModel",
188                                     "|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 }",
189                                     "|xns": "Roo.grid"
190                                 },
191                                 {
192                                     "*prop": "colModel[]",
193                                     "dataIndex": "item_active",
194                                     "header": "is Active?",
195                                     "width": 55,
196                                     "xtype": "ColumnModel",
197                                     "|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 }",
198                                     "|xns": "Roo.grid"
199                                 },
200                                 {
201                                     "*prop": "colModel[]",
202                                     "dataIndex": "item_type",
203                                     "header": "Type",
204                                     "width": 50,
205                                     "xtype": "ColumnModel",
206                                     "|renderer": "function(v) { return String.format('{0}', v); }",
207                                     "|xns": "Roo.grid"
208                                 },
209                                 {
210                                     "*prop": "colModel[]",
211                                     "dataIndex": "item_prodcat_id_prodcat_code",
212                                     "header": "Item prodcat",
213                                     "width": 100,
214                                     "xtype": "ColumnModel",
215                                     "|renderer": "function(v) { return String.format('{0}', v); }",
216                                     "|xns": "Roo.grid"
217                                 }
218                             ]
219                         }
220                     ]
221                 },
222                 {
223                     "listeners": {
224                         "click": "function (_self, e)\n{\n\n    if(!_this.callback){\n         _this.dialog.hide();\n        return;\n    }\n    var sels = _this.grid.selModel.getSelections();\n    if (!sels.length) {\n        Roo.MessageBox.alert(\"Error\", \"Select some items\");\n    }\n      _this.dialog.hide();\n    _this.callback.call(_this,sels);\n}",
225                         "render": "function (_self)\n{\n    _this.addSelected = _self;\n}"
226                     },
227                     "*prop": "buttons[]",
228                     "text": "Add Selected",
229                     "xtype": "Button",
230                     "|xns": "Roo"
231                 },
232                 {
233                     "listeners": {
234                         "click": "function (_self, e)\n{\n    Pman.Dialog.XtupleItem.show({item_id : 0}, function(){\n        _this.grid.footer.onClick('first');\n    });\n}"
235                     },
236                     "*prop": "buttons[]",
237                     "text": "Create New",
238                     "xtype": "Button",
239                     "|xns": "Roo"
240                 },
241                 {
242                     "listeners": {
243                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
244                     },
245                     "*prop": "buttons[]",
246                     "text": "Cancel",
247                     "xtype": "Button",
248                     "|xns": "Roo"
249                 }
250             ]
251         }
252     ],
253     "permname": "",
254     "modOrder": "001"
255 }