DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_DFLT_FUND_SRCS_API

Source


1 Package Body pqh_dflt_fund_srcs_api as
2 /* $Header: pqdfsapi.pkb 115.5 2002/11/27 23:43:12 rpasapul ship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  pqh_dflt_fund_srcs_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_dflt_fund_src >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_dflt_fund_src
13   (p_validate                       in  boolean   default false
14   ,p_dflt_fund_src_id               out nocopy number
15   ,p_dflt_budget_element_id         in  number    default null
16   ,p_dflt_dist_percentage           in  number    default null
17   ,p_project_id                     in  number    default null
18   ,p_award_id                       in  number    default null
19   ,p_task_id                        in  number    default null
20   ,p_expenditure_type               in  varchar2  default null
21   ,p_organization_id                in  number    default null
22   ,p_object_version_number          out nocopy number
23   ,p_cost_allocation_keyflex_id     in  number    default null
24   ) is
25   --
26   -- Declare cursors and local variables
27   --
28   l_dflt_fund_src_id pqh_dflt_fund_srcs.dflt_fund_src_id%TYPE;
29   l_proc varchar2(72) := g_package||'create_dflt_fund_src';
30   l_object_version_number pqh_dflt_fund_srcs.object_version_number%TYPE;
31   --
32 begin
33   --
34   hr_utility.set_location('Entering:'|| l_proc, 10);
35   --
36   -- Issue a savepoint if operating in validation only mode
37   --
38   savepoint create_dflt_fund_src;
39   --
40   hr_utility.set_location(l_proc, 20);
41   --
42   -- Process Logic
43   --
44   begin
45     --
46     -- Start of API User Hook for the before hook of create_dflt_fund_src
47     --
48     pqh_dflt_fund_srcs_bk1.create_dflt_fund_src_b
49       (
50        p_dflt_budget_element_id         =>  p_dflt_budget_element_id
51       ,p_dflt_dist_percentage           =>  p_dflt_dist_percentage
52       ,p_project_id                     =>  p_project_id
53       ,p_award_id                       =>  p_award_id
54       ,p_task_id                        =>  p_task_id
55       ,p_expenditure_type               =>  p_expenditure_type
56       ,p_organization_id                =>  p_organization_id
57       ,p_cost_allocation_keyflex_id     =>  p_cost_allocation_keyflex_id
58       );
59   exception
60     when hr_api.cannot_find_prog_unit then
61       hr_api.cannot_find_prog_unit_error
62         (
63          p_module_name => 'create_dflt_fund_src'
64         ,p_hook_type   => 'BP'
65         );
66     --
67     -- End of API User Hook for the before hook of create_dflt_fund_src
68     --
69   end;
70   --
71   pqh_dfs_ins.ins
72     (
73      p_dflt_fund_src_id              => l_dflt_fund_src_id
74     ,p_dflt_budget_element_id        => p_dflt_budget_element_id
75     ,p_dflt_dist_percentage          => p_dflt_dist_percentage
76     ,p_project_id                    => p_project_id
77     ,p_award_id                      => p_award_id
78     ,p_task_id                       => p_task_id
79     ,p_expenditure_type              => p_expenditure_type
80     ,p_organization_id               => p_organization_id
81     ,p_object_version_number         => l_object_version_number
82     ,p_cost_allocation_keyflex_id    => p_cost_allocation_keyflex_id
83     );
84   --
85   begin
86     --
87     -- Start of API User Hook for the after hook of create_dflt_fund_src
88     --
89     pqh_dflt_fund_srcs_bk1.create_dflt_fund_src_a
90       (
91        p_dflt_fund_src_id               =>  l_dflt_fund_src_id
92       ,p_dflt_budget_element_id         =>  p_dflt_budget_element_id
93       ,p_dflt_dist_percentage           =>  p_dflt_dist_percentage
94       ,p_project_id                     =>  p_project_id
95       ,p_award_id                       =>  p_award_id
96       ,p_task_id                        =>  p_task_id
97       ,p_expenditure_type               =>  p_expenditure_type
98       ,p_organization_id                =>  p_organization_id
99       ,p_object_version_number          =>  l_object_version_number
100       ,p_cost_allocation_keyflex_id     =>  p_cost_allocation_keyflex_id
101       );
102   exception
103     when hr_api.cannot_find_prog_unit then
104       hr_api.cannot_find_prog_unit_error
105         (p_module_name => 'create_dflt_fund_src'
106         ,p_hook_type   => 'AP'
107         );
108     --
109     -- End of API User Hook for the after hook of create_dflt_fund_src
110     --
111   end;
112   --
113   hr_utility.set_location(l_proc, 60);
114   --
115   -- When in validation only mode raise the Validate_Enabled exception
116   --
117   if p_validate then
118     raise hr_api.validate_enabled;
119   end if;
120   --
121   -- Set all output arguments
122   --
123   p_dflt_fund_src_id := l_dflt_fund_src_id;
124   p_object_version_number := l_object_version_number;
125   --
126   hr_utility.set_location(' Leaving:'||l_proc, 70);
127   --
128 exception
129   --
130   when hr_api.validate_enabled then
131     --
132     -- As the Validate_Enabled exception has been raised
133     -- we must rollback to the savepoint
134     --
135     ROLLBACK TO create_dflt_fund_src;
136     --
137     -- Only set output warning arguments
138     -- (Any key or derived arguments must be set to null
139     -- when validation only mode is being used.)
140     --
141     p_dflt_fund_src_id := null;
142     p_object_version_number  := null;
143     hr_utility.set_location(' Leaving:'||l_proc, 80);
144     --
145   when others then
146     p_dflt_fund_src_id := null;
147     p_object_version_number  := null;
148     --
149     -- A validation or unexpected error has occured
150     --
151     ROLLBACK TO create_dflt_fund_src;
152     raise;
153     --
154 end create_dflt_fund_src;
155 -- ----------------------------------------------------------------------------
156 -- |------------------------< update_dflt_fund_src >--- ------------------|
157 -- ----------------------------------------------------------------------------
158 --
159 procedure update_dflt_fund_src
160   (p_validate                       in  boolean   default false
161   ,p_dflt_fund_src_id               in  number
162   ,p_dflt_budget_element_id         in  number    default hr_api.g_number
163   ,p_dflt_dist_percentage           in  number    default hr_api.g_number
164   ,p_project_id                     in  number    default hr_api.g_number
165   ,p_award_id                       in  number    default hr_api.g_number
166   ,p_task_id                        in  number    default hr_api.g_number
167   ,p_expenditure_type               in  varchar2  default hr_api.g_varchar2
168   ,p_organization_id                in  number    default hr_api.g_number
169   ,p_object_version_number          in out nocopy number
170   ,p_cost_allocation_keyflex_id     in  number    default hr_api.g_number
171   ) is
172   --
173   -- Declare cursors and local variables
174   --
175   l_proc varchar2(72) := g_package||'update_dflt_fund_src';
176   l_object_version_number pqh_dflt_fund_srcs.object_version_number%TYPE;
177   --
178 begin
179   --
180   hr_utility.set_location('Entering:'|| l_proc, 10);
181   --
182   -- Issue a savepoint if operating in validation only mode
183   --
184   savepoint update_dflt_fund_src;
185   --
186   hr_utility.set_location(l_proc, 20);
187   --
188   -- Process Logic
189   --
190   l_object_version_number := p_object_version_number;
191   --
192   begin
193     --
194     -- Start of API User Hook for the before hook of update_dflt_fund_src
195     --
196     pqh_dflt_fund_srcs_bk2.update_dflt_fund_src_b
197       (
198        p_dflt_fund_src_id               =>  p_dflt_fund_src_id
199       ,p_dflt_budget_element_id         =>  p_dflt_budget_element_id
200       ,p_dflt_dist_percentage           =>  p_dflt_dist_percentage
201       ,p_project_id                     =>  p_project_id
202       ,p_award_id                       =>  p_award_id
203       ,p_task_id                        =>  p_task_id
204       ,p_expenditure_type               =>  p_expenditure_type
205       ,p_organization_id                =>  p_organization_id
206       ,p_object_version_number          =>  p_object_version_number
207       ,p_cost_allocation_keyflex_id     =>  p_cost_allocation_keyflex_id
208       );
209   exception
210     when hr_api.cannot_find_prog_unit then
211       hr_api.cannot_find_prog_unit_error
212         (p_module_name => 'update_dflt_fund_src'
213         ,p_hook_type   => 'BP'
214         );
215     --
216     -- End of API User Hook for the before hook of update_dflt_fund_src
217     --
218   end;
219   --
220   pqh_dfs_upd.upd
221     (
222      p_dflt_fund_src_id              => p_dflt_fund_src_id
223     ,p_dflt_budget_element_id        => p_dflt_budget_element_id
224     ,p_dflt_dist_percentage          => p_dflt_dist_percentage
225     ,p_project_id                    => p_project_id
226     ,p_award_id                      => p_award_id
227     ,p_task_id                       => p_task_id
228     ,p_expenditure_type              => p_expenditure_type
229     ,p_organization_id               => p_organization_id
230     ,p_object_version_number         => l_object_version_number
231     ,p_cost_allocation_keyflex_id    => p_cost_allocation_keyflex_id
232     );
233   --
234   begin
235     --
236     -- Start of API User Hook for the after hook of update_dflt_fund_src
237     --
238     pqh_dflt_fund_srcs_bk2.update_dflt_fund_src_a
239       (
240        p_dflt_fund_src_id               =>  p_dflt_fund_src_id
241       ,p_dflt_budget_element_id         =>  p_dflt_budget_element_id
242       ,p_dflt_dist_percentage           =>  p_dflt_dist_percentage
243       ,p_project_id                     =>  p_project_id
244       ,p_award_id                       =>  p_award_id
245       ,p_task_id                        =>  p_task_id
246       ,p_expenditure_type               =>  p_expenditure_type
247       ,p_organization_id                =>  p_organization_id
248       ,p_object_version_number          =>  l_object_version_number
249       ,p_cost_allocation_keyflex_id     =>  p_cost_allocation_keyflex_id
250       );
251   exception
252     when hr_api.cannot_find_prog_unit then
253       hr_api.cannot_find_prog_unit_error
254         (p_module_name => 'update_dflt_fund_src'
255         ,p_hook_type   => 'AP'
256         );
257     --
258     -- End of API User Hook for the after hook of update_dflt_fund_src
259     --
260   end;
261   --
262   hr_utility.set_location(l_proc, 60);
263   --
264   -- When in validation only mode raise the Validate_Enabled exception
265   --
266   if p_validate then
267     raise hr_api.validate_enabled;
268   end if;
269   --
270   -- Set all output arguments
271   --
272   p_object_version_number := l_object_version_number;
273   --
274   hr_utility.set_location(' Leaving:'||l_proc, 70);
275   --
276 exception
277   --
278   when hr_api.validate_enabled then
279     --
280     -- As the Validate_Enabled exception has been raised
281     -- we must rollback to the savepoint
282     --
283     ROLLBACK TO update_dflt_fund_src;
284     --
285     -- Only set output warning arguments
286     -- (Any key or derived arguments must be set to null
287     -- when validation only mode is being used.)
288     --
289     hr_utility.set_location(' Leaving:'||l_proc, 80);
290     --
291   when others then
292   p_object_version_number := l_object_version_number;
293     --
294     -- A validation or unexpected error has occured
295     --
296     ROLLBACK TO update_dflt_fund_src;
297     raise;
298     --
299 end update_dflt_fund_src;
300 -- ----------------------------------------------------------------------------
301 -- |------------------------< delete_dflt_fund_src >----------------------|
302 -- ----------------------------------------------------------------------------
303 --
304 procedure delete_dflt_fund_src
305   (p_validate                       in  boolean  default false
306   ,p_dflt_fund_src_id               in  number
307   ,p_object_version_number          in number
308   ) is
309   --
310   -- Declare cursors and local variables
311   --
312   l_proc varchar2(72) := g_package||'delete_dflt_fund_src';
313   l_object_version_number pqh_dflt_fund_srcs.object_version_number%TYPE;
314   --
315 begin
316   --
317   hr_utility.set_location('Entering:'|| l_proc, 10);
318   --
319   -- Issue a savepoint if operating in validation only mode
320   --
321   savepoint delete_dflt_fund_src;
322   --
323   hr_utility.set_location(l_proc, 20);
324   --
325   -- Process Logic
326   --
327   l_object_version_number := p_object_version_number;
328   --
329   --
330   begin
331     --
332     -- Start of API User Hook for the before hook of delete_dflt_fund_src
333     --
334     pqh_dflt_fund_srcs_bk3.delete_dflt_fund_src_b
335       (
336        p_dflt_fund_src_id               =>  p_dflt_fund_src_id
337       ,p_object_version_number          =>  p_object_version_number
338       );
339   exception
340     when hr_api.cannot_find_prog_unit then
341       hr_api.cannot_find_prog_unit_error
342         (p_module_name => 'delete_dflt_fund_src'
343         ,p_hook_type   => 'BP'
344         );
345     --
346     -- End of API User Hook for the before hook of delete_dflt_fund_src
347     --
348   end;
349   --
350   pqh_dfs_del.del
351     (
352      p_dflt_fund_src_id              => p_dflt_fund_src_id
353     ,p_object_version_number         => l_object_version_number
354     );
355   --
356   begin
357     --
358     -- Start of API User Hook for the after hook of delete_dflt_fund_src
359     --
360     pqh_dflt_fund_srcs_bk3.delete_dflt_fund_src_a
361       (
362        p_dflt_fund_src_id               =>  p_dflt_fund_src_id
363       ,p_object_version_number          =>  l_object_version_number
364       );
365   exception
366     when hr_api.cannot_find_prog_unit then
367       hr_api.cannot_find_prog_unit_error
371     --
368         (p_module_name => 'delete_dflt_fund_src'
369         ,p_hook_type   => 'AP'
370         );
372     -- End of API User Hook for the after hook of delete_dflt_fund_src
373     --
374   end;
375   --
376   hr_utility.set_location(l_proc, 60);
377   --
378   -- When in validation only mode raise the Validate_Enabled exception
379   --
380   if p_validate then
381     raise hr_api.validate_enabled;
382   end if;
383   --
384   hr_utility.set_location(' Leaving:'||l_proc, 70);
385   --
386 exception
387   --
388   when hr_api.validate_enabled then
389     --
390     -- As the Validate_Enabled exception has been raised
391     -- we must rollback to the savepoint
392     --
393     ROLLBACK TO delete_dflt_fund_src;
394     --
395     -- Only set output warning arguments
396     -- (Any key or derived arguments must be set to null
397     -- when validation only mode is being used.)
398     --
399     --
400   when others then
401     --
402     -- A validation or unexpected error has occured
403     --
404     ROLLBACK TO delete_dflt_fund_src;
405     raise;
406     --
407 end delete_dflt_fund_src;
408 --
409 -- ----------------------------------------------------------------------------
410 -- |-------------------------------< lck >------------------------------------|
411 -- ----------------------------------------------------------------------------
412 --
413 procedure lck
414   (
415    p_dflt_fund_src_id                   in     number
416   ,p_object_version_number          in     number
417   ) is
418   --
419   --
420   -- Declare cursors and local variables
421   --
422   l_proc varchar2(72) := g_package||'lck';
423   --
424 begin
425   --
426   hr_utility.set_location('Entering:'|| l_proc, 10);
427   --
428   pqh_dfs_shd.lck
429     (
430       p_dflt_fund_src_id                 => p_dflt_fund_src_id
431      ,p_object_version_number      => p_object_version_number
432     );
433   --
434   hr_utility.set_location(' Leaving:'||l_proc, 70);
435   --
436 end lck;
437 --
438 end pqh_dflt_fund_srcs_api;