284: for update of assignment_id;
285: --
286: cursor per_rows is
287: select ppf.rowid
288: from per_people_f ppf
289: where ppf.person_id = p_person_id
290: for update of ppf.person_id;
291: --
292: --CWK assignments cursor
464: -- Person cursor
465: --
466: cursor per_rows is
467: select ppf.rowid
468: from per_people_f ppf
469: where ppf.person_id = p_person_id
470: for update of ppf.person_id;
471: --
472: -- Period cursor
1535: --
1536: -- person cursor
1537: --
1538: cursor person is
1539: select p.rowid, effective_end_date from per_people_f p
1540: where p.person_id = p_person_id
1541: and p.effective_start_date >= p_date_start;
1542:
1543: -- new_person
1542:
1543: -- new_person
1544: --
1545: cursor new_person is
1546: select p.rowid from per_people_f p
1547: where p.person_id = p_person_id
1548: and p.effective_end_date = p_date_start -1;
1549:
1550: -- fix for bug 5005157 starts here.
1917: hr_utility.set_location('cancel_emp_apl_hire ',300);
1918: fetch person into p_rowid, l_person_end_date;
1919: exit when person%notfound;
1920:
1921: delete from per_people_f
1922: where rowid = p_rowid;
1923: --
1924: end loop person;
1925: close person;
1936:
1937:
1938: hr_utility.set_location('cancel_emp_apl_hire ',400);
1939:
1940: update per_people_f
1941: set effective_end_date = p_end_of_time
1942: where rowid = p_rowid;
1943:
1944: hr_utility.set_location('cancel_emp_apl_hire ',450);
2300: --
2301: -- person cursor
2302: --
2303: cursor person is
2304: select p.rowid, effective_end_date from per_people_f p
2305: where p.person_id = p_person_id
2306: and p.effective_start_date >= p_date_start;
2307: --
2308: -- 3194314
2351: --
2352: -- new_person
2353: --
2354: cursor new_person is
2355: select p.rowid from per_people_f p
2356: where p.person_id = p_person_id
2357: and p.effective_end_date = p_date_start -1;
2358:
2359: -- fix for bug 5005157 starts here.
2822: -- code added for the bug 8504597 ends here
2823:
2824: hr_utility.set_location('cancel_hire_or_apl.do_cancel_hire',322);
2825:
2826: update per_people_f
2827: set person_type_id = l_person_type_id,
2828: effective_start_date = p_date_start, -- in case DT updates exist
2829: current_employee_flag = null,
2830: current_emp_or_apl_flag = l_apl_flag, -- 3848352 --null,
2853: else -- #1998140
2854: --
2855: hr_utility.set_location('cancel_hire_or_apl.do_cancel_hire',323);
2856:
2857: delete from per_people_f
2858: where rowid = p_rowid;
2859: --
2860: end if;
2861:
2898:
2899: --
2900: -- 3847884 Changed from p_start_date to p_date_start
2901: --
2902: update per_people_f
2903: set person_type_id = l_person_type_id,
2904: current_employee_flag = null,
2905: current_emp_or_apl_flag = l_apl_flag, -- 3848352 -- null,
2906: current_applicant_flag = l_apl_flag, -- 3848352 --null,
2914: else -- #1998140
2915: --
2916: hr_utility.set_location('cancel_hire_or_apl.do_cancel_hire',325);
2917:
2918: delete from per_people_f
2919: where rowid = p_rowid;
2920: --
2921: end if;
2922:
2922:
2923: -- <<
2924: else
2925: hr_utility.set_location('cancel_hire_or_apl.do_cancel_hire',330);
2926: delete from per_people_f
2927: where rowid = p_rowid;
2928: end if;
2929: --
2930: -- hr_utility.set_location('cancel_hire_or_apl.do_cancel_hire',340); -- for bug 14523191
2956: exit when new_person%notfound;
2957: if NOT l_back2back
2958: then
2959: hr_utility.set_location('cancel_hire_or_apl.do_cancel_hire',380);
2960: update per_people_f
2961: set effective_end_date = p_end_of_time
2962: where rowid = p_rowid;
2963: end if;
2964: --
3203: -- person cursor
3204: --
3205: cursor people is
3206: select rowid
3207: from per_people_f
3208: where person_id = p_person_id
3209: and effective_start_date >= p_date_received;
3210: --
3211: -- new person cursor
3211: -- new person cursor
3212: --
3213: cursor new_people is
3214: select rowid
3215: from per_people_f
3216: where person_id = p_person_id
3217: and effective_end_date = p_date_received - 1;
3218: --
3219: --
3278: -- person comments when apl cursor
3279: --
3280: cursor person_apl_comments2 is
3281: select distinct h.comment_id --fix for bug 7157204.
3282: from hr_comments h, per_people_f ppf
3283: where ppf.business_group_id = p_business_group_id
3284: and ppf.person_id = p_person_id
3285: and ppf.effective_start_date >= p_date_received
3286: and ppf.comment_id = h.comment_id;
3291: -- Bug 8405711: Cursor return the effective_start_date if the action performs
3292: -- on the day where a record is already present.
3293: cursor chk_action_perform_date is
3294: select effective_start_date
3295: from per_people_f
3296: where person_id = p_person_id
3297: and effective_start_date = hr_general.effective_date;
3298:
3299: -- Bug 8405711: Cursor get the future records along with end-dated record
3299: -- Bug 8405711: Cursor get the future records along with end-dated record
3300: -- on the previous day, in the case if the action performs on future date.
3301: cursor people_b2b_with_prev_record is
3302: select rowid,effective_end_date,effective_start_date,current_applicant_flag
3303: from per_people_f
3304: where person_id = p_person_id
3305: and (effective_start_date > p_date_received
3306: or effective_end_date = hr_general.effective_date - 1);
3307:
3317: and ptu.effective_start_date = p_date_received
3318: and ptu.person_type_id = ppt.person_type_id
3319: and ppt.system_person_type <> 'APL';
3320:
3321: -- Bug 4095559: Cursor to update per_people_f B2B of EX_EMP/EX_CWK.APL
3322: -- new_people_b2b for person records with ESD as date_received
3323: cursor new_people_b2b is
3324: select rowid,effective_end_date,effective_start_date,current_applicant_flag
3325: from per_people_f
3321: -- Bug 4095559: Cursor to update per_people_f B2B of EX_EMP/EX_CWK.APL
3322: -- new_people_b2b for person records with ESD as date_received
3323: cursor new_people_b2b is
3324: select rowid,effective_end_date,effective_start_date,current_applicant_flag
3325: from per_people_f
3326: where person_id = p_person_id
3327: and effective_start_date = p_date_received;
3328:
3329: -- Bug 4095559: Cursor to update per_people_f B2B of EX_EMP/EX_CWK.APL
3325: from per_people_f
3326: where person_id = p_person_id
3327: and effective_start_date = p_date_received;
3328:
3329: -- Bug 4095559: Cursor to update per_people_f B2B of EX_EMP/EX_CWK.APL
3330: -- people_b2b for person records with ESD future to date_received
3331: cursor people_b2b is
3332: select rowid,effective_end_date,effective_start_date,current_applicant_flag
3333: from per_people_f
3329: -- Bug 4095559: Cursor to update per_people_f B2B of EX_EMP/EX_CWK.APL
3330: -- people_b2b for person records with ESD future to date_received
3331: cursor people_b2b is
3332: select rowid,effective_end_date,effective_start_date,current_applicant_flag
3333: from per_people_f
3334: where person_id = p_person_id
3335: and effective_start_date > p_date_received;
3336:
3337: -- Bug 4095559: Cursor to get the latest person_type_id B2B of
3385: AND ppf.person_id = p_person_id
3386: AND ppf.business_group_id +0 = p_business_group_id
3387: ORDER BY ppf.effective_start_date DESC;
3388:
3389: l_apl_number per_people_f.applicant_number%TYPE;
3390:
3391: -- Changes end for the bug 14156610
3392: --
3393:
3668: <
3669: loop
3670: fetch people into l_rowid;
3671: exit when people%notfound;
3672: delete from per_people_f
3673: where rowid = l_rowid;
3674: if sql%notfound then
3675: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
3676: hr_utility.set_message_token('PROCEDURE','do_cancel_appl');
3691: <
3692: loop
3693: fetch new_people into l_rowid;
3694: exit when new_people%notfound;
3695: update per_people_f
3696: set effective_end_date = p_end_of_time
3697: where rowid = l_rowid;
3698: --
3699: if sql%ROWCOUNT <1 then
3741: /*open latest_ptid;
3742: fetch latest_ptid into l_person_type_id;
3743: close latest_ptid;*/
3744: -- Upadte the person table with the person type id
3745: /*update per_people_f
3746: set PERSON_TYPE_ID=l_person_type_id
3747: where rowid = l_rowid;*/
3748:
3749: delete from per_people_f
3745: /*update per_people_f
3746: set PERSON_TYPE_ID=l_person_type_id
3747: where rowid = l_rowid;*/
3748:
3749: delete from per_people_f
3750: where rowid = l_rowid;
3751:
3752: if sql%notfound THEN
3753: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
3770: fetch people_b2b_with_prev_record into l_rowid,l_effective_end_date,
3771: l_effective_start_date,l_current_applicant_flag;
3772: exit when people_b2b_with_prev_record%notfound;
3773:
3774: delete from per_people_f
3775: where rowid = l_rowid;
3776:
3777: if sql%notfound then
3778: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
3793: exit when new_people_b2b%notfound;
3794:
3795: --start changes for bug 8405711
3796: /* if l_effective_end_date = hr_general.effective_date -1 then
3797: delete from per_people_f
3798: where rowid = l_rowid;
3799: elsif */
3800: IF l_current_applicant_flag = 'Y' then
3801: --
3804: open csr_pre_apl_num;
3805: fetch csr_pre_apl_num into l_apl_number;
3806: close csr_pre_apl_num;
3807:
3808: update per_people_f
3809: set applicant_number = l_apl_number, --null, -- commented for fix of Bug#14156610
3810: current_applicant_flag=null,
3811: current_emp_or_apl_flag=DECODE (l_system_person_type,'EMP','Y',null),
3812: PERSON_TYPE_ID=l_person_type_id,
3821: fetch latest_ptid into l_person_type_id;
3822: close latest_ptid;*/
3823: -- Updating the person table, if there is future changes
3824: /* if l_fut_per_chg then
3825: update per_people_f
3826: set applicant_number = null,
3827: current_applicant_flag=null,
3828: current_emp_or_apl_flag=DECODE (l_system_person_type,'EMP','Y',null),
3829: PERSON_TYPE_ID=l_person_type_id
3829: PERSON_TYPE_ID=l_person_type_id
3830: where rowid = l_rowid;
3831: -- Updating the person table, if there is NO future changes
3832: else
3833: update per_people_f
3834: set applicant_number = null,
3835: current_applicant_flag=null,
3836: current_emp_or_apl_flag=DECODE (l_system_person_type,'EMP','Y',null),
3837: PERSON_TYPE_ID=l_person_type_id,
4008: --
4009: CURSOR csr_chk_person_is_cwk IS
4010: SELECT per.person_id,
4011: per.effective_start_date
4012: FROM per_people_f per
4013: WHERE per.person_id = p_person_id
4014: AND per.current_npw_flag = 'Y'
4015: AND per.effective_start_date >= p_date_start;
4016: --
4467: | |
4468: *============================================================================*/
4469: --
4470: PROCEDURE do_cancel_placement
4471: (p_person_id IN per_people_f.person_id%TYPE
4472: ,p_business_group_id IN per_people_f.business_group_id%TYPE
4473: ,p_effective_date IN DATE
4474: ,p_date_start IN DATE) AS
4475: --
4468: *============================================================================*/
4469: --
4470: PROCEDURE do_cancel_placement
4471: (p_person_id IN per_people_f.person_id%TYPE
4472: ,p_business_group_id IN per_people_f.business_group_id%TYPE
4473: ,p_effective_date IN DATE
4474: ,p_date_start IN DATE) AS
4475: --
4476: -- Declare local variables
4495: l_object_version_number per_person_type_usages_f.object_version_number%TYPE;
4496: c_effective_start_date date; --Added for the bug 6460093
4497: --l_ex_apl_person_type_id per_person_type_usages_f.person_type_usage_id%TYPE; --Added for the bug#13442055 -- Commented for the bug#13576986
4498: l_cur_sys_person_type per_person_types.system_person_type%TYPE; --Added for the bug#13576986
4499: l_npw_number per_people_f.npw_number%TYPE; --Added for the bug#13772471
4500: --
4501: -- events cursor
4502: --
4503: CURSOR csr_events IS
4653: --
4654: CURSOR csr_person IS
4655: SELECT p.rowid,
4656: effective_end_date
4657: FROM per_people_f p
4658: WHERE p.person_id = p_person_id
4659: AND p.effective_start_date >= p_date_start;
4660: --
4661: -- new_person
4661: -- new_person
4662: --
4663: CURSOR csr_new_person IS
4664: SELECT p.rowid
4665: FROM per_people_f p
4666: WHERE p.person_id = p_person_id
4667: AND p.effective_end_date = p_date_start -1;
4668: --
4669: CURSOR csr_assignment_rate_values IS
5195: AND p_date_start BETWEEN effective_start_date
5196: AND effective_end_date;
5197: --changes end for bug 7110731
5198:
5199: UPDATE per_people_f -- 3194314
5200: SET current_npw_flag = null
5201: ,effective_start_date = p_date_start -- in case DT udpates exist
5202: WHERE rowid = person_rec.rowid;
5203: --
5204: ELSE -- #1998140
5205: --
5206: hr_utility.set_location(l_proc,400);
5207: --
5208: DELETE FROM per_people_f
5209: WHERE rowid = person_rec.rowid;
5210: --
5211: END IF;
5212: --
5227: close csr_pre_npw_num;
5228:
5229: -- Changes end for the bug 13772471
5230: --
5231: UPDATE per_people_f
5232: SET npw_number = l_npw_number, --null -- Modified for bug#13772471
5233: effective_start_date = p_date_start, -- in case DT updates exist
5234: current_npw_flag = null,
5235: per_information7 = 'INCL'
5239: ELSE -- #1998140
5240: --
5241: hr_utility.set_location(l_proc,406);
5242: --
5243: DELETE FROM per_people_f
5244: WHERE rowid = person_rec.rowid;
5245: --
5246: END IF;
5247: --
5273: close csr_pre_npw_num;
5274:
5275: -- Changes end for the bug 13772471
5276: --
5277: UPDATE per_people_f
5278: SET npw_number = l_npw_number, --null -- Modified for bug#13772471
5279: effective_start_date = p_date_start, -- in case DT updates exist
5280: current_npw_flag = null
5281: WHERE rowid = person_rec.rowid;
5282: else
5283: --
5284: hr_utility.set_location(l_proc,420); -- Moved this debug line here to resolve Bug#13964489
5285: --
5286: DELETE FROM per_people_f
5287: WHERE rowid = person_rec.rowid;
5288: --
5289: end if;
5290: --l_ex_apl_person_type_id := null; -- Commented for the bug#13576986
5350: --
5351: else
5352: hr_utility.set_location(l_proc,556);
5353:
5354: UPDATE per_people_f
5355: SET effective_end_date = l_end_of_time
5356: WHERE rowid = new_person_rec.rowid;
5357: --
5358: end if;
5553: --
5554: CURSOR csr_leg_code IS
5555: SELECT pbg.legislation_code
5556: FROM per_business_groups pbg
5557: , per_people_f per
5558: WHERE per.person_id = p_person_id
5559: AND pbg.business_group_id = per.business_group_id;
5560: --
5561: -- Declare local variables