DBA Data[Home] [Help]

PACKAGE BODY: APPS.GHR_COMPLAINTS_CA_DETAILS_API

Source


1 Package Body ghr_complaints_ca_details_api as
2 /* $Header: ghcdtapi.pkb 115.4 2003/01/30 16:31:44 asubrahm noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  ghr_complaints_ca_details_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< Create_ca_detail >-----------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_ca_detail
13   (p_validate                       in     boolean
14   ,p_effective_date                 in     date
15   ,p_compl_ca_header_id             in     number
16   --,p_action                         in     varchar2
17   ,p_amount                         in     number
18   ,p_order_date                     in	   date
19   ,p_due_date                       in	   date
20   ,p_request_date                   in	   date
21   ,p_complete_date                  in	   date
22   ,p_category                       in     varchar2
23   --,p_type                           in	 varchar2
24   ,p_phase                          in	 varchar2
25   ,p_action_type                    in     varchar2
26   ,p_payment_type                   in     varchar2
27   ,p_description                    in	 varchar2
28   ,p_compl_ca_detail_id             out nocopy    number
29   ,p_object_version_number          out nocopy    number
30   ) is
31 
32   --
33   -- Declare cursors and local variables
34   --
35 
36   l_proc                  varchar2(72) := g_package||'create_ca_detail';
37   l_compl_ca_detail_id    number;
38   l_object_version_number number;
39 begin
40   hr_utility.set_location('Entering:'|| l_proc, 10);
41   --
42   -- Issue a savepoint
43   --
44   savepoint create_ca_detail;
45   hr_utility.set_location(l_proc, 20);
46   --
47   -- Truncate the time portion from all IN date parameters
48   --
49   --
50   -- Call Before Process User Hook
51   --
52   begin
53     ghr_complaints_ca_details_bk_1.create_ca_detail_b
54       (p_effective_date                 => p_effective_date
55       ,p_compl_ca_header_id             => p_compl_ca_header_id
56       --,p_action                         => p_action
57       ,p_amount                         => p_amount
58       ,p_order_date                     => p_order_date
59       ,p_due_date                       => p_due_date
60       ,p_request_date                   => p_request_date
61       ,p_complete_date                  => p_complete_date
62       ,p_category                       => p_category
63       --,p_type                           => p_type
64       ,p_phase                          => p_phase
65       ,p_action_type                    => p_action_type
66       ,p_payment_type                   => p_payment_type
67       ,p_description                    => p_description
68       );
69   exception
70     when hr_api.cannot_find_prog_unit then
71       hr_api.cannot_find_prog_unit_error
72         (p_module_name => 'create_ca_detail'
73         ,p_hook_type   => 'BP'
74         );
75   end;
76   --
77   -- Validation in addition to Row Handlers
78   --
79   hr_utility.set_location(l_proc, 40);
80   --
81   -- Process Logic
82   --
83   ghr_cdt_ins.ins
84   (
85    p_effective_date                 => p_effective_date
86   ,p_compl_ca_header_id             => p_compl_ca_header_id
87   --,p_action                         => p_action
88   ,p_amount                         => p_amount
89   ,p_order_date                     => p_order_date
90   ,p_due_date                       => p_due_date
91   ,p_request_date                   => p_request_date
92   ,p_complete_date                  => p_complete_date
93   ,p_category                       => p_category
94   --,p_type                           => p_type
95   ,p_phase                          => p_phase
96   ,p_action_type                    => p_action_type
97   ,p_payment_type                   => p_payment_type
98   ,p_description                    => p_description
99   ,p_compl_ca_detail_id             => l_compl_ca_detail_id
100   ,p_object_version_number          => l_object_version_number
101   );
102   hr_utility.set_location(l_proc, 50);
103   --
104   -- Call After Process User Hook
105   --
106   begin
107     ghr_complaints_ca_details_bk_1.create_ca_detail_a
108       (p_effective_date                 => p_effective_date
109       ,p_compl_ca_header_id             => p_compl_ca_header_id
110       --,p_action                         => p_action
111       ,p_amount                         => p_amount
112       ,p_order_date                     => p_order_date
113       ,p_due_date                       => p_due_date
114       ,p_request_date                   => p_request_date
115       ,p_complete_date                  => p_complete_date
116       ,p_category                       => p_category
117       --,p_type                           => p_type
118       ,p_phase                          => p_phase
119       ,p_action_type                    => p_action_type
120       ,p_payment_type                   => p_payment_type
121       ,p_description                    => p_description
122       ,p_compl_ca_detail_id             => l_compl_ca_detail_id
123       ,p_object_version_number          => l_object_version_number
124       );
125   exception
126     when hr_api.cannot_find_prog_unit then
127       hr_api.cannot_find_prog_unit_error
128         (p_module_name => 'create_ca_detail'
129         ,p_hook_type   => 'AP'
130         );
131   end;
132   --
133   -- When in validation only mode raise the Validate_Enabled exception
134   --
135   if p_validate then
136     raise hr_api.validate_enabled;
137   end if;
138   --
139   -- Set all output arguments
140   --
141   p_compl_ca_detail_id     := l_compl_ca_detail_id;
142   p_object_version_number  := l_object_version_number;
143   --
144   hr_utility.set_location(' Leaving:'||l_proc, 70);
145 exception
146   when hr_api.validate_enabled then
147     --
148     -- As the Validate_Enabled exception has been raised
149     -- we must rollback to the savepoint
150     --
151     rollback to create_ca_detail;
152     --
153     -- Only set output warning arguments
154     -- (Any key or derived arguments must be set to null
155     -- when validation only mode is being used.)
156     --
157     p_compl_ca_detail_id     := null;
158     p_object_version_number  := null;
159     hr_utility.set_location(' Leaving:'||l_proc, 80);
160   when others then
161     --
162     -- A validation or unexpected error has occured
163     --
164     rollback to create_ca_detail;
165     --RESET In/Out Params and SET Out Params
166     p_compl_ca_detail_id     := null;
167     p_object_version_number  := null;
168     hr_utility.set_location(' Leaving:'||l_proc, 90);
169     raise;
170 end create_ca_detail;
171 --
172 
173 
174 procedure update_ca_detail
175   (p_validate                     in     boolean
176   ,p_effective_date               in     date
177   ,p_compl_ca_detail_id           in     number
178   ,p_object_version_number        in out nocopy number
179   ,p_compl_ca_header_id           in     number
180   --,p_action                       in     varchar2
181   ,p_amount                       in     number
182   ,p_order_date                   in     date
183   ,p_due_date                     in     date
184   ,p_request_date                 in     date
185   ,p_complete_date                in     date
186   ,p_category                     in     varchar2
187   --,p_type                         in     varchar2
188   ,p_phase                        in     varchar2
189   ,p_action_type                  in     varchar2
190   ,p_payment_type                 in     varchar2
191   ,p_description                  in     varchar2
192  )
193 
194 is
195   l_proc                varchar2(72) := g_package||'update_ca_detail';
196   l_object_version_number number;
197 begin
198 hr_utility.set_location('Entering:'|| l_proc, 5);
199   --
200    savepoint update_ca_detail;
201   --
202      l_object_version_number := p_object_version_number;
203   -- Truncate the time portion from all IN date parameters
204   --
205   -- Call Before Process User Hook
206   --
207   begin
208     ghr_complaints_ca_details_bk_2.update_ca_detail_b
209       (p_effective_date                 => p_effective_date
210       ,p_compl_ca_detail_id             => p_compl_ca_detail_id
211       ,p_compl_ca_header_id             => p_compl_ca_header_id
212       --,p_action                         => p_action
213       ,p_amount                         => p_amount
214       ,p_order_date                     => p_order_date
215       ,p_due_date                       => p_due_date
216       ,p_request_date                   => p_request_date
217       ,p_complete_date                  => p_complete_date
218       ,p_category                       => p_category
219       --,p_type                           => p_type
220       ,p_phase                          => p_phase
221       ,p_action_type                    => p_action_type
222       ,p_payment_type                   => p_payment_type
223       ,p_description                    => p_description
224       ,p_object_version_number          => p_object_version_number
225       );
226   exception
227     when hr_api.cannot_find_prog_unit then
228       hr_api.cannot_find_prog_unit_error
229         (p_module_name => 'update_ca_detail'
230         ,p_hook_type   => 'BP'
231         );
232   end;
233   --
234   -- Validation in addition to Row Handlers
235   --
236   -- Store the original ovn in case we rollback when p_validate is true
237   --
238   l_object_version_number  := p_object_version_number;
239 
240   hr_utility.set_location(l_proc, 6);
241 
242   ghr_cdt_upd.upd
243   (p_effective_date                 => p_effective_date
244   ,p_compl_ca_detail_id             => p_compl_ca_detail_id
245   ,p_compl_ca_header_id             => p_compl_ca_header_id
246   --,p_action                         => p_action
247   ,p_amount                         => p_amount
248   ,p_order_date                     => p_order_date
249   ,p_due_date                       => p_due_date
250   ,p_request_date                   => p_request_date
251   ,p_complete_date                  => p_complete_date
252   ,p_category                       => p_category
253   --,p_type                           => p_type
254   ,p_phase                          => p_phase
255   ,p_action_type                    => p_action_type
256   ,p_payment_type                   => p_payment_type
257   ,p_description                    => p_description
258   ,p_object_version_number          => l_object_version_number
259   );
260   --
261   -- Call After Process User Hook
262   --
263   begin
264     ghr_complaints_ca_details_bk_2.update_ca_detail_a
265       (p_effective_date                 => p_effective_date
266       ,p_compl_ca_detail_id             => p_compl_ca_detail_id
267       ,p_compl_ca_header_id             => p_compl_ca_header_id
268       --,p_action                         => p_action
269       ,p_amount                         => p_amount
270       ,p_order_date                     => p_order_date
271       ,p_due_date                       => p_due_date
272       ,p_request_date                   => p_request_date
273       ,p_complete_date                  => p_complete_date
274       ,p_category                       => p_category
275       --,p_type                           => p_type
276       ,p_phase                          => p_phase
277       ,p_action_type                    => p_action_type
278       ,p_payment_type                   => p_payment_type
279       ,p_description                    => p_description
280       ,p_object_version_number          => l_object_version_number
281       );
282   exception
283     when hr_api.cannot_find_prog_unit then
284       hr_api.cannot_find_prog_unit_error
285         (p_module_name => 'update_ca_detail'
286         ,p_hook_type   => 'AP'
287         );
288   end;
289   --
290   -- When in validation only mode raise the Validate_Enabled exception
291   --
292   if p_validate then
293     raise hr_api.validate_enabled;
294   end if;
295   --
296   -- Set all output arguments
297   --
298   p_object_version_number  := l_object_version_number;
299   --
300   hr_utility.set_location(' Leaving:'||l_proc, 70);
301 exception
302   when hr_api.validate_enabled then
303     --
304     -- As the Validate_Enabled exception has been raised
305     -- we must rollback to the savepoint
306     --
307     rollback to update_ca_detail;
308     --
309     -- Only set output warning arguments
310     -- (Any key or derived arguments must be set to null
311     -- when validation only mode is being used.)
312     --
313     p_object_version_number  := l_object_version_number;
314     hr_utility.set_location(' Leaving:'||l_proc, 80);
315   when others then
316     --
317     -- A validation or unexpected error has occured
318     --
319     rollback to update_ca_detail;
320     -- RESET In/Out Params and SET Out Params
321     p_object_version_number  := l_object_version_number;
322     hr_utility.set_location(' Leaving:'||l_proc, 90);
323     raise;
324 
325 end update_ca_detail;
326 
327 -- ----------------------------------------------------------------------------
328 -- |-----------------------< delete_ca_detail >--------------------------------|
329 -- ----------------------------------------------------------------------------
330 --
331 procedure delete_ca_detail
332   (p_validate                      in     boolean
333   ,p_compl_ca_detail_id            in     number
334   ,p_object_version_number         in     number
335   ) is
336   --
337   -- Declare cursors and local variables
338   --
339   l_proc                  varchar2(72) := g_package||'delete_ca_detail';
340   l_exists                boolean      := false;
341 
342 begin
343   hr_utility.set_location('Entering:'|| l_proc, 5);
344   --
345   --
346   savepoint delete_ca_detail;
347   --
348   -- Truncate the time portion from all IN date parameters
349   --
350 
351   --
352   -- Call Before Process User Hook
353   --
354   begin
355     ghr_complaints_ca_details_bk_3.delete_ca_detail_b
356       (p_compl_ca_detail_id            => p_compl_ca_detail_id
357       ,p_object_version_number         => p_object_version_number
358       );
359   exception
360     when hr_api.cannot_find_prog_unit then
361       hr_api.cannot_find_prog_unit_error
362         (p_module_name => 'delete_ca_detail'
363         ,p_hook_type   => 'BP'
364         );
365   end;
366   --
367   -- Validation in addition to Row Handlers
368   --
369  -- Process Logic
370    ghr_cdt_del.del
371     (p_compl_ca_detail_id            => p_compl_ca_detail_id
372     ,p_object_version_number         => p_object_version_number
373      );
374  --
375   hr_utility.set_location(l_proc, 8);
376   --
377   -- Call After Process User Hook
378   --
379   begin
380     ghr_complaints_ca_details_bk_3.delete_ca_detail_a
381       (p_compl_ca_detail_id            => p_compl_ca_detail_id
382       ,p_object_version_number         => p_object_version_number
383       );
384   exception
385     when hr_api.cannot_find_prog_unit then
386       hr_api.cannot_find_prog_unit_error
387         (p_module_name => 'delete_ca_detail'
388         ,p_hook_type   => 'AP'
389         );
390   end;
391   --
392   -- When in validation only mode raise the Validate_Enabled exception
393   --
394   if p_validate then
395     raise hr_api.validate_enabled;
396   end if;
397   --
398   hr_utility.set_location(' Leaving:'||l_proc, 11);
399 exception
400   when hr_api.validate_enabled then
401     -- we must rollback to the savepoint
402     --
403     ROLLBACK TO delete_ca_detail;
404     --
405   When Others then
406     ROLLBACK TO delete_ca_detail;
407     raise;
408 
409   hr_utility.set_location(' Leaving:'||l_proc, 12);
410 end delete_ca_detail;
411 end ghr_complaints_ca_details_api;
412