1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.XtupleMiscellaneousCheck = {
10 show : function(data, cb)
18 this.dialog.show(this.data._el);
21 this.form.setValues(data);
22 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
30 this.dialog = Roo.factory({
31 xtype: 'LayoutDialog',
34 show : function (_self)
36 this.layout.getRegion('center').showPanel(0);
44 title : "Create Miscellaneous Check",
48 xtype: 'ContentPanel',
56 actioncomplete : function(_self,action)
58 if (action.type == 'setdata') {
59 if(_this.data.checkhead_id){
60 _this.dialog.el.mask("Loading");
61 this.load({ method: 'GET', params: { '_id' : _this.data.checkhead_id }});
66 if (action.type == 'load') {
67 _this.dialog.el.unmask();
70 if (action.type =='submit') {
72 _this.dialog.el.unmask();
76 _this.callback.call(_this, _this.form.getValues());
82 rendered : function (form)
89 style : 'margin:10px;',
90 url : baseURL + '/Roo/checkhead.php',
96 fieldLabel : 'Customer',
105 fieldLabel : 'Apply To Credit Memo',
106 name : 'cmhead_number',
115 displayField : 'curr_name',
117 emptyText : "Select Currency",
118 fieldLabel : 'Currency',
119 forceSelection : true,
120 hiddenName : 'checkhead_curr_id',
122 loadingText : "Searching...",
124 name : 'checkhead_curr_id_curr_name',
126 qtip : "Select Currency",
127 queryParam : 'query[curr_name]',
128 selectOnFocus : true,
129 tpl : '<div class="x-grid-cell-text x-btn button"><b>{curr_name}</b> </div>',
130 triggerAction : 'all',
132 valueField : 'curr_id',
138 beforeload : function (_self, o){
139 o.params = o.params || {};
145 sortInfo : { direction : 'ASC', field: 'curr_symbol' },
150 url : baseURL + '/Roo/curr_symbol.php'
157 totalProperty : 'total',
158 fields : [{"name":"curr_id","type":"int"},"curr_symbol"]
163 xtype: 'NumberField',
166 allowDecimals : true,
167 decimalPrecision : 2,
168 fieldLabel : 'Amount',
169 name : 'checkhead_amount',
176 displayField : 'bankaccnt_name',
178 emptyText : "Select Bank Accnt",
179 fieldLabel : 'Post to',
180 forceSelection : true,
181 hiddenName : 'checkhead_bankaccnt_id',
183 loadingText : "Searching...",
185 name : 'checkhead_bankaccnt_id_name',
187 qtip : "Select Bank Accnt",
188 queryParam : 'query[bankaccnt_name]',
189 selectOnFocus : true,
190 tpl : '<div class="x-grid-cell-text x-btn button"><b>{bankaccnt_name} - {bankaccnt_descrip}</b> </div>',
191 triggerAction : 'all',
193 valueField : 'bankaccnt_id',
199 beforeload : function (_self, o){
200 o.params = o.params || {};
206 sortInfo : { direction : 'DESC', field: 'bankaccnt_id' },
211 url : baseURL + '/Roo/bankaccnt.php'
218 totalProperty : 'total',
219 fields : [{"name":"bankaccnt_id","type":"int"},"bankaccnt_name"]
229 name : 'checkhead_checkdate',
237 name : 'checkhead_for',
244 fieldLabel : 'Notes',
245 name : 'checkhead_notes',
251 name : 'checkhead_id'
256 name : 'checkhead_recip_id'
261 name : 'checkhead_recip_type'
271 name : 'checkhead_misc'
276 name : '_create_and_post'
281 name : 'remaining_total'
289 xtype: 'LayoutRegion',
297 click : function (_self, e)
308 click : function (_self, e)
313 // _this.dialog.el.mask("Saving");
314 var a = _this.form.findField('checkhead_amount').getValue();
315 var r = _this.form.findField('remaining_total').getValue();
318 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);
319 _this.form.findField('checkhead_amount').setValue(r);
323 _this.form.doAction("submit");