Unable to use attendance doc custom column in Salary components

I have add a new column in attendance doc type called over_time and i want to refer this in salary component formula as base * (1 if doc.over_time == “1” else 0). while generating payroll i am getting error stating that name ‘over_time’ is not defined. Please suggest a fix

Please help me how to resolve the issue.


You can use the following to get the over_time value from attendance doc type in salary component formula:

base * frappe.db.get_value("Attendance", {'employee': doc.employee}, "over_time")

But you need to also consider how you will determine the period and sum of all overtime during the pay period.


Getting error while generating payslip.

Error while evaluating the Salary Structure Full Time Nursing at row 4.

Error: name ‘frappe’ is not defined