[Home] [Help]
PACKAGE BODY: APPS.BEN_BRI_BUS
Source
1 Package Body ben_bri_bus as
2 /* $Header: bebrirhi.pkb 120.0 2005/05/28 00:51:44 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_bri_bus.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< chk_batch_rt_id >-------------------------|
12 -- ----------------------------------------------------------------------------
13 --
14 -- Description
15 -- This procedure is used to check that the primary key for the table
16 -- is created properly. It should be null on insert and
17 -- should not be able to be updated.
18 --
19 -- Pre Conditions
20 -- None.
21 --
22 -- In Parameters
23 -- batch_rt_id PK of record being inserted or updated.
24 -- object_version_number Object version number of record being
25 -- inserted or updated.
26 --
27 -- Post Success
28 -- Processing continues
29 --
30 -- Post Failure
31 -- Errors handled by the procedure
32 --
33 -- Access Status
34 -- Internal table handler use only.
35 --
36 Procedure chk_batch_rt_id(p_batch_rt_id in number,
37 p_object_version_number in number) is
38 --
39 l_proc varchar2(72) := g_package||'chk_batch_rt_id';
40 l_api_updating boolean;
41 --
42 Begin
43 --
44 hr_utility.set_location('Entering:'||l_proc, 5);
45 --
46 l_api_updating := ben_bri_shd.api_updating
47 (p_batch_rt_id => p_batch_rt_id,
48 p_object_version_number => p_object_version_number);
49 --
50 if (l_api_updating
51 and nvl(p_batch_rt_id,hr_api.g_number)
52 <> ben_bri_shd.g_old_rec.batch_rt_id) then
53 --
54 -- raise error as PK has changed
55 --
56 ben_bri_shd.constraint_error('BEN_BATCH_RATE_INFO_PK');
57 --
58 elsif not l_api_updating then
59 --
60 -- check if PK is null
61 --
62 if p_batch_rt_id is not null then
63 --
64 -- raise error as PK is not null
65 --
66 ben_bri_shd.constraint_error('BEN_BATCH_RATE_INFO_PK');
67 --
68 end if;
69 --
70 end if;
71 --
72 hr_utility.set_location('Leaving:'||l_proc, 10);
73 --
74 End chk_batch_rt_id;
75 --
76 -- ----------------------------------------------------------------------------
77 -- |-----------------------------< chk_oipl_id >------------------------------|
78 -- ----------------------------------------------------------------------------
79 --
80 -- Description
81 -- This procedure checks that a referenced foreign key actually exists
82 -- in the referenced table.
83 --
84 -- Pre-Conditions
85 -- None.
86 --
87 -- In Parameters
88 -- p_batch_rt_id PK
89 -- p_oipl_id ID of FK column
90 -- p_effective_date Session Date of record
91 -- p_object_version_number object version number
92 --
93 -- Post Success
94 -- Processing continues
95 --
96 -- Post Failure
97 -- Error raised.
98 --
99 -- Access Status
103 p_oipl_id in number,
100 -- Internal table handler use only.
101 --
102 Procedure chk_oipl_id (p_batch_rt_id in number,
104 p_effective_date in date,
105 p_object_version_number in number) is
106 --
107 l_proc varchar2(72) := g_package||'chk_oipl_id';
108 l_api_updating boolean;
109 l_dummy varchar2(1);
110 --
111 cursor c1 is
112 select null
113 from ben_oipl_f a
114 where a.oipl_id = p_oipl_id
115 and p_effective_date
116 between a.effective_start_date
117 and a.effective_end_date;
118 --
119 Begin
120 --
121 hr_utility.set_location('Entering:'||l_proc,5);
122 --
123 l_api_updating := ben_bri_shd.api_updating
124 (p_batch_rt_id => p_batch_rt_id,
125 p_object_version_number => p_object_version_number);
126 --
127 if (l_api_updating
128 and nvl(p_oipl_id,hr_api.g_number)
129 <> nvl(ben_bri_shd.g_old_rec.oipl_id,hr_api.g_number)
130 or not l_api_updating) and
131 p_oipl_id is not null then
132 --
133 -- check if oipl_id value exists in ben_oipl_f table
134 --
135 open c1;
136 --
137 fetch c1 into l_dummy;
138 if c1%notfound then
139 --
140 close c1;
141 --
142 -- raise error as FK does not relate to PK in ben_oipl_f
143 -- table.
144 --
145 ben_bri_shd.constraint_error('BEN_BATCH_RATE_INFO_DT4');
146 --
147 end if;
148 --
149 close c1;
150 --
151 end if;
152 --
153 hr_utility.set_location('Leaving:'||l_proc,10);
154 --
155 End chk_oipl_id;
156 --
157 -- ----------------------------------------------------------------------------
158 -- |-------------------------------< chk_pl_id >------------------------------|
159 -- ----------------------------------------------------------------------------
160 --
161 -- Description
162 -- This procedure checks that a referenced foreign key actually exists
163 -- in the referenced table.
164 --
165 -- Pre-Conditions
166 -- None.
167 --
168 -- In Parameters
169 -- p_batch_rt_id PK
170 -- p_pl_id ID of FK column
171 -- p_effective_date Session Date of record
172 -- p_object_version_number object version number
173 --
174 -- Post Success
175 -- Processing continues
176 --
177 -- Post Failure
178 -- Error raised.
179 --
180 -- Access Status
181 -- Internal table handler use only.
182 --
183 Procedure chk_pl_id (p_batch_rt_id in number,
184 p_pl_id in number,
185 p_effective_date in date,
186 p_object_version_number in number) is
187 --
188 l_proc varchar2(72) := g_package||'chk_pl_id';
189 l_api_updating boolean;
190 l_dummy varchar2(1);
191 --
192 cursor c1 is
193 select null
194 from ben_pl_f a
195 where a.pl_id = p_pl_id
196 and p_effective_date
197 between a.effective_start_date
198 and a.effective_end_date;
199 --
200 Begin
201 --
202 hr_utility.set_location('Entering:'||l_proc,5);
203 --
204 l_api_updating := ben_bri_shd.api_updating
205 (p_batch_rt_id => p_batch_rt_id,
206 p_object_version_number => p_object_version_number);
207 --
208 if (l_api_updating
209 and nvl(p_pl_id,hr_api.g_number)
210 <> nvl(ben_bri_shd.g_old_rec.pl_id,hr_api.g_number)
211 or not l_api_updating) and
212 p_pl_id is not null then
213 --
214 -- check if pl_id value exists in ben_pl_f table
215 --
216 open c1;
217 --
218 fetch c1 into l_dummy;
219 if c1%notfound then
220 --
221 close c1;
222 --
223 -- raise error as FK does not relate to PK in ben_pl_f
224 -- table.
225 --
226 ben_bri_shd.constraint_error('BEN_BATCH_RATE_INFO_DT3');
227 --
228 end if;
229 --
230 close c1;
231 --
232 end if;
233 --
234 hr_utility.set_location('Leaving:'||l_proc,10);
235 --
236 End chk_pl_id;
237 --
238 -- ----------------------------------------------------------------------------
239 -- |--------------------------------< chk_pgm_id >----------------------------|
240 -- ----------------------------------------------------------------------------
241 --
242 -- Description
243 -- This procedure checks that a referenced foreign key actually exists
244 -- in the referenced table.
245 --
246 -- Pre-Conditions
247 -- None.
248 --
249 -- In Parameters
250 -- p_batch_rt_id PK
251 -- p_pgm_id ID of FK column
252 -- p_effective_date Session Date of record
253 -- p_object_version_number object version number
254 --
255 -- Post Success
256 -- Processing continues
257 --
258 -- Post Failure
259 -- Error raised.
260 --
261 -- Access Status
262 -- Internal table handler use only.
263 --
264 Procedure chk_pgm_id (p_batch_rt_id in number,
265 p_pgm_id in number,
266 p_effective_date in date,
267 p_object_version_number in number) is
268 --
272 --
269 l_proc varchar2(72) := g_package||'chk_pgm_id';
270 l_api_updating boolean;
271 l_dummy varchar2(1);
273 cursor c1 is
274 select null
275 from ben_pgm_f a
276 where a.pgm_id = p_pgm_id
277 and p_effective_date
278 between a.effective_start_date
279 and a.effective_end_date;
280 --
281 Begin
282 --
283 hr_utility.set_location('Entering:'||l_proc,5);
284 --
285 l_api_updating := ben_bri_shd.api_updating
286 (p_batch_rt_id => p_batch_rt_id,
287 p_object_version_number => p_object_version_number);
288 --
289 if (l_api_updating
290 and nvl(p_pgm_id,hr_api.g_number)
291 <> nvl(ben_bri_shd.g_old_rec.pgm_id,hr_api.g_number)
292 or not l_api_updating) and
293 p_pgm_id is not null then
294 --
295 -- check if pgm_id value exists in ben_pgm_f table
296 --
297 open c1;
298 --
299 fetch c1 into l_dummy;
300 if c1%notfound then
301 --
302 close c1;
303 --
304 -- raise error as FK does not relate to PK in ben_pgm_f
305 -- table.
306 --
307 ben_bri_shd.constraint_error('BEN_BATCH_RATE_INFO_DT2');
308 --
309 end if;
310 --
311 close c1;
312 --
313 end if;
314 --
315 hr_utility.set_location('Leaving:'||l_proc,10);
316 --
317 End chk_pgm_id;
318 --
319 -- ----------------------------------------------------------------------------
320 -- |----------------------------< chk_person_id >-----------------------------|
321 -- ----------------------------------------------------------------------------
322 --
323 -- Description
324 -- This procedure checks that a referenced foreign key actually exists
325 -- in the referenced table.
326 --
327 -- Pre-Conditions
328 -- None.
329 --
330 -- In Parameters
331 -- p_batch_rt_id PK
332 -- p_person_id ID of FK column
333 -- p_effective_date Session Date of record
334 -- p_object_version_number object version number
335 --
336 -- Post Success
337 -- Processing continues
338 --
339 -- Post Failure
340 -- Error raised.
341 --
342 -- Access Status
343 -- Internal table handler use only.
344 --
345 Procedure chk_person_id (p_batch_rt_id in number,
346 p_person_id in number,
347 p_effective_date in date,
348 p_object_version_number in number) is
349 --
350 l_proc varchar2(72) := g_package||'chk_person_id';
351 l_api_updating boolean;
352 l_dummy varchar2(1);
353 --
354 cursor c1 is
355 select null
356 from per_all_people_f a
357 where a.person_id = p_person_id
358 and p_effective_date
359 between a.effective_start_date
360 and a.effective_end_date;
361 --
362 Begin
363 --
364 hr_utility.set_location('Entering:'||l_proc,5);
365 --
366 l_api_updating := ben_bri_shd.api_updating
367 (p_batch_rt_id => p_batch_rt_id,
368 p_object_version_number => p_object_version_number);
369 --
370 if (l_api_updating
371 and nvl(p_person_id,hr_api.g_number)
372 <> nvl(ben_bri_shd.g_old_rec.person_id,hr_api.g_number)
373 or not l_api_updating) then
374 --
375 -- check if person_id value exists in per_all_people_f table
376 --
377 open c1;
378 --
379 fetch c1 into l_dummy;
380 if c1%notfound then
381 --
382 close c1;
383 --
384 -- raise error as FK does not relate to PK in per_all_people_f
385 -- table.
386 --
387 ben_bri_shd.constraint_error('BEN_BATCH_RATE_INFO_DT1');
388 --
389 end if;
390 --
391 close c1;
392 --
393 end if;
394 --
395 hr_utility.set_location('Leaving:'||l_proc,10);
396 --
397 End chk_person_id;
398 --
399 -- ----------------------------------------------------------------------------
400 -- |------------------------< chk_benefit_action_id >-------------------------|
401 -- ----------------------------------------------------------------------------
402 --
403 -- Description
404 -- This procedure checks that a referenced foreign key actually exists
405 -- in the referenced table.
406 --
407 -- Pre-Conditions
408 -- None.
409 --
410 -- In Parameters
411 -- p_batch_rt_id PK
412 -- p_benefit_action_id ID of FK column
413 -- p_object_version_number object version number
414 --
415 -- Post Success
416 -- Processing continues
417 --
418 -- Post Failure
419 -- Error raised.
420 --
421 -- Access Status
422 -- Internal table handler use only.
423 --
424 Procedure chk_benefit_action_id (p_batch_rt_id in number,
425 p_benefit_action_id in number,
426 p_object_version_number in number) is
427 --
428 l_proc varchar2(72) := g_package||'chk_benefit_action_id';
429 l_api_updating boolean;
430 l_dummy varchar2(1);
431 --
432 cursor c1 is
433 select null
434 from ben_benefit_actions a
435 where a.benefit_action_id = p_benefit_action_id;
436 --
440 --
437 Begin
438 --
439 hr_utility.set_location('Entering:'||l_proc,5);
441 l_api_updating := ben_bri_shd.api_updating
442 (p_batch_rt_id => p_batch_rt_id,
443 p_object_version_number => p_object_version_number);
444 --
445 if (l_api_updating
446 and nvl(p_benefit_action_id,hr_api.g_number)
447 <> nvl(ben_bri_shd.g_old_rec.benefit_action_id,hr_api.g_number)
448 or not l_api_updating) then
449 --
450 -- check if benefit_action_id value exists in ben_benefit_actions table
451 --
452 open c1;
453 --
454 fetch c1 into l_dummy;
455 if c1%notfound then
456 --
457 close c1;
458 --
459 -- raise error as FK does not relate to PK in ben_benefit_actions
460 -- table.
461 --
462 ben_bri_shd.constraint_error('BEN_BATCH_RATE_INFO_FK1');
463 --
464 end if;
465 --
466 close c1;
467 --
468 end if;
469 --
470 hr_utility.set_location('Leaving:'||l_proc,10);
471 --
472 End chk_benefit_action_id;
473 --
474 -- ----------------------------------------------------------------------------
475 -- |----------------------------< chk_acty_typ_cd >---------------------------|
476 -- ----------------------------------------------------------------------------
477 --
478 -- Description
479 -- This procedure is used to check that the lookup value is valid.
480 --
481 -- Pre Conditions
482 -- None.
483 --
484 -- In Parameters
485 -- batch_rt_id PK of record being inserted or updated.
486 -- acty_typ_cd Value of lookup code.
487 -- effective_date effective date
488 -- object_version_number Object version number of record being
489 -- inserted or updated.
490 --
491 -- Post Success
492 -- Processing continues
493 --
494 -- Post Failure
495 -- Error handled by procedure
496 --
497 -- Access Status
498 -- Internal table handler use only.
499 --
500 Procedure chk_acty_typ_cd(p_batch_rt_id in number,
501 p_acty_typ_cd in varchar2,
502 p_effective_date in date,
503 p_object_version_number in number) is
504 --
505 l_proc varchar2(72) := g_package||'chk_acty_typ_cd';
506 l_api_updating boolean;
507 --
508 Begin
509 --
510 hr_utility.set_location('Entering:'||l_proc, 5);
511 --
512 l_api_updating := ben_bri_shd.api_updating
513 (p_batch_rt_id => p_batch_rt_id,
514 p_object_version_number => p_object_version_number);
515 --
516 if (l_api_updating
517 and p_acty_typ_cd
518 <> nvl(ben_bri_shd.g_old_rec.acty_typ_cd,hr_api.g_varchar2)
519 or not l_api_updating)
520 and p_acty_typ_cd is not null then
521 --
522 -- check if value of lookup falls within lookup type.
523 --
524 if hr_api.not_exists_in_hr_lookups
525 (p_lookup_type => 'BEN_ACTY_TYP',
526 p_lookup_code => p_acty_typ_cd,
527 p_effective_date => p_effective_date) then
528 --
529 -- raise error as does not exist as lookup
530 --
531 fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
532 fnd_message.set_token('FIELD','p_acty_typ_cd');
533 fnd_message.set_token('TYPE','BEN_ACTY_TYP');
534 fnd_message.raise_error;
535 --
536 end if;
537 --
538 end if;
539 --
540 hr_utility.set_location('Leaving:'||l_proc,10);
541 --
542 end chk_acty_typ_cd;
543 --
544 -- ----------------------------------------------------------------------------
545 -- |-------------------------< chk_tx_typ_cd >--------------------------------|
546 -- ----------------------------------------------------------------------------
547 --
548 -- Description
549 -- This procedure is used to check that the lookup value is valid.
550 --
551 -- Pre Conditions
552 -- None.
553 --
554 -- In Parameters
555 -- batch_rt_id PK of record being inserted or updated.
556 -- tx_typ_cd Value of lookup code.
557 -- effective_date effective date
558 -- object_version_number Object version number of record being
559 -- inserted or updated.
560 --
561 -- Post Success
562 -- Processing continues
563 --
564 -- Post Failure
565 -- Error handled by procedure
566 --
567 -- Access Status
568 -- Internal table handler use only.
569 --
570 Procedure chk_tx_typ_cd(p_batch_rt_id in number,
571 p_tx_typ_cd in varchar2,
572 p_effective_date in date,
573 p_object_version_number in number) is
574 --
575 l_proc varchar2(72) := g_package||'chk_tx_typ_cd';
576 l_api_updating boolean;
577 --
578 Begin
579 --
580 hr_utility.set_location('Entering:'||l_proc, 5);
581 --
582 l_api_updating := ben_bri_shd.api_updating
583 (p_batch_rt_id => p_batch_rt_id,
584 p_object_version_number => p_object_version_number);
585 --
586 if (l_api_updating
587 and p_tx_typ_cd
588 <> nvl(ben_bri_shd.g_old_rec.tx_typ_cd,hr_api.g_varchar2)
589 or not l_api_updating)
590 and p_tx_typ_cd is not null then
591 --
592 -- check if value of lookup falls within lookup type.
593 --
594 if hr_api.not_exists_in_hr_lookups
595 (p_lookup_type => 'BEN_TX_TYP',
596 p_lookup_code => p_tx_typ_cd,
600 --
597 p_effective_date => p_effective_date) then
598 --
599 -- raise error as does not exist as lookup
601 fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
602 fnd_message.set_token('FIELD','p_tx_typ_cd');
603 fnd_message.set_token('TYPE','BEN_TX_TYP');
604 fnd_message.raise_error;
605 --
606 end if;
607 --
608 end if;
609 --
610 hr_utility.set_location('Leaving:'||l_proc,10);
611 --
612 end chk_tx_typ_cd;
613 --
614 -- ----------------------------------------------------------------------------
615 -- |---------------------------< chk_dflt_flag >------------------------------|
616 -- ----------------------------------------------------------------------------
617 --
618 -- Description
619 -- This procedure is used to check that the lookup value is valid.
620 --
621 -- Pre Conditions
622 -- None.
623 --
624 -- In Parameters
625 -- batch_rt_id PK of record being inserted or updated.
626 -- dflt_flag Value of lookup code.
627 -- effective_date effective date
628 -- object_version_number Object version number of record being
629 -- inserted or updated.
630 --
631 -- Post Success
632 -- Processing continues
633 --
634 -- Post Failure
635 -- Error handled by procedure
636 --
637 -- Access Status
638 -- Internal table handler use only.
639 --
640 Procedure chk_dflt_flag(p_batch_rt_id in number,
641 p_dflt_flag in varchar2,
642 p_effective_date in date,
643 p_object_version_number in number) is
644 --
645 l_proc varchar2(72) := g_package||'chk_dflt_flag';
646 l_api_updating boolean;
647 --
648 Begin
649 --
650 hr_utility.set_location('Entering:'||l_proc, 5);
651 --
652 l_api_updating := ben_bri_shd.api_updating
653 (p_batch_rt_id => p_batch_rt_id,
654 p_object_version_number => p_object_version_number);
655 --
656 if (l_api_updating
657 and p_dflt_flag
658 <> nvl(ben_bri_shd.g_old_rec.dflt_flag,hr_api.g_varchar2)
659 or not l_api_updating) then
660 --
661 -- check if value of lookup falls within lookup type.
662 --
663 --
664 if hr_api.not_exists_in_hr_lookups
665 (p_lookup_type => 'YES_NO',
666 p_lookup_code => p_dflt_flag,
667 p_effective_date => p_effective_date) then
668 --
669 -- raise error as does not exist as lookup
670 --
671 fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
672 fnd_message.set_token('FIELD','p_dflt_flag');
673 fnd_message.set_token('TYPE','YES_NO');
674 fnd_message.raise_error;
675 --
676 end if;
677 --
678 end if;
679 --
680 hr_utility.set_location('Leaving:'||l_proc,10);
681 --
682 end chk_dflt_flag;
683 --
684 -- ----------------------------------------------------------------------------
685 -- |----------------------------< chk_bnft_rt_typ_cd >------------------------|
686 -- ----------------------------------------------------------------------------
687 --
688 -- Description
689 -- This procedure is used to check that the lookup value is valid.
690 --
691 -- Pre Conditions
692 -- None.
693 --
694 -- In Parameters
695 -- batch_rt_id PK of record being inserted or updated.
696 -- bnft_rt_typ_cd Value of lookup code.
697 -- effective_date effective date
698 -- object_version_number Object version number of record being
699 -- inserted or updated.
700 --
701 -- Post Success
702 -- Processing continues
703 --
704 -- Post Failure
705 -- Error handled by procedure
706 --
707 -- Access Status
708 -- Internal table handler use only.
709 --
710 Procedure chk_bnft_rt_typ_cd(p_batch_rt_id in number,
711 p_bnft_rt_typ_cd in varchar2,
712 p_effective_date in date,
713 p_object_version_number in number) is
714 --
715 l_proc varchar2(72) := g_package||'chk_bnft_rt_typ_cd';
716 l_api_updating boolean;
717 --
718 Begin
719 --
720 hr_utility.set_location('Entering:'||l_proc, 5);
721 --
722 l_api_updating := ben_bri_shd.api_updating
723 (p_batch_rt_id => p_batch_rt_id,
724 p_object_version_number => p_object_version_number);
725 --
726 if (l_api_updating
727 and p_bnft_rt_typ_cd
728 <> nvl(ben_bri_shd.g_old_rec.bnft_rt_typ_cd,hr_api.g_varchar2)
729 or not l_api_updating)
730 and p_bnft_rt_typ_cd is not null then
731 --
732 -- check if value of lookup falls within lookup type.
733 --
734 if hr_api.not_exists_in_hr_lookups
735 (p_lookup_type => 'BEN_BNFT_RT_TYP',
736 p_lookup_code => p_bnft_rt_typ_cd,
737 p_effective_date => p_effective_date) then
738 --
739 -- raise error as does not exist as lookup
740 --
741 fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
742 fnd_message.set_token('FIELD','p_bnft_rt_typ_cd');
743 fnd_message.set_token('TYPE','BEN_BNFT_RT_TYP');
744 fnd_message.raise_error;
748 end if;
745 --
746 end if;
747 --
749 --
750 hr_utility.set_location('Leaving:'||l_proc,10);
751 --
752 end chk_bnft_rt_typ_cd;
753 --
754 -- ----------------------------------------------------------------------------
755 -- |---------------------------< insert_validate >----------------------------|
756 -- ----------------------------------------------------------------------------
757 Procedure insert_validate(p_rec in ben_bri_shd.g_rec_type
758 ,p_effective_date in date) is
759 --
760 l_proc varchar2(72) := g_package||'insert_validate';
761 --
762 Begin
763 hr_utility.set_location('Entering:'||l_proc, 5);
764 --
765 -- Call all supporting business operations
766 --
767 --
768 hr_api.validate_bus_grp_id(p_rec.business_group_id); -- Validate Bus Grp
769 --
770 chk_batch_rt_id
771 (p_batch_rt_id => p_rec.batch_rt_id,
772 p_object_version_number => p_rec.object_version_number);
773 --
774 chk_oipl_id
775 (p_batch_rt_id => p_rec.batch_rt_id,
776 p_oipl_id => p_rec.oipl_id,
777 p_effective_date => p_effective_date,
778 p_object_version_number => p_rec.object_version_number);
779 --
780 chk_pl_id
781 (p_batch_rt_id => p_rec.batch_rt_id,
782 p_pl_id => p_rec.pl_id,
783 p_effective_date => p_effective_date,
784 p_object_version_number => p_rec.object_version_number);
785 --
786 chk_pgm_id
787 (p_batch_rt_id => p_rec.batch_rt_id,
788 p_pgm_id => p_rec.pgm_id,
789 p_effective_date => p_effective_date,
790 p_object_version_number => p_rec.object_version_number);
791 --
792 chk_person_id
793 (p_batch_rt_id => p_rec.batch_rt_id,
794 p_person_id => p_rec.person_id,
795 p_effective_date => p_effective_date,
796 p_object_version_number => p_rec.object_version_number);
797 --
798 chk_benefit_action_id
799 (p_batch_rt_id => p_rec.batch_rt_id,
800 p_benefit_action_id => p_rec.benefit_action_id,
801 p_object_version_number => p_rec.object_version_number);
802 --
803 chk_acty_typ_cd
804 (p_batch_rt_id => p_rec.batch_rt_id,
805 p_acty_typ_cd => p_rec.acty_typ_cd,
806 p_effective_date => p_effective_date,
807 p_object_version_number => p_rec.object_version_number);
808 --
809 chk_tx_typ_cd
810 (p_batch_rt_id => p_rec.batch_rt_id,
811 p_tx_typ_cd => p_rec.tx_typ_cd,
812 p_effective_date => p_effective_date,
813 p_object_version_number => p_rec.object_version_number);
814 --
815 chk_dflt_flag
816 (p_batch_rt_id => p_rec.batch_rt_id,
817 p_dflt_flag => p_rec.dflt_flag,
818 p_effective_date => p_effective_date,
819 p_object_version_number => p_rec.object_version_number);
820 --
821 chk_bnft_rt_typ_cd
822 (p_batch_rt_id => p_rec.batch_rt_id,
823 p_bnft_rt_typ_cd => p_rec.bnft_rt_typ_cd,
824 p_effective_date => p_effective_date,
825 p_object_version_number => p_rec.object_version_number);
826 --
827 hr_utility.set_location(' Leaving:'||l_proc, 10);
828 End insert_validate;
829 --
830 -- ----------------------------------------------------------------------------
831 -- |---------------------------< update_validate >----------------------------|
832 -- ----------------------------------------------------------------------------
833 Procedure update_validate(p_rec in ben_bri_shd.g_rec_type
834 ,p_effective_date in date) is
835 --
836 l_proc varchar2(72) := g_package||'update_validate';
837 --
838 Begin
839 hr_utility.set_location('Entering:'||l_proc, 5);
840 --
841 -- Call all supporting business operations
842 --
843 --
844 hr_api.validate_bus_grp_id(p_rec.business_group_id); -- Validate Bus Grp
845 --
846 chk_batch_rt_id
847 (p_batch_rt_id => p_rec.batch_rt_id,
848 p_object_version_number => p_rec.object_version_number);
849 --
850 chk_oipl_id
851 (p_batch_rt_id => p_rec.batch_rt_id,
852 p_oipl_id => p_rec.oipl_id,
853 p_effective_date => p_effective_date,
854 p_object_version_number => p_rec.object_version_number);
855 --
856 chk_pl_id
857 (p_batch_rt_id => p_rec.batch_rt_id,
858 p_pl_id => p_rec.pl_id,
859 p_effective_date => p_effective_date,
860 p_object_version_number => p_rec.object_version_number);
861 --
862 chk_pgm_id
863 (p_batch_rt_id => p_rec.batch_rt_id,
864 p_pgm_id => p_rec.pgm_id,
865 p_effective_date => p_effective_date,
866 p_object_version_number => p_rec.object_version_number);
867 --
868 chk_person_id
869 (p_batch_rt_id => p_rec.batch_rt_id,
870 p_person_id => p_rec.person_id,
871 p_effective_date => p_effective_date,
872 p_object_version_number => p_rec.object_version_number);
873 --
874 chk_benefit_action_id
875 (p_batch_rt_id => p_rec.batch_rt_id,
876 p_benefit_action_id => p_rec.benefit_action_id,
877 p_object_version_number => p_rec.object_version_number);
878 --
879 chk_acty_typ_cd
880 (p_batch_rt_id => p_rec.batch_rt_id,
881 p_acty_typ_cd => p_rec.acty_typ_cd,
882 p_effective_date => p_effective_date,
883 p_object_version_number => p_rec.object_version_number);
884 --
885 chk_tx_typ_cd
886 (p_batch_rt_id => p_rec.batch_rt_id,
890 --
887 p_tx_typ_cd => p_rec.tx_typ_cd,
888 p_effective_date => p_effective_date,
889 p_object_version_number => p_rec.object_version_number);
891 chk_dflt_flag
892 (p_batch_rt_id => p_rec.batch_rt_id,
893 p_dflt_flag => p_rec.dflt_flag,
894 p_effective_date => p_effective_date,
895 p_object_version_number => p_rec.object_version_number);
896 --
897 chk_bnft_rt_typ_cd
898 (p_batch_rt_id => p_rec.batch_rt_id,
899 p_bnft_rt_typ_cd => p_rec.bnft_rt_typ_cd,
900 p_effective_date => p_effective_date,
901 p_object_version_number => p_rec.object_version_number);
902 --
903 hr_utility.set_location(' Leaving:'||l_proc, 10);
904 End update_validate;
905 --
906 -- ----------------------------------------------------------------------------
907 -- |---------------------------< delete_validate >----------------------------|
908 -- ----------------------------------------------------------------------------
909 Procedure delete_validate(p_rec in ben_bri_shd.g_rec_type
910 ,p_effective_date in date) is
911 --
912 l_proc varchar2(72) := g_package||'delete_validate';
913 --
914 Begin
915 hr_utility.set_location('Entering:'||l_proc, 5);
916 --
917 -- Call all supporting business operations
918 --
919 hr_utility.set_location(' Leaving:'||l_proc, 10);
920 End delete_validate;
921 --
922 --
923 -- ---------------------------------------------------------------------------
924 -- |---------------------< return_legislation_code >-------------------------|
925 -- ---------------------------------------------------------------------------
926 --
927 function return_legislation_code
928 (p_batch_rt_id in number) return varchar2 is
929 --
930 -- Declare cursor
931 --
932 cursor csr_leg_code is
933 select a.legislation_code
934 from per_business_groups a,
935 ben_batch_rate_info b
936 where b.batch_rt_id = p_batch_rt_id
937 and a.business_group_id = b.business_group_id;
938 --
939 -- Declare local variables
940 --
941 l_legislation_code varchar2(150);
945 --
942 l_proc varchar2(72) := g_package||'return_legislation_code';
943 --
944 begin
946 hr_utility.set_location('Entering:'|| l_proc, 10);
947 --
948 -- Ensure that all the mandatory parameter are not null
949 --
950 hr_api.mandatory_arg_error(p_api_name => l_proc,
951 p_argument => 'batch_rt_id',
952 p_argument_value => p_batch_rt_id);
953 --
954 open csr_leg_code;
955 --
956 fetch csr_leg_code into l_legislation_code;
957 --
958 if csr_leg_code%notfound then
959 --
960 close csr_leg_code;
961 --
962 -- The primary key is invalid therefore we must error
963 --
964 hr_utility.set_message(801,'HR_7220_INVALID_PRIMARY_KEY');
965 hr_utility.raise_error;
966 --
967 end if;
968 --
969 close csr_leg_code;
970 --
971 hr_utility.set_location(' Leaving:'|| l_proc, 20);
972 --
973 return l_legislation_code;
974 --
975 end return_legislation_code;
976 --
977 end ben_bri_bus;