Pman.Tab.XtupleSalesShipment.bjs
[Pman.Xtuple] / Pman.Tab.XtupleSalesShipment.bjs
1 {
2     "id": "roo-file-396",
3     "name": "Pman.Tab.XtupleSalesShipment",
4     "parent": "Pman.Tab.XtupleSales",
5     "title": "",
6     "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleSalesShipment.bjs",
7     "items": [
8         {
9             "|xns": "Roo",
10             "xtype": "GridPanel",
11             ".builderCfg": "{\"cols\":[{\"table\":\"shiphead\",\"column\":\"shiphead_order_id\",\"columnshort\":\"shiphead_order_id\",\"ctype\":\"int4\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Order#\"},{\"table\":\"shiphead\",\"column\":\"shiphead_number\",\"columnshort\":\"shiphead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":0,\"title\":\"Shipment#\"},{\"table\":\"shiphead\",\"column\":\"shiphead_notes\",\"columnshort\":\"shiphead_notes\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_shipped\",\"columnshort\":\"shiphead_shipped\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_shipdate\",\"columnshort\":\"shiphead_shipdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_sfstatus\",\"columnshort\":\"shiphead_sfstatus\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}],\"cols_ex\":[\"shiphead_notes\"],\"table\":\"shiphead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
12             "title": "Fullfillments",
13             "fitToframe": true,
14             "fitContainer": true,
15             "tableName": "shiphead",
16             "background": true,
17             "region": "center",
18             "listeners": {
19                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
20             },
21             "items": [
22                 {
23                     "listeners": {
24                         "|render": "function() \n{\n    _this.grid = this; \n    try { \n        _this.dialog = Pman.Dialog.XtupleSalesOrder;\n    } catch(e) {}\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
25                         "|rowdblclick": "function (_self, rowIndex, e)\n{\n     if (!_this.dialog) return;\n     \n     var d =  this.getDataSource().getAt(rowIndex).data;\n    _this.dialog.show( {\n        cohead_id : d.shiphead_order_id\n    \n    }, function() {\n        _this.grid.footer.onClick('refresh');\n        Pman.Tab.XtupleSales.grid.footer.onClick('first');\n    }); \n}\n"
26                     },
27                     "*prop": "grid",
28                     ".builderCfg": "{\"cols\":[{\"table\":\"shiphead\",\"column\":\"shiphead_order_id\",\"columnshort\":\"shiphead_order_id\",\"ctype\":\"int4\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Order#\"},{\"table\":\"shiphead\",\"column\":\"shiphead_number\",\"columnshort\":\"shiphead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":0,\"title\":\"Shipment#\"},{\"table\":\"shiphead\",\"column\":\"shiphead_notes\",\"columnshort\":\"shiphead_notes\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_shipped\",\"columnshort\":\"shiphead_shipped\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_shipdate\",\"columnshort\":\"shiphead_shipdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_sfstatus\",\"columnshort\":\"shiphead_sfstatus\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}],\"cols_ex\":[\"shiphead_notes\"],\"table\":\"shiphead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
29                     "autoExpandColumn": "shiphead_notes",
30                     "loadMask": true,
31                     "xtype": "Grid",
32                     "|xns": "Roo.grid",
33                     "items": [
34                         {
35                             "listeners": {
36                                 "beforeload": "function (_self, options)\n{\n    options.params._status =  _this.status.getValue();\n    var cust = _this.custSel.getValue();\n    if (cust *1) {\n    \n    \n    }\n}"
37                             },
38                             "*prop": "dataSource",
39                             "remoteSort": true,
40                             "xtype": "Store",
41                             "|sortInfo": "{ field : 'shipdate', direction: 'DESC' }",
42                             "|xns": "Roo.data",
43                             "items": [
44                                 {
45                                     "*prop": "proxy",
46                                     "xtype": "HttpProxy",
47                                     "method": "GET",
48                                     "|url": "baseURL + '/Roo/shiphead.php'",
49                                     "|xns": "Roo.data"
50                                 },
51                                 {
52                                     "|xns": "Roo.data",
53                                     "xtype": "JsonReader",
54                                     "totalProperty": "total",
55                                     "root": "data",
56                                     ".builderCfg": "{\"cols\":[{\"table\":\"shiphead\",\"column\":\"shiphead_order_id\",\"columnshort\":\"shiphead_order_id\",\"ctype\":\"int4\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Order#\"},{\"table\":\"shiphead\",\"column\":\"shiphead_number\",\"columnshort\":\"shiphead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":0,\"title\":\"Shipment#\"},{\"table\":\"shiphead\",\"column\":\"shiphead_notes\",\"columnshort\":\"shiphead_notes\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_shipped\",\"columnshort\":\"shiphead_shipped\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_shipdate\",\"columnshort\":\"shiphead_shipdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_sfstatus\",\"columnshort\":\"shiphead_sfstatus\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}],\"cols_ex\":[\"shiphead_notes\"],\"table\":\"shiphead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
57                                     "*prop": "reader",
58                                     "id": "id",
59                                     "|fields": "[\n    {\n        'name': 'shiphead_order_id',\n        'type': 'int'\n    },\n    {\n        'name': 'shiphead_number',\n        'type': 'string'\n    },\n    {\n        'name': 'shiphead_notes',\n        'type': 'string'\n    },\n    {\n        'name': 'shiphead_shipped',\n        'type': 'boolean'\n    },\n    {\n        'name': 'shiphead_shipdate',\n        'type': 'date'\n    },\n    {\n        'name': 'shiphead_sfstatus'\n    }\n]"
60                                 }
61                             ]
62                         },
63                         {
64                             "*prop": "footer",
65                             "xtype": "PagingToolbar",
66                             "pageSize": 25,
67                             "displayInfo": true,
68                             "displayMsg": "Displaying shiphead{0} - {1} of {2}",
69                             "emptyMsg": "No shiphead found",
70                             "|xns": "Roo",
71                             "items": [
72                                 {
73                                     "listeners": {
74                                         "click": "function (_self, e)\n{\n    new Pman.Download({\n        grid: _this.grid\n    });\n    Roo.MessageBox.alert(\"Notice\", \"Download should start soon\");\n}"
75                                     },
76                                     "text": "Download",
77                                     "xtype": "Button",
78                                     "|xns": "Roo.Toolbar"
79                                 }
80                             ]
81                         },
82                         {
83                             "*prop": "toolbar",
84                             "xtype": "Toolbar",
85                             "|xns": "Roo",
86                             "items": [
87                                 {
88                                     "listeners": {
89                                         "select": "function (combo, record, index)\n{\n (function() {   _this.grid.footer.onClick('first'); }).defer(100);\n}",
90                                         "render": "function (_self)\n{\n    _this.custSel = _self;\n}"
91                                     },
92                                     "allowBlank": false,
93                                     "displayField": "cust_name",
94                                     "editable": true,
95                                     "emptyText": "Select custinfo",
96                                     "fieldLabel": "cust_name",
97                                     "forceSelection": false,
98                                     "hiddenName": "cust_id",
99                                     "listWidth": 400,
100                                     "loadingText": "Searching...",
101                                     "minChars": 2,
102                                     "name": "cust_name",
103                                     "pageSize": 20,
104                                     "qtip": "Select Customer",
105                                     "queryParam": "query[cust_name]",
106                                     "selectOnFocus": true,
107                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{cust_name}</b> </div>",
108                                     "triggerAction": "all",
109                                     "typeAhead": true,
110                                     "valueField": "cust_id",
111                                     "width": 300,
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: 'shiphead_shipdate' }",
123                                             "|xns": "Roo.data",
124                                             "items": [
125                                                 {
126                                                     "*prop": "proxy",
127                                                     "xtype": "HttpProxy",
128                                                     "method": "GET",
129                                                     "|xns": "Roo.data",
130                                                     "|url": "baseURL + '/Roo/custinfo.php'"
131                                                 },
132                                                 {
133                                                     "*prop": "reader",
134                                                     "xtype": "JsonReader",
135                                                     "|xns": "Roo.data",
136                                                     "id": "cust_id",
137                                                     "root": "data",
138                                                     "totalProperty": "total",
139                                                     "|fields": "[{\"name\":\"cust_id\",\"type\":\"int\"},\"cust_name\"]"
140                                                 }
141                                             ]
142                                         }
143                                     ]
144                                 },
145                                 {
146                                     "listeners": {
147                                         "render": "function (_self)\n{\n  _this.status = _self;\n}",
148                                         "beforeselect": "function (combo, record, index)\n{\n (function() {   _this.grid.footer.onClick('first'); }).defer(100);\n}"
149                                     },
150                                     "allowBlank": false,
151                                     "displayField": "fname",
152                                     "editable": false,
153                                     "fieldLabel": "Status",
154                                     "hiddenName": "status",
155                                     "listWidth": 200,
156                                     "mode": "local",
157                                     "name": "status",
158                                     "triggerAction": "all",
159                                     "value": "S",
160                                     "valueField": "ftype",
161                                     "width": 100,
162                                     "xtype": "ComboBox",
163                                     "|xns": "Roo.form",
164                                     "items": [
165                                         {
166                                             "*prop": "store",
167                                             "xtype": "SimpleStore",
168                                             "|data": "[ \n    [ 'S', \"Shipped\"],\n    [ 'R' , \"Reserved\"],\n    [ 'V' , \"Void Only\"],    \n    [ 'A', \"All\"] \n]\n",
169                                             "|fields": "[  'ftype', 'fname']",
170                                             "|xns": "Roo.data"
171                                         }
172                                     ]
173                                 }
174                             ]
175                         },
176                         {
177                             "*prop": "colModel[]",
178                             ".builderCfg": "{\"table\":\"shiphead\",\"column\":\"shiphead_order_id\",\"columnshort\":\"shiphead_order_id\",\"ctype\":\"int4\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Order#\"}",
179                             "dataIndex": "shiphead_order_id_cohead_number",
180                             "header": "Order#",
181                             "sortable": true,
182                             "width": 75,
183                             "xtype": "ColumnModel",
184                             "|renderer": "function(v) { return String.format('{0}', v); }",
185                             "|xns": "Roo.grid"
186                         },
187                         {
188                             "*prop": "colModel[]",
189                             "dataIndex": "shiphead_custinfo_cust_name",
190                             "header": "Customer",
191                             "width": 200,
192                             "xtype": "ColumnModel",
193                             "|renderer": "function(v) { return String.format('{0}', v); }",
194                             "|xns": "Roo.grid"
195                         },
196                         {
197                             "*prop": "colModel[]",
198                             ".builderCfg": "{\"table\":\"shiphead\",\"column\":\"shiphead_number\",\"columnshort\":\"shiphead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":0,\"title\":\"Shipment#\"}",
199                             "dataIndex": "shiphead_number",
200                             "header": "Shipment#",
201                             "sortable": true,
202                             "width": 200,
203                             "xtype": "ColumnModel",
204                             "|renderer": "function(v) { return String.format('{0}', v); }",
205                             "|xns": "Roo.grid"
206                         },
207                         {
208                             "xtype": "ColumnModel",
209                             ".builderCfg": "{\"table\":\"shiphead\",\"column\":\"shiphead_notes\",\"columnshort\":\"shiphead_notes\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"}",
210                             "header": "notes",
211                             "width": 200,
212                             "dataIndex": "shiphead_notes",
213                             "|renderer": "function(v) { return String.format('{0}', v); }",
214                             "|xns": "Roo.grid",
215                             "*prop": "colModel[]"
216                         },
217                         {
218                             "*prop": "colModel[]",
219                             "dataIndex": "shiphead_delivery_note",
220                             "header": "Delivery Note",
221                             "width": 200,
222                             "xtype": "ColumnModel",
223                             "|renderer": "function(v) { return String.format('{0}', v); }",
224                             "|xns": "Roo.grid"
225                         },
226                         {
227                             "*prop": "colModel[]",
228                             ".builderCfg": "{\"table\":\"shiphead\",\"column\":\"shiphead_shipped\",\"columnshort\":\"shiphead_shipped\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}",
229                             "dataIndex": "shiphead_shipped",
230                             "header": "shipped",
231                             "width": 75,
232                             "xtype": "ColumnModel",
233                             "|renderer": "function(v,x,r) { \n\n\n\n  \n    if (r.json.shiphead_shipdate.length) {\n    \n        if (r.json.shiphead_shipped) {\n            return \"Confirmed\";\n        }\n    \n         return 'Draft';\n    }\n     \n    return 'VOID';\n   \n\n}",
234                             "|xns": "Roo.grid"
235                         },
236                         {
237                             "*prop": "colModel[]",
238                             ".builderCfg": "{\"table\":\"shiphead\",\"column\":\"shiphead_shipdate\",\"columnshort\":\"shiphead_shipdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}",
239                             "dataIndex": "shiphead_shipdate",
240                             "header": "shipdate",
241                             "sortable": true,
242                             "width": 75,
243                             "xtype": "ColumnModel",
244                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
245                             "|xns": "Roo.grid"
246                         }
247                     ]
248                 }
249             ]
250         }
251     ],
252     "permname": "",
253     "modOrder": "100"
254 }