Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleReconcile.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Pman.Dialog.XtupleReconcile = {
6
7     dialog : false,
8     callback:  false,
9
10     show : function(data, cb)
11     {
12         if (!this.dialog) {
13             this.create();
14         }
15
16         this.callback = cb;
17         this.data = data;
18         this.dialog.show(this.data._el);
19         if (this.form) {
20            this.form.reset();
21            this.form.setValues(data);
22            this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
23         }
24
25     },
26
27     create : function()
28     {
29         var _this = this;
30         this.dialog = Roo.factory({
31             xtype: 'LayoutDialog',
32             xns: Roo,
33             closable : false,
34             collapsible : false,
35             height : 260,
36             modal : true,
37             resizable : false,
38             title : "Reconcile account",
39             width : 400,
40             items : [
41                 {
42                     xtype: 'ContentPanel',
43                     xns: Roo,
44                     region : 'center',
45                     items : [
46                         {
47                             xtype: 'Form',
48                             xns: Roo.form,
49                             listeners : {
50                                 actioncomplete : function(_self,action)
51                                 {
52                                     if (action.type == 'setdata') {
53                                 
54                                        this.load({ method: 'GET', params: { '_closedata' : _this.data.bankaccnt_id }});
55                                        return;
56                                     }
57                                     if (action.type == 'load') {
58                                  
59                                         return;
60                                     }
61                                     if (action.type =='submit') {
62                                     
63                                  
64                                         _this.dialog.hide();
65                                     
66                                          if (_this.callback) {
67                                             _this.callback.call(_this, _this.form.getValues());
68                                          }
69                                          _this.form.reset();
70                                          return;
71                                     }
72                                 },
73                                 rendered : function (form)
74                                 {
75                                     _this.form= form;
76                                 },
77                                 actionfailed : function (_self, action)
78                                 {
79                                 
80                                     Roo.MessageBox.alert("Error", 
81                                         action.result ? action.result.errorMsg : "Error posting"
82                                     );
83                                         
84                                     if (action.type == 'load') {
85                                         _this.dialog.hide();
86                                         return;
87                                     }
88                                 
89                                 
90                                     
91                                 }
92                             },
93                             labelAlign : 'right',
94                             labelWidth : 150,
95                             method : 'POST',
96                             style : 'margin:10px;',
97                             url : baseURL + '/Roo/bankrec.php',
98                             items : [
99                                 {
100                                     xtype: 'TextField',
101                                     xns: Roo.form,
102                                     fieldLabel : 'Bank Account',
103                                     name : 'bankrec_bankaccnt_id_bankaccnt_descrip',
104                                     readOnly : true,
105                                     width : 200
106                                 },
107                                 {
108                                     xtype: 'TextField',
109                                     xns: Roo.form,
110                                     fieldLabel : 'From date',
111                                     format : 'Y-m-d',
112                                     name : 'bankrec_opendate',
113                                     readOnly : true,
114                                     width : 100
115                                 },
116                                 {
117                                     xtype: 'TextField',
118                                     xns: Roo.form,
119                                     fieldLabel : 'End Date',
120                                     format : 'Y-m-d',
121                                     name : 'bankrec_enddate',
122                                     readOnly : true,
123                                     width : 100
124                                 },
125                                 {
126                                     xtype: 'TextField',
127                                     xns: Roo.form,
128                                     fieldLabel : 'Opening Balance',
129                                     name : 'bankrec_openbal',
130                                     readOnly : true,
131                                     width : 75
132                                 },
133                                 {
134                                     xtype: 'TextField',
135                                     xns: Roo.form,
136                                     fieldLabel : 'System close balance',
137                                     name : 'bankrec_endbal_prop',
138                                     readOnly : true,
139                                     width : 150
140                                 },
141                                 {
142                                     xtype: 'TextField',
143                                     xns: Roo.form,
144                                     fieldLabel : 'Real close balance',
145                                     name : 'bankrec_endbal',
146                                     width : 150
147                                 },
148                                 {
149                                     xtype: 'Hidden',
150                                     xns: Roo.form,
151                                     name : '_post',
152                                     value : 1,
153                                     width : 150
154                                 },
155                                 {
156                                     xtype: 'Hidden',
157                                     xns: Roo.form,
158                                     name : 'bankrec_bankaccnt_id',
159                                     width : 150
160                                 },
161                                 {
162                                     xtype: 'Hidden',
163                                     xns: Roo.form,
164                                     name : 'bankrec_id',
165                                     width : 150
166                                 }
167                             ]
168                         }
169                     ]
170                 }
171             ],
172             center : {
173                 xtype: 'LayoutRegion',
174                 xns: Roo
175             },
176             buttons : [
177                 {
178                     xtype: 'Button',
179                     xns: Roo,
180                     listeners : {
181                         click : function (_self, e)
182                         {
183                             _this.dialog.hide();
184                         }
185                     },
186                     text : "Cancel"
187                 },
188                 {
189                     xtype: 'Button',
190                     xns: Roo,
191                     listeners : {
192                         click : function (_self, e)
193                         {
194                             // do some checks?
195                              
196                             
197                          
198                             _this.form.doAction("submit");
199                         
200                         }
201                     },
202                     text : "Save"
203                 }
204             ]
205         });
206     }
207 };