Each accrual plan needs to be associated with two formulas: an accrual formula to calculate gross PTO entitlement to date and a Carry Over formula to be called by the carry over process at the end of the accrual term.
You can also associate a third formula to be called by BEE (Batch Element Entry) validation for entries to the absence element associated with the accrual plan. This Ineligibility formula checks whether an assignment is eligible to use accrued PTO. It must calculate the end of the ineligibility period in the same way as the Accrual formula for the plan. This formula is not required if you enter the ineligibility period for a plan in the Accrual Plan window.
Some formulas are seeded, see Seeded Accrual Type Formulas. You can use these as supplied, edit them, or write your own formulas to provide the plan rules you require.
This topic explains:
The formula types for formulas associated with accrual plans
The required inputs and outputs for Accrual, Carry Over, and Ineligibility formulas
Checks you must include in your Accrual formulas to avoid errors
For a sample Accrual formula and suggestions on how to change it to incorporate a whole range of plan rules, see: Sample Accrual Formula.
There are a number of formula types for formulas associated with accrual plans. You must define your formulas as the appropriate types or they will not be available for selection in the Accrual Plan window.
| Formula Type | Displays on list of values for . . . | Use for . . . |
|---|---|---|
| Accrual | Accrual Formula field | The top level formula that calculates PTO entitlement for a plan |
| Accrual Subformula | -- | Any formulas called by the top level formula, such as formulas for calculating the entitlement per period. |
| Accrual Carryover | Carryover Formula field | The formula to be called by the Carry Over process. |
| Accrual Ineligibility | Ineligibility Formula field | The formula to be called by BEE (if required) to specify whether an assignment is eligible to use accrued PTO. |
If you write your own formulas for accrual plans, you must use the following INPUTS and RETURN statements. Do not add extra lines to these statements. You can use functions or database items to get extra inputs. The following values are available as contexts for all the accrual formula types (and therefore you do not need to retrieve them as inputs or database items):
ASSIGNMENT_ID
DATE_EARNED
ACCRUAL_PLAN_ID
BUSINESS_GROUP_ID
PAYROLL_ID
Some formula functions have been defined specially for Accrual type formulas. They require some or all of these contexts and they return values need for the accrual calculation, such as total absences, accrual band, and period dates. See: Functions for Accrual Type Formulas. You can define and register any other functions you require.
INPUTS ARE
Calculation_Date (date)
ACCRUAL_START_DATE (date)
ACCRUAL_LATEST_BALANCE
/* Formula body */
RETURN total_accrued_pto, effective_start_date, effective_end_date, accrual_end_date
| Input | Description |
|---|---|
| Calculation_Date | The date up to which accrual will be calculated |
| Accrual_Start_Date | The date to begin calculating accrual. If null, accruals are calculated from beginning of the accrual term. |
| Accrual_Latest_ Balance | The latest balance for the accrual term up to the day before Accrual_Start_Date. The latest balance is held in a payroll balance. |
Note: The Accrual_Start_Date and Accrual_Latest_Balance inputs are required only if your accrual plan uses a payroll balance to store gross accruals.
| Output | Description |
|---|---|
| total_accrued_pto | Gross accrued PTO this term |
| effective_start_date | Start date of accrual, which is normally the start of this accrual term, but may be plan enrollment date, hire date, adjusted service date, or other, depending on plan rules. |
| effective_end_date | Normally the calculation date, but should be the termination date if the employee has been terminated, or the end date of the plan element entry if the employee has left the plan. |
| accrual_end_date | This is an optional output. In the seeded formulas it is the end of the last full accrual period before the calculation date (because these formulas do not take account of partial accrual periods). |
INPUTS ARE
calculation_date (date),
accrual_term (text)
/* formula body */
RETURN max_carryover, effective_date, expiry_date, process
| Input | Description |
|---|---|
| calculation_date | Any date falling within an accrual term |
| accrual_term | 'PREVIOUS' or 'CURRENT' indicating whether to return the last date of the accrual term spanning calculation_date, or the accrual term previous to that spanning calculation date. |
| Output | Description |
|---|---|
| max_carryover | Maximum amount the employee can carry over, which may be dependent on an accrual band. |
| effective_date | The last date of an accrual term (either current or previous, as determined by the input). For example, this would be 31-DEC-YYYY for an accrual plan based on calendar years. |
| expiry_date | The date by which employees must use carried over PTO, otherwise they lose it. This output is optional. |
| process | Set to Yes by default. This means that the max_carryover amount is returned. If you set it to No, max_carryover is set to Null by the Carry Over process |
INPUTS ARE
calculation_date (date),
/* formula body */
RETURN assignment_eligible
| Input | Description |
|---|---|
| calculation_date | The effective date of the element entry. |
| Output | Description |
|---|---|
| assignment_eligible | 'Y' or 'N'. If Y, BEE creates the entry to the absence element (assuming all other validation is successful). If N, BEE creates a warning on the batch line for the absence entry. |
You may notice that the seeded formulas contain statements to check a number of dates to see whether an employee is eligible to accrue any PTO. Be sure to include these checks in your formulas too.
Check whether there is a termination date for the assignment. If the termination date is before the calculation date, calculate accrual as of the termination date. If your formula does not handle partial accrual periods, check whether the termination date is before the end of the first accrual period; if yes, set gross accrual to zero.
Check whether there is an end date for the assignment's enrollment in the plan. If the end date is before the calculation date, calculate accrual as of the end date. If your formula does not handle partial accrual periods, check whether the end date is before the end of the first accrual period; if yes, set gross accrual to zero.
If the calculation date is before the end of the first accrual period, set gross accrual to zero (unless your formula handles partial accrual periods).
Check the employee's hire date or continuous service date. If your formula handles partial accrual periods, check that this date is before the calculation date, and if not, set the gross accrual to zero. If your formula does not handle partial periods, check that this date is before the start of the last full accrual period used in the current calculation. If the employee has not worked for a full accrual period before the calculation date, set the gross accrual to zero.
Check when the employee should start to accrue time. This is typically the date of enrollment in the plan or (if your formula does not handle partial accrual periods) the first period starting on or after the date of enrollment in the plan. If this date (or period) is after the calculation date (or period), set the accrual to zero.
Note: The seeded and sample formulas also show how to incorporate other start dates in your plan, such as six months after hire date, or start of calendar year after hire date.
Check any ineligibility period (which is a time when a new participant accrues time but cannot use it, so it does not appear credited to him or her until the end of the period). If the eligibility period is still in force at the calculation date (or, if your formula does not handle partial accrual periods, on the end date of the last accrual period used in the calculation) set the gross accrual to zero.
Check whether the employee's assignment has been active throughout the period for which you are calculating accruals. Depending on your plan rules, your employees might not accrue time when their assignments are inactive, or they might accrue time at a reduced rate. You can use the function GET_ASG_INACTIVE_DAYS to check the assignment status on each day from period start date to period end date and return the number of inactive working days.