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