38: l_security_group_id number;
39: l_proc varchar2(72) := g_package||'set_security_group_id';
40:
41: begin
42: hr_utility.set_location('Entering:'|| l_proc, 10);
43:
44: -- Ensure that all the mandatory parameter are not null
45:
46: hr_api.mandatory_arg_error(p_api_name => l_proc,
53: close csr_sec_grp;
54:
55: -- The primary key is invalid therefore we must error
56:
57: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
58: hr_multi_message.add(p_associated_column1 =>
59: nvl(p_associated_column1,'PER_APPRAISALS.PERSON_ID'));
60: else
61: close csr_sec_grp;
66: (p_security_group_id => l_security_group_id
67: );
68: end if;
69:
70: hr_utility.set_location(' Leaving:'|| l_proc, 20);
71:
72: end set_security_group_id;
73:
74:
115:
116: l_show_term_employee VARCHAR2 (10) := 'Y';
117: l_future_term_exist VARCHAR2 (2) := 'N';
118: BEGIN
119: hr_utility.set_location ('Entering:' || l_proc, 10);
120:
121: OPEN csr_template_info;
122:
123: FETCH csr_template_info
140: fnd_message.raise_error;
141: END IF;
142: END IF;
143:
144: hr_utility.set_location ('Leaving:' || l_proc, 970);
145: EXCEPTION
146: WHEN app_exception.application_exception
147: THEN
148: IF hr_multi_message.exception_add (p_associated_column1 => 'PER_APPRAISALS.APPRAISAL_DATE')
146: WHEN app_exception.application_exception
147: THEN
148: IF hr_multi_message.exception_add (p_associated_column1 => 'PER_APPRAISALS.APPRAISAL_DATE')
149: THEN
150: hr_utility.set_location (' Leaving:' || l_proc, 980);
151: RAISE;
152: END IF;
153:
154: hr_utility.set_location (' Leaving:' || l_proc, 990);
150: hr_utility.set_location (' Leaving:' || l_proc, 980);
151: RAISE;
152: END IF;
153:
154: hr_utility.set_location (' Leaving:' || l_proc, 990);
155: END chk_future_termination_exist;
156:
157:
158:
165:
166: l_proc varchar2(72) := g_package||'chk_non_updateable_args';
167:
168: Begin
169: hr_utility.set_location('Entering:'||l_proc, 5);
170:
171: -- Only proceed with validation if a row exists for
172: -- the current record in the HR Schema
173:
174: if not per_apr_shd.api_updating
175: (p_appraisal_id => p_rec.appraisal_id
176: ,p_object_version_number => p_rec.object_version_number
177: ) then
178: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
179: hr_utility.set_message_token('PROCEDURE', l_proc);
180: hr_utility.set_message_token('STEP', '5');
181: end if;
182:
175: (p_appraisal_id => p_rec.appraisal_id
176: ,p_object_version_number => p_rec.object_version_number
177: ) then
178: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
179: hr_utility.set_message_token('PROCEDURE', l_proc);
180: hr_utility.set_message_token('STEP', '5');
181: end if;
182:
183: hr_utility.set_location(l_proc, 6);
176: ,p_object_version_number => p_rec.object_version_number
177: ) then
178: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
179: hr_utility.set_message_token('PROCEDURE', l_proc);
180: hr_utility.set_message_token('STEP', '5');
181: end if;
182:
183: hr_utility.set_location(l_proc, 6);
184:
179: hr_utility.set_message_token('PROCEDURE', l_proc);
180: hr_utility.set_message_token('STEP', '5');
181: end if;
182:
183: hr_utility.set_location(l_proc, 6);
184:
185: if p_rec.business_group_id <> per_apr_shd.g_old_rec.business_group_id then
186: hr_api.argument_changed_error
187: (
189: ,p_argument => 'BUSINESS_GROUP_ID'
190: ,p_base_table => per_per_shd.g_tab_nam
191: );
192: elsif p_rec.appraisal_template_id <> per_apr_shd.g_old_rec.appraisal_template_id then
193: hr_utility.set_location(l_proc, 7);
194: hr_api.argument_changed_error
195: (
196: p_api_name => l_proc
197: ,p_argument => 'APPRAISAL_TEMPLATE_ID'
197: ,p_argument => 'APPRAISAL_TEMPLATE_ID'
198: ,p_base_table => per_per_shd.g_tab_nam
199: );
200: elsif p_rec.appraisee_person_id <> per_apr_shd.g_old_rec.appraisee_person_id then
201: hr_utility.set_location(l_proc, 8);
202: hr_api.argument_changed_error
203: (
204: p_api_name => l_proc
205: ,p_argument => 'APPRAISEE_ID'
205: ,p_argument => 'APPRAISEE_ID'
206: ,p_base_table => per_per_shd.g_tab_nam
207: );
208: elsif p_rec.assignment_id <> per_apr_shd.g_old_rec.assignment_id then
209: hr_utility.set_location(l_proc, 9);
210: hr_api.argument_changed_error
211: (
212: p_api_name => l_proc
213: ,p_argument => 'ASSIGNMENT_ID'
213: ,p_argument => 'ASSIGNMENT_ID'
214: ,p_base_table => per_per_shd.g_tab_nam
215: );
216: elsif p_rec.assignment_start_date <> per_apr_shd.g_old_rec.assignment_start_date then
217: hr_utility.set_location(l_proc, 10);
218: hr_api.argument_changed_error
219: (
220: p_api_name => l_proc
221: ,p_argument => 'ASSIGNMENT_START_DATE'
221: ,p_argument => 'ASSIGNMENT_START_DATE'
222: ,p_base_table => per_per_shd.g_tab_nam
223: );
224: elsif p_rec.assignment_business_group_id <> per_apr_shd.g_old_rec.assignment_business_group_id then
225: hr_utility.set_location(l_proc, 11);
226: hr_api.argument_changed_error
227: (
228: p_api_name => l_proc
229: ,p_argument => 'ASSIGNMENT_BUSINESS_GROUP_ID'
229: ,p_argument => 'ASSIGNMENT_BUSINESS_GROUP_ID'
230: ,p_base_table => per_per_shd.g_tab_nam
231: );
232: elsif p_rec.assignment_organization_id <> per_apr_shd.g_old_rec.assignment_organization_id then
233: hr_utility.set_location(l_proc, 12);
234: hr_api.argument_changed_error
235: (
236: p_api_name => l_proc
237: ,p_argument => 'ASSIGNMENT_ORGANIZATION_ID'
237: ,p_argument => 'ASSIGNMENT_ORGANIZATION_ID'
238: ,p_base_table => per_per_shd.g_tab_nam
239: );
240: elsif p_rec.assignment_job_id <> per_apr_shd.g_old_rec.assignment_job_id then
241: hr_utility.set_location(l_proc, 13);
242: hr_api.argument_changed_error
243: (
244: p_api_name => l_proc
245: ,p_argument => 'ASSIGNMENT_JOB_ID'
245: ,p_argument => 'ASSIGNMENT_JOB_ID'
246: ,p_base_table => per_per_shd.g_tab_nam
247: );
248: elsif p_rec.assignment_position_id <> per_apr_shd.g_old_rec.assignment_position_id then
249: hr_utility.set_location(l_proc, 14);
250: hr_api.argument_changed_error
251: (
252: p_api_name => l_proc
253: ,p_argument => 'ASSIGNMENT_POSITION_ID'
254: ,p_base_table => per_per_shd.g_tab_nam
255: );
256:
257: end if;
258: hr_utility.set_location(' Leaving:'||l_proc, 15);
259:
260: end chk_non_updateable_args;
261:
262: -- --------------------------------------------------------------------------+
297: l_proc varchar2(72) := g_package || 'chk_open';
298:
299: begin
300:
301: hr_utility.set_location('Entering: '||l_proc,10);
302:
303: if (p_open <> null) and
304: (hr_api.not_exists_in_hr_lookups
305: (p_effective_date => p_effective_date
310: fnd_message.set_name('PER','PER_52459_APR_INVALID_OPEN_TYPE');
311: fnd_message.raise_error;
312: end if;
313:
314: hr_utility.set_location('Leaving: '||l_proc,20);
315:
316: EXCEPTION
317: when app_exception.application_exception then
318: if hr_multi_message.exception_add
383: l_allow_term_emp varchar2(2) := 'N';
384: l_allow_term_cwk varchar2(2) := 'N';
385: begin
386:
387: hr_utility.set_location('Entering: '||l_proc,10);
388: OPEN csr_allow_term_update;
389: FETCH csr_allow_term_update INTO l_allow_term_emp, l_allow_term_cwk;
390: CLOSE csr_allow_term_update;
391: -- Fetch person_type
388: OPEN csr_allow_term_update;
389: FETCH csr_allow_term_update INTO l_allow_term_emp, l_allow_term_cwk;
390: CLOSE csr_allow_term_update;
391: -- Fetch person_type
392: hr_utility.set_location('l_allow_term_emp: '||l_allow_term_emp,10);
393: hr_utility.set_location('l_allow_term_cwk: '||l_allow_term_cwk,11);
394: OPEN csr_fetch_type;
395: FETCH csr_fetch_type INTO l_person_type;
396: CLOSE csr_fetch_type;
389: FETCH csr_allow_term_update INTO l_allow_term_emp, l_allow_term_cwk;
390: CLOSE csr_allow_term_update;
391: -- Fetch person_type
392: hr_utility.set_location('l_allow_term_emp: '||l_allow_term_emp,10);
393: hr_utility.set_location('l_allow_term_cwk: '||l_allow_term_cwk,11);
394: OPEN csr_fetch_type;
395: FETCH csr_fetch_type INTO l_person_type;
396: CLOSE csr_fetch_type;
397:
414: IF NOT l_allow_appraisal AND l_allow_term_emp ='N' THEN
415: fnd_message.set_name('PER','PER_52456_APR_UPD_EX_EMP_APR');
416: fnd_message.raise_error;
417: END IF;
418: hr_utility.set_location('l_allow_term_emp: '||l_allow_term_emp,10);
419: --ExEmpEnhancements
420: per_apr_bus.chk_future_termination_exist (
421: p_appraisee_person_id => p_rec.appraisee_person_id ,
422: p_appraisal_template_id => p_rec.appraisal_template_id
618:
619:
620: end if;
621:
622: hr_utility.set_location('Leaving: '||l_proc,20);
623:
624: end chk_update_allowed;
625:
626:
672: and qsa.type = 'APPRAISAL';
673:
674: begin
675:
676: hr_utility.set_location('Entering: '|| l_proc,10);
677:
678: -- flemonni added
679:
680: if p_appraisal_id <> per_apr_shd.g_old_rec.appraisal_id then
691: else
692: null;
693: end if;
694:
695: hr_utility.set_location('Leaving: '||l_proc,20);
696:
697: EXCEPTION
698: when app_exception.application_exception then
699: if hr_multi_message.exception_add
770: nvl(date_from,hr_api.g_sot) and nvl(date_to,hr_api.g_eot);
771:
772:
773: begin
774: hr_utility.set_location('Entering:'|| l_proc, 1);
775:
776: -- Check mandatory parameters have been set
777:
778: hr_api.mandatory_arg_error
787: ,p_argument => 'effective_date'
788: ,p_argument_value => p_effective_date
789: );
790:
791: hr_utility.set_location('Entering:'|| l_proc, 2);
792:
793: -- check if the user has entered a appraisal_template_id
794: -- It is mandatory column.
795:
793: -- check if the user has entered a appraisal_template_id
794: -- It is mandatory column.
795:
796: if p_appraisal_template_id is null then
797: hr_utility.set_message(800,'HR_52256_APR_TEMP_MANDATORY');
798: hr_utility.raise_error;
799: end if;
800:
801: hr_utility.set_location(l_proc, 3);
794: -- It is mandatory column.
795:
796: if p_appraisal_template_id is null then
797: hr_utility.set_message(800,'HR_52256_APR_TEMP_MANDATORY');
798: hr_utility.raise_error;
799: end if;
800:
801: hr_utility.set_location(l_proc, 3);
802:
797: hr_utility.set_message(800,'HR_52256_APR_TEMP_MANDATORY');
798: hr_utility.raise_error;
799: end if;
800:
801: hr_utility.set_location(l_proc, 3);
802:
803: if p_appraisal_template_id is not null then
804: open csr_appraisal_exists;
805: fetch csr_appraisal_exists into l_business_group_id;
804: open csr_appraisal_exists;
805: fetch csr_appraisal_exists into l_business_group_id;
806: if csr_appraisal_exists%notfound then
807: close csr_appraisal_exists;
808: hr_utility.set_message(801,'HR_52246_APR_TEMP_NOT_EXIST');
809: hr_utility.raise_error;
810: end if;
811: close csr_appraisal_exists;
812:
805: fetch csr_appraisal_exists into l_business_group_id;
806: if csr_appraisal_exists%notfound then
807: close csr_appraisal_exists;
808: hr_utility.set_message(801,'HR_52246_APR_TEMP_NOT_EXIST');
809: hr_utility.raise_error;
810: end if;
811: close csr_appraisal_exists;
812:
813: -- check if appraisal template is in the same business group
812:
813: -- check if appraisal template is in the same business group
814:
815: if l_business_group_id <> p_business_group_id then
816: hr_utility.set_message(801,'HR_51883_TEMP_DIFF_BUS_GRP');
817: hr_utility.raise_error;
818: end if;
819:
820: -- check if appraisal template exists as of users effective date
813: -- check if appraisal template is in the same business group
814:
815: if l_business_group_id <> p_business_group_id then
816: hr_utility.set_message(801,'HR_51883_TEMP_DIFF_BUS_GRP');
817: hr_utility.raise_error;
818: end if;
819:
820: -- check if appraisal template exists as of users effective date
821:
822: open csr_appraisal_template_valid;
823: fetch csr_appraisal_template_valid into l_exists;
824: if csr_appraisal_template_valid%notfound then
825: close csr_appraisal_template_valid;
826: hr_utility.set_message(801,'HR_51884_APR_TEMP_NOT_DATE');
827: hr_utility.raise_error;
828: end if;
829: close csr_appraisal_template_valid;
830: end if;
823: fetch csr_appraisal_template_valid into l_exists;
824: if csr_appraisal_template_valid%notfound then
825: close csr_appraisal_template_valid;
826: hr_utility.set_message(801,'HR_51884_APR_TEMP_NOT_DATE');
827: hr_utility.raise_error;
828: end if;
829: close csr_appraisal_template_valid;
830: end if;
831:
828: end if;
829: close csr_appraisal_template_valid;
830: end if;
831:
832: hr_utility.set_location(l_proc, 4);
833:
834: hr_utility.set_location('Leaving: '|| l_proc, 10);
835: EXCEPTION
836: when app_exception.application_exception then
830: end if;
831:
832: hr_utility.set_location(l_proc, 4);
833:
834: hr_utility.set_location('Leaving: '|| l_proc, 10);
835: EXCEPTION
836: when app_exception.application_exception then
837: if hr_multi_message.exception_add
838: (p_associated_column1 => 'PER_APPRAISALS.APPRAISAL_TEMPLATE_ID'
933: and p_effective_date between
934: effective_start_date and nvl(effective_end_date,hr_api.g_eot);
935:
936: begin
937: hr_utility.set_location('Entering:'|| l_proc, 1);
938:
939: if (p_person_id is NULL) then
940: if p_person_type = 'APPRAISEE' then
941: hr_utility.set_message(801, 'HR_51887_APR_APPRAISEE_NULL');
937: hr_utility.set_location('Entering:'|| l_proc, 1);
938:
939: if (p_person_id is NULL) then
940: if p_person_type = 'APPRAISEE' then
941: hr_utility.set_message(801, 'HR_51887_APR_APPRAISEE_NULL');
942: hr_utility.raise_error;
943: elsif p_person_type = 'APPRAISER' then
944: hr_utility.set_message(801, 'HR_51888_APR_APPRAISER_NULL');
945: hr_utility.raise_error;
938:
939: if (p_person_id is NULL) then
940: if p_person_type = 'APPRAISEE' then
941: hr_utility.set_message(801, 'HR_51887_APR_APPRAISEE_NULL');
942: hr_utility.raise_error;
943: elsif p_person_type = 'APPRAISER' then
944: hr_utility.set_message(801, 'HR_51888_APR_APPRAISER_NULL');
945: hr_utility.raise_error;
946: end if;
940: if p_person_type = 'APPRAISEE' then
941: hr_utility.set_message(801, 'HR_51887_APR_APPRAISEE_NULL');
942: hr_utility.raise_error;
943: elsif p_person_type = 'APPRAISER' then
944: hr_utility.set_message(801, 'HR_51888_APR_APPRAISER_NULL');
945: hr_utility.raise_error;
946: end if;
947: end if;
948:
941: hr_utility.set_message(801, 'HR_51887_APR_APPRAISEE_NULL');
942: hr_utility.raise_error;
943: elsif p_person_type = 'APPRAISER' then
944: hr_utility.set_message(801, 'HR_51888_APR_APPRAISER_NULL');
945: hr_utility.raise_error;
946: end if;
947: end if;
948:
949: -- Check mandatory parameters have been set
954: ,p_argument_value => p_effective_date
955: );
956:
957:
958: hr_utility.set_location('Entering:'|| l_proc, 2);
959:
960: -- bug 1980440 fix starts
961: -- if CROSS_BUSINESS_GROUP option is enabled we shouldn't do a comparison
962: -- between appraisers BG and appraisee BG as they may be different
967: open csr_person_bg;
968: fetch csr_person_bg into l_business_group_id;
969: if csr_person_bg%notfound then
970: close csr_person_bg;
971: hr_utility.set_message(801,'HR_51889_APR_PERSON_NOT_EXIST');
972: hr_utility.raise_error;
973: end if;
974: close csr_person_bg;
975: ELSE
968: fetch csr_person_bg into l_business_group_id;
969: if csr_person_bg%notfound then
970: close csr_person_bg;
971: hr_utility.set_message(801,'HR_51889_APR_PERSON_NOT_EXIST');
972: hr_utility.raise_error;
973: end if;
974: close csr_person_bg;
975: ELSE
976: open csr_cbg_person_bg;
976: open csr_cbg_person_bg;
977: fetch csr_cbg_person_bg into l_business_group_id;
978: if csr_cbg_person_bg%notfound then
979: close csr_cbg_person_bg;
980: hr_utility.set_message(801,'HR_51889_APR_PERSON_NOT_EXIST');
981: hr_utility.raise_error;
982: end if;
983: close csr_cbg_person_bg;
984: END IF;
977: fetch csr_cbg_person_bg into l_business_group_id;
978: if csr_cbg_person_bg%notfound then
979: close csr_cbg_person_bg;
980: hr_utility.set_message(801,'HR_51889_APR_PERSON_NOT_EXIST');
981: hr_utility.raise_error;
982: end if;
983: close csr_cbg_person_bg;
984: END IF;
985:
983: close csr_cbg_person_bg;
984: END IF;
985:
986: IF lv_cross_business_group <> 'Y' THEN
987: hr_utility.set_location(l_proc, 3);
988: -- check if business group match
989: if p_business_group_id <> l_business_group_id then
990: hr_utility.set_message(801,'HR_51890_APR_PERSON_DIFF_BG');
991: hr_utility.raise_error;
986: IF lv_cross_business_group <> 'Y' THEN
987: hr_utility.set_location(l_proc, 3);
988: -- check if business group match
989: if p_business_group_id <> l_business_group_id then
990: hr_utility.set_message(801,'HR_51890_APR_PERSON_DIFF_BG');
991: hr_utility.raise_error;
992: end if;
993: end if;
994:
987: hr_utility.set_location(l_proc, 3);
988: -- check if business group match
989: if p_business_group_id <> l_business_group_id then
990: hr_utility.set_message(801,'HR_51890_APR_PERSON_DIFF_BG');
991: hr_utility.raise_error;
992: end if;
993: end if;
994:
995: hr_utility.set_location(l_proc, 4);
991: hr_utility.raise_error;
992: end if;
993: end if;
994:
995: hr_utility.set_location(l_proc, 4);
996: -- check if person is valid as of effective date
997: IF lv_cross_business_group <> 'Y' THEN
998: open csr_person_valid_date;
999: fetch csr_person_valid_date into l_exists;
998: open csr_person_valid_date;
999: fetch csr_person_valid_date into l_exists;
1000: if csr_person_valid_date%notfound then
1001: close csr_person_valid_date;
1002: hr_utility.set_message(801,'HR_51891_APR_PERSON_DATE_RANGE');
1003: hr_utility.raise_error;
1004: end if;
1005: close csr_person_valid_date;
1006: ELSE
999: fetch csr_person_valid_date into l_exists;
1000: if csr_person_valid_date%notfound then
1001: close csr_person_valid_date;
1002: hr_utility.set_message(801,'HR_51891_APR_PERSON_DATE_RANGE');
1003: hr_utility.raise_error;
1004: end if;
1005: close csr_person_valid_date;
1006: ELSE
1007: open csr_cbg_person_valid_date;
1007: open csr_cbg_person_valid_date;
1008: fetch csr_cbg_person_valid_date into l_exists;
1009: if csr_cbg_person_valid_date%notfound then
1010: close csr_cbg_person_valid_date;
1011: hr_utility.set_message(801,'HR_51891_APR_PERSON_DATE_RANGE');
1012: hr_utility.raise_error;
1013: end if;
1014: close csr_cbg_person_valid_date;
1015: END IF;
1008: fetch csr_cbg_person_valid_date into l_exists;
1009: if csr_cbg_person_valid_date%notfound then
1010: close csr_cbg_person_valid_date;
1011: hr_utility.set_message(801,'HR_51891_APR_PERSON_DATE_RANGE');
1012: hr_utility.raise_error;
1013: end if;
1014: close csr_cbg_person_valid_date;
1015: END IF;
1016: -- bug 1980440 fix ends
1015: END IF;
1016: -- bug 1980440 fix ends
1017: end if;
1018:
1019: hr_utility.set_location(l_proc, 5);
1020:
1021: hr_utility.set_location('Leaving: '|| l_proc, 10);
1022:
1023: end chk_appraisee_appraiser;
1017: end if;
1018:
1019: hr_utility.set_location(l_proc, 5);
1020:
1021: hr_utility.set_location('Leaving: '|| l_proc, 10);
1022:
1023: end chk_appraisee_appraiser;
1024:
1025: ------------------------------------------------------------------------------+
1093:
1094:
1095: begin
1096:
1097: hr_utility.set_location('Entering:'|| l_proc, 5);
1098:
1099: lv_cross_business_group := fnd_profile.value('HR_CROSS_BUSINESS_GROUP');
1100:
1101: IF p_main_appraiser_id IS NULL OR p_main_appraiser_id = -1 THEN
1109: ,p_argument => 'effective_date'
1110: ,p_argument_value => p_effective_date
1111: );
1112:
1113: hr_utility.set_location( l_proc, 6);
1114:
1115: -- check if person is valid as of effective date
1116: IF lv_cross_business_group <> 'Y' THEN
1117: hr_utility.set_location( l_proc, 7);
1113: hr_utility.set_location( l_proc, 6);
1114:
1115: -- check if person is valid as of effective date
1116: IF lv_cross_business_group <> 'Y' THEN
1117: hr_utility.set_location( l_proc, 7);
1118: open csr_person_valid_date;
1119: fetch csr_person_valid_date into l_exists;
1120: if csr_person_valid_date%notfound then
1121: hr_utility.set_location( l_proc, 8);
1117: hr_utility.set_location( l_proc, 7);
1118: open csr_person_valid_date;
1119: fetch csr_person_valid_date into l_exists;
1120: if csr_person_valid_date%notfound then
1121: hr_utility.set_location( l_proc, 8);
1122: close csr_person_valid_date;
1123: hr_utility.set_message(800,'HR_449030_MA_PERSON_DATE_RANGE');
1124: hr_utility.raise_error;
1125: end if;
1119: fetch csr_person_valid_date into l_exists;
1120: if csr_person_valid_date%notfound then
1121: hr_utility.set_location( l_proc, 8);
1122: close csr_person_valid_date;
1123: hr_utility.set_message(800,'HR_449030_MA_PERSON_DATE_RANGE');
1124: hr_utility.raise_error;
1125: end if;
1126: close csr_person_valid_date;
1127: ELSE
1120: if csr_person_valid_date%notfound then
1121: hr_utility.set_location( l_proc, 8);
1122: close csr_person_valid_date;
1123: hr_utility.set_message(800,'HR_449030_MA_PERSON_DATE_RANGE');
1124: hr_utility.raise_error;
1125: end if;
1126: close csr_person_valid_date;
1127: ELSE
1128: open csr_cbg_person_valid_date;
1125: end if;
1126: close csr_person_valid_date;
1127: ELSE
1128: open csr_cbg_person_valid_date;
1129: hr_utility.set_location( l_proc, 9);
1130: fetch csr_cbg_person_valid_date into l_exists;
1131: if csr_cbg_person_valid_date%notfound then
1132: hr_utility.set_location( l_proc, 10);
1133: close csr_cbg_person_valid_date;
1128: open csr_cbg_person_valid_date;
1129: hr_utility.set_location( l_proc, 9);
1130: fetch csr_cbg_person_valid_date into l_exists;
1131: if csr_cbg_person_valid_date%notfound then
1132: hr_utility.set_location( l_proc, 10);
1133: close csr_cbg_person_valid_date;
1134: hr_utility.set_message(800,'HR_449030_MA_PERSON_DATE_RANGE');
1135: hr_utility.raise_error;
1136: end if;
1130: fetch csr_cbg_person_valid_date into l_exists;
1131: if csr_cbg_person_valid_date%notfound then
1132: hr_utility.set_location( l_proc, 10);
1133: close csr_cbg_person_valid_date;
1134: hr_utility.set_message(800,'HR_449030_MA_PERSON_DATE_RANGE');
1135: hr_utility.raise_error;
1136: end if;
1137: close csr_cbg_person_valid_date;
1138: END IF;
1131: if csr_cbg_person_valid_date%notfound then
1132: hr_utility.set_location( l_proc, 10);
1133: close csr_cbg_person_valid_date;
1134: hr_utility.set_message(800,'HR_449030_MA_PERSON_DATE_RANGE');
1135: hr_utility.raise_error;
1136: end if;
1137: close csr_cbg_person_valid_date;
1138: END IF;
1139: -- bug 1980440 fix ends
1136: end if;
1137: close csr_cbg_person_valid_date;
1138: END IF;
1139: -- bug 1980440 fix ends
1140: hr_utility.set_location('Leaving:'|| l_proc, 10);
1141:
1142: EXCEPTION
1143: when app_exception.application_exception then
1144: if hr_multi_message.exception_add
1188: l_proc varchar2(72) := g_package||'chk_appraisal_type';
1189:
1190:
1191: begin
1192: hr_utility.set_location('Entering:'|| l_proc, 1);
1193:
1194: -- Check mandatory parameters have been set
1195:
1196: hr_api.mandatory_arg_error
1213: ) or
1214: (NOT l_api_updating)
1215: ) then
1216:
1217: hr_utility.set_location(l_proc, 2);
1218:
1219:
1220: -- If appraisal type is not null then
1221: -- check if the value exists in hr_lookups
1228: ,p_lookup_type => 'APPRAISAL_TYPE'
1229: ,p_lookup_code => p_type
1230: ) then
1231: -- error invalid type
1232: hr_utility.set_message(801,'HR_51892_APR_INVALID_TYPE');
1233: hr_utility.raise_error;
1234: end if;
1235: hr_utility.set_location(l_proc, 3);
1236: end if;
1229: ,p_lookup_code => p_type
1230: ) then
1231: -- error invalid type
1232: hr_utility.set_message(801,'HR_51892_APR_INVALID_TYPE');
1233: hr_utility.raise_error;
1234: end if;
1235: hr_utility.set_location(l_proc, 3);
1236: end if;
1237: end if;
1231: -- error invalid type
1232: hr_utility.set_message(801,'HR_51892_APR_INVALID_TYPE');
1233: hr_utility.raise_error;
1234: end if;
1235: hr_utility.set_location(l_proc, 3);
1236: end if;
1237: end if;
1238: hr_utility.set_location('Leaving: '|| l_proc, 10);
1239: EXCEPTION
1234: end if;
1235: hr_utility.set_location(l_proc, 3);
1236: end if;
1237: end if;
1238: hr_utility.set_location('Leaving: '|| l_proc, 10);
1239: EXCEPTION
1240: when app_exception.application_exception then
1241: if hr_multi_message.exception_add
1242: (p_associated_column1 => 'PER_APPRAISALS.APPRAISAL_TYPE'
1287: l_proc varchar2(72) := g_package||'chk_appraisal_status';
1288:
1289:
1290: begin
1291: hr_utility.set_location('Entering:'|| l_proc, 1);
1292:
1293: -- Check mandatory parameters have been set
1294:
1295: hr_api.mandatory_arg_error
1312: ) or
1313: (NOT l_api_updating)
1314: ) then
1315:
1316: hr_utility.set_location(l_proc, 2);
1317:
1318:
1319: -- If appraisal status is not null then
1320: -- check if the value exists in hr_lookups
1327: ,p_lookup_type => 'APPRAISAL_ASSESSMENT_STATUS'
1328: ,p_lookup_code => p_status
1329: ) then
1330: -- error invalid type
1331: hr_utility.set_message(801,'HR_51893_APR_INVALID_STATUS');
1332: hr_utility.raise_error;
1333: end if;
1334: hr_utility.set_location(l_proc, 3);
1335: end if;
1328: ,p_lookup_code => p_status
1329: ) then
1330: -- error invalid type
1331: hr_utility.set_message(801,'HR_51893_APR_INVALID_STATUS');
1332: hr_utility.raise_error;
1333: end if;
1334: hr_utility.set_location(l_proc, 3);
1335: end if;
1336: end if;
1330: -- error invalid type
1331: hr_utility.set_message(801,'HR_51893_APR_INVALID_STATUS');
1332: hr_utility.raise_error;
1333: end if;
1334: hr_utility.set_location(l_proc, 3);
1335: end if;
1336: end if;
1337: hr_utility.set_location('Leaving: '|| l_proc, 10);
1338:
1333: end if;
1334: hr_utility.set_location(l_proc, 3);
1335: end if;
1336: end if;
1337: hr_utility.set_location('Leaving: '|| l_proc, 10);
1338:
1339: EXCEPTION
1340: when app_exception.application_exception then
1341: if hr_multi_message.exception_add
1379: l_proc varchar2(72):=g_package||'chk_group_date_id';
1380:
1381:
1382: begin
1383: hr_utility.set_location('Entering:'|| l_proc, 1);
1384:
1385: -- Tests are carried out on insert only.
1386:
1387:
1396: */
1397:
1398: -- raise an error as the either both should exist or neither should.
1399:
1400: hr_utility.set_message(801, 'HR_52308_CM_GPR_DATE_ID_PROB');
1401: hr_utility.raise_error;
1402:
1403: end if;
1404:
1397:
1398: -- raise an error as the either both should exist or neither should.
1399:
1400: hr_utility.set_message(801, 'HR_52308_CM_GPR_DATE_ID_PROB');
1401: hr_utility.raise_error;
1402:
1403: end if;
1404:
1405: hr_utility.set_location('Leaving:'|| l_proc, 2);
1401: hr_utility.raise_error;
1402:
1403: end if;
1404:
1405: hr_utility.set_location('Leaving:'|| l_proc, 2);
1406: EXCEPTION
1407: when app_exception.application_exception then
1408: if hr_multi_message.exception_add
1409: (p_associated_column1 => 'PER_ASSESSMENTS.GROUP_DATE'
1456: l_asn_grp_pers_bg per_people_f.business_group_id%TYPE;
1457:
1458: lv_cross_business_group VARCHAR2(10); -- bug 1980440 fix
1459: begin
1460: hr_utility.set_location('Entering:'|| l_proc, 1);
1461:
1462: -- Tests are carried out on insert, and update (even if values haven't changed)
1463: -- as data in the referenced table may have.
1464:
1474: close csr_chk_grp_per_sta_date;
1475:
1476: -- raise an error as the person_id doesn't exist
1477:
1478: hr_utility.set_message(801, 'HR_52305_ASN_GRPPER_NOT_EXIST');
1479: hr_utility.raise_error;
1480:
1481: end if;
1482: close csr_chk_grp_per_sta_date;
1475:
1476: -- raise an error as the person_id doesn't exist
1477:
1478: hr_utility.set_message(801, 'HR_52305_ASN_GRPPER_NOT_EXIST');
1479: hr_utility.raise_error;
1480:
1481: end if;
1482: close csr_chk_grp_per_sta_date;
1483:
1493: if (l_asn_grp_pers_bg <> p_business_group_id) then
1494:
1495: -- raise an error as the person is in the wrong business_group
1496:
1497: hr_utility.set_message(801, 'HR_52306_ASN_GRPPER_NOT_BG');
1498: hr_utility.raise_error;
1499:
1500: end if;
1501: end if;
1494:
1495: -- raise an error as the person is in the wrong business_group
1496:
1497: hr_utility.set_message(801, 'HR_52306_ASN_GRPPER_NOT_BG');
1498: hr_utility.raise_error;
1499:
1500: end if;
1501: end if;
1502: -- bug 1980440 fix ends
1504: -- The group_date has to be on or after the group initiators start date
1505:
1506: if (p_group_date < l_asn_grp_pers_sta_date) then
1507:
1508: hr_utility.set_message(801, 'HR_52307_ASN_GRPPER_NO_XIST_DA');
1509: hr_utility.raise_error;
1510:
1511: end if;
1512: ELSE
1505:
1506: if (p_group_date < l_asn_grp_pers_sta_date) then
1507:
1508: hr_utility.set_message(801, 'HR_52307_ASN_GRPPER_NO_XIST_DA');
1509: hr_utility.raise_error;
1510:
1511: end if;
1512: ELSE
1513: NULL;
1512: ELSE
1513: NULL;
1514: END IF;
1515:
1516: hr_utility.set_location('Leaving:'|| l_proc, 1);
1517:
1518: EXCEPTION
1519: when app_exception.application_exception then
1520: if hr_multi_message.exception_add
1568: l_api_updating boolean;
1569: l_proc varchar2(72) := g_package||'chk_appraisal_period_dates';
1570:
1571: begin
1572: hr_utility.set_location('Entering:'|| l_proc, 1);
1573:
1574: if (p_appraisal_period_start_date is NULL) then
1575: hr_utility.set_message(801, 'HR_51894_APR_START_DATE_NULL');
1576: hr_utility.raise_error;
1571: begin
1572: hr_utility.set_location('Entering:'|| l_proc, 1);
1573:
1574: if (p_appraisal_period_start_date is NULL) then
1575: hr_utility.set_message(801, 'HR_51894_APR_START_DATE_NULL');
1576: hr_utility.raise_error;
1577: elsif (p_appraisal_period_end_date is NULL) then
1578: hr_utility.set_message(801, 'HR_51895_APR_END_DATE_NULL');
1579: hr_utility.raise_error;
1572: hr_utility.set_location('Entering:'|| l_proc, 1);
1573:
1574: if (p_appraisal_period_start_date is NULL) then
1575: hr_utility.set_message(801, 'HR_51894_APR_START_DATE_NULL');
1576: hr_utility.raise_error;
1577: elsif (p_appraisal_period_end_date is NULL) then
1578: hr_utility.set_message(801, 'HR_51895_APR_END_DATE_NULL');
1579: hr_utility.raise_error;
1580: end if;
1574: if (p_appraisal_period_start_date is NULL) then
1575: hr_utility.set_message(801, 'HR_51894_APR_START_DATE_NULL');
1576: hr_utility.raise_error;
1577: elsif (p_appraisal_period_end_date is NULL) then
1578: hr_utility.set_message(801, 'HR_51895_APR_END_DATE_NULL');
1579: hr_utility.raise_error;
1580: end if;
1581:
1582: -- Only proceed with validation if :
1575: hr_utility.set_message(801, 'HR_51894_APR_START_DATE_NULL');
1576: hr_utility.raise_error;
1577: elsif (p_appraisal_period_end_date is NULL) then
1578: hr_utility.set_message(801, 'HR_51895_APR_END_DATE_NULL');
1579: hr_utility.raise_error;
1580: end if;
1581:
1582: -- Only proceed with validation if :
1583: -- a) The current g_old_rec is current and
1586: (p_appraisal_id => p_appraisal_id
1587: ,p_object_version_number => p_object_version_number);
1588:
1589: -- Do the check
1590: hr_utility.set_location(l_proc, 2);
1591:
1592: -- The start date has to be <= the end date and end date >= strat date, else error.
1593:
1594: -- Fix 3062009
1594: -- Fix 3062009
1595: -- Removed If condition for raising error when start date < end date.
1596:
1597: if (p_appraisal_period_end_date < p_appraisal_period_start_date) then
1598: hr_utility.set_message(801, 'HR_51897_APR_END_DATE_LATER');
1599: hr_utility.raise_error;
1600: end if;
1601:
1602: hr_utility.set_location('Leaving: '|| l_proc, 10);
1595: -- Removed If condition for raising error when start date < end date.
1596:
1597: if (p_appraisal_period_end_date < p_appraisal_period_start_date) then
1598: hr_utility.set_message(801, 'HR_51897_APR_END_DATE_LATER');
1599: hr_utility.raise_error;
1600: end if;
1601:
1602: hr_utility.set_location('Leaving: '|| l_proc, 10);
1603: end chk_appraisal_period_dates;
1598: hr_utility.set_message(801, 'HR_51897_APR_END_DATE_LATER');
1599: hr_utility.raise_error;
1600: end if;
1601:
1602: hr_utility.set_location('Leaving: '|| l_proc, 10);
1603: end chk_appraisal_period_dates;
1604:
1605: -- ---------------------------------------------------------------------------+
1606: -- |---------------------< chk_appraisal_dates >------------------------------|
1744: END IF; --- l_ret FALSE
1745: RETURN l_ret;
1746: end validate_date;
1747: begin
1748: hr_utility.set_location('Entering: '||l_proc,10);
1749: IF p_term_validations = 'Y' THEN
1750: OPEN csr_term_settings(p_appraisal_template_id);
1751: FETCH csr_term_settings INTO l_term_emp,l_term_cwk,l_future_term;
1752: CLOSE csr_term_settings;
1754: l_term_emp := 'N';
1755: l_term_cwk := 'N';
1756: l_future_term := 'N';
1757: END IF;
1758: hr_utility.trace('l_term_setting: EMP: '||l_term_emp||':CWK:'||l_term_cwk||':FUT_TERM:'||l_future_term);
1759: -- Determine whether each of the dates are valid
1760: l_valid :=
1761: validate_date(p_appraisal_period_start_date, p_appraisee_person_id,l_term_emp,l_term_cwk,l_future_term);
1762: if not l_valid then
1764: hr_multi_message.add(p_associated_column1 => 'PER_APPRAISALS.APPRAISAL_PERIOD_START_DATE');
1765: --fnd_message.raise_error;
1766: end if;
1767:
1768: hr_utility.set_location(l_proc,20);
1769:
1770: l_valid :=
1771: validate_date(p_appraisal_date,p_appraisee_person_id,l_term_emp,l_term_cwk,l_future_term);
1772: if not l_valid then
1774: hr_multi_message.add(p_associated_column1 => 'PER_APPRAISALS.APPRAISAL_DATE');
1775: --fnd_message.raise_error;
1776: end if;
1777:
1778: hr_utility.set_location(l_proc,30);
1779:
1780: l_valid :=
1781: validate_date(p_appraisal_period_end_date, p_appraisee_person_id,l_term_emp,l_term_cwk,l_future_term);
1782: if not l_valid then
1784: hr_multi_message.add(p_associated_column1 => 'PER_APPRAISALS.APPRAISAL_PERIOD_END_DATE');
1785: --fnd_message.raise_error;
1786: end if;
1787:
1788: hr_utility.set_location(l_proc,40);
1789:
1790: -- Check that appraisal_date is not set to a date when appraiser_person_id
1791: -- in not person type of 'EX_EMP' or 'EX_EMP_APL'
1792: -- 6825820 Bug Fix
1806:
1807:
1808: -- Check added for Bug 820841
1809:
1810: hr_utility.set_location(l_proc,50);
1811: -- The appraisal date has to be >= appraisal start date, else error.
1812:
1813: if (p_appraisal_period_start_date > p_appraisal_date) then
1814:
1811: -- The appraisal date has to be >= appraisal start date, else error.
1812:
1813: if (p_appraisal_period_start_date > p_appraisal_date) then
1814:
1815: hr_utility.set_message(800, 'HR_52792_INVALID_APPR_DATE'); -- Fix 3061934.
1816: hr_multi_message.add(p_associated_column1 => 'PER_APPRAISALS.APPRAISAL_DATE'
1817: ,p_associated_column2 => 'PER_APPRAISALS.APPRAISAL_PERIOD_START_DATE'
1818: );
1819: --hr_utility.raise_error;
1815: hr_utility.set_message(800, 'HR_52792_INVALID_APPR_DATE'); -- Fix 3061934.
1816: hr_multi_message.add(p_associated_column1 => 'PER_APPRAISALS.APPRAISAL_DATE'
1817: ,p_associated_column2 => 'PER_APPRAISALS.APPRAISAL_PERIOD_START_DATE'
1818: );
1819: --hr_utility.raise_error;
1820: end if;
1821:
1822: hr_utility.set_location(l_proc,60);
1823:
1818: );
1819: --hr_utility.raise_error;
1820: end if;
1821:
1822: hr_utility.set_location(l_proc,60);
1823:
1824: -- Fix 3061901
1825:
1826: if ( nvl(p_next_appraisal_date,hr_api.g_eot ) < p_appraisal_date) then
1823:
1824: -- Fix 3061901
1825:
1826: if ( nvl(p_next_appraisal_date,hr_api.g_eot ) < p_appraisal_date) then
1827: hr_utility.set_message(800, 'HR_449014_INV_NEXT_APPR_DATE');
1828: hr_multi_message.add(p_associated_column1 => 'PER_APPRAISALS.NEXT_APPRAISAL_DATE'
1829: ,p_associated_column2 => 'PER_APPRAISALS.APPRAISAL_DATE'
1830: );
1831: --hr_utility.raise_error;
1827: hr_utility.set_message(800, 'HR_449014_INV_NEXT_APPR_DATE');
1828: hr_multi_message.add(p_associated_column1 => 'PER_APPRAISALS.NEXT_APPRAISAL_DATE'
1829: ,p_associated_column2 => 'PER_APPRAISALS.APPRAISAL_DATE'
1830: );
1831: --hr_utility.raise_error;
1832:
1833: end if;
1834:
1835: hr_utility.set_location('Leaving: '||l_proc,70);
1831: --hr_utility.raise_error;
1832:
1833: end if;
1834:
1835: hr_utility.set_location('Leaving: '||l_proc,70);
1836:
1837:
1838: end chk_appraisal_dates;
1839:
1905: where rating_scale_id = l_rating_scale_id
1906: and appraisal_template_id = p_appraisal_template_id;
1907:
1908: begin
1909: hr_utility.set_location('Entering:'|| l_proc, 1);
1910:
1911: -- Check mandatory parameters have been set
1912:
1913: hr_api.mandatory_arg_error
1930: ) or
1931: (NOT l_api_updating)
1932: ) then
1933: -- Do the check
1934: hr_utility.set_location(l_proc, 2);
1935: if p_overall_performance_level_id is not null then
1936: open csr_overall_rating_bg;
1937: fetch csr_overall_rating_bg into l_business_group_id , l_rating_scale_id;
1938: if csr_overall_rating_bg%notfound then
1936: open csr_overall_rating_bg;
1937: fetch csr_overall_rating_bg into l_business_group_id , l_rating_scale_id;
1938: if csr_overall_rating_bg%notfound then
1939: close csr_overall_rating_bg;
1940: hr_utility.set_message(801,'HR_51898_APR_NO_SUCH_LEVEL');
1941: hr_utility.raise_error;
1942: end if;
1943: close csr_overall_rating_bg;
1944: -- check if the business groups match
1937: fetch csr_overall_rating_bg into l_business_group_id , l_rating_scale_id;
1938: if csr_overall_rating_bg%notfound then
1939: close csr_overall_rating_bg;
1940: hr_utility.set_message(801,'HR_51898_APR_NO_SUCH_LEVEL');
1941: hr_utility.raise_error;
1942: end if;
1943: close csr_overall_rating_bg;
1944: -- check if the business groups match
1945: hr_utility.set_location(l_proc, 3);
1941: hr_utility.raise_error;
1942: end if;
1943: close csr_overall_rating_bg;
1944: -- check if the business groups match
1945: hr_utility.set_location(l_proc, 3);
1946: -- ngundura changes as per pa requirement
1947: -- added l_business_group_id is not null criteria to facilitate global rating scales
1948: if p_business_group_id <> l_business_group_id and l_business_group_id is not null then
1949: hr_utility.set_message(801,'HR_51899_APR_LVL_DIFF_BG');
1945: hr_utility.set_location(l_proc, 3);
1946: -- ngundura changes as per pa requirement
1947: -- added l_business_group_id is not null criteria to facilitate global rating scales
1948: if p_business_group_id <> l_business_group_id and l_business_group_id is not null then
1949: hr_utility.set_message(801,'HR_51899_APR_LVL_DIFF_BG');
1950: hr_utility.raise_error;
1951: end if;
1952: -- check if the rating level is for the rating scale
1953: -- defined in the appraisal template
1946: -- ngundura changes as per pa requirement
1947: -- added l_business_group_id is not null criteria to facilitate global rating scales
1948: if p_business_group_id <> l_business_group_id and l_business_group_id is not null then
1949: hr_utility.set_message(801,'HR_51899_APR_LVL_DIFF_BG');
1950: hr_utility.raise_error;
1951: end if;
1952: -- check if the rating level is for the rating scale
1953: -- defined in the appraisal template
1954: hr_utility.set_location(l_proc, 4);
1950: hr_utility.raise_error;
1951: end if;
1952: -- check if the rating level is for the rating scale
1953: -- defined in the appraisal template
1954: hr_utility.set_location(l_proc, 4);
1955: open csr_overall_rating_valid;
1956: fetch csr_overall_rating_valid into l_exists;
1957: if csr_overall_rating_valid%notfound then
1958: close csr_overall_rating_valid;
1955: open csr_overall_rating_valid;
1956: fetch csr_overall_rating_valid into l_exists;
1957: if csr_overall_rating_valid%notfound then
1958: close csr_overall_rating_valid;
1959: hr_utility.set_message(801,'HR_51900_APR_LVL_DIFF_SCALE');
1960: hr_utility.raise_error;
1961: end if;
1962: close csr_overall_rating_valid;
1963: end if;
1956: fetch csr_overall_rating_valid into l_exists;
1957: if csr_overall_rating_valid%notfound then
1958: close csr_overall_rating_valid;
1959: hr_utility.set_message(801,'HR_51900_APR_LVL_DIFF_SCALE');
1960: hr_utility.raise_error;
1961: end if;
1962: close csr_overall_rating_valid;
1963: end if;
1964: end if;
1961: end if;
1962: close csr_overall_rating_valid;
1963: end if;
1964: end if;
1965: hr_utility.set_location('Leaving: '|| l_proc, 10);
1966:
1967: EXCEPTION
1968: when app_exception.application_exception then
1969: if hr_multi_message.exception_add
2074: where qsa.type_object_id = p_appraisal_id
2075: and qsa.type = 'APPRAISAL';
2076:
2077: begin
2078: hr_utility.set_location('Entering:'|| l_proc, 1);
2079:
2080: -- Check mandatory parameters have been set
2081:
2082: hr_api.mandatory_arg_error
2084: ,p_argument => 'appraisal_id'
2085: ,p_argument_value => p_appraisal_id
2086: );
2087:
2088: hr_utility.set_location(l_proc, 2);
2089:
2090: -- check if overall_performance_level_id is null. If it is not null then
2091: -- do not allow the appraisal to be deleted.
2092:
2090: -- check if overall_performance_level_id is null. If it is not null then
2091: -- do not allow the appraisal to be deleted.
2092:
2093: if p_overall_performance_level_id is not null then
2094: hr_utility.set_message(801,'HR_51902_APR_LVL_NOT_NULL');
2095: hr_utility.raise_error;
2096: end if;
2097:
2098: open csr_apr_exists_in_answers;
2091: -- do not allow the appraisal to be deleted.
2092:
2093: if p_overall_performance_level_id is not null then
2094: hr_utility.set_message(801,'HR_51902_APR_LVL_NOT_NULL');
2095: hr_utility.raise_error;
2096: end if;
2097:
2098: open csr_apr_exists_in_answers;
2099: fetch csr_apr_exists_in_answers into l_exists;
2098: open csr_apr_exists_in_answers;
2099: fetch csr_apr_exists_in_answers into l_exists;
2100: if csr_apr_exists_in_answers%found then
2101: close csr_apr_exists_in_answers;
2102: hr_utility.set_message(801,'HR_51903_APR_IN_ANSWERS');
2103: hr_utility.raise_error;
2104: end if;
2105: close csr_apr_exists_in_answers;
2106:
2099: fetch csr_apr_exists_in_answers into l_exists;
2100: if csr_apr_exists_in_answers%found then
2101: close csr_apr_exists_in_answers;
2102: hr_utility.set_message(801,'HR_51903_APR_IN_ANSWERS');
2103: hr_utility.raise_error;
2104: end if;
2105: close csr_apr_exists_in_answers;
2106:
2107: hr_utility.set_location(l_proc, 3);
2103: hr_utility.raise_error;
2104: end if;
2105: close csr_apr_exists_in_answers;
2106:
2107: hr_utility.set_location(l_proc, 3);
2108:
2109: open csr_apr_exits_in_objectives;
2110: fetch csr_apr_exits_in_objectives into l_exists;
2111: if csr_apr_exits_in_objectives%found then
2109: open csr_apr_exits_in_objectives;
2110: fetch csr_apr_exits_in_objectives into l_exists;
2111: if csr_apr_exits_in_objectives%found then
2112: close csr_apr_exits_in_objectives;
2113: hr_utility.set_message(801,'HR_51904_APR_IN_OBJECT');
2114: hr_utility.raise_error;
2115: end if;
2116: close csr_apr_exits_in_objectives;
2117:
2110: fetch csr_apr_exits_in_objectives into l_exists;
2111: if csr_apr_exits_in_objectives%found then
2112: close csr_apr_exits_in_objectives;
2113: hr_utility.set_message(801,'HR_51904_APR_IN_OBJECT');
2114: hr_utility.raise_error;
2115: end if;
2116: close csr_apr_exits_in_objectives;
2117:
2118: hr_utility.set_location(l_proc, 4);
2114: hr_utility.raise_error;
2115: end if;
2116: close csr_apr_exits_in_objectives;
2117:
2118: hr_utility.set_location(l_proc, 4);
2119:
2120: open csr_apr_exists_in_assessments;
2121: fetch csr_apr_exists_in_assessments into l_exists;
2122: if csr_apr_exists_in_assessments%found then
2120: open csr_apr_exists_in_assessments;
2121: fetch csr_apr_exists_in_assessments into l_exists;
2122: if csr_apr_exists_in_assessments%found then
2123: close csr_apr_exists_in_assessments;
2124: hr_utility.set_message(801,'HR_51905_APR_IN_ASSMNT');
2125: hr_utility.raise_error;
2126: end if;
2127: close csr_apr_exists_in_assessments;
2128:
2121: fetch csr_apr_exists_in_assessments into l_exists;
2122: if csr_apr_exists_in_assessments%found then
2123: close csr_apr_exists_in_assessments;
2124: hr_utility.set_message(801,'HR_51905_APR_IN_ASSMNT');
2125: hr_utility.raise_error;
2126: end if;
2127: close csr_apr_exists_in_assessments;
2128:
2129: hr_utility.set_location(l_proc, 5);
2125: hr_utility.raise_error;
2126: end if;
2127: close csr_apr_exists_in_assessments;
2128:
2129: hr_utility.set_location(l_proc, 5);
2130:
2131: open csr_apr_exits_in_perf_rat;
2132: fetch csr_apr_exits_in_perf_rat into l_exists;
2133: if csr_apr_exits_in_perf_rat%found then
2131: open csr_apr_exits_in_perf_rat;
2132: fetch csr_apr_exits_in_perf_rat into l_exists;
2133: if csr_apr_exits_in_perf_rat%found then
2134: close csr_apr_exits_in_perf_rat;
2135: hr_utility.set_message(801,'HR_51906_APR_IN_PERF_RAT');
2136: hr_utility.raise_error;
2137: end if;
2138: close csr_apr_exits_in_perf_rat;
2139:
2132: fetch csr_apr_exits_in_perf_rat into l_exists;
2133: if csr_apr_exits_in_perf_rat%found then
2134: close csr_apr_exits_in_perf_rat;
2135: hr_utility.set_message(801,'HR_51906_APR_IN_PERF_RAT');
2136: hr_utility.raise_error;
2137: end if;
2138: close csr_apr_exits_in_perf_rat;
2139:
2140: hr_utility.set_location(l_proc, 6);
2136: hr_utility.raise_error;
2137: end if;
2138: close csr_apr_exits_in_perf_rat;
2139:
2140: hr_utility.set_location(l_proc, 6);
2141:
2142: open csr_apr_exists_in_per_part;
2143: fetch csr_apr_exists_in_per_part into l_exists;
2144: if csr_apr_exists_in_per_part%found then
2147: fnd_message.raise_error;
2148: end if;
2149: close csr_apr_exists_in_per_part;
2150:
2151: hr_utility.set_location(l_proc,7);
2152:
2153: open csr_apr_exists_in_hr_qsa;
2154: fetch csr_apr_exists_in_hr_qsa into l_exists;
2155: if csr_apr_exists_in_hr_qsa%found then
2158: fnd_message.raise_error;
2159: end if;
2160: close csr_apr_exists_in_hr_qsa;
2161:
2162: hr_utility.set_location('Leaving: '|| l_proc, 10);
2163: end chk_appraisal_delete;
2164:
2165: --
2166: -- ----------------------------------------------------------------------------
2204: WHERE pmp.plan_id = p_plan_id;
2205: --
2206: BEGIN
2207:
2208: hr_utility.set_location('Entering:'|| l_proc, 10);
2209:
2210: --
2211: -- Only proceed with validation if :
2212: -- a) The current g_old_rec is current and
2226: IF p_plan_id IS NOT null THEN
2227: --
2228: -- Check that plan exists.
2229: --
2230: hr_utility.set_location(l_proc, 20);
2231: OPEN csr_chk_plan_id;
2232: FETCH csr_chk_plan_id INTO l_plan_id;
2233: CLOSE csr_chk_plan_id;
2234:
2238: END IF;
2239:
2240: END IF;
2241:
2242: hr_utility.set_location('Leaving:'|| l_proc, 970);
2243:
2244: EXCEPTION
2245:
2246: WHEN app_exception.application_exception THEN
2246: WHEN app_exception.application_exception THEN
2247: IF hr_multi_message.exception_add
2248: (p_associated_column1 => 'PER_APPRAISALS.PLAN_ID')
2249: THEN
2250: hr_utility.set_location(' Leaving:'|| l_proc, 980);
2251: RAISE;
2252: END IF;
2253: hr_utility.set_location(' Leaving:'|| l_proc, 990);
2254:
2249: THEN
2250: hr_utility.set_location(' Leaving:'|| l_proc, 980);
2251: RAISE;
2252: END IF;
2253: hr_utility.set_location(' Leaving:'|| l_proc, 990);
2254:
2255: END chk_plan_id;
2256:
2257:
2294: --
2295: BEGIN
2296:
2297:
2298: hr_utility.set_location('Entering:'|| l_proc, 10);
2299:
2300:
2301: --
2302: -- Only proceed with validation if :
2317: IF p_offline_status IS NOT null THEN
2318: --
2319: -- Check that offline status is valid.
2320: --
2321: hr_utility.set_location(l_proc, 20);
2322: IF hr_api.not_exists_in_hr_lookups(
2323: p_effective_date => p_effective_date
2324: ,p_lookup_type => 'APPRAISAL_OFFLINE_STATUS'
2325: ,p_lookup_code => upper(p_offline_status)
2329: END IF;
2330:
2331: END IF;
2332:
2333: hr_utility.set_location('Leaving:'|| l_proc, 970);
2334: EXCEPTION
2335:
2336: WHEN app_exception.application_exception THEN
2337: IF hr_multi_message.exception_add
2336: WHEN app_exception.application_exception THEN
2337: IF hr_multi_message.exception_add
2338: (p_associated_column1 => 'PER_APPRAISALS.OFFLINE_STATUS')
2339: THEN
2340: hr_utility.set_location(' Leaving:'|| l_proc, 980);
2341: RAISE;
2342: END IF;
2343: hr_utility.set_location(' Leaving:'|| l_proc, 990);
2344:
2339: THEN
2340: hr_utility.set_location(' Leaving:'|| l_proc, 980);
2341: RAISE;
2342: END IF;
2343: hr_utility.set_location(' Leaving:'|| l_proc, 990);
2344:
2345: END chk_offline_status;
2346: --
2347: -- ----------------------------------------------------------------------+
2376:
2377: l_proc varchar2(72) := g_package||'chk_df';
2378:
2379: begin
2380: hr_utility.set_location('Entering:'||l_proc, 10);
2381:
2382: if ((p_rec.appraisal_id is not null) and (
2383: nvl(per_apr_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
2384: nvl(p_rec.attribute_category, hr_api.g_varchar2) or
2476: ,p_attribute20_value => p_rec.attribute20
2477: );
2478: end if;
2479:
2480: hr_utility.set_location(' Leaving:'||l_proc, 20);
2481:
2482: end chk_df;
2483:
2484: -- ---------------------------------------------------------------------------+
2490:
2491: l_proc varchar2(72) := g_package||'insert_validate';
2492:
2493: Begin
2494: hr_utility.set_location('Entering:'||l_proc, 5);
2495:
2496: -- Call all supporting business operations
2497:
2498: hr_api.validate_bus_grp_id
2500: ,p_associated_column1 => per_per_shd.g_tab_nam || '.BUSINESS_GROUP_ID'
2501: ); -- VALIDATE BUSINESS GROUP
2502:
2503:
2504: hr_utility.set_location(l_proc, 6);
2505:
2506: per_apr_bus.chk_appraisee_appraiser
2507: (p_person_id => p_rec.appraisee_person_id
2508: ,p_business_group_id => p_rec.business_group_id
2509: ,p_effective_date => p_effective_date
2510: ,p_person_type => 'APPRAISEE'
2511: );
2512:
2513: hr_utility.set_location(l_proc, 7);
2514:
2515: per_apr_bus.chk_appraisee_appraiser
2516: (p_person_id => p_rec.appraiser_person_id
2517: ,p_business_group_id => p_rec.business_group_id
2524: ,p_business_group_id => p_rec.business_group_id
2525: ,p_effective_date => p_effective_date
2526: );
2527:
2528: hr_utility.set_location(l_proc, 8);
2529:
2530: per_apr_bus.chk_appraisal_period_dates
2531: (p_appraisal_id => p_rec.appraisal_id
2532: ,p_object_version_number => p_rec.object_version_number
2533: ,p_appraisal_period_start_date => p_rec.appraisal_period_start_date
2534: ,p_appraisal_period_end_date => p_rec.appraisal_period_end_date
2535: );
2536:
2537: hr_utility.set_location(l_proc, 9);
2538: per_apr_bus.chk_appraisal_dates
2539: (p_appraisal_date => p_rec.appraisal_date
2540: ,p_appraisal_period_start_date => p_rec.appraisal_period_start_date
2541: ,p_appraisal_period_end_date => p_rec.appraisal_period_end_date
2545: ,p_main_appraiser_id => p_rec.main_appraiser_id
2546: ,p_appraisal_template_id => p_rec.appraisal_template_id
2547: ,p_term_validations => 'N'
2548: );
2549: hr_utility.set_location(l_proc, 10);
2550:
2551: per_apr_bus.chk_appraisal_template
2552: (p_appraisal_template_id => p_rec.appraisal_template_id
2553: ,p_business_group_id => p_rec.business_group_id
2564: ,p_effective_date => p_rec.appraisal_period_end_date
2565: );
2566:
2567:
2568: hr_utility.set_location(l_proc, 11);
2569:
2570: per_apr_bus.chk_appraisal_type
2571: (p_appraisal_id => p_rec.appraisal_id
2572: ,p_object_version_number => p_rec.object_version_number
2573: ,p_type => p_rec.type
2574: ,p_effective_date => p_effective_date
2575: );
2576:
2577: hr_utility.set_location(l_proc, 12);
2578:
2579: per_apr_bus.chk_overall_rating
2580: (p_appraisal_id => p_rec.appraisal_id
2581: ,p_object_version_number => p_rec.object_version_number
2583: ,p_overall_performance_level_id => p_rec.overall_performance_level_id
2584: ,p_business_group_id => p_rec.business_group_id
2585: );
2586:
2587: hr_utility.set_location(l_proc, 13);
2588:
2589: per_apr_bus.chk_appraisal_status
2590: (p_appraisal_id => p_rec.appraisal_id
2591: ,p_object_version_number => p_rec.object_version_number
2592: ,p_status => p_rec.status
2593: ,p_effective_date => p_effective_date
2594: );
2595:
2596: hr_utility.set_location(l_proc, 14);
2597:
2598:
2599: per_apr_bus.chk_group_date_id
2600: (p_group_initiator_id => p_rec.group_initiator_id
2629: -- Call descriptive flexfield validation routines
2630:
2631: per_apr_bus.chk_df(p_rec => p_rec);
2632:
2633: hr_utility.set_location(' Leaving:'||l_proc, 10);
2634: End insert_validate;
2635:
2636: -- ---------------------------------------------------------------------------+
2637: -- |---------------------------< update_validate >----------------------------|
2641:
2642: l_proc varchar2(72) := g_package||'update_validate';
2643:
2644: Begin
2645: hr_utility.set_location('Entering:'||l_proc, 5);
2646:
2647: -- Call all supporting business operations
2648:
2649: -- Rule Check non-updateable fields cannot be updated
2654: ); -- VALIDATE BUSINESS GROUP
2655:
2656: chk_non_updateable_args(p_rec => p_rec);
2657:
2658: hr_utility.set_location(l_proc,6);
2659:
2660: per_apr_bus.chk_open(p_open => p_rec.open
2661: ,p_effective_date => p_effective_date
2662: );
2660: per_apr_bus.chk_open(p_open => p_rec.open
2661: ,p_effective_date => p_effective_date
2662: );
2663:
2664: hr_utility.set_location(l_proc,7);
2665: per_apr_bus.chk_update_allowed
2666: (p_rec => p_rec);
2667: hr_utility.set_location(l_proc, 8);
2668:
2663:
2664: hr_utility.set_location(l_proc,7);
2665: per_apr_bus.chk_update_allowed
2666: (p_rec => p_rec);
2667: hr_utility.set_location(l_proc, 8);
2668:
2669: -- Appraisee is non updatable argument. So, no need for that check during update.
2670:
2671: per_apr_bus.chk_appraisee_appraiser
2680: per_apr_bus.chk_appraiser_person_id
2681: (p_appraisal_id => p_rec.appraisal_id);
2682: -- Call to current behavior of chk_appraiser_person_id is not required..
2683: */
2684: hr_utility.set_location(l_proc,9);
2685:
2686: per_apr_bus.chk_appraisal_period_dates
2687: (p_appraisal_id => p_rec.appraisal_id
2688: ,p_object_version_number => p_rec.object_version_number
2689: ,p_appraisal_period_start_date => p_rec.appraisal_period_start_date
2690: ,p_appraisal_period_end_date => p_rec.appraisal_period_end_date
2691: );
2692:
2693: hr_utility.set_location(l_proc, 9);
2694: per_apr_bus.chk_appraisal_dates
2695: (p_appraisal_date => p_rec.appraisal_date
2696: ,p_appraisal_period_start_date => p_rec.appraisal_period_start_date
2697: ,p_appraisal_period_end_date => p_rec.appraisal_period_end_date
2701: ,p_main_appraiser_id => p_rec.main_appraiser_id
2702: ,p_appraisal_template_id => p_rec.appraisal_template_id
2703: ,p_term_validations => 'Y'
2704: );
2705: hr_utility.set_location(l_proc, 91);
2706:
2707: per_apr_bus.chk_appraisal_type
2708: (p_appraisal_id => p_rec.appraisal_id
2709: ,p_object_version_number => p_rec.object_version_number
2710: ,p_type => p_rec.type
2711: ,p_effective_date => p_effective_date
2712: );
2713:
2714: hr_utility.set_location(l_proc, 10);
2715:
2716: per_apr_bus.chk_appraisal_template
2717: (p_appraisal_template_id => p_rec.appraisal_template_id
2718: ,p_business_group_id => p_rec.business_group_id
2736: ,p_overall_performance_level_id => p_rec.overall_performance_level_id
2737: ,p_business_group_id => p_rec.business_group_id
2738: );
2739:
2740: hr_utility.set_location(l_proc, 13);
2741:
2742: per_apr_bus.chk_appraisal_status
2743: (p_appraisal_id => p_rec.appraisal_id
2744: ,p_object_version_number => p_rec.object_version_number
2745: ,p_status => p_rec.status
2746: ,p_effective_date => p_effective_date
2747: );
2748:
2749: hr_utility.set_location(l_proc, 14);
2750:
2751: per_apr_bus.chk_main_appraiser_id
2752: (p_main_appraiser_id => p_rec.main_appraiser_id
2753: ,p_business_group_id => p_rec.business_group_id
2753: ,p_business_group_id => p_rec.business_group_id
2754: ,p_effective_date => p_effective_date
2755: );
2756:
2757: hr_utility.set_location(l_proc, 15);
2758:
2759: per_apr_bus.chk_plan_id
2760: (p_appraisal_id => p_rec.appraisal_id
2761: ,p_object_version_number => p_rec.object_version_number
2761: ,p_object_version_number => p_rec.object_version_number
2762: ,p_plan_id => p_rec.plan_id
2763: );
2764:
2765: hr_utility.set_location(l_proc, 16);
2766: per_apr_bus.chk_offline_status
2767: (p_appraisal_id => p_rec.appraisal_id
2768: ,p_object_version_number => p_rec.object_version_number
2769: ,p_offline_status => p_rec.offline_status
2773: -- Call descriptive flexfield validation routines
2774:
2775: per_apr_bus.chk_df(p_rec => p_rec);
2776:
2777: hr_utility.set_location(' Leaving:'||l_proc, 10);
2778: End update_validate;
2779:
2780: -- ---------------------------------------------------------------------------+
2781: -- |---------------------------< delete_validate >----------------------------|
2784:
2785: l_proc varchar2(72) := g_package||'delete_validate';
2786:
2787: Begin
2788: hr_utility.set_location('Entering:'||l_proc, 5);
2789:
2790: -- Call all supporting business operations
2791:
2792: per_apr_bus.chk_appraisal_delete
2794: ,p_object_version_number => p_rec.object_version_number
2795: ,p_overall_performance_level_id => p_rec.overall_performance_level_id
2796: ) ;
2797:
2798: hr_utility.set_location(' Leaving:'||l_proc, 10);
2799:
2800: End delete_validate;
2801:
2802:
2819: l_proc varchar2(72) := g_package||'return_legislation_code';
2820: l_legislation_code varchar2(150);
2821:
2822: Begin
2823: hr_utility.set_location('Entering:'||l_proc, 5);
2824:
2825: -- Ensure that all the mandatory parameters are not null
2826:
2827: hr_api.mandatory_arg_error (p_api_name => l_proc,
2834: -- call to this function. Just return the value in the global
2835: -- variable.
2836:
2837: l_legislation_code := g_legislation_code;
2838: hr_utility.set_location(l_proc, 20);
2839: else
2840:
2841: -- The ID is different to the last call to this function
2842: -- or this is the first call to this function.
2844: open csr_leg_code;
2845: fetch csr_leg_code into l_legislation_code;
2846: if csr_leg_code%notfound then
2847: close csr_leg_code;
2848: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
2849: hr_utility.raise_error;
2850: end if;
2851:
2852: close csr_leg_code;
2845: fetch csr_leg_code into l_legislation_code;
2846: if csr_leg_code%notfound then
2847: close csr_leg_code;
2848: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
2849: hr_utility.raise_error;
2850: end if;
2851:
2852: close csr_leg_code;
2853: g_appraisal_id := p_appraisal_id;
2853: g_appraisal_id := p_appraisal_id;
2854: g_legislation_code := l_legislation_code;
2855: end if;
2856:
2857: hr_utility.set_location(' Leaving:'||l_proc, 10);
2858:
2859: return l_legislation_code;
2860: End return_legislation_code;
2861: