[Home] [Help]
PACKAGE BODY: APPS.PAY_ELE_UPD
Source
1 Package Body pay_ele_upd as
2 /* $Header: pyelerhi.pkb 120.1 2005/05/30 05:19:19 rajeesha noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pay_ele_upd.'; -- Global package name
9 g_counter number;
10 --
11 -- ----------------------------------------------------------------------------
12 -- |----------------------------< dt_update_dml >-----------------------------|
13 -- ----------------------------------------------------------------------------
14 -- {Start Of Comments}
15 --
16 -- Description:
17 -- This procedure controls the execution of dml from the datetrack mode
18 -- of CORRECTION only. It is important to note that the object version
19 -- number is only increment by 1 because the datetrack correction is
20 -- soley for one datetracked row.
21 -- This procedure controls the actual dml update logic. The functions of this
22 -- procedure are as follows:
23 -- 1) Get the next object_version_number.
24 -- 2) To set and unset the g_api_dml status as required (as we are about to
25 -- perform dml).
26 -- 3) To update the specified row in the schema using the primary key in
27 -- the predicates.
28 -- 4) To trap any constraint violations that may have occurred.
29 -- 5) To raise any other errors.
30 --
31 -- Prerequisites:
32 -- This is an internal private procedure which must be called from the
33 -- update_dml procedure.
34 --
35 -- In Parameters:
36 -- A Pl/Sql record structure.
37 --
38 -- Post Success:
39 -- The specified row will be updated in the schema.
40 --
41 -- Post Failure:
42 -- On the update dml failure it is important to note that we always reset the
43 -- g_api_dml status to false.
44 -- If a check or unique integrity constraint violation is raised the
45 -- constraint_error procedure will be called.
46 -- If any other error is reported, the error will be raised after the
47 -- g_api_dml status is reset.
48 --
49 -- Developer Implementation Notes:
50 -- The update 'set' arguments list should be modified if any of your
51 -- attributes are not updateable.
52 --
53 -- Access Status:
54 -- Internal Row Handler Use Only.
55 --
56 -- {End Of Comments}
57 -- ----------------------------------------------------------------------------
58 Procedure dt_update_dml
59 (p_rec in out nocopy pay_ele_shd.g_rec_type
60 ,p_effective_date in date
61 ,p_datetrack_mode in varchar2
62 ,p_validation_start_date in date
63 ,p_validation_end_date in date
64 ) is
65 --
66 l_proc varchar2(72) := g_package||'dt_update_dml';
67 --
68 Begin
69 hr_utility.set_location('Entering:'||l_proc, 5);
70 --
71 If (p_datetrack_mode = hr_api.g_correction) then
72 hr_utility.set_location(l_proc, 10);
73 --
74 -- Because we are updating a row we must get the next object
75 -- version number.
76 --
77 p_rec.object_version_number :=
78 dt_api.get_object_version_number
79 (p_base_table_name => 'pay_element_entries_f'
80 ,p_base_key_column => 'element_entry_id'
81 ,p_base_key_value => p_rec.element_entry_id
82 );
83 --
84 pay_ele_shd.g_api_dml := true; -- Set the api dml status
85 --
86 -- Update the pay_element_entries_f Row
87 --
88 update pay_element_entries_f
89 set
90 element_entry_id = p_rec.element_entry_id
91 ,cost_allocation_keyflex_id = p_rec.cost_allocation_keyflex_id
92 ,assignment_id = p_rec.assignment_id
93 ,updating_action_id = p_rec.updating_action_id
94 ,updating_action_type = p_rec.updating_action_type
95 ,element_link_id = p_rec.element_link_id
96 ,original_entry_id = p_rec.original_entry_id
97 ,creator_type = p_rec.creator_type
98 ,entry_type = p_rec.entry_type
99 ,comment_id = p_rec.comment_id
100 ,creator_id = p_rec.creator_id
101 ,reason = p_rec.reason
102 ,target_entry_id = p_rec.target_entry_id
103 ,attribute_category = p_rec.attribute_category
104 ,attribute1 = p_rec.attribute1
105 ,attribute2 = p_rec.attribute2
106 ,attribute3 = p_rec.attribute3
107 ,attribute4 = p_rec.attribute4
108 ,attribute5 = p_rec.attribute5
109 ,attribute6 = p_rec.attribute6
110 ,attribute7 = p_rec.attribute7
111 ,attribute8 = p_rec.attribute8
112 ,attribute9 = p_rec.attribute9
113 ,attribute10 = p_rec.attribute10
114 ,attribute11 = p_rec.attribute11
115 ,attribute12 = p_rec.attribute12
116 ,attribute13 = p_rec.attribute13
117 ,attribute14 = p_rec.attribute14
118 ,attribute15 = p_rec.attribute15
119 ,attribute16 = p_rec.attribute16
120 ,attribute17 = p_rec.attribute17
121 ,attribute18 = p_rec.attribute18
122 ,attribute19 = p_rec.attribute19
123 ,attribute20 = p_rec.attribute20
124 ,subpriority = p_rec.subpriority
125 ,personal_payment_method_id = p_rec.personal_payment_method_id
126 ,date_earned = p_rec.date_earned
127 ,object_version_number = p_rec.object_version_number
128 ,source_id = p_rec.source_id
129 ,balance_adj_cost_flag = p_rec.balance_adj_cost_flag
130 ,element_type_id = p_rec.element_type_id
131 ,all_entry_values_null = p_rec.all_entry_values_null
132 where element_entry_id = p_rec.element_entry_id
133 and effective_start_date = p_validation_start_date
134 and effective_end_date = p_validation_end_date;
135 --
136 pay_ele_shd.g_api_dml := false; -- Unset the api dml status
137 --
138 -- Set the effective start and end dates
139 --
140 p_rec.effective_start_date := p_validation_start_date;
141 p_rec.effective_end_date := p_validation_end_date;
142 End If;
143 --
144 hr_utility.set_location(' Leaving:'||l_proc, 15);
145 Exception
146 When hr_api.check_integrity_violated Then
147 -- A check constraint has been violated
148 pay_ele_shd.g_api_dml := false; -- Unset the api dml status
149 pay_ele_shd.constraint_error
150 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
151 When hr_api.unique_integrity_violated Then
152 -- Unique integrity has been violated
153 pay_ele_shd.g_api_dml := false; -- Unset the api dml status
154 pay_ele_shd.constraint_error
155 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
156 When Others Then
157 pay_ele_shd.g_api_dml := false; -- Unset the api dml status
158 Raise;
159 End dt_update_dml;
160 --
161 -- ----------------------------------------------------------------------------
162 -- |------------------------------< update_dml >------------------------------|
163 -- ----------------------------------------------------------------------------
164 -- {Start Of Comments}
165 --
166 -- Description:
167 -- This procedure calls the dt_update_dml control logic which handles
168 -- the actual datetrack dml.
169 --
170 -- Prerequisites:
171 -- This is an internal private procedure which must be called from the upd
172 -- procedure.
173 --
174 -- In Parameters:
175 -- A Pl/Sql record structre.
176 --
177 -- Post Success:
178 -- Processing contines.
179 --
180 -- Post Failure:
181 -- No specific error handling is required within this procedure.
182 --
183 -- Developer Implementation Notes:
184 -- The update 'set' arguments list should be modified if any of your
185 -- attributes are not updateable.
186 --
187 -- Access Status:
188 -- Internal Row Handler Use Only.
189 --
190 -- {End Of Comments}
191 -- ----------------------------------------------------------------------------
192 Procedure update_dml
193 (p_rec in out nocopy pay_ele_shd.g_rec_type
194 ,p_effective_date in date
195 ,p_datetrack_mode in varchar2
196 ,p_validation_start_date in date
197 ,p_validation_end_date in date
198 ) is
199 --
200 l_proc varchar2(72) := g_package||'update_dml';
201 --
202 Begin
203 hr_utility.set_location('Entering:'||l_proc, 5);
204 --
205 pay_ele_upd.dt_update_dml
206 (p_rec => p_rec
207 ,p_effective_date => p_effective_date
208 ,p_datetrack_mode => p_datetrack_mode
209 ,p_validation_start_date => p_validation_start_date
210 ,p_validation_end_date => p_validation_end_date
211 );
212 --
213 hr_utility.set_location(' Leaving:'||l_proc, 10);
214 End update_dml;
215 --
216 -- ----------------------------------------------------------------------------
217 -- |----------------------------< dt_pre_update >-----------------------------|
218 -- ----------------------------------------------------------------------------
219 -- {Start Of Comments}
220 --
221 -- Description:
222 -- The dt_pre_update procedure controls the execution
223 -- of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
224 -- and UPDATE_CHANGE_INSERT only. The execution required is as
225 -- follows:
226 --
227 -- 1) Providing the datetrack update mode is not 'CORRECTION'
228 -- then set the effective end date of the current row (this
229 -- will be the validation_start_date - 1).
230 -- 2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
231 -- corresponding delete_dml process to delete any future rows
232 -- where the effective_start_date is greater than or equal to
233 -- the validation_start_date.
234 -- 3) Call the insert_dml process to insert the new updated row
235 -- details.
236 --
237 -- Prerequisites:
238 -- This is an internal procedure which is called from the
239 -- pre_update procedure.
240 --
241 -- In Parameters:
242 --
243 -- Post Success:
244 -- Processing continues.
245 --
246 -- Post Failure:
247 -- If an error has occurred, an error message and exception will be raised
248 -- but not handled.
249 --
250 -- Developer Implementation Notes:
251 -- This is an internal procedure which is required by Datetrack. Don't
252 -- remove or modify.
253 --
254 -- Access Status:
255 -- Internal Row Handler Use Only.
256 --
257 -- {End Of Comments}
258 -- ----------------------------------------------------------------------------
259 Procedure dt_pre_update
260 (p_rec in out nocopy pay_ele_shd.g_rec_type
261 ,p_effective_date in date
262 ,p_datetrack_mode in varchar2
263 ,p_validation_start_date in date
264 ,p_validation_end_date in date
265 ) is
266 --
267 l_proc varchar2(72) := g_package||'dt_pre_update';
268 l_dummy_version_number number;
269 --
270 Begin
271 hr_utility.set_location('Entering:'||l_proc, 5);
272 If (p_datetrack_mode <> hr_api.g_correction) then
273 --
274 -- Update the current effective end date
275 --
276 pay_ele_shd.upd_effective_end_date
277 (p_effective_date => p_effective_date
278 ,p_base_key_value => p_rec.element_entry_id
279 ,p_new_effective_end_date => (p_validation_start_date - 1)
280 ,p_validation_start_date => p_validation_start_date
281 ,p_validation_end_date => p_validation_end_date
282 ,p_object_version_number => l_dummy_version_number
283 );
284 --
285 If (p_datetrack_mode = hr_api.g_update_override) then
286 --
287 -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
288 -- delete any future rows
289 --
290 pay_ele_del.delete_dml
291 (p_rec => p_rec
292 ,p_effective_date => p_effective_date
293 ,p_datetrack_mode => p_datetrack_mode
294 ,p_validation_start_date => p_validation_start_date
295 ,p_validation_end_date => p_validation_end_date
296 );
297 End If;
298 --
299 -- We must now insert the updated row
300 --
301 pay_ele_ins.insert_dml
302 (p_rec => p_rec
303 ,p_effective_date => p_effective_date
304 ,p_datetrack_mode => p_datetrack_mode
305 ,p_validation_start_date => p_validation_start_date
306 ,p_validation_end_date => p_validation_end_date
307 );
308 End If;
309 hr_utility.set_location(' Leaving:'||l_proc, 20);
310 End dt_pre_update;
311 --
312 -- ----------------------------------------------------------------------------
313 -- |------------------------------< pre_update >------------------------------|
314 -- ----------------------------------------------------------------------------
315 -- {Start Of Comments}
316 --
317 -- Description:
318 -- This private procedure contains any processing which is required before
319 -- the update dml.
320 --
321 -- Prerequisites:
322 -- This is an internal procedure which is called from the upd procedure.
323 --
324 -- In Parameters:
325 -- A Pl/Sql record structure.
326 --
327 -- Post Success:
328 -- Processing continues.
329 --
330 -- Post Failure:
331 -- If an error has occurred, an error message and exception will be raised
332 -- but not handled.
333 --
334 -- Developer Implementation Notes:
335 -- Any pre-processing required before the update dml is issued should be
336 -- coded within this procedure. It is important to note that any 3rd party
337 -- maintenance should be reviewed before placing in this procedure. The call
338 -- to the dt_update_dml procedure should NOT be removed.
339 --
340 -- Access Status:
341 -- Internal Row Handler Use Only.
342 --
343 -- {End Of Comments}
344 -- ----------------------------------------------------------------------------
345 Procedure pre_update
346 (p_rec in out nocopy pay_ele_shd.g_rec_type
347 ,p_effective_date in date
348 ,p_datetrack_mode in varchar2
349 ,p_validation_start_date in date
350 ,p_validation_end_date in date
351 ) is
352 --
353 l_proc varchar2(72) := g_package||'pre_update';
354 --
355 Begin
356 hr_utility.set_location('Entering:'||l_proc, 5);
357 --
358 --
359 -- Insert the comment text if comments exist
360 --
361 If (p_rec.comments is not null and p_rec.comment_id is null) then
362 hr_comm_api.ins(p_comment_id => p_rec.comment_id
363 ,p_source_table_name => 'PAY_ELEMENT_ENTRIES_F'
364 ,p_comment_text => p_rec.comments
365 );
366 -- Update the comments if they have changed
367 ElsIf (p_rec.comment_id is not null and p_rec.comments <>
368 pay_ele_shd.g_old_rec.comments) then
369 hr_comm_api.upd(p_comment_id => p_rec.comment_id
370 ,p_source_table_name => 'PAY_ELEMENT_ENTRIES_F'
371 ,p_comment_text => p_rec.comments
372 );
373 End If;
374 --
375 dt_pre_update
376 (p_rec => p_rec
377 ,p_effective_date => p_effective_date
378 ,p_datetrack_mode => p_datetrack_mode
379 ,p_validation_start_date => p_validation_start_date
380 ,p_validation_end_date => p_validation_end_date
381 );
382 --
383 hr_utility.set_location(' Leaving:'||l_proc, 10);
384 End pre_update;
385 --
386 -- ----------------------------------------------------------------------------
387 -- |----------------------------< post_update >-------------------------------|
388 -- ----------------------------------------------------------------------------
389 -- {Start Of Comments}
390 --
391 -- Description:
392 -- This private procedure contains any processing which is required after the
393 -- update dml.
394 --
395 -- Prerequisites:
396 -- This is an internal procedure which is called from the upd procedure.
397 --
398 -- In Parameters:
399 -- A Pl/Sql record structure.
400 --
401 -- Post Success:
402 -- Processing continues.
403 --
404 -- Post Failure:
405 -- If an error has occurred, an error message and exception will be raised
406 -- but not handled.
407 --
408 -- Developer Implementation Notes:
409 -- Any post-processing required after the update dml is issued should be
410 -- coded within this procedure. It is important to note that any 3rd party
411 -- maintenance should be reviewed before placing in this procedure.
412 --
413 -- Access Status:
414 -- Internal Row Handler Use Only.
415 --
416 -- {End Of Comments}
417 -- ----------------------------------------------------------------------------
418 Procedure post_update
419 (p_rec in pay_ele_shd.g_rec_type
420 ,p_effective_date in date
421 ,p_datetrack_mode in varchar2
422 ,p_validation_start_date in date
423 ,p_validation_end_date in date
424 ) is
425 --
426
427 l_proc varchar2(72) := g_package||'post_update';
428 --
429 Begin
430 hr_utility.set_location('Entering:'||l_proc, 5);
431 begin
432 --
433 pay_ele_rku.after_update
434 (p_effective_date
435 => p_effective_date
436 ,p_datetrack_mode
437 => p_datetrack_mode
438 ,p_validation_start_date
439 => p_validation_start_date
440 ,p_validation_end_date
441 => p_validation_end_date
442 ,p_element_entry_id
443 => p_rec.element_entry_id
444 ,p_effective_start_date
445 => p_rec.effective_start_date
446 ,p_effective_end_date
447 => p_rec.effective_end_date
448 ,p_cost_allocation_keyflex_id
449 => p_rec.cost_allocation_keyflex_id
450 ,p_updating_action_id
451 => p_rec.updating_action_id
452 ,p_updating_action_type
453 => p_rec.updating_action_type
454 ,p_original_entry_id
455 => p_rec.original_entry_id
456 ,p_creator_type
457 => p_rec.creator_type
458 ,p_entry_type
459 => p_rec.entry_type
460 ,p_comment_id
461 => p_rec.comment_id
462 ,p_comments
463 => p_rec.comments
464 ,p_creator_id
465 => p_rec.creator_id
466 ,p_reason
467 => p_rec.reason
468 ,p_target_entry_id
469 => p_rec.target_entry_id
470 ,p_attribute_category
471 => p_rec.attribute_category
472 ,p_attribute1
473 => p_rec.attribute1
474 ,p_attribute2
475 => p_rec.attribute2
476 ,p_attribute3
477 => p_rec.attribute3
478 ,p_attribute4
479 => p_rec.attribute4
480 ,p_attribute5
481 => p_rec.attribute5
482 ,p_attribute6
483 => p_rec.attribute6
484 ,p_attribute7
485 => p_rec.attribute7
486 ,p_attribute8
487 => p_rec.attribute8
488 ,p_attribute9
489 => p_rec.attribute9
490 ,p_attribute10
491 => p_rec.attribute10
492 ,p_attribute11
493 => p_rec.attribute11
494 ,p_attribute12
495 => p_rec.attribute12
496 ,p_attribute13
497 => p_rec.attribute13
498 ,p_attribute14
499 => p_rec.attribute14
500 ,p_attribute15
501 => p_rec.attribute15
502 ,p_attribute16
503 => p_rec.attribute16
504 ,p_attribute17
505 => p_rec.attribute17
506 ,p_attribute18
507 => p_rec.attribute18
508 ,p_attribute19
509 => p_rec.attribute19
510 ,p_attribute20
511 => p_rec.attribute20
512 -- --
513 ,
514 p_entry_information_category => p_rec.entry_information_category,
515 p_entry_information1 => p_rec.entry_information1,
516 p_entry_information2 => p_rec.entry_information2,
517 p_entry_information3 => p_rec.entry_information3,
518 p_entry_information4 => p_rec.entry_information4,
519 p_entry_information5 => p_rec.entry_information5,
520 p_entry_information6 => p_rec.entry_information6,
521 p_entry_information7 => p_rec.entry_information7,
522 p_entry_information8 => p_rec.entry_information8,
523 p_entry_information9 => p_rec.entry_information9,
524 p_entry_information10 => p_rec.entry_information10,
525 p_entry_information11 => p_rec.entry_information11,
526 p_entry_information12 => p_rec.entry_information12,
527 p_entry_information13 => p_rec.entry_information13,
528 p_entry_information14 => p_rec.entry_information14,
529 p_entry_information15 => p_rec.entry_information15,
530 p_entry_information16 => p_rec.entry_information16,
531 p_entry_information17 => p_rec.entry_information17,
532 p_entry_information18 => p_rec.entry_information18,
533 p_entry_information19 => p_rec.entry_information19,
534 p_entry_information20 => p_rec.entry_information20,
535 p_entry_information21 => p_rec.entry_information21,
536 p_entry_information22 => p_rec.entry_information22,
537 p_entry_information23 => p_rec.entry_information23,
538 p_entry_information24 => p_rec.entry_information24,
539 p_entry_information25 => p_rec.entry_information25,
540 p_entry_information26 => p_rec.entry_information26,
541 p_entry_information27 => p_rec.entry_information27,
542 p_entry_information28 => p_rec.entry_information28,
543 p_entry_information29 => p_rec.entry_information29,
544 p_entry_information30 => p_rec.entry_information30
545 ,p_subpriority
546 => p_rec.subpriority
547 ,p_personal_payment_method_id
548 => p_rec.personal_payment_method_id
549 ,p_date_earned
550 => p_rec.date_earned
551 ,p_object_version_number
552 => p_rec.object_version_number
553 ,p_source_id
554 => p_rec.source_id
555 ,p_balance_adj_cost_flag
556 => p_rec.balance_adj_cost_flag
557 ,p_all_entry_values_null
558 => p_rec.all_entry_values_null
559 ,p_effective_start_date_o
560 => pay_ele_shd.g_old_rec.effective_start_date
561 ,p_effective_end_date_o
562 => pay_ele_shd.g_old_rec.effective_end_date
563 ,p_cost_allocation_keyflex_id_o
564 => pay_ele_shd.g_old_rec.cost_allocation_keyflex_id
565 ,p_assignment_id_o
566 => pay_ele_shd.g_old_rec.assignment_id
567 ,p_updating_action_id_o
568 => pay_ele_shd.g_old_rec.updating_action_id
569 ,p_updating_action_type_o
570 => pay_ele_shd.g_old_rec.updating_action_type
571 ,p_element_link_id_o
572 => pay_ele_shd.g_old_rec.element_link_id
573 ,p_original_entry_id_o
574 => pay_ele_shd.g_old_rec.original_entry_id
575 ,p_creator_type_o
576 => pay_ele_shd.g_old_rec.creator_type
577 ,p_entry_type_o
578 => pay_ele_shd.g_old_rec.entry_type
579 ,p_comment_id_o
580 => pay_ele_shd.g_old_rec.comment_id
581 ,p_comments_o
582 => pay_ele_shd.g_old_rec.comments
583 ,p_creator_id_o
584 => pay_ele_shd.g_old_rec.creator_id
585 ,p_reason_o
586 => pay_ele_shd.g_old_rec.reason
587 ,p_target_entry_id_o
588 => pay_ele_shd.g_old_rec.target_entry_id
589 ,p_attribute_category_o
590 => pay_ele_shd.g_old_rec.attribute_category
591 ,p_attribute1_o
592 => pay_ele_shd.g_old_rec.attribute1
593 ,p_attribute2_o
594 => pay_ele_shd.g_old_rec.attribute2
595 ,p_attribute3_o
596 => pay_ele_shd.g_old_rec.attribute3
597 ,p_attribute4_o
598 => pay_ele_shd.g_old_rec.attribute4
599 ,p_attribute5_o
600 => pay_ele_shd.g_old_rec.attribute5
601 ,p_attribute6_o
602 => pay_ele_shd.g_old_rec.attribute6
603 ,p_attribute7_o
604 => pay_ele_shd.g_old_rec.attribute7
605 ,p_attribute8_o
606 => pay_ele_shd.g_old_rec.attribute8
607 ,p_attribute9_o
608 => pay_ele_shd.g_old_rec.attribute9
609 ,p_attribute10_o
610 => pay_ele_shd.g_old_rec.attribute10
611 ,p_attribute11_o
612 => pay_ele_shd.g_old_rec.attribute11
613 ,p_attribute12_o
614 => pay_ele_shd.g_old_rec.attribute12
615 ,p_attribute13_o
616 => pay_ele_shd.g_old_rec.attribute13
617 ,p_attribute14_o
618 => pay_ele_shd.g_old_rec.attribute14
619 ,p_attribute15_o
620 => pay_ele_shd.g_old_rec.attribute15
621 ,p_attribute16_o
622 => pay_ele_shd.g_old_rec.attribute16
623 ,p_attribute17_o
624 => pay_ele_shd.g_old_rec.attribute17
625 ,p_attribute18_o
626 => pay_ele_shd.g_old_rec.attribute18
627 ,p_attribute19_o
628 => pay_ele_shd.g_old_rec.attribute19
629 ,p_attribute20_o
630 => pay_ele_shd.g_old_rec.attribute20
631 -- --
632 ,--Altered next 30 lines, 20-FEB-03 changed p_rec -> pay_ele_shd.g_old_rec
633 --as looked like a cut-n-paste accident
634 p_entry_information_category_o => pay_ele_shd.g_old_rec.entry_information_category,
635 p_entry_information1_o => pay_ele_shd.g_old_rec.entry_information1,
636 p_entry_information2_o => pay_ele_shd.g_old_rec.entry_information2,
637 p_entry_information3_o => pay_ele_shd.g_old_rec.entry_information3,
638 p_entry_information4_o => pay_ele_shd.g_old_rec.entry_information4,
639 p_entry_information5_o => pay_ele_shd.g_old_rec.entry_information5,
640 p_entry_information6_o => pay_ele_shd.g_old_rec.entry_information6,
641 p_entry_information7_o => pay_ele_shd.g_old_rec.entry_information7,
642 p_entry_information8_o => pay_ele_shd.g_old_rec.entry_information8,
643 p_entry_information9_o => pay_ele_shd.g_old_rec.entry_information9,
644 p_entry_information10_o => pay_ele_shd.g_old_rec.entry_information10,
645 p_entry_information11_o => pay_ele_shd.g_old_rec.entry_information11,
646 p_entry_information12_o => pay_ele_shd.g_old_rec.entry_information12,
647 p_entry_information13_o => pay_ele_shd.g_old_rec.entry_information13,
648 p_entry_information14_o => pay_ele_shd.g_old_rec.entry_information14,
649 p_entry_information15_o => pay_ele_shd.g_old_rec.entry_information15,
650 p_entry_information16_o => pay_ele_shd.g_old_rec.entry_information16,
651 p_entry_information17_o => pay_ele_shd.g_old_rec.entry_information17,
652 p_entry_information18_o => pay_ele_shd.g_old_rec.entry_information18,
653 p_entry_information19_o => pay_ele_shd.g_old_rec.entry_information19,
654 p_entry_information20_o => pay_ele_shd.g_old_rec.entry_information20,
655 p_entry_information21_o => pay_ele_shd.g_old_rec.entry_information21,
656 p_entry_information22_o => pay_ele_shd.g_old_rec.entry_information22,
657 p_entry_information23_o => pay_ele_shd.g_old_rec.entry_information23,
658 p_entry_information24_o => pay_ele_shd.g_old_rec.entry_information24,
659 p_entry_information25_o => pay_ele_shd.g_old_rec.entry_information25,
660 p_entry_information26_o => pay_ele_shd.g_old_rec.entry_information26,
661 p_entry_information27_o => pay_ele_shd.g_old_rec.entry_information27,
662 p_entry_information28_o => pay_ele_shd.g_old_rec.entry_information28,
663 p_entry_information29_o => pay_ele_shd.g_old_rec.entry_information29,
664 p_entry_information30_o => pay_ele_shd.g_old_rec.entry_information30
665 ,p_subpriority_o
666 => pay_ele_shd.g_old_rec.subpriority
667 ,p_personal_payment_method_id_o
668 => pay_ele_shd.g_old_rec.personal_payment_method_id
669 ,p_date_earned_o
670 => pay_ele_shd.g_old_rec.date_earned
671 ,p_object_version_number_o
672 => pay_ele_shd.g_old_rec.object_version_number
673 ,p_source_id_o
674 => pay_ele_shd.g_old_rec.source_id
675 ,p_balance_adj_cost_flag_o
676 => pay_ele_shd.g_old_rec.balance_adj_cost_flag
677 ,p_element_type_id_o => pay_ele_shd.g_old_rec.element_type_id
678 ,p_all_entry_values_null_o
679 => pay_ele_shd.g_old_rec.all_entry_values_null
680 );
681 --
682 exception
683 --
684 when hr_api.cannot_find_prog_unit then
685 --
686 hr_api.cannot_find_prog_unit_error
687 (p_module_name => 'PAY_ELEMENT_ENTRIES_F'
688 ,p_hook_type => 'AU');
689 --
690 end;
691 --
692 -- 11-NOV-03
693 -- Hard calls to DYT_PKG removed, perfomed in pyentapi.pkb
694
695 hr_utility.set_location('Leaving:'||l_proc, 900);
696 --
697 End post_update;
698 --
699 -- ----------------------------------------------------------------------------
700 -- |-----------------------------< convert_defs >-----------------------------|
701 -- ----------------------------------------------------------------------------
702 -- {Start Of Comments}
703 --
704 -- Description:
705 -- The Convert_Defs procedure has one very important function:
706 -- It must return the record structure for the row with all system defaulted
707 -- values converted into its corresponding parameter value for update. When
708 -- we attempt to update a row through the Upd process , certain
709 -- parameters can be defaulted which enables flexibility in the calling of
710 -- the upd process (e.g. only attributes which need to be updated need to be
711 -- specified). For the upd process to determine which attributes
712 -- have NOT been specified we need to check if the parameter has a reserved
713 -- system default value. Therefore, for all parameters which have a
714 -- corresponding reserved system default mechanism specified we need to
715 -- check if a system default is being used. If a system default is being
716 -- used then we convert the defaulted value into its corresponding attribute
717 -- value held in the g_old_rec data structure.
718 --
719 -- Prerequisites:
720 -- This private function can only be called from the upd process.
721 --
722 -- In Parameters:
723 -- A Pl/Sql record structure.
724 --
725 -- Post Success:
726 -- The record structure will be returned with all system defaulted parameter
727 -- values converted into its current row attribute value.
728 --
729 -- Post Failure:
730 -- No direct error handling is required within this function. Any possible
731 -- errors within this procedure will be a PL/SQL value error due to
732 -- conversion of datatypes or data lengths.
733 --
734 -- Developer Implementation Notes:
735 -- None.
736 --
737 -- Access Status:
738 -- Internal Row Handler Use Only.
739 --
740 -- {End Of Comments}
741 -- ----------------------------------------------------------------------------
742 Procedure convert_defs
743 (p_rec in out nocopy pay_ele_shd.g_rec_type
744 ) is
745 --
746 Begin
747 --
748 -- We must now examine each argument value in the
749 -- p_rec plsql record structure
750 -- to see if a system default is being used. If a system default
751 -- is being used then we must set to the 'current' argument value.
752 --
753 If (p_rec.cost_allocation_keyflex_id = hr_api.g_number) then
754 p_rec.cost_allocation_keyflex_id :=
755 pay_ele_shd.g_old_rec.cost_allocation_keyflex_id;
756 End If;
757 If (p_rec.assignment_id = hr_api.g_number) then
758 p_rec.assignment_id :=
759 pay_ele_shd.g_old_rec.assignment_id;
760 End If;
761 If (p_rec.updating_action_id = hr_api.g_number) then
762 p_rec.updating_action_id :=
763 pay_ele_shd.g_old_rec.updating_action_id;
764 End If;
765 If (p_rec.updating_action_type = hr_api.g_varchar2) then
766 p_rec.updating_action_type :=
767 pay_ele_shd.g_old_rec.updating_action_type;
768 End If;
769 If (p_rec.element_link_id = hr_api.g_number) then
770 p_rec.element_link_id :=
771 pay_ele_shd.g_old_rec.element_link_id;
772 End If;
773 If (p_rec.original_entry_id = hr_api.g_number) then
774 p_rec.original_entry_id :=
775 pay_ele_shd.g_old_rec.original_entry_id;
776 End If;
777 If (p_rec.creator_type = hr_api.g_varchar2) then
778 p_rec.creator_type :=
779 pay_ele_shd.g_old_rec.creator_type;
780 End If;
781 If (p_rec.entry_type = hr_api.g_varchar2) then
782 p_rec.entry_type :=
783 pay_ele_shd.g_old_rec.entry_type;
784 End If;
785 If (p_rec.comment_id = hr_api.g_number) then
786 p_rec.comment_id :=
787 pay_ele_shd.g_old_rec.comment_id;
788 End If;
789 If (p_rec.comments = hr_api.g_varchar2) then
790 p_rec.comments :=
791 pay_ele_shd.g_old_rec.comments;
792 End If;
793 If (p_rec.creator_id = hr_api.g_number) then
794 p_rec.creator_id :=
795 pay_ele_shd.g_old_rec.creator_id;
796 End If;
797 If (p_rec.reason = hr_api.g_varchar2) then
798 p_rec.reason :=
799 pay_ele_shd.g_old_rec.reason;
800 End If;
801 If (p_rec.target_entry_id = hr_api.g_number) then
802 p_rec.target_entry_id :=
803 pay_ele_shd.g_old_rec.target_entry_id;
804 End If;
805 If (p_rec.attribute_category = hr_api.g_varchar2) then
806 p_rec.attribute_category :=
807 pay_ele_shd.g_old_rec.attribute_category;
808 End If;
809 If (p_rec.attribute1 = hr_api.g_varchar2) then
810 p_rec.attribute1 :=
811 pay_ele_shd.g_old_rec.attribute1;
812 End If;
813 If (p_rec.attribute2 = hr_api.g_varchar2) then
814 p_rec.attribute2 :=
815 pay_ele_shd.g_old_rec.attribute2;
816 End If;
817 If (p_rec.attribute3 = hr_api.g_varchar2) then
818 p_rec.attribute3 :=
819 pay_ele_shd.g_old_rec.attribute3;
820 End If;
821 If (p_rec.attribute4 = hr_api.g_varchar2) then
822 p_rec.attribute4 :=
823 pay_ele_shd.g_old_rec.attribute4;
824 End If;
825 If (p_rec.attribute5 = hr_api.g_varchar2) then
826 p_rec.attribute5 :=
827 pay_ele_shd.g_old_rec.attribute5;
828 End If;
829 If (p_rec.attribute6 = hr_api.g_varchar2) then
830 p_rec.attribute6 :=
831 pay_ele_shd.g_old_rec.attribute6;
832 End If;
833 If (p_rec.attribute7 = hr_api.g_varchar2) then
834 p_rec.attribute7 :=
835 pay_ele_shd.g_old_rec.attribute7;
836 End If;
837 If (p_rec.attribute8 = hr_api.g_varchar2) then
838 p_rec.attribute8 :=
839 pay_ele_shd.g_old_rec.attribute8;
840 End If;
841 If (p_rec.attribute9 = hr_api.g_varchar2) then
842 p_rec.attribute9 :=
843 pay_ele_shd.g_old_rec.attribute9;
844 End If;
845 If (p_rec.attribute10 = hr_api.g_varchar2) then
846 p_rec.attribute10 :=
847 pay_ele_shd.g_old_rec.attribute10;
848 End If;
849 If (p_rec.attribute11 = hr_api.g_varchar2) then
850 p_rec.attribute11 :=
851 pay_ele_shd.g_old_rec.attribute11;
852 End If;
853 If (p_rec.attribute12 = hr_api.g_varchar2) then
854 p_rec.attribute12 :=
855 pay_ele_shd.g_old_rec.attribute12;
856 End If;
857 If (p_rec.attribute13 = hr_api.g_varchar2) then
858 p_rec.attribute13 :=
859 pay_ele_shd.g_old_rec.attribute13;
860 End If;
861 If (p_rec.attribute14 = hr_api.g_varchar2) then
862 p_rec.attribute14 :=
863 pay_ele_shd.g_old_rec.attribute14;
864 End If;
865 If (p_rec.attribute15 = hr_api.g_varchar2) then
866 p_rec.attribute15 :=
867 pay_ele_shd.g_old_rec.attribute15;
868 End If;
869 If (p_rec.attribute16 = hr_api.g_varchar2) then
870 p_rec.attribute16 :=
871 pay_ele_shd.g_old_rec.attribute16;
872 End If;
873 If (p_rec.attribute17 = hr_api.g_varchar2) then
874 p_rec.attribute17 :=
875 pay_ele_shd.g_old_rec.attribute17;
876 End If;
877 If (p_rec.attribute18 = hr_api.g_varchar2) then
878 p_rec.attribute18 :=
879 pay_ele_shd.g_old_rec.attribute18;
880 End If;
881 If (p_rec.attribute19 = hr_api.g_varchar2) then
882 p_rec.attribute19 :=
883 pay_ele_shd.g_old_rec.attribute19;
884 End If;
885 If (p_rec.attribute20 = hr_api.g_varchar2) then
886 p_rec.attribute20 :=
887 pay_ele_shd.g_old_rec.attribute20;
888 End If;
889 If (p_rec.subpriority = hr_api.g_number) then
890 p_rec.subpriority :=
891 pay_ele_shd.g_old_rec.subpriority;
892 End If;
893 If (p_rec.personal_payment_method_id = hr_api.g_number) then
894 p_rec.personal_payment_method_id :=
895 pay_ele_shd.g_old_rec.personal_payment_method_id;
896 End If;
897 If (p_rec.date_earned = hr_api.g_date) then
898 p_rec.date_earned :=
899 pay_ele_shd.g_old_rec.date_earned;
900 End If;
901 If (p_rec.source_id = hr_api.g_number) then
902 p_rec.source_id :=
903 pay_ele_shd.g_old_rec.source_id;
904 End If;
905 If (p_rec.balance_adj_cost_flag = hr_api.g_varchar2) then
906 p_rec.balance_adj_cost_flag :=
907 pay_ele_shd.g_old_rec.balance_adj_cost_flag;
908 End If;
909 If (p_rec.element_type_id = hr_api.g_number) then
910 p_rec.element_type_id :=
911 pay_ele_shd.g_old_rec.element_type_id;
912 End If;
913 If (p_rec.all_entry_values_null = hr_api.g_varchar2) then
914 p_rec.all_entry_values_null :=
915 pay_ele_shd.g_old_rec.all_entry_values_null;
916 End If;
917 --
918 End convert_defs;
919 --
920 -- ----------------------------------------------------------------------------
921 -- |---------------------------------< upd >----------------------------------|
922 -- ----------------------------------------------------------------------------
923 Procedure upd
924 (p_effective_date in date
925 ,p_datetrack_mode in varchar2
926 ,p_rec in out nocopy pay_ele_shd.g_rec_type
927 ) is
928 --
929 l_proc varchar2(72) := g_package||'upd';
930 l_validation_start_date date;
931 l_validation_end_date date;
932 --
933 Begin
934 hr_utility.set_location('Entering:'||l_proc, 5);
935 --
936 -- Ensure that the DateTrack update mode is valid
937 --
938 dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
939 --
940 -- We must lock the row which we need to update.
941 --
942 pay_ele_shd.lck
943 (p_effective_date => p_effective_date
944 ,p_datetrack_mode => p_datetrack_mode
945 ,p_element_entry_id => p_rec.element_entry_id
946 ,p_object_version_number => p_rec.object_version_number
947 ,p_validation_start_date => l_validation_start_date
948 ,p_validation_end_date => l_validation_end_date
949 );
950 --
951 -- 1. During an update system defaults are used to determine if
952 -- arguments have been defaulted or not. We must therefore
953 -- derive the full record structure values to be updated.
954 --
955 -- 2. Call the supporting update validate operations.
956 --
957 pay_ele_upd.convert_defs(p_rec);
958 --
959 pay_ele_bus.update_validate
960 (p_rec => p_rec
961 ,p_effective_date => p_effective_date
962 ,p_datetrack_mode => p_datetrack_mode
963 ,p_validation_start_date => l_validation_start_date
964 ,p_validation_end_date => l_validation_end_date
965 );
966 --
967 -- Call the supporting pre-update operation
968 --
969 pre_update
970 (p_rec => p_rec
971 ,p_effective_date => p_effective_date
972 ,p_datetrack_mode => p_datetrack_mode
973 ,p_validation_start_date => l_validation_start_date
974 ,p_validation_end_date => l_validation_end_date
975 );
976 --
977 -- Update the row.
978 --
979 update_dml
980 (p_rec => p_rec
981 ,p_effective_date => p_effective_date
982 ,p_datetrack_mode => p_datetrack_mode
983 ,p_validation_start_date => l_validation_start_date
984 ,p_validation_end_date => l_validation_end_date
985 );
986 --
987 -- Call the supporting post-update operation
988 --
989 post_update
990 (p_rec => p_rec
991 ,p_effective_date => p_effective_date
992 ,p_datetrack_mode => p_datetrack_mode
993 ,p_validation_start_date => l_validation_start_date
994 ,p_validation_end_date => l_validation_end_date
995 );
996 End upd;
997 --
998 -- ----------------------------------------------------------------------------
999 -- |------------------------------< upd >-------------------------------------|
1000 -- ----------------------------------------------------------------------------
1001 Procedure upd
1002 (p_effective_date in date
1003 ,p_datetrack_mode in varchar2
1004 ,p_element_entry_id in number
1005 ,p_object_version_number in out nocopy number
1006 ,p_assignment_id in number default hr_api.g_number
1007 ,p_element_link_id in number default hr_api.g_number
1008 ,p_creator_type in varchar2 default hr_api.g_varchar2
1009 ,p_entry_type in varchar2 default hr_api.g_varchar2
1010 ,p_cost_allocation_keyflex_id in number default hr_api.g_number
1011 ,p_updating_action_id in number default hr_api.g_number
1012 ,p_updating_action_type in varchar2 default hr_api.g_varchar2
1013 ,p_original_entry_id in number default hr_api.g_number
1014 ,p_comments in varchar2 default hr_api.g_varchar2
1015 ,p_creator_id in number default hr_api.g_number
1016 ,p_reason in varchar2 default hr_api.g_varchar2
1017 ,p_target_entry_id in number default hr_api.g_number
1018 ,p_attribute_category in varchar2 default hr_api.g_varchar2
1019 ,p_attribute1 in varchar2 default hr_api.g_varchar2
1020 ,p_attribute2 in varchar2 default hr_api.g_varchar2
1021 ,p_attribute3 in varchar2 default hr_api.g_varchar2
1022 ,p_attribute4 in varchar2 default hr_api.g_varchar2
1023 ,p_attribute5 in varchar2 default hr_api.g_varchar2
1024 ,p_attribute6 in varchar2 default hr_api.g_varchar2
1025 ,p_attribute7 in varchar2 default hr_api.g_varchar2
1026 ,p_attribute8 in varchar2 default hr_api.g_varchar2
1027 ,p_attribute9 in varchar2 default hr_api.g_varchar2
1028 ,p_attribute10 in varchar2 default hr_api.g_varchar2
1029 ,p_attribute11 in varchar2 default hr_api.g_varchar2
1030 ,p_attribute12 in varchar2 default hr_api.g_varchar2
1031 ,p_attribute13 in varchar2 default hr_api.g_varchar2
1032 ,p_attribute14 in varchar2 default hr_api.g_varchar2
1033 ,p_attribute15 in varchar2 default hr_api.g_varchar2
1034 ,p_attribute16 in varchar2 default hr_api.g_varchar2
1035 ,p_attribute17 in varchar2 default hr_api.g_varchar2
1036 ,p_attribute18 in varchar2 default hr_api.g_varchar2
1037 ,p_attribute19 in varchar2 default hr_api.g_varchar2
1038 ,p_attribute20 in varchar2 default hr_api.g_varchar2
1039 ,p_subpriority in number default hr_api.g_number
1040 ,p_personal_payment_method_id in number default hr_api.g_number
1041 ,p_date_earned in date default hr_api.g_date
1042 ,p_source_id in number default hr_api.g_number
1043 ,p_balance_adj_cost_flag in varchar2 default hr_api.g_varchar2
1044 ,p_effective_start_date out nocopy date
1045 ,p_effective_end_date out nocopy date
1046 ,p_comment_id out nocopy number
1047 ) is
1048 --
1049 l_rec pay_ele_shd.g_rec_type;
1050 l_proc varchar2(72) := g_package||'upd';
1051 --
1052 Begin
1053 hr_utility.set_location('Entering:'||l_proc, 5);
1054 --
1055 -- Call conversion function to turn arguments into the
1056 -- l_rec structure.
1057 --
1058 l_rec :=
1059 pay_ele_shd.convert_args
1060 (p_element_entry_id
1061 ,null
1062 ,null
1063 ,p_cost_allocation_keyflex_id
1064 ,p_assignment_id
1065 ,p_updating_action_id
1066 ,p_updating_action_type
1067 ,p_element_link_id
1068 ,p_original_entry_id
1069 ,p_creator_type
1070 ,p_entry_type
1071 ,hr_api.g_number
1072 ,p_comments
1073 ,p_creator_id
1074 ,p_reason
1075 ,p_target_entry_id
1076 ,p_attribute_category
1077 ,p_attribute1
1078 ,p_attribute2
1079 ,p_attribute3
1080 ,p_attribute4
1081 ,p_attribute5
1082 ,p_attribute6
1083 ,p_attribute7
1084 ,p_attribute8
1085 ,p_attribute9
1086 ,p_attribute10
1087 ,p_attribute11
1088 ,p_attribute12
1089 ,p_attribute13
1090 ,p_attribute14
1091 ,p_attribute15
1092 ,p_attribute16
1093 ,p_attribute17
1094 ,p_attribute18
1095 ,p_attribute19
1096 ,p_attribute20
1097 ,p_subpriority
1098 ,p_personal_payment_method_id
1099 ,p_date_earned
1100 ,p_object_version_number
1101 ,p_source_id
1102 ,p_balance_adj_cost_flag
1103 ,hr_api.g_number
1104 ,hr_api.g_varchar2 -- p_all_entry_values_null
1105 );
1106 --
1107 -- Having converted the arguments into the
1108 -- plsql record structure we call the corresponding record
1109 -- business process.
1110 --
1111 pay_ele_upd.upd
1112 (p_effective_date
1113 ,p_datetrack_mode
1114 ,l_rec
1115 );
1116 --
1117 -- Set the out parameters
1118 --
1119 p_object_version_number := l_rec.object_version_number;
1120 p_effective_start_date := l_rec.effective_start_date;
1121 p_effective_end_date := l_rec.effective_end_date;
1122 p_comment_id := l_rec.comment_id;
1123 --
1124 hr_utility.set_location(' Leaving:'||l_proc, 10);
1125 End upd;
1126 --
1127 end pay_ele_upd;