1 Package Body pay_ivl_upd as
2 /* $Header: pyivlrhi.pkb 120.0 2005/05/29 06:04:43 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pay_ivl_upd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |----------------------------< dt_update_dml >-----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 -- This procedure controls the execution of dml from the datetrack mode
17 -- of CORRECTION only. It is important to note that the object version
18 -- number is only increment by 1 because the datetrack correction is
19 -- soley for one datetracked row.
20 -- This procedure controls the actual dml update logic. The functions of
21 -- this procedure are as follows:
22 -- 1) Get the next object_version_number.
23 -- 2) To set and unset the g_api_dml status as required (as we are about to
24 -- perform dml).
25 -- 3) To update the specified row in the schema using the primary key in
26 -- the predicates.
27 -- 4) To trap any constraint violations that may have occurred.
28 -- 5) To raise any other errors.
29 --
30 -- Prerequisites:
31 -- This is an internal private procedure which must be called from the
32 -- update_dml procedure.
33 --
34 -- In Parameters:
35 -- A Pl/Sql record structure.
36 --
37 -- Post Success:
38 -- The specified row will be updated in the schema.
39 --
40 -- Post Failure:
41 -- On the update dml failure it is important to note that we always reset the
42 -- g_api_dml status to false.
43 -- If a check or unique integrity constraint violation is raised the
44 -- constraint_error procedure will be called.
45 -- If any other error is reported, the error will be raised after the
46 -- g_api_dml status is reset.
47 --
48 -- Developer Implementation Notes:
49 -- The update 'set' arguments list should be modified if any of your
50 -- attributes are not updateable.
51 --
52 -- Access Status:
53 -- Internal Row Handler Use Only.
54 --
55 -- {End Of Comments}
56 -- ----------------------------------------------------------------------------
57 Procedure dt_update_dml
58 (p_rec in out nocopy pay_ivl_shd.g_rec_type
59 ,p_effective_date in date
60 ,p_datetrack_mode in varchar2
61 ,p_validation_start_date in date
62 ,p_validation_end_date in date
63 ) is
64 --
65 l_proc varchar2(72) := g_package||'dt_update_dml';
66 --
67 Begin
68 hr_utility.set_location('Entering:'||l_proc, 5);
69 --
70 If (p_datetrack_mode = hr_api.g_correction) then
71 hr_utility.set_location(l_proc, 10);
72 --
73 -- Because we are updating a row we must get the next object
74 -- version number.
75 --
76 p_rec.object_version_number :=
77 dt_api.get_object_version_number
78 (p_base_table_name => 'pay_input_values_f'
79 ,p_base_key_column => 'input_value_id'
80 ,p_base_key_value => p_rec.input_value_id
81 );
82 --
83 pay_ivl_shd.g_api_dml := true; -- Set the api dml status
84 --
85 -- Update the pay_input_values_f Row
86 --
87 update pay_input_values_f
88 set
89 input_value_id = p_rec.input_value_id
90 ,element_type_id = p_rec.element_type_id
91 ,lookup_type = p_rec.lookup_type
92 ,business_group_id = p_rec.business_group_id
93 ,legislation_code = p_rec.legislation_code
94 ,formula_id = p_rec.formula_id
95 ,value_set_id = p_rec.value_set_id
96 ,display_sequence = p_rec.display_sequence
97 ,generate_db_items_flag = p_rec.generate_db_items_flag
98 ,hot_default_flag = p_rec.hot_default_flag
99 ,mandatory_flag = p_rec.mandatory_flag
100 ,name = p_rec.name
101 ,uom = p_rec.uom
102 ,default_value = p_rec.default_value
103 ,legislation_subgroup = p_rec.legislation_subgroup
104 ,max_value = p_rec.max_value
105 ,min_value = p_rec.min_value
106 ,warning_or_error = p_rec.warning_or_error
107 ,object_version_number = p_rec.object_version_number
108 where input_value_id = p_rec.input_value_id
109 and effective_start_date = p_validation_start_date
110 and effective_end_date = p_validation_end_date;
111 --
112 pay_ivl_shd.g_api_dml := false; -- Unset the api dml status
113 --
114 -- Set the effective start and end dates
115 --
116 p_rec.effective_start_date := p_validation_start_date;
117 p_rec.effective_end_date := p_validation_end_date;
118 End If;
119 --
120 hr_utility.set_location(' Leaving:'||l_proc, 15);
121 Exception
122 When hr_api.check_integrity_violated Then
123 -- A check constraint has been violated
124 pay_ivl_shd.g_api_dml := false; -- Unset the api dml status
125 pay_ivl_shd.constraint_error
126 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
127 When hr_api.unique_integrity_violated Then
128 -- Unique integrity has been violated
129 pay_ivl_shd.g_api_dml := false; -- Unset the api dml status
130 pay_ivl_shd.constraint_error
131 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
132 When Others Then
133 pay_ivl_shd.g_api_dml := false; -- Unset the api dml status
134 Raise;
135 End dt_update_dml;
136 --
137 -- ----------------------------------------------------------------------------
138 -- |------------------------------< update_dml >------------------------------|
139 -- ----------------------------------------------------------------------------
140 -- {Start Of Comments}
141 --
142 -- Description:
143 -- This procedure calls the dt_update_dml control logic which handles
144 -- the actual datetrack dml.
145 --
146 -- Prerequisites:
147 -- This is an internal private procedure which must be called from the upd
148 -- procedure.
149 --
150 -- In Parameters:
151 -- A Pl/Sql record structre.
152 --
153 -- Post Success:
154 -- Processing contines.
155 --
156 -- Post Failure:
157 -- No specific error handling is required within this procedure.
158 --
159 -- Developer Implementation Notes:
160 -- The update 'set' arguments list should be modified if any of your
161 -- attributes are not updateable.
162 --
163 -- Access Status:
164 -- Internal Row Handler Use Only.
165 --
166 -- {End Of Comments}
167 -- ----------------------------------------------------------------------------
168 Procedure update_dml
169 (p_rec in out nocopy pay_ivl_shd.g_rec_type
170 ,p_effective_date in date
171 ,p_datetrack_mode in varchar2
172 ,p_validation_start_date in date
173 ,p_validation_end_date in date
174 ) is
175 --
176 l_proc varchar2(72) := g_package||'update_dml';
177 --
178 Begin
179 hr_utility.set_location('Entering:'||l_proc, 5);
180 --
181 pay_ivl_upd.dt_update_dml
182 (p_rec => p_rec
183 ,p_effective_date => p_effective_date
184 ,p_datetrack_mode => p_datetrack_mode
185 ,p_validation_start_date => p_validation_start_date
186 ,p_validation_end_date => p_validation_end_date
187 );
188 --
189 hr_utility.set_location(' Leaving:'||l_proc, 10);
190 End update_dml;
191 --
192 -- ----------------------------------------------------------------------------
193 -- |----------------------------< dt_pre_update >-----------------------------|
194 -- ----------------------------------------------------------------------------
195 -- {Start Of Comments}
196 --
197 -- Description:
198 -- The dt_pre_update procedure controls the execution
199 -- of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
200 -- and UPDATE_CHANGE_INSERT only. The execution required is as
201 -- follows:
202 --
203 -- 1) Providing the datetrack update mode is not 'CORRECTION'
204 -- then set the effective end date of the current row (this
205 -- will be the validation_start_date - 1).
206 -- 2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
207 -- corresponding delete_dml process to delete any future rows
208 -- where the effective_start_date is greater than or equal to
209 -- the validation_start_date.
210 -- 3) Call the insert_dml process to insert the new updated row
211 -- details.
212 --
213 -- Prerequisites:
214 -- This is an internal procedure which is called from the
215 -- pre_update procedure.
216 --
217 -- In Parameters:
218 --
219 -- Post Success:
220 -- Processing continues.
221 --
222 -- Post Failure:
223 -- If an error has occurred, an error message and exception will be raised
224 -- but not handled.
225 --
226 -- Developer Implementation Notes:
227 -- This is an internal procedure which is required by Datetrack. Don't
228 -- remove or modify.
229 --
230 -- Access Status:
231 -- Internal Row Handler Use Only.
232 --
233 -- {End Of Comments}
234 -- ----------------------------------------------------------------------------
235 Procedure dt_pre_update
236 (p_rec in out nocopy pay_ivl_shd.g_rec_type
237 ,p_effective_date in date
238 ,p_datetrack_mode in varchar2
239 ,p_validation_start_date in date
240 ,p_validation_end_date in date
241 ) is
242 --
243 l_proc varchar2(72) := g_package||'dt_pre_update';
244 l_dummy_version_number number;
245 --
246 Begin
247 hr_utility.set_location('Entering:'||l_proc, 5);
248 If (p_datetrack_mode <> hr_api.g_correction) then
249 --
250 -- Update the current effective end date
251 --
252 pay_ivl_shd.upd_effective_end_date
253 (p_effective_date => p_effective_date
254 ,p_base_key_value => p_rec.input_value_id
255 ,p_new_effective_end_date => (p_validation_start_date - 1)
256 ,p_validation_start_date => p_validation_start_date
257 ,p_validation_end_date => p_validation_end_date
258 ,p_object_version_number => l_dummy_version_number
259 );
260 --
261 If (p_datetrack_mode = hr_api.g_update_override) then
262 --
263 -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
264 -- delete any future rows
265 --
266 pay_ivl_del.delete_dml
267 (p_rec => p_rec
268 ,p_effective_date => p_effective_date
269 ,p_datetrack_mode => p_datetrack_mode
270 ,p_validation_start_date => p_validation_start_date
271 ,p_validation_end_date => p_validation_end_date
272 );
273 End If;
274 --
275 -- We must now insert the updated row
276 --
277 pay_ivl_ins.insert_dml
278 (p_rec => p_rec
279 ,p_effective_date => p_effective_date
280 ,p_datetrack_mode => p_datetrack_mode
281 ,p_validation_start_date => p_validation_start_date
282 ,p_validation_end_date => p_validation_end_date
283 );
284 End If;
285 hr_utility.set_location(' Leaving:'||l_proc, 20);
286 End dt_pre_update;
287 --
288 -- ----------------------------------------------------------------------------
289 -- |------------------------------< pre_update >------------------------------|
290 -- ----------------------------------------------------------------------------
291 -- {Start Of Comments}
292 --
293 -- Description:
294 -- This private procedure contains any processing which is required before
295 -- the update dml.
296 --
297 -- Prerequisites:
298 -- This is an internal procedure which is called from the upd procedure.
299 --
300 -- In Parameters:
301 -- A Pl/Sql record structure.
302 --
303 -- Post Success:
304 -- Processing continues.
305 --
306 -- Post Failure:
307 -- If an error has occurred, an error message and exception will be raised
308 -- but not handled.
309 -- Developer Implementation Notes:
310 -- Any pre-processing required before the update dml is issued should be
311 -- coded within this procedure. It is important to note that any 3rd party
312 -- maintenance should be reviewed before placing in this procedure. The call
313 -- to the dt_update_dml procedure should NOT be removed.
314 --
315 -- Access Status:
316 -- Internal Row Handler Use Only.
317 --
318 -- {End Of Comments}
319 -- ----------------------------------------------------------------------------
320 Procedure pre_update
321 (p_rec in out nocopy pay_ivl_shd.g_rec_type
322 ,p_effective_date in date
323 ,p_datetrack_mode in varchar2
324 ,p_validation_start_date in date
325 ,p_validation_end_date in date
326 ) is
327 --
328 l_proc varchar2(72) := g_package||'pre_update';
329 --
330 Begin
331 hr_utility.set_location('Entering:'||l_proc, 5);
332 --
333 --
334 --
335 dt_pre_update
336 (p_rec => p_rec
337 ,p_effective_date => p_effective_date
338 ,p_datetrack_mode => p_datetrack_mode
339 ,p_validation_start_date => p_validation_start_date
340 ,p_validation_end_date => p_validation_end_date
341 );
342 --
343 hr_utility.set_location(' Leaving:'||l_proc, 10);
344 End pre_update;
345 --
346 -- ----------------------------------------------------------------------------
347 -- |----------------------------< post_update >-------------------------------|
348 -- ----------------------------------------------------------------------------
349 -- {Start Of Comments}
350 --
351 -- Description:
352 -- This private procedure contains any processing which is required after
353 -- the update dml.
354 --
355 -- Prerequisites:
356 -- This is an internal procedure which is called from the upd procedure.
357 --
358 -- In Parameters:
359 -- A Pl/Sql record structure.
360 --
361 -- Post Success:
362 -- Processing continues.
363 --
364 -- Post Failure:
365 -- If an error has occurred, an error message and exception will be raised
366 -- but not handled.
367 --
368 -- Developer Implementation Notes:
369 -- Any post-processing required after the update dml is issued should be
370 -- coded within this procedure. It is important to note that any 3rd party
371 -- maintenance should be reviewed before placing in this procedure.
372 --
373 -- Access Status:
374 -- Internal Row Handler Use Only.
375 --
376 -- {End Of Comments}
377 -- ----------------------------------------------------------------------------
378 Procedure post_update
379 (p_rec in pay_ivl_shd.g_rec_type
380 ,p_effective_date in date
381 ,p_datetrack_mode in varchar2
382 ,p_validation_start_date in date
383 ,p_validation_end_date in date
384 ) is
385 --
386 l_proc varchar2(72) := g_package||'post_update';
387 --
388 Begin
389 hr_utility.set_location('Entering:'||l_proc, 5);
390 begin
391 --
392 pay_ivl_rku.after_update
393 (p_effective_date
394 => p_effective_date
395 ,p_datetrack_mode
396 => p_datetrack_mode
397 ,p_validation_start_date
398 => p_validation_start_date
399 ,p_validation_end_date
400 => p_validation_end_date
401 ,p_input_value_id
402 => p_rec.input_value_id
403 ,p_effective_start_date
404 => p_rec.effective_start_date
405 ,p_effective_end_date
406 => p_rec.effective_end_date
407 ,p_element_type_id
408 => p_rec.element_type_id
409 ,p_lookup_type
410 => p_rec.lookup_type
411 ,p_business_group_id
412 => p_rec.business_group_id
413 ,p_legislation_code
414 => p_rec.legislation_code
415 ,p_formula_id
416 => p_rec.formula_id
417 ,p_value_set_id
418 => p_rec.value_set_id
419 ,p_display_sequence
420 => p_rec.display_sequence
421 ,p_generate_db_items_flag
422 => p_rec.generate_db_items_flag
423 ,p_hot_default_flag
424 => p_rec.hot_default_flag
425 ,p_mandatory_flag
426 => p_rec.mandatory_flag
427 ,p_name
428 => p_rec.name
429 ,p_uom
430 => p_rec.uom
431 ,p_default_value
432 => p_rec.default_value
433 ,p_legislation_subgroup
434 => p_rec.legislation_subgroup
435 ,p_max_value
436 => p_rec.max_value
437 ,p_min_value
438 => p_rec.min_value
439 ,p_warning_or_error
440 => p_rec.warning_or_error
441 ,p_object_version_number
442 => p_rec.object_version_number
443 ,p_effective_start_date_o
444 => pay_ivl_shd.g_old_rec.effective_start_date
445 ,p_effective_end_date_o
446 => pay_ivl_shd.g_old_rec.effective_end_date
447 ,p_element_type_id_o
448 => pay_ivl_shd.g_old_rec.element_type_id
449 ,p_lookup_type_o
450 => pay_ivl_shd.g_old_rec.lookup_type
451 ,p_business_group_id_o
452 => pay_ivl_shd.g_old_rec.business_group_id
453 ,p_legislation_code_o
454 => pay_ivl_shd.g_old_rec.legislation_code
455 ,p_formula_id_o
456 => pay_ivl_shd.g_old_rec.formula_id
457 ,p_value_set_id_o
458 => pay_ivl_shd.g_old_rec.value_set_id
459 ,p_display_sequence_o
460 => pay_ivl_shd.g_old_rec.display_sequence
461 ,p_generate_db_items_flag_o
462 => pay_ivl_shd.g_old_rec.generate_db_items_flag
463 ,p_hot_default_flag_o
464 => pay_ivl_shd.g_old_rec.hot_default_flag
465 ,p_mandatory_flag_o
466 => pay_ivl_shd.g_old_rec.mandatory_flag
467 ,p_name_o
468 => pay_ivl_shd.g_old_rec.name
469 ,p_uom_o
470 => pay_ivl_shd.g_old_rec.uom
471 ,p_default_value_o
472 => pay_ivl_shd.g_old_rec.default_value
473 ,p_legislation_subgroup_o
474 => pay_ivl_shd.g_old_rec.legislation_subgroup
475 ,p_max_value_o
476 => pay_ivl_shd.g_old_rec.max_value
477 ,p_min_value_o
478 => pay_ivl_shd.g_old_rec.min_value
479 ,p_warning_or_error_o
480 => pay_ivl_shd.g_old_rec.warning_or_error
481 ,p_object_version_number_o
482 => pay_ivl_shd.g_old_rec.object_version_number
483 );
484 --
485 exception
486 --
487 when hr_api.cannot_find_prog_unit then
488 --
489 hr_api.cannot_find_prog_unit_error
490 (p_module_name => 'PAY_INPUT_VALUES_F'
491 ,p_hook_type => 'AU');
492 --
493 end;
494 --
495 hr_utility.set_location(' Leaving:'||l_proc, 10);
496 End post_update;
497 --
498 -- ----------------------------------------------------------------------------
499 -- |-----------------------------< convert_defs >-----------------------------|
500 -- ----------------------------------------------------------------------------
501 -- {Start Of Comments}
502 --
503 -- Description:
504 -- The Convert_Defs procedure has one very important function:
505 -- It must return the record structure for the row with all system defaulted
506 -- values converted into its corresponding parameter value for update. When
507 -- we attempt to update a row through the Upd process , certain
508 -- parameters can be defaulted which enables flexibility in the calling of
509 -- the upd process (e.g. only attributes which need to be updated need to be
510 -- specified). For the upd process to determine which attributes
511 -- have NOT been specified we need to check if the parameter has a reserved
512 -- system default value. Therefore, for all parameters which have a
513 -- corresponding reserved system default mechanism specified we need to
514 -- check if a system default is being used. If a system default is being
515 -- used then we convert the defaulted value into its corresponding attribute
516 -- value held in the g_old_rec data structure.
517 --
518 -- Prerequisites:
519 -- This private function can only be called from the upd process.
520 --
521 -- In Parameters:
522 -- A Pl/Sql record structure.
523 --
524 -- Post Success:
525 -- The record structure will be returned with all system defaulted parameter
526 -- values converted into its current row attribute value.
527 --
528 -- Post Failure:
529 -- No direct error handling is required within this function. Any possible
530 -- errors within this procedure will be a PL/SQL value error due to
531 -- conversion of datatypes or data lengths.
532 --
533 -- Developer Implementation Notes:
534 -- None.
535 --
536 -- Access Status:
537 -- Internal Row Handler Use Only.
538 --
539 -- {End Of Comments}
540 -- ----------------------------------------------------------------------------
541 Procedure convert_defs
542 (p_rec in out nocopy pay_ivl_shd.g_rec_type
543 ) is
544 --
545 Begin
546 --
547 -- We must now examine each argument value in the
548 -- p_rec plsql record structure
549 -- to see if a system default is being used. If a system default
550 -- is being used then we must set to the 'current' argument value.
551 --
552 If (p_rec.element_type_id = hr_api.g_number) then
553 p_rec.element_type_id :=
554 pay_ivl_shd.g_old_rec.element_type_id;
555 End If;
556 If (p_rec.lookup_type = hr_api.g_varchar2) then
557 p_rec.lookup_type :=
558 pay_ivl_shd.g_old_rec.lookup_type;
559 End If;
560 If (p_rec.business_group_id = hr_api.g_number) then
561 p_rec.business_group_id :=
562 pay_ivl_shd.g_old_rec.business_group_id;
563 End If;
564 If (p_rec.legislation_code = hr_api.g_varchar2) then
565 p_rec.legislation_code :=
566 pay_ivl_shd.g_old_rec.legislation_code;
567 End If;
568 If (p_rec.formula_id = hr_api.g_number) then
569 p_rec.formula_id :=
570 pay_ivl_shd.g_old_rec.formula_id;
571 End If;
572 If (p_rec.value_set_id = hr_api.g_number) then
573 p_rec.value_set_id :=
574 pay_ivl_shd.g_old_rec.value_set_id;
575 End If;
576 If (p_rec.display_sequence = hr_api.g_number) then
577 p_rec.display_sequence :=
578 pay_ivl_shd.g_old_rec.display_sequence;
579 End If;
580 If (p_rec.generate_db_items_flag = hr_api.g_varchar2) then
581 p_rec.generate_db_items_flag :=
582 pay_ivl_shd.g_old_rec.generate_db_items_flag;
583 End If;
584 If (p_rec.hot_default_flag = hr_api.g_varchar2) then
585 p_rec.hot_default_flag :=
586 pay_ivl_shd.g_old_rec.hot_default_flag;
587 End If;
588 If (p_rec.mandatory_flag = hr_api.g_varchar2) then
589 p_rec.mandatory_flag :=
590 pay_ivl_shd.g_old_rec.mandatory_flag;
591 End If;
592 If (p_rec.name = hr_api.g_varchar2) then
593 p_rec.name :=
594 pay_ivl_shd.g_old_rec.name;
595 End If;
596 If (p_rec.uom = hr_api.g_varchar2) then
597 p_rec.uom :=
598 pay_ivl_shd.g_old_rec.uom;
599 End If;
600 If (p_rec.default_value = hr_api.g_varchar2) then
601 p_rec.default_value :=
602 pay_ivl_shd.g_old_rec.default_value;
603 End If;
604 If (p_rec.legislation_subgroup = hr_api.g_varchar2) then
605 p_rec.legislation_subgroup :=
606 pay_ivl_shd.g_old_rec.legislation_subgroup;
607 End If;
608 If (p_rec.max_value = hr_api.g_varchar2) then
609 p_rec.max_value :=
610 pay_ivl_shd.g_old_rec.max_value;
611 End If;
612 If (p_rec.min_value = hr_api.g_varchar2) then
613 p_rec.min_value :=
614 pay_ivl_shd.g_old_rec.min_value;
615 End If;
616 If (p_rec.warning_or_error = hr_api.g_varchar2) then
617 p_rec.warning_or_error :=
618 pay_ivl_shd.g_old_rec.warning_or_error;
619 End If;
620 --
621 End convert_defs;
622 --
623 -- ----------------------------------------------------------------------------
624 -- |---------------------------------< upd >----------------------------------|
625 -- ----------------------------------------------------------------------------
626 Procedure upd
627 (p_effective_date in date
628 ,p_datetrack_mode in varchar2
629 ,p_rec in out nocopy pay_ivl_shd.g_rec_type
630 ,p_default_val_warning out nocopy boolean
631 ,p_min_max_warning out nocopy boolean
632 ,p_link_inp_val_warning out nocopy boolean
633 ,p_pay_basis_warning out nocopy boolean
634 ,p_formula_warning out nocopy boolean
635 ,p_assignment_id_warning out nocopy boolean
636 ,p_formula_message out nocopy varchar2
637 ) is
638 --
639 l_proc varchar2(72) := g_package||'upd';
640 l_validation_start_date date;
641 l_validation_end_date date;
642
643 l_datetrack_mode varchar2(100) := p_datetrack_mode;
644 --
645 Begin
646 hr_utility.set_location('Entering:'||l_proc, 5);
647 --
648 -- Ensure that the DateTrack update mode is valid
649 --
650 dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
651 --
652 -- We must lock the row which we need to update.
653 --
654 pay_ivl_shd.lck
655 (p_effective_date => p_effective_date
656 ,p_datetrack_mode => p_datetrack_mode
657 ,p_input_value_id => p_rec.input_value_id
658 ,p_object_version_number => p_rec.object_version_number
659 ,p_validation_start_date => l_validation_start_date
660 ,p_validation_end_date => l_validation_end_date
661 );
662 --
663 -- 1. During an update system defaults are used to determine if
664 -- arguments have been defaulted or not. We must therefore
665 -- derive the full record structure values to be updated.
666 --
667 -- 2. Call the supporting update validate operations.
668 --
669 pay_ivl_upd.convert_defs(p_rec);
670 --
671 pay_ivl_bus.update_validate
672 (p_rec => p_rec
673 ,p_effective_date => p_effective_date
674 ,p_datetrack_mode => l_datetrack_mode
675 ,p_validation_start_date => l_validation_start_date
676 ,p_validation_end_date => l_validation_end_date
677 ,p_default_val_warning => p_default_val_warning
678 ,p_min_max_warning => p_min_max_warning
679 ,p_link_inp_val_warning => p_link_inp_val_warning
680 ,p_pay_basis_warning => p_pay_basis_warning
681 ,p_formula_warning => p_formula_warning
682 ,p_assignment_id_warning => p_assignment_id_warning
683 ,p_formula_message => p_formula_message
684 );
685 --
686 -- Call to raise any errors on multi-message list
687 hr_multi_message.end_validation_set;
688 --
689 -- Call the supporting pre-update operation
690 --
691 pre_update
692 (p_rec => p_rec
693 ,p_effective_date => p_effective_date
694 ,p_datetrack_mode => l_datetrack_mode
695 ,p_validation_start_date => l_validation_start_date
696 ,p_validation_end_date => l_validation_end_date
697 );
698 --
699 -- Update the row.
700 --
701 update_dml
702 (p_rec => p_rec
703 ,p_effective_date => p_effective_date
704 ,p_datetrack_mode => l_datetrack_mode
705 ,p_validation_start_date => l_validation_start_date
706 ,p_validation_end_date => l_validation_end_date
707 );
708 --
709 -- Call the supporting post-update operation
710 --
711 post_update
712 (p_rec => p_rec
713 ,p_effective_date => p_effective_date
714 ,p_datetrack_mode => l_datetrack_mode
715 ,p_validation_start_date => l_validation_start_date
716 ,p_validation_end_date => l_validation_end_date
717 );
718
719 if pay_ivl_shd.g_old_rec.name <> p_rec.name or pay_ivl_shd.g_old_rec.uom <> p_rec.uom
720 or pay_ivl_shd.g_old_rec.generate_db_items_flag <> p_rec.generate_db_items_flag then
721 pay_input_values_pkg.recreate_db_items(p_rec.element_type_id);
722 end if;
723 --
724 -- Call to raise any errors on multi-message list
725 hr_multi_message.end_validation_set;
726 End upd;
727 --
728 -- ----------------------------------------------------------------------------
729 -- |------------------------------< upd >-------------------------------------|
730 -- ----------------------------------------------------------------------------
731 Procedure upd
732 (p_effective_date in date
733 ,p_datetrack_mode in varchar2
734 ,p_input_value_id in number
735 ,p_object_version_number in out nocopy number
736 ,p_element_type_id in number default hr_api.g_number
737 ,p_display_sequence in number default hr_api.g_number
738 ,p_generate_db_items_flag in varchar2 default hr_api.g_varchar2
739 ,p_hot_default_flag in varchar2 default hr_api.g_varchar2
740 ,p_mandatory_flag in varchar2 default hr_api.g_varchar2
741 ,p_name in varchar2 default hr_api.g_varchar2
742 ,p_uom in varchar2 default hr_api.g_varchar2
743 ,p_lookup_type in varchar2 default hr_api.g_varchar2
744 ,p_business_group_id in number default hr_api.g_number
745 ,p_legislation_code in varchar2 default hr_api.g_varchar2
746 ,p_formula_id in number default hr_api.g_number
747 ,p_value_set_id in number default hr_api.g_number
748 ,p_default_value in varchar2 default hr_api.g_varchar2
749 ,p_legislation_subgroup in varchar2 default hr_api.g_varchar2
750 ,p_max_value in varchar2 default hr_api.g_varchar2
751 ,p_min_value in varchar2 default hr_api.g_varchar2
752 ,p_warning_or_error in varchar2 default hr_api.g_varchar2
753 ,p_effective_start_date out nocopy date
754 ,p_effective_end_date out nocopy date
755 ,p_default_val_warning out nocopy boolean
756 ,p_min_max_warning out nocopy boolean
757 ,p_link_inp_val_warning out nocopy boolean
758 ,p_pay_basis_warning out nocopy boolean
759 ,p_formula_warning out nocopy boolean
760 ,p_assignment_id_warning out nocopy boolean
761 ,p_formula_message out nocopy varchar2
762
763 ) is
764 --
765 l_rec pay_ivl_shd.g_rec_type;
766 l_proc varchar2(72) := g_package||'upd';
767 --
768 Begin
769 hr_utility.set_location('Entering:'||l_proc, 5);
770 --
771 -- Call conversion function to turn arguments into the
772 -- l_rec structure.
773 --
774 l_rec :=
775 pay_ivl_shd.convert_args
776 (p_input_value_id
777 ,null
778 ,null
779 ,p_element_type_id
780 ,p_lookup_type
781 ,p_business_group_id
782 ,p_legislation_code
783 ,p_formula_id
784 ,p_value_set_id
785 ,p_display_sequence
786 ,p_generate_db_items_flag
787 ,p_hot_default_flag
788 ,p_mandatory_flag
789 ,p_name
790 ,p_uom
791 ,p_default_value
792 ,p_legislation_subgroup
793 ,p_max_value
794 ,p_min_value
795 ,p_warning_or_error
796 ,p_object_version_number
797 );
798 --
799 -- Having converted the arguments into the
800 -- plsql record structure we call the corresponding record
801 -- business process.
802 --
803 pay_ivl_upd.upd
804 (p_effective_date
805 ,p_datetrack_mode
806 ,l_rec
807 ,p_default_val_warning
808 ,p_min_max_warning
809 ,p_link_inp_val_warning
810 ,p_pay_basis_warning
811 ,p_formula_warning
812 ,p_assignment_id_warning
813 ,p_formula_message
814 );
815 --
816 -- Set the out parameters
817 --
818 p_object_version_number := l_rec.object_version_number;
819 p_effective_start_date := l_rec.effective_start_date;
820 p_effective_end_date := l_rec.effective_end_date;
821 --
822 pay_ivt_upd.upd_tl
823 (p_language_code => userenv('LANG')
824 ,p_input_value_id => p_input_value_id
825 ,p_name => p_name
826 );
827
828 --
829 hr_utility.set_location(' Leaving:'||l_proc, 10);
830 End upd;
831 --
832 end pay_ivl_upd;