CRV_SQL_CURVE_PKG.SUM(PRCALENDAR.ODF_CALENDAR, LS.WBC_LEAVE_START, TRUNC(LS.WBC_LEAVE_END) + 1) returns 0 or incorrect hours when the Monday is a Non working day and the Leave start date is on Friday.
All Clarity Releases
CRV_SQL_CURVE_PKG.SUM is a pretty old package used in Clarity and there is a preparsed SQL curve used since 15.* release and its advised to use the new package.
NK_PARSE_CURVE_FCT is the new sql curve which should be used for accurate and faster results.
The above query should be rewritten as
nk_sum_fct(odf_nk_calendar, LS.WBC_LEAVE_START, TRUNC(LS.WBC_LEAVE_END) + 1) / 3600, 2)