1 Package Body pay_ipd_upd as
2 /* $Header: pyipdrhi.pkb 120.2 2005/09/30 06:49:56 vikgupta noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pay_ipd_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_ipd_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_ie_paye_details_f'
79 ,p_base_key_column => 'paye_details_id'
80 ,p_base_key_value => p_rec.paye_details_id
81 );
82 --
83 --
84 --
85 -- Update the pay_ie_paye_details_f Row
86 --
87 update pay_ie_paye_details_f
88 set
89 paye_details_id = p_rec.paye_details_id
90 ,object_version_number = p_rec.object_version_number
91 ,assignment_id = p_rec.assignment_id
92 ,info_source = p_rec.info_source
93 ,comm_period_no = p_rec.comm_period_no
94 ,tax_basis = p_rec.tax_basis
95 ,certificate_start_date = p_rec.certificate_start_date
96 ,certificate_end_date = p_rec.certificate_end_date
97 ,tax_assess_basis = p_rec.tax_assess_basis
98 ,weekly_tax_credit = p_rec.weekly_tax_credit
99 ,weekly_std_rate_cut_off = p_rec.weekly_std_rate_cut_off
100 ,monthly_tax_credit = p_rec.monthly_tax_credit
101 ,monthly_std_rate_cut_off = p_rec.monthly_std_rate_cut_off
102 ,request_id = p_rec.request_id
103 ,program_application_id = p_rec.program_application_id
104 ,program_id = p_rec.program_id
105 ,program_update_date = p_rec.program_update_date
106 ,certificate_issue_date = p_rec.certificate_issue_date
107 where paye_details_id = p_rec.paye_details_id
108 and effective_start_date = p_validation_start_date
109 and effective_end_date = p_validation_end_date;
110 --
111 --
112 --
113 -- Set the effective start and end dates
114 --
115 p_rec.effective_start_date := p_validation_start_date;
116 p_rec.effective_end_date := p_validation_end_date;
117 End If;
118 --
119 hr_utility.set_location(' Leaving:'||l_proc, 15);
120 Exception
121 When hr_api.check_integrity_violated Then
122 -- A check constraint has been violated
123 --
124 pay_ipd_shd.constraint_error
125 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
126 When hr_api.unique_integrity_violated Then
127 -- Unique integrity has been violated
128 --
129 pay_ipd_shd.constraint_error
130 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
131 When Others Then
132 --
133 Raise;
134 End dt_update_dml;
135 --
136 -- ----------------------------------------------------------------------------
137 -- |------------------------------< update_dml >------------------------------|
138 -- ----------------------------------------------------------------------------
139 -- {Start Of Comments}
140 --
141 -- Description:
142 -- This procedure calls the dt_update_dml control logic which handles
143 -- the actual datetrack dml.
144 --
145 -- Prerequisites:
146 -- This is an internal private procedure which must be called from the upd
147 -- procedure.
148 --
149 -- In Parameters:
150 -- A Pl/Sql record structre.
151 --
152 -- Post Success:
153 -- Processing contines.
154 --
155 -- Post Failure:
156 -- No specific error handling is required within this procedure.
157 --
158 -- Developer Implementation Notes:
159 -- The update 'set' arguments list should be modified if any of your
160 -- attributes are not updateable.
161 --
162 -- Access Status:
163 -- Internal Row Handler Use Only.
164 --
165 -- {End Of Comments}
166 -- ----------------------------------------------------------------------------
167 Procedure update_dml
168 (p_rec in out nocopy pay_ipd_shd.g_rec_type
169 ,p_effective_date in date
170 ,p_datetrack_mode in varchar2
171 ,p_validation_start_date in date
172 ,p_validation_end_date in date
173 ) is
174 --
175 l_proc varchar2(72) := g_package||'update_dml';
176 --
177 Begin
178 hr_utility.set_location('Entering:'||l_proc, 5);
179 --
180 pay_ipd_upd.dt_update_dml
181 (p_rec => p_rec
182 ,p_effective_date => p_effective_date
183 ,p_datetrack_mode => p_datetrack_mode
184 ,p_validation_start_date => p_validation_start_date
185 ,p_validation_end_date => p_validation_end_date
186 );
187 --
188 hr_utility.set_location(' Leaving:'||l_proc, 10);
189 End update_dml;
190 --
191 -- ----------------------------------------------------------------------------
192 -- |----------------------------< dt_pre_update >-----------------------------|
193 -- ----------------------------------------------------------------------------
194 -- {Start Of Comments}
195 --
196 -- Description:
197 -- The dt_pre_update procedure controls the execution
198 -- of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
199 -- and UPDATE_CHANGE_INSERT only. The execution required is as
200 -- follows:
201 --
202 -- 1) Providing the datetrack update mode is not 'CORRECTION'
203 -- then set the effective end date of the current row (this
204 -- will be the validation_start_date - 1).
205 -- 2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
206 -- corresponding delete_dml process to delete any future rows
207 -- where the effective_start_date is greater than or equal to
208 -- the validation_start_date.
209 -- 3) Call the insert_dml process to insert the new updated row
210 -- details.
211 --
212 -- Prerequisites:
213 -- This is an internal procedure which is called from the
214 -- pre_update procedure.
215 --
216 -- In Parameters:
217 --
218 -- Post Success:
219 -- Processing continues.
220 --
221 -- Post Failure:
222 -- If an error has occurred, an error message and exception will be raised
223 -- but not handled.
224 --
225 -- Developer Implementation Notes:
226 -- This is an internal procedure which is required by Datetrack. Don't
227 -- remove or modify.
228 --
229 -- Access Status:
230 -- Internal Row Handler Use Only.
231 --
232 -- {End Of Comments}
233 -- ----------------------------------------------------------------------------
234 Procedure dt_pre_update
235 (p_rec in out nocopy pay_ipd_shd.g_rec_type
236 ,p_effective_date in date
237 ,p_datetrack_mode in varchar2
238 ,p_validation_start_date in date
239 ,p_validation_end_date in date
240 ) is
241 --
242 l_proc varchar2(72) := g_package||'dt_pre_update';
243 l_dummy_version_number number;
244 --
245 Begin
246 hr_utility.set_location('Entering:'||l_proc, 5);
247 If (p_datetrack_mode <> hr_api.g_correction) then
248 --
249 -- Update the current effective end date
250 --
251 pay_ipd_shd.upd_effective_end_date
252 (p_effective_date => p_effective_date
253 ,p_base_key_value => p_rec.paye_details_id
254 ,p_new_effective_end_date => (p_validation_start_date - 1)
255 ,p_validation_start_date => p_validation_start_date
256 ,p_validation_end_date => p_validation_end_date
257 ,p_object_version_number => l_dummy_version_number
258 );
259 --
260 If (p_datetrack_mode = hr_api.g_update_override) then
261 --
262 -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
263 -- delete any future rows
264 --
265 pay_ipd_del.delete_dml
266 (p_rec => p_rec
267 ,p_effective_date => p_effective_date
268 ,p_datetrack_mode => p_datetrack_mode
269 ,p_validation_start_date => p_validation_start_date
270 ,p_validation_end_date => p_validation_end_date
271 );
272 End If;
273 --
274 -- We must now insert the updated row
275 --
276 pay_ipd_ins.insert_dml
277 (p_rec => p_rec
278 ,p_effective_date => p_effective_date
279 ,p_datetrack_mode => p_datetrack_mode
280 ,p_validation_start_date => p_validation_start_date
281 ,p_validation_end_date => p_validation_end_date
282 );
283 End If;
284 hr_utility.set_location(' Leaving:'||l_proc, 20);
285 End dt_pre_update;
286 --
287 -- ----------------------------------------------------------------------------
288 -- |------------------------------< pre_update >------------------------------|
289 -- ----------------------------------------------------------------------------
290 -- {Start Of Comments}
291 --
292 -- Description:
293 -- This private procedure contains any processing which is required before
294 -- the update dml.
295 --
296 -- Prerequisites:
297 -- This is an internal procedure which is called from the upd procedure.
298 --
299 -- In Parameters:
300 -- A Pl/Sql record structure.
301 --
302 -- Post Success:
303 -- Processing continues.
304 --
305 -- Post Failure:
306 -- If an error has occurred, an error message and exception will be raised
307 -- but not handled.
308 -- Developer Implementation Notes:
309 -- Any pre-processing required before the update dml is issued should be
310 -- coded within this procedure. It is important to note that any 3rd party
311 -- maintenance should be reviewed before placing in this procedure. The call
312 -- to the dt_update_dml procedure should NOT be removed.
313 --
314 -- Access Status:
315 -- Internal Row Handler Use Only.
316 --
317 -- {End Of Comments}
318 -- ----------------------------------------------------------------------------
319 Procedure pre_update
320 (p_rec in out nocopy pay_ipd_shd.g_rec_type
321 ,p_effective_date in date
322 ,p_datetrack_mode in varchar2
323 ,p_validation_start_date in date
324 ,p_validation_end_date in date
325 ) is
326 --
327 l_proc varchar2(72) := g_package||'pre_update';
328 --
329 Begin
330 hr_utility.set_location('Entering:'||l_proc, 5);
331 --
332 --
333 --
334 dt_pre_update
335 (p_rec => p_rec
336 ,p_effective_date => p_effective_date
337 ,p_datetrack_mode => p_datetrack_mode
338 ,p_validation_start_date => p_validation_start_date
339 ,p_validation_end_date => p_validation_end_date
340 );
341 --
342 hr_utility.set_location(' Leaving:'||l_proc, 10);
343 End pre_update;
344 --
345 -- ----------------------------------------------------------------------------
346 -- |----------------------------< post_update >-------------------------------|
347 -- ----------------------------------------------------------------------------
348 -- {Start Of Comments}
349 --
350 -- Description:
351 -- This private procedure contains any processing which is required after
352 -- the update dml.
353 --
354 -- Prerequisites:
355 -- This is an internal procedure which is called from the upd procedure.
356 --
357 -- In Parameters:
358 -- A Pl/Sql record structure.
359 --
360 -- Post Success:
361 -- Processing continues.
362 --
363 -- Post Failure:
364 -- If an error has occurred, an error message and exception will be raised
365 -- but not handled.
366 --
367 -- Developer Implementation Notes:
368 -- Any post-processing required after the update dml is issued should be
369 -- coded within this procedure. It is important to note that any 3rd party
370 -- maintenance should be reviewed before placing in this procedure.
371 --
372 -- Access Status:
373 -- Internal Row Handler Use Only.
374 --
375 -- {End Of Comments}
376 -- ----------------------------------------------------------------------------
377 Procedure post_update
378 (p_rec in pay_ipd_shd.g_rec_type
379 ,p_effective_date in date
380 ,p_datetrack_mode in varchar2
381 ,p_validation_start_date in date
382 ,p_validation_end_date in date
383 ) is
384 --
385 l_proc varchar2(72) := g_package||'post_update';
386 --
387 Begin
388 hr_utility.set_location('Entering:'||l_proc, 5);
389 begin
390 --
391 pay_ipd_rku.after_update
392 (p_effective_date
393 => p_effective_date
394 ,p_datetrack_mode
395 => p_datetrack_mode
396 ,p_validation_start_date
397 => p_validation_start_date
398 ,p_validation_end_date
399 => p_validation_end_date
400 ,p_paye_details_id
401 => p_rec.paye_details_id
402 ,p_effective_start_date
403 => p_rec.effective_start_date
404 ,p_effective_end_date
405 => p_rec.effective_end_date
406 ,p_object_version_number
407 => p_rec.object_version_number
408 ,p_assignment_id
409 => p_rec.assignment_id
410 ,p_info_source
411 => p_rec.info_source
412 ,p_comm_period_no
413 => p_rec.comm_period_no
414 ,p_tax_basis
415 => p_rec.tax_basis
416 ,p_certificate_start_date
417 => p_rec.certificate_start_date
418 ,p_certificate_end_date
419 => p_rec.certificate_end_date
420 ,p_tax_assess_basis
421 => p_rec.tax_assess_basis
422 ,p_weekly_tax_credit
423 => p_rec.weekly_tax_credit
424 ,p_weekly_std_rate_cut_off
425 => p_rec.weekly_std_rate_cut_off
426 ,p_monthly_tax_credit
427 => p_rec.monthly_tax_credit
428 ,p_monthly_std_rate_cut_off
429 => p_rec.monthly_std_rate_cut_off
430 ,p_request_id
431 => p_rec.request_id
432 ,p_program_application_id
433 => p_rec.program_application_id
434 ,p_program_id
435 => p_rec.program_id
436 ,p_program_update_date
437 => p_rec.program_update_date
438 ,p_certificate_issue_date
439 => p_rec.certificate_issue_date
440 ,p_effective_start_date_o
441 => pay_ipd_shd.g_old_rec.effective_start_date
442 ,p_effective_end_date_o
443 => pay_ipd_shd.g_old_rec.effective_end_date
444 ,p_object_version_number_o
445 => pay_ipd_shd.g_old_rec.object_version_number
446 ,p_assignment_id_o
447 => pay_ipd_shd.g_old_rec.assignment_id
448 ,p_info_source_o
449 => pay_ipd_shd.g_old_rec.info_source
450 ,p_comm_period_no_o
451 => pay_ipd_shd.g_old_rec.comm_period_no
452 ,p_tax_basis_o
453 => pay_ipd_shd.g_old_rec.tax_basis
454 ,p_certificate_start_date_o
455 => pay_ipd_shd.g_old_rec.certificate_start_date
456 ,p_certificate_end_date_o
457 => pay_ipd_shd.g_old_rec.certificate_end_date
458 ,p_tax_assess_basis_o
459 => pay_ipd_shd.g_old_rec.tax_assess_basis
460 ,p_weekly_tax_credit_o
461 => pay_ipd_shd.g_old_rec.weekly_tax_credit
462 ,p_weekly_std_rate_cut_off_o
463 => pay_ipd_shd.g_old_rec.weekly_std_rate_cut_off
464 ,p_monthly_tax_credit_o
465 => pay_ipd_shd.g_old_rec.monthly_tax_credit
466 ,p_monthly_std_rate_cut_off_o
467 => pay_ipd_shd.g_old_rec.monthly_std_rate_cut_off
468 ,p_request_id_o
469 => pay_ipd_shd.g_old_rec.request_id
470 ,p_program_application_id_o
471 => pay_ipd_shd.g_old_rec.program_application_id
472 ,p_program_id_o
473 => pay_ipd_shd.g_old_rec.program_id
474 ,p_program_update_date_o
475 => pay_ipd_shd.g_old_rec.program_update_date
476 ,p_certificate_issue_date_o
477 => pay_ipd_shd.g_old_rec.certificate_issue_date
478 );
479 --
480 exception
481 --
482 when hr_api.cannot_find_prog_unit then
483 --
484 hr_api.cannot_find_prog_unit_error
485 (p_module_name => 'PAY_IE_PAYE_DETAILS_F'
486 ,p_hook_type => 'AU');
487 --
488 end;
489 --
490 hr_utility.set_location(' Leaving:'||l_proc, 10);
491 End post_update;
492 --
493 -- ----------------------------------------------------------------------------
494 -- |-----------------------------< convert_defs >-----------------------------|
495 -- ----------------------------------------------------------------------------
496 -- {Start Of Comments}
497 --
498 -- Description:
499 -- The Convert_Defs procedure has one very important function:
500 -- It must return the record structure for the row with all system defaulted
501 -- values converted into its corresponding parameter value for update. When
502 -- we attempt to update a row through the Upd process , certain
503 -- parameters can be defaulted which enables flexibility in the calling of
504 -- the upd process (e.g. only attributes which need to be updated need to be
505 -- specified). For the upd process to determine which attributes
506 -- have NOT been specified we need to check if the parameter has a reserved
507 -- system default value. Therefore, for all parameters which have a
508 -- corresponding reserved system default mechanism specified we need to
509 -- check if a system default is being used. If a system default is being
510 -- used then we convert the defaulted value into its corresponding attribute
511 -- value held in the g_old_rec data structure.
512 --
513 -- Prerequisites:
514 -- This private function can only be called from the upd process.
515 --
516 -- In Parameters:
517 -- A Pl/Sql record structure.
518 --
519 -- Post Success:
520 -- The record structure will be returned with all system defaulted parameter
521 -- values converted into its current row attribute value.
522 --
523 -- Post Failure:
524 -- No direct error handling is required within this function. Any possible
525 -- errors within this procedure will be a PL/SQL value error due to
526 -- conversion of datatypes or data lengths.
527 --
528 -- Developer Implementation Notes:
529 -- None.
530 --
531 -- Access Status:
532 -- Internal Row Handler Use Only.
533 --
534 -- {End Of Comments}
535 -- ----------------------------------------------------------------------------
536 Procedure convert_defs
537 (p_rec in out nocopy pay_ipd_shd.g_rec_type
538 ) is
539 --
540 Begin
541 --
542 -- We must now examine each argument value in the
543 -- p_rec plsql record structure
544 -- to see if a system default is being used. If a system default
545 -- is being used then we must set to the 'current' argument value.
546 --
547 If (p_rec.assignment_id = hr_api.g_number) then
548 p_rec.assignment_id :=
549 pay_ipd_shd.g_old_rec.assignment_id;
550 End If;
551 If (p_rec.info_source = hr_api.g_varchar2) then
552 p_rec.info_source :=
553 pay_ipd_shd.g_old_rec.info_source;
554 End If;
555 If (p_rec.comm_period_no = hr_api.g_number) then
556 p_rec.comm_period_no :=
557 pay_ipd_shd.g_old_rec.comm_period_no;
558 End If;
559 If (p_rec.tax_basis = hr_api.g_varchar2) then
560 p_rec.tax_basis :=
561 pay_ipd_shd.g_old_rec.tax_basis;
562 End If;
563 If (p_rec.certificate_start_date = hr_api.g_date) then
564 p_rec.certificate_start_date :=
565 pay_ipd_shd.g_old_rec.certificate_start_date;
566 End If;
567 If (p_rec.certificate_end_date = hr_api.g_date) then
568 p_rec.certificate_end_date :=
569 pay_ipd_shd.g_old_rec.certificate_end_date;
570 End If;
571 If (p_rec.tax_assess_basis = hr_api.g_varchar2) then
572 p_rec.tax_assess_basis :=
573 pay_ipd_shd.g_old_rec.tax_assess_basis;
574 End If;
575 If (p_rec.weekly_tax_credit = hr_api.g_number) then
576 p_rec.weekly_tax_credit :=
577 pay_ipd_shd.g_old_rec.weekly_tax_credit;
578 End If;
579 If (p_rec.weekly_std_rate_cut_off = hr_api.g_number) then
580 p_rec.weekly_std_rate_cut_off :=
581 pay_ipd_shd.g_old_rec.weekly_std_rate_cut_off;
582 End If;
583 If (p_rec.monthly_tax_credit = hr_api.g_number) then
584 p_rec.monthly_tax_credit :=
585 pay_ipd_shd.g_old_rec.monthly_tax_credit;
586 End If;
587 If (p_rec.monthly_std_rate_cut_off = hr_api.g_number) then
588 p_rec.monthly_std_rate_cut_off :=
589 pay_ipd_shd.g_old_rec.monthly_std_rate_cut_off;
590 End If;
591 If (p_rec.request_id = hr_api.g_number) then
592 p_rec.request_id :=
593 pay_ipd_shd.g_old_rec.request_id;
594 End If;
595 If (p_rec.program_application_id = hr_api.g_number) then
596 p_rec.program_application_id :=
597 pay_ipd_shd.g_old_rec.program_application_id;
598 End If;
599 If (p_rec.program_id = hr_api.g_number) then
600 p_rec.program_id :=
601 pay_ipd_shd.g_old_rec.program_id;
602 End If;
603 If (p_rec.program_update_date = hr_api.g_date) then
604 p_rec.program_update_date :=
605 pay_ipd_shd.g_old_rec.program_update_date;
606 End If;
607 If (p_rec.certificate_issue_date = hr_api.g_date) then
608 p_rec.certificate_issue_date :=
609 pay_ipd_shd.g_old_rec.certificate_issue_date;
610 End If;
611 --
612 End convert_defs;
613 --
614 -- ----------------------------------------------------------------------------
615 -- |---------------------------------< upd >----------------------------------|
616 -- ----------------------------------------------------------------------------
617 Procedure upd
618 (p_effective_date in date
619 ,p_datetrack_mode in varchar2
620 ,p_rec in out nocopy pay_ipd_shd.g_rec_type
621 ) is
622 --
623 l_proc varchar2(72) := g_package||'upd';
624 l_validation_start_date date;
625 l_validation_end_date date;
626 --
627 Begin
628 hr_utility.set_location('Entering:'||l_proc, 5);
629 --
630 -- Ensure that the DateTrack update mode is valid
631 --
632 dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
633 --
634 -- We must lock the row which we need to update.
635 --
636 pay_ipd_shd.lck
637 (p_effective_date => p_effective_date
638 ,p_datetrack_mode => p_datetrack_mode
639 ,p_paye_details_id => p_rec.paye_details_id
640 ,p_object_version_number => p_rec.object_version_number
641 ,p_validation_start_date => l_validation_start_date
642 ,p_validation_end_date => l_validation_end_date
643 );
644 --
645 -- 1. During an update system defaults are used to determine if
646 -- arguments have been defaulted or not. We must therefore
647 -- derive the full record structure values to be updated.
648 --
649 -- 2. Call the supporting update validate operations.
650 --
651 pay_ipd_upd.convert_defs(p_rec);
652 --
653 pay_ipd_bus.update_validate
654 (p_rec => p_rec
655 ,p_effective_date => p_effective_date
656 ,p_datetrack_mode => p_datetrack_mode
657 ,p_validation_start_date => l_validation_start_date
658 ,p_validation_end_date => l_validation_end_date
659 );
660 --
661 -- Call the supporting pre-update operation
662 --
663 pre_update
664 (p_rec => p_rec
665 ,p_effective_date => p_effective_date
666 ,p_datetrack_mode => p_datetrack_mode
667 ,p_validation_start_date => l_validation_start_date
668 ,p_validation_end_date => l_validation_end_date
669 );
670 --
671 -- Update the row.
672 --
673 update_dml
674 (p_rec => p_rec
675 ,p_effective_date => p_effective_date
676 ,p_datetrack_mode => p_datetrack_mode
677 ,p_validation_start_date => l_validation_start_date
678 ,p_validation_end_date => l_validation_end_date
679 );
680 --
681 -- Call the supporting post-update operation
682 --
683 post_update
684 (p_rec => p_rec
685 ,p_effective_date => p_effective_date
686 ,p_datetrack_mode => p_datetrack_mode
687 ,p_validation_start_date => l_validation_start_date
688 ,p_validation_end_date => l_validation_end_date
689 );
690 End upd;
691 --
692 -- ----------------------------------------------------------------------------
693 -- |------------------------------< upd >-------------------------------------|
694 -- ----------------------------------------------------------------------------
695 Procedure upd
696 (p_effective_date in date
697 ,p_datetrack_mode in varchar2
698 ,p_paye_details_id in number
699 ,p_object_version_number in out nocopy number
700 ,p_info_source in varchar2 default hr_api.g_varchar2
701 ,p_tax_basis in varchar2 default hr_api.g_varchar2
702 ,p_certificate_start_date in date default hr_api.g_date
703 ,p_tax_assess_basis in varchar2 default hr_api.g_varchar2
704 ,p_certificate_end_date in date default hr_api.g_date
705 ,p_weekly_tax_credit in number default hr_api.g_number
706 ,p_weekly_std_rate_cut_off in number default hr_api.g_number
707 ,p_monthly_tax_credit in number default hr_api.g_number
708 ,p_monthly_std_rate_cut_off in number default hr_api.g_number
709 ,p_request_id in number default hr_api.g_number
710 ,p_program_application_id in number default hr_api.g_number
711 ,p_program_id in number default hr_api.g_number
712 ,p_program_update_date in date default hr_api.g_date
713 ,p_certificate_issue_date in date default hr_api.g_date
714 ,p_effective_start_date out nocopy date
715 ,p_effective_end_date out nocopy date
716 ) is
717 --
718 l_rec pay_ipd_shd.g_rec_type;
719 l_proc varchar2(72) := g_package||'upd';
720 --
721 Begin
722 hr_utility.set_location('Entering:'||l_proc, 5);
723 --
724 -- Call conversion function to turn arguments into the
725 -- l_rec structure.
726 --
727 l_rec :=
728 pay_ipd_shd.convert_args
729 (p_paye_details_id
730 ,null
731 ,null
732 ,p_object_version_number
733 ,hr_api.g_number
734 ,p_info_source
735 ,hr_api.g_number
736 ,p_tax_basis
737 ,p_certificate_start_date
738 ,p_certificate_end_date
739 ,p_tax_assess_basis
740 ,p_weekly_tax_credit
741 ,p_weekly_std_rate_cut_off
742 ,p_monthly_tax_credit
743 ,p_monthly_std_rate_cut_off
744 ,p_request_id
745 ,p_program_application_id
746 ,p_program_id
747 ,p_program_update_date
748 ,p_certificate_issue_date
749 );
750 --
751 -- Having converted the arguments into the
752 -- plsql record structure we call the corresponding record
753 -- business process.
754 --
755 pay_ipd_upd.upd
756 (p_effective_date
757 ,p_datetrack_mode
758 ,l_rec
759 );
760 --
761 -- Set the out parameters
762 --
763 p_object_version_number := l_rec.object_version_number;
764 p_effective_start_date := l_rec.effective_start_date;
765 p_effective_end_date := l_rec.effective_end_date;
766 --
767 --
768 hr_utility.set_location(' Leaving:'||l_proc, 10);
769 End upd;
770 --
771 end pay_ipd_upd;