Customer has a requirement where-in they will allow 2 days of Accrual Leave to all eligible employees ( eligibility being checked via a separate Eligibility Fast Formula).
If the employee has joined in the same year in which he/she is trying to apply leave and Hire Month is before the 7th month of the year then he gets balance of 2 leaves for the year
If the employee has joined in the same year in which he/she is trying to apply leave and Hire Month is after the 7th month of the year then he gets balance of 1 leave for the year
If the employee has been serving the company from anytime before this year then he gets balance of 2 leave for the year
VestingUnits
Vesting Units as defined is a numeric value which determines after how much time period (this being measured by VestingUOM will a individual be able to apply leave)
For this example the VestingUnits is 3 while VestingUOM is Months meaning Employee will be capable of applying leave after 3 months, till that period he/she anyhow would keep on accruing the leaves if eligible .
/******************************************************************************
FORMULA NAME: A2F_ANC_ACCRUAL_ExtendedChildCare
FORMULA TYPE: Global Absence Accrual
DESCRIPTION: This formula returns the accrual for employees enrolled in Extended Child Care
Change History:
Name Date Comments
-----------------------------------------------
Ashley Hardy 10-Apr-2015 Initial Version
*******************************************************************************/
DEFAULT FOR PER_ASG_FTE IS 1
DEFAULT FOR PER_REL_ORIGINAL_DATE_OF_HIRE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR PER_REL_ACTUAL_TERMINATION_DATE IS '4712/12/31 00:00:00' (date)
ln_accrual = 0
ld_effective_date=PER_REL_ORIGINAL_DATE_OF_HIRE
ld_emp_term_date =PER_REL_ACTUAL_TERMINATION_DATE
ld_current_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00' (date))
ld_term_start_date = TO_DATE('01-01-'||TO_CHAR(ld_effective_date, 'rrrr'),'dd-mm-rrrr')
ld_term_end_date = TO_DATE('31-12-'||TO_CHAR(ld_effective_date, 'rrrr'),'dd-mm-rrrr')
ld_term_duration = DAYS_BETWEEN (ld_term_end_date, ld_term_start_date)
ld_hire_year = TO_NUMBER(TO_CHAR(ld_effective_date,'rrrr'))
ld_curr_year = TO_NUMBER(TO_CHAR(ld_current_date,'rrrr'))
accrual = 0
IF (ld_curr_year = ld_hire_year)
THEN
(
IF (TO_NUMBER(TO_CHAR(ld_effective_date,'MM')) < 7)
THEN
(
accrual = 2
IF (TO_NUMBER(TO_CHAR(ld_effective_date,'MM')) >= 7 AND TO_NUMBER(TO_CHAR(ld_effective_date,'MM')) <= 12)
THEN
(
accrual = 1
)
)
)
IF (ld_curr_year > ld_hire_year)
THEN
(accrual = 2)
ceiling = 2
carryover=0
vestingUnits=3
vestingUOM='M'
RETURN accrual,ceiling,carryover,vestingUnits,vestingUOM
Click on Edit Button and then select Correct