25:
26:
27: --
28: g_package varchar2(30) := 'ben_evl_dpnt_elig_criteria.';
29: g_debug boolean := hr_utility.debug_enabled;
30: --
31: --
32: -- -----------------------------------------------------
33: -- get the values from accesss table
55: --
56: l_current_loc NUMBER:=0;
57: Begin
58: if g_debug then
59: hr_utility.set_location('Entering: '||l_proc,10);
60: end if ;
61:
62: -- build the dynamic statement
63: l_statement := 'Select ' || p_column_name ||
100: end if ;
101: close l_valcur ;
102:
103: if g_debug then
104: hr_utility.set_location(' char return :' || p_value_char, 5);
105: hr_utility.set_location(' num return :' || p_value_num , 5);
106: hr_utility.set_location(' date return :'|| p_value_date, 5);
107: hr_utility.set_location(' Leaving:' || l_proc, 5);
108: end if ;
101: close l_valcur ;
102:
103: if g_debug then
104: hr_utility.set_location(' char return :' || p_value_char, 5);
105: hr_utility.set_location(' num return :' || p_value_num , 5);
106: hr_utility.set_location(' date return :'|| p_value_date, 5);
107: hr_utility.set_location(' Leaving:' || l_proc, 5);
108: end if ;
109: exception
102:
103: if g_debug then
104: hr_utility.set_location(' char return :' || p_value_char, 5);
105: hr_utility.set_location(' num return :' || p_value_num , 5);
106: hr_utility.set_location(' date return :'|| p_value_date, 5);
107: hr_utility.set_location(' Leaving:' || l_proc, 5);
108: end if ;
109: exception
110: when others then
103: if g_debug then
104: hr_utility.set_location(' char return :' || p_value_char, 5);
105: hr_utility.set_location(' num return :' || p_value_num , 5);
106: hr_utility.set_location(' date return :'|| p_value_date, 5);
107: hr_utility.set_location(' Leaving:' || l_proc, 5);
108: end if ;
109: exception
110: when others then
111: hr_utility.set_location(' exception:' || substr(sqlerrm,1,110), 5);
107: hr_utility.set_location(' Leaving:' || l_proc, 5);
108: end if ;
109: exception
110: when others then
111: hr_utility.set_location(' exception:' || substr(sqlerrm,1,110), 5);
112: raise ;
113: End get_values_access_table ;
114:
115:
122: l_proc varchar2(100):= g_package||'is_ok C';
123: l_return boolean ;
124: begin
125: if g_debug then
126: hr_utility.set_location('Entering: '||l_proc,10);
127: hr_utility.set_location('range : '||p_range_check,10);
128: end if ;
129: l_return := false ;
130: if p_range_check = 'N' then
123: l_return boolean ;
124: begin
125: if g_debug then
126: hr_utility.set_location('Entering: '||l_proc,10);
127: hr_utility.set_location('range : '||p_range_check,10);
128: end if ;
129: l_return := false ;
130: if p_range_check = 'N' then
131: l_return := (p_value = p_from_value ) ;
137: l_return := false ;
138: end if ;
139:
140: if g_debug then
141: hr_utility.set_location(' Leaving:' || l_proc, 5);
142: end if ;
143: return l_return ;
144: end is_ok ;
145:
153: l_proc varchar2(100):= g_package||'is_ok N';
154: l_return boolean ;
155: begin
156: if g_debug then
157: hr_utility.set_location('Entering: '||l_proc,10);
158: hr_utility.set_location('range : '||p_range_check,10);
159: end if ;
160: l_return := false ;
161:
154: l_return boolean ;
155: begin
156: if g_debug then
157: hr_utility.set_location('Entering: '||l_proc,10);
158: hr_utility.set_location('range : '||p_range_check,10);
159: end if ;
160: l_return := false ;
161:
162: if p_range_check = 'N' then
171: l_return := false ;
172: end if ;
173:
174: if g_debug then
175: hr_utility.set_location(' Leaving:' || l_proc, 5);
176: end if ;
177: return l_return ;
178: end is_ok ;
179:
187: l_proc varchar2(100):= g_package||'is_ok D';
188: l_return boolean ;
189: begin
190: if g_debug then
191: hr_utility.set_location('Entering: '||l_proc,10);
192: hr_utility.set_location('range : '||p_range_check,10);
193: end if ;
194: l_return := false ;
195:
188: l_return boolean ;
189: begin
190: if g_debug then
191: hr_utility.set_location('Entering: '||l_proc,10);
192: hr_utility.set_location('range : '||p_range_check,10);
193: end if ;
194: l_return := false ;
195:
196: if p_range_check = 'N' then
205: l_return := false ;
206: end if ;
207:
208: if g_debug then
209: hr_utility.set_location(' Leaving:' || l_proc, 5);
210: end if ;
211: return l_return ;
212: end is_ok ;
213:
236: l_return boolean ;
237:
238: begin
239: if g_debug then
240: hr_utility.set_location('Entering: '||l_proc,5);
241: end if ;
242:
243: if p_crit_col_datatype = 'C' then
244: l_return := is_ok(p_value_char,p_char_from_value,p_char_to_value,p_allow_range_validation_flag) ;
248: l_return := is_ok(p_value_date,p_date_from_value,p_date_to_value,p_allow_range_validation_flag) ;
249: end if ;
250:
251: if g_debug then
252: hr_utility.set_location(' Leaving:' || l_proc, 10);
253: end if ;
254:
255: return l_return;
256:
350: l_fonm_cvg_strt_dt date;
351:
352: Begin
353:
354: g_debug := hr_utility.debug_enabled;
355: if g_debug then
356: hr_utility.set_location('Entering: '||l_proc,10);
357: end if ;
358:
352: Begin
353:
354: g_debug := hr_utility.debug_enabled;
355: if g_debug then
356: hr_utility.set_location('Entering: '||l_proc,10);
357: end if ;
358:
359: l_effective_date := nvl(p_lf_evt_ocrd_dt,p_effective_date ) ;
360:
368: end if;
369:
370: l_crit_value_checked := 'Y' ;
371: if g_debug then
372: hr_utility.set_location('effective date : '||p_effective_date,11);
373: hr_utility.set_location('fonm effective date : '||l_effective_date,11);
374: end if ;
375:
376:
369:
370: l_crit_value_checked := 'Y' ;
371: if g_debug then
372: hr_utility.set_location('effective date : '||p_effective_date,11);
373: hr_utility.set_location('fonm effective date : '||l_effective_date,11);
374: end if ;
375:
376:
377: for i in c_dst_egc
375:
376:
377: for i in c_dst_egc
378: loop
379: hr_utility.set_location('eligy_criteria_dpnt_id : '||i.eligy_criteria_dpnt_id,20);
380: open c_info_egc (i.eligy_criteria_dpnt_id) ;
381: fetch c_info_egc into l_info_egc ;
382: close c_info_egc ;
383:
380: open c_info_egc (i.eligy_criteria_dpnt_id) ;
381: fetch c_info_egc into l_info_egc ;
382: close c_info_egc ;
383:
384: hr_utility.set_location('get the values from the table column SET1',99099);
385: get_values_access_table
386: (p_table_name => l_info_egc.access_table_name1 ,
387: p_column_name => l_info_egc.access_column_name1,
388: p_data_type_cd => l_info_egc.crit_col1_datatype ,
399: -- RAISE the ERROR a
400: null ;
401: end if ;
402:
403: hr_utility.set_location('l_info_egc.access_table_name1 '||l_info_egc.access_table_name1,99011);
404: hr_utility.set_location('l_info_egc.access_column_name1 '||l_info_egc.access_column_name1,99011);
405: hr_utility.set_location('l_info_egc.crit_col1_datatype '||l_info_egc.crit_col1_datatype,99011);
406: hr_utility.set_location('l_info_egc.allow_range_validation_flag '||l_info_egc.allow_range_validation_flag,99011);
407: hr_utility.set_location('l_value_char1 '||l_value_char1,99011);
400: null ;
401: end if ;
402:
403: hr_utility.set_location('l_info_egc.access_table_name1 '||l_info_egc.access_table_name1,99011);
404: hr_utility.set_location('l_info_egc.access_column_name1 '||l_info_egc.access_column_name1,99011);
405: hr_utility.set_location('l_info_egc.crit_col1_datatype '||l_info_egc.crit_col1_datatype,99011);
406: hr_utility.set_location('l_info_egc.allow_range_validation_flag '||l_info_egc.allow_range_validation_flag,99011);
407: hr_utility.set_location('l_value_char1 '||l_value_char1,99011);
408: hr_utility.set_location('l_value_num1 '||l_value_num1,99011);
401: end if ;
402:
403: hr_utility.set_location('l_info_egc.access_table_name1 '||l_info_egc.access_table_name1,99011);
404: hr_utility.set_location('l_info_egc.access_column_name1 '||l_info_egc.access_column_name1,99011);
405: hr_utility.set_location('l_info_egc.crit_col1_datatype '||l_info_egc.crit_col1_datatype,99011);
406: hr_utility.set_location('l_info_egc.allow_range_validation_flag '||l_info_egc.allow_range_validation_flag,99011);
407: hr_utility.set_location('l_value_char1 '||l_value_char1,99011);
408: hr_utility.set_location('l_value_num1 '||l_value_num1,99011);
409: hr_utility.set_location('l_value_date1 '||l_value_date1,99011);
402:
403: hr_utility.set_location('l_info_egc.access_table_name1 '||l_info_egc.access_table_name1,99011);
404: hr_utility.set_location('l_info_egc.access_column_name1 '||l_info_egc.access_column_name1,99011);
405: hr_utility.set_location('l_info_egc.crit_col1_datatype '||l_info_egc.crit_col1_datatype,99011);
406: hr_utility.set_location('l_info_egc.allow_range_validation_flag '||l_info_egc.allow_range_validation_flag,99011);
407: hr_utility.set_location('l_value_char1 '||l_value_char1,99011);
408: hr_utility.set_location('l_value_num1 '||l_value_num1,99011);
409: hr_utility.set_location('l_value_date1 '||l_value_date1,99011);
410:
403: hr_utility.set_location('l_info_egc.access_table_name1 '||l_info_egc.access_table_name1,99011);
404: hr_utility.set_location('l_info_egc.access_column_name1 '||l_info_egc.access_column_name1,99011);
405: hr_utility.set_location('l_info_egc.crit_col1_datatype '||l_info_egc.crit_col1_datatype,99011);
406: hr_utility.set_location('l_info_egc.allow_range_validation_flag '||l_info_egc.allow_range_validation_flag,99011);
407: hr_utility.set_location('l_value_char1 '||l_value_char1,99011);
408: hr_utility.set_location('l_value_num1 '||l_value_num1,99011);
409: hr_utility.set_location('l_value_date1 '||l_value_date1,99011);
410:
411:
404: hr_utility.set_location('l_info_egc.access_column_name1 '||l_info_egc.access_column_name1,99011);
405: hr_utility.set_location('l_info_egc.crit_col1_datatype '||l_info_egc.crit_col1_datatype,99011);
406: hr_utility.set_location('l_info_egc.allow_range_validation_flag '||l_info_egc.allow_range_validation_flag,99011);
407: hr_utility.set_location('l_value_char1 '||l_value_char1,99011);
408: hr_utility.set_location('l_value_num1 '||l_value_num1,99011);
409: hr_utility.set_location('l_value_date1 '||l_value_date1,99011);
410:
411:
412: if l_info_egc.access_table_name2 is not null then
405: hr_utility.set_location('l_info_egc.crit_col1_datatype '||l_info_egc.crit_col1_datatype,99011);
406: hr_utility.set_location('l_info_egc.allow_range_validation_flag '||l_info_egc.allow_range_validation_flag,99011);
407: hr_utility.set_location('l_value_char1 '||l_value_char1,99011);
408: hr_utility.set_location('l_value_num1 '||l_value_num1,99011);
409: hr_utility.set_location('l_value_date1 '||l_value_date1,99011);
410:
411:
412: if l_info_egc.access_table_name2 is not null then
413: hr_utility.set_location('get the values from the table column SET2',99099);
409: hr_utility.set_location('l_value_date1 '||l_value_date1,99011);
410:
411:
412: if l_info_egc.access_table_name2 is not null then
413: hr_utility.set_location('get the values from the table column SET2',99099);
414: get_values_access_table
415: (p_table_name => l_info_egc.access_table_name2 ,
416: p_column_name => l_info_egc.access_column_name2,
417: p_data_type_cd => l_info_egc.crit_col2_datatype ,
422: p_value_date => l_value_date2 ,
423: p_effective_date => p_effective_date
424: ) ;
425: end if ; --if l_info_egc.ACCESS_CALC_RULE2
426: hr_utility.set_location('l_info_egc.access_table_name2 '||l_info_egc.access_table_name2,99011);
427: hr_utility.set_location('l_info_egc.access_column_name2 '||l_info_egc.access_column_name2,99011);
428: hr_utility.set_location('l_info_egc.crit_col2_datatype '||l_info_egc.crit_col2_datatype,99011);
429: hr_utility.set_location('l_info_egc.allow_range_validation_flag2 '||l_info_egc.allow_range_validation_flag2,99011);
430: hr_utility.set_location('l_value_char2 '||l_value_char2,99011);
423: p_effective_date => p_effective_date
424: ) ;
425: end if ; --if l_info_egc.ACCESS_CALC_RULE2
426: hr_utility.set_location('l_info_egc.access_table_name2 '||l_info_egc.access_table_name2,99011);
427: hr_utility.set_location('l_info_egc.access_column_name2 '||l_info_egc.access_column_name2,99011);
428: hr_utility.set_location('l_info_egc.crit_col2_datatype '||l_info_egc.crit_col2_datatype,99011);
429: hr_utility.set_location('l_info_egc.allow_range_validation_flag2 '||l_info_egc.allow_range_validation_flag2,99011);
430: hr_utility.set_location('l_value_char2 '||l_value_char2,99011);
431: hr_utility.set_location('l_value_num2 '||l_value_num2,99011);
424: ) ;
425: end if ; --if l_info_egc.ACCESS_CALC_RULE2
426: hr_utility.set_location('l_info_egc.access_table_name2 '||l_info_egc.access_table_name2,99011);
427: hr_utility.set_location('l_info_egc.access_column_name2 '||l_info_egc.access_column_name2,99011);
428: hr_utility.set_location('l_info_egc.crit_col2_datatype '||l_info_egc.crit_col2_datatype,99011);
429: hr_utility.set_location('l_info_egc.allow_range_validation_flag2 '||l_info_egc.allow_range_validation_flag2,99011);
430: hr_utility.set_location('l_value_char2 '||l_value_char2,99011);
431: hr_utility.set_location('l_value_num2 '||l_value_num2,99011);
432: hr_utility.set_location('l_value_date2 '||l_value_date2,99011);
425: end if ; --if l_info_egc.ACCESS_CALC_RULE2
426: hr_utility.set_location('l_info_egc.access_table_name2 '||l_info_egc.access_table_name2,99011);
427: hr_utility.set_location('l_info_egc.access_column_name2 '||l_info_egc.access_column_name2,99011);
428: hr_utility.set_location('l_info_egc.crit_col2_datatype '||l_info_egc.crit_col2_datatype,99011);
429: hr_utility.set_location('l_info_egc.allow_range_validation_flag2 '||l_info_egc.allow_range_validation_flag2,99011);
430: hr_utility.set_location('l_value_char2 '||l_value_char2,99011);
431: hr_utility.set_location('l_value_num2 '||l_value_num2,99011);
432: hr_utility.set_location('l_value_date2 '||l_value_date2,99011);
433:
426: hr_utility.set_location('l_info_egc.access_table_name2 '||l_info_egc.access_table_name2,99011);
427: hr_utility.set_location('l_info_egc.access_column_name2 '||l_info_egc.access_column_name2,99011);
428: hr_utility.set_location('l_info_egc.crit_col2_datatype '||l_info_egc.crit_col2_datatype,99011);
429: hr_utility.set_location('l_info_egc.allow_range_validation_flag2 '||l_info_egc.allow_range_validation_flag2,99011);
430: hr_utility.set_location('l_value_char2 '||l_value_char2,99011);
431: hr_utility.set_location('l_value_num2 '||l_value_num2,99011);
432: hr_utility.set_location('l_value_date2 '||l_value_date2,99011);
433:
434: --- intialise the falg value
427: hr_utility.set_location('l_info_egc.access_column_name2 '||l_info_egc.access_column_name2,99011);
428: hr_utility.set_location('l_info_egc.crit_col2_datatype '||l_info_egc.crit_col2_datatype,99011);
429: hr_utility.set_location('l_info_egc.allow_range_validation_flag2 '||l_info_egc.allow_range_validation_flag2,99011);
430: hr_utility.set_location('l_value_char2 '||l_value_char2,99011);
431: hr_utility.set_location('l_value_num2 '||l_value_num2,99011);
432: hr_utility.set_location('l_value_date2 '||l_value_date2,99011);
433:
434: --- intialise the falg value
435: l_crit_value_checked := 'Y' ;
428: hr_utility.set_location('l_info_egc.crit_col2_datatype '||l_info_egc.crit_col2_datatype,99011);
429: hr_utility.set_location('l_info_egc.allow_range_validation_flag2 '||l_info_egc.allow_range_validation_flag2,99011);
430: hr_utility.set_location('l_value_char2 '||l_value_char2,99011);
431: hr_utility.set_location('l_value_num2 '||l_value_num2,99011);
432: hr_utility.set_location('l_value_date2 '||l_value_date2,99011);
433:
434: --- intialise the falg value
435: l_crit_value_checked := 'Y' ;
436: l_true_false1 := true ;
443: l_error_value2 := l_value_char2||l_value_num2||l_value_date2 ;
444: if l_error_value2 is not null then
445: l_error_value1 := l_error_value1 || ' , ' || l_error_value2 ;
446: end if ;
447: hr_utility.set_location(' person values : '|| l_error_value1 ,30);
448: l_eror_crit_name := l_info_egc.name ;
449: ---
450: for l in c_egv(p_dpnt_cvg_eligy_prfl_id ,
451: i.eligy_criteria_dpnt_id)
450: for l in c_egv(p_dpnt_cvg_eligy_prfl_id ,
451: i.eligy_criteria_dpnt_id)
452: loop
453: if g_debug then
454: hr_utility.set_location('eligy_criteria_values C : '||l.char_value1 ||' / ' || l.char_value2||' and '||l.char_value3 ||'/ '||l.char_value4 ,30);
455: hr_utility.set_location('eligy_criteria_values N : '||l.number_value1 ||' / ' || l.number_value2||' and '||l.number_value3 ||'/ '||l.number_value4 ,30);
456: hr_utility.set_location('eligy_criteria_values D : '||l.date_value1 ||' / ' || l.date_value2 ||' and '||l.date_value3 ||'/ '||l.date_value4,30);
457: end if ;
458: -- intialize the variable for the calue row
451: i.eligy_criteria_dpnt_id)
452: loop
453: if g_debug then
454: hr_utility.set_location('eligy_criteria_values C : '||l.char_value1 ||' / ' || l.char_value2||' and '||l.char_value3 ||'/ '||l.char_value4 ,30);
455: hr_utility.set_location('eligy_criteria_values N : '||l.number_value1 ||' / ' || l.number_value2||' and '||l.number_value3 ||'/ '||l.number_value4 ,30);
456: hr_utility.set_location('eligy_criteria_values D : '||l.date_value1 ||' / ' || l.date_value2 ||' and '||l.date_value3 ||'/ '||l.date_value4,30);
457: end if ;
458: -- intialize the variable for the calue row
459: l_crit_value_checked := 'Y' ;
452: loop
453: if g_debug then
454: hr_utility.set_location('eligy_criteria_values C : '||l.char_value1 ||' / ' || l.char_value2||' and '||l.char_value3 ||'/ '||l.char_value4 ,30);
455: hr_utility.set_location('eligy_criteria_values N : '||l.number_value1 ||' / ' || l.number_value2||' and '||l.number_value3 ||'/ '||l.number_value4 ,30);
456: hr_utility.set_location('eligy_criteria_values D : '||l.date_value1 ||' / ' || l.date_value2 ||' and '||l.date_value3 ||'/ '||l.date_value4,30);
457: end if ;
458: -- intialize the variable for the calue row
459: l_crit_value_checked := 'Y' ;
460: l_true_false1 := true ;
501: --- Y Y exit consider prfile failed
502: --- N N validate further values to see whether he pass any values
503: --- N Y treate like he meets the condition Y and N
504:
505: hr_utility.set_location('end result : '||l_crit_value_checked,20);
506: hr_utility.set_location('exclude : '||l.EXCLD_FLAG,20);
507: if l_crit_value_checked = 'Y' and l.EXCLD_FLAG = 'N' then
508: --- when one of the value satisfied and exclde flag is false
509: --- exit, next criteria will be validated for failure
502: --- N N validate further values to see whether he pass any values
503: --- N Y treate like he meets the condition Y and N
504:
505: hr_utility.set_location('end result : '||l_crit_value_checked,20);
506: hr_utility.set_location('exclude : '||l.EXCLD_FLAG,20);
507: if l_crit_value_checked = 'Y' and l.EXCLD_FLAG = 'N' then
508: --- when one of the value satisfied and exclde flag is false
509: --- exit, next criteria will be validated for failure
510: exit ;
526: --- to validate, this is as good as Y and N
527: l_crit_value_checked := 'Y' ;
528: exit ;
529: end if ;
530: hr_utility.set_location('after exclude end result : '||l_crit_value_checked,20);
531:
532: end Loop ;
533:
534: -- if any of the criteria failed (non of the value matched) then exit
538: end if ;
539: end Loop ;
540:
541:
542: hr_utility.set_location('end result : '||l_crit_value_checked,20);
543:
544: if l_crit_value_checked = 'N' then
545:
546: p_inelig_rsn_cd := 'OTH';
551: p_eligible_flag := 'Y';
552: end if ;
553:
554: if g_debug then
555: hr_utility.set_location(' Leaving:' || l_proc, 5);
556: end if ;
557: end main ;
558:
559: