52: WHERE business_group_id = l_business_group_id;
53: --
54: BEGIN
55: --
56: hr_utility.set_location('Entering:'|| l_proc, 10);
57: hr_api.mandatory_arg_error(p_api_name => l_proc,
58: p_argument => 'location_id',
59: p_argument_value => p_location_id);
60: IF nvl(g_location_id, hr_api.g_number) = p_location_id THEN
63: -- call to this function. Just return the value in the global
64: -- variable.
65: --
66: l_legislation_code := g_legislation_code;
67: hr_utility.set_location(l_proc, 20);
68: ELSE
69: --
70: -- The ID is different to the last call to this function
71: -- or this is the first call to this function.
102: fnd_message.raise_error;
103: ELSE
104: CLOSE csr_leg_code;
105: END IF;
106: hr_utility.set_location(l_proc, 30);
107: --
108: --
109: END IF;
110: --
114: g_legislation_code := l_legislation_code;
115: --
116: END IF;
117: --
118: hr_utility.set_location(' Leaving:'|| l_proc, 40);
119: RETURN l_legislation_code;
120: END return_legislation_code;
121: --
122: -- ----------------------------------------------------------------------------
188: OR nvl(business_group_id, p_business_group_id)
189: = p_business_group_id );
190: --
191: BEGIN
192: hr_utility.set_location('Entering:'|| l_proc, 10);
193:
194: --
195: -- Check that the ship to location ID is linked to a
196: -- valid location on HR_LOCATIONS_ALL
194: --
195: -- Check that the ship to location ID is linked to a
196: -- valid location on HR_LOCATIONS_ALL
197: --
198: hr_utility.set_location(l_proc, 20);
199: --
200: --
201: -- Only check validity of ship_to_location if inserting or data has changed
202: --
209: -- If p_ship_to_location_id IS null, it defaults to location_id
210: -- once this is known (i.e. in pre_insert() )
211: --
212: --
213: hr_utility.set_location(l_proc, 25);
214: --
215: IF p_ship_to_site_flag = 'Y' THEN
216: --
217: -- Can't be a ship-to-site if p_ship_to_location_id points to another
216: --
217: -- Can't be a ship-to-site if p_ship_to_location_id points to another
218: -- location, which it must do if it is not NULL.
219: --
220: hr_utility.set_message(800, 'PER_52537_LOC_INV_SHPTO_FLG');
221: hr_utility.raise_error;
222: ELSE
223: --
224: -- Fetch data from database
217: -- Can't be a ship-to-site if p_ship_to_location_id points to another
218: -- location, which it must do if it is not NULL.
219: --
220: hr_utility.set_message(800, 'PER_52537_LOC_INV_SHPTO_FLG');
221: hr_utility.raise_error;
222: ELSE
223: --
224: -- Fetch data from database
225: --
227: FETCH csr_valid_ship_to_loc INTO l_exists;
228: --
229: IF csr_valid_ship_to_loc%notfound THEN
230: CLOSE csr_valid_ship_to_loc;
231: hr_utility.set_message(800, 'PER_52501_INV_SHIP_TO_LOC');
232: hr_utility.raise_error;
233: ELSE
234: CLOSE csr_valid_ship_to_loc;
235: END IF;
228: --
229: IF csr_valid_ship_to_loc%notfound THEN
230: CLOSE csr_valid_ship_to_loc;
231: hr_utility.set_message(800, 'PER_52501_INV_SHIP_TO_LOC');
232: hr_utility.raise_error;
233: ELSE
234: CLOSE csr_valid_ship_to_loc;
235: END IF;
236: END IF;
242: -- Can't be a ship-to-site if p_ship_to_location_id points to another
243: -- location, which it must do if it is not NULL.
244: -- Must be a ship-to-site if p_ship_to_location_id is NULL
245: --
246: hr_utility.set_message(800, 'PER_52386_INVALID_SHIP_TO_LOC');
247: hr_utility.raise_error;
248: END IF;
249: END IF;
250: --
243: -- location, which it must do if it is not NULL.
244: -- Must be a ship-to-site if p_ship_to_location_id is NULL
245: --
246: hr_utility.set_message(800, 'PER_52386_INVALID_SHIP_TO_LOC');
247: hr_utility.raise_error;
248: END IF;
249: END IF;
250: --
251:
262: --
263: -- ship_to_location_id defaults to location_id if NULL. See business rules.
264: --
265: --
266: hr_utility.set_location(l_proc, 30);
267: --
268: p_ship_to_location_id := nvl (p_ship_to_location_id, p_location_id);
269: ---
270: IF p_ship_to_location_id = p_location_id THEN
272: -- Do not get data from database if we are referencing current location_id
273: --
274: IF (p_ship_to_site_flag = 'N') OR (nvl(p_inactive_date, hr_api.g_eot) <
275: p_effective_date) THEN
276: hr_utility.set_message(800, 'PER_52537_LOC_INV_SHPTO_FLG');
277: hr_utility.raise_error;
278: END IF;
279: ELSE
280: --
273: --
274: IF (p_ship_to_site_flag = 'N') OR (nvl(p_inactive_date, hr_api.g_eot) <
275: p_effective_date) THEN
276: hr_utility.set_message(800, 'PER_52537_LOC_INV_SHPTO_FLG');
277: hr_utility.raise_error;
278: END IF;
279: ELSE
280: --
281: IF (p_ship_to_site_flag = 'Y') THEN
278: END IF;
279: ELSE
280: --
281: IF (p_ship_to_site_flag = 'Y') THEN
282: hr_utility.set_message(800, 'PER_52537_LOC_INV_SHPTO_FLG');
283: hr_utility.raise_error;
284: END IF;
285: --
286: -- Fetch data from database
279: ELSE
280: --
281: IF (p_ship_to_site_flag = 'Y') THEN
282: hr_utility.set_message(800, 'PER_52537_LOC_INV_SHPTO_FLG');
283: hr_utility.raise_error;
284: END IF;
285: --
286: -- Fetch data from database
287: --
289: FETCH csr_valid_ship_to_loc INTO l_exists;
290: --
291: IF csr_valid_ship_to_loc%notfound THEN
292: CLOSE csr_valid_ship_to_loc;
293: hr_utility.set_message(800, 'PER_52501_INV_SHIP_TO_LOC');
294: hr_utility.raise_error;
295: ELSE
296: CLOSE csr_valid_ship_to_loc;
297: END IF;
290: --
291: IF csr_valid_ship_to_loc%notfound THEN
292: CLOSE csr_valid_ship_to_loc;
293: hr_utility.set_message(800, 'PER_52501_INV_SHIP_TO_LOC');
294: hr_utility.raise_error;
295: ELSE
296: CLOSE csr_valid_ship_to_loc;
297: END IF;
298: END IF;
298: END IF;
299: END IF;
300: END IF;
301: --
302: hr_utility.set_location('Leaving:'|| l_proc, 80);
303: END chk_ship_to_loc_id_and_flag;
304: --
305: --
306: -- ----------------------------------------------------------------------------
345: BEGIN
346: --
347: -- Test validity of receiving-site flag.
348: --
349: hr_utility.set_location('Entering:'|| l_proc, 10);
350: --
351: IF p_ship_to_site_flag = 'Y' AND p_receiving_site_flag <> 'Y' THEN
352: hr_utility.set_message(800, 'PER_52538_LOC_INV_REC_FLAG');
353: hr_utility.raise_error;
348: --
349: hr_utility.set_location('Entering:'|| l_proc, 10);
350: --
351: IF p_ship_to_site_flag = 'Y' AND p_receiving_site_flag <> 'Y' THEN
352: hr_utility.set_message(800, 'PER_52538_LOC_INV_REC_FLAG');
353: hr_utility.raise_error;
354: END IF;
355: --
356: hr_utility.set_location('Leaving:'|| l_proc, 20);
349: hr_utility.set_location('Entering:'|| l_proc, 10);
350: --
351: IF p_ship_to_site_flag = 'Y' AND p_receiving_site_flag <> 'Y' THEN
352: hr_utility.set_message(800, 'PER_52538_LOC_INV_REC_FLAG');
353: hr_utility.raise_error;
354: END IF;
355: --
356: hr_utility.set_location('Leaving:'|| l_proc, 20);
357: END chk_receiving_site_flag;
352: hr_utility.set_message(800, 'PER_52538_LOC_INV_REC_FLAG');
353: hr_utility.raise_error;
354: END IF;
355: --
356: hr_utility.set_location('Leaving:'|| l_proc, 20);
357: END chk_receiving_site_flag;
358: --
359: -- ---------------------------------------------------------------------------
360: -- |----------------------< chk_designated_receiver_id >---------------------|
410: OR p_business_group_id = business_group_id +0);
411:
412: --
413: BEGIN
414: hr_utility.set_location('Entering:'|| l_proc, 10);
415: IF p_designated_receiver_id IS NOT NULL THEN
416: --
417: -- Only perform validation when DESIGNATED_RECEIVER_ID is not null
418: --
423: --
424: -- Check that the Person ID is linked to a
425: -- valid person on PER_PEOPLE_F
426: --
427: hr_utility.set_location(l_proc, 20);
428: OPEN csr_valid_pers;
429: FETCH csr_valid_pers INTO l_exists;
430: IF csr_valid_pers%notfound THEN
431: CLOSE csr_valid_pers;
428: OPEN csr_valid_pers;
429: FETCH csr_valid_pers INTO l_exists;
430: IF csr_valid_pers%notfound THEN
431: CLOSE csr_valid_pers;
432: hr_utility.set_message(800, 'PER_52502_INV_DES_REC_LOC');
433: hr_utility.raise_error;
434: ELSE
435: CLOSE csr_valid_pers;
436: END IF;
429: FETCH csr_valid_pers INTO l_exists;
430: IF csr_valid_pers%notfound THEN
431: CLOSE csr_valid_pers;
432: hr_utility.set_message(800, 'PER_52502_INV_DES_REC_LOC');
433: hr_utility.raise_error;
434: ELSE
435: CLOSE csr_valid_pers;
436: END IF;
437: --
438: END IF;
439: --
440: END IF;
441: --
442: hr_utility.set_location('Leaving:'|| l_proc, 30);
443: --
444:
445: END chk_designated_receiver_id;
446: --
484: --
485: l_proc VARCHAR2(72) := g_package||'chk_inactive_date';
486: --
487: BEGIN
488: hr_utility.set_location('Entering:'|| l_proc, 10);
489: --
490: -- If set, inactive_date must be greater or equal to session date.
491: --
492: IF nvl (p_inactive_date, hr_api.g_eot) < p_effective_date THEN
489: --
490: -- If set, inactive_date must be greater or equal to session date.
491: --
492: IF nvl (p_inactive_date, hr_api.g_eot) < p_effective_date THEN
493: hr_utility.set_message(800, 'HR_7301_INVALID_INACTIVE_DATE');
494: hr_utility.raise_error;
495: END IF;
496: --
497: hr_utility.set_location('Leaving:'||l_proc, 30);
490: -- If set, inactive_date must be greater or equal to session date.
491: --
492: IF nvl (p_inactive_date, hr_api.g_eot) < p_effective_date THEN
493: hr_utility.set_message(800, 'HR_7301_INVALID_INACTIVE_DATE');
494: hr_utility.raise_error;
495: END IF;
496: --
497: hr_utility.set_location('Leaving:'||l_proc, 30);
498: --
493: hr_utility.set_message(800, 'HR_7301_INVALID_INACTIVE_DATE');
494: hr_utility.raise_error;
495: END IF;
496: --
497: hr_utility.set_location('Leaving:'||l_proc, 30);
498: --
499: END chk_inactive_date;
500: --
501: -- ----------------------------------------------------------------------------
548: res BINARY_INTEGER;
549: --
550: BEGIN
551: --
552: hr_utility.set_location('Entering: id '|| l_proc, 10);
553: --
554: -- Only continue if INVENTORY_ORGANIZTION_ID is not null
555: -- and we are updating with new data, or inserting.
556: --
554: -- Only continue if INVENTORY_ORGANIZTION_ID is not null
555: -- and we are updating with new data, or inserting.
556: --
557: IF p_inventory_organization_id IS NOT NULL THEN
558: hr_utility.set_location('Inventory Org id '|| p_inventory_organization_id, 15);
559: IF ( p_inventory_organization_id <> nvl (hr_loc_shd.g_old_rec.inventory_organization_id, hr_api.g_number) ) OR
560: ( p_location_id IS NULL) THEN
561: hr_utility.set_location('If Condition satisfied, checking inventory org ', 20);
562: --
557: IF p_inventory_organization_id IS NOT NULL THEN
558: hr_utility.set_location('Inventory Org id '|| p_inventory_organization_id, 15);
559: IF ( p_inventory_organization_id <> nvl (hr_loc_shd.g_old_rec.inventory_organization_id, hr_api.g_number) ) OR
560: ( p_location_id IS NULL) THEN
561: hr_utility.set_location('If Condition satisfied, checking inventory org ', 20);
562: --
563: DECLARE
564: INV_VIEW_DOES_NOT_EXIST EXCEPTION;
565: PRAGMA EXCEPTION_INIT(INV_VIEW_DOES_NOT_EXIST, -00942);
565: PRAGMA EXCEPTION_INIT(INV_VIEW_DOES_NOT_EXIST, -00942);
566: BEGIN
567: cur := DBMS_SQL.Open_Cursor;
568: --
569: hr_utility.set_location(l_proc||': Before parse', 30);
570: --
571: DBMS_SQL.Parse (cur,
572: ' SELECT NULL
573: FROM INV_ORGANIZATION_NAME_V
572: ' SELECT NULL
573: FROM INV_ORGANIZATION_NAME_V
574: WHERE organization_id = :pOrgId', DBMS_SQL.Native );
575: DBMS_SQL.Bind_Variable (cur, 'pOrgId',p_inventory_organization_id );
576: hr_utility.set_location(l_proc||': Before Execute', 40);
577: res := DBMS_SQL.Execute(cur);
578:
579: -- Make sure we have a valid inventory organization
580: hr_utility.set_location(l_proc||': Before Fetch', 50);
576: hr_utility.set_location(l_proc||': Before Execute', 40);
577: res := DBMS_SQL.Execute(cur);
578:
579: -- Make sure we have a valid inventory organization
580: hr_utility.set_location(l_proc||': Before Fetch', 50);
581: If (DBMS_SQL.FETCH_ROWS (cur) = 0) then
582: hr_utility.set_location(l_proc||': Rasing Error', 60);
583: hr_utility.set_message(800, 'PER_52503_INV_INVENT_ORG_ID');
584: hr_utility.raise_error;
578:
579: -- Make sure we have a valid inventory organization
580: hr_utility.set_location(l_proc||': Before Fetch', 50);
581: If (DBMS_SQL.FETCH_ROWS (cur) = 0) then
582: hr_utility.set_location(l_proc||': Rasing Error', 60);
583: hr_utility.set_message(800, 'PER_52503_INV_INVENT_ORG_ID');
584: hr_utility.raise_error;
585: End if;
586:
579: -- Make sure we have a valid inventory organization
580: hr_utility.set_location(l_proc||': Before Fetch', 50);
581: If (DBMS_SQL.FETCH_ROWS (cur) = 0) then
582: hr_utility.set_location(l_proc||': Rasing Error', 60);
583: hr_utility.set_message(800, 'PER_52503_INV_INVENT_ORG_ID');
584: hr_utility.raise_error;
585: End if;
586:
587: hr_utility.set_location(l_proc||': Before close cursor', 70);
580: hr_utility.set_location(l_proc||': Before Fetch', 50);
581: If (DBMS_SQL.FETCH_ROWS (cur) = 0) then
582: hr_utility.set_location(l_proc||': Rasing Error', 60);
583: hr_utility.set_message(800, 'PER_52503_INV_INVENT_ORG_ID');
584: hr_utility.raise_error;
585: End if;
586:
587: hr_utility.set_location(l_proc||': Before close cursor', 70);
588: DBMS_SQL.Close_Cursor (cur);
583: hr_utility.set_message(800, 'PER_52503_INV_INVENT_ORG_ID');
584: hr_utility.raise_error;
585: End if;
586:
587: hr_utility.set_location(l_proc||': Before close cursor', 70);
588: DBMS_SQL.Close_Cursor (cur);
589: EXCEPTION
590: When INV_VIEW_DOES_NOT_EXIST Then
591: hr_utility.set_location(l_proc||': View INV_ORGANIZATION_NAME_V not found', 99);
587: hr_utility.set_location(l_proc||': Before close cursor', 70);
588: DBMS_SQL.Close_Cursor (cur);
589: EXCEPTION
590: When INV_VIEW_DOES_NOT_EXIST Then
591: hr_utility.set_location(l_proc||': View INV_ORGANIZATION_NAME_V not found', 99);
592: if DBMS_SQL.Is_Open(cur) then
593: DBMS_SQL.Close_Cursor(cur);
594: end if;
595:
593: DBMS_SQL.Close_Cursor(cur);
594: end if;
595:
596: When Others then
597: hr_utility.set_location(l_proc||': Other Error found'||sqlerrm, 99);
598: if DBMS_SQL.Is_Open(cur) then
599: DBMS_SQL.Close_Cursor(cur);
600: end if;
601: raise;
603:
604: END IF;
605: END IF;
606: --
607: hr_utility.set_location('Leaving:'||l_proc, 40);
608: --
609: END chk_inventory_organization_id;
610:
611: /*
656: AND name = p_tax_name;
657: --
658: BEGIN
659: --
660: hr_utility.set_location('Entering:'|| l_proc, 10);
661: --
662: -- Only continue if tax_name is not null:
663: --
664: IF ( p_tax_name IS NOT NULL ) THEN
673: THEN
674: OPEN csr_valid_tax_name;
675: FETCH csr_valid_tax_name INTO l_exists;
676: --
677: hr_utility.set_location(l_proc, 20);
678: --
679: IF csr_valid_tax_name%notfound THEN
680: CLOSE csr_valid_tax_name;
681: hr_utility.set_message(800, 'PER_52504_INV_TAX_NAME');
677: hr_utility.set_location(l_proc, 20);
678: --
679: IF csr_valid_tax_name%notfound THEN
680: CLOSE csr_valid_tax_name;
681: hr_utility.set_message(800, 'PER_52504_INV_TAX_NAME');
682: hr_utility.raise_error;
683: END IF;
684: --
685: CLOSE csr_valid_tax_name;
678: --
679: IF csr_valid_tax_name%notfound THEN
680: CLOSE csr_valid_tax_name;
681: hr_utility.set_message(800, 'PER_52504_INV_TAX_NAME');
682: hr_utility.raise_error;
683: END IF;
684: --
685: CLOSE csr_valid_tax_name;
686: END IF;
686: END IF;
687: --
688: END IF;
689: --
690: hr_utility.set_location('Leaving:'||l_proc, 30);
691: --
692: END chk_tax_name;
693: --
694: */
744: AND vl.descriptive_flex_context_code = p_style;
745: --
746: --
747: BEGIN
748: hr_utility.set_location('Entering:'|| l_proc, 10);
749: --
750: -- Only continue if STYLE is not null
751: --
752: IF ( p_style IS NOT NULL ) THEN
760: --
761: OPEN csr_valid_style;
762: FETCH csr_valid_style INTO l_exists;
763: --
764: hr_utility.set_location(l_proc, 20);
765: --
766: IF csr_valid_style%notfound THEN
767: CLOSE csr_valid_style;
768: hr_utility.set_message(800, 'PER_52505_INV_ADDRESS_STYLE');
764: hr_utility.set_location(l_proc, 20);
765: --
766: IF csr_valid_style%notfound THEN
767: CLOSE csr_valid_style;
768: hr_utility.set_message(800, 'PER_52505_INV_ADDRESS_STYLE');
769: hr_utility.raise_error;
770: END IF;
771: CLOSE csr_valid_style;
772: END IF;
765: --
766: IF csr_valid_style%notfound THEN
767: CLOSE csr_valid_style;
768: hr_utility.set_message(800, 'PER_52505_INV_ADDRESS_STYLE');
769: hr_utility.raise_error;
770: END IF;
771: CLOSE csr_valid_style;
772: END IF;
773: END IF;
771: CLOSE csr_valid_style;
772: END IF;
773: END IF;
774: --
775: hr_utility.set_location(' Leaving:'|| l_proc, 30);
776: END chk_style;
777: --
778: --
779: -- ---------------------------------------------------------------------------
820: AND vl.enabled_flag = 'Y';
821: --
822: --
823: BEGIN
824: hr_utility.set_location('Entering:'|| l_proc, 10);
825: --
826: -- Only continue if TIMEZONE_CODE is not null
827: --
828: IF ( p_timezone_code IS NOT NULL ) THEN
836: --
837: OPEN csr_valid_timezone;
838: FETCH csr_valid_timezone INTO l_exists;
839: --
840: hr_utility.set_location(l_proc, 20);
841: --
842: IF csr_valid_timezone%notfound THEN
843: CLOSE csr_valid_timezone;
844: hr_utility.set_message(800, 'PER_51983_INV_TZ_CODE');
840: hr_utility.set_location(l_proc, 20);
841: --
842: IF csr_valid_timezone%notfound THEN
843: CLOSE csr_valid_timezone;
844: hr_utility.set_message(800, 'PER_51983_INV_TZ_CODE');
845: hr_utility.raise_error;
846: END IF;
847: CLOSE csr_valid_timezone;
848: END IF;
841: --
842: IF csr_valid_timezone%notfound THEN
843: CLOSE csr_valid_timezone;
844: hr_utility.set_message(800, 'PER_51983_INV_TZ_CODE');
845: hr_utility.raise_error;
846: END IF;
847: CLOSE csr_valid_timezone;
848: END IF;
849: END IF;
847: CLOSE csr_valid_timezone;
848: END IF;
849: END IF;
850: --
851: hr_utility.set_location(' Leaving:'|| l_proc, 30);
852: END chk_timezone;
853: --
854: --
855: --------------------------------------------------------------------------------
951: FROM per_us_inval_locations
952: WHERE location_id = p_location_id;
953: --
954: BEGIN
955: hr_utility.set_location('Entering:'|| l_proc, 10);
956: -- get the proposal details first.
957: --
958: OPEN csr_per_all_assignments_f;
959: FETCH csr_per_all_assignments_f INTO l_exists;
958: OPEN csr_per_all_assignments_f;
959: FETCH csr_per_all_assignments_f INTO l_exists;
960: IF csr_per_all_assignments_f%found THEN
961: CLOSE csr_per_all_assignments_f;
962: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
963: hr_utility.raise_error;
964: END IF;
965: CLOSE csr_per_all_assignments_f;
966: --
959: FETCH csr_per_all_assignments_f INTO l_exists;
960: IF csr_per_all_assignments_f%found THEN
961: CLOSE csr_per_all_assignments_f;
962: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
963: hr_utility.raise_error;
964: END IF;
965: CLOSE csr_per_all_assignments_f;
966: --
967: --
964: END IF;
965: CLOSE csr_per_all_assignments_f;
966: --
967: --
968: hr_utility.set_location(l_proc, 15);
969: OPEN csr_pay_wc_funds;
970: FETCH csr_pay_wc_funds INTO l_exists;
971: IF csr_pay_wc_funds%found THEN
972: CLOSE csr_pay_wc_funds ;
969: OPEN csr_pay_wc_funds;
970: FETCH csr_pay_wc_funds INTO l_exists;
971: IF csr_pay_wc_funds%found THEN
972: CLOSE csr_pay_wc_funds ;
973: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
974: hr_utility.raise_error;
975: END IF;
976: CLOSE csr_pay_wc_funds ;
977: --
970: FETCH csr_pay_wc_funds INTO l_exists;
971: IF csr_pay_wc_funds%found THEN
972: CLOSE csr_pay_wc_funds ;
973: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
974: hr_utility.raise_error;
975: END IF;
976: CLOSE csr_pay_wc_funds ;
977: --
978: --
975: END IF;
976: CLOSE csr_pay_wc_funds ;
977: --
978: --
979: hr_utility.set_location(l_proc, 20);
980: OPEN csr_per_events;
981: FETCH csr_per_events INTO l_exists;
982: IF csr_per_events%found THEN
983: CLOSE csr_per_events;
980: OPEN csr_per_events;
981: FETCH csr_per_events INTO l_exists;
982: IF csr_per_events%found THEN
983: CLOSE csr_per_events;
984: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
985: hr_utility.raise_error;
986: END IF;
987: CLOSE csr_per_events;
988: --
981: FETCH csr_per_events INTO l_exists;
982: IF csr_per_events%found THEN
983: CLOSE csr_per_events;
984: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
985: hr_utility.raise_error;
986: END IF;
987: CLOSE csr_per_events;
988: --
989: --
986: END IF;
987: CLOSE csr_per_events;
988: --
989: --
990: hr_utility.set_location(l_proc, 25);
991: OPEN csr_per_all_vacancies;
992: FETCH csr_per_all_vacancies INTO l_exists;
993: IF csr_per_all_vacancies%found THEN
994: CLOSE csr_per_all_vacancies;
991: OPEN csr_per_all_vacancies;
992: FETCH csr_per_all_vacancies INTO l_exists;
993: IF csr_per_all_vacancies%found THEN
994: CLOSE csr_per_all_vacancies;
995: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
996: hr_utility.raise_error;
997: END IF;
998: CLOSE csr_per_all_vacancies;
999: --
992: FETCH csr_per_all_vacancies INTO l_exists;
993: IF csr_per_all_vacancies%found THEN
994: CLOSE csr_per_all_vacancies;
995: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
996: hr_utility.raise_error;
997: END IF;
998: CLOSE csr_per_all_vacancies;
999: --
1000: --
997: END IF;
998: CLOSE csr_per_all_vacancies;
999: --
1000: --
1001: hr_utility.set_location(l_proc, 30);
1002: OPEN csr_hr_all_organization_units;
1003: FETCH csr_hr_all_organization_units INTO l_exists;
1004: IF csr_hr_all_organization_units%found THEN
1005: CLOSE csr_hr_all_organization_units;
1002: OPEN csr_hr_all_organization_units;
1003: FETCH csr_hr_all_organization_units INTO l_exists;
1004: IF csr_hr_all_organization_units%found THEN
1005: CLOSE csr_hr_all_organization_units;
1006: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
1007: hr_utility.raise_error;
1008: END IF;
1009: CLOSE csr_hr_all_organization_units;
1010: --
1003: FETCH csr_hr_all_organization_units INTO l_exists;
1004: IF csr_hr_all_organization_units%found THEN
1005: CLOSE csr_hr_all_organization_units;
1006: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
1007: hr_utility.raise_error;
1008: END IF;
1009: CLOSE csr_hr_all_organization_units;
1010: --
1011: -- Added by SCNair on 30-SEP-99 (position date tracked table)
1009: CLOSE csr_hr_all_organization_units;
1010: --
1011: -- Added by SCNair on 30-SEP-99 (position date tracked table)
1012: --
1013: hr_utility.set_location(l_proc, 35);
1014: OPEN csr_hr_all_positions_f;
1015: FETCH csr_hr_all_positions_f INTO l_exists;
1016: IF csr_hr_all_positions_f%found THEN
1017: CLOSE csr_hr_all_positions_f;
1014: OPEN csr_hr_all_positions_f;
1015: FETCH csr_hr_all_positions_f INTO l_exists;
1016: IF csr_hr_all_positions_f%found THEN
1017: CLOSE csr_hr_all_positions_f;
1018: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
1019: hr_utility.raise_error;
1020: END IF;
1021: CLOSE csr_hr_all_positions_f;
1022: --
1015: FETCH csr_hr_all_positions_f INTO l_exists;
1016: IF csr_hr_all_positions_f%found THEN
1017: CLOSE csr_hr_all_positions_f;
1018: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
1019: hr_utility.raise_error;
1020: END IF;
1021: CLOSE csr_hr_all_positions_f;
1022: --
1023: --
1020: END IF;
1021: CLOSE csr_hr_all_positions_f;
1022: --
1023: --
1024: hr_utility.set_location(l_proc, 40);
1025: OPEN csr_pay_element_links_f;
1026: FETCH csr_pay_element_links_f INTO l_exists;
1027: IF csr_pay_element_links_f%found THEN
1028: CLOSE csr_pay_element_links_f;
1025: OPEN csr_pay_element_links_f;
1026: FETCH csr_pay_element_links_f INTO l_exists;
1027: IF csr_pay_element_links_f%found THEN
1028: CLOSE csr_pay_element_links_f;
1029: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
1030: hr_utility.raise_error;
1031: END IF;
1032: CLOSE csr_pay_element_links_f;
1033: --
1026: FETCH csr_pay_element_links_f INTO l_exists;
1027: IF csr_pay_element_links_f%found THEN
1028: CLOSE csr_pay_element_links_f;
1029: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
1030: hr_utility.raise_error;
1031: END IF;
1032: CLOSE csr_pay_element_links_f;
1033: --
1034: --
1031: END IF;
1032: CLOSE csr_pay_element_links_f;
1033: --
1034: --
1035: hr_utility.set_location(l_proc, 45);
1036: OPEN csr_per_salary_survey_mappings;
1037: FETCH csr_per_salary_survey_mappings INTO l_exists;
1038: IF csr_per_salary_survey_mappings%found THEN
1039: CLOSE csr_per_salary_survey_mappings;
1036: OPEN csr_per_salary_survey_mappings;
1037: FETCH csr_per_salary_survey_mappings INTO l_exists;
1038: IF csr_per_salary_survey_mappings%found THEN
1039: CLOSE csr_per_salary_survey_mappings;
1040: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
1041: hr_utility.raise_error;
1042: END IF;
1043: CLOSE csr_per_salary_survey_mappings;
1044: --
1037: FETCH csr_per_salary_survey_mappings INTO l_exists;
1038: IF csr_per_salary_survey_mappings%found THEN
1039: CLOSE csr_per_salary_survey_mappings;
1040: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
1041: hr_utility.raise_error;
1042: END IF;
1043: CLOSE csr_per_salary_survey_mappings;
1044: --
1045: --
1042: END IF;
1043: CLOSE csr_per_salary_survey_mappings;
1044: --
1045: --
1046: hr_utility.set_location(l_proc, 50);
1047: OPEN csr_hr_location_extra_info;
1048: FETCH csr_hr_location_extra_info INTO l_exists;
1049: IF csr_hr_location_extra_info%found THEN
1050: CLOSE csr_hr_location_extra_info;
1047: OPEN csr_hr_location_extra_info;
1048: FETCH csr_hr_location_extra_info INTO l_exists;
1049: IF csr_hr_location_extra_info%found THEN
1050: CLOSE csr_hr_location_extra_info;
1051: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
1052: hr_utility.raise_error;
1053: END IF;
1054: CLOSE csr_hr_location_extra_info;
1055: --
1048: FETCH csr_hr_location_extra_info INTO l_exists;
1049: IF csr_hr_location_extra_info%found THEN
1050: CLOSE csr_hr_location_extra_info;
1051: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
1052: hr_utility.raise_error;
1053: END IF;
1054: CLOSE csr_hr_location_extra_info;
1055: --
1056: --
1053: END IF;
1054: CLOSE csr_hr_location_extra_info;
1055: --
1056: --
1057: hr_utility.set_location(l_proc, 55);
1058: OPEN csr_per_us_inval_locations;
1059: FETCH csr_per_us_inval_locations INTO l_exists;
1060: IF csr_per_us_inval_locations%found THEN
1061: CLOSE csr_per_us_inval_locations;
1058: OPEN csr_per_us_inval_locations;
1059: FETCH csr_per_us_inval_locations INTO l_exists;
1060: IF csr_per_us_inval_locations%found THEN
1061: CLOSE csr_per_us_inval_locations;
1062: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
1063: hr_utility.raise_error;
1064: END IF;
1065: CLOSE csr_per_us_inval_locations;
1066: --
1059: FETCH csr_per_us_inval_locations INTO l_exists;
1060: IF csr_per_us_inval_locations%found THEN
1061: CLOSE csr_per_us_inval_locations;
1062: hr_utility.set_message(800, 'PER_52506_CHK_DEL_LOCATION');
1063: hr_utility.raise_error;
1064: END IF;
1065: CLOSE csr_per_us_inval_locations;
1066: --
1067: -- Call pre-delete validation provided by other Apps
1070: po_locations_s.po_predel_validation ( p_location_id => p_location_id);
1071: oe_location.oe_predel_validation ( p_location_id => p_location_id);
1072: qa_location.qa_predel_validation ( p_location_id => p_location_id);
1073: --
1074: hr_utility.set_location('Leaving: ' ||l_proc, 80);
1075: END chk_del_location;
1076: --
1077: --
1078: -- ----------------------------------------------------------------------------
1113: l_error EXCEPTION;
1114: l_argument VARCHAR2(30);
1115: --
1116: BEGIN
1117: hr_utility.set_location('Entering:'||l_proc, 5);
1118: --
1119: -- Only proceed with validation if a row exists for
1120: -- the current record in the HR Schema
1121: --
1122: IF NOT hr_loc_shd.api_updating
1123: (p_location_id => p_rec.location_id,
1124: p_object_version_number => p_rec.object_version_number)
1125: THEN
1126: hr_utility.set_message(800, 'HR_6153_ALL_PROCEDURE_FAIL');
1127: hr_utility.set_message_token('PROCEDURE ', l_proc);
1128: hr_utility.set_message_token('STEP ', '5');
1129: END IF;
1130: --
1123: (p_location_id => p_rec.location_id,
1124: p_object_version_number => p_rec.object_version_number)
1125: THEN
1126: hr_utility.set_message(800, 'HR_6153_ALL_PROCEDURE_FAIL');
1127: hr_utility.set_message_token('PROCEDURE ', l_proc);
1128: hr_utility.set_message_token('STEP ', '5');
1129: END IF;
1130: --
1131: hr_utility.set_location(l_proc, 10);
1124: p_object_version_number => p_rec.object_version_number)
1125: THEN
1126: hr_utility.set_message(800, 'HR_6153_ALL_PROCEDURE_FAIL');
1127: hr_utility.set_message_token('PROCEDURE ', l_proc);
1128: hr_utility.set_message_token('STEP ', '5');
1129: END IF;
1130: --
1131: hr_utility.set_location(l_proc, 10);
1132: --
1127: hr_utility.set_message_token('PROCEDURE ', l_proc);
1128: hr_utility.set_message_token('STEP ', '5');
1129: END IF;
1130: --
1131: hr_utility.set_location(l_proc, 10);
1132: --
1133: IF nvl(p_rec.business_group_id, hr_api.g_number) <>
1134: nvl (hr_loc_shd.g_old_rec.business_group_id, hr_api.g_number) THEN
1135: l_argument := 'business_group_id';
1142: (p_api_name => l_proc
1143: ,p_argument => l_argument);
1144: WHEN OTHERS THEN
1145: RAISE;
1146: hr_utility.set_location(' Leaving:'||l_proc, 12);
1147: END chk_non_updateable_args;
1148: --
1149: -- ---------------------------------------------------------------------------
1150: -- |-----------------------------< chk_df >--------------------------------|
1179: --
1180: l_proc VARCHAR2(72) := g_package||'chk_df';
1181: --
1182: BEGIN
1183: hr_utility.set_location('Entering:'||l_proc, 10);
1184: hr_utility.set_location('Style is: '||p_rec.style || ', Address 1 is: ' || p_rec.address_line_1, 10);
1185: --
1186: -- Address location - regular DF
1187: -- =============================
1180: l_proc VARCHAR2(72) := g_package||'chk_df';
1181: --
1182: BEGIN
1183: hr_utility.set_location('Entering:'||l_proc, 10);
1184: hr_utility.set_location('Style is: '||p_rec.style || ', Address 1 is: ' || p_rec.address_line_1, 10);
1185: --
1186: -- Address location - regular DF
1187: -- =============================
1188: --
1281: ,p_attribute20_value => p_rec.loc_information20
1282: );
1283: END IF;
1284: --
1285: hr_utility.set_location(l_proc, 20);
1286: --
1287: -- HR_LOCATIONS - flexible address DDF
1288: -- ===================================
1289: --
1383: ,p_attribute20_value => p_rec.attribute20
1384: );
1385: END IF;
1386: --
1387: hr_utility.set_location(l_proc, 30);
1388: --
1389: -- JG_HR_LOCATIONS - global localizations DDF
1390: -- ==========================================
1391: --
1486: );
1487: END IF;
1488: --
1489: --
1490: hr_utility.set_location(' Leaving:'||l_proc, 40);
1491: END chk_df;
1492: --
1493: -- ----------------------------------------------------------------------------
1494: -- |---------------------------< insert_validate >----------------------------|
1502: l_proc VARCHAR2(72) := g_package||'insert_validate';
1503: l_constraint_name VARCHAR2(30);
1504: --
1505: BEGIN
1506: hr_utility.set_location('Entering:'||l_proc, 5);
1507: --
1508: -- Call all supporting business operations. Mapping to the
1509: -- appropriate Business Rules in hrloc.bru is provided (where
1510: -- relevant)
1520: hr_api.validate_bus_grp_id(p_rec.business_group_id);
1521: END IF;
1522: --
1523: --
1524: hr_utility.set_location(l_proc, 10);
1525: --
1526: -- Validate inactive_date
1527: -- ======================
1528: chk_inactive_date
1531: p_location_id => p_rec.location_id
1532: );
1533: --
1534: --
1535: hr_utility.set_location(l_proc, 15);
1536: --
1537: -- Validate ship_to_loc_id_and_flags
1538: -- =================================
1539: --
1544: p_inactive_date => p_rec.inactive_date,
1545: p_business_group_id => p_rec.business_group_id,
1546: p_effective_date => p_effective_date );
1547: --
1548: hr_utility.set_location(l_proc, 35);
1549: --
1550: -- Validate receiving_site_flag
1551: -- ===============================
1552: chk_receiving_site_flag
1553: ( p_ship_to_site_flag => p_rec.ship_to_site_flag,
1554: p_receiving_site_flag => p_rec.receiving_site_flag
1555: );
1556: --
1557: hr_utility.set_location(l_proc, 40);
1558: --
1559: -- Validate designated_receiver_id
1560: -- ===============================
1561: chk_designated_receiver_id
1563: p_location_id => p_rec.location_id,
1564: p_business_group_id => p_rec.business_group_id,
1565: p_effective_date => p_effective_date
1566: );
1567: hr_utility.set_location(l_proc, 45);
1568: --
1569: -- Validate inventory_organization_id
1570: -- ==================================
1571: chk_inventory_organization_id
1574: p_location_id => p_rec.location_id,
1575: p_operating_unit_id => p_operating_unit_id
1576: );
1577: --
1578: hr_utility.set_location(l_proc, 50);
1579: /* --
1580: -- Validate tax_name
1581: -- =================
1582: --
1587: );
1588: --
1589: --
1590: */
1591: hr_utility.set_location(l_proc, 58);
1592: --
1593: -- Validate style
1594: -- ==============
1595: chk_style
1597: p_location_id => p_rec.location_id
1598: );
1599: --
1600: --
1601: hr_utility.set_location(l_proc, 59);
1602: --
1603: -- Validate timezone_code
1604: -- ======================
1605: chk_timezone
1606: (p_timezone_code => p_rec.timezone_code
1607: );
1608: --
1609: --
1610: hr_utility.set_location(l_proc, 60);
1611: --
1612: -- Validate flexfields
1613: -- ===================
1614: chk_df(p_rec => p_rec);
1613: -- ===================
1614: chk_df(p_rec => p_rec);
1615: --
1616: --
1617: hr_utility.set_location(' Leaving:'||l_proc, 65);
1618: --
1619: END insert_validate;
1620: --
1621: -- ----------------------------------------------------------------------------
1630: l_proc VARCHAR2(72) := g_package||'update_validate';
1631: l_constraint_name VARCHAR2(30);
1632: --
1633: BEGIN
1634: hr_utility.set_location('Entering:'||l_proc, 5);
1635: --
1636: -- Call all supporting business operations. Mapping to the
1637: -- appropriate Business Rules in hrloc.bru is provided.
1638: --
1644: -- be updated have not changed
1645: --
1646: chk_non_updateable_args(p_rec => p_rec);
1647: --
1648: hr_utility.set_location(l_proc, 15);
1649: --
1650: -- Validate inactive_date
1651: -- ======================
1652: chk_inactive_date
1654: p_effective_date => p_effective_date,
1655: p_location_id => p_rec.location_id
1656: );
1657: --
1658: hr_utility.set_location(l_proc, 20);
1659: --
1660: -- Validate ship_to_loc_id_and_flag
1661: -- ======================================
1662: chk_ship_to_loc_id_and_flag (
1666: p_inactive_date => p_rec.inactive_date,
1667: p_business_group_id => p_rec.business_group_id,
1668: p_effective_date => p_effective_date );
1669: --
1670: hr_utility.set_location(l_proc, 25);
1671: --
1672: -- Validate receiving_site_flag
1673: -- ===============================
1674: chk_receiving_site_flag
1675: ( p_ship_to_site_flag => p_rec.ship_to_site_flag,
1676: p_receiving_site_flag => p_rec.receiving_site_flag
1677: );
1678: --
1679: hr_utility.set_location(l_proc, 35);
1680: --
1681: -- Validate designated_receiver_id
1682: -- ===============================
1683: chk_designated_receiver_id
1686: p_business_group_id => p_rec.business_group_id,
1687: p_effective_date => p_effective_date
1688: );
1689: --
1690: hr_utility.set_location(l_proc, 45);
1691: --
1692: -- Validate inventory_organization_id
1693: -- ==================================
1694: chk_inventory_organization_id
1697: p_location_id => p_rec.location_id,
1698: p_operating_unit_id => p_operating_unit_id
1699: );
1700: --
1701: hr_utility.set_location(l_proc, 50);
1702: /*
1703: --
1704: -- Validate tax_name
1705: -- =================
1711: );
1712: --
1713: --
1714: */
1715: hr_utility.set_location(l_proc, 58);
1716: --
1717: -- Validate style
1718: -- ==============
1719: chk_style
1721: p_location_id => p_rec.location_id
1722: );
1723: --
1724: --
1725: hr_utility.set_location(l_proc, 59);
1726: --
1727: --
1728: -- Validate timezone_code
1729: -- ======================
1730: chk_timezone
1731: (p_timezone_code => p_rec.timezone_code
1732: );
1733: --
1734: hr_utility.set_location(l_proc, 60);
1735: --
1736: -- Validate flexfields
1737: -- ===================
1738: chk_df(p_rec => p_rec);
1737: -- ===================
1738: chk_df(p_rec => p_rec);
1739: --
1740: --
1741: hr_utility.set_location(' Leaving:'||l_proc, 65);
1742: --
1743: END update_validate;
1744:
1745: --
1753: --
1754: l_proc VARCHAR2(72) := g_package||'delete_validate';
1755: --
1756: BEGIN
1757: hr_utility.set_location('Entering:'||l_proc, 5);
1758: --
1759: -- Call all supporting business operations
1760: --
1761: -- Validate delete
1766: --
1767: chk_del_location
1768: (p_location_id => p_rec.location_id);
1769: --
1770: hr_utility.set_location(' Leaving:'||l_proc, 10);
1771: END delete_validate;
1772: --
1773: --
1774: END hr_loc_bus;