142: l_dummy varchar2(1);
143:
144: Begin
145:
146: hr_utility.set_location ('Entering '||l_package,5);
147: hr_utility.set_location ('p_elig_per_elctbl_chc_id '||
148: to_char(p_elig_per_elctbl_chc_id),5);
149: hr_utility.set_location ('p_enrt_bnft_id '||
150: to_char(p_enrt_bnft_id),5);
143:
144: Begin
145:
146: hr_utility.set_location ('Entering '||l_package,5);
147: hr_utility.set_location ('p_elig_per_elctbl_chc_id '||
148: to_char(p_elig_per_elctbl_chc_id),5);
149: hr_utility.set_location ('p_enrt_bnft_id '||
150: to_char(p_enrt_bnft_id),5);
151: hr_utility.set_location ('p_enrt_ctfn_typ_cd '||
145:
146: hr_utility.set_location ('Entering '||l_package,5);
147: hr_utility.set_location ('p_elig_per_elctbl_chc_id '||
148: to_char(p_elig_per_elctbl_chc_id),5);
149: hr_utility.set_location ('p_enrt_bnft_id '||
150: to_char(p_enrt_bnft_id),5);
151: hr_utility.set_location ('p_enrt_ctfn_typ_cd '||
152: p_enrt_ctfn_typ_cd,5);
153:
147: hr_utility.set_location ('p_elig_per_elctbl_chc_id '||
148: to_char(p_elig_per_elctbl_chc_id),5);
149: hr_utility.set_location ('p_enrt_bnft_id '||
150: to_char(p_enrt_bnft_id),5);
151: hr_utility.set_location ('p_enrt_ctfn_typ_cd '||
152: p_enrt_ctfn_typ_cd,5);
153:
154: -- if this certificaion type cd has already been attached to the choice,
155: -- don't attach another one. This prevents problems with bad plan
156: -- design setup.
157: open c1;
158: fetch c1 into l_dummy;
159: if c1%FOUND and p_mode not in ('U','R') then
160: hr_utility.set_location ('found ctfn ',5);
161: close c1;
162: else
163: close c1;
164: l_write_ctfn := false;
244: --
245: end if;
246: end if;
247:
248: hr_utility.set_location ('Leaving '||l_package,10);
249:
250: end write_ctfn;
251: --
252: --
290: ctfn.effective_start_date and ctfn.effective_end_date;
291: --
292: begin
293: --
294: hr_utility.set_location ('Entering '||l_package,10);
295: --
296: l_create_ctfn := false;
297: --
298: if p_ctfn_rqd_when_rl is not null then
348: end loop;
349: --
350: end if;
351: --
352: hr_utility.set_location ('Leaving '||l_package,10);
353: --
354: end get_ler_ctfns;
355: --
356: --
418: ctfn.effective_start_date and ctfn.effective_end_date;
419: --
420: begin
421: --
422: hr_utility.set_location ('Entering '||l_package,10);
423: --
424: open c_ler_rstrn;
425: fetch c_ler_rstrn into l_ler_bnft_rstrn_id;
426: --
461: -- Plan Level option jumping certifications.
462: --
463: for l_ctfn in c_pl_rstrn_ctfn loop
464: --
465: hr_utility.set_location ('l_ctfn.enrt_ctfn_typ_cd '||l_ctfn.enrt_ctfn_typ_cd,10);
466:
467: write_ctfn(p_elig_per_elctbl_chc_id => p_elig_per_elctbl_chc_id,
468: p_enrt_ctfn_typ_cd => l_ctfn.enrt_ctfn_typ_cd,
469: p_rqd_flag => l_ctfn.rqd_flag,
485: end loop;
486: --
487: end if;
488: --
489: hr_utility.set_location ('Leaving '||l_package,10);
490: --
491: end write_bnft_rstrn_ctfn;
492: --
493: --
502: l_ctfn_rqd_flag varchar2(30) := 'N';
503: --
504: begin
505: --
506: hr_utility.set_location ('Entering '||l_package,10);
507: --
508: if g_ctfn_created then
509: --
510: l_ctfn_rqd_flag := 'Y';
523: p_effective_date => p_effective_date);
524: --
525: end if;
526: --
527: hr_utility.set_location ('Leaving '||l_package,10);
528: --
529: end update_ctfn_rqd_flag;
530: --
531: -------------------------------------------------------------------------
652: l_jurisdiction_code varchar2(30) := null;
653: --
654: BEGIN
655: --
656: hr_utility.set_location ('Entering '||l_package,10);
657: --
658: -- Edit to ensure that the input p_effective_date has a value
659: --
660: If p_effective_date is null then
717: fetch c_epe into l_epe;
718: if c_epe%found then
719: close c_epe;
720: */
721: hr_utility.set_location (l_package||' Start EPE loop ',10);
722: --
723: l_found := false;
724: g_ctfn_created := false;
725: --
722: --
723: l_found := false;
724: g_ctfn_created := false;
725: --
726: hr_utility.set_location ('l_ler_id '||l_ler_id,55);
727: hr_utility.set_location ('l_pl_id '||l_pl_id,55);
728: hr_utility.set_location ('l_oipl_id '||l_oipl_id,55);
729: hr_utility.set_location ('l_epe.elig_per_elctbl_chc_id '||
730: l_epe.elig_per_elctbl_chc_id,55);
723: l_found := false;
724: g_ctfn_created := false;
725: --
726: hr_utility.set_location ('l_ler_id '||l_ler_id,55);
727: hr_utility.set_location ('l_pl_id '||l_pl_id,55);
728: hr_utility.set_location ('l_oipl_id '||l_oipl_id,55);
729: hr_utility.set_location ('l_epe.elig_per_elctbl_chc_id '||
730: l_epe.elig_per_elctbl_chc_id,55);
731: hr_utility.set_location ('l_epe.object_version_number '||
724: g_ctfn_created := false;
725: --
726: hr_utility.set_location ('l_ler_id '||l_ler_id,55);
727: hr_utility.set_location ('l_pl_id '||l_pl_id,55);
728: hr_utility.set_location ('l_oipl_id '||l_oipl_id,55);
729: hr_utility.set_location ('l_epe.elig_per_elctbl_chc_id '||
730: l_epe.elig_per_elctbl_chc_id,55);
731: hr_utility.set_location ('l_epe.object_version_number '||
732: l_epe.object_version_number,55);
725: --
726: hr_utility.set_location ('l_ler_id '||l_ler_id,55);
727: hr_utility.set_location ('l_pl_id '||l_pl_id,55);
728: hr_utility.set_location ('l_oipl_id '||l_oipl_id,55);
729: hr_utility.set_location ('l_epe.elig_per_elctbl_chc_id '||
730: l_epe.elig_per_elctbl_chc_id,55);
731: hr_utility.set_location ('l_epe.object_version_number '||
732: l_epe.object_version_number,55);
733: --
727: hr_utility.set_location ('l_pl_id '||l_pl_id,55);
728: hr_utility.set_location ('l_oipl_id '||l_oipl_id,55);
729: hr_utility.set_location ('l_epe.elig_per_elctbl_chc_id '||
730: l_epe.elig_per_elctbl_chc_id,55);
731: hr_utility.set_location ('l_epe.object_version_number '||
732: l_epe.object_version_number,55);
733: --
734: l_pl_id := l_epe.pl_id;
735: l_ler_id := l_epe.ler_id;
739: If l_epe.comp_lvl_cd = 'OIPL' then
740: --
741: -- process ler rqrd ctfn if found for oipl
742: --
743: hr_utility.set_location ('Entering oipl ',99);
744: --
745: for l_lre in c_lre_oipl loop
746: --
747: hr_utility.set_location ('Entering oipl lre ',99);
743: hr_utility.set_location ('Entering oipl ',99);
744: --
745: for l_lre in c_lre_oipl loop
746: --
747: hr_utility.set_location ('Entering oipl lre ',99);
748: l_found := true;
749: --
750: get_ler_ctfns
751: (p_ler_rqrs_enrt_ctfn_id => l_lre.ler_rqrs_enrt_ctfn_id ,
768: --
769: if not l_found then
770: for l_ecf in c_ecf_oipl loop
771: --
772: hr_utility.set_location ('Entering oipl ecf',99);
773: l_found := true;
774: --
775: write_ctfn
776: (p_elig_per_elctbl_chc_id => l_epe.elig_per_elctbl_chc_id,
796: end if;
797: --
798: end if;
799: --
800: hr_utility.set_location (l_package||' EPE CLC CHK ',10);
801: if l_epe.comp_lvl_cd in ('OIPL','PLAN','PLANFC','PLANIMP') then
802: --
803: -- process plan ler ctfns
804: --
805: if not l_found then
806: --
807: for l_lre in c_lre_pl loop
808: --
809: hr_utility.set_location ('Entering pl lre',99);
810: l_found := true;
811: --
812: get_ler_ctfns
813: (p_ler_rqrs_enrt_ctfn_id => l_lre.ler_rqrs_enrt_ctfn_id ,
823: p_pl_typ_id => l_epe.pl_typ_id,
824: p_opt_id => l_epe.opt_id,
825: p_ler_id => l_epe.ler_id);
826: --
827: hr_utility.set_location ('Done glerctfns '||l_package,10);
828: --
829: end loop;
830: --
831: --
831: --
832: if not l_found then
833: for l_ecf in c_ecf_pl loop
834: --
835: hr_utility.set_location ('Entering pl ecf',99);
836: l_found := true;
837: --
838: write_ctfn
839: (p_elig_per_elctbl_chc_id => l_epe.elig_per_elctbl_chc_id,
853: p_susp_if_ctfn_not_prvd_flag => l_ecf.susp_if_ctfn_not_prvd_flag,
854: p_ctfn_determine_cd => l_ecf.ctfn_determine_cd,
855: p_mode => g_mode);
856: --
857: hr_utility.set_location ('Done gecfctfns '||l_package,10);
858: --
859: end loop;
860: --
861: end if;
863: end if;
864: --
865: end if;
866: --
867: hr_utility.set_location (l_package||' EPE OIPL ID EPE CRF ',10);
868: if l_epe.oipl_id is not null and l_epe.ctfn_rqd_flag = 'Y' then
869: --
870: -- Write level jumping certifications for OIPL's only if
871: -- bendenrr has already found that certification is required
885: p_effective_date => p_effective_date);
886: --
887: end if;
888: --
889: hr_utility.set_location (l_package||' UCRF ',10);
890: update_ctfn_rqd_flag
891: (p_elig_per_elctbl_chc_id => l_epe.elig_per_elctbl_chc_id,
892: p_ctfn_rqd_flag => l_epe.ctfn_rqd_flag,
893: p_object_version_number => l_epe.object_version_number,
893: p_object_version_number => l_epe.object_version_number,
894: p_business_group_id => l_epe.business_group_id,
895: p_effective_date => p_effective_date);
896: --
897: hr_utility.set_location (l_package||' End EPE loop ',10);
898: /*
899: else
900: close c_epe;
901: */
900: close c_epe;
901: */
902: end if;
903: --
904: hr_utility.set_location ('Leaving '||l_package,10);
905: --
906: end main;
907: --
908: procedure update_susp_if_ctfn_flag(
1047: l_dummy VARCHAR2(30) := 'N';
1048: l_dummy1 VARCHAR2(30) := 'N';
1049: l_dummy2 VARCHAR2(30) := 'N';
1050: begin
1051: hr_utility.set_location ('Entering '||l_package,10);
1052: FOR l_ecc IN c_ecc LOOP
1053: --
1054: hr_utility.set_location ('l_ecc.pgm_id'||l_ecc.pgm_id,20);
1055: hr_utility.set_location ('l_ecc.pl_id '||l_ecc.pl_id,20);
1050: begin
1051: hr_utility.set_location ('Entering '||l_package,10);
1052: FOR l_ecc IN c_ecc LOOP
1053: --
1054: hr_utility.set_location ('l_ecc.pgm_id'||l_ecc.pgm_id,20);
1055: hr_utility.set_location ('l_ecc.pl_id '||l_ecc.pl_id,20);
1056: hr_utility.set_location ('l_ecc.enrt_ctfn_typ_cd '||l_ecc.enrt_ctfn_typ_cd,20);
1057: --
1058: OPEN c_pl_ctfn(l_ecc.pl_id,p_per_in_ler_id,p_effective_date,l_ecc.enrt_ctfn_typ_cd) ;
1051: hr_utility.set_location ('Entering '||l_package,10);
1052: FOR l_ecc IN c_ecc LOOP
1053: --
1054: hr_utility.set_location ('l_ecc.pgm_id'||l_ecc.pgm_id,20);
1055: hr_utility.set_location ('l_ecc.pl_id '||l_ecc.pl_id,20);
1056: hr_utility.set_location ('l_ecc.enrt_ctfn_typ_cd '||l_ecc.enrt_ctfn_typ_cd,20);
1057: --
1058: OPEN c_pl_ctfn(l_ecc.pl_id,p_per_in_ler_id,p_effective_date,l_ecc.enrt_ctfn_typ_cd) ;
1059: FETCH c_pl_ctfn INTO l_dummy ;
1052: FOR l_ecc IN c_ecc LOOP
1053: --
1054: hr_utility.set_location ('l_ecc.pgm_id'||l_ecc.pgm_id,20);
1055: hr_utility.set_location ('l_ecc.pl_id '||l_ecc.pl_id,20);
1056: hr_utility.set_location ('l_ecc.enrt_ctfn_typ_cd '||l_ecc.enrt_ctfn_typ_cd,20);
1057: --
1058: OPEN c_pl_ctfn(l_ecc.pl_id,p_per_in_ler_id,p_effective_date,l_ecc.enrt_ctfn_typ_cd) ;
1059: FETCH c_pl_ctfn INTO l_dummy ;
1060: CLOSE c_pl_ctfn ;
1057: --
1058: OPEN c_pl_ctfn(l_ecc.pl_id,p_per_in_ler_id,p_effective_date,l_ecc.enrt_ctfn_typ_cd) ;
1059: FETCH c_pl_ctfn INTO l_dummy ;
1060: CLOSE c_pl_ctfn ;
1061: hr_utility.set_location(' l_dummy '||l_dummy,30);
1062: IF l_dummy = 'Y' THEN
1063: -- Plan level certification is setup and now check to see current at the plan level
1064: OPEN c_plan_enrolment_info(p_lf_evt_ocrd_dt,
1065: p_person_id,
1067: l_ecc.pl_id) ;
1068: FETCH c_plan_enrolment_info INTO l_dummy1 ;
1069: CLOSE c_plan_enrolment_info ;
1070: --Currently enrolled at plan level
1071: hr_utility.set_location(' Plan Level Certs l_dummy1 '||l_dummy1,40);
1072: IF l_dummy1 = 'Y' THEN
1073: --Currently enrolled in this option, so we need to update the flag
1074: OPEN c_pl_or_oipl_ecc(l_ecc.pl_id) ;
1075: loop
1078: close c_pl_or_oipl_ecc ;
1079: exit ;
1080: end if;
1081: --
1082: hr_utility.set_location(' l_oipl_rec.elctbl_chc_ctfn_id '||l_oipl_rec.elctbl_chc_ctfn_id,50);
1083: l_ecc_ovn := l_oipl_rec.object_version_number ;
1084: --
1085: ben_ELTBL_CHC_CTFN_api.update_ELTBL_CHC_CTFN
1086: (p_elctbl_chc_ctfn_id => l_oipl_rec.elctbl_chc_ctfn_id
1093: END IF;
1094: --
1095: ELSE
1096: -- Plan level certification is not setup, so need to see if current only at the option level
1097: hr_utility.set_location('Cert at Option Level',60);
1098: OPEN c_oipl_ecc(l_ecc.pl_id) ;
1099: loop
1100: fetch c_oipl_ecc INTO l_oipl_rec;
1101: if c_oipl_ecc%notfound then
1107: l_ecc.pgm_id,
1108: l_oipl_rec.oipl_id) ;
1109: FETCH c_oipl_enrolment_info INTO l_dummy2 ;
1110: CLOSE c_oipl_enrolment_info ;
1111: hr_utility.set_location(' l_dummy2 '||l_dummy2,70);
1112: IF l_dummy2 = 'Y' THEN
1113: --Currently enrolled in this option, so we need to update the flag
1114: l_ecc_ovn := l_oipl_rec.object_version_number ;
1115: --
1112: IF l_dummy2 = 'Y' THEN
1113: --Currently enrolled in this option, so we need to update the flag
1114: l_ecc_ovn := l_oipl_rec.object_version_number ;
1115: --
1116: hr_utility.set_location(' l_oipl_rec.elctbl_chc_ctfn_id '||l_oipl_rec.elctbl_chc_ctfn_id,80);
1117: ben_ELTBL_CHC_CTFN_api.update_ELTBL_CHC_CTFN
1118: (p_elctbl_chc_ctfn_id => l_oipl_rec.elctbl_chc_ctfn_id
1119: ,p_susp_if_ctfn_not_prvd_flag => 'N'
1120: ,p_object_version_number => l_ecc_ovn
1126: --
1127: END IF;
1128: --
1129: END LOOP;
1130: hr_utility.set_location ('Leaving '||l_package,10);
1131: end update_susp_if_ctfn_flag ;
1132: --
1133: end BEN_DETERMINE_CHC_CTFN;