27: v_proc varchar2(72) := g_package||'set_globals';
28: --
29: Begin
30: --
31: hr_utility.set_location('Entering:'|| v_proc, 5);
32: --
33: --
34: g_version_start_date := start_date;
35: g_version_end_date := end_date;
33: --
34: g_version_start_date := start_date;
35: g_version_end_date := end_date;
36: --
37: hr_utility.set_location('Leaving:'|| v_proc, 10);
38: --
39: End set_globals;
40: --
41: -- ----------------------------------------------------------------------------
43: -- ----------------------------------------------------------------------------
44: --
45: -- Description:
46: -- Passes the error information to the procedure set_message of package
47: -- hr_utility.
48: --
49: Procedure call_error_message
50: (
51: p_error_appl varchar2
55: v_proc varchar2(72) := g_package||'call_error_message';
56: --
57: Begin
58: --
59: hr_utility.set_location('Entering:'|| v_proc, 5);
60: --
61: -- ** TEMP ** Add error message with the following text.
62: --
63: fnd_message.set_name ( p_error_appl ,p_error_txt);
62: --
63: fnd_message.set_name ( p_error_appl ,p_error_txt);
64: fnd_message.raise_error;
65: --
66: hr_utility.set_location(' Leaving:'|| v_proc, 10);
67: --
68: End call_error_message;
69: --
70: -- ----------------------------------------------------------------------------
72: -- ----------------------------------------------------------------------------
73: --
74: -- Description:
75: -- Passes the error information to the procedure set_message of package
76: -- hr_utility.
77: --
78: Procedure call_warning_message
79: (
80: p_warning_txt varchar2
83: v_proc varchar2(72) := g_package||'call_warning_message';
84: --
85: Begin
86: --
87: hr_utility.set_location('Entering:'|| v_proc, 5);
88: --
89: -- ** TEMP ** Add warning message with the following text.
90: --
91: -- fnd_message.set_name( 'OTA', OTA_TAV_
91: -- fnd_message.set_name( 'OTA', OTA_TAV_
92: fnd_message.set_name( 'OTA', p_warning_txt);
93: fnd_message.raise_error;
94: --
95: hr_utility.set_location(' Leaving:'|| v_proc, 10);
96: --
97: End call_warning_message;
98: --
99: -- ----------------------------------------------------------------------------
104: --
105: v_proc varchar2(72) := g_package||'check_currency';
106: begin
107: --
108: hr_utility.set_location('Entering:'|| v_proc, 5);
109: --
110: ota_general.check_currency_is_valid
111: (p_currency_code);
112: --
109: --
110: ota_general.check_currency_is_valid
111: (p_currency_code);
112: --
113: hr_utility.set_location(' Leaving:'|| v_proc, 10);
114: --
115: exception
116: when app_exception.application_exception then
117: if hr_multi_message.exception_add
116: when app_exception.application_exception then
117: if hr_multi_message.exception_add
118: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.CURRENCY_CODE'
119: ) then
120: hr_utility.set_location(' Leaving:'|| v_proc,70);
121: raise;
122: end if;
123: hr_utility.set_location(' Leaving:'|| v_proc,80);
124: end check_currency;
119: ) then
120: hr_utility.set_location(' Leaving:'|| v_proc,70);
121: raise;
122: end if;
123: hr_utility.set_location(' Leaving:'|| v_proc,80);
124: end check_currency;
125: --
126: -- ----------------------------------------------------------------------------
127: -- |---------------------< check_vendor >----------------------------------|
131: --
132: v_proc varchar2(72) := g_package||'check_vendor';
133: begin
134: --
135: hr_utility.set_location('Entering:'|| v_proc, 5);
136: --
137: ota_general.check_vendor_is_valid(p_vendor_id);
138: --
139: hr_utility.set_location(' Leaving:'|| v_proc, 10);
135: hr_utility.set_location('Entering:'|| v_proc, 5);
136: --
137: ota_general.check_vendor_is_valid(p_vendor_id);
138: --
139: hr_utility.set_location(' Leaving:'|| v_proc, 10);
140: --
141: exception
142: when app_exception.application_exception then
143: if hr_multi_message.exception_add
142: when app_exception.application_exception then
143: if hr_multi_message.exception_add
144: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.VENDOR_ID'
145: ) then
146: hr_utility.set_location(' Leaving:'|| v_proc,70);
147: raise;
148: end if;
149: hr_utility.set_location(' Leaving:'|| v_proc,80);
150: end check_vendor;
145: ) then
146: hr_utility.set_location(' Leaving:'|| v_proc,70);
147: raise;
148: end if;
149: hr_utility.set_location(' Leaving:'|| v_proc,80);
150: end check_vendor;
151: --
152: -- ----------------------------------------------------------------------------
153: -- |---------------------< check_cost_vals >----------------------------------|
160: --
161: v_proc varchar2(72) := g_package||'check_cost_vals';
162: begin
163: --
164: hr_utility.set_location('Entering:'|| v_proc, 5);
165: --
166: if (p_budget_cost is not null or p_actual_cost is not null) and
167: p_budget_currency_code is null then
168: --
170: fnd_message.raise_error;
171: --
172: end if;
173: --
174: hr_utility.set_location(' Leaving:'|| v_proc, 10);
175: --
176: exception
177: when app_exception.application_exception then
178: if hr_multi_message.exception_add
179: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.CURRENCY_CODE'
180: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.BUDGET_COST'
181: ,p_associated_column3 => 'OTA_ACTIVITY_VERSIONS.ACTUAL_COST'
182: ) then
183: hr_utility.set_location(' Leaving:'|| v_proc,70);
184: raise;
185: end if;
186: hr_utility.set_location(' Leaving:'|| v_proc,80);
187: end check_cost_vals;
182: ) then
183: hr_utility.set_location(' Leaving:'|| v_proc,70);
184: raise;
185: end if;
186: hr_utility.set_location(' Leaving:'|| v_proc,80);
187: end check_cost_vals;
188: --
189: -- ----------------------------------------------------------------------------
190: -- |---------------------< check_professional_credit_vals >-------------------|
196: --
197: v_proc varchar2(72) := g_package||'check_professional_credit_vals';
198: begin
199: --
200: hr_utility.set_location('Entering:'|| v_proc, 5);
201: --
202: if (p_professional_credit_type is null and
203: p_professional_credits is not null)
204: or (p_professional_credit_type is not null and
208: fnd_message.raise_error;
209: --
210: end if;
211: --
212: hr_utility.set_location(' Leaving:'|| v_proc, 10);
213: --
214: exception
215: when app_exception.application_exception then
216: if hr_multi_message.exception_add
216: if hr_multi_message.exception_add
217: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.PROFESSIONAL_CREDITS'
218: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.PROFESSIONAL_CREDIT_TYPE'
219: ) then
220: hr_utility.set_location(' Leaving:'|| v_proc,70);
221: raise;
222: end if;
223: hr_utility.set_location(' Leaving:'|| v_proc,80);
224: end check_professional_credit_vals;
219: ) then
220: hr_utility.set_location(' Leaving:'|| v_proc,70);
221: raise;
222: end if;
223: hr_utility.set_location(' Leaving:'|| v_proc,80);
224: end check_professional_credit_vals;
225: --
226: -- ----------------------------------------------------------------------------
227: -- |---------------------< check_professional_credit_type >-------------------|
232: --
233: v_proc varchar2(72) := g_package||'check_professional_credit_type';
234: begin
235: --
236: hr_utility.set_location('Entering:'|| v_proc, 5);
237: --
238: ota_general.check_domain_value
239: ( 'PROFESSIONAL_CREDIT_TYPE', p_professional_credit_type);
240: --
237: --
238: ota_general.check_domain_value
239: ( 'PROFESSIONAL_CREDIT_TYPE', p_professional_credit_type);
240: --
241: hr_utility.set_location(' Leaving:'|| v_proc, 10);
242: --
243: exception
244: when app_exception.application_exception then
245: if hr_multi_message.exception_add
244: when app_exception.application_exception then
245: if hr_multi_message.exception_add
246: (p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.PROFESSIONAL_CREDIT_TYPE'
247: ) then
248: hr_utility.set_location(' Leaving:'|| v_proc,70);
249: raise;
250: end if;
251: hr_utility.set_location(' Leaving:'|| v_proc,80);
252: end check_professional_credit_type;
247: ) then
248: hr_utility.set_location(' Leaving:'|| v_proc,70);
249: raise;
250: end if;
251: hr_utility.set_location(' Leaving:'|| v_proc,80);
252: end check_professional_credit_type;
253: --
254: -- ----------------------------------------------------------------------------
255: -- |-------------------------< check_min_max_values >-------------------------|
268: v_proc varchar2(72) := g_package||'check_min_max_values';
269: --
270: Begin
271: --
272: hr_utility.set_location('Entering:'||v_proc, 5);
273: --
274: If p_min is not null AND p_max is not null then
275: --
276: If p_min > p_max Then
284: End If;
285: --
286: End If;
287: --
288: hr_utility.set_location(' Leaving:'||v_proc, 10);
289: --
290: End check_min_max_values;
291: --
292: -- ----------------------------------------------------------------------------
328:
329: --
330: Begin
331: --
332: hr_utility.set_location('Entering:'|| v_proc, 5);
333: --
334: if p_business_group_id is null then
335: open get_activity;
336: fetch get_activity into v_business_group_id;
355: end if;
356: --
357: close sel_unique_key;
358: --
359: hr_utility.set_location(' Leaving:'|| v_proc, 10);
360: --
361: End check_unique_name;
362: --
363: -- ----------------------------------------------------------------------------
385: where tav.activity_version_id = p_sup_act_vers_id;
386: --
387: Begin
388: --
389: hr_utility.set_location('Entering:'|| v_proc, 5);
390: --
391: If p_sup_act_vers_id is not null Then
392: --
393: Open sel_version;
419: Close sel_version;
420: --
421: End if;
422: --
423: hr_utility.set_location(' Leaving:'|| v_proc, 10);
424: --
425: End check_superseding_version;
426: --
427: -- ---------------------------------------------------------------------------
456: );
457:
458: Begin
459: --
460: hr_utility.set_location('Entering:'|| v_proc, 5);
461: --
462: Open find_overlapping_vers;
463: Fetch find_overlapping_vers into overlapping_vers;
464: --
474: --
475: End if;
476: Close find_overlapping_vers;
477: --
478: hr_utility.set_location('Leaving:'|| v_proc, 10);
479: --
480: End find_overlapping_versions;
481: --
482: -- ---------------------------------------------------------------------------
495: v_proc varchar2(72) := g_package||'check_user_status';
496: --
497: Begin
498: --
499: hr_utility.set_location('Entering:'|| v_proc, 5);
500: --
501: If p_user_status is not null Then
502: --
503: ota_general.check_domain_value( 'ACTIVITY_USER_STATUS', p_user_status);
503: ota_general.check_domain_value( 'ACTIVITY_USER_STATUS', p_user_status);
504: --
505: End if;
506: --
507: hr_utility.set_location(' Leaving:'|| v_proc, 10);
508: --
509: End check_user_status;
510: --
511: -- ----------------------------------------------------------------------------
524: v_proc varchar2(72) := g_package||'check_success_criteria';
525: --
526: Begin
527: --
528: hr_utility.set_location('Entering:'|| v_proc, 5);
529: --
530: IF p_succ_criteria is not null Then
531: --
532: ota_general.check_domain_value('ACTIVITY_SUCCESS_CRITERIA',p_succ_criteria);
532: ota_general.check_domain_value('ACTIVITY_SUCCESS_CRITERIA',p_succ_criteria);
533: --
534: End if;
535: --
536: hr_utility.set_location(' Leaving:'|| v_proc, 10);
537: --
538: End check_success_criteria;
539: --
540: -- ----------------------------------------------------------------------------
563:
564: --
565: Begin
566: --
567: hr_utility.set_location('Entering:'|| v_proc, 5);
568: --
569: If p_activity_id is not null AND p_version_name is not null Then
570: --
571: Open sel_version_id;
596: );
597: --
598: End if;
599: --
600: hr_utility.set_location(' Leaving:'|| v_proc, 10);
601: --
602: End get_activity_version_id;
603: --
604: -- ----------------------------------------------------------------------------
664: v_proc varchar2(72) := g_package||'check_start_end_dates';
665: --
666: Begin
667: --
668: hr_utility.set_location('Entering:'|| v_proc, 5);
669: --
670: ota_general.check_start_end_dates( p_start_date, p_end_date);
671: --
672: hr_utility.set_location(' Leaving:'|| v_proc, 10);
668: hr_utility.set_location('Entering:'|| v_proc, 5);
669: --
670: ota_general.check_start_end_dates( p_start_date, p_end_date);
671: --
672: hr_utility.set_location(' Leaving:'|| v_proc, 10);
673: --
674: End check_start_end_dates;
675: --
676: -- ----------------------------------------------------------------------------
706: if hr_multi_message.no_error_message
707: (p_check_message_name1 => 'OTA_13312_GEN_DATE_ORDER'
708: ) then
709: --
710: hr_utility.set_location('Entering:'|| v_proc, 5);
711: --
712: Open sel_check_dates;
713: Fetch sel_check_dates into v_start_date
714: , v_end_date;
748: End loop;
749: --
750: Close sel_check_dates;
751: --
752: hr_utility.set_location(' Leaving:'|| v_proc, 10);
753: --
754: end if;
755: exception
756: when app_exception.application_exception then
757: if hr_multi_message.exception_add
758: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
759: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
760: ) then
761: hr_utility.set_location(' Leaving:'|| v_proc,70);
762: raise;
763: end if;
764: hr_utility.set_location(' Leaving:'|| v_proc,80);
765: End check_dates_update_rud;
760: ) then
761: hr_utility.set_location(' Leaving:'|| v_proc,70);
762: raise;
763: end if;
764: hr_utility.set_location(' Leaving:'|| v_proc,80);
765: End check_dates_update_rud;
766: --
767: -- ----------------------------------------------------------------------------
768: -- |-------------------------< check_dates_update_ple >-----------------------|
792: where ple.activity_version_id = p_activity_version_id;
793: --
794: Begin
795: --
796: hr_utility.set_location('Entering:'|| v_proc, 5);
797: --
798: Open sel_check_dates;
799: Fetch sel_check_dates into v_start_date
800: , v_end_date;
819: End loop;
820: --
821: Close sel_check_dates;
822: --
823: hr_utility.set_location(' Leaving:'|| v_proc, 10);
824: --
825: End check_dates_update_ple;
826: --
827: -- ----------------------------------------------------------------------------
852: where tbd.activity_version_id = p_activity_version_id;
853: --
854: Begin
855: --
856: hr_utility.set_location('Entering:'|| v_proc, 5);
857: --
858: Open sel_check_dates;
859: Fetch sel_check_dates into v_start_date
860: , v_end_date;
879: End loop;
880: --
881: Close sel_check_dates;
882: --
883: hr_utility.set_location(' Leaving:'|| v_proc, 10);
884: --
885: End check_dates_update_tbd;
886: --
887: -- ----------------------------------------------------------------------------
918: where off.activity_version_id = p_activity_version_id;
919: --
920: Begin
921: --
922: hr_utility.set_location('Entering:'|| v_proc, 5);
923: --
924: Open sel_check_dates;
925: Fetch sel_check_dates into v_start_date
926: , v_end_date;
965: End loop;
966: --
967: Close sel_check_dates;
968: --
969: hr_utility.set_location(' Leaving:'|| v_proc, 10);
970: --
971: End check_dates_update_evt;
972: --
973: -- ----------------------------------------------------------------------------
1007: l_cat_start_date date;
1008: l_cat_end_date date;
1009:
1010: Begin
1011: hr_utility.set_location(' Entering:' || l_proc,10);
1012: --
1013: IF hr_multi_message.no_exclusive_error
1014: (p_check_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
1015: ,p_check_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
1034: CLOSE cur_cat_start_end_date;
1035: End IF;
1036: End IF;
1037: --
1038: hr_utility.set_location(' Leaving:' || l_proc,10);
1039: Exception
1040: when app_exception.application_exception then
1041: IF hr_multi_message.exception_add
1042: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
1041: IF hr_multi_message.exception_add
1042: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
1043: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
1044: ) THEN
1045: hr_utility.set_location(' Leaving:'|| l_proc,20);
1046: raise;
1047: END IF;
1048:
1049: hr_utility.set_location(' Leaving:'|| l_proc,30);
1045: hr_utility.set_location(' Leaving:'|| l_proc,20);
1046: raise;
1047: END IF;
1048:
1049: hr_utility.set_location(' Leaving:'|| l_proc,30);
1050: --
1051: End check_category_dates;
1052: --
1053: -- ----------------------------------------------------------------------------
1074: where evt.activity_version_id = p_activity_version_id;
1075: --
1076: Begin
1077: --
1078: hr_utility.set_location('Entering:'|| v_proc, 5);
1079: --
1080: Open sel_evt_exists;
1081: fetch sel_evt_exists into v_exists;
1082: --
1093: end if;
1094: --
1095: close sel_evt_exists;
1096: --
1097: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1098: --
1099: End check_if_evt_exists;
1100: --
1101: -- ----------------------------------------------------------------------------
1122: where off.activity_version_id = p_activity_version_id;
1123: --
1124: Begin
1125: --
1126: hr_utility.set_location('Entering:'|| v_proc, 5);
1127: --
1128: Open sel_off_exists;
1129: fetch sel_off_exists into v_exists;
1130: --
1141: end if;
1142: --
1143: close sel_off_exists;
1144: --
1145: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1146: --
1147: End check_if_off_exists;
1148: --
1149: -- ----------------------------------------------------------------------------
1175: l_dummy varchar2(1);
1176: --
1177: Begin
1178: --
1179: hr_utility.set_location('Entering:'|| v_proc, 5);
1180: --
1181: -- Check if the activity version is referenced in training plan members table
1182: open c_get_tpm_rows;
1183: fetch c_get_tpm_rows into l_dummy;
1188: else
1189: close c_get_tpm_rows;
1190: end if;
1191: --
1192: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1193: --
1194: End check_if_tpm_exists;
1195: --
1196: -- ----------------------------------------------------------------------------
1217: where tbd.activity_version_id = p_activity_version_id;
1218: --
1219: Begin
1220: --
1221: hr_utility.set_location('Entering:'|| v_proc, 5);
1222: --
1223: Open sel_tbd_exists;
1224: fetch sel_tbd_exists into v_exists;
1225: --
1236: end if;
1237: --
1238: close sel_tbd_exists;
1239: --
1240: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1241: --
1242: End check_if_tbd_exists;
1243: --
1244: -- ----------------------------------------------------------------------------
1265: where ple.activity_version_id = p_activity_version_id;
1266: --
1267: Begin
1268: --
1269: hr_utility.set_location('Entering:'|| v_proc, 5);
1270: --
1271: Open sel_ple_exists;
1272: fetch sel_ple_exists into v_exists;
1273: --
1284: end if;
1285: --
1286: close sel_ple_exists;
1287: --
1288: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1289: --
1290: End check_if_ple_exists;
1291: --
1292: -- ----------------------------------------------------------------------------
1313: where pce.activity_version_id = p_activity_version_id;
1314: --
1315: Begin
1316: --
1317: hr_utility.set_location('Entering:'|| v_proc, 5);
1318: --
1319: Open sel_comp_exists;
1320: fetch sel_comp_exists into v_exists;
1321: --
1332: end if;
1333: --
1334: close sel_comp_exists;
1335: --
1336: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1337: --
1338: End check_if_comp_exists;
1339: --
1340:
1363: where lpm.activity_version_id = p_activity_version_id;
1364: --
1365: Begin
1366: --
1367: hr_utility.set_location('Entering:'|| v_proc, 5);
1368: --
1369: Open sel_lpm_exists;
1370: fetch sel_lpm_exists into v_exists;
1371: --
1382: end if;
1383: --
1384: close sel_lpm_exists;
1385: --
1386: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1387: --
1388: End check_if_lpm_exists;
1389: --
1390:
1413: where tav.superseded_by_act_version_id = p_activity_version_id;
1414: --
1415: Begin
1416: --
1417: hr_utility.set_location('Entering:'|| v_proc, 5);
1418: --
1419: Open sel_tav_exists;
1420: fetch sel_tav_exists into v_exists;
1421: --
1432: end if;
1433: --
1434: close sel_tav_exists;
1435: --
1436: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1437: --
1438: End check_if_tav_exists;
1439: --
1440: -- ----------------------------------------------------------------------------
1461: where tsp.activity_version_id = p_activity_version_id;
1462: --
1463: Begin
1464: --
1465: hr_utility.set_location('Entering:'|| v_proc, 5);
1466: --
1467: Open sel_tsp_exists;
1468: fetch sel_tsp_exists into v_exists;
1469: --
1480: end if;
1481: --
1482: close sel_tsp_exists;
1483: --
1484: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1485: --
1486: End check_if_tsp_exists;
1487: --
1488:
1502: v_proc varchar2(72) := g_package||'check_duration_units';
1503: --
1504: Begin
1505: --
1506: hr_utility.set_location('Entering:'|| v_proc, 5);
1507: --
1508: If p_duration_units is not null Then
1509: --
1510: ota_general.check_domain_value( 'OTA_DURATION_UNITS', p_duration_units);
1510: ota_general.check_domain_value( 'OTA_DURATION_UNITS', p_duration_units);
1511: --
1512: End if;
1513: --
1514: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1515: --
1516: End check_duration_units;
1517: --
1518: -- ----------------------------------------------------------------------------
1531: v_proc varchar2(72) := g_package||'check_duration';
1532: --
1533: Begin
1534: --
1535: hr_utility.set_location('Entering:'|| v_proc, 5);
1536: --
1537: If p_duration <= 0 Then
1538: --
1539: -- ** TEMP ** Add error message with the following text.
1543: );
1544: --
1545: end if;
1546: --
1547: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1548: --
1549: End check_duration;
1550: --
1551: -- ----------------------------------------------------------------------------
1569: where lan.language_id = p_language_id;
1570: --
1571: Begin
1572: --
1573: hr_utility.set_location('Entering:'|| v_proc, 5);
1574: --
1575: Open sel_language;
1576: fetch sel_language into v_exists;
1577: --
1592: End if;
1593: --
1594: close sel_language;
1595: --
1596: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1597: --
1598: End check_language;
1599: --
1600: -- ----------------------------------------------------------------------------
1615: v_proc varchar2(72) := g_package||'check_controlling_person';
1616: --
1617: Begin
1618: --
1619: hr_utility.set_location('Entering:'|| v_proc, 5);
1620: --
1621: If p_person_id is not null Then
1622: --
1623: If NOT ota_general.check_person( p_person_id, nvl(p_date,hr_api.g_sot)) Then
1631: End if;
1632: --
1633: End if;
1634: --
1635: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1636: --
1637: End check_controlling_person;
1638: --
1639: -- ----------------------------------------------------------------------------
1671: and v_end_date >= nvl(tav.start_date,hr_api.g_sot);
1672: --
1673: Begin
1674: --
1675: hr_utility.set_location('Entering:'|| v_proc, 5);
1676: --
1677: if p_start_date is null then
1678: v_start_date := hr_api.g_sot;
1679: else
1701: else
1702: v_default_end_date := hr_api.g_eot;
1703: end if;
1704: --
1705: hr_utility.trace(to_char(v_start_date));
1706: hr_utility.trace(to_char(v_end_date));
1707: hr_utility.trace(to_char(v_default_end_date));
1708: --
1709: Open sel_versions;
1702: v_default_end_date := hr_api.g_eot;
1703: end if;
1704: --
1705: hr_utility.trace(to_char(v_start_date));
1706: hr_utility.trace(to_char(v_end_date));
1707: hr_utility.trace(to_char(v_default_end_date));
1708: --
1709: Open sel_versions;
1710: fetch sel_versions into v_exists;
1703: end if;
1704: --
1705: hr_utility.trace(to_char(v_start_date));
1706: hr_utility.trace(to_char(v_end_date));
1707: hr_utility.trace(to_char(v_default_end_date));
1708: --
1709: Open sel_versions;
1710: fetch sel_versions into v_exists;
1711: --
1709: Open sel_versions;
1710: fetch sel_versions into v_exists;
1711: --
1712: if sel_versions%found then
1713: hr_utility.trace('Returning true');
1714: close sel_versions;
1715: return(true);
1716: else
1717: hr_utility.trace('Returning False');
1713: hr_utility.trace('Returning true');
1714: close sel_versions;
1715: return(true);
1716: else
1717: hr_utility.trace('Returning False');
1718: close sel_versions;
1719: return(false);
1720: end if;
1721: --
1718: close sel_versions;
1719: return(false);
1720: end if;
1721: --
1722: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1723: --
1724: End exist_multiple_versions;
1725: --
1726: --
1751: and tad.multiple_con_versions_flag = 'N' ;
1752: --
1753: Begin
1754: --
1755: hr_utility.set_location('Entering:'|| v_proc, 5);
1756: --
1757: Open sel_activity;
1758: Fetch sel_activity into v_exists ;
1759: --
1774: End if;
1775: --
1776: Close sel_activity;
1777: --
1778: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1779: --
1780: End check_multiple_con_version;
1781: --
1782: --
1822: and tav2.activity_id = p_activity_id);
1823: --
1824: Begin
1825: --
1826: hr_utility.set_location('Entering:'|| v_proc, 5);
1827: --
1828: open get_previous_version;
1829: fetch get_previous_version into v_version_id,
1830: v_start_date,
1858: end if;
1859: close get_previous_version;
1860: --
1861: --
1862: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1863: --
1864: End set_superseding_version;
1865: --
1866: -- ----------------------------------------------------------------------------
1892: order by tav.end_date desc;
1893: --
1894: Begin
1895: --
1896: hr_utility.set_location('Entering:'|| v_proc, 5);
1897: --
1898: Open get_versions;
1899: Fetch get_versions into v_max_end_date;
1900: --
1909: End if;
1910: --
1911: Close get_versions;
1912: --
1913: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1914: --
1915: End set_superseding_start_date;
1916: --
1917: -- ---------------------------------------------------------------------------
1954: and tav.activity_version_id = pc_activity_version_id ;
1955: --
1956: Begin
1957: --
1958: hr_utility.set_location('Entering:'|| v_proc, 5);
1959: --
1960: Open sel_latest_version;
1961: Fetch sel_latest_version into v_act_version_id;
1962: --
1987: End if;
1988: --
1989: close sel_latest_version;
1990: --
1991: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1992: --
1993: End check_version_after_supersede;
1994: --
1995:
2036: where activity_version_id = p_activity_version_id;
2037: --
2038: Begin
2039: --
2040: hr_utility.set_location('Entering:'|| l_proc, 5);
2041:
2042: OPEN csr_old_inventory;
2043: FETCH csr_old_inventory into l_old_inventory_item_id,
2044: l_old_organization_id;
2046: if ((p_activity_version_id is not null) and
2047: nvl(l_old_inventory_item_id,hr_api.g_number) <>
2048: nvl(p_inventory_item_id,hr_api.g_number)) then
2049: --
2050: hr_utility.set_location('Entering:'||l_proc, 10);
2051:
2052: --
2053: if p_inventory_item_id is null and l_old_inventory_item_id is not null then
2054: hr_utility.set_location('Entering:'||l_proc, 15);
2050: hr_utility.set_location('Entering:'||l_proc, 10);
2051:
2052: --
2053: if p_inventory_item_id is null and l_old_inventory_item_id is not null then
2054: hr_utility.set_location('Entering:'||l_proc, 15);
2055: open csr_order_line_exist;
2056: fetch csr_order_line_exist into l_exists;
2057: if csr_order_line_exist%found then
2058: fnd_message.set_name('OTA','OTA_13695_TAV_INV_EXIST');
2058: fnd_message.set_name('OTA','OTA_13695_TAV_INV_EXIST');
2059: fnd_message.raise_error;
2060: end if;
2061: close csr_order_line_exist;
2062: hr_utility.set_location('Entering:'||l_proc, 20);
2063:
2064:
2065: end if;
2066: if (p_inventory_item_id is not null and
2066: if (p_inventory_item_id is not null and
2067: p_organization_id is not null) and
2068: (l_old_inventory_item_id is not null and
2069: l_old_organization_id is not null) then
2070: hr_utility.set_location('Entering:'||l_proc, 25);
2071: open csr_order_line_exist;
2072: fetch csr_order_line_exist into l_exists;
2073: if csr_order_line_exist%found then
2074: fnd_message.set_name('OTA','OTA_13695_TAV_INV_EXIST');
2074: fnd_message.set_name('OTA','OTA_13695_TAV_INV_EXIST');
2075: fnd_message.raise_error;
2076: end if;
2077: close csr_order_line_exist;
2078: hr_utility.set_location('Entering:'||l_proc, 30);
2079: end if;
2080: --
2081: end if;
2082: hr_utility.set_location(' Leaving:'|| l_proc, 35);
2078: hr_utility.set_location('Entering:'||l_proc, 30);
2079: end if;
2080: --
2081: end if;
2082: hr_utility.set_location(' Leaving:'|| l_proc, 35);
2083: --
2084: exception
2085: when app_exception.application_exception then
2086: if hr_multi_message.exception_add
2085: when app_exception.application_exception then
2086: if hr_multi_message.exception_add
2087: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.INVENTORY_ITEM_ID'
2088: ) then
2089: hr_utility.set_location(' Leaving:'|| l_proc,70);
2090: raise;
2091: end if;
2092: hr_utility.set_location(' Leaving:'|| l_proc,80);
2093: End check_OE_lines_exist;
2088: ) then
2089: hr_utility.set_location(' Leaving:'|| l_proc,70);
2090: raise;
2091: end if;
2092: hr_utility.set_location(' Leaving:'|| l_proc,80);
2093: End check_OE_lines_exist;
2094:
2095: --
2096: -- ----------------------------------------------------------------------------
2148:
2149: Begin
2150: --
2151:
2152: hr_utility.set_location('Entering:'|| l_proc, 5);
2153: IF p_activity_version_id is not null THEN
2154: OPEN csr_old_inventory;
2155: FETCH csr_old_inventory into l_old_inventory_item_id,
2156: l_old_organization_id;
2163: nvl(l_old_organization_id,hr_api.g_number) <>
2164: nvl(p_organization_id,hr_api.g_number)))
2165: or (p_activity_version_id is null)) then
2166: --
2167: hr_utility.set_location('Entering:'||l_proc, 10);
2168:
2169: --
2170: if p_inventory_item_id is not null and
2171: p_organization_id is not null then
2168:
2169: --
2170: if p_inventory_item_id is not null and
2171: p_organization_id is not null then
2172: hr_utility.set_location('Entering:'||l_proc, 15);
2173: open csr_inventory;
2174: fetch csr_inventory into l_exists;
2175: if csr_inventory%notfound then
2176: fnd_message.set_name('OTA','OTA_13693_TAV_NO_INV');
2176: fnd_message.set_name('OTA','OTA_13693_TAV_NO_INV');
2177: fnd_message.raise_error;
2178: end if;
2179: close csr_inventory;
2180: hr_utility.set_location('Entering:'||l_proc, 20);
2181: elsif p_inventory_item_id is not null and
2182: p_organization_id is null then
2183: fnd_message.set_name('OTA','OTA_13892_TAV_INV_COMB_INVALID');
2184: fnd_message.raise_error;
2219: end if;
2220:
2221:
2222:
2223: hr_utility.set_location(' Leaving:'|| l_proc, 30);
2224: --
2225: exception
2226: when app_exception.application_exception then
2227: if hr_multi_message.exception_add
2226: when app_exception.application_exception then
2227: if hr_multi_message.exception_add
2228: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.INVENTORY_ITEM_ID'
2229: ) then
2230: hr_utility.set_location(' Leaving:'|| l_proc,70);
2231: raise;
2232: end if;
2233: hr_utility.set_location(' Leaving:'|| l_proc,80);
2234: End check_inventory_item_id;
2229: ) then
2230: hr_utility.set_location(' Leaving:'|| l_proc,70);
2231: raise;
2232: end if;
2233: hr_utility.set_location(' Leaving:'|| l_proc,80);
2234: End check_inventory_item_id;
2235:
2236: --
2237: -- ----------------------------------------------------------------------------
2261: where rco_id = p_rco_id;
2262:
2263: Begin
2264:
2265: hr_utility.set_location('Entering:'||l_proc, 5);
2266:
2267: if (((p_activity_version_id is not null) and
2268: nvl(ota_tav_shd.g_old_rec.rco_id,hr_api.g_number) <>
2269: nvl(p_rco_id,hr_api.g_number))
2268: nvl(ota_tav_shd.g_old_rec.rco_id,hr_api.g_number) <>
2269: nvl(p_rco_id,hr_api.g_number))
2270: or (p_activity_version_id is null)) then
2271: --
2272: hr_utility.set_location('Entering:'||l_proc, 10);
2273: if (p_rco_id is not null) then
2274: hr_utility.set_location('Entering:'||l_proc, 15);
2275: open csr_rco;
2276: fetch csr_rco into l_exists;
2270: or (p_activity_version_id is null)) then
2271: --
2272: hr_utility.set_location('Entering:'||l_proc, 10);
2273: if (p_rco_id is not null) then
2274: hr_utility.set_location('Entering:'||l_proc, 15);
2275: open csr_rco;
2276: fetch csr_rco into l_exists;
2277: if csr_rco%found then
2278: ota_tav_shd.constraint_error(p_constraint_name =>'OTA_ACTIVITY_VERSIONS_UK5');
2277: if csr_rco%found then
2278: ota_tav_shd.constraint_error(p_constraint_name =>'OTA_ACTIVITY_VERSIONS_UK5');
2279: end if;
2280: close csr_rco;
2281: hr_utility.set_location('Leaving:'||l_proc, 20);
2282: end if;
2283: end if;
2284: exception
2285: when app_exception.application_exception then
2285: when app_exception.application_exception then
2286: if hr_multi_message.exception_add
2287: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.RCO_ID'
2288: ) then
2289: hr_utility.set_location(' Leaving:'|| l_proc,70);
2290: raise;
2291: end if;
2292: hr_utility.set_location(' Leaving:'|| l_proc,80);
2293: hr_utility.set_location('Leaving:'||l_proc, 30);
2288: ) then
2289: hr_utility.set_location(' Leaving:'|| l_proc,70);
2290: raise;
2291: end if;
2292: hr_utility.set_location(' Leaving:'|| l_proc,80);
2293: hr_utility.set_location('Leaving:'||l_proc, 30);
2294: End;
2295:
2296: --
2289: hr_utility.set_location(' Leaving:'|| l_proc,70);
2290: raise;
2291: end if;
2292: hr_utility.set_location(' Leaving:'|| l_proc,80);
2293: hr_utility.set_location('Leaving:'||l_proc, 30);
2294: End;
2295:
2296: --
2297: -- ----------------------------------------------------------------------------
2331: OR (lps.end_date_active IS NOT NULL AND l_start_date > lps.end_date_active));
2332:
2333: Begin
2334:
2335: hr_utility.set_location('Entering:'||l_proc, 5);
2336: IF hr_multi_message.no_exclusive_error
2337: (p_check_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2338: ,p_check_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
2339: ,p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2372: END IF;
2373: END IF;
2374: END IF;
2375:
2376: hr_utility.set_location('Leaving:'||l_proc, 80);
2377: End;
2378:
2379: -- ----------------------------------------------------------------------------
2380: -- |-------------------------< check_if_noth_exists >--------------------------|
2401: where nth.activity_version_id = p_activity_version_id;
2402: --
2403: Begin
2404: --
2405: hr_utility.set_location('Entering:'|| v_proc, 5);
2406: --
2407: Open sel_noth_exists;
2408: fetch sel_noth_exists into v_exists;
2409: --
2420: end if;
2421: --
2422: close sel_noth_exists;
2423: --
2424: hr_utility.set_location(' Leaving:'|| v_proc, 10);
2425: --
2426:
2427: end check_if_noth_exists;
2428:
2452: and ctm.object_type = 'H';
2453: --
2454: Begin
2455: --
2456: hr_utility.set_location('Entering:'|| v_proc, 5);
2457: --
2458: Open sel_ctm_exists;
2459: fetch sel_ctm_exists into v_exists;
2460: --
2471: end if;
2472: --
2473: close sel_ctm_exists;
2474: --
2475: hr_utility.set_location(' Leaving:'|| v_proc, 10);
2476: --
2477:
2478: end check_if_crt_exists;
2479:
2520:
2521:
2522: Begin
2523:
2524: hr_utility.set_location('Entering:'||l_proc, 5);
2525: IF hr_multi_message.no_exclusive_error
2526: (p_check_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2527: ,p_check_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
2528: ,p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2561: END IF;
2562: END IF;
2563: END IF;
2564:
2565: hr_utility.set_location('Leaving:'||l_proc, 80);
2566: End check_course_crt_dates;
2567: end ota_tav_api_business_rules;