@Jitendra_Rathod I need one last modification to this script …
the script calculation trigger whenever i update gst field which is the way i wanted. but i need the scrip to recalculate the values when the amount field updated.
there was issues to set script for the amount field as it is read only field and not input field. anyway i modify the script a bit and its working for my current situation sharing the script as it might helpful for the community.
frappe.ui.form.on('Quotation Item', {
gst:function(frm,cdt,cdn){
var d = locals[cdt][cdn];
var gst_amount = (flt(d.qty) * flt(d.rate)) * flt(d.gst) / 100 ;
frappe.model.set_value(cdt, cdn, "gst_amount", gst_amount);
var total = (flt(d.qty) * flt(d.rate)) + flt (d.gst_amount);
frappe.model.set_value(cdt, cdn, 'total_amount', total);
},
qty:function(frm,cdt,cdn){
var d = locals[cdt][cdn];
var gst_amount = (flt(d.qty) * flt(d.rate)) * flt(d.gst) / 100 ;
frappe.model.set_value(cdt, cdn, "gst_amount", gst_amount);
var total = (flt(d.qty) * flt(d.rate)) + flt (d.gst_amount);
frappe.model.set_value(cdt, cdn, 'total_amount', total);
},
rate:function(frm,cdt,cdn){
var d = locals[cdt][cdn];
var gst_amount = (flt(d.qty) * flt(d.rate)) * flt(d.gst) / 100 ;
frappe.model.set_value(cdt, cdn, "gst_amount", gst_amount);
var total = (flt(d.qty) * flt(d.rate)) + flt (d.gst_amount);
frappe.model.set_value(cdt, cdn, 'total_amount', total);
}
})