19: -- |----------------------< return_legislation_code >--------------------|
20: -- -----------------------------------------------------------------------
21: --
22: FUNCTION return_legislation_code
23: (p_location_id IN hr_locations.location_id%TYPE
24: ) RETURN VARCHAR2 IS
25: --
26: -- Declare local variables
27: --
34: -- legislation code.
35: --
36: cursor csr_bus_grp_id IS
37: SELECT business_group_id
38: FROM hr_locations_all
39: WHERE location_id = p_location_id;
40: --
41: -- Cursor to find legislation code. l_business_group_id
42: -- is set using csr_bus_grp_id (above).
129: -- Process Logic:
130: --
131: -- Only perform validation if SHIP_TO_LOCATION_ID is not NULL.
132: --
133: -- i) Check SHIP_TO_LOCATION_ID is valid within the HR_LOCATIONS_ALL table,
134: -- and its SHIP_TO_SITE_FLAG is 'Y'
135: --
136: -- ii) If SHIP_TO_LOCATION_ID references a location other LOCATION_ID,
137: -- ensure that the current location's SHIP_TO_SITE_FLAG is 'N'.
165: --
166: -- {End Of Comments}
167: --
168: PROCEDURE chk_ship_to_loc_id_and_flag
169: ( p_location_id IN hr_locations.location_id%TYPE,
170: p_ship_to_location_id IN OUT NOCOPY hr_locations.ship_to_location_id%TYPE,
171: p_ship_to_site_flag IN hr_locations.ship_to_site_flag%TYPE,
172: p_inactive_date IN hr_locations.inactive_date%TYPE,
173: p_business_group_id IN hr_locations.business_group_id%TYPE,
166: -- {End Of Comments}
167: --
168: PROCEDURE chk_ship_to_loc_id_and_flag
169: ( p_location_id IN hr_locations.location_id%TYPE,
170: p_ship_to_location_id IN OUT NOCOPY hr_locations.ship_to_location_id%TYPE,
171: p_ship_to_site_flag IN hr_locations.ship_to_site_flag%TYPE,
172: p_inactive_date IN hr_locations.inactive_date%TYPE,
173: p_business_group_id IN hr_locations.business_group_id%TYPE,
174: p_effective_date IN DATE )
167: --
168: PROCEDURE chk_ship_to_loc_id_and_flag
169: ( p_location_id IN hr_locations.location_id%TYPE,
170: p_ship_to_location_id IN OUT NOCOPY hr_locations.ship_to_location_id%TYPE,
171: p_ship_to_site_flag IN hr_locations.ship_to_site_flag%TYPE,
172: p_inactive_date IN hr_locations.inactive_date%TYPE,
173: p_business_group_id IN hr_locations.business_group_id%TYPE,
174: p_effective_date IN DATE )
175: IS
168: PROCEDURE chk_ship_to_loc_id_and_flag
169: ( p_location_id IN hr_locations.location_id%TYPE,
170: p_ship_to_location_id IN OUT NOCOPY hr_locations.ship_to_location_id%TYPE,
171: p_ship_to_site_flag IN hr_locations.ship_to_site_flag%TYPE,
172: p_inactive_date IN hr_locations.inactive_date%TYPE,
173: p_business_group_id IN hr_locations.business_group_id%TYPE,
174: p_effective_date IN DATE )
175: IS
176: --
169: ( p_location_id IN hr_locations.location_id%TYPE,
170: p_ship_to_location_id IN OUT NOCOPY hr_locations.ship_to_location_id%TYPE,
171: p_ship_to_site_flag IN hr_locations.ship_to_site_flag%TYPE,
172: p_inactive_date IN hr_locations.inactive_date%TYPE,
173: p_business_group_id IN hr_locations.business_group_id%TYPE,
174: p_effective_date IN DATE )
175: IS
176: --
177: l_exists VARCHAR2(1);
179: --
180: cursor csr_valid_ship_to_loc IS
181: --
182: SELECT NULL
183: FROM hr_locations_all
184: WHERE location_id = p_ship_to_location_id
185: AND ship_to_site_flag = 'Y'
186: AND nvl(inactive_date, hr_api.g_eot) >= p_effective_date
187: AND ( p_business_group_id IS NULL
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
197: --
198: hr_utility.set_location(l_proc, 20);
199: --
200: --
335: --
336: -- {End Of Comments}
337: --
338: PROCEDURE chk_receiving_site_flag
339: ( p_ship_to_site_flag IN OUT NOCOPY hr_locations.ship_to_site_flag%TYPE,
340: p_receiving_site_flag IN OUT NOCOPY hr_locations.receiving_site_flag%TYPE )
341: IS
342: --
343: l_proc VARCHAR2(72) := g_package||'chk_receiving_site_flag';
336: -- {End Of Comments}
337: --
338: PROCEDURE chk_receiving_site_flag
339: ( p_ship_to_site_flag IN OUT NOCOPY hr_locations.ship_to_site_flag%TYPE,
340: p_receiving_site_flag IN OUT NOCOPY hr_locations.receiving_site_flag%TYPE )
341: IS
342: --
343: l_proc VARCHAR2(72) := g_package||'chk_receiving_site_flag';
344: --
389: --
390: -- {End Of Comments}
391: --
392: PROCEDURE chk_designated_receiver_id
393: ( p_designated_receiver_id IN hr_locations.designated_receiver_id%TYPE,
394: p_location_id IN hr_locations.location_id%TYPE,
395: p_business_group_id IN hr_locations.business_group_id%TYPE,
396: p_effective_date IN DATE
397: )
390: -- {End Of Comments}
391: --
392: PROCEDURE chk_designated_receiver_id
393: ( p_designated_receiver_id IN hr_locations.designated_receiver_id%TYPE,
394: p_location_id IN hr_locations.location_id%TYPE,
395: p_business_group_id IN hr_locations.business_group_id%TYPE,
396: p_effective_date IN DATE
397: )
398: IS
391: --
392: PROCEDURE chk_designated_receiver_id
393: ( p_designated_receiver_id IN hr_locations.designated_receiver_id%TYPE,
394: p_location_id IN hr_locations.location_id%TYPE,
395: p_business_group_id IN hr_locations.business_group_id%TYPE,
396: p_effective_date IN DATE
397: )
398: IS
399: --
476: --
477: -- {End Of Comments}
478: --
479: PROCEDURE chk_inactive_date
480: (p_inactive_date IN hr_locations.inactive_date%TYPE,
481: p_effective_date IN DATE,
482: p_location_id IN hr_locations.location_id%TYPE)
483: IS
484: --
478: --
479: PROCEDURE chk_inactive_date
480: (p_inactive_date IN hr_locations.inactive_date%TYPE,
481: p_effective_date IN DATE,
482: p_location_id IN hr_locations.location_id%TYPE)
483: IS
484: --
485: l_proc VARCHAR2(72) := g_package||'chk_inactive_date';
486: --
531: --
532: -- {End Of Comments}
533: --
534: PROCEDURE chk_inventory_organization_id
535: ( p_inventory_organization_id IN hr_locations.inventory_organization_id%TYPE,
536: p_effective_date IN DATE,
537: p_location_id IN hr_locations.location_id%TYPE,
538: p_operating_unit_id IN NUMBER)
539: IS
533: --
534: PROCEDURE chk_inventory_organization_id
535: ( p_inventory_organization_id IN hr_locations.inventory_organization_id%TYPE,
536: p_effective_date IN DATE,
537: p_location_id IN hr_locations.location_id%TYPE,
538: p_operating_unit_id IN NUMBER)
539: IS
540: l_proc VARCHAR2(72) := g_package||'chk_inventory_organization_id';
541: l_exists VARCHAR2(1);
641: --
642: -- {End Of Comments}
643: --
644: PROCEDURE chk_tax_name
645: ( p_tax_name IN hr_locations.tax_name%TYPE,
646: p_effective_date IN DATE,
647: p_location_id IN hr_locations.location_id%TYPE)
648: IS
649: l_proc VARCHAR2(72) := g_package||'chk_tax_name';
643: --
644: PROCEDURE chk_tax_name
645: ( p_tax_name IN hr_locations.tax_name%TYPE,
646: p_effective_date IN DATE,
647: p_location_id IN hr_locations.location_id%TYPE)
648: IS
649: l_proc VARCHAR2(72) := g_package||'chk_tax_name';
650: l_exists VARCHAR2(1);
651: --
724: --
725: -- {End Of Comments}
726: --
727: PROCEDURE chk_style
728: (p_style IN hr_locations.style%TYPE,
729: p_location_id IN hr_locations.location_id%TYPE )
730: IS
731: --
732: l_proc VARCHAR2(72) := g_package||'chk_style';
725: -- {End Of Comments}
726: --
727: PROCEDURE chk_style
728: (p_style IN hr_locations.style%TYPE,
729: p_location_id IN hr_locations.location_id%TYPE )
730: IS
731: --
732: l_proc VARCHAR2(72) := g_package||'chk_style';
733: l_exists VARCHAR2(1);
806: --
807: -- {End Of Comments}
808: --
809: PROCEDURE chk_timezone
810: (p_timezone_code IN hr_locations.timezone_code%TYPE)
811: IS
812: --
813: l_proc VARCHAR2(72) := g_package||'chk_timezone';
814: l_exists VARCHAR2(1);
858: --------------------------------------------------------------------------------
859: --
860: --
861: -- Description
862: -- - Checks that the following tables do not reference the hr_locations_all
863: -- row
864: --
865: -- per_all_assigments_f
866: -- pay_wc_funds
890: -- Internal Development Use Only.
891: --
892: --
893: PROCEDURE chk_del_location
894: ( p_location_id IN hr_locations.location_id%TYPE ) IS
895: --
896: l_proc VARCHAR2(72):= g_package||'chk_del_location';
897: l_exists VARCHAR2(1);
898: l_location_id hr_locations.location_id%TYPE;
894: ( p_location_id IN hr_locations.location_id%TYPE ) IS
895: --
896: l_proc VARCHAR2(72):= g_package||'chk_del_location';
897: l_exists VARCHAR2(1);
898: l_location_id hr_locations.location_id%TYPE;
899: l_location_code hr_locations.location_code%TYPE;
900: --
901: --
902: -- Define a cursor for each table in HRMS that contains a location id column.
895: --
896: l_proc VARCHAR2(72):= g_package||'chk_del_location';
897: l_exists VARCHAR2(1);
898: l_location_id hr_locations.location_id%TYPE;
899: l_location_code hr_locations.location_code%TYPE;
900: --
901: --
902: -- Define a cursor for each table in HRMS that contains a location id column.
903: --
1283: END IF;
1284: --
1285: hr_utility.set_location(l_proc, 20);
1286: --
1287: -- HR_LOCATIONS - flexible address DDF
1288: -- ===================================
1289: --
1290: IF nvl(hr_loc_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
1291: nvl(p_rec.attribute_category, hr_api.g_varchar2) OR
1338: -- b) During insert.
1339: --
1340: hr_dflex_utility.ins_or_upd_descflex_attribs
1341: (p_appl_short_name => 'PER'
1342: ,p_descflex_name => 'HR_LOCATIONS'
1343: ,p_attribute_category => p_rec.attribute_category
1344: ,p_attribute1_name => 'ATTRIBUTE1'
1345: ,p_attribute1_value => p_rec.attribute1
1346: ,p_attribute2_name => 'ATTRIBUTE2'
1385: END IF;
1386: --
1387: hr_utility.set_location(l_proc, 30);
1388: --
1389: -- JG_HR_LOCATIONS - global localizations DDF
1390: -- ==========================================
1391: --
1392: IF nvl(hr_loc_shd.g_old_rec.global_attribute_category, hr_api.g_varchar2) <>
1393: nvl(p_rec.global_attribute_category, hr_api.g_varchar2) OR
1440: -- b) During insert.
1441: --
1442: hr_dflex_utility.ins_or_upd_descflex_attribs
1443: (p_appl_short_name => 'JG'
1444: ,p_descflex_name => 'JG_HR_LOCATIONS'
1445: ,p_attribute_category => p_rec.global_attribute_category
1446: ,p_attribute1_name => 'GLOBAL_ATTRIBUTE1'
1447: ,p_attribute1_value => p_rec.global_attribute1
1448: ,p_attribute2_name => 'GLOBAL_ATTRIBUTE2'