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                                     items : [
87                                         {
88                                             xtype: 'TextField',
89                                             xns: Roo.form,
90                                             fieldLabel : 'Sequence',
91                                             name : 'gltrans_sequence',
92                                             width : 150
93                                         },
94                                         {
95                                             xtype: 'TextField',
96                                             xns: Roo.form,
97                                             fieldLabel : 'Journal No.',
98                                             name : 'gltrans_journalnumber',
99                                             width : 75
100                                         }
101                                     ]
102                                 },
103                                 {
104                                     xtype: 'Row',
105                                     xns: Roo.form,
106                                     labelAlign : 'right',
107                                     items : [
108                                         {
109                                             xtype: 'DateField',
110                                             xns: Roo.form,
111                                             fieldLabel : 'Date',
112                                             format : 'd/M/Y',
113                                             name : 'gltrans_date',
114                                             useIso : true,
115                                             width : 100
116                                         },
117                                         {
118                                             xtype: 'TextField',
119                                             xns: Roo.form,
120                                             fieldLabel : 'Entered',
121                                             name : 'gltrans_entered',
122                                             width : 150
123                                         }
124                                     ]
125                                 },
126                                 {
127                                     xtype: 'Row',
128                                     xns: Roo.form,
129                                     items : [
130                                         {
131                                             xtype: 'Checkbox',
132                                             xns: Roo.form,
133                                             boxLabel : 'Posted',
134                                             fieldLabel : 'Status',
135                                             name : 'Posted',
136                                             width : 75
137                                         },
138                                         {
139                                             xtype: 'Row',
140                                             xns: Roo.form,
141                                             hideLabels : true,
142                                             items : [
143                                                 {
144                                                     xtype: 'Checkbox',
145                                                     xns: Roo.form,
146                                                     boxLabel : 'Recorded in Bank Reconcile',
147                                                     fieldLabel : '&nbsp;',
148                                                     name : 'gltrans_rec',
149                                                     width : 200
150                                                 },
151                                                 {
152                                                     xtype: 'Checkbox',
153                                                     xns: Roo.form,
154                                                     boxLabel : 'Deleted',
155                                                     fieldLabel : 'Deleted',
156                                                     name : 'gltrans_deleted',
157                                                     width : 75
158                                                 }
159                                             ]
160                                         }
161                                     ]
162                                 },
163                                 {
164                                     xtype: 'DateField',
165                                     xns: Roo.form,
166                                     fieldLabel : 'Date',
167                                     format : 'd/M/Y',
168                                     name : 'gltrans_date',
169                                     useIso : true,
170                                     width : 100
171                                 },
172                                 {
173                                     xtype: 'TextField',
174                                     xns: Roo.form,
175                                     fieldLabel : 'Gltrans source',
176                                     name : 'Source',
177                                     width : 100
178                                 },
179                                 {
180                                     xtype: 'TextField',
181                                     xns: Roo.form,
182                                     fieldLabel : 'Doc No.',
183                                     name : 'gltrans_docnumber',
184                                     width : 200
185                                 },
186                                 {
187                                     xtype: 'TextField',
188                                     xns: Roo.form,
189                                     fieldLabel : 'References',
190                                     name : 'gltrans_misc_id',
191                                     width : 75
192                                 },
193                                 {
194                                     xtype: 'TextField',
195                                     xns: Roo.form,
196                                     fieldLabel : 'Doc Type',
197                                     name : 'gltrans_doctype',
198                                     width : 100
199                                 },
200                                 {
201                                     xtype: 'Checkbox',
202                                     xns: Roo.form,
203                                     boxLabel : 'In Bank Reconcile',
204                                     fieldLabel : 'Recorded',
205                                     name : 'gltrans_rec',
206                                     width : 200
207                                 },
208                                 {
209                                     xtype: 'TextField',
210                                     xns: Roo.form,
211                                     fieldLabel : 'Created By',
212                                     height : 100,
213                                     name : 'gltrans_username',
214                                     width : 200
215                                 },
216                                 {
217                                     xtype: 'Checkbox',
218                                     xns: Roo.form,
219                                     fieldLabel : 'Deleted',
220                                     name : 'gltrans_deleted',
221                                     width : 75
222                                 }
223                             ]
224                         }
225                     ]
226                 }
227             ],
228             center : {
229                 xtype: 'LayoutRegion',
230                 xns: Roo
231             },
232             buttons : [
233                 {
234                     xtype: 'Button',
235                     xns: Roo,
236                     listeners : {
237                         click : function (_self, e)
238                         {
239                             _this.dialog.hide();
240                         }
241                     },
242                     text : "Cancel"
243                 },
244                 {
245                     xtype: 'Button',
246                     xns: Roo,
247                     listeners : {
248                         click : function (_self, e)
249                         {
250                             // do some checks?
251                              
252                             
253                             _this.dialog.el.mask("Saving");
254                             _this.form.doAction("submit");
255                         
256                         }
257                     },
258                     text : "Save"
259                 }
260             ]
261         });
262     }
263 };