90: l_proc varchar2(80) := g_package || '.write_person_category';
91: --
92: begin
93: --
94: hr_utility.set_location ('Entering ' || l_proc, 05);
95: --
96: if p_error then
97: --
98: if p_audit_log = 'Y' then
246: end loop;
247: --
248: end if;
249: --
250: hr_utility.set_location ('Leaving '||l_proc,10);
251: --
252: exception
253: --
254: when others then
278: l_pl_name ben_pl_f.name%TYPE; -- UTF8 varchar2(80);
279: --
280: begin
281: --
282: hr_utility.set_location ('Entering '||l_proc,05);
283: --
284: if p_cnt > 0 then
285: --
286: ben_batch_utils.write
331: end loop;
332: --
333: end if;
334: --
335: hr_utility.set_location ('Leaving ' || l_proc, 10);
336: --
337: end write_pil_elctbl_popl;
338: --
339: -- -----------------------------------------------------------------------------
349: l_request_id number;
350: --
351: begin
352: --
353: hr_utility.set_location ('Entering '||l_proc,05);
354: --
355: if fnd_global.conc_request_id <> -1 then
356: --
357: if upper(p_audit_log) = 'Y' then
383: ,p_report_type => 'ERROR_BY_PERSON');
384: --
385: end if;
386: --
387: hr_utility.set_location ('Leaving '||l_proc,10);
388: --
389: exception
390: --
391: when others then
429: l_voidd_dt date;
430: --
431: begin
432: --
433: hr_utility.set_location('Entering '||l_proc,10);
434: --
435: l_object_version_number := p_object_version_number;
436: --
437: -- No updates need to be done when the status code
473: benutils.update_life_event_cache(p_open_and_closed => 'N');
474: --
475: end if;
476: --
477: hr_utility.set_location('Leaving:'||l_proc, 10);
478: --
479: exception
480: --
481: when others then
714: l_auto_flag boolean := FALSE; --Bug 6144967
715: --
716: begin
717: --
718: hr_utility.set_location ('Entering '||l_proc,10);
719: --
720: -- Make sure all the mandatory input parameters are not null
721: --
722: hr_api.mandatory_arg_error(p_api_name => l_proc
847: --
848: -- PB : When open enrollment called from authentication form if a active
849: -- life event exists and PSR opts closure of the active life event.
850: --
851: hr_utility.set_location('p_close_cd is : ' || p_close_cd, 5);
852: --
853: if p_close_cd = 'PRPENDTR' then
854: --
855: open c_get_pending_approvals;
882: end if;
883: --
884: ----Bug 8531750,check if the Life event has electability or not.
885: l_no_dflt_flag := false;
886: hr_utility.set_location('no default flag', 5);
887: open c_check_elctbl_chc(l_rec.pil_elctbl_chc_popl_id);
888: fetch c_check_elctbl_chc into l_check_elctbl_chc;
889: if c_check_elctbl_chc%notfound then
890: hr_utility.set_location('no electability', 5);
886: hr_utility.set_location('no default flag', 5);
887: open c_check_elctbl_chc(l_rec.pil_elctbl_chc_popl_id);
888: fetch c_check_elctbl_chc into l_check_elctbl_chc;
889: if c_check_elctbl_chc%notfound then
890: hr_utility.set_location('no electability', 5);
891: open c_check_cur_enr(l_rec.pil_elctbl_chc_popl_id);
892: fetch c_check_cur_enr into l_check_cur_enr;
893: if c_check_cur_enr%found then
894: hr_utility.set_location('crntly enrd but no electability', 5);
890: hr_utility.set_location('no electability', 5);
891: open c_check_cur_enr(l_rec.pil_elctbl_chc_popl_id);
892: fetch c_check_cur_enr into l_check_cur_enr;
893: if c_check_cur_enr%found then
894: hr_utility.set_location('crntly enrd but no electability', 5);
895: l_no_dflt_flag := true;
896: end if;
897: close c_check_cur_enr;
898: end if;
904: not l_no_dflt_flag and -----Bug 8531750
905: not l_pend_approvals
906: then
907: --
908: hr_utility.set_location('Defaults will be assigned', 5);
909: --
910: l_dflt_flag := TRUE;
911: l_set_pel_stat_cd := TRUE;
912: --
910: l_dflt_flag := TRUE;
911: l_set_pel_stat_cd := TRUE;
912: --
913: else
914: hr_utility.set_location('Elections have been made or Defaults ' ||
915: 'assigned or No Defaults required', 5);
916: --
917: l_set_pel_stat_cd := TRUE;
918: --
919: end if;
920: --
921: elsif l_rec.cls_enrt_dt_to_use_cd = 'ELCNSMADE' then
922: --
923: hr_utility.set_location('cls_enrt_dt_to_use_cd is ELCNSMADE', 10);
924: --
925: if l_rec.elcns_made_dt is not NULL then
926: --
927: hr_utility.set_location('Elections have been made', 10);
923: hr_utility.set_location('cls_enrt_dt_to_use_cd is ELCNSMADE', 10);
924: --
925: if l_rec.elcns_made_dt is not NULL then
926: --
927: hr_utility.set_location('Elections have been made', 10);
928: --
929: l_set_pel_stat_cd := TRUE;
930: --
931: elsif l_rec.procg_end_dt is not null and
932: l_rec.procg_end_dt <= p_effective_date then
933: --
934: -- Elections not made. Processing end date reached.
935: --
936: hr_utility.set_location('Elections not made. procg_end_dt reached', 10);
937: --
938: if l_rec.dflt_asnd_dt is not null then
939: --
940: -- The defaults have been assigned to the enrollment.
938: if l_rec.dflt_asnd_dt is not null then
939: --
940: -- The defaults have been assigned to the enrollment.
941: --
942: hr_utility.set_location('Defaults assigned.', 10);
943: --
944: l_set_pel_stat_cd := TRUE;
945: --
946: else
946: else
947: --
948: -- Processing end date reached. Defaults not asigned.
949: --
950: hr_utility.set_location('Defaults not assigned.', 10);
951: --
952: if l_rec.dflt_enrt_dt is not null and
953: l_rec.dflt_enrt_dt <= p_effective_date then
954: --
951: --
952: if l_rec.dflt_enrt_dt is not null and
953: l_rec.dflt_enrt_dt <= p_effective_date then
954: --
955: hr_utility.set_location('Defaults will be assigned', 10);
956: --
957: l_dflt_flag := TRUE;
958: l_set_pel_stat_cd := TRUE;
959: --
960: elsif l_rec.dflt_enrt_dt is NULL then
961: --
962: -- This comp-object does not need to be defaulted.
963: --
964: hr_utility.set_location('No action needed.', 10);
965: --
966: l_set_pel_stat_cd := TRUE;
967: --
968: end if;
972: end if;
973: --
974: elsif l_rec.cls_enrt_dt_to_use_cd = 'ENRTPERDEND' then
975: --
976: hr_utility.set_location('cls_enrt_dt_to_use_cd is ENRTPERDEND', 10);
977: --
978: if l_rec.enrt_perd_end_dt is not null and
979: l_rec.enrt_perd_end_dt <= p_effective_date then
980: --
977: --
978: if l_rec.enrt_perd_end_dt is not null and
979: l_rec.enrt_perd_end_dt <= p_effective_date then
980: --
981: hr_utility.set_location('Enrt perd over', 10);
982: --
983: if l_rec.elcns_made_dt is not Null or
984: l_rec.dflt_asnd_dt is not null then
985: --
982: --
983: if l_rec.elcns_made_dt is not Null or
984: l_rec.dflt_asnd_dt is not null then
985: --
986: hr_utility.set_location('Enrt end dt reached. Either elections ' ||
987: 'have been made or enrt defaulted', 10);
988: --
989: l_set_pel_stat_cd := TRUE;
990: --
990: --
991: elsif l_rec.dflt_enrt_dt is not null and
992: l_rec.dflt_enrt_dt <= p_effective_date then
993: --
994: hr_utility.set_location('No defaults yet. Assigning defaults', 10);
995: --
996: l_dflt_flag := TRUE;
997: l_set_pel_stat_cd := TRUE;
998: --
999: elsif l_rec.dflt_enrt_dt is NULL then
1000: --
1001: -- This comp-object does not need to be defaulted.
1002: --
1003: hr_utility.set_location('No action needed.', 10);
1004: --
1005: l_set_pel_stat_cd := TRUE;
1006: --
1007: end if;
1007: end if;
1008: --
1009: elsif l_rec.enrt_perd_end_dt is NULL then
1010: --
1011: hr_utility.set_location('enrt_perd_end date is NULL', 10);
1012: --
1013: fnd_message.set_name('BEN','BEN_91903_ENRT_PERD_END_DT_NUL');
1014: fnd_message.set_token('PROC',l_proc);
1015: fnd_message.set_token('PIL_ELCTBL_CHC_POPL_ID',
1023: end if;
1024: --
1025: elsif l_rec.cls_enrt_dt_to_use_cd = 'PROCGEND' then
1026: --
1027: hr_utility.set_location('cls_enrt_dt_to_use_cd is PROCGEND', 10);
1028: --
1029: if l_rec.procg_end_dt is not null and
1030: l_rec.procg_end_dt <= p_effective_date then
1031: --
1028: --
1029: if l_rec.procg_end_dt is not null and
1030: l_rec.procg_end_dt <= p_effective_date then
1031: --
1032: hr_utility.set_location('Processing end date reached.', 10);
1033: --
1034: if l_rec.elcns_made_dt is not null or
1035: l_rec.dflt_asnd_dt is not null then
1036: --
1034: if l_rec.elcns_made_dt is not null or
1035: l_rec.dflt_asnd_dt is not null then
1036: --
1037: --
1038: hr_utility.set_location('Enrt end dt reached. Either elections ' ||
1039: 'have been made or enrt defaulted', 10);
1040: --
1041: l_set_pel_stat_cd := TRUE;
1042: --
1042: --
1043: elsif l_rec.dflt_enrt_dt is not NULL and
1044: l_rec.dflt_enrt_dt <= p_effective_date then
1045: --
1046: hr_utility.set_location('No defaults yet. Assigning defaults', 10);
1047: --
1048: l_dflt_flag := TRUE;
1049: l_set_pel_stat_cd := TRUE;
1050: --
1051: elsif (l_rec.dflt_enrt_dt is NULL) then
1052: --
1053: -- This comp-object does not need to be defaulted.
1054: --
1055: hr_utility.set_location('No action needed', 10);
1056: --
1057: l_set_pel_stat_cd := TRUE;
1058: --
1059: end if;
1059: end if;
1060: --
1061: elsif l_rec.procg_end_dt is null then
1062: --
1063: hr_utility.set_location('Processing end date is null', 10);
1064: --
1065: fnd_message.set_name('BEN','BEN_91904_PROCG_END_DT_NULL');
1066: fnd_message.set_token('PROC',l_proc);
1067: fnd_message.set_token('PIL_ELCTBL_CHC_POPL_ID',
1075: end if;
1076: --
1077: else
1078: --
1079: hr_utility.set_location('Invalid cls_enrt_dt_cd', 10);
1080: --
1081: fnd_message.set_name('BEN','BEN_91905_INVLD_CLS_ENRT_DT_CD');
1082: fnd_message.set_token('PROC',l_proc);
1083: fnd_message.set_token('CLS_ENRT_DT_TO_USE_CD',
1089: end if;
1090: --
1091: if l_set_pel_stat_cd = TRUE then
1092: --
1093: hr_utility.set_location('Setting pil_elcbl_chc_popl_stat to PROCD', 10);
1094: --
1095:
1096: --Start Bug 6144967
1097:
1154: end if;
1155: --
1156: if l_dflt_flag = TRUE then
1157: --
1158: hr_utility.set_location('Assign defaults', 10);
1159: --
1160: -- Bug 5407755
1161: -- Close enrollment date = nvl ( ( 'Defaults will be assigned on',
1162: -- OR 'Days after Enrollment Period to Apply Defaults'
1169: if l_dflt_enrt_Date is null or p_close_cd = 'FORCE'
1170: then
1171: l_dflt_enrt_date := p_effective_date;
1172: end if;
1173: hr_utility.set_location('ACE l_Dflt_enrt_Date = ' || l_Dflt_enrt_Date, 9999);
1174: ben_manage_default_enrt.default_comp_obj
1175: (p_validate => FALSE
1176: ,p_per_in_ler_id => p_per_in_ler_id
1177: ,p_person_id => l_person_id
1197: open c_chk_epe_exists;
1198: fetch c_chk_epe_exists into l_chk_epe_exists;
1199: close c_chk_epe_exists;
1200: --
1201: hr_utility.set_location('l_set_pil_stat_cd = ' || 'FALSE' , 9999);
1202: hr_utility.set_location('l_pec_cnt = ' || to_char(l_pec_cnt), 9999);
1203: hr_utility.set_location('ELIG_PER_ELCTBL_CHC_ID = ' || l_chk_epe_exists.ELIG_PER_ELCTBL_CHC_ID, 9999);
1204: hr_utility.set_location('l_pil_stat_cd = ' || l_pil_stat_cd, 9999);
1205: --
1198: fetch c_chk_epe_exists into l_chk_epe_exists;
1199: close c_chk_epe_exists;
1200: --
1201: hr_utility.set_location('l_set_pil_stat_cd = ' || 'FALSE' , 9999);
1202: hr_utility.set_location('l_pec_cnt = ' || to_char(l_pec_cnt), 9999);
1203: hr_utility.set_location('ELIG_PER_ELCTBL_CHC_ID = ' || l_chk_epe_exists.ELIG_PER_ELCTBL_CHC_ID, 9999);
1204: hr_utility.set_location('l_pil_stat_cd = ' || l_pil_stat_cd, 9999);
1205: --
1206: -- Third OR condition is for all PEL in PROCD and PIL in STRTD
1199: close c_chk_epe_exists;
1200: --
1201: hr_utility.set_location('l_set_pil_stat_cd = ' || 'FALSE' , 9999);
1202: hr_utility.set_location('l_pec_cnt = ' || to_char(l_pec_cnt), 9999);
1203: hr_utility.set_location('ELIG_PER_ELCTBL_CHC_ID = ' || l_chk_epe_exists.ELIG_PER_ELCTBL_CHC_ID, 9999);
1204: hr_utility.set_location('l_pil_stat_cd = ' || l_pil_stat_cd, 9999);
1205: --
1206: -- Third OR condition is for all PEL in PROCD and PIL in STRTD
1207: --
1200: --
1201: hr_utility.set_location('l_set_pil_stat_cd = ' || 'FALSE' , 9999);
1202: hr_utility.set_location('l_pec_cnt = ' || to_char(l_pec_cnt), 9999);
1203: hr_utility.set_location('ELIG_PER_ELCTBL_CHC_ID = ' || l_chk_epe_exists.ELIG_PER_ELCTBL_CHC_ID, 9999);
1204: hr_utility.set_location('l_pil_stat_cd = ' || l_pil_stat_cd, 9999);
1205: --
1206: -- Third OR condition is for all PEL in PROCD and PIL in STRTD
1207: --
1208: if l_pec_cnt <> 0
1224: -- FALSE so that the per_in_ler is not closed.
1225: --
1226: if l_pec_rec(i).set_flag = 'N' then
1227: --
1228: hr_utility.set_location('PEL not processed. ' ||
1229: 'Cannot set per_in_ler status to PROCD', 10);
1230: --
1231: l_set_pil_stat_cd := FALSE;
1232: --
1243: -- All pel_elctbl_chc records have been processed. We can set per_in_ler.
1244: -- Loop through enrollments for which the prtt is no longer eligible and
1245: -- haven't been closed yet.
1246: --
1247: hr_utility.set_location('set_pil_stat_cd flag is TRUE', 10);
1248: --
1249: for rslt in c_no_lngr_elig
1250: loop
1251: --
1292: if nvl(l_enrt_cvg_end_dt_cd, '-1') <> 'WEM' then
1293: --
1294: -- The end date code is not 'when elections made'. Delete enrt.
1295: --
1296: hr_utility.set_location('End date cd not WEM. Deleting enrt', 10);
1297: --
1298: ben_prtt_enrt_result_api.delete_enrollment
1299: (p_validate => p_validate
1300: ,p_per_in_ler_id => p_per_in_ler_id
1315: -- Close unresolved actn items.
1316: --
1317: if p_close_uneai_flag='Y' then
1318: --
1319: hr_utility.set_location ('effectiv_date=' ||
1320: to_char(p_effective_date,'YYYY/MM/DD HH24:MI:SS'), 05);
1321: --
1322: hr_utility.set_location ('uneai_effectiv_date=' ||
1323: to_char(p_uneai_effective_date,'YYYY/MM/DD HH24:MI:SS'), 05);
1318: --
1319: hr_utility.set_location ('effectiv_date=' ||
1320: to_char(p_effective_date,'YYYY/MM/DD HH24:MI:SS'), 05);
1321: --
1322: hr_utility.set_location ('uneai_effectiv_date=' ||
1323: to_char(p_uneai_effective_date,'YYYY/MM/DD HH24:MI:SS'), 05);
1324: --
1325: ben_cls_unresolved_actn_item.cls_per_unresolved_actn_item
1326: (p_person_id => l_person_id
1419: benutils.write_table_and_file(p_table => TRUE, p_file => TRUE);
1420: --
1421: end if;
1422: --
1423: hr_utility.set_location('Leaving:'||l_proc, 10);
1424: --
1425: exception
1426: --
1427: when others then
1568: -- end bug 3079317
1569:
1570: begin
1571: --
1572: hr_utility.set_location ('Entering '||l_proc,10);
1573: --
1574: /*
1575: l_effective_date := to_date(p_effective_date,'YYYY/MM/DD HH24:MI:SS');
1576: l_effective_date := to_date(to_char(trunc(l_effective_date),'DD/MM/RRRR')
1652: update ben_batch_ranges ran
1653: set ran.range_status_cd = 'P'
1654: where ran.range_id = l_range_id;
1655: --
1656: hr_utility.set_location('Updated range ' || to_char(l_range_id) ||
1657: ' status code to P', 10);
1658: --
1659: commit;
1660: --
1665: open c_person_thread;
1666: --
1667: l_record_number := 0;
1668: --
1669: hr_utility.set_location('Load person actions into the cache', 10);
1670: --
1671: loop
1672: --
1673: fetch c_person_thread into
1696: --
1697: for l_cnt in 1..l_record_number
1698: loop
1699: --
1700: hr_utility.set_location('Closing Enrollment for ' ||
1701: to_char(g_cache_per_proc(l_cnt).person_id), 10);
1702: --
1703: begin
1704: --
1762: end loop;
1763: --
1764: else
1765: --
1766: hr_utility.set_location('No records found. Erroring out.', 10);
1767: --
1768: l_actn := 'Reporting error since there is no record found';
1769: --
1770: fnd_message.set_name('BEN','BEN_91906_PER_NOT_FND_IN_RNG');
1790: --
1791: ben_batch_utils.write_logfile(p_num_pers_processed => g_persons_procd
1792: ,p_num_pers_errored => g_persons_errored);
1793: --
1794: hr_utility.set_location ('Leaving '||l_proc,70);
1795: --
1796: exception
1797: --
1798: when others then
1799: --
1800: rollback;
1801: benutils.write(p_text => sqlerrm);
1802: --
1803: hr_utility.set_location('BENCLENR Super Error ' || l_proc, 10);
1804: --
1805: ben_batch_utils.rpt_error(p_proc => l_proc
1806: ,p_last_actn => l_actn
1807: ,p_rpt_flag => TRUE);
1863: l_proc varchar2(80) := g_package||'.restart';
1864: --
1865: begin
1866: --
1867: hr_utility.set_location ('Entering '||l_proc,10);
1868: --
1869: -- get the parameters for a previous run and do a restart
1870: --
1871: open c_parameters;
1904: ,p_close_uneai_flag => l_parameters.close_uneai_flag
1905: ,p_close_cd => l_parameters.mode_cd -- 1674123
1906: ,p_uneai_effective_date => l_parameters.uneai_effective_date);
1907: --
1908: hr_utility.set_location ('Leaving '||l_proc,70);
1909: --
1910: end restart;
1911: --
1912: -- -----------------------------------------------------------------------------
2048: l_pilid_va g_number_table := g_number_table();
2049:
2050: begin
2051: --
2052: hr_utility.set_location ('Entering ' || l_proc, 10);
2053: -- Bug 5857493
2054: if p_audit_log ='Y' then
2055: ben_batch_utils.g_audit_flag := true;
2056: else
2311: -- for restarting.
2312: --
2313: l_benefit_action_id := p_benefit_action_id;
2314: --
2315: hr_utility.set_location('Restarting for benefit action id : ' ||
2316: to_char(l_benefit_action_id), 10);
2317: --
2318: ben_batch_utils.create_restart_person_actions
2319: (p_benefit_action_id => p_benefit_action_id
2331: -- that got created.
2332: --
2333: if l_num_ranges > 1 then
2334: --
2335: hr_utility.set_location('More than one range got created.', 10);
2336: --
2337: --
2338: -- Set the number of threads to the lesser of the defined number of threads
2339: -- and the number of ranges created above. There's no point in submitting
2347: -- We are subtracting one from the number of threads because the main
2348: -- process will act as the last thread and will be able to keep track of
2349: -- the child requests that get submitted.
2350: --
2351: hr_utility.set_location('Submitting request ' || l_count, 10);
2352: --
2353: l_request_id := fnd_request.submit_request
2354: (application => 'BEN'
2355: ,program => 'BENCLENRS'
2398: end if;
2399: --
2400: -- Carry on with the master. This will ensure that the master finishes last.
2401: --
2402: hr_utility.set_location('Submitting the master process', 10);
2403: --
2404: do_multithread
2405: (errbuf => errbuf
2406: ,retcode => retcode
2425: -- Submit reports.
2426: --
2427: submit_all_reports(p_audit_log => p_audit_log);
2428: --
2429: hr_utility.set_location ('Leaving ' || l_proc, 10);
2430: --
2431: exception
2432: --
2433: when others then
2567: l_pil_rec c_get_strtd_dt%rowtype;
2568: --
2569: begin
2570: --
2571: hr_utility.set_location ('Entering '||l_proc,10);
2572:
2573: --
2574: --Bug(2300866):Should not allow to reopen the bug
2575: --the prtspnt does not have any electable choices.
2573: --
2574: --Bug(2300866):Should not allow to reopen the bug
2575: --the prtspnt does not have any electable choices.
2576: --
2577: hr_utility.set_location('p_per_in_ler_id' || p_per_in_ler_id , 99 );
2578:
2579: open c_chk_reopen_lf_event;
2580: fetch c_chk_reopen_lf_event into l_chk_reopen_lf_event;
2581: close c_chk_reopen_lf_event;
2695: --epe and valid result.
2696: --
2697: FOR l_enb IN c_enb(p_per_in_ler_id) LOOP
2698: --
2699: hr_utility.set_location ('manage_enrt_bnft '||l_enb.enrt_bnft_id,10);
2700: --
2701: ben_election_information.manage_enrt_bnft
2702: ( p_enrt_bnft_id => l_enb.enrt_bnft_id,
2703: p_effective_date => p_effective_date,
2710: );
2711: --
2712: END LOOP;
2713: --
2714: hr_utility.set_location ('Leaving '||l_proc,10);
2715: --
2716: end reopen_single_life_event;
2717: --
2718: --Selfservice wrapper to call close enrollment for closing a per in ler