38: l_legislation_code varchar2(150);
39: --
40: begin
41: --
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
78: --
79: hr_api.set_legislation_context(l_legislation_code);
80: end if;
81: --
82: hr_utility.set_location(' Leaving:'|| l_proc, 20);
83: --
84: end set_security_group_id;
85: --
86: -- ---------------------------------------------------------------------------
106: l_proc varchar2(72) := g_package||'return_legislation_code';
107: --
108: Begin
109: --
110: hr_utility.set_location('Entering:'|| l_proc, 10);
111: --
112: -- Ensure that all the mandatory parameter are not null
113: --
114: hr_api.mandatory_arg_error
124: -- call to this function. Just return the value in the global
125: -- variable.
126: --
127: l_legislation_code := per_cpo_bus.g_legislation_code;
128: hr_utility.set_location(l_proc, 20);
129: else
130: --
131: -- The ID is different to the last call to this function
132: -- or this is the first call to this function.
141: close csr_leg_code;
142: fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
143: fnd_message.raise_error;
144: end if;
145: hr_utility.set_location(l_proc,30);
146: --
147: -- Set the global variables so the values are
148: -- available for the next call to this function.
149: --
150: close csr_leg_code;
151: per_cpo_bus.g_outcome_id := p_outcome_id;
152: per_cpo_bus.g_legislation_code := l_legislation_code;
153: end if;
154: hr_utility.set_location(' Leaving:'|| l_proc, 40);
155: return l_legislation_code;
156: end return_legislation_code;
157: --
158: -- ----------------------------------------------------------------------------
243: l_proc varchar2(72) := g_package||'chk_outcome_id';
244: l_api_updating boolean;
245: --
246: Begin
247: hr_utility.set_location('Entering:'||l_proc, 5);
248: --
249: l_api_updating := per_cpo_shd.api_updating
250: (p_outcome_id => p_outcome_id
251: ,p_object_version_number => p_object_version_number
272: end if;
273: --
274: end if;
275: --
276: hr_utility.set_location('Leaving:'||l_proc, 10);
277: --
278: End chk_outcome_id;
279: --
280: -- ---------------------------------------------------------------------------
327: l_api_updating boolean;
328: l_exists varchar2(1);
329: --
330: begin
331: hr_utility.set_location('Entering:'||l_proc, 10);
332: --
333: -- Check mandatory parameters have been set
334: --
335:
338: ,p_argument => 'competence_id'
339: ,p_argument_value => p_competence_id
340: );
341:
342: hr_utility.set_location(l_proc, 20);
343:
344: --
345: -- Only proceed with validation if :
346: -- a) The current g_old_rec is current and
357:
358: --
359: -- Check that competence_id is a foreign key
360: --
361: hr_utility.set_location(l_proc, 30);
362: --
363: open csr_competence;
364: fetch csr_competence into l_exists;
365: if csr_competence%NOTFOUND then
372: close csr_competence;
373: --
374: end if;
375: --
376: hr_utility.set_location(' Leaving:'||l_proc, 40);
377: end chk_competence_id;
378: --
379: -- ---------------------------------------------------------------------------
380: -- |-----------------------< chk_outcome_number>------------------------------|
442: l_api_updating boolean;
443: l_exists varchar2(1);
444: --
445: begin
446: hr_utility.set_location('Entering:'||l_proc, 10);
447: hr_utility.trace('outcome_id : ' || p_outcome_id);
448: hr_utility.trace('date_from : ' || p_date_from);
449: hr_utility.trace('date_to : ' || p_date_to);
450: hr_utility.trace('outcome_number : ' || p_outcome_number);
443: l_exists varchar2(1);
444: --
445: begin
446: hr_utility.set_location('Entering:'||l_proc, 10);
447: hr_utility.trace('outcome_id : ' || p_outcome_id);
448: hr_utility.trace('date_from : ' || p_date_from);
449: hr_utility.trace('date_to : ' || p_date_to);
450: hr_utility.trace('outcome_number : ' || p_outcome_number);
451: hr_utility.trace('competence_id : ' || p_competence_id);
444: --
445: begin
446: hr_utility.set_location('Entering:'||l_proc, 10);
447: hr_utility.trace('outcome_id : ' || p_outcome_id);
448: hr_utility.trace('date_from : ' || p_date_from);
449: hr_utility.trace('date_to : ' || p_date_to);
450: hr_utility.trace('outcome_number : ' || p_outcome_number);
451: hr_utility.trace('competence_id : ' || p_competence_id);
452: --
445: begin
446: hr_utility.set_location('Entering:'||l_proc, 10);
447: hr_utility.trace('outcome_id : ' || p_outcome_id);
448: hr_utility.trace('date_from : ' || p_date_from);
449: hr_utility.trace('date_to : ' || p_date_to);
450: hr_utility.trace('outcome_number : ' || p_outcome_number);
451: hr_utility.trace('competence_id : ' || p_competence_id);
452: --
453: -- Check mandatory parameters have been set
446: hr_utility.set_location('Entering:'||l_proc, 10);
447: hr_utility.trace('outcome_id : ' || p_outcome_id);
448: hr_utility.trace('date_from : ' || p_date_from);
449: hr_utility.trace('date_to : ' || p_date_to);
450: hr_utility.trace('outcome_number : ' || p_outcome_number);
451: hr_utility.trace('competence_id : ' || p_competence_id);
452: --
453: -- Check mandatory parameters have been set
454: --
447: hr_utility.trace('outcome_id : ' || p_outcome_id);
448: hr_utility.trace('date_from : ' || p_date_from);
449: hr_utility.trace('date_to : ' || p_date_to);
450: hr_utility.trace('outcome_number : ' || p_outcome_number);
451: hr_utility.trace('competence_id : ' || p_competence_id);
452: --
453: -- Check mandatory parameters have been set
454: --
455:
458: ,p_argument => 'outcome_number'
459: ,p_argument_value => p_outcome_number
460: );
461:
462: hr_utility.set_location(l_proc, 20);
463:
464: --
465: -- Only proceed with validation if :
466: -- a) The current g_old_rec is current and
479: then
480: --
481: -- Check that outcome_number is unique
482: --
483: hr_utility.set_location(l_proc, 30);
484: open csr_upd_outcome_number;
485: fetch csr_upd_outcome_number into l_exists;
486: if csr_upd_outcome_number%FOUND then
487: close csr_upd_outcome_number;
484: open csr_upd_outcome_number;
485: fetch csr_upd_outcome_number into l_exists;
486: if csr_upd_outcome_number%FOUND then
487: close csr_upd_outcome_number;
488: hr_utility.set_message(800, 'HR_449129_QUA_FWK_NUMBER_EXIST');
489: hr_utility.raise_error;
490: end if;
491: close csr_upd_outcome_number;
492: --
485: fetch csr_upd_outcome_number into l_exists;
486: if csr_upd_outcome_number%FOUND then
487: close csr_upd_outcome_number;
488: hr_utility.set_message(800, 'HR_449129_QUA_FWK_NUMBER_EXIST');
489: hr_utility.raise_error;
490: end if;
491: close csr_upd_outcome_number;
492: --
493: elsif (NOT l_api_updating) then
490: end if;
491: close csr_upd_outcome_number;
492: --
493: elsif (NOT l_api_updating) then
494: hr_utility.set_location(l_proc, 35);
495: open csr_outcome_number;
496: fetch csr_outcome_number into l_exists;
497: if csr_outcome_number%FOUND then
498: close csr_outcome_number;
495: open csr_outcome_number;
496: fetch csr_outcome_number into l_exists;
497: if csr_outcome_number%FOUND then
498: close csr_outcome_number;
499: hr_utility.set_message(800, 'HR_449129_QUA_FWK_NUMBER_EXIST');
500: hr_utility.raise_error;
501: end if;
502: close csr_outcome_number;
503: end if;
496: fetch csr_outcome_number into l_exists;
497: if csr_outcome_number%FOUND then
498: close csr_outcome_number;
499: hr_utility.set_message(800, 'HR_449129_QUA_FWK_NUMBER_EXIST');
500: hr_utility.raise_error;
501: end if;
502: close csr_outcome_number;
503: end if;
504: --
501: end if;
502: close csr_outcome_number;
503: end if;
504: --
505: hr_utility.set_location(' Leaving:'||l_proc, 40);
506: end chk_outcome_number;
507: --
508: -- ---------------------------------------------------------------------------
509: -- |------------------------------< chk_name >--------------------------------|
571: l_api_updating boolean;
572: l_exists varchar2(1);
573: --
574: begin
575: hr_utility.set_location('Entering:'||l_proc, 10);
576: --
577: -- Check mandatory parameters have been set
578: --
579:
582: ,p_argument => 'name'
583: ,p_argument_value => p_name
584: );
585:
586: hr_utility.set_location(l_proc, 20);
587:
588: --
589: -- Only proceed with validation if :
590: -- a) The current g_old_rec is current and
603: then
604: --
605: -- Check that outcome_number is unique
606: --
607: hr_utility.set_location(l_proc, 30);
608: open csr_upd_name;
609: fetch csr_upd_name into l_exists;
610: if csr_upd_name%FOUND then
611: close csr_upd_name;
608: open csr_upd_name;
609: fetch csr_upd_name into l_exists;
610: if csr_upd_name%FOUND then
611: close csr_upd_name;
612: hr_utility.set_message(800, 'HR_449130_QUA_FWK_NAME_EXISTS');
613: hr_utility.raise_error;
614: end if;
615: close csr_upd_name;
616: --
609: fetch csr_upd_name into l_exists;
610: if csr_upd_name%FOUND then
611: close csr_upd_name;
612: hr_utility.set_message(800, 'HR_449130_QUA_FWK_NAME_EXISTS');
613: hr_utility.raise_error;
614: end if;
615: close csr_upd_name;
616: --
617: elsif (NOT l_api_updating) then
614: end if;
615: close csr_upd_name;
616: --
617: elsif (NOT l_api_updating) then
618: hr_utility.set_location(l_proc, 35);
619: open csr_name;
620: fetch csr_name into l_exists;
621: if csr_name%FOUND then
622: close csr_name;
619: open csr_name;
620: fetch csr_name into l_exists;
621: if csr_name%FOUND then
622: close csr_name;
623: hr_utility.set_message(800, 'HR_449130_QUA_FWK_NAME_EXISTS');
624: hr_utility.raise_error;
625: end if;
626: close csr_name;
627: end if;
620: fetch csr_name into l_exists;
621: if csr_name%FOUND then
622: close csr_name;
623: hr_utility.set_message(800, 'HR_449130_QUA_FWK_NAME_EXISTS');
624: hr_utility.raise_error;
625: end if;
626: close csr_name;
627: end if;
628: --
625: end if;
626: close csr_name;
627: end if;
628: --
629: hr_utility.set_location(' Leaving:'||l_proc, 40);
630: end chk_name;
631: --
632: -- ---------------------------------------------------------------------------
633: -- |---------------------------< chk_dates >---------------------------------|
672: l_proc varchar2(72) := g_package||'chk_dates';
673: l_api_updating boolean;
674: --
675: begin
676: hr_utility.set_location('Entering:'||l_proc, 10);
677: --
678: -- Check mandatory parameters have been set
679: --
680:
682: (p_api_name => l_proc
683: ,p_argument => 'date_from'
684: ,p_argument_value => p_date_from
685: );
686: hr_utility.set_location(l_proc, 20);
687: --
688: -- Only proceed with validation if :
689: -- a) The current g_old_rec is current and
690: -- b) The date_end value has changed
700: (NOT l_api_updating))) then
701: --
702: -- Check that date_from <= date_to
703: --
704: hr_utility.set_location(l_proc, 30);
705: --
706: if p_date_from > nvl(p_date_to,hr_api.g_eot) then
707: hr_utility.set_message(800,'HR_6758_APPL_DATE_FROM_CHK');
708: hr_utility.raise_error;
703: --
704: hr_utility.set_location(l_proc, 30);
705: --
706: if p_date_from > nvl(p_date_to,hr_api.g_eot) then
707: hr_utility.set_message(800,'HR_6758_APPL_DATE_FROM_CHK');
708: hr_utility.raise_error;
709: end if;
710: --
711: end if;
704: hr_utility.set_location(l_proc, 30);
705: --
706: if p_date_from > nvl(p_date_to,hr_api.g_eot) then
707: hr_utility.set_message(800,'HR_6758_APPL_DATE_FROM_CHK');
708: hr_utility.raise_error;
709: end if;
710: --
711: end if;
712: --
709: end if;
710: --
711: end if;
712: --
713: hr_utility.set_location(' Leaving:'||l_proc, 40);
714: end chk_dates;
715: --
716: -- ---------------------------------------------------------------------------
717: -- |---------------------------< chk_delete >--------------------------------|
753: WHERE outcome_id = p_outcome_id;
754: --
755: Begin
756: --
757: hr_utility.set_location('Entering:'||l_proc, 10);
758: --
759: -- Check there are no values in per_comp_element_outcomes
760: --
761: open csr_outcome;
765: If csr_outcome%found Then
766: --
767: close csr_outcome;
768: --
769: hr_utility.set_message(800, 'HR_449131_QUA_FWK_DEL_OUTCOME');
770: fnd_message.raise_error;
771: --
772: End If;
773: --
772: End If;
773: --
774: close csr_outcome;
775: --
776: hr_utility.set_location('Leaving:' || l_proc, 40);
777: --
778: end chk_delete;
779: --
780: --
812: --
813: l_proc varchar2(72) := g_package || 'chk_ddf';
814: --
815: begin
816: hr_utility.set_location('Entering:'||l_proc,10);
817: --
818: if ((p_rec.outcome_id is not null) and (
819: nvl(per_cpo_shd.g_old_rec.information_category, hr_api.g_varchar2) <>
820: nvl(p_rec.information_category, hr_api.g_varchar2) or
909: ,p_attribute20_value => p_rec.information20
910: );
911: end if;
912: --
913: hr_utility.set_location(' Leaving:'||l_proc,20);
914: end chk_ddf;
915: --
916: -- ----------------------------------------------------------------------------
917: -- |------------------------------< chk_df >----------------------------------|
947: --
948: l_proc varchar2(72) := g_package || 'chk_df';
949: --
950: begin
951: hr_utility.set_location('Entering:'||l_proc,10);
952: --
953: if ((p_rec.outcome_id is not null) and (
954: nvl(per_cpo_shd.g_old_rec.attribute1, hr_api.g_varchar2) <>
955: nvl(p_rec.attribute1, hr_api.g_varchar2) or
1044: ,p_attribute20_value => p_rec.attribute20
1045: );
1046: end if;
1047: --
1048: hr_utility.set_location(' Leaving:'||l_proc,20);
1049: end chk_df;
1050: --
1051: --
1052: -- ----------------------------------------------------------------------------
1059: --
1060: l_proc varchar2(72) := g_package||'insert_validate';
1061: --
1062: Begin
1063: hr_utility.set_location('Entering:'||l_proc, 5);
1064: --
1065: -- Call all supporting business operations
1066: --
1067:
1072: (p_outcome_id => p_rec.outcome_id
1073: ,p_object_version_number => p_rec.object_version_number
1074: );
1075:
1076: hr_utility.set_location(l_proc, 10);
1077:
1078: --
1079: -- After validating the set of important attributes,
1080: -- if Multiple Message detection is enabled and at least
1090: ,p_competence_id => p_rec.competence_id
1091: ,p_object_version_number => p_rec.object_version_number
1092: );
1093:
1094: hr_utility.set_location(l_proc, 20);
1095:
1096: --
1097: -- Validate dates
1098: --
1102: ,p_date_to => p_rec.date_to
1103: ,p_object_version_number => p_rec.object_version_number
1104: );
1105:
1106: hr_utility.set_location(l_proc, 30);
1107:
1108: --
1109: -- Validate outcome_number
1110: --
1116: ,p_date_to => p_rec.date_to
1117: ,p_object_version_number => p_rec.object_version_number
1118: );
1119:
1120: hr_utility.set_location(l_proc, 40);
1121:
1122: --
1123: -- Validate name
1124: --
1130: ,p_date_to => p_rec.date_to
1131: ,p_object_version_number => p_rec.object_version_number
1132: );
1133:
1134: hr_utility.set_location(l_proc, 50);
1135:
1136:
1137: --
1138: -- Validate Dependent Attributes
1139: --
1140: --
1141: per_cpo_bus.chk_df(p_rec);
1142:
1143: hr_utility.set_location(l_proc, 60);
1144:
1145: per_cpo_bus.chk_ddf(p_rec);
1146: --
1147: hr_utility.set_location(' Leaving:'||l_proc, 70);
1143: hr_utility.set_location(l_proc, 60);
1144:
1145: per_cpo_bus.chk_ddf(p_rec);
1146: --
1147: hr_utility.set_location(' Leaving:'||l_proc, 70);
1148: --
1149: End insert_validate;
1150: --
1151: -- ----------------------------------------------------------------------------
1158: --
1159: l_proc varchar2(72) := g_package||'update_validate';
1160: --
1161: Begin
1162: hr_utility.set_location('Entering:'||l_proc, 5);
1163: --
1164: -- Call all supporting business operations
1165: --
1166:
1171: (p_outcome_id => p_rec.outcome_id
1172: ,p_object_version_number => p_rec.object_version_number
1173: );
1174:
1175: hr_utility.set_location(l_proc, 10);
1176:
1177: --
1178: -- After validating the set of important attributes,
1179: -- if Multiple Message detection is enabled and at least
1189: ,p_competence_id => p_rec.competence_id
1190: ,p_object_version_number => p_rec.object_version_number
1191: );
1192:
1193: hr_utility.set_location(l_proc, 20);
1194:
1195: --
1196: -- Validate date effective
1197: --
1201: ,p_date_to => p_rec.date_to
1202: ,p_object_version_number => p_rec.object_version_number
1203: );
1204:
1205: hr_utility.set_location(l_proc, 30);
1206:
1207: --
1208: -- Validate outcome_number
1209: --
1215: ,p_date_to => p_rec.date_to
1216: ,p_object_version_number => p_rec.object_version_number
1217: );
1218:
1219: hr_utility.set_location(l_proc, 40);
1220:
1221: --
1222: -- Validate name
1223: --
1229: ,p_date_to => p_rec.date_to
1230: ,p_object_version_number => p_rec.object_version_number
1231: );
1232:
1233: hr_utility.set_location(l_proc, 50);
1234:
1235: --
1236: -- Validate Dependent Attributes
1237: --
1239: (p_effective_date => p_effective_date
1240: ,p_rec => p_rec
1241: );
1242: --
1243: hr_utility.set_location(l_proc, 60);
1244: --
1245: per_cpo_bus.chk_df(p_rec);
1246:
1247: hr_utility.set_location(l_proc, 70);
1243: hr_utility.set_location(l_proc, 60);
1244: --
1245: per_cpo_bus.chk_df(p_rec);
1246:
1247: hr_utility.set_location(l_proc, 70);
1248:
1249: per_cpo_bus.chk_ddf(p_rec);
1250: --
1251: hr_utility.set_location(' Leaving:'||l_proc, 80);
1247: hr_utility.set_location(l_proc, 70);
1248:
1249: per_cpo_bus.chk_ddf(p_rec);
1250: --
1251: hr_utility.set_location(' Leaving:'||l_proc, 80);
1252: End update_validate;
1253: --
1254: -- ----------------------------------------------------------------------------
1255: -- |---------------------------< delete_validate >----------------------------|
1260: --
1261: l_proc varchar2(72) := g_package||'delete_validate';
1262: --
1263: Begin
1264: hr_utility.set_location('Entering:'||l_proc, 5);
1265: --
1266: -- Call all supporting business operations
1267: --
1268: chk_delete
1268: chk_delete
1269: (p_outcome_id => p_rec.outcome_id
1270: );
1271:
1272: hr_utility.set_location(l_proc, 10);
1273:
1274: per_cpo_bus.chk_df(p_rec);
1275:
1276: hr_utility.set_location(l_proc, 20);
1272: hr_utility.set_location(l_proc, 10);
1273:
1274: per_cpo_bus.chk_df(p_rec);
1275:
1276: hr_utility.set_location(l_proc, 20);
1277:
1278: per_cpo_bus.chk_ddf(p_rec);
1279:
1280: hr_utility.set_location(' Leaving:'||l_proc, 30);
1276: hr_utility.set_location(l_proc, 20);
1277:
1278: per_cpo_bus.chk_ddf(p_rec);
1279:
1280: hr_utility.set_location(' Leaving:'||l_proc, 30);
1281: End delete_validate;
1282: --
1283: end per_cpo_bus;