DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_LOC_BUS

Source


1 PACKAGE BODY hr_loc_bus AS
2   /* $Header: hrlocrhi.pkb 120.7 2006/05/15 13:34:54 srenukun noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package           VARCHAR2(33) := '  hr_loc_bus.';  -- Global package name
9 --
10 -- The following two global variables are only to be
11 -- used by the return_legislation_code function.
12 --
13 g_legislation_code  VARCHAR2(150)       DEFAULT NULL;
14 g_location_id       NUMBER              DEFAULT NULL;
15 --
16 --
17 --
18 -- -----------------------------------------------------------------------
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   --
28   l_legislation_code  VARCHAR2(150);
29   l_proc              VARCHAR2(72)  :=  'return_legislation_code';
30   l_business_group_id NUMBER(15);
31   --
32   -- Cursor to find business_group_id.  We need to know
33   -- if this is NULL before attempting to find the
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).
43   --
44   -- Want to use business_group_id as index in this case.
45   --
46   -- Previous cursor technique not helpful here because the
47   -- business_group_id is allowed to be NULL.
48   --
49     cursor csr_leg_code IS
50     SELECT legislation_code
51       FROM per_business_groups
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
61     --
62     -- The legislation code has already been found with a previous
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.
72     --
73     OPEN csr_bus_grp_id;
74     FETCH csr_bus_grp_id INTO l_business_group_id;
75     IF csr_bus_grp_id%notfound THEN
76       --
77       -- The primary key is invalid therefore we must error
78       --
79       CLOSE csr_bus_grp_id;
80       fnd_message.set_name('PER', 'HR_7220_INVALID_PRIMARY_KEY');
81       fnd_message.raise_error;
82     END IF;
83     --
84     IF l_business_group_id IS NULL THEN
85        --
86        --  If the location's business_group is NULL, we return a NULL
87        --  legislation code (This is not standard).
88        --
89        l_legislation_code := NULL;
90     ELSE
91        --
92        --  Otherwise get legislation code from database
93        --
94        OPEN csr_leg_code;
95        FETCH csr_leg_code INTO l_legislation_code;
96        IF csr_leg_code%notfound THEN
97           --
98           -- The business_group_id is invalid therefore we must error
99           --
100           CLOSE csr_leg_code;
101           fnd_message.set_name('PER', 'HR_51395_WEB_BUS_GRP_NOT_FND');
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     --
111     -- Set the global variables so the values are
112     -- available for the next call to this function
113     g_location_id      := p_location_id;
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 -- ----------------------------------------------------------------------------
123 -- |-------------------< chk_ship_to_loc_id_and_flag>------------------------|
124 -- ----------------------------------------------------------------------------
125 --
126 --  Description:
127 --    Validates SHIP_TO_LOCATION_ID and all YES/NO flags
128 --
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'.
138 --
139 --
140 --  Pre-Requisites:
141 --    None.
142 --
143 --  In Arguments:
144 --    p_location_id
145 --    p_ship_to_location_id
146 --    p_ship_to_site_flag
147 --    p_receiving_site_flag
148 --    p_inactive_date            -  required to validate ship_to_location
149 --    p_business_group_id        -  required to validate ship_to_location
150 --    p_effective_date
151 --
152 --  Post Success:
153 --    Processing continues if attributes are valid.  Also, ship_to_site_flag
154 --    and receiving_site flag may have been set.
155 --
156 --  Post Failure:
157 --    An application error is raised and processing is terminated.
158 --
159 --  Developer/Implementation notes:
160 --    Duplicate validation exists on form, so any changes made here or on form
161 --    must be dual-maintained.
162 --
163 --  Access Status:
164 --    Internal Row Handler Use Only.
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,
174       p_effective_date         IN     DATE )
175 IS
176 --
177    l_exists             VARCHAR2(1);
178    l_proc               VARCHAR2(72)  :=  g_package||'chk_ship_to_loc_id_and_flag';
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
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
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    --
203    IF (p_location_id IS NULL) THEN
204 --
205 -- **************************** Inserting ************************************
206 --
207       IF p_ship_to_location_id IS NOT NULL THEN
208       --
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
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             --
226               OPEN csr_valid_ship_to_loc;
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;
236       END IF;
237       --
238       ELSE
239     IF p_ship_to_site_flag = 'N' THEN
240       --
241       --
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         --
251 
252    ELSE
253       -- Start of fix 3224396
254       IF nvl (p_ship_to_location_id, hr_api.g_number) <>
255          nvl (hr_loc_shd.g_old_rec.ship_to_location_id, hr_api.g_number) OR
256          nvl (p_ship_to_site_flag, hr_api.g_varchar2) <>
257          nvl (hr_loc_shd.g_old_rec.ship_to_site_flag, hr_api.g_varchar2) THEN
258       -- End of 3224396
259 --
260 -- ************************** Updating with new data ***************************
261 --
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
271        --
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        --
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        --
288             OPEN csr_valid_ship_to_loc;
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;
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 -- ----------------------------------------------------------------------------
307 -- |-----------------------< chk_receiving_site_flag >------------------------|
308 -- ----------------------------------------------------------------------------
309 --
310 --  Description:
311 --    Validates RECEIVING_SITE_FLAG
312 --
313 --
314 --  Pre-Requisites:
315 --    Ship-to-site flag has been validated
316 --
317 --  In Arguments:
318 
319 --    p_ship_to_site_flag
320 --    p_receiving_site_flag
321 --
322 --  Post Success:
323 --    Processing continues if attributes are valid.  Also, ship_to_site_flag
324 --    and receiving_site flag may have been set.
325 --
326 --  Post Failure:
327 --    An application error is raised and processing is terminated.
328 --
329 --  Developer/Implementation notes:
330 --    Duplicate validation exists on form, so any changes made here or on form
331 --    must be dual-maintained.
332 --
333 --  Access Status:
334 --    Internal Row Handler Use Only.
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';
344 --
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;
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 >---------------------|
361 --  ---------------------------------------------------------------------------
362 --
363 --  Description:
364 --    Validates that a designated_receiver id exists in table per_people_f.
365 --
366 --  Pre-conditions:
367 --    None.
368 --
369 --  In Arguments:
370 --    p_designated_receiver_id
371 --    p_location_id
372 --    p_business_group_id
373 --    p_effective_date
374 --
375 --  Post Success:
376 --    If a row does exist in per_all_people_f for the given designated_receiver id,
377 --    and this person is an active employee then processing continues.
378 --
379 --  Post Failure:
380 --    If a row does not exist in per_people_f for the given designated_receiver id then
381 --    an application error will be raised and processing is terminated.
382 --
383 --  Developer/Implementation Notes:
384 --    Duplicate validation exists on form, so any changes made here
385 --    or on form must be dual-maintained
386 --
387 --  Access Status:
388 --    Internal Row Handler Use Only
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   )
398 IS
399 --
400    l_exists             VARCHAR2(1);
401    l_proc               VARCHAR2(72)  :=  g_package||'chk_designated_receiver_id';
402 --
403    cursor csr_valid_pers IS
404      SELECT NULL
405      FROM per_all_people_f
406        WHERE person_id = p_designated_receiver_id
407        AND employee_number IS NOT NULL
408        AND p_effective_date BETWEEN effective_start_date AND effective_end_date
409        AND ( p_business_group_id IS NULL
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       --
419       IF (p_location_id IS NULL) OR
420    (p_designated_receiver_id <> nvl (hr_loc_shd.g_old_rec.designated_receiver_id,
421                  hr_api.g_number) )
422       THEN
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;
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 --
447 -- ----------------------------------------------------------------------------
448 -- |--------------------------< chk_inactive_date>----------------------------|
449 -- ----------------------------------------------------------------------------
450 --
451 --  Description:
452 --    Validates that inactive_date is greater than or equal to session_date
453 --
454 --  Pre-conditions:
455 --    None.
456 --
457 --  In Arguments:
458 --    p_inactive_date
459 --    p_effective_date
460 --    p_location_id
461 --
462 --  Post Success:
463 --    If inactive date is greater than or equal to session date then
464 --    normal processing continues
465 --
466 --  Post Failure:
467 --    If the inactive date is less than the session date then an application
468 --    error will be raised and processing is terminated.
469 --
470 --  Developer/Implementation Notes:
471 --    Duplicate validation exists on form, so any changes made here
472 --    or on form must be dual-maintained
473 --
474 --  Access Status:
475 --    Internal Row Handler Use Only
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 --
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
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 -- ----------------------------------------------------------------------------
502 -- |-------------------< chk_inventory_organization_id >----------------------|
503 -- ----------------------------------------------------------------------------
504 --
505 --  Description:
506 --    Validates the INVENTORY_ORGANIZATION_ID points to a valid inventory
507 --    organization with the use of a select statement.
508 --
509 --  Pre-conditions:
510 --    None.
511 --
512 --  In Arguments:
513 --    p_inventory_organization_id
514 --    p_effective_date
515 --    p_location_id
516 --
517 --  Post Success:
518 --    If the inventory_organization_id is valid then
519 --    normal processing continues
520 --
521 --  Post Failure:
522 --    If the inventory_organization_id is invalid then an application
523 --    error will be raised and processing is terminated.
524 --
525 --  Developer/Implementation Notes:
526 --    Duplicate validation exists on form, so any changes made here
527 --    or on form must be dual-maintained
528 --
529 --  Access Status:
530 --    Internal Row Handler Use Only
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
540    l_proc           VARCHAR2(72)  :=  g_package||'chk_inventory_organization_id';
541    l_exists         VARCHAR2(1);
542 
543    dummy            NUMBER := 2;
544    dummy2           NUMBER := 1;
545 --
546 --
547    cur BINARY_INTEGER;
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 --
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);
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
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);
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);
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 
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;
602     END;
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 /*
612 -- ----------------------------------------------------------------------------
613 -- |-------------------------< chk_tax_name >---------------------------------|
614 -- ----------------------------------------------------------------------------
615 --
616 --  Description:
617 --    Validates that TAX_NAME is valid within the active tax codes.
618 --
619 --  Pre-conditions:
620 --    None.
621 --
622 --  In Arguments:
623 --    p_tax_name
624 --    p_effective_date
625 --    p_location_id
626 --
627 --  Post Success:
628 --    If the tax_name attribute is valid then
629 --    normal processing continues
630 --
631 --  Post Failure:
632 --    If the tax_name attribute is invalid then an application
633 --    error will be raised and processing is terminated.
634 --
635 --  Developer/Implementation Notes:
636 --    Duplicate validation exists on form, so any changes made here
637 --    or on form must be dual-maintained.
638 --
639 --  Access Status:
640 --    Internal Row Table Handler Use Only.
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';
650    l_exists         VARCHAR2(1);
651 --
652    cursor csr_valid_tax_name IS
653      SELECT NULL
654         FROM ap_tax_codes
655         WHERE nvl(inactive_date, hr_api.g_eot ) >= p_effective_date
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
665    --
666    -- Only continue if tax_name is not null
667    --p_tax_name
668       IF ( p_tax_name <> nvl (hr_loc_shd.g_old_rec.tax_name, hr_api.g_varchar2) )
669    OR (p_location_id IS NULL)
670       --
671       --  Only validate if inserting, or updating with new value
672       --
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');
682        hr_utility.raise_error;
683     END IF;
684     --
685     CLOSE csr_valid_tax_name;
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 */
695 --
696 --  ---------------------------------------------------------------------------
697 --  |-----------------------------<  chk_style >------------------------------|
698 --  ---------------------------------------------------------------------------
699 --
700 --  Description:
701 --    Validates STYLE column using select statement.
702 --
703 --  Pre-conditions:
704 --    None
705 --
706 --  In Arguments:
707 --    p_style
708 --    p_location_id
709 --
710 --  Post Success:
711 --    If the style attribute is valid then
712 --    normal processing continues
713 --
714 --  Post Failure:
715 --    If the style attribute is invalid then an application
716 --    error will be raised and processing is terminated.
717 --
718 --  Developer/Implementation Notes:
719 --    Duplicate validation exists on form, so any changes made here
720 --    or on form must be dual-maintained.
721 --
722 --  Access Status:
723 --    Internal Row Handler Use Only.
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';
733    l_exists         VARCHAR2(1);
734 --
735    -- Bug fix 3649137.
736    -- cursor modified to improve performance.
737 
738    cursor csr_valid_style IS
739      SELECT NULL
740         FROM fnd_descr_flex_contexts_vl vl
741         WHERE vl.descriptive_flexfield_name ='Address Location'
742            AND vl.enabled_flag = 'Y'
743 	   AND vl.application_id = 800
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
753       --
754       --  Only continue if STYLE is not null
755       --
756       IF ( nvl(hr_loc_shd.g_old_rec.style, hr_api.g_varchar2) <> p_style)
757    OR (p_location_id IS NULL ) THEN
758     --
759     -- Only validate if inserting, or updating with new value
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');
769        hr_utility.raise_error;
770     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 --  ---------------------------------------------------------------------------
780 --  |--------------------------<  chk_timezone >------------------------------|
781 --  ---------------------------------------------------------------------------
782 --
783 --  Description:
784 --    Validates TIMEZONE_CODE column using select statement.
785 --
786 --  Pre-conditions:
787 --    None
788 --
789 --  In Arguments:
790 --    p_timezone
791 --
792 --  Post Success:
793 --    If the timezone_code attribute is valid then
794 --    normal processing continues
795 --
796 --  Post Failure:
797 --    If the timezone_code attribute is invalid then an application
798 --    error will be raised and processing is terminated.
799 --
800 --  Developer/Implementation Notes:
801 --    Duplicate validation exists on Location form, so any changes
802 --    made here or on form must be dual-maintained.
803 --
804 --  Access Status:
805 --    Internal Row Handler Use Only.
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);
815 --
816    cursor csr_valid_timezone IS
817      SELECT NULL
818         FROM fnd_timezones_vl vl
819         WHERE vl.timezone_code = p_timezone_code
820           AND vl.enabled_flag = 'Y';
821 --
825 --
822 --
823 BEGIN
824   hr_utility.set_location('Entering:'|| l_proc, 10);
826 -- Only continue if TIMEZONE_CODE is not null
827 --
828    IF ( p_timezone_code IS NOT NULL ) THEN
829       --
830       --  Only continue if TIMEZONE_CODE is not null
831       --
832       IF ( nvl(hr_loc_shd.g_old_rec.timezone_code, hr_api.g_varchar2)
833                    <> p_timezone_code) THEN
834     --
835     -- Only validate if inserting, or updating with new value
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');
845        hr_utility.raise_error;
846     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 --------------------------------------------------------------------------------
856 --------------------------------------------------------------------------------
857 --|-------------------------< chk_del_location >-------------------------------|
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
867 --           per_events
868 --           per_all_vacancies
869 --           hr_all_organization_units
870 --           hr_all_positions_f (date tracked position table)
871 --           pay_element_links_f
872 --           per_salary_survey_mappings
873 --           hr_location_extra_info
874 --           per_us_inval_locations
875 --
876 --
877 --  Pre-conditions:
878 --    None
879 --
880 --  In Arguments:
881 --     p_location_id
882 --
883 --  Post Success:
884 --    The record is deleted from the database.
885 --
886 --  Post Failure:
887 --    An application error will be raised and processing is terminated.
888 --
889 --  Access Status:
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;
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    --
904    cursor csr_per_all_assignments_f IS
905    SELECT NULL
906      FROM  per_all_assignments_f
907      WHERE location_id = p_location_id;
908 --
909    cursor csr_pay_wc_funds IS
910    SELECT NULL
911      FROM  pay_wc_funds
912      WHERE location_id = p_location_id;
913 --
914    cursor csr_per_events IS
915    SELECT NULL
916      FROM  per_events
917      WHERE location_id = p_location_id;
918  --
919    cursor csr_per_all_vacancies IS
920    SELECT NULL
921      FROM  per_all_vacancies
922      WHERE location_id = p_location_id;
923  --
924    cursor csr_hr_all_organization_units IS
925    SELECT NULL
926      FROM  hr_all_organization_units
927      WHERE location_id = p_location_id;
928 --
929    cursor csr_hr_all_positions_f IS
930    SELECT NULL
931      FROM  hr_all_positions_f
932      WHERE location_id = p_location_id;
933 --
934    cursor csr_pay_element_links_f IS
935    SELECT NULL
936      FROM  pay_element_links_f
937      WHERE location_id = p_location_id;
938  --
939    cursor csr_per_salary_survey_mappings IS
940    SELECT NULL
941      FROM  per_salary_survey_mappings
942      WHERE location_id = p_location_id;
943 
944    cursor csr_hr_location_extra_info IS
945    SELECT NULL
946      FROM  hr_location_extra_info
947      WHERE location_id = p_location_id;
948 --
949    cursor csr_per_us_inval_locations IS
950    SELECT NULL
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;
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   --
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 ;
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   --
982   IF csr_per_events%found THEN
979   hr_utility.set_location(l_proc, 20);
980   OPEN csr_per_events;
981   FETCH csr_per_events INTO l_exists;
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   --
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;
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   --
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;
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)
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;
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   --
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;
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   --
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;
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   --
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;
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   --
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;
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
1068   --
1069   inv_location.inv_predel_validation  ( p_location_id => p_location_id);
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 -- ----------------------------------------------------------------------------
1079 -- |-----------------------< chk_non_updateable_args >------------------------|
1080 -- ----------------------------------------------------------------------------
1081 -- {Start Of Comments}
1082 --
1083 -- Description:
1084 --   This procedure is used to ensure that non updateable attributes have
1085 --   not been updated. If an attribute has been updated an error is generated.
1086 --
1087 -- Pre Conditions:
1088 --   g_old_rec has been populated with details of the values currently in
1089 --   the database.
1090 --
1091 -- In Arguments:
1092 --   p_rec has been populated with the updated values the user would like the
1093 --   record set to.
1094 --
1095 -- Post Success:
1096 --   Processing continues if all the non updateable attributes have not
1097 --   changed.
1098 --
1099 -- Post Failure:
1100 --   An application error is raised if any of the non updatable attributes
1101 --   (business_group_id, person_id, location_id, primary_flag or style)
1102 --   have been altered.
1103 --
1104 -- Access Status:
1105 --    Internal Row Handler Use Only
1106 --
1107 -- {End Of Comments}
1108 -- ---------------------------------------------------------------------------
1109 --
1110 PROCEDURE chk_non_updateable_args(p_rec IN hr_loc_shd.g_rec_type) IS
1111 --
1112   l_proc     VARCHAR2(72) := g_package||'chk_non_updateable_args';
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   --
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';
1136      RAISE l_error;
1137   END IF;
1138   --
1139   EXCEPTION
1140     WHEN l_error THEN
1141        hr_api.argument_changed_error
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  >--------------------------------|
1151 -- ---------------------------------------------------------------------------
1152 --
1153 -- Description:
1154 --   Validates the all Descriptive Flexfield values.
1155 --
1156 -- Pre-conditions:
1157 --   All other columns have been validated. Must be called as the
1158 --   last step from insert_validate and update_validate.
1159 --
1160 -- In Arguments:
1161 --   p_rec
1162 --
1163 -- Post Success:
1164 --   If the Descriptive Flexfield structure column and data values are
1165 --   all valid this procedure will end normally and processing will
1166 --   continue.
1167 --
1168 -- Post Failure:
1169 --   If the Descriptive Flexfield structure column value or any of
1170 --   the data values are invalid then an application error is raised as
1171 --   a PL/SQL exception.
1172 --
1173 -- Access Status:
1174 --   Internal Row Handler Use Only.
1175 --
1176 -- ---------------------------------------------------------------------------
1177 PROCEDURE chk_df
1178   (p_rec IN hr_loc_shd.g_rec_type) IS
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   -- =============================
1188   --
1189   IF nvl(hr_loc_shd.g_old_rec.style, hr_api.g_varchar2) <>
1190      nvl(p_rec.style, hr_api.g_varchar2) OR
1191      nvl(hr_loc_shd.g_old_rec.address_line_1, hr_api.g_varchar2) <>
1192      nvl(p_rec.address_line_1, hr_api.g_varchar2) OR
1193      nvl(hr_loc_shd.g_old_rec.address_line_2, hr_api.g_varchar2) <>
1194      nvl(p_rec.address_line_2, hr_api.g_varchar2) OR
1195      nvl(hr_loc_shd.g_old_rec.address_line_3, hr_api.g_varchar2) <>
1196      nvl(p_rec.address_line_3, hr_api.g_varchar2) OR
1197      nvl(hr_loc_shd.g_old_rec.country, hr_api.g_varchar2) <>
1198      nvl(p_rec.country, hr_api.g_varchar2) OR
1199      nvl(hr_loc_shd.g_old_rec.postal_code, hr_api.g_varchar2) <>
1200      nvl(p_rec.postal_code, hr_api.g_varchar2) OR
1201      nvl(hr_loc_shd.g_old_rec.region_1, hr_api.g_varchar2) <>
1202      nvl(p_rec.region_1, hr_api.g_varchar2) OR
1203      nvl(hr_loc_shd.g_old_rec.region_2, hr_api.g_varchar2) <>
1204      nvl(p_rec.region_2, hr_api.g_varchar2) OR
1205      nvl(hr_loc_shd.g_old_rec.region_3, hr_api.g_varchar2) <>
1206      nvl(p_rec.region_3, hr_api.g_varchar2) OR
1207      nvl(hr_loc_shd.g_old_rec.telephone_number_1, hr_api.g_varchar2) <>
1208      nvl(p_rec.telephone_number_1, hr_api.g_varchar2) OR
1209      nvl(hr_loc_shd.g_old_rec.telephone_number_2, hr_api.g_varchar2) <>
1210      nvl(p_rec.telephone_number_2, hr_api.g_varchar2) OR
1211      nvl(hr_loc_shd.g_old_rec.telephone_number_3, hr_api.g_varchar2) <>
1212      nvl(p_rec.telephone_number_3, hr_api.g_varchar2) OR
1213      nvl(hr_loc_shd.g_old_rec.town_or_city, hr_api.g_varchar2) <>
1214      nvl(p_rec.town_or_city, hr_api.g_varchar2) OR
1215      nvl(hr_loc_shd.g_old_rec.loc_information13, hr_api.g_varchar2) <>
1216      nvl(p_rec.loc_information13, hr_api.g_varchar2) OR
1217      nvl(hr_loc_shd.g_old_rec.loc_information14, hr_api.g_varchar2) <>
1218      nvl(p_rec.loc_information14, hr_api.g_varchar2) OR
1219      nvl(hr_loc_shd.g_old_rec.loc_information15, hr_api.g_varchar2) <>
1220      nvl(p_rec.loc_information15, hr_api.g_varchar2) OR
1221      nvl(hr_loc_shd.g_old_rec.loc_information16, hr_api.g_varchar2) <>
1222      nvl(p_rec.loc_information16, hr_api.g_varchar2) OR
1223      nvl(hr_loc_shd.g_old_rec.loc_information17, hr_api.g_varchar2) <>
1224      nvl(p_rec.loc_information17, hr_api.g_varchar2) OR
1225      nvl(hr_loc_shd.g_old_rec.loc_information18, hr_api.g_varchar2) <>
1226      nvl(p_rec.loc_information18, hr_api.g_varchar2) OR
1227      nvl(hr_loc_shd.g_old_rec.loc_information19, hr_api.g_varchar2) <>
1228      nvl(p_rec.loc_information19, hr_api.g_varchar2) OR
1229      nvl(hr_loc_shd.g_old_rec.loc_information20, hr_api.g_varchar2) <>
1233     -- Only execute the validation if absolutely necessary:
1230      nvl(p_rec.loc_information20, hr_api.g_varchar2) OR
1231     (p_rec.location_id IS NULL)
1232   THEN
1234     -- a) During update, the structure column value or any
1235     --    of the attribute values have actually changed.
1236     -- b) During insert.
1237     --
1238     hr_dflex_utility.ins_or_upd_descflex_attribs
1239       (p_appl_short_name    => 'PER'
1240       ,p_descflex_name      => 'Address Location'
1241       ,p_attribute_category => p_rec.style
1242       ,p_attribute1_name    => 'ADDRESS_LINE_1'
1243       ,p_attribute1_value   => p_rec.address_line_1
1244       ,p_attribute2_name    => 'ADDRESS_LINE_2'
1245       ,p_attribute2_value   => p_rec.address_line_2
1246       ,p_attribute3_name    => 'ADDRESS_LINE_3'
1247       ,p_attribute3_value   => p_rec.address_line_3
1248       ,p_attribute4_name    => 'COUNTRY'
1249       ,p_attribute4_value   => p_rec.country
1250       ,p_attribute5_name    => 'POSTAL_CODE'
1251       ,p_attribute5_value   => p_rec.postal_code
1252       ,p_attribute6_name    => 'REGION_1'
1253       ,p_attribute6_value   => p_rec.region_1
1254       ,p_attribute7_name    => 'REGION_2'
1255       ,p_attribute7_value   => p_rec.region_2
1256       ,p_attribute8_name    => 'REGION_3'
1257       ,p_attribute8_value   => p_rec.region_3
1258       ,p_attribute9_name    => 'TELEPHONE_NUMBER_1'
1259       ,p_attribute9_value   => p_rec.telephone_number_1
1260       ,p_attribute10_name   => 'TELEPHONE_NUMBER_2'
1261       ,p_attribute10_value  => p_rec.telephone_number_2
1262       ,p_attribute11_name   => 'TELEPHONE_NUMBER_3'
1263       ,p_attribute11_value  => p_rec.telephone_number_3
1264       ,p_attribute12_name   => 'TOWN_OR_CITY'
1265       ,p_attribute12_value  => p_rec.town_or_city
1266       ,p_attribute13_name   => 'LOC_INFORMATION13'
1267       ,p_attribute13_value  => p_rec.loc_information13
1268       ,p_attribute14_name   => 'LOC_INFORMATION14'
1269       ,p_attribute14_value  => p_rec.loc_information14
1270       ,p_attribute15_name   => 'LOC_INFORMATION15'
1271       ,p_attribute15_value  => p_rec.loc_information15
1272       ,p_attribute16_name   => 'LOC_INFORMATION16'
1273       ,p_attribute16_value  => p_rec.loc_information16
1274       ,p_attribute17_name   => 'LOC_INFORMATION17'
1275       ,p_attribute17_value  => p_rec.loc_information17
1276       ,p_attribute18_name   => 'LOC_INFORMATION18'
1277       ,p_attribute18_value  => p_rec.loc_information18
1278       ,p_attribute19_name   => 'LOC_INFORMATION19'
1279       ,p_attribute19_value  => p_rec.loc_information19
1280       ,p_attribute20_name   => 'LOC_INFORMATION20'
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   --
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
1292      nvl(hr_loc_shd.g_old_rec.attribute1, hr_api.g_varchar2) <>
1293      nvl(p_rec.attribute1, hr_api.g_varchar2) OR
1294      nvl(hr_loc_shd.g_old_rec.attribute2, hr_api.g_varchar2) <>
1295      nvl(p_rec.attribute2, hr_api.g_varchar2) OR
1296      nvl(hr_loc_shd.g_old_rec.attribute3, hr_api.g_varchar2) <>
1297      nvl(p_rec.attribute3, hr_api.g_varchar2) OR
1298      nvl(hr_loc_shd.g_old_rec.attribute4, hr_api.g_varchar2) <>
1299      nvl(p_rec.attribute4, hr_api.g_varchar2) OR
1300      nvl(hr_loc_shd.g_old_rec.attribute5, hr_api.g_varchar2) <>
1301      nvl(p_rec.attribute5, hr_api.g_varchar2) OR
1302      nvl(hr_loc_shd.g_old_rec.attribute6, hr_api.g_varchar2) <>
1303      nvl(p_rec.attribute6, hr_api.g_varchar2) OR
1304      nvl(hr_loc_shd.g_old_rec.attribute7, hr_api.g_varchar2) <>
1305      nvl(p_rec.attribute7, hr_api.g_varchar2) OR
1306      nvl(hr_loc_shd.g_old_rec.attribute8, hr_api.g_varchar2) <>
1307      nvl(p_rec.attribute8, hr_api.g_varchar2) OR
1308      nvl(hr_loc_shd.g_old_rec.attribute9, hr_api.g_varchar2) <>
1309      nvl(p_rec.attribute9, hr_api.g_varchar2) OR
1310      nvl(hr_loc_shd.g_old_rec.attribute10, hr_api.g_varchar2) <>
1311      nvl(p_rec.attribute10, hr_api.g_varchar2) OR
1312      nvl(hr_loc_shd.g_old_rec.attribute11, hr_api.g_varchar2) <>
1313      nvl(p_rec.attribute11, hr_api.g_varchar2) OR
1314      nvl(hr_loc_shd.g_old_rec.attribute12, hr_api.g_varchar2) <>
1315      nvl(p_rec.attribute12, hr_api.g_varchar2) OR
1316      nvl(hr_loc_shd.g_old_rec.attribute13, hr_api.g_varchar2) <>
1317      nvl(p_rec.attribute13, hr_api.g_varchar2) OR
1318      nvl(hr_loc_shd.g_old_rec.attribute14, hr_api.g_varchar2) <>
1319      nvl(p_rec.attribute14, hr_api.g_varchar2) OR
1320      nvl(hr_loc_shd.g_old_rec.attribute15, hr_api.g_varchar2) <>
1321      nvl(p_rec.attribute15, hr_api.g_varchar2) OR
1322      nvl(hr_loc_shd.g_old_rec.attribute16, hr_api.g_varchar2) <>
1323      nvl(p_rec.attribute16, hr_api.g_varchar2) OR
1324      nvl(hr_loc_shd.g_old_rec.attribute17, hr_api.g_varchar2) <>
1325      nvl(p_rec.attribute17, hr_api.g_varchar2) OR
1326      nvl(hr_loc_shd.g_old_rec.attribute18, hr_api.g_varchar2) <>
1327      nvl(p_rec.attribute18, hr_api.g_varchar2) OR
1328      nvl(hr_loc_shd.g_old_rec.attribute19, hr_api.g_varchar2) <>
1329      nvl(p_rec.attribute19, hr_api.g_varchar2) OR
1330      nvl(hr_loc_shd.g_old_rec.attribute20, hr_api.g_varchar2) <>
1331      nvl(p_rec.attribute20, hr_api.g_varchar2)
1332   OR
1333      (p_rec.location_id IS NULL)
1334   THEN
1335     -- Only execute the validation if absolutely necessary:
1336     -- a) During update, the structure column value or any
1337     --    of the attribute values have actually changed.
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'
1347       ,p_attribute2_value   => p_rec.attribute2
1348       ,p_attribute3_name    => 'ATTRIBUTE3'
1349       ,p_attribute3_value   => p_rec.attribute3
1350       ,p_attribute4_name    => 'ATTRIBUTE4'
1351       ,p_attribute4_value   => p_rec.attribute4
1352       ,p_attribute5_name    => 'ATTRIBUTE5'
1353       ,p_attribute5_value   => p_rec.attribute5
1354       ,p_attribute6_name    => 'ATTRIBUTE6'
1355       ,p_attribute6_value   => p_rec.attribute6
1356       ,p_attribute7_name    => 'ATTRIBUTE7'
1357       ,p_attribute7_value   => p_rec.attribute7
1358       ,p_attribute8_name    => 'ATTRIBUTE8'
1359       ,p_attribute8_value   => p_rec.attribute8
1360       ,p_attribute9_name    => 'ATTRIBUTE9'
1361       ,p_attribute9_value   => p_rec.attribute9
1362       ,p_attribute10_name   => 'ATTRIBUTE10'
1363       ,p_attribute10_value  => p_rec.attribute10
1364       ,p_attribute11_name   => 'ATTRIBUTE11'
1365       ,p_attribute11_value  => p_rec.attribute11
1366       ,p_attribute12_name   => 'ATTRIBUTE12'
1367       ,p_attribute12_value  => p_rec.attribute12
1368       ,p_attribute13_name   => 'ATTRIBUTE13'
1369       ,p_attribute13_value  => p_rec.attribute13
1370       ,p_attribute14_name   => 'ATTRIBUTE14'
1371       ,p_attribute14_value  => p_rec.attribute14
1372       ,p_attribute15_name   => 'ATTRIBUTE15'
1373       ,p_attribute15_value  => p_rec.attribute15
1374       ,p_attribute16_name   => 'ATTRIBUTE16'
1375       ,p_attribute16_value  => p_rec.attribute16
1376       ,p_attribute17_name   => 'ATTRIBUTE17'
1377       ,p_attribute17_value  => p_rec.attribute17
1378       ,p_attribute18_name   => 'ATTRIBUTE18'
1379       ,p_attribute18_value  => p_rec.attribute18
1380       ,p_attribute19_name   => 'ATTRIBUTE19'
1381       ,p_attribute19_value  => p_rec.attribute19
1382       ,p_attribute20_name   => 'ATTRIBUTE20'
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   --
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
1394      nvl(hr_loc_shd.g_old_rec.global_attribute1, hr_api.g_varchar2) <>
1395      nvl(p_rec.global_attribute1, hr_api.g_varchar2) OR
1396      nvl(hr_loc_shd.g_old_rec.global_attribute2, hr_api.g_varchar2) <>
1397      nvl(p_rec.global_attribute2, hr_api.g_varchar2) OR
1398      nvl(hr_loc_shd.g_old_rec.global_attribute3, hr_api.g_varchar2) <>
1399      nvl(p_rec.global_attribute3, hr_api.g_varchar2) OR
1400      nvl(hr_loc_shd.g_old_rec.global_attribute4, hr_api.g_varchar2) <>
1401      nvl(p_rec.global_attribute4, hr_api.g_varchar2) OR
1402      nvl(hr_loc_shd.g_old_rec.global_attribute5, hr_api.g_varchar2) <>
1403      nvl(p_rec.global_attribute5, hr_api.g_varchar2) OR
1404      nvl(hr_loc_shd.g_old_rec.global_attribute6, hr_api.g_varchar2) <>
1405      nvl(p_rec.global_attribute6, hr_api.g_varchar2) OR
1406      nvl(hr_loc_shd.g_old_rec.global_attribute7, hr_api.g_varchar2) <>
1407      nvl(p_rec.global_attribute7, hr_api.g_varchar2) OR
1408      nvl(hr_loc_shd.g_old_rec.global_attribute8, hr_api.g_varchar2) <>
1409      nvl(p_rec.global_attribute8, hr_api.g_varchar2) OR
1410      nvl(hr_loc_shd.g_old_rec.global_attribute9, hr_api.g_varchar2) <>
1411      nvl(p_rec.global_attribute9, hr_api.g_varchar2) OR
1412      nvl(hr_loc_shd.g_old_rec.global_attribute10, hr_api.g_varchar2) <>
1413      nvl(p_rec.global_attribute10, hr_api.g_varchar2) OR
1414      nvl(hr_loc_shd.g_old_rec.global_attribute11, hr_api.g_varchar2) <>
1415      nvl(p_rec.global_attribute11, hr_api.g_varchar2) OR
1416      nvl(hr_loc_shd.g_old_rec.global_attribute12, hr_api.g_varchar2) <>
1417      nvl(p_rec.global_attribute12, hr_api.g_varchar2) OR
1418      nvl(hr_loc_shd.g_old_rec.global_attribute13, hr_api.g_varchar2) <>
1419      nvl(p_rec.global_attribute13, hr_api.g_varchar2) OR
1420      nvl(hr_loc_shd.g_old_rec.global_attribute14, hr_api.g_varchar2) <>
1421      nvl(p_rec.global_attribute14, hr_api.g_varchar2) OR
1422      nvl(hr_loc_shd.g_old_rec.global_attribute15, hr_api.g_varchar2) <>
1423      nvl(p_rec.global_attribute15, hr_api.g_varchar2) OR
1424      nvl(hr_loc_shd.g_old_rec.global_attribute16, hr_api.g_varchar2) <>
1425      nvl(p_rec.global_attribute16, hr_api.g_varchar2) OR
1426      nvl(hr_loc_shd.g_old_rec.global_attribute17, hr_api.g_varchar2) <>
1427      nvl(p_rec.global_attribute17, hr_api.g_varchar2) OR
1428      nvl(hr_loc_shd.g_old_rec.global_attribute18, hr_api.g_varchar2) <>
1429      nvl(p_rec.global_attribute18, hr_api.g_varchar2) OR
1430      nvl(hr_loc_shd.g_old_rec.global_attribute19, hr_api.g_varchar2) <>
1431      nvl(p_rec.global_attribute19, hr_api.g_varchar2) OR
1432      nvl(hr_loc_shd.g_old_rec.global_attribute20, hr_api.g_varchar2) <>
1433      nvl(p_rec.global_attribute20, hr_api.g_varchar2)
1437     -- Only execute the validation if absolutely necessary:
1434   OR
1435      (p_rec.location_id IS NULL)
1436   THEN
1438     -- a) During update, the structure column value or any
1439     --    of the attribute values have actually changed.
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'
1449       ,p_attribute2_value   => p_rec.global_attribute2
1450       ,p_attribute3_name    => 'GLOBAL_ATTRIBUTE3'
1451       ,p_attribute3_value   => p_rec.global_attribute3
1452       ,p_attribute4_name    => 'GLOBAL_ATTRIBUTE4'
1453       ,p_attribute4_value   => p_rec.global_attribute4
1454       ,p_attribute5_name    => 'GLOBAL_ATTRIBUTE5'
1455       ,p_attribute5_value   => p_rec.global_attribute5
1456       ,p_attribute6_name    => 'GLOBAL_ATTRIBUTE6'
1457       ,p_attribute6_value   => p_rec.global_attribute6
1458       ,p_attribute7_name    => 'GLOBAL_ATTRIBUTE7'
1459       ,p_attribute7_value   => p_rec.global_attribute7
1460       ,p_attribute8_name    => 'GLOBAL_ATTRIBUTE8'
1461       ,p_attribute8_value   => p_rec.global_attribute8
1462       ,p_attribute9_name    => 'GLOBAL_ATTRIBUTE9'
1463       ,p_attribute9_value   => p_rec.global_attribute9
1464       ,p_attribute10_name   => 'GLOBAL_ATTRIBUTE10'
1465       ,p_attribute10_value  => p_rec.global_attribute10
1466       ,p_attribute11_name   => 'GLOBAL_ATTRIBUTE11'
1467       ,p_attribute11_value  => p_rec.global_attribute11
1468       ,p_attribute12_name   => 'GLOBAL_ATTRIBUTE12'
1469       ,p_attribute12_value  => p_rec.global_attribute12
1470       ,p_attribute13_name   => 'GLOBAL_ATTRIBUTE13'
1471       ,p_attribute13_value  => p_rec.global_attribute13
1472       ,p_attribute14_name   => 'GLOBAL_ATTRIBUTE14'
1473       ,p_attribute14_value  => p_rec.global_attribute14
1474       ,p_attribute15_name   => 'GLOBAL_ATTRIBUTE15'
1475       ,p_attribute15_value  => p_rec.global_attribute15
1476       ,p_attribute16_name   => 'GLOBAL_ATTRIBUTE16'
1477       ,p_attribute16_value  => p_rec.global_attribute16
1478       ,p_attribute17_name   => 'GLOBAL_ATTRIBUTE17'
1479       ,p_attribute17_value  => p_rec.global_attribute17
1480       ,p_attribute18_name   => 'GLOBAL_ATTRIBUTE18'
1481       ,p_attribute18_value  => p_rec.global_attribute18
1482       ,p_attribute19_name   => 'GLOBAL_ATTRIBUTE19'
1483       ,p_attribute19_value  => p_rec.global_attribute19
1484       ,p_attribute20_name   => 'GLOBAL_ATTRIBUTE20'
1485       ,p_attribute20_value  => p_rec.global_attribute20
1486       );
1487   END IF;
1488 --
1489 --
1490   hr_utility.set_location(' Leaving:'||l_proc, 40);
1491 END chk_df;
1492 --
1493 -- ----------------------------------------------------------------------------
1494 -- |---------------------------< insert_validate >----------------------------|
1495 -- ----------------------------------------------------------------------------
1496 PROCEDURE insert_validate
1497   (  p_rec IN OUT NOCOPY hr_loc_shd.g_rec_type,
1498      p_effective_date IN DATE,
1499      p_operating_unit_id IN NUMBER)
1500 IS
1501 --
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)
1511   --
1512   -- Validate business_group_id (only if set)
1513   -- ==========================
1514   --
1515   -- Note:  There are no calls to lookup validation procedures in this row handler
1516   --        at present.  If this changes, "CLIENT_INFO" may require setting - see
1517   --        API strategy page 12-29 onwards.
1518   --
1519   IF p_rec.business_group_id IS NOT NULL THEN
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
1529     (p_inactive_date              =>    p_rec.inactive_date,
1530      p_effective_date             =>    p_effective_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   --
1540   chk_ship_to_loc_id_and_flag (
1541     p_location_id                 =>   p_rec.location_id,
1542     p_ship_to_location_id         =>   p_rec.ship_to_location_id,
1543     p_ship_to_site_flag           =>   p_rec.ship_to_site_flag,
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,
1557   hr_utility.set_location(l_proc, 40);
1554       p_receiving_site_flag         =>   p_rec.receiving_site_flag
1555     );
1556   --
1558   --
1559   -- Validate designated_receiver_id
1560   -- ===============================
1561   chk_designated_receiver_id
1562     (p_designated_receiver_id     =>    p_rec.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
1572     (p_inventory_organization_id    =>    p_rec.inventory_organization_id,
1573      p_effective_date               =>    p_effective_date,
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   --
1583   chk_tax_name
1584     (p_tax_name                 =>    p_rec.tax_name,
1585      p_effective_date           =>    p_effective_date,
1586      p_location_id              =>    p_rec.location_id
1587     );
1588   --
1589   --
1590   */
1591   hr_utility.set_location(l_proc, 58);
1592   --
1593   -- Validate style
1594   -- ==============
1595   chk_style
1596     (p_style                    =>    p_rec.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);
1615   --
1616   --
1617   hr_utility.set_location(' Leaving:'||l_proc, 65);
1618   --
1619 END insert_validate;
1620 --
1621 -- ----------------------------------------------------------------------------
1622 -- |---------------------------< update_validate >----------------------------|
1623 -- ----------------------------------------------------------------------------
1624 PROCEDURE update_validate
1625  (  p_rec IN OUT NOCOPY hr_loc_shd.g_rec_type,
1626     p_effective_date IN DATE,
1627     p_operating_unit_id IN NUMBER)
1628 IS
1629 --
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   --
1639   -- Note:  There are no calls to lookup validation procedures in this row handler
1640   --        at present.  If this changes, "CLIENT_INFO" may require setting - see
1641   --        API strategy page 12-29 onwards.
1642   --
1643   -- Check that the columns which cannot
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
1653     (p_inactive_date              =>    p_rec.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 (
1663     p_location_id                 =>   p_rec.location_id,
1664     p_ship_to_location_id         =>   p_rec.ship_to_location_id,
1665     p_ship_to_site_flag           =>   p_rec.ship_to_site_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
1684     (p_designated_receiver_id     =>    p_rec.designated_receiver_id,
1685      p_location_id                =>    p_rec.location_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
1695     (p_inventory_organization_id    =>    p_rec.inventory_organization_id,
1696      p_effective_date               =>    p_effective_date,
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   -- =================
1706   --
1707   chk_tax_name
1708     (p_tax_name                 =>    p_rec.tax_name,
1709      p_effective_date           =>    p_effective_date,
1710      p_location_id              =>    p_rec.location_id
1711     );
1712   --
1713   --
1714   */
1715   hr_utility.set_location(l_proc, 58);
1716   --
1717   -- Validate style
1718   -- ==============
1719   chk_style
1720     (p_style                    =>    p_rec.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);
1739   --
1740   --
1741   hr_utility.set_location(' Leaving:'||l_proc, 65);
1742   --
1743 END update_validate;
1744 
1745 --
1746 -- ----------------------------------------------------------------------------
1747 -- |---------------------------< delete_validate >----------------------------|
1748 -- ----------------------------------------------------------------------------
1749 PROCEDURE delete_validate
1750   (p_rec          IN    hr_loc_shd.g_rec_type
1751  ) IS
1752 
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
1762   --
1763   -- Business Rule Mapping
1764   -- =====================
1765   -- Rule chk_del_location
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;