DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_LOCATION_API

Source


1 PACKAGE BODY hr_location_api AS
2 /* $Header: hrlocapi.pkb 120.4 2010/10/19 11:52:44 ghshanka ship $ */
3 --
4 -- Package Variables
5 --
6 g_package            VARCHAR2(33) := '  hr_location_api.';
7 --
8 --------------------------------------------------------------------------------
9 g_dummy  number(1);  -- Dummy for cursor returns which are not needed
10 g_business_group_id number(15); -- For validating translation;
11 g_legislation_code varchar2(150); -- For validating translation;
12 --------------------------------------------------------------------------------
13 -- ----------------------------------------------------------------------------
14 -- |-----------------------------< create_location >--------------------------|
15 -- ----------------------------------------------------------------------------
16 --
17 PROCEDURE create_location
18   (   p_validate                       IN  BOOLEAN   DEFAULT false
19      ,p_effective_date                 IN  DATE
20      ,p_language_code                  IN  VARCHAR2  DEFAULT hr_api.userenv_lang
21      ,p_location_code                  IN  VARCHAR2
22      ,p_description                    IN  VARCHAR2  DEFAULT NULL
23      ,p_timezone_code                  IN  VARCHAR2  DEFAULT NULL
24      ,p_tp_header_id                   IN  NUMBER    DEFAULT NULL
25      ,p_ece_tp_location_code           IN  VARCHAR2  DEFAULT NULL
26      ,p_address_line_1                 IN  VARCHAR2  DEFAULT NULL
27      ,p_address_line_2                 IN  VARCHAR2  DEFAULT NULL
28      ,p_address_line_3                 IN  VARCHAR2  DEFAULT NULL
29      ,p_bill_to_site_flag              IN  VARCHAR2  DEFAULT 'Y'
30      ,p_country                        IN  VARCHAR2  DEFAULT NULL
31      ,p_designated_receiver_id         IN  NUMBER    DEFAULT NULL
32      ,p_in_organization_flag           IN  VARCHAR2  DEFAULT 'Y'
33      ,p_inactive_date                  IN  DATE      DEFAULT NULL
34      ,p_operating_unit_id              IN  NUMBER    DEFAULT NULL
35      ,p_inventory_organization_id      IN  NUMBER    DEFAULT NULL
36      ,p_office_site_flag               IN  VARCHAR2  DEFAULT 'Y'
37      ,p_postal_code                    IN  VARCHAR2  DEFAULT NULL
38      ,p_receiving_site_flag            IN  VARCHAR2  DEFAULT 'Y'
39      ,p_region_1                       IN  VARCHAR2  DEFAULT NULL
40      ,p_region_2                       IN  VARCHAR2  DEFAULT NULL
41      ,p_region_3                       IN  VARCHAR2  DEFAULT NULL
42      ,p_ship_to_location_id            IN  NUMBER    DEFAULT NULL
43      ,p_ship_to_site_flag              IN  VARCHAR2  DEFAULT 'Y'
44      ,p_style                          IN  VARCHAR2  DEFAULT NULL
45      ,p_tax_name                       IN  VARCHAR2  DEFAULT NULL
46      ,p_telephone_number_1             IN  VARCHAR2  DEFAULT NULL
47      ,p_telephone_number_2             IN  VARCHAR2  DEFAULT NULL
48      ,p_telephone_number_3             IN  VARCHAR2  DEFAULT NULL
49      ,p_town_or_city                   IN  VARCHAR2  DEFAULT NULL
50      ,p_loc_information13              IN  VARCHAR2  DEFAULT NULL
51      ,p_loc_information14              IN  VARCHAR2  DEFAULT NULL
52      ,p_loc_information15              IN  VARCHAR2  DEFAULT NULL
53      ,p_loc_information16              IN  VARCHAR2  DEFAULT NULL
54      ,p_loc_information17              IN  VARCHAR2  DEFAULT NULL
55      ,p_loc_information18              IN  VARCHAR2  DEFAULT NULL
56      ,p_loc_information19              IN  VARCHAR2  DEFAULT NULL
57      ,p_loc_information20              IN  VARCHAR2  DEFAULT NULL
58      ,p_attribute_category             IN  VARCHAR2  DEFAULT NULL
59      ,p_attribute1                     IN  VARCHAR2  DEFAULT NULL
60      ,p_attribute2                     IN  VARCHAR2  DEFAULT NULL
61      ,p_attribute3                     IN  VARCHAR2  DEFAULT NULL
62      ,p_attribute4                     IN  VARCHAR2  DEFAULT NULL
63      ,p_attribute5                     IN  VARCHAR2  DEFAULT NULL
64      ,p_attribute6                     IN  VARCHAR2  DEFAULT NULL
65      ,p_attribute7                     IN  VARCHAR2  DEFAULT NULL
66      ,p_attribute8                     IN  VARCHAR2  DEFAULT NULL
67      ,p_attribute9                     IN  VARCHAR2  DEFAULT NULL
68      ,p_attribute10                    IN  VARCHAR2  DEFAULT NULL
69      ,p_attribute11                    IN  VARCHAR2  DEFAULT NULL
70      ,p_attribute12                    IN  VARCHAR2  DEFAULT NULL
71      ,p_attribute13                    IN  VARCHAR2  DEFAULT NULL
72      ,p_attribute14                    IN  VARCHAR2  DEFAULT NULL
73      ,p_attribute15                    IN  VARCHAR2  DEFAULT NULL
74      ,p_attribute16                    IN  VARCHAR2  DEFAULT NULL
75      ,p_attribute17                    IN  VARCHAR2  DEFAULT NULL
76      ,p_attribute18                    IN  VARCHAR2  DEFAULT NULL
77      ,p_attribute19                    IN  VARCHAR2  DEFAULT NULL
78      ,p_attribute20                    IN  VARCHAR2  DEFAULT NULL
79      ,p_global_attribute_category      IN  VARCHAR2  DEFAULT NULL
80      ,p_global_attribute1              IN  VARCHAR2  DEFAULT NULL
81      ,p_global_attribute2              IN  VARCHAR2  DEFAULT NULL
82      ,p_global_attribute3              IN  VARCHAR2  DEFAULT NULL
83      ,p_global_attribute4              IN  VARCHAR2  DEFAULT NULL
84      ,p_global_attribute5              IN  VARCHAR2  DEFAULT NULL
85      ,p_global_attribute6              IN  VARCHAR2  DEFAULT NULL
86      ,p_global_attribute7              IN  VARCHAR2  DEFAULT NULL
87      ,p_global_attribute8              IN  VARCHAR2  DEFAULT NULL
88      ,p_global_attribute9              IN  VARCHAR2  DEFAULT NULL
89      ,p_global_attribute10             IN  VARCHAR2  DEFAULT NULL
90      ,p_global_attribute11             IN  VARCHAR2  DEFAULT NULL
91      ,p_global_attribute12             IN  VARCHAR2  DEFAULT NULL
92      ,p_global_attribute13             IN  VARCHAR2  DEFAULT NULL
93      ,p_global_attribute14             IN  VARCHAR2  DEFAULT NULL
94      ,p_global_attribute15             IN  VARCHAR2  DEFAULT NULL
95      ,p_global_attribute16             IN  VARCHAR2  DEFAULT NULL
96      ,p_global_attribute17             IN  VARCHAR2  DEFAULT NULL
97      ,p_global_attribute18             IN  VARCHAR2  DEFAULT NULL
98      ,p_global_attribute19             IN  VARCHAR2  DEFAULT NULL
99      ,p_global_attribute20             IN  VARCHAR2  DEFAULT NULL
100      ,p_business_group_id              IN  NUMBER    DEFAULT NULL
101      ,p_location_id                    OUT NOCOPY NUMBER
102      ,p_object_version_number          OUT NOCOPY NUMBER
103 
104   ) IS
105   --
106   -- Declare cursors and local variables
107   --
108   l_proc                  VARCHAR2(72) := g_package||'create_location';
109   l_location_id           hr_locations_all.location_id%TYPE;
110   l_object_version_number hr_locations_all.object_version_number%TYPE;
111   l_language_code         hr_locations_all_tl.language%TYPE;
112   l_inactive_date         DATE;
113   --
114 BEGIN
115   --
116   hr_utility.set_location('Entering:'|| l_proc, 10);
117   --
118   -- Issue a savepoint
119   --
120   savepoint create_location;
121   --
122   hr_utility.set_location(l_proc, 15);
123   --
124   --  All date input parameters must be truncated to remove time elements
125   --
126   l_inactive_date := trunc (p_inactive_date);
127   --
128   --
129   -- Validate the language parameter.  l_language_code should be passed to functions
130   -- instead of p_language_code from now on, to allow an IN OUT parameter to
131   -- be passed through.
132   --
133   l_language_code := p_language_code;
134   hr_api.validate_language_code(p_language_code => l_language_code);
135   --
136   hr_utility.set_location(l_proc, 20);
137   --
138     BEGIN
139     --
140     -- Start of API User Hook for the before hook of create_location
141     --
142     hr_location_bk1.create_location_b
143      (
144      p_effective_date                => p_effective_date
145     ,p_language_code                 => l_language_code
146     ,p_location_code                 => p_location_code
147     ,p_description                   => p_description
148     ,p_timezone_code                 => p_timezone_code
149     ,p_tp_header_id                  => p_tp_header_id
150     ,p_ece_tp_location_code          => p_ece_tp_location_code
151     ,p_address_line_1                => p_address_line_1
152     ,p_address_line_2                => p_address_line_2
153     ,p_address_line_3                => p_address_line_3
154     ,p_bill_to_site_flag             => p_bill_to_site_flag
155     ,p_country                       => p_country
156     ,p_designated_receiver_id        => p_designated_receiver_id
157     ,p_in_organization_flag          => p_in_organization_flag
158     ,p_inactive_date                 => l_inactive_date
159     ,p_operating_unit_id             => p_operating_unit_id
160     ,p_inventory_organization_id     => p_inventory_organization_id
161     ,p_office_site_flag              => p_office_site_flag
162     ,p_postal_code                   => p_postal_code
163     ,p_receiving_site_flag           => p_receiving_site_flag
164     ,p_region_1                      => p_region_1
165     ,p_region_2                      => p_region_2
166     ,p_region_3                      => p_region_3
167     ,p_ship_to_location_id           => p_ship_to_location_id
168     ,p_ship_to_site_flag             => p_ship_to_site_flag
169     ,p_style                         => p_style
170     ,p_tax_name                      => p_tax_name
171     ,p_telephone_number_1            => p_telephone_number_1
172     ,p_telephone_number_2            => p_telephone_number_2
173     ,p_telephone_number_3            => p_telephone_number_3
174     ,p_town_or_city                  => p_town_or_city
175     ,p_loc_information13             => p_loc_information13
176     ,p_loc_information14             => p_loc_information14
177     ,p_loc_information15             => p_loc_information15
178     ,p_loc_information16             => p_loc_information16
179     ,p_loc_information17             => p_loc_information17
180     ,p_loc_information18             => p_loc_information18
181     ,p_loc_information19             => p_loc_information19
182     ,p_loc_information20             => p_loc_information20
183     ,p_attribute_category            => p_attribute_category
184     ,p_attribute1                    => p_attribute1
185     ,p_attribute2                    => p_attribute2
186     ,p_attribute3                    => p_attribute3
187     ,p_attribute4                    => p_attribute4
188     ,p_attribute5                    => p_attribute5
189     ,p_attribute6                    => p_attribute6
190     ,p_attribute7                    => p_attribute7
191     ,p_attribute8                    => p_attribute8
192     ,p_attribute9                    => p_attribute9
193     ,p_attribute10                   => p_attribute10
194     ,p_attribute11                   => p_attribute11
195     ,p_attribute12                   => p_attribute12
196     ,p_attribute13                   => p_attribute13
197     ,p_attribute14                   => p_attribute14
198     ,p_attribute15                   => p_attribute15
199     ,p_attribute16                   => p_attribute16
200     ,p_attribute17                   => p_attribute17
201     ,p_attribute18                   => p_attribute18
202     ,p_attribute19                   => p_attribute19
203     ,p_attribute20                   => p_attribute20
204     ,p_global_attribute_category     => p_global_attribute_category
205     ,p_global_attribute1             => p_global_attribute1
206     ,p_global_attribute2             => p_global_attribute2
207     ,p_global_attribute3             => p_global_attribute3
208     ,p_global_attribute4             => p_global_attribute4
209     ,p_global_attribute5             => p_global_attribute5
210     ,p_global_attribute6             => p_global_attribute6
211     ,p_global_attribute7             => p_global_attribute7
212     ,p_global_attribute8             => p_global_attribute8
213     ,p_global_attribute9             => p_global_attribute9
214     ,p_global_attribute10            => p_global_attribute10
215     ,p_global_attribute11            => p_global_attribute11
216     ,p_global_attribute12            => p_global_attribute12
217     ,p_global_attribute13            => p_global_attribute13
218     ,p_global_attribute14            => p_global_attribute14
219     ,p_global_attribute15            => p_global_attribute15
220     ,p_global_attribute16            => p_global_attribute16
221     ,p_global_attribute17            => p_global_attribute17
222     ,p_global_attribute18            => p_global_attribute18
223     ,p_global_attribute19            => p_global_attribute19
224     ,p_global_attribute20            => p_global_attribute20
225     ,p_business_group_id             => p_business_group_id
226      );
227      EXCEPTION
228        WHEN hr_api.cannot_find_prog_unit THEN
229          hr_api.cannot_find_prog_unit_error
230            (  p_module_name => 'CREATE_LOCATION'
231              ,p_hook_type   => 'BP'
232            );
233     --
234     -- End of API User Hook for the before hook of create_location
235     --
236   END;
237   -- Process Logic
238   --
239   -- Insert non-translatable rows into HR_LOCATIONS_ALL first
240 
241   hr_utility.set_location(l_proc, 25);
242 
243   hr_location_internal.create_generic_location
244   (   p_effective_date                => p_effective_date
245      ,p_location_id                   => l_location_id
246      ,p_object_version_number         => l_object_version_number
247      ,p_location_code                 => p_location_code
248      ,p_timezone_code                 => p_timezone_code
249      ,p_address_line_1                => p_address_line_1
250      ,p_address_line_2                => p_address_line_2
251      ,p_address_line_3                => p_address_line_3
252      ,p_bill_to_site_flag             => p_bill_to_site_flag
253      ,p_country                       => p_country
254      ,p_description                   => p_description
255      ,p_designated_receiver_id        => p_designated_receiver_id
256      ,p_in_organization_flag          => p_in_organization_flag
257      ,p_inactive_date                 => l_inactive_date
258      ,p_operating_unit_id             => p_operating_unit_id
259      ,p_inventory_organization_id     => p_inventory_organization_id
260      ,p_office_site_flag              => p_office_site_flag
261      ,p_postal_code                   => p_postal_code
262      ,p_receiving_site_flag           => p_receiving_site_flag
263      ,p_region_1                      => p_region_1
264      ,p_region_2                      => p_region_2
265      ,p_region_3                      => p_region_3
266      ,p_ship_to_location_id           => p_ship_to_location_id
267      ,p_ship_to_site_flag             => p_ship_to_site_flag
268      ,p_style                         => p_style
269      -- Bug 4195237 : 'p_tax_name' parameter is disabled.
270      -- Passing 'null' to hr_location_internal
271     -- ,p_tax_name                      => null   -- reverted the fix 10106543
272      ,p_tax_name                      => p_tax_name
273      ,p_telephone_number_1            => p_telephone_number_1
274      ,p_telephone_number_2            => p_telephone_number_2
275      ,p_telephone_number_3            => p_telephone_number_3
276      ,p_town_or_city                  => p_town_or_city
277      ,p_loc_information13             => p_loc_information13
278      ,p_loc_information14             => p_loc_information14
279      ,p_loc_information15             => p_loc_information15
280      ,p_loc_information16             => p_loc_information16
281      ,p_loc_information17             => p_loc_information17
282      ,p_loc_information18             => p_loc_information18
283      ,p_loc_information19             => p_loc_information19
284      ,p_loc_information20             => p_loc_information20
285      ,p_attribute_category            => p_attribute_category
286      ,p_attribute1                    => p_attribute1
287      ,p_attribute2                    => p_attribute2
288      ,p_attribute3                    => p_attribute3
289      ,p_attribute4                    => p_attribute4
290      ,p_attribute5                    => p_attribute5
291      ,p_attribute6                    => p_attribute6
292      ,p_attribute7                    => p_attribute7
293      ,p_attribute8                    => p_attribute8
294      ,p_attribute9                    => p_attribute9
295      ,p_attribute10                   => p_attribute10
296      ,p_attribute11                   => p_attribute11
297      ,p_attribute12                   => p_attribute12
298      ,p_attribute13                   => p_attribute13
299      ,p_attribute14                   => p_attribute14
300      ,p_attribute15                   => p_attribute15
301      ,p_attribute16                   => p_attribute16
302      ,p_attribute17                   => p_attribute17
303      ,p_attribute18                   => p_attribute18
304      ,p_attribute19                   => p_attribute19
305      ,p_attribute20                   => p_attribute20
306      ,p_global_attribute_category     => p_global_attribute_category
307      ,p_global_attribute1             => p_global_attribute1
308      ,p_global_attribute2             => p_global_attribute2
309      ,p_global_attribute3             => p_global_attribute3
310      ,p_global_attribute4             => p_global_attribute4
311      ,p_global_attribute5             => p_global_attribute5
312      ,p_global_attribute6             => p_global_attribute6
313      ,p_global_attribute7             => p_global_attribute7
314      ,p_global_attribute8             => p_global_attribute8
315      ,p_global_attribute9             => p_global_attribute9
316      ,p_global_attribute10            => p_global_attribute10
317      ,p_global_attribute11            => p_global_attribute11
318      ,p_global_attribute12            => p_global_attribute12
319      ,p_global_attribute13            => p_global_attribute13
320      ,p_global_attribute14            => p_global_attribute14
321      ,p_global_attribute15            => p_global_attribute15
322      ,p_global_attribute16            => p_global_attribute16
323      ,p_global_attribute17            => p_global_attribute17
324      ,p_global_attribute18            => p_global_attribute18
325      ,p_global_attribute19            => p_global_attribute19
326      ,p_global_attribute20            => p_global_attribute20
327      ,p_legal_address_flag            => 'N'
328      ,p_tp_header_id                  => p_tp_header_id
329      ,p_ece_tp_location_code          => p_ece_tp_location_code
330      ,p_business_group_id             => p_business_group_id
331    );
332 
333   --
334   BEGIN
335     --
336     -- Start of API User Hook for the after hook of create_location
337     --
338     hr_location_bk1.create_location_a
339      (
340      p_effective_date                => p_effective_date
341     ,p_language_code                 => l_language_code
342     ,p_location_code                 => p_location_code
343     ,p_description                   => p_description
344     ,p_timezone_code                 => p_timezone_code
345     ,p_tp_header_id                  => p_tp_header_id
346     ,p_ece_tp_location_code          => p_ece_tp_location_code
347     ,p_address_line_1                => p_address_line_1
348     ,p_address_line_2                => p_address_line_2
349     ,p_address_line_3                => p_address_line_3
350     ,p_bill_to_site_flag             => p_bill_to_site_flag
351     ,p_country                       => p_country
352     ,p_designated_receiver_id        => p_designated_receiver_id
353     ,p_in_organization_flag          => p_in_organization_flag
354     ,p_inactive_date                 => l_inactive_date
355     ,p_operating_unit_id             => p_operating_unit_id
356     ,p_inventory_organization_id     => p_inventory_organization_id
357     ,p_office_site_flag              => p_office_site_flag
358     ,p_postal_code                   => p_postal_code
359     ,p_receiving_site_flag           => p_receiving_site_flag
360     ,p_region_1                      => p_region_1
361     ,p_region_2                      => p_region_2
362     ,p_region_3                      => p_region_3
363     ,p_ship_to_location_id           => p_ship_to_location_id
364     ,p_ship_to_site_flag             => p_ship_to_site_flag
365     ,p_style                         => p_style
366     ,p_tax_name                      => p_tax_name
367     ,p_telephone_number_1            => p_telephone_number_1
368     ,p_telephone_number_2            => p_telephone_number_2
369     ,p_telephone_number_3            => p_telephone_number_3
370     ,p_town_or_city                  => p_town_or_city
371     ,p_loc_information13             => p_loc_information13
372     ,p_loc_information14             => p_loc_information14
373     ,p_loc_information15             => p_loc_information15
374     ,p_loc_information16             => p_loc_information16
375     ,p_loc_information17             => p_loc_information17
376     ,p_loc_information18             => p_loc_information18
377     ,p_loc_information19             => p_loc_information19
378     ,p_loc_information20             => p_loc_information20
379     ,p_attribute_category            => p_attribute_category
380     ,p_attribute1                    => p_attribute1
381     ,p_attribute2                    => p_attribute2
382     ,p_attribute3                    => p_attribute3
383     ,p_attribute4                    => p_attribute4
384     ,p_attribute5                    => p_attribute5
385     ,p_attribute6                    => p_attribute6
386     ,p_attribute7                    => p_attribute7
387     ,p_attribute8                    => p_attribute8
388     ,p_attribute9                    => p_attribute9
389     ,p_attribute10                   => p_attribute10
390     ,p_attribute11                   => p_attribute11
391     ,p_attribute12                   => p_attribute12
392     ,p_attribute13                   => p_attribute13
393     ,p_attribute14                   => p_attribute14
394     ,p_attribute15                   => p_attribute15
395     ,p_attribute16                   => p_attribute16
396     ,p_attribute17                   => p_attribute17
397     ,p_attribute18                   => p_attribute18
398     ,p_attribute19                   => p_attribute19
399     ,p_attribute20                   => p_attribute20
400     ,p_global_attribute_category     => p_global_attribute_category
401     ,p_global_attribute1             => p_global_attribute1
402     ,p_global_attribute2             => p_global_attribute2
403     ,p_global_attribute3             => p_global_attribute3
404     ,p_global_attribute4             => p_global_attribute4
405     ,p_global_attribute5             => p_global_attribute5
406     ,p_global_attribute6             => p_global_attribute6
407     ,p_global_attribute7             => p_global_attribute7
408     ,p_global_attribute8             => p_global_attribute8
409     ,p_global_attribute9             => p_global_attribute9
410     ,p_global_attribute10            => p_global_attribute10
411     ,p_global_attribute11            => p_global_attribute11
412     ,p_global_attribute12            => p_global_attribute12
413     ,p_global_attribute13            => p_global_attribute13
414     ,p_global_attribute14            => p_global_attribute14
415     ,p_global_attribute15            => p_global_attribute15
416     ,p_global_attribute16            => p_global_attribute16
417     ,p_global_attribute17            => p_global_attribute17
418     ,p_global_attribute18            => p_global_attribute18
419     ,p_global_attribute19            => p_global_attribute19
420     ,p_global_attribute20            => p_global_attribute20
421     ,p_business_group_id             => p_business_group_id
422     ,p_location_id                   => l_location_id
423     ,p_object_version_number         => l_object_version_number
424     );
425    EXCEPTION
426     WHEN hr_api.cannot_find_prog_unit THEN
427       hr_api.cannot_find_prog_unit_error
428         (p_module_name => 'CREATE_LOCATION'
429         ,p_hook_type   => 'AP'
430         );
431     --
432     -- End of API User Hook for the after hook of create_location
433     --
434   END;
435   hr_utility.set_location(l_proc, 60);
436   --
437   -- When in validation only mode raise the Validate_Enabled exception
438   --
439     IF p_validate THEN
440     RAISE hr_api.validate_enabled;
441   END IF;
442    -- Set all output arguments
443   --
444   p_location_id := l_location_id;
445   p_object_version_number := l_object_version_number;
446   --
447 EXCEPTION
448   --
449   WHEN hr_api.validate_enabled THEN
450     --
451     -- As the Validate_Enabled exception has been raised
452     -- we must rollback to the savepoint
453     --
454     ROLLBACK TO create_location;
455     --
456     -- Only set output warning arguments
457     -- (Any key or derived arguments must be set to null
458     -- when validation only mode is being used.)
459     --
460     p_location_id := NULL;
461     p_object_version_number  := NULL;
462     hr_utility.set_location(' Leaving:'||l_proc, 80);
463   WHEN OTHERS THEN
464     --
465     -- A validation or unexpected error has occurred
466     ROLLBACK TO create_location;
467     -- Set OUT parameters.
468     p_location_id := NULL;
469     p_object_version_number  := NULL;
470     hr_utility.set_location(' Leaving:'||l_proc, 90);
471     RAISE;
472    --
473 END create_location;
474 -- ----------------------------------------------------------------------------
475 -- |--------------------------< update_location >-----------------------------|
476 -- ----------------------------------------------------------------------------
477 --
478 PROCEDURE update_location
479   (   p_validate                       IN  BOOLEAN   DEFAULT false
480      ,p_effective_date                 IN  DATE
481      ,p_language_code                  IN  VARCHAR2  DEFAULT hr_api.userenv_lang
482      ,p_location_id                    IN  NUMBER
483      ,p_location_code                  IN  VARCHAR2  DEFAULT hr_api.g_varchar2
484      ,p_description                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
485      ,p_timezone_code                  IN  VARCHAR2  DEFAULT hr_api.g_varchar2
486      ,p_tp_header_id                   IN  NUMBER    DEFAULT hr_api.g_number
487      ,p_ece_tp_location_code           IN  VARCHAR2  DEFAULT hr_api.g_varchar2
488      ,p_address_line_1                 IN  VARCHAR2  DEFAULT hr_api.g_varchar2
489      ,p_address_line_2                 IN  VARCHAR2  DEFAULT hr_api.g_varchar2
490      ,p_address_line_3                 IN  VARCHAR2  DEFAULT hr_api.g_varchar2
491      ,p_bill_to_site_flag              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
492      ,p_country                        IN  VARCHAR2  DEFAULT hr_api.g_varchar2
493      ,p_designated_receiver_id         IN  NUMBER    DEFAULT hr_api.g_number
494      ,p_in_organization_flag           IN  VARCHAR2  DEFAULT hr_api.g_varchar2
495      ,p_inactive_date                  IN  DATE      DEFAULT hr_api.g_date
496      ,p_operating_unit_id              IN  NUMBER    DEFAULT NULL
497      ,p_inventory_organization_id      IN  NUMBER    DEFAULT hr_api.g_number
498      ,p_office_site_flag               IN  VARCHAR2  DEFAULT hr_api.g_varchar2
499      ,p_postal_code                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
500      ,p_receiving_site_flag            IN  VARCHAR2  DEFAULT hr_api.g_varchar2
501      ,p_region_1                       IN  VARCHAR2  DEFAULT hr_api.g_varchar2
502      ,p_region_2                       IN  VARCHAR2  DEFAULT hr_api.g_varchar2
503      ,p_region_3                       IN  VARCHAR2  DEFAULT hr_api.g_varchar2
504      ,p_ship_to_location_id            IN  NUMBER    DEFAULT hr_api.g_number
505      ,p_ship_to_site_flag              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
506      ,p_style                          IN  VARCHAR2  DEFAULT hr_api.g_varchar2
507      ,p_tax_name                       IN  VARCHAR2  DEFAULT hr_api.g_varchar2
508      ,p_telephone_number_1             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
509      ,p_telephone_number_2             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
510      ,p_telephone_number_3             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
511      ,p_town_or_city                   IN  VARCHAR2  DEFAULT hr_api.g_varchar2
512      ,p_loc_information13              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
513      ,p_loc_information14              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
514      ,p_loc_information15              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
515      ,p_loc_information16              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
516      ,p_loc_information17              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
517      ,p_loc_information18              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
518      ,p_loc_information19              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
519      ,p_loc_information20              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
520      ,p_attribute_category             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
521      ,p_attribute1                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
522      ,p_attribute2                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
523      ,p_attribute3                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
524      ,p_attribute4                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
525      ,p_attribute5                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
526      ,p_attribute6                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
527      ,p_attribute7                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
528      ,p_attribute8                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
529      ,p_attribute9                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
530      ,p_attribute10                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
531      ,p_attribute11                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
532      ,p_attribute12                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
533      ,p_attribute13                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
534      ,p_attribute14                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
535      ,p_attribute15                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
536      ,p_attribute16                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
537      ,p_attribute17                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
538      ,p_attribute18                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
539      ,p_attribute19                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
540      ,p_attribute20                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
541      ,p_global_attribute_category      IN  VARCHAR2  DEFAULT hr_api.g_varchar2
542      ,p_global_attribute1              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
543      ,p_global_attribute2              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
544      ,p_global_attribute3              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
545      ,p_global_attribute4              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
546      ,p_global_attribute5              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
547      ,p_global_attribute6              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
548      ,p_global_attribute7              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
549      ,p_global_attribute8              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
550      ,p_global_attribute9              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
551      ,p_global_attribute10             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
552      ,p_global_attribute11             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
553      ,p_global_attribute12             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
554      ,p_global_attribute13             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
555      ,p_global_attribute14             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
556      ,p_global_attribute15             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
557      ,p_global_attribute16             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
558      ,p_global_attribute17             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
559      ,p_global_attribute18             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
560      ,p_global_attribute19             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
561      ,p_global_attribute20             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
562      ,p_object_version_number          IN OUT NOCOPY NUMBER
563   ) IS
564   --
565   -- Declare cursors and local variables
566   --
567   l_proc                  VARCHAR2(72) := g_package||'update_location';
568   l_object_version_number hr_locations.object_version_number%TYPE;
569   l_language_code         hr_locations_all_tl.language%TYPE;
570   l_inactive_date         DATE;
571 
572   l_temp_ovn   number := p_object_version_number;
573   --
574   l_address_line_1        VARCHAR2(240);
575   l_address_line_2        VARCHAR2(240);
576   l_address_line_3        VARCHAR2(240);
577   l_country               VARCHAR2(60);
578   l_postal_code           VARCHAR2(30);
579   l_region_1              VARCHAR2(120);
580   l_region_2              VARCHAR2(120);
581   l_region_3              VARCHAR2(120);
582   l_style                 VARCHAR2(30);
583   l_town_or_city          VARCHAR2(30);
584 
585 BEGIN
586   --
587   hr_utility.set_location('Entering:'|| l_proc, 10);
588   --
589   -- Issue a savepoint.
590   --
591   savepoint update_location;
592   --
593   --
594   --  All date input parameters must be truncated to remove time elements
595   --
596   l_inactive_date := trunc (p_inactive_date);
597   --
598   -- Validate the language parameter.
599   -- l_language_code should be passed to functions
600   -- instead of p_language_code from now on, to allow an IN OUT parameter to be
601   -- passed through.
602   --
603   l_language_code := p_language_code;
604   hr_api.validate_language_code(p_language_code => l_language_code);
605   hr_utility.set_location(l_proc, 20);
606 
607   if hr_general2.is_location_legal_adr(p_location_id => p_location_id) then
608   --
609 -- fix for bug 9223716,the address fields are enabled for update.
610     --
611     -- Check that the non updateable parameter for legal address has
612     -- not been passed in.
613     --
614     -- p_address_line_1
615     -- p_address_line_2
616     -- p_address_line_3
617     -- p_country
618     -- p_inactive_date
619     -- p_postal_code
620     -- p_region_1
621     -- p_region_2
622     -- p_region_3
623     -- p_style
624     -- p_town_or_city
625 
626     -- fix 3219077 start
627        select address_line_1
628              ,address_line_2
629              ,address_line_3
630              ,country
631              ,inactive_date
632              ,postal_code
633              ,region_1
634              ,region_2
635              ,region_3
636              ,style
637              ,town_or_city
638        into   l_address_line_1
639              ,l_address_line_2
640              ,l_address_line_3
641              ,l_country
642              ,l_inactive_date
643              ,l_postal_code
644              ,l_region_1
645              ,l_region_2
646              ,l_region_3
647              ,l_style
648              ,l_town_or_city
649        from   hr_locations_all loc
650      where  loc.location_id = p_location_id;
651   -- fix 3219077 end
652 
653        hr_utility.set_location(l_proc, 25);
654 
655     if (
656 
657       /* nvl(p_address_line_1,hr_api.g_varchar2) <>
658                     nvl(l_address_line_1,hr_api.g_varchar2)  OR
659        nvl(p_address_line_2,hr_api.g_varchar2) <>
660                     nvl(l_address_line_2,hr_api.g_varchar2) OR
661        nvl(p_address_line_3,hr_api.g_varchar2) <>
662                     nvl(l_address_line_3,hr_api.g_varchar2) OR
663        nvl(p_country,hr_api.g_varchar2)        <>
664                     nvl(l_country,hr_api.g_varchar2) OR */
665        nvl(p_inactive_date,hr_api.g_date)  <>
666                     nvl(l_inactive_date,hr_api.g_date)
667       /* OR
668        nvl(p_postal_code,hr_api.g_varchar2)    <>
669                     nvl(l_postal_code,hr_api.g_varchar2) OR
670        nvl(p_region_1,hr_api.g_varchar2)       <>
671                     nvl(l_region_1,hr_api.g_varchar2) OR
672        nvl(p_region_2,hr_api.g_varchar2)       <>
673                     nvl(l_region_2,hr_api.g_varchar2) OR
674        nvl(p_region_3,hr_api.g_varchar2)       <>
675                     nvl(l_region_3,hr_api.g_varchar2) OR
676        nvl(p_style,hr_api.g_varchar2)          <>
677                     nvl(l_style,hr_api.g_varchar2) OR
678        nvl(p_town_or_city,hr_api.g_varchar2)   <>
679                     nvl(l_town_or_city,hr_api.g_varchar2) */
680        )    then
681 
682        hr_utility.set_location(l_proc, 26);
683 
684        hr_utility.set_message(800, 'HR_50049_NON_UPDATEABLE_VALUES');
685        hr_utility.raise_error;
686 
687     end if;
688 
689   end if;
690 
691   -- Process Logic
692   --
693   l_object_version_number := p_object_version_number;
694   --
695     BEGIN
696     --
697     -- Start of API User Hook for the before hook of update_location
698     --
699     hr_location_bk2.update_location_b
700       (
701      p_effective_date                => p_effective_date
702     ,p_language_code                 => l_language_code
703     ,p_location_id                   => p_location_id
704     ,p_location_code                 => p_location_code
705     ,p_description                   => p_description
706     ,p_timezone_code                 => p_timezone_code
707     ,p_tp_header_id                  => p_tp_header_id
708     ,p_ece_tp_location_code          => p_ece_tp_location_code
709     ,p_address_line_1                => p_address_line_1
710     ,p_address_line_2                => p_address_line_2
711     ,p_address_line_3                => p_address_line_3
712     ,p_bill_to_site_flag             => p_bill_to_site_flag
713     ,p_country                       => p_country
714     ,p_designated_receiver_id        => p_designated_receiver_id
715     ,p_in_organization_flag          => p_in_organization_flag
716     ,p_inactive_date                 => l_inactive_date
717     ,p_operating_unit_id             => p_operating_unit_id
718     ,p_inventory_organization_id     => p_inventory_organization_id
719     ,p_office_site_flag              => p_office_site_flag
720     ,p_postal_code                   => p_postal_code
721     ,p_receiving_site_flag           => p_receiving_site_flag
722     ,p_region_1                      => p_region_1
723     ,p_region_2                      => p_region_2
724     ,p_region_3                      => p_region_3
725     ,p_ship_to_location_id           => p_ship_to_location_id
726     ,p_ship_to_site_flag             => p_ship_to_site_flag
727     ,p_style                         => p_style
728     ,p_tax_name                      => p_tax_name
729     ,p_telephone_number_1            => p_telephone_number_1
730     ,p_telephone_number_2            => p_telephone_number_2
731     ,p_telephone_number_3            => p_telephone_number_3
732     ,p_town_or_city                  => p_town_or_city
733     ,p_loc_information13             => p_loc_information13
734     ,p_loc_information14             => p_loc_information14
735     ,p_loc_information15             => p_loc_information15
736     ,p_loc_information16             => p_loc_information16
737     ,p_loc_information17             => p_loc_information17
738     ,p_loc_information18             => p_loc_information18
739     ,p_loc_information19             => p_loc_information19
740     ,p_loc_information20             => p_loc_information20
741     ,p_attribute_category            => p_attribute_category
742     ,p_attribute1                    => p_attribute1
743     ,p_attribute2                    => p_attribute2
744     ,p_attribute3                    => p_attribute3
745     ,p_attribute4                    => p_attribute4
746     ,p_attribute5                    => p_attribute5
747     ,p_attribute6                    => p_attribute6
748     ,p_attribute7                    => p_attribute7
749     ,p_attribute8                    => p_attribute8
750     ,p_attribute9                    => p_attribute9
751     ,p_attribute10                   => p_attribute10
752     ,p_attribute11                   => p_attribute11
753     ,p_attribute12                   => p_attribute12
754     ,p_attribute13                   => p_attribute13
755     ,p_attribute14                   => p_attribute14
756     ,p_attribute15                   => p_attribute15
757     ,p_attribute16                   => p_attribute16
758     ,p_attribute17                   => p_attribute17
759     ,p_attribute18                   => p_attribute18
760     ,p_attribute19                   => p_attribute19
761     ,p_attribute20                   => p_attribute20
762     ,p_global_attribute_category     => p_global_attribute_category
763     ,p_global_attribute1             => p_global_attribute1
764     ,p_global_attribute2             => p_global_attribute2
765     ,p_global_attribute3             => p_global_attribute3
766     ,p_global_attribute4             => p_global_attribute4
767     ,p_global_attribute5             => p_global_attribute5
768     ,p_global_attribute6             => p_global_attribute6
769     ,p_global_attribute7             => p_global_attribute7
770     ,p_global_attribute8             => p_global_attribute8
771     ,p_global_attribute9             => p_global_attribute9
772     ,p_global_attribute10            => p_global_attribute10
773     ,p_global_attribute11            => p_global_attribute11
774     ,p_global_attribute12            => p_global_attribute12
775     ,p_global_attribute13            => p_global_attribute13
776     ,p_global_attribute14            => p_global_attribute14
777     ,p_global_attribute15            => p_global_attribute15
778     ,p_global_attribute16            => p_global_attribute16
779     ,p_global_attribute17            => p_global_attribute17
780     ,p_global_attribute18            => p_global_attribute18
781     ,p_global_attribute19            => p_global_attribute19
782     ,p_global_attribute20            => p_global_attribute20
783     ,p_object_version_number         => l_object_version_number
784      );
785    EXCEPTION
786     WHEN hr_api.cannot_find_prog_unit THEN
787       hr_api.cannot_find_prog_unit_error
788         (p_module_name => 'UPDATE_LOCATION'
789         ,p_hook_type   => 'BP'
790         );
791     --
792     -- End of API User Hook for the before hook of update_location
793     --
794   END;
795   --
796   -- Insert non-translatable rows in HR_LOCATIONS_ALL Table
797   --
798   hr_location_internal.update_generic_location
799     ( p_effective_date                => p_effective_date
800      ,p_language_code                 => l_language_code  -- Added for bug 3368450.
801      ,p_location_id                   => p_location_id
802      ,p_timezone_code                 => p_timezone_code
803      ,p_object_version_number         => l_object_version_number
804      ,p_tp_header_id                  => p_tp_header_id
805      ,p_ece_tp_location_code          => p_ece_tp_location_code
806      ,p_location_code                 => p_location_code
807      ,p_address_line_1                => p_address_line_1
808      ,p_address_line_2                => p_address_line_2
809      ,p_address_line_3                => p_address_line_3
810      ,p_bill_to_site_flag             => p_bill_to_site_flag
811      ,p_country                       => p_country
812      ,p_description                   => p_description
813      ,p_designated_receiver_id        => p_designated_receiver_id
814      ,p_in_organization_flag          => p_in_organization_flag
815      ,p_inactive_date                 => l_inactive_date
816      ,p_operating_unit_id             => p_operating_unit_id
817      ,p_inventory_organization_id     => p_inventory_organization_id
818      ,p_office_site_flag              => p_office_site_flag
819      ,p_postal_code                   => p_postal_code
820      ,p_receiving_site_flag           => p_receiving_site_flag
821      ,p_region_1                      => p_region_1
822      ,p_region_2                      => p_region_2
823      ,p_region_3                      => p_region_3
824      ,p_ship_to_location_id           => p_ship_to_location_id
825      ,p_ship_to_site_flag             => p_ship_to_site_flag
826      ,p_style                         => p_style
827      -- Bug 4195237 : 'p_tax_name' parameter is disabled.
828      -- Passing 'null' to hr_location_internal
829     -- ,p_tax_name                      => null -- reverted the fix 10106543
830      ,p_tax_name                      => p_tax_name
831      ,p_telephone_number_1            => p_telephone_number_1
832      ,p_telephone_number_2            => p_telephone_number_2
833      ,p_telephone_number_3            => p_telephone_number_3
834      ,p_town_or_city                  => p_town_or_city
835      ,p_loc_information13             => p_loc_information13
836      ,p_loc_information14             => p_loc_information14
837      ,p_loc_information15             => p_loc_information15
838      ,p_loc_information16             => p_loc_information16
839      ,p_loc_information17             => p_loc_information17
840      ,p_loc_information18             => p_loc_information18
841      ,p_loc_information19             => p_loc_information19
842      ,p_loc_information20             => p_loc_information20
843      ,p_attribute_category            => p_attribute_category
844      ,p_attribute1                    => p_attribute1
845      ,p_attribute2                    => p_attribute2
846      ,p_attribute3                    => p_attribute3
847      ,p_attribute4                    => p_attribute4
848      ,p_attribute5                    => p_attribute5
849      ,p_attribute6                    => p_attribute6
850      ,p_attribute7                    => p_attribute7
851      ,p_attribute8                    => p_attribute8
852      ,p_attribute9                    => p_attribute9
853      ,p_attribute10                   => p_attribute10
854      ,p_attribute11                   => p_attribute11
855      ,p_attribute12                   => p_attribute12
856      ,p_attribute13                   => p_attribute13
857      ,p_attribute14                   => p_attribute14
858      ,p_attribute15                   => p_attribute15
859      ,p_attribute16                   => p_attribute16
860      ,p_attribute17                   => p_attribute17
861      ,p_attribute18                   => p_attribute18
862      ,p_attribute19                   => p_attribute19
863      ,p_attribute20                   => p_attribute20
864      ,p_global_attribute_category     => p_global_attribute_category
865      ,p_global_attribute1             => p_global_attribute1
866      ,p_global_attribute2             => p_global_attribute2
867      ,p_global_attribute3             => p_global_attribute3
868      ,p_global_attribute4             => p_global_attribute4
869      ,p_global_attribute5             => p_global_attribute5
870      ,p_global_attribute6             => p_global_attribute6
871      ,p_global_attribute7             => p_global_attribute7
872      ,p_global_attribute8             => p_global_attribute8
873      ,p_global_attribute9             => p_global_attribute9
874      ,p_global_attribute10            => p_global_attribute10
875      ,p_global_attribute11            => p_global_attribute11
876      ,p_global_attribute12            => p_global_attribute12
877      ,p_global_attribute13            => p_global_attribute13
878      ,p_global_attribute14            => p_global_attribute14
879      ,p_global_attribute15            => p_global_attribute15
880      ,p_global_attribute16            => p_global_attribute16
881      ,p_global_attribute17            => p_global_attribute17
882      ,p_global_attribute18            => p_global_attribute18
883      ,p_global_attribute19            => p_global_attribute19
884      ,p_global_attribute20            => p_global_attribute20
885     );
886 
887 --
888     BEGIN
889     --
890     -- Start of API User Hook for the after hook of update_location
891     --
892     hr_location_bk2.update_location_a
893       (
894      p_effective_date                => p_effective_date
895     ,p_language_code                 => l_language_code
896     ,p_location_id                   => p_location_id
897     ,p_location_code                 => p_location_code
898     ,p_description                   => p_description
899     ,p_timezone_code                 => p_timezone_code
900     ,p_tp_header_id                  => p_tp_header_id
901     ,p_ece_tp_location_code          => p_ece_tp_location_code
902     ,p_address_line_1                => p_address_line_1
903     ,p_address_line_2                => p_address_line_2
904     ,p_address_line_3                => p_address_line_3
905     ,p_bill_to_site_flag             => p_bill_to_site_flag
906     ,p_country                       => p_country
907     ,p_designated_receiver_id        => p_designated_receiver_id
908     ,p_in_organization_flag          => p_in_organization_flag
909     ,p_inactive_date                 => l_inactive_date
910     ,p_operating_unit_id             => p_operating_unit_id
911     ,p_inventory_organization_id     => p_inventory_organization_id
912     ,p_office_site_flag              => p_office_site_flag
913     ,p_postal_code                   => p_postal_code
914     ,p_receiving_site_flag           => p_receiving_site_flag
915     ,p_region_1                      => p_region_1
916     ,p_region_2                      => p_region_2
917     ,p_region_3                      => p_region_3
918     ,p_ship_to_location_id           => p_ship_to_location_id
919     ,p_ship_to_site_flag             => p_ship_to_site_flag
920     ,p_style                         => p_style
921     ,p_tax_name                      => p_tax_name
922     ,p_telephone_number_1            => p_telephone_number_1
923     ,p_telephone_number_2            => p_telephone_number_2
924     ,p_telephone_number_3            => p_telephone_number_3
925     ,p_town_or_city                  => p_town_or_city
926     ,p_loc_information13             => p_loc_information13
927     ,p_loc_information14             => p_loc_information14
928     ,p_loc_information15             => p_loc_information15
929     ,p_loc_information16             => p_loc_information16
930     ,p_loc_information17             => p_loc_information17
931     ,p_loc_information18             => p_loc_information18
932     ,p_loc_information19             => p_loc_information19
933     ,p_loc_information20             => p_loc_information20
934     ,p_attribute_category            => p_attribute_category
935     ,p_attribute1                    => p_attribute1
936     ,p_attribute2                    => p_attribute2
937     ,p_attribute3                    => p_attribute3
938     ,p_attribute4                    => p_attribute4
939     ,p_attribute5                    => p_attribute5
940     ,p_attribute6                    => p_attribute6
941     ,p_attribute7                    => p_attribute7
942     ,p_attribute8                    => p_attribute8
943     ,p_attribute9                    => p_attribute9
944     ,p_attribute10                   => p_attribute10
945     ,p_attribute11                   => p_attribute11
946     ,p_attribute12                   => p_attribute12
947     ,p_attribute13                   => p_attribute13
948     ,p_attribute14                   => p_attribute14
949     ,p_attribute15                   => p_attribute15
950     ,p_attribute16                   => p_attribute16
951     ,p_attribute17                   => p_attribute17
952     ,p_attribute18                   => p_attribute18
953     ,p_attribute19                   => p_attribute19
954     ,p_attribute20                   => p_attribute20
955     ,p_global_attribute_category     => p_global_attribute_category
956     ,p_global_attribute1             => p_global_attribute1
957     ,p_global_attribute2             => p_global_attribute2
958     ,p_global_attribute3             => p_global_attribute3
959     ,p_global_attribute4             => p_global_attribute4
960     ,p_global_attribute5             => p_global_attribute5
961     ,p_global_attribute6             => p_global_attribute6
962     ,p_global_attribute7             => p_global_attribute7
963     ,p_global_attribute8             => p_global_attribute8
964     ,p_global_attribute9             => p_global_attribute9
965     ,p_global_attribute10            => p_global_attribute10
966     ,p_global_attribute11            => p_global_attribute11
967     ,p_global_attribute12            => p_global_attribute12
968     ,p_global_attribute13            => p_global_attribute13
969     ,p_global_attribute14            => p_global_attribute14
970     ,p_global_attribute15            => p_global_attribute15
971     ,p_global_attribute16            => p_global_attribute16
972     ,p_global_attribute17            => p_global_attribute17
973     ,p_global_attribute18            => p_global_attribute18
974     ,p_global_attribute19            => p_global_attribute19
975     ,p_global_attribute20            => p_global_attribute20
976     ,p_object_version_number         => l_object_version_number
977      );
978    EXCEPTION
979     WHEN hr_api.cannot_find_prog_unit THEN
980       hr_api.cannot_find_prog_unit_error
981         (p_module_name => 'UPDATE_LOCATION'
982         ,p_hook_type   => 'AP'
983         );
984     --
985     -- End of API User Hook for the after hook of update_location
986     --
987   END;
988   --
989   hr_utility.set_location(l_proc, 60);
990   --
991   -- When in validation only mode raise the Validate_Enabled exception
992   --
993   IF p_validate THEN
994     RAISE hr_api.validate_enabled;
995   END IF;
996   --
997   -- Set all output arguments.  If p_validate was TRUE, this bit is
998   -- never reached, so p_object_version_number is passed back unchanged.
999   --
1000   p_object_version_number := l_object_version_number;
1001   --
1002   hr_utility.set_location(' Leaving:'||l_proc, 70);
1003   --
1004 EXCEPTION
1005   --
1006   WHEN hr_api.validate_enabled THEN
1007     --
1008     -- As the Validate_Enabled exception has been raised
1009     -- we must rollback to the savepoint
1010     --
1011     ROLLBACK TO update_location;
1012     --
1013     -- Only set output warning arguments
1014     -- (Any key or derived arguments must be set to null
1015     -- when validation only mode is being used.)
1016     -- Reset IN OUT parameters.
1017     p_object_version_number := l_temp_ovn;
1018     hr_utility.set_location(' Leaving:'||l_proc, 80);
1019   WHEN OTHERS THEN
1020     --
1021     -- A validation or unexpected error has occurred
1022     ROLLBACK TO update_location;
1023     -- Reset IN OUT parameters.
1024     p_object_version_number := l_temp_ovn;
1025     hr_utility.set_location(' Leaving:'||l_proc, 90);
1026     RAISE;
1027     --
1028     --
1029 END update_location;
1030 -- ----------------------------------------------------------------------------
1031 -- |-------------------------< delete_location >------------------------------|
1032 -- ----------------------------------------------------------------------------
1033 --
1034 PROCEDURE delete_location
1035    (  p_validate                     IN BOOLEAN DEFAULT false
1036      ,p_location_id                  IN hr_locations.location_id%TYPE
1037      ,p_object_version_number        IN hr_locations.object_version_number%TYPE )
1038 
1039 IS
1040   --
1041   --
1042   -- Declare cursors and local variables
1043   --
1044   l_proc                  VARCHAR2(72) := g_package||'delete_location';
1045   --
1046 BEGIN
1047   --
1048   hr_utility.set_location('Entering:'|| l_proc, 10);
1049   --
1050   -- Issue a savepoint
1051   --
1052   savepoint delete_location;
1053   --
1054     BEGIN
1055     hr_utility.set_location( l_proc, 20);
1056     hr_location_bk3.delete_location_b (
1057       p_location_id                 => p_location_id,
1058       p_object_version_number       => p_object_version_number );
1059     --
1060   EXCEPTION
1061     WHEN hr_api.cannot_find_prog_unit THEN
1062       hr_api.cannot_find_prog_unit_error
1063         (p_module_name => 'DELETE_LOCATION'
1064         ,p_hook_type   => 'BP'
1065    );
1066   END;
1067   --
1068   -- Process Logic
1069   -- =============
1070   --
1071   --  Need to lock main table to maintain the locking ladder order
1072   --
1073   hr_utility.set_location( l_proc, 30);
1074   hr_loc_shd.lck (   p_location_id                 => p_location_id,
1075                      p_object_version_number       => p_object_version_number );
1076   --
1077   --  Remove all matching translation rows
1078   --
1079   hr_utility.set_location( l_proc, 35);
1080   hr_lot_del.del_tl (
1081     p_location_id                 => p_location_id );
1082   --
1083   --  Remove non-translated data row
1084   --
1085   hr_utility.set_location( l_proc, 40);
1086   hr_loc_del.del(
1087     p_location_id                 => p_location_id,
1088     p_object_version_number       => p_object_version_number );
1089   --
1090     BEGIN
1091     hr_utility.set_location( l_proc, 50);
1092     hr_location_bk3.delete_location_a (
1093       p_location_id                 => p_location_id,
1094       p_object_version_number       => p_object_version_number );
1095     --
1096   EXCEPTION
1097     WHEN hr_api.cannot_find_prog_unit THEN
1098       hr_api.cannot_find_prog_unit_error
1099         (p_module_name => 'DELETE_LOCATION'
1100         ,p_hook_type   => 'AP'
1101    );
1102   END;
1103 --
1104 --
1105   hr_utility.set_location(' Leaving:'||l_proc, 60);
1106   --
1107   -- When in validation only mode raise the Validate_Enabled exception
1108   --
1109   IF p_validate THEN
1110      RAISE hr_api.validate_enabled;
1111   END IF;
1112   --
1113   --
1114 EXCEPTION
1115   --
1116   WHEN hr_api.validate_enabled THEN
1117     --
1118     -- As the Validate_Enabled exception has been raised
1119     -- we must rollback to the savepoint
1120     --
1121     ROLLBACK TO delete_location;
1122     --
1123     -- Only set output warning arguments
1124     -- (Any key or derived arguments must be set to null
1125     -- when validation only mode is being used.)
1126     --
1127     hr_utility.set_location(' Leaving:'||l_proc, 80);
1128   WHEN OTHERS THEN
1129     --
1130     -- A validation or unexpected error has occurred
1131     ROLLBACK TO delete_location;
1132     hr_utility.set_location(' Leaving:'||l_proc, 90);
1133     RAISE;
1134     --
1135 END delete_location;
1136 --
1137 
1138 --------------------------------------------------------------------------------
1139 -- ----------------------------------------------------------------------------
1140 -- |---------------------< create_location_legal_adr >-----------------------|
1141 -- ----------------------------------------------------------------------------
1142 --
1143 PROCEDURE create_location_legal_adr
1144   (   p_validate                       IN  BOOLEAN   DEFAULT false
1145      ,p_effective_date                 IN  DATE
1146      ,p_language_code                  IN  VARCHAR2  DEFAULT hr_api.userenv_lang
1147      ,p_location_code                  IN  VARCHAR2
1148      ,p_description                    IN  VARCHAR2  DEFAULT NULL
1149      ,p_timezone_code                  IN  VARCHAR2  DEFAULT NULL
1150      ,p_address_line_1                 IN  VARCHAR2  DEFAULT NULL
1151      ,p_address_line_2                 IN  VARCHAR2  DEFAULT NULL
1152      ,p_address_line_3                 IN  VARCHAR2  DEFAULT NULL
1153      ,p_country                        IN  VARCHAR2  DEFAULT NULL
1154      ,p_inactive_date                  IN  DATE      DEFAULT NULL
1155      ,p_postal_code                    IN  VARCHAR2  DEFAULT NULL
1156      ,p_region_1                       IN  VARCHAR2  DEFAULT NULL
1157      ,p_region_2                       IN  VARCHAR2  DEFAULT NULL
1158      ,p_region_3                       IN  VARCHAR2  DEFAULT NULL
1159      ,p_style                          IN  VARCHAR2  DEFAULT NULL
1160      ,p_town_or_city                   IN  VARCHAR2  DEFAULT NULL
1161   /*Added for bug8703747 */
1162      ,p_telephone_number_1             IN  VARCHAR2  DEFAULT NULL
1163      ,p_telephone_number_2             IN  VARCHAR2  DEFAULT NULL
1164      ,p_telephone_number_3             IN  VARCHAR2  DEFAULT NULL
1165      ,p_loc_information13              IN  VARCHAR2  DEFAULT NULL
1166      ,p_loc_information14              IN  VARCHAR2  DEFAULT NULL
1167      ,p_loc_information15              IN  VARCHAR2  DEFAULT NULL
1168      ,p_loc_information16              IN  VARCHAR2  DEFAULT NULL
1169      ,p_loc_information17              IN  VARCHAR2  DEFAULT NULL
1170      ,p_loc_information18              IN  VARCHAR2  DEFAULT NULL
1171      ,p_loc_information19              IN  VARCHAR2  DEFAULT NULL
1172      ,p_loc_information20              IN  VARCHAR2  DEFAULT NULL
1173 /*Changes end for bug8703747 */
1174      ,p_attribute_category             IN  VARCHAR2  DEFAULT NULL
1175      ,p_attribute1                     IN  VARCHAR2  DEFAULT NULL
1176      ,p_attribute2                     IN  VARCHAR2  DEFAULT NULL
1177      ,p_attribute3                     IN  VARCHAR2  DEFAULT NULL
1178      ,p_attribute4                     IN  VARCHAR2  DEFAULT NULL
1179      ,p_attribute5                     IN  VARCHAR2  DEFAULT NULL
1180      ,p_attribute6                     IN  VARCHAR2  DEFAULT NULL
1181      ,p_attribute7                     IN  VARCHAR2  DEFAULT NULL
1182      ,p_attribute8                     IN  VARCHAR2  DEFAULT NULL
1183      ,p_attribute9                     IN  VARCHAR2  DEFAULT NULL
1184      ,p_attribute10                    IN  VARCHAR2  DEFAULT NULL
1185      ,p_attribute11                    IN  VARCHAR2  DEFAULT NULL
1186      ,p_attribute12                    IN  VARCHAR2  DEFAULT NULL
1187      ,p_attribute13                    IN  VARCHAR2  DEFAULT NULL
1188      ,p_attribute14                    IN  VARCHAR2  DEFAULT NULL
1189      ,p_attribute15                    IN  VARCHAR2  DEFAULT NULL
1190      ,p_attribute16                    IN  VARCHAR2  DEFAULT NULL
1191      ,p_attribute17                    IN  VARCHAR2  DEFAULT NULL
1192      ,p_attribute18                    IN  VARCHAR2  DEFAULT NULL
1193      ,p_attribute19                    IN  VARCHAR2  DEFAULT NULL
1194      ,p_attribute20                    IN  VARCHAR2  DEFAULT NULL
1195      ,p_business_group_id              IN  NUMBER    DEFAULT NULL
1196      ,p_location_id                    OUT NOCOPY NUMBER
1197      ,p_object_version_number          OUT NOCOPY NUMBER
1198 
1199   ) IS
1200   --
1201   -- Declare cursors and local variables
1202   --
1203   l_proc                  VARCHAR2(72) := g_package||'create_location_legal_adr';
1204   l_location_id           hr_locations_all.location_id%TYPE;
1205   l_object_version_number hr_locations_all.object_version_number%TYPE;
1206   l_language_code         hr_locations_all_tl.language%TYPE;
1207   l_inactive_date         DATE;
1208   --
1209 BEGIN
1210   --
1211   hr_utility.set_location('Entering:'|| l_proc, 10);
1212   --
1213   -- Issue a savepoint
1214   --
1215   savepoint create_location_legal_adr;
1216   --
1217   hr_utility.set_location(l_proc, 15);
1218   --
1219   --  All date input parameters must be truncated to remove time elements
1220   --
1221   l_inactive_date := trunc (p_inactive_date);
1222   --
1223   --
1224   -- Validate the language parameter.  l_language_code should be passed to functions
1225   -- instead of p_language_code from now on, to allow an IN OUT parameter to
1226   -- be passed through.
1227   --
1228   l_language_code := p_language_code;
1229   hr_api.validate_language_code(p_language_code => l_language_code);
1230   --
1231   hr_utility.set_location(l_proc, 20);
1232   --
1233 
1234     BEGIN
1235     --
1236     -- Start of API User Hook for the before hook of create_generic_location
1237     --
1238     hr_location_bk4.create_location_legal_adr_b(
1239      p_effective_date                => p_effective_date
1240     ,p_language_code                 => l_language_code
1241     ,p_location_code                 => p_location_code
1242     ,p_description                   => p_description
1243     ,p_timezone_code                 => p_timezone_code
1244     ,p_address_line_1                => p_address_line_1
1245     ,p_address_line_2                => p_address_line_2
1246     ,p_address_line_3                => p_address_line_3
1247     ,p_country                       => p_country
1248     ,p_inactive_date                 => l_inactive_date
1249     ,p_postal_code                   => p_postal_code
1250     ,p_region_1                      => p_region_1
1251     ,p_region_2                      => p_region_2
1252     ,p_region_3                      => p_region_3
1253     ,p_style                         => p_style
1254     ,p_town_or_city                  => p_town_or_city
1255     ,p_attribute_category            => p_attribute_category
1256    /* Added for bug8703747*/
1257      ,p_telephone_number_1            => p_telephone_number_1
1258     ,p_telephone_number_2            => p_telephone_number_2
1259     ,p_telephone_number_3            => p_telephone_number_3
1260     ,p_loc_information13             => p_loc_information13
1261     ,p_loc_information14             => p_loc_information14
1262     ,p_loc_information15             => p_loc_information15
1263     ,p_loc_information16             => p_loc_information16
1264     ,p_loc_information17             => p_loc_information17
1265     ,p_loc_information18             => p_loc_information18
1266     ,p_loc_information19             => p_loc_information19
1267     ,p_loc_information20             => p_loc_information20
1268 /* Changes end for bug8703747*/
1269     ,p_attribute1                    => p_attribute1
1270     ,p_attribute2                    => p_attribute2
1271     ,p_attribute3                    => p_attribute3
1272     ,p_attribute4                    => p_attribute4
1273     ,p_attribute5                    => p_attribute5
1274     ,p_attribute6                    => p_attribute6
1275     ,p_attribute7                    => p_attribute7
1276     ,p_attribute8                    => p_attribute8
1277     ,p_attribute9                    => p_attribute9
1278     ,p_attribute10                   => p_attribute10
1279     ,p_attribute11                   => p_attribute11
1280     ,p_attribute12                   => p_attribute12
1281     ,p_attribute13                   => p_attribute13
1282     ,p_attribute14                   => p_attribute14
1283     ,p_attribute15                   => p_attribute15
1284     ,p_attribute16                   => p_attribute16
1285     ,p_attribute17                   => p_attribute17
1286     ,p_attribute18                   => p_attribute18
1287     ,p_attribute19                   => p_attribute19
1288     ,p_attribute20                   => p_attribute20
1289     ,p_business_group_id             => p_business_group_id
1290      );
1291      EXCEPTION
1292        WHEN hr_api.cannot_find_prog_unit THEN
1293          hr_api.cannot_find_prog_unit_error
1294            (  p_module_name => 'create_location_legal_adr'
1295              ,p_hook_type   => 'BP'
1296            );
1297     --
1298     -- End of API User Hook for the before hook of create_generic_location
1299     --
1300   END;
1301 
1302   -- Process Logic
1303   --
1304   -- Call the internal API
1305 
1306   hr_location_internal.create_generic_location
1307   (   p_effective_date                => p_effective_date
1308      ,p_location_id                   => l_location_id
1309      ,p_object_version_number         => l_object_version_number
1310      ,p_location_code                 => p_location_code
1311      ,p_address_line_1                => p_address_line_1
1312      ,p_address_line_2                => p_address_line_2
1313      ,p_address_line_3                => p_address_line_3
1314      ,p_country                       => p_country
1315      ,p_description                   => p_description
1316      ,p_inactive_date                 => l_inactive_date
1317      ,p_postal_code                   => p_postal_code
1318      ,p_region_1                      => p_region_1
1319      ,p_region_2                      => p_region_2
1320      ,p_region_3                      => p_region_3
1321      ,p_style                         => p_style
1322      ,p_town_or_city                  => p_town_or_city
1323      /* Added for bug8703747*/
1324      ,p_telephone_number_1            => p_telephone_number_1
1325     ,p_telephone_number_2            => p_telephone_number_2
1326     ,p_telephone_number_3            => p_telephone_number_3
1327     ,p_loc_information13             => p_loc_information13
1328     ,p_loc_information14             => p_loc_information14
1329     ,p_loc_information15             => p_loc_information15
1330     ,p_loc_information16             => p_loc_information16
1331     ,p_loc_information17             => p_loc_information17
1332     ,p_loc_information18             => p_loc_information18
1333     ,p_loc_information19             => p_loc_information19
1334     ,p_loc_information20             => p_loc_information20
1335 /* Changes end for bug8703747*/
1336      ,p_attribute_category            => p_attribute_category
1337      ,p_attribute1                    => p_attribute1
1338      ,p_attribute2                    => p_attribute2
1339      ,p_attribute3                    => p_attribute3
1340      ,p_attribute4                    => p_attribute4
1341      ,p_attribute5                    => p_attribute5
1342      ,p_attribute6                    => p_attribute6
1343      ,p_attribute7                    => p_attribute7
1344      ,p_attribute8                    => p_attribute8
1345      ,p_attribute9                    => p_attribute9
1346      ,p_attribute10                   => p_attribute10
1347      ,p_attribute11                   => p_attribute11
1348      ,p_attribute12                   => p_attribute12
1349      ,p_attribute13                   => p_attribute13
1350      ,p_attribute14                   => p_attribute14
1351      ,p_attribute15                   => p_attribute15
1352      ,p_attribute16                   => p_attribute16
1353      ,p_attribute17                   => p_attribute17
1354      ,p_attribute18                   => p_attribute18
1355      ,p_attribute19                   => p_attribute19
1356      ,p_attribute20                   => p_attribute20
1357      ,p_legal_address_flag            => 'Y'
1358      ,p_business_group_id             => p_business_group_id
1359    );
1360 
1361   --
1362   BEGIN
1363     --
1364     -- Start of API User Hook for the after hook of create_generic_location
1365     --
1366     hr_location_bk4.create_location_legal_adr_a
1367       (
1368      p_effective_date                => p_effective_date
1369     ,p_language_code                 => l_language_code
1370     ,p_location_code                 => p_location_code
1371     ,p_description                   => p_description
1372     ,p_timezone_code                 => p_timezone_code
1373     ,p_address_line_1                => p_address_line_1
1374     ,p_address_line_2                => p_address_line_2
1375     ,p_address_line_3                => p_address_line_3
1376     ,p_country                       => p_country
1377     ,p_inactive_date                 => l_inactive_date
1378     ,p_postal_code                   => p_postal_code
1379     ,p_region_1                      => p_region_1
1380     ,p_region_2                      => p_region_2
1381     ,p_region_3                      => p_region_3
1382     ,p_style                         => p_style
1383     ,p_town_or_city                  => p_town_or_city
1384     ,p_attribute_category            => p_attribute_category
1385     /* Added for bug8703747*/
1386      ,p_telephone_number_1            => p_telephone_number_1
1387     ,p_telephone_number_2            => p_telephone_number_2
1388     ,p_telephone_number_3            => p_telephone_number_3
1389     ,p_loc_information13             => p_loc_information13
1390     ,p_loc_information14             => p_loc_information14
1391     ,p_loc_information15             => p_loc_information15
1392     ,p_loc_information16             => p_loc_information16
1393     ,p_loc_information17             => p_loc_information17
1394     ,p_loc_information18             => p_loc_information18
1395     ,p_loc_information19             => p_loc_information19
1396     ,p_loc_information20             => p_loc_information20
1397 /* Changes end for bug8703747*/
1398     ,p_attribute1                    => p_attribute1
1399     ,p_attribute2                    => p_attribute2
1400     ,p_attribute3                    => p_attribute3
1401     ,p_attribute4                    => p_attribute4
1402     ,p_attribute5                    => p_attribute5
1403     ,p_attribute6                    => p_attribute6
1404     ,p_attribute7                    => p_attribute7
1405     ,p_attribute8                    => p_attribute8
1406     ,p_attribute9                    => p_attribute9
1407     ,p_attribute10                   => p_attribute10
1408     ,p_attribute11                   => p_attribute11
1409     ,p_attribute12                   => p_attribute12
1410     ,p_attribute13                   => p_attribute13
1411     ,p_attribute14                   => p_attribute14
1412     ,p_attribute15                   => p_attribute15
1413     ,p_attribute16                   => p_attribute16
1414     ,p_attribute17                   => p_attribute17
1415     ,p_attribute18                   => p_attribute18
1416     ,p_attribute19                   => p_attribute19
1417     ,p_attribute20                   => p_attribute20
1418     ,p_business_group_id             => p_business_group_id
1419     ,p_location_id                   => l_location_id
1420     ,p_object_version_number         => l_object_version_number
1421    );
1422    EXCEPTION
1423     WHEN hr_api.cannot_find_prog_unit THEN
1424       hr_api.cannot_find_prog_unit_error
1425         (p_module_name => 'create_location_legal_adr'
1426         ,p_hook_type   => 'AP'
1427         );
1428     --
1429     -- End of API User Hook for the after hook of create_generic_location
1430     --
1431   END;
1432 
1433   hr_utility.set_location(l_proc, 60);
1434   --
1435   -- When in validation only mode raise the Validate_Enabled exception
1436   --
1437     IF p_validate THEN
1438     RAISE hr_api.validate_enabled;
1439   END IF;
1440   --
1441   -- Set all output arguments
1442   --
1443   p_location_id := l_location_id;
1444   p_object_version_number := l_object_version_number;
1445 EXCEPTION
1446   --
1447   WHEN hr_api.validate_enabled THEN
1448     --
1449     -- As the Validate_Enabled exception has been raised
1450     -- we must rollback to the savepoint
1451     --
1452     ROLLBACK TO create_location_legal_adr;
1453     --
1454     -- Only set output warning arguments
1455     -- (Any key or derived arguments must be set to null
1456     -- when validation only mode is being used.)
1457     --
1458     p_location_id := NULL;
1459     p_object_version_number  := NULL;
1460     hr_utility.set_location(' Leaving:'||l_proc, 80);
1461   WHEN OTHERS THEN
1462     --
1463     -- A validation or unexpected error has occurred
1464     ROLLBACK TO create_location_legal_adr;
1465     -- Set OUT parameters.
1466     p_location_id := NULL;
1467     p_object_version_number  := NULL;
1468     hr_utility.set_location(' Leaving:'||l_proc, 90);
1469     RAISE;
1470    --
1471 END create_location_legal_adr;
1472 -- ----------------------------------------------------------------------------
1473 -- |--------------------< update_location_legal_adr >--------------------------|
1474 -- ----------------------------------------------------------------------------
1475 --
1476 PROCEDURE update_location_legal_adr
1477   (   p_validate                       IN  BOOLEAN   DEFAULT false
1478      ,p_effective_date                 IN  DATE
1479      ,p_location_id                    IN  NUMBER
1480      ,p_description                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1481      ,p_timezone_code                  IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1482      ,p_address_line_1                 IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1483      ,p_address_line_2                 IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1484      ,p_address_line_3                 IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1485      ,p_inactive_date                  IN  DATE      DEFAULT hr_api.g_date
1486      ,p_postal_code                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1487      ,p_region_1                       IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1488      ,p_region_2                       IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1489      ,p_region_3                       IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1490      ,p_style                          IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1491      ,p_town_or_city                   IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1492     /* Added for bug8703747*/
1493      ,p_telephone_number_1             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1494      ,p_telephone_number_2             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1495      ,p_telephone_number_3             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1496      ,p_loc_information13              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1497      ,p_loc_information14              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1498      ,p_loc_information15              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1499      ,p_loc_information16              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1500      ,p_loc_information17              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1501      ,p_loc_information18              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1502      ,p_loc_information19              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1503      ,p_loc_information20              IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1504     /*Changes end for bug8703747 */
1505      ,p_attribute_category             IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1506      ,p_attribute1                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1507      ,p_attribute2                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1508      ,p_attribute3                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1509      ,p_attribute4                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1510      ,p_attribute5                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1511      ,p_attribute6                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1512      ,p_attribute7                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1513      ,p_attribute8                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1514      ,p_attribute9                     IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1515      ,p_attribute10                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1516      ,p_attribute11                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1517      ,p_attribute12                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1518      ,p_attribute13                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1519      ,p_attribute14                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1520      ,p_attribute15                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1521      ,p_attribute16                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1522      ,p_attribute17                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1523      ,p_attribute18                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1524      ,p_attribute19                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1525      ,p_attribute20                    IN  VARCHAR2  DEFAULT hr_api.g_varchar2
1526      ,p_object_version_number          IN OUT NOCOPY NUMBER
1527   ) IS
1528   --
1529   -- Declare cursors and local variables
1530   --
1531   l_proc                  VARCHAR2(72) := g_package||'update_location_legal_adr';
1532   l_object_version_number hr_locations.object_version_number%TYPE;
1533   l_temp_ovn   number(9) := p_object_version_number;
1534   --
1535 BEGIN
1536   --
1537   hr_utility.set_location('Entering:'|| l_proc, 10);
1538   --
1539   -- Issue a savepoint.
1540   --
1541   savepoint update_location_legal_adr;
1542   --
1543   -- Process Logic
1544   --
1545   l_object_version_number := p_object_version_number;
1546   --
1547     BEGIN
1548     --
1549     -- Start of API User Hook for the before hook of update_location_legal_adr
1550     --
1551     hr_location_bk5.update_location_legal_adr_b
1552       (
1553      p_effective_date                => p_effective_date
1554     ,p_location_id                   => p_location_id
1555     ,p_description                   => p_description
1556     ,p_timezone_code                 => p_timezone_code
1557     ,p_address_line_1                => p_address_line_1
1558     ,p_address_line_2                => p_address_line_2
1559     ,p_address_line_3                => p_address_line_3
1560     ,p_inactive_date                 => p_inactive_date
1561     ,p_postal_code                   => p_postal_code
1562     ,p_region_1                      => p_region_1
1563     ,p_region_2                      => p_region_2
1564     ,p_region_3                      => p_region_3
1565     ,p_style                         => p_style
1566     ,p_town_or_city                  => p_town_or_city
1567       /*Added for bug8703747 */
1568      ,p_telephone_number_1            => p_telephone_number_1
1569     ,p_telephone_number_2            => p_telephone_number_2
1570     ,p_telephone_number_3            => p_telephone_number_3
1571     ,p_loc_information13             => p_loc_information13
1572     ,p_loc_information14             => p_loc_information14
1573     ,p_loc_information15             => p_loc_information15
1574     ,p_loc_information16             => p_loc_information16
1575     ,p_loc_information17             => p_loc_information17
1576     ,p_loc_information18             => p_loc_information18
1577     ,p_loc_information19             => p_loc_information19
1578     ,p_loc_information20             => p_loc_information20
1579  /*Changes end for bug8703747 */
1580     ,p_attribute_category            => p_attribute_category
1581     ,p_attribute1                    => p_attribute1
1582     ,p_attribute2                    => p_attribute2
1583     ,p_attribute3                    => p_attribute3
1584     ,p_attribute4                    => p_attribute4
1585     ,p_attribute5                    => p_attribute5
1586     ,p_attribute6                    => p_attribute6
1587     ,p_attribute7                    => p_attribute7
1588     ,p_attribute8                    => p_attribute8
1589     ,p_attribute9                    => p_attribute9
1590     ,p_attribute10                   => p_attribute10
1591     ,p_attribute11                   => p_attribute11
1592     ,p_attribute12                   => p_attribute12
1593     ,p_attribute13                   => p_attribute13
1594     ,p_attribute14                   => p_attribute14
1595     ,p_attribute15                   => p_attribute15
1596     ,p_attribute16                   => p_attribute16
1597     ,p_attribute17                   => p_attribute17
1598     ,p_attribute18                   => p_attribute18
1599     ,p_attribute19                   => p_attribute19
1600     ,p_attribute20                   => p_attribute20
1601     ,p_object_version_number         => l_object_version_number
1602       );
1603    EXCEPTION
1604     WHEN hr_api.cannot_find_prog_unit THEN
1605       hr_api.cannot_find_prog_unit_error
1606         (p_module_name => 'update_location_legal_adr'
1607         ,p_hook_type   => 'BP'
1608         );
1609     --
1610     -- End of API User Hook for the before hook of update_location_legal_adr
1611     --
1612   END;
1613   --
1614   -- Call the internal API
1615   --
1616   hr_location_internal.update_generic_location
1617     ( p_effective_date                => p_effective_date
1618      ,p_location_id                   => p_location_id
1619      ,p_object_version_number         => l_object_version_number
1620      ,p_description                   => p_description
1621      ,p_address_line_1                => p_address_line_1
1622      ,p_address_line_2                => p_address_line_2
1623      ,p_address_line_3                => p_address_line_3
1624      ,p_inactive_date                 => p_inactive_date
1625      ,p_postal_code                   => p_postal_code
1626      ,p_region_1                      => p_region_1
1627      ,p_region_2                      => p_region_2
1628      ,p_region_3                      => p_region_3
1629      ,p_style                         => p_style
1630      ,p_town_or_city                  => p_town_or_city
1631        /*Added for bug8703747 */
1632      ,p_telephone_number_1            => p_telephone_number_1
1633     ,p_telephone_number_2            => p_telephone_number_2
1634     ,p_telephone_number_3            => p_telephone_number_3
1635     ,p_loc_information13             => p_loc_information13
1636     ,p_loc_information14             => p_loc_information14
1637     ,p_loc_information15             => p_loc_information15
1638     ,p_loc_information16             => p_loc_information16
1639     ,p_loc_information17             => p_loc_information17
1640     ,p_loc_information18             => p_loc_information18
1641     ,p_loc_information19             => p_loc_information19
1642     ,p_loc_information20             => p_loc_information20
1643  /*Changes end for bug8703747 */
1644      ,p_attribute_category            => p_attribute_category
1645      ,p_attribute1                    => p_attribute1
1646      ,p_attribute2                    => p_attribute2
1647      ,p_attribute3                    => p_attribute3
1648      ,p_attribute4                    => p_attribute4
1649      ,p_attribute5                    => p_attribute5
1650      ,p_attribute6                    => p_attribute6
1651      ,p_attribute7                    => p_attribute7
1652      ,p_attribute8                    => p_attribute8
1653      ,p_attribute9                    => p_attribute9
1654      ,p_attribute10                   => p_attribute10
1655      ,p_attribute11                   => p_attribute11
1656      ,p_attribute12                   => p_attribute12
1657      ,p_attribute13                   => p_attribute13
1658      ,p_attribute14                   => p_attribute14
1659      ,p_attribute15                   => p_attribute15
1660      ,p_attribute16                   => p_attribute16
1661      ,p_attribute17                   => p_attribute17
1662      ,p_attribute18                   => p_attribute18
1663      ,p_attribute19                   => p_attribute19
1664      ,p_attribute20                   => p_attribute20
1665     );
1666 
1667 --
1668     BEGIN
1669     --
1670     -- Start of API User Hook for the after hook of update_location_legal_adr
1671     --
1672     hr_location_bk5.update_location_legal_adr_a
1673       (
1674          p_effective_date                => p_effective_date
1675         ,p_location_id                   => p_location_id
1676         ,p_description                   => p_description
1677         ,p_timezone_code                 => p_timezone_code
1678         ,p_address_line_1                => p_address_line_1
1679         ,p_address_line_2                => p_address_line_2
1680         ,p_address_line_3                => p_address_line_3
1681         ,p_inactive_date                 => p_inactive_date
1682         ,p_postal_code                   => p_postal_code
1683         ,p_region_1                      => p_region_1
1684         ,p_region_2                      => p_region_2
1685         ,p_region_3                      => p_region_3
1686         ,p_style                         => p_style
1687         ,p_town_or_city                  => p_town_or_city
1688           /*Added for bug8703747 */
1689      ,p_telephone_number_1            => p_telephone_number_1
1690     ,p_telephone_number_2            => p_telephone_number_2
1691     ,p_telephone_number_3            => p_telephone_number_3
1692     ,p_loc_information13             => p_loc_information13
1693     ,p_loc_information14             => p_loc_information14
1694     ,p_loc_information15             => p_loc_information15
1695     ,p_loc_information16             => p_loc_information16
1696     ,p_loc_information17             => p_loc_information17
1697     ,p_loc_information18             => p_loc_information18
1698     ,p_loc_information19             => p_loc_information19
1699     ,p_loc_information20             => p_loc_information20
1700  /*Changes end for bug8703747 */
1701         ,p_attribute_category            => p_attribute_category
1702    ,p_attribute1                    => p_attribute1
1703    ,p_attribute2                    => p_attribute2
1704    ,p_attribute3                    => p_attribute3
1705    ,p_attribute4                    => p_attribute4
1706    ,p_attribute5                    => p_attribute5
1707    ,p_attribute6                    => p_attribute6
1708    ,p_attribute7                    => p_attribute7
1709    ,p_attribute8                    => p_attribute8
1710    ,p_attribute9                    => p_attribute9
1711    ,p_attribute10                   => p_attribute10
1712    ,p_attribute11                   => p_attribute11
1713    ,p_attribute12                   => p_attribute12
1714    ,p_attribute13                   => p_attribute13
1715    ,p_attribute14                   => p_attribute14
1716    ,p_attribute15                   => p_attribute15
1717    ,p_attribute16                   => p_attribute16
1718    ,p_attribute17                   => p_attribute17
1719    ,p_attribute18                   => p_attribute18
1720    ,p_attribute19                   => p_attribute19
1721    ,p_attribute20                   => p_attribute20
1722         ,p_object_version_number         => l_object_version_number
1723       );
1724    EXCEPTION
1725     WHEN hr_api.cannot_find_prog_unit THEN
1726       hr_api.cannot_find_prog_unit_error
1727         (p_module_name => 'update_location_legal_adr'
1728         ,p_hook_type   => 'AP'
1729         );
1730     --
1731     -- End of API User Hook for the after hook of update_location_legal_adr
1732     --
1733   END;
1734   --
1735   hr_utility.set_location(l_proc, 60);
1736   --
1737   -- When in validation only mode raise the Validate_Enabled exception
1738   --
1739   IF p_validate THEN
1740     RAISE hr_api.validate_enabled;
1741   END IF;
1742   --
1743   -- Set all output arguments.  If p_validate was TRUE, this bit is
1744   -- never reached, so p_object_version_number is passed back unchanged.
1745   --
1746   p_object_version_number := l_object_version_number;
1747   --
1748   hr_utility.set_location(' Leaving:'||l_proc, 70);
1749   --
1750 EXCEPTION
1751   --
1752   WHEN hr_api.validate_enabled THEN
1753     --
1754     -- As the Validate_Enabled exception has been raised
1755     -- we must rollback to the savepoint
1756     --
1757     ROLLBACK TO update_location_legal_adr;
1758     --
1759     -- Only set output warning arguments
1760     -- (Any key or derived arguments must be set to null
1761     -- when validation only mode is being used.)
1762     -- Reset IN OUT parameters.
1763     p_object_version_number := l_temp_ovn;
1764     hr_utility.set_location(' Leaving:'||l_proc, 80);
1765   WHEN OTHERS THEN
1766     --
1767     -- A validation or unexpected error has occurred
1768     ROLLBACK TO update_location_legal_adr;
1769     -- Reset IN OUT parameters.
1770     p_object_version_number := l_temp_ovn;
1771     hr_utility.set_location(' Leaving:'||l_proc, 90);
1772     RAISE;
1773     --
1774     --
1775 END update_location_legal_adr;
1776 --------------------------------------------------------------------------------
1777 PROCEDURE set_translation_globals(p_business_group_id IN NUMBER,
1778               p_legislation_code IN VARCHAR2) IS
1779 BEGIN
1780    g_business_group_id := p_business_group_id;
1781    g_legislation_code := p_legislation_code;
1782 END;
1783 -- ----------------------------------------------------------------------------
1784 -- |----------------------< disable_location_legal_adr >---------------------|
1785 -- ----------------------------------------------------------------------------
1786 --
1787 PROCEDURE disable_location_legal_adr
1788   (   p_validate                       IN  BOOLEAN   DEFAULT false
1789      ,p_effective_date                 IN  DATE
1790      ,p_location_id                    IN  NUMBER
1791      ,p_object_version_number          IN OUT NOCOPY  NUMBER
1792 
1793   ) IS
1794   --
1795   -- Declare cursors and local variables
1796   --
1797   l_proc                  VARCHAR2(72) := g_package||'disable_location_legal_adr';
1798   l_object_version_number hr_locations_all.object_version_number%TYPE;
1799   l_temp_ovn   number := p_object_version_number;
1800   --
1801 BEGIN
1802   --
1803   hr_utility.set_location('Entering:'|| l_proc, 10);
1804   --
1805   -- Issue a savepoint
1806   --
1807   savepoint disable_location_legal_adr;
1808   --
1809   hr_utility.set_location(l_proc, 20);
1810   --
1811   -- Process Logic
1812   --
1813   l_object_version_number := p_object_version_number;
1814   --
1815   -- Bug fix 3205662.
1816   -- User hook call added.
1817   --
1818   BEGIN
1819       --
1820       -- Start of API User Hook for the before hook of disable_location_legal_adr
1821       --
1822       hr_location_bk7.disable_location_legal_adr_b
1823       (
1824          p_effective_date    => p_effective_date
1825    ,p_location_id            => p_location_id
1826    ,p_object_version_number  => l_object_version_number
1827       );
1828 
1829   EXCEPTION
1830       WHEN hr_api.cannot_find_prog_unit THEN
1831             hr_api.cannot_find_prog_unit_error
1832               (p_module_name => 'disable_location_legal_adr'
1833               ,p_hook_type   => 'BP'
1834               );
1835        --
1836        -- End of API User Hook for the before hook of disable_location_legal_adr
1837        --
1838   END;
1839   --
1840   -- UPDATE ROW IN HR_LOCATIONS_ALL table
1841   --
1842     hr_location_internal.update_generic_location
1843   (   p_effective_date                => p_effective_date
1844      ,p_location_id                   => p_location_id
1845      ,p_object_version_number         => l_object_version_number
1846      ,p_legal_address_flag       => NULL
1847    );
1848 
1849   --
1850   hr_utility.set_location(l_proc, 60);
1851   --
1852   -- Bug fix 3205662.
1853   -- User hook call added.
1854   --
1855   BEGIN
1856      --
1857      -- Start of API User Hook for the after hook of disable_location_legal_adr
1858      --
1859      hr_location_bk7.disable_location_legal_adr_a
1860      (
1861          p_effective_date    => p_effective_date
1862    ,p_location_id            => p_location_id
1863    ,p_object_version_number  => l_object_version_number
1864      );
1865 
1866   EXCEPTION
1867      WHEN hr_api.cannot_find_prog_unit THEN
1868           hr_api.cannot_find_prog_unit_error
1869             (p_module_name => 'disable_location_legal_adr'
1870             ,p_hook_type   => 'AP'
1871             );
1872       --
1873       -- End of API User Hook for the after hook of disable_location_legal_adr
1874       --
1875   END;
1876   --
1877   -- When in validation only mode raise the Validate_Enabled exception
1878   --
1879   IF p_validate THEN
1880     RAISE hr_api.validate_enabled;
1881   END IF;
1882   -- Set all output arguments.  If p_validate was TRUE, this bit is
1883   -- never reached, so p_object_version_number is passed back unchanged.
1884   --
1885   p_object_version_number := l_object_version_number;
1886   --
1887   hr_utility.set_location(' Leaving:'||l_proc, 70);
1888 EXCEPTION
1889   --
1890   WHEN hr_api.validate_enabled THEN
1891     --
1892     -- As the Validate_Enabled exception has been raised
1893     -- we must rollback to the savepoint
1894     --
1895     ROLLBACK TO disable_location_legal_adr;
1896     --
1897     -- Only set output warning arguments
1898     -- (Any key or derived arguments must be set to null
1899     -- when validation only mode is being used.)
1900     -- Reset IN OUT parameters.
1901     p_object_version_number := l_temp_ovn;
1902     hr_utility.set_location(' Leaving:'||l_proc, 80);
1903   WHEN OTHERS THEN
1904     --
1905     -- A validation or unexpected error has occurred
1906     ROLLBACK TO disable_location_legal_adr;
1907     -- Reset IN OUT parameters.
1908     p_object_version_number := l_temp_ovn;
1909     hr_utility.set_location(' Leaving:'||l_proc, 90);
1910     RAISE;
1911    --
1912 END disable_location_legal_adr;
1913 --
1914 -- ----------------------------------------------------------------------------
1915 -- |------------------------< enable_location_legal_adr >---------------------|
1916 -- ----------------------------------------------------------------------------
1917 --
1918 PROCEDURE enable_location_legal_adr
1919   (   p_validate                       IN  BOOLEAN   DEFAULT false
1920      ,p_effective_date                 IN  DATE
1921      ,p_location_id                    IN  NUMBER
1922      ,p_object_version_number          IN OUT NOCOPY  NUMBER
1923   ) IS
1924   --
1925   -- Declare cursors and local variables
1926   --
1927   l_proc                  VARCHAR2(72) := g_package||'enable_location_legal_adr';
1928   l_object_version_number hr_locations_all.object_version_number%TYPE;
1929   l_temp_ovn   number := p_object_version_number;
1930   --
1931 BEGIN
1932   --
1933   hr_utility.set_location('Entering:'|| l_proc, 10);
1934   --
1935   -- Issue a savepoint
1936   --
1937   savepoint enable_location_legal_adr;
1938   --
1939   hr_utility.set_location(l_proc, 20);
1940   --
1941   -- Process Logic
1942   --
1943   l_object_version_number := p_object_version_number;
1944   --
1945   -- Bug fix 3205662.
1946   -- User hook call added.
1947   --
1948   BEGIN
1949         --
1950         -- Start of API User Hook for the before hook of enable_location_legal_adr
1951         --
1952         hr_location_bk6.enable_location_legal_adr_b
1953         (
1954            p_effective_date     => p_effective_date
1955      ,p_location_id            => p_location_id
1956      ,p_object_version_number  => l_object_version_number
1957         );
1958 
1959   EXCEPTION
1960         WHEN hr_api.cannot_find_prog_unit THEN
1961               hr_api.cannot_find_prog_unit_error
1962                 (p_module_name => 'enable_location_legal_adr'
1963                 ,p_hook_type   => 'BP'
1964                 );
1965         --
1966         -- End of API User Hook for the before hook of enable_location_legal_adr
1967         --
1968   END;
1969   --
1970   -- UPDATE ROW IN HR_LOCATIONS_ALL table
1971   --
1972     hr_location_internal.update_generic_location
1973   (   p_effective_date                => p_effective_date
1974      ,p_location_id                   => p_location_id
1975      ,p_object_version_number         => l_object_version_number
1976      ,p_legal_address_flag       => 'Y'
1977    );
1978 
1979   --
1980   hr_utility.set_location(l_proc, 60);
1981   --
1982   -- Bug fix 3205662.
1983   -- User hook call added.
1984   --
1985   BEGIN
1986        --
1987        -- Start of API User Hook for the after hook of enable_location_legal_adr
1988        --
1989        hr_location_bk6.enable_location_legal_adr_a
1990        (
1991            p_effective_date       => p_effective_date
1992      ,p_location_id            => p_location_id
1993      ,p_object_version_number  => l_object_version_number
1994        );
1995   EXCEPTION
1996           WHEN hr_api.cannot_find_prog_unit THEN
1997                 hr_api.cannot_find_prog_unit_error
1998                   (p_module_name => 'enable_location_legal_adr'
1999                   ,p_hook_type   => 'AP'
2000                   );
2001         --
2002         -- End of API User Hook for the after hook of enable_location_legal_adr
2003         --
2004   END;
2005   --
2006   -- When in validation only mode raise the Validate_Enabled exception
2007   --
2008   IF p_validate THEN
2009     RAISE hr_api.validate_enabled;
2010   END IF;
2011   -- Set all output arguments.  If p_validate was TRUE, this bit is
2012   -- never reached, so p_object_version_number is passed back unchanged.
2013   --
2014   p_object_version_number := l_object_version_number;
2015   --
2016   hr_utility.set_location(' Leaving:'||l_proc, 70);
2017 EXCEPTION
2018   --
2019   WHEN hr_api.validate_enabled THEN
2020     --
2021     -- As the Validate_Enabled exception has been raised
2022     -- we must rollback to the savepoint
2023     --
2024     ROLLBACK TO enable_location_legal_adr;
2025     --
2026     -- Only set output warning arguments
2027     -- (Any key or derived arguments must be set to null
2028     -- when validation only mode is being used.)
2029     -- Reset IN OUT parameters.
2030     p_object_version_number := l_temp_ovn;
2031     hr_utility.set_location(' Leaving:'||l_proc, 80);
2032   WHEN OTHERS THEN
2033     --
2034     -- A validation or unexpected error has occurred
2035     ROLLBACK TO enable_location_legal_adr;
2036     -- Reset IN OUT parameters.
2037     p_object_version_number := l_temp_ovn;
2038     hr_utility.set_location(' Leaving:'||l_proc, 90);
2039     RAISE;
2040    --
2041 END enable_location_legal_adr;
2042 --
2043 -----------------------------------------------------------------------------
2044 END hr_location_api;