1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.XtupleDiscountOfInvoice = {
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('discount').focus();
43 title : "% Discount to Offer",
47 xtype: 'ContentPanel',
55 rendered : function (form)
67 allowNegative : false,
69 fieldLabel : '% Discount to Offer.',
84 xtype: 'LayoutRegion',
92 click : function (_self, e)
104 click : function (_self, e)
106 var data = _this.form.getFieldValues();
108 if (data.invchead_id * 1 < 1) {
109 Roo.MessageBox.alert("Error", "Missing invchead_id");
113 if(data.discount > 100){
114 Roo.MessageBox.alert("Error", "Maximum of discount value is 100");
118 var discount = 100 - data.discount;
121 template: 'Shipping-Invoice-' + baseURL.split('/').pop().split('.').shift(),
122 filename : 'Shipping-Invoice-' + data.invchead_id,
123 'param[0]': "invchead_id:integer='" + data.invchead_id + "'",
124 'param[1]': "discount:integer='" + discount + "'"
128 url : baseURL + '/Xtuple/Print',
131 success : function() {