67: and pen.pl_typ_id = l_pl_typ_id
68: and oipl.opt_id = l_opt_id
69: and pen.person_id = p_person_id
70: and pen.per_in_ler_id = p_per_in_ler_id
71: and pen.effective_end_date = hr_api.g_eot
72: and pen.enrt_cvg_thru_dt <> hr_api.g_eot
73: and pen.effective_start_date between oipl.effective_start_date
74: and oipl.effective_end_date
75: AND pen.prtt_enrt_rslt_stat_cd IS NULL
68: and oipl.opt_id = l_opt_id
69: and pen.person_id = p_person_id
70: and pen.per_in_ler_id = p_per_in_ler_id
71: and pen.effective_end_date = hr_api.g_eot
72: and pen.enrt_cvg_thru_dt <> hr_api.g_eot
73: and pen.effective_start_date between oipl.effective_start_date
74: and oipl.effective_end_date
75: AND pen.prtt_enrt_rslt_stat_cd IS NULL
76: ;
81: from ben_prtt_enrt_rslt_f pen
82: where pen.pl_typ_id = l_pl_typ_id
83: and pen.person_id = p_person_id
84: and pen.per_in_ler_id = p_per_in_ler_id
85: and pen.effective_end_date = hr_api.g_eot
86: and pen.enrt_cvg_thru_dt <> hr_api.g_eot
87: AND pen.prtt_enrt_rslt_stat_cd IS NULL
88: ;
89:
82: where pen.pl_typ_id = l_pl_typ_id
83: and pen.person_id = p_person_id
84: and pen.per_in_ler_id = p_per_in_ler_id
85: and pen.effective_end_date = hr_api.g_eot
86: and pen.enrt_cvg_thru_dt <> hr_api.g_eot
87: AND pen.prtt_enrt_rslt_stat_cd IS NULL
88: ;
89:
90: cursor c_previous_pl_oipl_result is
95: and pen.pl_typ_id = l_pl_typ_id
96: and oipl.opt_id = l_opt_id
97: and pen.person_id = p_person_id
98: and pen.per_in_ler_id = p_per_in_ler_id
99: and pen.effective_end_date = hr_api.g_eot
100: and pen.enrt_cvg_thru_dt <> hr_api.g_eot
101: and pen.effective_start_date between oipl.effective_start_date
102: and oipl.effective_end_date
103: AND pen.prtt_enrt_rslt_stat_cd IS NULL
96: and oipl.opt_id = l_opt_id
97: and pen.person_id = p_person_id
98: and pen.per_in_ler_id = p_per_in_ler_id
99: and pen.effective_end_date = hr_api.g_eot
100: and pen.enrt_cvg_thru_dt <> hr_api.g_eot
101: and pen.effective_start_date between oipl.effective_start_date
102: and oipl.effective_end_date
103: AND pen.prtt_enrt_rslt_stat_cd IS NULL
104: ;
115: pen.prtt_enrt_rslt_id = p_prev_prtt_enrt_rslt_id
116: and pen.person_id = p_person_id
117: -- this condition removed to CFD from any result
118: --and pen.per_in_ler_id = p_per_in_ler_id
119: and pen.effective_end_date = hr_api.g_eot
120: and pen.enrt_cvg_thru_dt <> hr_api.g_eot
121: AND pen.prtt_enrt_rslt_stat_cd is null
122: ;
123:
116: and pen.person_id = p_person_id
117: -- this condition removed to CFD from any result
118: --and pen.per_in_ler_id = p_per_in_ler_id
119: and pen.effective_end_date = hr_api.g_eot
120: and pen.enrt_cvg_thru_dt <> hr_api.g_eot
121: AND pen.prtt_enrt_rslt_stat_cd is null
122: ;
123:
124:
127: from ben_prtt_enrt_rslt_f pen
128: where pen.pl_typ_id = l_pl_typ_id
129: and pen.person_id = p_person_id
130: and pen.per_in_ler_id = p_per_in_ler_id
131: and pen.effective_end_date = hr_api.g_eot
132: and pen.enrt_cvg_thru_dt <> hr_api.g_eot
133: AND pen.prtt_enrt_rslt_stat_cd IS NULL
134: ;
135:
128: where pen.pl_typ_id = l_pl_typ_id
129: and pen.person_id = p_person_id
130: and pen.per_in_ler_id = p_per_in_ler_id
131: and pen.effective_end_date = hr_api.g_eot
132: and pen.enrt_cvg_thru_dt <> hr_api.g_eot
133: AND pen.prtt_enrt_rslt_stat_cd IS NULL
134: ;
135:
136: cursor c_prev_pen_dpnts(v_enrt_rslt_id number,v_per_in_ler_id number) is
443: p_elig_dpnt_id => l_epe_dpnt_rec.elig_dpnt_id,
444: p_business_group_id => p_business_group_id,
445: p_effective_date => p_effective_date,
446: p_cvg_strt_dt => l_cvg_strt_dt,
447: p_cvg_thru_dt => hr_api.g_eot,
448: p_datetrack_mode => hr_api.g_insert,
449: p_elig_cvrd_dpnt_id => l_elig_cvrd_dpnt_id,
450: p_effective_start_date => l_eff_start_date,
451: p_effective_end_date => l_eff_end_date,
444: p_business_group_id => p_business_group_id,
445: p_effective_date => p_effective_date,
446: p_cvg_strt_dt => l_cvg_strt_dt,
447: p_cvg_thru_dt => hr_api.g_eot,
448: p_datetrack_mode => hr_api.g_insert,
449: p_elig_cvrd_dpnt_id => l_elig_cvrd_dpnt_id,
450: p_effective_start_date => l_eff_start_date,
451: p_effective_end_date => l_eff_end_date,
452: p_object_version_number => l_object_version_number,
591: and not exists(select null
592: from ben_prtt_enrt_rslt_f pen
593: where pen.pgm_id = epe.pgm_id
594: and pen.per_in_ler_id = epe.per_in_ler_id
595: and pen.enrt_cvg_thru_dt = hr_api.g_eot
596: and pen.effective_end_date = hr_api.g_eot)
597: or epe.pl_id is not null
598: and not exists(select null
599: from ben_prtt_enrt_rslt_f pen
592: from ben_prtt_enrt_rslt_f pen
593: where pen.pgm_id = epe.pgm_id
594: and pen.per_in_ler_id = epe.per_in_ler_id
595: and pen.enrt_cvg_thru_dt = hr_api.g_eot
596: and pen.effective_end_date = hr_api.g_eot)
597: or epe.pl_id is not null
598: and not exists(select null
599: from ben_prtt_enrt_rslt_f pen
600: where pen.pl_id = epe.pl_id
598: and not exists(select null
599: from ben_prtt_enrt_rslt_f pen
600: where pen.pl_id = epe.pl_id
601: and pen.per_in_ler_id = epe.per_in_ler_id
602: and pen.enrt_cvg_thru_dt = hr_api.g_eot
603: and pen.effective_end_date = hr_api.g_eot)
604: )
605: order by epe.pgm_id, epe.pl_id;
606: --
599: from ben_prtt_enrt_rslt_f pen
600: where pen.pl_id = epe.pl_id
601: and pen.per_in_ler_id = epe.per_in_ler_id
602: and pen.enrt_cvg_thru_dt = hr_api.g_eot
603: and pen.effective_end_date = hr_api.g_eot)
604: )
605: order by epe.pgm_id, epe.pl_id;
606: --
607: l_choice_info c_choice_info%rowtype;
626: and not exists(select null
627: from ben_prtt_enrt_rslt_f pen
628: where pen.pgm_id = epe.pgm_id
629: and pen.per_in_ler_id = epe.per_in_ler_id
630: and pen.enrt_cvg_thru_dt = hr_api.g_eot
631: and pen.effective_end_date = hr_api.g_eot)
632: or epe.pl_id is not null
633: and not exists(select null
634: from ben_prtt_enrt_rslt_f pen
627: from ben_prtt_enrt_rslt_f pen
628: where pen.pgm_id = epe.pgm_id
629: and pen.per_in_ler_id = epe.per_in_ler_id
630: and pen.enrt_cvg_thru_dt = hr_api.g_eot
631: and pen.effective_end_date = hr_api.g_eot)
632: or epe.pl_id is not null
633: and not exists(select null
634: from ben_prtt_enrt_rslt_f pen
635: where pen.pl_id = epe.pl_id
633: and not exists(select null
634: from ben_prtt_enrt_rslt_f pen
635: where pen.pl_id = epe.pl_id
636: and pen.per_in_ler_id = epe.per_in_ler_id
637: and pen.enrt_cvg_thru_dt = hr_api.g_eot
638: and pen.effective_end_date = hr_api.g_eot));
639: --
640: cursor c_pgm_enrt_dt(v_elig_per_elctbl_chc_id number,v_pgm_id number) is
641: select pel.enrt_perd_strt_dt
634: from ben_prtt_enrt_rslt_f pen
635: where pen.pl_id = epe.pl_id
636: and pen.per_in_ler_id = epe.per_in_ler_id
637: and pen.enrt_cvg_thru_dt = hr_api.g_eot
638: and pen.effective_end_date = hr_api.g_eot));
639: --
640: cursor c_pgm_enrt_dt(v_elig_per_elctbl_chc_id number,v_pgm_id number) is
641: select pel.enrt_perd_strt_dt
642: from ben_pil_elctbl_chc_popl pel,ben_elig_per_elctbl_chc epe
731: where pil.per_in_ler_id = p_per_in_ler_id
732: and pil.per_in_ler_Stat_cd = 'STRTD'
733: and pen.per_in_ler_id = pil.per_in_ler_id
734: and pen.business_group_id = p_business_group_id
735: and pen.enrt_cvg_thru_dt = hr_api.g_eot
736: and pen.effective_end_date = hr_api.g_eot
737: and p_effective_date between pen.effective_start_date
738: and pen.effective_end_date
739: and pen.pgm_id=epe.pgm_id
732: and pil.per_in_ler_Stat_cd = 'STRTD'
733: and pen.per_in_ler_id = pil.per_in_ler_id
734: and pen.business_group_id = p_business_group_id
735: and pen.enrt_cvg_thru_dt = hr_api.g_eot
736: and pen.effective_end_date = hr_api.g_eot
737: and p_effective_date between pen.effective_start_date
738: and pen.effective_end_date
739: and pen.pgm_id=epe.pgm_id
740: and epe.auto_enrt_flag = 'Y'
747: where pil.per_in_ler_id = p_per_in_ler_id
748: and pil.per_in_ler_Stat_cd = 'STRTD'
749: and pen.per_in_ler_id = pil.per_in_ler_id
750: and pen.business_group_id = p_business_group_id
751: and pen.enrt_cvg_thru_dt = hr_api.g_eot
752: and pen.effective_end_date = hr_api.g_eot
753: and pen.pgm_id is null
754: and p_effective_date between pen.effective_start_date
755: and pen.effective_end_date
748: and pil.per_in_ler_Stat_cd = 'STRTD'
749: and pen.per_in_ler_id = pil.per_in_ler_id
750: and pen.business_group_id = p_business_group_id
751: and pen.enrt_cvg_thru_dt = hr_api.g_eot
752: and pen.effective_end_date = hr_api.g_eot
753: and pen.pgm_id is null
754: and p_effective_date between pen.effective_start_date
755: and pen.effective_end_date
756: and epe.auto_enrt_flag = 'Y'
888: --
889: close c_prtt_result;
890: --
891: l_new_election := false;
892: l_datetrack_mode := hr_api.g_update;
893: l_choice_info.stage := 'N';
894: --
895: else
896: --
894: --
895: else
896: --
897: l_new_election := true;
898: l_datetrack_mode := hr_api.g_insert;
899: l_choice_info.stage := 'Y';
900: --
901: --Bug 5589466 : Reset l_prtt_result if the current election is a new one
902: l_prtt_result := null;
1138:
1139: hr_utility.set_location('l_cryfwd_elig_dpnt_cd '||l_cryfwd_elig_dpnt_cd,744);
1140: hr_utility.set_location('l_prev_prtt_enrt_rslt_id '||l_prev_prtt_enrt_rslt_id,744);
1141:
1142: if l_datetrack_mode = hr_api.g_insert and l_cryfwd_elig_dpnt_cd = 'CFRRWP' then
1143:
1144: hr_utility.set_location('cvg strt cd: '||l_choice_info.dpnt_cvg_strt_dt_cd,10);
1145: -- p_effective_date is now changed to l_effective_dt , when ever LE reprocessed
1146: -- result created as on effective date and automeatic enrollment called with