53: v_curr_date := NULL;
54: v_curr_day :=NULL;
55:
56: -- Check for valid range
57: hr_utility.trace('Entered standard_hours_worked');
58:
59: IF p_range_start > p_range_end THEN
60: hr_utility.trace('p_range_start greater than p_range_end');
61: RETURN v_total_hours;
56: -- Check for valid range
57: hr_utility.trace('Entered standard_hours_worked');
58:
59: IF p_range_start > p_range_end THEN
60: hr_utility.trace('p_range_start greater than p_range_end');
61: RETURN v_total_hours;
62: -- hr_utility.set_message(801,'PAY_xxxx_INVALID_DATE_RANGE');
63: -- hr_utility.raise_error;
64: END IF;
58:
59: IF p_range_start > p_range_end THEN
60: hr_utility.trace('p_range_start greater than p_range_end');
61: RETURN v_total_hours;
62: -- hr_utility.set_message(801,'PAY_xxxx_INVALID_DATE_RANGE');
63: -- hr_utility.raise_error;
64: END IF;
65: --
66:
59: IF p_range_start > p_range_end THEN
60: hr_utility.trace('p_range_start greater than p_range_end');
61: RETURN v_total_hours;
62: -- hr_utility.set_message(801,'PAY_xxxx_INVALID_DATE_RANGE');
63: -- hr_utility.raise_error;
64: END IF;
65: --
66:
67: IF UPPER(p_std_freq) = 'WEEK' THEN
64: END IF;
65: --
66:
67: IF UPPER(p_std_freq) = 'WEEK' THEN
68: hr_utility.trace('p_std_freq = WEEK ');
69:
70: v_wrkday_hours := p_std_hrs / c_wkdays_per_week;
71:
72: hr_utility.trace('p_std_hrs ='||to_number(p_std_hrs));
68: hr_utility.trace('p_std_freq = WEEK ');
69:
70: v_wrkday_hours := p_std_hrs / c_wkdays_per_week;
71:
72: hr_utility.trace('p_std_hrs ='||to_number(p_std_hrs));
73: hr_utility.trace('c_wkdays_per_week ='||to_number(c_wkdays_per_week));
74: hr_utility.trace('v_wrkday_hours ='||to_number(v_wrkday_hours));
75:
76: ELSIF UPPER(p_std_freq) = 'MONTH' THEN
69:
70: v_wrkday_hours := p_std_hrs / c_wkdays_per_week;
71:
72: hr_utility.trace('p_std_hrs ='||to_number(p_std_hrs));
73: hr_utility.trace('c_wkdays_per_week ='||to_number(c_wkdays_per_week));
74: hr_utility.trace('v_wrkday_hours ='||to_number(v_wrkday_hours));
75:
76: ELSIF UPPER(p_std_freq) = 'MONTH' THEN
77:
70: v_wrkday_hours := p_std_hrs / c_wkdays_per_week;
71:
72: hr_utility.trace('p_std_hrs ='||to_number(p_std_hrs));
73: hr_utility.trace('c_wkdays_per_week ='||to_number(c_wkdays_per_week));
74: hr_utility.trace('v_wrkday_hours ='||to_number(v_wrkday_hours));
75:
76: ELSIF UPPER(p_std_freq) = 'MONTH' THEN
77:
78: hr_utility.trace('p_std_freq = MONTH ');
74: hr_utility.trace('v_wrkday_hours ='||to_number(v_wrkday_hours));
75:
76: ELSIF UPPER(p_std_freq) = 'MONTH' THEN
77:
78: hr_utility.trace('p_std_freq = MONTH ');
79:
80: v_wrkday_hours := p_std_hrs / c_wkdays_per_month;
81:
82:
79:
80: v_wrkday_hours := p_std_hrs / c_wkdays_per_month;
81:
82:
83: hr_utility.trace('p_std_hrs ='||to_number(p_std_hrs));
84: hr_utility.trace('c_wkdays_per_month ='||to_number(c_wkdays_per_month));
85: hr_utility.trace('v_wrkday_hours ='||to_number(v_wrkday_hours));
86:
87: ELSIF UPPER(p_std_freq) = 'YEAR' THEN
80: v_wrkday_hours := p_std_hrs / c_wkdays_per_month;
81:
82:
83: hr_utility.trace('p_std_hrs ='||to_number(p_std_hrs));
84: hr_utility.trace('c_wkdays_per_month ='||to_number(c_wkdays_per_month));
85: hr_utility.trace('v_wrkday_hours ='||to_number(v_wrkday_hours));
86:
87: ELSIF UPPER(p_std_freq) = 'YEAR' THEN
88:
81:
82:
83: hr_utility.trace('p_std_hrs ='||to_number(p_std_hrs));
84: hr_utility.trace('c_wkdays_per_month ='||to_number(c_wkdays_per_month));
85: hr_utility.trace('v_wrkday_hours ='||to_number(v_wrkday_hours));
86:
87: ELSIF UPPER(p_std_freq) = 'YEAR' THEN
88:
89: hr_utility.trace('p_std_freq = YEAR ');
85: hr_utility.trace('v_wrkday_hours ='||to_number(v_wrkday_hours));
86:
87: ELSIF UPPER(p_std_freq) = 'YEAR' THEN
88:
89: hr_utility.trace('p_std_freq = YEAR ');
90: v_wrkday_hours := p_std_hrs / c_wkdays_per_year;
91:
92: hr_utility.trace('p_std_hrs ='||to_number(p_std_hrs));
93: hr_utility.trace('c_wkdays_per_year ='||to_number(c_wkdays_per_year));
88:
89: hr_utility.trace('p_std_freq = YEAR ');
90: v_wrkday_hours := p_std_hrs / c_wkdays_per_year;
91:
92: hr_utility.trace('p_std_hrs ='||to_number(p_std_hrs));
93: hr_utility.trace('c_wkdays_per_year ='||to_number(c_wkdays_per_year));
94: hr_utility.trace('v_wrkday_hours ='||to_number(v_wrkday_hours));
95:
96: ELSE
89: hr_utility.trace('p_std_freq = YEAR ');
90: v_wrkday_hours := p_std_hrs / c_wkdays_per_year;
91:
92: hr_utility.trace('p_std_hrs ='||to_number(p_std_hrs));
93: hr_utility.trace('c_wkdays_per_year ='||to_number(c_wkdays_per_year));
94: hr_utility.trace('v_wrkday_hours ='||to_number(v_wrkday_hours));
95:
96: ELSE
97: hr_utility.trace('p_std_freq in ELSE ');
90: v_wrkday_hours := p_std_hrs / c_wkdays_per_year;
91:
92: hr_utility.trace('p_std_hrs ='||to_number(p_std_hrs));
93: hr_utility.trace('c_wkdays_per_year ='||to_number(c_wkdays_per_year));
94: hr_utility.trace('v_wrkday_hours ='||to_number(v_wrkday_hours));
95:
96: ELSE
97: hr_utility.trace('p_std_freq in ELSE ');
98: v_wrkday_hours := p_std_hrs;
93: hr_utility.trace('c_wkdays_per_year ='||to_number(c_wkdays_per_year));
94: hr_utility.trace('v_wrkday_hours ='||to_number(v_wrkday_hours));
95:
96: ELSE
97: hr_utility.trace('p_std_freq in ELSE ');
98: v_wrkday_hours := p_std_hrs;
99: END IF;
100:
101: v_curr_date := p_range_start;
99: END IF;
100:
101: v_curr_date := p_range_start;
102:
103: hr_utility.trace('v_curr_date is range start'||to_char(v_curr_date));
104:
105:
106: LOOP
107:
112:
113:
114: v_total_hours := nvl(v_total_hours,0) + v_wrkday_hours;
115:
116: hr_utility.trace(' v_day_no = '||to_char(v_day_no));
117: hr_utility.trace(' v_total_hours = '||to_char(v_total_hours));
118: END IF;
119:
120: v_curr_date := v_curr_date + 1;
113:
114: v_total_hours := nvl(v_total_hours,0) + v_wrkday_hours;
115:
116: hr_utility.trace(' v_day_no = '||to_char(v_day_no));
117: hr_utility.trace(' v_total_hours = '||to_char(v_total_hours));
118: END IF;
119:
120: v_curr_date := v_curr_date + 1;
121: EXIT WHEN v_curr_date > p_range_end;
119:
120: v_curr_date := v_curr_date + 1;
121: EXIT WHEN v_curr_date > p_range_end;
122: END LOOP;
123: hr_utility.trace(' Final v_total_hours = '||to_char(v_total_hours));
124: hr_utility.trace(' Leaving standard_hours_worked' );
125: --
126: RETURN v_total_hours;
127: --
120: v_curr_date := v_curr_date + 1;
121: EXIT WHEN v_curr_date > p_range_end;
122: END LOOP;
123: hr_utility.trace(' Final v_total_hours = '||to_char(v_total_hours));
124: hr_utility.trace(' Leaving standard_hours_worked' );
125: --
126: RETURN v_total_hours;
127: --
128: END standard_hours_worked;
170: BEGIN
171: l_work_schedule_found := FALSE;
172: l_total_hours := 0;
173:
174: hr_utility.trace( 'date_earned '||date_earned);
175: hr_utility.trace('assignment_action_id=' || assignment_action_id);
176: hr_utility.trace('assignment_id=' || assignment_id);
177: hr_utility.trace('business_group_id=' || business_group_id);
178: hr_utility.trace('element_entry_id=' || element_entry_id);
171: l_work_schedule_found := FALSE;
172: l_total_hours := 0;
173:
174: hr_utility.trace( 'date_earned '||date_earned);
175: hr_utility.trace('assignment_action_id=' || assignment_action_id);
176: hr_utility.trace('assignment_id=' || assignment_id);
177: hr_utility.trace('business_group_id=' || business_group_id);
178: hr_utility.trace('element_entry_id=' || element_entry_id);
179: hr_utility.trace( 'date_earned '||date_earned);
172: l_total_hours := 0;
173:
174: hr_utility.trace( 'date_earned '||date_earned);
175: hr_utility.trace('assignment_action_id=' || assignment_action_id);
176: hr_utility.trace('assignment_id=' || assignment_id);
177: hr_utility.trace('business_group_id=' || business_group_id);
178: hr_utility.trace('element_entry_id=' || element_entry_id);
179: hr_utility.trace( 'date_earned '||date_earned);
180: hr_utility.trace('p_period_start_date=' || p_period_start_date);
173:
174: hr_utility.trace( 'date_earned '||date_earned);
175: hr_utility.trace('assignment_action_id=' || assignment_action_id);
176: hr_utility.trace('assignment_id=' || assignment_id);
177: hr_utility.trace('business_group_id=' || business_group_id);
178: hr_utility.trace('element_entry_id=' || element_entry_id);
179: hr_utility.trace( 'date_earned '||date_earned);
180: hr_utility.trace('p_period_start_date=' || p_period_start_date);
181: hr_utility.trace('p_period_end_date=' || p_period_end_date);
174: hr_utility.trace( 'date_earned '||date_earned);
175: hr_utility.trace('assignment_action_id=' || assignment_action_id);
176: hr_utility.trace('assignment_id=' || assignment_id);
177: hr_utility.trace('business_group_id=' || business_group_id);
178: hr_utility.trace('element_entry_id=' || element_entry_id);
179: hr_utility.trace( 'date_earned '||date_earned);
180: hr_utility.trace('p_period_start_date=' || p_period_start_date);
181: hr_utility.trace('p_period_end_date=' || p_period_end_date);
182: hr_utility.trace('p_legislation_code=' || p_legislation_code);
175: hr_utility.trace('assignment_action_id=' || assignment_action_id);
176: hr_utility.trace('assignment_id=' || assignment_id);
177: hr_utility.trace('business_group_id=' || business_group_id);
178: hr_utility.trace('element_entry_id=' || element_entry_id);
179: hr_utility.trace( 'date_earned '||date_earned);
180: hr_utility.trace('p_period_start_date=' || p_period_start_date);
181: hr_utility.trace('p_period_end_date=' || p_period_end_date);
182: hr_utility.trace('p_legislation_code=' || p_legislation_code);
183: hr_utility.trace('p_schedule_category=' || p_schedule_category);
176: hr_utility.trace('assignment_id=' || assignment_id);
177: hr_utility.trace('business_group_id=' || business_group_id);
178: hr_utility.trace('element_entry_id=' || element_entry_id);
179: hr_utility.trace( 'date_earned '||date_earned);
180: hr_utility.trace('p_period_start_date=' || p_period_start_date);
181: hr_utility.trace('p_period_end_date=' || p_period_end_date);
182: hr_utility.trace('p_legislation_code=' || p_legislation_code);
183: hr_utility.trace('p_schedule_category=' || p_schedule_category);
184: hr_utility.trace('p_schedule_source=' || p_schedule_source);
177: hr_utility.trace('business_group_id=' || business_group_id);
178: hr_utility.trace('element_entry_id=' || element_entry_id);
179: hr_utility.trace( 'date_earned '||date_earned);
180: hr_utility.trace('p_period_start_date=' || p_period_start_date);
181: hr_utility.trace('p_period_end_date=' || p_period_end_date);
182: hr_utility.trace('p_legislation_code=' || p_legislation_code);
183: hr_utility.trace('p_schedule_category=' || p_schedule_category);
184: hr_utility.trace('p_schedule_source=' || p_schedule_source);
185: hr_utility.trace('p_include_exceptions=' || p_include_exceptions);
178: hr_utility.trace('element_entry_id=' || element_entry_id);
179: hr_utility.trace( 'date_earned '||date_earned);
180: hr_utility.trace('p_period_start_date=' || p_period_start_date);
181: hr_utility.trace('p_period_end_date=' || p_period_end_date);
182: hr_utility.trace('p_legislation_code=' || p_legislation_code);
183: hr_utility.trace('p_schedule_category=' || p_schedule_category);
184: hr_utility.trace('p_schedule_source=' || p_schedule_source);
185: hr_utility.trace('p_include_exceptions=' || p_include_exceptions);
186: hr_utility.trace('p_busy_tentative_as=' || p_busy_tentative_as);
179: hr_utility.trace( 'date_earned '||date_earned);
180: hr_utility.trace('p_period_start_date=' || p_period_start_date);
181: hr_utility.trace('p_period_end_date=' || p_period_end_date);
182: hr_utility.trace('p_legislation_code=' || p_legislation_code);
183: hr_utility.trace('p_schedule_category=' || p_schedule_category);
184: hr_utility.trace('p_schedule_source=' || p_schedule_source);
185: hr_utility.trace('p_include_exceptions=' || p_include_exceptions);
186: hr_utility.trace('p_busy_tentative_as=' || p_busy_tentative_as);
187: hr_utility.trace('p_schedule=' || p_schedule);
180: hr_utility.trace('p_period_start_date=' || p_period_start_date);
181: hr_utility.trace('p_period_end_date=' || p_period_end_date);
182: hr_utility.trace('p_legislation_code=' || p_legislation_code);
183: hr_utility.trace('p_schedule_category=' || p_schedule_category);
184: hr_utility.trace('p_schedule_source=' || p_schedule_source);
185: hr_utility.trace('p_include_exceptions=' || p_include_exceptions);
186: hr_utility.trace('p_busy_tentative_as=' || p_busy_tentative_as);
187: hr_utility.trace('p_schedule=' || p_schedule);
188:
181: hr_utility.trace('p_period_end_date=' || p_period_end_date);
182: hr_utility.trace('p_legislation_code=' || p_legislation_code);
183: hr_utility.trace('p_schedule_category=' || p_schedule_category);
184: hr_utility.trace('p_schedule_source=' || p_schedule_source);
185: hr_utility.trace('p_include_exceptions=' || p_include_exceptions);
186: hr_utility.trace('p_busy_tentative_as=' || p_busy_tentative_as);
187: hr_utility.trace('p_schedule=' || p_schedule);
188:
189:
182: hr_utility.trace('p_legislation_code=' || p_legislation_code);
183: hr_utility.trace('p_schedule_category=' || p_schedule_category);
184: hr_utility.trace('p_schedule_source=' || p_schedule_source);
185: hr_utility.trace('p_include_exceptions=' || p_include_exceptions);
186: hr_utility.trace('p_busy_tentative_as=' || p_busy_tentative_as);
187: hr_utility.trace('p_schedule=' || p_schedule);
188:
189:
190: IF (p_legislation_code IS NULL) AND (g_legislation_code IS NULL) THEN
183: hr_utility.trace('p_schedule_category=' || p_schedule_category);
184: hr_utility.trace('p_schedule_source=' || p_schedule_source);
185: hr_utility.trace('p_include_exceptions=' || p_include_exceptions);
186: hr_utility.trace('p_busy_tentative_as=' || p_busy_tentative_as);
187: hr_utility.trace('p_schedule=' || p_schedule);
188:
189:
190: IF (p_legislation_code IS NULL) AND (g_legislation_code IS NULL) THEN
191: OPEN get_leg_code(business_group_id);
215: */
216:
217: IF NOT l_work_schedule_found THEN
218: BEGIN
219: hr_utility.trace( 'getting work schedule from SCL ');
220: EXECUTE IMMEDIATE 'BEGIN :1 := PAY_'||g_legislation_code||
221: '_RULES.Work_Schedule_Total_Hours(:2,:3,:4,:5,:6,:7,:8); END;'
222: USING OUT l_total_hours,
223: IN assignment_action_id,assignment_id,business_group_id,element_entry_id
223: IN assignment_action_id,assignment_id,business_group_id,element_entry_id
224: ,date_earned,p_period_start_date,p_period_end_date;
225:
226: IF l_total_hours > 0 THEN
227: hr_utility.trace( 'work schedule found from SCL ');
228: l_work_schedule_found := TRUE;
229: return l_total_hours;
230: END IF;
231: EXCEPTION
239: worked are not available from either ATG work schedule or work schedule
240: at assignment/org level */
241:
242: IF NOT l_work_schedule_found THEN
243: hr_utility.trace('Calculating hours based on Standard conditions ');
244: hr_utility.trace( 'Assignment Id '||assignment_id);
245: hr_utility.trace( 'date_earned '||date_earned);
246: OPEN get_asg_hours_freq(date_earned,assignment_id);
247: FETCH get_asg_hours_freq
240: at assignment/org level */
241:
242: IF NOT l_work_schedule_found THEN
243: hr_utility.trace('Calculating hours based on Standard conditions ');
244: hr_utility.trace( 'Assignment Id '||assignment_id);
245: hr_utility.trace( 'date_earned '||date_earned);
246: OPEN get_asg_hours_freq(date_earned,assignment_id);
247: FETCH get_asg_hours_freq
248: INTO l_asg_frequency, l_normal_hours;
241:
242: IF NOT l_work_schedule_found THEN
243: hr_utility.trace('Calculating hours based on Standard conditions ');
244: hr_utility.trace( 'Assignment Id '||assignment_id);
245: hr_utility.trace( 'date_earned '||date_earned);
246: OPEN get_asg_hours_freq(date_earned,assignment_id);
247: FETCH get_asg_hours_freq
248: INTO l_asg_frequency, l_normal_hours;
249: CLOSE get_asg_hours_freq;
247: FETCH get_asg_hours_freq
248: INTO l_asg_frequency, l_normal_hours;
249: CLOSE get_asg_hours_freq;
250:
251: hr_utility.trace( 'l_asg_frequency '||l_asg_frequency);
252: hr_utility.trace( 'l_normal_hours '||l_normal_hours);
253:
254: IF l_asg_frequency IS NOT NULL and l_normal_hours IS NOT NULL THEN
255: l_total_hours := standard_hours_worked(l_normal_hours
248: INTO l_asg_frequency, l_normal_hours;
249: CLOSE get_asg_hours_freq;
250:
251: hr_utility.trace( 'l_asg_frequency '||l_asg_frequency);
252: hr_utility.trace( 'l_normal_hours '||l_normal_hours);
253:
254: IF l_asg_frequency IS NOT NULL and l_normal_hours IS NOT NULL THEN
255: l_total_hours := standard_hours_worked(l_normal_hours
256: ,p_period_start_date