DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_LOP_BUS

Source


1 Package Body ben_lop_bus as
2 /* $Header: beloprhi.pkb 115.12 2002/12/13 06:19:42 hmani ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_lop_bus.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------< chk_ler_chg_oipl_enrt_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 --   ler_chg_oipl_enrt_id PK of record being inserted or updated.
24 --   effective_date Effective Date of session
25 --   object_version_number Object version number of record being
26 --                         inserted or updated.
27 --
28 -- Post Success
29 --   Processing continues
30 --
31 -- Post Failure
32 --   Errors handled by the procedure
33 --
34 -- Access Status
35 --   Internal table handler use only.
36 --
37 Procedure chk_ler_chg_oipl_enrt_id(p_ler_chg_oipl_enrt_id                in number,
38                            p_effective_date              in date,
39                            p_object_version_number       in number) is
40   --
41   l_proc         varchar2(72) := g_package||'chk_ler_chg_oipl_enrt_id';
42   l_api_updating boolean;
43   --
44 Begin
45   --
46   hr_utility.set_location('Entering:'||l_proc, 5);
47   --
48   l_api_updating := ben_lop_shd.api_updating
49     (p_effective_date              => p_effective_date,
50      p_ler_chg_oipl_enrt_id                => p_ler_chg_oipl_enrt_id,
51      p_object_version_number       => p_object_version_number);
52   --
53   if (l_api_updating
54      and nvl(p_ler_chg_oipl_enrt_id,hr_api.g_number)
55      <>  ben_lop_shd.g_old_rec.ler_chg_oipl_enrt_id) then
56     --
57     -- raise error as PK has changed
58     --
59     ben_lop_shd.constraint_error('BEN_LER_CHG_OIPL_ENRT_PK');
60     --
61   elsif not l_api_updating then
62     --
63     -- check if PK is null
64     --
65     if p_ler_chg_oipl_enrt_id is not null then
66       --
67       -- raise error as PK is not null
68       --
69       ben_lop_shd.constraint_error('BEN_LER_CHG_OIPL_ENRT_PK');
70       --
71     end if;
72     --
73   end if;
74   --
75   hr_utility.set_location('Leaving:'||l_proc, 10);
76   --
77 End chk_ler_chg_oipl_enrt_id;
78 --
79 -- ----------------------------------------------------------------------------
80 -- |------------------------< chk_auto_enrt_flag >----------------------------|
81 -- ----------------------------------------------------------------------------
82 --
83 -- Description
84 --   This procedure is used to check that the lookup value is valid.
85 --
86 -- Pre Conditions
87 --   None.
88 --
89 -- In Parameters
90 --   ler_chg_oipl_enrt_id PK of record being inserted or updated.
91 --   auto_enrt_flag Value of lookup code.
92 --   effective_date effective date
93 --   object_version_number Object version number of record being
94 --                         inserted or updated.
95 --
96 -- Post Success
97 --   Processing continues
98 --
99 -- Post Failure
100 --   Error handled by procedure
101 --
102 -- Access Status
103 --   Internal table handler use only.
104 --
105 Procedure chk_auto_enrt_flag(p_ler_chg_oipl_enrt_id       in number,
106                              p_auto_enrt_flag             in varchar2,
107                              p_effective_date             in date,
108                              p_object_version_number      in number) is
109   --
110   l_proc         varchar2(72) := g_package||'chk_auto_enrt_flag';
111   l_api_updating boolean;
112   --
113 Begin
114   --
115   hr_utility.set_location('Entering:'||l_proc, 5);
116   --
117   l_api_updating := ben_lop_shd.api_updating
118     (p_ler_chg_oipl_enrt_id        => p_ler_chg_oipl_enrt_id,
119      p_effective_date              => p_effective_date,
120      p_object_version_number       => p_object_version_number);
121   --
122   if (l_api_updating
123       and p_auto_enrt_flag
124       <> nvl(ben_lop_shd.g_old_rec.auto_enrt_flag,hr_api.g_varchar2)
125       or not l_api_updating)
126       and p_auto_enrt_flag is not null then
127     --
128     -- check if value of lookup falls within lookup type.
129     --
130     if hr_api.not_exists_in_hr_lookups
131           (p_lookup_type    => 'YES_NO',
132            p_lookup_code    => p_auto_enrt_flag,
133            p_effective_date => p_effective_date) then
134       --
135       -- raise error as does not exist as lookup
136       --
137       fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
138       fnd_message.set_token('FIELD','p_auto_enrt_flag');
139       fnd_message.set_token('TYPE','YES_NO');
140       fnd_message.raise_error;
141       --
142     end if;
143     --
144   end if;
145   --
146   hr_utility.set_location('Leaving:'||l_proc,10);
147   --
148 end chk_auto_enrt_flag;
149 --
150 -- ----------------------------------------------------------------------------
151 -- |------< chk_stl_elig_cant_chg_flag >------|
152 -- ----------------------------------------------------------------------------
153 --
154 -- Description
155 --   This procedure is used to check that the lookup value is valid.
156 --
157 -- Pre Conditions
158 --   None.
159 --
160 -- In Parameters
161 --   ler_chg_oipl_enrt_id PK of record being inserted or updated.
162 --   stl_elig_cant_chg_flag Value of lookup code.
163 --   effective_date effective date
164 --   object_version_number Object version number of record being
165 --                         inserted or updated.
166 --
167 -- Post Success
168 --   Processing continues
169 --
170 -- Post Failure
171 --   Error handled by procedure
172 --
173 -- Access Status
174 --   Internal table handler use only.
175 --
176 Procedure chk_stl_elig_cant_chg_flag(p_ler_chg_oipl_enrt_id                in number,
177                             p_stl_elig_cant_chg_flag               in varchar2,
178                             p_effective_date              in date,
179                             p_object_version_number       in number) is
180   --
181   l_proc         varchar2(72) := g_package||'chk_stl_elig_cant_chg_flag';
182   l_api_updating boolean;
183   --
184 Begin
185   --
186   hr_utility.set_location('Entering:'||l_proc, 5);
187   --
188   l_api_updating := ben_lop_shd.api_updating
189     (p_ler_chg_oipl_enrt_id                => p_ler_chg_oipl_enrt_id,
190      p_effective_date              => p_effective_date,
191      p_object_version_number       => p_object_version_number);
192   --
193   if (l_api_updating
194       and p_stl_elig_cant_chg_flag
195       <> nvl(ben_lop_shd.g_old_rec.stl_elig_cant_chg_flag,hr_api.g_varchar2)
196       or not l_api_updating)
197       and p_stl_elig_cant_chg_flag is not null then
198     --
199     -- check if value of lookup falls within lookup type.
200     --
201     if hr_api.not_exists_in_hr_lookups
202           (p_lookup_type    => 'YES_NO',
203            p_lookup_code    => p_stl_elig_cant_chg_flag,
204            p_effective_date => p_effective_date) then
205       --
206       -- raise error as does not exist as lookup
207       --
208       fnd_message.set_name('PAY','HR_LOOKUP_DOES_NOT_EXIST');
209       fnd_message.raise_error;
210       --
211     end if;
212     --
213   end if;
214   --
215   hr_utility.set_location('Leaving:'||l_proc,10);
216   --
217 end chk_stl_elig_cant_chg_flag;
218 --
219 -- ----------------------------------------------------------------------------
220 -- |------< chk_dflt_flag >------|
221 -- ----------------------------------------------------------------------------
222 --
223 -- Description
224 --   This procedure is used to check that the lookup value is valid.
225 --
226 -- Pre Conditions
227 --   None.
228 --
229 -- In Parameters
230 --   ler_chg_oipl_enrt_id PK of record being inserted or updated.
231 --   dflt_flag Value of lookup code.
232 --   effective_date effective date
233 --   object_version_number Object version number of record being
234 --                         inserted or updated.
235 --
236 -- Post Success
237 --   Processing continues
238 --
239 -- Post Failure
240 --   Error handled by procedure
241 --
242 -- Access Status
243 --   Internal table handler use only.
244 --
245 Procedure chk_dflt_flag(p_ler_chg_oipl_enrt_id                in number,
246                             p_dflt_flag               in varchar2,
247                             p_effective_date              in date,
248                             p_object_version_number       in number) is
249   --
250   l_proc         varchar2(72) := g_package||'chk_dflt_flag';
251   l_api_updating boolean;
252   --
253 Begin
254   --
255   hr_utility.set_location('Entering:'||l_proc, 5);
256   --
257   l_api_updating := ben_lop_shd.api_updating
258     (p_ler_chg_oipl_enrt_id                => p_ler_chg_oipl_enrt_id,
259      p_effective_date              => p_effective_date,
260      p_object_version_number       => p_object_version_number);
261   --
262   if (l_api_updating
263       and p_dflt_flag
264       <> nvl(ben_lop_shd.g_old_rec.dflt_flag,hr_api.g_varchar2)
265       or not l_api_updating)
266       and p_dflt_flag 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    => 'YES_NO',
272            p_lookup_code    => p_dflt_flag,
273            p_effective_date => p_effective_date) then
274       --
275       -- raise error as does not exist as lookup
276       --
277       fnd_message.set_name('PAY','HR_LOOKUP_DOES_NOT_EXIST');
278       fnd_message.raise_error;
279       --
280     end if;
281     --
282   end if;
283   --
284   hr_utility.set_location('Leaving:'||l_proc,10);
285   --
286 end chk_dflt_flag;
287 --
288 -- ----------------------------------------------------------------------------
289 -- |------< chk_dflt_enrt_cd >------|
290 -- ----------------------------------------------------------------------------
291 --
292 -- Description
293 --   This procedure is used to check that the lookup value is valid.
294 --
295 -- Pre Conditions
296 --   None.
297 --
298 -- In Parameters
299 --   ler_chg_oipl_enrt_id PK of record being inserted or updated.
300 --   dflt_enrt_cd Value of lookup code.
301 --   effective_date effective date
302 --   object_version_number Object version number of record being
303 --                         inserted or updated.
304 --
305 -- Post Success
306 --   Processing continues
307 --
308 -- Post Failure
309 --   Error handled by procedure
310 --
311 -- Access Status
312 --   Internal table handler use only.
313 --
314 Procedure chk_dflt_enrt_cd(p_ler_chg_oipl_enrt_id                in number,
315                             p_dflt_enrt_cd               in varchar2,
316                             p_effective_date              in date,
317                             p_object_version_number       in number) is
318   --
319   l_proc         varchar2(72) := g_package||'chk_dflt_enrt_cd';
320   l_api_updating boolean;
321   --
322 Begin
323   --
324   hr_utility.set_location('Entering:'||l_proc, 5);
325   --
326   l_api_updating := ben_lop_shd.api_updating
327     (p_ler_chg_oipl_enrt_id                => p_ler_chg_oipl_enrt_id,
328      p_effective_date              => p_effective_date,
329      p_object_version_number       => p_object_version_number);
330   --
331   if (l_api_updating
332       and p_dflt_enrt_cd
333       <> nvl(ben_lop_shd.g_old_rec.dflt_enrt_cd,hr_api.g_varchar2)
334       or not l_api_updating)
335       and p_dflt_enrt_cd is not null then
336     --
337     -- check if value of lookup falls within lookup type.
338     --
339     if hr_api.not_exists_in_hr_lookups
340           (p_lookup_type    => 'BEN_DFLT_ENRT',
341            p_lookup_code    => p_dflt_enrt_cd,
342            p_effective_date => p_effective_date) then
343       --
344       -- raise error as does not exist as lookup
345       --
346       fnd_message.set_name('PAY','HR_LOOKUP_DOES_NOT_EXIST');
347       fnd_message.raise_error;
348       --
349     end if;
350     --
351   end if;
352   --
353   hr_utility.set_location('Leaving:'||l_proc,10);
354   --
355 end chk_dflt_enrt_cd;
356 --
357 -- ----------------------------------------------------------------------------
358 -- |---------------------< chk_dflt_enrt_rl >---------------------------------|
359 -- ----------------------------------------------------------------------------
360 --
361 -- Description
362 --   This procedure is used to check that the lookup value is valid.
363 --
364 -- Pre Conditions
365 --   None.
366 --
367 -- In Parameters
368 --   ler_chg_oipl_enrt_id   PK of record being inserted or updated.
369 --   dflt_enrt_rl           Value of lookup code.
370 --   effective_date         effective date
371 --   object_version_number  Object version number of record being
372 --                          inserted or updated.
373 --   business_group_id
374 --
375 -- Post Success
376 --   Processing continues
377 --
378 -- Post Failure
379 --   Error handled by procedure
380 --
381 -- Access Status
382 --   Internal table handler use only.
383 --
384 Procedure chk_dflt_enrt_rl(p_ler_chg_oipl_enrt_id        in number,
385                            p_dflt_enrt_rl                in number,
386                            p_effective_date              in date,
387                            p_object_version_number       in number,
388                            p_business_group_id           in number) is
389   --
390   l_proc         varchar2(72) := g_package||'chk_dflt_enrt_rl';
391   l_api_updating boolean;
392   l_dummy varchar2(30);
393   --
394   cursor c1 is
395     select null
396     from   ff_formulas_f ff,
397            per_business_groups pbg
398     where  ff.formula_id = p_dflt_enrt_rl
399     and    ff.formula_type_id = - 32
400     and    pbg.business_group_id = p_business_group_id
401     and    nvl(ff.business_group_id, p_business_group_id) =
402            p_business_group_id
403     and    nvl(ff.legislation_code, pbg.legislation_code) =
404            pbg.legislation_code
405     and    p_effective_date
406            between ff.effective_start_date
407            and     ff.effective_end_date;
408   --
409 Begin
410   --
411   hr_utility.set_location('Entering:'||l_proc, 5);
412   --
413   l_api_updating := ben_lop_shd.api_updating
414     (p_ler_chg_oipl_enrt_id        => p_ler_chg_oipl_enrt_id,
415      p_effective_date              => p_effective_date,
416      p_object_version_number       => p_object_version_number);
417   --
418   if (l_api_updating
419       and p_dflt_enrt_rl
420       <> nvl(ben_lop_shd.g_old_rec.dflt_enrt_rl,hr_api.g_number)
421       or not l_api_updating)
422       and p_dflt_enrt_rl is not null then
423     --
424     -- check if value of formula rule is valid.
425     --
426     open c1;
427       --
428       -- fetch value from cursor if it returns a record then the
429       -- formula is valid otherwise its invalid
430       --
431       fetch c1 into l_dummy;
432       if c1%notfound then
433         --
434         close c1;
435         --
436         -- raise error
437         --
438       fnd_message.set_name('BEN','BEN_91471_FORMULA_NOT_FOUND');
439       fnd_message.set_token('ID',p_dflt_enrt_rl);
440       fnd_message.set_token('TYPE_ID',-32);
441       fnd_message.raise_error;
442         --
443       end if;
444       --
445     close c1;
446     --
447   end if;
448   --
449   hr_utility.set_location('Leaving:'||l_proc,10);
450   --
451 end chk_dflt_enrt_rl;
452 --
453 -- ----------------------------------------------------------------------------
454 -- |------< chk_enrt_cd >------|
455 -- ----------------------------------------------------------------------------
456 --
457 -- Description
458 --   This procedure is used to check that the lookup value is valid.
459 --
460 -- Pre Conditions
461 --   None.
462 --
463 -- In Parameters
464 --   ler_chg_oipl_enrt_id PK of record being inserted or updated.
465 --   enrt_cd Value of lookup code.
466 --   effective_date effective date
467 --   object_version_number Object version number of record being
468 --                         inserted or updated.
469 --
470 -- Post Success
471 --   Processing continues
472 --
473 -- Post Failure
474 --   Error handled by procedure
475 --
476 -- Access Status
477 --   Internal table handler use only.
478 --
479 Procedure chk_enrt_cd(p_ler_chg_oipl_enrt_id                in number,
480                             p_enrt_cd               in varchar2,
481                             p_effective_date              in date,
482                             p_object_version_number       in number) is
483   --
484   l_proc         varchar2(72) := g_package||'chk_enrt_cd';
485   l_api_updating boolean;
486   --
487 Begin
488   --
489   hr_utility.set_location('Entering:'||l_proc, 5);
490   --
491   l_api_updating := ben_lop_shd.api_updating
492     (p_ler_chg_oipl_enrt_id                => p_ler_chg_oipl_enrt_id,
493      p_effective_date              => p_effective_date,
494      p_object_version_number       => p_object_version_number);
495   --
496   if (l_api_updating
497       and p_enrt_cd
498       <> nvl(ben_lop_shd.g_old_rec.enrt_cd,hr_api.g_varchar2)
499       or not l_api_updating)
500       and p_enrt_cd is not null then
501     --
502     -- check if value of lookup falls within lookup type.
503     --
504     if hr_api.not_exists_in_hr_lookups
505           (p_lookup_type    => 'BEN_ENRT',
506            p_lookup_code    => p_enrt_cd,
507            p_effective_date => p_effective_date) then
508       --
509       -- raise error as does not exist as lookup
510       --
511       fnd_message.set_name('PAY','HR_LOOKUP_DOES_NOT_EXIST');
512       fnd_message.raise_error;
513       --
514     end if;
515     --
516   end if;
517   --
518   hr_utility.set_location('Leaving:'||l_proc,10);
519   --
520 end chk_enrt_cd;
521 --
522 -- ----------------------------------------------------------------------------
523 -- |---------------------< chk_enrt_rl >-----------------------------------|
524 -- ----------------------------------------------------------------------------
525 --
526 -- Description
527 --   This procedure is used to check that the lookup value is valid.
528 --
529 -- Pre Conditions
530 --   None.
531 --
532 -- In Parameters
533 --   ler_chg_oipl_enrt_id   PK of record being inserted or updated.
534 --   enrt_rl                Value of lookup code.
535 --   effective_date         effective date
536 --   object_version_number  Object version number of record being
537 --                          inserted or updated.
538 --   business_group_id
539 --
540 -- Post Success
541 --   Processing continues
542 --
543 -- Post Failure
544 --   Error handled by procedure
545 --
546 -- Access Status
547 --   Internal table handler use only.
548 --
549 Procedure chk_enrt_rl(p_ler_chg_oipl_enrt_id              in number,
550                             p_enrt_rl                     in number,
551                             p_effective_date              in date,
552                             p_object_version_number       in number,
553                             p_business_group_id           in number) is
554   --
555   l_proc         varchar2(72) := g_package||'chk_enrt_rl';
556   l_api_updating boolean;
557   l_dummy varchar2(30);
558   --
559   cursor c1 is
560     select null
561     from   ff_formulas_f ff,
562            per_business_groups pbg
563     where  ff.formula_id = p_enrt_rl
564     and    ff.formula_type_id = - 393
565     and    pbg.business_group_id = p_business_group_id
566     and    nvl(ff.business_group_id, p_business_group_id) =
567            p_business_group_id
568     and    nvl(ff.legislation_code, pbg.legislation_code) =
569            pbg.legislation_code
570     and    p_effective_date
571            between ff.effective_start_date
572            and     ff.effective_end_date;
573   --
574 Begin
575   --
576   hr_utility.set_location('Entering:'||l_proc, 5);
577   --
578   l_api_updating := ben_lop_shd.api_updating
579     (p_ler_chg_oipl_enrt_id        => p_ler_chg_oipl_enrt_id,
580      p_effective_date              => p_effective_date,
581      p_object_version_number       => p_object_version_number);
582   --
583   if (l_api_updating
584       and p_enrt_rl
585       <> nvl(ben_lop_shd.g_old_rec.enrt_rl,hr_api.g_number)
586       or not l_api_updating)
587       and p_enrt_rl is not null then
588     --
589     -- check if value of formula rule is valid.
590     --
591     open c1;
592       --
593       -- fetch value from cursor if it returns a record then the
594       -- formula is valid otherwise its invalid
595       --
596       fetch c1 into l_dummy;
597       if c1%notfound then
598         --
599         close c1;
600         --
601         -- raise error
602         --
603       fnd_message.set_name('BEN','BEN_91471_FORMULA_NOT_FOUND');
604       fnd_message.set_token('ID',p_enrt_rl);
605       fnd_message.set_token('TYPE_ID',-393);
606       fnd_message.raise_error;
607         --
608       end if;
609       --
610     close c1;
611     --
612   end if;
613   --
614   hr_utility.set_location('Leaving:'||l_proc,10);
615   --
616 end chk_enrt_rl;
617 --
618 -- ----------------------------------------------------------------------------
619 -- |---------------------< chk_auto_enrt_mthd_rl >-------------------------|
620 -- ----------------------------------------------------------------------------
621 --
622 -- Description
623 --   This procedure is used to check that the lookup value is valid.
624 --
625 -- Pre Conditions
626 --   None.
627 --
628 -- In Parameters
629 --   ler_chg_oipl_enrt_id   PK of record being inserted or updated.
630 --   auto_enrt_mthd_rl      Value of lookup code.
631 --   effective_date         effective date
632 --   object_version_number  Object version number of record being
633 --                          inserted or updated.
634 --   business_group_id
635 --
636 -- Post Success
637 --   Processing continues
638 --
639 -- Post Failure
640 --   Error handled by procedure
641 --
642 -- Access Status
643 --   Internal table handler use only.
644 --
645 Procedure chk_auto_enrt_mthd_rl(p_ler_chg_oipl_enrt_id    in number,
646                             p_auto_enrt_mthd_rl           in number,
647                             p_effective_date              in date,
648                             p_object_version_number       in number,
649                             p_business_group_id           in number) is
650   --
651   l_proc         varchar2(72) := g_package||'chk_auto_enrt_mthd_rl';
652   l_api_updating boolean;
653   l_dummy varchar2(30);
654   --
655   cursor c1 is
656     select null
657     from   ff_formulas_f ff,
658            per_business_groups pbg
659     where  ff.formula_id = p_auto_enrt_mthd_rl
660     and    ff.formula_type_id = - 146
661     and    pbg.business_group_id = p_business_group_id
662     and    nvl(ff.business_group_id, p_business_group_id) =
663            p_business_group_id
664     and    nvl(ff.legislation_code, pbg.legislation_code) =
665            pbg.legislation_code
666     and    p_effective_date
667            between ff.effective_start_date
668            and     ff.effective_end_date;
669   --
670 Begin
671   --
672   hr_utility.set_location('Entering:'||l_proc, 5);
673   --
674   l_api_updating := ben_lop_shd.api_updating
675     (p_ler_chg_oipl_enrt_id        => p_ler_chg_oipl_enrt_id,
676      p_effective_date              => p_effective_date,
677      p_object_version_number       => p_object_version_number);
678   --
679   if (l_api_updating
680       and p_auto_enrt_mthd_rl
681       <> nvl(ben_lop_shd.g_old_rec.auto_enrt_mthd_rl,hr_api.g_number)
682       or not l_api_updating)
683       and p_auto_enrt_mthd_rl is not null then
684     --
685     -- check if value of formula rule is valid.
686     --
687     open c1;
688       --
689       -- fetch value from cursor if it returns a record then the
690       -- formula is valid otherwise its invalid
691       --
692       fetch c1 into l_dummy;
693       if c1%notfound then
694         --
695         close c1;
696         --
697         -- raise error
698         --
699       fnd_message.set_name('BEN','BEN_91471_FORMULA_NOT_FOUND');
700       fnd_message.set_token('ID',p_auto_enrt_mthd_rl);
701       fnd_message.set_token('TYPE_ID',-146);
702       fnd_message.raise_error;
703         --
704       end if;
705       --
706     close c1;
707     --
708   end if;
709   --
710   hr_utility.set_location('Leaving:'||l_proc,10);
711   --
712 end chk_auto_enrt_mthd_rl;
713 --
714 -- ----------------------------------------------------------------------------
715 -- |------< chk_use_schedd_enrt_dfns_flag >------|
716 -- ----------------------------------------------------------------------------
717 --
718 -- Description
719 --   This procedure is used to check that the lookup value is valid.
720 --
721 -- Pre Conditions
722 --   None.
723 --
724 -- In Parameters
725 --   ler_chg_oipl_enrt_id PK of record being inserted or updated.
726 --   use_schedd_enrt_dfns_flag Value of lookup code.
727 --   effective_date effective date
728 --   object_version_number Object version number of record being
729 --                         inserted or updated.
730 --
731 -- Post Success
732 --   Processing continues
733 --
734 -- Post Failure
735 --   Error handled by procedure
736 --
737 -- Access Status
738 --   Internal table handler use only.
739 --
740 /*
741 --
742 Procedure chk_use_schedd_enrt_dfns_flag(p_ler_chg_oipl_enrt_id                in number,
743                             p_use_schedd_enrt_dfns_flag               in varchar2,
744                             p_effective_date              in date,
745                             p_object_version_number       in number) is
746   --
747   l_proc         varchar2(72) := g_package||'chk_use_schedd_enrt_dfns_flag';
748   l_api_updating boolean;
749   --
750 Begin
751   --
752   hr_utility.set_location('Entering:'||l_proc, 5);
753   --
754   l_api_updating := ben_lop_shd.api_updating
755     (p_ler_chg_oipl_enrt_id                => p_ler_chg_oipl_enrt_id,
756      p_effective_date              => p_effective_date,
757      p_object_version_number       => p_object_version_number);
758   --
759   if (l_api_updating
760       and p_use_schedd_enrt_dfns_flag
761       <> nvl(ben_lop_shd.g_old_rec.use_schedd_enrt_dfns_flag,hr_api.g_varchar2)
762       or not l_api_updating)
763       and p_use_schedd_enrt_dfns_flag is not null then
764     --
765     -- check if value of lookup falls within lookup type.
766     --
767     if hr_api.not_exists_in_hr_lookups
768           (p_lookup_type    => 'YES_NO',
769            p_lookup_code    => p_use_schedd_enrt_dfns_flag,
770            p_effective_date => p_effective_date) then
771       --
772       -- raise error as does not exist as lookup
773       --
774       fnd_message.set_name('PAY','HR_LOOKUP_DOES_NOT_EXIST');
775       fnd_message.raise_error;
776       --
777     end if;
778     --
779   end if;
780   --
781   hr_utility.set_location('Leaving:'||l_proc,10);
782   --
783 end chk_use_schedd_enrt_dfns_flag;
784 --
785 */
786 --
787 -- ----------------------------------------------------------------------------
788 -- |------< chk_use_schedd_enrt_dflts_flag >------|
789 -- ----------------------------------------------------------------------------
790 --
791 -- Description
792 --   This procedure is used to check that the lookup value is valid.
793 --
794 -- Pre Conditions
795 --   None.
796 --
797 -- In Parameters
798 --   ler_chg_oipl_enrt_id PK of record being inserted or updated.
799 --   use_schedd_enrt_dflts_flag Value of lookup code.
800 --   effective_date effective date
801 --   object_version_number Object version number of record being
802 --                         inserted or updated.
803 --
804 -- Post Success
805 --   Processing continues
806 --
807 -- Post Failure
808 --   Error handled by procedure
809 --
810 -- Access Status
811 --   Internal table handler use only.
812 --
813 /*
814 --
815 Procedure chk_use_schedd_enrt_dflts_flag(p_ler_chg_oipl_enrt_id                in number,
816                             p_use_schedd_enrt_dflts_flag               in varchar2,
817                             p_effective_date              in date,
818                             p_object_version_number       in number) is
819   --
820   l_proc         varchar2(72) := g_package||'chk_use_schedd_enrt_dflts_flag';
821   l_api_updating boolean;
822   --
823 Begin
824   --
825   hr_utility.set_location('Entering:'||l_proc, 5);
826   --
827   l_api_updating := ben_lop_shd.api_updating
828     (p_ler_chg_oipl_enrt_id                => p_ler_chg_oipl_enrt_id,
829      p_effective_date              => p_effective_date,
830      p_object_version_number       => p_object_version_number);
831   --
832   if (l_api_updating
833       and p_use_schedd_enrt_dflts_flag
834       <> nvl(ben_lop_shd.g_old_rec.use_schedd_enrt_dflts_flag,hr_api.g_varchar2)
835       or not l_api_updating)
836       and p_use_schedd_enrt_dflts_flag is not null then
837     --
838     -- check if value of lookup falls within lookup type.
839     --
840     if hr_api.not_exists_in_hr_lookups
841           (p_lookup_type    => 'YES_NO',
842            p_lookup_code    => p_use_schedd_enrt_dflts_flag,
843            p_effective_date => p_effective_date) then
844       --
845       -- raise error as does not exist as lookup
846       --
847       fnd_message.set_name('PAY','HR_LOOKUP_DOES_NOT_EXIST');
848       fnd_message.raise_error;
849       --
850     end if;
851     --
852   end if;
853   --
854   hr_utility.set_location('Leaving:'||l_proc,10);
855   --
856 end chk_use_schedd_enrt_dflts_flag;
857 --
858 */
859 --
860 -- ----------------------------------------------------------------------------
861 -- |------< chk_new_crnt_enrl_cd >------|
862 -- ----------------------------------------------------------------------------
863 --
864 -- Description
865 --   This procedure is used to check that the lookup value is valid.
866 --
867 -- Pre Conditions
868 --   None.
869 --
870 -- In Parameters
871 --   ler_chg_oipl_enrt_id PK of record being inserted or updated.
872 --   new_crnt_enrl_cd Value of lookup code.
873 --   effective_date effective date
874 --   object_version_number Object version number of record being
875 --                         inserted or updated.
876 --
877 -- Post Success
878 --   Processing continues
879 --
880 -- Post Failure
881 --   Error handled by procedure
882 --
883 -- Access Status
884 --   Internal table handler use only.
885 --
886 /*
887 Procedure chk_new_crnt_enrl_cd(p_ler_chg_oipl_enrt_id                in number,
888                             p_new_crnt_enrl_cd               in varchar2,
889                             p_effective_date              in date,
890                             p_object_version_number       in number) is
891   --
892   l_proc         varchar2(72) := g_package||'chk_new_crnt_enrl_cd';
893   l_api_updating boolean;
894   --
895 Begin
896   --
897   hr_utility.set_location('Entering:'||l_proc, 5);
898   --
899   l_api_updating := ben_lop_shd.api_updating
900     (p_ler_chg_oipl_enrt_id                => p_ler_chg_oipl_enrt_id,
901      p_effective_date              => p_effective_date,
902      p_object_version_number       => p_object_version_number);
903   --
904   if (l_api_updating
905       and p_new_crnt_enrl_cd
906       <> nvl(ben_lop_shd.g_old_rec.new_crnt_enrl_cd,hr_api.g_varchar2)
907       or not l_api_updating) then
908     --
909     -- check if value of lookup falls within lookup type.
910     --
911     --
912     if hr_api.not_exists_in_hr_lookups
913           (p_lookup_type    => 'BEN_NEW_CRNT_ENRT',
914            p_lookup_code    => p_new_crnt_enrl_cd,
915            p_effective_date => p_effective_date) then
916       --
917       -- raise error as does not exist as lookup
918       --
919       fnd_message.set_name('PAY','HR_LOOKUP_DOES_NOT_EXIST');
920       fnd_message.raise_error;
921       --
922     end if;
923     --
924   end if;
925   --
926   hr_utility.set_location('Leaving:'||l_proc,10);
927   --
928 end chk_new_crnt_enrl_cd;
929 */
930 --
931 -- ----------------------------------------------------------------------------
932 -- |------< chk_crnt_enrt_prclds_chg_flag >------|
933 -- ----------------------------------------------------------------------------
934 --
935 -- Description
936 --   This procedure is used to check that the lookup value is valid.
937 --
938 -- Pre Conditions
939 --   None.
940 --
941 -- In Parameters
942 --   ler_chg_oipl_enrt_id PK of record being inserted or updated.
943 --   crnt_enrt_prclds_chg_flag Value of lookup code.
944 --   effective_date effective date
945 --   object_version_number Object version number of record being
946 --                         inserted or updated.
947 --
948 -- Post Success
949 --   Processing continues
950 --
951 -- Post Failure
952 --   Error handled by procedure
953 --
954 -- Access Status
955 --   Internal table handler use only.
956 --
957 Procedure chk_crnt_enrt_prclds_chg_flag(p_ler_chg_oipl_enrt_id                in number,
958                             p_crnt_enrt_prclds_chg_flag               in varchar2,
959                             p_effective_date              in date,
960                             p_object_version_number       in number) is
961   --
962   l_proc         varchar2(72) := g_package||'chk_crnt_enrt_prclds_chg_flag';
963   l_api_updating boolean;
964   --
965 Begin
966   --
967   hr_utility.set_location('Entering:'||l_proc, 5);
968   --
969   l_api_updating := ben_lop_shd.api_updating
970     (p_ler_chg_oipl_enrt_id                => p_ler_chg_oipl_enrt_id,
971      p_effective_date              => p_effective_date,
972      p_object_version_number       => p_object_version_number);
973   --
974   if (l_api_updating
975       and p_crnt_enrt_prclds_chg_flag
976       <> nvl(ben_lop_shd.g_old_rec.crnt_enrt_prclds_chg_flag,hr_api.g_varchar2)
977       or not l_api_updating)
978       and p_crnt_enrt_prclds_chg_flag is not null then
979     --
980     -- check if value of lookup falls within lookup type.
981     --
982     if hr_api.not_exists_in_hr_lookups
983           (p_lookup_type    => 'YES_NO',
984            p_lookup_code    => p_crnt_enrt_prclds_chg_flag,
985            p_effective_date => p_effective_date) then
986       --
987       -- raise error as does not exist as lookup
988       --
989       fnd_message.set_name('PAY','HR_LOOKUP_DOES_NOT_EXIST');
990       fnd_message.raise_error;
991       --
992     end if;
993     --
994   end if;
995   --
996   hr_utility.set_location('Leaving:'||l_proc,10);
997   --
998 end chk_crnt_enrt_prclds_chg_flag;
999 --
1000 -- ----------------------------------------------------------------------------
1001 -- |--------------------------< dt_update_validate >--------------------------|
1002 -- ----------------------------------------------------------------------------
1003 -- {Start Of Comments}
1004 --
1005 -- Description:
1006 --   This procedure is used for referential integrity of datetracked
1007 --   parent entities when a datetrack update operation is taking place
1008 --   and where there is no cascading of update defined for this entity.
1009 --
1010 -- Prerequisites:
1011 --   This procedure is called from the update_validate.
1012 --
1013 -- In Parameters:
1014 --
1015 -- Post Success:
1016 --   Processing continues.
1017 --
1018 -- Post Failure:
1019 --
1020 -- Developer Implementation Notes:
1021 --   This procedure should not need maintenance unless the HR Schema model
1022 --   changes.
1023 --
1024 -- Access Status:
1025 --   Internal Row Handler Use Only.
1026 --
1027 -- {End Of Comments}
1028 -- ----------------------------------------------------------------------------
1029 Procedure dt_update_validate
1030             (p_ler_id                        in number default hr_api.g_number,
1031              p_oipl_id                       in number default hr_api.g_number,
1032 	     p_datetrack_mode		     in varchar2,
1033              p_validation_start_date	     in date,
1034 	     p_validation_end_date	     in date) Is
1035 --
1036   l_proc	    varchar2(72) := g_package||'dt_update_validate';
1037   l_integrity_error Exception;
1038   l_table_name	    all_tables.table_name%TYPE;
1039 --
1040 Begin
1041   hr_utility.set_location('Entering:'||l_proc, 5);
1042   --
1043   -- Ensure that the p_datetrack_mode argument is not null
1044   --
1045   hr_api.mandatory_arg_error
1046     (p_api_name       => l_proc,
1047      p_argument       => 'datetrack_mode',
1048      p_argument_value => p_datetrack_mode);
1049   --
1050   -- Only perform the validation if the datetrack update mode is valid
1051   --
1052   If (dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode)) then
1053     --
1054     --
1055     -- Ensure the arguments are not null
1056     --
1057     hr_api.mandatory_arg_error
1058       (p_api_name       => l_proc,
1059        p_argument       => 'validation_start_date',
1060        p_argument_value => p_validation_start_date);
1061     --
1062     hr_api.mandatory_arg_error
1063       (p_api_name       => l_proc,
1064        p_argument       => 'validation_end_date',
1065        p_argument_value => p_validation_end_date);
1066     --
1067     If ((nvl(p_ler_id, hr_api.g_number) <> hr_api.g_number) and
1068       NOT (dt_api.check_min_max_dates
1069             (p_base_table_name => 'ben_ler_f',
1070              p_base_key_column => 'ler_id',
1071              p_base_key_value  => p_ler_id,
1072              p_from_date       => p_validation_start_date,
1073              p_to_date         => p_validation_end_date)))  Then
1074       l_table_name := 'ben_ler_f';
1075       Raise l_integrity_error;
1076     End If;
1077     If ((nvl(p_oipl_id, hr_api.g_number) <> hr_api.g_number) and
1078       NOT (dt_api.check_min_max_dates
1079             (p_base_table_name => 'ben_oipl_f',
1080              p_base_key_column => 'oipl_id',
1081              p_base_key_value  => p_oipl_id,
1082              p_from_date       => p_validation_start_date,
1083              p_to_date         => p_validation_end_date)))  Then
1084       l_table_name := 'ben_oipl_f';
1085       Raise l_integrity_error;
1086     End If;
1087     --
1088   End If;
1089   --
1090   hr_utility.set_location(' Leaving:'||l_proc, 10);
1091 Exception
1092   When l_integrity_error Then
1093     --
1094     -- A referential integrity check was violated therefore
1095     -- we must error
1096     --
1097     ben_utility.parent_integrity_error(p_table_name => l_table_name);
1098     --
1099   When Others Then
1100     --
1101     -- An unhandled or unexpected error has occurred which
1102     -- we must report
1103     --
1104     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
1105     fnd_message.set_token('PROCEDURE', l_proc);
1106     fnd_message.set_token('STEP','15');
1107     fnd_message.raise_error;
1108 End dt_update_validate;
1109 --
1110 -- ----------------------------------------------------------------------------
1111 -- |--------------------------< dt_delete_validate >--------------------------|
1112 -- ----------------------------------------------------------------------------
1113 -- {Start Of Comments}
1114 --
1115 -- Description:
1116 --   This procedure is used for referential integrity of datetracked
1117 --   child entities when either a datetrack DELETE or ZAP is in operation
1118 --   and where there is no cascading of delete defined for this entity.
1119 --   For the datetrack mode of DELETE or ZAP we must ensure that no
1120 --   datetracked child rows exist between the validation start and end
1121 --   dates.
1122 --
1123 -- Prerequisites:
1124 --   This procedure is called from the delete_validate.
1125 --
1126 -- In Parameters:
1127 --
1128 -- Post Success:
1129 --   Processing continues.
1130 --
1131 -- Post Failure:
1132 --   If a row exists by determining the returning Boolean value from the
1133 --   generic dt_api.rows_exist function then we must supply an error via
1134 --   the use of the local exception handler l_rows_exist.
1135 --
1136 -- Developer Implementation Notes:
1137 --   This procedure should not need maintenance unless the HR Schema model
1138 --   changes.
1139 --
1140 -- Access Status:
1141 --   Internal Row Handler Use Only.
1142 --
1143 -- {End Of Comments}
1144 -- ----------------------------------------------------------------------------
1145 Procedure dt_delete_validate
1146             (p_ler_chg_oipl_enrt_id		in number,
1147              p_datetrack_mode		in varchar2,
1148 	     p_validation_start_date	in date,
1149 	     p_validation_end_date	in date) Is
1150 --
1151   l_proc	varchar2(72) 	:= g_package||'dt_delete_validate';
1152   l_rows_exist	Exception;
1153   l_table_name	all_tables.table_name%TYPE;
1154 --
1155 Begin
1156   hr_utility.set_location('Entering:'||l_proc, 5);
1157   --
1158   -- Ensure that the p_datetrack_mode argument is not null
1159   --
1160   hr_api.mandatory_arg_error
1161     (p_api_name       => l_proc,
1162      p_argument       => 'datetrack_mode',
1163      p_argument_value => p_datetrack_mode);
1164   --
1165   -- Only perform the validation if the datetrack mode is either
1166   -- DELETE or ZAP
1167   --
1168   If (p_datetrack_mode = 'DELETE' or
1169       p_datetrack_mode = 'ZAP') then
1170     --
1171     --
1172     -- Ensure the arguments are not null
1173     --
1174     hr_api.mandatory_arg_error
1175       (p_api_name       => l_proc,
1176        p_argument       => 'validation_start_date',
1177        p_argument_value => p_validation_start_date);
1178     --
1179     hr_api.mandatory_arg_error
1180       (p_api_name       => l_proc,
1181        p_argument       => 'validation_end_date',
1182        p_argument_value => p_validation_end_date);
1183     --
1184     hr_api.mandatory_arg_error
1185       (p_api_name       => l_proc,
1186        p_argument       => 'ler_chg_oipl_enrt_id',
1187        p_argument_value => p_ler_chg_oipl_enrt_id);
1188     --
1189     If (dt_api.rows_exist
1190           (p_base_table_name => 'ben_ler_chg_oipl_enrt_rl_f',
1191            p_base_key_column => 'ler_chg_oipl_enrt_id',
1192            p_base_key_value  => p_ler_chg_oipl_enrt_id,
1193            p_from_date       => p_validation_start_date,
1194            p_to_date         => p_validation_end_date)) Then
1195       l_table_name := 'ben_ler_chg_oipl_enrt_rl_f';
1196       Raise l_rows_exist;
1197     End If;
1198     --
1199   End If;
1200   --
1201   hr_utility.set_location(' Leaving:'||l_proc, 10);
1202 Exception
1203   When l_rows_exist Then
1204     --
1205     -- A referential integrity check was violated therefore
1206     -- we must error
1207     --
1208     ben_utility.child_exists_error(p_table_name => l_table_name);
1209     --
1210   When Others Then
1211     --
1212     -- An unhandled or unexpected error has occurred which
1213     -- we must report
1214     --
1215     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
1216     fnd_message.set_token('PROCEDURE', l_proc);
1217     fnd_message.set_token('STEP','15');
1218     fnd_message.raise_error;
1219 End dt_delete_validate;
1220 --
1221 -- ----------------------------------------------------------------------------
1222 -- |---------------------------< insert_validate >----------------------------|
1223 -- ----------------------------------------------------------------------------
1224 Procedure insert_validate
1225 	(p_rec 			 in ben_lop_shd.g_rec_type,
1226 	 p_effective_date	 in date,
1227 	 p_datetrack_mode	 in varchar2,
1228 	 p_validation_start_date in date,
1229 	 p_validation_end_date	 in date) is
1230 --
1231   l_proc	varchar2(72) := g_package||'insert_validate';
1232 --
1233 Begin
1234   hr_utility.set_location('Entering:'||l_proc, 5);
1235   --
1236   -- Call all supporting business operations
1237   --
1238   --
1239   hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate Bus Grp
1240   --
1241   chk_ler_chg_oipl_enrt_id
1242   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1243    p_effective_date        => p_effective_date,
1244    p_object_version_number => p_rec.object_version_number);
1245   --
1246   chk_auto_enrt_flag
1247   (p_ler_chg_oipl_enrt_id  => p_rec.ler_chg_oipl_enrt_id,
1248    p_auto_enrt_flag        => p_rec.auto_enrt_flag,
1249    p_effective_date        => p_effective_date,
1250    p_object_version_number => p_rec.object_version_number);
1251   --
1252   chk_stl_elig_cant_chg_flag
1253   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1254    p_stl_elig_cant_chg_flag         => p_rec.stl_elig_cant_chg_flag,
1255    p_effective_date        => p_effective_date,
1256    p_object_version_number => p_rec.object_version_number);
1257   --
1258   chk_dflt_flag
1259   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1260    p_dflt_flag         => p_rec.dflt_flag,
1261    p_effective_date        => p_effective_date,
1262    p_object_version_number => p_rec.object_version_number);
1263   --
1264 
1265   chk_dflt_enrt_cd
1266   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1267    p_dflt_enrt_cd         => p_rec.dflt_enrt_cd,
1268    p_effective_date        => p_effective_date,
1269    p_object_version_number => p_rec.object_version_number);
1270   --
1271   chk_dflt_enrt_rl
1272   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1273    p_dflt_enrt_rl                  => p_rec.dflt_enrt_rl,
1274    p_effective_date                => p_effective_date,
1275    p_object_version_number         => p_rec.object_version_number,
1276    p_business_group_id             => p_rec.business_group_id);
1277   --
1278   chk_enrt_cd
1279   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1280    p_enrt_cd         => p_rec.enrt_cd,
1281    p_effective_date        => p_effective_date,
1282    p_object_version_number => p_rec.object_version_number);
1283   --
1284   chk_enrt_rl
1285   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1286    p_enrt_rl                       => p_rec.enrt_rl,
1287    p_effective_date                => p_effective_date,
1288    p_object_version_number         => p_rec.object_version_number,
1289    p_business_group_id             => p_rec.business_group_id);
1290   --
1291   chk_auto_enrt_mthd_rl
1292   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1293    p_auto_enrt_mthd_rl             => p_rec.auto_enrt_mthd_rl,
1294    p_effective_date                => p_effective_date,
1295    p_object_version_number         => p_rec.object_version_number,
1296    p_business_group_id             => p_rec.business_group_id);
1297 /*
1298   --
1299   chk_use_schedd_enrt_dfns_flag
1300   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1301    p_use_schedd_enrt_dfns_flag         => p_rec.use_schedd_enrt_dfns_flag,
1302    p_effective_date        => p_effective_date,
1303    p_object_version_number => p_rec.object_version_number);
1304   --
1305   chk_use_schedd_enrt_dflts_flag
1306   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1307    p_use_schedd_enrt_dflts_flag         => p_rec.use_schedd_enrt_dflts_flag,
1308    p_effective_date        => p_effective_date,
1309    p_object_version_number => p_rec.object_version_number);
1310   --
1311   chk_new_crnt_enrl_cd
1312   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1313    p_new_crnt_enrl_cd         => p_rec.new_crnt_enrl_cd,
1314    p_effective_date        => p_effective_date,
1315    p_object_version_number => p_rec.object_version_number);
1316   --
1317 */
1318   --
1319   chk_crnt_enrt_prclds_chg_flag
1320   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1321    p_crnt_enrt_prclds_chg_flag         => p_rec.crnt_enrt_prclds_chg_flag,
1322    p_effective_date        => p_effective_date,
1323    p_object_version_number => p_rec.object_version_number);
1324   --
1325   hr_utility.set_location(' Leaving:'||l_proc, 10);
1326 End insert_validate;
1327 --
1328 -- ----------------------------------------------------------------------------
1329 -- |---------------------------< update_validate >----------------------------|
1330 -- ----------------------------------------------------------------------------
1331 Procedure update_validate
1332 	(p_rec 			 in ben_lop_shd.g_rec_type,
1333 	 p_effective_date	 in date,
1334 	 p_datetrack_mode	 in varchar2,
1335 	 p_validation_start_date in date,
1336 	 p_validation_end_date	 in date) is
1337 --
1338   l_proc	varchar2(72) := g_package||'update_validate';
1339 --
1340 Begin
1341   hr_utility.set_location('Entering:'||l_proc, 5);
1342   --
1343   -- Call all supporting business operations
1344   --
1345   --
1346   hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate Bus Grp
1347   --
1348   chk_ler_chg_oipl_enrt_id
1349   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1350    p_effective_date        => p_effective_date,
1351    p_object_version_number => p_rec.object_version_number);
1352   --
1353   chk_auto_enrt_flag
1354   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1355    p_auto_enrt_flag        => p_rec.auto_enrt_flag,
1356    p_effective_date        => p_effective_date,
1357    p_object_version_number => p_rec.object_version_number);
1358   --
1359   chk_stl_elig_cant_chg_flag
1360   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1361    p_stl_elig_cant_chg_flag         => p_rec.stl_elig_cant_chg_flag,
1362    p_effective_date        => p_effective_date,
1363    p_object_version_number => p_rec.object_version_number);
1364   --
1365   chk_dflt_flag
1366   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1367    p_dflt_flag         => p_rec.dflt_flag,
1368    p_effective_date        => p_effective_date,
1369    p_object_version_number => p_rec.object_version_number);
1370   --
1371   chk_dflt_enrt_cd
1372   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1373    p_dflt_enrt_cd         => p_rec.dflt_enrt_cd,
1374    p_effective_date        => p_effective_date,
1375    p_object_version_number => p_rec.object_version_number);
1376   --
1377   chk_dflt_enrt_rl
1378   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1379    p_dflt_enrt_rl                  => p_rec.dflt_enrt_rl,
1380    p_effective_date                => p_effective_date,
1381    p_object_version_number         => p_rec.object_version_number,
1382    p_business_group_id             => p_rec.business_group_id);
1383   --
1384   chk_enrt_cd
1385   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1386    p_enrt_cd         => p_rec.enrt_cd,
1387    p_effective_date        => p_effective_date,
1388    p_object_version_number => p_rec.object_version_number);
1389   --
1390   chk_enrt_rl
1391   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1392    p_enrt_rl                       => p_rec.enrt_rl,
1393    p_effective_date                => p_effective_date,
1394    p_object_version_number         => p_rec.object_version_number,
1395    p_business_group_id             => p_rec.business_group_id);
1396   --
1397   chk_auto_enrt_mthd_rl
1398   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1399    p_auto_enrt_mthd_rl             => p_rec.auto_enrt_mthd_rl,
1400    p_effective_date                => p_effective_date,
1401    p_object_version_number         => p_rec.object_version_number,
1402    p_business_group_id             => p_rec.business_group_id);
1403 /*
1404   --
1405   chk_use_schedd_enrt_dfns_flag
1406   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1407    p_use_schedd_enrt_dfns_flag         => p_rec.use_schedd_enrt_dfns_flag,
1408    p_effective_date        => p_effective_date,
1409    p_object_version_number => p_rec.object_version_number);
1410   --
1411   chk_use_schedd_enrt_dflts_flag
1412   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1413    p_use_schedd_enrt_dflts_flag         => p_rec.use_schedd_enrt_dflts_flag,
1414    p_effective_date        => p_effective_date,
1415    p_object_version_number => p_rec.object_version_number);
1416   --
1417   chk_new_crnt_enrl_cd
1418   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1419    p_new_crnt_enrl_cd         => p_rec.new_crnt_enrl_cd,
1420    p_effective_date        => p_effective_date,
1421    p_object_version_number => p_rec.object_version_number);
1422   --
1423 */
1424   --
1425   chk_crnt_enrt_prclds_chg_flag
1426   (p_ler_chg_oipl_enrt_id          => p_rec.ler_chg_oipl_enrt_id,
1427    p_crnt_enrt_prclds_chg_flag         => p_rec.crnt_enrt_prclds_chg_flag,
1428    p_effective_date        => p_effective_date,
1429    p_object_version_number => p_rec.object_version_number);
1430   --
1431   -- Call the datetrack update integrity operation
1432   --
1433   dt_update_validate
1434     (p_ler_id                        => p_rec.ler_id,
1435              p_oipl_id                       => p_rec.oipl_id,
1436      p_datetrack_mode                => p_datetrack_mode,
1437      p_validation_start_date	     => p_validation_start_date,
1438      p_validation_end_date	     => p_validation_end_date);
1439   --
1440   hr_utility.set_location(' Leaving:'||l_proc, 10);
1441 End update_validate;
1442 --
1443 -- ----------------------------------------------------------------------------
1444 -- |---------------------------< delete_validate >----------------------------|
1445 -- ----------------------------------------------------------------------------
1446 Procedure delete_validate
1447 	(p_rec 			 in ben_lop_shd.g_rec_type,
1448 	 p_effective_date	 in date,
1449 	 p_datetrack_mode	 in varchar2,
1450 	 p_validation_start_date in date,
1451 	 p_validation_end_date	 in date) is
1452 --
1453   l_proc	varchar2(72) := g_package||'delete_validate';
1454 --
1455 Begin
1456   hr_utility.set_location('Entering:'||l_proc, 5);
1457   --
1458   -- Call all supporting business operations
1459   --
1460   dt_delete_validate
1461     (p_datetrack_mode		=> p_datetrack_mode,
1462      p_validation_start_date	=> p_validation_start_date,
1463      p_validation_end_date	=> p_validation_end_date,
1464      p_ler_chg_oipl_enrt_id		=> p_rec.ler_chg_oipl_enrt_id);
1465   --
1466   hr_utility.set_location(' Leaving:'||l_proc, 10);
1467 End delete_validate;
1468 --
1469 --
1470 --  ---------------------------------------------------------------------------
1471 --  |---------------------< return_legislation_code >-------------------------|
1472 --  ---------------------------------------------------------------------------
1473 --
1474 function return_legislation_code
1475   (p_ler_chg_oipl_enrt_id in number) return varchar2 is
1476   --
1477   -- Declare cursor
1478   --
1479   cursor csr_leg_code is
1480     select a.legislation_code
1481     from   per_business_groups a,
1482            ben_ler_chg_oipl_enrt_f b
1483     where b.ler_chg_oipl_enrt_id      = p_ler_chg_oipl_enrt_id
1484     and   a.business_group_id = b.business_group_id;
1485   --
1486   -- Declare local variables
1487   --
1488   l_legislation_code  varchar2(150);
1489   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
1490   --
1491 begin
1492   --
1493   hr_utility.set_location('Entering:'|| l_proc, 10);
1494   --
1495   -- Ensure that all the mandatory parameter are not null
1496   --
1497   hr_api.mandatory_arg_error(p_api_name       => l_proc,
1498                              p_argument       => 'ler_chg_oipl_enrt_id',
1499                              p_argument_value => p_ler_chg_oipl_enrt_id);
1500   --
1501   open csr_leg_code;
1502     --
1503     fetch csr_leg_code into l_legislation_code;
1504     --
1505     if csr_leg_code%notfound then
1506       --
1507       close csr_leg_code;
1508       --
1509       -- The primary key is invalid therefore we must error
1510       --
1511       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
1512       fnd_message.raise_error;
1513       --
1514     end if;
1515     --
1516   close csr_leg_code;
1517   --
1518   hr_utility.set_location(' Leaving:'|| l_proc, 20);
1519   --
1520   return l_legislation_code;
1521   --
1522 end return_legislation_code;
1523 --
1524 end ben_lop_bus;