You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Absence Leave Duration Issue

edited Jun 14, 2018 1:26PM in Workforce Management 1 comment

Summary

Absence Leave Not Rounding Up

Content

We have an absence plan where the duration is not calculating to .5 for a half day and/or a whole day when multiple days are taken. Please see screenshot. The screenshots are in the user's local language, but it is the same when testing in another language(English). I have also attached the fast formula that should round it accordingly. 

 

Code Snippet

/******************************************************************************
FORMULA NAME: XRX_FR_ABS_DURATION_FF
FORMULA TYPE: Global Absence Type Duration
DESCRIPTION: This formula returns the duration for absence entries and rounds the duration up to 0.5 or 1

*******************************************************************************/

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 0
DEFAULT FOR IV_END_DURATION is 0

INPUTS ARE IV_START_DATE (date), IV_END_DATE (date), IV_START_DURATION(Number), IV_END_DURATION(Number), IV_START_TIME(text), IV_END_TIME(text)

l_start_date = to_date(to_char(IV_START_DATE,'DD/MM/YYYY'),'DD/MM/YYYY')
l_end_date = to_date(to_char(IV_END_DATE,'DD/MM/YYYY'),'DD/MM/YYYY')
l_start_date_plus1 = ADD_DAYS(l_start_date,1)
l_end_date_minus1 = l_end_date
l_start_datetime = to_date(to_char(IV_START_DATE,'DD/MM/YYYY')||' '||IV_START_TIME,'DD/MM/YYYY HH24:MI:SS')
l_end_datetime = to_date(to_char(IV_END_DATE,'DD/MM/YYYY')||' '||IV_END_TIME,'DD/MM/YYYY HH24:MI:SS')
l_noon_start_time = to_date(to_char(IV_START_DATE,'DD/MM/YYYY')||' '||'13:00:00','DD/MM/YYYY HH24:MI:SS')
l_noon_end_time = to_date(to_char(IV_END_DATE,'DD/MM/YYYY')||' '||'13:00:00','DD/MM/YYYY HH24:MI:SS')
l_start_duration = 0
l_end_duration = 0
l_mid_duration = 0
lc_resource_type = 'ASSIGN'
lc_use_sch_asg = 'Y'
lc_use_sch_inh = 'Y'
lc_include_noshift = 'Y'
lc_include_calevents

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!