Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleShipmentNew.bjs
1 {
2     "id": "roo-file-36",
3     "name": "Pman.Dialog.XtupleShipmentNew",
4     "parent": false,
5     "title": "",
6     "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleShipmentNew.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "show": "function (_self)\n{\n    _this.form.findField('shiphead_location_id').focus();\n}"
11             },
12             "closable": false,
13             "height": 130,
14             "modal": true,
15             "resizable": false,
16             "title": "Create new Shipment",
17             "width": 500,
18             "xtype": "LayoutDialog",
19             "|xns": "Roo",
20             "items": [
21                 {
22                     "|xns": "Roo",
23                     "xtype": "LayoutRegion",
24                     "*prop": "center"
25                 },
26                 {
27                     "region": "center",
28                     "xtype": "ContentPanel",
29                     "|xns": "Roo",
30                     "items": [
31                         {
32                             "listeners": {
33                                 "rendered": "function (form)\n{\n  _this.form = form;\n}",
34                                 "actioncomplete": "function (_self, action)\n{\n    if (action.type == 'setdata') {\n        // see if there are multiple possilbe targets\n        new Pman.Request({\n            url : baseURL + '/Roo/cohead',\n            method : 'GET',\n            params : {\n                cohead_id : _this.data.shiphead_order_id,\n                _has_multiple_ship : 1\n            },\n            success : function(res) {\n                // if there is one row returned, then assign values, and press OK\n                // otherwise.. cary on..\n                if (res.total === 1) {\n                    _this.form.setValues( {\n                    \n                        shiphead_location_id : res.data[0].coitem_location_src,\n                        shiphead_location_id_location_name : res.data[0].coitem_location_src_name,                        \n                        shiphead_shipto_id : res.data[0].coitem_shipto_id,\n                        shiphead_shipto_id_shipto_name : res.data[0].coitem_shipto_id_name\n                    });\n                    _this.okButton.fireEvent('click');\n                }\n                \n            },\n            failure : function(res) {\n\n                Roo.MessageBox.alert(\"Error\", res.errorMsg);\n                _this.dialog.hide();\n                \n            }\n        });\n            \n    \n    }\n  \n}"
35                             },
36                             "xtype": "Form",
37                             "|xns": "Roo.form",
38                             "items": [
39                                 {
40                                     "allowBlank": false,
41                                     "alwaysQuery": true,
42                                     "displayField": "location_name",
43                                     "editable": false,
44                                     "emptyText": "Select location",
45                                     "fieldLabel": "From Location",
46                                     "forceSelection": true,
47                                     "hiddenName": "shiphead_location_id",
48                                     "listWidth": 400,
49                                     "loadingText": "Searching...",
50                                     "minChars": 2,
51                                     "name": "shiphead_location_id_location_name",
52                                     "pageSize": 20,
53                                     "qtip": "Select location",
54                                     "queryParam": "",
55                                     "selectOnFocus": true,
56                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{location_name}</b> </div>",
57                                     "triggerAction": "all",
58                                     "typeAhead": true,
59                                     "valueField": "location_id",
60                                     "width": 300,
61                                     "xtype": "ComboBox",
62                                     "|xns": "Roo.form",
63                                     "items": [
64                                         {
65                                             "listeners": {
66                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    o.params['query[for_cohead_id]'] = _this.data.shiphead_order_id;\n    // set more here\n}\n"
67                                             },
68                                             "*prop": "store",
69                                             "remoteSort": true,
70                                             "xtype": "Store",
71                                             "|sortInfo": "{ direction : 'ASC', field: 'location_name' }",
72                                             "|xns": "Roo.data",
73                                             "items": [
74                                                 {
75                                                     "*prop": "proxy",
76                                                     "xtype": "HttpProxy",
77                                                     "method": "GET",
78                                                     "|xns": "Roo.data",
79                                                     "|url": "baseURL + '/Roo/location.php'"
80                                                 },
81                                                 {
82                                                     "*prop": "reader",
83                                                     "xtype": "JsonReader",
84                                                     "|xns": "Roo.data",
85                                                     "id": "id",
86                                                     "root": "data",
87                                                     "totalProperty": "total",
88                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"location_name\",\"type\":\"string\"}]"
89                                                 }
90                                             ]
91                                         }
92                                     ]
93                                 },
94                                 {
95                                     "allowBlank": false,
96                                     "alwaysQuery": true,
97                                     "displayField": "shipto_name",
98                                     "editable": false,
99                                     "emptyText": "Select Ship to name",
100                                     "fieldLabel": "To",
101                                     "forceSelection": true,
102                                     "hiddenName": "shiphead_shipto_id",
103                                     "listWidth": 400,
104                                     "loadingText": "Searching...",
105                                     "minChars": 2,
106                                     "name": "shiphead_shipto_id_shipto_name",
107                                     "pageSize": 20,
108                                     "qtip": "Select Ship to name",
109                                     "queryParam": "",
110                                     "selectOnFocus": true,
111                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{shipto_name}</b> </div>",
112                                     "triggerAction": "all",
113                                     "typeAhead": true,
114                                     "valueField": "shipto_id",
115                                     "width": 300,
116                                     "xtype": "ComboBox",
117                                     "|xns": "Roo.form",
118                                     "items": [
119                                         {
120                                             "listeners": {
121                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n     o.params['query[for_cohead_id]'] = _this.data.shiphead_order_id;\n}\n"
122                                             },
123                                             "*prop": "store",
124                                             "remoteSort": true,
125                                             "xtype": "Store",
126                                             "|sortInfo": "{ direction : 'ASC', field: 'shipto_name' }",
127                                             "|xns": "Roo.data",
128                                             "items": [
129                                                 {
130                                                     "*prop": "proxy",
131                                                     "xtype": "HttpProxy",
132                                                     "method": "GET",
133                                                     "|xns": "Roo.data",
134                                                     "|url": "baseURL + '/Roo/shiptoinfo.php'"
135                                                 },
136                                                 {
137                                                     "*prop": "reader",
138                                                     "xtype": "JsonReader",
139                                                     "|xns": "Roo.data",
140                                                     "id": "id",
141                                                     "root": "data",
142                                                     "totalProperty": "total",
143                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"shipto_name\",\"type\":\"string\"}]"
144                                                 }
145                                             ]
146                                         }
147                                     ]
148                                 },
149                                 {
150                                     "name": "shiphead_order_id",
151                                     "xtype": "Hidden",
152                                     "|xns": "Roo.form"
153                                 },
154                                 {
155                                     "name": "shiphead_shipdate",
156                                     "xtype": "Hidden",
157                                     "|xns": "Roo.form"
158                                 }
159                             ]
160                         }
161                     ]
162                 },
163                 {
164                     "listeners": {
165                         "click": "function (_self, e)\n{\n   _this.dialog.hide();\n \n }"
166                     },
167                     "*prop": "buttons[]",
168                     "text": "Cancel",
169                     "xtype": "Button",
170                     "|xns": "Roo"
171                 },
172                 {
173                     "listeners": {
174                         "click": "function (_self, e)\n{\n   //_this.findField('cuinfo_\n   \n   // check if customer is filled in.\n   if (_this.form.findField('shiphead_location_id').getValue() < 1) {\n        Roo.MessageBox.alert(\"Error\", \"Select a source location\");\n        return;\n   }\n   if (_this.form.findField('shiphead_shipto_id').getValue() < 1) {\n        Roo.MessageBox.alert(\"Error\", \"Select where to ship to\");\n        return;\n   }\n\n     var rv = _this.form.getFieldValues();\n\n    \n    Pman.Dialog.XtupleShipment.show(rv ,\n        function() { \n              _this.dialog.hide();\n             _this.callback()\n        }\n    );\n    \n }",
175                         "render": "function (_self)\n{\n    _this.okButton = _self;\n}"
176                     },
177                     "*prop": "buttons[]",
178                     "text": "OK",
179                     "xtype": "Button",
180                     "|xns": "Roo"
181                 }
182             ]
183         }
184     ],
185     "permname": "",
186     "modOrder": "001"
187 }