1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.XtupleCreditMemoNew = {
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.form.findField('cmhead_cust_id').focus();
43 title : "Create new Credit Memo",
47 xtype: 'ContentPanel',
55 rendered : function (form)
65 add : function (combo)
68 Pman.Dialog.XtupleCustomer.show( { id : 0 } , function(res) {
71 _this.form.findField('cmhed_cust_id_cust_name').setValue(res.cust_id);
72 _this.form.findField('cmhed_cust_id_cust_name').el.dom.value = res.cust_name;
79 displayField : 'cust_name',
81 fieldLabel : 'Select Customer',
82 forceSelection : true,
83 hiddenName : 'cmhead_cust_id',
85 loadingText : "Searching...",
87 name : 'cmhead_cust_id_cust_name',
89 qtip : "Select custinfo",
90 queryParam : 'query[cust_name]',
92 tpl : '<div class="x-grid-cell-text x-btn button">{cust_number}: <b>{cust_name}</b> </div>',
93 triggerAction : 'all',
95 valueField : 'cust_id',
101 beforeload : function (_self, o){
102 o.params = o.params || {};
104 // o.params._with_last_location = 1;
108 sortInfo : { direction : 'ASC', field: 'cust_name' },
113 url : baseURL + '/Roo/custinfo.php'
120 totalProperty : 'total',
121 fields : [{"name":"cust_id","type":"int"},"cust_name"]
131 xtype: 'LayoutRegion',
139 click : function (_self, e)
151 click : function (_self, e)
153 //_this.findField('cuinfo_
155 // check if customer is filled in.
156 if (_this.form.findField('cmhead_cust_id').getValue() < 1) {
157 Roo.MessageBox.alert("Error", "Select a customer");
161 var data = _this.form.getFieldValues();
162 var c = _this.form.findField('cmhead_cust_id').lastData;
164 data.cmhead_curr_id = c.cust_curr_id;
165 data.cmhead_curr_id_curr_name = c.cust_curr_id_curr_name;
167 data.cmhead_terms_id = c.cust_terms_id;
168 data.cmhead_terms_id_terms_descrip = c.cust_terms_id_terms_descrip;
170 // fill in staff in/c..
172 data.cmhead_salesrep_id = Pman.Login.authUser.salesrep.salesrep_id;
173 data.cmhead_salesrep_id_salesrep_name = Pman.Login.authUser.salesrep.salesrep_name;
175 data.cmhead_docdate = new Date();
177 data.cmhead_taxzone_id = c.cust_taxzone_id;
178 data.cmhead_taxzone_id_taxzone_descrip = c.cust_taxzone_id_taxzone_descrip;
179 data.cmhead_location_id = c.default_location_id,
180 data.cmhead_location_id_location_name = c.default_location_name;
182 Pman.Dialog.XtupleCreditMemo.show(data, function() {