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