Global Absence Type Duration

The Global Absence Type Duration fast formula can be used to override the default calculation logic that the application uses to determine the absence entry duration and accrual plan usage against absence entries.

In an organization when a worker makes an absence entry for an absence type that is measured in Days, there might be a need to have the total duration pro-rated based on the scheduled work hours of the Worker for those days of absence. In such a case, a type duration formula can be composed with the required logic of calculating the pro-rated duration so that it replaces the default duration calculation rules in the application.

The same formula needs to return the required duration when the entry is processed as a single unit (between start date and end date), as well as when processed for each day between the start and end dates.

Configuration Point in HCM Cloud

If you have created this formula, you can attach this formula to the absence type definition. This is currently available only for absence types with UoM as Hours or Days.

Navigation

  1. In the Absence Administration work area, click Absence Types to open the Absence Types page.
  2. On the Search Results section toolbar, click Create to open the Create Absence Type dialog box.
  3. Click Continue.
  4. On the Create Absence Type page Type Attributes tab, General Attributes section, select the defined formula in 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
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_START_DATE Date Start date of absence entry
IV_END_DATE Date End date of absence entry
IV_START_DURATION Number Start date duration of the absence entry. Applicable when absence entry is being recorded against an Elapsed based work schedule
IV_END_DURATION Number End date duration of the 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 absence entry. Applicable when absence entry is being recorded against a Time based work schedule. For elapsed work schedules it will be 00:00.
IV_END_TIME Text End time on the end date for the absence being entered. Applicable when absence entry is being recorded against a Time based work schedule. For elapsed work schedules it will be 23:59.
IV_UOM Text Unit of Measure

Return Variables

Variable Name Data Type Description
DURATION Number Duration of absence entry

Sample Formula

Requirement: The organization requires that for a particular absence type for which partial day absence recording is not allowed, and the duration is measured in Days, the total duration needs to be pro-rated by multiplying with the FTE value of the Worker.

Solution: A Global Absence Type duration formula such as the one below can be used.

FORMULA NAME: ANC_DURCAL

FORMULA TYPE: Global Absence Type Duration Formula

DESCRIPTION: This formula returns the pro-rated duration for absence entries based on FTE

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_FTE_VALUE IS 1

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')

ln_unrounded_duration_d = ln_entry_duration_d * PER_ASG_FTE_VALUE

DURATION = ROUND(ln_unrounded_duration_d,2)

RETURN DURATION