1: Package Body hxc_ff_dict as
2: /* $Header: hxcffpkg.pkb 120.4 2005/09/23 08:08:37 sechandr noship $ */
3:
4: g_debug boolean :=hr_utility.debug_enabled;
5:
6: function formula(
7: p_formula_id in number
8: , p_resource_id in number
37: AND asg.assignment_type in ('E','C');
38:
39: begin -- formula
40:
41: g_debug:=hr_utility.debug_enabled;
42: if g_debug then
43: l_proc := g_package||'.formula';
44: hr_utility.set_location ('Entering '||l_proc,10);
45: hr_utility.set_location ('Before Init Formula '||l_proc,20);
40:
41: g_debug:=hr_utility.debug_enabled;
42: if g_debug then
43: l_proc := g_package||'.formula';
44: hr_utility.set_location ('Entering '||l_proc,10);
45: hr_utility.set_location ('Before Init Formula '||l_proc,20);
46: end if;
47: ff_utils.set_debug(127);
48: ff_exec.init_formula
41: g_debug:=hr_utility.debug_enabled;
42: if g_debug then
43: l_proc := g_package||'.formula';
44: hr_utility.set_location ('Entering '||l_proc,10);
45: hr_utility.set_location ('Before Init Formula '||l_proc,20);
46: end if;
47: ff_utils.set_debug(127);
48: ff_exec.init_formula
49: (p_formula_id => p_formula_id,
50: p_effective_date => p_submission_date,
51: p_inputs => l_inputs,
52: p_outputs => l_outputs);
53: if g_debug then
54: hr_utility.set_location ('After Init Formula '||l_proc,30);
55: end if;
56:
57: -- check the cache for the assignment id
58: -- (should always be there now)
90: -- array locations we put the values into, this is because of the caching
91: -- mechanism that formula uses.
92: --
93: if g_debug then
94: hr_utility.set_location ('First Position'||l_inputs.first,10);
95: hr_utility.set_location ('Last Position'||l_inputs.last,10);
96: end if;
97: --
98: -- Account for case where formula has no contexts or inputs
91: -- mechanism that formula uses.
92: --
93: if g_debug then
94: hr_utility.set_location ('First Position'||l_inputs.first,10);
95: hr_utility.set_location ('Last Position'||l_inputs.last,10);
96: end if;
97: --
98: -- Account for case where formula has no contexts or inputs
99: --
99: --
100: for l_count in nvl(l_inputs.first,0)..nvl(l_inputs.last,-1) loop
101: --
102: if g_debug then
103: hr_utility.set_location ('Current Context'||l_inputs(l_count).name,10);
104: end if;
105: -- *** CONTEXTS ****
106:
107: if l_inputs(l_count).name = 'DATE_EARNED'
129: -- Note that you must pass the date as a string, that is because
130: -- of the canonical date change of 11.5
131: --
132: if g_debug then
133: hr_utility.set_location ('Submission Date '||to_char(p_submission_date),10);
134: end if;
135: -- Still the fast formula does't accept the full canonical form.
136: -- l_inputs(l_count).value := fnd_date.date_to_canonical(p_submission_date);
137: l_inputs(l_count).value := to_char(p_submission_date, 'YYYY/MM/DD HH24:MI:SS');
231: end loop;
232: for l_count in nvl(l_inputs.first,0)..nvl(l_inputs.last,-1) loop
233: --
234: if g_debug then
235: hr_utility.set_location ('GAZ Current Context: '||l_inputs(l_count).name||' Value: '||l_inputs(l_count).value ,999);
236: end if;
237: --
238: END LOOP;
239: --
243: ff_exec.run_formula(p_inputs => l_inputs,
244: p_outputs => l_outputs);
245: --
246: if g_debug then
247: hr_utility.set_location ('Leaving '||l_proc,10);
248: end if;
249: for l_count in nvl(l_outputs.first,0)..nvl(l_outputs.last,-1) loop
250: --
251: if g_debug then
248: end if;
249: for l_count in nvl(l_outputs.first,0)..nvl(l_outputs.last,-1) loop
250: --
251: if g_debug then
252: hr_utility.set_location ('GAZ Current Context: '||l_outputs(l_count).name||' Value: '||l_outputs(l_count).value ,999);
253: end if;
254: --
255: END LOOP;
256: return l_outputs;
257:
258: EXCEPTION WHEN OTHERS THEN
259:
260: if g_debug then
261: hr_utility.trace('gazza - error is '||SQLERRM);
262: end if;
263:
264: raise_application_error(-20000,'ORA'||sqlcode||':'||sqlerrm);
265:
316:
317:
318: if g_debug then
319: l_proc := g_package||'.set_pto_time_category';
320: hr_utility.set_location('Processing '||l_proc, 10);
321: end if;
322:
323: OPEN csr_get_time_category_id;
324: FETCH csr_get_time_category_id INTO l_tc_id, l_tc_name;
360:
361:
362: BEGIN
363:
364: g_debug:=hr_utility.debug_enabled;
365: if g_debug then
366: l_proc:= g_package||'.decode_formula_segments';
367: hr_utility.set_location('Entering '||l_proc, 10);
368: end if;
363:
364: g_debug:=hr_utility.debug_enabled;
365: if g_debug then
366: l_proc:= g_package||'.decode_formula_segments';
367: hr_utility.set_location('Entering '||l_proc, 10);
368: end if;
369:
370: -- initialise g_time_category_id
371:
374: FOR r_seg IN csr_get_flex_segments ( p_formula_name => p_formula_name )
375: LOOP
376:
377: if g_debug then
378: hr_utility.set_location('Processing '||l_proc, 10);
379: end if;
380:
381: IF ( r_seg.application_column_name = 'ATTRIBUTE1' )
382: THEN
380:
381: IF ( r_seg.application_column_name = 'ATTRIBUTE1' )
382: THEN
383: if g_debug then
384: hr_utility.trace('');
385: hr_utility.trace('attribute 1 param is '||r_seg.end_user_column_name);
386: hr_utility.trace('attribute 1 param value is '||p_rule_rec.attribute1);
387: end if;
388:
381: IF ( r_seg.application_column_name = 'ATTRIBUTE1' )
382: THEN
383: if g_debug then
384: hr_utility.trace('');
385: hr_utility.trace('attribute 1 param is '||r_seg.end_user_column_name);
386: hr_utility.trace('attribute 1 param value is '||p_rule_rec.attribute1);
387: end if;
388:
389: p_param_rec.param1_value := p_rule_rec.attribute1;
382: THEN
383: if g_debug then
384: hr_utility.trace('');
385: hr_utility.trace('attribute 1 param is '||r_seg.end_user_column_name);
386: hr_utility.trace('attribute 1 param value is '||p_rule_rec.attribute1);
387: end if;
388:
389: p_param_rec.param1_value := p_rule_rec.attribute1;
390: p_param_rec.param1 := UPPER(r_seg.end_user_column_name);
413:
414: ELSIF ( r_seg.application_column_name = 'ATTRIBUTE2' )
415: THEN
416: if g_debug then
417: hr_utility.trace('');
418: hr_utility.trace('attribute 2 param is '||r_seg.end_user_column_name);
419: hr_utility.trace('attribute 2 param value is '||p_rule_rec.attribute2);
420: end if;
421:
414: ELSIF ( r_seg.application_column_name = 'ATTRIBUTE2' )
415: THEN
416: if g_debug then
417: hr_utility.trace('');
418: hr_utility.trace('attribute 2 param is '||r_seg.end_user_column_name);
419: hr_utility.trace('attribute 2 param value is '||p_rule_rec.attribute2);
420: end if;
421:
422: p_param_rec.param2_value := p_rule_rec.attribute2;
415: THEN
416: if g_debug then
417: hr_utility.trace('');
418: hr_utility.trace('attribute 2 param is '||r_seg.end_user_column_name);
419: hr_utility.trace('attribute 2 param value is '||p_rule_rec.attribute2);
420: end if;
421:
422: p_param_rec.param2_value := p_rule_rec.attribute2;
423: p_param_rec.param2 := UPPER(r_seg.end_user_column_name);
446:
447: ELSIF ( r_seg.application_column_name = 'ATTRIBUTE3' )
448: THEN
449: if g_debug then
450: hr_utility.trace('');
451: hr_utility.trace('attribute 3 param is '||r_seg.end_user_column_name);
452: hr_utility.trace('attribute 3 param value is '||p_rule_rec.attribute3);
453: end if;
454:
447: ELSIF ( r_seg.application_column_name = 'ATTRIBUTE3' )
448: THEN
449: if g_debug then
450: hr_utility.trace('');
451: hr_utility.trace('attribute 3 param is '||r_seg.end_user_column_name);
452: hr_utility.trace('attribute 3 param value is '||p_rule_rec.attribute3);
453: end if;
454:
455: p_param_rec.param3_value := p_rule_rec.attribute3;
448: THEN
449: if g_debug then
450: hr_utility.trace('');
451: hr_utility.trace('attribute 3 param is '||r_seg.end_user_column_name);
452: hr_utility.trace('attribute 3 param value is '||p_rule_rec.attribute3);
453: end if;
454:
455: p_param_rec.param3_value := p_rule_rec.attribute3;
456: p_param_rec.param3 := UPPER(r_seg.end_user_column_name);
809:
810: END LOOP; -- csr_get_flex_segments
811:
812: if g_debug then
813: hr_utility.set_location('Leaving '||l_proc, 20);
814: end if;
815:
816:
817: END decode_formula_segments;
919:
920: END IF;
921:
922: if g_debug then
923: hr_utility.trace('');
924: hr_utility.trace(' ********** Fix Periods ************** ');
925: hr_utility.trace(' TC period start is :'||TO_CHAR(l_period_tab(x).period_start, 'DD-MON-YY HH24:MI:SS'));
926: hr_utility.trace(' TC period end is :'||TO_CHAR(l_period_tab(x).period_end, 'DD-MON-YY HH24:MI:SS'));
927: hr_utility.trace(' pre TC period start is :'||TO_CHAR(l_period_tab(x).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
920: END IF;
921:
922: if g_debug then
923: hr_utility.trace('');
924: hr_utility.trace(' ********** Fix Periods ************** ');
925: hr_utility.trace(' TC period start is :'||TO_CHAR(l_period_tab(x).period_start, 'DD-MON-YY HH24:MI:SS'));
926: hr_utility.trace(' TC period end is :'||TO_CHAR(l_period_tab(x).period_end, 'DD-MON-YY HH24:MI:SS'));
927: hr_utility.trace(' pre TC period start is :'||TO_CHAR(l_period_tab(x).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
928: hr_utility.trace(' pre TC period end is :'||TO_CHAR(l_period_tab(x).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
921:
922: if g_debug then
923: hr_utility.trace('');
924: hr_utility.trace(' ********** Fix Periods ************** ');
925: hr_utility.trace(' TC period start is :'||TO_CHAR(l_period_tab(x).period_start, 'DD-MON-YY HH24:MI:SS'));
926: hr_utility.trace(' TC period end is :'||TO_CHAR(l_period_tab(x).period_end, 'DD-MON-YY HH24:MI:SS'));
927: hr_utility.trace(' pre TC period start is :'||TO_CHAR(l_period_tab(x).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
928: hr_utility.trace(' pre TC period end is :'||TO_CHAR(l_period_tab(x).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
929: hr_utility.trace(' post TC period start is:'||TO_CHAR(l_period_tab(x).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
922: if g_debug then
923: hr_utility.trace('');
924: hr_utility.trace(' ********** Fix Periods ************** ');
925: hr_utility.trace(' TC period start is :'||TO_CHAR(l_period_tab(x).period_start, 'DD-MON-YY HH24:MI:SS'));
926: hr_utility.trace(' TC period end is :'||TO_CHAR(l_period_tab(x).period_end, 'DD-MON-YY HH24:MI:SS'));
927: hr_utility.trace(' pre TC period start is :'||TO_CHAR(l_period_tab(x).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
928: hr_utility.trace(' pre TC period end is :'||TO_CHAR(l_period_tab(x).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
929: hr_utility.trace(' post TC period start is:'||TO_CHAR(l_period_tab(x).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
930: hr_utility.trace(' post TC period end is :'||TO_CHAR(l_period_tab(x).db_post_period_end, 'DD-MON-YY HH24:MI:SS'));
923: hr_utility.trace('');
924: hr_utility.trace(' ********** Fix Periods ************** ');
925: hr_utility.trace(' TC period start is :'||TO_CHAR(l_period_tab(x).period_start, 'DD-MON-YY HH24:MI:SS'));
926: hr_utility.trace(' TC period end is :'||TO_CHAR(l_period_tab(x).period_end, 'DD-MON-YY HH24:MI:SS'));
927: hr_utility.trace(' pre TC period start is :'||TO_CHAR(l_period_tab(x).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
928: hr_utility.trace(' pre TC period end is :'||TO_CHAR(l_period_tab(x).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
929: hr_utility.trace(' post TC period start is:'||TO_CHAR(l_period_tab(x).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
930: hr_utility.trace(' post TC period end is :'||TO_CHAR(l_period_tab(x).db_post_period_end, 'DD-MON-YY HH24:MI:SS'));
931: end if;
924: hr_utility.trace(' ********** Fix Periods ************** ');
925: hr_utility.trace(' TC period start is :'||TO_CHAR(l_period_tab(x).period_start, 'DD-MON-YY HH24:MI:SS'));
926: hr_utility.trace(' TC period end is :'||TO_CHAR(l_period_tab(x).period_end, 'DD-MON-YY HH24:MI:SS'));
927: hr_utility.trace(' pre TC period start is :'||TO_CHAR(l_period_tab(x).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
928: hr_utility.trace(' pre TC period end is :'||TO_CHAR(l_period_tab(x).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
929: hr_utility.trace(' post TC period start is:'||TO_CHAR(l_period_tab(x).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
930: hr_utility.trace(' post TC period end is :'||TO_CHAR(l_period_tab(x).db_post_period_end, 'DD-MON-YY HH24:MI:SS'));
931: end if;
932:
925: hr_utility.trace(' TC period start is :'||TO_CHAR(l_period_tab(x).period_start, 'DD-MON-YY HH24:MI:SS'));
926: hr_utility.trace(' TC period end is :'||TO_CHAR(l_period_tab(x).period_end, 'DD-MON-YY HH24:MI:SS'));
927: hr_utility.trace(' pre TC period start is :'||TO_CHAR(l_period_tab(x).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
928: hr_utility.trace(' pre TC period end is :'||TO_CHAR(l_period_tab(x).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
929: hr_utility.trace(' post TC period start is:'||TO_CHAR(l_period_tab(x).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
930: hr_utility.trace(' post TC period end is :'||TO_CHAR(l_period_tab(x).db_post_period_end, 'DD-MON-YY HH24:MI:SS'));
931: end if;
932:
933: END LOOP;
926: hr_utility.trace(' TC period end is :'||TO_CHAR(l_period_tab(x).period_end, 'DD-MON-YY HH24:MI:SS'));
927: hr_utility.trace(' pre TC period start is :'||TO_CHAR(l_period_tab(x).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
928: hr_utility.trace(' pre TC period end is :'||TO_CHAR(l_period_tab(x).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
929: hr_utility.trace(' post TC period start is:'||TO_CHAR(l_period_tab(x).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
930: hr_utility.trace(' post TC period end is :'||TO_CHAR(l_period_tab(x).db_post_period_end, 'DD-MON-YY HH24:MI:SS'));
931: end if;
932:
933: END LOOP;
934:
937: END fix_periods;
938:
939: BEGIN
940:
941: g_debug:=hr_utility.debug_enabled;
942: if g_debug then
943: l_proc := g_package||'.execute_approval_formula';
944: hr_utility.set_location('Entering '||l_proc, 10);
945: end if;
940:
941: g_debug:=hr_utility.debug_enabled;
942: if g_debug then
943: l_proc := g_package||'.execute_approval_formula';
944: hr_utility.set_location('Entering '||l_proc, 10);
945: end if;
946:
947: decode_formula_segments (
948: p_formula_name => p_rule_rec.formula_name
952: , p_reference_value => l_reference_period
953: , p_consider_zero_hours => l_consider_zero_hours );
954:
955: if g_debug then
956: hr_utility.set_location('Processing '||l_proc, 30);
957: end if;
958:
959: IF ( l_period_id IS NULL )
960: THEN
959: IF ( l_period_id IS NULL )
960: THEN
961:
962: if g_debug then
963: hr_utility.set_location('Processing '||l_proc, 40);
964: end if;
965:
966:
967: -- no period id entered via TER thus use application period
968:
969: l_period_end_date := TO_DATE(TO_CHAR(p_period_end_date, 'DD/MM/YYYY')||' 23:59:59','DD/MM/YYYY HH24:MI:SS');
970:
971: if g_debug then
972: hr_utility.trace('Application approval period start is '||TO_CHAR(p_period_start_date, 'DD-MON-YY HH24:MI:SS'));
973: hr_utility.trace('Application approval period end is ' ||TO_CHAR(l_period_end_date, 'DD-MON-YY HH24:MI:SS'));
974: end if;
975:
976: hxc_time_entry_rules_utils_pkg.calc_timecard_periods (
969: l_period_end_date := TO_DATE(TO_CHAR(p_period_end_date, 'DD/MM/YYYY')||' 23:59:59','DD/MM/YYYY HH24:MI:SS');
970:
971: if g_debug then
972: hr_utility.trace('Application approval period start is '||TO_CHAR(p_period_start_date, 'DD-MON-YY HH24:MI:SS'));
973: hr_utility.trace('Application approval period end is ' ||TO_CHAR(l_period_end_date, 'DD-MON-YY HH24:MI:SS'));
974: end if;
975:
976: hxc_time_entry_rules_utils_pkg.calc_timecard_periods (
977: p_timecard_period_start => p_tc_period_start_date
983:
984: ELSE -- user entered period via TER thus override application period
985:
986: if g_debug then
987: hr_utility.set_location('Processing '||l_proc, 50);
988: end if;
989:
990: /* NOTE: This code pulled from hxc_time_Entry_rules_utils_pkg */
991:
994: FETCH hxc_time_entry_rules_utils_pkg.csr_get_period_info INTO l_period_type, l_duration_in_days, l_period_start;
995: CLOSE hxc_time_entry_rules_utils_pkg.csr_get_period_info;
996:
997: if g_debug then
998: hr_utility.trace('');
999: hr_utility.trace('*********** Period Info ************');
1000: hr_utility.trace('period type is '||l_period_type);
1001: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1002: hr_utility.trace('period start date is '||TO_CHAR(l_period_start,'DD-MON-YY HH24:MI:SS'));
995: CLOSE hxc_time_entry_rules_utils_pkg.csr_get_period_info;
996:
997: if g_debug then
998: hr_utility.trace('');
999: hr_utility.trace('*********** Period Info ************');
1000: hr_utility.trace('period type is '||l_period_type);
1001: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1002: hr_utility.trace('period start date is '||TO_CHAR(l_period_start,'DD-MON-YY HH24:MI:SS'));
1003: end if;
996:
997: if g_debug then
998: hr_utility.trace('');
999: hr_utility.trace('*********** Period Info ************');
1000: hr_utility.trace('period type is '||l_period_type);
1001: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1002: hr_utility.trace('period start date is '||TO_CHAR(l_period_start,'DD-MON-YY HH24:MI:SS'));
1003: end if;
1004:
997: if g_debug then
998: hr_utility.trace('');
999: hr_utility.trace('*********** Period Info ************');
1000: hr_utility.trace('period type is '||l_period_type);
1001: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1002: hr_utility.trace('period start date is '||TO_CHAR(l_period_start,'DD-MON-YY HH24:MI:SS'));
1003: end if;
1004:
1005: -- gaz - remove this when function changed
998: hr_utility.trace('');
999: hr_utility.trace('*********** Period Info ************');
1000: hr_utility.trace('period type is '||l_period_type);
1001: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1002: hr_utility.trace('period start date is '||TO_CHAR(l_period_start,'DD-MON-YY HH24:MI:SS'));
1003: end if;
1004:
1005: -- gaz - remove this when function changed
1006:
1042:
1043: l_period_end_date := TO_DATE(TO_CHAR(l_period_end_date, 'DD/MM/YYYY')||' 23:59:59','DD/MM/YYYY HH24:MI:SS');
1044:
1045: if g_debug then
1046: Hr_utility.trace('');
1047: hr_utility.trace('*********** Period Start and End ************');
1048: hr_utility.trace('period start date is '||TO_CHAR(l_period_start_date,'DD-MON-YY HH24:MI:SS'));
1049: hr_utility.trace('period end date is '||TO_CHAR(l_period_end_date,'DD-MON-YY HH24:MI:SS'));
1050: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1043: l_period_end_date := TO_DATE(TO_CHAR(l_period_end_date, 'DD/MM/YYYY')||' 23:59:59','DD/MM/YYYY HH24:MI:SS');
1044:
1045: if g_debug then
1046: Hr_utility.trace('');
1047: hr_utility.trace('*********** Period Start and End ************');
1048: hr_utility.trace('period start date is '||TO_CHAR(l_period_start_date,'DD-MON-YY HH24:MI:SS'));
1049: hr_utility.trace('period end date is '||TO_CHAR(l_period_end_date,'DD-MON-YY HH24:MI:SS'));
1050: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1051: end if;
1044:
1045: if g_debug then
1046: Hr_utility.trace('');
1047: hr_utility.trace('*********** Period Start and End ************');
1048: hr_utility.trace('period start date is '||TO_CHAR(l_period_start_date,'DD-MON-YY HH24:MI:SS'));
1049: hr_utility.trace('period end date is '||TO_CHAR(l_period_end_date,'DD-MON-YY HH24:MI:SS'));
1050: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1051: end if;
1052:
1045: if g_debug then
1046: Hr_utility.trace('');
1047: hr_utility.trace('*********** Period Start and End ************');
1048: hr_utility.trace('period start date is '||TO_CHAR(l_period_start_date,'DD-MON-YY HH24:MI:SS'));
1049: hr_utility.trace('period end date is '||TO_CHAR(l_period_end_date,'DD-MON-YY HH24:MI:SS'));
1050: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1051: end if;
1052:
1053: -- now build up table of time entry rule periods that the timecard
1046: Hr_utility.trace('');
1047: hr_utility.trace('*********** Period Start and End ************');
1048: hr_utility.trace('period start date is '||TO_CHAR(l_period_start_date,'DD-MON-YY HH24:MI:SS'));
1049: hr_utility.trace('period end date is '||TO_CHAR(l_period_end_date,'DD-MON-YY HH24:MI:SS'));
1050: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1051: end if;
1052:
1053: -- now build up table of time entry rule periods that the timecard
1054: -- may span
1063:
1064: END IF; -- ( l_period_id IS NOT NULL )
1065:
1066: if g_debug then
1067: hr_utility.set_location('Processing '||l_proc, 60);
1068: end if;
1069:
1070: -- set submission date to be within valid assignment
1071:
1084: FOR p IN l_period_tab.FIRST .. l_period_tab.LAST
1085: LOOP
1086:
1087: if g_debug then
1088: hr_utility.set_location('Processing '||l_proc, 70);
1089: end if;
1090:
1091: l_timecard_hrs := 0;
1092:
1090:
1091: l_timecard_hrs := 0;
1092:
1093: if g_debug then
1094: hr_utility.set_location('Processing '||l_proc, 80);
1095: end if;
1096:
1097: -- Execute the formula
1098:
1096:
1097: -- Execute the formula
1098:
1099: if g_debug then
1100: hr_utility.trace('Before call to execute formula');
1101: end if;
1102:
1103: -- GPM v115.19
1104: -- take the greater of the first assignment date or the period start date
1119: , p_duration_in_days => 1
1120: , p_param_rec => l_param_rec );
1121:
1122: if g_debug then
1123: hr_utility.set_location('Processing '||l_proc, 100);
1124: end if;
1125:
1126: --
1127: if g_debug then
1124: end if;
1125:
1126: --
1127: if g_debug then
1128: hr_utility.trace('After call to execute formula');
1129: end if;
1130: --
1131: -- Analyze the outputs
1132: --
1135: --
1136: IF (l_outputs(l_count).name = 'TO_APPROVE') THEN
1137:
1138: if g_debug then
1139: hr_utility.set_location('Processing '||l_proc, 110);
1140: end if;
1141:
1142: l_result := l_outputs(l_count).value;
1143:
1171:
1172: IF ( p = 1 AND l_period_id IS NULL )
1173: THEN
1174: if g_debug then
1175: hr_utility.set_location('Processing '||l_proc, 90);
1176: end if;
1177:
1178: -- remember only want to do this once for the
1179: -- application approval period
1183:
1184: END LOOP; -- period loop
1185:
1186: if g_debug then
1187: hr_utility.set_location('Processing '||l_proc, 120);
1188: end if;
1189:
1190:
1191: -- we used to populate the message table here but the approval
1192: -- process does not currently support ANY message being returned
1193: -- for the formulas executed in the date interdependcy rules
1194:
1195: if g_debug then
1196: hr_utility.set_location('Processing '||l_proc, 130);
1197: end if;
1198:
1199: if g_debug then
1200: hr_utility.trace('l result is '||l_result);
1196: hr_utility.set_location('Processing '||l_proc, 130);
1197: end if;
1198:
1199: if g_debug then
1200: hr_utility.trace('l result is '||l_result);
1201: end if;
1202:
1203: RETURN l_result;
1204:
1204:
1205: EXCEPTION WHEN OTHERS THEN
1206:
1207: if g_debug then
1208: hr_utility.trace('In exception : '||SQLERRM);
1209: end if;
1210:
1211: raise;
1212: