Hi, i would like to know is it possible to add the Salary Component with date counting condition?
Like the employee date of joining is 1 Jan 2023, and the condition will be effective after 30 days when he joined. Thanks.
Hi,
Yes it is possible. You can use the condition box to define your condition in the salary componet.
Condition will be like below :
date_of_joining > 30
Note: Please check the actual field name of date of joining in employee master, as I didn’t check that.
Thanks,
Divyesh Mangroliya
Thanks Mangroliya, will have a try on it
Mangroliya,
there is error on the code Error: ‘>’ not supported between instances of ‘datetime.date’ and ‘int’
is it need to build the python code to change the date format?
Hi,
Please use like this:
frappe.datetime.get_day_diff(posting_date,joining_date) > 30
Thanks,
Divyesh Mangroliya
Dear Mangroliya,
Thanks again for your reply. For your code mentioned, is it I need to put it in Client Script rather than in Salary Component condition and formula section?
Hi,
You need to put it in the condition section of the salary componet.
Salary componet is only get calculated if the condition is true.
Thanks,
Divyesh Mangroliya