DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_BATCH_RATE_INFO_API

Source


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