I wish to add 3 field (Basic & DA & Gen Allowance) values in field CTC.
I have written client script for that but it applies when I do the changes in the Basic field ONLY, when I do the changes in the other two fields DA and Gen Allowance, changes are not reflected in the CTC field.
Client SCript is below:
frappe.ui.form.on(“Employee”, {
custom_basic: function(frm,cdt,cdn) {
var d = locals[cdt][cdn];
frappe.model.set_value(cdt, cdn, ‘ctc’, (d.custom_basic + d.custom_da + d.custom_general_allowance));
}
});