554: p_hrs_period_start => p_hrs_period_start
555: , p_hrs_period_end => p_hrs_period_end
556: , p_tco_bb => p_tco_bb
557: , p_tco_att => p_tco_att
558: , p_time_category_id => hxc_time_category_utils_pkg.g_time_category_id );
559:
560: RETURN l_hours;
561:
562: END calc_timecard_hrs;
585: l_time_category_id hxc_time_categories.time_category_id%TYPE;
586:
587: BEGIN
588:
589: l_time_category_id := hxc_time_category_utils_pkg.get_time_category_id ( p_time_category_name => p_time_category_name );
590:
591: l_hours := calc_timecard_hrs (
592: p_hrs_period_start => p_hrs_period_start
593: , p_hrs_period_end => p_hrs_period_end
634: if g_debug then
635: hr_utility.set_location('Processing '||l_proc, 15);
636: end if;
637:
638: hxc_time_category_utils_pkg.initialise_time_category (
639: p_time_category_id => p_time_category_id
640: , p_tco_att => p_tco_att );
641:
642: hxc_time_category_utils_pkg.sum_tc_bb_ok_hrs (
638: hxc_time_category_utils_pkg.initialise_time_category (
639: p_time_category_id => p_time_category_id
640: , p_tco_att => p_tco_att );
641:
642: hxc_time_category_utils_pkg.sum_tc_bb_ok_hrs (
643: p_tc_bb_ok_string => hxc_time_category_utils_pkg.g_tc_bb_ok_string
644: , p_hrs => l_timecard_hrs
645: , p_period_start => p_hrs_period_start
646: , p_period_end => p_hrs_period_end );
639: p_time_category_id => p_time_category_id
640: , p_tco_att => p_tco_att );
641:
642: hxc_time_category_utils_pkg.sum_tc_bb_ok_hrs (
643: p_tc_bb_ok_string => hxc_time_category_utils_pkg.g_tc_bb_ok_string
644: , p_hrs => l_timecard_hrs
645: , p_period_start => p_hrs_period_start
646: , p_period_end => p_hrs_period_end );
647:
648: ELSE
649:
650: -- no time category set this sum all hours on the timecard regardless
651:
652: hxc_time_category_utils_pkg.sum_tc_bb_ok_hrs (
653: p_tc_bb_ok_string => NULL
654: , p_hrs => l_timecard_hrs
655: , p_period_start => p_hrs_period_start
656: , p_period_end => p_hrs_period_end );
1963: end if;
1964:
1965: -- we always have to intialise the first time category so do it now
1966:
1967: hxc_time_category_utils_pkg.initialise_time_category (
1968: p_time_category_id => l_tc_id_1
1969: , p_tco_att => p_tco_att );
1970:
1971: if g_debug then
1982: IF ( p_tco_bb(l_bb_ind).scope = 'DETAIL' and
1983: p_tco_bb(l_bb_ind).date_to = hr_general.end_of_time ) --Fix for Bug#2943285
1984: THEN
1985:
1986: IF ( NOT hxc_time_category_utils_pkg.chk_tc_bb_ok ( p_tco_bb(l_bb_ind).time_building_block_id ) )
1987: THEN
1988:
1989: IF ( l_tc_id_2 IS NULL )
1990: THEN
2021:
2022: IF ( l_tc_id_2 IS NOT NULL )
2023: THEN
2024:
2025: hxc_time_category_utils_pkg.initialise_time_category (
2026: p_time_category_id => l_tc_id_2
2027: , p_tco_att => p_tco_att );
2028:
2029: -- now process the second time category
2036: IF ( p_tco_bb(l_bb_ind).scope = 'DETAIL' and
2037: p_tco_bb(l_bb_ind).date_to = hr_general.end_of_time ) --Fix for Bug#2943285
2038: THEN
2039:
2040: IF ( hxc_time_category_utils_pkg.chk_tc_bb_ok ( p_tco_bb(l_bb_ind).time_building_block_id ) )
2041: THEN
2042:
2043: -- since this building block matches the time category check to make sure that the bb
2044: -- did not match the first time category, if it did then raise an error
2427: , p_operator VARCHAR2 ) RETURN NUMBER IS
2428:
2429:
2430: CURSOR csr_get_total_hrs ( p_start_date DATE, p_end_date DATE) IS
2431: SELECT NVL(SUM(SUM(NVL(hxc_time_category_utils_pkg.category_detail_hrs( tbb_detail.time_building_block_id,
2432: tbb_detail.object_version_number),0)) ),0)
2433: FROM
2434: hxc_timecard_summary ts,
2435: hxc_time_building_blocks tbb_day,
2600: THEN
2601:
2602: -- calculate PTO INC hours
2603:
2604: l_old_tc_id := hxc_time_category_utils_pkg.g_time_category_id;
2605: hxc_time_category_utils_pkg.g_time_category_id
2606: := hxc_time_entry_rules_utils_pkg.g_ter_record.ter_inc_pto_plan_id;
2607:
2608: l_hrs := 0;
2601:
2602: -- calculate PTO INC hours
2603:
2604: l_old_tc_id := hxc_time_category_utils_pkg.g_time_category_id;
2605: hxc_time_category_utils_pkg.g_time_category_id
2606: := hxc_time_entry_rules_utils_pkg.g_ter_record.ter_inc_pto_plan_id;
2607:
2608: l_hrs := 0;
2609:
2633: end if;
2634:
2635: l_total_hrs := l_total_hrs - l_hrs;
2636:
2637: hxc_time_category_utils_pkg.g_time_category_id := l_old_tc_id;
2638:
2639: END IF;
2640:
2641: ELSIF ( l_db_pre_period_start IS NOT NULL )
2662: THEN
2663:
2664: -- calculate PTO INC hours
2665:
2666: l_old_tc_id := hxc_time_category_utils_pkg.g_time_category_id;
2667: hxc_time_category_utils_pkg.g_time_category_id
2668: := hxc_time_entry_rules_utils_pkg.g_ter_record.ter_inc_pto_plan_id;
2669:
2670: l_hrs := 0;
2663:
2664: -- calculate PTO INC hours
2665:
2666: l_old_tc_id := hxc_time_category_utils_pkg.g_time_category_id;
2667: hxc_time_category_utils_pkg.g_time_category_id
2668: := hxc_time_entry_rules_utils_pkg.g_ter_record.ter_inc_pto_plan_id;
2669:
2670: l_hrs := 0;
2671:
2680: end if;
2681:
2682: l_total_hrs := l_total_hrs - l_hrs;
2683:
2684: hxc_time_category_utils_pkg.g_time_category_id := l_old_tc_id;
2685:
2686: END IF;
2687:
2688: ELSIF( l_db_post_period_start IS NOT NULL )
2709: THEN
2710:
2711: -- calculate PTO INC hours
2712:
2713: l_old_tc_id := hxc_time_category_utils_pkg.g_time_category_id;
2714: hxc_time_category_utils_pkg.g_time_category_id
2715: := hxc_time_entry_rules_utils_pkg.g_ter_record.ter_inc_pto_plan_id;
2716:
2717: l_hrs := 0;
2710:
2711: -- calculate PTO INC hours
2712:
2713: l_old_tc_id := hxc_time_category_utils_pkg.g_time_category_id;
2714: hxc_time_category_utils_pkg.g_time_category_id
2715: := hxc_time_entry_rules_utils_pkg.g_ter_record.ter_inc_pto_plan_id;
2716:
2717: l_hrs := 0;
2718:
2726: end if;
2727:
2728: l_total_hrs := l_total_hrs - l_hrs;
2729:
2730: hxc_time_category_utils_pkg.g_time_category_id := l_old_tc_id;
2731:
2732: END IF;
2733:
2734: ELSE
3212: l_time_category_id := r_rules.attribute2;
3213: if g_debug then
3214: hr_utility.trace('Time Category ID' || l_time_category_id);
3215: end if;
3216: hxc_time_category_utils_pkg.initialise_time_category(
3217: p_time_category_id => to_number(l_time_category_id),
3218: p_tco_att => P_TIME_ATTRIBUTES);
3219: n := p_time_building_blocks.first;
3220: loop
3219: n := p_time_building_blocks.first;
3220: loop
3221: exit when not p_time_building_blocks.exists(n);
3222: if (p_time_building_blocks(n).scope = 'DETAIL') then
3223: if (hxc_time_category_utils_pkg.chk_tc_bb_ok( p_time_building_blocks(n).time_building_block_id)) then
3224: add_error_to_table (
3225: p_message_table => p_messages
3226: , p_message_name => r_rules.attribute1
3227: , p_message_token => NULL
4744: l_old_tco_att hxc_self_service_time_deposit.building_block_attribute_info;
4745: l_timecard_info_rec hxc_time_entry_rules_utils_pkg.r_timecard_info;
4746: l_build_change_list VARCHAR2 (2000);
4747: l_change_list VARCHAR2 (2000);
4748: l_time_cat_tab hxc_time_category_utils_pkg.t_time_category;
4749: l_long LONG;
4750: l_operator hxc_time_categories.OPERATOR%TYPE;
4751: l_tc_bb_ok_tab hxc_time_category_utils_pkg.t_tc_bb_ok;
4752: l_tc_bb_ok_tab_old hxc_time_category_utils_pkg.t_tc_bb_ok;
4747: l_change_list VARCHAR2 (2000);
4748: l_time_cat_tab hxc_time_category_utils_pkg.t_time_category;
4749: l_long LONG;
4750: l_operator hxc_time_categories.OPERATOR%TYPE;
4751: l_tc_bb_ok_tab hxc_time_category_utils_pkg.t_tc_bb_ok;
4752: l_tc_bb_ok_tab_old hxc_time_category_utils_pkg.t_tc_bb_ok;
4753: l_tc_bb_ok_string VARCHAR2(32000);
4754: l_tc_bb_not_ok_string VARCHAR2(32000);
4755: n NUMBER;
4748: l_time_cat_tab hxc_time_category_utils_pkg.t_time_category;
4749: l_long LONG;
4750: l_operator hxc_time_categories.OPERATOR%TYPE;
4751: l_tc_bb_ok_tab hxc_time_category_utils_pkg.t_tc_bb_ok;
4752: l_tc_bb_ok_tab_old hxc_time_category_utils_pkg.t_tc_bb_ok;
4753: l_tc_bb_ok_string VARCHAR2(32000);
4754: l_tc_bb_not_ok_string VARCHAR2(32000);
4755: n NUMBER;
4756: l_tbb_deleted BOOLEAN;
4786: end if;
4787:
4788: -- populate the time category bb ok table
4789:
4790: hxc_time_category_utils_pkg.evaluate_time_category (
4791: p_time_category_id => p_rule_record.attribute1
4792: , p_tc_bb_ok_tab => l_tc_bb_ok_tab
4793: , p_tc_bb_ok_string => l_tc_bb_ok_string
4794: , p_tc_bb_not_ok_string => l_tc_bb_not_ok_string );
4795:
4796: -- populate the old attribute table
4797:
4798:
4799: hxc_time_category_utils_pkg.push_attributes ( l_old_tco_att );
4800:
4801:
4802: -- populate the time category bb ok table
4803:
4800:
4801:
4802: -- populate the time category bb ok table
4803:
4804: hxc_time_category_utils_pkg.evaluate_time_category (
4805: p_time_category_id => p_rule_record.attribute1
4806: , p_tc_bb_ok_tab => l_tc_bb_ok_tab_old
4807: , p_tc_bb_ok_string => l_tc_bb_ok_string
4808: , p_tc_bb_not_ok_string => l_tc_bb_not_ok_string
4809: , p_use_tc_bb_cache => FALSE );
4810:
4811: -- put back the original attributes
4812:
4813: hxc_time_category_utils_pkg.push_attributes ( p_tco_att );
4814:
4815: END IF;
4816:
4817: if g_debug then
5091: l_time_category_id := p_rule_record.attribute1;
5092:
5093: IF (l_time_category_id IS NOT NULL)
5094: THEN
5095: hxc_time_category_utils_pkg.initialise_time_category (
5096: p_time_category_id=> TO_NUMBER (l_time_category_id),
5097: p_tco_att=> p_tco_att
5098: );
5099: l_tbb_index := p_tco_bb.FIRST;
5124: l_tbb_parent_index := p_tco_bb.next(l_tbb_parent_index);
5125: END LOOP;
5126: END IF;
5127:
5128: IF (hxc_time_category_utils_pkg.chk_tc_bb_ok (
5129: p_tco_bb (l_tbb_index).time_building_block_id
5130: )
5131: )
5132: THEN