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: 'TextField',
166                                     xns: Roo.form,
167                                     fieldLabel : 'Gltrans source',
168                                     name : 'Source',
169                                     width : 100
170                                 },
171                                 {
172                                     xtype: 'TextField',
173                                     xns: Roo.form,
174                                     fieldLabel : 'Doc No.',
175                                     name : 'gltrans_docnumber',
176                                     width : 200
177                                 },
178                                 {
179                                     xtype: 'TextField',
180                                     xns: Roo.form,
181                                     fieldLabel : 'References',
182                                     name : 'gltrans_misc_id',
183                                     width : 75
184                                 },
185                                 {
186                                     xtype: 'TextField',
187                                     xns: Roo.form,
188                                     fieldLabel : 'Doc Type',
189                                     name : 'gltrans_doctype',
190                                     width : 100
191                                 },
192                                 {
193                                     xtype: 'Checkbox',
194                                     xns: Roo.form,
195                                     boxLabel : 'In Bank Reconcile',
196                                     fieldLabel : 'Recorded',
197                                     name : 'gltrans_rec',
198                                     width : 200
199                                 },
200                                 {
201                                     xtype: 'TextField',
202                                     xns: Roo.form,
203                                     fieldLabel : 'Created By',
204                                     height : 100,
205                                     name : 'gltrans_username',
206                                     width : 200
207                                 },
208                                 {
209                                     xtype: 'Checkbox',
210                                     xns: Roo.form,
211                                     fieldLabel : 'Deleted',
212                                     name : 'gltrans_deleted',
213                                     width : 75
214                                 }
215                             ]
216                         }
217                     ]
218                 }
219             ],
220             center : {
221                 xtype: 'LayoutRegion',
222                 xns: Roo
223             },
224             buttons : [
225                 {
226                     xtype: 'Button',
227                     xns: Roo,
228                     listeners : {
229                         click : function (_self, e)
230                         {
231                             _this.dialog.hide();
232                         }
233                     },
234                     text : "Cancel"
235                 },
236                 {
237                     xtype: 'Button',
238                     xns: Roo,
239                     listeners : {
240                         click : function (_self, e)
241                         {
242                             // do some checks?
243                              
244                             
245                             _this.dialog.el.mask("Saving");
246                             _this.form.doAction("submit");
247                         
248                         }
249                     },
250                     text : "Save"
251                 }
252             ]
253         });
254     }
255 };