[Home] [Help]
PACKAGE BODY: APPS.PAY_BATCH_ELEMENT_ENTRY_API
Source
1 Package Body PAY_BATCH_ELEMENT_ENTRY_API as
2 /* $Header: pybthapi.pkb 120.3 2005/06/21 06:16:10 susivasu noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := 'pay_batch_element_entry_api.';
7 --
8 --
9 function get_upgrade_status
10 (p_batch_id number
11 ,p_batch_line_id number
12 ,p_short_name varchar2
13 )return varchar2 is
14 --
15 l_status pay_upgrade_status.status%type;
16 l_business_group_id pay_batch_headers.business_group_id%TYPE;
17 --
18 cursor csr_bg_id is
19 select bth.business_group_id
20 from pay_batch_headers bth
21 where bth.batch_id = p_batch_id
22 union all
23 select bth.business_group_id
24 from pay_batch_headers bth,
25 pay_batch_lines btl
26 where bth.batch_id = btl.batch_id
27 and btl.batch_line_id = p_batch_line_id;
28 --
29 begin
30 --
31 open csr_bg_id;
32 fetch csr_bg_id into l_business_group_id;
33 close csr_bg_id;
34 --
35 pay_core_utils.get_upgrade_status(l_business_group_id,p_short_name,l_status);
36 --
37 return l_status;
38 --
39 exception
40 when others then
41 --
42 return 'E';
43 --
44 end;
45 --
46 -- -------------------------------------------------------------------------
47 -- Procedure to convert input values from display format to internal format.
48 -- -------------------------------------------------------------------------
49 function convert_display_to_internal
50 (p_input_value varchar2,
51 p_uom_value varchar2,
52 p_lookup_type varchar2,
53 p_value_set_id number,
54 p_currency_code varchar2)
55 return varchar2 is
56 --
57 l_display_value varchar2(80) := p_input_value;
58 l_formatted_value varchar2(80) := p_input_value;
59 l_dummy varchar2(100);
60 --
61 cursor csr_valid_lookup
62 (p_lookup_type varchar2,
63 p_meaning varchar2) is
64 select HL.lookup_code
65 from hr_lookups HL
66 where HL.lookup_type = p_lookup_type
67 and HL.meaning = p_meaning;
68 --
69 begin
70 --
71 if (p_lookup_type is not null and
72 l_display_value is not null) then
73 --
74 open csr_valid_lookup(p_lookup_type, l_display_value);
75 fetch csr_valid_lookup into l_formatted_value ;
76 --
77 if csr_valid_lookup%NOTFOUND then
78 close csr_valid_lookup;
79 raise no_data_found;
80 end if;
81 --
82 close csr_valid_lookup;
83 --
84 elsif (p_value_set_id is not null and
85 l_display_value is not null) then
86 --
87 l_formatted_value := pay_input_values_pkg.decode_vset_meaning(
88 p_value_set_id, l_display_value);
89 --
90 if l_formatted_value is null then
91 raise no_data_found;
92 end if;
93 --
94 else
95 --
96 hr_chkfmt.checkformat (
97 l_display_value, /* the value to be formatted (out - display) */
98 p_uom_value, /* the format to check */
99 l_formatted_value, /* the formatted value on output (out - canonical) */
100 null, /* minimum value (can be null) */
101 null, /* maximum value (can be null) */
102 'Y', /* is ok to be null ? */
103 l_dummy, /* used for range checking */
104 p_currency_code );
105 --
106 end if;
107 --
108 return l_formatted_value;
109 --
110 exception
111 when others then
112 fnd_message.set_name ('PAY','PAY_6306_INPUT_VALUE_FORMAT');
113 fnd_message.set_token ('UNIT_OF_MEASURE', hr_general.decode_lookup ('UNITS', p_uom_value ));
114 fnd_message.raise_error;
115 --
116 end convert_display_to_internal;
117 --
118 -- -------------------------------------------------------------------------------
119 -- Procedure to convert date input values from display format to canonical format.
120 -- -------------------------------------------------------------------------------
121 procedure convert_date_to_canonical
122 (p_iv1 in out nocopy varchar2
123 ,p_iv2 in out nocopy varchar2
124 ,p_iv3 in out nocopy varchar2
125 ,p_iv4 in out nocopy varchar2
126 ,p_iv5 in out nocopy varchar2
127 ,p_iv6 in out nocopy varchar2
128 ,p_iv7 in out nocopy varchar2
129 ,p_iv8 in out nocopy varchar2
130 ,p_iv9 in out nocopy varchar2
131 ,p_iv10 in out nocopy varchar2
132 ,p_iv11 in out nocopy varchar2
133 ,p_iv12 in out nocopy varchar2
134 ,p_iv13 in out nocopy varchar2
135 ,p_iv14 in out nocopy varchar2
136 ,p_iv15 in out nocopy varchar2
137 ,p_element_type_id in number
138 ,p_element_name in varchar2
139 ,p_batch_id in number default null
140 ,p_effective_date in date
141 ,p_batch_line_id in number default null
142 ,p_date_cfmt in varchar2
143 ,p_int_fmt in varchar2
144 ) is
145 --
146 cursor csr_table_inp_ids(p_ele_type_id number
147 ,p_eff_date date) is
148 select inv.uom,inv.lookup_type,inv.value_set_id
149 from pay_input_values_f inv
150 where inv.element_type_id = p_ele_type_id
151 and p_eff_date between inv.effective_start_date
152 and inv.effective_end_date
153 order by inv.display_sequence
154 , inv.name;
155 --
156 l_uom pay_input_values_f.uom%TYPE;
157 --
158 l_lookup_type pay_input_values_f.lookup_type%TYPE;
159 l_value_set_id pay_input_values_f.value_set_id%TYPE;
160 l_input_curr_code pay_element_types_f.input_currency_code%TYPE;
161 --
162 l_element_type_id pay_element_types_f.element_type_id%TYPE := null;
163 l_element_name pay_element_types_f.element_name%TYPE := null;
164 l_count number := 0;
165 l_legislation_code per_business_groups.legislation_code%TYPE := null;
166 l_business_group_id per_business_groups.business_group_id%TYPE;
167 l_batch_id pay_batch_lines.batch_id%TYPE;
168 l_effective_date pay_batch_lines.effective_date%TYPE;
169 --
170 cursor csr_element_type (p_ele_name varchar2
171 ,p_bus_group_id number
172 ,p_leg_code varchar2
173 ,p_eff_date date
174 ,p_ele_id number) is
175 select pet.element_type_id,pet.input_currency_code
176 from pay_element_types_f pet
177 where p_ele_id is null
178 and upper(pet.element_name) = upper(p_ele_name)
179 and p_eff_date between pet.effective_start_date
180 and pet.effective_end_date
181 and (pet.business_group_id = p_bus_group_id
182 or (pet.business_group_id is null
183 and pet.legislation_code = p_leg_code)
184 or (pet.business_group_id is null
185 and pet.legislation_code is null))
186 union all
187 select pet.element_type_id,pet.input_currency_code
188 from pay_element_types_f pet
189 where p_ele_id is not null
190 and pet.element_type_id = p_ele_id
191 and p_eff_date between pet.effective_start_date
192 and pet.effective_end_date;
193 --
194 l_proc varchar2(72) := g_package||'convert_date_to_canonical';
195 --
196 begin
197 --
198 hr_utility.set_location('Entering:'|| l_proc, 10);
199 --
200 if p_effective_date = hr_api.g_date then
201 select effective_date
202 into l_effective_date
203 from pay_batch_lines pbl
204 where pbl.batch_line_id = p_batch_line_id;
205 else
206 l_effective_date := p_effective_date;
207 end if;
208 --
209 if (p_element_type_id = hr_api.g_number) then
210 select pbl.element_type_id
211 into l_element_type_id
212 from pay_batch_lines pbl
213 where pbl.batch_line_id = p_batch_line_id;
214 else
215 l_element_type_id := p_element_type_id;
216 end if;
217 --
218 if (l_element_type_id is null) then
219 --
220 if (p_batch_id is null and p_batch_line_id is not null) then
221 select pbl.batch_id
222 into l_batch_id
223 from pay_batch_lines pbl
224 where pbl.batch_line_id = p_batch_line_id;
225 else
226 l_batch_id := p_batch_id;
227 end if;
228 --
229 if p_element_name = hr_api.g_varchar2 then
230 select pbl.element_name
231 into l_element_name
232 from pay_batch_lines pbl
233 where pbl.batch_line_id = p_batch_line_id;
234 else
235 l_element_name := p_element_name;
236 end if;
237 --
238 select pbg.business_group_id,pbg.legislation_code
239 into l_business_group_id,l_legislation_code
240 from per_business_groups pbg,
241 pay_batch_headers pbh
242 where pbh.batch_id = l_batch_id
243 and pbg.business_group_id = pbh.business_group_id;
244 --
245 open csr_element_type(l_element_name
246 ,l_business_group_id
247 ,l_legislation_code
248 ,l_effective_date
249 ,l_element_type_id);
250 fetch csr_element_type into l_element_type_id,l_input_curr_code;
251 close csr_element_type;
252 --
253 else
254 --
255 open csr_element_type(l_element_name
256 ,l_business_group_id
257 ,l_legislation_code
258 ,l_effective_date
259 ,l_element_type_id);
260 fetch csr_element_type into l_element_type_id,l_input_curr_code;
261 close csr_element_type;
262 --
263 end if;
264 --
265 open csr_table_inp_ids(l_element_type_id,l_effective_date);
266 --
267 loop
268 fetch csr_table_inp_ids into l_uom,l_lookup_type,l_value_set_id;
269 exit when csr_table_inp_ids%NOTFOUND;
270 --
271 l_count := l_count +1;
272 --
273 if l_count > 15 then
274 exit;
275 end if;
276 --
277 -- Only convert the date if the input value is of date format, as well as the
278 -- input value is not defaulted or the intented format is canonical but the passed
279 -- value might be DD-MON-YYYY or DD-MON-YY format or they are specifically stated as
280 -- non-canonical format.
281 if (l_count = 1
282 and p_iv1 <> hr_api.g_varchar2
283 and ((l_uom = 'D' and p_date_cfmt = 'Y' and instr(p_iv1,'-',1,2) <> 0)
284 or (l_uom = 'D' and p_date_cfmt = 'N')
285 or (l_uom <> 'D' and p_int_fmt = 'Y'))) then
286 --
287 p_iv1 := convert_display_to_internal(p_iv1,l_uom,l_lookup_type,l_value_set_id,l_input_curr_code);
288 --
289 elsif (l_count = 2
290 and p_iv2 <> hr_api.g_varchar2
291 and ((l_uom = 'D' and p_date_cfmt = 'Y' and instr(p_iv2,'-',1,2) <> 0)
292 or (l_uom = 'D' and p_date_cfmt = 'N')
293 or (l_uom <> 'D' and p_int_fmt = 'Y'))) then
294 --
295 p_iv2 := convert_display_to_internal(p_iv2,l_uom,l_lookup_type,l_value_set_id,l_input_curr_code);
296 --
297 elsif (l_count = 3
298 and p_iv3 <> hr_api.g_varchar2
299 and ((l_uom = 'D' and p_date_cfmt = 'Y' and instr(p_iv3,'-',1,2) <> 0)
300 or (l_uom = 'D' and p_date_cfmt = 'N')
301 or (l_uom <> 'D' and p_int_fmt = 'Y'))) then
302 --
303 p_iv3 := convert_display_to_internal(p_iv3,l_uom,l_lookup_type,l_value_set_id,l_input_curr_code);
304 --
305 elsif (l_count = 4
309 or (l_uom <> 'D' and p_int_fmt = 'Y'))) then
306 and p_iv4 <> hr_api.g_varchar2
307 and ((l_uom = 'D' and p_date_cfmt = 'Y' and instr(p_iv4,'-',1,2) <> 0)
308 or (l_uom = 'D' and p_date_cfmt = 'N')
310 --
311 p_iv4 := convert_display_to_internal(p_iv4,l_uom,l_lookup_type,l_value_set_id,l_input_curr_code);
312 --
313 elsif (l_count = 5
314 and p_iv5 <> hr_api.g_varchar2
315 and ((l_uom = 'D' and p_date_cfmt = 'Y' and instr(p_iv5,'-',1,2) <> 0)
316 or (l_uom = 'D' and p_date_cfmt = 'N')
317 or (l_uom <> 'D' and p_int_fmt = 'Y'))) then
318 --
319 p_iv5 := convert_display_to_internal(p_iv5,l_uom,l_lookup_type,l_value_set_id,l_input_curr_code);
320 --
321 elsif (l_count = 6
322 and p_iv6 <> hr_api.g_varchar2
323 and ((l_uom = 'D' and p_date_cfmt = 'Y' and instr(p_iv6,'-',1,2) <> 0)
324 or (l_uom = 'D' and p_date_cfmt = 'N')
325 or (l_uom <> 'D' and p_int_fmt = 'Y'))) then
326 --
327 p_iv6 := convert_display_to_internal(p_iv6,l_uom,l_lookup_type,l_value_set_id,l_input_curr_code);
328 --
329 elsif (l_count = 7
330 and p_iv7 <> hr_api.g_varchar2
331 and ((l_uom = 'D' and p_date_cfmt = 'Y' and instr(p_iv7,'-',1,2) <> 0)
332 or (l_uom = 'D' and p_date_cfmt = 'N')
333 or (l_uom <> 'D' and p_int_fmt = 'Y'))) then
334 --
335 p_iv7 := convert_display_to_internal(p_iv7,l_uom,l_lookup_type,l_value_set_id,l_input_curr_code);
336 --
337 elsif (l_count = 8
338 and p_iv8 <> hr_api.g_varchar2
339 and ((l_uom = 'D' and p_date_cfmt = 'Y' and instr(p_iv8,'-',1,2) <> 0)
340 or (l_uom = 'D' and p_date_cfmt = 'N')
341 or (l_uom <> 'D' and p_int_fmt = 'Y'))) then
342 --
343 p_iv8 := convert_display_to_internal(p_iv8,l_uom,l_lookup_type,l_value_set_id,l_input_curr_code);
344 --
345 elsif (l_count = 9
346 and p_iv9 <> hr_api.g_varchar2
347 and ((l_uom = 'D' and p_date_cfmt = 'Y' and instr(p_iv9,'-',1,2) <> 0)
348 or (l_uom = 'D' and p_date_cfmt = 'N')
349 or (l_uom <> 'D' and p_int_fmt = 'Y'))) then
350 --
351 p_iv9 := convert_display_to_internal(p_iv9,l_uom,l_lookup_type,l_value_set_id,l_input_curr_code);
352 --
353 elsif (l_count = 10
354 and p_iv10 <> hr_api.g_varchar2
355 and ((l_uom = 'D' and p_date_cfmt = 'Y' and instr(p_iv10,'-',1,2) <> 0)
356 or (l_uom = 'D' and p_date_cfmt = 'N')
357 or (l_uom <> 'D' and p_int_fmt = 'Y'))) then
358 --
359 p_iv10 := convert_display_to_internal(p_iv10,l_uom,l_lookup_type,l_value_set_id,l_input_curr_code);
360 --
361 elsif (l_count = 11
362 and p_iv11 <> hr_api.g_varchar2
363 and ((l_uom = 'D' and p_date_cfmt = 'Y' and instr(p_iv11,'-',1,2) <> 0)
364 or (l_uom = 'D' and p_date_cfmt = 'N')
365 or (l_uom <> 'D' and p_int_fmt = 'Y'))) then
366 --
367 p_iv11 := convert_display_to_internal(p_iv11,l_uom,l_lookup_type,l_value_set_id,l_input_curr_code);
368 --
369 elsif (l_count = 12
370 and p_iv12 <> hr_api.g_varchar2
371 and ((l_uom = 'D' and p_date_cfmt = 'Y' and instr(p_iv12,'-',1,2) <> 0)
372 or (l_uom = 'D' and p_date_cfmt = 'N')
373 or (l_uom <> 'D' and p_int_fmt = 'Y'))) then
374 --
375 p_iv12 := convert_display_to_internal(p_iv12,l_uom,l_lookup_type,l_value_set_id,l_input_curr_code);
376 --
377 elsif (l_count = 13
378 and p_iv13 <> hr_api.g_varchar2
379 and ((l_uom = 'D' and p_date_cfmt = 'Y' and instr(p_iv13,'-',1,2) <> 0)
380 or (l_uom = 'D' and p_date_cfmt = 'N')
381 or (l_uom <> 'D' and p_int_fmt = 'Y'))) then
382 --
383 p_iv13 := convert_display_to_internal(p_iv13,l_uom,l_lookup_type,l_value_set_id,l_input_curr_code);
384 --
385 elsif (l_count = 14
386 and p_iv14 <> hr_api.g_varchar2
387 and ((l_uom = 'D' and p_date_cfmt = 'Y' and instr(p_iv14,'-',1,2) <> 0)
388 or (l_uom = 'D' and p_date_cfmt = 'N')
389 or (l_uom <> 'D' and p_int_fmt = 'Y'))) then
390 --
391 p_iv14 := convert_display_to_internal(p_iv14,l_uom,l_lookup_type,l_value_set_id,l_input_curr_code);
392 --
393 elsif (l_count = 15
394 and p_iv15 <> hr_api.g_varchar2
395 and ((l_uom = 'D' and p_date_cfmt = 'Y' and instr(p_iv15,'-',1,2) <> 0)
396 or (l_uom = 'D' and p_date_cfmt = 'N')
397 or (l_uom <> 'D' and p_int_fmt = 'Y'))) then
398 --
399 p_iv15 := convert_display_to_internal(p_iv15,l_uom,l_lookup_type,l_value_set_id,l_input_curr_code);
400 --
401 end if;
402 --
403 end loop;
404 --
405 close csr_table_inp_ids;
406 --
407 hr_utility.set_location('Leaving:'|| l_proc, 20);
408 --
409 exception
410 when others then
411 --fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
412 --fnd_message.set_token('PROCEDURE', l_proc);
413 --fnd_message.set_token('STEP','10');
414 --fnd_message.raise_error;
418 end convert_date_to_canonical;
415 fnd_message.set_name ('PAY','PAY_6306_INPUT_VALUE_FORMAT');
416 fnd_message.set_token ('UNIT_OF_MEASURE', hr_general.decode_lookup ('UNITS', l_uom ));
417 fnd_message.raise_error;
419 --
420 -- ----------------------------------------------------------------------------
421 -- |------------------------< create_batch_header >-------------------------|
422 -- ----------------------------------------------------------------------------
423 --
424 procedure create_batch_header
425 (p_validate in boolean default false
426 ,p_session_date in date
427 ,p_batch_name in varchar2
428 ,p_batch_status in varchar2 default 'U'
429 ,p_business_group_id in number
430 ,p_action_if_exists in varchar2 default 'R'
431 ,p_batch_reference in varchar2 default null
432 ,p_batch_source in varchar2 default null
433 ,p_comments in varchar2 default null
434 ,p_date_effective_changes in varchar2 default null
435 ,p_purge_after_transfer in varchar2 default 'N'
436 ,p_reject_if_future_changes in varchar2 default 'Y'
437 ,p_batch_id out nocopy number
438 ,p_object_version_number out nocopy number
439 ,p_reject_if_results_exists in varchar2 default 'Y'
440 ,p_purge_after_rollback in varchar2 default 'N'
441 ,p_batch_type in varchar2 default null
442 ,p_REJECT_ENTRY_NOT_REMOVED in varchar2 default 'N'
443 ,p_ROLLBACK_ENTRY_UPDATES in varchar2 default 'N'
444 ) is
445 --
446 -- Declare cursors and local variables
447 --
448 l_proc varchar2(72) := g_package||'create_batch_header';
449 l_batch_id pay_batch_headers.batch_id%TYPE;
450 l_object_version_number pay_batch_headers.object_version_number%TYPE;
451 l_session_date date;
452 --
453 begin
454 hr_utility.set_location('Entering:'|| l_proc, 10);
455 --
456 -- Issue a savepoint
457 --
458 savepoint create_batch_header;
459 --
460 -- Truncate the time portion from all IN date parameters
461 --
462 l_session_date := trunc(p_session_date);
463 --
464 -- Call Before Process User Hook
465 --
466 begin
467 pay_batch_element_entry_bk1.create_batch_header_b
468 (p_session_date => l_session_date
469 ,p_batch_name => p_batch_name
470 ,p_batch_status => p_batch_status
471 ,p_business_group_id => p_business_group_id
472 ,p_action_if_exists => p_action_if_exists
473 ,p_batch_reference => p_batch_reference
474 ,p_batch_source => p_batch_source
475 ,p_comments => p_comments
476 ,p_date_effective_changes => p_date_effective_changes
477 ,p_purge_after_transfer => p_purge_after_transfer
478 ,p_reject_if_future_changes => p_reject_if_future_changes
479 ,p_reject_if_results_exists => p_reject_if_results_exists
480 ,p_purge_after_rollback => p_purge_after_rollback
481 ,p_batch_type => p_batch_type
482 ,p_REJECT_ENTRY_NOT_REMOVED => p_REJECT_ENTRY_NOT_REMOVED
483 ,p_ROLLBACK_ENTRY_UPDATES => p_ROLLBACK_ENTRY_UPDATES
484 );
485 exception
486 when hr_api.cannot_find_prog_unit then
487 hr_api.cannot_find_prog_unit_error
488 (p_module_name => 'create_batch_header_b'
489 ,p_hook_type => 'BP'
490 );
491 end;
492 --
493 -- Validation in addition to Row Handlers
494 --
495 --
496 -- Process Logic
497 --
498 pay_bth_ins.ins
499 (p_session_date => l_session_date
500 ,p_business_group_id => p_business_group_id
501 ,p_batch_name => p_batch_name
502 ,p_batch_status => p_batch_status
503 ,p_action_if_exists => p_action_if_exists
504 ,p_batch_reference => p_batch_reference
505 ,p_batch_source => p_batch_source
506 ,p_batch_type => p_batch_type
507 ,p_comments => p_comments
508 ,p_date_effective_changes => p_date_effective_changes
509 ,p_purge_after_transfer => p_purge_after_transfer
510 ,p_reject_if_future_changes => p_reject_if_future_changes
511 ,p_reject_if_results_exists => p_reject_if_results_exists
512 ,p_purge_after_rollback => p_purge_after_rollback
513 ,p_REJECT_ENTRY_NOT_REMOVED => p_REJECT_ENTRY_NOT_REMOVED
514 ,p_ROLLBACK_ENTRY_UPDATES => p_ROLLBACK_ENTRY_UPDATES
515 ,p_batch_id => l_batch_id
516 ,p_object_version_number => l_object_version_number);
517 --
518 -- Call After Process User Hook
519 --
520 begin
521 pay_batch_element_entry_bk1.create_batch_header_a
522 (p_session_date => l_session_date
523 ,p_batch_name => p_batch_name
524 ,p_batch_status => p_batch_status
525 ,p_business_group_id => p_business_group_id
526 ,p_action_if_exists => p_action_if_exists
527 ,p_batch_reference => p_batch_reference
528 ,p_batch_source => p_batch_source
529 ,p_comments => p_comments
533 ,p_batch_id => l_batch_id
530 ,p_date_effective_changes => p_date_effective_changes
531 ,p_purge_after_transfer => p_purge_after_transfer
532 ,p_reject_if_future_changes => p_reject_if_future_changes
534 ,p_object_version_number => l_object_version_number
535 ,p_reject_if_results_exists => p_reject_if_results_exists
536 ,p_purge_after_rollback => p_purge_after_rollback
537 ,p_batch_type => p_batch_type
538 ,p_REJECT_ENTRY_NOT_REMOVED => p_REJECT_ENTRY_NOT_REMOVED
539 ,p_ROLLBACK_ENTRY_UPDATES => p_ROLLBACK_ENTRY_UPDATES
540 );
541 exception
542 when hr_api.cannot_find_prog_unit then
543 hr_api.cannot_find_prog_unit_error
544 (p_module_name => 'create_batch_header_a'
545 ,p_hook_type => 'AP'
546 );
547 end;
548 --
549 -- When in validation only mode raise the Validate_Enabled exception
550 --
551 if p_validate then
552 raise hr_api.validate_enabled;
553 end if;
554 --
555 -- Set all output arguments
556 --
557 p_batch_id := l_batch_id;
558 p_object_version_number := l_object_version_number;
559 --
560 hr_utility.set_location(' Leaving:'||l_proc, 70);
561 exception
562 when hr_api.validate_enabled then
563 --
564 -- As the Validate_Enabled exception has been raised
565 -- we must rollback to the savepoint
566 --
567 rollback to create_batch_header;
568 --
569 -- Only set output warning arguments
570 -- (Any key or derived arguments must be set to null
571 -- when validation only mode is being used.)
572 --
573 p_batch_id := null;
574 p_object_version_number := null;
575 hr_utility.set_location(' Leaving:'||l_proc, 80);
576 when others then
577 --
578 -- A validation or unexpected error has occured
579 --
580 rollback to create_batch_header;
581 p_batch_id := null;
582 p_object_version_number := null;
583 hr_utility.set_location(' Leaving:'||l_proc, 90);
584 raise;
585 end create_batch_header;
586 --
587 --
588 -- ----------------------------------------------------------------------------
589 -- |-------------------------< create_batch_line >--------------------------|
590 -- ----------------------------------------------------------------------------
591 --
592 procedure create_batch_line
593 (p_validate in boolean default false
594 ,p_session_date in date
595 ,p_batch_id in number
596 ,p_batch_line_status in varchar2 default 'U'
597 ,p_assignment_id in number default null
598 ,p_assignment_number in varchar2 default null
599 ,p_attribute_category in varchar2 default null
600 ,p_attribute1 in varchar2 default null
601 ,p_attribute2 in varchar2 default null
602 ,p_attribute3 in varchar2 default null
603 ,p_attribute4 in varchar2 default null
604 ,p_attribute5 in varchar2 default null
605 ,p_attribute6 in varchar2 default null
606 ,p_attribute7 in varchar2 default null
607 ,p_attribute8 in varchar2 default null
608 ,p_attribute9 in varchar2 default null
609 ,p_attribute10 in varchar2 default null
610 ,p_attribute11 in varchar2 default null
611 ,p_attribute12 in varchar2 default null
612 ,p_attribute13 in varchar2 default null
613 ,p_attribute14 in varchar2 default null
614 ,p_attribute15 in varchar2 default null
615 ,p_attribute16 in varchar2 default null
616 ,p_attribute17 in varchar2 default null
617 ,p_attribute18 in varchar2 default null
618 ,p_attribute19 in varchar2 default null
619 ,p_attribute20 in varchar2 default null
620 ,p_entry_information_category in varchar2 default null
621 ,p_entry_information1 in varchar2 default null
622 ,p_entry_information2 in varchar2 default null
623 ,p_entry_information3 in varchar2 default null
624 ,p_entry_information4 in varchar2 default null
625 ,p_entry_information5 in varchar2 default null
626 ,p_entry_information6 in varchar2 default null
627 ,p_entry_information7 in varchar2 default null
628 ,p_entry_information8 in varchar2 default null
629 ,p_entry_information9 in varchar2 default null
630 ,p_entry_information10 in varchar2 default null
631 ,p_entry_information11 in varchar2 default null
632 ,p_entry_information12 in varchar2 default null
633 ,p_entry_information13 in varchar2 default null
634 ,p_entry_information14 in varchar2 default null
635 ,p_entry_information15 in varchar2 default null
636 ,p_entry_information16 in varchar2 default null
637 ,p_entry_information17 in varchar2 default null
638 ,p_entry_information18 in varchar2 default null
639 ,p_entry_information19 in varchar2 default null
643 ,p_entry_information23 in varchar2 default null
640 ,p_entry_information20 in varchar2 default null
641 ,p_entry_information21 in varchar2 default null
642 ,p_entry_information22 in varchar2 default null
644 ,p_entry_information24 in varchar2 default null
645 ,p_entry_information25 in varchar2 default null
646 ,p_entry_information26 in varchar2 default null
647 ,p_entry_information27 in varchar2 default null
648 ,p_entry_information28 in varchar2 default null
649 ,p_entry_information29 in varchar2 default null
650 ,p_entry_information30 in varchar2 default null
651 ,p_date_earned in date default null
652 ,p_personal_payment_method_id in number default null
653 ,p_subpriority in number default null
654 ,p_batch_sequence in number default null
655 ,p_concatenated_segments in varchar2 default null
656 ,p_cost_allocation_keyflex_id in number default null
657 ,p_effective_date in date default null
658 ,p_effective_start_date in date default null
659 ,p_effective_end_date in date default null
660 ,p_element_name in varchar2 default null
661 ,p_element_type_id in number default null
662 ,p_entry_type in varchar2 default null
663 ,p_reason in varchar2 default null
664 ,p_segment1 in varchar2 default null
665 ,p_segment2 in varchar2 default null
666 ,p_segment3 in varchar2 default null
667 ,p_segment4 in varchar2 default null
668 ,p_segment5 in varchar2 default null
669 ,p_segment6 in varchar2 default null
670 ,p_segment7 in varchar2 default null
671 ,p_segment8 in varchar2 default null
672 ,p_segment9 in varchar2 default null
673 ,p_segment10 in varchar2 default null
674 ,p_segment11 in varchar2 default null
675 ,p_segment12 in varchar2 default null
676 ,p_segment13 in varchar2 default null
677 ,p_segment14 in varchar2 default null
678 ,p_segment15 in varchar2 default null
679 ,p_segment16 in varchar2 default null
680 ,p_segment17 in varchar2 default null
681 ,p_segment18 in varchar2 default null
682 ,p_segment19 in varchar2 default null
683 ,p_segment20 in varchar2 default null
684 ,p_segment21 in varchar2 default null
685 ,p_segment22 in varchar2 default null
686 ,p_segment23 in varchar2 default null
687 ,p_segment24 in varchar2 default null
688 ,p_segment25 in varchar2 default null
689 ,p_segment26 in varchar2 default null
690 ,p_segment27 in varchar2 default null
691 ,p_segment28 in varchar2 default null
692 ,p_segment29 in varchar2 default null
693 ,p_segment30 in varchar2 default null
694 ,p_value_1 in varchar2 default null
695 ,p_value_2 in varchar2 default null
696 ,p_value_3 in varchar2 default null
697 ,p_value_4 in varchar2 default null
698 ,p_value_5 in varchar2 default null
699 ,p_value_6 in varchar2 default null
700 ,p_value_7 in varchar2 default null
701 ,p_value_8 in varchar2 default null
702 ,p_value_9 in varchar2 default null
703 ,p_value_10 in varchar2 default null
704 ,p_value_11 in varchar2 default null
705 ,p_value_12 in varchar2 default null
706 ,p_value_13 in varchar2 default null
707 ,p_value_14 in varchar2 default null
708 ,p_value_15 in varchar2 default null
709 ,p_canonical_date_format in varchar2 default 'Y'
710 ,p_iv_all_internal_format in varchar2 default 'N'
711 ,p_batch_line_id out nocopy number
712 ,p_object_version_number out nocopy number
713 ) is
714 --
715 -- Declare cursors and local variables
716 --
717 l_proc varchar2(72) := g_package||'create_batch_line';
718 l_batch_line_id pay_batch_lines.batch_line_id%TYPE;
719 l_object_version_number pay_batch_lines.object_version_number%TYPE;
720 l_session_date date;
721 l_effective_date date;
722 l_effective_start_date date;
723 l_effective_end_date date;
724 l_date_earned date;
725 --
726 l_value_1 pay_batch_lines.value_1%TYPE := p_value_1;
727 l_value_2 pay_batch_lines.value_2%TYPE := p_value_2;
728 l_value_3 pay_batch_lines.value_3%TYPE := p_value_3;
729 l_value_4 pay_batch_lines.value_4%TYPE := p_value_4;
730 l_value_5 pay_batch_lines.value_5%TYPE := p_value_5;
734 l_value_9 pay_batch_lines.value_9%TYPE := p_value_9;
731 l_value_6 pay_batch_lines.value_6%TYPE := p_value_6;
732 l_value_7 pay_batch_lines.value_7%TYPE := p_value_7;
733 l_value_8 pay_batch_lines.value_8%TYPE := p_value_8;
735 l_value_10 pay_batch_lines.value_10%TYPE := p_value_10;
736 l_value_11 pay_batch_lines.value_11%TYPE := p_value_11;
737 l_value_12 pay_batch_lines.value_12%TYPE := p_value_12;
738 l_value_13 pay_batch_lines.value_13%TYPE := p_value_13;
739 l_value_14 pay_batch_lines.value_14%TYPE := p_value_14;
740 l_value_15 pay_batch_lines.value_15%TYPE := p_value_15;
741 --
742 l_bee_iv_upgrade varchar2(1);
743 --
744 begin
745 hr_utility.set_location('Entering:'|| l_proc, 10);
746 --
747 -- Issue a savepoint
748 --
749 savepoint create_batch_line;
750 --
751 -- Truncate the time portion from all IN date parameters
752 --
753 l_session_date := trunc(p_session_date);
754 l_effective_date := trunc(p_effective_date);
755 l_effective_start_date := trunc(p_effective_start_date);
756 l_effective_end_date := trunc(p_effective_end_date);
757 l_date_earned := trunc(p_date_earned);
758 --
759 l_bee_iv_upgrade := get_upgrade_status(p_batch_id,null,'BEE_IV_UPG');
760 --
761 -- Check whether the upgrade process is in progress.
762 --
763 if l_bee_iv_upgrade = 'E' then
764 hr_utility.set_message(800, 'HR_449106_BEE_UPGRADING');
765 hr_utility.raise_error;
766 end if;
767 --
768 if p_iv_all_internal_format = 'Y' and l_bee_iv_upgrade = 'N' then
769 fnd_message.set_name('PAY', 'HR_7462_PLK_INVLD_VALUE');
770 fnd_message.set_token('COLUMN_NAME','P_IV_ALL_INTERNAL_FORMAT');
771 fnd_message.raise_error;
772 end if;
773 --
774 if p_iv_all_internal_format = 'Y' and p_canonical_date_format = 'N' then
775 fnd_message.set_name('PAY', 'HR_7462_PLK_INVLD_VALUE');
776 fnd_message.set_token('COLUMN_NAME','P_CANONICAL_DATE_FORMAT');
777 fnd_message.raise_error;
778 end if;
779 --
780 --
781 if p_iv_all_internal_format <> 'Y' then
782 convert_date_to_canonical
783 (p_iv1 => l_value_1
784 ,p_iv2 => l_value_2
785 ,p_iv3 => l_value_3
786 ,p_iv4 => l_value_4
787 ,p_iv5 => l_value_5
788 ,p_iv6 => l_value_6
789 ,p_iv7 => l_value_7
790 ,p_iv8 => l_value_8
791 ,p_iv9 => l_value_9
792 ,p_iv10 => l_value_10
793 ,p_iv11 => l_value_11
794 ,p_iv12 => l_value_12
795 ,p_iv13 => l_value_13
796 ,p_iv14 => l_value_14
797 ,p_iv15 => l_value_15
798 ,p_element_type_id => p_element_type_id
799 ,p_element_name => p_element_name
800 ,p_batch_id => p_batch_id
801 ,p_effective_date => p_effective_date
802 ,p_date_cfmt => p_canonical_date_format
803 ,p_int_fmt => l_bee_iv_upgrade
804 );
805 end if;
806 --
807 -- Call Before Process User Hook
808 --
809 begin
810 pay_batch_element_entry_bk2.create_batch_line_b
811 (p_session_date => l_session_date
812 ,p_batch_id => p_batch_id
813 ,p_batch_line_status => p_batch_line_status
814 ,p_assignment_id => p_assignment_id
815 ,p_assignment_number => p_assignment_number
816 ,p_attribute_category => p_attribute_category
817 ,p_attribute1 => p_attribute1
818 ,p_attribute2 => p_attribute2
819 ,p_attribute3 => p_attribute3
820 ,p_attribute4 => p_attribute4
821 ,p_attribute5 => p_attribute5
822 ,p_attribute6 => p_attribute6
823 ,p_attribute7 => p_attribute7
824 ,p_attribute8 => p_attribute8
825 ,p_attribute9 => p_attribute9
826 ,p_attribute10 => p_attribute10
827 ,p_attribute11 => p_attribute11
828 ,p_attribute12 => p_attribute12
829 ,p_attribute13 => p_attribute13
830 ,p_attribute14 => p_attribute14
831 ,p_attribute15 => p_attribute15
832 ,p_attribute16 => p_attribute16
833 ,p_attribute17 => p_attribute17
834 ,p_attribute18 => p_attribute18
835 ,p_attribute19 => p_attribute19
836 ,p_attribute20 => p_attribute20
837 ,p_entry_information_category => p_entry_information_category
838 ,p_entry_information1 => p_entry_information1
839 ,p_entry_information2 => p_entry_information2
840 ,p_entry_information3 => p_entry_information3
841 ,p_entry_information4 => p_entry_information4
842 ,p_entry_information5 => p_entry_information5
843 ,p_entry_information6 => p_entry_information6
844 ,p_entry_information7 => p_entry_information7
845 ,p_entry_information8 => p_entry_information8
849 ,p_entry_information12 => p_entry_information12
846 ,p_entry_information9 => p_entry_information9
847 ,p_entry_information10 => p_entry_information10
848 ,p_entry_information11 => p_entry_information11
850 ,p_entry_information13 => p_entry_information13
851 ,p_entry_information14 => p_entry_information14
852 ,p_entry_information15 => p_entry_information15
853 ,p_entry_information16 => p_entry_information16
854 ,p_entry_information17 => p_entry_information17
855 ,p_entry_information18 => p_entry_information18
856 ,p_entry_information19 => p_entry_information19
857 ,p_entry_information20 => p_entry_information20
858 ,p_entry_information21 => p_entry_information21
859 ,p_entry_information22 => p_entry_information22
860 ,p_entry_information23 => p_entry_information23
861 ,p_entry_information24 => p_entry_information24
862 ,p_entry_information25 => p_entry_information25
863 ,p_entry_information26 => p_entry_information26
864 ,p_entry_information27 => p_entry_information27
865 ,p_entry_information28 => p_entry_information28
866 ,p_entry_information29 => p_entry_information29
867 ,p_entry_information30 => p_entry_information30
868 ,p_date_earned => l_date_earned
869 ,p_personal_payment_method_id => p_personal_payment_method_id
870 ,p_subpriority => p_subpriority
871 ,p_batch_sequence => p_batch_sequence
872 ,p_concatenated_segments => p_concatenated_segments
873 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
874 ,p_effective_date => l_effective_date
875 ,p_effective_start_date => l_effective_start_date
876 ,p_effective_end_date => l_effective_end_date
877 ,p_element_name => p_element_name
878 ,p_element_type_id => p_element_type_id
879 ,p_entry_type => p_entry_type
880 ,p_reason => p_reason
881 ,p_segment1 => p_segment1
882 ,p_segment2 => p_segment2
883 ,p_segment3 => p_segment3
884 ,p_segment4 => p_segment4
885 ,p_segment5 => p_segment5
886 ,p_segment6 => p_segment6
887 ,p_segment7 => p_segment7
888 ,p_segment8 => p_segment8
889 ,p_segment9 => p_segment9
890 ,p_segment10 => p_segment10
891 ,p_segment11 => p_segment11
892 ,p_segment12 => p_segment12
893 ,p_segment13 => p_segment13
894 ,p_segment14 => p_segment14
895 ,p_segment15 => p_segment15
896 ,p_segment16 => p_segment16
897 ,p_segment17 => p_segment17
898 ,p_segment18 => p_segment18
899 ,p_segment19 => p_segment19
900 ,p_segment20 => p_segment20
901 ,p_segment21 => p_segment21
902 ,p_segment22 => p_segment22
903 ,p_segment23 => p_segment23
904 ,p_segment24 => p_segment24
905 ,p_segment25 => p_segment25
906 ,p_segment26 => p_segment26
907 ,p_segment27 => p_segment27
908 ,p_segment28 => p_segment28
909 ,p_segment29 => p_segment29
910 ,p_segment30 => p_segment30
911 ,p_value_1 => l_value_1
912 ,p_value_2 => l_value_2
913 ,p_value_3 => l_value_3
914 ,p_value_4 => l_value_4
915 ,p_value_5 => l_value_5
916 ,p_value_6 => l_value_6
917 ,p_value_7 => l_value_7
918 ,p_value_8 => l_value_8
919 ,p_value_9 => l_value_9
920 ,p_value_10 => l_value_10
921 ,p_value_11 => l_value_11
922 ,p_value_12 => l_value_12
923 ,p_value_13 => l_value_13
924 ,p_value_14 => l_value_14
925 ,p_value_15 => l_value_15
926 );
927 exception
928 when hr_api.cannot_find_prog_unit then
929 hr_api.cannot_find_prog_unit_error
930 (p_module_name => 'create_batch_line_b'
931 ,p_hook_type => 'BP'
932 );
933 end;
934 --
935 -- Validation in addition to Row Handlers
936 --
937 --
938 -- Process Logic
939 --
940 pay_btl_ins.ins
941 (p_session_date => l_session_date
942 ,p_batch_id => p_batch_id
943 ,p_batch_line_status => p_batch_line_status
944 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
945 ,p_element_type_id => p_element_type_id
946 ,p_assignment_id => p_assignment_id
947 ,p_assignment_number => p_assignment_number
951 ,p_element_name => p_element_name
948 ,p_batch_sequence => p_batch_sequence
949 ,p_concatenated_segments => p_concatenated_segments
950 ,p_effective_date => l_effective_date
952 ,p_entry_type => p_entry_type
953 ,p_reason => p_reason
954 ,p_segment1 => p_segment1
955 ,p_segment2 => p_segment2
956 ,p_segment3 => p_segment3
957 ,p_segment4 => p_segment4
958 ,p_segment5 => p_segment5
959 ,p_segment6 => p_segment6
960 ,p_segment7 => p_segment7
961 ,p_segment8 => p_segment8
962 ,p_segment9 => p_segment9
963 ,p_segment10 => p_segment10
964 ,p_segment11 => p_segment11
965 ,p_segment12 => p_segment12
966 ,p_segment13 => p_segment13
967 ,p_segment14 => p_segment14
968 ,p_segment15 => p_segment15
969 ,p_segment16 => p_segment16
970 ,p_segment17 => p_segment17
971 ,p_segment18 => p_segment18
972 ,p_segment19 => p_segment19
973 ,p_segment20 => p_segment20
974 ,p_segment21 => p_segment21
975 ,p_segment22 => p_segment22
976 ,p_segment23 => p_segment23
977 ,p_segment24 => p_segment24
978 ,p_segment25 => p_segment25
979 ,p_segment26 => p_segment26
980 ,p_segment27 => p_segment27
981 ,p_segment28 => p_segment28
982 ,p_segment29 => p_segment29
983 ,p_segment30 => p_segment30
984 ,p_value_1 => l_value_1
985 ,p_value_2 => l_value_2
986 ,p_value_3 => l_value_3
987 ,p_value_4 => l_value_4
988 ,p_value_5 => l_value_5
989 ,p_value_6 => l_value_6
990 ,p_value_7 => l_value_7
991 ,p_value_8 => l_value_8
992 ,p_value_9 => l_value_9
993 ,p_value_10 => l_value_10
994 ,p_value_11 => l_value_11
995 ,p_value_12 => l_value_12
996 ,p_value_13 => l_value_13
997 ,p_value_14 => l_value_14
998 ,p_value_15 => l_value_15
999 ,p_attribute_category => p_attribute_category
1000 ,p_attribute1 => p_attribute1
1001 ,p_attribute2 => p_attribute2
1002 ,p_attribute3 => p_attribute3
1003 ,p_attribute4 => p_attribute4
1004 ,p_attribute5 => p_attribute5
1005 ,p_attribute6 => p_attribute6
1006 ,p_attribute7 => p_attribute7
1007 ,p_attribute8 => p_attribute8
1008 ,p_attribute9 => p_attribute9
1009 ,p_attribute10 => p_attribute10
1010 ,p_attribute11 => p_attribute11
1011 ,p_attribute12 => p_attribute12
1012 ,p_attribute13 => p_attribute13
1013 ,p_attribute14 => p_attribute14
1014 ,p_attribute15 => p_attribute15
1015 ,p_attribute16 => p_attribute16
1016 ,p_attribute17 => p_attribute17
1017 ,p_attribute18 => p_attribute18
1018 ,p_attribute19 => p_attribute19
1019 ,p_attribute20 => p_attribute20
1020 ,p_entry_information_category => p_entry_information_category
1021 ,p_entry_information1 => p_entry_information1
1022 ,p_entry_information2 => p_entry_information2
1023 ,p_entry_information3 => p_entry_information3
1024 ,p_entry_information4 => p_entry_information4
1025 ,p_entry_information5 => p_entry_information5
1026 ,p_entry_information6 => p_entry_information6
1027 ,p_entry_information7 => p_entry_information7
1028 ,p_entry_information8 => p_entry_information8
1029 ,p_entry_information9 => p_entry_information9
1030 ,p_entry_information10 => p_entry_information10
1031 ,p_entry_information11 => p_entry_information11
1032 ,p_entry_information12 => p_entry_information12
1033 ,p_entry_information13 => p_entry_information13
1034 ,p_entry_information14 => p_entry_information14
1035 ,p_entry_information15 => p_entry_information15
1036 ,p_entry_information16 => p_entry_information16
1037 ,p_entry_information17 => p_entry_information17
1038 ,p_entry_information18 => p_entry_information18
1039 ,p_entry_information19 => p_entry_information19
1040 ,p_entry_information20 => p_entry_information20
1041 ,p_entry_information21 => p_entry_information21
1042 ,p_entry_information22 => p_entry_information22
1043 ,p_entry_information23 => p_entry_information23
1044 ,p_entry_information24 => p_entry_information24
1045 ,p_entry_information25 => p_entry_information25
1046 ,p_entry_information26 => p_entry_information26
1050 ,p_entry_information30 => p_entry_information30
1047 ,p_entry_information27 => p_entry_information27
1048 ,p_entry_information28 => p_entry_information28
1049 ,p_entry_information29 => p_entry_information29
1051 ,p_date_earned => l_date_earned
1052 ,p_personal_payment_method_id => p_personal_payment_method_id
1053 ,p_subpriority => p_subpriority
1054 ,p_effective_start_date => l_effective_start_date
1055 ,p_effective_end_date => l_effective_end_date
1056 ,p_batch_line_id => l_batch_line_id
1057 ,p_object_version_number => l_object_version_number);
1058 --
1059 -- Call After Process User Hook
1060 --
1061 begin
1062 pay_batch_element_entry_bk2.create_batch_line_a
1063 (p_session_date => l_session_date
1064 ,p_batch_id => p_batch_id
1065 ,p_batch_line_status => p_batch_line_status
1066 ,p_assignment_id => p_assignment_id
1067 ,p_assignment_number => p_assignment_number
1068 ,p_attribute_category => p_attribute_category
1069 ,p_attribute1 => p_attribute1
1070 ,p_attribute2 => p_attribute2
1071 ,p_attribute3 => p_attribute3
1072 ,p_attribute4 => p_attribute4
1073 ,p_attribute5 => p_attribute5
1074 ,p_attribute6 => p_attribute6
1075 ,p_attribute7 => p_attribute7
1076 ,p_attribute8 => p_attribute8
1077 ,p_attribute9 => p_attribute9
1078 ,p_attribute10 => p_attribute10
1079 ,p_attribute11 => p_attribute11
1080 ,p_attribute12 => p_attribute12
1081 ,p_attribute13 => p_attribute13
1082 ,p_attribute14 => p_attribute14
1083 ,p_attribute15 => p_attribute15
1084 ,p_attribute16 => p_attribute16
1085 ,p_attribute17 => p_attribute17
1086 ,p_attribute18 => p_attribute18
1087 ,p_attribute19 => p_attribute19
1088 ,p_attribute20 => p_attribute20
1089 ,p_entry_information_category => p_entry_information_category
1090 ,p_entry_information1 => p_entry_information1
1091 ,p_entry_information2 => p_entry_information2
1092 ,p_entry_information3 => p_entry_information3
1093 ,p_entry_information4 => p_entry_information4
1094 ,p_entry_information5 => p_entry_information5
1095 ,p_entry_information6 => p_entry_information6
1096 ,p_entry_information7 => p_entry_information7
1097 ,p_entry_information8 => p_entry_information8
1098 ,p_entry_information9 => p_entry_information9
1099 ,p_entry_information10 => p_entry_information10
1100 ,p_entry_information11 => p_entry_information11
1101 ,p_entry_information12 => p_entry_information12
1102 ,p_entry_information13 => p_entry_information13
1103 ,p_entry_information14 => p_entry_information14
1104 ,p_entry_information15 => p_entry_information15
1105 ,p_entry_information16 => p_entry_information16
1106 ,p_entry_information17 => p_entry_information17
1107 ,p_entry_information18 => p_entry_information18
1108 ,p_entry_information19 => p_entry_information19
1109 ,p_entry_information20 => p_entry_information20
1110 ,p_entry_information21 => p_entry_information21
1111 ,p_entry_information22 => p_entry_information22
1112 ,p_entry_information23 => p_entry_information23
1113 ,p_entry_information24 => p_entry_information24
1114 ,p_entry_information25 => p_entry_information25
1115 ,p_entry_information26 => p_entry_information26
1116 ,p_entry_information27 => p_entry_information27
1117 ,p_entry_information28 => p_entry_information28
1118 ,p_entry_information29 => p_entry_information29
1119 ,p_entry_information30 => p_entry_information30
1120 ,p_date_earned => l_date_earned
1121 ,p_personal_payment_method_id => p_personal_payment_method_id
1122 ,p_subpriority => p_subpriority
1123 ,p_batch_sequence => p_batch_sequence
1124 ,p_concatenated_segments => p_concatenated_segments
1125 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
1126 ,p_effective_date => l_effective_date
1127 ,p_effective_start_date => l_effective_start_date
1128 ,p_effective_end_date => l_effective_end_date
1129 ,p_element_name => p_element_name
1130 ,p_element_type_id => p_element_type_id
1131 ,p_entry_type => p_entry_type
1132 ,p_reason => p_reason
1133 ,p_segment1 => p_segment1
1134 ,p_segment2 => p_segment2
1135 ,p_segment3 => p_segment3
1136 ,p_segment4 => p_segment4
1137 ,p_segment5 => p_segment5
1141 ,p_segment9 => p_segment9
1138 ,p_segment6 => p_segment6
1139 ,p_segment7 => p_segment7
1140 ,p_segment8 => p_segment8
1142 ,p_segment10 => p_segment10
1143 ,p_segment11 => p_segment11
1144 ,p_segment12 => p_segment12
1145 ,p_segment13 => p_segment13
1146 ,p_segment14 => p_segment14
1147 ,p_segment15 => p_segment15
1148 ,p_segment16 => p_segment16
1149 ,p_segment17 => p_segment17
1150 ,p_segment18 => p_segment18
1151 ,p_segment19 => p_segment19
1152 ,p_segment20 => p_segment20
1153 ,p_segment21 => p_segment21
1154 ,p_segment22 => p_segment22
1155 ,p_segment23 => p_segment23
1156 ,p_segment24 => p_segment24
1157 ,p_segment25 => p_segment25
1158 ,p_segment26 => p_segment26
1159 ,p_segment27 => p_segment27
1160 ,p_segment28 => p_segment28
1161 ,p_segment29 => p_segment29
1162 ,p_segment30 => p_segment30
1163 ,p_value_1 => l_value_1
1164 ,p_value_2 => l_value_2
1165 ,p_value_3 => l_value_3
1166 ,p_value_4 => l_value_4
1167 ,p_value_5 => l_value_5
1168 ,p_value_6 => l_value_6
1169 ,p_value_7 => l_value_7
1170 ,p_value_8 => l_value_8
1171 ,p_value_9 => l_value_9
1172 ,p_value_10 => l_value_10
1173 ,p_value_11 => l_value_11
1174 ,p_value_12 => l_value_12
1175 ,p_value_13 => l_value_13
1176 ,p_value_14 => l_value_14
1177 ,p_value_15 => l_value_15
1178 ,p_batch_line_id => l_batch_line_id
1179 ,p_object_version_number => l_object_version_number
1180 );
1181 exception
1182 when hr_api.cannot_find_prog_unit then
1183 hr_api.cannot_find_prog_unit_error
1184 (p_module_name => 'create_batch_line_a'
1185 ,p_hook_type => 'AP'
1186 );
1187 end;
1188 --
1189 -- When in validation only mode raise the Validate_Enabled exception
1190 --
1191 if p_validate then
1192 raise hr_api.validate_enabled;
1193 end if;
1194 --
1195 -- Set all output arguments
1196 --
1197 p_batch_line_id := l_batch_line_id;
1198 p_object_version_number := l_object_version_number;
1199 --
1200 hr_utility.set_location(' Leaving:'||l_proc, 70);
1201 exception
1202 when hr_api.validate_enabled then
1203 --
1204 -- As the Validate_Enabled exception has been raised
1205 -- we must rollback to the savepoint
1206 --
1207 rollback to create_batch_line;
1208 --
1209 -- Only set output warning arguments
1210 -- (Any key or derived arguments must be set to null
1211 -- when validation only mode is being used.)
1212 --
1213 p_batch_line_id := null;
1214 p_object_version_number := null;
1215 hr_utility.set_location(' Leaving:'||l_proc, 80);
1216 when others then
1217 --
1218 -- A validation or unexpected error has occured
1219 --
1220 rollback to create_batch_line;
1221 p_batch_line_id := null;
1222 p_object_version_number := null;
1223 hr_utility.set_location(' Leaving:'||l_proc, 90);
1224 raise;
1225 end create_batch_line;
1226 --
1227 --
1228 -- ----------------------------------------------------------------------------
1229 -- |------------------------< create_batch_total >--------------------------|
1230 -- ----------------------------------------------------------------------------
1231 --
1232 procedure create_batch_total
1233 (p_validate in boolean default false
1234 ,p_session_date in date
1235 ,p_batch_id in number
1236 ,p_control_status in varchar2 default 'U'
1237 ,p_control_total in varchar2 default null
1238 ,p_control_type in varchar2 default null
1239 ,p_batch_control_id out nocopy number
1240 ,p_object_version_number out nocopy number
1241 ) is
1242 --
1243 -- Declare cursors and local variables
1244 --
1245 l_proc varchar2(72) := g_package||'create_batch_total';
1246 l_batch_control_id pay_batch_control_totals.batch_control_id%TYPE;
1247 l_object_version_number pay_batch_control_totals.object_version_number%TYPE;
1248 l_session_date date;
1249 --
1250 begin
1251 hr_utility.set_location('Entering:'|| l_proc, 10);
1252 --
1253 -- Issue a savepoint
1254 --
1255 savepoint create_batch_total;
1256 --
1257 -- Truncate the time portion from all IN date parameters
1258 --
1259 l_session_date := trunc(p_session_date);
1263 begin
1260 --
1261 -- Call Before Process User Hook
1262 --
1264 pay_batch_element_entry_bk3.create_batch_total_b
1265 (p_session_date => l_session_date
1266 ,p_batch_id => p_batch_id
1267 ,p_control_status => p_control_status
1268 ,p_control_total => p_control_total
1269 ,p_control_type => p_control_type
1270 );
1271 exception
1272 when hr_api.cannot_find_prog_unit then
1273 hr_api.cannot_find_prog_unit_error
1274 (p_module_name => 'create_batch_total_b'
1275 ,p_hook_type => 'BP'
1276 );
1277 end;
1278 --
1279 -- Validation in addition to Row Handlers
1280 --
1281 --
1282 -- Process Logic
1283 --
1284 pay_bct_ins.ins
1285 (p_session_date => l_session_date
1286 ,p_batch_id => p_batch_id
1287 ,p_control_status => p_control_status
1288 ,p_control_total => p_control_total
1289 ,p_control_type => p_control_type
1290 ,p_batch_control_id => l_batch_control_id
1291 ,p_object_version_number => l_object_version_number);
1292 --
1293 -- Call After Process User Hook
1294 --
1295 begin
1296 pay_batch_element_entry_bk3.create_batch_total_a
1297 (p_session_date => l_session_date
1298 ,p_batch_id => p_batch_id
1299 ,p_control_status => p_control_status
1300 ,p_control_total => p_control_total
1301 ,p_control_type => p_control_type
1302 ,p_batch_control_id => l_batch_control_id
1303 ,p_object_version_number => l_object_version_number
1304 );
1305 exception
1306 when hr_api.cannot_find_prog_unit then
1307 hr_api.cannot_find_prog_unit_error
1308 (p_module_name => 'create_batch_total_a'
1309 ,p_hook_type => 'AP'
1310 );
1311 end;
1312 --
1313 -- When in validation only mode raise the Validate_Enabled exception
1314 --
1315 if p_validate then
1316 raise hr_api.validate_enabled;
1317 end if;
1318 --
1319 -- Set all output arguments
1320 --
1321 p_batch_control_id := l_batch_control_id;
1322 p_object_version_number := l_object_version_number;
1323 --
1324 hr_utility.set_location(' Leaving:'||l_proc, 70);
1325 exception
1326 when hr_api.validate_enabled then
1327 --
1328 -- As the Validate_Enabled exception has been raised
1329 -- we must rollback to the savepoint
1330 --
1331 rollback to create_batch_total;
1332 --
1333 -- Only set output warning arguments
1334 -- (Any key or derived arguments must be set to null
1335 -- when validation only mode is being used.)
1336 --
1337 p_batch_control_id := null;
1338 p_object_version_number := null;
1339 hr_utility.set_location(' Leaving:'||l_proc, 80);
1340 when others then
1341 --
1342 -- A validation or unexpected error has occured
1343 --
1344 rollback to create_batch_total;
1345 p_batch_control_id := null;
1346 p_object_version_number := null;
1347 hr_utility.set_location(' Leaving:'||l_proc, 90);
1348 raise;
1349 end create_batch_total;
1350 --
1351 --
1352 -- ----------------------------------------------------------------------------
1353 -- |------------------------< update_batch_header >-------------------------|
1354 -- ----------------------------------------------------------------------------
1355 --
1356 procedure update_batch_header
1357 (p_validate in boolean default false
1358 ,p_session_date in date
1359 ,p_batch_id in number
1360 ,p_object_version_number in out nocopy number
1361 ,p_action_if_exists in varchar2 default hr_api.g_varchar2
1362 ,p_batch_name in varchar2 default hr_api.g_varchar2
1363 ,p_batch_reference in varchar2 default hr_api.g_varchar2
1364 ,p_batch_source in varchar2 default hr_api.g_varchar2
1365 ,p_batch_status in varchar2 default hr_api.g_varchar2
1366 ,p_comments in varchar2 default hr_api.g_varchar2
1367 ,p_date_effective_changes in varchar2 default hr_api.g_varchar2
1368 ,p_purge_after_transfer in varchar2 default hr_api.g_varchar2
1369 ,p_reject_if_future_changes in varchar2 default hr_api.g_varchar2
1370 ,p_reject_if_results_exists in varchar2 default hr_api.g_varchar2
1371 ,p_purge_after_rollback in varchar2 default hr_api.g_varchar2
1372 ,p_batch_type in varchar2 default hr_api.g_varchar2
1373 ,p_REJECT_ENTRY_NOT_REMOVED in varchar2 default hr_api.g_varchar2
1374 ,p_ROLLBACK_ENTRY_UPDATES in varchar2 default hr_api.g_varchar2
1375 ) is
1376 --
1377 -- Declare cursors and local variables
1378 --
1379 l_proc varchar2(72) := g_package||'update_batch_header';
1380 l_object_version_number pay_batch_headers.object_version_number%TYPE;
1381 l_session_date date;
1382 --
1383 begin
1384 hr_utility.set_location('Entering:'|| l_proc, 10);
1385 --
1386 -- Issue a savepoint
1387 --
1388 savepoint update_batch_header;
1389 --
1393 --
1390 -- Store initial values for IN OUT parameters
1391 --
1392 l_object_version_number := p_object_version_number;
1394 -- Truncate the time portion from all IN date parameters
1395 --
1396 l_session_date := trunc(p_session_date);
1397 --
1398 -- Call Before Process User Hook
1399 --
1400 begin
1401 pay_batch_element_entry_bk4.update_batch_header_b
1402 (p_session_date => l_session_date
1403 ,p_batch_id => p_batch_id
1404 ,p_object_version_number => l_object_version_number
1405 ,p_action_if_exists => p_action_if_exists
1406 ,p_batch_name => p_batch_name
1407 ,p_batch_reference => p_batch_reference
1408 ,p_batch_source => p_batch_source
1409 ,p_batch_status => p_batch_status
1410 ,p_comments => p_comments
1411 ,p_date_effective_changes => p_date_effective_changes
1412 ,p_purge_after_transfer => p_purge_after_transfer
1413 ,p_reject_if_future_changes => p_reject_if_future_changes
1414 ,p_reject_if_results_exists => p_reject_if_results_exists
1415 ,p_purge_after_rollback => p_purge_after_rollback
1416 ,p_batch_type => p_batch_type
1417 ,p_REJECT_ENTRY_NOT_REMOVED => p_REJECT_ENTRY_NOT_REMOVED
1418 ,p_ROLLBACK_ENTRY_UPDATES => p_ROLLBACK_ENTRY_UPDATES
1419 );
1420 exception
1421 when hr_api.cannot_find_prog_unit then
1422 hr_api.cannot_find_prog_unit_error
1423 (p_module_name => 'update_batch_header_b'
1424 ,p_hook_type => 'BP'
1425 );
1426 end;
1427 --
1428 -- Validation in addition to Row Handlers
1429 --
1430 --
1431 -- Process Logic
1432 --
1433 pay_bth_upd.upd
1434 (p_session_date => l_session_date
1435 ,p_batch_id => p_batch_id
1436 ,p_object_version_number => l_object_version_number
1437 ,p_batch_name => p_batch_name
1438 ,p_batch_status => p_batch_status
1439 ,p_action_if_exists => p_action_if_exists
1440 ,p_batch_reference => p_batch_reference
1441 ,p_batch_source => p_batch_source
1442 ,p_batch_type => p_batch_type
1443 ,p_comments => p_comments
1444 ,p_date_effective_changes => p_date_effective_changes
1445 ,p_purge_after_transfer => p_purge_after_transfer
1446 ,p_reject_if_future_changes => p_reject_if_future_changes
1447 ,p_reject_if_results_exists => p_reject_if_results_exists
1448 ,p_purge_after_rollback => p_purge_after_rollback
1449 ,p_REJECT_ENTRY_NOT_REMOVED => p_REJECT_ENTRY_NOT_REMOVED
1450 ,p_ROLLBACK_ENTRY_UPDATES => p_ROLLBACK_ENTRY_UPDATES);
1451 --
1452 -- Call After Process User Hook
1453 --
1454 begin
1455 pay_batch_element_entry_bk4.update_batch_header_a
1456 (p_session_date => l_session_date
1457 ,p_batch_id => p_batch_id
1458 ,p_object_version_number => l_object_version_number
1459 ,p_action_if_exists => p_action_if_exists
1460 ,p_batch_name => p_batch_name
1461 ,p_batch_reference => p_batch_reference
1462 ,p_batch_source => p_batch_source
1463 ,p_batch_status => p_batch_status
1464 ,p_comments => p_comments
1465 ,p_date_effective_changes => p_date_effective_changes
1466 ,p_purge_after_transfer => p_purge_after_transfer
1467 ,p_reject_if_future_changes => p_reject_if_future_changes
1468 ,p_reject_if_results_exists => p_reject_if_results_exists
1469 ,p_purge_after_rollback => p_purge_after_rollback
1470 ,p_batch_type => p_batch_type
1471 ,p_REJECT_ENTRY_NOT_REMOVED => p_REJECT_ENTRY_NOT_REMOVED
1472 ,p_ROLLBACK_ENTRY_UPDATES => p_ROLLBACK_ENTRY_UPDATES
1473 );
1474 exception
1475 when hr_api.cannot_find_prog_unit then
1476 hr_api.cannot_find_prog_unit_error
1477 (p_module_name => 'update_batch_header_a'
1478 ,p_hook_type => 'AP'
1479 );
1480 end;
1481 --
1482 -- When in validation only mode raise the Validate_Enabled exception
1483 --
1484 if p_validate then
1485 raise hr_api.validate_enabled;
1486 end if;
1487 --
1488 -- Set all output arguments
1489 --
1490 p_object_version_number := l_object_version_number;
1491 --
1492 hr_utility.set_location(' Leaving:'||l_proc, 70);
1493 exception
1494 when hr_api.validate_enabled then
1495 --
1496 -- As the Validate_Enabled exception has been raised
1497 -- we must rollback to the savepoint
1498 --
1499 rollback to update_batch_header;
1500 --
1501 -- Only set output warning arguments
1502 -- (Any key or derived arguments must be set to null
1503 -- when validation only mode is being used.)
1504 --
1505 hr_utility.set_location(' Leaving:'||l_proc, 80);
1506 when others then
1507 --
1508 -- A validation or unexpected error has occured
1509 --
1510 rollback to update_batch_header;
1511 p_object_version_number := l_object_version_number;
1512 hr_utility.set_location(' Leaving:'||l_proc, 90);
1513 raise;
1514 end update_batch_header;
1515 --
1516 --
1520 --
1517 -- ----------------------------------------------------------------------------
1518 -- |-------------------------< update_batch_line >--------------------------|
1519 -- ----------------------------------------------------------------------------
1521 procedure update_batch_line
1522 (p_validate in boolean default false
1523 ,p_session_date in date
1524 ,p_batch_line_id in number
1525 ,p_batch_line_status in varchar2 default hr_api.g_varchar2
1526 ,p_object_version_number in out nocopy number
1527 ,p_assignment_id in number default hr_api.g_number
1528 ,p_assignment_number in varchar2 default hr_api.g_varchar2
1529 ,p_attribute_category in varchar2 default hr_api.g_varchar2
1530 ,p_attribute1 in varchar2 default hr_api.g_varchar2
1531 ,p_attribute2 in varchar2 default hr_api.g_varchar2
1532 ,p_attribute3 in varchar2 default hr_api.g_varchar2
1533 ,p_attribute4 in varchar2 default hr_api.g_varchar2
1534 ,p_attribute5 in varchar2 default hr_api.g_varchar2
1535 ,p_attribute6 in varchar2 default hr_api.g_varchar2
1536 ,p_attribute7 in varchar2 default hr_api.g_varchar2
1537 ,p_attribute8 in varchar2 default hr_api.g_varchar2
1538 ,p_attribute9 in varchar2 default hr_api.g_varchar2
1539 ,p_attribute10 in varchar2 default hr_api.g_varchar2
1540 ,p_attribute11 in varchar2 default hr_api.g_varchar2
1541 ,p_attribute12 in varchar2 default hr_api.g_varchar2
1542 ,p_attribute13 in varchar2 default hr_api.g_varchar2
1543 ,p_attribute14 in varchar2 default hr_api.g_varchar2
1544 ,p_attribute15 in varchar2 default hr_api.g_varchar2
1545 ,p_attribute16 in varchar2 default hr_api.g_varchar2
1546 ,p_attribute17 in varchar2 default hr_api.g_varchar2
1547 ,p_attribute18 in varchar2 default hr_api.g_varchar2
1548 ,p_attribute19 in varchar2 default hr_api.g_varchar2
1549 ,p_attribute20 in varchar2 default hr_api.g_varchar2
1550 ,p_entry_information_category in varchar2 default hr_api.g_varchar2
1551 ,p_entry_information1 in varchar2 default hr_api.g_varchar2
1552 ,p_entry_information2 in varchar2 default hr_api.g_varchar2
1553 ,p_entry_information3 in varchar2 default hr_api.g_varchar2
1554 ,p_entry_information4 in varchar2 default hr_api.g_varchar2
1555 ,p_entry_information5 in varchar2 default hr_api.g_varchar2
1556 ,p_entry_information6 in varchar2 default hr_api.g_varchar2
1557 ,p_entry_information7 in varchar2 default hr_api.g_varchar2
1558 ,p_entry_information8 in varchar2 default hr_api.g_varchar2
1559 ,p_entry_information9 in varchar2 default hr_api.g_varchar2
1560 ,p_entry_information10 in varchar2 default hr_api.g_varchar2
1561 ,p_entry_information11 in varchar2 default hr_api.g_varchar2
1562 ,p_entry_information12 in varchar2 default hr_api.g_varchar2
1563 ,p_entry_information13 in varchar2 default hr_api.g_varchar2
1564 ,p_entry_information14 in varchar2 default hr_api.g_varchar2
1565 ,p_entry_information15 in varchar2 default hr_api.g_varchar2
1566 ,p_entry_information16 in varchar2 default hr_api.g_varchar2
1567 ,p_entry_information17 in varchar2 default hr_api.g_varchar2
1568 ,p_entry_information18 in varchar2 default hr_api.g_varchar2
1569 ,p_entry_information19 in varchar2 default hr_api.g_varchar2
1570 ,p_entry_information20 in varchar2 default hr_api.g_varchar2
1571 ,p_entry_information21 in varchar2 default hr_api.g_varchar2
1572 ,p_entry_information22 in varchar2 default hr_api.g_varchar2
1573 ,p_entry_information23 in varchar2 default hr_api.g_varchar2
1574 ,p_entry_information24 in varchar2 default hr_api.g_varchar2
1575 ,p_entry_information25 in varchar2 default hr_api.g_varchar2
1576 ,p_entry_information26 in varchar2 default hr_api.g_varchar2
1577 ,p_entry_information27 in varchar2 default hr_api.g_varchar2
1578 ,p_entry_information28 in varchar2 default hr_api.g_varchar2
1579 ,p_entry_information29 in varchar2 default hr_api.g_varchar2
1580 ,p_entry_information30 in varchar2 default hr_api.g_varchar2
1581 ,p_date_earned in date default hr_api.g_date
1582 ,p_personal_payment_method_id in number default hr_api.g_number
1583 ,p_subpriority in number default hr_api.g_number
1584 ,p_batch_sequence in number default hr_api.g_number
1585 ,p_concatenated_segments in varchar2 default hr_api.g_varchar2
1586 ,p_cost_allocation_keyflex_id in number default hr_api.g_number
1587 ,p_effective_date in date default hr_api.g_date
1588 ,p_effective_start_date in date default hr_api.g_date
1589 ,p_effective_end_date in date default hr_api.g_date
1590 ,p_element_name in varchar2 default hr_api.g_varchar2
1591 ,p_element_type_id in number default hr_api.g_number
1592 ,p_entry_type in varchar2 default hr_api.g_varchar2
1596 ,p_segment3 in varchar2 default hr_api.g_varchar2
1593 ,p_reason in varchar2 default hr_api.g_varchar2
1594 ,p_segment1 in varchar2 default hr_api.g_varchar2
1595 ,p_segment2 in varchar2 default hr_api.g_varchar2
1597 ,p_segment4 in varchar2 default hr_api.g_varchar2
1598 ,p_segment5 in varchar2 default hr_api.g_varchar2
1599 ,p_segment6 in varchar2 default hr_api.g_varchar2
1600 ,p_segment7 in varchar2 default hr_api.g_varchar2
1601 ,p_segment8 in varchar2 default hr_api.g_varchar2
1602 ,p_segment9 in varchar2 default hr_api.g_varchar2
1603 ,p_segment10 in varchar2 default hr_api.g_varchar2
1604 ,p_segment11 in varchar2 default hr_api.g_varchar2
1605 ,p_segment12 in varchar2 default hr_api.g_varchar2
1606 ,p_segment13 in varchar2 default hr_api.g_varchar2
1607 ,p_segment14 in varchar2 default hr_api.g_varchar2
1608 ,p_segment15 in varchar2 default hr_api.g_varchar2
1609 ,p_segment16 in varchar2 default hr_api.g_varchar2
1610 ,p_segment17 in varchar2 default hr_api.g_varchar2
1611 ,p_segment18 in varchar2 default hr_api.g_varchar2
1612 ,p_segment19 in varchar2 default hr_api.g_varchar2
1613 ,p_segment20 in varchar2 default hr_api.g_varchar2
1614 ,p_segment21 in varchar2 default hr_api.g_varchar2
1615 ,p_segment22 in varchar2 default hr_api.g_varchar2
1616 ,p_segment23 in varchar2 default hr_api.g_varchar2
1617 ,p_segment24 in varchar2 default hr_api.g_varchar2
1618 ,p_segment25 in varchar2 default hr_api.g_varchar2
1619 ,p_segment26 in varchar2 default hr_api.g_varchar2
1620 ,p_segment27 in varchar2 default hr_api.g_varchar2
1621 ,p_segment28 in varchar2 default hr_api.g_varchar2
1622 ,p_segment29 in varchar2 default hr_api.g_varchar2
1623 ,p_segment30 in varchar2 default hr_api.g_varchar2
1624 ,p_value_1 in varchar2 default hr_api.g_varchar2
1625 ,p_value_2 in varchar2 default hr_api.g_varchar2
1626 ,p_value_3 in varchar2 default hr_api.g_varchar2
1627 ,p_value_4 in varchar2 default hr_api.g_varchar2
1628 ,p_value_5 in varchar2 default hr_api.g_varchar2
1629 ,p_value_6 in varchar2 default hr_api.g_varchar2
1630 ,p_value_7 in varchar2 default hr_api.g_varchar2
1631 ,p_value_8 in varchar2 default hr_api.g_varchar2
1632 ,p_value_9 in varchar2 default hr_api.g_varchar2
1633 ,p_value_10 in varchar2 default hr_api.g_varchar2
1634 ,p_value_11 in varchar2 default hr_api.g_varchar2
1635 ,p_value_12 in varchar2 default hr_api.g_varchar2
1636 ,p_value_13 in varchar2 default hr_api.g_varchar2
1637 ,p_value_14 in varchar2 default hr_api.g_varchar2
1638 ,p_value_15 in varchar2 default hr_api.g_varchar2
1639 ,p_canonical_date_format in varchar2 default 'Y'
1640 ,p_iv_all_internal_format in varchar2 default 'N'
1641 ) is
1642 --
1643 -- Declare cursors and local variables
1644 --
1645 l_proc varchar2(72) := g_package||'update_batch_line';
1646 l_object_version_number pay_batch_lines.object_version_number%TYPE;
1647 l_session_date date;
1648 l_effective_date date;
1649 l_effective_start_date date;
1650 l_effective_end_date date;
1651 l_date_earned date;
1652 --
1653 l_value_1 pay_batch_lines.value_1%TYPE := p_value_1;
1654 l_value_2 pay_batch_lines.value_2%TYPE := p_value_2;
1655 l_value_3 pay_batch_lines.value_3%TYPE := p_value_3;
1656 l_value_4 pay_batch_lines.value_4%TYPE := p_value_4;
1657 l_value_5 pay_batch_lines.value_5%TYPE := p_value_5;
1658 l_value_6 pay_batch_lines.value_6%TYPE := p_value_6;
1659 l_value_7 pay_batch_lines.value_7%TYPE := p_value_7;
1660 l_value_8 pay_batch_lines.value_8%TYPE := p_value_8;
1661 l_value_9 pay_batch_lines.value_9%TYPE := p_value_9;
1662 l_value_10 pay_batch_lines.value_10%TYPE := p_value_10;
1663 l_value_11 pay_batch_lines.value_11%TYPE := p_value_11;
1664 l_value_12 pay_batch_lines.value_12%TYPE := p_value_12;
1665 l_value_13 pay_batch_lines.value_13%TYPE := p_value_13;
1666 l_value_14 pay_batch_lines.value_14%TYPE := p_value_14;
1667 l_value_15 pay_batch_lines.value_15%TYPE := p_value_15;
1668 --
1669 l_bee_iv_upgrade varchar2(1);
1670 --
1671 begin
1672 hr_utility.set_location('Entering:'|| l_proc, 10);
1673 --
1674 -- Issue a savepoint
1675 --
1676 savepoint update_batch_line;
1677 --
1678 -- Store initial values for IN OUT parameters
1679 --
1680 l_object_version_number := p_object_version_number;
1681 --
1682 -- Truncate the time portion from all IN date parameters
1683 --
1684 l_session_date := trunc(p_session_date);
1688 l_date_earned := trunc(p_date_earned);
1685 l_effective_date := trunc(p_effective_date);
1686 l_effective_start_date := trunc(p_effective_start_date);
1687 l_effective_end_date := trunc(p_effective_end_date);
1689 --
1690 l_bee_iv_upgrade := get_upgrade_status(null,p_batch_line_id,'BEE_IV_UPG');
1691 --
1692 -- Check whether the upgrade process is in progress.
1693 --
1694 if l_bee_iv_upgrade = 'E' then
1695 hr_utility.set_message(800, 'HR_449106_BEE_UPGRADING');
1696 hr_utility.raise_error;
1697 end if;
1698 --
1699 if p_iv_all_internal_format = 'Y' and l_bee_iv_upgrade = 'N' then
1700 fnd_message.set_name('PAY', 'HR_7462_PLK_INVLD_VALUE');
1701 fnd_message.set_token('COLUMN_NAME','P_IV_ALL_INTERNAL_FORMAT');
1702 fnd_message.raise_error;
1703 end if;
1704 --
1705 if p_iv_all_internal_format = 'Y' and p_canonical_date_format = 'N' then
1706 fnd_message.set_name('PAY', 'HR_7462_PLK_INVLD_VALUE');
1707 fnd_message.set_token('COLUMN_NAME','P_CANONICAL_DATE_FORMAT');
1708 fnd_message.raise_error;
1709 end if;
1710 --
1711 --
1712 if p_iv_all_internal_format <> 'Y' then
1713 convert_date_to_canonical
1714 (p_iv1 => l_value_1
1715 ,p_iv2 => l_value_2
1716 ,p_iv3 => l_value_3
1717 ,p_iv4 => l_value_4
1718 ,p_iv5 => l_value_5
1719 ,p_iv6 => l_value_6
1720 ,p_iv7 => l_value_7
1721 ,p_iv8 => l_value_8
1722 ,p_iv9 => l_value_9
1723 ,p_iv10 => l_value_10
1724 ,p_iv11 => l_value_11
1725 ,p_iv12 => l_value_12
1726 ,p_iv13 => l_value_13
1727 ,p_iv14 => l_value_14
1728 ,p_iv15 => l_value_15
1729 ,p_element_type_id => p_element_type_id
1730 ,p_element_name => p_element_name
1731 ,p_effective_date => p_effective_date
1732 ,p_batch_line_id => p_batch_line_id
1733 ,p_date_cfmt => p_canonical_date_format
1734 ,p_int_fmt => l_bee_iv_upgrade
1735 );
1736 end if;
1737 --
1738 -- Call Before Process User Hook
1739 --
1740 begin
1741 pay_batch_element_entry_bk5.update_batch_line_b
1742 (p_session_date => l_session_date
1743 ,p_batch_line_id => p_batch_line_id
1744 ,p_batch_line_status => p_batch_line_status
1745 ,p_object_version_number => l_object_version_number
1746 ,p_assignment_id => p_assignment_id
1747 ,p_assignment_number => p_assignment_number
1748 ,p_attribute_category => p_attribute_category
1749 ,p_attribute1 => p_attribute1
1750 ,p_attribute2 => p_attribute2
1751 ,p_attribute3 => p_attribute3
1752 ,p_attribute4 => p_attribute4
1753 ,p_attribute5 => p_attribute5
1754 ,p_attribute6 => p_attribute6
1755 ,p_attribute7 => p_attribute7
1756 ,p_attribute8 => p_attribute8
1757 ,p_attribute9 => p_attribute9
1758 ,p_attribute10 => p_attribute10
1759 ,p_attribute11 => p_attribute11
1760 ,p_attribute12 => p_attribute12
1761 ,p_attribute13 => p_attribute13
1762 ,p_attribute14 => p_attribute14
1763 ,p_attribute15 => p_attribute15
1764 ,p_attribute16 => p_attribute16
1765 ,p_attribute17 => p_attribute17
1766 ,p_attribute18 => p_attribute18
1767 ,p_attribute19 => p_attribute19
1768 ,p_attribute20 => p_attribute20
1769 ,p_entry_information_category => p_entry_information_category
1770 ,p_entry_information1 => p_entry_information1
1771 ,p_entry_information2 => p_entry_information2
1772 ,p_entry_information3 => p_entry_information3
1773 ,p_entry_information4 => p_entry_information4
1774 ,p_entry_information5 => p_entry_information5
1775 ,p_entry_information6 => p_entry_information6
1776 ,p_entry_information7 => p_entry_information7
1777 ,p_entry_information8 => p_entry_information8
1778 ,p_entry_information9 => p_entry_information9
1779 ,p_entry_information10 => p_entry_information10
1780 ,p_entry_information11 => p_entry_information11
1781 ,p_entry_information12 => p_entry_information12
1782 ,p_entry_information13 => p_entry_information13
1783 ,p_entry_information14 => p_entry_information14
1784 ,p_entry_information15 => p_entry_information15
1785 ,p_entry_information16 => p_entry_information16
1786 ,p_entry_information17 => p_entry_information17
1787 ,p_entry_information18 => p_entry_information18
1788 ,p_entry_information19 => p_entry_information19
1789 ,p_entry_information20 => p_entry_information20
1790 ,p_entry_information21 => p_entry_information21
1791 ,p_entry_information22 => p_entry_information22
1792 ,p_entry_information23 => p_entry_information23
1796 ,p_entry_information27 => p_entry_information27
1793 ,p_entry_information24 => p_entry_information24
1794 ,p_entry_information25 => p_entry_information25
1795 ,p_entry_information26 => p_entry_information26
1797 ,p_entry_information28 => p_entry_information28
1798 ,p_entry_information29 => p_entry_information29
1799 ,p_entry_information30 => p_entry_information30
1800 ,p_date_earned => l_date_earned
1801 ,p_personal_payment_method_id => p_personal_payment_method_id
1802 ,p_subpriority => p_subpriority
1803 ,p_batch_sequence => p_batch_sequence
1804 ,p_concatenated_segments => p_concatenated_segments
1805 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
1806 ,p_effective_date => l_effective_date
1807 ,p_effective_start_date => l_effective_start_date
1808 ,p_effective_end_date => l_effective_end_date
1809 ,p_element_name => p_element_name
1810 ,p_element_type_id => p_element_type_id
1811 ,p_entry_type => p_entry_type
1812 ,p_reason => p_reason
1813 ,p_segment1 => p_segment1
1814 ,p_segment2 => p_segment2
1815 ,p_segment3 => p_segment3
1816 ,p_segment4 => p_segment4
1817 ,p_segment5 => p_segment5
1818 ,p_segment6 => p_segment6
1819 ,p_segment7 => p_segment7
1820 ,p_segment8 => p_segment8
1821 ,p_segment9 => p_segment9
1822 ,p_segment10 => p_segment10
1823 ,p_segment11 => p_segment11
1824 ,p_segment12 => p_segment12
1825 ,p_segment13 => p_segment13
1826 ,p_segment14 => p_segment14
1827 ,p_segment15 => p_segment15
1828 ,p_segment16 => p_segment16
1829 ,p_segment17 => p_segment17
1830 ,p_segment18 => p_segment18
1831 ,p_segment19 => p_segment19
1832 ,p_segment20 => p_segment20
1833 ,p_segment21 => p_segment21
1834 ,p_segment22 => p_segment22
1835 ,p_segment23 => p_segment23
1836 ,p_segment24 => p_segment24
1837 ,p_segment25 => p_segment25
1838 ,p_segment26 => p_segment26
1839 ,p_segment27 => p_segment27
1840 ,p_segment28 => p_segment28
1841 ,p_segment29 => p_segment29
1842 ,p_segment30 => p_segment30
1843 ,p_value_1 => l_value_1
1844 ,p_value_2 => l_value_2
1845 ,p_value_3 => l_value_3
1846 ,p_value_4 => l_value_4
1847 ,p_value_5 => l_value_5
1848 ,p_value_6 => l_value_6
1849 ,p_value_7 => l_value_7
1850 ,p_value_8 => l_value_8
1851 ,p_value_9 => l_value_9
1852 ,p_value_10 => l_value_10
1853 ,p_value_11 => l_value_11
1854 ,p_value_12 => l_value_12
1855 ,p_value_13 => l_value_13
1856 ,p_value_14 => l_value_14
1857 ,p_value_15 => l_value_15
1858 );
1859 exception
1860 when hr_api.cannot_find_prog_unit then
1861 hr_api.cannot_find_prog_unit_error
1862 (p_module_name => 'update_batch_line_b'
1863 ,p_hook_type => 'BP'
1864 );
1865 end;
1866 --
1867 hr_utility.set_location(l_proc, 11);
1868 --
1869 -- Validation in addition to Row Handlers
1870 --
1871 --
1872 -- Process Logic
1873 --
1874 pay_btl_upd.upd
1875 (p_session_date => l_session_date
1876 ,p_batch_line_id => p_batch_line_id
1877 ,p_object_version_number => l_object_version_number
1878 ,p_batch_line_status => p_batch_line_status
1879 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
1880 ,p_element_type_id => p_element_type_id
1881 ,p_assignment_id => p_assignment_id
1882 ,p_assignment_number => p_assignment_number
1883 ,p_batch_sequence => p_batch_sequence
1884 ,p_concatenated_segments => p_concatenated_segments
1885 ,p_effective_date => l_effective_date
1886 ,p_element_name => p_element_name
1887 ,p_entry_type => p_entry_type
1888 ,p_reason => p_reason
1889 ,p_segment1 => p_segment1
1890 ,p_segment2 => p_segment2
1891 ,p_segment3 => p_segment3
1892 ,p_segment4 => p_segment4
1893 ,p_segment5 => p_segment5
1894 ,p_segment6 => p_segment6
1895 ,p_segment7 => p_segment7
1896 ,p_segment8 => p_segment8
1897 ,p_segment9 => p_segment9
1901 ,p_segment13 => p_segment13
1898 ,p_segment10 => p_segment10
1899 ,p_segment11 => p_segment11
1900 ,p_segment12 => p_segment12
1902 ,p_segment14 => p_segment14
1903 ,p_segment15 => p_segment15
1904 ,p_segment16 => p_segment16
1905 ,p_segment17 => p_segment17
1906 ,p_segment18 => p_segment18
1907 ,p_segment19 => p_segment19
1908 ,p_segment20 => p_segment20
1909 ,p_segment21 => p_segment21
1910 ,p_segment22 => p_segment22
1911 ,p_segment23 => p_segment23
1912 ,p_segment24 => p_segment24
1913 ,p_segment25 => p_segment25
1914 ,p_segment26 => p_segment26
1915 ,p_segment27 => p_segment27
1916 ,p_segment28 => p_segment28
1917 ,p_segment29 => p_segment29
1918 ,p_segment30 => p_segment30
1919 ,p_value_1 => l_value_1
1920 ,p_value_2 => l_value_2
1921 ,p_value_3 => l_value_3
1922 ,p_value_4 => l_value_4
1923 ,p_value_5 => l_value_5
1924 ,p_value_6 => l_value_6
1925 ,p_value_7 => l_value_7
1926 ,p_value_8 => l_value_8
1927 ,p_value_9 => l_value_9
1928 ,p_value_10 => l_value_10
1929 ,p_value_11 => l_value_11
1930 ,p_value_12 => l_value_12
1931 ,p_value_13 => l_value_13
1932 ,p_value_14 => l_value_14
1933 ,p_value_15 => l_value_15
1934 ,p_attribute_category => p_attribute_category
1935 ,p_attribute1 => p_attribute1
1936 ,p_attribute2 => p_attribute2
1937 ,p_attribute3 => p_attribute3
1938 ,p_attribute4 => p_attribute4
1939 ,p_attribute5 => p_attribute5
1940 ,p_attribute6 => p_attribute6
1941 ,p_attribute7 => p_attribute7
1942 ,p_attribute8 => p_attribute8
1943 ,p_attribute9 => p_attribute9
1944 ,p_attribute10 => p_attribute10
1945 ,p_attribute11 => p_attribute11
1946 ,p_attribute12 => p_attribute12
1947 ,p_attribute13 => p_attribute13
1948 ,p_attribute14 => p_attribute14
1949 ,p_attribute15 => p_attribute15
1950 ,p_attribute16 => p_attribute16
1951 ,p_attribute17 => p_attribute17
1952 ,p_attribute18 => p_attribute18
1953 ,p_attribute19 => p_attribute19
1954 ,p_attribute20 => p_attribute20
1955 ,p_entry_information_category => p_entry_information_category
1956 ,p_entry_information1 => p_entry_information1
1957 ,p_entry_information2 => p_entry_information2
1958 ,p_entry_information3 => p_entry_information3
1959 ,p_entry_information4 => p_entry_information4
1960 ,p_entry_information5 => p_entry_information5
1961 ,p_entry_information6 => p_entry_information6
1962 ,p_entry_information7 => p_entry_information7
1963 ,p_entry_information8 => p_entry_information8
1964 ,p_entry_information9 => p_entry_information9
1965 ,p_entry_information10 => p_entry_information10
1966 ,p_entry_information11 => p_entry_information11
1967 ,p_entry_information12 => p_entry_information12
1968 ,p_entry_information13 => p_entry_information13
1969 ,p_entry_information14 => p_entry_information14
1970 ,p_entry_information15 => p_entry_information15
1971 ,p_entry_information16 => p_entry_information16
1972 ,p_entry_information17 => p_entry_information17
1973 ,p_entry_information18 => p_entry_information18
1974 ,p_entry_information19 => p_entry_information19
1975 ,p_entry_information20 => p_entry_information20
1976 ,p_entry_information21 => p_entry_information21
1977 ,p_entry_information22 => p_entry_information22
1978 ,p_entry_information23 => p_entry_information23
1979 ,p_entry_information24 => p_entry_information24
1980 ,p_entry_information25 => p_entry_information25
1981 ,p_entry_information26 => p_entry_information26
1982 ,p_entry_information27 => p_entry_information27
1983 ,p_entry_information28 => p_entry_information28
1984 ,p_entry_information29 => p_entry_information29
1985 ,p_entry_information30 => p_entry_information30
1986 ,p_date_earned => l_date_earned
1987 ,p_personal_payment_method_id => p_personal_payment_method_id
1988 ,p_subpriority => p_subpriority
1989 ,p_effective_start_date => l_effective_start_date
1990 ,p_effective_end_date => l_effective_end_date);
1991 --
1992 hr_utility.set_location(l_proc, 12);
1993 --
1994 --
1995 -- Call After Process User Hook
1996 --
1997 begin
2001 ,p_batch_line_status => p_batch_line_status
1998 pay_batch_element_entry_bk5.update_batch_line_a
1999 (p_session_date => l_session_date
2000 ,p_batch_line_id => p_batch_line_id
2002 ,p_object_version_number => l_object_version_number
2003 ,p_assignment_id => p_assignment_id
2004 ,p_assignment_number => p_assignment_number
2005 ,p_attribute_category => p_attribute_category
2006 ,p_attribute1 => p_attribute1
2007 ,p_attribute2 => p_attribute2
2008 ,p_attribute3 => p_attribute3
2009 ,p_attribute4 => p_attribute4
2010 ,p_attribute5 => p_attribute5
2011 ,p_attribute6 => p_attribute6
2012 ,p_attribute7 => p_attribute7
2013 ,p_attribute8 => p_attribute8
2014 ,p_attribute9 => p_attribute9
2015 ,p_attribute10 => p_attribute10
2016 ,p_attribute11 => p_attribute11
2017 ,p_attribute12 => p_attribute12
2018 ,p_attribute13 => p_attribute13
2019 ,p_attribute14 => p_attribute14
2020 ,p_attribute15 => p_attribute15
2021 ,p_attribute16 => p_attribute16
2022 ,p_attribute17 => p_attribute17
2023 ,p_attribute18 => p_attribute18
2024 ,p_attribute19 => p_attribute19
2025 ,p_attribute20 => p_attribute20
2026 ,p_entry_information_category => p_entry_information_category
2027 ,p_entry_information1 => p_entry_information1
2028 ,p_entry_information2 => p_entry_information2
2029 ,p_entry_information3 => p_entry_information3
2030 ,p_entry_information4 => p_entry_information4
2031 ,p_entry_information5 => p_entry_information5
2032 ,p_entry_information6 => p_entry_information6
2033 ,p_entry_information7 => p_entry_information7
2034 ,p_entry_information8 => p_entry_information8
2035 ,p_entry_information9 => p_entry_information9
2036 ,p_entry_information10 => p_entry_information10
2037 ,p_entry_information11 => p_entry_information11
2038 ,p_entry_information12 => p_entry_information12
2039 ,p_entry_information13 => p_entry_information13
2040 ,p_entry_information14 => p_entry_information14
2041 ,p_entry_information15 => p_entry_information15
2042 ,p_entry_information16 => p_entry_information16
2043 ,p_entry_information17 => p_entry_information17
2044 ,p_entry_information18 => p_entry_information18
2045 ,p_entry_information19 => p_entry_information19
2046 ,p_entry_information20 => p_entry_information20
2047 ,p_entry_information21 => p_entry_information21
2048 ,p_entry_information22 => p_entry_information22
2049 ,p_entry_information23 => p_entry_information23
2050 ,p_entry_information24 => p_entry_information24
2051 ,p_entry_information25 => p_entry_information25
2052 ,p_entry_information26 => p_entry_information26
2053 ,p_entry_information27 => p_entry_information27
2054 ,p_entry_information28 => p_entry_information28
2055 ,p_entry_information29 => p_entry_information29
2056 ,p_entry_information30 => p_entry_information30
2057 ,p_date_earned => l_date_earned
2058 ,p_personal_payment_method_id => p_personal_payment_method_id
2059 ,p_subpriority => p_subpriority
2060 ,p_batch_sequence => p_batch_sequence
2061 ,p_concatenated_segments => p_concatenated_segments
2062 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
2063 ,p_effective_date => l_effective_date
2064 ,p_effective_start_date => l_effective_start_date
2065 ,p_effective_end_date => l_effective_end_date
2066 ,p_element_name => p_element_name
2067 ,p_element_type_id => p_element_type_id
2068 ,p_entry_type => p_entry_type
2069 ,p_reason => p_reason
2070 ,p_segment1 => p_segment1
2071 ,p_segment2 => p_segment2
2072 ,p_segment3 => p_segment3
2073 ,p_segment4 => p_segment4
2074 ,p_segment5 => p_segment5
2075 ,p_segment6 => p_segment6
2076 ,p_segment7 => p_segment7
2077 ,p_segment8 => p_segment8
2078 ,p_segment9 => p_segment9
2079 ,p_segment10 => p_segment10
2080 ,p_segment11 => p_segment11
2081 ,p_segment12 => p_segment12
2082 ,p_segment13 => p_segment13
2083 ,p_segment14 => p_segment14
2084 ,p_segment15 => p_segment15
2085 ,p_segment16 => p_segment16
2086 ,p_segment17 => p_segment17
2087 ,p_segment18 => p_segment18
2091 ,p_segment22 => p_segment22
2088 ,p_segment19 => p_segment19
2089 ,p_segment20 => p_segment20
2090 ,p_segment21 => p_segment21
2092 ,p_segment23 => p_segment23
2093 ,p_segment24 => p_segment24
2094 ,p_segment25 => p_segment25
2095 ,p_segment26 => p_segment26
2096 ,p_segment27 => p_segment27
2097 ,p_segment28 => p_segment28
2098 ,p_segment29 => p_segment29
2099 ,p_segment30 => p_segment30
2100 ,p_value_1 => l_value_1
2101 ,p_value_2 => l_value_2
2102 ,p_value_3 => l_value_3
2103 ,p_value_4 => l_value_4
2104 ,p_value_5 => l_value_5
2105 ,p_value_6 => l_value_6
2106 ,p_value_7 => l_value_7
2107 ,p_value_8 => l_value_8
2108 ,p_value_9 => l_value_9
2109 ,p_value_10 => l_value_10
2110 ,p_value_11 => l_value_11
2111 ,p_value_12 => l_value_12
2112 ,p_value_13 => l_value_13
2113 ,p_value_14 => l_value_14
2114 ,p_value_15 => l_value_15
2115 );
2116 exception
2117 when hr_api.cannot_find_prog_unit then
2118 hr_api.cannot_find_prog_unit_error
2119 (p_module_name => 'update_batch_line_a'
2120 ,p_hook_type => 'AP'
2121 );
2122 end;
2123 --
2124 -- When in validation only mode raise the Validate_Enabled exception
2125 --
2126 if p_validate then
2127 raise hr_api.validate_enabled;
2128 end if;
2129 --
2130 -- Set all output arguments
2131 --
2132 p_object_version_number := l_object_version_number;
2133 --
2134 hr_utility.set_location(' Leaving:'||l_proc, 70);
2135 exception
2136 when hr_api.validate_enabled then
2137 --
2138 -- As the Validate_Enabled exception has been raised
2139 -- we must rollback to the savepoint
2140 --
2141 rollback to update_batch_line;
2142 --
2143 -- Only set output warning arguments
2144 -- (Any key or derived arguments must be set to null
2145 -- when validation only mode is being used.)
2146 --
2147 hr_utility.set_location(' Leaving:'||l_proc, 80);
2148 when others then
2149 --
2150 -- A validation or unexpected error has occured
2151 --
2152 rollback to update_batch_line;
2153 p_object_version_number := l_object_version_number;
2154 hr_utility.set_location(' Leaving:'||l_proc, 90);
2155 raise;
2156 end update_batch_line;
2157 --
2158 --
2159 -- ----------------------------------------------------------------------------
2160 -- |------------------------< update_batch_total >--------------------------|
2161 -- ----------------------------------------------------------------------------
2162 --
2163 procedure update_batch_total
2164 (p_validate in boolean default false
2165 ,p_session_date in date
2166 ,p_batch_control_id in number
2167 ,p_object_version_number in out nocopy number
2168 ,p_control_status in varchar2 default hr_api.g_varchar2
2169 ,p_control_total in varchar2 default hr_api.g_varchar2
2170 ,p_control_type in varchar2 default hr_api.g_varchar2
2171 ) is
2172 --
2173 -- Declare cursors and local variables
2174 --
2175 l_proc varchar2(72) := g_package||'update_batch_total';
2176 l_object_version_number pay_batch_control_totals.object_version_number%TYPE;
2177 l_session_date date;
2178 --
2179 begin
2180 hr_utility.set_location('Entering:'|| l_proc, 10);
2181 --
2182 -- Issue a savepoint
2183 --
2184 savepoint update_batch_total;
2185 --
2186 -- Store initial values for IN OUT parameters
2187 --
2188 l_object_version_number := p_object_version_number;
2189 --
2190 -- Truncate the time portion from all IN date parameters
2191 --
2192 l_session_date := trunc(p_session_date);
2193 --
2194 -- Call Before Process User Hook
2195 --
2196 begin
2197 pay_batch_element_entry_bk6.update_batch_total_b
2198 (p_session_date => l_session_date
2199 ,p_batch_control_id => p_batch_control_id
2200 ,p_object_version_number => l_object_version_number
2201 ,p_control_status => p_control_status
2202 ,p_control_total => p_control_total
2203 ,p_control_type => p_control_type
2204 );
2205 exception
2206 when hr_api.cannot_find_prog_unit then
2207 hr_api.cannot_find_prog_unit_error
2208 (p_module_name => 'update_batch_total_b'
2209 ,p_hook_type => 'BP'
2210 );
2211 end;
2212 --
2213 -- Validation in addition to Row Handlers
2214 --
2215 --
2216 -- Process Logic
2217 --
2218 pay_bct_upd.upd
2219 (p_session_date => l_session_date
2220 ,p_batch_control_id => p_batch_control_id
2224 ,p_control_type => p_control_type);
2221 ,p_object_version_number => l_object_version_number
2222 ,p_control_status => p_control_status
2223 ,p_control_total => p_control_total
2225 --
2226 -- Call After Process User Hook
2227 --
2228 begin
2229 pay_batch_element_entry_bk6.update_batch_total_a
2230 (p_session_date => l_session_date
2231 ,p_batch_control_id => p_batch_control_id
2232 ,p_object_version_number => l_object_version_number
2233 ,p_control_status => p_control_status
2234 ,p_control_total => p_control_total
2235 ,p_control_type => p_control_type
2236 );
2237 exception
2238 when hr_api.cannot_find_prog_unit then
2239 hr_api.cannot_find_prog_unit_error
2240 (p_module_name => 'update_batch_total_a'
2241 ,p_hook_type => 'AP'
2242 );
2243 end;
2244 --
2245 -- When in validation only mode raise the Validate_Enabled exception
2246 --
2247 if p_validate then
2248 raise hr_api.validate_enabled;
2249 end if;
2250 --
2251 -- Set all output arguments
2252 --
2253 p_object_version_number := l_object_version_number;
2254 --
2255 hr_utility.set_location(' Leaving:'||l_proc, 70);
2256 exception
2257 when hr_api.validate_enabled then
2258 --
2259 -- As the Validate_Enabled exception has been raised
2260 -- we must rollback to the savepoint
2261 --
2262 rollback to update_batch_total;
2263 --
2264 -- Only set output warning arguments
2265 -- (Any key or derived arguments must be set to null
2266 -- when validation only mode is being used.)
2267 --
2268 hr_utility.set_location(' Leaving:'||l_proc, 80);
2269 when others then
2270 --
2271 -- A validation or unexpected error has occured
2272 --
2273 rollback to update_batch_total;
2274 p_object_version_number := l_object_version_number;
2275 hr_utility.set_location(' Leaving:'||l_proc, 90);
2276 raise;
2277 end update_batch_total;
2278 --
2279 --
2280 -- ----------------------------------------------------------------------------
2281 -- |------------------------< delete_batch_header >-------------------------|
2282 -- ----------------------------------------------------------------------------
2283 --
2284 procedure delete_batch_header
2285 (p_validate in boolean default false
2286 ,p_batch_id in number
2287 ,p_object_version_number in number
2288 ) is
2289 --
2290 -- Declare cursors and local variables
2291 --
2292 l_proc varchar2(72) := g_package||'delete_batch_header';
2293 --
2294 cursor csr_batch_lines is
2295 select btl.batch_line_id,btl.object_version_number
2296 from pay_batch_lines btl
2297 where btl.batch_id = p_batch_id;
2298 --
2299 cursor csr_batch_ctl_totals is
2300 select bct.batch_control_id,bct.object_version_number
2301 from pay_batch_control_totals bct
2302 where bct.batch_id = p_batch_id;
2303 --
2304 begin
2305 hr_utility.set_location('Entering:'|| l_proc, 5);
2306 --
2307 -- Issue a savepoint if operating in validation only mode.
2308 --
2309 savepoint delete_batch_header;
2310 --
2311 -- Call Before Process User Hook
2312 --
2313 begin
2314 pay_batch_element_entry_bk7.delete_batch_header_b
2315 (p_batch_id => p_batch_id
2316 ,p_object_version_number => p_object_version_number
2317 );
2318 exception
2319 when hr_api.cannot_find_prog_unit then
2320 hr_api.cannot_find_prog_unit_error
2321 (p_module_name => 'delete_batch_header_b'
2322 ,p_hook_type => 'BP'
2323 );
2324 end;
2325 --
2326 --
2327 hr_utility.set_location(l_proc, 7);
2328 --
2329 -- Process Logic
2330 --
2331 --
2332 -- Deletes all batch lines.
2333 --
2334 for cssr in csr_batch_lines loop
2335 --
2336 -- Deletes all messages
2337 --
2338 delete from pay_message_lines
2339 where SOURCE_TYPE = 'L'
2340 and SOURCE_ID = cssr.batch_line_id;
2341 --
2342 pay_btl_del.del
2343 (p_batch_line_id => cssr.batch_line_id
2344 ,p_object_version_number => cssr.object_version_number
2345 );
2346 end loop;
2347 --
2348 hr_utility.set_location(l_proc, 10);
2349 --
2350 -- Deletes all batch control totals
2351 --
2352 for cssr in csr_batch_ctl_totals loop
2353 --
2354 -- Deletes all messages
2355 --
2356 delete from pay_message_lines
2357 where SOURCE_TYPE = 'C'
2358 and SOURCE_ID = cssr.batch_control_id;
2359 --
2360 pay_bct_del.del
2361 (p_batch_control_id => cssr.batch_control_id
2362 ,p_object_version_number => cssr.object_version_number
2363 );
2364 end loop;
2365 --
2366 hr_utility.set_location(l_proc, 15);
2367 --
2368 -- Deletes all messages
2369 --
2370 delete from pay_message_lines
2374 -- Deletes the batch header
2371 where SOURCE_TYPE = 'H'
2372 and SOURCE_ID = p_batch_id;
2373 --
2375 --
2376 pay_bth_del.del
2377 (p_batch_id => p_batch_id
2378 ,p_object_version_number => p_object_version_number
2379 );
2380 --
2381 hr_utility.set_location(l_proc, 20);
2382 --
2383 --
2384 -- Call After Process User Hook
2385 --
2386 begin
2387 pay_batch_element_entry_bk7.delete_batch_header_a
2388 (p_batch_id => p_batch_id
2389 ,p_object_version_number => p_object_version_number
2390 );
2391 exception
2392 when hr_api.cannot_find_prog_unit then
2393 hr_api.cannot_find_prog_unit_error
2394 (p_module_name => 'delete_batch_header_a'
2395 ,p_hook_type => 'AP'
2396 );
2397 end;
2398 --
2399 -- When in validation only mode raise the Validate_Enabled exception
2400 --
2401 if p_validate then
2402 raise hr_api.validate_enabled;
2403 end if;
2404 --
2405 hr_utility.set_location(' Leaving:'||l_proc, 21);
2406 exception
2407 when hr_api.validate_enabled then
2408 --
2409 -- As the Validate_Enabled exception has been raised
2410 -- we must rollback to the savepoint
2411 --
2412 ROLLBACK TO delete_batch_header;
2413 --
2414 hr_utility.set_location(' Leaving:'||l_proc, 22);
2415 --
2416 when others then
2417 --
2418 --
2419 ROLLBACK TO delete_batch_header;
2420 --
2421 raise;
2422 --
2423 end delete_batch_header;
2424 --
2425 --
2426 -- ----------------------------------------------------------------------------
2427 -- |-------------------------< delete_batch_line >--------------------------|
2428 -- ----------------------------------------------------------------------------
2429 --
2430 procedure delete_batch_line
2431 (p_validate in boolean default false
2432 ,p_batch_line_id in number
2433 ,p_object_version_number in number
2434 ) is
2435 --
2436 -- Declare cursors and local variables
2437 --
2438 l_proc varchar2(72) := g_package||'delete_batch_line';
2439 --
2440 begin
2441 hr_utility.set_location('Entering:'|| l_proc, 5);
2442 --
2443 -- Issue a savepoint if operating in validation only mode.
2444 --
2445 savepoint delete_batch_line;
2446 --
2447 -- Call Before Process User Hook
2448 --
2449 begin
2450 pay_batch_element_entry_bk8.delete_batch_line_b
2451 (p_batch_line_id => p_batch_line_id
2452 ,p_object_version_number => p_object_version_number
2453 );
2454 exception
2455 when hr_api.cannot_find_prog_unit then
2456 hr_api.cannot_find_prog_unit_error
2457 (p_module_name => 'delete_batch_line_b'
2458 ,p_hook_type => 'BP'
2459 );
2460 end;
2461 --
2462 --
2463 hr_utility.set_location(l_proc, 7);
2464 --
2465 -- Process Logic
2466 --
2467 --
2468 -- Deletes all messages
2469 --
2470 delete from pay_message_lines
2471 where SOURCE_TYPE = 'L'
2472 and SOURCE_ID = p_batch_line_id;
2473 --
2474 -- Deletes the batch line
2475 --
2476 pay_btl_del.del
2477 (p_batch_line_id => p_batch_line_id
2478 ,p_object_version_number => p_object_version_number
2479 );
2480 --
2481 hr_utility.set_location(l_proc, 20);
2482 --
2483 --
2484 -- Call After Process User Hook
2485 --
2486 begin
2487 pay_batch_element_entry_bk8.delete_batch_line_a
2488 (p_batch_line_id => p_batch_line_id
2489 ,p_object_version_number => p_object_version_number
2490 );
2491 exception
2492 when hr_api.cannot_find_prog_unit then
2493 hr_api.cannot_find_prog_unit_error
2494 (p_module_name => 'delete_batch_line_a'
2495 ,p_hook_type => 'AP'
2496 );
2497 end;
2498 --
2499 -- When in validation only mode raise the Validate_Enabled exception
2500 --
2501 if p_validate then
2502 raise hr_api.validate_enabled;
2503 end if;
2504 --
2505 hr_utility.set_location(' Leaving:'||l_proc, 21);
2506 exception
2507 when hr_api.validate_enabled then
2508 --
2509 -- As the Validate_Enabled exception has been raised
2510 -- we must rollback to the savepoint
2511 --
2512 ROLLBACK TO delete_batch_line;
2513 --
2514 hr_utility.set_location(' Leaving:'||l_proc, 22);
2515 --
2516 when others then
2517 --
2518 --
2519 ROLLBACK TO delete_batch_line;
2520 --
2521 raise;
2522 --
2523 end delete_batch_line;
2524 --
2525 --
2526 -- ----------------------------------------------------------------------------
2527 -- |------------------------< delete_batch_total >--------------------------|
2528 -- ----------------------------------------------------------------------------
2529 --
2530 procedure delete_batch_total
2531 (p_validate in boolean default false
2532 ,p_batch_control_id in number
2533 ,p_object_version_number in number
2534 ) is
2535 --
2536 -- Declare cursors and local variables
2537 --
2538 l_proc varchar2(72) := g_package||'delete_batch_total';
2539 --
2540 begin
2544 --
2541 hr_utility.set_location('Entering:'|| l_proc, 5);
2542 --
2543 -- Issue a savepoint if operating in validation only mode.
2545 savepoint delete_batch_total;
2546 --
2547 -- Call Before Process User Hook
2548 --
2549 begin
2550 pay_batch_element_entry_bk9.delete_batch_total_b
2551 (p_batch_control_id => p_batch_control_id
2552 ,p_object_version_number => p_object_version_number
2553 );
2554 exception
2555 when hr_api.cannot_find_prog_unit then
2556 hr_api.cannot_find_prog_unit_error
2557 (p_module_name => 'delete_batch_total_b'
2558 ,p_hook_type => 'BP'
2559 );
2560 end;
2561 --
2562 --
2563 hr_utility.set_location(l_proc, 7);
2564 --
2565 -- Process Logic
2566 --
2567 --
2568 -- Deletes all messages
2569 --
2570 delete from pay_message_lines
2571 where SOURCE_TYPE = 'C'
2572 and SOURCE_ID = p_batch_control_id;
2573 --
2574 -- Deletes the batch header
2575 --
2576 pay_bct_del.del
2577 (p_batch_control_id => p_batch_control_id
2578 ,p_object_version_number => p_object_version_number
2579 );
2580 --
2581 hr_utility.set_location(l_proc, 20);
2582 --
2583 --
2584 -- Call After Process User Hook
2585 --
2586 begin
2587 pay_batch_element_entry_bk9.delete_batch_total_a
2588 (p_batch_control_id => p_batch_control_id
2589 ,p_object_version_number => p_object_version_number
2590 );
2591 exception
2592 when hr_api.cannot_find_prog_unit then
2593 hr_api.cannot_find_prog_unit_error
2594 (p_module_name => 'delete_batch_total_a'
2595 ,p_hook_type => 'AP'
2596 );
2597 end;
2598 --
2599 -- When in validation only mode raise the Validate_Enabled exception
2600 --
2601 if p_validate then
2602 raise hr_api.validate_enabled;
2603 end if;
2604 --
2605 hr_utility.set_location(' Leaving:'||l_proc, 21);
2606 exception
2607 when hr_api.validate_enabled then
2608 --
2609 -- As the Validate_Enabled exception has been raised
2610 -- we must rollback to the savepoint
2611 --
2612 ROLLBACK TO delete_batch_total;
2613 --
2614 hr_utility.set_location(' Leaving:'||l_proc, 22);
2615 --
2616 when others then
2617 --
2618 --
2619 ROLLBACK TO delete_batch_total;
2620 --
2621 raise;
2622 --
2623 end delete_batch_total;
2624 --
2625 end PAY_BATCH_ELEMENT_ENTRY_API;