Hi all. I want to calculate provident fund in a salary structure. i am able to do it in salary slip but for CTC i want it in salary structure too.
i have added one custom script but it is not working.
frappe.ui.form.on(“Salary Detail”,“refresh”, function(frm, cdt, cdn) {
var d =locals[cdt][cdn];
var item=frappe.get_doc(cdt,cdn);
if(d.component == “Provident Fund”){
frappe.model.set_value(cdt, cdn, “ctc_deductions”, gross_pay*12/100);
//console.log(“hi”);
}
});
i have added the total of earnings as gross pay in parent field and i want provident fund calculated value ctc deductions. please help