DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_ECT_BUS

Source


1 Package Body ben_ect_bus as
2 /* $Header: beectrhi.pkb 120.0 2005/05/28 01:54:16 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_ect_bus.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------< chk_elig_dsblty_ctg_prte_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 --   elig_dsblty_ctg_prte_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_elig_dsblty_ctg_prte_id(p_elig_dsblty_ctg_prte_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_elig_dsblty_ctg_prte_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_ect_shd.api_updating
49     (p_effective_date              => p_effective_date,
50      p_elig_dsblty_ctg_prte_id                => p_elig_dsblty_ctg_prte_id,
51      p_object_version_number       => p_object_version_number);
52   --
53   if (l_api_updating
54      and nvl(p_elig_dsblty_ctg_prte_id,hr_api.g_number)
55      <>  ben_ect_shd.g_old_rec.elig_dsblty_ctg_prte_id) then
56     --
57     -- raise error as PK has changed
58     --
59     ben_ect_shd.constraint_error('BEN_ELIG_PER_TYP_PK');
60     --
61   elsif not l_api_updating then
62     --
63     -- check if PK is null
64     --
65     if p_elig_dsblty_ctg_prte_id is not null then
66       --
67       -- raise error as PK is not null
68       --
69       ben_ect_shd.constraint_error('BEN_ELIG_PER_TYP_PK');
70       --
71     end if;
72     --
73   end if;
74   --
75   hr_utility.set_location('Leaving:'||l_proc, 10);
76   --
77 End chk_elig_dsblty_ctg_prte_id;
78 --
79 --
80 /*-- ----------------------------------------------------------------------------
81 -- |------< chk_person_type_id >------|
82 -- ----------------------------------------------------------------------------
83 --
84 -- Description
85 --   This procedure checks that a referenced foreign key actually exists
86 --   in the referenced table.
87 --   Additionally this procedure will check that person_type_id is unique
88 --   within the Eligibility profile.
89 --   This procedure will also check that Per type of 'not Employee'
90 --   can not be set for any profile for which the following eligibility
91 --   factors are present: grade, assignment set, org unit, barg unit,
92 --   percent full time, job, ....
93 --
94 -- Pre-Conditions
95 --   None.
96 --
97 -- In Parameters
98 --   p_elig_dsblty_ctg_prte_id PK
99 --   p_category   ID of FK column
100 --   p_eligy_prfl_id
101 --   p_business_group_id
102 --   p_effective_date session date
103 --   p_object_version_number object version number
104 --
105 --
106 -- Post Success
107 --   Processing continues
108 --
109 -- Post Failure
110 --   Error raised.
111 --
112 -- Access Status
113 --   Internal table handler use only.
114 --
115 Procedure chk_person_type_id (p_elig_dsblty_ctg_prte_id  in number,
116                               p_category            in varchar2,
117                               p_eligy_prfl_id         in number,
118                               p_excld_flag            in varchar2,
119                               p_validation_start_date in date,
120                               p_validation_end_date   in date,
121                               p_business_group_id     in number,
122                               p_effective_date        in date,
123                               p_object_version_number in number) is
124   --
125   l_proc         varchar2(72) := g_package||'chk_person_type_id';
126   l_api_updating boolean;
127   l_system_person_type        varchar2(30);
128   l_dummy                     varchar2(1);
129   l_exists       varchar2(1);
130   --
131   --
132   cursor c3 is
133      select null
134        from ben_elig_dsblty_ctg_prte_f
135          where category = p_category
136            and eligy_prfl_id = p_eligy_prfl_id
137            and elig_dsblty_ctg_prte_id <> nvl(p_elig_dsblty_ctg_prte_id,hr_api.g_number)
138            and business_group_id + 0 = p_business_group_id
139            and p_validation_start_date <= effective_end_date
140            and p_validation_end_date >= effective_start_date
141            ;
142   --
143   cursor c1 is
144     select system_person_type
145     from   per_person_types a
146     where  a.person_type_id =to_number( p_category)
147            and a.business_group_id = p_business_group_id;
148   --
149   cursor c2 is
150     select null from ben_elig_asnt_set_prte_f a where a.eligy_prfl_id = p_eligy_prfl_id
151       union
152     select null from ben_elig_grd_prte_f a where a.eligy_prfl_id = p_eligy_prfl_id
153       union
154     select null from ben_elig_org_unit_prte_f a where a.eligy_prfl_id = p_eligy_prfl_id
155       union
156     select null from ben_elig_brgng_unit_prte_f a where a.eligy_prfl_id = p_eligy_prfl_id
157       union
158     select null from ben_elig_pct_fl_tm_prte_f a where a.eligy_prfl_id = p_eligy_prfl_id
159       union
160     select null from ben_elig_hrly_slrd_prte_f a where a.eligy_prfl_id = p_eligy_prfl_id
161       union
162     select null from ben_elig_comp_lvl_prte_f a where a.eligy_prfl_id = p_eligy_prfl_id
163       union
164     select null from ben_elig_los_prte_f a where a.eligy_prfl_id = p_eligy_prfl_id
165       union
166     select null from ben_elig_cmbn_age_los_prte_f a where a.eligy_prfl_id = p_eligy_prfl_id
167       union
168     select null from ben_elig_loa_rsn_prte_f a where a.eligy_prfl_id = p_eligy_prfl_id
169       union
170     select null from ben_elig_hrs_wkd_prte_f a where a.eligy_prfl_id = p_eligy_prfl_id
171       union
172     select null from ben_elig_wk_loc_prte_f a where a.eligy_prfl_id = p_eligy_prfl_id
173       union
174     select null from ben_elig_lbr_mmbr_prte_f a where a.eligy_prfl_id = p_eligy_prfl_id
175       union
176     select null from ben_elig_pyrl_prte_f a where a.eligy_prfl_id = p_eligy_prfl_id
177       union
178     select null from ben_elig_schedd_hrs_prte_f a where a.eligy_prfl_id = p_eligy_prfl_id
179       union
180     select null from ben_elig_py_bss_prte_f a where a.eligy_prfl_id = p_eligy_prfl_id;
181   --
182 Begin
183   --
184   hr_utility.set_location('Entering:'||l_proc,5);
185   --
186   l_api_updating := ben_ect_shd.api_updating
187      (p_elig_dsblty_ctg_prte_id    => p_elig_dsblty_ctg_prte_id,
188       p_effective_date          => p_effective_date,
189       p_object_version_number   => p_object_version_number);
190   --
191   if (l_api_updating
192      and nvl(p_category,hr_api.g_number)
193      <> nvl(ben_ect_shd.g_old_rec.category,hr_api.g_number)
194      or not l_api_updating) then
195     --
196     -- check if category value exists in per_person_types table
197     --
198     open c1;
199       --
200       fetch c1 into l_system_person_type;
201       if c1%notfound then
202         --
203         close c1;
204         --
205         -- raise error as FK does not relate to PK in per_person_types
206         -- table.
207         --
208         ben_ect_shd.constraint_error('BEN_ELIG_PER_TYP_PRTE_FK2');
209         --
210       end if;
211       --
212     close c1;
213     --
214     --
215     open c3;
216     fetch c3 into l_exists;
217     if c3%found then
218       close c3;
219       --
220       -- raise error as this per type already exists for this profile
221     --
222      fnd_message.set_name('BEN', 'BEN_91349_DUP_ELIG_CRITERIA');
223      fnd_message.raise_error;
224     --
225     end if;
226     close c3;
227     --
228     -- additionally check rules for not Employee
229     --
230     if (l_system_person_type <> 'EMP' and l_system_person_type <> 'EMP_APL'
231         and p_excld_flag = 'N') then
232        open c2;
233        fetch c2 into l_dummy;
234       if c2%found then
235         --
236         close c2;
237         --
238         -- raise error as person type can not be set to not employee
239         -- need to create message
240         -- ben_ect_shd.constraint_error('BEN_ELIG_PER_TYP_PRTE_FK2');
241            fnd_message.set_name('BEN', 'BEN_91387_INV_PER_TYPE');
242            fnd_message.raise_error;
243         --
244       end if;
245       --
246     close c2;
247     end if;
248     --
249   end if;
250   --
251   hr_utility.set_location('Leaving:'||l_proc,10);
252   --
253 End chk_person_type_id;
254 --*/
255 -- ----------------------------------------------------------------------------
256 -- |------< chk_category >---------|
257 -- ----------------------------------------------------------------------------
258 --
259 -- Description
260 --   This procedure is used to check that the lookup value is valid.
261 --
262 -- Pre Conditions
263 -- None.
264 --
265 -- In Parameters
266 --   elig_dsblty_ctg_prte_id PK of record being inserted or updated.
267 --   category Value of lookup code.
268 --   effective_date effective date
269 --   object_version_number Object version number of record being
270 --                         inserted or updated.
271 --
272 -- Post Success
273 --   Processing continues
274 --
275 -- Post Failure
276 --  Error handled by procedure
277 --
278 -- Access Status
279 --   Internal table handler use only.
280 --
281 Procedure chk_category(p_elig_dsblty_ctg_prte_id	 in number,
282 		         p_category            in varchar2,
283 		         p_business_group_id     in number,
284 		         p_effective_date        in date,
285 		         p_object_version_number in number) is
286   --
287   l_proc         varchar2(72) := g_package||'chk_category';
288   l_api_updating boolean;
289   l_dummy        varchar2(1);
290   --
291   cursor c1 is
292     select null
293     from   per_person_types ppt
294     where  ppt.system_person_type = p_category
295     and    ppt.active_flag = 'Y'
296     and    ppt.business_group_id+0 = p_business_group_id;
297   --
298 Begin
299   --
300   hr_utility.set_location('Entering:'||l_proc, 5);
301   --
302   l_api_updating := ben_ect_shd.api_updating
303      (p_effective_date        =>p_effective_date,
304       p_elig_dsblty_ctg_prte_id  => p_elig_dsblty_ctg_prte_id,
305       p_object_version_number =>p_object_version_number);
306   --
307   if (l_api_updating
308       and p_category
309       <>nvl(ben_ect_shd.g_old_rec.category,hr_api.g_varchar2)
310       or not l_api_updating)
311       and p_category is not null then
312     --
313     open c1;
314       --
315       fetch c1 into l_dummy;
316       if c1%notfound then
317         --
318         -- Raise error as system person type can not be found
319         --
320         close c1;
321         fnd_message.set_name('PER','HR_7513_PER_TYPE_INVALID');
322         fnd_message.raise_error;
323         --
324       end if;
325       --
326     close c1;
327     --
328   end if;
329   --
330   hr_utility.set_location('Leaving:'||l_proc,10);
331   --
332 end chk_category;
333 --
334 -- ----------------------------------------------------------------------------
335 -- |------< chk_excld_flag >------|
336 -- ----------------------------------------------------------------------------
337 --
338 -- Description
339 --   This procedure is used to check that the lookup value is valid.
340 --
341 -- Pre Conditions
342 --   None.
343 --
344 -- In Parameters
345 --   elig_dsblty_ctg_prte_id PK of record being inserted or updated.
346 --   excld_flag Value of lookup code.
347 --   effective_date effective date
348 --   object_version_number Object version number of record being
349 --                         inserted or updated.
350 --
351 -- Post Success
352 --   Processing continues
353 --
354 -- Post Failure
355 --   Error handled by procedure
356 --
357 -- Access Status
358 --   Internal table handler use only.
359 --
360 Procedure chk_excld_flag(p_elig_dsblty_ctg_prte_id                in number,
361                             p_excld_flag               in varchar2,
362                             p_effective_date              in date,
363                             p_object_version_number       in number) is
364   --
365   l_proc         varchar2(72) := g_package||'chk_excld_flag';
366   l_api_updating boolean;
367   --
368 Begin
369   --
370   hr_utility.set_location('Entering:'||l_proc, 5);
371   --
372   l_api_updating := ben_ect_shd.api_updating
373     (p_elig_dsblty_ctg_prte_id                => p_elig_dsblty_ctg_prte_id,
377   if (l_api_updating
374      p_effective_date              => p_effective_date,
375      p_object_version_number       => p_object_version_number);
376   --
378       and p_excld_flag
379       <> nvl(ben_ect_shd.g_old_rec.excld_flag,hr_api.g_varchar2)
380       or not l_api_updating) then
381     --
382     -- check if value of lookup falls within lookup type.
383     --
384     --
385     if hr_api.not_exists_in_hr_lookups
386           (p_lookup_type    => 'YES_NO',
387            p_lookup_code    => p_excld_flag,
388            p_effective_date => p_effective_date) then
389       --
390       -- raise error as does not exist as lookup
391       --
392       fnd_message.set_name('PAY','HR_LOOKUP_DOES_NOT_EXIST');
393       fnd_message.raise_error;
394       --
395     end if;
396     --
397   end if;
398   --
399   hr_utility.set_location('Leaving:'||l_proc,10);
400   --
401 end chk_excld_flag;
402 --
403 -- ----------------------------------------------------------------------------
404 -- |--------------------------< dt_update_validate >--------------------------|
405 -- ----------------------------------------------------------------------------
406 -- {Start Of Comments}
407 --
408 -- Description:
409 --   This procedure is used for referential integrity of datetracked
410 --   parent entities when a datetrack update operation is taking place
411 --   and where there is no cascading of update defined for this entity.
412 --
413 -- Prerequisites:
414 --   This procedure is called from the update_validate.
415 --
416 -- In Parameters:
417 --
418 -- Post Success:
419 --   Processing continues.
420 --
421 -- Post Failure:
422 --
423 -- Developer Implementation Notes:
424 --   This procedure should not need maintenance unless the HR Schema model
425 --   changes.
426 --
427 -- Access Status:
428 --   Internal Row Handler Use Only.
429 --
430 -- {End Of Comments}
431 -- ----------------------------------------------------------------------------
432 Procedure dt_update_validate
433             (p_eligy_prfl_id                 in number default hr_api.g_number,
434 	     p_datetrack_mode		     in varchar2,
435              p_validation_start_date	     in date,
436 	     p_validation_end_date	     in date) Is
437 --
438   l_proc	    varchar2(72) := g_package||'dt_update_validate';
439   l_integrity_error Exception;
440   l_table_name	    all_tables.table_name%TYPE;
441 --
442 Begin
443   hr_utility.set_location('Entering:'||l_proc, 5);
444   --
445   -- Ensure that the p_datetrack_mode argument is not null
446   --
447   hr_api.mandatory_arg_error
448     (p_api_name       => l_proc,
449      p_argument       => 'datetrack_mode',
450      p_argument_value => p_datetrack_mode);
451   --
452   -- Only perform the validation if the datetrack update mode is valid
453   --
454   If (dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode)) then
455     --
456     --
457     -- Ensure the arguments are not null
458     --
459     hr_api.mandatory_arg_error
460       (p_api_name       => l_proc,
461        p_argument       => 'validation_start_date',
462        p_argument_value => p_validation_start_date);
463     --
464     hr_api.mandatory_arg_error
465       (p_api_name       => l_proc,
466        p_argument       => 'validation_end_date',
467        p_argument_value => p_validation_end_date);
468     --
469     If ((nvl(p_eligy_prfl_id, hr_api.g_number) <> hr_api.g_number) and
470       NOT (dt_api.check_min_max_dates
471             (p_base_table_name => 'ben_eligy_prfl_f',
472              p_base_key_column => 'eligy_prfl_id',
473              p_base_key_value  => p_eligy_prfl_id,
474              p_from_date       => p_validation_start_date,
475              p_to_date         => p_validation_end_date)))  Then
476       l_table_name := 'ben_eligy_prfl_f';
477       Raise l_integrity_error;
478     End If;
479     --
480   End If;
481   --
482   hr_utility.set_location(' Leaving:'||l_proc, 10);
483 Exception
484   When l_integrity_error Then
485     --
486     -- A referential integrity check was violated therefore
487     -- we must error
488     --
489     fnd_message.set_name('PAY', 'HR_7216_DT_UPD_INTEGRITY_ERR');
490     fnd_message.set_token('TABLE_NAME', l_table_name);
491     fnd_message.raise_error;
492   When Others Then
493     --
494     -- An unhandled or unexpected error has occurred which
495     -- we must report
496     --
497     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
498     fnd_message.set_token('PROCEDURE', l_proc);
499     fnd_message.set_token('STEP','15');
500     fnd_message.raise_error;
501 End dt_update_validate;
502 --
503 -- ----------------------------------------------------------------------------
504 -- |--------------------------< dt_delete_validate >--------------------------|
505 -- ----------------------------------------------------------------------------
506 -- {Start Of Comments}
507 --
508 -- Description:
509 --   This procedure is used for referential integrity of datetracked
510 --   child entities when either a datetrack DELETE or ZAP is in operation
514 --   dates.
511 --   and where there is no cascading of delete defined for this entity.
512 --   For the datetrack mode of DELETE or ZAP we must ensure that no
513 --   datetracked child rows exist between the validation start and end
515 --
516 -- Prerequisites:
517 --   This procedure is called from the delete_validate.
518 --
519 -- In Parameters:
520 --
521 -- Post Success:
522 --   Processing continues.
523 --
524 -- Post Failure:
525 --   If a row exists by determining the returning Boolean value from the
526 --   generic dt_api.rows_exist function then we must supply an error via
527 --   the use of the local exception handler l_rows_exist.
528 --
529 -- Developer Implementation Notes:
530 --   This procedure should not need maintenance unless the HR Schema model
531 --   changes.
532 --
533 -- Access Status:
534 --   Internal Row Handler Use Only.
535 --
536 -- {End Of Comments}
537 -- ----------------------------------------------------------------------------
538 Procedure dt_delete_validate
539             (p_elig_dsblty_ctg_prte_id		in number,
540              p_datetrack_mode		in varchar2,
541 	     p_validation_start_date	in date,
542 	     p_validation_end_date	in date) Is
543 --
544   l_proc	varchar2(72) 	:= g_package||'dt_delete_validate';
545   l_rows_exist	Exception;
546   l_table_name	all_tables.table_name%TYPE;
547 --
548 Begin
549   hr_utility.set_location('Entering:'||l_proc, 5);
550   --
551   -- Ensure that the p_datetrack_mode argument is not null
552   --
553   hr_api.mandatory_arg_error
554     (p_api_name       => l_proc,
555      p_argument       => 'datetrack_mode',
556      p_argument_value => p_datetrack_mode);
557   --
558   -- Only perform the validation if the datetrack mode is either
559   -- DELETE or ZAP
560   --
561   If (p_datetrack_mode = 'DELETE' or
562       p_datetrack_mode = 'ZAP') then
563     --
564     --
565     -- Ensure the arguments are not null
566     --
567     hr_api.mandatory_arg_error
568       (p_api_name       => l_proc,
569        p_argument       => 'validation_start_date',
570        p_argument_value => p_validation_start_date);
571     --
572     hr_api.mandatory_arg_error
573       (p_api_name       => l_proc,
574        p_argument       => 'validation_end_date',
575        p_argument_value => p_validation_end_date);
576     --
577     hr_api.mandatory_arg_error
578       (p_api_name       => l_proc,
579        p_argument       => 'elig_dsblty_ctg_prte_id',
580        p_argument_value => p_elig_dsblty_ctg_prte_id);
581     --
582     --
583     --
584   End If;
585   --
586   hr_utility.set_location(' Leaving:'||l_proc, 10);
587 Exception
588   When l_rows_exist Then
589     --
590     -- A referential integrity check was violated therefore
591     -- we must error
592     --
593     fnd_message.set_name('PAY', 'HR_7215_DT_CHILD_EXISTS');
594     fnd_message.set_token('TABLE_NAME', l_table_name);
595     fnd_message.raise_error;
596   When Others Then
597     --
598     -- An unhandled or unexpected error has occurred which
599     -- we must report
600     --
601     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
602     fnd_message.set_token('PROCEDURE', l_proc);
603     fnd_message.set_token('STEP','15');
604     fnd_message.raise_error;
605 End dt_delete_validate;
606 --
607 -- ----------------------------------------------------------------------------
608 -- |---------------------------< insert_validate >----------------------------|
609 -- ----------------------------------------------------------------------------
610 Procedure insert_validate
611 	(p_rec 			 in ben_ect_shd.g_rec_type,
612 	 p_effective_date	 in date,
613 	 p_datetrack_mode	 in varchar2,
614 	 p_validation_start_date in date,
615 	 p_validation_end_date	 in date) is
616 --
617   l_proc	varchar2(72) := g_package||'insert_validate';
618 --
619 Begin
620   hr_utility.set_location('Entering:'||l_proc, 5);
621   --
622   -- Call all supporting business operations
623   --
624   --
625   hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate Bus Grp
626   --
627   chk_elig_dsblty_ctg_prte_id
628   (p_elig_dsblty_ctg_prte_id          => p_rec.elig_dsblty_ctg_prte_id,
629    p_effective_date        => p_effective_date,
630    p_object_version_number => p_rec.object_version_number);
631   --
632   /*chk_person_type_id (p_elig_dsblty_ctg_prte_id  => p_rec.elig_dsblty_ctg_prte_id,
633                       p_per_typ_cd            => p_rec.per_typ_cd,
634                       p_eligy_prfl_id         => p_rec.eligy_prfl_id,
635                       p_excld_flag            => p_rec.excld_flag,
636                       p_validation_start_date => p_validation_start_date,
637                       p_validation_end_date   => p_validation_end_date,
638                       p_business_group_id     => p_rec.business_group_id,
639                       p_effective_date        => p_effective_date,
640                       p_object_version_number => p_rec.object_version_number);*/
641   --
642  /* --chk_category
643   (p_elig_dsblty_ctg_prte_id		=> p_rec.elig_dsblty_ctg_prte_id,
644    p_category				=> p_rec.category,
645    p_business_group_id			=> p_rec.business_group_id,
649   --
646    p_effective_date			=>p_effective_date,
647    p_object_version_number		=>p_rec.object_version_number);
648 */
650   chk_excld_flag
651   (p_elig_dsblty_ctg_prte_id  => p_rec.elig_dsblty_ctg_prte_id,
652    p_excld_flag            => p_rec.excld_flag,
653    p_effective_date        => p_effective_date,
654    p_object_version_number => p_rec.object_version_number);
655   --
656   hr_utility.set_location(' Leaving:'||l_proc, 10);
657 End insert_validate;
658 --
659 -- ----------------------------------------------------------------------------
660 -- |---------------------------< update_validate >----------------------------|
661 -- ----------------------------------------------------------------------------
662 Procedure update_validate
663 	(p_rec 			 in ben_ect_shd.g_rec_type,
664 	 p_effective_date	 in date,
665 	 p_datetrack_mode	 in varchar2,
666 	 p_validation_start_date in date,
667 	 p_validation_end_date	 in date) is
668 --
669   l_proc	varchar2(72) := g_package||'update_validate';
670 --
671 Begin
672   hr_utility.set_location('Entering:'||l_proc, 5);
673   --
674   -- Call all supporting business operations
675   --
676   --
677   hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate Bus Grp
678   --
679   chk_elig_dsblty_ctg_prte_id
680   (p_elig_dsblty_ctg_prte_id          => p_rec.elig_dsblty_ctg_prte_id,
681    p_effective_date        => p_effective_date,
682    p_object_version_number => p_rec.object_version_number);
683   --
684   /* chk_person_type_id (p_elig_per_typ_prte_id  => p_rec.elig_per_typ_prte_id,
685                        p_per_typ_cd            => p_rec.per_typ_cd,
686                        p_eligy_prfl_id         => p_rec.eligy_prfl_id,
687                        p_excld_flag            => p_rec.excld_flag,
688                        p_validation_start_date => p_validation_start_date,
689                        p_validation_end_date   => p_validation_end_date,
690                        p_business_group_id     => p_rec.business_group_id,
691                        p_effective_date        => p_effective_date,
692                        p_object_version_number => p_rec.object_version_number);*/
693 
694   /*chk_category
695   (p_elig_dsblty_ctg_prte_id	=> p_rec.elig_dsblty_ctg_prte_id,
696    p_category			=> p_rec.category,
697    p_business_group_id		=> p_rec.business_group_id,
698    p_effective_date		=>p_effective_date,
699    p_object_version_number	=>p_rec.object_version_number);
700   --
701 */
702   chk_excld_flag
703      (p_elig_dsblty_ctg_prte_id          => p_rec.elig_dsblty_ctg_prte_id,
704       p_excld_flag         => p_rec.excld_flag,
705       p_effective_date        => p_effective_date,
706       p_object_version_number => p_rec.object_version_number);
707   --
708   -- Call the datetrack update integrity operation
709   --
710   dt_update_validate
711     (p_eligy_prfl_id                 => p_rec.eligy_prfl_id,
712      p_datetrack_mode                => p_datetrack_mode,
713      p_validation_start_date	     => p_validation_start_date,
714      p_validation_end_date	     => p_validation_end_date);
715   --
716   hr_utility.set_location(' Leaving:'||l_proc, 10);
717 End update_validate;
718 --
719 -- ----------------------------------------------------------------------------
720 -- |---------------------------< delete_validate >----------------------------|
721 -- ----------------------------------------------------------------------------
722 Procedure delete_validate
723 	(p_rec 			 in ben_ect_shd.g_rec_type,
724 	 p_effective_date	 in date,
725 	 p_datetrack_mode	 in varchar2,
726 	 p_validation_start_date in date,
727 	 p_validation_end_date	 in date) is
728 --
729   l_proc	varchar2(72) := g_package||'delete_validate';
730 --
731 Begin
732   hr_utility.set_location('Entering:'||l_proc, 5);
733   --
734   -- Call all supporting business operations
735   --
736   dt_delete_validate
737     (p_datetrack_mode		=> p_datetrack_mode,
738      p_validation_start_date	=> p_validation_start_date,
739      p_validation_end_date	=> p_validation_end_date,
740      p_elig_dsblty_ctg_prte_id		=> p_rec.elig_dsblty_ctg_prte_id);
741   --
742   hr_utility.set_location(' Leaving:'||l_proc, 10);
743 End delete_validate;
744 --
745 --
746 --  ---------------------------------------------------------------------------
747 --  |---------------------< return_legislation_code >-------------------------|
748 --  ---------------------------------------------------------------------------
749 --
750 function return_legislation_code
751   (p_elig_dsblty_ctg_prte_id in number) return varchar2 is
752   --
753   -- Declare cursor
754   --
755   cursor csr_leg_code is
756     select a.legislation_code
757     from   per_business_groups a,
758            ben_elig_dsblty_ctg_prte_f b
759     where b.elig_dsblty_ctg_prte_id      = p_elig_dsblty_ctg_prte_id
760     and   a.business_group_id = b.business_group_id;
761   --
762   -- Declare local variables
763   --
764   l_legislation_code  varchar2(150);
765   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
766   --
767 begin
768   --
769   hr_utility.set_location('Entering:'|| l_proc, 10);
770   --
771   -- Ensure that all the mandatory parameter are not null
772   --
773   hr_api.mandatory_arg_error(p_api_name       => l_proc,
774                              p_argument       => 'elig_dsblty_ctg_prte_id',
775                              p_argument_value => p_elig_dsblty_ctg_prte_id);
776   --
777   open csr_leg_code;
778     --
779     fetch csr_leg_code into l_legislation_code;
780     --
781     if csr_leg_code%notfound then
782       --
783       close csr_leg_code;
784       --
785       -- The primary key is invalid therefore we must error
786       --
787       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
788       fnd_message.raise_error;
789       --
790     end if;
791     --
792   close csr_leg_code;
793   --
794   hr_utility.set_location(' Leaving:'|| l_proc, 20);
795   --
796   return l_legislation_code;
797   --
798 end return_legislation_code;
799 --
800 end ben_ect_bus;