154: l_dummy_date date;
155: l_prev_popl_id number := -1;
156:
157: begin
158: -- hr_utility.trace_on(null,'trace');
159: hr_utility.set_location('Entering '||l_proc,1);
160: hr_utility.set_location('p_effective_date '||p_effective_date,10);
161: hr_utility.set_location('p_per_in_ler_id '||p_per_in_ler_id,10);
162: g_debug := hr_utility.debug_enabled;
155: l_prev_popl_id number := -1;
156:
157: begin
158: -- hr_utility.trace_on(null,'trace');
159: hr_utility.set_location('Entering '||l_proc,1);
160: hr_utility.set_location('p_effective_date '||p_effective_date,10);
161: hr_utility.set_location('p_per_in_ler_id '||p_per_in_ler_id,10);
162: g_debug := hr_utility.debug_enabled;
163: --
156:
157: begin
158: -- hr_utility.trace_on(null,'trace');
159: hr_utility.set_location('Entering '||l_proc,1);
160: hr_utility.set_location('p_effective_date '||p_effective_date,10);
161: hr_utility.set_location('p_per_in_ler_id '||p_per_in_ler_id,10);
162: g_debug := hr_utility.debug_enabled;
163: --
164: l_effective_date := p_lf_evt_ocrd_dt;
157: begin
158: -- hr_utility.trace_on(null,'trace');
159: hr_utility.set_location('Entering '||l_proc,1);
160: hr_utility.set_location('p_effective_date '||p_effective_date,10);
161: hr_utility.set_location('p_per_in_ler_id '||p_per_in_ler_id,10);
162: g_debug := hr_utility.debug_enabled;
163: --
164: l_effective_date := p_lf_evt_ocrd_dt;
165: --
158: -- hr_utility.trace_on(null,'trace');
159: hr_utility.set_location('Entering '||l_proc,1);
160: hr_utility.set_location('p_effective_date '||p_effective_date,10);
161: hr_utility.set_location('p_per_in_ler_id '||p_per_in_ler_id,10);
162: g_debug := hr_utility.debug_enabled;
163: --
164: l_effective_date := p_lf_evt_ocrd_dt;
165: --
166: open c_pen;
201: l_datetrack_mode := hr_api.g_zap;
202: end if;
203:
204: l_pea_effective_date := greatest(l_effective_date-1,l_act_sus.effective_start_date);
205: hr_utility.set_location('Delete A1'||l_pen_rec.prtt_enrt_rslt_id ,10);
206:
207: ben_prtt_enrt_actn_api.delete_prtt_enrt_actn
208: (p_prtt_enrt_actn_id => l_act_sus.prtt_enrt_actn_id
209: ,p_business_group_id => p_business_group_id
222: close c_get_actn_items_sus;
223: --
224: if l_act_item_expired THEN
225: --
226: hr_utility.set_location ('Expired action items exist ..',10);
227: open c_min_max_date (l_pen_rec.prtt_enrt_rslt_id);
228: fetch c_min_max_date into l_min_start_date,l_max_end_date;
229: close c_min_max_date;
230: --
234:
235: if l_min_start_date <= l_effective_date and
236: l_max_end_date > l_effective_date
237: then
238: hr_utility.set_location('delete_enrollment 1'||l_pen_rec.prtt_enrt_rslt_id,10);
239: ben_prtt_enrt_result_api.delete_enrollment
240: (p_prtt_enrt_rslt_id => l_pen_rec.prtt_enrt_rslt_id
241: ,p_per_in_ler_id => p_per_in_ler_id
242: ,p_business_group_id => p_business_group_id
247: ,p_datetrack_mode => hr_api.g_delete
248: ,p_multi_row_validate => false --BUG 4718599 to be in sync with inelig
249: ,p_source => 'beninelg');
250: else
251: hr_utility.set_location('delete_enrollment 2'
252: ||l_pen_rec.prtt_enrt_rslt_id,10);
253: ben_prtt_enrt_result_api.delete_enrollment
254: (p_prtt_enrt_rslt_id => l_pen_rec.prtt_enrt_rslt_id
255: ,p_per_in_ler_id => p_per_in_ler_id
289: l_object_version_number := l_pea_rec.object_version_number;
290: --
291: if l_pea_effective_date <> l_pea_rec.effective_end_date then
292: --
293: hr_utility.set_location('OPtional delete_prtt_enrt_actn'||
294: l_pea_rec.prtt_enrt_actn_id,10);
295: ben_prtt_enrt_actn_api.delete_prtt_enrt_actn
296: (p_prtt_enrt_actn_id => l_pea_rec.prtt_enrt_actn_id
297: ,p_business_group_id => p_business_group_id
303: ,p_unsuspend_enrt_flag => 'N'
304: ,p_effective_start_date => l_effective_start_date
305: ,p_effective_end_date => l_effective_end_date);
306: --
307: hr_utility.set_location('prtt_enrt_actn_id:'||
308: l_pea_rec.prtt_enrt_actn_id, 10);
309: end if;
310: --
311: end loop;
309: end if;
310: --
311: end loop;
312:
313: hr_utility.set_location('Leaving '||l_proc,1);
314:
315: end main;
316:
317: procedure reinstate_dpnt(p_pgm_id in number,
579: l_elig_cvrd_dpnt_id ben_elig_cvrd_dpnt_f.elig_cvrd_dpnt_id%TYPE;
580:
581: begin
582: --
583: hr_utility.set_location('Entering: '||l_proc,10);
584: hr_utility.set_location('program : '||p_pgm_id,745);
585: hr_utility.set_location('plan : ' ||p_pl_id,745);
586: hr_utility.set_location('option : ' ||p_oipl_id,745);
587: hr_utility.set_location('p_elig_per_elctbl_chc_id : ' ||p_elig_per_elctbl_chc_id,745);
580:
581: begin
582: --
583: hr_utility.set_location('Entering: '||l_proc,10);
584: hr_utility.set_location('program : '||p_pgm_id,745);
585: hr_utility.set_location('plan : ' ||p_pl_id,745);
586: hr_utility.set_location('option : ' ||p_oipl_id,745);
587: hr_utility.set_location('p_elig_per_elctbl_chc_id : ' ||p_elig_per_elctbl_chc_id,745);
588: hr_utility.set_location('eff date : ' ||p_effective_date,745 );
581: begin
582: --
583: hr_utility.set_location('Entering: '||l_proc,10);
584: hr_utility.set_location('program : '||p_pgm_id,745);
585: hr_utility.set_location('plan : ' ||p_pl_id,745);
586: hr_utility.set_location('option : ' ||p_oipl_id,745);
587: hr_utility.set_location('p_elig_per_elctbl_chc_id : ' ||p_elig_per_elctbl_chc_id,745);
588: hr_utility.set_location('eff date : ' ||p_effective_date,745 );
589:
582: --
583: hr_utility.set_location('Entering: '||l_proc,10);
584: hr_utility.set_location('program : '||p_pgm_id,745);
585: hr_utility.set_location('plan : ' ||p_pl_id,745);
586: hr_utility.set_location('option : ' ||p_oipl_id,745);
587: hr_utility.set_location('p_elig_per_elctbl_chc_id : ' ||p_elig_per_elctbl_chc_id,745);
588: hr_utility.set_location('eff date : ' ||p_effective_date,745 );
589:
590: ---- Pl ty and opt id is determined for pl type and opt validation # 2508745
583: hr_utility.set_location('Entering: '||l_proc,10);
584: hr_utility.set_location('program : '||p_pgm_id,745);
585: hr_utility.set_location('plan : ' ||p_pl_id,745);
586: hr_utility.set_location('option : ' ||p_oipl_id,745);
587: hr_utility.set_location('p_elig_per_elctbl_chc_id : ' ||p_elig_per_elctbl_chc_id,745);
588: hr_utility.set_location('eff date : ' ||p_effective_date,745 );
589:
590: ---- Pl ty and opt id is determined for pl type and opt validation # 2508745
591: open c_pl_typ ;
584: hr_utility.set_location('program : '||p_pgm_id,745);
585: hr_utility.set_location('plan : ' ||p_pl_id,745);
586: hr_utility.set_location('option : ' ||p_oipl_id,745);
587: hr_utility.set_location('p_elig_per_elctbl_chc_id : ' ||p_elig_per_elctbl_chc_id,745);
588: hr_utility.set_location('eff date : ' ||p_effective_date,745 );
589:
590: ---- Pl ty and opt id is determined for pl type and opt validation # 2508745
591: open c_pl_typ ;
592: fetch c_pl_typ into l_pl_typ_id ;
595: open c_opt ;
596: fetch c_opt into l_opt_id ;
597: close c_opt ;
598:
599: hr_utility.set_location('option : ' ||l_opt_id,745);
600: hr_utility.set_location('pl type : ' ||l_pl_typ_id,745);
601:
602: if p_prev_prtt_enrt_rslt_id is not null then
603:
596: fetch c_opt into l_opt_id ;
597: close c_opt ;
598:
599: hr_utility.set_location('option : ' ||l_opt_id,745);
600: hr_utility.set_location('pl type : ' ||l_pl_typ_id,745);
601:
602: if p_prev_prtt_enrt_rslt_id is not null then
603:
604: l_rslt_id := p_prev_prtt_enrt_rslt_id ;
601:
602: if p_prev_prtt_enrt_rslt_id is not null then
603:
604: l_rslt_id := p_prev_prtt_enrt_rslt_id ;
605: hr_utility.set_location('p_prev_prtt_enrt_rslt_id after result',745 );
606: open c_previous_result_id_result ;
607: fetch c_previous_result_id_result into l_old_cvg_strt_dt ,l_pil_id;
608: if c_previous_result_id_result%notfound then
609: hr_utility.set_location('0 null : '||l_proc,745);
605: hr_utility.set_location('p_prev_prtt_enrt_rslt_id after result',745 );
606: open c_previous_result_id_result ;
607: fetch c_previous_result_id_result into l_old_cvg_strt_dt ,l_pil_id;
608: if c_previous_result_id_result%notfound then
609: hr_utility.set_location('0 null : '||l_proc,745);
610: end if ;
611: close c_previous_result_id_result;
612:
613: else
616: if p_oipl_id is not null then
617: open c_previous_ptip_oipl_result;
618: fetch c_previous_ptip_oipl_result into l_rslt_id,l_old_cvg_strt_dt ,l_pil_id;
619: if c_previous_ptip_oipl_result%notfound then null;
620: hr_utility.set_location('1 null : '||l_proc,745);
621: end if;
622: close c_previous_ptip_oipl_result;
623: hr_utility.set_location('1 : '||l_proc,745);
624:
619: if c_previous_ptip_oipl_result%notfound then null;
620: hr_utility.set_location('1 null : '||l_proc,745);
621: end if;
622: close c_previous_ptip_oipl_result;
623: hr_utility.set_location('1 : '||l_proc,745);
624:
625: else
626: open c_previous_pgm_ptip_result;
627: fetch c_previous_pgm_ptip_result into l_rslt_id,l_old_cvg_strt_dt ,l_pil_id;
627: fetch c_previous_pgm_ptip_result into l_rslt_id,l_old_cvg_strt_dt ,l_pil_id;
628: if c_previous_pgm_ptip_result%notfound then null;
629: end if;
630: close c_previous_pgm_ptip_result;
631: hr_utility.set_location('2 : '||l_proc,745);
632: end if;
633: else
634:
635: if p_oipl_id is not null then
635: if p_oipl_id is not null then
636: open c_previous_pl_oipl_result;
637: fetch c_previous_pl_oipl_result into l_rslt_id,l_old_cvg_strt_dt ,l_pil_id;
638: if c_previous_pl_oipl_result%notfound then null;
639: hr_utility.set_location('3 null : '||l_proc,745);
640: end if;
641: close c_previous_pl_oipl_result;
642: hr_utility.set_location('3 : '||l_proc,745);
643: elsif p_oipl_id is null then
638: if c_previous_pl_oipl_result%notfound then null;
639: hr_utility.set_location('3 null : '||l_proc,745);
640: end if;
641: close c_previous_pl_oipl_result;
642: hr_utility.set_location('3 : '||l_proc,745);
643: elsif p_oipl_id is null then
644: open c_previous_pl_result;
645: fetch c_previous_pl_result into l_rslt_id,l_old_cvg_strt_dt ,l_pil_id;
646: if c_previous_pl_result%notfound then null;
643: elsif p_oipl_id is null then
644: open c_previous_pl_result;
645: fetch c_previous_pl_result into l_rslt_id,l_old_cvg_strt_dt ,l_pil_id;
646: if c_previous_pl_result%notfound then null;
647: hr_utility.set_location('4 nul : '||l_proc,745);
648: end if;
649: close c_previous_pl_result;
650: hr_utility.set_location('4 : '||l_proc,745);
651: end if;
646: if c_previous_pl_result%notfound then null;
647: hr_utility.set_location('4 nul : '||l_proc,745);
648: end if;
649: close c_previous_pl_result;
650: hr_utility.set_location('4 : '||l_proc,745);
651: end if;
652: end if;
653: end if ; --- p_prev_prtt_enrt_rslt_id
654:
653: end if ; --- p_prev_prtt_enrt_rslt_id
654:
655: if l_rslt_id is not null and l_pil_id is not null then
656:
657: hr_utility.set_location('Reinstating dependent person id',99);
658: hr_utility.set_location('pil id '|| l_pil_id ,99);
659: hr_utility.set_location('rslt id '|| l_rslt_id ,99);
660: hr_utility.set_location('cvg start '|| l_old_cvg_strt_dt ,99);
661:
654:
655: if l_rslt_id is not null and l_pil_id is not null then
656:
657: hr_utility.set_location('Reinstating dependent person id',99);
658: hr_utility.set_location('pil id '|| l_pil_id ,99);
659: hr_utility.set_location('rslt id '|| l_rslt_id ,99);
660: hr_utility.set_location('cvg start '|| l_old_cvg_strt_dt ,99);
661:
662: --- # 2623034 Find out the maximum required dpnt
655: if l_rslt_id is not null and l_pil_id is not null then
656:
657: hr_utility.set_location('Reinstating dependent person id',99);
658: hr_utility.set_location('pil id '|| l_pil_id ,99);
659: hr_utility.set_location('rslt id '|| l_rslt_id ,99);
660: hr_utility.set_location('cvg start '|| l_old_cvg_strt_dt ,99);
661:
662: --- # 2623034 Find out the maximum required dpnt
663: --- Validate every groep of relation match with
656:
657: hr_utility.set_location('Reinstating dependent person id',99);
658: hr_utility.set_location('pil id '|| l_pil_id ,99);
659: hr_utility.set_location('rslt id '|| l_rslt_id ,99);
660: hr_utility.set_location('cvg start '|| l_old_cvg_strt_dt ,99);
661:
662: --- # 2623034 Find out the maximum required dpnt
663: --- Validate every groep of relation match with
664:
669: fetch c_total_rqmt into l_ttl_max_num, l_ttl_no_max_flag,l_dsgn_rqmt_id,l_grp_rlshp_cd;
670: if c_total_rqmt%notfound then
671: exit ;
672: end if;
673: hr_utility.set_location(' grp_rlshp_cd ' || l_grp_rlshp_cd, 99 );
674: hr_utility.set_location(' l_dsgn_rqmt_id ' || l_dsgn_rqmt_id, 99 );
675: hr_utility.set_location(' ttl_no_max_flag ' || l_ttl_no_max_flag, 99 );
676: hr_utility.set_location(' ttl_max_num ' || l_ttl_max_num, 99 );
677: l_tot_elig_dpnt := 0 ;
670: if c_total_rqmt%notfound then
671: exit ;
672: end if;
673: hr_utility.set_location(' grp_rlshp_cd ' || l_grp_rlshp_cd, 99 );
674: hr_utility.set_location(' l_dsgn_rqmt_id ' || l_dsgn_rqmt_id, 99 );
675: hr_utility.set_location(' ttl_no_max_flag ' || l_ttl_no_max_flag, 99 );
676: hr_utility.set_location(' ttl_max_num ' || l_ttl_max_num, 99 );
677: l_tot_elig_dpnt := 0 ;
678: open c_tot_elig_dpnt (l_pil_id,l_rslt_id,l_dsgn_rqmt_id,l_grp_rlshp_cd) ;
671: exit ;
672: end if;
673: hr_utility.set_location(' grp_rlshp_cd ' || l_grp_rlshp_cd, 99 );
674: hr_utility.set_location(' l_dsgn_rqmt_id ' || l_dsgn_rqmt_id, 99 );
675: hr_utility.set_location(' ttl_no_max_flag ' || l_ttl_no_max_flag, 99 );
676: hr_utility.set_location(' ttl_max_num ' || l_ttl_max_num, 99 );
677: l_tot_elig_dpnt := 0 ;
678: open c_tot_elig_dpnt (l_pil_id,l_rslt_id,l_dsgn_rqmt_id,l_grp_rlshp_cd) ;
679: fetch c_tot_elig_dpnt into l_tot_elig_dpnt ;
672: end if;
673: hr_utility.set_location(' grp_rlshp_cd ' || l_grp_rlshp_cd, 99 );
674: hr_utility.set_location(' l_dsgn_rqmt_id ' || l_dsgn_rqmt_id, 99 );
675: hr_utility.set_location(' ttl_no_max_flag ' || l_ttl_no_max_flag, 99 );
676: hr_utility.set_location(' ttl_max_num ' || l_ttl_max_num, 99 );
677: l_tot_elig_dpnt := 0 ;
678: open c_tot_elig_dpnt (l_pil_id,l_rslt_id,l_dsgn_rqmt_id,l_grp_rlshp_cd) ;
679: fetch c_tot_elig_dpnt into l_tot_elig_dpnt ;
680: close c_tot_elig_dpnt ;
677: l_tot_elig_dpnt := 0 ;
678: open c_tot_elig_dpnt (l_pil_id,l_rslt_id,l_dsgn_rqmt_id,l_grp_rlshp_cd) ;
679: fetch c_tot_elig_dpnt into l_tot_elig_dpnt ;
680: close c_tot_elig_dpnt ;
681: hr_utility.set_location(' total eligible ' || l_tot_elig_dpnt, 99 );
682: if l_ttl_no_max_flag = 'N' and
683: nvl(l_tot_elig_dpnt,0) > l_ttl_max_num then
684: l_tot_rqmt_allow := 'N' ;
685: -- exit ;
685: -- exit ;
686: end if ;
687: End loop ;
688: close c_total_rqmt ;
689: hr_utility.set_location(' l_tot_rqmt_allow ' || l_tot_rqmt_allow, 99 );
690:
691:
692: if l_tot_rqmt_allow = 'Y' then
693: -- Create the dependents row.
692: if l_tot_rqmt_allow = 'Y' then
693: -- Create the dependents row.
694: for l_prev_pen_dpnts in c_prev_pen_dpnts(l_rslt_id,l_pil_id) loop
695: --
696: hr_utility.set_location('Reinstating dependent in loop ',99);
697: hr_utility.set_location('p_dpnt_cvg_strt_dt_cd '|| p_dpnt_cvg_strt_dt_cd,99);
698: if p_dpnt_cvg_strt_dt_cd is null then
699: --
700: fnd_message.set_name('BEN','BEN_92558_DPNT_CVG_CD');
693: -- Create the dependents row.
694: for l_prev_pen_dpnts in c_prev_pen_dpnts(l_rslt_id,l_pil_id) loop
695: --
696: hr_utility.set_location('Reinstating dependent in loop ',99);
697: hr_utility.set_location('p_dpnt_cvg_strt_dt_cd '|| p_dpnt_cvg_strt_dt_cd,99);
698: if p_dpnt_cvg_strt_dt_cd is null then
699: --
700: fnd_message.set_name('BEN','BEN_92558_DPNT_CVG_CD');
701: fnd_message.raise_error;
719:
720: if l_cvg_strt_dt < p_enrt_cvg_strt_dt then
721: l_cvg_strt_dt := p_enrt_cvg_strt_dt;
722: end if;
723: hr_utility.set_location('Cvg start dt ='||to_char(l_cvg_strt_dt), 25);
724: --hook the depenedent to the new enrollment result.
725: open c_epe_dpnt(p_elig_per_elctbl_chc_id,l_prev_pen_dpnts.dpnt_person_id);
726: fetch c_epe_dpnt into l_epe_dpnt_rec;
727: if c_epe_dpnt%notfound then
744: end loop;
745: End if ;
746: end if;
747: --
748: hr_utility.set_location('Leaving: '||l_proc,10);
749: --
750: end reinstate_dpnt;
751: --
752: ----------------------------------------------------------------------------------------
806: begin
807: --
808: l_effective_date := p_effective_date;
809: if (g_debug) then
810: hr_utility.set_location('Entering reinstate_prvdd_ctfn_items ', 10);
811: end if;
812: --
813: for l_prvdd_ctfns in c_prvdd_ctfns_past_pil
814: loop
813: for l_prvdd_ctfns in c_prvdd_ctfns_past_pil
814: loop
815: --
816: if (g_debug) then
817: hr_utility.set_location('l_effective_date ' || l_effective_date, 10);
818: hr_utility.set_location('l_prvdd_ctfns.effective_start_date ' || l_prvdd_ctfns.effective_start_date, 10);
819: hr_utility.set_location('l_prvdd_ctfns.effective_end_date ' || l_prvdd_ctfns.effective_end_date, 10);
820: hr_utility.set_location('l_prvdd_ctfns.prtt_enrt_actn_id ' || l_prvdd_ctfns.prtt_enrt_actn_id, 10);
821: hr_utility.set_location('l_prvdd_ctfns.prev_prtt_enrt_actn_id ' || l_prvdd_ctfns.prev_prtt_enrt_actn_id, 10);
814: loop
815: --
816: if (g_debug) then
817: hr_utility.set_location('l_effective_date ' || l_effective_date, 10);
818: hr_utility.set_location('l_prvdd_ctfns.effective_start_date ' || l_prvdd_ctfns.effective_start_date, 10);
819: hr_utility.set_location('l_prvdd_ctfns.effective_end_date ' || l_prvdd_ctfns.effective_end_date, 10);
820: hr_utility.set_location('l_prvdd_ctfns.prtt_enrt_actn_id ' || l_prvdd_ctfns.prtt_enrt_actn_id, 10);
821: hr_utility.set_location('l_prvdd_ctfns.prev_prtt_enrt_actn_id ' || l_prvdd_ctfns.prev_prtt_enrt_actn_id, 10);
822: hr_utility.set_location('l_prvdd_ctfns.prtt_enrt_ctfn_prvdd_id' || l_prvdd_ctfns.prtt_enrt_ctfn_prvdd_id, 10);
815: --
816: if (g_debug) then
817: hr_utility.set_location('l_effective_date ' || l_effective_date, 10);
818: hr_utility.set_location('l_prvdd_ctfns.effective_start_date ' || l_prvdd_ctfns.effective_start_date, 10);
819: hr_utility.set_location('l_prvdd_ctfns.effective_end_date ' || l_prvdd_ctfns.effective_end_date, 10);
820: hr_utility.set_location('l_prvdd_ctfns.prtt_enrt_actn_id ' || l_prvdd_ctfns.prtt_enrt_actn_id, 10);
821: hr_utility.set_location('l_prvdd_ctfns.prev_prtt_enrt_actn_id ' || l_prvdd_ctfns.prev_prtt_enrt_actn_id, 10);
822: hr_utility.set_location('l_prvdd_ctfns.prtt_enrt_ctfn_prvdd_id' || l_prvdd_ctfns.prtt_enrt_ctfn_prvdd_id, 10);
823: hr_utility.set_location('l_prvdd_ctfns.enrt_ctfn_recd_dt' || l_prvdd_ctfns.enrt_ctfn_recd_dt, 10);
816: if (g_debug) then
817: hr_utility.set_location('l_effective_date ' || l_effective_date, 10);
818: hr_utility.set_location('l_prvdd_ctfns.effective_start_date ' || l_prvdd_ctfns.effective_start_date, 10);
819: hr_utility.set_location('l_prvdd_ctfns.effective_end_date ' || l_prvdd_ctfns.effective_end_date, 10);
820: hr_utility.set_location('l_prvdd_ctfns.prtt_enrt_actn_id ' || l_prvdd_ctfns.prtt_enrt_actn_id, 10);
821: hr_utility.set_location('l_prvdd_ctfns.prev_prtt_enrt_actn_id ' || l_prvdd_ctfns.prev_prtt_enrt_actn_id, 10);
822: hr_utility.set_location('l_prvdd_ctfns.prtt_enrt_ctfn_prvdd_id' || l_prvdd_ctfns.prtt_enrt_ctfn_prvdd_id, 10);
823: hr_utility.set_location('l_prvdd_ctfns.enrt_ctfn_recd_dt' || l_prvdd_ctfns.enrt_ctfn_recd_dt, 10);
824: hr_utility.set_location('l_prvdd_ctfns.ENRT_CTFN_TYP_CD' || l_prvdd_ctfns.ENRT_CTFN_TYP_CD, 10);
817: hr_utility.set_location('l_effective_date ' || l_effective_date, 10);
818: hr_utility.set_location('l_prvdd_ctfns.effective_start_date ' || l_prvdd_ctfns.effective_start_date, 10);
819: hr_utility.set_location('l_prvdd_ctfns.effective_end_date ' || l_prvdd_ctfns.effective_end_date, 10);
820: hr_utility.set_location('l_prvdd_ctfns.prtt_enrt_actn_id ' || l_prvdd_ctfns.prtt_enrt_actn_id, 10);
821: hr_utility.set_location('l_prvdd_ctfns.prev_prtt_enrt_actn_id ' || l_prvdd_ctfns.prev_prtt_enrt_actn_id, 10);
822: hr_utility.set_location('l_prvdd_ctfns.prtt_enrt_ctfn_prvdd_id' || l_prvdd_ctfns.prtt_enrt_ctfn_prvdd_id, 10);
823: hr_utility.set_location('l_prvdd_ctfns.enrt_ctfn_recd_dt' || l_prvdd_ctfns.enrt_ctfn_recd_dt, 10);
824: hr_utility.set_location('l_prvdd_ctfns.ENRT_CTFN_TYP_CD' || l_prvdd_ctfns.ENRT_CTFN_TYP_CD, 10);
825: end if;
818: hr_utility.set_location('l_prvdd_ctfns.effective_start_date ' || l_prvdd_ctfns.effective_start_date, 10);
819: hr_utility.set_location('l_prvdd_ctfns.effective_end_date ' || l_prvdd_ctfns.effective_end_date, 10);
820: hr_utility.set_location('l_prvdd_ctfns.prtt_enrt_actn_id ' || l_prvdd_ctfns.prtt_enrt_actn_id, 10);
821: hr_utility.set_location('l_prvdd_ctfns.prev_prtt_enrt_actn_id ' || l_prvdd_ctfns.prev_prtt_enrt_actn_id, 10);
822: hr_utility.set_location('l_prvdd_ctfns.prtt_enrt_ctfn_prvdd_id' || l_prvdd_ctfns.prtt_enrt_ctfn_prvdd_id, 10);
823: hr_utility.set_location('l_prvdd_ctfns.enrt_ctfn_recd_dt' || l_prvdd_ctfns.enrt_ctfn_recd_dt, 10);
824: hr_utility.set_location('l_prvdd_ctfns.ENRT_CTFN_TYP_CD' || l_prvdd_ctfns.ENRT_CTFN_TYP_CD, 10);
825: end if;
826: --
819: hr_utility.set_location('l_prvdd_ctfns.effective_end_date ' || l_prvdd_ctfns.effective_end_date, 10);
820: hr_utility.set_location('l_prvdd_ctfns.prtt_enrt_actn_id ' || l_prvdd_ctfns.prtt_enrt_actn_id, 10);
821: hr_utility.set_location('l_prvdd_ctfns.prev_prtt_enrt_actn_id ' || l_prvdd_ctfns.prev_prtt_enrt_actn_id, 10);
822: hr_utility.set_location('l_prvdd_ctfns.prtt_enrt_ctfn_prvdd_id' || l_prvdd_ctfns.prtt_enrt_ctfn_prvdd_id, 10);
823: hr_utility.set_location('l_prvdd_ctfns.enrt_ctfn_recd_dt' || l_prvdd_ctfns.enrt_ctfn_recd_dt, 10);
824: hr_utility.set_location('l_prvdd_ctfns.ENRT_CTFN_TYP_CD' || l_prvdd_ctfns.ENRT_CTFN_TYP_CD, 10);
825: end if;
826: --
827: if (l_effective_date > l_prvdd_ctfns.effective_start_date) then
820: hr_utility.set_location('l_prvdd_ctfns.prtt_enrt_actn_id ' || l_prvdd_ctfns.prtt_enrt_actn_id, 10);
821: hr_utility.set_location('l_prvdd_ctfns.prev_prtt_enrt_actn_id ' || l_prvdd_ctfns.prev_prtt_enrt_actn_id, 10);
822: hr_utility.set_location('l_prvdd_ctfns.prtt_enrt_ctfn_prvdd_id' || l_prvdd_ctfns.prtt_enrt_ctfn_prvdd_id, 10);
823: hr_utility.set_location('l_prvdd_ctfns.enrt_ctfn_recd_dt' || l_prvdd_ctfns.enrt_ctfn_recd_dt, 10);
824: hr_utility.set_location('l_prvdd_ctfns.ENRT_CTFN_TYP_CD' || l_prvdd_ctfns.ENRT_CTFN_TYP_CD, 10);
825: end if;
826: --
827: if (l_effective_date > l_prvdd_ctfns.effective_start_date) then
828: l_datetrack_mode := hr_api.g_update;
1171: l_rdefault_table_cnt number;
1172: --
1173: begin
1174: --
1175: g_debug := hr_utility.debug_enabled;
1176: --
1177: hr_utility.set_location('Entering: '||l_proc,10);
1178: --
1179: -- ben_env_object.get(p_rec => l_rec);
1173: begin
1174: --
1175: g_debug := hr_utility.debug_enabled;
1176: --
1177: hr_utility.set_location('Entering: '||l_proc,10);
1178: --
1179: -- ben_env_object.get(p_rec => l_rec);
1180: --
1181: hr_utility.set_location('Effective date: '||p_effective_date,10);
1177: hr_utility.set_location('Entering: '||l_proc,10);
1178: --
1179: -- ben_env_object.get(p_rec => l_rec);
1180: --
1181: hr_utility.set_location('Effective date: '||p_effective_date,10);
1182: --
1183: ben_sspndd_enrollment.g_cfw_flag := 'Y';
1184: --
1185: l_pen_count := 0;
1196: l_bnft := l_bnft_reset; -- BBULUSU CODE
1197: --
1198: fetch c_choice_info into l_choice_info;
1199: --
1200: hr_utility.set_location('cvg strt cd: '||l_choice_info.dpnt_cvg_strt_dt_cd,10);
1201: hr_utility.set_location('epe id : '||l_choice_info.elig_per_elctbl_chc_id,10);
1202: --
1203: exit when c_choice_info%notfound;
1204: --
1197: --
1198: fetch c_choice_info into l_choice_info;
1199: --
1200: hr_utility.set_location('cvg strt cd: '||l_choice_info.dpnt_cvg_strt_dt_cd,10);
1201: hr_utility.set_location('epe id : '||l_choice_info.elig_per_elctbl_chc_id,10);
1202: --
1203: exit when c_choice_info%notfound;
1204: --
1205: -- Get participant enrollment result information
1203: exit when c_choice_info%notfound;
1204: --
1205: -- Get participant enrollment result information
1206:
1207: hr_utility.set_location('cvg strt cd: '||l_choice_info.dpnt_cvg_strt_dt_cd,10);
1208: hr_utility.set_location('epe id : '||l_choice_info.elig_per_elctbl_chc_id,10);
1209: --
1210: if l_choice_info.crntly_enrd_flag = 'Y' then
1211: --
1204: --
1205: -- Get participant enrollment result information
1206:
1207: hr_utility.set_location('cvg strt cd: '||l_choice_info.dpnt_cvg_strt_dt_cd,10);
1208: hr_utility.set_location('epe id : '||l_choice_info.elig_per_elctbl_chc_id,10);
1209: --
1210: if l_choice_info.crntly_enrd_flag = 'Y' then
1211: --
1212: open c_prtt_result(l_choice_info.prtt_enrt_rslt_id,
1244: --
1245: -- Get benefit information
1246: --
1247: l_dflt_found:=false;
1248: hr_utility.set_location(l_proc,20);
1249: open c_bnft(l_choice_info.elig_per_elctbl_chc_id, l_prtt_result.bnft_ordr_num );
1250: fetch c_bnft into l_bnft;
1251: close c_bnft;
1252: --
1251: close c_bnft;
1252: --
1253: /*
1254: loop
1255: hr_utility.set_location(l_proc,30);
1256: --
1257: fetch c_bnft into l_bnft;
1258: --
1259: exit when c_bnft%notfound;
1256: --
1257: fetch c_bnft into l_bnft;
1258: --
1259: exit when c_bnft%notfound;
1260: hr_utility.set_location(l_proc,40);
1261: if l_bnft.dflt_flag='Y' then
1262: hr_utility.set_location(l_proc,50);
1263: l_dflt_bnft:=l_bnft;
1264: l_dflt_found:=true;
1258: --
1259: exit when c_bnft%notfound;
1260: hr_utility.set_location(l_proc,40);
1261: if l_bnft.dflt_flag='Y' then
1262: hr_utility.set_location(l_proc,50);
1263: l_dflt_bnft:=l_bnft;
1264: l_dflt_found:=true;
1265: end if;
1266: hr_utility.set_location(l_proc,60);
1262: hr_utility.set_location(l_proc,50);
1263: l_dflt_bnft:=l_bnft;
1264: l_dflt_found:=true;
1265: end if;
1266: hr_utility.set_location(l_proc,60);
1267: end loop;
1268: hr_utility.set_location(l_proc,70);
1269: close c_bnft;
1270: */
1264: l_dflt_found:=true;
1265: end if;
1266: hr_utility.set_location(l_proc,60);
1267: end loop;
1268: hr_utility.set_location(l_proc,70);
1269: close c_bnft;
1270: */
1271: --
1272: hr_utility.set_location(l_proc||l_bnft.val,90);
1268: hr_utility.set_location(l_proc,70);
1269: close c_bnft;
1270: */
1271: --
1272: hr_utility.set_location(l_proc||l_bnft.val,90);
1273: hr_utility.set_location('ENB ID'||l_bnft.enrt_bnft_id,90);
1274: --
1275: -- Get Rate information
1276: --
1269: close c_bnft;
1270: */
1271: --
1272: hr_utility.set_location(l_proc||l_bnft.val,90);
1273: hr_utility.set_location('ENB ID'||l_bnft.enrt_bnft_id,90);
1274: --
1275: -- Get Rate information
1276: --
1277: for l_count in 1..10 loop
1323: --end if;
1324: close c_pl_enrt_dt;
1325: end if;
1326: --
1327: hr_utility.set_location('cvg_mlt_cd='||l_bnft.cvg_mlt_cd,13);
1328: hr_utility.set_location('bnft_val='||l_bnft.val,13);
1329: hr_utility.set_location('rate_val='||l_rt_table(1).dflt_val,13);
1330: hr_utility.set_location('ann_rt_val='||l_rt_table(1).ann_rt_val,13);
1331: --
1324: close c_pl_enrt_dt;
1325: end if;
1326: --
1327: hr_utility.set_location('cvg_mlt_cd='||l_bnft.cvg_mlt_cd,13);
1328: hr_utility.set_location('bnft_val='||l_bnft.val,13);
1329: hr_utility.set_location('rate_val='||l_rt_table(1).dflt_val,13);
1330: hr_utility.set_location('ann_rt_val='||l_rt_table(1).ann_rt_val,13);
1331: --
1332: if l_bnft.cvg_mlt_cd='SAAEAR' and
1325: end if;
1326: --
1327: hr_utility.set_location('cvg_mlt_cd='||l_bnft.cvg_mlt_cd,13);
1328: hr_utility.set_location('bnft_val='||l_bnft.val,13);
1329: hr_utility.set_location('rate_val='||l_rt_table(1).dflt_val,13);
1330: hr_utility.set_location('ann_rt_val='||l_rt_table(1).ann_rt_val,13);
1331: --
1332: if l_bnft.cvg_mlt_cd='SAAEAR' and
1333: l_rt_table(1).ann_rt_val is null then
1326: --
1327: hr_utility.set_location('cvg_mlt_cd='||l_bnft.cvg_mlt_cd,13);
1328: hr_utility.set_location('bnft_val='||l_bnft.val,13);
1329: hr_utility.set_location('rate_val='||l_rt_table(1).dflt_val,13);
1330: hr_utility.set_location('ann_rt_val='||l_rt_table(1).ann_rt_val,13);
1331: --
1332: if l_bnft.cvg_mlt_cd='SAAEAR' and
1333: l_rt_table(1).ann_rt_val is null then
1334: l_rt_table(1).ann_rt_val:=l_rt_table(1).dflt_val;
1375: /* Added for Enhancement Bug 8716679
1376: To add the electable choices to pl/sql table that are carry forwarded. This pl/sql
1377: is scanned to check whether the enrollment record is already carry forwarded by the carry foward logic
1378: while defaulting and reinstating the explicit elections from intervening LE */
1379: hr_utility.set_location ('Carry Fwd epe '||l_choice_info.elig_per_elctbl_chc_id,199);
1380: l_rdefault_table_cnt := nvl( ben_lf_evt_clps_restore.g_reinstated_defaults.LAST, 0) + 1;
1381: ben_lf_evt_clps_restore.g_reinstated_defaults(l_rdefault_table_cnt) := l_choice_info.elig_per_elctbl_chc_id;
1382: /* End of Enhancement Bug 8716679*/
1383:
1547: ---
1548: end if ;
1549:
1550:
1551: hr_utility.set_location('l_cryfwd_elig_dpnt_cd '||l_cryfwd_elig_dpnt_cd,744);
1552: hr_utility.set_location('l_prev_prtt_enrt_rslt_id '||l_prev_prtt_enrt_rslt_id,744);
1553:
1554: if l_datetrack_mode = hr_api.g_insert and l_cryfwd_elig_dpnt_cd = 'CFRRWP' then
1555:
1548: end if ;
1549:
1550:
1551: hr_utility.set_location('l_cryfwd_elig_dpnt_cd '||l_cryfwd_elig_dpnt_cd,744);
1552: hr_utility.set_location('l_prev_prtt_enrt_rslt_id '||l_prev_prtt_enrt_rslt_id,744);
1553:
1554: if l_datetrack_mode = hr_api.g_insert and l_cryfwd_elig_dpnt_cd = 'CFRRWP' then
1555:
1556: hr_utility.set_location('cvg strt cd: '||l_choice_info.dpnt_cvg_strt_dt_cd,10);
1552: hr_utility.set_location('l_prev_prtt_enrt_rslt_id '||l_prev_prtt_enrt_rslt_id,744);
1553:
1554: if l_datetrack_mode = hr_api.g_insert and l_cryfwd_elig_dpnt_cd = 'CFRRWP' then
1555:
1556: hr_utility.set_location('cvg strt cd: '||l_choice_info.dpnt_cvg_strt_dt_cd,10);
1557: -- p_effective_date is now changed to l_effective_dt , when ever LE reprocessed
1558: -- result created as on effective date and automeatic enrollment called with
1559: -- lE_ocurd_Dt as affective date so there is no result as on effective date (le_ocrd_dt)
1560: -- this is fixed sending l_effective_dt # 3042033
1660: end if;
1661:
1662: /* Bug 8900007:Reinstate the action items and certifications of carry forwarded enrollments*/
1663: if(ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list.count is not null) then
1664: hr_utility.set_location('sspnd list1 ',310);
1665: if(ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list.count > 0 ) then
1666: for i IN ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list.FIRST..ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list.LAST loop
1667: hr_utility.set_location('sspnd list ' || ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list(i).PGM_ID||' '||
1668: ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list(i).pl_id , 10);
1663: if(ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list.count is not null) then
1664: hr_utility.set_location('sspnd list1 ',310);
1665: if(ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list.count > 0 ) then
1666: for i IN ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list.FIRST..ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list.LAST loop
1667: hr_utility.set_location('sspnd list ' || ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list(i).PGM_ID||' '||
1668: ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list(i).pl_id , 10);
1669: hr_utility.set_location('l_choice_info ' || l_choice_info.pgm_id||' '||l_choice_info.pl_id , 10);
1670: if( nvl(ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list(i).PGM_ID,-1) = nvl(l_choice_info.pgm_id,-1)
1671: and nvl(ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list(i).pl_id,-1) = nvl(l_choice_info.pl_id,-1)
1665: if(ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list.count > 0 ) then
1666: for i IN ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list.FIRST..ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list.LAST loop
1667: hr_utility.set_location('sspnd list ' || ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list(i).PGM_ID||' '||
1668: ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list(i).pl_id , 10);
1669: hr_utility.set_location('l_choice_info ' || l_choice_info.pgm_id||' '||l_choice_info.pl_id , 10);
1670: if( nvl(ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list(i).PGM_ID,-1) = nvl(l_choice_info.pgm_id,-1)
1671: and nvl(ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list(i).pl_id,-1) = nvl(l_choice_info.pl_id,-1)
1672: and nvl(ben_lf_evt_clps_restore.g_bckdt_sspndd_pen_list(i).pl_typ_id,-1) = nvl(l_choice_info.pl_typ_id,-1) ) then
1673: ben_lf_evt_clps_restore.reinstate_pcs_per_pen(
1752: --
1753: if (l_crd_fwd_pen_id.COUNT > 0) then
1754: for i in l_crd_fwd_pen_id.FIRST..l_crd_fwd_pen_id.LAST loop
1755: --
1756: hr_utility.set_location('CRD FWD CERT l_crd_fwd_pen_id(i) ' || l_crd_fwd_pen_id(i) , 10);
1757: --
1758: reinstate_prvdd_ctfn_items(p_prtt_enrt_rslt_id => l_crd_fwd_pen_id(i)
1759: ,p_per_in_ler_id => p_per_in_ler_id
1760: ,p_business_group_id => p_business_group_id
1763: end loop;
1764: end if;
1765: --
1766: ben_sspndd_enrollment.g_cfw_flag := 'N';
1767: hr_utility.set_location('Leaving: '||l_proc,10);
1768: --
1769: exception
1770: when others then
1771: ben_sspndd_enrollment.g_cfw_flag := 'N';
1838: l_prev_prtt_enrt_ctfn_prvdd_id number;
1839: --
1840: begin
1841: --
1842: hr_utility.set_location ('Entering ' || l_proc , 1230);
1843: l_per_in_ler_id := p_per_in_ler_id;
1844: l_prev_prtt_enrt_actn_id := -1;
1845: --
1846: for l_actn_item in c_actn_item_for_past_pil (l_per_in_ler_id) loop
1916: --
1917: end if;
1918: close c_check_prem_active;
1919: --
1920: hr_utility.set_location ('Leaving ' || l_proc, 1230);
1921: end unprocess_susp_enrt_past_pil;
1922: procedure carry_farward_results(
1923: p_person_id in number,
1924: p_per_in_ler_id in number,
1944: l_pen_sus c_pen_sus%rowtype;
1945: --
1946: begin
1947: --
1948: hr_utility.set_location('Entering: '||l_proc,10);
1949: hr_utility.set_location('p_person_id'||p_person_id,10);
1950: hr_utility.set_location('p_per_in_ler_id'||p_per_in_ler_id,10);
1951: hr_utility.set_location('p_business_group_id'||p_business_group_id,10);
1952: hr_utility.set_location('p_mode'||p_mode,10);
1945: --
1946: begin
1947: --
1948: hr_utility.set_location('Entering: '||l_proc,10);
1949: hr_utility.set_location('p_person_id'||p_person_id,10);
1950: hr_utility.set_location('p_per_in_ler_id'||p_per_in_ler_id,10);
1951: hr_utility.set_location('p_business_group_id'||p_business_group_id,10);
1952: hr_utility.set_location('p_mode'||p_mode,10);
1953: hr_utility.set_location('p_effective_date'||p_effective_date,10);
1946: begin
1947: --
1948: hr_utility.set_location('Entering: '||l_proc,10);
1949: hr_utility.set_location('p_person_id'||p_person_id,10);
1950: hr_utility.set_location('p_per_in_ler_id'||p_per_in_ler_id,10);
1951: hr_utility.set_location('p_business_group_id'||p_business_group_id,10);
1952: hr_utility.set_location('p_mode'||p_mode,10);
1953: hr_utility.set_location('p_effective_date'||p_effective_date,10);
1954: --
1947: --
1948: hr_utility.set_location('Entering: '||l_proc,10);
1949: hr_utility.set_location('p_person_id'||p_person_id,10);
1950: hr_utility.set_location('p_per_in_ler_id'||p_per_in_ler_id,10);
1951: hr_utility.set_location('p_business_group_id'||p_business_group_id,10);
1952: hr_utility.set_location('p_mode'||p_mode,10);
1953: hr_utility.set_location('p_effective_date'||p_effective_date,10);
1954: --
1955: if p_mode not in ('L','C', 'M') then
1948: hr_utility.set_location('Entering: '||l_proc,10);
1949: hr_utility.set_location('p_person_id'||p_person_id,10);
1950: hr_utility.set_location('p_per_in_ler_id'||p_per_in_ler_id,10);
1951: hr_utility.set_location('p_business_group_id'||p_business_group_id,10);
1952: hr_utility.set_location('p_mode'||p_mode,10);
1953: hr_utility.set_location('p_effective_date'||p_effective_date,10);
1954: --
1955: if p_mode not in ('L','C', 'M') then
1956: --
1949: hr_utility.set_location('p_person_id'||p_person_id,10);
1950: hr_utility.set_location('p_per_in_ler_id'||p_per_in_ler_id,10);
1951: hr_utility.set_location('p_business_group_id'||p_business_group_id,10);
1952: hr_utility.set_location('p_mode'||p_mode,10);
1953: hr_utility.set_location('p_effective_date'||p_effective_date,10);
1954: --
1955: if p_mode not in ('L','C', 'M') then
1956: --
1957: -- Wrong mode my friend!
1965: p_per_in_ler_id => p_per_in_ler_id,
1966: p_ler_id => p_ler_id,
1967: p_effective_date => p_effective_date);
1968: --
1969: hr_utility.set_location('Leaving: '||l_proc,10);
1970: --
1971: --Reopen the closed action items of the enrollment results for which there are no
1972: --electable choices exists in this life event.
1973: open c_pen_sus;