Global Absence Plan Duration

The Global Absence Plan Duration fast formula is used to override the default duration calculation logic for daily accrual duration entries against accrual plans. For example, if the accrual deduction to be considered for an absence entry in an accrual plan of an organization depends on the location of the worker, then this formula can be leveraged to specify this dynamic calculation logic. This formula is invoked once for each day of absence. If there are multiple shifts in a day, then the formula is invoked once for each shift. If the shift spans over a day divide, then the shift is split into two and the formula is invoked once for each shift block.

Configuration Point in HCM Cloud

If you have created this formula, you can attach this formula to the absence plan definition.

Navigation

  1. In the Absence Administration work area, click Absence Plans to open the Absence Plans page.
  2. On the Search Results section toolbar, click Create to open the Create Absence Plan dialog box.
  3. In the Plan Type field, select Accrual.
  4. Click Continue.
  5. On the Edit Absence Plan page Plan Attributes tab General Attributes section, select the defined formula from the Conversion Formula field.

Contexts

The following contexts are available in this formula type:

Context Name Data Type
ABSENCE_ENTRY_ID Number
ABSENCE_TYPE_ID Number
ACCRUAL_PLAN_ID Number
DATE_EARNED Date
EFFECTIVE_DATE Date
END_DATE Date
ENTERPRISE_ID Number
HR_ASSIGNMENT_ID Number
HR_RELATIONSHIP_ID Number
HR_TERM_ID Number
JOB_ID Number
LEGAL_EMPLOYER_ID Number
LEGISLATIVE_DATA_GROUP_ID Number
ORGANIZATION_ID Number
PAYROLL_ASSIGNMENT_ID Number
PAYROLL_ID Number
PAYROLL_RELATIONSHIP_ID Number
PAYROLL_TERM_ID Number
PERSON_ID Number
START_DATE Date

Input Values

Variable Name Data Type Description
IV_ABS_START_DATE Date Start date: time of absence entry
IV_ABS_END_DATE Date End date: time of absence entry
IV_ABS_START_DURATION Number Start date duration of absence entry. Applicable when absence entry is being recorded against an Elapsed based work schedule
IV_ABS_END_DURATION Number End date duration of absence entry. Applicable when absence entry is being recorded against an Elapsed based work schedule
IV_START_DATE Date Start date of shift block within absence
IV_END_DATE Date End date of shift block within absence
IV_START_DURATION Number Start date duration of the shift block within absence entry. Applicable when absence entry is being recorded against an Elapsed based work schedule
IV_END_DURATION Number End date duration of the shift block within absence entry. Applicable when absence entry is being recorded against an Elapsed based work schedule
IV_START_TIME Text Start time on the start date of the shift block within absence entry. Applicable when absence entry is being recorded against a Time based work schedule. For elapsed work schedules it will be 00:00. If there are no shifts on the day being processed, then absence start time or 00:00 is passed, whichever is greater.
IV_END_TIME Text End time on the start date of the shift block within absence entry. Applicable when absence entry is being recorded against a Time based work schedule. For elapsed work schedules it will be 00:00. If there are no shifts on the day being processed, then absence end time or 00:00 is passed, whichever is greater.
IV_UOM Text Unit of measure

Return Variables

Variable Name Data Type Description
Duration Number Duration of plan entries

Sample Formula

Requirement: The organization has an accrual plan where the accrual usage is only 50% for workers who work in an office whose location is in California, whereas the rest of the workers the accrual usage is same as the absence duration.

Solution: A Global Absence Plan Duration formula such as the one below can be used.

FORMULA NAME: ANC_PLN_DUR

FORMULA TYPE: Global Absence Plan Duration

DESCRIPTION: This formula evaluates the entitlement usage based on worker location

DEFAULT FOR IV_START_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR IV_END_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR IV_START_TIME IS '00:00'
DEFAULT FOR IV_END_TIME IS '23:59'
DEFAULT FOR PER_ASG_LOC_REGION2 IS ' XXXXXXXXXX'
INPUTS ARE IV_START_DATE (date), IV_END_DATE (date), IV_START_TIME(text),IV_END_TIME(text)

ln_entry_duration_d = 0
ln_unrounded_duration_d = 0

ld_period_start_date = to_date(to_char(IV_START_DATE,'DD/MM/RRRR')||' '||IV_START_TIME,'DD/MM/RRRR HH24:MI:SS')
ld_period_end_date = to_date(to_char(IV_END_DATE,'DD/MM/RRRR')||' '||IV_END_TIME,'DD/MM/RRRR HH24:MI:SS')

ln_entry_duration_d = GET_PAY_AVAILABILITY ('ASSIGN',
    ld_period_start_date,
    ld_period_end_date,
    'Y',
    'Y',
    'Y',
    'Y',
    'D')

IF (PER_ASG_LOC_REGION2 = 'CA')
THEN 
(
   ln_entry_duration_d = ln_entry_duration_d * 0.5
)
DURATION = ROUND(ln_entry_duration_d,2)
RETURN DURATION