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