Sample Body Onload Javascript Phprunner
Before Record added
$values["Total"] = ($values["Price"] * $values["Qty"]) - (($values["Discount"]/100)*($values["Price"] * $values["Qty"]));
// Place event code here.
// Use "Add Action" button to add code snippets.
return true;
Java Script on load
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);
Sample table db
SELECT
id,
ItemCode,
Qty,
Price,
Total,
Discount
FROM sales
0 comments:
Post a Comment