|
|
Applies to versions: 2.0, 2.1, 2.2, 2.3, 2.4
Advanced Modifications and Accruals using Expressions
Accruals and Modifications can be configured to calculate with an expressions for special situations.
Accruals
The accrual expression should return the amount of the accrual in hours.
The following variables are available to the expression when calculating the accrual amount:
- usersID - The ID of the user benefit accruals are being calculated for
- benefitTypeID - The ID of the benefit type being calculated
- begTimestamp - The timestamp of the beginning of the accrual range
- endTimestamp - The timestamp of the end of the accrual range
Example 1:
An accrual policy grants 50 hours a year on Jan 1st each year. And, for employees who where hired between Jan and June, an additional 8 hours is granted on Jul 1st.
- This is a special rule because the amount accrued on Jul 1st is different than on Jan 1st and depends on the hire date of the employee.
- To accommodate this, accruals would be set to run twice a year
- The accrual amount would be set to Expression
- The expression would be
=if(utcdate("m",[begTimestamp])=1,50, /* this gives 50 hours if it is the Jan accrual */ if(substr(employeeInfo([usersID], 'startDate'),6,2)<7,8,0)) /* this looks at the month of the start date and, if it's less than 7 (Jan->Jun) then give 8 hours, otherwise none */
Modifications
The following variables are available to the expression when calculating the modification amount:
- usersID - The ID of the user benefit accruals are being calculated for
- benefitTypeID - The ID of the benefit type being calculated
- begTimestamp - The timestamp of the beginning of the accrual range
- endTimestamp - The timestamp of the end of the accrual range
See Also: Accruals (2.0, 2.1, 2.2, 2.3, 2.4)
Was this article relevant to your question? Yes No |