Workforce Compensation Eligibility Formula , Youtube Tutorial
/*
FF: CWB_ELIG_FF
Type: Participation and Rate Eligibility
purpose: Make the person eligible if the person worked more than a year
*/
DEFAULT FOR PER_PERSON_ENTERPRISE_HIRE_DATE is '1900/10/01 00:00:00' (date)
DEFAULT FOR PER_PER_FULL_NAME is ' '
DEFAULT FOR CMP_IV_COMPONENT_ID IS -1
DEFAULT FOR CMP_IV_PLAN_ELIG_DATE IS ' '
DEFAULT FOR CMP_IV_PERFORMANCE_EFF_DATE IS ' '
DEFAULT FOR CMP_IV_PROMOTION_EFF_DATE IS ' '
DEFAULT FOR CMP_IV_XCHG_RATE_DATE IS ' '
INPUTS ARE CMP_IV_PLAN_START_DATE (text), CMP_IV_PLAN_END_DATE (text), CMP_IV_PLAN_ELIG_DATE(text),CMP_IV_PLAN_EXTRACTION_DATE
(text), CMP_IV_PERFORMANCE_EFF_DATE(text), CMP_IV_PROMOTION_EFF_DATE (text), CMP_IV_XCHG_RATE_DATE (text), CMP_IV_PLAN_ID (number), CMP_IV_PERIOD_ID(number), CMP_IV_COMPONENT_ID (number)
l_log= set_log('****************ENTERING CWB_ELIG_FF')
eDate = GET_CONTEXT(EFFECTIVE_DATE, '1900/01/01 00:00:00' (date) )
personid = GET_CONTEXT( PERSON_ID, -1 )
assignid = GET_CONTEXT( HR_ASSIGNMENT_ID, -1 )
l_log= set_log('EFF DATE ' + TO_CHAR(eDate) )
l_log= set_log('personid ' + TO_CHAR(personid) )
l_log= set_log('assignid ' + TO_CHAR(assignid) )
l_log= set_log('PER_PER_FULL_NAME ' + PER_PER_FULL_NAME )
l_log= set_log('CMP_IV_PLAN_ID ' + TO_CHAR(CMP_IV_PLAN_ID) )
l_log= set_log('CMP_IV_PERIOD_ID ' + TO_CHAR(CMP_IV_PERIOD_ID) )
l_log= set_log('CMP_IV_COMPONENT_ID '+TO_CHAR(CMP_IV_COMPONENT_ID) )
l_log= set_log('CMP_IV_PLAN_START_DATE ' + CMP_IV_PLAN_START_DATE )
l_log= set_log('CMP_IV_PLAN_END_DATE ' + CMP_IV_PLAN_END_DATE )
l_log= set_log('CMP_IV_PLAN_ELIG_DATE ' + CMP_IV_PLAN_ELIG_DATE )
l_log= set_log('CMP_IV_PLAN_EXTRACTION_DATE ' + CMP_IV_PLAN_EXTRACTION_DATE )
l_log= set_log('CMP_IV_PERFORMANCE_EFF_DATE ' + CMP_IV_PERFORMANCE_EFF_DATE )
l_log= set_log('CMP_IV_PROMOTION_EFF_DATE ' + CMP_IV_PROMOTION_EFF_DATE )
l_log= set_log('CMP_IV_PLAN_START_DATE ' + CMP_IV_PLAN_START_DATE )
ELIGIBLE = 'N'
l_log= set_log('PER_PERSON_ENTERPRISE_HIRE_DATE ' + TO_CHAR(PER_PERSON_ENTERPRISE_HIRE_DATE) )
IF DAYS_BETWEEN(eDate, PER_PERSON_ENTERPRISE_HIRE_DATE) >= 365 THEN
(
ELIGIBLE = 'Y'
)
l_log= set_log('****************Leaving CWB_ELIG_FF ' + ELIGIBLE )
RETURN ELIGIBLE