How to use Holidays in Formula and Conditions

Hello

Appreciate if someone can give me some pointers.

I managed to use only the formula field in Salary Slip/Salary Component/Salary Structure to calculate each staff’s Basic Wage and Overtime Wage using Timesheet, for every working day, including holidays.

Now, since the pay rate is different for holidays, I’d like to factor in holidays in the formula.

How do I access the holiday list? I only have 1 company Holiday list.

How do I check if the Start date logged in timesheet hits one of the dates in the holiday? How do I use IF, ELSE in formula and condition to achieve this?

I tried to use the solution in other post but it won’t work…

Conditions:
“6/1/2022” in [day.holiday_date for day in doc.get(“holidays”)]

It says “doc” cannot be found.

How do I reference another DocType’s variables from Salary Structure?