Hello Everyone,
We have seen this requirement in most of the cases where business allow users to carry over specific number of leaves to the next year and employees can use those leaves only in first 3 months or maybe first 6 months.
There are multiple ways how this can be done using Interim rule or Business Rules but today I am going to show you the process which will take care of carrying balance over to next year automatically at the end of current year and will restrict users to take these leaves only for First 3 months in next year. All this will happen using custom Integration and no need to run Interim rules or rely on any another business rule.
Here is my business case
- Time Type – Annual Leave (Singapore)
- No of Leaves which can be carried over next year – Max up to 10 Days
- Leaves to be utilized next year before – 31st Mar of next year
Step 1 – Create Custom field on Time Account “Balance as of PEP” where we can store the balance which needs to be carried over to next year
Step 2 – Create Time Account Type “Annual Leave” which will be regular Time Account Type assigned to Leave and it will Post leaves on year to year basis.
Step 3 – Create Time Account Type “Annual Leave (Carried Over)” which will be created using Integration Center and account created using this rule will be only active for first 3 months of the year.
Step 4 – Create Time Type “Annual Leave” For Singapore and attach both the “Time Account Type” which will allow us to carry over balance on same “Time Type.”
Step 5 – Lets create Integration which will carry over Balance from Last year’s Time Account to next year’s Time Account.
Mapping can be done as below
Current Year Time Account (Left Side) | Future Year Time Account (Right Side) | Mapping Type | Comments |
External Code | Calculated Field | Use any logic to create custom external code for Time Account. I have used logic as “Employee Number + Bookable End Date From last year” | |
Closed | Default Value | False | |
Time Account Type | Default Value |
SGP_ANNUAL_LEAVE_CO This can be different for each country and then we can use calculated field in that case |
|
Booking Possible Until | Booking Possible Until | Calculated Field | Booking Possible Until + 3 Months |
Booking Possible Until | Booking Possible From | Calculated Field | Booking Possible Until + 1 day |
Booking Possible Until | Account Valid Until | Calculated Field | Booking Possible Until + 3 Months |
Booking Possible Until | Account Valid From | Calculated Field | Booking Possible Until + 1 day |
User | User | Direct Mapping | |
Time Account_External Code | Calculated Field | Use any logic to create custom external code for Time Account. I have used logic as “Employee Number + Bookable End Date From last year” | |
External Code | Calculated Field | Use any logic to create custom external code for Time Account. I have used logic as “Employee Number + Bookable End Date From last year” | |
Balance as of PEP | Amount Posted | Direct Mapping | |
Booking Possible Until | Posting Date | Calculated Field | Booking Possible Until + 1 day |
Posting Type | Default Value | MANUAL_ADJUSTMENT | |
Posting Unit | Default Value | DAYS | |
Comment | Default Value | Carried over Balance From Last Year |
Step 6 – Time to Test Solution
Step 6.1 – Assign Time Profile to any Singapore Employee to see if the correct Leaves are assigned are not
Step 6.2 – Run Period End Processing manually to Check status of Time Account
Step 6.3 – Running Integration Manually for Test Purpose
Hope this solution will help you to achieve your specific requirement
Benefits of using above solution
- Complete Automated Process
- No complex business rule
- Logic can be made very flexible for each Country and each Time Type
- Validity period can be easily customized for each Time Type and Country
Thank you for taking time and going through my blog!