105: --
106: --
107: begin
108:
109: hr_utility.set_location('pay_std_check::check_control',1);
110:
111:
112: p_std_status := 'C';
113: --
134: if(l_n_lines <> nvl(p_control_total,0)) then
135:
136: -- Set status to signify an error and load up message text
137: p_std_status:='E';
138: hr_utility.set_message(801,'HR_34850_WRONG_NUM_BATCH_LINES');
139: hr_utility.set_message_token('N_LINES_IN_BATCH',l_n_lines);
140: hr_utility.set_message_token('N_LINES_CONTROL_TOTAL',p_control_total);
141: p_std_message:=hr_utility.get_message;
142:
135:
136: -- Set status to signify an error and load up message text
137: p_std_status:='E';
138: hr_utility.set_message(801,'HR_34850_WRONG_NUM_BATCH_LINES');
139: hr_utility.set_message_token('N_LINES_IN_BATCH',l_n_lines);
140: hr_utility.set_message_token('N_LINES_CONTROL_TOTAL',p_control_total);
141: p_std_message:=hr_utility.get_message;
142:
143: end if;
136: -- Set status to signify an error and load up message text
137: p_std_status:='E';
138: hr_utility.set_message(801,'HR_34850_WRONG_NUM_BATCH_LINES');
139: hr_utility.set_message_token('N_LINES_IN_BATCH',l_n_lines);
140: hr_utility.set_message_token('N_LINES_CONTROL_TOTAL',p_control_total);
141: p_std_message:=hr_utility.get_message;
142:
143: end if;
144:
137: p_std_status:='E';
138: hr_utility.set_message(801,'HR_34850_WRONG_NUM_BATCH_LINES');
139: hr_utility.set_message_token('N_LINES_IN_BATCH',l_n_lines);
140: hr_utility.set_message_token('N_LINES_CONTROL_TOTAL',p_control_total);
141: p_std_message:=hr_utility.get_message;
142:
143: end if;
144:
145: end if;
157: -- dont even attempt summation.
158: -- No element in batch has this input value.
159: -- Set status to error and insert relevant error in message table
160: p_std_status:='E';
161: hr_utility.set_message(801,'HR_34851_IRRELEVANT_CONTROL_TOTAL');
162: hr_utility.set_message_token('NAME_OF_ENTRY_TO_SUM',l_meaning);
163: p_std_message:=hr_utility.get_message;
164:
165: else
158: -- No element in batch has this input value.
159: -- Set status to error and insert relevant error in message table
160: p_std_status:='E';
161: hr_utility.set_message(801,'HR_34851_IRRELEVANT_CONTROL_TOTAL');
162: hr_utility.set_message_token('NAME_OF_ENTRY_TO_SUM',l_meaning);
163: p_std_message:=hr_utility.get_message;
164:
165: else
166:
159: -- Set status to error and insert relevant error in message table
160: p_std_status:='E';
161: hr_utility.set_message(801,'HR_34851_IRRELEVANT_CONTROL_TOTAL');
162: hr_utility.set_message_token('NAME_OF_ENTRY_TO_SUM',l_meaning);
163: p_std_message:=hr_utility.get_message;
164:
165: else
166:
167: -- Do the summation. We need to build a sql statement for each
201: execute immediate l_sql_stat into l_element_total;
202: exception -- could not perform summation for some reason
203: when others then
204: p_std_status:='E';
205: hr_utility.set_message(801,'HR_34853_CANT_SUM_COLUMN');
206: hr_utility.set_message_token('NAME_OF_ENTRY_TO_SUM',l_meaning);
207: p_std_message:=hr_utility.get_message;
208: --
209: end;
202: exception -- could not perform summation for some reason
203: when others then
204: p_std_status:='E';
205: hr_utility.set_message(801,'HR_34853_CANT_SUM_COLUMN');
206: hr_utility.set_message_token('NAME_OF_ENTRY_TO_SUM',l_meaning);
207: p_std_message:=hr_utility.get_message;
208: --
209: end;
210: --
203: when others then
204: p_std_status:='E';
205: hr_utility.set_message(801,'HR_34853_CANT_SUM_COLUMN');
206: hr_utility.set_message_token('NAME_OF_ENTRY_TO_SUM',l_meaning);
207: p_std_message:=hr_utility.get_message;
208: --
209: end;
210: --
211: l_running_total := l_running_total + nvl(l_element_total,0);
219: -- compare calculated total with control total
220:
221: if(l_running_total <> nvl(p_control_total,0)) then
222: p_std_status:='E';
223: hr_utility.set_message(801,'HR_34852_SUMMATION_NE_TOTAL');
224: hr_utility.set_message_token('NAME_OF_ENTRY_TO_SUM',l_meaning);
225: hr_utility.set_message_token('BATCH_TOTAL',l_running_total);
226: hr_utility.set_message_token('CONTROL_TOTAL',p_control_total);
227: p_std_message:=hr_utility.get_message;
220:
221: if(l_running_total <> nvl(p_control_total,0)) then
222: p_std_status:='E';
223: hr_utility.set_message(801,'HR_34852_SUMMATION_NE_TOTAL');
224: hr_utility.set_message_token('NAME_OF_ENTRY_TO_SUM',l_meaning);
225: hr_utility.set_message_token('BATCH_TOTAL',l_running_total);
226: hr_utility.set_message_token('CONTROL_TOTAL',p_control_total);
227: p_std_message:=hr_utility.get_message;
228: end if;
221: if(l_running_total <> nvl(p_control_total,0)) then
222: p_std_status:='E';
223: hr_utility.set_message(801,'HR_34852_SUMMATION_NE_TOTAL');
224: hr_utility.set_message_token('NAME_OF_ENTRY_TO_SUM',l_meaning);
225: hr_utility.set_message_token('BATCH_TOTAL',l_running_total);
226: hr_utility.set_message_token('CONTROL_TOTAL',p_control_total);
227: p_std_message:=hr_utility.get_message;
228: end if;
229:
222: p_std_status:='E';
223: hr_utility.set_message(801,'HR_34852_SUMMATION_NE_TOTAL');
224: hr_utility.set_message_token('NAME_OF_ENTRY_TO_SUM',l_meaning);
225: hr_utility.set_message_token('BATCH_TOTAL',l_running_total);
226: hr_utility.set_message_token('CONTROL_TOTAL',p_control_total);
227: p_std_message:=hr_utility.get_message;
228: end if;
229:
230: end if;
223: hr_utility.set_message(801,'HR_34852_SUMMATION_NE_TOTAL');
224: hr_utility.set_message_token('NAME_OF_ENTRY_TO_SUM',l_meaning);
225: hr_utility.set_message_token('BATCH_TOTAL',l_running_total);
226: hr_utility.set_message_token('CONTROL_TOTAL',p_control_total);
227: p_std_message:=hr_utility.get_message;
228: end if;
229:
230: end if;
231: end if;