3: --
4: -- Package Variables
5: --
6:
7: g_debug boolean := hr_utility.debug_enabled;
8:
9: TYPE r_message_record IS RECORD ( name fnd_new_messages.message_name%TYPE,
10: token_name varchar2(240),
11: token_value varchar2(4000),
24:
25: deletedFlag boolean := true;
26:
27: BEGIN
28: g_debug := hr_utility.debug_enabled;
29:
30: if g_debug then
31: l_proc := g_package||'get_timecard_info';
32: hr_utility.set_location('Entering '||l_proc, 10);
28: g_debug := hr_utility.debug_enabled;
29:
30: if g_debug then
31: l_proc := g_package||'get_timecard_info';
32: hr_utility.set_location('Entering '||l_proc, 10);
33: end if;
34:
35: l_tbb_index := p_time_building_blocks.FIRST;
36:
39:
40: IF p_time_building_blocks(l_tbb_index).SCOPE = 'TIMECARD'
41: THEN
42: if g_debug then
43: hr_utility.trace('************* Timecard details *****************');
44: hr_utility.trace('timecard bb id is '||to_char(p_time_building_blocks(l_tbb_index).time_building_block_id));
45: hr_utility.trace('timecard ovn is '||to_char(p_time_building_blocks(l_tbb_index).object_version_number));
46: hr_utility.trace('start time is '||to_char(p_time_building_blocks(l_tbb_index).start_time, 'dd-mon-yyyy hh24:mi:ss'));
47: hr_utility.trace('stop time is ' ||to_char(p_time_building_blocks(l_tbb_index).stop_time, 'dd-mon-yyyy hh24:mi:ss'));
40: IF p_time_building_blocks(l_tbb_index).SCOPE = 'TIMECARD'
41: THEN
42: if g_debug then
43: hr_utility.trace('************* Timecard details *****************');
44: hr_utility.trace('timecard bb id is '||to_char(p_time_building_blocks(l_tbb_index).time_building_block_id));
45: hr_utility.trace('timecard ovn is '||to_char(p_time_building_blocks(l_tbb_index).object_version_number));
46: hr_utility.trace('start time is '||to_char(p_time_building_blocks(l_tbb_index).start_time, 'dd-mon-yyyy hh24:mi:ss'));
47: hr_utility.trace('stop time is ' ||to_char(p_time_building_blocks(l_tbb_index).stop_time, 'dd-mon-yyyy hh24:mi:ss'));
48: hr_utility.trace('resource id is '||to_char(p_time_building_blocks(l_tbb_index).resource_id));
41: THEN
42: if g_debug then
43: hr_utility.trace('************* Timecard details *****************');
44: hr_utility.trace('timecard bb id is '||to_char(p_time_building_blocks(l_tbb_index).time_building_block_id));
45: hr_utility.trace('timecard ovn is '||to_char(p_time_building_blocks(l_tbb_index).object_version_number));
46: hr_utility.trace('start time is '||to_char(p_time_building_blocks(l_tbb_index).start_time, 'dd-mon-yyyy hh24:mi:ss'));
47: hr_utility.trace('stop time is ' ||to_char(p_time_building_blocks(l_tbb_index).stop_time, 'dd-mon-yyyy hh24:mi:ss'));
48: hr_utility.trace('resource id is '||to_char(p_time_building_blocks(l_tbb_index).resource_id));
49: hr_utility.trace('************************************************');
42: if g_debug then
43: hr_utility.trace('************* Timecard details *****************');
44: hr_utility.trace('timecard bb id is '||to_char(p_time_building_blocks(l_tbb_index).time_building_block_id));
45: hr_utility.trace('timecard ovn is '||to_char(p_time_building_blocks(l_tbb_index).object_version_number));
46: hr_utility.trace('start time is '||to_char(p_time_building_blocks(l_tbb_index).start_time, 'dd-mon-yyyy hh24:mi:ss'));
47: hr_utility.trace('stop time is ' ||to_char(p_time_building_blocks(l_tbb_index).stop_time, 'dd-mon-yyyy hh24:mi:ss'));
48: hr_utility.trace('resource id is '||to_char(p_time_building_blocks(l_tbb_index).resource_id));
49: hr_utility.trace('************************************************');
50: end if;
43: hr_utility.trace('************* Timecard details *****************');
44: hr_utility.trace('timecard bb id is '||to_char(p_time_building_blocks(l_tbb_index).time_building_block_id));
45: hr_utility.trace('timecard ovn is '||to_char(p_time_building_blocks(l_tbb_index).object_version_number));
46: hr_utility.trace('start time is '||to_char(p_time_building_blocks(l_tbb_index).start_time, 'dd-mon-yyyy hh24:mi:ss'));
47: hr_utility.trace('stop time is ' ||to_char(p_time_building_blocks(l_tbb_index).stop_time, 'dd-mon-yyyy hh24:mi:ss'));
48: hr_utility.trace('resource id is '||to_char(p_time_building_blocks(l_tbb_index).resource_id));
49: hr_utility.trace('************************************************');
50: end if;
51:
44: hr_utility.trace('timecard bb id is '||to_char(p_time_building_blocks(l_tbb_index).time_building_block_id));
45: hr_utility.trace('timecard ovn is '||to_char(p_time_building_blocks(l_tbb_index).object_version_number));
46: hr_utility.trace('start time is '||to_char(p_time_building_blocks(l_tbb_index).start_time, 'dd-mon-yyyy hh24:mi:ss'));
47: hr_utility.trace('stop time is ' ||to_char(p_time_building_blocks(l_tbb_index).stop_time, 'dd-mon-yyyy hh24:mi:ss'));
48: hr_utility.trace('resource id is '||to_char(p_time_building_blocks(l_tbb_index).resource_id));
49: hr_utility.trace('************************************************');
50: end if;
51:
52: p_timecard_rec.start_date := p_time_building_blocks(l_tbb_index).start_time;
45: hr_utility.trace('timecard ovn is '||to_char(p_time_building_blocks(l_tbb_index).object_version_number));
46: hr_utility.trace('start time is '||to_char(p_time_building_blocks(l_tbb_index).start_time, 'dd-mon-yyyy hh24:mi:ss'));
47: hr_utility.trace('stop time is ' ||to_char(p_time_building_blocks(l_tbb_index).stop_time, 'dd-mon-yyyy hh24:mi:ss'));
48: hr_utility.trace('resource id is '||to_char(p_time_building_blocks(l_tbb_index).resource_id));
49: hr_utility.trace('************************************************');
50: end if;
51:
52: p_timecard_rec.start_date := p_time_building_blocks(l_tbb_index).start_time;
53: p_timecard_rec.end_date := p_time_building_blocks(l_tbb_index).stop_time;
81: end if;
82:
83:
84: if g_debug then
85: hr_utility.set_location('Leaving '||l_proc, 20);
86: end if;
87:
88: END get_timecard_info;
89:
97:
98: l_att_index BINARY_INTEGER;
99:
100: BEGIN
101: g_debug := hr_utility.debug_enabled;
102:
103: if g_debug then
104: l_proc := g_package||'get_timecard_info';
105: hr_utility.set_location('Entering '||l_proc, 10);
101: g_debug := hr_utility.debug_enabled;
102:
103: if g_debug then
104: l_proc := g_package||'get_timecard_info';
105: hr_utility.set_location('Entering '||l_proc, 10);
106: end if;
107:
108: get_timecard_info ( p_time_building_blocks => p_time_building_blocks
109: , p_timecard_rec => p_timecard_rec );
115:
116: IF ( p_time_attributes(l_att_index).attribute_category = 'SECURITY' )
117: THEN
118: if g_debug then
119: hr_utility.set_location('Processing '||l_proc, 30);
120: end if;
121:
122: p_timecard_rec.bg_id := TO_NUMBER(p_time_attributes(l_att_index).attribute2);
123:
129:
130: END LOOP;
131:
132: if g_debug then
133: hr_utility.set_location('Leaving '||l_proc, 20);
134: end if;
135:
136: END get_timecard_info;
137:
167: l_period_start_date DATE;
168: l_period_end_date DATE;
169:
170: BEGIN
171: g_debug := hr_utility.debug_enabled;
172:
173: if g_debug then
174: l_proc := g_package||'calc_timecard_periods';
175: hr_utility.set_location('Entering '||l_proc, 10);
171: g_debug := hr_utility.debug_enabled;
172:
173: if g_debug then
174: l_proc := g_package||'calc_timecard_periods';
175: hr_utility.set_location('Entering '||l_proc, 10);
176: end if;
177:
178: l_period_start_date := p_period_start_date;
179: l_period_end_date := p_period_end_date;
181: WHILE ( l_period_start_date <= p_timecard_period_end )
182: LOOP
183:
184: if g_debug then
185: hr_utility.set_location('Processing '||l_proc, 20);
186: end if;
187:
188:
189: IF ( l_period_start_date >= p_timecard_period_start AND
190: TRUNC(l_period_end_date) <= p_timecard_period_end )
191: THEN
192:
193: if g_debug then
194: hr_utility.set_location('Processing '||l_proc, 30);
195: end if;
196:
197: -- period completely within TCO
198:
208: TRUNC(l_period_end_date) <= p_timecard_period_end )
209: THEN
210:
211: if g_debug then
212: hr_utility.set_location('Processing '||l_proc, 40);
213: end if;
214:
215: -- period includes TC and stradles TCO start
216:
237: TRUNC(l_period_end_date) > p_timecard_period_end )
238: THEN
239:
240: if g_debug then
241: hr_utility.set_location('Processing '||l_proc, 50);
242: end if;
243:
244: -- period includes TC and stradles TC end
245:
258: TRUNC(l_period_end_date) > p_timecard_period_end )
259: THEN
260:
261: if g_debug then
262: hr_utility.set_location('Processing '||l_proc, 60);
263: end if;
264:
265: -- period completely stradles TCO
266:
277:
278: END IF;
279:
280: if g_debug then
281: hr_utility.trace('');
282: hr_utility.trace(' ********** Periods ************** ');
283: hr_utility.trace(' Actual TC period start is :'||TO_CHAR(p_timecard_period_start, 'DD-MON-YY HH24:MI:SS'));
284: hr_utility.trace(' Actual TC period end is :'||TO_CHAR(p_timecard_period_end, 'DD-MON-YY HH24:MI:SS'));
285: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
278: END IF;
279:
280: if g_debug then
281: hr_utility.trace('');
282: hr_utility.trace(' ********** Periods ************** ');
283: hr_utility.trace(' Actual TC period start is :'||TO_CHAR(p_timecard_period_start, 'DD-MON-YY HH24:MI:SS'));
284: hr_utility.trace(' Actual TC period end is :'||TO_CHAR(p_timecard_period_end, 'DD-MON-YY HH24:MI:SS'));
285: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
286: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
279:
280: if g_debug then
281: hr_utility.trace('');
282: hr_utility.trace(' ********** Periods ************** ');
283: hr_utility.trace(' Actual TC period start is :'||TO_CHAR(p_timecard_period_start, 'DD-MON-YY HH24:MI:SS'));
284: hr_utility.trace(' Actual TC period end is :'||TO_CHAR(p_timecard_period_end, 'DD-MON-YY HH24:MI:SS'));
285: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
286: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
287: hr_utility.trace(' pre TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
280: if g_debug then
281: hr_utility.trace('');
282: hr_utility.trace(' ********** Periods ************** ');
283: hr_utility.trace(' Actual TC period start is :'||TO_CHAR(p_timecard_period_start, 'DD-MON-YY HH24:MI:SS'));
284: hr_utility.trace(' Actual TC period end is :'||TO_CHAR(p_timecard_period_end, 'DD-MON-YY HH24:MI:SS'));
285: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
286: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
287: hr_utility.trace(' pre TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
288: hr_utility.trace(' pre TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
281: hr_utility.trace('');
282: hr_utility.trace(' ********** Periods ************** ');
283: hr_utility.trace(' Actual TC period start is :'||TO_CHAR(p_timecard_period_start, 'DD-MON-YY HH24:MI:SS'));
284: hr_utility.trace(' Actual TC period end is :'||TO_CHAR(p_timecard_period_end, 'DD-MON-YY HH24:MI:SS'));
285: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
286: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
287: hr_utility.trace(' pre TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
288: hr_utility.trace(' pre TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
289: hr_utility.trace(' post TC period start is:'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
282: hr_utility.trace(' ********** Periods ************** ');
283: hr_utility.trace(' Actual TC period start is :'||TO_CHAR(p_timecard_period_start, 'DD-MON-YY HH24:MI:SS'));
284: hr_utility.trace(' Actual TC period end is :'||TO_CHAR(p_timecard_period_end, 'DD-MON-YY HH24:MI:SS'));
285: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
286: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
287: hr_utility.trace(' pre TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
288: hr_utility.trace(' pre TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
289: hr_utility.trace(' post TC period start is:'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
290: hr_utility.trace(' post TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_end, 'DD-MON-YY HH24:MI:SS'));
283: hr_utility.trace(' Actual TC period start is :'||TO_CHAR(p_timecard_period_start, 'DD-MON-YY HH24:MI:SS'));
284: hr_utility.trace(' Actual TC period end is :'||TO_CHAR(p_timecard_period_end, 'DD-MON-YY HH24:MI:SS'));
285: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
286: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
287: hr_utility.trace(' pre TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
288: hr_utility.trace(' pre TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
289: hr_utility.trace(' post TC period start is:'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
290: hr_utility.trace(' post TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_end, 'DD-MON-YY HH24:MI:SS'));
291: end if;
284: hr_utility.trace(' Actual TC period end is :'||TO_CHAR(p_timecard_period_end, 'DD-MON-YY HH24:MI:SS'));
285: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
286: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
287: hr_utility.trace(' pre TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
288: hr_utility.trace(' pre TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
289: hr_utility.trace(' post TC period start is:'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
290: hr_utility.trace(' post TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_end, 'DD-MON-YY HH24:MI:SS'));
291: end if;
292:
285: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
286: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
287: hr_utility.trace(' pre TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
288: hr_utility.trace(' pre TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
289: hr_utility.trace(' post TC period start is:'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
290: hr_utility.trace(' post TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_end, 'DD-MON-YY HH24:MI:SS'));
291: end if;
292:
293: l_period_start_date := l_period_start_date + p_duration_in_days;
286: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
287: hr_utility.trace(' pre TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
288: hr_utility.trace(' pre TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
289: hr_utility.trace(' post TC period start is:'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
290: hr_utility.trace(' post TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_end, 'DD-MON-YY HH24:MI:SS'));
291: end if;
292:
293: l_period_start_date := l_period_start_date + p_duration_in_days;
294: l_period_end_date := l_period_end_date + p_duration_in_days;
293: l_period_start_date := l_period_start_date + p_duration_in_days;
294: l_period_end_date := l_period_end_date + p_duration_in_days;
295:
296: if g_debug then
297: hr_utility.trace('');
298: hr_utility.trace('start is '||to_char(l_period_start_date, 'dd-mon-yyyy hh24:mi:ss'));
299: hr_utility.trace('end is '||to_char(l_period_end_date, 'dd-mon-yyyy hh24:mi:ss'));
300: hr_utility.trace('');
301: end if;
294: l_period_end_date := l_period_end_date + p_duration_in_days;
295:
296: if g_debug then
297: hr_utility.trace('');
298: hr_utility.trace('start is '||to_char(l_period_start_date, 'dd-mon-yyyy hh24:mi:ss'));
299: hr_utility.trace('end is '||to_char(l_period_end_date, 'dd-mon-yyyy hh24:mi:ss'));
300: hr_utility.trace('');
301: end if;
302:
295:
296: if g_debug then
297: hr_utility.trace('');
298: hr_utility.trace('start is '||to_char(l_period_start_date, 'dd-mon-yyyy hh24:mi:ss'));
299: hr_utility.trace('end is '||to_char(l_period_end_date, 'dd-mon-yyyy hh24:mi:ss'));
300: hr_utility.trace('');
301: end if;
302:
303: l_cnt := l_cnt + 1;
296: if g_debug then
297: hr_utility.trace('');
298: hr_utility.trace('start is '||to_char(l_period_start_date, 'dd-mon-yyyy hh24:mi:ss'));
299: hr_utility.trace('end is '||to_char(l_period_end_date, 'dd-mon-yyyy hh24:mi:ss'));
300: hr_utility.trace('');
301: end if;
302:
303: l_cnt := l_cnt + 1;
304:
304:
305: END LOOP;
306:
307: if g_debug then
308: hr_utility.set_location('Leaving '||l_proc, 70);
309: end if;
310:
311: END calc_timecard_periods;
312:
331: l_ref_period_end DATE;
332:
333: BEGIN
334:
335: g_debug := hr_utility.debug_enabled;
336:
337: if g_debug then
338: l_proc := g_package||'calc_reference_periods';
339: hr_utility.set_location('Entering '||l_proc, 10);
335: g_debug := hr_utility.debug_enabled;
336:
337: if g_debug then
338: l_proc := g_package||'calc_reference_periods';
339: hr_utility.set_location('Entering '||l_proc, 10);
340: end if;
341:
342: l_period_start_date := p_period_start_date;
343: l_period_end_date := p_period_end_date;
348: WHILE ( l_period_start_date <= p_timecard_period_end )
349: LOOP
350:
351: if g_debug then
352: hr_utility.set_location('Processing '||l_proc, 20);
353: end if;
354:
355: IF ( l_period_start_date >= p_timecard_period_start AND
356: TRUNC(l_period_end_date) <= p_timecard_period_end )
356: TRUNC(l_period_end_date) <= p_timecard_period_end )
357: THEN
358:
359: if g_debug then
360: hr_utility.set_location('Entering '||l_proc, 30);
361: end if;
362:
363: -- timecard period completely within TCO
364:
369: l_ref_period_start >= p_timecard_period_start )
370: THEN
371:
372: if g_debug then
373: hr_utility.set_location('Entering '||l_proc, 40);
374: end if;
375:
376: -- ref period completely enclosed in TCO
377:
384: l_ref_period_start < p_timecard_period_start )
385: THEN
386:
387: if g_debug then
388: hr_utility.set_location('Entering '||l_proc, 50);
389: end if;
390:
391: -- ref period stradles start of TCO or end falls exactly on TC start
392:
398:
399: ELSE
400:
401: if g_debug then
402: hr_utility.set_location('Entering '||l_proc, 70);
403: end if;
404:
405: p_periods_tab(l_cnt).db_ref_period_start := l_ref_period_start;
406: p_periods_tab(l_cnt).db_ref_period_end :=
413: TRUNC(l_period_end_date) <= p_timecard_period_end )
414: THEN
415:
416: if g_debug then
417: hr_utility.set_location('Entering '||l_proc, 80);
418: end if;
419:
420: -- period includes TC and stradles TCO start
421:
427: TRUNC(l_period_end_date) > p_timecard_period_end )
428: THEN
429:
430: if g_debug then
431: hr_utility.set_location('Entering '||l_proc, 90);
432: end if;
433:
434: -- period includes TC and stradles TC end
435:
439: l_ref_period_start >= p_timecard_period_start )
440: THEN
441:
442: if g_debug then
443: hr_utility.set_location('Entering '||l_proc, 100);
444: end if;
445:
446: -- reference period completely enclosed in TCO
447:
454: l_ref_period_start < p_timecard_period_start )
455: THEN
456:
457: if g_debug then
458: hr_utility.set_location('Entering '||l_proc, 110);
459: end if;
460:
461: -- ref period stradles start of TCO or end falls exactly on start of TCO
462:
468:
469: ELSE
470:
471: if g_debug then
472: hr_utility.set_location('Entering '||l_proc, 130);
473: end if;
474:
475: p_periods_tab(l_cnt).db_ref_period_start := l_ref_period_start;
476: p_periods_tab(l_cnt).db_ref_period_end :=
482: l_period_end_date > p_timecard_period_end )
483: THEN
484:
485: if g_debug then
486: hr_utility.set_location('Entering '||l_proc, 140);
487: end if;
488:
489: -- period completely stradles TCO
490: -- reference period outside of TCO
495:
496: END IF;
497:
498: if g_debug then
499: hr_utility.trace('');
500: hr_utility.trace(' ********** Periods ************** ');
501: hr_utility.trace(' Actual TC period start is :'||TO_CHAR(p_timecard_period_start, 'DD-MON-YY HH24:MI:SS'));
502: hr_utility.trace(' Actual TC period end is :'||TO_CHAR(p_timecard_period_end, 'DD-MON-YY HH24:MI:SS'));
503: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
496: END IF;
497:
498: if g_debug then
499: hr_utility.trace('');
500: hr_utility.trace(' ********** Periods ************** ');
501: hr_utility.trace(' Actual TC period start is :'||TO_CHAR(p_timecard_period_start, 'DD-MON-YY HH24:MI:SS'));
502: hr_utility.trace(' Actual TC period end is :'||TO_CHAR(p_timecard_period_end, 'DD-MON-YY HH24:MI:SS'));
503: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
504: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
497:
498: if g_debug then
499: hr_utility.trace('');
500: hr_utility.trace(' ********** Periods ************** ');
501: hr_utility.trace(' Actual TC period start is :'||TO_CHAR(p_timecard_period_start, 'DD-MON-YY HH24:MI:SS'));
502: hr_utility.trace(' Actual TC period end is :'||TO_CHAR(p_timecard_period_end, 'DD-MON-YY HH24:MI:SS'));
503: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
504: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
505: hr_utility.trace(' pre TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
498: if g_debug then
499: hr_utility.trace('');
500: hr_utility.trace(' ********** Periods ************** ');
501: hr_utility.trace(' Actual TC period start is :'||TO_CHAR(p_timecard_period_start, 'DD-MON-YY HH24:MI:SS'));
502: hr_utility.trace(' Actual TC period end is :'||TO_CHAR(p_timecard_period_end, 'DD-MON-YY HH24:MI:SS'));
503: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
504: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
505: hr_utility.trace(' pre TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
506: hr_utility.trace(' pre TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
499: hr_utility.trace('');
500: hr_utility.trace(' ********** Periods ************** ');
501: hr_utility.trace(' Actual TC period start is :'||TO_CHAR(p_timecard_period_start, 'DD-MON-YY HH24:MI:SS'));
502: hr_utility.trace(' Actual TC period end is :'||TO_CHAR(p_timecard_period_end, 'DD-MON-YY HH24:MI:SS'));
503: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
504: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
505: hr_utility.trace(' pre TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
506: hr_utility.trace(' pre TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
507: hr_utility.trace(' post TC period start is:'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
500: hr_utility.trace(' ********** Periods ************** ');
501: hr_utility.trace(' Actual TC period start is :'||TO_CHAR(p_timecard_period_start, 'DD-MON-YY HH24:MI:SS'));
502: hr_utility.trace(' Actual TC period end is :'||TO_CHAR(p_timecard_period_end, 'DD-MON-YY HH24:MI:SS'));
503: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
504: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
505: hr_utility.trace(' pre TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
506: hr_utility.trace(' pre TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
507: hr_utility.trace(' post TC period start is:'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
508: hr_utility.trace(' post TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_end, 'DD-MON-YY HH24:MI:SS'));
501: hr_utility.trace(' Actual TC period start is :'||TO_CHAR(p_timecard_period_start, 'DD-MON-YY HH24:MI:SS'));
502: hr_utility.trace(' Actual TC period end is :'||TO_CHAR(p_timecard_period_end, 'DD-MON-YY HH24:MI:SS'));
503: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
504: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
505: hr_utility.trace(' pre TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
506: hr_utility.trace(' pre TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
507: hr_utility.trace(' post TC period start is:'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
508: hr_utility.trace(' post TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_end, 'DD-MON-YY HH24:MI:SS'));
509: hr_utility.trace(' ref period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_ref_period_start, 'DD-MON-YY HH24:MI:SS'));
502: hr_utility.trace(' Actual TC period end is :'||TO_CHAR(p_timecard_period_end, 'DD-MON-YY HH24:MI:SS'));
503: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
504: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
505: hr_utility.trace(' pre TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
506: hr_utility.trace(' pre TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
507: hr_utility.trace(' post TC period start is:'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
508: hr_utility.trace(' post TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_end, 'DD-MON-YY HH24:MI:SS'));
509: hr_utility.trace(' ref period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_ref_period_start, 'DD-MON-YY HH24:MI:SS'));
510: hr_utility.trace(' ref period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_ref_period_end, 'DD-MON-YY HH24:MI:SS'));
503: hr_utility.trace(' TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).period_start, 'DD-MON-YY HH24:MI:SS'));
504: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
505: hr_utility.trace(' pre TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
506: hr_utility.trace(' pre TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
507: hr_utility.trace(' post TC period start is:'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
508: hr_utility.trace(' post TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_end, 'DD-MON-YY HH24:MI:SS'));
509: hr_utility.trace(' ref period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_ref_period_start, 'DD-MON-YY HH24:MI:SS'));
510: hr_utility.trace(' ref period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_ref_period_end, 'DD-MON-YY HH24:MI:SS'));
511: end if;
504: hr_utility.trace(' TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).period_end, 'DD-MON-YY HH24:MI:SS'));
505: hr_utility.trace(' pre TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
506: hr_utility.trace(' pre TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
507: hr_utility.trace(' post TC period start is:'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
508: hr_utility.trace(' post TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_end, 'DD-MON-YY HH24:MI:SS'));
509: hr_utility.trace(' ref period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_ref_period_start, 'DD-MON-YY HH24:MI:SS'));
510: hr_utility.trace(' ref period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_ref_period_end, 'DD-MON-YY HH24:MI:SS'));
511: end if;
512:
505: hr_utility.trace(' pre TC period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_start, 'DD-MON-YY HH24:MI:SS'));
506: hr_utility.trace(' pre TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
507: hr_utility.trace(' post TC period start is:'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
508: hr_utility.trace(' post TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_end, 'DD-MON-YY HH24:MI:SS'));
509: hr_utility.trace(' ref period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_ref_period_start, 'DD-MON-YY HH24:MI:SS'));
510: hr_utility.trace(' ref period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_ref_period_end, 'DD-MON-YY HH24:MI:SS'));
511: end if;
512:
513: l_period_start_date := l_period_start_date + p_duration_in_days;
506: hr_utility.trace(' pre TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_pre_period_end, 'DD-MON-YY HH24:MI:SS'));
507: hr_utility.trace(' post TC period start is:'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_start, 'DD-MON-YY HH24:MI:SS'));
508: hr_utility.trace(' post TC period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_post_period_end, 'DD-MON-YY HH24:MI:SS'));
509: hr_utility.trace(' ref period start is :'||TO_CHAR(p_periods_tab(l_cnt).db_ref_period_start, 'DD-MON-YY HH24:MI:SS'));
510: hr_utility.trace(' ref period end is :'||TO_CHAR(p_periods_tab(l_cnt).db_ref_period_end, 'DD-MON-YY HH24:MI:SS'));
511: end if;
512:
513: l_period_start_date := l_period_start_date + p_duration_in_days;
514: l_period_end_date := l_period_end_date + p_duration_in_days;
520:
521: END LOOP;
522:
523: if g_debug then
524: hr_utility.set_location('Leaving '||l_proc, 160);
525: end if;
526:
527: END calc_reference_periods;
528:
619: l_timecard_hrs NUMBER;
620:
621: BEGIN -- calc_timecard_hrs
622:
623: g_debug := hr_utility.debug_enabled;
624:
625: if g_debug then
626: l_proc := g_package||'calc_timecard_hrs';
627: hr_utility.trace('p hrs period start is :'||to_char(p_hrs_period_start, 'DD-MON-YYYY HH24:MI:SS'));
623: g_debug := hr_utility.debug_enabled;
624:
625: if g_debug then
626: l_proc := g_package||'calc_timecard_hrs';
627: hr_utility.trace('p hrs period start is :'||to_char(p_hrs_period_start, 'DD-MON-YYYY HH24:MI:SS'));
628: hr_utility.trace('p hrs period end is :'||to_char(p_hrs_period_end, 'DD-MON-YYYY HH24:MI:SS'));
629: end if;
630:
631: IF ( p_time_category_id IS NOT NULL )
624:
625: if g_debug then
626: l_proc := g_package||'calc_timecard_hrs';
627: hr_utility.trace('p hrs period start is :'||to_char(p_hrs_period_start, 'DD-MON-YYYY HH24:MI:SS'));
628: hr_utility.trace('p hrs period end is :'||to_char(p_hrs_period_end, 'DD-MON-YYYY HH24:MI:SS'));
629: end if;
630:
631: IF ( p_time_category_id IS NOT NULL )
632: THEN
631: IF ( p_time_category_id IS NOT NULL )
632: THEN
633:
634: if g_debug then
635: hr_utility.set_location('Processing '||l_proc, 15);
636: end if;
637:
638: hxc_time_category_utils_pkg.initialise_time_category (
639: p_time_category_id => p_time_category_id
657:
658: END IF;
659:
660: if g_debug then
661: hr_utility.trace('');
662: hr_utility.trace(' TC hours are '||TO_CHAR(l_timecard_hrs));
663: hr_utility.trace('');
664: end if;
665:
658: END IF;
659:
660: if g_debug then
661: hr_utility.trace('');
662: hr_utility.trace(' TC hours are '||TO_CHAR(l_timecard_hrs));
663: hr_utility.trace('');
664: end if;
665:
666: RETURN l_timecard_hrs;
659:
660: if g_debug then
661: hr_utility.trace('');
662: hr_utility.trace(' TC hours are '||TO_CHAR(l_timecard_hrs));
663: hr_utility.trace('');
664: end if;
665:
666: RETURN l_timecard_hrs;
667:
667:
668: exception when others then
669:
670: if g_debug then
671: hr_utility.trace('In exception ....');
672: hr_utility.trace(SUBSTR(SQLERRM,1 ,80));
673: hr_utility.trace(SUBSTR(SQLERRM,81, 160));
674: end if;
675:
668: exception when others then
669:
670: if g_debug then
671: hr_utility.trace('In exception ....');
672: hr_utility.trace(SUBSTR(SQLERRM,1 ,80));
673: hr_utility.trace(SUBSTR(SQLERRM,81, 160));
674: end if;
675:
676: raise;
669:
670: if g_debug then
671: hr_utility.trace('In exception ....');
672: hr_utility.trace(SUBSTR(SQLERRM,1 ,80));
673: hr_utility.trace(SUBSTR(SQLERRM,81, 160));
674: end if;
675:
676: raise;
677:
711: l_hrs NUMBER;
712:
713: BEGIN -- calc_timecard_hrs
714:
715: g_debug := hr_utility.debug_enabled;
716:
717: l_hrs := calc_timecard_hrs (
718: p_hrs_period_start => p_hrs_period_start
719: , p_hrs_period_end => p_hrs_period_end
722: , p_time_category_id => p_time_category_id );
723:
724: if g_debug then
725: l_proc := g_package||'calc_timecard_hrs';
726: hr_utility.trace('');
727: hr_utility.trace(' TC hours are '||TO_CHAR(l_hrs));
728: hr_utility.trace('');
729: end if;
730:
723:
724: if g_debug then
725: l_proc := g_package||'calc_timecard_hrs';
726: hr_utility.trace('');
727: hr_utility.trace(' TC hours are '||TO_CHAR(l_hrs));
728: hr_utility.trace('');
729: end if;
730:
731: RETURN l_hrs;
724: if g_debug then
725: l_proc := g_package||'calc_timecard_hrs';
726: hr_utility.trace('');
727: hr_utility.trace(' TC hours are '||TO_CHAR(l_hrs));
728: hr_utility.trace('');
729: end if;
730:
731: RETURN l_hrs;
732:
732:
733: exception when others then
734:
735: if g_debug then
736: hr_utility.trace(SUBSTR(SQLERRM,1 ,80));
737: hr_utility.trace(SUBSTR(SQLERRM,81, 160));
738: end if;
739:
740: raise;
733: exception when others then
734:
735: if g_debug then
736: hr_utility.trace(SUBSTR(SQLERRM,1 ,80));
737: hr_utility.trace(SUBSTR(SQLERRM,81, 160));
738: end if;
739:
740: raise;
741:
772: l_message_name FND_NEW_MESSAGES.MESSAGE_NAME%TYPE;
773: l_message_token varchar2(4000);
774:
775: BEGIN
776: g_debug := hr_utility.debug_enabled;
777:
778: if g_debug then
779: l_proc := g_package||'add_error_to_table';
780: hr_utility.set_location('Entering '||l_proc, 10);
776: g_debug := hr_utility.debug_enabled;
777:
778: if g_debug then
779: l_proc := g_package||'add_error_to_table';
780: hr_utility.set_location('Entering '||l_proc, 10);
781: end if;
782:
783: l_tbb_ovn := p_timecard_bb_ovn+1;
784:
784:
785: l_last_index := NVL(p_message_table.last,0);
786:
787: if g_debug then
788: hr_utility.trace('index is '||to_char(l_last_index));
789: end if;
790:
791: l_message_token := SUBSTR(p_message_token,1,4000);
792:
820: p_message_table(l_last_index+1).time_attribute_ovn := p_time_attribute_ovn;
821: p_message_table(l_last_index+1).message_extent := p_message_extent; --Bug#2873563
822:
823: if g_debug then
824: hr_utility.set_location('Leaving '||l_proc, 20);
825: end if;
826:
827: END add_error_to_table;
828:
1023: IF ( p_timecard_info.deleted = 'N' )
1024: THEN
1025:
1026: if g_debug then
1027: hr_utility.trace('Entering check_commit');
1028: end if;
1029:
1030: OPEN chk_global_table;
1031: FETCH chk_global_table INTO l_dummy;
1035:
1036: CLOSE chk_global_table;
1037:
1038: if g_debug then
1039: hr_utility.trace('hxc tmp bld blks empty');
1040: end if;
1041:
1042: add_error_to_table (
1043: p_message_table => p_message_table
1058:
1059: CLOSE chk_global_table;
1060:
1061: if g_debug then
1062: hr_utility.trace('hxc tmp bld blks populated');
1063: end if;
1064:
1065: RETURN TRUE;
1066:
1086: **********************************************/
1087:
1088: if g_debug then
1089: l_proc := g_package||'execute_formula';
1090: hr_utility.set_location('Processing '||l_proc, 10);
1091: end if;
1092:
1093: hxc_ff_dict.decode_formula_segments (
1094: p_formula_name => p_formula_name
1099: , p_consider_zero_hours => l_consider_zero_hours );
1100:
1101:
1102: if g_debug then
1103: hr_utility.trace(' ************* Param values are.... ************ ');
1104: hr_utility.trace('');
1105: hr_utility.trace(' Rule name is '||p_rule_record.name);
1106: hr_utility.trace('');
1107: hr_utility.trace(' Period Id is '||to_char(l_period_id));
1100:
1101:
1102: if g_debug then
1103: hr_utility.trace(' ************* Param values are.... ************ ');
1104: hr_utility.trace('');
1105: hr_utility.trace(' Rule name is '||p_rule_record.name);
1106: hr_utility.trace('');
1107: hr_utility.trace(' Period Id is '||to_char(l_period_id));
1108: hr_utility.trace(' Reference Period is '||to_char(l_reference_period));
1101:
1102: if g_debug then
1103: hr_utility.trace(' ************* Param values are.... ************ ');
1104: hr_utility.trace('');
1105: hr_utility.trace(' Rule name is '||p_rule_record.name);
1106: hr_utility.trace('');
1107: hr_utility.trace(' Period Id is '||to_char(l_period_id));
1108: hr_utility.trace(' Reference Period is '||to_char(l_reference_period));
1109: hr_utility.trace(' Period Max is '||l_param_rec.param2_value);
1102: if g_debug then
1103: hr_utility.trace(' ************* Param values are.... ************ ');
1104: hr_utility.trace('');
1105: hr_utility.trace(' Rule name is '||p_rule_record.name);
1106: hr_utility.trace('');
1107: hr_utility.trace(' Period Id is '||to_char(l_period_id));
1108: hr_utility.trace(' Reference Period is '||to_char(l_reference_period));
1109: hr_utility.trace(' Period Max is '||l_param_rec.param2_value);
1110:
1103: hr_utility.trace(' ************* Param values are.... ************ ');
1104: hr_utility.trace('');
1105: hr_utility.trace(' Rule name is '||p_rule_record.name);
1106: hr_utility.trace('');
1107: hr_utility.trace(' Period Id is '||to_char(l_period_id));
1108: hr_utility.trace(' Reference Period is '||to_char(l_reference_period));
1109: hr_utility.trace(' Period Max is '||l_param_rec.param2_value);
1110:
1111:
1104: hr_utility.trace('');
1105: hr_utility.trace(' Rule name is '||p_rule_record.name);
1106: hr_utility.trace('');
1107: hr_utility.trace(' Period Id is '||to_char(l_period_id));
1108: hr_utility.trace(' Reference Period is '||to_char(l_reference_period));
1109: hr_utility.trace(' Period Max is '||l_param_rec.param2_value);
1110:
1111:
1112: hr_utility.set_location('Processing '||l_proc, 20);
1105: hr_utility.trace(' Rule name is '||p_rule_record.name);
1106: hr_utility.trace('');
1107: hr_utility.trace(' Period Id is '||to_char(l_period_id));
1108: hr_utility.trace(' Reference Period is '||to_char(l_reference_period));
1109: hr_utility.trace(' Period Max is '||l_param_rec.param2_value);
1110:
1111:
1112: hr_utility.set_location('Processing '||l_proc, 20);
1113: end if;
1108: hr_utility.trace(' Reference Period is '||to_char(l_reference_period));
1109: hr_utility.trace(' Period Max is '||l_param_rec.param2_value);
1110:
1111:
1112: hr_utility.set_location('Processing '||l_proc, 20);
1113: end if;
1114:
1115: -- if either PERIOD or REFERENCE_PERIOD specified.
1116:
1126: FETCH csr_get_period_info INTO l_period_type, l_duration_in_days, l_period_start;
1127: CLOSE csr_get_period_info;
1128:
1129: if g_debug then
1130: hr_utility.trace('');
1131: hr_utility.trace('*********** Period Info ************');
1132: hr_utility.trace('period type is '||l_period_type);
1133: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1134: hr_utility.trace('period start date is '||TO_CHAR(l_period_start,'DD-MON-YY HH24:MI:SS'));
1127: CLOSE csr_get_period_info;
1128:
1129: if g_debug then
1130: hr_utility.trace('');
1131: hr_utility.trace('*********** Period Info ************');
1132: hr_utility.trace('period type is '||l_period_type);
1133: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1134: hr_utility.trace('period start date is '||TO_CHAR(l_period_start,'DD-MON-YY HH24:MI:SS'));
1135: end if;
1128:
1129: if g_debug then
1130: hr_utility.trace('');
1131: hr_utility.trace('*********** Period Info ************');
1132: hr_utility.trace('period type is '||l_period_type);
1133: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1134: hr_utility.trace('period start date is '||TO_CHAR(l_period_start,'DD-MON-YY HH24:MI:SS'));
1135: end if;
1136:
1129: if g_debug then
1130: hr_utility.trace('');
1131: hr_utility.trace('*********** Period Info ************');
1132: hr_utility.trace('period type is '||l_period_type);
1133: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1134: hr_utility.trace('period start date is '||TO_CHAR(l_period_start,'DD-MON-YY HH24:MI:SS'));
1135: end if;
1136:
1137:
1130: hr_utility.trace('');
1131: hr_utility.trace('*********** Period Info ************');
1132: hr_utility.trace('period type is '||l_period_type);
1133: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1134: hr_utility.trace('period start date is '||TO_CHAR(l_period_start,'DD-MON-YY HH24:MI:SS'));
1135: end if;
1136:
1137:
1138: IF ( l_duration_in_days IS NOT NULL )
1164:
1165: l_period_end_date := TO_DATE(TO_CHAR(l_period_end_date, 'DD/MM/YYYY')||' 23:59:59','DD/MM/YYYY HH24:MI:SS');
1166:
1167: if g_debug then
1168: Hr_utility.trace('');
1169: hr_utility.trace('*********** Period Start and End ************');
1170: hr_utility.trace('period start date is '||TO_CHAR(l_period_start_date,'DD-MON-YY HH24:MI:SS'));
1171: hr_utility.trace('period end date is '||TO_CHAR(l_period_end_date,'DD-MON-YY HH24:MI:SS'));
1172: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1165: l_period_end_date := TO_DATE(TO_CHAR(l_period_end_date, 'DD/MM/YYYY')||' 23:59:59','DD/MM/YYYY HH24:MI:SS');
1166:
1167: if g_debug then
1168: Hr_utility.trace('');
1169: hr_utility.trace('*********** Period Start and End ************');
1170: hr_utility.trace('period start date is '||TO_CHAR(l_period_start_date,'DD-MON-YY HH24:MI:SS'));
1171: hr_utility.trace('period end date is '||TO_CHAR(l_period_end_date,'DD-MON-YY HH24:MI:SS'));
1172: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1173: end if;
1166:
1167: if g_debug then
1168: Hr_utility.trace('');
1169: hr_utility.trace('*********** Period Start and End ************');
1170: hr_utility.trace('period start date is '||TO_CHAR(l_period_start_date,'DD-MON-YY HH24:MI:SS'));
1171: hr_utility.trace('period end date is '||TO_CHAR(l_period_end_date,'DD-MON-YY HH24:MI:SS'));
1172: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1173: end if;
1174:
1167: if g_debug then
1168: Hr_utility.trace('');
1169: hr_utility.trace('*********** Period Start and End ************');
1170: hr_utility.trace('period start date is '||TO_CHAR(l_period_start_date,'DD-MON-YY HH24:MI:SS'));
1171: hr_utility.trace('period end date is '||TO_CHAR(l_period_end_date,'DD-MON-YY HH24:MI:SS'));
1172: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1173: end if;
1174:
1175: -- now build up table of time entry rule periods that the timecard
1168: Hr_utility.trace('');
1169: hr_utility.trace('*********** Period Start and End ************');
1170: hr_utility.trace('period start date is '||TO_CHAR(l_period_start_date,'DD-MON-YY HH24:MI:SS'));
1171: hr_utility.trace('period end date is '||TO_CHAR(l_period_end_date,'DD-MON-YY HH24:MI:SS'));
1172: hr_utility.trace('duration in days is '||TO_CHAR(l_duration_in_days));
1173: end if;
1174:
1175: -- now build up table of time entry rule periods that the timecard
1176: -- may span
1220:
1221: END IF;
1222:
1223: if g_debug then
1224: hr_utility.trace('');
1225: hr_utility.trace('********** Original reference period ************');
1226: hr_utility.trace('ref period start is '||TO_CHAR(l_ref_period_start,'DD-MON-YY HH24:MI:SS'));
1227: hr_utility.trace('ref period end is '||TO_CHAR(l_ref_period_end,'DD-MON-YY HH24:MI:SS'));
1228: end if;
1221: END IF;
1222:
1223: if g_debug then
1224: hr_utility.trace('');
1225: hr_utility.trace('********** Original reference period ************');
1226: hr_utility.trace('ref period start is '||TO_CHAR(l_ref_period_start,'DD-MON-YY HH24:MI:SS'));
1227: hr_utility.trace('ref period end is '||TO_CHAR(l_ref_period_end,'DD-MON-YY HH24:MI:SS'));
1228: end if;
1229:
1222:
1223: if g_debug then
1224: hr_utility.trace('');
1225: hr_utility.trace('********** Original reference period ************');
1226: hr_utility.trace('ref period start is '||TO_CHAR(l_ref_period_start,'DD-MON-YY HH24:MI:SS'));
1227: hr_utility.trace('ref period end is '||TO_CHAR(l_ref_period_end,'DD-MON-YY HH24:MI:SS'));
1228: end if;
1229:
1230: END IF; -- ( l_reference_period IS NOT NULL )
1223: if g_debug then
1224: hr_utility.trace('');
1225: hr_utility.trace('********** Original reference period ************');
1226: hr_utility.trace('ref period start is '||TO_CHAR(l_ref_period_start,'DD-MON-YY HH24:MI:SS'));
1227: hr_utility.trace('ref period end is '||TO_CHAR(l_ref_period_end,'DD-MON-YY HH24:MI:SS'));
1228: end if;
1229:
1230: END IF; -- ( l_reference_period IS NOT NULL )
1231:
1229:
1230: END IF; -- ( l_reference_period IS NOT NULL )
1231:
1232: if g_debug then
1233: hr_utility.set_location('Processing '||l_proc, 30);
1234: end if;
1235:
1236: ELSE -- ( l_period and l_ref_period are NULL )
1237:
1250:
1251: END IF; -- ( l_period_id IS NOT NULL OR l_reference_period_id )
1252:
1253: if g_debug then
1254: hr_utility.trace('*********************************************** ******');
1255: hr_utility.trace('****** TIME CARD is ******');
1256: hr_utility.trace('*********************************************** ******');
1257: end if;
1258:
1251: END IF; -- ( l_period_id IS NOT NULL OR l_reference_period_id )
1252:
1253: if g_debug then
1254: hr_utility.trace('*********************************************** ******');
1255: hr_utility.trace('****** TIME CARD is ******');
1256: hr_utility.trace('*********************************************** ******');
1257: end if;
1258:
1259: l_new_index := p_tco_bb.FIRST;
1252:
1253: if g_debug then
1254: hr_utility.trace('*********************************************** ******');
1255: hr_utility.trace('****** TIME CARD is ******');
1256: hr_utility.trace('*********************************************** ******');
1257: end if;
1258:
1259: l_new_index := p_tco_bb.FIRST;
1260:
1261: WHILE ( l_new_index IS NOT NULL )
1262: LOOP
1263:
1264: if g_debug then
1265: hr_utility.trace('');
1266: hr_utility.trace('index is '||to_char(l_new_index));
1267: hr_utility.trace('scope is '||p_tco_bb(l_new_index).scope);
1268: hr_utility.trace('bb id '||to_char(p_tco_bb(l_new_index).time_building_block_id));
1269: hr_utility.trace('parent bb id '||to_char(p_tco_bb(l_new_index).parent_building_block_id));
1262: LOOP
1263:
1264: if g_debug then
1265: hr_utility.trace('');
1266: hr_utility.trace('index is '||to_char(l_new_index));
1267: hr_utility.trace('scope is '||p_tco_bb(l_new_index).scope);
1268: hr_utility.trace('bb id '||to_char(p_tco_bb(l_new_index).time_building_block_id));
1269: hr_utility.trace('parent bb id '||to_char(p_tco_bb(l_new_index).parent_building_block_id));
1270: hr_utility.trace('start '||to_char(p_tco_bb(l_new_index).start_time, 'dd-mon-yy'));
1263:
1264: if g_debug then
1265: hr_utility.trace('');
1266: hr_utility.trace('index is '||to_char(l_new_index));
1267: hr_utility.trace('scope is '||p_tco_bb(l_new_index).scope);
1268: hr_utility.trace('bb id '||to_char(p_tco_bb(l_new_index).time_building_block_id));
1269: hr_utility.trace('parent bb id '||to_char(p_tco_bb(l_new_index).parent_building_block_id));
1270: hr_utility.trace('start '||to_char(p_tco_bb(l_new_index).start_time, 'dd-mon-yy'));
1271: hr_utility.trace('measure '||to_char(p_tco_bb(l_new_index).measure));
1264: if g_debug then
1265: hr_utility.trace('');
1266: hr_utility.trace('index is '||to_char(l_new_index));
1267: hr_utility.trace('scope is '||p_tco_bb(l_new_index).scope);
1268: hr_utility.trace('bb id '||to_char(p_tco_bb(l_new_index).time_building_block_id));
1269: hr_utility.trace('parent bb id '||to_char(p_tco_bb(l_new_index).parent_building_block_id));
1270: hr_utility.trace('start '||to_char(p_tco_bb(l_new_index).start_time, 'dd-mon-yy'));
1271: hr_utility.trace('measure '||to_char(p_tco_bb(l_new_index).measure));
1272: hr_utility.trace('');
1265: hr_utility.trace('');
1266: hr_utility.trace('index is '||to_char(l_new_index));
1267: hr_utility.trace('scope is '||p_tco_bb(l_new_index).scope);
1268: hr_utility.trace('bb id '||to_char(p_tco_bb(l_new_index).time_building_block_id));
1269: hr_utility.trace('parent bb id '||to_char(p_tco_bb(l_new_index).parent_building_block_id));
1270: hr_utility.trace('start '||to_char(p_tco_bb(l_new_index).start_time, 'dd-mon-yy'));
1271: hr_utility.trace('measure '||to_char(p_tco_bb(l_new_index).measure));
1272: hr_utility.trace('');
1273: end if;
1266: hr_utility.trace('index is '||to_char(l_new_index));
1267: hr_utility.trace('scope is '||p_tco_bb(l_new_index).scope);
1268: hr_utility.trace('bb id '||to_char(p_tco_bb(l_new_index).time_building_block_id));
1269: hr_utility.trace('parent bb id '||to_char(p_tco_bb(l_new_index).parent_building_block_id));
1270: hr_utility.trace('start '||to_char(p_tco_bb(l_new_index).start_time, 'dd-mon-yy'));
1271: hr_utility.trace('measure '||to_char(p_tco_bb(l_new_index).measure));
1272: hr_utility.trace('');
1273: end if;
1274:
1267: hr_utility.trace('scope is '||p_tco_bb(l_new_index).scope);
1268: hr_utility.trace('bb id '||to_char(p_tco_bb(l_new_index).time_building_block_id));
1269: hr_utility.trace('parent bb id '||to_char(p_tco_bb(l_new_index).parent_building_block_id));
1270: hr_utility.trace('start '||to_char(p_tco_bb(l_new_index).start_time, 'dd-mon-yy'));
1271: hr_utility.trace('measure '||to_char(p_tco_bb(l_new_index).measure));
1272: hr_utility.trace('');
1273: end if;
1274:
1275: l_new_index := p_tco_bb.NEXT(l_new_index);
1268: hr_utility.trace('bb id '||to_char(p_tco_bb(l_new_index).time_building_block_id));
1269: hr_utility.trace('parent bb id '||to_char(p_tco_bb(l_new_index).parent_building_block_id));
1270: hr_utility.trace('start '||to_char(p_tco_bb(l_new_index).start_time, 'dd-mon-yy'));
1271: hr_utility.trace('measure '||to_char(p_tco_bb(l_new_index).measure));
1272: hr_utility.trace('');
1273: end if;
1274:
1275: l_new_index := p_tco_bb.NEXT(l_new_index);
1276:
1282:
1283: FOR p IN l_period_tab.FIRST .. l_period_tab.LAST
1284: LOOP
1285: if g_debug then
1286: hr_utility.set_location('Processing '||l_proc, 40);
1287: end if;
1288:
1289: IF ( hxc_time_entry_rules_utils_pkg.return_archived_status(l_period_tab(p)) = false )
1290: THEN
1295: IF ( NOT check_commit ( p_messages, p_timecard_info ) )
1296: THEN
1297:
1298: if g_debug then
1299: hr_utility.trace('Exiting period loop - check_commit');
1300: end if;
1301: EXIT;
1302:
1303: END IF;
1310: , p_tco_bb => p_tco_bb
1311: , p_tco_att => p_tco_att );
1312:
1313: if g_debug then
1314: hr_utility.trace('TER INC PTO plan id is '||hxc_time_entry_rules_utils_pkg.g_ter_record.ter_inc_pto_plan_id);
1315: end if;
1316:
1317: IF ( hxc_time_entry_rules_utils_pkg.g_ter_record.ter_inc_pto_plan_id IS NOT NULL )
1318: THEN
1327:
1328: END IF;
1329:
1330: if g_debug then
1331: hr_utility.set_location('Processing '||l_proc, 50);
1332: end if;
1333:
1334: -- now call the formula
1335:
1333:
1334: -- now call the formula
1335:
1336: if g_debug then
1337: hr_utility.trace('consider zero hours is '||l_consider_zero_hours);
1338: end if;
1339:
1340: IF ( l_consider_zero_hours = 'Y' OR ( l_consider_zero_hours = 'N' AND l_timecard_hrs > 0 ) )
1341: THEN
1340: IF ( l_consider_zero_hours = 'Y' OR ( l_consider_zero_hours = 'N' AND l_timecard_hrs > 0 ) )
1341: THEN
1342:
1343: if g_debug then
1344: hr_utility.trace('Calling ff dict . formula');
1345: end if;
1346:
1347: l_outputs := hxc_ff_dict.formula (
1348: p_formula_id => p_rule_record.formula_id
1360: , p_duration_in_days => l_duration_in_days
1361: , p_param_rec => l_param_rec );
1362:
1363: if g_debug then
1364: hr_utility.set_location('Processing '||l_proc, 60);
1365: end if;
1366:
1367: l_message_table.DELETE;
1368:
1432:
1433: END LOOP; -- formula outputs loop
1434:
1435: if g_debug then
1436: hr_utility.set_location('Processing '||l_proc, 70);
1437: end if;
1438:
1439: -- populate message table
1440:
1443: IF ( ( l_result = 'E' ) AND ( l_message_table.COUNT <> 0 ) )
1444: THEN
1445:
1446: if g_debug then
1447: hr_utility.set_location('Processing '||l_proc, 80);
1448: end if;
1449:
1450: l_message_count := l_message_table.FIRST;
1451:
1452: WHILE l_message_count IS NOT NULL
1453: LOOP
1454:
1455: if g_debug then
1456: hr_utility.set_location('Processing '||l_proc, 90);
1457: end if;
1458:
1459: IF ( l_message_table(l_message_count).name IS NOT NULL )
1460: THEN
1505: end if; -- hxc_time_entry_rules_utils_pkg.return_archived_status(l_period_tab(p)) = false )
1506:
1507:
1508: if g_debug then
1509: hr_utility.set_location('Processing '||l_proc, 100);
1510: end if;
1511:
1512: END LOOP; -- t_periods
1513:
1511:
1512: END LOOP; -- t_periods
1513:
1514: if g_debug then
1515: hr_utility.trace('After period loop');
1516: end if;
1517:
1518: if g_debug then
1519: hr_utility.set_location('Processing '||l_proc, 110);
1515: hr_utility.trace('After period loop');
1516: end if;
1517:
1518: if g_debug then
1519: hr_utility.set_location('Processing '||l_proc, 110);
1520: end if;
1521:
1522: -- reset variables
1523:
1934:
1935:
1936: if g_debug then
1937: l_proc := g_package||'execute_field_combo_rule';
1938: hr_utility.set_location('Processing '||l_proc, 10);
1939: end if;
1940:
1941: hxc_ff_dict.decode_formula_segments (
1942: p_formula_name => p_formula_name
1946: , p_reference_value => l_reference_period
1947: , p_consider_zero_hours => l_consider_zero_hours );
1948:
1949: if g_debug then
1950: hr_utility.trace(' ************* Param values are.... ************ ');
1951: hr_utility.trace('');
1952: hr_utility.trace(' Rule name is '||p_rule_record.name);
1953: hr_utility.trace('');
1954: hr_utility.trace(' Time Category ID I is '||l_param_rec.param1_value);
1947: , p_consider_zero_hours => l_consider_zero_hours );
1948:
1949: if g_debug then
1950: hr_utility.trace(' ************* Param values are.... ************ ');
1951: hr_utility.trace('');
1952: hr_utility.trace(' Rule name is '||p_rule_record.name);
1953: hr_utility.trace('');
1954: hr_utility.trace(' Time Category ID I is '||l_param_rec.param1_value);
1955: hr_utility.trace(' Time Category ID II is '||l_param_rec.param2_value);
1948:
1949: if g_debug then
1950: hr_utility.trace(' ************* Param values are.... ************ ');
1951: hr_utility.trace('');
1952: hr_utility.trace(' Rule name is '||p_rule_record.name);
1953: hr_utility.trace('');
1954: hr_utility.trace(' Time Category ID I is '||l_param_rec.param1_value);
1955: hr_utility.trace(' Time Category ID II is '||l_param_rec.param2_value);
1956: end if;
1949: if g_debug then
1950: hr_utility.trace(' ************* Param values are.... ************ ');
1951: hr_utility.trace('');
1952: hr_utility.trace(' Rule name is '||p_rule_record.name);
1953: hr_utility.trace('');
1954: hr_utility.trace(' Time Category ID I is '||l_param_rec.param1_value);
1955: hr_utility.trace(' Time Category ID II is '||l_param_rec.param2_value);
1956: end if;
1957:
1950: hr_utility.trace(' ************* Param values are.... ************ ');
1951: hr_utility.trace('');
1952: hr_utility.trace(' Rule name is '||p_rule_record.name);
1953: hr_utility.trace('');
1954: hr_utility.trace(' Time Category ID I is '||l_param_rec.param1_value);
1955: hr_utility.trace(' Time Category ID II is '||l_param_rec.param2_value);
1956: end if;
1957:
1958: l_tc_id_1 := to_number(l_param_rec.param1_value);
1951: hr_utility.trace('');
1952: hr_utility.trace(' Rule name is '||p_rule_record.name);
1953: hr_utility.trace('');
1954: hr_utility.trace(' Time Category ID I is '||l_param_rec.param1_value);
1955: hr_utility.trace(' Time Category ID II is '||l_param_rec.param2_value);
1956: end if;
1957:
1958: l_tc_id_1 := to_number(l_param_rec.param1_value);
1959: l_tc_id_2 := to_number(l_param_rec.param2_value);
1958: l_tc_id_1 := to_number(l_param_rec.param1_value);
1959: l_tc_id_2 := to_number(l_param_rec.param2_value);
1960:
1961: if g_debug then
1962: hr_utility.set_location('Processing '||l_proc, 20);
1963: end if;
1964:
1965: -- we always have to intialise the first time category so do it now
1966:
1968: p_time_category_id => l_tc_id_1
1969: , p_tco_att => p_tco_att );
1970:
1971: if g_debug then
1972: hr_utility.set_location('Processing '||l_proc, 30);
1973: end if;
1974:
1975: -- now process the first time category
1976:
2092: *****************************************************************/
2093:
2094: BEGIN -- execute_time_entry_rules
2095:
2096: g_debug := hr_utility.debug_enabled;
2097:
2098: if g_debug then
2099: l_proc := g_package||'execute_time_entry_rules';
2100: hr_utility.set_location('Processing '||l_proc, 10);
2096: g_debug := hr_utility.debug_enabled;
2097:
2098: if g_debug then
2099: l_proc := g_package||'execute_time_entry_rules';
2100: hr_utility.set_location('Processing '||l_proc, 10);
2101: end if;
2102:
2103: get_timecard_info (
2104: p_time_building_blocks => p_time_building_blocks
2159: -- loop through the time entry rules based on the resource's
2160: -- preference and get the message level
2161:
2162: if g_debug then
2163: hr_utility.set_location('Processing '||l_proc, 20);
2164: end if;
2165:
2166: l_rules_evl := hxc_preference_evaluation.resource_preferences(
2167: p_resource_id => l_timecard_info_rec.resource_id
2186:
2187: l_terg_id := l_pref_table(1).attribute1 ;
2188:
2189: if g_debug then
2190: hr_utility.set_location('Processing '||l_proc, 25);
2191: end if;
2192:
2193: FOR r_rules IN csr_get_rules ( p_terg_id => l_terg_id
2194: , p_start_date => l_timecard_info_rec.start_date
2194: , p_start_date => l_timecard_info_rec.start_date
2195: , p_end_date => l_timecard_info_rec.end_date )
2196: LOOP
2197: if g_debug then
2198: hr_utility.set_location('Processing '||l_proc, 30);
2199: end if;
2200:
2201: -- GPM v115.61 2180942
2202:
2200:
2201: -- GPM v115.61 2180942
2202:
2203: if g_debug then
2204: hr_utility.trace('GAZ OPERATION IS '||p_operation);
2205: hr_utility.trace('GAZ RESUBMIT IS '||p_resubmit);
2206: end if;
2207:
2208: -- maintain global record of TER info
2201: -- GPM v115.61 2180942
2202:
2203: if g_debug then
2204: hr_utility.trace('GAZ OPERATION IS '||p_operation);
2205: hr_utility.trace('GAZ RESUBMIT IS '||p_resubmit);
2206: end if;
2207:
2208: -- maintain global record of TER info
2209:
2222: )
2223: THEN
2224:
2225: if g_debug then
2226: hr_utility.trace('');
2227: hr_utility.trace('********** Rule Name is '||r_rules.name||' **************');
2228: hr_utility.trace('');
2229: end if;
2230:
2223: THEN
2224:
2225: if g_debug then
2226: hr_utility.trace('');
2227: hr_utility.trace('********** Rule Name is '||r_rules.name||' **************');
2228: hr_utility.trace('');
2229: end if;
2230:
2231: IF ( r_rules.formula_id IS NULL )
2224:
2225: if g_debug then
2226: hr_utility.trace('');
2227: hr_utility.trace('********** Rule Name is '||r_rules.name||' **************');
2228: hr_utility.trace('');
2229: end if;
2230:
2231: IF ( r_rules.formula_id IS NULL )
2232: THEN
2230:
2231: IF ( r_rules.formula_id IS NULL )
2232: THEN
2233: if g_debug then
2234: hr_utility.set_location('Processing '||l_proc, 40);
2235: end if;
2236: if(FND_LOG.LEVEL_STATEMENT>=FND_LOG.G_CURRENT_RUNTIME_LEVEL) then
2237: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT,'hxc_time_entry_rules', 'after 40');
2238: end if;
2259:
2260: ELSIF ( r_rules.formula_id IS NOT NULL AND r_rules.mapping_id IS NOT NULL )
2261: THEN
2262: if g_debug then
2263: hr_utility.set_location('Processing '||l_proc, 50);
2264: end if;
2265:
2266: IF ( hxc_mapping_utilities.chk_mapping_changed(
2267: p_mapping_id => r_rules.mapping_id
2276: ,p_called_from => 'TIME_ENTRY'
2277: ))
2278: THEN
2279: if g_debug then
2280: hr_utility.set_location('Processing '||l_proc, 60);
2281: end if;
2282:
2283: execute_formula ( p_formula_name=> r_rules.formula_name
2284: , p_message_table => p_messages
2292:
2293: ELSE -- basically means ( r_rules.formula_id IS NOT NULL AND r_rules.mapping_id IS NULL )
2294:
2295: if g_debug then
2296: hr_utility.set_location('Processing '||l_proc, 70);
2297: end if;
2298:
2299: -- special case for Field Combination rules
2300:
2338:
2339: END LOOP; -- csr_get_rules
2340:
2341: if g_debug then
2342: hr_utility.set_location('Processing '||l_proc, 75);
2343: end if;
2344:
2345: EXCEPTION WHEN OTHERS THEN
2346:
2344:
2345: EXCEPTION WHEN OTHERS THEN
2346:
2347: if g_debug then
2348: hr_utility.trace('SQLERRM is '||SQLERRM);
2349: end if;
2350:
2351: hxc_time_entry_rules_utils_pkg.add_error_to_table (
2352: p_message_table => p_messages
2483:
2484:
2485: BEGIN -- period_maximum
2486:
2487: g_debug := hr_utility.debug_enabled;
2488:
2489: if g_debug then
2490: l_proc := g_package||'period_maximum';
2491: hr_utility.set_location('Processing '||l_proc, 10);
2487: g_debug := hr_utility.debug_enabled;
2488:
2489: if g_debug then
2490: l_proc := g_package||'period_maximum';
2491: hr_utility.set_location('Processing '||l_proc, 10);
2492:
2493: hr_utility.trace('Lets see what is in the structure');
2494: end if;
2495:
2489: if g_debug then
2490: l_proc := g_package||'period_maximum';
2491: hr_utility.set_location('Processing '||l_proc, 10);
2492:
2493: hr_utility.trace('Lets see what is in the structure');
2494: end if;
2495:
2496: l_tc_bld_blks := hxc_self_service_time_deposit.get_building_blocks;
2497:
2500: while l_tc_ind is not null
2501: loop
2502:
2503: if g_debug then
2504: hr_utility.trace('scope is '||l_tc_bld_blks(l_tc_ind).scope);
2505: hr_utility.trace('bb id is '||to_number(l_tc_bld_blks(l_tc_ind).time_building_Block_id));
2506: hr_utility.trace('new is '||l_tc_bld_blks(l_tc_ind).new);
2507: hr_utility.trace('changed is '||l_tc_bld_blks(l_tc_ind).changed);
2508: end if;
2501: loop
2502:
2503: if g_debug then
2504: hr_utility.trace('scope is '||l_tc_bld_blks(l_tc_ind).scope);
2505: hr_utility.trace('bb id is '||to_number(l_tc_bld_blks(l_tc_ind).time_building_Block_id));
2506: hr_utility.trace('new is '||l_tc_bld_blks(l_tc_ind).new);
2507: hr_utility.trace('changed is '||l_tc_bld_blks(l_tc_ind).changed);
2508: end if;
2509:
2502:
2503: if g_debug then
2504: hr_utility.trace('scope is '||l_tc_bld_blks(l_tc_ind).scope);
2505: hr_utility.trace('bb id is '||to_number(l_tc_bld_blks(l_tc_ind).time_building_Block_id));
2506: hr_utility.trace('new is '||l_tc_bld_blks(l_tc_ind).new);
2507: hr_utility.trace('changed is '||l_tc_bld_blks(l_tc_ind).changed);
2508: end if;
2509:
2510: l_tc_ind := l_tc_bld_blks.NEXT(l_tc_ind);
2503: if g_debug then
2504: hr_utility.trace('scope is '||l_tc_bld_blks(l_tc_ind).scope);
2505: hr_utility.trace('bb id is '||to_number(l_tc_bld_blks(l_tc_ind).time_building_Block_id));
2506: hr_utility.trace('new is '||l_tc_bld_blks(l_tc_ind).new);
2507: hr_utility.trace('changed is '||l_tc_bld_blks(l_tc_ind).changed);
2508: end if;
2509:
2510: l_tc_ind := l_tc_bld_blks.NEXT(l_tc_ind);
2511:
2563:
2564: IF ( l_db_pre_period_start IS NOT NULL AND l_db_post_period_start IS NOT NULL )
2565: THEN
2566: if g_debug then
2567: hr_utility.set_location('Processing '||l_proc, 20);
2568: end if;
2569:
2570: -- now lets get the total hours worked based on the pre TC window
2571:
2573: FETCH csr_get_total_hrs INTO l_hrs;
2574: CLOSE csr_get_total_hrs;
2575:
2576: if g_debug then
2577: hr_utility.trace('');
2578: hr_utility.trace('Pre period hours are '||to_char(l_hrs));
2579: hr_utility.trace('');
2580: end if;
2581:
2574: CLOSE csr_get_total_hrs;
2575:
2576: if g_debug then
2577: hr_utility.trace('');
2578: hr_utility.trace('Pre period hours are '||to_char(l_hrs));
2579: hr_utility.trace('');
2580: end if;
2581:
2582: l_total_hrs := l_hrs;
2575:
2576: if g_debug then
2577: hr_utility.trace('');
2578: hr_utility.trace('Pre period hours are '||to_char(l_hrs));
2579: hr_utility.trace('');
2580: end if;
2581:
2582: l_total_hrs := l_hrs;
2583:
2589: FETCH csr_get_total_hrs INTO l_hrs;
2590: CLOSE csr_get_total_hrs;
2591:
2592: if g_debug then
2593: hr_utility.trace('Post period hours are '||to_char(l_hrs));
2594: hr_utility.trace('');
2595: end if;
2596:
2597: l_total_hrs := l_total_hrs + l_hrs + p_timecard_hrs;
2590: CLOSE csr_get_total_hrs;
2591:
2592: if g_debug then
2593: hr_utility.trace('Post period hours are '||to_char(l_hrs));
2594: hr_utility.trace('');
2595: end if;
2596:
2597: l_total_hrs := l_total_hrs + l_hrs + p_timecard_hrs;
2598:
2611: FETCH csr_get_total_hrs INTO l_hrs;
2612: CLOSE csr_get_total_hrs;
2613:
2614: if g_debug then
2615: hr_utility.trace('');
2616: hr_utility.trace('Pre period hours are '||to_char(l_hrs));
2617: hr_utility.trace('');
2618: end if;
2619:
2612: CLOSE csr_get_total_hrs;
2613:
2614: if g_debug then
2615: hr_utility.trace('');
2616: hr_utility.trace('Pre period hours are '||to_char(l_hrs));
2617: hr_utility.trace('');
2618: end if;
2619:
2620: l_total_hrs := l_total_hrs - l_hrs;
2613:
2614: if g_debug then
2615: hr_utility.trace('');
2616: hr_utility.trace('Pre period hours are '||to_char(l_hrs));
2617: hr_utility.trace('');
2618: end if;
2619:
2620: l_total_hrs := l_total_hrs - l_hrs;
2621:
2627: FETCH csr_get_total_hrs INTO l_hrs;
2628: CLOSE csr_get_total_hrs;
2629:
2630: if g_debug then
2631: hr_utility.trace('Post period hours are '||to_char(l_hrs));
2632: hr_utility.trace('');
2633: end if;
2634:
2635: l_total_hrs := l_total_hrs - l_hrs;
2628: CLOSE csr_get_total_hrs;
2629:
2630: if g_debug then
2631: hr_utility.trace('Post period hours are '||to_char(l_hrs));
2632: hr_utility.trace('');
2633: end if;
2634:
2635: l_total_hrs := l_total_hrs - l_hrs;
2636:
2640:
2641: ELSIF ( l_db_pre_period_start IS NOT NULL )
2642: THEN
2643: if g_debug then
2644: hr_utility.set_location('Processing '||l_proc, 30);
2645: end if;
2646:
2647: -- now lets get the total hours worked based on the pre TC window
2648:
2650: FETCH csr_get_total_hrs INTO l_hrs;
2651: CLOSE csr_get_total_hrs;
2652:
2653: if g_debug then
2654: hr_utility.trace('');
2655: hr_utility.trace('Pre period hours are '||to_char(l_hrs));
2656: hr_utility.trace('');
2657: end if;
2658:
2651: CLOSE csr_get_total_hrs;
2652:
2653: if g_debug then
2654: hr_utility.trace('');
2655: hr_utility.trace('Pre period hours are '||to_char(l_hrs));
2656: hr_utility.trace('');
2657: end if;
2658:
2659: l_total_hrs := l_total_hrs + l_hrs + p_timecard_hrs;
2652:
2653: if g_debug then
2654: hr_utility.trace('');
2655: hr_utility.trace('Pre period hours are '||to_char(l_hrs));
2656: hr_utility.trace('');
2657: end if;
2658:
2659: l_total_hrs := l_total_hrs + l_hrs + p_timecard_hrs;
2660:
2673: FETCH csr_get_total_hrs INTO l_hrs;
2674: CLOSE csr_get_total_hrs;
2675:
2676: if g_debug then
2677: hr_utility.trace('');
2678: hr_utility.trace('Pre period hours are '||to_char(l_hrs));
2679: hr_utility.trace('');
2680: end if;
2681:
2674: CLOSE csr_get_total_hrs;
2675:
2676: if g_debug then
2677: hr_utility.trace('');
2678: hr_utility.trace('Pre period hours are '||to_char(l_hrs));
2679: hr_utility.trace('');
2680: end if;
2681:
2682: l_total_hrs := l_total_hrs - l_hrs;
2675:
2676: if g_debug then
2677: hr_utility.trace('');
2678: hr_utility.trace('Pre period hours are '||to_char(l_hrs));
2679: hr_utility.trace('');
2680: end if;
2681:
2682: l_total_hrs := l_total_hrs - l_hrs;
2683:
2687:
2688: ELSIF( l_db_post_period_start IS NOT NULL )
2689: THEN
2690: if g_debug then
2691: hr_utility.set_location('Processing '||l_proc, 40);
2692: end if;
2693:
2694: -- now lets get the total hours worked based on the post TC window
2695:
2697: FETCH csr_get_total_hrs INTO l_hrs;
2698: CLOSE csr_get_total_hrs;
2699:
2700: if g_debug then
2701: hr_utility.trace('');
2702: hr_utility.trace('Post period hours are '||to_char(l_hrs));
2703: hr_utility.trace('');
2704: end if;
2705:
2698: CLOSE csr_get_total_hrs;
2699:
2700: if g_debug then
2701: hr_utility.trace('');
2702: hr_utility.trace('Post period hours are '||to_char(l_hrs));
2703: hr_utility.trace('');
2704: end if;
2705:
2706: l_total_hrs := l_hrs + p_timecard_hrs;
2699:
2700: if g_debug then
2701: hr_utility.trace('');
2702: hr_utility.trace('Post period hours are '||to_char(l_hrs));
2703: hr_utility.trace('');
2704: end if;
2705:
2706: l_total_hrs := l_hrs + p_timecard_hrs;
2707:
2720: FETCH csr_get_total_hrs INTO l_hrs;
2721: CLOSE csr_get_total_hrs;
2722:
2723: if g_debug then
2724: hr_utility.trace('Post period hours are '||to_char(l_hrs));
2725: hr_utility.trace('');
2726: end if;
2727:
2728: l_total_hrs := l_total_hrs - l_hrs;
2721: CLOSE csr_get_total_hrs;
2722:
2723: if g_debug then
2724: hr_utility.trace('Post period hours are '||to_char(l_hrs));
2725: hr_utility.trace('');
2726: end if;
2727:
2728: l_total_hrs := l_total_hrs - l_hrs;
2729:
2732: END IF;
2733:
2734: ELSE
2735: if g_debug then
2736: hr_utility.set_location('Processing '||l_proc, 50);
2737: end if;
2738:
2739: -- i.e. the whole time entry rule period is
2740: -- encompassed by the TCO
2742: l_total_hrs := p_timecard_hrs;
2743:
2744: END IF;
2745: if g_debug then
2746: hr_utility.set_location('Processing '||l_proc, 60);
2747: end if;
2748:
2749: IF ( l_db_ref_period_start IS NOT NULL )
2750: THEN
2759:
2760: l_total_hrs := (( l_total_hrs + l_ref_period_hrs ) / l_number_of_periods );
2761:
2762: if g_debug then
2763: hr_utility.trace('');
2764: hr_utility.trace('************* reference period info ****************');
2765: hr_utility.trace('reference period start is '||TO_CHAR(l_db_ref_period_start, 'DD-MON-YY HH24:MI:SS'));
2766: hr_utility.trace('reference period end is '||TO_CHAR(l_db_ref_period_end , 'DD-MON-YY HH24:MI:SS'));
2767: hr_utility.trace('number of periods is '||TO_CHAR(l_number_of_periods));
2760: l_total_hrs := (( l_total_hrs + l_ref_period_hrs ) / l_number_of_periods );
2761:
2762: if g_debug then
2763: hr_utility.trace('');
2764: hr_utility.trace('************* reference period info ****************');
2765: hr_utility.trace('reference period start is '||TO_CHAR(l_db_ref_period_start, 'DD-MON-YY HH24:MI:SS'));
2766: hr_utility.trace('reference period end is '||TO_CHAR(l_db_ref_period_end , 'DD-MON-YY HH24:MI:SS'));
2767: hr_utility.trace('number of periods is '||TO_CHAR(l_number_of_periods));
2768: hr_utility.trace('ref period hours are '||to_char(l_ref_period_hrs));
2761:
2762: if g_debug then
2763: hr_utility.trace('');
2764: hr_utility.trace('************* reference period info ****************');
2765: hr_utility.trace('reference period start is '||TO_CHAR(l_db_ref_period_start, 'DD-MON-YY HH24:MI:SS'));
2766: hr_utility.trace('reference period end is '||TO_CHAR(l_db_ref_period_end , 'DD-MON-YY HH24:MI:SS'));
2767: hr_utility.trace('number of periods is '||TO_CHAR(l_number_of_periods));
2768: hr_utility.trace('ref period hours are '||to_char(l_ref_period_hrs));
2769: end if;
2762: if g_debug then
2763: hr_utility.trace('');
2764: hr_utility.trace('************* reference period info ****************');
2765: hr_utility.trace('reference period start is '||TO_CHAR(l_db_ref_period_start, 'DD-MON-YY HH24:MI:SS'));
2766: hr_utility.trace('reference period end is '||TO_CHAR(l_db_ref_period_end , 'DD-MON-YY HH24:MI:SS'));
2767: hr_utility.trace('number of periods is '||TO_CHAR(l_number_of_periods));
2768: hr_utility.trace('ref period hours are '||to_char(l_ref_period_hrs));
2769: end if;
2770:
2763: hr_utility.trace('');
2764: hr_utility.trace('************* reference period info ****************');
2765: hr_utility.trace('reference period start is '||TO_CHAR(l_db_ref_period_start, 'DD-MON-YY HH24:MI:SS'));
2766: hr_utility.trace('reference period end is '||TO_CHAR(l_db_ref_period_end , 'DD-MON-YY HH24:MI:SS'));
2767: hr_utility.trace('number of periods is '||TO_CHAR(l_number_of_periods));
2768: hr_utility.trace('ref period hours are '||to_char(l_ref_period_hrs));
2769: end if;
2770:
2771: END IF;
2764: hr_utility.trace('************* reference period info ****************');
2765: hr_utility.trace('reference period start is '||TO_CHAR(l_db_ref_period_start, 'DD-MON-YY HH24:MI:SS'));
2766: hr_utility.trace('reference period end is '||TO_CHAR(l_db_ref_period_end , 'DD-MON-YY HH24:MI:SS'));
2767: hr_utility.trace('number of periods is '||TO_CHAR(l_number_of_periods));
2768: hr_utility.trace('ref period hours are '||to_char(l_ref_period_hrs));
2769: end if;
2770:
2771: END IF;
2772:
2770:
2771: END IF;
2772:
2773: if g_debug then
2774: hr_utility.trace('period maximum is '||to_char(p_period_maximum));
2775: hr_utility.trace('total hours are '||to_char(l_total_hrs));
2776: hr_utility.trace('');
2777: end if;
2778:
2771: END IF;
2772:
2773: if g_debug then
2774: hr_utility.trace('period maximum is '||to_char(p_period_maximum));
2775: hr_utility.trace('total hours are '||to_char(l_total_hrs));
2776: hr_utility.trace('');
2777: end if;
2778:
2779: if g_debug then
2772:
2773: if g_debug then
2774: hr_utility.trace('period maximum is '||to_char(p_period_maximum));
2775: hr_utility.trace('total hours are '||to_char(l_total_hrs));
2776: hr_utility.trace('');
2777: end if;
2778:
2779: if g_debug then
2780: hr_utility.set_location('Processing '||l_proc, 70);
2776: hr_utility.trace('');
2777: end if;
2778:
2779: if g_debug then
2780: hr_utility.set_location('Processing '||l_proc, 70);
2781: end if;
2782:
2783: -- WWB 3738796
2784: -- check to see if period max is being called from a TER which is using the seeded PTO formula
2876:
2877: END IF; -- g_ter_record.ter_formula_name = 'HXC_PTO_ACCRUAL_COMPARISON'
2878:
2879: if g_debug then
2880: hr_utility.set_location('Processing '||l_proc, 70);
2881: end if;
2882:
2883: END period_maximum;
2884:
2969: l_dummy NUMBER(1);
2970:
2971: BEGIN
2972:
2973: g_debug := hr_utility.debug_enabled;
2974:
2975: if g_debug then
2976: l_proc := g_package||'tc_edit_allowed';
2977: hr_utility.set_location('Entering '||l_proc, 10);
2973: g_debug := hr_utility.debug_enabled;
2974:
2975: if g_debug then
2976: l_proc := g_package||'tc_edit_allowed';
2977: hr_utility.set_location('Entering '||l_proc, 10);
2978: end if;
2979:
2980: -- GPM v115.25
2981: -- WWB - 2109325
2987: l_tc_status := p_timecard_status;
2988: end if;
2989:
2990: if g_debug then
2991: hr_utility.set_location('Processing '||l_proc, 20);
2992: end if;
2993:
2994:
2995: IF ( p_edit_allowed_preference = 'NEW_WORKING_REJECTED' )
2994:
2995: IF ( p_edit_allowed_preference = 'NEW_WORKING_REJECTED' )
2996: THEN
2997: if g_debug then
2998: hr_utility.set_location('Processing '||l_proc, 30);
2999: end if;
3000:
3001: IF ( ( l_tc_status = 'REJECTED' ) OR ( l_tc_status = 'WORKING' ) )
3002: THEN
3007:
3008: ELSIF ( p_edit_allowed_preference = 'SUBMITTED' )
3009: THEN
3010: if g_debug then
3011: hr_utility.set_location('Processing '||l_proc, 40);
3012: end if;
3013:
3014: IF ( ( l_tc_status = 'REJECTED' ) OR ( l_tc_status = 'WORKING' ) OR ( l_tc_status = 'SUBMITTED' ) )
3015: THEN
3020:
3021: ELSIF ( p_edit_allowed_preference = 'APPROVALS_INITIATED' )
3022: THEN
3023: if g_debug then
3024: hr_utility.set_location('Processing '||l_proc, 50);
3025: end if;
3026:
3027: -- all we need to do here is check that this timecard
3028: -- has not been transferred successfully to any recipient
3040:
3041: ELSIF ( p_edit_allowed_preference = 'RETRO' )
3042: THEN
3043: if g_debug then
3044: hr_utility.set_location('Processing '||l_proc, 60);
3045: end if;
3046:
3047: IF ( ( l_tc_status = 'REJECTED' ) OR ( l_tc_status = 'WORKING' ) OR ( l_tc_status = 'SUBMITTED' )
3048: OR ( l_tc_status = 'APPROVED' ) OR ( l_tc_status = 'ERROR' ) )
3053: END IF;
3054:
3055: ELSE
3056: if g_debug then
3057: hr_utility.set_location('Processing '||l_proc, 70);
3058: end if;
3059:
3060: p_edit_allowed := 'FALSE';
3061:
3068: END IF;
3069:
3070:
3071: if g_debug then
3072: hr_utility.set_location('Leaving '||l_proc, 80);
3073: end if;
3074:
3075: END tc_edit_allowed;
3076:
3122:
3123:
3124: BEGIN
3125:
3126: g_debug := hr_utility.debug_enabled;
3127:
3128: OPEN csr_chk_pto_ok;
3129: FETCH csr_chk_pto_ok INTO l_pto_ok;
3130:
3131: IF csr_chk_pto_ok%FOUND
3132: THEN
3133:
3134: if g_debug then
3135: hr_utility.trace('PTO PLAN OK');
3136: end if;
3137: l_pto_ok := 1;
3138:
3139: ELSE
3138:
3139: ELSE
3140:
3141: if g_debug then
3142: hr_utility.trace('PTO PLAN NOT OK');
3143: end if;
3144:
3145:
3146: END IF;
3163:
3164: l_prefs hxc_preference_evaluation.t_pref_table;
3165:
3166: Begin
3167: g_debug := hr_utility.debug_enabled;
3168:
3169: get_timecard_info (
3170: p_time_building_blocks => p_time_building_blocks
3171: , p_timecard_rec => l_timecard_info_rec );
3169: get_timecard_info (
3170: p_time_building_blocks => p_time_building_blocks
3171: , p_timecard_rec => l_timecard_info_rec );
3172: if g_debug then
3173: hr_utility.trace('After get_timecard_info');
3174: hr_utility.trace('start_date ' || l_timecard_info_rec.start_date);
3175: end if;
3176: -- Start 2944785
3177: /*
3170: p_time_building_blocks => p_time_building_blocks
3171: , p_timecard_rec => l_timecard_info_rec );
3172: if g_debug then
3173: hr_utility.trace('After get_timecard_info');
3174: hr_utility.trace('start_date ' || l_timecard_info_rec.start_date);
3175: end if;
3176: -- Start 2944785
3177: /*
3178: hxc_preference_evaluation.resource_preferences(p_resource_id => l_timecard_info_rec.resource_id,
3205: , p_start_date => l_timecard_info_rec.start_date
3206: , p_end_date => l_timecard_info_rec.end_date )
3207: LOOP
3208: if g_debug then
3209: hr_utility.trace('r_rules.Timecategory_name' || r_rules.attribute2);
3210: hr_utility.trace('r_rules.Recipient Application' || r_rules.attribute1);
3211: end if;
3212: l_time_category_id := r_rules.attribute2;
3213: if g_debug then
3206: , p_end_date => l_timecard_info_rec.end_date )
3207: LOOP
3208: if g_debug then
3209: hr_utility.trace('r_rules.Timecategory_name' || r_rules.attribute2);
3210: hr_utility.trace('r_rules.Recipient Application' || r_rules.attribute1);
3211: end if;
3212: l_time_category_id := r_rules.attribute2;
3213: if g_debug then
3214: hr_utility.trace('Time Category ID' || l_time_category_id);
3210: hr_utility.trace('r_rules.Recipient Application' || r_rules.attribute1);
3211: end if;
3212: l_time_category_id := r_rules.attribute2;
3213: if g_debug then
3214: hr_utility.trace('Time Category ID' || l_time_category_id);
3215: end if;
3216: hxc_time_category_utils_pkg.initialise_time_category(
3217: p_time_category_id => to_number(l_time_category_id),
3218: p_tco_att => P_TIME_ATTRIBUTES);
3237: end loop;
3238: end loop;
3239:
3240: if g_debug then
3241: hr_utility.trace('Message Table');
3242: end if;
3243: n := p_messages.first;
3244: loop
3245: exit when not p_messages.exists(n);
3244: loop
3245: exit when not p_messages.exists(n);
3246: if (p_messages(n).message_level = 'PTE') then
3247: if g_debug then
3248: hr_utility.trace('Time Building Block Id' || p_messages(n).time_building_block_id);
3249: hr_utility.trace('Time Building Block OVN' || p_messages(n).time_building_block_ovn);
3250: hr_utility.trace('Recipient Application ID' || p_messages(n).message_name);
3251: end if;
3252: end if;
3245: exit when not p_messages.exists(n);
3246: if (p_messages(n).message_level = 'PTE') then
3247: if g_debug then
3248: hr_utility.trace('Time Building Block Id' || p_messages(n).time_building_block_id);
3249: hr_utility.trace('Time Building Block OVN' || p_messages(n).time_building_block_ovn);
3250: hr_utility.trace('Recipient Application ID' || p_messages(n).message_name);
3251: end if;
3252: end if;
3253: n := p_messages.next(n);
3246: if (p_messages(n).message_level = 'PTE') then
3247: if g_debug then
3248: hr_utility.trace('Time Building Block Id' || p_messages(n).time_building_block_id);
3249: hr_utility.trace('Time Building Block OVN' || p_messages(n).time_building_block_ovn);
3250: hr_utility.trace('Recipient Application ID' || p_messages(n).message_name);
3251: end if;
3252: end if;
3253: n := p_messages.next(n);
3254: end loop;
3253: n := p_messages.next(n);
3254: end loop;
3255:
3256: if g_debug then
3257: hr_utility.trace('End of execute ELP time entry rules');
3258: end if;
3259:
3260: end execute_ELP_time_entry_rules;
3261:
3282: l_client_tz fnd_timezones_b.timezone_code%type;
3283: l_server_tz fnd_timezones_b.timezone_code%type;
3284: l_client_time DATE;
3285: BEGIN
3286: g_debug := hr_utility.debug_enabled;
3287:
3288: if g_debug then
3289: hr_utility.TRACE ( 'Stop Time '
3290: || p_stop_time);
3285: BEGIN
3286: g_debug := hr_utility.debug_enabled;
3287:
3288: if g_debug then
3289: hr_utility.TRACE ( 'Stop Time '
3290: || p_stop_time);
3291: hr_utility.TRACE ( 'p_st_late_hrs '
3292: || p_st_late_hrs);
3293: hr_utility.TRACE ( 'p_qnt_late_hrs '
3287:
3288: if g_debug then
3289: hr_utility.TRACE ( 'Stop Time '
3290: || p_stop_time);
3291: hr_utility.TRACE ( 'p_st_late_hrs '
3292: || p_st_late_hrs);
3293: hr_utility.TRACE ( 'p_qnt_late_hrs '
3294: || p_qnt_late_hrs);
3295: end if;
3289: hr_utility.TRACE ( 'Stop Time '
3290: || p_stop_time);
3291: hr_utility.TRACE ( 'p_st_late_hrs '
3292: || p_st_late_hrs);
3293: hr_utility.TRACE ( 'p_qnt_late_hrs '
3294: || p_qnt_late_hrs);
3295: end if;
3296: --Fix for Bug No:4948883
3297: fnd_date.timezones_enabled := true;
3303: THEN
3304: l_late_measure := ( l_client_time - p_stop_time
3305: ) * 24;
3306: if g_debug then
3307: hr_utility.TRACE ( 'l_late_measure '
3308: || l_late_measure);
3309: end if;
3310:
3311: IF (l_late_measure > p_st_late_hrs)
3313: RETURN TRUE;
3314: END IF;
3315: ELSE
3316: if g_debug then
3317: hr_utility.trace('L_date_worked...............' || to_char(p_date_worked,'dd-mon-rrrr hh:mi:ss'));
3318: end if;
3319: IF (( TRUNC (p_date_worked)
3320: + (p_qnt_late_hrs / 24)
3321: ) < l_client_time
3321: ) < l_client_time
3322: )
3323: THEN
3324: if g_debug then
3325: hr_utility.TRACE ('Late.....');
3326: end if;
3327: RETURN TRUE;
3328: END IF;
3329: END IF;
3395: BEGIN
3396:
3397:
3398: if g_debug then
3399: hr_utility.TRACE ('Start of populate old tco');
3400: end if;
3401: p_timecard_building_blocks.DELETE;
3402: p_timecard_attributes.DELETE;
3403: l_tbb_index := 0;
3405:
3406: FOR r_det_rec IN csr_get_det_bbs
3407: LOOP
3408: if g_debug then
3409: hr_utility.TRACE (
3410: 'r_det_rec.time_building_block_id '
3411: || r_det_rec.time_building_block_id
3412: );
3413: hr_utility.TRACE (
3409: hr_utility.TRACE (
3410: 'r_det_rec.time_building_block_id '
3411: || r_det_rec.time_building_block_id
3412: );
3413: hr_utility.TRACE (
3414: 'r_det_rec.object_version_number '
3415: || r_det_rec.object_version_number
3416: );
3417: end if;
3461: r_det_rec.object_version_number
3462: )
3463: LOOP
3464: if g_debug then
3465: hr_utility.TRACE (
3466: 'Attribute Id'
3467: || r_der_attr.time_attribute_id
3468: );
3469: hr_utility.TRACE (
3465: hr_utility.TRACE (
3466: 'Attribute Id'
3467: || r_der_attr.time_attribute_id
3468: );
3469: hr_utility.TRACE (
3470: 'Attribute Category '
3471: || r_der_attr.attribute_category
3472: );
3473: end if;
3551: END LOOP;
3552: END LOOP;
3553:
3554: if g_debug then
3555: hr_utility.TRACE ('Leaving populate old tco');
3556: end if;
3557: END populate_old_tco;
3558:
3559: FUNCTION compare_tbb_attributes (
3636: p_change_att_tab(l_change_att_index).changed_attribute :='ATTRIBUTE1';
3637: l_change_att_index := l_change_att_index+1;
3638:
3639: if g_debug then
3640: hr_utility.TRACE ('Att1');
3641: hr_utility.TRACE ( 'l_mapping_name '
3642: || l_mapping_name);
3643: hr_utility.TRACE ( 'l_return_mapp '
3644: || l_return_mapp);
3637: l_change_att_index := l_change_att_index+1;
3638:
3639: if g_debug then
3640: hr_utility.TRACE ('Att1');
3641: hr_utility.TRACE ( 'l_mapping_name '
3642: || l_mapping_name);
3643: hr_utility.TRACE ( 'l_return_mapp '
3644: || l_return_mapp);
3645: end if;
3639: if g_debug then
3640: hr_utility.TRACE ('Att1');
3641: hr_utility.TRACE ( 'l_mapping_name '
3642: || l_mapping_name);
3643: hr_utility.TRACE ( 'l_return_mapp '
3644: || l_return_mapp);
3645: end if;
3646: l_return_mapp := l_return_mapp
3647: || ':'
3673: p_change_att_tab(l_change_att_index).changed_attribute :='ATTRIBUTE2';
3674: l_change_att_index := l_change_att_index+1;
3675:
3676: if g_debug then
3677: hr_utility.TRACE ('Att2');
3678: hr_utility.TRACE ( 'l_mapping_name '
3679: || l_mapping_name);
3680: hr_utility.TRACE ( 'l_return_mapp '
3681: || l_return_mapp);
3674: l_change_att_index := l_change_att_index+1;
3675:
3676: if g_debug then
3677: hr_utility.TRACE ('Att2');
3678: hr_utility.TRACE ( 'l_mapping_name '
3679: || l_mapping_name);
3680: hr_utility.TRACE ( 'l_return_mapp '
3681: || l_return_mapp);
3682: end if;
3676: if g_debug then
3677: hr_utility.TRACE ('Att2');
3678: hr_utility.TRACE ( 'l_mapping_name '
3679: || l_mapping_name);
3680: hr_utility.TRACE ( 'l_return_mapp '
3681: || l_return_mapp);
3682: end if;
3683: l_return_mapp := l_return_mapp
3684: || ':'
3711: p_change_att_tab(l_change_att_index).changed_attribute :='ATTRIBUTE3';
3712: l_change_att_index := l_change_att_index+1;
3713:
3714: if g_debug then
3715: hr_utility.TRACE ('Att3');
3716: hr_utility.TRACE ( 'l_mapping_name '
3717: || l_mapping_name);
3718: hr_utility.TRACE ( 'l_return_mapp '
3719: || l_return_mapp);
3712: l_change_att_index := l_change_att_index+1;
3713:
3714: if g_debug then
3715: hr_utility.TRACE ('Att3');
3716: hr_utility.TRACE ( 'l_mapping_name '
3717: || l_mapping_name);
3718: hr_utility.TRACE ( 'l_return_mapp '
3719: || l_return_mapp);
3720: end if;
3714: if g_debug then
3715: hr_utility.TRACE ('Att3');
3716: hr_utility.TRACE ( 'l_mapping_name '
3717: || l_mapping_name);
3718: hr_utility.TRACE ( 'l_return_mapp '
3719: || l_return_mapp);
3720: end if;
3721: l_return_mapp := l_return_mapp
3722: || ':'
3748: p_change_att_tab(l_change_att_index).changed_attribute :='ATTRIBUTE4';
3749: l_change_att_index := l_change_att_index+1;
3750:
3751: if g_debug then
3752: hr_utility.TRACE ('Att4');
3753: hr_utility.TRACE ( 'l_mapping_name '
3754: || l_mapping_name);
3755: hr_utility.TRACE ( 'l_return_mapp '
3756: || l_return_mapp);
3749: l_change_att_index := l_change_att_index+1;
3750:
3751: if g_debug then
3752: hr_utility.TRACE ('Att4');
3753: hr_utility.TRACE ( 'l_mapping_name '
3754: || l_mapping_name);
3755: hr_utility.TRACE ( 'l_return_mapp '
3756: || l_return_mapp);
3757: end if;
3751: if g_debug then
3752: hr_utility.TRACE ('Att4');
3753: hr_utility.TRACE ( 'l_mapping_name '
3754: || l_mapping_name);
3755: hr_utility.TRACE ( 'l_return_mapp '
3756: || l_return_mapp);
3757: end if;
3758: l_return_mapp := l_return_mapp
3759: || ':'
4553: || l_mapping_name;
4554: END IF;
4555:
4556: if g_debug then
4557: hr_utility.TRACE (l_return_mapp);
4558: end if;
4559: RETURN l_return_mapp;
4560: END compare_tbb_attributes;
4561:
4605: l_change_att_index := p_change_att_tab.last+1;
4606: END IF;
4607:
4608: if g_debug then
4609: hr_utility.TRACE ( 'p_block1.scope'
4610: || p_block1.SCOPE);
4611: hr_utility.TRACE ( 'p_block2.scope'
4612: || p_block2.SCOPE);
4613: end if;
4607:
4608: if g_debug then
4609: hr_utility.TRACE ( 'p_block1.scope'
4610: || p_block1.SCOPE);
4611: hr_utility.TRACE ( 'p_block2.scope'
4612: || p_block2.SCOPE);
4613: end if;
4614:
4615: IF (p_block1.SCOPE = 'DETAIL')
4625: OR
4626: (p_block1.measure is not null and p_tbb_deleted ))
4627: THEN
4628: if g_debug then
4629: hr_utility.TRACE ('Before assignment');
4630: end if;
4631: OPEN csr_get_mapping_name('ATTRIBUTE1');
4632: FETCH csr_get_mapping_name INTO l_mapping_name;
4633: CLOSE csr_get_mapping_name;
4639: l_change_att_index := p_change_att_tab.last+1;
4640:
4641: l_ret_val := 'BUILDING_BLOCKS'||'|'||'ATTRIBUTE1'||'|'||l_mapping_name;
4642: if g_debug then
4643: hr_utility.TRACE ('After Assignment');
4644: end if;
4645: END IF;
4646:
4647: if g_debug then
4644: end if;
4645: END IF;
4646:
4647: if g_debug then
4648: hr_utility.TRACE ('l_ret_val');
4649: end if;
4650:
4651: -- 2. Start Time
4652: IF ((NVL (p_block1.start_time, to_date('01-01-0090','dd-mm-rrrr')) <>
4655: (p_block1.start_time is not null and p_tbb_deleted )
4656: )
4657: THEN
4658: if g_debug then
4659: hr_utility.TRACE ( 'l_ret_val'
4660: || l_ret_val);
4661: end if;
4662: OPEN csr_get_mapping_name('ATTRIBUTE2');
4663: FETCH csr_get_mapping_name INTO l_mapping_name;
4759: BEGIN
4760:
4761:
4762: if g_debug then
4763: hr_utility.TRACE ('Before get_timecard_info');
4764: end if;
4765: get_timecard_info (
4766: p_time_building_blocks=> P_TIME_BUILDING_BLOCKS,
4767: p_timecard_rec=> l_timecard_info_rec
4767: p_timecard_rec=> l_timecard_info_rec
4768: );
4769:
4770: if g_debug then
4771: hr_utility.TRACE ('Before populate_old_tco');
4772: end if;
4773: populate_old_tco (
4774: p_timecard_rec=> l_timecard_info_rec,
4775: p_timecard_building_blocks=> l_old_tco_bb,
4778:
4779: IF (p_rule_record.attribute1 IS NOT NULL)
4780: THEN
4781: if g_debug then
4782: hr_utility.TRACE (
4783: 'Attribute 1 -- Time Category '
4784: || p_rule_record.attribute1
4785: );
4786: end if;
4814:
4815: END IF;
4816:
4817: if g_debug then
4818: hr_utility.TRACE ('Returned from populate_old_tco');
4819: end if;
4820:
4821: n:= l_old_tco_bb.first;
4822: loop
4821: n:= l_old_tco_bb.first;
4822: loop
4823: exit when not l_old_tco_bb.exists(n);
4824: if g_debug then
4825: hr_utility.trace('ID ' || 'OVN' || 'SCOPE' || 'Changed' || 'New' || 'Date To');
4826: hr_utility.trace(l_old_tco_bb(n).time_building_block_id||' ' || l_old_tco_bb(n).object_version_number|| ' ' || l_old_tco_bb(n).scope ||' '
4827: || l_old_tco_bb(n).changed|| ' ' ||l_old_tco_bb(n).new || to_char(l_old_tco_bb(n).date_to,'dd-mon-rrrr'));
4828: end if;
4829: n := p_time_building_blocks.next(n);
4822: loop
4823: exit when not l_old_tco_bb.exists(n);
4824: if g_debug then
4825: hr_utility.trace('ID ' || 'OVN' || 'SCOPE' || 'Changed' || 'New' || 'Date To');
4826: hr_utility.trace(l_old_tco_bb(n).time_building_block_id||' ' || l_old_tco_bb(n).object_version_number|| ' ' || l_old_tco_bb(n).scope ||' '
4827: || l_old_tco_bb(n).changed|| ' ' ||l_old_tco_bb(n).new || to_char(l_old_tco_bb(n).date_to,'dd-mon-rrrr'));
4828: end if;
4829: n := p_time_building_blocks.next(n);
4830: end loop;
4833:
4834: LOOP
4835: EXIT WHEN NOT p_tco_att.EXISTS (l_tbb_index);
4836: if g_debug then
4837: hr_utility.TRACE (
4838: p_tco_att (l_tbb_index).time_attribute_id
4839: || ' ' || p_tco_att (l_tbb_index).object_version_number
4840: || 'attribute_category' || p_tco_att (l_tbb_index).attribute_category
4841: || 'attribute1 '|| p_tco_att (l_tbb_index).attribute1
4845: l_tbb_index := p_tco_att.NEXT (l_tbb_index);
4846: END LOOP;
4847:
4848: if g_debug then
4849: hr_utility.TRACE ('OLD TBB');
4850: end if;
4851: l_old_tbb_index := l_old_tco_att.FIRST;
4852:
4853: LOOP
4852:
4853: LOOP
4854: EXIT WHEN NOT l_old_tco_att.EXISTS (l_old_tbb_index);
4855: if g_debug then
4856: hr_utility.TRACE (
4857: l_old_tco_att (l_old_tbb_index).time_attribute_id
4858: || ' '|| l_old_tco_att (l_old_tbb_index).object_version_number
4859: || 'Attribute_category '|| l_old_tco_att (l_old_tbb_index).attribute_category
4860: || 'Attribute1 '|| l_old_tco_att (l_old_tbb_index).attribute1
4869:
4870: /* Loop through Building blocks */
4871: LOOP
4872: if g_debug then
4873: hr_utility.TRACE ('Timecard Loop');
4874: end if;
4875: l_build_change_list := null;
4876: l_tbb_deleted := FALSE;
4877: EXIT WHEN NOT p_tco_bb.EXISTS (l_tbb_index);
4885:
4886:
4887: l_old_tbb_index := l_old_tco_bb.FIRST;
4888: if g_debug then
4889: hr_utility.TRACE ('Old Timecard Loop');
4890: end if;
4891: if (trunc(p_tco_bb(l_tbb_index).date_to) = trunc(sysdate)) then
4892: l_tbb_deleted := TRUE;
4893: else
4896: LOOP
4897: EXIT WHEN NOT l_old_tco_bb.EXISTS (l_old_tbb_index); -- OR l_tbb_deleted;
4898: l_change_list := NULL;
4899: if g_debug then
4900: hr_utility.TRACE ('TBB Test');
4901: end if;
4902:
4903: if g_debug then
4904: hr_utility.trace('new bb/ovn is '||to_char(p_tco_bb(l_tbb_index).time_building_block_id)||':'
4900: hr_utility.TRACE ('TBB Test');
4901: end if;
4902:
4903: if g_debug then
4904: hr_utility.trace('new bb/ovn is '||to_char(p_tco_bb(l_tbb_index).time_building_block_id)||':'
4905: ||to_char(p_tco_bb(l_tbb_index).object_version_number));
4906:
4907: hr_utility.trace('old bb/ovn is '||to_char(l_old_tco_bb(l_old_tbb_index).time_building_block_id)||':'
4908: ||to_char(l_old_tco_bb(l_old_tbb_index).object_version_number));
4903: if g_debug then
4904: hr_utility.trace('new bb/ovn is '||to_char(p_tco_bb(l_tbb_index).time_building_block_id)||':'
4905: ||to_char(p_tco_bb(l_tbb_index).object_version_number));
4906:
4907: hr_utility.trace('old bb/ovn is '||to_char(l_old_tco_bb(l_old_tbb_index).time_building_block_id)||':'
4908: ||to_char(l_old_tco_bb(l_old_tbb_index).object_version_number));
4909: end if;
4910:
4911: IF ( p_tco_bb (l_tbb_index).time_building_block_id =
4992: END IF;
4993:
4994: l_att_index := p_tco_att.NEXT (l_att_index);
4995: if g_debug then
4996: hr_utility.TRACE ('After old attr loop');
4997: end if;
4998: END LOOP;
4999: END IF;
5000:
5097: p_tco_att=> p_tco_att
5098: );
5099: l_tbb_index := p_tco_bb.FIRST;
5100: if g_debug then
5101: hr_utility.TRACE ('Outside Loop');
5102: end if;
5103:
5104: LOOP
5105: EXIT WHEN NOT p_tco_bb.EXISTS (l_tbb_index);
5208: END LOOP;
5209: END IF;
5210:
5211: if g_debug then
5212: hr_utility.TRACE ('CLA Lateeeeeeeeeeeeeee Message Table');
5213: hr_utility.trace('Count ' || p_messages.count);
5214: end if;
5215: n := p_messages.FIRST;
5216:
5209: END IF;
5210:
5211: if g_debug then
5212: hr_utility.TRACE ('CLA Lateeeeeeeeeeeeeee Message Table');
5213: hr_utility.trace('Count ' || p_messages.count);
5214: end if;
5215: n := p_messages.FIRST;
5216:
5217: LOOP
5219:
5220: IF (p_messages (n).message_level = 'REASON')
5221: THEN
5222: if g_debug then
5223: hr_utility.TRACE ('Time Building Block Id' || 'Time Building Block OVN' || 'message_name');
5224: hr_utility.trace(p_messages (n).time_building_block_id || ' ' || p_messages (n).time_building_block_ovn || ' ' || p_messages (n).message_name);
5225: end if;
5226: END IF;
5227: n := p_messages.NEXT (n);
5220: IF (p_messages (n).message_level = 'REASON')
5221: THEN
5222: if g_debug then
5223: hr_utility.TRACE ('Time Building Block Id' || 'Time Building Block OVN' || 'message_name');
5224: hr_utility.trace(p_messages (n).time_building_block_id || ' ' || p_messages (n).time_building_block_ovn || ' ' || p_messages (n).message_name);
5225: end if;
5226: END IF;
5227: n := p_messages.NEXT (n);
5228: END LOOP;
5226: END IF;
5227: n := p_messages.NEXT (n);
5228: END LOOP;
5229: if g_debug then
5230: hr_utility.trace('End Lateeeeeeeeeeeeeee');
5231: end if;
5232: END execute_late_ter;
5233: Begin
5234:
5231: end if;
5232: END execute_late_ter;
5233: Begin
5234:
5235: g_debug := hr_utility.debug_enabled;
5236:
5237: n:= p_time_building_blocks.first;
5238: loop
5239: exit when not p_time_building_blocks.exists(n);
5237: n:= p_time_building_blocks.first;
5238: loop
5239: exit when not p_time_building_blocks.exists(n);
5240: if g_debug then
5241: hr_utility.trace('ID ' || 'OVN' || 'SCOPE' || 'Changed' || 'New' || ' ' || 'Date to');
5242: hr_utility.trace(p_time_building_blocks(n).time_building_block_id||' ' || p_time_building_blocks(n).object_version_number|| ' ' || p_time_building_blocks(n).scope ||' '
5243: || p_time_building_blocks(n).changed|| ' ' ||p_time_building_blocks(n).new || to_char(p_time_building_blocks(n).date_to,'dd-mon-rrrr'));
5244: end if;
5245: n := p_time_building_blocks.next(n);
5238: loop
5239: exit when not p_time_building_blocks.exists(n);
5240: if g_debug then
5241: hr_utility.trace('ID ' || 'OVN' || 'SCOPE' || 'Changed' || 'New' || ' ' || 'Date to');
5242: hr_utility.trace(p_time_building_blocks(n).time_building_block_id||' ' || p_time_building_blocks(n).object_version_number|| ' ' || p_time_building_blocks(n).scope ||' '
5243: || p_time_building_blocks(n).changed|| ' ' ||p_time_building_blocks(n).new || to_char(p_time_building_blocks(n).date_to,'dd-mon-rrrr'));
5244: end if;
5245: n := p_time_building_blocks.next(n);
5246: end loop;
5247: get_timecard_info (
5248: p_time_building_blocks => P_TIME_BUILDING_BLOCKS
5249: , p_timecard_rec => l_timecard_info_rec );
5250: if g_debug then
5251: hr_utility.trace('After get_timecard_info');
5252: hr_utility.trace('start_date ' || l_timecard_info_rec.start_date);
5253: end if;
5254:
5255: n := p_messages.first;
5248: p_time_building_blocks => P_TIME_BUILDING_BLOCKS
5249: , p_timecard_rec => l_timecard_info_rec );
5250: if g_debug then
5251: hr_utility.trace('After get_timecard_info');
5252: hr_utility.trace('start_date ' || l_timecard_info_rec.start_date);
5253: end if;
5254:
5255: n := p_messages.first;
5256: loop
5306: end loop;
5307:
5308:
5309: if g_debug then
5310: hr_utility.trace('Final Message Table -- Late + Change......');
5311: end if;
5312: n := p_messages.first;
5313: loop
5314: exit when not p_messages.exists(n);
5313: loop
5314: exit when not p_messages.exists(n);
5315: if (p_messages(n).message_level = 'REASON') then
5316: if g_debug then
5317: hr_utility.trace('Time Building Block Id' || p_messages(n).time_building_block_id);
5318: hr_utility.trace('Time Building Block OVN' || p_messages(n).time_building_block_ovn);
5319: hr_utility.trace('Message name' || p_messages(n).message_name);
5320: hr_utility.trace('Message Level' || p_messages(n).message_level);
5321: hr_utility.trace('Message Tokens' || p_messages(n).message_tokens);
5314: exit when not p_messages.exists(n);
5315: if (p_messages(n).message_level = 'REASON') then
5316: if g_debug then
5317: hr_utility.trace('Time Building Block Id' || p_messages(n).time_building_block_id);
5318: hr_utility.trace('Time Building Block OVN' || p_messages(n).time_building_block_ovn);
5319: hr_utility.trace('Message name' || p_messages(n).message_name);
5320: hr_utility.trace('Message Level' || p_messages(n).message_level);
5321: hr_utility.trace('Message Tokens' || p_messages(n).message_tokens);
5322: hr_utility.trace('Field name' || p_messages(n).message_field);
5315: if (p_messages(n).message_level = 'REASON') then
5316: if g_debug then
5317: hr_utility.trace('Time Building Block Id' || p_messages(n).time_building_block_id);
5318: hr_utility.trace('Time Building Block OVN' || p_messages(n).time_building_block_ovn);
5319: hr_utility.trace('Message name' || p_messages(n).message_name);
5320: hr_utility.trace('Message Level' || p_messages(n).message_level);
5321: hr_utility.trace('Message Tokens' || p_messages(n).message_tokens);
5322: hr_utility.trace('Field name' || p_messages(n).message_field);
5323: hr_utility.trace('Recipient Application ID' || p_messages(n).message_name);
5316: if g_debug then
5317: hr_utility.trace('Time Building Block Id' || p_messages(n).time_building_block_id);
5318: hr_utility.trace('Time Building Block OVN' || p_messages(n).time_building_block_ovn);
5319: hr_utility.trace('Message name' || p_messages(n).message_name);
5320: hr_utility.trace('Message Level' || p_messages(n).message_level);
5321: hr_utility.trace('Message Tokens' || p_messages(n).message_tokens);
5322: hr_utility.trace('Field name' || p_messages(n).message_field);
5323: hr_utility.trace('Recipient Application ID' || p_messages(n).message_name);
5324: end if;
5317: hr_utility.trace('Time Building Block Id' || p_messages(n).time_building_block_id);
5318: hr_utility.trace('Time Building Block OVN' || p_messages(n).time_building_block_ovn);
5319: hr_utility.trace('Message name' || p_messages(n).message_name);
5320: hr_utility.trace('Message Level' || p_messages(n).message_level);
5321: hr_utility.trace('Message Tokens' || p_messages(n).message_tokens);
5322: hr_utility.trace('Field name' || p_messages(n).message_field);
5323: hr_utility.trace('Recipient Application ID' || p_messages(n).message_name);
5324: end if;
5325: end if;
5318: hr_utility.trace('Time Building Block OVN' || p_messages(n).time_building_block_ovn);
5319: hr_utility.trace('Message name' || p_messages(n).message_name);
5320: hr_utility.trace('Message Level' || p_messages(n).message_level);
5321: hr_utility.trace('Message Tokens' || p_messages(n).message_tokens);
5322: hr_utility.trace('Field name' || p_messages(n).message_field);
5323: hr_utility.trace('Recipient Application ID' || p_messages(n).message_name);
5324: end if;
5325: end if;
5326: n := p_messages.next(n);
5319: hr_utility.trace('Message name' || p_messages(n).message_name);
5320: hr_utility.trace('Message Level' || p_messages(n).message_level);
5321: hr_utility.trace('Message Tokens' || p_messages(n).message_tokens);
5322: hr_utility.trace('Field name' || p_messages(n).message_field);
5323: hr_utility.trace('Recipient Application ID' || p_messages(n).message_name);
5324: end if;
5325: end if;
5326: n := p_messages.next(n);
5327: end loop;
5326: n := p_messages.next(n);
5327: end loop;
5328:
5329: if g_debug then
5330: hr_utility.trace('End of execute CLA time entry rules');
5331: end if;
5332:
5333: end EXECUTE_CLA_TIME_ENTRY_RULES;
5334:
5362: AND hbb.BLD_BLK_INFO_TYPE_ID = hmc.bld_blk_info_type_id
5363: AND hbb.BLD_BLK_INFO_TYPE = 'BUILDING_BLOCKS';
5364: l_prompt_name varchar2(30);
5365: Begin
5366: g_debug := hr_utility.debug_enabled;
5367:
5368: if (p_blk_type = 'BUILDING_BLOCK' ) then
5369: open c_get_prompt_blk(p_attribute);
5370: fetch c_get_prompt_blk into l_prompt_name;
5368: if (p_blk_type = 'BUILDING_BLOCK' ) then
5369: open c_get_prompt_blk(p_attribute);
5370: fetch c_get_prompt_blk into l_prompt_name;
5371: if g_debug then
5372: hr_utility.trace('Prompt ' || l_prompt_name);
5373: end if;
5374: if c_get_prompt_blk%FOUND then
5375: p_prompt := l_prompt_name;
5376: end if;
5405: l_token_string VARCHAR2(4000) := NULL;
5406:
5407: BEGIN
5408:
5409: g_debug := hr_utility.debug_enabled;
5410:
5411: IF ( p_token_name is not null )
5412: THEN
5413:
5411: IF ( p_token_name is not null )
5412: THEN
5413:
5414: if g_debug then
5415: hr_utility.trace('GAZ token is '||p_token_name);
5416: hr_utility.trace('GAZ length P token value is '||to_char(length(p_token_value)));
5417: end if;
5418:
5419: l_token_string := SUBSTR(UPPER(p_token_name)||'&'||p_token_Value,1,4000);
5412: THEN
5413:
5414: if g_debug then
5415: hr_utility.trace('GAZ token is '||p_token_name);
5416: hr_utility.trace('GAZ length P token value is '||to_char(length(p_token_value)));
5417: end if;
5418:
5419: l_token_string := SUBSTR(UPPER(p_token_name)||'&'||p_token_Value,1,4000);
5420:
5418:
5419: l_token_string := SUBSTR(UPPER(p_token_name)||'&'||p_token_Value,1,4000);
5420:
5421: if g_debug then
5422: hr_utility.trace('GAZ length token string is '||to_char(length(l_token_string)));
5423: end if;
5424:
5425: END IF;
5426: