Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleMiscellaneousCheck.bjs
1 {
2     "id": "roo-file-15",
3     "name": "Pman.Dialog.XtupleMiscellaneousCheck",
4     "parent": "",
5     "title": "",
6     "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleMiscellaneousCheck.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "show": "function (_self)\n{\n    this.layout.getRegion('center').showPanel(0);\n}"
11             },
12             "closable": false,
13             "collapsible": false,
14             "height": 350,
15             "modal": true,
16             "resizable": false,
17             "title": "Create Miscellaneous Check",
18             "width": 500,
19             "xtype": "LayoutDialog",
20             "|xns": "Roo",
21             "items": [
22                 {
23                     "|xns": "Roo",
24                     "xtype": "LayoutRegion",
25                     "*prop": "center"
26                 },
27                 {
28                     "region": "center",
29                     "xtype": "ContentPanel",
30                     "|xns": "Roo",
31                     "items": [
32                         {
33                             "listeners": {
34                                 "|actioncomplete": "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       if(_this.data.checkhead_id){\n           _this.dialog.el.mask(\"Loading\");\n           this.load({ method: 'GET', params: { '_id' : _this.data.checkhead_id }});\n           return;\n       }\n       return;\n    }\n    if (action.type == 'load') {\n        _this.dialog.el.unmask();\n        return;\n    }\n    if (action.type =='submit') {\n    \n        _this.dialog.el.unmask();\n        _this.dialog.hide();\n    \n         if (_this.callback) {\n            _this.callback.call(_this, _this.form.getValues());\n         }\n         _this.form.reset();\n         return;\n    }\n}\n",
35                                 "|rendered": "function (form)\n{\n    _this.form= form;\n}\n"
36                             },
37                             "labelWidth": 150,
38                             "method": "POST",
39                             "style": "margin:10px;",
40                             "xtype": "Form",
41                             "|url": "baseURL + '/Roo/checkhead.php'",
42                             "|xns": "Roo.form",
43                             "items": [
44                                 {
45                                     "allowBlank": true,
46                                     "fieldLabel": "Customer",
47                                     "name": "cust_name",
48                                     "readOnly": true,
49                                     "width": 200,
50                                     "xtype": "TextField",
51                                     "|xns": "Roo.form"
52                                 },
53                                 {
54                                     "allowBlank": true,
55                                     "fieldLabel": "Apply To Credit Memo",
56                                     "name": "cmhead_number",
57                                     "readOnly": true,
58                                     "width": 200,
59                                     "xtype": "TextField",
60                                     "|xns": "Roo.form"
61                                 },
62                                 {
63                                     "allowBlank": false,
64                                     "disabled": true,
65                                     "displayField": "curr_name",
66                                     "editable": false,
67                                     "emptyText": "Select Currency",
68                                     "fieldLabel": "Currency",
69                                     "forceSelection": true,
70                                     "hiddenName": "checkhead_curr_id",
71                                     "listWidth": 400,
72                                     "loadingText": "Searching...",
73                                     "minChars": 2,
74                                     "name": "checkhead_curr_id_curr_name",
75                                     "pageSize": 20,
76                                     "qtip": "Select Currency",
77                                     "queryParam": "query[curr_name]",
78                                     "selectOnFocus": true,
79                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{curr_name}</b> </div>",
80                                     "triggerAction": "all",
81                                     "typeAhead": true,
82                                     "valueField": "curr_id",
83                                     "width": 200,
84                                     "xtype": "ComboBox",
85                                     "|xns": "Roo.form",
86                                     "items": [
87                                         {
88                                             "listeners": {
89                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n   \n}\n"
90                                             },
91                                             "*prop": "store",
92                                             "remoteSort": true,
93                                             "xtype": "Store",
94                                             "|sortInfo": "{ direction : 'ASC', field: 'curr_symbol' }",
95                                             "|xns": "Roo.data",
96                                             "items": [
97                                                 {
98                                                     "*prop": "proxy",
99                                                     "xtype": "HttpProxy",
100                                                     "method": "GET",
101                                                     "|xns": "Roo.data",
102                                                     "|url": "baseURL + '/Roo/curr_symbol.php'"
103                                                 },
104                                                 {
105                                                     "*prop": "reader",
106                                                     "xtype": "JsonReader",
107                                                     "|xns": "Roo.data",
108                                                     "id": "curr_id",
109                                                     "root": "data",
110                                                     "totalProperty": "total",
111                                                     "|fields": "[{\"name\":\"curr_id\",\"type\":\"int\"},\"curr_symbol\"]"
112                                                 }
113                                             ]
114                                         }
115                                     ]
116                                 },
117                                 {
118                                     "allowBlank": false,
119                                     "allowDecimals": true,
120                                     "decimalPrecision": 2,
121                                     "fieldLabel": "Amount",
122                                     "name": "checkhead_amount",
123                                     "width": 200,
124                                     "xtype": "NumberField",
125                                     "|xns": "Roo.form"
126                                 },
127                                 {
128                                     "allowBlank": false,
129                                     "displayField": "bankaccnt_name",
130                                     "editable": false,
131                                     "emptyText": "Select Bank Accnt",
132                                     "fieldLabel": "Post to",
133                                     "forceSelection": true,
134                                     "hiddenName": "checkhead_bankaccnt_id",
135                                     "listWidth": 400,
136                                     "loadingText": "Searching...",
137                                     "minChars": 2,
138                                     "name": "checkhead_bankaccnt_id_name",
139                                     "pageSize": 20,
140                                     "qtip": "Select Bank Accnt",
141                                     "queryParam": "query[bankaccnt_name]",
142                                     "selectOnFocus": true,
143                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{bankaccnt_name} - {bankaccnt_descrip}</b> </div>",
144                                     "triggerAction": "all",
145                                     "typeAhead": true,
146                                     "valueField": "bankaccnt_id",
147                                     "width": 200,
148                                     "xtype": "ComboBox",
149                                     "|xns": "Roo.form",
150                                     "items": [
151                                         {
152                                             "listeners": {
153                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n   \n}\n"
154                                             },
155                                             "*prop": "store",
156                                             "remoteSort": true,
157                                             "xtype": "Store",
158                                             "|sortInfo": "{ direction : 'DESC', field: 'bankaccnt_id' }",
159                                             "|xns": "Roo.data",
160                                             "items": [
161                                                 {
162                                                     "*prop": "proxy",
163                                                     "method": "GET",
164                                                     "xtype": "HttpProxy",
165                                                     "|url": "baseURL + '/Roo/bankaccnt.php'",
166                                                     "|xns": "Roo.data"
167                                                 },
168                                                 {
169                                                     "*prop": "reader",
170                                                     "id": "bankaccnt_id",
171                                                     "root": "data",
172                                                     "totalProperty": "total",
173                                                     "xtype": "JsonReader",
174                                                     "|fields": "[{\"name\":\"bankaccnt_id\",\"type\":\"int\"},\"bankaccnt_name\"]",
175                                                     "|xns": "Roo.data"
176                                                 }
177                                             ]
178                                         }
179                                     ]
180                                 },
181                                 {
182                                     "allowBlank": false,
183                                     "fieldLabel": "Date",
184                                     "format": "Y-m-d",
185                                     "name": "checkhead_checkdate",
186                                     "width": 200,
187                                     "xtype": "DateField",
188                                     "|xns": "Roo.form"
189                                 },
190                                 {
191                                     "allowBlank": true,
192                                     "fieldLabel": "Memo",
193                                     "name": "checkhead_for",
194                                     "width": 200,
195                                     "xtype": "TextField",
196                                     "|xns": "Roo.form"
197                                 },
198                                 {
199                                     "allowBlank": true,
200                                     "fieldLabel": "Notes",
201                                     "name": "checkhead_notes",
202                                     "width": 300,
203                                     "xtype": "TextArea",
204                                     "|xns": "Roo.form"
205                                 },
206                                 {
207                                     "name": "checkhead_id",
208                                     "xtype": "Hidden",
209                                     "|xns": "Roo.form"
210                                 },
211                                 {
212                                     "name": "checkhead_recip_id",
213                                     "xtype": "Hidden",
214                                     "|xns": "Roo.form"
215                                 },
216                                 {
217                                     "name": "checkhead_recip_type",
218                                     "xtype": "Hidden",
219                                     "|xns": "Roo.form"
220                                 },
221                                 {
222                                     "name": "aropen_id",
223                                     "xtype": "Hidden",
224                                     "|xns": "Roo.form"
225                                 },
226                                 {
227                                     "name": "checkhead_misc",
228                                     "xtype": "Hidden",
229                                     "|xns": "Roo.form"
230                                 },
231                                 {
232                                     "name": "_create_and_post",
233                                     "xtype": "Hidden",
234                                     "|xns": "Roo.form"
235                                 },
236                                 {
237                                     "name": "remaining_total",
238                                     "xtype": "Hidden",
239                                     "|xns": "Roo.form"
240                                 }
241                             ]
242                         }
243                     ]
244                 },
245                 {
246                     "listeners": {
247                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
248                     },
249                     "*prop": "buttons[]",
250                     "text": "Cancel",
251                     "xtype": "Button",
252                     "|xns": "Roo"
253                 },
254                 {
255                     "listeners": {
256                         "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n   // _this.dialog.el.mask(\"Saving\");\n   var a = _this.form.findField('checkhead_amount').getValue();\n   var r = _this.form.findField('remaining_total').getValue();\n   \n   if(a - r > 0){\n        Roo.MessageBox.alert(\"Error\", \"You must enter an amount less than or equal to the credit memo! The amount remaining of this credit memo is \" + r);\n        _this.form.findField('checkhead_amount').setValue(r);\n        return;\n   }\n   \n   _this.form.doAction(\"submit\");\n\n}"
257                     },
258                     "*prop": "buttons[]",
259                     "text": "Save",
260                     "xtype": "Button",
261                     "|xns": "Roo"
262                 }
263             ]
264         }
265     ],
266     "permname": "",
267     "modOrder": "001"
268 }