You are on page 1of 2

/* The employee is eligible after 1st anniversary, completing 365 days */

DEFAULT for PER_ASG_REL_ORIGINAL_DATE_OF_HIRE is '4712/12/31' (date)

l_eff = GET_CONTEXT(EFFECTIVE_DATE, TO_DATE('4712/12/31','YYYY/MM/DD') )

l_hire_date = PER_ASG_REL_ORIGINAL_DATE_OF_HIRE

l_hire_month = 0

l_cuur_month = 0

ELIGIBLE = 'N'

l_tmp = ESS_LOG_WRITE('l_hire_date='|| to_char(l_hire_date))

l_tmp = ESS_LOG_WRITE('l_eff='|| to_char(l_eff))

IF(PER_ASG_REL_ORIGINAL_DATE_OF_HIRE WAS NOT DEFAULTED ) THEN

l_hire_month = To_Number(To_Char(l_hire_date,'MM'))

l_tmp = ESS_LOG_WRITE('l_hire_month='|| to_char(l_hire_month))

l_cuur_month = To_Number(To_Char(l_eff,'MM'))

l_tmp = ESS_LOG_WRITE('l_cuur_month='|| to_char(l_cuur_month))

l_no_of_days = DAYS_BETWEEN(l_eff,l_hire_date)

l_tmp = ESS_LOG_WRITE('l_no_of_days='|| to_char(l_no_of_days))

IF( l_no_of_days > 365) THEN

if(l_hire_month = l_cuur_month) then

ELIGIBLE = 'Y'
)

RETURN ELIGIBLE

You might also like