I am trying to configure a Salary Component in Frappe HRMS that only applies if an employee has been with the company for more than 60 days.
However, I am consistently hitting evaluation errors when testing this on a Salary Slip. I have tried several variations in the “Condition” field, but each fails for different reasons.
The Logic I Need:
If (Payroll Date - Employee Joining Date) > 60 days, then apply component.
Errors encountered so far:
-
Using
date_diff(payroll_date, employee.date_of_joining) > 60returns: “name ‘date_diff’ is not defined” or “name ‘payroll_date’ is not defined”. -
Using
(payroll_date - employee.date_of_joining).days > 60returns: “‘str’ object has no attribute ‘date_of_joining’”, suggesting theemployeevariable is being treated as a string (ID) rather than a Document object.
Question:
What is the correct, allowlisted syntax to calculate the difference between the Salary Slip date and the Employee’s Joining Date within the Salary Component condition field for this version?
