Sunday, 22 October 2017

FUSION HCM : FAST FORMULAS IN ABSENCE MANAGEMENT -1

Fast Formulas in Absence Management:
The three categories for Absence Management fast formula types are:
Fast Formulas used by accrual absence plans
Fast Formulas used by qualification absence plans
Fast Formulas used by absence types

Fast Formulas used by absence types :
To define special rules for when a user records an absence entry, use the following formula types:
    1. Global Absence Entry Validation
    2. Global Absence Type Duration.
1. Global Absence Entry Validation :
The Global Absence Entry Validation fast formula can be used in cases where a custom data validation or business rule validation needs to be performed when an absence entry is being made.
For example, an organization might have a rule that allows an Worker to record an absence entry of type Maternity Leave – Unpaid, only in sequence with a regular Maternity Leave absence entry. In such a case, a validation formula can be composed which looks at the Workers absence history to identify if there is a Maternity Leave that is ending on the day just before the absence entry being made of Maternity Leave - Unpaid.
     
Below Formula:
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_DATA_VALUE for ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR is 0
DEFAULT FOR ANC_ABS_ENTRS_ABSENCE_TYPE_ID is 0
DEFAULT FOR ANC_ABS_ENTRS_ABSENCE_STATUS_CD IS ' '
DEFAULT FOR ANC_ABS_TYP_NAME IS ' '
DEFAULT FOR ANC_ABS_ENTRS_END_DATE IS '4712/12/31 00:00:00' (date)

INPUTS ARE IV_END_DATE (date), IV_START_DATE (date)

lc_sickness_unpaid_name = 'Sickness - Unpaid'
ld_start_date = TO_DATE('1951-01-01','yyyy-MM-dd')
ld_sickness_end_date = TO_DATE('4712-12-31','yyyy-MM-dd')

i=1

CHANGE_CONTEXTS(START_DATE=ld_start_date, END_DATE=IV_END_DATE)
(
 WHILE ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR.exists(i)
 LOOP  
 (
 CHANGE_CONTEXTS (ABSENCE_ENTRY_ID = ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR[i])
 (
  CHANGE_CONTEXTS (ABSENCE_TYPE_ID = ANC_ABS_ENTRS_ABSENCE_TYPE_ID)
  (
   IF (lc_sickness_unpaid_name = ANC_ABS_TYP_NAME AND ANC_ABS_ENTRS_ABSENCE_STATUS_CD = 'SUBMITTED')
   THEN
   (
    IF (365 > DAYS_BETWEEN(TRUNC(IV_START_DATE), ANC_ABS_ENTRS_END_DATE) + 1)
    THEN
    (
     VALID = 'N'
     ERROR_MESSAGE = 'ORA_CUSTOM_ERROR_MESSAGE'
     RETURN VALID, ERROR_MESSAGE
    )
   )
  )
 )
 i=i+1
 )
)
VALID = 'Y'
RETURN VALID
  
   2.Global Absence Type Duration :
The Global Absence Type Duration fast formula can be used to over-ride the default calculation logic that the application uses to determine the absence entry duration and accrual plan usage against absence entries.
For example, in an organization when an 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.
   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 .
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


Fast Formulas used by qualification absence plans :

To define special rules for implementing custom dynamic entitlement calculation rules, use the following formula types for qualification plans:
. Global Absence Plan Duration
. Global Absence Band Entitlement
. Global Absence Plan Enrollment Start Date
. Global Absence Plan Entitlement
. Global Absence Plan Roll Backward End
. Global Absence Plan Roll Forward Start
. Global Absence Plan Use Rate
Global Absence Plan Duration:
The Global Absence Plan Duration fast formula can be used to over-ride the default duration calculation logic for daily entitlement duration entries against qualification plans. For example, if the entitlement to be considered against a qualification plan in an organization depends on the location of the Worker, then this formula can be leveraged to specify this dynamic calculation logic. This formula will be invoked once for each day of absence.
Sample Formula
Requirement: The organization has a qualification plan where the entitlement usage is only 50% for Workers who work in an office whose location is in California, whereas the rest of the Workers the entitlement usage is same as the absence duration.
Sol:
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

Global Absence Band Entitlement :
The Global Absence Band Entitlement fast formula can be used to define the bands of entitlement duration and percentage of payment that is applicable against a qualification plan entitlement.
For example, an organization might have a rule that gives Workers in a certain location additional fully paid days of Maternity entitlement when compared to Workers working in any other location.
Sample Formula
Requirement: The organization has an entitlement payment band that is based on the location. Workers belonging to a location that is in California receive an additional 10 days of fully paid entitlement for Maternity Leave
DEFAULT FOR PER_ASG_LOC_REGION2 IS ' XXXXXXXXXX'

IF (PER_ASG_LOC_REGION2 = 'CA')
THEN 
(
BANDPAYFACTOR = 100
BANDENTITLEMENT = 130
)
ELSE
(
BANDPAYFACTOR = 100
BANDENTITLEMENT = 120
)

RETURN BANDPAYFACTOR, BANDENTITLEMENT

Global Absence Plan Enrollment Start Date :
The Global Absence Plan Enrollment Start Date fast formula can be used to specify the Qualification date for the absence plan.
For example, an organization might have a rule for Maternity entitlements according to which the qualification date is on the absence start date if actual dates are entered or if it is not entered, then the qualification date needs to be the event date (actual if available, or else, the planned date). For including such conditional logic to determine the qualification date, formulas of this type can be used.
Sample Formula
Requirement: The organization has a rule for Maternity entitlements according to which the qualification date is on the absence start date if actual dates are entered. If this is not provided, then the qualification date needs to be the event date (actual if available, or else, the planned date).
Solution: A Global Absence Enrollment Start Date formula such as the one below can be used
DEFAULT FOR IV_ACTUALCHILDBIRTHDATE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR IV_ACTUALSTARTDATE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR IV_EXPECTEDCHILDBIRTHDATE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR PER_ASG_REL_ACTUAL_TERMINATION_DATE IS '4712/12/31 00:00:00' (date)

INPUTS ARE IV_ACTUALCHILDBIRTHDATE (date), IV_ACTUALSTARTDATE (date), IV_EXPECTEDCHILDBIRTHDATE (date)

ld_effective_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 12:00:00' (date))

IF (IV_ACTUALSTARTDATE WAS NOT DEFAULTED)
THEN
(
ENROLLMENTSTARTDATE = IV_ACTUALSTARTDATE
)
ELSE
(
IF (IV_ACTUALCHILDBIRTHDATE WAS NOT DEFAULTED)
THEN
(
ENROLLMENTSTARTDATE = IV_ACTUALCHILDBIRTHDATE
)
ELSE
(
ENROLLMENTSTARTDATE = IV_EXPECTEDCHILDBIRTHDATE
)
)

RETURN ENROLLMENTSTARTDATE

Global Absence Plan Entitlement :
The Global Absence Plan Entitlement fast formula can be used to define the entire entitlement structure for a qualification plan for cases where matrix architecture does not fit the bill.
Sample Formula
Requirement: The organization has an entitlement payment band structures that is based on the location that the Worker works out of. Workers belonging to a location that is in California follow a different band structure as compared to Workers in the rest of the country.

DEFAULT FOR PER_ASG_LOC_REGION2 IS ' XXXXXXXXXX'

IF (PER_ASG_LOC_REGION2 = 'CA')
THEN 
(
BAND1PAYFACTOR = 100
BAND1ENTITLEMENT = 50
BAND2PAYFACTOR = 75
BAND2ENTITLEMENT = 50
BAND3PAYFACTOR = 50
BAND3ENTITLEMENT = 50
)
ELSE
(
BAND1PAYFACTOR = 100
BAND1ENTITLEMENT = 40
BAND2PAYFACTOR = 75
BAND2ENTITLEMENT = 40
BAND3PAYFACTOR = 50
BAND3ENTITLEMENT = 40
)

RETURN BAND1PAYFACTOR, BAND1ENTITLEMENT, BAND2PAYFACTOR, BAND2ENTITLEMENT, BAND3PAYFACTOR, BAND3ENTITLEMENT

0 comments:

Post a Comment