DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_CCP_BUS

Source


1 Package Body ben_ccp_bus as
2 /* $Header: beccprhi.pkb 120.1 2005/11/21 04:51:30 rbingi noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_ccp_bus.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------< chk_cvrd_dpnt_ctfn_prvdd_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 --   cvrd_dpnt_ctfn_prvdd_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_cvrd_dpnt_ctfn_prvdd_id(p_cvrd_dpnt_ctfn_prvdd_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_cvrd_dpnt_ctfn_prvdd_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_ccp_shd.api_updating
49     (p_effective_date              => p_effective_date,
50      p_cvrd_dpnt_ctfn_prvdd_id                => p_cvrd_dpnt_ctfn_prvdd_id,
51      p_object_version_number       => p_object_version_number);
52   --
53   if (l_api_updating
54      and nvl(p_cvrd_dpnt_ctfn_prvdd_id,hr_api.g_number)
55      <>  ben_ccp_shd.g_old_rec.cvrd_dpnt_ctfn_prvdd_id) then
56     --
57     -- raise error as PK has changed
58     --
59     ben_ccp_shd.constraint_error('BEN_CVRD_DPNT_PVD_PK');
60     --
61   elsif not l_api_updating then
62     --
63     -- check if PK is null
64     --
65     if p_cvrd_dpnt_ctfn_prvdd_id is not null then
66       --
67       -- raise error as PK is not null
68       --
69       ben_ccp_shd.constraint_error('BEN_CVRD_DPNT_PVD_PK');
70       --
71     end if;
72     --
73   end if;
74   --
75   hr_utility.set_location('Leaving:'||l_proc, 10);
76   --
77 End chk_cvrd_dpnt_ctfn_prvdd_id;
78 --
79 -- ----------------------------------------------------------------------------
80 -- |------< chk_dpnt_dsgn_ctfn_rqd_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 --   cvrd_dpnt_ctfn_prvdd_id PK of record being inserted or updated.
91 --   dpnt_dsgn_ctfn_rqd_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_dpnt_dsgn_ctfn_rqd_flag(p_cvrd_dpnt_ctfn_prvdd_id                in number,
106                             p_dpnt_dsgn_ctfn_rqd_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_dpnt_dsgn_ctfn_rqd_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_ccp_shd.api_updating
118     (p_cvrd_dpnt_ctfn_prvdd_id                => p_cvrd_dpnt_ctfn_prvdd_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_dpnt_dsgn_ctfn_rqd_flag
124       <> nvl(ben_ccp_shd.g_old_rec.dpnt_dsgn_ctfn_rqd_flag,hr_api.g_varchar2)
125       or not l_api_updating) then
126     --
127     -- check if value of lookup falls within lookup type.
128     --
129     --
130     if hr_api.not_exists_in_hr_lookups
131           (p_lookup_type    => 'YES_NO',
132            p_lookup_code    => p_dpnt_dsgn_ctfn_rqd_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_dpnt_dsgn_ctfn_rqd_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_dpnt_dsgn_ctfn_rqd_flag;
149 --
150 -- ----------------------------------------------------------------------------
151 -- |------< chk_dpnt_dsgn_ctfn_typ_cd >------|
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 --   cvrd_dpnt_ctfn_prvdd_id PK of record being inserted or updated.
162 --   dpnt_dsgn_ctfn_typ_cd 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_dpnt_dsgn_ctfn_typ_cd(p_cvrd_dpnt_ctfn_prvdd_id     in number,
177                                     p_dpnt_dsgn_ctfn_typ_cd       in varchar2,
178                                     p_elig_cvrd_dpnt_id           in varchar2,
179                                     p_prtt_enrt_actn_id           in varchar2,
180                                     p_effective_date              in date,
181                                     p_validation_start_date       in date,
182                                     p_validation_end_date         in date,
183                                     p_business_group_id           in number,
184                                     p_object_version_number       in number) is
185   --
186   l_proc         varchar2(72) := g_package||'chk_dpnt_dsgn_ctfn_typ_cd';
187   l_api_updating boolean;
188   l_exists       varchar2(1);
189   --
190   cursor c3 is
191      select null
192        from ben_cvrd_dpnt_ctfn_prvdd_f ccp,
193             ben_prtt_enrt_actn_f pea,
194             ben_per_in_ler pil
195          where ccp.elig_cvrd_dpnt_id = p_elig_cvrd_dpnt_id
196            and ccp.dpnt_dsgn_ctfn_typ_cd = p_dpnt_dsgn_ctfn_typ_cd
197            and pea.prtt_enrt_actn_id = p_prtt_enrt_actn_id
198            and pea.prtt_enrt_actn_id = ccp.prtt_enrt_actn_id
199            and pil.per_in_ler_id = pea.per_in_ler_id
200            and pil.per_in_ler_stat_cd not in ('BCKDT', 'VOIDD')
201            and ccp.cvrd_dpnt_ctfn_prvdd_id <> nvl(p_cvrd_dpnt_ctfn_prvdd_id, hr_api.g_number)
202            and ccp.business_group_id  = p_business_group_id
203            and p_effective_date between pea.effective_start_date
204                                     and pea.effective_end_date
205            and p_validation_start_date <= ccp.effective_end_date
206            and p_validation_end_date >= ccp.effective_start_date
207 
208            ;
209   --
210   --
211 Begin
212   --
213   hr_utility.set_location('Entering:'||l_proc, 5);
214   --
215   l_api_updating := ben_ccp_shd.api_updating
216     (p_cvrd_dpnt_ctfn_prvdd_id                => p_cvrd_dpnt_ctfn_prvdd_id,
217      p_effective_date              => p_effective_date,
218      p_object_version_number       => p_object_version_number);
219   --
220   if (l_api_updating
221       and p_dpnt_dsgn_ctfn_typ_cd
222       <> nvl(ben_ccp_shd.g_old_rec.dpnt_dsgn_ctfn_typ_cd,hr_api.g_varchar2)
223       or not l_api_updating) then
224     --
225     -- check if value of lookup falls within lookup type.
226     --
227     --
228     if hr_api.not_exists_in_hr_lookups
229           (p_lookup_type    => 'BEN_DPNT_CVG_CTFN_TYP',
230            p_lookup_code    => p_dpnt_dsgn_ctfn_typ_cd,
231            p_effective_date => p_effective_date) then
232       --
233       -- raise error as does not exist as lookup
234       --
235       fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
236       fnd_message.set_token('FIELD','p_dpnt_dsgn_ctfn_typ_cd');
237       fnd_message.set_token('TYPE','BEN_DPNT_CVG_CTFN_TYP');
238       fnd_message.raise_error;
239       --
240     end if;
241     --
242     open c3;
243     fetch c3 into l_exists;
244     if c3%found then
245       close c3;
246       --
247       -- raise error as this ctfn row already exists for this beneficiary
248     --
249      fnd_message.set_name('BEN', 'BEN_91632_DUP_DPNT_CTFN');
250      fnd_message.raise_error;
251     --
252     end if;
253     close c3;
254     --
255     --
256   end if;
257   --
258   hr_utility.set_location('Leaving:'||l_proc,10);
259   --
260 end chk_dpnt_dsgn_ctfn_typ_cd;
261 
262 
263 --
264 -- ----------------------------------------------------------------------------
265 -- |------< chk_dpnt_dsgn_ctfn_recd_dt >------|
266 -- ----------------------------------------------------------------------------
267 --
268 -- Description
269 --  This procedure is used to check that the received date is not less
270 --   than the effective start date. W
271 --  Will be called only from UPDATE API.
272 --
273 -- Pre Conditions
274 --   None.
275 --
276 -- In Parameters
277 --   prtt_enrt_ctfn_prvdd_id PK of record being inserted or updated.
278 --   dpnt_dsgn_ctfn_recd_dt received date.
279 --   effective_date effective date.
280 --   object_version_number Object version number of record being
281 --                         inserted or updated.
282 --
283 -- Post Success
284 --   Processing continues
285 --
286 -- Post Failure
287 --   Error handled by procedure
288 --
289 -- Access Status
290 --   Internal table handler use only.
291 --
292 Procedure chk_dpnt_dsgn_ctfn_recd_dt(
293                      p_cvrd_dpnt_ctfn_prvdd_id in number,
294                      p_effective_date          in date,
295 				     p_dpnt_dsgn_ctfn_recd_dt  in date,
296                      p_validation_start_date   in date,
297                      p_object_version_number   in number) is
298   --
299   -- 4740223, Added parameters cvrd_dpnt_ctfb_prvdd_id, eff_dt,
300   -- OVN to the procedure
301   l_proc  varchar2(72) := g_package||'chk_dpnt_dsgn_ctfn_recd_dt';
302   l_api_updating boolean;
303   --
304   --
305 Begin
306   --
307   hr_utility.set_location('Entering:'||l_proc, 5);
308   l_api_updating := ben_ccp_shd.api_updating
309     (p_cvrd_dpnt_ctfn_prvdd_id     => p_cvrd_dpnt_ctfn_prvdd_id,
310      p_effective_date              => p_effective_date,
311      p_object_version_number       => p_object_version_number);
312   --
313   if (l_api_updating
314       and p_dpnt_dsgn_ctfn_recd_dt
315       <> nvl(ben_ccp_shd.g_old_rec.dpnt_dsgn_ctfn_recd_dt,hr_api.g_date)
316       or not l_api_updating) then
317     --
318     -- check if received date < than efective start date. .
319     --
320      if p_dpnt_dsgn_ctfn_recd_dt < p_validation_start_date then
321       --
322       fnd_message.set_name('BEN','BEN_94211_DPNT_CTFN_RECD_DT');
323       fnd_message.raise_error;
324       --
325      end if;
326     --
327   End If;
328   hr_utility.set_location('Leaving:'||l_proc,10);
329   --
330 end chk_dpnt_dsgn_ctfn_recd_dt;
331 --
332 --
333 -- ----------------------------------------------------------------------------
334 -- |--------------------------< dt_update_validate >--------------------------|
335 -- ----------------------------------------------------------------------------
336 -- {Start Of Comments}
337 --
338 -- Description:
339 --   This procedure is used for referential integrity of datetracked
340 --   parent entities when a datetrack update operation is taking place
341 --   and where there is no cascading of update defined for this entity.
342 --
343 -- Prerequisites:
344 --   This procedure is called from the update_validate.
345 --
346 -- In Parameters:
347 --
348 -- Post Success:
349 --   Processing continues.
350 --
351 -- Post Failure:
352 --
353 -- Developer Implementation Notes:
354 --   This procedure should not need maintenance unless the HR Schema model
355 --   changes.
356 --
357 -- Access Status:
358 --   Internal Row Handler Use Only.
359 --
360 -- {End Of Comments}
361 -- ----------------------------------------------------------------------------
362 Procedure dt_update_validate
363             (p_elig_cvrd_dpnt_id             in number default hr_api.g_number,
364              p_prtt_enrt_actn_id             in number default hr_api.g_number,
365 	     p_datetrack_mode		     in varchar2,
366              p_validation_start_date	     in date,
367 	     p_validation_end_date	     in date) Is
368 --
369   l_proc	    varchar2(72) := g_package||'dt_update_validate';
370   l_integrity_error Exception;
371   l_table_name	    all_tables.table_name%TYPE;
372 --
373 Begin
374   hr_utility.set_location('Entering:'||l_proc, 5);
375   --
376   -- Ensure that the p_datetrack_mode argument is not null
377   --
378   hr_api.mandatory_arg_error
379     (p_api_name       => l_proc,
380      p_argument       => 'datetrack_mode',
381      p_argument_value => p_datetrack_mode);
382   --
383   -- Only perform the validation if the datetrack update mode is valid
384   --
385   If (dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode)) then
386     --
387     --
388     -- Ensure the arguments are not null
389     --
390     hr_api.mandatory_arg_error
391       (p_api_name       => l_proc,
392        p_argument       => 'validation_start_date',
393        p_argument_value => p_validation_start_date);
394     --
395     hr_api.mandatory_arg_error
396       (p_api_name       => l_proc,
397        p_argument       => 'validation_end_date',
398        p_argument_value => p_validation_end_date);
399     --
400     If ((nvl(p_elig_cvrd_dpnt_id, hr_api.g_number) <> hr_api.g_number) and
401       NOT (dt_api.check_min_max_dates
402             (p_base_table_name => 'ben_elig_cvrd_dpnt_f',
403              p_base_key_column => 'elig_cvrd_dpnt_id',
404              p_base_key_value  => p_elig_cvrd_dpnt_id,
405              p_from_date       => p_validation_start_date,
406              p_to_date         => p_validation_end_date)))  Then
407       l_table_name := 'ben_elig_cvrd_dpnt_f';
408       Raise l_integrity_error;
409     End If;
410     If ((nvl(p_prtt_enrt_actn_id, hr_api.g_number) <> hr_api.g_number) and
411       NOT (dt_api.check_min_max_dates
412             (p_base_table_name => 'ben_prtt_enrt_actn_f',
413              p_base_key_column => 'prtt_enrt_actn_id',
414              p_base_key_value  => p_prtt_enrt_actn_id,
418       Raise l_integrity_error;
415              p_from_date       => p_validation_start_date,
416              p_to_date         => p_validation_end_date)))  Then
417       l_table_name := 'ben_prtt_enrt_actn_f';
419     End If;
420     --
421   End If;
422   --
423   hr_utility.set_location(' Leaving:'||l_proc, 10);
424 Exception
425   When l_integrity_error Then
426     --
427     -- A referential integrity check was violated therefore
428     -- we must error
429     --
430        ben_utility.parent_integrity_error(p_table_name => l_table_name);
431     --
432   When Others Then
433     --
434     -- An unhandled or unexpected error has occurred which
435     -- we must report
436     --
437     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
438     fnd_message.set_token('PROCEDURE', l_proc);
439     fnd_message.set_token('STEP','15');
440     fnd_message.raise_error;
441 End dt_update_validate;
442 --
443 -- ----------------------------------------------------------------------------
444 -- |--------------------------< dt_delete_validate >--------------------------|
445 -- ----------------------------------------------------------------------------
446 -- {Start Of Comments}
447 --
448 -- Description:
449 --   This procedure is used for referential integrity of datetracked
450 --   child entities when either a datetrack DELETE or ZAP is in operation
451 --   and where there is no cascading of delete defined for this entity.
452 --   For the datetrack mode of DELETE or ZAP we must ensure that no
453 --   datetracked child rows exist between the validation start and end
454 --   dates.
455 --
456 -- Prerequisites:
457 --   This procedure is called from the delete_validate.
458 --
459 -- In Parameters:
460 --
461 -- Post Success:
462 --   Processing continues.
463 --
464 -- Post Failure:
465 --   If a row exists by determining the returning Boolean value from the
466 --   generic dt_api.rows_exist function then we must supply an error via
467 --   the use of the local exception handler l_rows_exist.
468 --
469 -- Developer Implementation Notes:
470 --   This procedure should not need maintenance unless the HR Schema model
471 --   changes.
472 --
473 -- Access Status:
474 --   Internal Row Handler Use Only.
475 --
476 -- {End Of Comments}
477 -- ----------------------------------------------------------------------------
478 Procedure dt_delete_validate
479             (p_cvrd_dpnt_ctfn_prvdd_id		in number,
480              p_datetrack_mode		in varchar2,
481 	     p_validation_start_date	in date,
482 	     p_validation_end_date	in date) Is
483 --
484   l_proc	varchar2(72) 	:= g_package||'dt_delete_validate';
485   l_rows_exist	Exception;
486   l_table_name	all_tables.table_name%TYPE;
487 --
488 Begin
489   hr_utility.set_location('Entering:'||l_proc, 5);
490   --
491   -- Ensure that the p_datetrack_mode argument is not null
492   --
493   hr_api.mandatory_arg_error
494     (p_api_name       => l_proc,
495      p_argument       => 'datetrack_mode',
496      p_argument_value => p_datetrack_mode);
497   --
498   -- Only perform the validation if the datetrack mode is either
499   -- DELETE or ZAP
500   --
501   If (p_datetrack_mode = 'DELETE' or
502       p_datetrack_mode = 'ZAP') then
503     --
504     --
505     -- Ensure the arguments are not null
506     --
507     hr_api.mandatory_arg_error
508       (p_api_name       => l_proc,
509        p_argument       => 'validation_start_date',
510        p_argument_value => p_validation_start_date);
511     --
512     hr_api.mandatory_arg_error
513       (p_api_name       => l_proc,
514        p_argument       => 'validation_end_date',
515        p_argument_value => p_validation_end_date);
516     --
517     hr_api.mandatory_arg_error
518       (p_api_name       => l_proc,
519        p_argument       => 'cvrd_dpnt_ctfn_prvdd_id',
520        p_argument_value => p_cvrd_dpnt_ctfn_prvdd_id);
521     --
522     --
523     --
524   End If;
525   --
526   hr_utility.set_location(' Leaving:'||l_proc, 10);
527 Exception
528   When l_rows_exist Then
529     --
530     -- A referential integrity check was violated therefore
531     -- we must error
532     --
533        ben_utility.child_exists_error(p_table_name => l_table_name);
534     --
535   When Others Then
536     --
537     -- An unhandled or unexpected error has occurred which
538     -- we must report
539     --
540     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
541     fnd_message.set_token('PROCEDURE', l_proc);
542     fnd_message.set_token('STEP','15');
543     fnd_message.raise_error;
544 End dt_delete_validate;
545 --
546 -- ----------------------------------------------------------------------------
547 -- |---------------------------< insert_validate >----------------------------|
548 -- ----------------------------------------------------------------------------
549 Procedure insert_validate
550 	(p_rec 			 in ben_ccp_shd.g_rec_type,
551 	 p_effective_date	 in date,
552 	 p_datetrack_mode	 in varchar2,
553 	 p_validation_start_date in date,
554 	 p_validation_end_date	 in date) is
555 --
556   l_proc	varchar2(72) := g_package||'insert_validate';
560   --
557 --
558 Begin
559   hr_utility.set_location('Entering:'||l_proc, 5);
561   -- Call all supporting business operations
562   --
563   --
564   hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate Bus Grp
565   --
566   chk_cvrd_dpnt_ctfn_prvdd_id
567   (p_cvrd_dpnt_ctfn_prvdd_id          => p_rec.cvrd_dpnt_ctfn_prvdd_id,
568    p_effective_date        => p_effective_date,
569    p_object_version_number => p_rec.object_version_number);
570   --
571   chk_dpnt_dsgn_ctfn_rqd_flag
572   (p_cvrd_dpnt_ctfn_prvdd_id          => p_rec.cvrd_dpnt_ctfn_prvdd_id,
573    p_dpnt_dsgn_ctfn_rqd_flag         => p_rec.dpnt_dsgn_ctfn_rqd_flag,
574    p_effective_date        => p_effective_date,
575    p_object_version_number => p_rec.object_version_number);
576   --
577   chk_dpnt_dsgn_ctfn_typ_cd
578   (p_cvrd_dpnt_ctfn_prvdd_id   => p_rec.cvrd_dpnt_ctfn_prvdd_id,
579    p_dpnt_dsgn_ctfn_typ_cd     => p_rec.dpnt_dsgn_ctfn_typ_cd,
580    p_elig_cvrd_dpnt_id         => p_rec.elig_cvrd_dpnt_id,
581    p_prtt_enrt_actn_id         => p_rec.prtt_enrt_actn_id,
582    p_effective_date            => p_effective_date,
583    p_validation_start_date     => p_validation_start_date,
584    p_validation_end_date       => p_validation_end_date,
585    p_business_group_id         => p_rec.business_group_id,
586    p_object_version_number     => p_rec.object_version_number);
587   --
588   /* 4740223, Commented check in create API, coz the prvdd_dt can be
589    < eff_strt_dt in case of Carry forward or recycle dependent.
590    But such 'Update' is not allowed through the form.
591    --
592    chk_dpnt_dsgn_ctfn_recd_dt
593    ( p_dpnt_dsgn_ctfn_recd_dt  => p_rec.dpnt_dsgn_ctfn_recd_dt,
594      p_validation_start_date  => p_validation_start_date
595     );
596   rbingi */
597   --
598   hr_utility.set_location(' Leaving:'||l_proc, 10);
599 End insert_validate;
600 --
601 -- ----------------------------------------------------------------------------
602 -- |---------------------------< update_validate >----------------------------|
603 -- ----------------------------------------------------------------------------
604 Procedure update_validate
605 	(p_rec 			 in ben_ccp_shd.g_rec_type,
606 	 p_effective_date	 in date,
607 	 p_datetrack_mode	 in varchar2,
608 	 p_validation_start_date in date,
609 	 p_validation_end_date	 in date) is
610 --
611   l_proc	varchar2(72) := g_package||'update_validate';
612 --
613 Begin
614   hr_utility.set_location('Entering:'||l_proc, 5);
615   --
616   -- Call all supporting business operations
617   --
618   --
619   hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate Bus Grp
620   --
621   chk_cvrd_dpnt_ctfn_prvdd_id
622   (p_cvrd_dpnt_ctfn_prvdd_id          => p_rec.cvrd_dpnt_ctfn_prvdd_id,
623    p_effective_date        => p_effective_date,
624    p_object_version_number => p_rec.object_version_number);
625   --
626   chk_dpnt_dsgn_ctfn_rqd_flag
627   (p_cvrd_dpnt_ctfn_prvdd_id          => p_rec.cvrd_dpnt_ctfn_prvdd_id,
628    p_dpnt_dsgn_ctfn_rqd_flag         => p_rec.dpnt_dsgn_ctfn_rqd_flag,
629    p_effective_date        => p_effective_date,
630    p_object_version_number => p_rec.object_version_number);
631   --
632   chk_dpnt_dsgn_ctfn_typ_cd
633   (p_cvrd_dpnt_ctfn_prvdd_id   => p_rec.cvrd_dpnt_ctfn_prvdd_id,
634    p_dpnt_dsgn_ctfn_typ_cd     => p_rec.dpnt_dsgn_ctfn_typ_cd,
635    p_elig_cvrd_dpnt_id         => p_rec.elig_cvrd_dpnt_id,
636    p_prtt_enrt_actn_id         => p_rec.prtt_enrt_actn_id,
637    p_effective_date            => p_effective_date,
638    p_validation_start_date     => p_validation_start_date,
639    p_validation_end_date       => p_validation_end_date,
640    p_business_group_id         => p_rec.business_group_id,
641    p_object_version_number     => p_rec.object_version_number);
642   --
643   -- 4740223, Added parameters cvrd_dpnt_ctfb_prvdd_id, eff_dt,
644   -- ovn to the following call
645   --
646    chk_dpnt_dsgn_ctfn_recd_dt
647    (p_cvrd_dpnt_ctfn_prvdd_id => p_rec.cvrd_dpnt_ctfn_prvdd_id,
648     p_effective_date          => p_effective_date,
649     p_dpnt_dsgn_ctfn_recd_dt  => p_rec.dpnt_dsgn_ctfn_recd_dt,
650     p_validation_start_date   => p_validation_start_date,
651     p_object_version_number   => p_rec.object_version_number);
652   --
653   -- Call the datetrack update integrity operation
654   --
655   dt_update_validate
656     (p_elig_cvrd_dpnt_id             => p_rec.elig_cvrd_dpnt_id,
657      p_prtt_enrt_actn_id             => p_rec.prtt_enrt_actn_id,
658      p_datetrack_mode                => p_datetrack_mode,
659      p_validation_start_date	     => p_validation_start_date,
660      p_validation_end_date	     => p_validation_end_date);
661   --
662   hr_utility.set_location(' Leaving:'||l_proc, 10);
663 End update_validate;
664 --
665 -- ----------------------------------------------------------------------------
666 -- |---------------------------< delete_validate >----------------------------|
667 -- ----------------------------------------------------------------------------
668 Procedure delete_validate
669 	(p_rec 			 in ben_ccp_shd.g_rec_type,
670 	 p_effective_date	 in date,
671 	 p_datetrack_mode	 in varchar2,
672 	 p_validation_start_date in date,
673 	 p_validation_end_date	 in date) is
674 --
675   l_proc	varchar2(72) := g_package||'delete_validate';
676 --
677 Begin
678   hr_utility.set_location('Entering:'||l_proc, 5);
679   --
680   -- Call all supporting business operations
681   --
682   dt_delete_validate
683     (p_datetrack_mode		=> p_datetrack_mode,
684      p_validation_start_date	=> p_validation_start_date,
685      p_validation_end_date	=> p_validation_end_date,
686      p_cvrd_dpnt_ctfn_prvdd_id		=> p_rec.cvrd_dpnt_ctfn_prvdd_id);
687   --
688   hr_utility.set_location(' Leaving:'||l_proc, 10);
689 End delete_validate;
690 --
691 --
692 --  ---------------------------------------------------------------------------
693 --  |---------------------< return_legislation_code >-------------------------|
694 --  ---------------------------------------------------------------------------
695 --
696 function return_legislation_code
697   (p_cvrd_dpnt_ctfn_prvdd_id in number) return varchar2 is
698   --
699   -- Declare cursor
700   --
701   cursor csr_leg_code is
702     select a.legislation_code
703     from   per_business_groups a,
704            ben_cvrd_dpnt_ctfn_prvdd_f b
705     where b.cvrd_dpnt_ctfn_prvdd_id      = p_cvrd_dpnt_ctfn_prvdd_id
706     and   a.business_group_id = b.business_group_id;
707   --
708   -- Declare local variables
709   --
710   l_legislation_code  varchar2(150);
711   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
712   --
713 begin
714   --
715   hr_utility.set_location('Entering:'|| l_proc, 10);
716   --
717   -- Ensure that all the mandatory parameter are not null
718   --
719   hr_api.mandatory_arg_error(p_api_name       => l_proc,
720                              p_argument       => 'cvrd_dpnt_ctfn_prvdd_id',
721                              p_argument_value => p_cvrd_dpnt_ctfn_prvdd_id);
722   --
723   open csr_leg_code;
724     --
725     fetch csr_leg_code into l_legislation_code;
726     --
727     if csr_leg_code%notfound then
728       --
729       close csr_leg_code;
730       --
731       -- The primary key is invalid therefore we must error
732       --
733       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
734       fnd_message.raise_error;
735       --
736     end if;
737     --
738   close csr_leg_code;
739   --
740   hr_utility.set_location(' Leaving:'|| l_proc, 20);
741   --
742   return l_legislation_code;
743   --
744 end return_legislation_code;
745 --
746 end ben_ccp_bus;
747