331: --------------------------------------------------------------------------------
332: PROCEDURE get_work_day (
333: p_date IN DATE,
334: p_work_id IN NUMBER,
335: p_standard_start OUT NOCOPY NUMBER,
336: p_standard_stop OUT NOCOPY NUMBER,
337: p_hours OUT NOCOPY NUMBER
338: )
339: IS
332: PROCEDURE get_work_day (
333: p_date IN DATE,
334: p_work_id IN NUMBER,
335: p_standard_start OUT NOCOPY NUMBER,
336: p_standard_stop OUT NOCOPY NUMBER,
337: p_hours OUT NOCOPY NUMBER
338: )
339: IS
340: --
343: -- assigned shift on an input date
344:
345: CURSOR work_day (p_wp_id NUMBER, p_date DATE) --, p_weekday VARCHAR2)
346: IS
347: SELECT sht.standard_start, sht.standard_stop, sht.hours
348: FROM hxt_shifts sht,
349: hxt_weekly_work_schedules wws,
350: hxt_work_shifts wsh
351: WHERE wsh.week_day = hxt_util.get_week_day(p_date)--p_weekday --to_char(p_date,'DY')
381: hr_utility.set_location ('Get_Work_Day', 20);
382: end if;
383: */
384: OPEN work_day (p_work_id, p_date); --, l_lookup_code);
385: FETCH work_day INTO p_standard_start, p_standard_stop, p_hours;
386: CLOSE work_day;
387: if g_debug then
388: hr_utility.TRACE ( 'p_standard_start :'
389: || p_standard_start);
384: OPEN work_day (p_work_id, p_date); --, l_lookup_code);
385: FETCH work_day INTO p_standard_start, p_standard_stop, p_hours;
386: CLOSE work_day;
387: if g_debug then
388: hr_utility.TRACE ( 'p_standard_start :'
389: || p_standard_start);
390: hr_utility.TRACE ( 'p_standard_stop :'
391: || p_standard_stop);
392: end if;
385: FETCH work_day INTO p_standard_start, p_standard_stop, p_hours;
386: CLOSE work_day;
387: if g_debug then
388: hr_utility.TRACE ( 'p_standard_start :'
389: || p_standard_start);
390: hr_utility.TRACE ( 'p_standard_stop :'
391: || p_standard_stop);
392: end if;
393: EXCEPTION
386: CLOSE work_day;
387: if g_debug then
388: hr_utility.TRACE ( 'p_standard_start :'
389: || p_standard_start);
390: hr_utility.TRACE ( 'p_standard_stop :'
391: || p_standard_stop);
392: end if;
393: EXCEPTION
394: WHEN OTHERS
387: if g_debug then
388: hr_utility.TRACE ( 'p_standard_start :'
389: || p_standard_start);
390: hr_utility.TRACE ( 'p_standard_stop :'
391: || p_standard_stop);
392: end if;
393: EXCEPTION
394: WHEN OTHERS
395: THEN
419: l_time_in_timecard DATE;
420: l_time_out_timecard DATE;
421: l_time_in_day DATE;
422: l_time_out_day DATE;
423: l_standard_start NUMBER;
424: l_standard_stop NUMBER;
425: l_hours NUMBER;
426: p_hours NUMBER;
427: l_hcl_hours NUMBER;
420: l_time_out_timecard DATE;
421: l_time_in_day DATE;
422: l_time_out_day DATE;
423: l_standard_start NUMBER;
424: l_standard_stop NUMBER;
425: l_hours NUMBER;
426: p_hours NUMBER;
427: l_hcl_hours NUMBER;
428: l_type VARCHAR2 (9);
476: get_work_day (
477: p_start
478: + i,
479: p_tws_id,
480: l_standard_start,
481: l_standard_stop,
482: l_hours
483: );
484: --Calculate Start Date and End Date for TIMECARD and DAY Scope
477: p_start
478: + i,
479: p_tws_id,
480: l_standard_start,
481: l_standard_stop,
482: l_hours
483: );
484: --Calculate Start Date and End Date for TIMECARD and DAY Scope
485: l_time_in_timecard := convert_timecard_time (p_start, 000000);
592: IF (l_hours IS NULL)
593: THEN
594: l_type := 'RANGE';
595: l_time_in := convert_time ( p_start
596: + i, l_standard_start);
597: l_time_out := convert_time (
598: p_start
599: + i,
600: l_standard_start,
596: + i, l_standard_start);
597: l_time_out := convert_time (
598: p_start
599: + i,
600: l_standard_start,
601: l_standard_stop
602: );
603: -- l_hours := NULL;--24*(l_time_out - l_time_in);
604: ELSE
597: l_time_out := convert_time (
598: p_start
599: + i,
600: l_standard_start,
601: l_standard_stop
602: );
603: -- l_hours := NULL;--24*(l_time_out - l_time_in);
604: ELSE
605: l_type := 'MEASURE';
775: );
776: hr_utility.TRACE ( 'NEW:'
777: || p_timecard (l_next_index).NEW);
778: end if;
779: IF ( (NVL (l_standard_start, 0) <> 0)
780: OR (NVL (l_standard_stop, 0) <> 0)
781: OR (NVL (l_hours, 0) <> 0)
782: )
783: THEN
776: hr_utility.TRACE ( 'NEW:'
777: || p_timecard (l_next_index).NEW);
778: end if;
779: IF ( (NVL (l_standard_start, 0) <> 0)
780: OR (NVL (l_standard_stop, 0) <> 0)
781: OR (NVL (l_hours, 0) <> 0)
782: )
783: THEN
784: l_next_index := p_timecard.COUNT