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