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: -- -------------------------------------------------------------------------+
79:
80: l_proc varchar2(72) := g_package||'chk_non_updateable_args';
81:
82: Begin
83: hr_utility.set_location('Entering:'||l_proc, 5);
84:
85: -- Only proceed with validation if a row exists for
86: -- the current record in the HR Schema
87:
88: if not per_apr_shd.api_updating
89: (p_appraisal_id => p_rec.appraisal_id
90: ,p_object_version_number => p_rec.object_version_number
91: ) then
92: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
93: hr_utility.set_message_token('PROCEDURE', l_proc);
94: hr_utility.set_message_token('STEP', '5');
95: end if;
96:
89: (p_appraisal_id => p_rec.appraisal_id
90: ,p_object_version_number => p_rec.object_version_number
91: ) then
92: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
93: hr_utility.set_message_token('PROCEDURE', l_proc);
94: hr_utility.set_message_token('STEP', '5');
95: end if;
96:
97: hr_utility.set_location(l_proc, 6);
90: ,p_object_version_number => p_rec.object_version_number
91: ) then
92: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
93: hr_utility.set_message_token('PROCEDURE', l_proc);
94: hr_utility.set_message_token('STEP', '5');
95: end if;
96:
97: hr_utility.set_location(l_proc, 6);
98:
93: hr_utility.set_message_token('PROCEDURE', l_proc);
94: hr_utility.set_message_token('STEP', '5');
95: end if;
96:
97: hr_utility.set_location(l_proc, 6);
98:
99: if p_rec.business_group_id <> per_apr_shd.g_old_rec.business_group_id then
100: hr_api.argument_changed_error
101: (
103: ,p_argument => 'BUSINESS_GROUP_ID'
104: ,p_base_table => per_per_shd.g_tab_nam
105: );
106: elsif p_rec.appraisal_template_id <> per_apr_shd.g_old_rec.appraisal_template_id then
107: hr_utility.set_location(l_proc, 7);
108: hr_api.argument_changed_error
109: (
110: p_api_name => l_proc
111: ,p_argument => 'APPRAISAL_TEMPLATE_ID'
111: ,p_argument => 'APPRAISAL_TEMPLATE_ID'
112: ,p_base_table => per_per_shd.g_tab_nam
113: );
114: elsif p_rec.appraisee_person_id <> per_apr_shd.g_old_rec.appraisee_person_id then
115: hr_utility.set_location(l_proc, 8);
116: hr_api.argument_changed_error
117: (
118: p_api_name => l_proc
119: ,p_argument => 'APPRAISEE_ID'
119: ,p_argument => 'APPRAISEE_ID'
120: ,p_base_table => per_per_shd.g_tab_nam
121: );
122: elsif p_rec.assignment_id <> per_apr_shd.g_old_rec.assignment_id then
123: hr_utility.set_location(l_proc, 9);
124: hr_api.argument_changed_error
125: (
126: p_api_name => l_proc
127: ,p_argument => 'ASSIGNMENT_ID'
127: ,p_argument => 'ASSIGNMENT_ID'
128: ,p_base_table => per_per_shd.g_tab_nam
129: );
130: elsif p_rec.assignment_start_date <> per_apr_shd.g_old_rec.assignment_start_date then
131: hr_utility.set_location(l_proc, 10);
132: hr_api.argument_changed_error
133: (
134: p_api_name => l_proc
135: ,p_argument => 'ASSIGNMENT_START_DATE'
135: ,p_argument => 'ASSIGNMENT_START_DATE'
136: ,p_base_table => per_per_shd.g_tab_nam
137: );
138: elsif p_rec.assignment_business_group_id <> per_apr_shd.g_old_rec.assignment_business_group_id then
139: hr_utility.set_location(l_proc, 11);
140: hr_api.argument_changed_error
141: (
142: p_api_name => l_proc
143: ,p_argument => 'ASSIGNMENT_BUSINESS_GROUP_ID'
143: ,p_argument => 'ASSIGNMENT_BUSINESS_GROUP_ID'
144: ,p_base_table => per_per_shd.g_tab_nam
145: );
146: elsif p_rec.assignment_organization_id <> per_apr_shd.g_old_rec.assignment_organization_id then
147: hr_utility.set_location(l_proc, 12);
148: hr_api.argument_changed_error
149: (
150: p_api_name => l_proc
151: ,p_argument => 'ASSIGNMENT_ORGANIZATION_ID'
151: ,p_argument => 'ASSIGNMENT_ORGANIZATION_ID'
152: ,p_base_table => per_per_shd.g_tab_nam
153: );
154: elsif p_rec.assignment_job_id <> per_apr_shd.g_old_rec.assignment_job_id then
155: hr_utility.set_location(l_proc, 13);
156: hr_api.argument_changed_error
157: (
158: p_api_name => l_proc
159: ,p_argument => 'ASSIGNMENT_JOB_ID'
159: ,p_argument => 'ASSIGNMENT_JOB_ID'
160: ,p_base_table => per_per_shd.g_tab_nam
161: );
162: elsif p_rec.assignment_position_id <> per_apr_shd.g_old_rec.assignment_position_id then
163: hr_utility.set_location(l_proc, 14);
164: hr_api.argument_changed_error
165: (
166: p_api_name => l_proc
167: ,p_argument => 'ASSIGNMENT_POSITION_ID'
168: ,p_base_table => per_per_shd.g_tab_nam
169: );
170:
171: end if;
172: hr_utility.set_location(' Leaving:'||l_proc, 15);
173:
174: end chk_non_updateable_args;
175:
176: -- --------------------------------------------------------------------------+
211: l_proc varchar2(72) := g_package || 'chk_open';
212:
213: begin
214:
215: hr_utility.set_location('Entering: '||l_proc,10);
216:
217: if (p_open <> null) and
218: (hr_api.not_exists_in_hr_lookups
219: (p_effective_date => p_effective_date
224: fnd_message.set_name('PER','PER_52459_APR_INVALID_OPEN_TYPE');
225: fnd_message.raise_error;
226: end if;
227:
228: hr_utility.set_location('Leaving: '||l_proc,20);
229:
230: EXCEPTION
231: when app_exception.application_exception then
232: if hr_multi_message.exception_add
291:
292: l_allow_appraisal BOOLEAN := FALSE;
293: begin
294:
295: hr_utility.set_location('Entering: '||l_proc,10);
296:
297: -- Fetch person_type
298:
299: for i in csr_fetch_type
502:
503:
504: end if;
505:
506: hr_utility.set_location('Leaving: '||l_proc,20);
507:
508: end chk_update_allowed;
509:
510:
556: and qsa.type = 'APPRAISAL';
557:
558: begin
559:
560: hr_utility.set_location('Entering: '|| l_proc,10);
561:
562: -- flemonni added
563:
564: if p_appraisal_id <> per_apr_shd.g_old_rec.appraisal_id then
575: else
576: null;
577: end if;
578:
579: hr_utility.set_location('Leaving: '||l_proc,20);
580:
581: EXCEPTION
582: when app_exception.application_exception then
583: if hr_multi_message.exception_add
654: nvl(date_from,hr_api.g_sot) and nvl(date_to,hr_api.g_eot);
655:
656:
657: begin
658: hr_utility.set_location('Entering:'|| l_proc, 1);
659:
660: -- Check mandatory parameters have been set
661:
662: hr_api.mandatory_arg_error
671: ,p_argument => 'effective_date'
672: ,p_argument_value => p_effective_date
673: );
674:
675: hr_utility.set_location('Entering:'|| l_proc, 2);
676:
677: -- check if the user has entered a appraisal_template_id
678: -- It is mandatory column.
679:
677: -- check if the user has entered a appraisal_template_id
678: -- It is mandatory column.
679:
680: if p_appraisal_template_id is null then
681: hr_utility.set_message(800,'HR_52256_APR_TEMP_MANDATORY');
682: hr_utility.raise_error;
683: end if;
684:
685: hr_utility.set_location(l_proc, 3);
678: -- It is mandatory column.
679:
680: if p_appraisal_template_id is null then
681: hr_utility.set_message(800,'HR_52256_APR_TEMP_MANDATORY');
682: hr_utility.raise_error;
683: end if;
684:
685: hr_utility.set_location(l_proc, 3);
686:
681: hr_utility.set_message(800,'HR_52256_APR_TEMP_MANDATORY');
682: hr_utility.raise_error;
683: end if;
684:
685: hr_utility.set_location(l_proc, 3);
686:
687: if p_appraisal_template_id is not null then
688: open csr_appraisal_exists;
689: fetch csr_appraisal_exists into l_business_group_id;
688: open csr_appraisal_exists;
689: fetch csr_appraisal_exists into l_business_group_id;
690: if csr_appraisal_exists%notfound then
691: close csr_appraisal_exists;
692: hr_utility.set_message(801,'HR_52246_APR_TEMP_NOT_EXIST');
693: hr_utility.raise_error;
694: end if;
695: close csr_appraisal_exists;
696:
689: fetch csr_appraisal_exists into l_business_group_id;
690: if csr_appraisal_exists%notfound then
691: close csr_appraisal_exists;
692: hr_utility.set_message(801,'HR_52246_APR_TEMP_NOT_EXIST');
693: hr_utility.raise_error;
694: end if;
695: close csr_appraisal_exists;
696:
697: -- check if appraisal template is in the same business group
696:
697: -- check if appraisal template is in the same business group
698:
699: if l_business_group_id <> p_business_group_id then
700: hr_utility.set_message(801,'HR_51883_TEMP_DIFF_BUS_GRP');
701: hr_utility.raise_error;
702: end if;
703:
704: -- check if appraisal template exists as of users effective date
697: -- check if appraisal template is in the same business group
698:
699: if l_business_group_id <> p_business_group_id then
700: hr_utility.set_message(801,'HR_51883_TEMP_DIFF_BUS_GRP');
701: hr_utility.raise_error;
702: end if;
703:
704: -- check if appraisal template exists as of users effective date
705:
706: open csr_appraisal_template_valid;
707: fetch csr_appraisal_template_valid into l_exists;
708: if csr_appraisal_template_valid%notfound then
709: close csr_appraisal_template_valid;
710: hr_utility.set_message(801,'HR_51884_APR_TEMP_NOT_DATE');
711: hr_utility.raise_error;
712: end if;
713: close csr_appraisal_template_valid;
714: end if;
707: fetch csr_appraisal_template_valid into l_exists;
708: if csr_appraisal_template_valid%notfound then
709: close csr_appraisal_template_valid;
710: hr_utility.set_message(801,'HR_51884_APR_TEMP_NOT_DATE');
711: hr_utility.raise_error;
712: end if;
713: close csr_appraisal_template_valid;
714: end if;
715:
712: end if;
713: close csr_appraisal_template_valid;
714: end if;
715:
716: hr_utility.set_location(l_proc, 4);
717:
718: hr_utility.set_location('Leaving: '|| l_proc, 10);
719: EXCEPTION
720: when app_exception.application_exception then
714: end if;
715:
716: hr_utility.set_location(l_proc, 4);
717:
718: hr_utility.set_location('Leaving: '|| l_proc, 10);
719: EXCEPTION
720: when app_exception.application_exception then
721: if hr_multi_message.exception_add
722: (p_associated_column1 => 'PER_APPRAISALS.APPRAISAL_TEMPLATE_ID'
817: and p_effective_date between
818: effective_start_date and nvl(effective_end_date,hr_api.g_eot);
819:
820: begin
821: hr_utility.set_location('Entering:'|| l_proc, 1);
822:
823: if (p_person_id is NULL) then
824: if p_person_type = 'APPRAISEE' then
825: hr_utility.set_message(801, 'HR_51887_APR_APPRAISEE_NULL');
821: hr_utility.set_location('Entering:'|| l_proc, 1);
822:
823: if (p_person_id is NULL) then
824: if p_person_type = 'APPRAISEE' then
825: hr_utility.set_message(801, 'HR_51887_APR_APPRAISEE_NULL');
826: hr_utility.raise_error;
827: elsif p_person_type = 'APPRAISER' then
828: hr_utility.set_message(801, 'HR_51888_APR_APPRAISER_NULL');
829: hr_utility.raise_error;
822:
823: if (p_person_id is NULL) then
824: if p_person_type = 'APPRAISEE' then
825: hr_utility.set_message(801, 'HR_51887_APR_APPRAISEE_NULL');
826: hr_utility.raise_error;
827: elsif p_person_type = 'APPRAISER' then
828: hr_utility.set_message(801, 'HR_51888_APR_APPRAISER_NULL');
829: hr_utility.raise_error;
830: end if;
824: if p_person_type = 'APPRAISEE' then
825: hr_utility.set_message(801, 'HR_51887_APR_APPRAISEE_NULL');
826: hr_utility.raise_error;
827: elsif p_person_type = 'APPRAISER' then
828: hr_utility.set_message(801, 'HR_51888_APR_APPRAISER_NULL');
829: hr_utility.raise_error;
830: end if;
831: end if;
832:
825: hr_utility.set_message(801, 'HR_51887_APR_APPRAISEE_NULL');
826: hr_utility.raise_error;
827: elsif p_person_type = 'APPRAISER' then
828: hr_utility.set_message(801, 'HR_51888_APR_APPRAISER_NULL');
829: hr_utility.raise_error;
830: end if;
831: end if;
832:
833: -- Check mandatory parameters have been set
838: ,p_argument_value => p_effective_date
839: );
840:
841:
842: hr_utility.set_location('Entering:'|| l_proc, 2);
843:
844: -- bug 1980440 fix starts
845: -- if CROSS_BUSINESS_GROUP option is enabled we shouldn't do a comparison
846: -- between appraisers BG and appraisee BG as they may be different
851: open csr_person_bg;
852: fetch csr_person_bg into l_business_group_id;
853: if csr_person_bg%notfound then
854: close csr_person_bg;
855: hr_utility.set_message(801,'HR_51889_APR_PERSON_NOT_EXIST');
856: hr_utility.raise_error;
857: end if;
858: close csr_person_bg;
859: ELSE
852: fetch csr_person_bg into l_business_group_id;
853: if csr_person_bg%notfound then
854: close csr_person_bg;
855: hr_utility.set_message(801,'HR_51889_APR_PERSON_NOT_EXIST');
856: hr_utility.raise_error;
857: end if;
858: close csr_person_bg;
859: ELSE
860: open csr_cbg_person_bg;
860: open csr_cbg_person_bg;
861: fetch csr_cbg_person_bg into l_business_group_id;
862: if csr_cbg_person_bg%notfound then
863: close csr_cbg_person_bg;
864: hr_utility.set_message(801,'HR_51889_APR_PERSON_NOT_EXIST');
865: hr_utility.raise_error;
866: end if;
867: close csr_cbg_person_bg;
868: END IF;
861: fetch csr_cbg_person_bg into l_business_group_id;
862: if csr_cbg_person_bg%notfound then
863: close csr_cbg_person_bg;
864: hr_utility.set_message(801,'HR_51889_APR_PERSON_NOT_EXIST');
865: hr_utility.raise_error;
866: end if;
867: close csr_cbg_person_bg;
868: END IF;
869:
867: close csr_cbg_person_bg;
868: END IF;
869:
870: IF lv_cross_business_group <> 'Y' THEN
871: hr_utility.set_location(l_proc, 3);
872: -- check if business group match
873: if p_business_group_id <> l_business_group_id then
874: hr_utility.set_message(801,'HR_51890_APR_PERSON_DIFF_BG');
875: hr_utility.raise_error;
870: IF lv_cross_business_group <> 'Y' THEN
871: hr_utility.set_location(l_proc, 3);
872: -- check if business group match
873: if p_business_group_id <> l_business_group_id then
874: hr_utility.set_message(801,'HR_51890_APR_PERSON_DIFF_BG');
875: hr_utility.raise_error;
876: end if;
877: end if;
878:
871: hr_utility.set_location(l_proc, 3);
872: -- check if business group match
873: if p_business_group_id <> l_business_group_id then
874: hr_utility.set_message(801,'HR_51890_APR_PERSON_DIFF_BG');
875: hr_utility.raise_error;
876: end if;
877: end if;
878:
879: hr_utility.set_location(l_proc, 4);
875: hr_utility.raise_error;
876: end if;
877: end if;
878:
879: hr_utility.set_location(l_proc, 4);
880: -- check if person is valid as of effective date
881: IF lv_cross_business_group <> 'Y' THEN
882: open csr_person_valid_date;
883: fetch csr_person_valid_date into l_exists;
882: open csr_person_valid_date;
883: fetch csr_person_valid_date into l_exists;
884: if csr_person_valid_date%notfound then
885: close csr_person_valid_date;
886: hr_utility.set_message(801,'HR_51891_APR_PERSON_DATE_RANGE');
887: hr_utility.raise_error;
888: end if;
889: close csr_person_valid_date;
890: ELSE
883: fetch csr_person_valid_date into l_exists;
884: if csr_person_valid_date%notfound then
885: close csr_person_valid_date;
886: hr_utility.set_message(801,'HR_51891_APR_PERSON_DATE_RANGE');
887: hr_utility.raise_error;
888: end if;
889: close csr_person_valid_date;
890: ELSE
891: open csr_cbg_person_valid_date;
891: open csr_cbg_person_valid_date;
892: fetch csr_cbg_person_valid_date into l_exists;
893: if csr_cbg_person_valid_date%notfound then
894: close csr_cbg_person_valid_date;
895: hr_utility.set_message(801,'HR_51891_APR_PERSON_DATE_RANGE');
896: hr_utility.raise_error;
897: end if;
898: close csr_cbg_person_valid_date;
899: END IF;
892: fetch csr_cbg_person_valid_date into l_exists;
893: if csr_cbg_person_valid_date%notfound then
894: close csr_cbg_person_valid_date;
895: hr_utility.set_message(801,'HR_51891_APR_PERSON_DATE_RANGE');
896: hr_utility.raise_error;
897: end if;
898: close csr_cbg_person_valid_date;
899: END IF;
900: -- bug 1980440 fix ends
899: END IF;
900: -- bug 1980440 fix ends
901: end if;
902:
903: hr_utility.set_location(l_proc, 5);
904:
905: hr_utility.set_location('Leaving: '|| l_proc, 10);
906:
907: end chk_appraisee_appraiser;
901: end if;
902:
903: hr_utility.set_location(l_proc, 5);
904:
905: hr_utility.set_location('Leaving: '|| l_proc, 10);
906:
907: end chk_appraisee_appraiser;
908:
909: ------------------------------------------------------------------------------+
971:
972:
973: begin
974:
975: hr_utility.set_location('Entering:'|| l_proc, 5);
976:
977: lv_cross_business_group := fnd_profile.value('HR_CROSS_BUSINESS_GROUP');
978:
979: IF p_main_appraiser_id IS NULL OR p_main_appraiser_id = -1 THEN
987: ,p_argument => 'effective_date'
988: ,p_argument_value => p_effective_date
989: );
990:
991: hr_utility.set_location( l_proc, 6);
992:
993: -- check if person is valid as of effective date
994: IF lv_cross_business_group <> 'Y' THEN
995: hr_utility.set_location( l_proc, 7);
991: hr_utility.set_location( l_proc, 6);
992:
993: -- check if person is valid as of effective date
994: IF lv_cross_business_group <> 'Y' THEN
995: hr_utility.set_location( l_proc, 7);
996: open csr_person_valid_date;
997: fetch csr_person_valid_date into l_exists;
998: if csr_person_valid_date%notfound then
999: hr_utility.set_location( l_proc, 8);
995: hr_utility.set_location( l_proc, 7);
996: open csr_person_valid_date;
997: fetch csr_person_valid_date into l_exists;
998: if csr_person_valid_date%notfound then
999: hr_utility.set_location( l_proc, 8);
1000: close csr_person_valid_date;
1001: hr_utility.set_message(800,'HR_449030_MA_PERSON_DATE_RANGE');
1002: hr_utility.raise_error;
1003: end if;
997: fetch csr_person_valid_date into l_exists;
998: if csr_person_valid_date%notfound then
999: hr_utility.set_location( l_proc, 8);
1000: close csr_person_valid_date;
1001: hr_utility.set_message(800,'HR_449030_MA_PERSON_DATE_RANGE');
1002: hr_utility.raise_error;
1003: end if;
1004: close csr_person_valid_date;
1005: ELSE
998: if csr_person_valid_date%notfound then
999: hr_utility.set_location( l_proc, 8);
1000: close csr_person_valid_date;
1001: hr_utility.set_message(800,'HR_449030_MA_PERSON_DATE_RANGE');
1002: hr_utility.raise_error;
1003: end if;
1004: close csr_person_valid_date;
1005: ELSE
1006: open csr_cbg_person_valid_date;
1003: end if;
1004: close csr_person_valid_date;
1005: ELSE
1006: open csr_cbg_person_valid_date;
1007: hr_utility.set_location( l_proc, 9);
1008: fetch csr_cbg_person_valid_date into l_exists;
1009: if csr_cbg_person_valid_date%notfound then
1010: hr_utility.set_location( l_proc, 10);
1011: close csr_cbg_person_valid_date;
1006: open csr_cbg_person_valid_date;
1007: hr_utility.set_location( l_proc, 9);
1008: fetch csr_cbg_person_valid_date into l_exists;
1009: if csr_cbg_person_valid_date%notfound then
1010: hr_utility.set_location( l_proc, 10);
1011: close csr_cbg_person_valid_date;
1012: hr_utility.set_message(800,'HR_449030_MA_PERSON_DATE_RANGE');
1013: hr_utility.raise_error;
1014: end if;
1008: fetch csr_cbg_person_valid_date into l_exists;
1009: if csr_cbg_person_valid_date%notfound then
1010: hr_utility.set_location( l_proc, 10);
1011: close csr_cbg_person_valid_date;
1012: hr_utility.set_message(800,'HR_449030_MA_PERSON_DATE_RANGE');
1013: hr_utility.raise_error;
1014: end if;
1015: close csr_cbg_person_valid_date;
1016: END IF;
1009: if csr_cbg_person_valid_date%notfound then
1010: hr_utility.set_location( l_proc, 10);
1011: close csr_cbg_person_valid_date;
1012: hr_utility.set_message(800,'HR_449030_MA_PERSON_DATE_RANGE');
1013: hr_utility.raise_error;
1014: end if;
1015: close csr_cbg_person_valid_date;
1016: END IF;
1017: -- bug 1980440 fix ends
1014: end if;
1015: close csr_cbg_person_valid_date;
1016: END IF;
1017: -- bug 1980440 fix ends
1018: hr_utility.set_location('Leaving:'|| l_proc, 10);
1019:
1020: EXCEPTION
1021: when app_exception.application_exception then
1022: if hr_multi_message.exception_add
1066: l_proc varchar2(72) := g_package||'chk_appraisal_type';
1067:
1068:
1069: begin
1070: hr_utility.set_location('Entering:'|| l_proc, 1);
1071:
1072: -- Check mandatory parameters have been set
1073:
1074: hr_api.mandatory_arg_error
1091: ) or
1092: (NOT l_api_updating)
1093: ) then
1094:
1095: hr_utility.set_location(l_proc, 2);
1096:
1097:
1098: -- If appraisal type is not null then
1099: -- check if the value exists in hr_lookups
1106: ,p_lookup_type => 'APPRAISAL_TYPE'
1107: ,p_lookup_code => p_type
1108: ) then
1109: -- error invalid type
1110: hr_utility.set_message(801,'HR_51892_APR_INVALID_TYPE');
1111: hr_utility.raise_error;
1112: end if;
1113: hr_utility.set_location(l_proc, 3);
1114: end if;
1107: ,p_lookup_code => p_type
1108: ) then
1109: -- error invalid type
1110: hr_utility.set_message(801,'HR_51892_APR_INVALID_TYPE');
1111: hr_utility.raise_error;
1112: end if;
1113: hr_utility.set_location(l_proc, 3);
1114: end if;
1115: end if;
1109: -- error invalid type
1110: hr_utility.set_message(801,'HR_51892_APR_INVALID_TYPE');
1111: hr_utility.raise_error;
1112: end if;
1113: hr_utility.set_location(l_proc, 3);
1114: end if;
1115: end if;
1116: hr_utility.set_location('Leaving: '|| l_proc, 10);
1117: EXCEPTION
1112: end if;
1113: hr_utility.set_location(l_proc, 3);
1114: end if;
1115: end if;
1116: hr_utility.set_location('Leaving: '|| l_proc, 10);
1117: EXCEPTION
1118: when app_exception.application_exception then
1119: if hr_multi_message.exception_add
1120: (p_associated_column1 => 'PER_APPRAISALS.APPRAISAL_TYPE'
1165: l_proc varchar2(72) := g_package||'chk_appraisal_status';
1166:
1167:
1168: begin
1169: hr_utility.set_location('Entering:'|| l_proc, 1);
1170:
1171: -- Check mandatory parameters have been set
1172:
1173: hr_api.mandatory_arg_error
1190: ) or
1191: (NOT l_api_updating)
1192: ) then
1193:
1194: hr_utility.set_location(l_proc, 2);
1195:
1196:
1197: -- If appraisal status is not null then
1198: -- check if the value exists in hr_lookups
1205: ,p_lookup_type => 'APPRAISAL_ASSESSMENT_STATUS'
1206: ,p_lookup_code => p_status
1207: ) then
1208: -- error invalid type
1209: hr_utility.set_message(801,'HR_51893_APR_INVALID_STATUS');
1210: hr_utility.raise_error;
1211: end if;
1212: hr_utility.set_location(l_proc, 3);
1213: end if;
1206: ,p_lookup_code => p_status
1207: ) then
1208: -- error invalid type
1209: hr_utility.set_message(801,'HR_51893_APR_INVALID_STATUS');
1210: hr_utility.raise_error;
1211: end if;
1212: hr_utility.set_location(l_proc, 3);
1213: end if;
1214: end if;
1208: -- error invalid type
1209: hr_utility.set_message(801,'HR_51893_APR_INVALID_STATUS');
1210: hr_utility.raise_error;
1211: end if;
1212: hr_utility.set_location(l_proc, 3);
1213: end if;
1214: end if;
1215: hr_utility.set_location('Leaving: '|| l_proc, 10);
1216:
1211: end if;
1212: hr_utility.set_location(l_proc, 3);
1213: end if;
1214: end if;
1215: hr_utility.set_location('Leaving: '|| l_proc, 10);
1216:
1217: EXCEPTION
1218: when app_exception.application_exception then
1219: if hr_multi_message.exception_add
1257: l_proc varchar2(72):=g_package||'chk_group_date_id';
1258:
1259:
1260: begin
1261: hr_utility.set_location('Entering:'|| l_proc, 1);
1262:
1263: -- Tests are carried out on insert only.
1264:
1265:
1274: */
1275:
1276: -- raise an error as the either both should exist or neither should.
1277:
1278: hr_utility.set_message(801, 'HR_52308_CM_GPR_DATE_ID_PROB');
1279: hr_utility.raise_error;
1280:
1281: end if;
1282:
1275:
1276: -- raise an error as the either both should exist or neither should.
1277:
1278: hr_utility.set_message(801, 'HR_52308_CM_GPR_DATE_ID_PROB');
1279: hr_utility.raise_error;
1280:
1281: end if;
1282:
1283: hr_utility.set_location('Leaving:'|| l_proc, 2);
1279: hr_utility.raise_error;
1280:
1281: end if;
1282:
1283: hr_utility.set_location('Leaving:'|| l_proc, 2);
1284: EXCEPTION
1285: when app_exception.application_exception then
1286: if hr_multi_message.exception_add
1287: (p_associated_column1 => 'PER_ASSESSMENTS.GROUP_DATE'
1334: l_asn_grp_pers_bg per_people_f.business_group_id%TYPE;
1335:
1336: lv_cross_business_group VARCHAR2(10); -- bug 1980440 fix
1337: begin
1338: hr_utility.set_location('Entering:'|| l_proc, 1);
1339:
1340: -- Tests are carried out on insert, and update (even if values haven't changed)
1341: -- as data in the referenced table may have.
1342:
1352: close csr_chk_grp_per_sta_date;
1353:
1354: -- raise an error as the person_id doesn't exist
1355:
1356: hr_utility.set_message(801, 'HR_52305_ASN_GRPPER_NOT_EXIST');
1357: hr_utility.raise_error;
1358:
1359: end if;
1360: close csr_chk_grp_per_sta_date;
1353:
1354: -- raise an error as the person_id doesn't exist
1355:
1356: hr_utility.set_message(801, 'HR_52305_ASN_GRPPER_NOT_EXIST');
1357: hr_utility.raise_error;
1358:
1359: end if;
1360: close csr_chk_grp_per_sta_date;
1361:
1371: if (l_asn_grp_pers_bg <> p_business_group_id) then
1372:
1373: -- raise an error as the person is in the wrong business_group
1374:
1375: hr_utility.set_message(801, 'HR_52306_ASN_GRPPER_NOT_BG');
1376: hr_utility.raise_error;
1377:
1378: end if;
1379: end if;
1372:
1373: -- raise an error as the person is in the wrong business_group
1374:
1375: hr_utility.set_message(801, 'HR_52306_ASN_GRPPER_NOT_BG');
1376: hr_utility.raise_error;
1377:
1378: end if;
1379: end if;
1380: -- bug 1980440 fix ends
1382: -- The group_date has to be on or after the group initiators start date
1383:
1384: if (p_group_date < l_asn_grp_pers_sta_date) then
1385:
1386: hr_utility.set_message(801, 'HR_52307_ASN_GRPPER_NO_XIST_DA');
1387: hr_utility.raise_error;
1388:
1389: end if;
1390: ELSE
1383:
1384: if (p_group_date < l_asn_grp_pers_sta_date) then
1385:
1386: hr_utility.set_message(801, 'HR_52307_ASN_GRPPER_NO_XIST_DA');
1387: hr_utility.raise_error;
1388:
1389: end if;
1390: ELSE
1391: NULL;
1390: ELSE
1391: NULL;
1392: END IF;
1393:
1394: hr_utility.set_location('Leaving:'|| l_proc, 1);
1395:
1396: EXCEPTION
1397: when app_exception.application_exception then
1398: if hr_multi_message.exception_add
1446: l_api_updating boolean;
1447: l_proc varchar2(72) := g_package||'chk_appraisal_period_dates';
1448:
1449: begin
1450: hr_utility.set_location('Entering:'|| l_proc, 1);
1451:
1452: if (p_appraisal_period_start_date is NULL) then
1453: hr_utility.set_message(801, 'HR_51894_APR_START_DATE_NULL');
1454: hr_utility.raise_error;
1449: begin
1450: hr_utility.set_location('Entering:'|| l_proc, 1);
1451:
1452: if (p_appraisal_period_start_date is NULL) then
1453: hr_utility.set_message(801, 'HR_51894_APR_START_DATE_NULL');
1454: hr_utility.raise_error;
1455: elsif (p_appraisal_period_end_date is NULL) then
1456: hr_utility.set_message(801, 'HR_51895_APR_END_DATE_NULL');
1457: hr_utility.raise_error;
1450: hr_utility.set_location('Entering:'|| l_proc, 1);
1451:
1452: if (p_appraisal_period_start_date is NULL) then
1453: hr_utility.set_message(801, 'HR_51894_APR_START_DATE_NULL');
1454: hr_utility.raise_error;
1455: elsif (p_appraisal_period_end_date is NULL) then
1456: hr_utility.set_message(801, 'HR_51895_APR_END_DATE_NULL');
1457: hr_utility.raise_error;
1458: end if;
1452: if (p_appraisal_period_start_date is NULL) then
1453: hr_utility.set_message(801, 'HR_51894_APR_START_DATE_NULL');
1454: hr_utility.raise_error;
1455: elsif (p_appraisal_period_end_date is NULL) then
1456: hr_utility.set_message(801, 'HR_51895_APR_END_DATE_NULL');
1457: hr_utility.raise_error;
1458: end if;
1459:
1460: -- Only proceed with validation if :
1453: hr_utility.set_message(801, 'HR_51894_APR_START_DATE_NULL');
1454: hr_utility.raise_error;
1455: elsif (p_appraisal_period_end_date is NULL) then
1456: hr_utility.set_message(801, 'HR_51895_APR_END_DATE_NULL');
1457: hr_utility.raise_error;
1458: end if;
1459:
1460: -- Only proceed with validation if :
1461: -- a) The current g_old_rec is current and
1464: (p_appraisal_id => p_appraisal_id
1465: ,p_object_version_number => p_object_version_number);
1466:
1467: -- Do the check
1468: hr_utility.set_location(l_proc, 2);
1469:
1470: -- The start date has to be <= the end date and end date >= strat date, else error.
1471:
1472: -- Fix 3062009
1472: -- Fix 3062009
1473: -- Removed If condition for raising error when start date < end date.
1474:
1475: if (p_appraisal_period_end_date < p_appraisal_period_start_date) then
1476: hr_utility.set_message(801, 'HR_51897_APR_END_DATE_LATER');
1477: hr_utility.raise_error;
1478: end if;
1479:
1480: hr_utility.set_location('Leaving: '|| l_proc, 10);
1473: -- Removed If condition for raising error when start date < end date.
1474:
1475: if (p_appraisal_period_end_date < p_appraisal_period_start_date) then
1476: hr_utility.set_message(801, 'HR_51897_APR_END_DATE_LATER');
1477: hr_utility.raise_error;
1478: end if;
1479:
1480: hr_utility.set_location('Leaving: '|| l_proc, 10);
1481: end chk_appraisal_period_dates;
1476: hr_utility.set_message(801, 'HR_51897_APR_END_DATE_LATER');
1477: hr_utility.raise_error;
1478: end if;
1479:
1480: hr_utility.set_location('Leaving: '|| l_proc, 10);
1481: end chk_appraisal_period_dates;
1482:
1483: -- ---------------------------------------------------------------------------+
1484: -- |---------------------< chk_appraisal_dates >------------------------------|
1585:
1586:
1587: begin
1588:
1589: hr_utility.set_location('Entering: '||l_proc,10);
1590:
1591: -- Determine whether each of the dates are valid
1592: l_valid :=
1593: validate_date(p_appraisal_period_start_date, p_appraisee_person_id);
1596: hr_multi_message.add(p_associated_column1 => 'PER_APPRAISALS.APPRAISAL_PERIOD_START_DATE');
1597: --fnd_message.raise_error;
1598: end if;
1599:
1600: hr_utility.set_location(l_proc,20);
1601:
1602: l_valid :=
1603: validate_date(p_appraisal_date,p_appraisee_person_id);
1604: if not l_valid then
1606: hr_multi_message.add(p_associated_column1 => 'PER_APPRAISALS.APPRAISAL_DATE');
1607: --fnd_message.raise_error;
1608: end if;
1609:
1610: hr_utility.set_location(l_proc,30);
1611:
1612: l_valid :=
1613: validate_date(p_appraisal_period_end_date, p_appraisee_person_id);
1614: if not l_valid then
1616: hr_multi_message.add(p_associated_column1 => 'PER_APPRAISALS.APPRAISAL_PERIOD_END_DATE');
1617: --fnd_message.raise_error;
1618: end if;
1619:
1620: hr_utility.set_location(l_proc,40);
1621:
1622: -- Check that appraisal_date is not set to a date when appraiser_person_id
1623: -- in not person type of 'EX_EMP' or 'EX_EMP_APL'
1624: -- 6825820 Bug Fix
1638:
1639:
1640: -- Check added for Bug 820841
1641:
1642: hr_utility.set_location(l_proc,50);
1643: -- The appraisal date has to be >= appraisal start date, else error.
1644:
1645: if (p_appraisal_period_start_date > p_appraisal_date) then
1646:
1643: -- The appraisal date has to be >= appraisal start date, else error.
1644:
1645: if (p_appraisal_period_start_date > p_appraisal_date) then
1646:
1647: hr_utility.set_message(800, 'HR_52792_INVALID_APPR_DATE'); -- Fix 3061934.
1648: hr_multi_message.add(p_associated_column1 => 'PER_APPRAISALS.APPRAISAL_DATE'
1649: ,p_associated_column2 => 'PER_APPRAISALS.APPRAISAL_PERIOD_START_DATE'
1650: );
1651: --hr_utility.raise_error;
1647: hr_utility.set_message(800, 'HR_52792_INVALID_APPR_DATE'); -- Fix 3061934.
1648: hr_multi_message.add(p_associated_column1 => 'PER_APPRAISALS.APPRAISAL_DATE'
1649: ,p_associated_column2 => 'PER_APPRAISALS.APPRAISAL_PERIOD_START_DATE'
1650: );
1651: --hr_utility.raise_error;
1652: end if;
1653:
1654: hr_utility.set_location(l_proc,60);
1655:
1650: );
1651: --hr_utility.raise_error;
1652: end if;
1653:
1654: hr_utility.set_location(l_proc,60);
1655:
1656: -- Fix 3061901
1657:
1658: if ( nvl(p_next_appraisal_date,hr_api.g_eot ) < p_appraisal_date) then
1655:
1656: -- Fix 3061901
1657:
1658: if ( nvl(p_next_appraisal_date,hr_api.g_eot ) < p_appraisal_date) then
1659: hr_utility.set_message(800, 'HR_449014_INV_NEXT_APPR_DATE');
1660: hr_multi_message.add(p_associated_column1 => 'PER_APPRAISALS.NEXT_APPRAISAL_DATE'
1661: ,p_associated_column2 => 'PER_APPRAISALS.APPRAISAL_DATE'
1662: );
1663: --hr_utility.raise_error;
1659: hr_utility.set_message(800, 'HR_449014_INV_NEXT_APPR_DATE');
1660: hr_multi_message.add(p_associated_column1 => 'PER_APPRAISALS.NEXT_APPRAISAL_DATE'
1661: ,p_associated_column2 => 'PER_APPRAISALS.APPRAISAL_DATE'
1662: );
1663: --hr_utility.raise_error;
1664:
1665: end if;
1666:
1667: hr_utility.set_location('Leaving: '||l_proc,70);
1663: --hr_utility.raise_error;
1664:
1665: end if;
1666:
1667: hr_utility.set_location('Leaving: '||l_proc,70);
1668:
1669:
1670: end chk_appraisal_dates;
1671:
1737: where rating_scale_id = l_rating_scale_id
1738: and appraisal_template_id = p_appraisal_template_id;
1739:
1740: begin
1741: hr_utility.set_location('Entering:'|| l_proc, 1);
1742:
1743: -- Check mandatory parameters have been set
1744:
1745: hr_api.mandatory_arg_error
1762: ) or
1763: (NOT l_api_updating)
1764: ) then
1765: -- Do the check
1766: hr_utility.set_location(l_proc, 2);
1767: if p_overall_performance_level_id is not null then
1768: open csr_overall_rating_bg;
1769: fetch csr_overall_rating_bg into l_business_group_id , l_rating_scale_id;
1770: if csr_overall_rating_bg%notfound then
1768: open csr_overall_rating_bg;
1769: fetch csr_overall_rating_bg into l_business_group_id , l_rating_scale_id;
1770: if csr_overall_rating_bg%notfound then
1771: close csr_overall_rating_bg;
1772: hr_utility.set_message(801,'HR_51898_APR_NO_SUCH_LEVEL');
1773: hr_utility.raise_error;
1774: end if;
1775: close csr_overall_rating_bg;
1776: -- check if the business groups match
1769: fetch csr_overall_rating_bg into l_business_group_id , l_rating_scale_id;
1770: if csr_overall_rating_bg%notfound then
1771: close csr_overall_rating_bg;
1772: hr_utility.set_message(801,'HR_51898_APR_NO_SUCH_LEVEL');
1773: hr_utility.raise_error;
1774: end if;
1775: close csr_overall_rating_bg;
1776: -- check if the business groups match
1777: hr_utility.set_location(l_proc, 3);
1773: hr_utility.raise_error;
1774: end if;
1775: close csr_overall_rating_bg;
1776: -- check if the business groups match
1777: hr_utility.set_location(l_proc, 3);
1778: -- ngundura changes as per pa requirement
1779: -- added l_business_group_id is not null criteria to facilitate global rating scales
1780: if p_business_group_id <> l_business_group_id and l_business_group_id is not null then
1781: hr_utility.set_message(801,'HR_51899_APR_LVL_DIFF_BG');
1777: hr_utility.set_location(l_proc, 3);
1778: -- ngundura changes as per pa requirement
1779: -- added l_business_group_id is not null criteria to facilitate global rating scales
1780: if p_business_group_id <> l_business_group_id and l_business_group_id is not null then
1781: hr_utility.set_message(801,'HR_51899_APR_LVL_DIFF_BG');
1782: hr_utility.raise_error;
1783: end if;
1784: -- check if the rating level is for the rating scale
1785: -- defined in the appraisal template
1778: -- ngundura changes as per pa requirement
1779: -- added l_business_group_id is not null criteria to facilitate global rating scales
1780: if p_business_group_id <> l_business_group_id and l_business_group_id is not null then
1781: hr_utility.set_message(801,'HR_51899_APR_LVL_DIFF_BG');
1782: hr_utility.raise_error;
1783: end if;
1784: -- check if the rating level is for the rating scale
1785: -- defined in the appraisal template
1786: hr_utility.set_location(l_proc, 4);
1782: hr_utility.raise_error;
1783: end if;
1784: -- check if the rating level is for the rating scale
1785: -- defined in the appraisal template
1786: hr_utility.set_location(l_proc, 4);
1787: open csr_overall_rating_valid;
1788: fetch csr_overall_rating_valid into l_exists;
1789: if csr_overall_rating_valid%notfound then
1790: close csr_overall_rating_valid;
1787: open csr_overall_rating_valid;
1788: fetch csr_overall_rating_valid into l_exists;
1789: if csr_overall_rating_valid%notfound then
1790: close csr_overall_rating_valid;
1791: hr_utility.set_message(801,'HR_51900_APR_LVL_DIFF_SCALE');
1792: hr_utility.raise_error;
1793: end if;
1794: close csr_overall_rating_valid;
1795: end if;
1788: fetch csr_overall_rating_valid into l_exists;
1789: if csr_overall_rating_valid%notfound then
1790: close csr_overall_rating_valid;
1791: hr_utility.set_message(801,'HR_51900_APR_LVL_DIFF_SCALE');
1792: hr_utility.raise_error;
1793: end if;
1794: close csr_overall_rating_valid;
1795: end if;
1796: end if;
1793: end if;
1794: close csr_overall_rating_valid;
1795: end if;
1796: end if;
1797: hr_utility.set_location('Leaving: '|| l_proc, 10);
1798:
1799: EXCEPTION
1800: when app_exception.application_exception then
1801: if hr_multi_message.exception_add
1906: where qsa.type_object_id = p_appraisal_id
1907: and qsa.type = 'APPRAISAL';
1908:
1909: begin
1910: hr_utility.set_location('Entering:'|| l_proc, 1);
1911:
1912: -- Check mandatory parameters have been set
1913:
1914: hr_api.mandatory_arg_error
1916: ,p_argument => 'appraisal_id'
1917: ,p_argument_value => p_appraisal_id
1918: );
1919:
1920: hr_utility.set_location(l_proc, 2);
1921:
1922: -- check if overall_performance_level_id is null. If it is not null then
1923: -- do not allow the appraisal to be deleted.
1924:
1922: -- check if overall_performance_level_id is null. If it is not null then
1923: -- do not allow the appraisal to be deleted.
1924:
1925: if p_overall_performance_level_id is not null then
1926: hr_utility.set_message(801,'HR_51902_APR_LVL_NOT_NULL');
1927: hr_utility.raise_error;
1928: end if;
1929:
1930: open csr_apr_exists_in_answers;
1923: -- do not allow the appraisal to be deleted.
1924:
1925: if p_overall_performance_level_id is not null then
1926: hr_utility.set_message(801,'HR_51902_APR_LVL_NOT_NULL');
1927: hr_utility.raise_error;
1928: end if;
1929:
1930: open csr_apr_exists_in_answers;
1931: fetch csr_apr_exists_in_answers into l_exists;
1930: open csr_apr_exists_in_answers;
1931: fetch csr_apr_exists_in_answers into l_exists;
1932: if csr_apr_exists_in_answers%found then
1933: close csr_apr_exists_in_answers;
1934: hr_utility.set_message(801,'HR_51903_APR_IN_ANSWERS');
1935: hr_utility.raise_error;
1936: end if;
1937: close csr_apr_exists_in_answers;
1938:
1931: fetch csr_apr_exists_in_answers into l_exists;
1932: if csr_apr_exists_in_answers%found then
1933: close csr_apr_exists_in_answers;
1934: hr_utility.set_message(801,'HR_51903_APR_IN_ANSWERS');
1935: hr_utility.raise_error;
1936: end if;
1937: close csr_apr_exists_in_answers;
1938:
1939: hr_utility.set_location(l_proc, 3);
1935: hr_utility.raise_error;
1936: end if;
1937: close csr_apr_exists_in_answers;
1938:
1939: hr_utility.set_location(l_proc, 3);
1940:
1941: open csr_apr_exits_in_objectives;
1942: fetch csr_apr_exits_in_objectives into l_exists;
1943: if csr_apr_exits_in_objectives%found then
1941: open csr_apr_exits_in_objectives;
1942: fetch csr_apr_exits_in_objectives into l_exists;
1943: if csr_apr_exits_in_objectives%found then
1944: close csr_apr_exits_in_objectives;
1945: hr_utility.set_message(801,'HR_51904_APR_IN_OBJECT');
1946: hr_utility.raise_error;
1947: end if;
1948: close csr_apr_exits_in_objectives;
1949:
1942: fetch csr_apr_exits_in_objectives into l_exists;
1943: if csr_apr_exits_in_objectives%found then
1944: close csr_apr_exits_in_objectives;
1945: hr_utility.set_message(801,'HR_51904_APR_IN_OBJECT');
1946: hr_utility.raise_error;
1947: end if;
1948: close csr_apr_exits_in_objectives;
1949:
1950: hr_utility.set_location(l_proc, 4);
1946: hr_utility.raise_error;
1947: end if;
1948: close csr_apr_exits_in_objectives;
1949:
1950: hr_utility.set_location(l_proc, 4);
1951:
1952: open csr_apr_exists_in_assessments;
1953: fetch csr_apr_exists_in_assessments into l_exists;
1954: if csr_apr_exists_in_assessments%found then
1952: open csr_apr_exists_in_assessments;
1953: fetch csr_apr_exists_in_assessments into l_exists;
1954: if csr_apr_exists_in_assessments%found then
1955: close csr_apr_exists_in_assessments;
1956: hr_utility.set_message(801,'HR_51905_APR_IN_ASSMNT');
1957: hr_utility.raise_error;
1958: end if;
1959: close csr_apr_exists_in_assessments;
1960:
1953: fetch csr_apr_exists_in_assessments into l_exists;
1954: if csr_apr_exists_in_assessments%found then
1955: close csr_apr_exists_in_assessments;
1956: hr_utility.set_message(801,'HR_51905_APR_IN_ASSMNT');
1957: hr_utility.raise_error;
1958: end if;
1959: close csr_apr_exists_in_assessments;
1960:
1961: hr_utility.set_location(l_proc, 5);
1957: hr_utility.raise_error;
1958: end if;
1959: close csr_apr_exists_in_assessments;
1960:
1961: hr_utility.set_location(l_proc, 5);
1962:
1963: open csr_apr_exits_in_perf_rat;
1964: fetch csr_apr_exits_in_perf_rat into l_exists;
1965: if csr_apr_exits_in_perf_rat%found then
1963: open csr_apr_exits_in_perf_rat;
1964: fetch csr_apr_exits_in_perf_rat into l_exists;
1965: if csr_apr_exits_in_perf_rat%found then
1966: close csr_apr_exits_in_perf_rat;
1967: hr_utility.set_message(801,'HR_51906_APR_IN_PERF_RAT');
1968: hr_utility.raise_error;
1969: end if;
1970: close csr_apr_exits_in_perf_rat;
1971:
1964: fetch csr_apr_exits_in_perf_rat into l_exists;
1965: if csr_apr_exits_in_perf_rat%found then
1966: close csr_apr_exits_in_perf_rat;
1967: hr_utility.set_message(801,'HR_51906_APR_IN_PERF_RAT');
1968: hr_utility.raise_error;
1969: end if;
1970: close csr_apr_exits_in_perf_rat;
1971:
1972: hr_utility.set_location(l_proc, 6);
1968: hr_utility.raise_error;
1969: end if;
1970: close csr_apr_exits_in_perf_rat;
1971:
1972: hr_utility.set_location(l_proc, 6);
1973:
1974: open csr_apr_exists_in_per_part;
1975: fetch csr_apr_exists_in_per_part into l_exists;
1976: if csr_apr_exists_in_per_part%found then
1979: fnd_message.raise_error;
1980: end if;
1981: close csr_apr_exists_in_per_part;
1982:
1983: hr_utility.set_location(l_proc,7);
1984:
1985: open csr_apr_exists_in_hr_qsa;
1986: fetch csr_apr_exists_in_hr_qsa into l_exists;
1987: if csr_apr_exists_in_hr_qsa%found then
1990: fnd_message.raise_error;
1991: end if;
1992: close csr_apr_exists_in_hr_qsa;
1993:
1994: hr_utility.set_location('Leaving: '|| l_proc, 10);
1995: end chk_appraisal_delete;
1996:
1997: --
1998: -- ----------------------------------------------------------------------------
2036: WHERE pmp.plan_id = p_plan_id;
2037: --
2038: BEGIN
2039:
2040: hr_utility.set_location('Entering:'|| l_proc, 10);
2041:
2042: --
2043: -- Only proceed with validation if :
2044: -- a) The current g_old_rec is current and
2058: IF p_plan_id IS NOT null THEN
2059: --
2060: -- Check that plan exists.
2061: --
2062: hr_utility.set_location(l_proc, 20);
2063: OPEN csr_chk_plan_id;
2064: FETCH csr_chk_plan_id INTO l_plan_id;
2065: CLOSE csr_chk_plan_id;
2066:
2070: END IF;
2071:
2072: END IF;
2073:
2074: hr_utility.set_location('Leaving:'|| l_proc, 970);
2075:
2076: EXCEPTION
2077:
2078: WHEN app_exception.application_exception THEN
2078: WHEN app_exception.application_exception THEN
2079: IF hr_multi_message.exception_add
2080: (p_associated_column1 => 'PER_APPRAISALS.PLAN_ID')
2081: THEN
2082: hr_utility.set_location(' Leaving:'|| l_proc, 980);
2083: RAISE;
2084: END IF;
2085: hr_utility.set_location(' Leaving:'|| l_proc, 990);
2086:
2081: THEN
2082: hr_utility.set_location(' Leaving:'|| l_proc, 980);
2083: RAISE;
2084: END IF;
2085: hr_utility.set_location(' Leaving:'|| l_proc, 990);
2086:
2087: END chk_plan_id;
2088: --
2089: -- ----------------------------------------------------------------------------
2124: --
2125: BEGIN
2126:
2127:
2128: hr_utility.set_location('Entering:'|| l_proc, 10);
2129:
2130:
2131: --
2132: -- Only proceed with validation if :
2147: IF p_offline_status IS NOT null THEN
2148: --
2149: -- Check that offline status is valid.
2150: --
2151: hr_utility.set_location(l_proc, 20);
2152: IF hr_api.not_exists_in_hr_lookups(
2153: p_effective_date => p_effective_date
2154: ,p_lookup_type => 'APPRAISAL_OFFLINE_STATUS'
2155: ,p_lookup_code => upper(p_offline_status)
2159: END IF;
2160:
2161: END IF;
2162:
2163: hr_utility.set_location('Leaving:'|| l_proc, 970);
2164: EXCEPTION
2165:
2166: WHEN app_exception.application_exception THEN
2167: IF hr_multi_message.exception_add
2166: WHEN app_exception.application_exception THEN
2167: IF hr_multi_message.exception_add
2168: (p_associated_column1 => 'PER_APPRAISALS.OFFLINE_STATUS')
2169: THEN
2170: hr_utility.set_location(' Leaving:'|| l_proc, 980);
2171: RAISE;
2172: END IF;
2173: hr_utility.set_location(' Leaving:'|| l_proc, 990);
2174:
2169: THEN
2170: hr_utility.set_location(' Leaving:'|| l_proc, 980);
2171: RAISE;
2172: END IF;
2173: hr_utility.set_location(' Leaving:'|| l_proc, 990);
2174:
2175: END chk_offline_status;
2176: --
2177: -- ----------------------------------------------------------------------+
2206:
2207: l_proc varchar2(72) := g_package||'chk_df';
2208:
2209: begin
2210: hr_utility.set_location('Entering:'||l_proc, 10);
2211:
2212: if ((p_rec.appraisal_id is not null) and (
2213: nvl(per_apr_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
2214: nvl(p_rec.attribute_category, hr_api.g_varchar2) or
2306: ,p_attribute20_value => p_rec.attribute20
2307: );
2308: end if;
2309:
2310: hr_utility.set_location(' Leaving:'||l_proc, 20);
2311:
2312: end chk_df;
2313:
2314: -- ---------------------------------------------------------------------------+
2320:
2321: l_proc varchar2(72) := g_package||'insert_validate';
2322:
2323: Begin
2324: hr_utility.set_location('Entering:'||l_proc, 5);
2325:
2326: -- Call all supporting business operations
2327:
2328: hr_api.validate_bus_grp_id
2330: ,p_associated_column1 => per_per_shd.g_tab_nam || '.BUSINESS_GROUP_ID'
2331: ); -- VALIDATE BUSINESS GROUP
2332:
2333:
2334: hr_utility.set_location(l_proc, 6);
2335:
2336: per_apr_bus.chk_appraisee_appraiser
2337: (p_person_id => p_rec.appraisee_person_id
2338: ,p_business_group_id => p_rec.business_group_id
2339: ,p_effective_date => p_effective_date
2340: ,p_person_type => 'APPRAISEE'
2341: );
2342:
2343: hr_utility.set_location(l_proc, 7);
2344:
2345: per_apr_bus.chk_appraisee_appraiser
2346: (p_person_id => p_rec.appraiser_person_id
2347: ,p_business_group_id => p_rec.business_group_id
2354: ,p_business_group_id => p_rec.business_group_id
2355: ,p_effective_date => p_effective_date
2356: );
2357:
2358: hr_utility.set_location(l_proc, 8);
2359:
2360: per_apr_bus.chk_appraisal_period_dates
2361: (p_appraisal_id => p_rec.appraisal_id
2362: ,p_object_version_number => p_rec.object_version_number
2363: ,p_appraisal_period_start_date => p_rec.appraisal_period_start_date
2364: ,p_appraisal_period_end_date => p_rec.appraisal_period_end_date
2365: );
2366:
2367: hr_utility.set_location(l_proc, 9);
2368: per_apr_bus.chk_appraisal_dates
2369: (p_appraisal_date => p_rec.appraisal_date
2370: ,p_appraisal_period_start_date => p_rec.appraisal_period_start_date
2371: ,p_appraisal_period_end_date => p_rec.appraisal_period_end_date
2373: ,p_appraisee_person_id => p_rec.appraisee_person_id
2374: ,p_appraiser_person_id => p_rec.appraiser_person_id
2375: ,p_main_appraiser_id => p_rec.main_appraiser_id
2376: );
2377: hr_utility.set_location(l_proc, 10);
2378:
2379: per_apr_bus.chk_appraisal_template
2380: (p_appraisal_template_id => p_rec.appraisal_template_id
2381: ,p_business_group_id => p_rec.business_group_id
2392: ,p_effective_date => p_rec.appraisal_period_end_date
2393: );
2394:
2395:
2396: hr_utility.set_location(l_proc, 11);
2397:
2398: per_apr_bus.chk_appraisal_type
2399: (p_appraisal_id => p_rec.appraisal_id
2400: ,p_object_version_number => p_rec.object_version_number
2401: ,p_type => p_rec.type
2402: ,p_effective_date => p_effective_date
2403: );
2404:
2405: hr_utility.set_location(l_proc, 12);
2406:
2407: per_apr_bus.chk_overall_rating
2408: (p_appraisal_id => p_rec.appraisal_id
2409: ,p_object_version_number => p_rec.object_version_number
2411: ,p_overall_performance_level_id => p_rec.overall_performance_level_id
2412: ,p_business_group_id => p_rec.business_group_id
2413: );
2414:
2415: hr_utility.set_location(l_proc, 13);
2416:
2417: per_apr_bus.chk_appraisal_status
2418: (p_appraisal_id => p_rec.appraisal_id
2419: ,p_object_version_number => p_rec.object_version_number
2420: ,p_status => p_rec.status
2421: ,p_effective_date => p_effective_date
2422: );
2423:
2424: hr_utility.set_location(l_proc, 14);
2425:
2426:
2427: per_apr_bus.chk_group_date_id
2428: (p_group_initiator_id => p_rec.group_initiator_id
2450: -- Call descriptive flexfield validation routines
2451:
2452: per_apr_bus.chk_df(p_rec => p_rec);
2453:
2454: hr_utility.set_location(' Leaving:'||l_proc, 10);
2455: End insert_validate;
2456:
2457: -- ---------------------------------------------------------------------------+
2458: -- |---------------------------< update_validate >----------------------------|
2462:
2463: l_proc varchar2(72) := g_package||'update_validate';
2464:
2465: Begin
2466: hr_utility.set_location('Entering:'||l_proc, 5);
2467:
2468: -- Call all supporting business operations
2469:
2470: -- Rule Check non-updateable fields cannot be updated
2475: ); -- VALIDATE BUSINESS GROUP
2476:
2477: chk_non_updateable_args(p_rec => p_rec);
2478:
2479: hr_utility.set_location(l_proc,6);
2480:
2481: per_apr_bus.chk_open(p_open => p_rec.open
2482: ,p_effective_date => p_effective_date
2483: );
2481: per_apr_bus.chk_open(p_open => p_rec.open
2482: ,p_effective_date => p_effective_date
2483: );
2484:
2485: hr_utility.set_location(l_proc,7);
2486:
2487: per_apr_bus.chk_update_allowed
2488: (p_rec => p_rec);
2489:
2487: per_apr_bus.chk_update_allowed
2488: (p_rec => p_rec);
2489:
2490:
2491: hr_utility.set_location(l_proc, 8);
2492: -- Appraisee is non updatable argument. So, no need for that check during update.
2493:
2494: per_apr_bus.chk_appraisee_appraiser
2495: (p_person_id => p_rec.appraiser_person_id
2503: per_apr_bus.chk_appraiser_person_id
2504: (p_appraisal_id => p_rec.appraisal_id);
2505: -- Call to current behavior of chk_appraiser_person_id is not required..
2506: */
2507: hr_utility.set_location(l_proc,9);
2508:
2509: per_apr_bus.chk_appraisal_period_dates
2510: (p_appraisal_id => p_rec.appraisal_id
2511: ,p_object_version_number => p_rec.object_version_number
2512: ,p_appraisal_period_start_date => p_rec.appraisal_period_start_date
2513: ,p_appraisal_period_end_date => p_rec.appraisal_period_end_date
2514: );
2515:
2516: hr_utility.set_location(l_proc, 9);
2517:
2518: if (p_rec.appraisal_system_status <> 'DELETED') then
2519: per_apr_bus.chk_appraisal_dates
2520: (p_appraisal_date => p_rec.appraisal_date
2533: ,p_type => p_rec.type
2534: ,p_effective_date => p_effective_date
2535: );
2536:
2537: hr_utility.set_location(l_proc, 10);
2538:
2539: per_apr_bus.chk_appraisal_template
2540: (p_appraisal_template_id => p_rec.appraisal_template_id
2541: ,p_business_group_id => p_rec.business_group_id
2559: ,p_overall_performance_level_id => p_rec.overall_performance_level_id
2560: ,p_business_group_id => p_rec.business_group_id
2561: );
2562:
2563: hr_utility.set_location(l_proc, 13);
2564:
2565: per_apr_bus.chk_appraisal_status
2566: (p_appraisal_id => p_rec.appraisal_id
2567: ,p_object_version_number => p_rec.object_version_number
2568: ,p_status => p_rec.status
2569: ,p_effective_date => p_effective_date
2570: );
2571:
2572: hr_utility.set_location(l_proc, 14);
2573:
2574: per_apr_bus.chk_main_appraiser_id
2575: (p_main_appraiser_id => p_rec.main_appraiser_id
2576: ,p_business_group_id => p_rec.business_group_id
2576: ,p_business_group_id => p_rec.business_group_id
2577: ,p_effective_date => p_effective_date
2578: );
2579:
2580: hr_utility.set_location(l_proc, 15);
2581:
2582: per_apr_bus.chk_plan_id
2583: (p_appraisal_id => p_rec.appraisal_id
2584: ,p_object_version_number => p_rec.object_version_number
2584: ,p_object_version_number => p_rec.object_version_number
2585: ,p_plan_id => p_rec.plan_id
2586: );
2587:
2588: hr_utility.set_location(l_proc, 16);
2589: per_apr_bus.chk_offline_status
2590: (p_appraisal_id => p_rec.appraisal_id
2591: ,p_object_version_number => p_rec.object_version_number
2592: ,p_offline_status => p_rec.offline_status
2596: -- Call descriptive flexfield validation routines
2597:
2598: per_apr_bus.chk_df(p_rec => p_rec);
2599:
2600: hr_utility.set_location(' Leaving:'||l_proc, 10);
2601: End update_validate;
2602:
2603: -- ---------------------------------------------------------------------------+
2604: -- |---------------------------< delete_validate >----------------------------|
2607:
2608: l_proc varchar2(72) := g_package||'delete_validate';
2609:
2610: Begin
2611: hr_utility.set_location('Entering:'||l_proc, 5);
2612:
2613: -- Call all supporting business operations
2614:
2615: per_apr_bus.chk_appraisal_delete
2617: ,p_object_version_number => p_rec.object_version_number
2618: ,p_overall_performance_level_id => p_rec.overall_performance_level_id
2619: ) ;
2620:
2621: hr_utility.set_location(' Leaving:'||l_proc, 10);
2622:
2623: End delete_validate;
2624:
2625:
2642: l_proc varchar2(72) := g_package||'return_legislation_code';
2643: l_legislation_code varchar2(150);
2644:
2645: Begin
2646: hr_utility.set_location('Entering:'||l_proc, 5);
2647:
2648: -- Ensure that all the mandatory parameters are not null
2649:
2650: hr_api.mandatory_arg_error (p_api_name => l_proc,
2657: -- call to this function. Just return the value in the global
2658: -- variable.
2659:
2660: l_legislation_code := g_legislation_code;
2661: hr_utility.set_location(l_proc, 20);
2662: else
2663:
2664: -- The ID is different to the last call to this function
2665: -- or this is the first call to this function.
2670: close csr_leg_code;
2671:
2672: -- The primary key is invalid therefore we must error out
2673:
2674: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
2675: hr_utility.raise_error;
2676: end if;
2677:
2678: close csr_leg_code;
2671:
2672: -- The primary key is invalid therefore we must error out
2673:
2674: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
2675: hr_utility.raise_error;
2676: end if;
2677:
2678: close csr_leg_code;
2679: g_appraisal_id := p_appraisal_id;
2679: g_appraisal_id := p_appraisal_id;
2680: g_legislation_code := l_legislation_code;
2681: end if;
2682:
2683: hr_utility.set_location(' Leaving:'||l_proc, 10);
2684:
2685: return l_legislation_code;
2686: End return_legislation_code;
2687: