Pman.Dialog.XtupleJournalEntry.bjs
[Pman.Xtuple] / Pman.Dialog.XtupleJournalEntry.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.XtupleJournalEntry = {
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 : 910,
36             modal : true,
37             resizable : false,
38             title : "Edit / Create gltrans",
39             width : 800,
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                                        //_this.dialog.el.mask("Loading");
54                                        //this.load({ method: 'GET', params: { '_id' : _this.data.id }});
55                                        return;
56                                     }
57                                     if (action.type == 'load') {
58                                         _this.dialog.el.unmask();
59                                         return;
60                                     }
61                                     if (action.type =='submit') {
62                                     
63                                         _this.dialog.el.unmask();
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                             },
78                             labelAlign : 'right',
79                             method : 'POST',
80                             style : 'margin:10px;',
81                             url : baseURL + '/Roo/gltrans.php',
82                             items : [
83                                 {
84                                     xtype: 'Row',
85                                     xns: Roo.form,
86                                     labelAlign : 'right',
87                                     items : [
88                                         {
89                                             xtype: 'TextField',
90                                             xns: Roo.form,
91                                             fieldLabel : 'Sequence',
92                                             name : 'gltrans_sequence',
93                                             width : 100
94                                         },
95                                         {
96                                             xtype: 'TextField',
97                                             xns: Roo.form,
98                                             fieldLabel : 'Journal No.',
99                                             name : 'gltrans_journalnumber',
100                                             width : 75
101                                         }
102                                     ]
103                                 },
104                                 {
105                                     xtype: 'Row',
106                                     xns: Roo.form,
107                                     labelAlign : 'right',
108                                     items : [
109                                         {
110                                             xtype: 'DateField',
111                                             xns: Roo.form,
112                                             fieldLabel : 'Date',
113                                             format : 'd/M/Y',
114                                             name : 'gltrans_date',
115                                             useIso : true,
116                                             width : 100
117                                         },
118                                         {
119                                             xtype: 'TextField',
120                                             xns: Roo.form,
121                                             fieldLabel : 'Entered',
122                                             name : 'gltrans_entered',
123                                             width : 150
124                                         }
125                                     ]
126                                 },
127                                 {
128                                     xtype: 'Row',
129                                     xns: Roo.form,
130                                     items : [
131                                         {
132                                             xtype: 'Checkbox',
133                                             xns: Roo.form,
134                                             boxLabel : 'Posted',
135                                             fieldLabel : 'Status',
136                                             name : 'Posted',
137                                             width : 75
138                                         },
139                                         {
140                                             xtype: 'Row',
141                                             xns: Roo.form,
142                                             hideLabels : true,
143                                             items : [
144                                                 {
145                                                     xtype: 'Checkbox',
146                                                     xns: Roo.form,
147                                                     boxLabel : 'Recorded in Bank Reconcile',
148                                                     fieldLabel : '&nbsp;',
149                                                     name : 'gltrans_rec',
150                                                     width : 200
151                                                 },
152                                                 {
153                                                     xtype: 'Checkbox',
154                                                     xns: Roo.form,
155                                                     boxLabel : 'Deleted',
156                                                     fieldLabel : 'Deleted',
157                                                     name : 'gltrans_deleted',
158                                                     width : 75
159                                                 }
160                                             ]
161                                         }
162                                     ]
163                                 },
164                                 {
165                                     xtype: 'Row',
166                                     xns: Roo.form,
167                                     items : [
168                                         {
169                                             xtype: 'TextField',
170                                             xns: Roo.form,
171                                             fieldLabel : 'Gltrans source',
172                                             name : 'Source',
173                                             width : 100
174                                         },
175                                         {
176                                             xtype: 'TextField',
177                                             xns: Roo.form,
178                                             fieldLabel : 'Doc Type',
179                                             name : 'gltrans_doctype',
180                                             width : 100
181                                         },
182                                         {
183                                             xtype: 'TextField',
184                                             xns: Roo.form,
185                                             fieldLabel : 'Doc No.',
186                                             name : 'gltrans_docnumber',
187                                             width : 200
188                                         }
189                                     ]
190                                 },
191                                 {
192                                     xtype: 'TextField',
193                                     xns: Roo.form,
194                                     fieldLabel : 'Gltrans source',
195                                     name : 'Source',
196                                     width : 100
197                                 },
198                                 {
199                                     xtype: 'TextField',
200                                     xns: Roo.form,
201                                     fieldLabel : 'Doc No.',
202                                     name : 'gltrans_docnumber',
203                                     width : 200
204                                 },
205                                 {
206                                     xtype: 'TextField',
207                                     xns: Roo.form,
208                                     fieldLabel : 'References',
209                                     name : 'gltrans_misc_id',
210                                     width : 75
211                                 },
212                                 {
213                                     xtype: 'TextField',
214                                     xns: Roo.form,
215                                     fieldLabel : 'Doc Type',
216                                     name : 'gltrans_doctype',
217                                     width : 100
218                                 },
219                                 {
220                                     xtype: 'Checkbox',
221                                     xns: Roo.form,
222                                     boxLabel : 'In Bank Reconcile',
223                                     fieldLabel : 'Recorded',
224                                     name : 'gltrans_rec',
225                                     width : 200
226                                 },
227                                 {
228                                     xtype: 'TextField',
229                                     xns: Roo.form,
230                                     fieldLabel : 'Created By',
231                                     height : 100,
232                                     name : 'gltrans_username',
233                                     width : 200
234                                 },
235                                 {
236                                     xtype: 'Checkbox',
237                                     xns: Roo.form,
238                                     fieldLabel : 'Deleted',
239                                     name : 'gltrans_deleted',
240                                     width : 75
241                                 }
242                             ]
243                         }
244                     ]
245                 }
246             ],
247             center : {
248                 xtype: 'LayoutRegion',
249                 xns: Roo
250             },
251             buttons : [
252                 {
253                     xtype: 'Button',
254                     xns: Roo,
255                     listeners : {
256                         click : function (_self, e)
257                         {
258                             _this.dialog.hide();
259                         }
260                     },
261                     text : "Cancel"
262                 },
263                 {
264                     xtype: 'Button',
265                     xns: Roo,
266                     listeners : {
267                         click : function (_self, e)
268                         {
269                             // do some checks?
270                              
271                             
272                             _this.dialog.el.mask("Saving");
273                             _this.form.doAction("submit");
274                         
275                         }
276                     },
277                     text : "Save"
278                 }
279             ]
280         });
281     }
282 };