1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.XtupleProdcat = {
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',
38 title : "Edit / Create Product Category",
42 xtype: 'ContentPanel',
50 actioncomplete : function(_self,action)
52 if (action.type == 'setdata') {
53 if(_this.data.prodcat_id){
54 _this.dialog.el.mask("Loading");
55 this.load({ method: 'GET', params: { '_id' : _this.data.prodcat_id, '_with_salesaccnt' : 1 }});
58 _this.form.findField('salesaccnt_sales_accnt_id_descrip').setValue('');
59 _this.form.findField('salesaccnt_credit_accnt_id_descrip').setValue('');
60 _this.form.findField('salesaccnt_cos_accnt_id_descrip').setValue('');
63 if (action.type == 'load') {
64 _this.dialog.el.unmask();
67 if (action.type =='submit') {
69 _this.dialog.el.unmask();
73 _this.callback.call(_this, _this.form.getValues());
79 rendered : function (form)
86 style : 'margin:10px;',
87 url : baseURL + '/Roo/Prodcat.php',
92 legend : "Product Category Detail",
93 style : 'width:380px',
99 fieldLabel : 'Category Code',
100 name : 'prodcat_code',
107 fieldLabel : 'Category Description',
108 name : 'prodcat_descrip',
116 legend : "Account Setting",
117 style : 'width:380px',
128 beforeselect : function (combo, record, index)
130 _this.form.findField('salesaccnt_sales_accnt_id_descrip').setValue(record.data.accnt_descrip);
134 displayField : 'accnt_name',
136 emptyText : "Select Account",
137 fieldLabel : 'Inventory Sales Account',
138 forceSelection : true,
139 hiddenName : 'salesaccnt_sales_accnt_id',
141 loadingText : "Searching...",
143 name : 'salesaccnt_sales_accnt_id_name',
145 qtip : "Select Account",
146 queryParam : 'search[name]',
147 selectOnFocus : true,
148 tpl : '<div class="x-grid-cell-text x-btn button"><b>{accnt_name} ( {accnt_descrip} )</b> </div>',
149 triggerAction : 'all',
151 valueField : 'accnt_id',
157 beforeload : function (_self, o){
158 o.params = o.params || {};
160 o.params.accnt_active = 1;
161 o.params.accnt_type = 'R';
165 sortInfo : { direction : 'ASC', field: 'accnt_id' },
170 url : baseURL + '/Roo/accnt.php'
177 totalProperty : 'total',
178 fields : [{"name":"accnt_id","type":"int"},{"name":"accnt_descrip","type":"string"}]
189 style : 'margin-left:155px;',
192 xtype: 'DisplayField',
194 name : 'salesaccnt_sales_accnt_id_descrip',
208 beforeselect : function (combo, record, index)
210 _this.form.findField('salesaccnt_credit_accnt_id_descrip').setValue(record.data.accnt_descrip);
214 displayField : 'accnt_name',
216 emptyText : "Select Account",
217 fieldLabel : 'Credit Memo Account',
218 forceSelection : true,
219 hiddenName : 'salesaccnt_credit_accnt_id',
221 loadingText : "Searching...",
223 name : 'salesaccnt_credit_accnt_id_name',
225 qtip : "Select Account",
226 queryParam : 'search[name]',
227 selectOnFocus : true,
228 tpl : '<div class="x-grid-cell-text x-btn button"><b>{accnt_name} ( {accnt_descrip} )</b> </div>',
229 triggerAction : 'all',
231 valueField : 'accnt_id',
237 beforeload : function (_self, o){
238 o.params = o.params || {};
240 o.params.accnt_active = 1;
241 o.params.accnt_type = 'R';
245 sortInfo : { direction : 'ASC', field: 'accnt_id' },
250 url : baseURL + '/Roo/accnt.php'
257 totalProperty : 'total',
258 fields : [{"name":"accnt_id","type":"int"},{"name":"accnt_descrip","type":"string"}]
269 style : 'margin-left:155px;',
272 xtype: 'DisplayField',
274 name : 'salesaccnt_credit_accnt_id_descrip',
288 beforeselect : function (combo, record, index)
290 _this.form.findField('salesaccnt_cos_accnt_id_descrip').setValue(record.data.accnt_descrip);
294 displayField : 'accnt_name',
296 emptyText : "Select Account",
297 fieldLabel : 'Cost of Sales Account',
298 forceSelection : true,
299 hiddenName : 'salesaccnt_cos_accnt_id',
301 loadingText : "Searching...",
303 name : 'salesaccnt_cos_accnt_id_name',
305 qtip : "Select Account",
306 queryParam : 'search[name]',
307 selectOnFocus : true,
308 tpl : '<div class="x-grid-cell-text x-btn button"><b>{accnt_name} ( {accnt_descrip} )</b> </div>',
309 triggerAction : 'all',
311 valueField : 'accnt_id',
317 beforeload : function (_self, o){
318 o.params = o.params || {};
320 o.params.accnt_active = 1;
321 o.params.accnt_type = 'E';
325 sortInfo : { direction : 'ASC', field: 'accnt_id' },
330 url : baseURL + '/Roo/accnt.php'
337 totalProperty : 'total',
338 fields : [{"name":"accnt_id","type":"int"},{"name":"accnt_descrip","type":"string"}]
349 style : 'margin-left:155px;',
352 xtype: 'DisplayField',
354 name : 'salesaccnt_cos_accnt_id_descrip',
369 name : 'salesaccnt_id'
377 xtype: 'LayoutRegion',
385 click : function (_self, e)
396 click : function (_self, e)
401 // _this.dialog.el.mask("Saving");
402 _this.form.doAction("submit");