DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_CAGR_CHECK_ELIGIBILITY

Source


1 package body ben_cagr_check_eligibility as
2 /* $Header: bendtlca.pkb 120.0 2005/05/28 04:15:31 appldev noship $ */
3 --
4 g_package varchar2(50) := 'ben_cagr_check_eligibility.';
5 g_rec                  benutils.g_batch_elig_rec;
6 --
7 procedure check_gndr_elig
8   (p_eligy_prfl_id     in number
9   ,p_score_compute_mode in boolean default false
10   ,p_profile_score_tab in out nocopy ben_evaluate_elig_profiles.scoreTab
11   ,p_effective_date    in date
12   ,p_per_sex           in varchar2
13   )
14 is
15   --
16   l_proc          varchar2(100) := g_package||'check_gndr_elig';
17   --
18   l_inst_set      ben_cagrelp_cache.g_elp_cache := ben_cagrelp_cache.g_elp_cache();
19   --
20   l_ok            boolean := false;
21   l_rows_found    boolean := false;
22   --
23   l_ele_num       pls_integer;
24   l_crit_passed     boolean;
25   l_score_tab       ben_evaluate_elig_profiles.scoreTab;
26   --
27 begin
28   --
29   hr_utility.set_location('Entering : '||l_proc,10);
30   --
31   ben_cagrelp_cache.elpegn_getdets
32     (p_effective_date => p_effective_date
33     ,p_eligy_prfl_id  => p_eligy_prfl_id
34     --
35     ,p_inst_set       => l_inst_set
36     );
37   --
38   if l_inst_set.count > 0 then
39     --
40     l_ele_num := 1;
41     --
42     for i in l_inst_set.first .. l_inst_set.last loop
43       --
44       l_ok := nvl((nvl(p_per_sex,'-1') = l_inst_set(l_ele_num).v230_val),FALSE);
45       --
46       if l_ok and l_inst_set(l_ele_num).excld_flag = 'N' then
47         --
48         if p_score_compute_mode then
49            if l_crit_passed is null then
50               l_crit_passed := true;
51            end if;
52            ben_evaluate_elig_profiles.write(l_score_tab,
53                  l_inst_set(l_ele_num).eligy_prfl_id,
54                  l_inst_set(l_ele_num).short_code,
55                  l_inst_set(l_ele_num).pk_id,
56                  nvl(l_inst_set(l_ele_num).criteria_score,
57                  l_inst_set(l_ele_num).criteria_weight));
58         else
59            exit;
60         end if;
61         --
62       elsif l_ok and l_inst_set(l_ele_num).excld_flag = 'Y' then
63         --
64         l_rows_found := true;
65         l_ok := false;
66         exit;
67         --
68       elsif (not l_ok) and l_inst_set(l_ele_num).excld_flag = 'Y' then
69         --
70         l_rows_found := true;
71         l_ok := true;
72         if p_score_compute_mode then
73            ben_evaluate_elig_profiles.write(l_score_tab,
74                  l_inst_set(l_ele_num).eligy_prfl_id,
75                  l_inst_set(l_ele_num).short_code,
76                  l_inst_set(l_ele_num).pk_id,
77                  nvl(l_inst_set(l_ele_num).criteria_score,
78                  l_inst_set(l_ele_num).criteria_weight));
79         end if;
80         --
81       elsif l_inst_set(l_ele_num).excld_flag = 'N' then
82         --
83         l_rows_found := true;
84         --
85       end if;
86       --
87       l_ele_num := l_ele_num+1;
88       --
89     end loop;
90     --
91   end if;
92   --
93   if l_crit_passed is null
94   then
95      if l_rows_found
96        and not l_ok
97      then
98        --
99        ben_evaluate_elig_profiles.g_inelg_rsn_cd := 'EGN';
100        fnd_message.set_name('BEN','BEN_92814_GNDR_PRFL_FAIL');
101        hr_utility.set_location('Criteria Failed: '||l_proc,20);
102        raise ben_evaluate_elig_profiles.g_criteria_failed;
103        --
104      end if;
105   end if;
106   --
107   if p_score_compute_mode
108   then
109      hr_utility.set_location('count '||l_score_tab.count,20);
110      ben_evaluate_elig_profiles.write(p_profile_score_tab,l_score_tab);
111   end if;
112   hr_utility.set_location('Leaving: '||l_proc,20);
113   --
114 end check_gndr_elig;
115 --
116 procedure check_mrtl_sts_elig
117   (p_eligy_prfl_id  in number
118   ,p_score_compute_mode in boolean default false
119   ,p_profile_score_tab in out nocopy ben_evaluate_elig_profiles.scoreTab
120   ,p_effective_date in date
121   ,p_per_mar_status   in varchar2
122   )
123 is
124   --
125   l_proc          varchar2(100) := g_package||'check_mrtl_sts_elig';
126   --
127   l_inst_set      ben_cagrelp_cache.g_elp_cache := ben_cagrelp_cache.g_elp_cache();
128   --
129   l_ok            boolean := false;
130   l_rows_found    boolean := false;
131   --
132   l_ele_num       pls_integer;
133   --
134   l_crit_passed     boolean;
135   l_score_tab       ben_evaluate_elig_profiles.scoreTab;
136 begin
137   --
138   hr_utility.set_location('Entering : '||l_proc,10);
139   --
140   ben_cagrelp_cache.elpemp_getdets
141     (p_effective_date => p_effective_date
142     ,p_eligy_prfl_id  => p_eligy_prfl_id
143     --
144     ,p_inst_set       => l_inst_set
145     );
146   --
147   if l_inst_set.count > 0 then
148     --
149     l_ele_num := 1;
150     --
151     for i in l_inst_set.first .. l_inst_set.last loop
152       --
153       l_ok := nvl((nvl(p_per_mar_status,'-1') = l_inst_set(l_ele_num).v230_val),FALSE);
154       --
155       if l_ok and l_inst_set(l_ele_num).excld_flag = 'N' then
156         --
157         if p_score_compute_mode then
158            if l_crit_passed is null then
159               l_crit_passed := true;
160            end if;
161            ben_evaluate_elig_profiles.write(l_score_tab,
162                  l_inst_set(l_ele_num).eligy_prfl_id,
163                  l_inst_set(l_ele_num).short_code,
164                  l_inst_set(l_ele_num).pk_id,
165                  nvl(l_inst_set(l_ele_num).criteria_score,
166                  l_inst_set(l_ele_num).criteria_weight));
167         else
168            exit;
169         end if;
170         --
171       elsif l_ok and l_inst_set(l_ele_num).excld_flag = 'Y' then
172         --
173         l_rows_found := true;
174         l_ok := false;
175         exit;
176         --
177       elsif (not l_ok) and l_inst_set(l_ele_num).excld_flag = 'Y' then
178         --
179         l_rows_found := true;
180         l_ok := true;
181         --
182         if p_score_compute_mode then
183            ben_evaluate_elig_profiles.write(l_score_tab,
184                  l_inst_set(l_ele_num).eligy_prfl_id,
185                  l_inst_set(l_ele_num).short_code,
186                  l_inst_set(l_ele_num).pk_id,
187                  nvl(l_inst_set(l_ele_num).criteria_score,
188                  l_inst_set(l_ele_num).criteria_weight));
189         end if;
190       elsif l_inst_set(l_ele_num).excld_flag = 'N' then
191         --
192         l_rows_found := true;
193         --
194       end if;
195       --
196       l_ele_num := l_ele_num+1;
197       --
198     end loop;
199     --
200   end if;
201   --
202   if l_crit_passed is null
203   then
204      if l_rows_found
205        and not l_ok
206      then
207        --
208        ben_evaluate_elig_profiles.g_inelg_rsn_cd := 'EMP';
209        fnd_message.set_name('BEN','BEN_92815_MARSTAT_PRFL_FAIL');
210        hr_utility.set_location('Criteria Failed: '||l_proc,20);
211        raise ben_evaluate_elig_profiles.g_criteria_failed;
212        --
213      end if;
214   end if;
215   --
216   if p_score_compute_mode
217   then
218      hr_utility.set_location('count '||l_score_tab.count,20);
219      ben_evaluate_elig_profiles.write(p_profile_score_tab,l_score_tab);
220   end if;
221   hr_utility.set_location('Leaving: '||l_proc,20);
222   --
223 end check_mrtl_sts_elig;
224 --
225 procedure check_dsblty_ctg_elig
226   (p_eligy_prfl_id  in number
227   ,p_score_compute_mode in boolean default false
228   ,p_profile_score_tab in out nocopy ben_evaluate_elig_profiles.scoreTab
229   ,p_effective_date in date
230   ,p_per_dsblty_ctg   in varchar2
231   )
232 is
233   --
234   l_proc          varchar2(100) := g_package||'check_dsblty_ctg_elig';
235   --
236   l_inst_set      ben_cagrelp_cache.g_elp_cache := ben_cagrelp_cache.g_elp_cache();
237   --
238   l_ok            boolean := false;
239   l_rows_found    boolean := false;
240   --
241   l_ele_num       pls_integer;
242   --
243   l_crit_passed     boolean;
244   l_score_tab       ben_evaluate_elig_profiles.scoreTab;
245 begin
246   --
247   hr_utility.set_location('Entering : '||l_proc,10);
248   --
249   ben_cagrelp_cache.elpect_getdets
250     (p_effective_date => p_effective_date
251     ,p_eligy_prfl_id  => p_eligy_prfl_id
252     --
253     ,p_inst_set       => l_inst_set
254     );
255   --
256   if l_inst_set.count > 0 then
257     --
258     l_ele_num := 1;
259     --
260     for i in l_inst_set.first .. l_inst_set.last loop
261       --
262       l_ok := nvl((nvl(p_per_dsblty_ctg,'-1') = l_inst_set(l_ele_num).v230_val),FALSE);
263       --
264       if l_ok and l_inst_set(l_ele_num).excld_flag = 'N' then
265         --
266         if p_score_compute_mode then
267            if l_crit_passed is null then
268               l_crit_passed := true;
269            end if;
270            ben_evaluate_elig_profiles.write(l_score_tab,
271                  l_inst_set(l_ele_num).eligy_prfl_id,
272                  l_inst_set(l_ele_num).short_code,
273                  l_inst_set(l_ele_num).pk_id,
274                  nvl(l_inst_set(l_ele_num).criteria_score,
275                  l_inst_set(l_ele_num).criteria_weight));
276         else
277            exit;
278         end if;
279         --
280       elsif l_ok and l_inst_set(l_ele_num).excld_flag = 'Y' then
281         --
282         l_rows_found := true;
283         l_ok := false;
284         exit;
285         --
286       elsif (not l_ok) and l_inst_set(l_ele_num).excld_flag = 'Y' then
287         --
288         l_rows_found := true;
289         l_ok := true;
290         --
291         if p_score_compute_mode then
292            ben_evaluate_elig_profiles.write(l_score_tab,
293                  l_inst_set(l_ele_num).eligy_prfl_id,
294                  l_inst_set(l_ele_num).short_code,
295                  l_inst_set(l_ele_num).pk_id,
296                  nvl(l_inst_set(l_ele_num).criteria_score,
297                  l_inst_set(l_ele_num).criteria_weight));
298         end if;
299       elsif l_inst_set(l_ele_num).excld_flag = 'N' then
300         --
301         l_rows_found := true;
302         --
303       end if;
304       --
305       l_ele_num := l_ele_num+1;
306       --
307     end loop;
308     --
309   end if;
310   --
311   if l_crit_passed is null
312   then
313      if l_rows_found
314        and not l_ok
315      then
316        --
317        ben_evaluate_elig_profiles.g_inelg_rsn_cd := 'ECT';
318        fnd_message.set_name('BEN','BEN_92816_DSBLCAT_PRFL_FAIL');
319        hr_utility.set_location('Criteria Failed: '||l_proc,20);
320        raise ben_evaluate_elig_profiles.g_criteria_failed;
321        --
322      end if;
323   end if;
324   --
325   if p_score_compute_mode
326   then
327      hr_utility.set_location('count '||l_score_tab.count,20);
328      ben_evaluate_elig_profiles.write(p_profile_score_tab,l_score_tab);
329   end if;
330   hr_utility.set_location('Leaving: '||l_proc,20);
331   --
332 end check_dsblty_ctg_elig;
333 --
334 procedure check_dsblty_rsn_elig
335   (p_eligy_prfl_id  in number
336   ,p_score_compute_mode in boolean default false
337   ,p_profile_score_tab in out nocopy ben_evaluate_elig_profiles.scoreTab
338   ,p_effective_date in date
339   ,p_per_dsblty_rsn   in varchar2
340   )
341 is
342   --
343   l_proc          varchar2(100) := g_package||'check_dsblty_rsn_elig';
344   --
345   l_inst_set      ben_cagrelp_cache.g_elp_cache := ben_cagrelp_cache.g_elp_cache();
346   --
347   l_ok            boolean := false;
348   l_rows_found    boolean := false;
349   --
350   l_ele_num       pls_integer;
351   --
352   l_crit_passed     boolean;
353   l_score_tab       ben_evaluate_elig_profiles.scoreTab;
354 begin
355   --
356   hr_utility.set_location('Entering : '||l_proc,10);
357   --
358   ben_cagrelp_cache.elpedr_getdets
359     (p_effective_date => p_effective_date
360     ,p_eligy_prfl_id  => p_eligy_prfl_id
361     --
362     ,p_inst_set       => l_inst_set
363     );
364   --
365   if l_inst_set.count > 0 then
366     --
367     l_ele_num := 1;
368     --
369     for i in l_inst_set.first .. l_inst_set.last loop
370       --
371       l_ok := nvl((nvl(p_per_dsblty_rsn,'-1') = l_inst_set(l_ele_num).v230_val),FALSE);
372       --
373       if l_ok and l_inst_set(l_ele_num).excld_flag = 'N' then
374         --
375         if p_score_compute_mode then
376            if l_crit_passed is null then
377               l_crit_passed := true;
378            end if;
379            ben_evaluate_elig_profiles.write(l_score_tab,
380                  l_inst_set(l_ele_num).eligy_prfl_id,
381                  l_inst_set(l_ele_num).short_code,
382                  l_inst_set(l_ele_num).pk_id,
383                  nvl(l_inst_set(l_ele_num).criteria_score,
384                  l_inst_set(l_ele_num).criteria_weight));
385         else
386            exit;
387         end if;
388         --
389       elsif l_ok and l_inst_set(l_ele_num).excld_flag = 'Y' then
390         --
391         l_rows_found := true;
392         l_ok := false;
393         exit;
394         --
395       elsif (not l_ok) and l_inst_set(l_ele_num).excld_flag = 'Y' then
396         --
397         l_rows_found := true;
398         l_ok := true;
399         --
400         if p_score_compute_mode then
401            ben_evaluate_elig_profiles.write(l_score_tab,
402                  l_inst_set(l_ele_num).eligy_prfl_id,
403                  l_inst_set(l_ele_num).short_code,
404                  l_inst_set(l_ele_num).pk_id,
405                  nvl(l_inst_set(l_ele_num).criteria_score,
406                  l_inst_set(l_ele_num).criteria_weight));
407         end if;
408       elsif l_inst_set(l_ele_num).excld_flag = 'N' then
409         --
410         l_rows_found := true;
411         --
412       end if;
413       --
414       l_ele_num := l_ele_num+1;
415       --
416     end loop;
417     --
418   end if;
419   --
420   if l_crit_passed is null
421   then
422      if l_rows_found
423        and not l_ok
424      then
425        --
426        ben_evaluate_elig_profiles.g_inelg_rsn_cd := 'EDR';
427        fnd_message.set_name('BEN','BEN_92817_DSBLRSN_PRFL_FAIL');
428        hr_utility.set_location('Criteria Failed: '||l_proc,20);
429        raise ben_evaluate_elig_profiles.g_criteria_failed;
430        --
431      end if;
432   end if;
433   --
434   if p_score_compute_mode
435   then
436      hr_utility.set_location('count '||l_score_tab.count,20);
437      ben_evaluate_elig_profiles.write(p_profile_score_tab,l_score_tab);
438   end if;
439   hr_utility.set_location('Leaving: '||l_proc,20);
440   --
441 end check_dsblty_rsn_elig;
442 --
443 procedure check_dsblty_dgr_elig
444   (p_eligy_prfl_id     in number
445   ,p_score_compute_mode in boolean default false
446   ,p_profile_score_tab in out nocopy ben_evaluate_elig_profiles.scoreTab
447   ,p_effective_date    in date
448   ,p_per_degree        in number
449   )
450 is
451   --
452   l_proc         varchar2(100) := g_package||'check_dsblty_dgr_elig';
453   --
454   l_inst_set      ben_cagrelp_cache.g_elp_cache := ben_cagrelp_cache.g_elp_cache();
455   --
456   l_ok            boolean := false;
457   l_rows_found    boolean := false;
458   --
459   l_ele_num       pls_integer;
460   --
461   l_crit_passed     boolean;
462   l_score_tab       ben_evaluate_elig_profiles.scoreTab;
463 begin
464   --
465   hr_utility.set_location('Entering : '||l_proc,10);
466   --
467   ben_cagrelp_cache.elpedd_getdets
468     (p_effective_date => p_effective_date
469     ,p_eligy_prfl_id  => p_eligy_prfl_id
470     --
471     ,p_inst_set       => l_inst_set
472     );
473   --
474   if l_inst_set.count > 0 then
475     --
476     l_ele_num := 1;
477     --
478     for i in l_inst_set.first .. l_inst_set.last loop
479       --
480       l_ok := nvl((nvl(p_per_degree,'-1') = l_inst_set(l_ele_num).num_val),FALSE);
481       --
482       if l_ok and l_inst_set(l_ele_num).excld_flag = 'N' then
483         --
484         if p_score_compute_mode then
485            if l_crit_passed is null then
486               l_crit_passed := true;
487            end if;
488            ben_evaluate_elig_profiles.write(l_score_tab,
489                  l_inst_set(l_ele_num).eligy_prfl_id,
490                  l_inst_set(l_ele_num).short_code,
491                  l_inst_set(l_ele_num).pk_id,
492                  nvl(l_inst_set(l_ele_num).criteria_score,
493                  l_inst_set(l_ele_num).criteria_weight));
494         else
495            exit;
496         end if;
497         --
498       elsif l_ok and l_inst_set(l_ele_num).excld_flag = 'Y' then
499         --
500         l_rows_found := true;
501         l_ok := false;
502         exit;
503         --
504       elsif (not l_ok) and l_inst_set(l_ele_num).excld_flag = 'Y' then
505         --
506         l_rows_found := true;
507         l_ok := true;
508         --
509         if p_score_compute_mode then
510            ben_evaluate_elig_profiles.write(l_score_tab,
511                  l_inst_set(l_ele_num).eligy_prfl_id,
512                  l_inst_set(l_ele_num).short_code,
513                  l_inst_set(l_ele_num).pk_id,
514                  nvl(l_inst_set(l_ele_num).criteria_score,
515                  l_inst_set(l_ele_num).criteria_weight));
516         end if;
517       elsif l_inst_set(l_ele_num).excld_flag = 'N' then
518         --
519         l_rows_found := true;
520         --
521       end if;
522       --
523       l_ele_num := l_ele_num+1;
524       --
525     end loop;
526     --
527   end if;
528   --
529   if l_crit_passed is null
530   then
531      if l_rows_found
532        and not l_ok
533      then
534        --
535        ben_evaluate_elig_profiles.g_inelg_rsn_cd := 'EDD';
536        fnd_message.set_name('BEN','BEN_92818_DSBDGR_PRFL_FAIL');
537        hr_utility.set_location('Criteria Failed: '||l_proc,20);
538        raise ben_evaluate_elig_profiles.g_criteria_failed;
539        --
540      end if;
541   end if;
542   --
543   if p_score_compute_mode
544   then
545      hr_utility.set_location('count '||l_score_tab.count,20);
546      ben_evaluate_elig_profiles.write(p_profile_score_tab,l_score_tab);
547   end if;
548   hr_utility.set_location('Leaving: '||l_proc,20);
549   --
550 end check_dsblty_dgr_elig;
551 --
552 procedure check_suppl_role_elig
553   (p_eligy_prfl_id    in number
554   ,p_score_compute_mode in boolean default false
555   ,p_profile_score_tab in out nocopy ben_evaluate_elig_profiles.scoreTab
556   ,p_effective_date   in date
557   ,p_asg_job_id       in number
558   ,p_asg_job_group_id in number
559   )
560 is
561   --
562   l_proc          varchar2(100) := g_package||'check_suppl_role_elig';
563   --
564   l_inst_set      ben_cagrelp_cache.g_elp_cache := ben_cagrelp_cache.g_elp_cache();
565   --
566   l_ok            boolean := false;
567   l_rows_found    boolean := false;
568   --
569   l_ele_num       pls_integer;
570   --
571   l_crit_passed     boolean;
572   l_score_tab       ben_evaluate_elig_profiles.scoreTab;
573 begin
574   --
575   hr_utility.set_location('Entering : '||l_proc,10);
576   --
577   ben_cagrelp_cache.elpest_getdets
578     (p_effective_date => p_effective_date
579     ,p_eligy_prfl_id  => p_eligy_prfl_id
580     --
581     ,p_inst_set       => l_inst_set
582     );
583   --
584   if l_inst_set.count > 0 then
585     --
586     l_ele_num := 1;
587     --
588     for i in l_inst_set.first .. l_inst_set.last loop
589       --
590       l_ok := nvl((nvl(p_asg_job_id,-1) = l_inst_set(l_ele_num).num_val
591               and nvl(p_asg_job_group_id,-1) = l_inst_set(l_ele_num).num_val1),FALSE);
592       --
593       if l_ok and l_inst_set(l_ele_num).excld_flag = 'N' then
594         --
595         if p_score_compute_mode then
596            if l_crit_passed is null then
597               l_crit_passed := true;
598            end if;
599            ben_evaluate_elig_profiles.write(l_score_tab,
600                  l_inst_set(l_ele_num).eligy_prfl_id,
601                  l_inst_set(l_ele_num).short_code,
602                  l_inst_set(l_ele_num).pk_id,
603                  nvl(l_inst_set(l_ele_num).criteria_score,
604                  l_inst_set(l_ele_num).criteria_weight));
605         else
606            exit;
607         end if;
608         --
609       elsif l_ok and l_inst_set(l_ele_num).excld_flag = 'Y' then
610         --
611         l_rows_found := true;
612         l_ok := false;
613         exit;
614         --
615       elsif (not l_ok) and l_inst_set(l_ele_num).excld_flag = 'Y' then
616         --
617         l_rows_found := true;
618         l_ok := true;
619         --
620         if p_score_compute_mode then
621            ben_evaluate_elig_profiles.write(l_score_tab,
622                  l_inst_set(l_ele_num).eligy_prfl_id,
623                  l_inst_set(l_ele_num).short_code,
624                  l_inst_set(l_ele_num).pk_id,
625                  nvl(l_inst_set(l_ele_num).criteria_score,
626                  l_inst_set(l_ele_num).criteria_weight));
627         end if;
628       elsif l_inst_set(l_ele_num).excld_flag = 'N' then
629         --
630         l_rows_found := true;
631         --
632       end if;
633       --
634       l_ele_num := l_ele_num+1;
635       --
636     end loop;
637     --
638   end if;
639   --
640   if l_crit_passed is null
641   then
642      if l_rows_found
643        and not l_ok
644      then
645        --
646        ben_evaluate_elig_profiles.g_inelg_rsn_cd := 'EST';
647        fnd_message.set_name('BEN','BEN_92819_SUPPLROLE_PRFL_FAIL');
648        hr_utility.set_location('Criteria Failed: '||l_proc,20);
649        raise ben_evaluate_elig_profiles.g_criteria_failed;
650        --
651      end if;
652   end if;
653   --
654   if p_score_compute_mode
655   then
656      hr_utility.set_location('count '||l_score_tab.count,20);
657      ben_evaluate_elig_profiles.write(p_profile_score_tab,l_score_tab);
658   end if;
659   hr_utility.set_location('Leaving: '||l_proc,20);
660   --
661 end check_suppl_role_elig;
662 --
663 procedure check_qual_titl_elig
664   (p_eligy_prfl_id   in number
665   ,p_score_compute_mode in boolean default false
666   ,p_profile_score_tab in out nocopy ben_evaluate_elig_profiles.scoreTab
667   ,p_effective_date  in date
668   ,p_per_qual_title  in varchar2
669   ,p_per_qual_typ_id in number
670   )
671 is
672   --
673   l_proc          varchar2(100) := g_package||'check_qual_titl_elig';
674   --
675   l_inst_set      ben_cagrelp_cache.g_elp_cache := ben_cagrelp_cache.g_elp_cache();
676   --
677   l_ok            boolean := false;
678   l_rows_found    boolean := false;
679   --
680   l_ele_num       pls_integer;
681   --
682   l_crit_passed     boolean;
683   l_score_tab       ben_evaluate_elig_profiles.scoreTab;
684 begin
685   --
686   hr_utility.set_location('Entering : '||l_proc,10);
687   --
688   ben_cagrelp_cache.elpeqt_getdets
689     (p_effective_date => p_effective_date
690     ,p_eligy_prfl_id  => p_eligy_prfl_id
691     --
692     ,p_inst_set       => l_inst_set
693     );
694   --
695   if l_inst_set.count > 0 then
696     --
697     l_ele_num := 1;
698     --
699     for i in l_inst_set.first .. l_inst_set.last loop
700       --
701       l_ok := nvl((nvl(p_per_qual_typ_id,-1) = l_inst_set(l_ele_num).num_val
702               and nvl(upper(p_per_qual_title),'-999999') = nvl(upper(l_inst_set(l_ele_num).v230_val),'-999999')),FALSE);
703       --
704       --        and nvl(upper(p_per_qual_title),'-1') = upper(l_inst_set(l_ele_num).v230_val)),FALSE);
705       -- bug 2669031 - added nvl in the right hand side to handle case where person qual titl
706       -- and criteria's qual title are both null, and if person's qual type and criteria's qual
707       -- type matches, then the person passes the criteria in the above case.
708       --
709       if l_ok and l_inst_set(l_ele_num).excld_flag = 'N' then
710         --
711         if p_score_compute_mode then
712            if l_crit_passed is null then
713               l_crit_passed := true;
714            end if;
715            ben_evaluate_elig_profiles.write(l_score_tab,
716                  l_inst_set(l_ele_num).eligy_prfl_id,
717                  l_inst_set(l_ele_num).short_code,
718                  l_inst_set(l_ele_num).pk_id,
719                  nvl(l_inst_set(l_ele_num).criteria_score,
720                  l_inst_set(l_ele_num).criteria_weight));
721         else
722            exit;
723         end if;
724         --
725       elsif l_ok and l_inst_set(l_ele_num).excld_flag = 'Y' then
726         --
727         l_rows_found := true;
728         l_ok := false;
729         exit;
730         --
731       elsif (not l_ok) and l_inst_set(l_ele_num).excld_flag = 'Y' then
732         --
733         l_rows_found := true;
734         l_ok := true;
735         --
736         if p_score_compute_mode then
737            ben_evaluate_elig_profiles.write(l_score_tab,
738                  l_inst_set(l_ele_num).eligy_prfl_id,
739                  l_inst_set(l_ele_num).short_code,
740                  l_inst_set(l_ele_num).pk_id,
741                  nvl(l_inst_set(l_ele_num).criteria_score,
742                  l_inst_set(l_ele_num).criteria_weight));
743         end if;
744       elsif l_inst_set(l_ele_num).excld_flag = 'N' then
745         --
746         l_rows_found := true;
747         --
748       end if;
749       --
750       l_ele_num := l_ele_num+1;
751       --
752     end loop;
753     --
754   end if;
755   --
756   if l_crit_passed is null
757   then
758      if l_rows_found
759        and not l_ok
760      then
761        --
762        ben_evaluate_elig_profiles.g_inelg_rsn_cd := 'EQT';
763        fnd_message.set_name('BEN','BEN_92820_QUALTITL_PRFL_FAIL');
767      end if;
764        hr_utility.set_location('Criteria Failed: '||l_proc,20);
765        raise ben_evaluate_elig_profiles.g_criteria_failed;
766        --
768   end if;
769   --
770   if p_score_compute_mode
771   then
772      hr_utility.set_location('count '||l_score_tab.count,20);
773      ben_evaluate_elig_profiles.write(p_profile_score_tab,l_score_tab);
774   end if;
775   hr_utility.set_location('Leaving: '||l_proc,20);
776   --
777 end check_qual_titl_elig;
778 --
779 procedure check_pstn_elig
780   (p_eligy_prfl_id  in number
781   ,p_score_compute_mode in boolean default false
782   ,p_profile_score_tab in out nocopy ben_evaluate_elig_profiles.scoreTab
783   ,p_effective_date in date
784   ,p_asg_position_id   in varchar2
785   )
786 is
787   --
788   l_proc          varchar2(100) := g_package||'check_pstn_elig';
789   --
790   l_inst_set      ben_cagrelp_cache.g_elp_cache := ben_cagrelp_cache.g_elp_cache();
791   --
792   l_ok            boolean := false;
793   l_rows_found    boolean := false;
794   --
795   l_ele_num       pls_integer;
796   --
797   l_crit_passed     boolean;
798   l_score_tab       ben_evaluate_elig_profiles.scoreTab;
799 begin
800   --
801   hr_utility.set_location('Entering : '||l_proc,10);
802   --
803   ben_cagrelp_cache.elpeps_getdets
804     (p_effective_date => p_effective_date
805     ,p_eligy_prfl_id  => p_eligy_prfl_id
806     --
807     ,p_inst_set       => l_inst_set
808     );
809   --
810   if l_inst_set.count > 0 then
811     --
812     l_ele_num := 1;
813     --
814     for i in l_inst_set.first .. l_inst_set.last loop
815       --
816       l_ok := nvl((nvl(p_asg_position_id,'-1') = l_inst_set(l_ele_num).num_val),FALSE);
817       --
818       if l_ok and l_inst_set(l_ele_num).excld_flag = 'N' then
819         --
820         if p_score_compute_mode then
821            if l_crit_passed is null then
822               l_crit_passed := true;
823            end if;
824            ben_evaluate_elig_profiles.write(l_score_tab,
825                  l_inst_set(l_ele_num).eligy_prfl_id,
826                  l_inst_set(l_ele_num).short_code,
827                  l_inst_set(l_ele_num).pk_id,
828                  nvl(l_inst_set(l_ele_num).criteria_score,
829                  l_inst_set(l_ele_num).criteria_weight));
830         else
831            exit;
832         end if;
833         --
834       elsif l_ok and l_inst_set(l_ele_num).excld_flag = 'Y' then
835         --
836         l_rows_found := true;
837         l_ok := false;
838         exit;
839         --
840       elsif (not l_ok) and l_inst_set(l_ele_num).excld_flag = 'Y' then
841         --
842         l_rows_found := true;
843         l_ok := true;
844         --
845         if p_score_compute_mode then
846            ben_evaluate_elig_profiles.write(l_score_tab,
847                  l_inst_set(l_ele_num).eligy_prfl_id,
848                  l_inst_set(l_ele_num).short_code,
849                  l_inst_set(l_ele_num).pk_id,
850                  nvl(l_inst_set(l_ele_num).criteria_score,
851                  l_inst_set(l_ele_num).criteria_weight));
852         end if;
853       elsif l_inst_set(l_ele_num).excld_flag = 'N' then
854         --
855         l_rows_found := true;
856         --
857       end if;
858       --
859       l_ele_num := l_ele_num+1;
860       --
861     end loop;
862     --
863   end if;
864   --
865   if l_crit_passed is null
866   then
867      if l_rows_found
868        and not l_ok
869      then
870        --
871        ben_evaluate_elig_profiles.g_inelg_rsn_cd := 'EPS';
872        fnd_message.set_name('BEN','BEN_92821_PSTN_PRFL_FAIL');
873        hr_utility.set_location('Criteria Failed: '||l_proc,20);
874        raise ben_evaluate_elig_profiles.g_criteria_failed;
875        --
876      end if;
877   end if;
878   --
879   if p_score_compute_mode
880   then
881      hr_utility.set_location('count '||l_score_tab.count,20);
882      ben_evaluate_elig_profiles.write(p_profile_score_tab,l_score_tab);
883   end if;
884   hr_utility.set_location('Leaving: '||l_proc,20);
885   --
886 end check_pstn_elig;
887 --
888 procedure check_prbtn_perd_elig
889   (p_eligy_prfl_id  in     number
890   ,p_score_compute_mode in boolean default false
891   ,p_profile_score_tab in out nocopy ben_evaluate_elig_profiles.scoreTab
892   ,p_effective_date in     date
893   ,p_asg_prob_perd  in     number
894   ,p_asg_prob_unit  in     varchar2
895   )
896 is
897   --
898   l_proc         varchar2(100) := g_package||'check_prbtn_perd_elig';
899   --
900   l_inst_set      ben_cagrelp_cache.g_elp_cache := ben_cagrelp_cache.g_elp_cache();
901   --
902   l_ok            boolean := false;
903   l_rows_found    boolean := false;
904   --
905   l_ele_num       pls_integer;
906   --
907   l_crit_passed     boolean;
908   l_score_tab       ben_evaluate_elig_profiles.scoreTab;
909 begin
910   --
911   ben_cagrelp_cache.elpepn_getdets
912     (p_effective_date => p_effective_date
913     ,p_eligy_prfl_id  => p_eligy_prfl_id
914     --
915     ,p_inst_set       => l_inst_set
916     );
917   --
918   if l_inst_set.count > 0 then
919     --
920     l_ele_num := 1;
921     --
922     for i in l_inst_set.first .. l_inst_set.last loop
923       --
924       l_ok := nvl((nvl(p_asg_prob_perd,-1) = l_inst_set(l_ele_num).num_val
925               and nvl(p_asg_prob_unit,'-1') = l_inst_set(l_ele_num).v230_val),FALSE);
926       --
927       if l_ok and l_inst_set(l_ele_num).excld_flag = 'N' then
928         --
929         if p_score_compute_mode then
930            if l_crit_passed is null then
931               l_crit_passed := true;
932            end if;
933            ben_evaluate_elig_profiles.write(l_score_tab,
934                  l_inst_set(l_ele_num).eligy_prfl_id,
935                  l_inst_set(l_ele_num).short_code,
936                  l_inst_set(l_ele_num).pk_id,
937                  nvl(l_inst_set(l_ele_num).criteria_score,
938                  l_inst_set(l_ele_num).criteria_weight));
939         else
940            exit;
941         end if;
942         --
943       elsif l_ok and l_inst_set(l_ele_num).excld_flag = 'Y' then
944         --
945         l_rows_found := true;
946         l_ok := false;
947         exit;
948         --
949       elsif (not l_ok) and l_inst_set(l_ele_num).excld_flag = 'Y' then
950         --
951         l_rows_found := true;
952         l_ok := true;
953         --
954         if p_score_compute_mode then
955            ben_evaluate_elig_profiles.write(l_score_tab,
956                  l_inst_set(l_ele_num).eligy_prfl_id,
957                  l_inst_set(l_ele_num).short_code,
958                  l_inst_set(l_ele_num).pk_id,
959                  nvl(l_inst_set(l_ele_num).criteria_score,
960                  l_inst_set(l_ele_num).criteria_weight));
961         end if;
962       elsif l_inst_set(l_ele_num).excld_flag = 'N' then
963         --
964         l_rows_found := true;
965         --
966       end if;
967       --
968       l_ele_num := l_ele_num+1;
969       --
970     end loop;
971     --
972   end if;
973   --
974   if l_crit_passed is null
975   then
976      if l_rows_found
977        and not l_ok
978      then
979        --
980        ben_evaluate_elig_profiles.g_inelg_rsn_cd := 'EDD';
981        fnd_message.set_name('BEN','BEN_92822_PRBNPERD_PRFL_FAIL');
982        hr_utility.set_location('Criteria Failed: '||l_proc,20);
983        raise ben_evaluate_elig_profiles.g_criteria_failed;
984        --
985      end if;
986   end if;
987   --
988   if p_score_compute_mode
989   then
990      hr_utility.set_location('count '||l_score_tab.count,20);
991      ben_evaluate_elig_profiles.write(p_profile_score_tab,l_score_tab);
992   end if;
993   hr_utility.set_location('Leaving: '||l_proc,20);
994   --
995 end check_prbtn_perd_elig;
996 --
997 procedure check_sp_clng_prg_elig
998   (p_eligy_prfl_id  in number
999   ,p_score_compute_mode in boolean default false
1000   ,p_profile_score_tab in out nocopy ben_evaluate_elig_profiles.scoreTab
1001   ,p_effective_date in date
1002   ,p_asg_sps_id   in varchar2
1003   )
1004 is
1005   --
1006   l_proc          varchar2(100) := g_package||'check_sp_clng_prg_elig';
1007   --
1008   l_inst_set      ben_cagrelp_cache.g_elp_cache := ben_cagrelp_cache.g_elp_cache();
1009   --
1010   l_ok            boolean := false;
1011   l_rows_found    boolean := false;
1012   --
1013   l_ele_num       pls_integer;
1014   --
1015   l_crit_passed     boolean;
1016   l_score_tab       ben_evaluate_elig_profiles.scoreTab;
1017 begin
1018   --
1019   hr_utility.set_location('Entering : '||l_proc,10);
1020   --
1021   ben_cagrelp_cache.elpesp_getdets
1022     (p_effective_date => p_effective_date
1023     ,p_eligy_prfl_id  => p_eligy_prfl_id
1024     --
1025     ,p_inst_set       => l_inst_set
1026     );
1027   --
1028   if l_inst_set.count > 0 then
1029     --
1030     l_ele_num := 1;
1031     --
1032     for i in l_inst_set.first .. l_inst_set.last loop
1033       --
1034       l_ok := nvl((nvl(p_asg_sps_id,'-1') = l_inst_set(l_ele_num).num_val),FALSE);
1035       --
1036       if l_ok and l_inst_set(l_ele_num).excld_flag = 'N' then
1037         --
1038         if p_score_compute_mode then
1039            if l_crit_passed is null then
1040               l_crit_passed := true;
1041            end if;
1042            ben_evaluate_elig_profiles.write(l_score_tab,
1043                  l_inst_set(l_ele_num).eligy_prfl_id,
1044                  l_inst_set(l_ele_num).short_code,
1045                  l_inst_set(l_ele_num).pk_id,
1046                  nvl(l_inst_set(l_ele_num).criteria_score,
1047                  l_inst_set(l_ele_num).criteria_weight));
1048         else
1049            exit;
1050         end if;
1051         --
1052       elsif l_ok and l_inst_set(l_ele_num).excld_flag = 'Y' then
1053         --
1054         l_rows_found := true;
1055         l_ok := false;
1056         exit;
1057         --
1061         l_ok := true;
1058       elsif (not l_ok) and l_inst_set(l_ele_num).excld_flag = 'Y' then
1059         --
1060         l_rows_found := true;
1062         --
1063         if p_score_compute_mode then
1064            ben_evaluate_elig_profiles.write(l_score_tab,
1065                  l_inst_set(l_ele_num).eligy_prfl_id,
1066                  l_inst_set(l_ele_num).short_code,
1067                  l_inst_set(l_ele_num).pk_id,
1068                  nvl(l_inst_set(l_ele_num).criteria_score,
1069                  l_inst_set(l_ele_num).criteria_weight));
1070         end if;
1071       elsif l_inst_set(l_ele_num).excld_flag = 'N' then
1072         --
1073         l_rows_found := true;
1074         --
1075       end if;
1076       --
1077       l_ele_num := l_ele_num+1;
1078       --
1079     end loop;
1080     --
1081   end if;
1082   --
1083   if l_crit_passed is null
1084   then
1085      if l_rows_found
1086        and not l_ok
1087      then
1088        --
1089        ben_evaluate_elig_profiles.g_inelg_rsn_cd := 'ESP';
1090        fnd_message.set_name('BEN','BEN_92823_SPCLNGPRG_PRFL_FAIL');
1091        hr_utility.set_location('Criteria Failed: '||l_proc,20);
1092        raise ben_evaluate_elig_profiles.g_criteria_failed;
1093        --
1094      end if;
1095   end if;
1096   --
1097   if p_score_compute_mode
1098   then
1099      hr_utility.set_location('count '||l_score_tab.count,20);
1100      ben_evaluate_elig_profiles.write(p_profile_score_tab,l_score_tab);
1101   end if;
1102   hr_utility.set_location('Leaving: '||l_proc,20);
1103   --
1104 end check_sp_clng_prg_elig;
1105 --
1106 procedure check_cagr_elig_profiles
1107   (p_eligprof_dets      in     ben_cep_cache.g_cobcep_cache_rec
1108   ,p_effective_date     in     date
1109   --
1110   ,p_person_id          in     number
1111   ,p_score_compute_mode in     boolean
1112   ,p_profile_score_tab in out nocopy ben_evaluate_elig_profiles.scoreTab
1113   ,p_per_sex            in     varchar2
1114   ,p_per_mar_status     in     varchar2
1115   ,p_per_qualification_type_id   in     varchar2 default null
1116   ,p_per_title          in     varchar2 default null
1117   ,p_asg_job_id         in     number
1118   ,p_asg_position_id    in     number
1119   ,p_asg_prob_perd      in     number
1120   ,p_asg_prob_unit      in     varchar2
1121   ,p_asg_sps_id         in     number
1122   )
1123 is
1124   --
1125   l_proc          varchar2(100) := g_package||'check_cagr_elig_profiles';
1126   --
1127   cursor c_dsbl_dets
1128     (c_per_id number
1129     ,c_eff_dt date
1130     )
1131   is
1132     select dis.CATEGORY,
1133            dis.DEGREE,
1134            dis.REASON
1135     from per_disabilities_f dis
1136     where dis.person_id = c_per_id
1137     and c_eff_dt
1138       between dis.effective_start_date and dis.effective_end_date;
1139   --
1140   l_dsbl_dets c_dsbl_dets%rowtype;
1141   --
1142   cursor c_qual_dets
1143     (c_per_id number
1144      , c_eff_dt date
1145     )
1146   is
1147     select qua.TITLE,
1148            qua.QUALIFICATION_TYPE_ID
1149     from per_qualifications qua
1150     where qua.person_id = c_per_id
1151     and c_eff_dt between nvl(start_date,hr_general.start_of_time)
1152                       and nvl(end_date,hr_general.end_of_time)
1153     order by nvl(start_date,hr_general.start_of_time) desc ,qualification_id desc ;
1154   -- Added where clause and order by clause as part of bug fix 3775543
1155   --
1156   l_qual_dets c_qual_dets%rowtype;
1157   --
1158   cursor c_jobgrp_dets
1159     (c_per_id     number
1160     ,c_asg_job_id number
1161     )
1162   is
1163     select role.job_group_id
1164     from per_roles role
1165     where role.person_id = c_per_id
1166     and   role.job_id = c_asg_job_id;
1167   --
1168   l_jobgrp_dets c_jobgrp_dets%rowtype;
1169   --
1170 begin
1171   --
1172   hr_utility.set_location('Entering : '||l_proc,10);
1173   --
1174   -- Get disability details
1175   --
1176   if p_eligprof_dets.ELIG_DSBLTY_CTG_FLAG = 'Y'
1177     or p_eligprof_dets.ELIG_DSBLTY_RSN_FLAG = 'Y'
1178     or p_eligprof_dets.ELIG_DSBLTY_DGR_FLAG = 'Y'
1179   then
1180     --
1181     open c_dsbl_dets
1182       (c_per_id => p_person_id
1183       ,c_eff_dt => p_effective_date
1184       );
1185     fetch c_dsbl_dets into l_dsbl_dets;
1186     close c_dsbl_dets;
1187     --
1188   end if;
1189   --
1190   if p_eligprof_dets.ELIG_GNDR_FLAG = 'Y' then
1191     --
1192     ben_cagr_check_eligibility.check_gndr_elig
1193       (p_eligy_prfl_id  => p_eligprof_dets.eligy_prfl_id
1194       ,p_score_compute_mode=> p_score_compute_mode
1195       ,p_profile_score_tab => p_profile_score_tab
1196       ,p_effective_date => p_effective_date
1197       ,p_per_sex        => p_per_sex
1198       );
1199     --
1200   end if;
1201   --
1202   if p_eligprof_dets.ELIG_MRTL_STS_FLAG = 'Y' then
1203     --
1204     ben_cagr_check_eligibility.check_mrtl_sts_elig
1205       (p_eligy_prfl_id  => p_eligprof_dets.eligy_prfl_id
1206       ,p_score_compute_mode=> p_score_compute_mode
1207       ,p_profile_score_tab => p_profile_score_tab
1208       ,p_effective_date => p_effective_date
1209       ,p_per_mar_status => p_per_mar_status
1210       );
1211     --
1212   end if;
1213   --
1214   if p_eligprof_dets.ELIG_DSBLTY_CTG_FLAG = 'Y' then
1215     --
1216     ben_cagr_check_eligibility.check_dsblty_ctg_elig
1217       (p_eligy_prfl_id  => p_eligprof_dets.eligy_prfl_id
1218       ,p_score_compute_mode=> p_score_compute_mode
1219       ,p_profile_score_tab => p_profile_score_tab
1220       ,p_effective_date => p_effective_date
1221       ,p_per_dsblty_ctg => l_dsbl_dets.category
1222       );
1223     --
1224   end if;
1225   --
1226   if p_eligprof_dets.ELIG_DSBLTY_RSN_FLAG = 'Y' then
1227     --
1228     ben_cagr_check_eligibility.check_dsblty_rsn_elig
1229       (p_eligy_prfl_id  => p_eligprof_dets.eligy_prfl_id
1230       ,p_score_compute_mode=> p_score_compute_mode
1231       ,p_profile_score_tab => p_profile_score_tab
1232       ,p_effective_date => p_effective_date
1233       ,p_per_dsblty_rsn => l_dsbl_dets.reason
1234       );
1235     --
1236   end if;
1237   --
1238   if p_eligprof_dets.ELIG_DSBLTY_DGR_FLAG = 'Y' then
1239     --
1240     ben_cagr_check_eligibility.check_dsblty_dgr_elig
1241       (p_eligy_prfl_id  => p_eligprof_dets.eligy_prfl_id
1242       ,p_score_compute_mode=> p_score_compute_mode
1243       ,p_profile_score_tab => p_profile_score_tab
1244       ,p_effective_date => p_effective_date
1245       ,p_per_degree     => l_dsbl_dets.degree
1246       );
1247     --
1248   end if;
1249   --
1250   if p_eligprof_dets.ELIG_SUPPL_ROLE_FLAG = 'Y' then
1251     --
1252     open c_jobgrp_dets
1253       (c_per_id     => p_person_id
1254       ,c_asg_job_id => p_asg_job_id
1255       );
1256     fetch c_jobgrp_dets into l_jobgrp_dets;
1257     close c_jobgrp_dets;
1258     --
1259     ben_cagr_check_eligibility.check_suppl_role_elig
1260       (p_eligy_prfl_id    => p_eligprof_dets.eligy_prfl_id
1261       ,p_score_compute_mode=> p_score_compute_mode
1262       ,p_profile_score_tab => p_profile_score_tab
1263       ,p_effective_date   => p_effective_date
1264       ,p_asg_job_id       => p_asg_job_id
1265       ,p_asg_job_group_id => l_jobgrp_dets.job_group_id
1266       );
1267     --
1268   end if;
1269   --
1270   if p_eligprof_dets.ELIG_QUAL_TITL_FLAG = 'Y' then
1271     --
1272     if p_per_title is null and
1273        p_per_qualification_type_id is null then
1274 
1275        open c_qual_dets
1276          (c_per_id => p_person_id
1277          , c_eff_dt  => p_effective_date
1278          );
1279        fetch c_qual_dets into l_qual_dets;
1280        close c_qual_dets;
1281        --
1282     else
1283        l_qual_dets.title := p_per_title;
1284        l_qual_dets.qualification_type_id := p_per_qualification_type_id;
1285     end if;
1286 
1287     ben_cagr_check_eligibility.check_qual_titl_elig
1288       (p_eligy_prfl_id   => p_eligprof_dets.eligy_prfl_id
1289       ,p_effective_date  => p_effective_date
1290       ,p_score_compute_mode=> p_score_compute_mode
1291       ,p_profile_score_tab => p_profile_score_tab
1292       ,p_per_qual_title  => l_qual_dets.title
1293       ,p_per_qual_typ_id => l_qual_dets.QUALIFICATION_TYPE_ID
1294       );
1295     --
1296   end if;
1297   --
1298   if p_eligprof_dets.ELIG_PSTN_FLAG = 'Y' then
1299     --
1300     ben_cagr_check_eligibility.check_pstn_elig
1301       (p_eligy_prfl_id   => p_eligprof_dets.eligy_prfl_id
1302       ,p_score_compute_mode=> p_score_compute_mode
1303       ,p_profile_score_tab => p_profile_score_tab
1304       ,p_effective_date  => p_effective_date
1305       ,p_asg_position_id => p_asg_position_id
1306       );
1307     --
1308   end if;
1309   --
1310   if p_eligprof_dets.ELIG_PRBTN_PERD_FLAG = 'Y' then
1311     --
1312     ben_cagr_check_eligibility.check_prbtn_perd_elig
1313       (p_eligy_prfl_id  => p_eligprof_dets.eligy_prfl_id
1314       ,p_score_compute_mode=> p_score_compute_mode
1315       ,p_profile_score_tab => p_profile_score_tab
1316       ,p_effective_date => p_effective_date
1317       ,p_asg_prob_perd  => p_asg_prob_perd
1318       ,p_asg_prob_unit  => p_asg_prob_unit
1319       );
1320     --
1321   end if;
1322   --
1323   if p_eligprof_dets.ELIG_SP_CLNG_PRG_PT_FLAG = 'Y' then
1324     --
1325     ben_cagr_check_eligibility.check_sp_clng_prg_elig
1326       (p_eligy_prfl_id  => p_eligprof_dets.eligy_prfl_id
1327       ,p_score_compute_mode=> p_score_compute_mode
1328       ,p_profile_score_tab => p_profile_score_tab
1329       ,p_effective_date => p_effective_date
1330       ,p_asg_sps_id     => p_asg_sps_id
1331       );
1332     --
1333   end if;
1334   --
1335   hr_utility.set_location('Leaving: '||l_proc,20);
1336   --
1337 end check_cagr_elig_profiles;
1338 --
1339 end ben_cagr_check_eligibility;