DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQP_ANALYZED_ALIEN_DATA_API

Source


1 Package Body pqp_analyzed_alien_data_api as
2 /* $Header: pqaadapi.pkb 115.4 2003/01/22 00:53:34 tmehra noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := 'pqp_analyzed_alien_data_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_analyzed_alien_data >--------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_analyzed_alien_data
13   (p_validate                       in  boolean   default false
14   ,p_analyzed_data_id               out nocopy number
15   ,p_assignment_id                  in  number    default null
16   ,p_data_source                    in  varchar2  default null
17   ,p_tax_year                       in  number    default null
18   ,p_current_residency_status       in  varchar2  default null
19   ,p_nra_to_ra_date                 in  date      default null
20   ,p_target_departure_date          in  date      default null
21   ,p_tax_residence_country_code     in  varchar2  default null
22   ,p_treaty_info_update_date        in  date      default null
23   ,p_number_of_days_in_usa          in  number    default null
24   ,p_withldg_allow_eligible_flag    in  varchar2  default null
25   ,p_ra_effective_date              in  date      default null
26   ,p_record_source                  in  varchar2  default null
27   ,p_visa_type                      in  varchar2  default null
28   ,p_j_sub_type                     in  varchar2  default null
29   ,p_primary_activity               in  varchar2  default null
30   ,p_non_us_country_code            in  varchar2  default null
31   ,p_citizenship_country_code       in  varchar2  default null
32   ,p_object_version_number          out nocopy number
33   ,p_effective_date                 in  date
34   ,p_date_8233_signed               in  date      default null
35   ,p_date_w4_signed                 in  date      default null
36   ) is
37   -- p_date_8233_signed and p_date_w4_signed were added by Ashu Gupta
38   -- on 07/27/2000
39   --
40   -- Declare cursors and local variables
41   --
42   l_analyzed_data_id pqp_analyzed_alien_data.analyzed_data_id%TYPE;
43   l_proc varchar2(72) := g_package||'create_analyzed_alien_data';
44   l_object_version_number pqp_analyzed_alien_data.object_version_number%TYPE;
45   --
46 begin
47   --
48   hr_utility.set_location('Entering:'|| l_proc, 10);
49   --
50   -- Issue a savepoint if operating in validation only mode
51   --
52   savepoint create_analyzed_alien_data;
53   --
54   hr_utility.set_location(l_proc, 20);
55   --
56   -- Process Logic
57   --
58   begin
59     --
60     -- Start of API User Hook for the before hook of create_analyzed_alien_data
61     --
62     pqp_analyzed_alien_data_bk1.create_analyzed_alien_data_b
63       (
64        p_assignment_id                  =>  p_assignment_id
65       ,p_data_source                    =>  p_data_source
66       ,p_tax_year                       =>  p_tax_year
67       ,p_current_residency_status       =>  p_current_residency_status
68       ,p_nra_to_ra_date                 =>  p_nra_to_ra_date
69       ,p_target_departure_date          =>  p_target_departure_date
70       ,p_tax_residence_country_code     =>  p_tax_residence_country_code
71       ,p_treaty_info_update_date        =>  p_treaty_info_update_date
72       ,p_number_of_days_in_usa          =>  p_number_of_days_in_usa
73       ,p_withldg_allow_eligible_flag    =>  p_withldg_allow_eligible_flag
74       ,p_ra_effective_date              =>  p_ra_effective_date
75       ,p_record_source                  =>  p_record_source
76       ,p_visa_type                      =>  p_visa_type
77       ,p_j_sub_type                     =>  p_j_sub_type
78       ,p_primary_activity               =>  p_primary_activity
79       ,p_non_us_country_code            =>  p_non_us_country_code
80       ,p_citizenship_country_code       =>  p_citizenship_country_code
81       ,p_effective_date               => trunc(p_effective_date)
82       ,p_date_8233_signed               =>  p_date_8233_signed
83       ,p_date_w4_signed                 =>  p_date_w4_signed
84       );
85   exception
86     when hr_api.cannot_find_prog_unit then
87       hr_api.cannot_find_prog_unit_error
88         (
89          p_module_name => 'CREATE_ANALYZED_ALIEN_DATA'
90         ,p_hook_type   => 'BP'
91         );
92     --
93     -- End of API User Hook for the before hook of create_analyzed_alien_data
94     --
95   end;
96   --
97   pqp_aad_ins.ins
98     (
99      p_analyzed_data_id              => l_analyzed_data_id
100     ,p_assignment_id                 => p_assignment_id
101     ,p_data_source                   => p_data_source
102     ,p_tax_year                      => p_tax_year
103     ,p_current_residency_status      => p_current_residency_status
104     ,p_nra_to_ra_date                => p_nra_to_ra_date
105     ,p_target_departure_date         => p_target_departure_date
106     ,p_tax_residence_country_code    => p_tax_residence_country_code
107     ,p_treaty_info_update_date       => p_treaty_info_update_date
108     ,p_number_of_days_in_usa         => p_number_of_days_in_usa
109     ,p_withldg_allow_eligible_flag   => p_withldg_allow_eligible_flag
110     ,p_ra_effective_date             => p_ra_effective_date
111     ,p_record_source                 => p_record_source
112     ,p_visa_type                     => p_visa_type
113     ,p_j_sub_type                    => p_j_sub_type
114     ,p_primary_activity              => p_primary_activity
115     ,p_non_us_country_code           => p_non_us_country_code
116     ,p_citizenship_country_code      => p_citizenship_country_code
117     ,p_object_version_number         => l_object_version_number
118     ,p_effective_date                => trunc(p_effective_date)
119     ,p_date_8233_signed              =>  p_date_8233_signed
120     ,p_date_w4_signed                =>  p_date_w4_signed
121     );
122   --
123   begin
124     --
125     -- Start of API User Hook for the after hook of create_analyzed_alien_data
126     --
127     pqp_analyzed_alien_data_bk1.create_analyzed_alien_data_a
128       (
129        p_analyzed_data_id               =>  l_analyzed_data_id
130       ,p_assignment_id                  =>  p_assignment_id
131       ,p_data_source                    =>  p_data_source
132       ,p_tax_year                       =>  p_tax_year
133       ,p_current_residency_status       =>  p_current_residency_status
134       ,p_nra_to_ra_date                 =>  p_nra_to_ra_date
135       ,p_target_departure_date          =>  p_target_departure_date
136       ,p_tax_residence_country_code     =>  p_tax_residence_country_code
137       ,p_treaty_info_update_date        =>  p_treaty_info_update_date
138       ,p_number_of_days_in_usa          =>  p_number_of_days_in_usa
139       ,p_withldg_allow_eligible_flag    =>  p_withldg_allow_eligible_flag
140       ,p_ra_effective_date              =>  p_ra_effective_date
141       ,p_record_source                  =>  p_record_source
142       ,p_visa_type                      =>  p_visa_type
143       ,p_j_sub_type                     =>  p_j_sub_type
144       ,p_primary_activity               =>  p_primary_activity
145       ,p_non_us_country_code            =>  p_non_us_country_code
146       ,p_citizenship_country_code       =>  p_citizenship_country_code
147       ,p_object_version_number          =>  l_object_version_number
148       ,p_effective_date                 => trunc(p_effective_date)
149       ,p_date_8233_signed               =>  p_date_8233_signed
150       ,p_date_w4_signed                 =>  p_date_w4_signed
151       );
152   exception
153     when hr_api.cannot_find_prog_unit then
154       hr_api.cannot_find_prog_unit_error
155         (p_module_name => 'CREATE_ANALYZED_ALIEN_DATA'
156         ,p_hook_type   => 'AP'
157         );
158     --
159     -- End of API User Hook for the after hook of create_analyzed_alien_data
160     --
161   end;
162   --
163   hr_utility.set_location(l_proc, 60);
164   --
165   -- When in validation only mode raise the Validate_Enabled exception
166   --
167   if p_validate then
168     raise hr_api.validate_enabled;
169   end if;
170   --
171   -- Set all output arguments
172   --
173   p_analyzed_data_id := l_analyzed_data_id;
174   p_object_version_number := l_object_version_number;
175   --
176   hr_utility.set_location(' Leaving:'||l_proc, 70);
177   --
178 exception
179   --
180   when hr_api.validate_enabled then
181     --
182     -- As the Validate_Enabled exception has been raised
183     -- we must rollback to the savepoint
184     --
185     ROLLBACK TO create_analyzed_alien_data;
186     --
187     -- Only set output warning arguments
188     -- (Any key or derived arguments must be set to null
189     -- when validation only mode is being used.)
190     --
191     p_analyzed_data_id := null;
192     p_object_version_number  := null;
193     hr_utility.set_location(' Leaving:'||l_proc, 80);
194     --
195   when others then
196     --
197     -- A validation or unexpected error has occured
198     --
199     ROLLBACK TO create_analyzed_alien_data;
200     p_analyzed_data_id := l_analyzed_data_id;
201     p_object_version_number  := null;
202     hr_utility.set_location(' Leaving:'||l_proc, 90);
203     raise;
204     --
205 end create_analyzed_alien_data;
206 -- ----------------------------------------------------------------------------
207 -- |------------------------< update_analyzed_alien_data >--- ------------------|
208 -- ----------------------------------------------------------------------------
209 --
210 procedure update_analyzed_alien_data
211   (p_validate                       in  boolean   default false
212   ,p_analyzed_data_id               in  number
213   ,p_assignment_id                  in  number    default hr_api.g_number
214   ,p_data_source                    in  varchar2  default hr_api.g_varchar2
215   ,p_tax_year                       in  number    default hr_api.g_number
216   ,p_current_residency_status       in  varchar2  default hr_api.g_varchar2
217   ,p_nra_to_ra_date                 in  date      default hr_api.g_date
218   ,p_target_departure_date          in  date      default hr_api.g_date
219   ,p_tax_residence_country_code     in  varchar2  default hr_api.g_varchar2
220   ,p_treaty_info_update_date        in  date      default hr_api.g_date
221   ,p_number_of_days_in_usa          in  number    default hr_api.g_number
222   ,p_withldg_allow_eligible_flag    in  varchar2  default hr_api.g_varchar2
223   ,p_ra_effective_date              in  date      default hr_api.g_date
224   ,p_record_source                  in  varchar2  default hr_api.g_varchar2
225   ,p_visa_type                      in  varchar2  default hr_api.g_varchar2
226   ,p_j_sub_type                     in  varchar2  default hr_api.g_varchar2
227   ,p_primary_activity               in  varchar2  default hr_api.g_varchar2
228   ,p_non_us_country_code            in  varchar2  default hr_api.g_varchar2
229   ,p_citizenship_country_code       in  varchar2  default hr_api.g_varchar2
230   ,p_object_version_number          in out nocopy number
231   ,p_effective_date                 in  date
232   ,p_date_8233_signed               in  date      default hr_api.g_date
233   ,p_date_w4_signed                 in  date      default hr_api.g_date
234   ) is
235   --
236   -- Declare cursors and local variables
237   --
238   l_proc varchar2(72) := g_package||'update_analyzed_alien_data';
239   l_object_version_number pqp_analyzed_alien_data.object_version_number%TYPE;
240   --
241 begin
242   --
243   hr_utility.set_location('Entering:'|| l_proc, 10);
244   --
245   -- Issue a savepoint if operating in validation only mode
246   --
247   savepoint update_analyzed_alien_data;
248   --
249   hr_utility.set_location(l_proc, 20);
250   --
251   -- Process Logic
252   --
253   l_object_version_number := p_object_version_number;
254   --
255   begin
256     --
257     -- Start of API User Hook for the before hook of update_analyzed_alien_data
258     --
259     pqp_analyzed_alien_data_bk2.update_analyzed_alien_data_b
260       (
261        p_analyzed_data_id               =>  p_analyzed_data_id
262       ,p_assignment_id                  =>  p_assignment_id
263       ,p_data_source                    =>  p_data_source
264       ,p_tax_year                       =>  p_tax_year
265       ,p_current_residency_status       =>  p_current_residency_status
266       ,p_nra_to_ra_date                 =>  p_nra_to_ra_date
267       ,p_target_departure_date          =>  p_target_departure_date
268       ,p_tax_residence_country_code     =>  p_tax_residence_country_code
269       ,p_treaty_info_update_date        =>  p_treaty_info_update_date
270       ,p_number_of_days_in_usa          =>  p_number_of_days_in_usa
271       ,p_withldg_allow_eligible_flag    =>  p_withldg_allow_eligible_flag
272       ,p_ra_effective_date              =>  p_ra_effective_date
273       ,p_record_source                  =>  p_record_source
274       ,p_visa_type                      =>  p_visa_type
275       ,p_j_sub_type                     =>  p_j_sub_type
276       ,p_primary_activity               =>  p_primary_activity
277       ,p_non_us_country_code            =>  p_non_us_country_code
278       ,p_citizenship_country_code       =>  p_citizenship_country_code
279       ,p_object_version_number          =>  p_object_version_number
280     ,p_effective_date                 => trunc(p_effective_date)
281       ,p_date_8233_signed               =>  p_date_8233_signed
282       ,p_date_w4_signed                 =>  p_date_w4_signed
283       );
284   exception
285     when hr_api.cannot_find_prog_unit then
286       hr_api.cannot_find_prog_unit_error
287         (p_module_name => 'UPDATE_ANALYZED_ALIEN_DATA'
288         ,p_hook_type   => 'BP'
289         );
290     --
291     -- End of API User Hook for the before hook of update_analyzed_alien_data
292     --
293   end;
294   --
295   pqp_aad_upd.upd
296     (
297      p_analyzed_data_id              => p_analyzed_data_id
298     ,p_assignment_id                 => p_assignment_id
299     ,p_data_source                   => p_data_source
300     ,p_tax_year                      => p_tax_year
301     ,p_current_residency_status      => p_current_residency_status
302     ,p_nra_to_ra_date                => p_nra_to_ra_date
303     ,p_target_departure_date         => p_target_departure_date
304     ,p_tax_residence_country_code    => p_tax_residence_country_code
305     ,p_treaty_info_update_date       => p_treaty_info_update_date
306     ,p_number_of_days_in_usa         => p_number_of_days_in_usa
307     ,p_withldg_allow_eligible_flag   => p_withldg_allow_eligible_flag
308     ,p_ra_effective_date             => p_ra_effective_date
309     ,p_record_source                 => p_record_source
310     ,p_visa_type                     => p_visa_type
311     ,p_j_sub_type                    => p_j_sub_type
312     ,p_primary_activity              => p_primary_activity
313     ,p_non_us_country_code           => p_non_us_country_code
314     ,p_citizenship_country_code      => p_citizenship_country_code
315     ,p_object_version_number         => l_object_version_number
316     ,p_effective_date                => trunc(p_effective_date)
317     ,p_date_8233_signed              =>  p_date_8233_signed
318     ,p_date_w4_signed                =>  p_date_w4_signed
319     );
320   --
321   begin
322     --
323     -- Start of API User Hook for the after hook of update_analyzed_alien_data
324     --
325     pqp_analyzed_alien_data_bk2.update_analyzed_alien_data_a
326       (
327        p_analyzed_data_id               =>  p_analyzed_data_id
328       ,p_assignment_id                  =>  p_assignment_id
329       ,p_data_source                    =>  p_data_source
330       ,p_tax_year                       =>  p_tax_year
331       ,p_current_residency_status       =>  p_current_residency_status
332       ,p_nra_to_ra_date                 =>  p_nra_to_ra_date
333       ,p_target_departure_date          =>  p_target_departure_date
334       ,p_tax_residence_country_code     =>  p_tax_residence_country_code
335       ,p_treaty_info_update_date        =>  p_treaty_info_update_date
336       ,p_number_of_days_in_usa          =>  p_number_of_days_in_usa
337       ,p_withldg_allow_eligible_flag    =>  p_withldg_allow_eligible_flag
338       ,p_ra_effective_date              =>  p_ra_effective_date
339       ,p_record_source                  =>  p_record_source
340       ,p_visa_type                      =>  p_visa_type
341       ,p_j_sub_type                     =>  p_j_sub_type
342       ,p_primary_activity               =>  p_primary_activity
343       ,p_non_us_country_code            =>  p_non_us_country_code
344       ,p_citizenship_country_code       =>  p_citizenship_country_code
345       ,p_object_version_number          =>  l_object_version_number
346       ,p_effective_date                => trunc(p_effective_date)
347       ,p_date_8233_signed               =>  p_date_8233_signed
348       ,p_date_w4_signed                 =>  p_date_w4_signed
349       );
350   exception
351     when hr_api.cannot_find_prog_unit then
352       hr_api.cannot_find_prog_unit_error
353         (p_module_name => 'UPDATE_ANALYZED_ALIEN_DATA'
354         ,p_hook_type   => 'AP'
355         );
356     --
357     -- End of API User Hook for the after hook of update_analyzed_alien_data
358     --
359   end;
360   --
361   hr_utility.set_location(l_proc, 60);
362   --
363   -- When in validation only mode raise the Validate_Enabled exception
364   --
365   if p_validate then
366     raise hr_api.validate_enabled;
367   end if;
368   --
369   -- Set all output arguments
370   --
371   p_object_version_number := l_object_version_number;
372   --
373   hr_utility.set_location(' Leaving:'||l_proc, 70);
374   --
375 exception
376   --
377   when hr_api.validate_enabled then
378     --
379     -- As the Validate_Enabled exception has been raised
380     -- we must rollback to the savepoint
381     --
382     ROLLBACK TO update_analyzed_alien_data;
383     --
384     -- Only set output warning arguments
385     -- (Any key or derived arguments must be set to null
386     -- when validation only mode is being used.)
387     --
388     hr_utility.set_location(' Leaving:'||l_proc, 80);
389     --
390   when others then
391     --
392     -- A validation or unexpected error has occured
393     --
394     ROLLBACK TO update_analyzed_alien_data;
395     raise;
396     --
397 end update_analyzed_alien_data;
398 -- ----------------------------------------------------------------------------
399 -- |------------------------< delete_analyzed_alien_data >----------------------|
400 -- ----------------------------------------------------------------------------
401 --
402 procedure delete_analyzed_alien_data
403   (p_validate                       in  boolean  default false
404   ,p_analyzed_data_id               in  number
405   ,p_object_version_number          in out nocopy number
406   ,p_effective_date                 in  date
407   ) is
408   --
409   -- Declare cursors and local variables
410   --
411   l_proc varchar2(72) := g_package||'delete_analyzed_alien_data';
412   l_object_version_number pqp_analyzed_alien_data.object_version_number%TYPE;
413   --
414 begin
415   --
416   hr_utility.set_location('Entering:'|| l_proc, 10);
417   --
418   -- Issue a savepoint if operating in validation only mode
419   --
420   savepoint delete_analyzed_alien_data;
421   --
422   hr_utility.set_location(l_proc, 20);
423   --
424   -- Process Logic
425   --
426   l_object_version_number := p_object_version_number;
427   --
428   --
429   begin
430     --
431     -- Start of API User Hook for the before hook of delete_analyzed_alien_data
432     --
433     pqp_analyzed_alien_data_bk3.delete_analyzed_alien_data_b
434       (
435        p_analyzed_data_id               =>  p_analyzed_data_id
436       ,p_object_version_number          =>  p_object_version_number
437     ,p_effective_date                      => trunc(p_effective_date)
438       );
439   exception
440     when hr_api.cannot_find_prog_unit then
441       hr_api.cannot_find_prog_unit_error
442         (p_module_name => 'DELETE_ANALYZED_ALIEN_DATA'
443         ,p_hook_type   => 'BP'
444         );
445     --
446     -- End of API User Hook for the before hook of delete_analyzed_alien_data
447     --
448   end;
449   --
450   pqp_aad_del.del
451     (
452      p_analyzed_data_id              => p_analyzed_data_id
453     ,p_object_version_number         => l_object_version_number
454     ,p_effective_date                => p_effective_date
455     );
456   --
457   begin
458     --
459     -- Start of API User Hook for the after hook of delete_analyzed_alien_data
460     --
461     pqp_analyzed_alien_data_bk3.delete_analyzed_alien_data_a
462       (
463        p_analyzed_data_id               =>  p_analyzed_data_id
464       ,p_object_version_number          =>  l_object_version_number
465     ,p_effective_date                      => trunc(p_effective_date)
466       );
467   exception
468     when hr_api.cannot_find_prog_unit then
469       hr_api.cannot_find_prog_unit_error
470         (p_module_name => 'DELETE_ANALYZED_ALIEN_DATA'
471         ,p_hook_type   => 'AP'
472         );
473     --
474     -- End of API User Hook for the after hook of delete_analyzed_alien_data
475     --
476   end;
477   --
478   hr_utility.set_location(l_proc, 60);
479   --
480   -- When in validation only mode raise the Validate_Enabled exception
481   --
482   if p_validate then
483     raise hr_api.validate_enabled;
484   end if;
485   --
486   hr_utility.set_location(' Leaving:'||l_proc, 70);
487   --
488 exception
489   --
490   when hr_api.validate_enabled then
491     --
492     -- As the Validate_Enabled exception has been raised
493     -- we must rollback to the savepoint
494     --
495     ROLLBACK TO delete_analyzed_alien_data;
496     --
497     -- Only set output warning arguments
498     -- (Any key or derived arguments must be set to null
499     -- when validation only mode is being used.)
500     --
501     --
502   when others then
503     --
504     -- A validation or unexpected error has occured
505     --
506     ROLLBACK TO delete_analyzed_alien_data;
507     raise;
508     --
509 end delete_analyzed_alien_data;
510 --
511 -- ----------------------------------------------------------------------------
512 -- |-------------------------------< lck >------------------------------------|
513 -- ----------------------------------------------------------------------------
514 --
515 procedure lck
516   (
517    p_analyzed_data_id                   in     number
518   ,p_object_version_number          in     number
519   ) is
520   --
521   --
522   -- Declare cursors and local variables
523   --
524   l_proc varchar2(72) := g_package||'lck';
525   --
526 begin
527   --
528   hr_utility.set_location('Entering:'|| l_proc, 10);
529   --
530   pqp_aad_shd.lck
531     (
532       p_analyzed_data_id                 => p_analyzed_data_id
533      ,p_object_version_number      => p_object_version_number
534     );
535   --
536   hr_utility.set_location(' Leaving:'||l_proc, 70);
537   --
538 end lck;
539 --
540 end pqp_analyzed_alien_data_api;