JavaScript on load calculation qty price discount total
var ctrlPrice = Runner.getControl(pageid, 'Price');
var ctrlQty = Runner.getControl(pageid, 'Qty');
var ctrlDiscount = Runner.getControl(pageid, 'Discount');
var ctrlTotal = Runner.getControl(pageid, 'Total');
function func() {
ctrlTotal.setValue(( parseFloat(ctrlPrice.getValue()) * parseFloat(ctrlQty.getValue())) - (( parseFloat(ctrlPrice.getValue()) * parseFloat(ctrlQty.getValue())) * (parseFloat(ctrlDiscount.getValue()/100.0))) );
//ctrlTotal.setValue(ctrlDiscount.getValue());
};
ctrlPrice.on('keyup', func);
ctrlQty.on('keyup', func);
ctrlDiscount.on('keyup', func);
Here Before record added
$values["Total"] = ($values["Price"] * $values["Qty"]) - (($values["Discount"]/100)*($values["Price"] * $values["Qty"]));
0 comments:
Post a Comment