Tuesday, 22 June 2021
Sample Formula to calculate absence duration in Oracle Cloud HCM
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 IV_START_DURATION IS 1
DEFAULT FOR IV_END_DURATION IS 1
DEFAULT FOR PER_ASG_FTE_VALUE IS 1
DEFAULT FOR PER_ASG_EMPLOYMENT_CATEGORY IS 'UNKNOWN'
INPUTS ARE IV_START_DATE (date), IV_END_DATE (date), IV_START_TIME(text),IV_END_TIME(text), IV_START_DURATION(number), IV_END_DURATION(number)
ln_duration = 0
ln_unrounded_duration_d = 0
lc_asg_resource_type = 'ASSIGN'
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')
lc_use_sch_asg_y = 'Y'
lc_use_sch_inh_y = 'Y'
lc_include_noshift_y = 'Y'
lc_include_calevents_y = 'Y'
lc_calc_units_d = 'D'
/* Retrieve the absence duration based on the work schedule */
ln_unrounded_duration_d = GET_PAY_AVAILABILITY (lc_asg_resource_type,
ld_period_start_date,
ld_period_end_date,
lc_use_sch_asg_y,
lc_use_sch_inh_y,
lc_include_noshift_y,
lc_include_calevents_y,
lc_calc_units_d)
/* test if (vertical) Part time apply the FTE */
IF PER_ASG_EMPLOYMENT_CATEGORY ='FR_20' THEN
ln_duration = ln_unrounded_duration_d * (1/PER_ASG_FTE_VALUE)
ELSE ln_duration = ln_unrounded_duration_d
/*duration = ROUND(ln_duration,2)*/
duration = ln_duration
RETURN duration
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 IV_START_DURATION IS 1
DEFAULT FOR IV_END_DURATION IS 1
DEFAULT FOR PER_ASG_FTE_VALUE IS 1
DEFAULT FOR PER_ASG_EMPLOYMENT_CATEGORY IS 'UNKNOWN'
INPUTS ARE IV_START_DATE (date), IV_END_DATE (date), IV_START_TIME(text),IV_END_TIME(text), IV_START_DURATION(number), IV_END_DURATION(number)
ln_duration = 0
ln_unrounded_duration_d = 0
lc_asg_resource_type = 'ASSIGN'
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')
lc_use_sch_asg_y = 'Y'
lc_use_sch_inh_y = 'Y'
lc_include_noshift_y = 'Y'
lc_include_calevents_y = 'Y'
lc_calc_units_d = 'D'
/* Retrieve the absence duration based on the work schedule */
ln_unrounded_duration_d = GET_PAY_AVAILABILITY (lc_asg_resource_type,
ld_period_start_date,
ld_period_end_date,
lc_use_sch_asg_y,
lc_use_sch_inh_y,
lc_include_noshift_y,
lc_include_calevents_y,
lc_calc_units_d)
/* test if (vertical) Part time apply the FTE */
IF PER_ASG_EMPLOYMENT_CATEGORY ='FR_20' THEN
ln_duration = ln_unrounded_duration_d * (1/PER_ASG_FTE_VALUE)
ELSE ln_duration = ln_unrounded_duration_d
/*duration = ROUND(ln_duration,2)*/
duration = ln_duration
RETURN duration
Friday, 18 June 2021
Getting Sysdate in a particular Date format in OIC
Sysdate can be got in a particular Date format using the below code in OIC.
string( xp20:format-dateTime( string ( fn:current-dateTime() ) ,'[Y0001]-[M01]-[D01][H01]:[m01]:[s01] ' ) )
Reading a lookup value in OIC
The below code can be used to read lookup value in OIC.
dvm:lookupValue('oramds:/apps/ICS/DVM/Test1.dvm','Column1','Path','Column2','Default Value for Column2')
dvm:lookupValue('oramds:/apps/ICS/DVM/Test1.dvm','Column1','Size','Column2','Default Value for Column2')
Wednesday, 9 June 2021
Sample Fast Formula - Eligibility Profile Fast Formula based on US LDG
Came across this useful post. Re-posting.
/* --------------------------------------------------------------------------------------------------------------------------
********************************************************************************************
* NAME : US Legislation
* TYPE : Participation and Rate Eligiblity
* Requirement: Formula to get the eligible employees for US
********************************************************************************************
------------------------------------------------------------------------------------------------------------------------*/
DEFAULT FOR PER_ASG_LEGISLATION_CODE IS 'ABC'
ELIGIBLE = 'N'
IF (PER_ASG_LEGISLATION_CODE = 'US') THEN
(
ELIGIBLE = 'Y'
)
RETURN ELIGIBLE
********************************************************************************************
* NAME : US Legislation
* TYPE : Participation and Rate Eligiblity
* Requirement: Formula to get the eligible employees for US
********************************************************************************************
------------------------------------------------------------------------------------------------------------------------*/
DEFAULT FOR PER_ASG_LEGISLATION_CODE IS 'ABC'
ELIGIBLE = 'N'
IF (PER_ASG_LEGISLATION_CODE = 'US') THEN
(
ELIGIBLE = 'Y'
)
RETURN ELIGIBLE
Subscribe to:
Posts (Atom)