48: from ghr_pa_requests
49: where pa_request_id = p_pa_request_id;
50: --
51: Begin
52: hr_utility.set_location('Entering:'||l_proc, 1);
53: --
54: -- Check mandatory parameters have been set
55: --
56: hr_api.mandatory_arg_error
58: p_api_name => l_proc,
59: p_argument => 'pa_request_id',
60: p_argument_value => p_pa_request_id
61: );
62: hr_utility.set_location(l_proc, 2);
63: --
64: -- Check that the pa_request_id is in the ghr_pa_requests table.
65: --
66: open c_valid_req;
66: open c_valid_req;
67: fetch c_valid_req into l_dummy;
68: if c_valid_req%notfound then
69: close c_valid_req;
70: hr_utility.set_message(8301, 'HR_38119_INV_REQ_ID');
71: hr_utility.raise_error;
72: end if;
73: close c_valid_req;
74: --
67: fetch c_valid_req into l_dummy;
68: if c_valid_req%notfound then
69: close c_valid_req;
70: hr_utility.set_message(8301, 'HR_38119_INV_REQ_ID');
71: hr_utility.raise_error;
72: end if;
73: close c_valid_req;
74: --
75: hr_utility.set_location(' Leaving:'||l_proc, 3);
71: hr_utility.raise_error;
72: end if;
73: close c_valid_req;
74: --
75: hr_utility.set_location(' Leaving:'||l_proc, 3);
76: --
77: End chk_pa_request_id;
78: --
79: --
115: l_argument varchar2(30);
116: --
117: Begin
118: --
119: hr_utility.set_location('Entering:'|| l_proc,10);
120: --
121: -- Only proceed with validation if a row exists for
122: -- the current record in the HR Schema.
123: if not ghr_rei_shd.api_updating
123: if not ghr_rei_shd.api_updating
124: (p_pa_request_extra_info_id => p_rec.pa_request_extra_info_id
125: ,p_object_version_number => p_rec.object_version_number
126: ) then
127: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
128: hr_utility.set_message_token('PROCEDURE', l_proc);
129: hr_utility.set_message_token('STEP', '20');
130: end if;
131: --
124: (p_pa_request_extra_info_id => p_rec.pa_request_extra_info_id
125: ,p_object_version_number => p_rec.object_version_number
126: ) then
127: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
128: hr_utility.set_message_token('PROCEDURE', l_proc);
129: hr_utility.set_message_token('STEP', '20');
130: end if;
131: --
132: hr_utility.set_location (l_proc, 30);
125: ,p_object_version_number => p_rec.object_version_number
126: ) then
127: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
128: hr_utility.set_message_token('PROCEDURE', l_proc);
129: hr_utility.set_message_token('STEP', '20');
130: end if;
131: --
132: hr_utility.set_location (l_proc, 30);
133: --
128: hr_utility.set_message_token('PROCEDURE', l_proc);
129: hr_utility.set_message_token('STEP', '20');
130: end if;
131: --
132: hr_utility.set_location (l_proc, 30);
133: --
134: if nvl(p_rec.pa_request_id,hr_api.g_number)
135: <> nvl(ghr_rei_shd.g_old_rec.pa_request_id,hr_api.g_number) then
136: l_argument := 'pa_request_id';
142: l_argument := 'information_type';
143: raise l_error;
144: end if;
145: --
146: hr_utility.set_location(' Leaving : '|| l_proc, 40);
147: --
148: exception
149: when l_error then
150: hr_api.argument_changed_error
204: WHERE rit.information_type = p_information_type
205: ;
206: --
207: Begin
208: hr_utility.set_location('Entering:'||l_proc, 5);
209: --
210: --
211: -- Check mandatory parameters have been set
212: --
232: end if;
233: --
234: close c_info_type;
235: --
236: hr_utility.set_location(' Leaving:'||l_proc, 10);
237: --
238: Exception
239: --
240: when l_inactive_type then
238: Exception
239: --
240: when l_inactive_type then
241: close c_info_type;
242: hr_utility.set_message(8301, 'HR_38120_INACTIVE_INFO_TYPE');
243: hr_utility.raise_error;
244: --
245: when no_data_found then
246: close c_info_type;
239: --
240: when l_inactive_type then
241: close c_info_type;
242: hr_utility.set_message(8301, 'HR_38120_INACTIVE_INFO_TYPE');
243: hr_utility.raise_error;
244: --
245: when no_data_found then
246: close c_info_type;
247: hr_utility.set_message(8301, 'HR_38121_INVALID_INFO_TYPE');
243: hr_utility.raise_error;
244: --
245: when no_data_found then
246: close c_info_type;
247: hr_utility.set_message(8301, 'HR_38121_INVALID_INFO_TYPE');
248: hr_utility.raise_error;
249: --
250: End chk_pa_request_info_type;
251: --
244: --
245: when no_data_found then
246: close c_info_type;
247: hr_utility.set_message(8301, 'HR_38121_INVALID_INFO_TYPE');
248: hr_utility.raise_error;
249: --
250: End chk_pa_request_info_type;
251: --
252: --
302: WHERE rei.information_type = p_information_type
303: AND rei.pa_request_id = p_pa_request_id ;
304: --
305: Begin
306: hr_utility.set_location('Entering:'||l_proc, 5);
307: --
308: if p_multiple_occurrences_flag = 'N' then
309: --
310: -- Check mandatory parameters have been set
333: raise l_success;
334: end if;
335: end if;
336: --
337: hr_utility.set_location(' Leaving:'||l_proc, 10);
338: Exception
339: when l_success then
340: hr_utility.set_location(' Leaving:'||l_proc, 10);
341: when l_failure then
336: --
337: hr_utility.set_location(' Leaving:'||l_proc, 10);
338: Exception
339: when l_success then
340: hr_utility.set_location(' Leaving:'||l_proc, 10);
341: when l_failure then
342: hr_utility.set_message(8301, 'GHR_38122_INFO_TYPE_ALLOWS_1_R');
343: hr_utility.raise_error;
344:
338: Exception
339: when l_success then
340: hr_utility.set_location(' Leaving:'||l_proc, 10);
341: when l_failure then
342: hr_utility.set_message(8301, 'GHR_38122_INFO_TYPE_ALLOWS_1_R');
343: hr_utility.raise_error;
344:
345: End chk_count_rows;
346: -- -------------------------------------------------------------------------
339: when l_success then
340: hr_utility.set_location(' Leaving:'||l_proc, 10);
341: when l_failure then
342: hr_utility.set_message(8301, 'GHR_38122_INFO_TYPE_ALLOWS_1_R');
343: hr_utility.raise_error;
344:
345: End chk_count_rows;
346: -- -------------------------------------------------------------------------
347: -- |----------------------------- < chk_reason_for_submission > ------------|
357: l_proc varchar2(72) := 'chk_reason_for_submission';
358: l_api_updating boolean;
359: --
360: begin
361: hr_utility.set_location('Entering: '|| l_proc, 10);
362: --
363: -- Check mandatory parameters have been set
364: --
365: hr_api.mandatory_arg_error
381: nvl(ghr_rei_shd.g_old_rec.rei_information3,hr_api.g_varchar2)
382: <> nvl(p_reason_for_submission, hr_api.g_varchar2)) or
383: (not l_api_updating))
384: then
385: hr_utility.set_location(l_proc, 20);
386: --
387: -- If reason_for_submission is not null then
388: -- Check if the reason_for_submission value exists in hr_lookups
389: -- where the lookup_type is 'GHR_US_SUBMISSION_REASON'
396: ,p_lookup_code => p_reason_for_submission
397: )
398: then
399: -- Error: Invalid reason_for_submission
400: hr_utility.set_message(8301, 'GHR_REASON_FOR_SUB_INVALID');
401: hr_utility.raise_error;
402: end if;
403: hr_utility.set_location(l_proc, 30);
404: end if;
397: )
398: then
399: -- Error: Invalid reason_for_submission
400: hr_utility.set_message(8301, 'GHR_REASON_FOR_SUB_INVALID');
401: hr_utility.raise_error;
402: end if;
403: hr_utility.set_location(l_proc, 30);
404: end if;
405: end if;
399: -- Error: Invalid reason_for_submission
400: hr_utility.set_message(8301, 'GHR_REASON_FOR_SUB_INVALID');
401: hr_utility.raise_error;
402: end if;
403: hr_utility.set_location(l_proc, 30);
404: end if;
405: end if;
406: hr_utility.set_location(' Leavig:'|| l_proc, 40);
407: end chk_reason_for_submission;
402: end if;
403: hr_utility.set_location(l_proc, 30);
404: end if;
405: end if;
406: hr_utility.set_location(' Leavig:'|| l_proc, 40);
407: end chk_reason_for_submission;
408: --
409: -- ----------------------------------------------------------------------------------------------------
410: -- |------------------------------- < chk_explanation > ----------------------------------------------|
420: l_proc varchar2(72) := 'chk_explanation';
421: l_api_updating boolean;
422: --
423: begin
424: hr_utility.set_location('Entering: '|| l_proc, 10);
425: --
426: -- Only proceed with validation if a record is being inserted
427: --
428: l_api_updating := ghr_rei_shd.api_updating
447: then
448: */
449: if (p_reason_for_submission = '4' and (p_explanation is null))
450: then
451: hr_utility.set_message(8301, 'GHR_NO_EXPLANATION');
452: hr_utility.raise_error;
453: end if;
454: end if;
455: hr_utility.set_location('Leaving: '|| l_proc, 20);
448: */
449: if (p_reason_for_submission = '4' and (p_explanation is null))
450: then
451: hr_utility.set_message(8301, 'GHR_NO_EXPLANATION');
452: hr_utility.raise_error;
453: end if;
454: end if;
455: hr_utility.set_location('Leaving: '|| l_proc, 20);
456: end chk_explanation;
451: hr_utility.set_message(8301, 'GHR_NO_EXPLANATION');
452: hr_utility.raise_error;
453: end if;
454: end if;
455: hr_utility.set_location('Leaving: '|| l_proc, 20);
456: end chk_explanation;
457: --
458: -- ---------------------------------------------------------------------------------------------------
459: -- |-------------------------------- < chk_service > ------------------------------------------------|
469: l_proc varchar2(72) := 'chk_service';
470: l_api_updating boolean;
471: --
472: begin
473: hr_utility.set_location('Entering: '|| l_proc, 10);
474: --
475: -- Check mandatory parameters have been set
476: --
477: hr_api.mandatory_arg_error
494: nvl(ghr_rei_shd.g_old_rec.rei_information5,hr_api.g_varchar2)
495: <> nvl(p_service, hr_api.g_varchar2)) or
496: (not l_api_updating))
497: then
498: hr_utility.set_location(l_proc, 20);
499: --
500: -- If service is not null then
501: -- Check if the service value exists in hr_lookups
502: -- where the lookup type is 'GHR_US_SERVICE'
509: ,p_lookup_code => p_service
510: )
511: then
512: -- Error: Invalid Service
513: hr_utility.set_message(8301, 'GHR_SERVICE_INVALID');
514: hr_utility.raise_error;
515: end if;
516: hr_utility.set_location(l_proc, 30);
517: end if;
510: )
511: then
512: -- Error: Invalid Service
513: hr_utility.set_message(8301, 'GHR_SERVICE_INVALID');
514: hr_utility.raise_error;
515: end if;
516: hr_utility.set_location(l_proc, 30);
517: end if;
518: end if;
512: -- Error: Invalid Service
513: hr_utility.set_message(8301, 'GHR_SERVICE_INVALID');
514: hr_utility.raise_error;
515: end if;
516: hr_utility.set_location(l_proc, 30);
517: end if;
518: end if;
519: hr_utility.set_location(' Leaving:'|| l_proc, 40);
520: end chk_service;
515: end if;
516: hr_utility.set_location(l_proc, 30);
517: end if;
518: end if;
519: hr_utility.set_location(' Leaving:'|| l_proc, 40);
520: end chk_service;
521: --
522: -- ----------------------------------------------------------------------------
523: -- |---------------------------< Chk_ddf_for_866 >----------------------------|
568: Where pa_request_id = p_rec.pa_request_id;
569:
570: Begin
571:
572: hr_utility.set_location('Entering:'||l_proc, 5);
573:
574: for find_noa_code in c_find_noa_code loop
575: l_first_noa_code := find_noa_code.first_noa_code;
576: l_effective_date := nvl(find_noa_code.effective_date,sysdate);
580: If p_rec.information_type = 'GHR_US_PAR_TERM_RET_GRADE' then
581: for date_end in C_date_end loop
582: If nvl(fnd_date.canonical_to_date(date_end.pei_information2),l_effective_date)
583: < l_effective_date then
584: hr_utility.set_message(8301,'GHR_38500_REC_ALREADY_ENDED');
585: hr_utility.raise_error;
586: End if;
587: End loop;
588: End if;
581: for date_end in C_date_end loop
582: If nvl(fnd_date.canonical_to_date(date_end.pei_information2),l_effective_date)
583: < l_effective_date then
584: hr_utility.set_message(8301,'GHR_38500_REC_ALREADY_ENDED');
585: hr_utility.raise_error;
586: End if;
587: End loop;
588: End if;
589: End if;
587: End loop;
588: End if;
589: End if;
590:
591: hr_utility.set_location('Leaving:'||l_proc, 10);
592:
593: End chk_ddf_for_866;
594:
595: -- ----------------------------------------------------------------------------
637: Where pa_request_id = p_rec.pa_request_id;
638:
639: l_retained_grade ghr_pay_calc.retained_grade_rec_type;
640: Begin
641: hr_utility.set_location('Entering:'||l_proc, 5);
642:
643: for find_noa_code in c_find_noa_code loop
644: l_first_noa_code := find_noa_code.first_noa_code;
645: l_effective_date := nvl(find_noa_code.effective_date,sysdate);
655: ,l_effective_date
656: ,p_rec.pa_request_id);
657: EXCEPTION WHEN OTHERS THEN
658: IF p_rec.rei_information3 is NOT NULL THEN
659: hr_utility.set_message(8301,'GHR_38823_TEMP_PROMO_NO_RG');
660: hr_utility.raise_error;
661: ELSE
662: NULL;
663: END IF;
656: ,p_rec.pa_request_id);
657: EXCEPTION WHEN OTHERS THEN
658: IF p_rec.rei_information3 is NOT NULL THEN
659: hr_utility.set_message(8301,'GHR_38823_TEMP_PROMO_NO_RG');
660: hr_utility.raise_error;
661: ELSE
662: NULL;
663: END IF;
664: END;
662: NULL;
663: END IF;
664: END;
665: END IF;
666: hr_utility.set_location('Leaving:'||l_proc, 10);
667:
668: End chk_ddf_for_temp_promo;
669: --
670: -- ----------------------------------------------------------------------------
700: where pos.position_id = p_position_id
701: and l_effective_date between pos.effective_start_date
702: and pos.effective_end_date;
703: Begin
704: hr_utility.set_location('Entering:'||l_proc, 5);
705: --
706: hr_utility.set_location('Getting Ids',1);
707: -- Getting person_id,position_id
708: for c_get_perpos_rec in c_get_perpos_ids
702: and pos.effective_end_date;
703: Begin
704: hr_utility.set_location('Entering:'||l_proc, 5);
705: --
706: hr_utility.set_location('Getting Ids',1);
707: -- Getting person_id,position_id
708: for c_get_perpos_rec in c_get_perpos_ids
709: loop
710: l_person_id := c_get_perpos_rec.person_id;
714: -- out giving effective date
715: l_effective_date := nvl(c_get_perpos_rec.effective_date,sysdate);
716: exit;
717: end loop;
718: hr_utility.set_location('Person Id '||to_char(l_person_id),2);
719: hr_utility.set_location('Position Id '||to_char(l_position_id),2);
720: --
721: --
722: -- Set up the CLIENT_INFO
715: l_effective_date := nvl(c_get_perpos_rec.effective_date,sysdate);
716: exit;
717: end loop;
718: hr_utility.set_location('Person Id '||to_char(l_person_id),2);
719: hr_utility.set_location('Position Id '||to_char(l_position_id),2);
720: --
721: --
722: -- Set up the CLIENT_INFO
723: --
720: --
721: --
722: -- Set up the CLIENT_INFO
723: --
724: ghr_utility.set_client_info(p_person_id =>l_person_id,
725: p_position_id =>l_position_id);
726: --
727: -- Call all supporting business operations
728: --
799: ,p_attribute20_name => 'REI_ATTRIBUTE20'
800: ,p_attribute20_value => p_rec.REI_ATTRIBUTE20
801: );
802: --
803: hr_utility.set_location(l_proc, 10);
804: --
805: --
806: --
807: hr_utility.set_location(l_proc, 15);
803: hr_utility.set_location(l_proc, 10);
804: --
805: --
806: --
807: hr_utility.set_location(l_proc, 15);
808: -- Call ddf procedure to validate Developer Descritive Flex Fields
809: --
810: /*
811: ghr_rei_flex_ddf.ddf(p_rec) ;
835: end if;
836: end if;
837: if l_person_id is not null or l_position_id is not null then
838: --Putting the BUSINESS GROUP_ID
839: hr_utility.set_location('BG ID '||l_bus_group_id,4);
840: fnd_profile.put('PER_BUSINESS_GROUP_ID',l_bus_group_id);
841: hr_dflex_utility.ins_or_upd_descflex_attribs
842: (p_appl_short_name => 'GHR'
843: ,p_descflex_name => 'Extra PA Request Info DDF'
906: end if;
907: --
908: --
909: --
910: hr_utility.set_location(' Leaving:'||l_proc, 10);
911: End insert_validate;
912: --
913: -- ----------------------------------------------------------------------------
914: -- |---------------------------< update_validate >----------------------------|
942: where pos.position_id = p_position_id
943: and l_effective_date between pos.effective_start_date
944: and pos.effective_end_date;
945: Begin
946: hr_utility.set_location('Entering:'||l_proc, 5);
947: --
948: hr_utility.set_location('Getting Ids',1);
949: -- Getting person_id,position_id
950: for c_get_perpos_rec in c_get_perpos_ids
944: and pos.effective_end_date;
945: Begin
946: hr_utility.set_location('Entering:'||l_proc, 5);
947: --
948: hr_utility.set_location('Getting Ids',1);
949: -- Getting person_id,position_id
950: for c_get_perpos_rec in c_get_perpos_ids
951: loop
952: l_person_id := c_get_perpos_rec.person_id;
955: -- Bug#6215050 added NVL to consider sysdate if effective date is NULL
956: l_effective_date := NVL(c_get_perpos_rec.effective_date,sysdate);
957: exit;
958: end loop;
959: hr_utility.set_location('Person Id '||to_char(l_person_id),2);
960: hr_utility.set_location('Position Id '||to_char(l_position_id),2);
961: --
962: --
963: -- Set up the CLIENT_INFO
956: l_effective_date := NVL(c_get_perpos_rec.effective_date,sysdate);
957: exit;
958: end loop;
959: hr_utility.set_location('Person Id '||to_char(l_person_id),2);
960: hr_utility.set_location('Position Id '||to_char(l_position_id),2);
961: --
962: --
963: -- Set up the CLIENT_INFO
964: --
961: --
962: --
963: -- Set up the CLIENT_INFO
964: --
965: ghr_utility.set_client_info(p_person_id =>l_person_id,
966: p_position_id =>l_position_id);
967: -- Call all supporting business operations
968: --
969: chk_ddf_for_866(p_rec);
971: chk_ddf_for_temp_promo(p_rec);
972: --
973: -- 2) Check those columns which cannot be updated have not changed.
974: --
975: hr_utility.set_location(l_proc, 10);
976: --
977: chk_non_updateable_args (p_rec => p_rec);
978: -- Extra DDF Validation for PD Employee information
979: ghr_rei_bus.chk_ddf_extra_val(p_rec) ;
1028: ,p_attribute20_name => 'REI_ATTRIBUTE20'
1029: ,p_attribute20_value => p_rec.REI_ATTRIBUTE20
1030: );
1031: --
1032: hr_utility.set_location(l_proc, 15);
1033: --
1034: --
1035: --
1036: hr_utility.set_location(l_proc, 20);
1032: hr_utility.set_location(l_proc, 15);
1033: --
1034: --
1035: --
1036: hr_utility.set_location(l_proc, 20);
1037: --
1038: -- Call ddf procedure to validate Developer Descritive Flex Fields
1039: --
1040: /*
1065: end if;
1066: end if;
1067: if l_person_id is not null or l_position_id is not null then
1068: --Putting the BUSINESS GROUP_ID
1069: hr_utility.set_location('BG ID '||l_bus_group_id,4);
1070: fnd_profile.put('PER_BUSINESS_GROUP_ID',l_bus_group_id);
1071: hr_dflex_utility.ins_or_upd_descflex_attribs
1072: (p_appl_short_name => 'GHR'
1073: ,p_descflex_name => 'Extra PA Request Info DDF'
1136: end if;
1137: --
1138: --
1139: --
1140: hr_utility.set_location(' Leaving:'||l_proc, 10);
1141: End update_validate;
1142: --
1143: -- ----------------------------------------------------------------------------
1144: -- |---------------------------< delete_validate >----------------------------|
1147: --
1148: l_proc varchar2(72) := g_package||'delete_validate';
1149: --
1150: Begin
1151: hr_utility.set_location('Entering:'||l_proc, 5);
1152: --
1153: -- Call all supporting business operations
1154: --
1155: hr_utility.set_location(' Leaving:'||l_proc, 10);
1151: hr_utility.set_location('Entering:'||l_proc, 5);
1152: --
1153: -- Call all supporting business operations
1154: --
1155: hr_utility.set_location(' Leaving:'||l_proc, 10);
1156: End delete_validate;
1157: --
1158: procedure chk_ddf_extra_val
1159: (p_rec in ghr_rei_shd.g_rec_type) is
1161: l_proc varchar2(72) := g_package||'chk_ddf_extra_val';
1162: l_error exception;
1163: --
1164: Begin
1165: hr_utility.set_location('Entering:'||l_proc, 5);
1166: --
1167: hr_utility.set_location('Entering:'||l_proc, 5);
1168: --
1169: -- Call check procedures to validate reason for submission, explanation and
1163: --
1164: Begin
1165: hr_utility.set_location('Entering:'||l_proc, 5);
1166: --
1167: hr_utility.set_location('Entering:'||l_proc, 5);
1168: --
1169: -- Call check procedures to validate reason for submission, explanation and
1170: -- service only
1171: -- when information type is 'GHR_US_PD_GEN_EMP'.
1206: else
1207: --
1208: -- Reference field values is not supported
1209: --
1210: hr_utility.set_message(8301, 'GHR_38117_FLEX_INV_REF_FIELD_V');
1211: hr_utility.raise_error;
1212: end if;
1213: else
1214: --
1207: --
1208: -- Reference field values is not supported
1209: --
1210: hr_utility.set_message(8301, 'GHR_38117_FLEX_INV_REF_FIELD_V');
1211: hr_utility.raise_error;
1212: end if;
1213: else
1214: --
1215: -- When the reference field is null, check
1281: end if;
1282: */
1283: --
1284:
1285: hr_utility.set_location(' Leaving:'||l_proc, 10);
1286: exception
1287: when l_error then
1288: hr_utility.set_message(8301, 'GHR_38118_FLEX_INV_ATTRIBUTE_A');
1289: hr_utility.raise_error;
1284:
1285: hr_utility.set_location(' Leaving:'||l_proc, 10);
1286: exception
1287: when l_error then
1288: hr_utility.set_message(8301, 'GHR_38118_FLEX_INV_ATTRIBUTE_A');
1289: hr_utility.raise_error;
1290: hr_utility.set_location(' Leaving:'||l_proc, 10);
1291: end chk_ddf_extra_val;
1292: end ghr_rei_bus;
1285: hr_utility.set_location(' Leaving:'||l_proc, 10);
1286: exception
1287: when l_error then
1288: hr_utility.set_message(8301, 'GHR_38118_FLEX_INV_ATTRIBUTE_A');
1289: hr_utility.raise_error;
1290: hr_utility.set_location(' Leaving:'||l_proc, 10);
1291: end chk_ddf_extra_val;
1292: end ghr_rei_bus;
1286: exception
1287: when l_error then
1288: hr_utility.set_message(8301, 'GHR_38118_FLEX_INV_ATTRIBUTE_A');
1289: hr_utility.raise_error;
1290: hr_utility.set_location(' Leaving:'||l_proc, 10);
1291: end chk_ddf_extra_val;
1292: end ghr_rei_bus;