This post was originally published on this site
Managing employee accruals can be complex, especially when employees transition between regular and shift roles within the same year. Understanding how to accurately prorate these accruals is crucial to maintaining accuracy and consistency. Here’s a one such example.
Requirement:
When an employee is in a regular role, accruals are determined based on a seniority lookup table. For shift workers, however, the accrual balance is reset to zero.
When an employee transitions between regular and shift roles within a year, the accruals need to be prorated and recalculated accordingly.
For rounding purposes, amounts should be rounded to the nearest 0.5. For example, any amount between 0.01 and 0.50 should be rounded up to 0.5, while amounts between 0.51 and 1.0 should be rounded up to 1.0.
Solution:
We need a custom field on job info to store annual leave entitlement based on whether employee is regular or shift employee. This field will be automatically updated whenever job information is saved.Accrual Rule– Function to be used in rule-‘Calculate Average Value For Numeric Job Info Field()’ –This rule function calculates the average value of any numeric job information field based on months (that takes care of number of transfers employee might have had during a year). You can prorate