/*
FF Type : Compensation Hierarchy Determination
FF Name: CMP_HIERARCHY
Purpose: Pass the persons managers manager as his hierarchy, if the Managers manager not available
pass manager as hierarchy
*/
DEFAULT FOR PER_ASG_MGR_FULL_NAME is 'XXX'
DEFAULT FOR PER_ASG_MGR_MANAGER_ID is -999
DEFAULT FOR PER_ASG_MGR_MANAGER_ASG_ID is -999
DEFAULT FOR PER_PER_FULL_NAME 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)
l_log= set_log('****************ENTERING CMP_HIERARCHY')
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_PLAN_START_DATE ' + CMP_IV_PLAN_START_DATE )
L_ASSIGNMENT_ID = -999
L_PERSON_ID = -999
l_name = ' '
if assignid != -1 then (
L_PERSON_ID = PER_ASG_MGR_MANAGER_ID
L_ASSIGNMENT_ID = PER_ASG_MGR_MANAGER_ASG_ID
l_name = PER_ASG_MGR_FULL_NAME
l_log= set_log('Manager Name ' + l_name )
IF PER_ASG_MGR_MANAGER_ASG_ID WAS NOT DEFAULTED THEN (
CHANGE_CONTEXTS(HR_ASSIGNMENT_ID = L_ASSIGNMENT_ID)
(
assignid1 = GET_CONTEXT( HR_ASSIGNMENT_ID, -1 )
l_log= set_log('assignid 1 ' + TO_CHAR(assignid1) )
IF PER_ASG_MGR_MANAGER_ASG_ID WAS NOT DEFAULTED THEN (
L_PERSON_ID = PER_ASG_MGR_MANAGER_ID
L_ASSIGNMENT_ID = PER_ASG_MGR_MANAGER_ASG_ID
l_name = PER_ASG_MGR_FULL_NAME
l_log= set_log('Manager mgr Name ' + l_name )
)ELSE (
l_log= set_log('Manager mgr not found ' )
)
)
)
)
l_log= set_log('****************Leaving CMP_HIERARCHY')
RETURN L_ASSIGNMENT_ID, L_PERSON_ID