[Home] [Help]
PACKAGE BODY: APPS.BEN_PCP_BUS
Source
1 Package Body ben_pcp_bus as
2 /* $Header: bepcprhi.pkb 115.13 2002/12/16 12:00:12 vsethi noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_pcp_bus.'; -- Global package name
9 --
10 -- The following two global variables are only to be
11 -- used by the return_legislation_code function.
12 --
13 g_legislation_code varchar2(150) default null;
14 g_pl_pcp_id number default null;
15 --
16 -- ----------------------------------------------------------------------------
17 -- |------< chk_pl_pcp_id >------|
18 -- ----------------------------------------------------------------------------
19 --
20 -- Description
21 -- This procedure is used to check that the primary key for the table
22 -- is created properly. It should be null on insert and
23 -- should not be able to be updated.
24 --
25 -- Pre Conditions
26 -- None.
27 --
28 -- In Parameters
29 -- pl_pcp_id PK of record being inserted or updated.
30 -- object_version_number Object version number of record being
31 -- inserted or updated.
32 --
33 -- Post Success
34 -- Processing continues
35 --
36 -- Post Failure
37 -- Errors handled by the procedure
38 --
39 -- Access Status
40 -- Internal table handler use only.
41 --
42 Procedure chk_pl_pcp_id(p_pl_pcp_id in number,
43 p_object_version_number in number) is
44 --
45 l_proc varchar2(72) := g_package||'chk_pl_pcp_id';
46 l_api_updating boolean;
47 --
48 Begin
49 --
50 hr_utility.set_location('Entering:'||l_proc, 5);
51 --
52 l_api_updating := ben_pcp_shd.api_updating
53 (p_pl_pcp_id => p_pl_pcp_id,
54 p_object_version_number => p_object_version_number);
55 --
56 if (l_api_updating
57 and nvl(p_pl_pcp_id,hr_api.g_number)
58 <> ben_pcp_shd.g_old_rec.pl_pcp_id) then
59 --
60 -- raise error as PK has changed
61 --
62 ben_pcp_shd.constraint_error('BEN_PL_PCP_PK');
63 --
64 elsif not l_api_updating then
65 --
66 -- check if PK is null
67 --
68 if p_pl_pcp_id is not null then
69 --
70 -- raise error as PK is not null
71 --
72 ben_pcp_shd.constraint_error('BEN_PL_PCP_PK');
73 --
74 end if;
75 --
76 end if;
77 --
78 hr_utility.set_location('Leaving:'||l_proc, 10);
79 --
80 End chk_pl_pcp_id;
81 --
82 -- ----------------------------------------------------------------------------
83 -- |------< 1 chk_pl_pcp_rec_exist >------|
84 -- ----------------------------------------------------------------------------
85 --
86 -- Description
87 -- This procedure is used to make sure that the record doesn't exist for the -- -- same plan
88 --
89 -- Pre Conditions
90 -- None.
91 --
92 -- In Parameters
93 -- pl_id of a record.
94 --
95 -- Post Success
96 -- Processing continues
97 --
98 -- Post Failure
99 -- Errors handled by the procedure
100 --
101 -- Access Status
102 -- Internal table handler use only.
103 --
104
105 Procedure chk_pl_pcp_rec_exists
106 ( p_pl_id in number,
107 p_pl_pcp_id in number
108 ) is
109
110 l_proc varchar2(72) := g_package|| ' chk_pl_pcp_rec_exists';
111 l_dummy number;
112 --cursor to check the row exists in the database or not
113
114 cursor c1 is
115 select pcp.pl_pcp_id
116 from ben_pl_pcp pcp
117 Where pcp.pl_id = p_pl_id
118 and pcp.pl_pcp_id <> nvl(p_pl_pcp_id,-1)
119 ;
120
121 --
122 Begin
123 hr_utility.set_location('Entering:'||l_proc, 5);
124 --
125 open c1;
126 fetch c1 into l_dummy;
127 if c1%found then
128 close c1;
129 -- Create new message in seed database (Plan Already exists for the
130 -- particular plan id
131 fnd_message.set_name('BEN','BEN_92595_REC_EXISTS');
132 fnd_message.raise_error;
133 end if;
134 close c1;
135
136 hr_utility.set_location('Leaving:'||l_proc, 15);
137 End chk_pl_pcp_rec_exists;
138 --
139 -- ----------------------------------------------------------------------------
140 -- |------< chk_pcp_strt_dt_cd >------|
141 -- ----------------------------------------------------------------------------
142 --
143 -- Description
144 -- This procedure is used to check that the lookup value is valid.
145 --
146 -- Pre Conditions
147 -- None.
148 --
149 -- In Parameters
150 -- p_pl_pcp_id PK of record being inserted or updated.
151 -- pcp_strt_dt_cd Value of lookup code.
152 -- effective_date effective date
153 -- object_version_number Object version number of record being
154 -- inserted or updated.
155 --
156 -- Post Success
157 -- Processing continues
158 --
159 -- Post Failure
160 -- Error handled by procedure
161 --
162 -- Access Status
163 -- Internal table handler use only.
164 --
165 Procedure chk_pcp_strt_dt_cd(p_pl_pcp_id in number,
166 p_pcp_strt_dt_cd in varchar2,
167 p_effective_date in date,
168 p_object_version_number in number) is
169 --
170 l_proc varchar2(72) := g_package||'chk_pcp_strt_dt_cd';
171 l_api_updating boolean;
172 --
173 Begin
174 --
175 hr_utility.set_location('Entering:'||l_proc, 5);
176 --
177 l_api_updating := ben_pcp_shd.api_updating
178 (p_pl_pcp_id => p_pl_pcp_id,
179 p_object_version_number => p_object_version_number);
180 --
181 if p_pcp_strt_dt_cd is null then
182 fnd_message.set_name('BEN','BEN_92593_DATA_NULL');
183 fnd_message.set_token('FIELD', 'Start Date Code');
184 fnd_message.raise_error;
185 end if;
186 if (l_api_updating
187 and p_pcp_strt_dt_cd <> nvl(ben_pcp_shd.g_old_rec.pcp_strt_dt_cd,hr_api.g_varchar2)
188 or not l_api_updating)
189 and p_pcp_strt_dt_cd is not null then
190 --
191 -- check if value of lookup falls within lookup type.
192 --
193 if hr_api.not_exists_in_hr_lookups
194 (p_lookup_type => 'BEN_PCP_STRT_DT',
195 p_lookup_code => p_pcp_strt_dt_cd,
196 p_effective_date => p_effective_date) then
197 --
198 -- raise error as does not exist as lookup
199 --
200 fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
201 fnd_message.set_token('FIELD','p_pcp_strt_dt_cd');
202 fnd_message.set_token('TYPE','BEN_PCP_STRT_DT');
203 fnd_message.raise_error;
204 --
205 end if;
206 --
207 end if;
208 --
209 hr_utility.set_location('Leaving:'||l_proc,10);
210 --
211 end chk_pcp_strt_dt_cd;
212 --
213 --
214 --
215 -- ----------------------------------------------------------------------------
216 -- |------< chk_pcp_dsgn_cd >------|
217 -- ----------------------------------------------------------------------------
218 --
219 -- Description
220 -- This procedure is used to check that the lookup value is valid.
221 --
222 -- Pre Conditions
223 -- None.
224 --
225 -- In Parameters
226 -- p_pl_pcp_id PK of record being inserted or updated.
227 -- pcp_dsgn_cd Value of lookup code.
228 -- effective_date effective date
229 -- object_version_number Object version number of record being
230 -- inserted or updated.
231 --
232 -- Post Success
233 -- Processing continues
234 --
235 -- Post Failure
236 -- Error handled by procedure
237 --
238 -- Access Status
239 -- Internal table handler use only.
240 --
241 Procedure chk_pcp_dsgn_cd(p_pl_pcp_id in number,
242 p_pcp_dsgn_cd in varchar2,
243 p_effective_date in date,
244 p_object_version_number in number) is
245 --
246 l_proc varchar2(72) := g_package||'chk_pcp_dsgn_cd';
247 l_api_updating boolean;
248 --
249 Begin
250 --
251 hr_utility.set_location('Entering:'||l_proc, 5);
252 --
253 l_api_updating := ben_pcp_shd.api_updating
254 (p_pl_pcp_id => p_pl_pcp_id,
255 p_object_version_number => p_object_version_number);
256 --
257 --Ask Sharmista what is the token name for this CD
258 if p_pcp_dsgn_cd is null then
259 fnd_message.set_name('BEN','BEN_92593_DATA_NULL');
260 fnd_message.set_token('FIELD', 'Designation Code');
261 fnd_message.raise_error;
262 end if;
263 if (l_api_updating
264 and p_pcp_dsgn_cd <> nvl(ben_pcp_shd.g_old_rec.pcp_dsgn_cd,hr_api.g_varchar2)
265 or not l_api_updating)
266 and p_pcp_dsgn_cd is not null then
267 --
268 -- check if value of lookup falls within lookup type.
269 --
270 if hr_api.not_exists_in_hr_lookups
271 (p_lookup_type => 'BEN_PCP_DSGN',
272 p_lookup_code => p_pcp_dsgn_cd,
273 p_effective_date => p_effective_date) then
274 --
275 -- raise error as does not exist as lookup
276 --
277 fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
278 fnd_message.set_token('FIELD','p_pcp_dsgn_cd');
279 fnd_message.set_token('TYPE','BEN_PCP_DSGN');
280 fnd_message.raise_error;
281 --
282 end if;
283 --
284 end if;
285 --
286 hr_utility.set_location('Leaving:'||l_proc,10);
287 --
288 end chk_pcp_dsgn_cd;
289 --
290 --
291 -- ----------------------------------------------------------------------------
292 -- |------< chk_pcp_dpnt_dsgn_cd >------|
293 -- ----------------------------------------------------------------------------
294 --
295 -- Description
296 -- This procedure is used to check that the lookup value is valid.
297 --
298 -- Pre Conditions
299 -- None.
300 --
301 -- In Parameters
302 -- p_pl_pcp_id PK of record being inserted or updated.
303 -- pcp_dpnt_dsgn_cd Value of lookup code.
304 -- effective_date effective date
305 -- object_version_number Object version number of record being
306 -- inserted or updated.
307 --
308 -- Post Success
309 -- Processing continues
310 --
311 -- Post Failure
312 -- Error handled by procedure
313 --
314 -- Access Status
315 -- Internal table handler use only.
316 --
317 Procedure chk_pcp_dpnt_dsgn_cd(p_pl_pcp_id in number,
318 p_pcp_dpnt_dsgn_cd in varchar2,
319 p_effective_date in date,
320 p_object_version_number in number) is
321 --
322 l_proc varchar2(72) := g_package||'chk_pcp_dpnt_dsgn_cd';
323 l_api_updating boolean;
324 --
325 Begin
326 --
327 hr_utility.set_location('Entering:'||l_proc, 5);
328 --
329 l_api_updating := ben_pcp_shd.api_updating
330 (p_pl_pcp_id => p_pl_pcp_id,
331 p_object_version_number => p_object_version_number);
332 --
333 --Ask Sharmista what is the token name for this CD
334 if p_pcp_dpnt_dsgn_cd is null then
335 fnd_message.set_name('BEN','BEN_92593_DATA_NULL');
336 fnd_message.set_token('FIELD', 'Dependent Designation Code');
337 fnd_message.raise_error;
338 end if;
339 if (l_api_updating
340 and p_pcp_dpnt_dsgn_cd <> nvl(ben_pcp_shd.g_old_rec.pcp_dpnt_dsgn_cd,hr_api.g_varchar2)
341 or not l_api_updating)
342 and p_pcp_dpnt_dsgn_cd is not null then
343 --
344 -- check if value of lookup falls within lookup type.
345 --
346 if hr_api.not_exists_in_hr_lookups
347 (p_lookup_type => 'BEN_PCP_DSGN',
348 p_lookup_code => p_pcp_dpnt_dsgn_cd,
349 p_effective_date => p_effective_date) then
350 --
351 -- raise error as does not exist as lookup
352 --
353 fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
354 fnd_message.set_token('FIELD','p_pcp_dpnt_dsgn_cd');
355 fnd_message.set_token('TYPE','BEN_PCP_DPNT_DSGN');
356 fnd_message.raise_error;
357 --
358 end if;
359 --
360 end if;
361 --
362 hr_utility.set_location('Leaving:'||l_proc,10);
363 --
364 end chk_pcp_dpnt_dsgn_cd;
365 --
366 --
367 -- ----------------------------------------------------------------------------
368 -- |------< chk_pcp_rpstry_flag >------|
369 -- ----------------------------------------------------------------------------
370 --
371 -- Description
372 -- This procedure is used to check that the lookup value is valid.
373 -- when pcp_rpstry_flag=yes.
374 -- Pre Conditions
375 -- None.
376 --
377 -- In Parameters
378 -- pl_pcp_id PK of record being inserted or updated.
379 -- pcp_rpstry_flag Value of lookup code.
380 -- effective_date effective date
381 -- object_version_number Object version number of record being
382 -- inserted or updated.
383 --
384 -- Post Success
385 -- Processing continues
386 --
387 -- Post Failure
388 -- Error handled by procedure
389 --
390 -- Access Status
391 -- Internal table handler use only.
392 --
393 Procedure chk_pcp_rpstry_flag(p_pl_pcp_id in number,
394 p_pcp_rpstry_flag in varchar2,
395 p_effective_date in date,
396 p_object_version_number in number) is
397 --
398 l_proc varchar2(72) := g_package||'chk_pcp_rpstry_flag';
399 l_api_updating boolean;
400 --
401 Begin
402 --
403 hr_utility.set_location('Entering:'||l_proc, 5);
404 --
405 l_api_updating := ben_pcp_shd.api_updating
406 (p_pl_pcp_id => p_pl_pcp_id,
407 p_object_version_number => p_object_version_number);
408 --
409 if (l_api_updating
410 and p_pcp_rpstry_flag
411 <> nvl(ben_pcp_shd.g_old_rec.pcp_rpstry_flag,hr_api.g_varchar2)
412 or not l_api_updating)
413 and p_pcp_rpstry_flag is not null then
414 --
415 -- check if value of lookup falls within lookup type.
416 --
417 if hr_api.not_exists_in_hr_lookups
418 (p_lookup_type => 'YES_NO',
419 p_lookup_code => p_pcp_rpstry_flag,
420 p_effective_date => p_effective_date) then
421 --
422 -- raise error as does not exist as lookup
423 --
424 fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
425 fnd_message.set_token('FIELD','p_pcp_rpstry_flag');
426 fnd_message.set_token('TYPE','YES_NO');
427 fnd_message.raise_error;
428 --
429 end if;
430 --
431 end if;
432 --
433 hr_utility.set_location('Leaving:'||l_proc,10);
434 --
435 end chk_pcp_rpstry_flag;
436 --
437 --
438 -- ----------------------------------------------------------------------------
439 -- |------< chk_pcp_can_keep_flag >------|
440 -- ----------------------------------------------------------------------------
441 --
442 -- Description
443 -- This procedure is used to check that the lookup value is valid.
444 -- It also checks if output filename is null when pcp_can_keep_flag=yes.
445 -- Pre Conditions
446 -- None.
447 --
448 -- In Parameters
449 -- pl_pcp_id PK of record being inserted or updated.
453 -- inserted or updated.
450 -- pcp_can_keep_flag Value of lookup code.
451 -- effective_date effective date
452 -- object_version_number Object version number of record being
454 --
455 -- Post Success
456 -- Processing continues
457 --
458 -- Post Failure
459 -- Error handled by procedure
460 --
461 -- Access Status
462 -- Internal table handler use only.
463 --
464 Procedure chk_pcp_can_keep_flag(p_pl_pcp_id in number,
465 p_pcp_can_keep_flag in varchar2,
466 p_effective_date in date,
467 p_object_version_number in number) is
468 --
469 l_proc varchar2(72) := g_package||'chk_pcp_can_keep_flag';
470 l_api_updating boolean;
471 --
472 Begin
473 --
474 hr_utility.set_location('Entering:'||l_proc, 5);
475 --
476 l_api_updating := ben_pcp_shd.api_updating
477 (p_pl_pcp_id => p_pl_pcp_id,
478 p_object_version_number => p_object_version_number);
479 --
480 if (l_api_updating
481 and p_pcp_can_keep_flag
482 <> nvl(ben_pcp_shd.g_old_rec.pcp_can_keep_flag,hr_api.g_varchar2)
483 or not l_api_updating)
484 and p_pcp_can_keep_flag is not null then
485 --
486 -- check if value of lookup falls within lookup type.
487 --
488 if hr_api.not_exists_in_hr_lookups
489 (p_lookup_type => 'YES_NO',
490 p_lookup_code => p_pcp_can_keep_flag,
491 p_effective_date => p_effective_date) then
492 --
493 -- raise error as does not exist as lookup
494 --
495 fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
496 fnd_message.set_token('FIELD','p_pcp_can_keep_flag');
497 fnd_message.set_token('TYPE','YES_NO');
498 fnd_message.raise_error;
499 --
500 end if;
501 --
502 end if;
503 --
504 hr_utility.set_location('Leaving:'||l_proc,10);
505 --
506 end chk_pcp_can_keep_flag;
507 --
508 --
509 -- ----------------------------------------------------------------------------
510 -- |------< chk_pcp_radius_warn_flag >------|
511 -- ----------------------------------------------------------------------------
512 --
513 -- Description
514 -- This procedure is used to check that the lookup value is valid.
515 -- It also checks if output filename is null when pcp_radius_warn_flag=yes.
516 -- Pre Conditions
517 -- None.
518 --
519 -- In Parameters
520 -- pl_pcp_id PK of record being inserted or updated.
521 -- pcp_radius_warn_flag Value of lookup code.
522 -- effective_date effective date
523 -- object_version_number Object version number of record being
524 -- inserted or updated.
525 --
526 -- Post Success
527 -- Processing continues
528 --
529 -- Post Failure
530 -- Error handled by procedure
531 --
532 -- Access Status
533 -- Internal table handler use only.
534 --
535 Procedure chk_pcp_radius_warn_flag(p_pl_pcp_id in number,
536 p_pcp_radius_warn_flag in varchar2,
537 p_effective_date in date,
538 p_object_version_number in number) is
539 --
540 l_proc varchar2(72) := g_package||'chk_pcp_radius_warn_flag';
541 l_api_updating boolean;
542 --
543 Begin
544 --
545 hr_utility.set_location('Entering:'||l_proc, 5);
546 --
547 l_api_updating := ben_pcp_shd.api_updating
548 (p_pl_pcp_id => p_pl_pcp_id,
549 p_object_version_number => p_object_version_number);
550 --
551 if (l_api_updating
552 and p_pcp_radius_warn_flag
553 <> nvl(ben_pcp_shd.g_old_rec.pcp_radius_warn_flag,hr_api.g_varchar2)
554 or not l_api_updating)
558 --
555 and p_pcp_radius_warn_flag is not null then
556 --
557 -- check if value of lookup falls within lookup type.
559 if hr_api.not_exists_in_hr_lookups
560 (p_lookup_type => 'YES_NO',
561 p_lookup_code => p_pcp_radius_warn_flag,
562 p_effective_date => p_effective_date) then
563 --
564 -- raise error as does not exist as lookup
565 --
566 fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
567 fnd_message.set_token('FIELD','p_pcp_radius_warn_flag');
568 fnd_message.set_token('TYPE','YES_NO');
569 fnd_message.raise_error;
570 --
571 end if;
572 --
573 end if;
574 --
575 hr_utility.set_location('Leaving:'||l_proc,10);
576 --
577 end chk_pcp_radius_warn_flag;
578 --
579 -- ----------------------------------------------------------------------------
580 -- |------< 1 chk_pl_pcp_radius_parm >------|
581 -- ----------------------------------------------------------------------------
582 --
583 -- Description
584 -- This procedure is used to check the pcp_radius, pcp_radius_uom, pcp_radius_warn_flag
585 -- can not have a value unless the pcp_rpstry_flag = 'Y'. However, the pcp_radius is not
586 -- required if the flag is 'Y'.
587 --
588 -- Pre Conditions
589 -- None.
590 --
591 -- In Parameters
592 -- pcp_rpstry_flag of record
593 -- pcp_radius of record
594 -- pcp_radius_uom of record
595 -- pcp_radius_warn_flag of record.
596 --
597 -- Post Success
598 -- Processing continues
599 --
600 -- Post Failure
601 -- Errors handled by the procedure
602 --
603 -- Access Status
604 -- Internal table handler use only.
605 --
606
607 Procedure chk_pl_pcp_radius_parm(p_pcp_rpstry_flag varchar2
608 ,p_pcp_radius number
609 ,p_pcp_radius_uom varchar2
610 ,p_pcp_radius_warn_flag varchar2) is
611 --
612 l_proc varchar2(72) := g_package||'chk_pl_pcp_radius_parm';
613 --
614 Begin
615 --
616 hr_utility.set_location('Entering:'||l_proc, 5);
617 --
618 --
619 --
620 if p_pcp_rpstry_flag = 'N' then
621 if (p_pcp_radius is not null or p_pcp_radius_uom is not null) then
622 --
623 -- Raise error as pcp_radius, pcp_radius_uom are null
624 --
625 fnd_message.set_name('BEN','BEN_92560_RADIUS_PARM');
626 fnd_message.raise_error;
627 end if;
628 end if;
629
630 hr_utility.set_location('Leaving:'||l_proc, 10);
631 --
632 End chk_pl_pcp_radius_parm;
633 --
634 -- ----------------------------------------------------------------------------
635 -- |------< 3 chk_pl_pcp_record >------|
636 -- ----------------------------------------------------------------------------
637 --
638 -- Description
639 -- This procedure is used to check that the ben_pl_pcp record for plans that are
640 -- savings, inputed icome nor flex-plans could not be created
641 --
642 -- Pre Conditions
643 -- None.
644 --
645 -- In Parameters
646 -- pl_id FK of record
647 --
648 -- Post Success
649 -- Processing continues
650 --
651 -- Post Failure
652 -- Errors handled by the procedure
653 --
654 -- Access Status
655 -- Internal table handler use only.
656 --
657 Procedure chk_pl_pcp_record
658 ( p_pl_id in number
659 , p_effective_date in date) is
660
661 l_proc varchar2(72) := g_package|| ' chk_pl_pcp_record';
662 l_svgs_pl_flag ben_pl_f.svgs_pl_flag%type;
663 l_imptd_incm_calc_cd ben_pl_f.imptd_incm_calc_cd%type;
664 l_invk_flx_cr_pl_flag ben_pl_f.invk_flx_cr_pl_flag%type;
665 l_invk_dcln_prtn_pl_flag ben_pl_f.invk_dcln_prtn_pl_flag%type;
666
667
668 --cursor to check the values in svgs_pl_flag, imptd_incm_calc_cd, invk_flx_cr_pl_flag
669 cursor c1 is
670 select svgs_pl_flag, imptd_incm_calc_cd, invk_flx_cr_pl_flag, invk_dcln_prtn_pl_flag
671 from ben_pl_f
675
672 Where pl_id = p_pl_id
673 and p_effective_date between effective_start_date and
674 effective_end_date;
676 --
677 Begin
678 hr_utility.set_location('Entering:'||l_proc, 5);
679 --
680 --- when the rate is imputing chek the plan in imputing
681 open c1;
682 fetch c1 into l_svgs_pl_flag, l_imptd_incm_calc_cd, l_invk_flx_cr_pl_flag, l_invk_dcln_prtn_pl_flag;
683 close c1;
684
685 if ((l_svgs_pl_flag = 'Y')
686 or (l_imptd_incm_calc_cd is NOT NULL)
687 or (l_invk_flx_cr_pl_flag = 'Y')
688 or (l_invk_dcln_prtn_pl_flag = 'Y')) then
689 fnd_message.set_name('BEN','BEN_92562_SVG_INC');
690 fnd_message.raise_error;
691 end if;
692 hr_utility.set_location('Leaving:'||l_proc, 15);
693 End chk_pl_pcp_record;
694
695 -- ----------------------------------------------------------------------------
696 -- |------< 4 chk_pl_pcp_cds >------|
697 -- ----------------------------------------------------------------------------
698 --
699 -- Description
700 -- This procedure is used to check the pcp_dsgn_cd and pcp_dpnt_dsgn_cd's must
701 -- have a value.
702 --
703 -- Pre Conditions
704 -- None.
705 --
706 -- In Parameters
707 -- pcp_dpnt_cd of record
708 -- pcp_dpnt_dsgn_cd of record
709 --
710 -- Post Success
711 -- Processing continues
712 --
713 -- Post Failure
714 -- Errors handled by the procedure
715 --
716 -- Access Status
717 -- Internal table handler use only.
718 --
719
720 Procedure chk_pl_pcp_cds(p_pcp_dsgn_cd varchar2
721 ,p_pcp_dpnt_dsgn_cd varchar2) is
722 --
723 l_proc varchar2(72) := g_package||'chk_pcp_cds';
724 --
725 Begin
726 --
727 hr_utility.set_location('Entering:'||l_proc, 5);
728 --
729 --
730 -- check if pcp_dsgn_cd, pcp_dpnt_dsgn_cd is not null
731 --
732 if p_pcp_dsgn_cd is null or p_pcp_dpnt_dsgn_cd is null then
733 --
734 -- Raise error as pcp_dsgn_cd and pcp_dpnt_dsgn_cd should not be null
735 --
736 fnd_message.set_name('BEN','BEN_92563_DSGN_REQ');
737 fnd_message.raise_error;
738 end if;
739
740 hr_utility.set_location('Leaving:'||l_proc, 10);
741 --
742 End chk_pl_pcp_cds;
743 --
744 --
745 -- ----------------------------------------------------------------------------
746 -- |------< 5 chk_pl_pcp_rpstry >------|
747 -- ----------------------------------------------------------------------------
748 --
749 -- Description
750 -- This procedure is used to check that the plan cannot have a ben_pl_pcp row
751 -- with pcp_rpstry_flag = 'Y' until it has a ben_popl_org_f/ben_popl_org_role_f
752 --
753 -- Pre Conditions
754 -- None.
755 --
756 -- In Parameters
757 -- pl_id
758 --
759 -- Post Success
760 -- Processing continues
761 --
762 -- Post Failure
763 -- Errors handled by the procedure
764 --
765 -- Access Status
766 -- Internal table handler use only.
767 --
768
769 Procedure chk_pl_pcp_rpstry
770 ( p_pl_id in number,
771 p_pcp_rpstry_flag in varchar) is
772
773 l_proc varchar2(72) := g_package|| ' chk_pl_pcp_rpstry';
774 l_dummy varchar2(1);
775
776 --cursor to check the row exist in the ben_popl_org_f table.
777 cursor c1 is select 'x'
778 from ben_popl_org_f
779 Where pl_id = p_pl_id;
780 --
781 Begin
782 hr_utility.set_location('Entering:'||l_proc, 5);
783 --
784 IF p_pcp_rpstry_flag = 'Y' then
785 open c1;
786 fetch c1 into l_dummy;
787 if c1%notfound then
788 fnd_message.set_name('BEN','BEN_92564_PCP_LOC');
789 fnd_message.raise_error;
790 end if;
791 close c1;
792 END IF;
793
794 hr_utility.set_location('Leaving:'||l_proc, 15);
795 End chk_pl_pcp_rpstry;
796 --
797 -- ---------------------------------------------------------------------------
798 -- |----------------------< set_security_group_id >--------------------------|
799 -- ---------------------------------------------------------------------------
800 --
801 Procedure set_security_group_id
802 (p_pl_pcp_id in number
803 ) is
804 --
805 -- Declare cursor
806 --
807 cursor csr_sec_grp is
808 select pbg.security_group_id
809 from per_business_groups pbg
810 , ben_pl_pcp pcp
811 where pcp.pl_pcp_id = p_pl_pcp_id
812 and pbg.business_group_id = pcp.business_group_id;
813 --
814 -- Declare local variables
815 --
816 l_security_group_id number;
817 l_proc varchar2(72) := g_package||'set_security_group_id';
818 --
819 begin
820 --
821 hr_utility.set_location('Entering:'|| l_proc, 10);
822 --
823 -- Ensure that all the mandatory parameter are not null
824 --
825 hr_api.mandatory_arg_error
826 (p_api_name => l_proc
830 --
827 ,p_argument => 'pl_pcp_id'
828 ,p_argument_value => p_pl_pcp_id
829 );
831 open csr_sec_grp;
832 fetch csr_sec_grp into l_security_group_id;
833 --
834 if csr_sec_grp%notfound then
835 --
836 close csr_sec_grp;
837 --
838 -- The primary key is invalid therefore we must error
839 --
840 fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
841 fnd_message.raise_error;
842 --
843 end if;
844 close csr_sec_grp;
845 --
846 -- Set the security_group_id in CLIENT_INFO
847 --
848 hr_api.set_security_group_id
849 (p_security_group_id => l_security_group_id
850 );
851 --
852 hr_utility.set_location(' Leaving:'|| l_proc, 20);
853 --
854 end set_security_group_id;
855 --
856 -- ---------------------------------------------------------------------------
857 -- |---------------------< return_legislation_code >-------------------------|
858 -- ---------------------------------------------------------------------------
859 --
860 Function return_legislation_code
861 (p_pl_pcp_id in number
862 )
863 Return Varchar2 Is
864 --
865 -- Declare cursor
866 --
867 cursor csr_leg_code is
868 select pbg.legislation_code
869 from per_business_groups pbg
870 , ben_pl_pcp pcp
871 where pcp.pl_pcp_id = p_pl_pcp_id
872 and pbg.business_group_id = pcp.business_group_id;
873 --
874 -- Declare local variables
875 --
876 l_legislation_code varchar2(150);
877 l_proc varchar2(72) := g_package||'return_legislation_code';
878 --
879 Begin
880 --
881 hr_utility.set_location('Entering:'|| l_proc, 10);
882 --
883 -- Ensure that all the mandatory parameter are not null
884 --
885 hr_api.mandatory_arg_error
886 (p_api_name => l_proc
887 ,p_argument => 'pl_pcp_id'
888 ,p_argument_value => p_pl_pcp_id
889 );
890 --
891 if ( nvl(ben_pcp_bus.g_pl_pcp_id, hr_api.g_number)
892 = p_pl_pcp_id) then
893 --
894 -- The legislation code has already been found with a previous
895 -- call to this function. Just return the value in the global
896 -- variable.
897 --
898 l_legislation_code := ben_pcp_bus.g_legislation_code;
899 hr_utility.set_location(l_proc, 20);
900 else
901 --
902 -- The ID is different to the last call to this function
903 -- or this is the first call to this function.
904 --
905 open csr_leg_code;
906 fetch csr_leg_code into l_legislation_code;
907 --
908 if csr_leg_code%notfound then
909 --
910 -- The primary key is invalid therefore we must error
911 --
912 close csr_leg_code;
913 fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
914 fnd_message.raise_error;
915 end if;
916 hr_utility.set_location(l_proc,30);
917 --
918 -- Set the global variables so the values are
919 -- available for the next call to this function.
920 --
921 close csr_leg_code;
922 ben_pcp_bus.g_pl_pcp_id := p_pl_pcp_id;
923 ben_pcp_bus.g_legislation_code := l_legislation_code;
924 end if;
925 hr_utility.set_location(' Leaving:'|| l_proc, 40);
926 return l_legislation_code;
927 end return_legislation_code;
928 --
929 -- ----------------------------------------------------------------------------
930 -- |------------------------------< chk_df >----------------------------------|
931 -- ----------------------------------------------------------------------------
932 --
933 -- Description:
934 -- Validates all the Descriptive Flexfield values.
935 --
936 -- Prerequisites:
937 -- All other columns have been validated. Must be called as the
938 -- last step from insert_validate and update_validate.
939 --
940 -- In Arguments:
944 -- If the Descriptive Flexfield structure column and data values are
941 -- p_rec
942 --
943 -- Post Success:
945 -- all valid this procedure will end normally and processing will
946 -- continue.
947 --
948 -- Post Failure:
949 -- If the Descriptive Flexfield structure column value or any of
950 -- the data values are invalid then an application error is raised as
951 -- a PL/SQL exception.
952 --
953 -- Access Status:
954 -- Internal Row Handler Use Only.
955 --
956 -- ----------------------------------------------------------------------------
957 procedure chk_df
958 (p_rec in ben_pcp_shd.g_rec_type
959 ) is
960 --
961 l_proc varchar2(72) := g_package || 'chk_df';
962 --
963 begin
964 hr_utility.set_location('Entering:'||l_proc,10);
965 --
966 if ((p_rec.pl_pcp_id is not null) and (
967 nvl(ben_pcp_shd.g_old_rec.pcp_attribute_category, hr_api.g_varchar2) <>
968 nvl(p_rec.pcp_attribute_category, hr_api.g_varchar2) or
969 nvl(ben_pcp_shd.g_old_rec.pcp_attribute1, hr_api.g_varchar2) <>
973 nvl(ben_pcp_shd.g_old_rec.pcp_attribute3, hr_api.g_varchar2) <>
970 nvl(p_rec.pcp_attribute1, hr_api.g_varchar2) or
971 nvl(ben_pcp_shd.g_old_rec.pcp_attribute2, hr_api.g_varchar2) <>
972 nvl(p_rec.pcp_attribute2, hr_api.g_varchar2) or
974 nvl(p_rec.pcp_attribute3, hr_api.g_varchar2) or
975 nvl(ben_pcp_shd.g_old_rec.pcp_attribute4, hr_api.g_varchar2) <>
976 nvl(p_rec.pcp_attribute4, hr_api.g_varchar2) or
977 nvl(ben_pcp_shd.g_old_rec.pcp_attribute5, hr_api.g_varchar2) <>
978 nvl(p_rec.pcp_attribute5, hr_api.g_varchar2) or
979 nvl(ben_pcp_shd.g_old_rec.pcp_attribute6, hr_api.g_varchar2) <>
980 nvl(p_rec.pcp_attribute6, hr_api.g_varchar2) or
981 nvl(ben_pcp_shd.g_old_rec.pcp_attribute7, hr_api.g_varchar2) <>
982 nvl(p_rec.pcp_attribute7, hr_api.g_varchar2) or
983 nvl(ben_pcp_shd.g_old_rec.pcp_attribute8, hr_api.g_varchar2) <>
984 nvl(p_rec.pcp_attribute8, hr_api.g_varchar2) or
985 nvl(ben_pcp_shd.g_old_rec.pcp_attribute9, hr_api.g_varchar2) <>
986 nvl(p_rec.pcp_attribute9, hr_api.g_varchar2) or
987 nvl(ben_pcp_shd.g_old_rec.pcp_attribute10, hr_api.g_varchar2) <>
988 nvl(p_rec.pcp_attribute10, hr_api.g_varchar2) or
989 nvl(ben_pcp_shd.g_old_rec.pcp_attribute11, hr_api.g_varchar2) <>
990 nvl(p_rec.pcp_attribute11, hr_api.g_varchar2) or
991 nvl(ben_pcp_shd.g_old_rec.pcp_attribute12, hr_api.g_varchar2) <>
992 nvl(p_rec.pcp_attribute12, hr_api.g_varchar2) or
993 nvl(ben_pcp_shd.g_old_rec.pcp_attribute13, hr_api.g_varchar2) <>
994 nvl(p_rec.pcp_attribute13, hr_api.g_varchar2) or
995 nvl(ben_pcp_shd.g_old_rec.pcp_attribute14, hr_api.g_varchar2) <>
996 nvl(p_rec.pcp_attribute14, hr_api.g_varchar2) or
997 nvl(ben_pcp_shd.g_old_rec.pcp_attribute15, hr_api.g_varchar2) <>
998 nvl(p_rec.pcp_attribute15, hr_api.g_varchar2) or
999 nvl(ben_pcp_shd.g_old_rec.pcp_attribute16, hr_api.g_varchar2) <>
1000 nvl(p_rec.pcp_attribute16, hr_api.g_varchar2) or
1001 nvl(ben_pcp_shd.g_old_rec.pcp_attribute17, hr_api.g_varchar2) <>
1002 nvl(p_rec.pcp_attribute17, hr_api.g_varchar2) or
1003 nvl(ben_pcp_shd.g_old_rec.pcp_attribute18, hr_api.g_varchar2) <>
1004 nvl(p_rec.pcp_attribute18, hr_api.g_varchar2) or
1005 nvl(ben_pcp_shd.g_old_rec.pcp_attribute19, hr_api.g_varchar2) <>
1006 nvl(p_rec.pcp_attribute19, hr_api.g_varchar2) or
1007 nvl(ben_pcp_shd.g_old_rec.pcp_attribute20, hr_api.g_varchar2) <>
1008 nvl(p_rec.pcp_attribute20, hr_api.g_varchar2) or
1009 nvl(ben_pcp_shd.g_old_rec.pcp_attribute21, hr_api.g_varchar2) <>
1010 nvl(p_rec.pcp_attribute21, hr_api.g_varchar2) or
1011 nvl(ben_pcp_shd.g_old_rec.pcp_attribute22, hr_api.g_varchar2) <>
1012 nvl(p_rec.pcp_attribute22, hr_api.g_varchar2) or
1013 nvl(ben_pcp_shd.g_old_rec.pcp_attribute23, hr_api.g_varchar2) <>
1014 nvl(p_rec.pcp_attribute23, hr_api.g_varchar2) or
1015 nvl(ben_pcp_shd.g_old_rec.pcp_attribute24, hr_api.g_varchar2) <>
1016 nvl(p_rec.pcp_attribute24, hr_api.g_varchar2) or
1017 nvl(ben_pcp_shd.g_old_rec.pcp_attribute25, hr_api.g_varchar2) <>
1018 nvl(p_rec.pcp_attribute25, hr_api.g_varchar2) or
1019 nvl(ben_pcp_shd.g_old_rec.pcp_attribute26, hr_api.g_varchar2) <>
1020 nvl(p_rec.pcp_attribute26, hr_api.g_varchar2) or
1021 nvl(ben_pcp_shd.g_old_rec.pcp_attribute27, hr_api.g_varchar2) <>
1022 nvl(p_rec.pcp_attribute27, hr_api.g_varchar2) or
1023 nvl(ben_pcp_shd.g_old_rec.pcp_attribute28, hr_api.g_varchar2) <>
1024 nvl(p_rec.pcp_attribute28, hr_api.g_varchar2) or
1025 nvl(ben_pcp_shd.g_old_rec.pcp_attribute29, hr_api.g_varchar2) <>
1026 nvl(p_rec.pcp_attribute29, hr_api.g_varchar2) or
1027 nvl(ben_pcp_shd.g_old_rec.pcp_attribute30, hr_api.g_varchar2) <>
1028 nvl(p_rec.pcp_attribute30, hr_api.g_varchar2) ))
1029 or (p_rec.pl_pcp_id is null) then
1030 --
1031 -- Only execute the validation if absolutely necessary:
1032 -- a) During update, the structure column value or any
1033 -- of the attribute values have actually changed.
1034 -- b) During insert.
1035 --
1036 hr_dflex_utility.ins_or_upd_descflex_attribs
1037 (p_appl_short_name => 'BEN'
1038 ,p_descflex_name => 'EDIT_HERE: Enter descflex name'
1039 ,p_attribute_category => 'PCP_ATTRIBUTE_CATEGORY'
1040 ,p_attribute1_name => 'PCP_ATTRIBUTE1'
1041 ,p_attribute1_value => p_rec.pcp_attribute1
1042 ,p_attribute2_name => 'PCP_ATTRIBUTE2'
1043 ,p_attribute2_value => p_rec.pcp_attribute2
1044 ,p_attribute3_name => 'PCP_ATTRIBUTE3'
1045 ,p_attribute3_value => p_rec.pcp_attribute3
1046 ,p_attribute4_name => 'PCP_ATTRIBUTE4'
1047 ,p_attribute4_value => p_rec.pcp_attribute4
1048 ,p_attribute5_name => 'PCP_ATTRIBUTE5'
1049 ,p_attribute5_value => p_rec.pcp_attribute5
1050 ,p_attribute6_name => 'PCP_ATTRIBUTE6'
1051 ,p_attribute6_value => p_rec.pcp_attribute6
1052 ,p_attribute7_name => 'PCP_ATTRIBUTE7'
1053 ,p_attribute7_value => p_rec.pcp_attribute7
1054 ,p_attribute8_name => 'PCP_ATTRIBUTE8'
1055 ,p_attribute8_value => p_rec.pcp_attribute8
1056 ,p_attribute9_name => 'PCP_ATTRIBUTE9'
1057 ,p_attribute9_value => p_rec.pcp_attribute9
1058 ,p_attribute10_name => 'PCP_ATTRIBUTE10'
1059 ,p_attribute10_value => p_rec.pcp_attribute10
1060 ,p_attribute11_name => 'PCP_ATTRIBUTE11'
1061 ,p_attribute11_value => p_rec.pcp_attribute11
1062 ,p_attribute12_name => 'PCP_ATTRIBUTE12'
1063 ,p_attribute12_value => p_rec.pcp_attribute12
1064 ,p_attribute13_name => 'PCP_ATTRIBUTE13'
1065 ,p_attribute13_value => p_rec.pcp_attribute13
1066 ,p_attribute14_name => 'PCP_ATTRIBUTE14'
1067 ,p_attribute14_value => p_rec.pcp_attribute14
1068 ,p_attribute15_name => 'PCP_ATTRIBUTE15'
1069 ,p_attribute15_value => p_rec.pcp_attribute15
1070 ,p_attribute16_name => 'PCP_ATTRIBUTE16'
1071 ,p_attribute16_value => p_rec.pcp_attribute16
1072 ,p_attribute17_name => 'PCP_ATTRIBUTE17'
1073 ,p_attribute17_value => p_rec.pcp_attribute17
1074 ,p_attribute18_name => 'PCP_ATTRIBUTE18'
1075 ,p_attribute18_value => p_rec.pcp_attribute18
1076 ,p_attribute19_name => 'PCP_ATTRIBUTE19'
1077 ,p_attribute19_value => p_rec.pcp_attribute19
1078 ,p_attribute20_name => 'PCP_ATTRIBUTE20'
1079 ,p_attribute20_value => p_rec.pcp_attribute20
1080 ,p_attribute21_name => 'PCP_ATTRIBUTE21'
1081 ,p_attribute21_value => p_rec.pcp_attribute21
1082 ,p_attribute22_name => 'PCP_ATTRIBUTE22'
1083 ,p_attribute22_value => p_rec.pcp_attribute22
1084 ,p_attribute23_name => 'PCP_ATTRIBUTE23'
1085 ,p_attribute23_value => p_rec.pcp_attribute23
1086 ,p_attribute24_name => 'PCP_ATTRIBUTE24'
1087 ,p_attribute24_value => p_rec.pcp_attribute24
1088 ,p_attribute25_name => 'PCP_ATTRIBUTE25'
1089 ,p_attribute25_value => p_rec.pcp_attribute25
1090 ,p_attribute26_name => 'PCP_ATTRIBUTE26'
1091 ,p_attribute26_value => p_rec.pcp_attribute26
1092 ,p_attribute27_name => 'PCP_ATTRIBUTE27'
1093 ,p_attribute27_value => p_rec.pcp_attribute27
1094 ,p_attribute28_name => 'PCP_ATTRIBUTE28'
1095 ,p_attribute28_value => p_rec.pcp_attribute28
1096 ,p_attribute29_name => 'PCP_ATTRIBUTE29'
1097 ,p_attribute29_value => p_rec.pcp_attribute29
1098 ,p_attribute30_name => 'PCP_ATTRIBUTE30'
1099 ,p_attribute30_value => p_rec.pcp_attribute30
1100 );
1101 end if;
1102 --
1103 hr_utility.set_location(' Leaving:'||l_proc,20);
1104 end chk_df;
1105 --
1109 -- {Start Of Comments}
1106 -- ----------------------------------------------------------------------------
1107 -- |-----------------------< chk_non_updateable_args >------------------------|
1108 -- ----------------------------------------------------------------------------
1110 --
1111 -- Description:
1112 -- This procedure is used to ensure that non updateable attributes have
1113 -- not been updated. If an attribute has been updated an error is generated.
1114 --
1115 -- Pre Conditions:
1116 -- g_old_rec has been populated with details of the values currently in
1117 -- the database.
1118 --
1119 -- In Arguments:
1120 -- p_rec has been populated with the updated values the user would like the
1121 -- record set to.
1122 --
1123 -- Post Success:
1124 -- Processing continues if all the non updateable attributes have not
1125 -- changed.
1126 --
1127 -- Post Failure:
1128 -- An application error is raised if any of the non updatable attributes
1129 -- have been altered.
1130 --
1131 -- {End Of Comments}
1132 -- ----------------------------------------------------------------------------
1133 Procedure chk_non_updateable_args
1134 (p_rec in ben_pcp_shd.g_rec_type
1135 ) IS
1136 --
1137 l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
1138 l_error EXCEPTION;
1139 l_argument varchar2(30);
1140 --
1141 Begin
1142 --
1143 -- Only proceed with the validation if a row exists for the current
1144 -- record in the HR Schema.
1145 --
1146 IF NOT ben_pcp_shd.api_updating
1147 (p_pl_pcp_id => p_rec.pl_pcp_id
1148 ,p_object_version_number => p_rec.object_version_number
1149 ) THEN
1150 fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
1151 fnd_message.set_token('PROCEDURE ', l_proc);
1152 fnd_message.set_token('STEP ', '5');
1153 fnd_message.raise_error;
1154 END IF;
1155 --
1156 -- EDIT_HERE: Add checks to ensure non-updateable args have
1157 -- not been updated.
1158 --
1159 EXCEPTION
1160 WHEN l_error THEN
1161 hr_api.argument_changed_error
1162 (p_api_name => l_proc
1163 ,p_argument => l_argument);
1164 WHEN OTHERS THEN
1165 RAISE;
1166 End chk_non_updateable_args;
1167 --
1168 -- ----------------------------------------------------------------------------
1169 -- |---------------------------< insert_validate >----------------------------|
1170 -- ----------------------------------------------------------------------------
1171 Procedure insert_validate
1172 (p_rec in ben_pcp_shd.g_rec_type ,
1173 p_effective_date in date) is
1174 --
1175 l_proc varchar2(72) := g_package||'insert_validate';
1176 --
1177 Begin
1178 hr_utility.set_location('Entering:'||l_proc, 5);
1179 --
1180 -- Call all supporting business operations
1181 --
1182
1183 chk_pl_pcp_id(p_pl_pcp_id => p_rec.pl_pcp_id,
1184 p_object_version_number => p_rec.object_version_number);
1185 --
1186
1187 chk_pl_pcp_rec_exists ( p_pl_id => p_rec.pl_id,
1188 p_pl_pcp_id => p_rec.pl_pcp_id
1189 );
1190
1191 chk_pcp_strt_dt_cd(p_pl_pcp_id => p_rec.pl_pcp_id,
1192 p_pcp_strt_dt_cd => p_rec.pcp_strt_dt_cd,
1193 p_effective_date => p_effective_date,
1197 p_pcp_dsgn_cd => p_rec.pcp_dsgn_cd,
1194 p_object_version_number => p_rec.object_version_number);
1195
1196 chk_pcp_dsgn_cd(p_pl_pcp_id => p_rec.pl_pcp_id,
1198 p_effective_date => p_effective_date,
1199 p_object_version_number => p_rec.object_version_number);
1200
1201 chk_pcp_dpnt_dsgn_cd(p_pl_pcp_id => p_rec.pl_pcp_id,
1202 p_pcp_dpnt_dsgn_cd => p_rec.pcp_dpnt_dsgn_cd,
1203 p_effective_date => p_effective_date,
1204 p_object_version_number => p_rec.object_version_number);
1205
1206 chk_pcp_rpstry_flag(p_pl_pcp_id => p_rec.pl_pcp_id,
1207 p_pcp_rpstry_flag => p_rec.pcp_rpstry_flag,
1208 p_effective_date => p_effective_date,
1209 p_object_version_number => p_rec.object_version_number);
1210
1211 chk_pcp_can_keep_flag(p_pl_pcp_id => p_rec.pl_pcp_id,
1212 p_pcp_can_keep_flag => p_rec.pcp_can_keep_flag,
1213 p_effective_date => p_effective_date,
1214 p_object_version_number => p_rec.object_version_number);
1215
1216 chk_pcp_radius_warn_flag(p_pl_pcp_id => p_rec.pl_pcp_id,
1217 p_pcp_radius_warn_flag => p_rec.pcp_radius_warn_flag,
1218 p_effective_date => p_effective_date,
1219 p_object_version_number => p_rec.object_version_number);
1220
1221 chk_pl_pcp_radius_parm(p_pcp_rpstry_flag => p_rec.pcp_rpstry_flag
1222 ,p_pcp_radius => p_rec.pcp_radius
1223 ,p_pcp_radius_uom => p_rec.pcp_radius_uom
1224 ,p_pcp_radius_warn_flag => p_rec.pcp_radius_warn_flag);
1225
1226 chk_pl_pcp_record (p_pl_id => p_rec.pl_id
1227 ,p_effective_date => p_effective_date);
1228
1229 chk_pl_pcp_cds(p_pcp_dsgn_cd => p_rec.pcp_dsgn_cd
1230 ,p_pcp_dpnt_dsgn_cd => p_rec.pcp_dpnt_dsgn_cd);
1231
1232 chk_pl_pcp_rpstry ( p_pl_id => p_rec.pl_id
1233 ,p_pcp_rpstry_flag => p_rec.pcp_rpstry_flag);
1234
1235
1236
1237 hr_api.validate_bus_grp_id(p_rec.business_group_id); -- Validate Bus Grp
1238 --
1239 -- Call all supporting business operations
1240 --
1241
1242 --ben_pcp_bus.chk_df(p_rec);
1243 --
1244 hr_utility.set_location(' Leaving:'||l_proc, 10);
1245 End insert_validate;
1246 --
1247 -- ----------------------------------------------------------------------------
1248 -- |---------------------------< update_validate >----------------------------|
1249 -- ----------------------------------------------------------------------------
1250 Procedure update_validate
1251 (p_rec in ben_pcp_shd.g_rec_type
1252 ,p_effective_date in date) is
1253 --
1254 l_proc varchar2(72) := g_package||'update_validate';
1255 --
1256 Begin
1257 hr_utility.set_location('Entering:'||l_proc, 5);
1258 --
1259 -- Call all supporting business operations
1260 --
1261 chk_pl_pcp_id(p_pl_pcp_id => p_rec.pl_pcp_id,
1262 p_object_version_number => p_rec.object_version_number);
1263 --
1264 chk_pl_pcp_rec_exists ( p_pl_id => p_rec.pl_id,
1265 p_pl_pcp_id => p_rec.pl_pcp_id
1266 );
1267
1268 chk_pcp_strt_dt_cd(p_pl_pcp_id => p_rec.pl_pcp_id,
1269 p_pcp_strt_dt_cd => p_rec.pcp_strt_dt_cd,
1270 p_effective_date => p_effective_date,
1271 p_object_version_number => p_rec.object_version_number);
1272
1273 chk_pcp_dsgn_cd(p_pl_pcp_id => p_rec.pl_pcp_id,
1274 p_pcp_dsgn_cd => p_rec.pcp_dsgn_cd,
1275 p_effective_date => p_effective_date,
1276 p_object_version_number => p_rec.object_version_number);
1277
1278 chk_pcp_dpnt_dsgn_cd(p_pl_pcp_id => p_rec.pl_pcp_id,
1279 p_pcp_dpnt_dsgn_cd => p_rec.pcp_dpnt_dsgn_cd,
1280 p_effective_date => p_effective_date,
1281 p_object_version_number => p_rec.object_version_number);
1282
1283 chk_pcp_rpstry_flag(p_pl_pcp_id => p_rec.pl_pcp_id,
1284 p_pcp_rpstry_flag => p_rec.pcp_rpstry_flag,
1285 p_effective_date => p_effective_date,
1286 p_object_version_number => p_rec.object_version_number);
1287
1288 chk_pcp_can_keep_flag(p_pl_pcp_id => p_rec.pl_pcp_id,
1289 p_pcp_can_keep_flag => p_rec.pcp_can_keep_flag,
1290 p_effective_date => p_effective_date,
1291 p_object_version_number => p_rec.object_version_number);
1292
1293 chk_pcp_radius_warn_flag(p_pl_pcp_id => p_rec.pl_pcp_id,
1294 p_pcp_radius_warn_flag => p_rec.pcp_radius_warn_flag,
1295 p_effective_date => p_effective_date,
1296 p_object_version_number => p_rec.object_version_number);
1297
1298 chk_pl_pcp_radius_parm(p_pcp_rpstry_flag => p_rec.pcp_rpstry_flag
1299 ,p_pcp_radius => p_rec.pcp_radius
1300 ,p_pcp_radius_uom => p_rec.pcp_radius_uom
1301 ,p_pcp_radius_warn_flag => p_rec.pcp_radius_warn_flag);
1302
1303 chk_pl_pcp_record (p_pl_id => p_rec.pl_id
1304 ,p_effective_date => p_effective_date);
1305
1306 chk_pl_pcp_cds(p_pcp_dsgn_cd => p_rec.pcp_dsgn_cd
1307 ,p_pcp_dpnt_dsgn_cd => p_rec.pcp_dpnt_dsgn_cd);
1308
1309 chk_pl_pcp_rpstry ( p_pl_id => p_rec.pl_id
1310 ,p_pcp_rpstry_flag => p_rec.pcp_rpstry_flag);
1311
1312 hr_api.validate_bus_grp_id(p_rec.business_group_id); -- Validate Bus Grp
1313 --
1314 chk_non_updateable_args
1315 (p_rec => p_rec
1316 );
1317 --
1318 --
1319 --ben_pcp_bus.chk_df(p_rec);
1320 --
1321 hr_utility.set_location(' Leaving:'||l_proc, 10);
1322 End update_validate;
1323 --
1324 -- ----------------------------------------------------------------------------
1325 -- |---------------------------< delete_validate >----------------------------|
1326 -- ----------------------------------------------------------------------------
1327 Procedure delete_validate
1328 (p_rec in ben_pcp_shd.g_rec_type
1329 ) is
1330 --
1331 l_proc varchar2(72) := g_package||'delete_validate';
1332 --
1333 Begin
1334 hr_utility.set_location('Entering:'||l_proc, 5);
1335 --
1336 -- Call all supporting business operations
1337 --
1338 --chk_pl_pcp_rec_exists ( p_pl_id => p_rec.pl_id);
1339
1340
1341 hr_utility.set_location(' Leaving:'||l_proc, 10);
1342 End delete_validate;
1343 --
1344 end ben_pcp_bus;