[Home] [Help]
PACKAGE BODY: APPS.BEN_PTNL_LER_FOR_PER_API
Source
1 Package Body ben_ptnl_ler_for_per_api as
2 /* $Header: bepplapi.pkb 120.0 2005/05/28 10:58:30 appldev noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' ben_ptnl_ler_for_per_api.';
7 g_debug boolean := hr_utility.debug_enabled;
8 --
9 -- ----------------------------------------------------------------------------
10 -- |------------------------< derive_PPL_statcd_dates >-----------------------|
11 -- ----------------------------------------------------------------------------
12 --
13 procedure derive_PPL_statcd_dates
14 (p_ptnl_ler_for_per_stat_cd in varchar2
15 ,p_effective_date in date
16 ,p_mnl_dt out nocopy date
17 ,p_dtctd_dt out nocopy date
18 ,p_procd_dt out nocopy date
19 ,p_unprocd_dt out nocopy date
20 ,p_voidd_dt out nocopy date) is
21 --
22 -- Declare cursors and local variables
23 --
24 -- l_proc varchar2(72) := g_package||'derive_PPL_statcd_dates';
25 --
26 begin
27 --
28 -- DEBUG : Not critical to have set_location.
29 --
30 --
31 -- Set OUT parameters
32 --
33 if p_ptnl_ler_for_per_stat_cd = 'DTCTD' then
34 --
35 p_dtctd_dt := p_effective_date;
36 --
37 elsif p_ptnl_ler_for_per_stat_cd = 'UNPROCD' then
38 --
39 p_unprocd_dt := p_effective_date;
40 --
41 elsif p_ptnl_ler_for_per_stat_cd = 'PROCD' then
42 --
43 p_procd_dt := p_effective_date;
44 --
45 elsif p_ptnl_ler_for_per_stat_cd = 'VOIDD' then
46 --
47 p_voidd_dt := p_effective_date;
48 --
49 elsif p_ptnl_ler_for_per_stat_cd = 'MNL' then
50 --
51 p_mnl_dt := p_effective_date;
52 --
53 end if;
54 --
55 -- DEBUG : Not critical to have set_location.
56 --
57 end derive_PPL_statcd_dates;
58 --
59 -- ----------------------------------------------------------------------------
60 -- |------------------------< create_ptnl_ler_for_per >-----------------------|
61 -- ----------------------------------------------------------------------------
62 --
63 procedure create_ptnl_ler_for_per
64 (p_validate in boolean default false
65 ,p_ptnl_ler_for_per_id out nocopy number
66 ,p_csd_by_ptnl_ler_for_per_id in number default null
67 ,p_lf_evt_ocrd_dt in date default null
68 ,p_trgr_table_pk_id in number default null
69 ,p_ptnl_ler_for_per_stat_cd in varchar2 default null
70 ,p_ptnl_ler_for_per_src_cd in varchar2 default null
71 ,p_mnl_dt in date default null
72 ,p_enrt_perd_id in number default null
73 ,p_ler_id in number default null
74 ,p_person_id in number default null
75 ,p_business_group_id in number default null
76 ,p_dtctd_dt in date default null
77 ,p_procd_dt in date default null
78 ,p_unprocd_dt in date default null
79 ,p_voidd_dt in date default null
80 ,p_mnlo_dt in date default null
81 ,p_ntfn_dt in date default null
82 ,p_request_id in number default null
83 ,p_program_application_id in number default null
84 ,p_program_id in number default null
85 ,p_program_update_date in date default null
86 ,p_object_version_number out nocopy number
87 ,p_effective_date in date) is
88 --
89 -- Declare cursors and local variables
90 --
91 l_ptnl_ler_for_per_id ben_ptnl_ler_for_per.ptnl_ler_for_per_id%TYPE;
92 l_proc varchar2(72) ;
93 l_object_version_number ben_ptnl_ler_for_per.object_version_number%TYPE;
94 --
95 begin
96 --
97 g_debug := hr_utility.debug_enabled;
98 if g_debug then
99 l_proc := g_package||'create_ptnl_ler_for_per';
100 hr_utility.set_location('Entering:'|| l_proc, 10);
101 end if;
102 --
103 -- Issue a savepoint if operating in validation only mode
104 --
105 if p_validate then
106 --
107 savepoint create_ptnl_ler_for_per;
108 --
109 end if;
110 --
111 -- Process Logic
112 --
113 begin
114 --
115 -- Start of API User Hook for the before hook of create_ptnl_ler_for_per
116 --
117 ben_ptnl_ler_for_per_bk1.create_ptnl_ler_for_per_b
118 (p_lf_evt_ocrd_dt => trunc(p_lf_evt_ocrd_dt)
119 ,p_trgr_table_pk_id => p_trgr_table_pk_id
120 ,p_csd_by_ptnl_ler_for_per_id => p_csd_by_ptnl_ler_for_per_id
121 ,p_ptnl_ler_for_per_stat_cd => p_ptnl_ler_for_per_stat_cd
122 ,p_ptnl_ler_for_per_src_cd => p_ptnl_ler_for_per_src_cd
123 ,p_mnl_dt => trunc(p_mnl_dt)
124 ,p_enrt_perd_id => p_enrt_perd_id
125 ,p_ler_id => p_ler_id
126 ,p_person_id => p_person_id
127 ,p_business_group_id => p_business_group_id
128 ,p_dtctd_dt => trunc(p_dtctd_dt)
129 ,p_procd_dt => trunc(p_procd_dt)
130 ,p_unprocd_dt => trunc(p_unprocd_dt)
131 ,p_voidd_dt => trunc(p_voidd_dt)
132 ,p_mnlo_dt => trunc(p_mnlo_dt)
133 ,p_ntfn_dt => trunc(p_ntfn_dt)
134 ,p_request_id => p_request_id
135 ,p_program_application_id => p_program_application_id
136 ,p_program_id => p_program_id
137 ,p_program_update_date => trunc(p_program_update_date)
138 ,p_effective_date => trunc(p_effective_date));
139 --
140 exception
141 --
142 when hr_api.cannot_find_prog_unit then
143 --
144 hr_api.cannot_find_prog_unit_error
145 (p_module_name => 'CREATE_ptnl_ler_for_per'
146 ,p_hook_type => 'BP');
147 --
148 -- End of API User Hook for the before hook of create_ptnl_ler_for_per
149 --
150 end;
151 --
152 ben_ppl_ins.ins
153 (p_ptnl_ler_for_per_id => l_ptnl_ler_for_per_id
154 ,p_csd_by_ptnl_ler_for_per_id => p_csd_by_ptnl_ler_for_per_id
155 ,p_lf_evt_ocrd_dt => trunc(p_lf_evt_ocrd_dt)
156 ,p_trgr_table_pk_id => p_trgr_table_pk_id
157 ,p_ptnl_ler_for_per_stat_cd => p_ptnl_ler_for_per_stat_cd
158 ,p_ptnl_ler_for_per_src_cd => p_ptnl_ler_for_per_src_cd
159 ,p_mnl_dt => trunc(p_mnl_dt)
160 ,p_enrt_perd_id => p_enrt_perd_id
161 ,p_ler_id => p_ler_id
162 ,p_person_id => p_person_id
163 ,p_business_group_id => p_business_group_id
164 ,p_dtctd_dt => trunc(p_dtctd_dt)
165 ,p_procd_dt => trunc(p_procd_dt)
166 ,p_unprocd_dt => trunc(p_unprocd_dt)
167 ,p_voidd_dt => trunc(p_voidd_dt)
168 ,p_mnlo_dt => trunc(p_mnlo_dt)
169 ,p_ntfn_dt => trunc(p_ntfn_dt)
170 ,p_request_id => p_request_id
171 ,p_program_application_id => p_program_application_id
172 ,p_program_id => p_program_id
173 ,p_program_update_date => trunc(p_program_update_date)
174 ,p_object_version_number => l_object_version_number
175 ,p_effective_date => trunc(p_effective_date));
176 --
177 begin
178 --
179 -- Start of API User Hook for the after hook of create_ptnl_ler_for_per
180 --
181 ben_ptnl_ler_for_per_bk1.create_ptnl_ler_for_per_a
182 (p_ptnl_ler_for_per_id => l_ptnl_ler_for_per_id
183 ,p_csd_by_ptnl_ler_for_per_id => p_csd_by_ptnl_ler_for_per_id
184 ,p_lf_evt_ocrd_dt => trunc(p_lf_evt_ocrd_dt)
185 ,p_trgr_table_pk_id => p_trgr_table_pk_id
186 ,p_ptnl_ler_for_per_stat_cd => p_ptnl_ler_for_per_stat_cd
187 ,p_ptnl_ler_for_per_src_cd => p_ptnl_ler_for_per_src_cd
188 ,p_mnl_dt => trunc(p_mnl_dt)
189 ,p_enrt_perd_id => p_enrt_perd_id
190 ,p_ler_id => p_ler_id
191 ,p_person_id => p_person_id
192 ,p_business_group_id => p_business_group_id
193 ,p_dtctd_dt => trunc(p_dtctd_dt)
194 ,p_procd_dt => trunc(p_procd_dt)
195 ,p_unprocd_dt => trunc(p_unprocd_dt)
196 ,p_voidd_dt => trunc(p_voidd_dt)
197 ,p_mnlo_dt => trunc(p_mnlo_dt)
198 ,p_ntfn_dt => trunc(p_ntfn_dt)
199 ,p_request_id => p_request_id
200 ,p_program_application_id => p_program_application_id
201 ,p_program_id => p_program_id
202 ,p_program_update_date => trunc(p_program_update_date)
203 ,p_object_version_number => l_object_version_number
204 ,p_effective_date => trunc(p_effective_date));
205 --
206 exception
207 --
208 when hr_api.cannot_find_prog_unit then
209 --
210 hr_api.cannot_find_prog_unit_error
211 (p_module_name => 'CREATE_ptnl_ler_for_per'
212 ,p_hook_type => 'AP');
213 --
214 -- End of API User Hook for the after hook of create_ptnl_ler_for_per
215 --
216 end;
217 --
218 if g_debug then
219 hr_utility.set_location(l_proc, 60);
220 end if;
221 --
222 -- When in validation only mode raise the Validate_Enabled exception
223 --
224 if p_validate then
225 raise hr_api.validate_enabled;
226 end if;
227 --
228 -- Set all output arguments
229 --
230 p_ptnl_ler_for_per_id := l_ptnl_ler_for_per_id;
231 p_object_version_number := l_object_version_number;
232 --
233 if g_debug then
234 hr_utility.set_location(' Leaving:'||l_proc, 70);
235 end if;
236 --
237 exception
238 --
239 when hr_api.validate_enabled then
240 --
241 -- As the Validate_Enabled exception has been raised
242 -- we must rollback to the savepoint
243 --
244 ROLLBACK TO create_ptnl_ler_for_per;
245 --
246 -- Only set output warning arguments
247 -- (Any key or derived arguments must be set to null
248 -- when validation only mode is being used.)
249 --
250 p_ptnl_ler_for_per_id := null;
251 p_object_version_number := null;
252 --
253 if g_debug then
254 hr_utility.set_location(' Leaving:'||l_proc, 80);
255 end if;
256 --
257 when others then
258 --
259 -- A validation or unexpected error has occured
260 --
261 /* Inserted for nocopy changes */
262 p_ptnl_ler_for_per_id := null;
263 p_object_version_number := null;
264 raise;
265 --
266 end create_ptnl_ler_for_per;
267 -- ----------------------------------------------------------------------------
268 -- |------------------------< create_ptnl_ler_for_per_perf >------------------|
269 -- ----------------------------------------------------------------------------
270 --
271 procedure create_ptnl_ler_for_per_perf
272 (p_validate in boolean default false
273 ,p_ptnl_ler_for_per_id out nocopy number
274 ,p_csd_by_ptnl_ler_for_per_id in number default null
275 ,p_lf_evt_ocrd_dt in date default null
276 ,p_trgr_table_pk_id in number default null
277 ,p_ptnl_ler_for_per_stat_cd in varchar2 default null
278 ,p_ptnl_ler_for_per_src_cd in varchar2 default null
279 ,p_mnl_dt in date default null
280 ,p_enrt_perd_id in number default null
281 ,p_ler_id in number default null
282 ,p_person_id in number default null
283 ,p_business_group_id in number default null
284 ,p_dtctd_dt in date default null
285 ,p_procd_dt in date default null
286 ,p_unprocd_dt in date default null
287 ,p_voidd_dt in date default null
288 ,p_mnlo_dt in date default null
289 ,p_ntfn_dt in date default null
290 ,p_request_id in number default null
291 ,p_program_application_id in number default null
292 ,p_program_id in number default null
293 ,p_program_update_date in date default null
294 ,p_object_version_number out nocopy number
295 ,p_effective_date in date) is
296 --
297 -- Declare cursors and local variables
298 --
299 l_ptnl_ler_for_per_id ben_ptnl_ler_for_per.ptnl_ler_for_per_id%TYPE;
300 -- DEBUG : l_proc varchar2(72) := g_package||'create_ptnl_ler_for_per';
301 l_object_version_number ben_ptnl_ler_for_per.object_version_number%TYPE;
302 --
303 begin
304 --
305 if p_validate then
306 --
307 savepoint create_ptnl_ler_for_per;
308 --
309 end if;
310 --
311 -- Process Logic
312 --
313 begin
314 --
315 -- Start of API User Hook for the before hook of create_ptnl_ler_for_per
316 --
317 ben_ptnl_ler_for_per_bk1.create_ptnl_ler_for_per_b
318 (p_lf_evt_ocrd_dt => trunc(p_lf_evt_ocrd_dt)
319 ,p_trgr_table_pk_id => p_trgr_table_pk_id
320 ,p_csd_by_ptnl_ler_for_per_id => p_csd_by_ptnl_ler_for_per_id
321 ,p_ptnl_ler_for_per_stat_cd => p_ptnl_ler_for_per_stat_cd
322 ,p_ptnl_ler_for_per_src_cd => p_ptnl_ler_for_per_src_cd
323 ,p_mnl_dt => p_mnl_dt
324 ,p_enrt_perd_id => p_enrt_perd_id
325 ,p_ler_id => p_ler_id
326 ,p_person_id => p_person_id
327 ,p_business_group_id => p_business_group_id
328 ,p_dtctd_dt => trunc(p_dtctd_dt)
329 ,p_procd_dt => trunc(p_procd_dt)
330 ,p_unprocd_dt => trunc(p_unprocd_dt)
331 ,p_voidd_dt => trunc(p_voidd_dt)
332 ,p_mnlo_dt => trunc(p_mnlo_dt)
333 ,p_ntfn_dt => trunc(p_ntfn_dt)
334 ,p_request_id => p_request_id
335 ,p_program_application_id => p_program_application_id
336 ,p_program_id => p_program_id
337 ,p_program_update_date => trunc(p_program_update_date)
338 ,p_effective_date => trunc(p_effective_date));
339 --
340 exception
341 --
342 when hr_api.cannot_find_prog_unit then
343 --
344 hr_api.cannot_find_prog_unit_error
345 (p_module_name => 'CREATE_ptnl_ler_for_per'
346 ,p_hook_type => 'BP');
347 --
348 -- End of API User Hook for the before hook of create_ptnl_ler_for_per
349 --
350 end;
351 --
352 l_object_version_number := 1;
353 --
354 select ben_ptnl_ler_for_per_s.nextval
355 into l_ptnl_ler_for_per_id
356 from sys.dual;
357 --
358 insert into ben_ptnl_ler_for_per
359 (ptnl_ler_for_per_id
360 ,csd_by_ptnl_ler_for_per_id
361 ,lf_evt_ocrd_dt
362 ,trgr_table_pk_id
363 ,ptnl_ler_for_per_stat_cd
364 ,ptnl_ler_for_per_src_cd
365 ,mnl_dt
366 ,enrt_perd_id
367 ,ler_id
368 ,person_id
369 ,business_group_id
370 ,dtctd_dt
371 ,procd_dt
372 ,unprocd_dt
373 ,voidd_dt
374 ,mnlo_dt
375 ,ntfn_dt
376 ,request_id
377 ,program_application_id
378 ,program_id
379 ,program_update_date
380 ,object_version_number)
381 values
382 (l_ptnl_ler_for_per_id
383 ,p_csd_by_ptnl_ler_for_per_id
384 ,trunc(p_lf_evt_ocrd_dt)
385 ,p_trgr_table_pk_id
386 ,p_ptnl_ler_for_per_stat_cd
387 ,p_ptnl_ler_for_per_src_cd
388 ,trunc(p_mnl_dt)
389 ,p_enrt_perd_id
390 ,p_ler_id
391 ,p_person_id
392 ,p_business_group_id
393 ,trunc(p_dtctd_dt)
394 ,trunc(p_procd_dt)
395 ,trunc(p_unprocd_dt)
396 ,trunc(p_voidd_dt)
397 ,trunc(p_mnlo_dt)
398 ,trunc(p_ntfn_dt)
399 ,p_request_id
400 ,p_program_application_id
401 ,p_program_id
402 ,p_program_update_date
403 ,l_object_version_number);
404 --
405 begin
406 --
407 -- Start of API User Hook for the after hook of create_ptnl_ler_for_per
408 --
409 ben_ptnl_ler_for_per_bk1.create_ptnl_ler_for_per_a
410 (p_ptnl_ler_for_per_id => l_ptnl_ler_for_per_id
411 ,p_csd_by_ptnl_ler_for_per_id => p_csd_by_ptnl_ler_for_per_id
412 ,p_lf_evt_ocrd_dt => trunc(p_lf_evt_ocrd_dt)
413 ,p_trgr_table_pk_id => p_trgr_table_pk_id
414 ,p_ptnl_ler_for_per_stat_cd => p_ptnl_ler_for_per_stat_cd
415 ,p_ptnl_ler_for_per_src_cd => p_ptnl_ler_for_per_src_cd
416 ,p_mnl_dt => trunc(p_mnl_dt)
417 ,p_enrt_perd_id => p_enrt_perd_id
418 ,p_ler_id => p_ler_id
419 ,p_person_id => p_person_id
420 ,p_business_group_id => p_business_group_id
421 ,p_dtctd_dt => trunc(p_dtctd_dt)
422 ,p_procd_dt => trunc(p_procd_dt)
423 ,p_unprocd_dt => trunc(p_unprocd_dt)
424 ,p_voidd_dt => trunc(p_voidd_dt)
425 ,p_mnlo_dt => trunc(p_mnlo_dt)
426 ,p_ntfn_dt => trunc(p_ntfn_dt)
427 ,p_request_id => p_request_id
428 ,p_program_application_id => p_program_application_id
429 ,p_program_id => p_program_id
430 ,p_program_update_date => trunc(p_program_update_date)
431 ,p_object_version_number => l_object_version_number
432 ,p_effective_date => trunc(p_effective_date));
433 --
434 exception
435 --
436 when hr_api.cannot_find_prog_unit then
437 --
438 hr_api.cannot_find_prog_unit_error
439 (p_module_name => 'CREATE_ptnl_ler_for_per'
440 ,p_hook_type => 'AP');
441 --
442 -- End of API User Hook for the after hook of create_ptnl_ler_for_per
443 --
444 end;
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 -- Set all output arguments
453 --
454 p_ptnl_ler_for_per_id := l_ptnl_ler_for_per_id;
455 p_object_version_number := l_object_version_number;
456 --
457 exception
458 --
459 when hr_api.validate_enabled then
460 --
461 -- As the Validate_Enabled exception has been raised
462 -- we must rollback to the savepoint
463 --
464 ROLLBACK TO create_ptnl_ler_for_per;
465 --
466 -- Only set output warning arguments
467 -- (Any key or derived arguments must be set to null
468 -- when validation only mode is being used.)
469 --
470 p_ptnl_ler_for_per_id := null;
471 p_object_version_number := null;
472 -- DEBUG : hr_utility.set_location(' Leaving:'||l_proc, 80);
473 --
474 when others then
475 --
476 -- A validation or unexpected error has occured
477 --
478 /* Inserted for nocopy changes */
479 p_ptnl_ler_for_per_id := null;
480 p_object_version_number := null;
481 raise;
482 --
483 end create_ptnl_ler_for_per_perf;
484 -- ----------------------------------------------------------------------------
485 -- |------------------------< update_ptnl_ler_for_per >-----------------------|
486 -- ----------------------------------------------------------------------------
487 --
488 procedure update_ptnl_ler_for_per
489 (p_validate in boolean default false
490 ,p_ptnl_ler_for_per_id in number
491 ,p_csd_by_ptnl_ler_for_per_id in number default hr_api.g_number
492 ,p_lf_evt_ocrd_dt in date default hr_api.g_date
493 ,p_trgr_table_pk_id in number default hr_api.g_number
494 ,p_ptnl_ler_for_per_stat_cd in varchar2 default hr_api.g_varchar2
495 ,p_ptnl_ler_for_per_src_cd in varchar2 default hr_api.g_varchar2
496 ,p_mnl_dt in date default hr_api.g_date
497 ,p_enrt_perd_id in number default hr_api.g_number
498 ,p_ler_id in number default hr_api.g_number
499 ,p_person_id in number default hr_api.g_number
500 ,p_business_group_id in number default hr_api.g_number
501 ,p_dtctd_dt in date default hr_api.g_date
502 ,p_procd_dt in date default hr_api.g_date
503 ,p_unprocd_dt in date default hr_api.g_date
504 ,p_voidd_dt in date default hr_api.g_date
505 ,p_mnlo_dt in date default hr_api.g_date
506 ,p_ntfn_dt in date default hr_api.g_date
507 ,p_request_id in number default hr_api.g_number
508 ,p_program_application_id in number default hr_api.g_number
509 ,p_program_id in number default hr_api.g_number
510 ,p_program_update_date in date default hr_api.g_date
511 ,p_object_version_number in out nocopy number
512 ,p_effective_date in date) is
513 --
514 -- Declare cursors and local variables
515 --
516 l_proc varchar2(72) ;
517 l_object_version_number ben_ptnl_ler_for_per.object_version_number%TYPE;
518 --
519 begin
520 --
521 g_debug := hr_utility.debug_enabled;
522 if g_debug then
523 l_proc := g_package||'update_ptnl_ler_for_per';
524 hr_utility.set_location('Entering:'|| l_proc, 10);
525 end if;
526 --
527 -- Issue a savepoint if operating in validation only mode
528 --
529 if p_validate then
530 --
531 savepoint update_ptnl_ler_for_per;
532 --
533 end if;
534 --
535 -- Process Logic
536 --
537 l_object_version_number := p_object_version_number;
538 --
539 begin
540 --
541 -- Start of API User Hook for the before hook of update_ptnl_ler_for_per
542 --
543 ben_ptnl_ler_for_per_bk2.update_ptnl_ler_for_per_b
544 (p_ptnl_ler_for_per_id => p_ptnl_ler_for_per_id
545 ,p_csd_by_ptnl_ler_for_per_id => p_csd_by_ptnl_ler_for_per_id
546 ,p_lf_evt_ocrd_dt => trunc(p_lf_evt_ocrd_dt)
547 ,p_trgr_table_pk_id => p_trgr_table_pk_id
548 ,p_ptnl_ler_for_per_stat_cd => p_ptnl_ler_for_per_stat_cd
549 ,p_ptnl_ler_for_per_src_cd => p_ptnl_ler_for_per_src_cd
550 ,p_mnl_dt => trunc(p_mnl_dt)
551 ,p_enrt_perd_id => p_enrt_perd_id
552 ,p_ler_id => p_ler_id
553 ,p_person_id => p_person_id
554 ,p_business_group_id => p_business_group_id
555 ,p_dtctd_dt => trunc(p_dtctd_dt)
556 ,p_procd_dt => trunc(p_procd_dt)
557 ,p_unprocd_dt => trunc(p_unprocd_dt)
558 ,p_voidd_dt => trunc(p_voidd_dt)
559 ,p_mnlo_dt => trunc(p_mnlo_dt)
560 ,p_ntfn_dt => trunc(p_ntfn_dt)
561 ,p_request_id => p_request_id
562 ,p_program_application_id => p_program_application_id
563 ,p_program_id => p_program_id
564 ,p_program_update_date => trunc(p_program_update_date)
565 ,p_object_version_number => p_object_version_number
566 ,p_effective_date => trunc(p_effective_date));
567 --
568 exception
569 --
570 when hr_api.cannot_find_prog_unit then
571 --
572 hr_api.cannot_find_prog_unit_error
573 (p_module_name => 'UPDATE_ptnl_ler_for_per'
574 ,p_hook_type => 'BP');
575 --
576 -- End of API User Hook for the before hook of update_ptnl_ler_for_per
577 --
578 end;
579 --
580 ben_ppl_upd.upd
581 (p_ptnl_ler_for_per_id => p_ptnl_ler_for_per_id
582 ,p_csd_by_ptnl_ler_for_per_id => p_csd_by_ptnl_ler_for_per_id
583 ,p_lf_evt_ocrd_dt => trunc(p_lf_evt_ocrd_dt)
584 ,p_trgr_table_pk_id => p_trgr_table_pk_id
585 ,p_ptnl_ler_for_per_stat_cd => p_ptnl_ler_for_per_stat_cd
586 ,p_ptnl_ler_for_per_src_cd => p_ptnl_ler_for_per_src_cd
587 ,p_mnl_dt => trunc(p_mnl_dt)
588 ,p_enrt_perd_id => p_enrt_perd_id
589 ,p_ler_id => p_ler_id
590 ,p_person_id => p_person_id
591 ,p_business_group_id => p_business_group_id
592 ,p_dtctd_dt => trunc(p_dtctd_dt)
593 ,p_procd_dt => trunc(p_procd_dt )
594 ,p_unprocd_dt => trunc(p_unprocd_dt)
595 ,p_voidd_dt => trunc(p_voidd_dt)
596 ,p_mnlo_dt => trunc(p_mnlo_dt)
597 ,p_ntfn_dt => trunc(p_ntfn_dt)
598 ,p_request_id => p_request_id
599 ,p_program_application_id => p_program_application_id
600 ,p_program_id => p_program_id
601 ,p_program_update_date => trunc(p_program_update_date)
602 ,p_object_version_number => l_object_version_number
603 ,p_effective_date => trunc(p_effective_date));
604 --
605 begin
606 --
607 -- Start of API User Hook for the after hook of update_ptnl_ler_for_per
608 --
609 ben_ptnl_ler_for_per_bk2.update_ptnl_ler_for_per_a
610 (p_ptnl_ler_for_per_id => p_ptnl_ler_for_per_id
611 ,p_csd_by_ptnl_ler_for_per_id => p_csd_by_ptnl_ler_for_per_id
612 ,p_lf_evt_ocrd_dt => trunc(p_lf_evt_ocrd_dt)
613 ,p_trgr_table_pk_id => p_trgr_table_pk_id
614 ,p_ptnl_ler_for_per_stat_cd => p_ptnl_ler_for_per_stat_cd
615 ,p_ptnl_ler_for_per_src_cd => p_ptnl_ler_for_per_src_cd
616 ,p_mnl_dt => trunc(p_mnl_dt)
617 ,p_enrt_perd_id => p_enrt_perd_id
618 ,p_ler_id => p_ler_id
619 ,p_person_id => p_person_id
620 ,p_business_group_id => p_business_group_id
621 ,p_dtctd_dt => trunc(p_dtctd_dt)
622 ,p_procd_dt => trunc(p_procd_dt)
623 ,p_unprocd_dt => trunc(p_unprocd_dt)
624 ,p_voidd_dt => trunc(p_voidd_dt)
625 ,p_mnlo_dt => trunc(p_mnlo_dt)
626 ,p_ntfn_dt => trunc(p_ntfn_dt)
627 ,p_request_id => p_request_id
628 ,p_program_application_id => p_program_application_id
629 ,p_program_id => p_program_id
630 ,p_program_update_date => trunc(p_program_update_date)
631 ,p_object_version_number => l_object_version_number
632 ,p_effective_date => trunc(p_effective_date));
633 --
634 exception
635 --
636 when hr_api.cannot_find_prog_unit then
637 --
638 hr_api.cannot_find_prog_unit_error
639 (p_module_name => 'UPDATE_ptnl_ler_for_per'
640 ,p_hook_type => 'AP');
641 --
642 -- End of API User Hook for the after hook of update_ptnl_ler_for_per
643 --
644 end;
645 --
646 if g_debug then
647 hr_utility.set_location(l_proc, 60);
648 end if;
649 --
650 -- When in validation only mode raise the Validate_Enabled exception
651 --
652 if p_validate then
653 raise hr_api.validate_enabled;
654 end if;
655 --
656 -- Set all output arguments
657 --
658 p_object_version_number := l_object_version_number;
659 --
660 if g_debug then
661 hr_utility.set_location(' Leaving:'||l_proc, 70);
662 end if;
663 --
664 exception
665 --
666 when hr_api.validate_enabled then
667 --
668 -- As the Validate_Enabled exception has been raised
669 -- we must rollback to the savepoint
670 --
671 ROLLBACK TO update_ptnl_ler_for_per;
672 --
673 -- Only set output warning arguments
674 -- (Any key or derived arguments must be set to null
675 -- when validation only mode is being used.)
676 --
677 if g_debug then
678 hr_utility.set_location(' Leaving:'||l_proc, 80);
679 end if;
680 --
681 when others then
682 --
683 -- A validation or unexpected error has occured
684 --
685 /* Inserted for nocopy changes */
686 p_object_version_number := l_object_version_number;
687 raise;
688 --
689 end update_ptnl_ler_for_per;
690 -- ----------------------------------------------------------------------------
691 -- |------------------------< update_ptnl_ler_for_per_perf >------------------|
692 -- ----------------------------------------------------------------------------
693 --
694 procedure update_ptnl_ler_for_per_perf
695 (p_validate in boolean default false
696 ,p_ptnl_ler_for_per_id in number
697 ,p_csd_by_ptnl_ler_for_per_id in number default hr_api.g_number
698 ,p_lf_evt_ocrd_dt in date default hr_api.g_date
699 ,p_trgr_table_pk_id in number default hr_api.g_number
700 ,p_ptnl_ler_for_per_stat_cd in varchar2 default hr_api.g_varchar2
701 ,p_ptnl_ler_for_per_src_cd in varchar2 default hr_api.g_varchar2
702 ,p_mnl_dt in date default hr_api.g_date
703 ,p_enrt_perd_id in number default hr_api.g_number
704 ,p_ler_id in number default hr_api.g_number
705 ,p_person_id in number default hr_api.g_number
706 ,p_business_group_id in number default hr_api.g_number
707 ,p_dtctd_dt in date default hr_api.g_date
708 ,p_procd_dt in date default hr_api.g_date
709 ,p_unprocd_dt in date default hr_api.g_date
710 ,p_voidd_dt in date default hr_api.g_date
711 ,p_mnlo_dt in date default hr_api.g_date
712 ,p_ntfn_dt in date default hr_api.g_date
713 ,p_request_id in number default hr_api.g_number
714 ,p_program_application_id in number default hr_api.g_number
715 ,p_program_id in number default hr_api.g_number
716 ,p_program_update_date in date default hr_api.g_date
717 ,p_object_version_number in out nocopy number
718 ,p_effective_date in date) is
719 --
720 -- Declare cursors and local variables
721 --
722 -- l_proc varchar2(72) := g_package||'update_ptnl_ler_for_per';
723 l_object_version_number ben_ptnl_ler_for_per.object_version_number%TYPE;
724 --
725 l_ptnl_ler_for_per_id number;
726 l_csd_by_ptnl_ler_for_per_id number;
727 l_lf_evt_ocrd_dt date;
728 l_trgr_table_pk_id number;
729 l_ntfn_dt date;
730 l_dtctd_dt date;
731 l_procd_dt date;
732 l_unprocd_dt date;
733 l_voidd_dt date;
734 l_mnlo_dt date;
735 l_mnl_dt date;
736 l_ptnl_ler_for_per_stat_cd varchar2(30);
737 l_ptnl_ler_for_per_src_cd varchar2(30);
738 l_enrt_perd_id number;
739 l_ler_id number;
740 l_business_group_id number;
741 l_person_id number;
742 l_request_id number;
743 l_program_application_id number;
744 l_program_id number;
745 l_program_update_date date;
746 --
747 begin
748 --
749 -- Issue a savepoint if operating in validation only mode
750 --
751 if p_validate then
752 --
753 savepoint update_ptnl_ler_for_per;
754 --
755 end if;
756 --
757 l_object_version_number := p_object_version_number;
758 --
759 begin
760 --
761 -- Start of API User Hook for the before hook of update_ptnl_ler_for_per
762 --
763 ben_ptnl_ler_for_per_bk2.update_ptnl_ler_for_per_b
764 (p_ptnl_ler_for_per_id => p_ptnl_ler_for_per_id
765 ,p_csd_by_ptnl_ler_for_per_id => p_csd_by_ptnl_ler_for_per_id
766 ,p_lf_evt_ocrd_dt => trunc(p_lf_evt_ocrd_dt)
767 ,p_trgr_table_pk_id => p_trgr_table_pk_id
768 ,p_ptnl_ler_for_per_stat_cd => p_ptnl_ler_for_per_stat_cd
769 ,p_ptnl_ler_for_per_src_cd => p_ptnl_ler_for_per_src_cd
770 ,p_mnl_dt => trunc(p_mnl_dt)
771 ,p_enrt_perd_id => p_enrt_perd_id
772 ,p_ler_id => p_ler_id
773 ,p_person_id => p_person_id
774 ,p_business_group_id => p_business_group_id
775 ,p_dtctd_dt => p_dtctd_dt
776 ,p_procd_dt => trunc(p_procd_dt)
777 ,p_unprocd_dt => trunc(p_unprocd_dt)
778 ,p_voidd_dt => trunc(p_voidd_dt)
779 ,p_mnlo_dt => trunc(p_mnlo_dt)
780 ,p_ntfn_dt => trunc(p_ntfn_dt)
781 ,p_request_id => p_request_id
782 ,p_program_application_id => p_program_application_id
783 ,p_program_id => p_program_id
784 ,p_program_update_date => trunc(p_program_update_date)
785 ,p_object_version_number => p_object_version_number
786 ,p_effective_date => trunc(p_effective_date));
787 --
788 exception
789 --
790 when hr_api.cannot_find_prog_unit then
791 --
792 hr_api.cannot_find_prog_unit_error
793 (p_module_name => 'UPDATE_ptnl_ler_for_per'
794 ,p_hook_type => 'BP');
795 --
796 -- End of API User Hook for the before hook of update_ptnl_ler_for_per
797 --
798 end;
799 --
800 -- Lock the record so we can default properly
801 --
802 ben_ppl_shd.lck(p_ptnl_ler_for_per_id => p_ptnl_ler_for_per_id,
803 p_object_version_number => l_object_version_number);
804 --
805 -- default variables for update
806 --
807 l_csd_by_ptnl_ler_for_per_id := p_csd_by_ptnl_ler_for_per_id;
808 If (l_csd_by_ptnl_ler_for_per_id = hr_api.g_number) then
809 l_csd_by_ptnl_ler_for_per_id :=
810 ben_ppl_shd.g_old_rec.csd_by_ptnl_ler_for_per_id;
811 End If;
812 l_lf_evt_ocrd_dt := trunc(p_lf_evt_ocrd_dt);
813 If (p_lf_evt_ocrd_dt = hr_api.g_date) then
814 l_lf_evt_ocrd_dt :=
815 ben_ppl_shd.g_old_rec.lf_evt_ocrd_dt;
816 End If;
817 l_trgr_table_pk_id := p_trgr_table_pk_id;
818 If (p_trgr_table_pk_id = hr_api.g_number) then
819 l_trgr_table_pk_id :=
820 ben_ppl_shd.g_old_rec.trgr_table_pk_id;
821 End If;
822 l_ptnl_ler_for_per_stat_cd := p_ptnl_ler_for_per_stat_cd;
823 If (l_ptnl_ler_for_per_stat_cd = hr_api.g_varchar2) then
824 l_ptnl_ler_for_per_stat_cd :=
825 ben_ppl_shd.g_old_rec.ptnl_ler_for_per_stat_cd;
826 End If;
827 l_ptnl_ler_for_per_src_cd := p_ptnl_ler_for_per_src_cd;
828 If (l_ptnl_ler_for_per_src_cd = hr_api.g_varchar2) then
829 l_ptnl_ler_for_per_src_cd :=
830 ben_ppl_shd.g_old_rec.ptnl_ler_for_per_src_cd;
831 End If;
832 l_enrt_perd_id := p_enrt_perd_id;
833 If (l_enrt_perd_id = hr_api.g_number) then
834 l_enrt_perd_id :=
835 ben_ppl_shd.g_old_rec.enrt_perd_id;
836 End If;
837 l_ler_id := p_ler_id;
838 If (l_ler_id = hr_api.g_number) then
839 l_ler_id :=
840 ben_ppl_shd.g_old_rec.ler_id;
841 End If;
842 l_ntfn_dt := trunc(p_ntfn_dt);
843 If (l_ntfn_dt = hr_api.g_date) then
844 l_ntfn_dt :=
845 ben_ppl_shd.g_old_rec.ntfn_dt;
846 End If;
847 l_dtctd_dt := trunc(p_dtctd_dt);
848 If (l_dtctd_dt = hr_api.g_date) then
849 l_dtctd_dt :=
850 ben_ppl_shd.g_old_rec.dtctd_dt;
851 End If;
852 l_procd_dt := trunc(p_procd_dt);
853 If (l_procd_dt = hr_api.g_date) then
854 l_procd_dt :=
855 ben_ppl_shd.g_old_rec.procd_dt;
856 End If;
857 l_unprocd_dt := trunc(p_unprocd_dt);
858 If (l_unprocd_dt = hr_api.g_date) then
859 l_unprocd_dt :=
860 ben_ppl_shd.g_old_rec.unprocd_dt;
861 End If;
862 l_voidd_dt := trunc(p_voidd_dt);
863 If (l_voidd_dt = hr_api.g_date) then
864 l_voidd_dt :=
865 ben_ppl_shd.g_old_rec.voidd_dt;
866 End If;
867 l_mnlo_dt := trunc(p_mnlo_dt);
868 If (l_mnlo_dt = hr_api.g_date) then
869 l_mnlo_dt :=
870 ben_ppl_shd.g_old_rec.mnlo_dt;
871 End If;
872 l_mnl_dt := trunc(p_mnl_dt);
873 If (l_mnl_dt = hr_api.g_date) then
874 l_mnl_dt :=
875 ben_ppl_shd.g_old_rec.mnl_dt;
876 End If;
877 l_person_id := p_person_id;
878 If (l_person_id = hr_api.g_number) then
879 l_person_id :=
880 ben_ppl_shd.g_old_rec.person_id;
881 End If;
882 l_business_group_id := p_business_group_id;
883 If (l_business_group_id = hr_api.g_number) then
884 l_business_group_id :=
885 ben_ppl_shd.g_old_rec.business_group_id;
886 End If;
887 l_request_id := p_request_id;
888 If (l_request_id = hr_api.g_number) then
889 l_request_id :=
890 ben_ppl_shd.g_old_rec.request_id;
891 End If;
892 l_program_application_id := p_program_application_id;
893 If (l_program_application_id = hr_api.g_number) then
894 l_program_application_id :=
895 ben_ppl_shd.g_old_rec.program_application_id;
896 End If;
897 l_program_id := p_program_id;
898 If (l_program_id = hr_api.g_number) then
899 l_program_id :=
900 ben_ppl_shd.g_old_rec.program_id;
901 End If;
902 l_program_update_date := trunc(p_program_update_date);
903 If (l_program_update_date = hr_api.g_date) then
904 l_program_update_date :=
905 ben_ppl_shd.g_old_rec.program_update_date;
906 End If;
907 --
908 l_object_version_number := l_object_version_number + 1;
909 --
910 -- Update the row using the old values for defaulted parameters and
911 -- any changed values for passed parameters.
912 --
913 update ben_ptnl_ler_for_per
914 set lf_evt_ocrd_dt = l_lf_evt_ocrd_dt,
915 trgr_table_pk_id = l_trgr_table_pk_id,
916 csd_by_ptnl_ler_for_per_id = l_csd_by_ptnl_ler_for_per_id,
917 ptnl_ler_for_per_stat_cd = l_ptnl_ler_for_per_stat_cd,
918 ptnl_ler_for_per_src_cd = l_ptnl_ler_for_per_src_cd,
919 mnl_dt = l_mnl_dt,
920 enrt_perd_id = l_enrt_perd_id,
921 ler_id = l_ler_id,
922 person_id = l_person_id,
923 business_group_id = l_business_group_id,
924 dtctd_dt = l_dtctd_dt,
925 procd_dt = l_procd_dt,
926 unprocd_dt = l_unprocd_dt,
927 voidd_dt = l_voidd_dt,
928 mnlo_dt = l_mnlo_dt,
929 ntfn_dt = l_ntfn_dt,
930 request_id = l_request_id,
931 program_application_id = l_program_application_id,
932 program_id = l_program_id,
933 program_update_date = l_program_update_date,
934 object_version_number = l_object_version_number
935 where ptnl_ler_for_per_id = p_ptnl_ler_for_per_id;
936 --
937 begin
938 --
939 -- Start of API User Hook for the after hook of update_ptnl_ler_for_per
940 --
941 ben_ptnl_ler_for_per_bk2.update_ptnl_ler_for_per_a
942 (p_ptnl_ler_for_per_id => p_ptnl_ler_for_per_id
943 ,p_csd_by_ptnl_ler_for_per_id => p_csd_by_ptnl_ler_for_per_id
944 ,p_lf_evt_ocrd_dt => trunc(p_lf_evt_ocrd_dt)
945 ,p_trgr_table_pk_id => p_trgr_table_pk_id
946 ,p_ptnl_ler_for_per_stat_cd => p_ptnl_ler_for_per_stat_cd
947 ,p_ptnl_ler_for_per_src_cd => p_ptnl_ler_for_per_src_cd
948 ,p_mnl_dt => trunc(p_mnl_dt)
949 ,p_enrt_perd_id => p_enrt_perd_id
950 ,p_ler_id => p_ler_id
951 ,p_person_id => p_person_id
952 ,p_business_group_id => p_business_group_id
953 ,p_dtctd_dt => trunc(p_dtctd_dt)
954 ,p_procd_dt => trunc(p_procd_dt)
955 ,p_unprocd_dt => trunc(p_unprocd_dt)
956 ,p_voidd_dt => trunc(p_voidd_dt)
957 ,p_mnlo_dt => trunc(p_mnlo_dt)
958 ,p_ntfn_dt => trunc(p_ntfn_dt)
959 ,p_request_id => p_request_id
960 ,p_program_application_id => p_program_application_id
961 ,p_program_id => p_program_id
962 ,p_program_update_date => trunc(p_program_update_date)
963 ,p_object_version_number => l_object_version_number
964 ,p_effective_date => trunc(p_effective_date));
965 --
966 exception
967 --
968 when hr_api.cannot_find_prog_unit then
969 --
970 hr_api.cannot_find_prog_unit_error
971 (p_module_name => 'UPDATE_ptnl_ler_for_per'
972 ,p_hook_type => 'AP');
973 --
974 -- End of API User Hook for the after hook of update_ptnl_ler_for_per
975 --
976 end;
977 --
978 -- When in validation only mode raise the Validate_Enabled exception
979 --
980 if p_validate then
981 raise hr_api.validate_enabled;
982 end if;
983 --
984 -- Set all output arguments
985 --
986 p_object_version_number := l_object_version_number;
987 --
988 exception
989 --
990 when hr_api.validate_enabled then
991 --
992 -- As the Validate_Enabled exception has been raised
993 -- we must rollback to the savepoint
994 --
995 ROLLBACK TO update_ptnl_ler_for_per;
996 --
997 -- Only set output warning arguments
998 -- (Any key or derived arguments must be set to null
999 -- when validation only mode is being used.)
1000 --
1001 when others then
1002 --
1003 -- A validation or unexpected error has occured
1004 --
1005 /* Inserted for nocopy changes */
1006 p_object_version_number := l_object_version_number;
1007 raise;
1008 --
1009 end update_ptnl_ler_for_per_perf;
1010 -- ----------------------------------------------------------------------------
1011 -- |------------------------< delete_ptnl_ler_for_per >-----------------------|
1012 -- ----------------------------------------------------------------------------
1013 --
1014 procedure delete_ptnl_ler_for_per
1015 (p_validate in boolean default false
1016 ,p_ptnl_ler_for_per_id in number
1017 ,p_object_version_number in out nocopy number
1018 ,p_effective_date in date) is
1019 --
1020 -- Declare cursors and local variables
1021 --
1022 l_proc varchar2(72);
1023 l_object_version_number ben_ptnl_ler_for_per.object_version_number%TYPE;
1024 --
1025 begin
1026 --
1027 g_debug := hr_utility.debug_enabled;
1028 if g_debug then
1029 l_proc := g_package||'update_ptnl_ler_for_per';
1030 hr_utility.set_location('Entering:'|| l_proc, 10);
1031 end if;
1032 --
1033 -- Issue a savepoint if operating in validation only mode
1034 --
1035 if p_validate then
1036 --
1037 savepoint delete_ptnl_ler_for_per;
1038 --
1039 end if;
1040 --
1041 -- Process Logic
1042 --
1043 l_object_version_number := p_object_version_number;
1044 --
1045 begin
1046 --
1047 -- Start of API User Hook for the before hook of delete_ptnl_ler_for_per
1048 --
1049 ben_ptnl_ler_for_per_bk3.delete_ptnl_ler_for_per_b
1050 (p_ptnl_ler_for_per_id => p_ptnl_ler_for_per_id
1051 ,p_object_version_number => p_object_version_number
1052 ,p_effective_date => trunc(p_effective_date));
1053 --
1054 exception
1055 --
1056 when hr_api.cannot_find_prog_unit then
1057 --
1058 hr_api.cannot_find_prog_unit_error
1059 (p_module_name => 'DELETE_ptnl_ler_for_per'
1060 ,p_hook_type => 'BP');
1061 --
1062 -- End of API User Hook for the before hook of delete_ptnl_ler_for_per
1063 --
1064 end;
1065 --
1066 ben_ppl_del.del
1067 (p_ptnl_ler_for_per_id => p_ptnl_ler_for_per_id
1068 ,p_object_version_number => l_object_version_number
1069 ,p_effective_date => p_effective_date);
1070 --
1071 begin
1072 --
1073 -- Start of API User Hook for the after hook of delete_ptnl_ler_for_per
1074 --
1075 ben_ptnl_ler_for_per_bk3.delete_ptnl_ler_for_per_a
1076 (p_ptnl_ler_for_per_id => p_ptnl_ler_for_per_id
1077 ,p_object_version_number => l_object_version_number
1078 ,p_effective_date => trunc(p_effective_date));
1079 --
1080 exception
1081 --
1082 when hr_api.cannot_find_prog_unit then
1083 --
1084 hr_api.cannot_find_prog_unit_error
1085 (p_module_name => 'DELETE_ptnl_ler_for_per'
1086 ,p_hook_type => 'AP');
1087 --
1088 -- End of API User Hook for the after hook of delete_ptnl_ler_for_per
1089 --
1090 end;
1091 --
1092 if g_debug then
1093 hr_utility.set_location(l_proc, 60);
1094 end if;
1095 --
1096 -- When in validation only mode raise the Validate_Enabled exception
1097 --
1098 if p_validate then
1099 raise hr_api.validate_enabled;
1100 end if;
1101 --
1102 if g_debug then
1103 hr_utility.set_location(' Leaving:'||l_proc, 70);
1104 end if;
1105 --
1106 exception
1107 --
1108 when hr_api.validate_enabled then
1109 --
1110 -- As the Validate_Enabled exception has been raised
1111 -- we must rollback to the savepoint
1112 --
1113 ROLLBACK TO delete_ptnl_ler_for_per;
1114 --
1115 -- Only set output warning arguments
1116 -- (Any key or derived arguments must be set to null
1117 -- when validation only mode is being used.)
1118 --
1119 --
1120 when others then
1121 --
1122 -- A validation or unexpected error has occured
1123 --
1124 /* Inserted for nocopy changes */
1125 p_object_version_number := l_object_version_number;
1126 raise;
1127 --
1128 end delete_ptnl_ler_for_per;
1129 --
1130 -- ----------------------------------------------------------------------------
1131 -- |-------------------------------< lck >------------------------------------|
1132 -- ----------------------------------------------------------------------------
1133 --
1134 procedure lck
1135 (p_ptnl_ler_for_per_id in number
1136 ,p_object_version_number in number) is
1137 --
1138 --
1139 -- Declare cursors and local variables
1140 --
1141 l_proc varchar2(72);
1142 --
1143 begin
1144 --
1145 g_debug := hr_utility.debug_enabled;
1146 if g_debug then
1147 l_proc := g_package||'lck';
1148 hr_utility.set_location('Entering:'|| l_proc, 10);
1149 end if;
1150 --
1151 ben_ppl_shd.lck
1152 (p_ptnl_ler_for_per_id => p_ptnl_ler_for_per_id
1153 ,p_object_version_number => p_object_version_number);
1154 --
1155 if g_debug then
1156 hr_utility.set_location(' Leaving:'||l_proc, 70);
1157 end if;
1158 --
1159 end lck;
1160 --
1161 end ben_ptnl_ler_for_per_api;