###### Product Information

# Time Off in Lieu Or Compensation Leave in Days instead of hours

Time off in Lieu is a common requirement across the globe and we have seen customers requesting this for “hours” as well as “Days”. However, with the SF standard/Direct EC Time solution currently, it is only possible to use this in “hours” using Overtime Base/Premium concept in the Timesheet. The below blog would demonstrate an approach to implement the scenario where the customer wants this in days. This is quite common for Indian customers. To cover this, we would need following

- A time recording profile, with time valuations which records the time worked in public holiday in time collectors.
- Integration Center: to Integrate Time collectors with Accrual calculation base (You can refer to another blog on same)
- A new time account which accrues based on actuals. In the rule, you would convert the hours collected by time collector and accrual calculation base into Days.

Now let’s go into details of each process step

## Time Recording Profile

The below is a sample time recording profile I created to collect recorded times in Holidays

The first valuation is fairly simple. It just collects the recorded time based on time types into a time type group “CLT – Collect Recorded Times”

The second valuation takes the input group as “CLT – Collect Recorded Times” filled from above step.

We then use the valuation type as “Filter Input Groups” and use time record filter for holidays as filter as shown below

The end result is Recorded times for public holidays “CLT – Collect Holiday Times” in time type group below

The third valuation removes any scheduled breaks from holiday times based on work schedule.

The Holiday times without breaks are stored in “CLT – Holiday Worked Times W/O breaks”

Then there is the final fourth evaluation which you might question “Is it really required”?. We could have just used the value from CLT – Holiday Worked Times W/O breaks.

Well to answer this, we are going to use daily collectors and if we just use the result from “CLT – Holiday Worked Times W/O breaks” , the time collector record would get created for each day even though for working days the result is Zero. We are just interested in values > 0. Hence the need for final time valuation

Here comes the final evaluation. Again, pretty straight forward

The most important part of this exercise is the time collector itself. The time type group above “Final Holiday Times” is the time collector and stores only values greater than threshold i.0

## Integration Center

The integration center concept to move the data from time collectors to accrual calculation base is already covered by the blog . I would assume that you would follow this blog and set this up on your own

There are three important things I would like to mention here

- Time collectors store the times in minutes. For example, 480 minutes for 8 Hours. You would need to divide this by 60 to get the actual hours worked
- The filter for your time collector would be the collector name “CLT_HLWT_FINAL”
- Additionally, you need to use last modified date as filter to only read collector records since the last job run( only recently modified records)

## Time Account Setup

The time account can be set up as recurring and accrual frequency as daily. As you are aware from previous steps, the data collected in Accrual Calculation Base from time collector is in hours. In the accrual rule, you would need to get working time for the daily accrual period and convert the hours into days. You can refer to screenshots below

Accrual Rule:

The Time account has accrual based on recorded times and the accrual rule uses a rule function “Get Working time in Hours” to read the accruable day’s work schedule for the given user. The number of hours collected in Accrual calculation based / Working time will give the quantity in days. The accrual for time off in lieu/ Comp Off account would then take place in days

As you can see above, with simple conversions in Integration Center and Business rules, you could accrue the comp off in days.

## Testing

Employee TimeOffInLieu Test1 has recorded 8 hours and 4 hours on public holidays 28^{th}, 30^{th} Respectively

Once the night job runs, all the accrual calculation base which are pending are processed and accruals are generated in days (Obviously assuming you have also scheduled the integration center job to move values from time collector to accrual calculation base)

In total, the employee has worked 12 hours on holidays which constitute 1.5 days as per his work schedule as seen above.

With this, we come to the end of this blog. You can use a similar concept to meet such requirements

Useful, Thanks for sharing solution document with clear explanation.

Thanks for the feedback!

Hi Neelesh,

Thank you for blog on time off in lieu, i'm trying to follow solution , however system is not allowing me to save combinations in time account type with business rule, could you please help me.