[Home] [Help]
227: --
228: -- Declare cursors and local variables
229: --
230: l_proc varchar2(72) := g_package||'create_applicant';
231: l_date_received per_applications.date_received%TYPE;
232: l_applicant_number per_all_people_f.applicant_number%TYPE;
233: l_date_employee_data_verified per_all_people_f.date_employee_data_verified%TYPE;
234: l_date_of_birth per_all_people_f.date_of_birth%TYPE;
235: l_background_date_check per_all_people_f.background_date_check%TYPE;
237: l_projected_start_date per_all_people_f.projected_start_date%TYPE;
238: l_resume_last_updated per_all_people_f.resume_last_updated%TYPE;
239: l_person_id per_all_people_f.person_id%TYPE;
240: l_assignment_id per_all_assignments_f.assignment_id%TYPE;
241: l_application_id per_applications.application_id%TYPE;
242: l_per_object_version_number per_all_people_f.object_version_number%TYPE;
243: l_asg_object_version_number per_all_assignments_f.object_version_number%TYPE;
244: l_apl_object_version_number per_applications.object_version_number%TYPE;
245: l_per_effective_start_date per_all_people_f.effective_start_date%TYPE;
240: l_assignment_id per_all_assignments_f.assignment_id%TYPE;
241: l_application_id per_applications.application_id%TYPE;
242: l_per_object_version_number per_all_people_f.object_version_number%TYPE;
243: l_asg_object_version_number per_all_assignments_f.object_version_number%TYPE;
244: l_apl_object_version_number per_applications.object_version_number%TYPE;
245: l_per_effective_start_date per_all_people_f.effective_start_date%TYPE;
246: l_per_effective_end_date per_all_people_f.effective_end_date%TYPE;
247: l_full_name per_all_people_f.full_name%TYPE;
248: l_per_comment_id per_all_people_f.comment_id%TYPE;
1837: l_system_person_type per_person_types.system_person_type%TYPE;
1838: l_business_group_id per_all_people_f.business_group_id%TYPE;
1839: l_legislation_code per_business_groups.legislation_code%TYPE;
1840: l_applicant_number per_all_people_f.applicant_number%TYPE;
1841: l_application_id per_applications.application_id%TYPE;
1842: l_apl_object_version_number per_applications.application_id%TYPE;
1843: --
1844: l_hire_date date;
1845: l_original_date_of_hire date;
1838: l_business_group_id per_all_people_f.business_group_id%TYPE;
1839: l_legislation_code per_business_groups.legislation_code%TYPE;
1840: l_applicant_number per_all_people_f.applicant_number%TYPE;
1841: l_application_id per_applications.application_id%TYPE;
1842: l_apl_object_version_number per_applications.application_id%TYPE;
1843: --
1844: l_hire_date date;
1845: l_original_date_of_hire date;
1846: --
1906: l_yes_backtoback varchar2(1) :='N';
1907:
1908: cursor csr_get_apln_details is
1909: select date_received,nvl(date_end ,hr_api.g_eot)
1910: from per_applications
1911: where person_id = p_person_id and date_received > l_hire_date;
1912:
1913: cursor csr_back_toback_apln is
1914: select 'Y' from per_applications
1910: from per_applications
1911: where person_id = p_person_id and date_received > l_hire_date;
1912:
1913: cursor csr_back_toback_apln is
1914: select 'Y' from per_applications
1915: where person_id = p_person_id
1916: and date_received = l_apln_date_to +1;
1917:
1918: cursor csr_fut_asg_rec is
1924: and application_id = l_application_id
1925: order by effective_start_date;
1926:
1927: cursor chk_apl_exists(p_asg_start_date date) is
1928: select application_id, date_end from per_applications
1929: where person_id = p_person_id
1930: and p_asg_start_date between date_received and nvl(date_end,hr_api.g_eot);
1931:
1932: cursor chk_future_changes(p_assignment_id number) is
2020: per.original_date_of_hire -- #2978566
2021: from per_all_people_f per,
2022: per_business_groups bus,
2023: per_person_types ppt,
2024: per_applications pap
2025: where per.person_type_id = ppt.person_type_id
2026: and per.business_group_id = bus.business_group_id
2027: and per.person_id = pap.person_id
2028: and per.person_id = p_person_id
2346: l_probation_unit per_all_assignments_f.probation_unit%TYPE;
2347:
2348: cursor appl_rec_det(l_appl_id number) is
2349: select projected_hire_date
2350: from per_applications
2351: where application_id =l_appl_id;
2352:
2353: cursor c_get_pro_dates(p_assignment_id per_all_assignments_f.assignment_id%TYPE,
2354: p_hire_date date) is
2875: fetch chk_apl_exists into l_cur_apl_id, l_current_apl_end_date;
2876: if chk_apl_exists%notfound then
2877:
2878: -- creating APLN since not found
2879: SELECT per_applications_s.nextval into l_new_application_id FROM sys.dual;
2880: l_cur_apl_id := l_new_application_id;
2881: begin
2882: INSERT INTO PER_APPLICATIONS(
2883: application_id,
2878: -- creating APLN since not found
2879: SELECT per_applications_s.nextval into l_new_application_id FROM sys.dual;
2880: l_cur_apl_id := l_new_application_id;
2881: begin
2882: INSERT INTO PER_APPLICATIONS(
2883: application_id,
2884: business_group_id,
2885: person_id,
2886: date_received,
2896: else
2897:
2898: -- if APLN end date < ASG end date, update the APLN
2899: if nvl(l_current_apl_end_date,hr_api.g_eot) < nvl(l_apl_end_date,hr_api.g_eot) then
2900: update per_applications
2901: set date_end = l_apl_end_date
2902: where person_id = p_person_id
2903: and application_id = l_cur_apl_id;
2904: end if;
4109: ,p_effective_date IN DATE
4110: ,p_person_id IN per_all_people_f.person_id%TYPE
4111: ,p_object_version_number IN OUT NOCOPY per_all_people_f.object_version_number%TYPE
4112: ,p_person_type_id IN per_person_types.person_type_id%TYPE --DEFAULT hr_api.g_number
4113: ,p_termination_reason IN per_applications.termination_reason%TYPE --DEFAULT NULL
4114: ,p_effective_start_date OUT NOCOPY per_all_people_f.effective_start_date%TYPE
4115: ,p_effective_end_date OUT NOCOPY per_all_people_f.effective_end_date%TYPE
4116: )
4117: IS
4138: ,p_effective_date IN DATE
4139: ,p_person_id IN per_all_people_f.person_id%TYPE
4140: ,p_object_version_number IN OUT NOCOPY per_all_people_f.object_version_number%TYPE
4141: ,p_person_type_id IN per_person_types.person_type_id%TYPE
4142: ,p_termination_reason IN per_applications.termination_reason%TYPE
4143: ,p_assignment_status_type_id IN per_all_assignments_f.assignment_status_type_id%TYPE
4144: ,p_effective_start_date OUT NOCOPY per_all_people_f.effective_start_date%TYPE
4145: ,p_effective_end_date OUT NOCOPY per_all_people_f.effective_end_date%TYPE
4146: )
4170: ,p_effective_date IN DATE
4171: ,p_person_id IN per_all_people_f.person_id%TYPE
4172: ,p_object_version_number IN OUT NOCOPY per_all_people_f.object_version_number%TYPE
4173: ,p_person_type_id IN per_person_types.person_type_id%TYPE
4174: ,p_termination_reason IN per_applications.termination_reason%TYPE
4175: ,p_assignment_status_type_id IN per_all_assignments_f.assignment_status_type_id%TYPE
4176: ,p_effective_start_date OUT NOCOPY per_all_people_f.effective_start_date%TYPE
4177: ,p_effective_end_date OUT NOCOPY per_all_people_f.effective_end_date%TYPE
4178: ,p_remove_fut_asg_warning OUT NOCOPY BOOLEAN -- 3652025
4203: ,p_effective_date IN DATE
4204: ,p_person_id IN per_all_people_f.person_id%TYPE
4205: ,p_object_version_number IN OUT NOCOPY per_all_people_f.object_version_number%TYPE
4206: ,p_person_type_id IN per_person_types.person_type_id%TYPE
4207: ,p_termination_reason IN per_applications.termination_reason%TYPE
4208: ,p_assignment_status_type_id IN per_all_assignments_f.assignment_status_type_id%TYPE
4209: ,p_change_reason IN per_all_assignments_f.change_reason%TYPE -- 4066579
4210: ,p_status_change_comments IN irc_assignment_statuses.status_change_comments%TYPE -- 8732296
4211: ,p_effective_start_date OUT NOCOPY per_all_people_f.effective_start_date%TYPE
4274: ,per.applicant_number
4275: ,per.employee_number
4276: ,pet.system_person_type
4277: ,per.npw_number
4278: FROM per_applications apl
4279: ,per_person_types pet
4280: ,per_people_f per
4281: WHERE p_effective_date BETWEEN apl.date_received
4282: AND NVL(apl.date_end,p_effective_date)
4657: hr_utility.set_location(l_proc,90);
4658: --
4659: -- End the application
4660: --
4661: UPDATE per_applications
4662: set date_end = l_effective_date
4663: ,termination_reason = p_termination_reason
4664: WHERE application_id = l_application.application_id;
4665: /*
4874: l_full_name per_all_people_f.full_name%TYPE;
4875: l_name_combination_warning BOOLEAN;
4876: l_dob_null_warning BOOLEAN;
4877: l_orig_hire_warning BOOLEAN;
4878: l_application_id per_applications.application_id%TYPE;
4879: l_apl_object_version_number per_applications.object_version_number%TYPE;
4880: l_assignment_id per_all_assignments_f.assignment_id%TYPE;
4881: l_asg_object_version_number per_all_assignments_f.object_version_number%TYPE;
4882: l_assignment_sequence per_all_assignments_f.assignment_sequence%TYPE;
4875: l_name_combination_warning BOOLEAN;
4876: l_dob_null_warning BOOLEAN;
4877: l_orig_hire_warning BOOLEAN;
4878: l_application_id per_applications.application_id%TYPE;
4879: l_apl_object_version_number per_applications.object_version_number%TYPE;
4880: l_assignment_id per_all_assignments_f.assignment_id%TYPE;
4881: l_asg_object_version_number per_all_assignments_f.object_version_number%TYPE;
4882: l_assignment_sequence per_all_assignments_f.assignment_sequence%TYPE;
4883: l_person_type_usage_id per_person_type_usages.person_type_usage_id%TYPE;
5122: RETURN VARCHAR2 IS
5123:
5124: cursor csr_fut_apl is
5125: select application_id
5126: from per_applications
5127: where person_id = p_person_id
5128: and date_received > p_effective_date
5129: order by date_received asc;
5130:
5129: order by date_received asc;
5130:
5131: cursor csr_current_apl is
5132: select application_id
5133: from per_applications
5134: where person_id = p_person_id
5135: and date_received < p_effective_date
5136: and nvl(date_end,hr_api.g_eot) >= p_effective_date;
5137:
5136: and nvl(date_end,hr_api.g_eot) >= p_effective_date;
5137:
5138: cursor csr_apl_yesterday is
5139: select application_id
5140: from per_applications
5141: where person_id = p_person_id
5142: and date_end = p_effective_date-1;
5143:
5144: l_future_apl_id per_applications.application_id%type;
5140: from per_applications
5141: where person_id = p_person_id
5142: and date_end = p_effective_date-1;
5143:
5144: l_future_apl_id per_applications.application_id%type;
5145: l_current_apl_id per_applications.application_id%type;
5146: l_yesterday_apl_id per_applications.application_id%type;
5147: l_raise_warning VARCHAR2(10);
5148:
5141: where person_id = p_person_id
5142: and date_end = p_effective_date-1;
5143:
5144: l_future_apl_id per_applications.application_id%type;
5145: l_current_apl_id per_applications.application_id%type;
5146: l_yesterday_apl_id per_applications.application_id%type;
5147: l_raise_warning VARCHAR2(10);
5148:
5149: BEGIN
5142: and date_end = p_effective_date-1;
5143:
5144: l_future_apl_id per_applications.application_id%type;
5145: l_current_apl_id per_applications.application_id%type;
5146: l_yesterday_apl_id per_applications.application_id%type;
5147: l_raise_warning VARCHAR2(10);
5148:
5149: BEGIN
5150: l_raise_warning := 'N';
5202: l_organization_id per_business_groups.organization_id%type;
5203: l_legislation_code per_business_groups.legislation_code%type;
5204: l_person_type_id per_people_f.person_type_id%type := p_person_type_id;
5205: l_person_type_id1 per_people_f.person_type_id%type;
5206: l_application_id per_applications.application_id%type;
5207: l_comment_id per_assignments_f.comment_id%type;
5208: l_assignment_sequence per_assignments_f.assignment_sequence%type;
5209: l_assignment_id per_assignments_f.assignment_id%type;
5210: l_object_version_number per_assignments_f.object_version_number%type;
5237: --
5238: -- Local variable added for the before and after business process
5239: -- apply_for_job_anytime
5240: --
5241: l_apl_object_version_number per_applications.object_version_number%TYPE;
5242: l_asg_object_version_number per_all_assignments_f.object_version_number%TYPE;
5243: l_per_effective_start_date per_all_people_f.effective_start_date%TYPE;
5244: l_per_effective_end_date per_all_people_f.effective_end_date%TYPE;
5245: --