1: package body pay_kr_yea_sshr_utils_pkg
2: /* $Header: pykryutl.pkb 120.8.12010000.5 2008/08/12 10:32:56 vaisriva ship $ */
3: as
4: --------------------------------------------------------------
5: g_debug boolean := hr_utility.debug_enabled;
6: --------------------------------------------------------------
7:
8: CURSOR csr_get_def_bal_id(p_bal_name IN varchar2) is
9: select pdb.defined_balance_id
355: p_return_status := 'S';
356: --
357: --
358: if g_debug then
359: hr_utility.set_location(l_proc_name, 10);
360: end if;
361: --
362: --
363: if p_effective_date is null then
616: --
617: begin
618:
619: if g_debug then
620: hr_utility.set_location('pay_kr_yea_sshr_utils_pkg.update_allowed', 10);
621: end if;
622:
623: l_update_allowed := 'N';
624: l_entry_start_date := null;
628: open csr_yea_exist;
629: fetch csr_yea_exist into l_flag;
630:
631: if g_debug then
632: hr_utility.trace('YEA Run Exists = '||l_flag);
633: end if;
634:
635: if csr_yea_exist%NOTFOUND then
636:
639: fetch csr_emp_org_id into l_emp_org_id;
640: close csr_emp_org_id;
641:
642: if g_debug then
643: hr_utility.trace('fetching emp org entry period');
644: end if;
645:
646: open csr_emp_org_entry_period(l_emp_org_id);
647: fetch csr_emp_org_entry_period into
651: close csr_emp_org_entry_period;
652:
653: if l_entry_start_date is null then
654: if g_debug then
655: hr_utility.trace('Emp org entry period not found.');
656: hr_utility.trace('Fetching Entry Period from Hierarchy.');
657: end if;
658:
659: -- check for periods of parent organizations in hierarchy
652:
653: if l_entry_start_date is null then
654: if g_debug then
655: hr_utility.trace('Emp org entry period not found.');
656: hr_utility.trace('Fetching Entry Period from Hierarchy.');
657: end if;
658:
659: -- check for periods of parent organizations in hierarchy
660: open csr_org_struct_version;
663:
664: -- check if primary hierarchy is defined
665: if l_struct_version_id is not null then
666: if g_debug then
667: hr_utility.trace('Struct Version ID : ' || l_struct_version_id);
668: end if;
669:
670: open csr_hierarchy_entry_period(l_struct_version_id,l_emp_org_id);
671:
680: -- 4657745
681: -- if entry period not found in Hierarchy, check BG Entry period
682: if l_entry_start_date is null then
683: if g_debug then
684: hr_utility.trace('Entry period of Hierarchy not found.');
685: hr_utility.trace('Fetching Entry Period from BG.');
686: end if;
687:
688: -- check for entry period of the BG
681: -- if entry period not found in Hierarchy, check BG Entry period
682: if l_entry_start_date is null then
683: if g_debug then
684: hr_utility.trace('Entry period of Hierarchy not found.');
685: hr_utility.trace('Fetching Entry Period from BG.');
686: end if;
687:
688: -- check for entry period of the BG
689: open csr_bg_entry_period;
703:
704: end if; -- emp org period exists.
705:
706: if g_debug then
707: hr_utility.trace('l_entry_start_date = '|| l_entry_start_date);
708: hr_utility.trace('l_entry_end_date = '|| l_entry_end_date);
709: hr_utility.trace('l_update_cut_off_date = '|| l_update_cut_off_date);
710: end if;
711:
704: end if; -- emp org period exists.
705:
706: if g_debug then
707: hr_utility.trace('l_entry_start_date = '|| l_entry_start_date);
708: hr_utility.trace('l_entry_end_date = '|| l_entry_end_date);
709: hr_utility.trace('l_update_cut_off_date = '|| l_update_cut_off_date);
710: end if;
711:
712:
705:
706: if g_debug then
707: hr_utility.trace('l_entry_start_date = '|| l_entry_start_date);
708: hr_utility.trace('l_entry_end_date = '|| l_entry_end_date);
709: hr_utility.trace('l_update_cut_off_date = '|| l_update_cut_off_date);
710: end if;
711:
712:
713: -- compare employees effective entry period with current date
734: l_update_allowed := 'N';
735: end if; -- assignment level update allowed
736:
737: if g_debug then
738: hr_utility.trace('Assgn Level Update Allowed = '||l_update_allowed);
739: end if;
740:
741: end if; -- compare current date with entry period
742: