DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PRY_UPD

Source


1 Package Body ben_pry_upd as
2 /* $Header: bepryrhi.pkb 120.7 2008/04/29 07:14:34 sagnanas noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  ben_pry_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 ben_pry_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 => 'ben_prtt_rmt_aprvd_fr_pymt_f'
79         ,p_base_key_column => 'prtt_rmt_aprvd_fr_pymt_id'
80         ,p_base_key_value  => p_rec.prtt_rmt_aprvd_fr_pymt_id
81         );
82     --
83     ben_pry_shd.g_api_dml := true;  -- Set the api dml status
84     --
85     -- Update the ben_prtt_rmt_aprvd_fr_pymt_f Row
86     --
87     update  ben_prtt_rmt_aprvd_fr_pymt_f
88     set
89      prtt_rmt_aprvd_fr_pymt_id            = p_rec.prtt_rmt_aprvd_fr_pymt_id
90     ,prtt_reimbmt_rqst_id                 = p_rec.prtt_reimbmt_rqst_id
91     ,apprvd_fr_pymt_num                   = p_rec.apprvd_fr_pymt_num
92     ,adjmt_flag                           = p_rec.adjmt_flag
93     ,aprvd_fr_pymt_amt                    = p_rec.aprvd_fr_pymt_amt
94     ,pymt_stat_cd                         = p_rec.pymt_stat_cd
95     ,pymt_stat_rsn_cd                     = p_rec.pymt_stat_rsn_cd
96     ,pymt_stat_ovrdn_rsn_cd               = p_rec.pymt_stat_ovrdn_rsn_cd
97     ,pymt_stat_prr_to_ovrd_cd             = p_rec.pymt_stat_prr_to_ovrd_cd
98     ,business_group_id                    = p_rec.business_group_id
99     ,element_entry_value_id               = p_rec.element_entry_value_id
100     ,pry_attribute_category               = p_rec.pry_attribute_category
101     ,pry_attribute1                       = p_rec.pry_attribute1
102     ,pry_attribute2                       = p_rec.pry_attribute2
103     ,pry_attribute3                       = p_rec.pry_attribute3
104     ,pry_attribute4                       = p_rec.pry_attribute4
105     ,pry_attribute5                       = p_rec.pry_attribute5
106     ,pry_attribute6                       = p_rec.pry_attribute6
107     ,pry_attribute7                       = p_rec.pry_attribute7
108     ,pry_attribute8                       = p_rec.pry_attribute8
109     ,pry_attribute9                       = p_rec.pry_attribute9
110     ,pry_attribute10                      = p_rec.pry_attribute10
111     ,pry_attribute11                      = p_rec.pry_attribute11
112     ,pry_attribute12                      = p_rec.pry_attribute12
113     ,pry_attribute13                      = p_rec.pry_attribute13
114     ,pry_attribute14                      = p_rec.pry_attribute14
115     ,pry_attribute15                      = p_rec.pry_attribute15
116     ,pry_attribute16                      = p_rec.pry_attribute16
117     ,pry_attribute17                      = p_rec.pry_attribute17
118     ,pry_attribute18                      = p_rec.pry_attribute18
119     ,pry_attribute19                      = p_rec.pry_attribute19
120     ,pry_attribute20                      = p_rec.pry_attribute20
121     ,pry_attribute21                      = p_rec.pry_attribute21
122     ,pry_attribute22                      = p_rec.pry_attribute22
123     ,pry_attribute23                      = p_rec.pry_attribute23
124     ,pry_attribute24                      = p_rec.pry_attribute24
125     ,pry_attribute25                      = p_rec.pry_attribute25
126     ,pry_attribute26                      = p_rec.pry_attribute26
127     ,pry_attribute27                      = p_rec.pry_attribute27
128     ,pry_attribute28                      = p_rec.pry_attribute28
129     ,pry_attribute29                      = p_rec.pry_attribute29
130     ,pry_attribute30                      = p_rec.pry_attribute30
131     ,object_version_number                = p_rec.object_version_number
132     where   prtt_rmt_aprvd_fr_pymt_id = p_rec.prtt_rmt_aprvd_fr_pymt_id
133     and     effective_start_date = p_validation_start_date
134     and     effective_end_date   = p_validation_end_date;
135     --
136     ben_pry_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     ben_pry_shd.g_api_dml := false;   -- Unset the api dml status
149     ben_pry_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     ben_pry_shd.g_api_dml := false;   -- Unset the api dml status
154     ben_pry_shd.constraint_error
155       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
156   When Others Then
157     ben_pry_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 ben_pry_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   ben_pry_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     ben_pry_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     ben_pry_shd.upd_effective_end_date
277       (p_effective_date         => p_effective_date
278       ,p_base_key_value         => p_rec.prtt_rmt_aprvd_fr_pymt_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       ben_pry_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     ben_pry_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 -- Developer Implementation Notes:
334 --   Any pre-processing required before the update dml is issued should be
335 --   coded within this procedure. It is important to note that any 3rd party
336 --   maintenance should be reviewed before placing in this procedure. The call
337 --   to the dt_update_dml procedure should NOT be removed.
338 --
339 -- Access Status:
340 --   Internal Row Handler Use Only.
341 --
342 -- {End Of Comments}
343 -- ----------------------------------------------------------------------------
344 Procedure pre_update
345   (p_rec                   in out nocopy ben_pry_shd.g_rec_type
346   ,p_effective_date        in date
347   ,p_datetrack_mode        in varchar2
348   ,p_validation_start_date in date
349   ,p_validation_end_date   in date
350   ) is
351 --
352   l_proc        varchar2(72) := g_package||'pre_update';
353 --
354 Begin
355   hr_utility.set_location('Entering:'||l_proc, 5);
356   --
357   --
358   --
359   dt_pre_update
360     (p_rec                   => p_rec
361     ,p_effective_date        => p_effective_date
362     ,p_datetrack_mode        => p_datetrack_mode
363     ,p_validation_start_date => p_validation_start_date
364     ,p_validation_end_date   => p_validation_end_date
365     );
366   --
367   hr_utility.set_location(' Leaving:'||l_proc, 10);
368 End pre_update;
369 --
370 -- ----------------------------------------------------------------------------
371 -- |----------------------------< post_update >-------------------------------|
372 -- ----------------------------------------------------------------------------
373 -- {Start Of Comments}
374 --
375 -- Description:
376 --   This private procedure contains any processing which is required after
377 --   the update dml.
378 --
379 -- Prerequisites:
380 --   This is an internal procedure which is called from the upd procedure.
381 --
382 -- In Parameters:
383 --   A Pl/Sql record structure.
384 --
385 -- Post Success:
386 --   Processing continues.
387 --
388 -- Post Failure:
389 --   If an error has occurred, an error message and exception will be raised
390 --   but not handled.
391 --
392 -- Developer Implementation Notes:
393 --   Any post-processing required after the update dml is issued should be
394 --   coded within this procedure. It is important to note that any 3rd party
395 --   maintenance should be reviewed before placing in this procedure.
396 --
397 -- Access Status:
398 --   Internal Row Handler Use Only.
399 --
400 -- {End Of Comments}
401 -- ----------------------------------------------------------------------------
402 Procedure post_update
403   (p_rec                   in ben_pry_shd.g_rec_type
404   ,p_effective_date        in date
405   ,p_datetrack_mode        in varchar2
406   ,p_validation_start_date in date
407   ,p_validation_end_date   in date
408   ) is
409 --
410   l_proc        varchar2(72) := g_package||'post_update';
411 --
412 Begin
413   hr_utility.set_location('Entering:'||l_proc, 5);
414   begin
415     --
416     ben_pry_rku.after_update
417       (p_effective_date
418       => p_effective_date
419       ,p_datetrack_mode
420       => p_datetrack_mode
421       ,p_validation_start_date
422       => p_validation_start_date
423       ,p_validation_end_date
424       => p_validation_end_date
425       ,p_prtt_rmt_aprvd_fr_pymt_id
426       => p_rec.prtt_rmt_aprvd_fr_pymt_id
427       ,p_prtt_reimbmt_rqst_id
428       => p_rec.prtt_reimbmt_rqst_id
429       ,p_effective_start_date
430       => p_rec.effective_start_date
431       ,p_effective_end_date
432       => p_rec.effective_end_date
433       ,p_apprvd_fr_pymt_num
434       => p_rec.apprvd_fr_pymt_num
435       ,p_adjmt_flag
436       => p_rec.adjmt_flag
437       ,p_aprvd_fr_pymt_amt
438       => p_rec.aprvd_fr_pymt_amt
439       ,p_pymt_stat_cd
440       => p_rec.pymt_stat_cd
441       ,p_pymt_stat_rsn_cd
442       => p_rec.pymt_stat_rsn_cd
443       ,p_pymt_stat_ovrdn_rsn_cd
444       => p_rec.pymt_stat_ovrdn_rsn_cd
445       ,p_pymt_stat_prr_to_ovrd_cd
446       => p_rec.pymt_stat_prr_to_ovrd_cd
447       ,p_business_group_id
448       => p_rec.business_group_id
449       ,p_element_entry_value_id => p_rec.element_entry_value_id
450       ,p_pry_attribute_category
451       => p_rec.pry_attribute_category
452       ,p_pry_attribute1
453       => p_rec.pry_attribute1
454       ,p_pry_attribute2
455       => p_rec.pry_attribute2
456       ,p_pry_attribute3
457       => p_rec.pry_attribute3
458       ,p_pry_attribute4
459       => p_rec.pry_attribute4
460       ,p_pry_attribute5
461       => p_rec.pry_attribute5
462       ,p_pry_attribute6
463       => p_rec.pry_attribute6
464       ,p_pry_attribute7
465       => p_rec.pry_attribute7
466       ,p_pry_attribute8
467       => p_rec.pry_attribute8
468       ,p_pry_attribute9
469       => p_rec.pry_attribute9
470       ,p_pry_attribute10
471       => p_rec.pry_attribute10
472       ,p_pry_attribute11
473       => p_rec.pry_attribute11
474       ,p_pry_attribute12
475       => p_rec.pry_attribute12
476       ,p_pry_attribute13
477       => p_rec.pry_attribute13
478       ,p_pry_attribute14
479       => p_rec.pry_attribute14
480       ,p_pry_attribute15
481       => p_rec.pry_attribute15
482       ,p_pry_attribute16
483       => p_rec.pry_attribute16
484       ,p_pry_attribute17
485       => p_rec.pry_attribute17
486       ,p_pry_attribute18
487       => p_rec.pry_attribute18
488       ,p_pry_attribute19
489       => p_rec.pry_attribute19
490       ,p_pry_attribute20
491       => p_rec.pry_attribute20
492       ,p_pry_attribute21
493       => p_rec.pry_attribute21
494       ,p_pry_attribute22
495       => p_rec.pry_attribute22
496       ,p_pry_attribute23
497       => p_rec.pry_attribute23
498       ,p_pry_attribute24
499       => p_rec.pry_attribute24
500       ,p_pry_attribute25
501       => p_rec.pry_attribute25
502       ,p_pry_attribute26
503       => p_rec.pry_attribute26
504       ,p_pry_attribute27
505       => p_rec.pry_attribute27
506       ,p_pry_attribute28
507       => p_rec.pry_attribute28
508       ,p_pry_attribute29
509       => p_rec.pry_attribute29
510       ,p_pry_attribute30
511       => p_rec.pry_attribute30
512       ,p_object_version_number
513       => p_rec.object_version_number
514       ,p_prtt_reimbmt_rqst_id_o
515       => ben_pry_shd.g_old_rec.prtt_reimbmt_rqst_id
516       ,p_effective_start_date_o
517       => ben_pry_shd.g_old_rec.effective_start_date
518       ,p_effective_end_date_o
519       => ben_pry_shd.g_old_rec.effective_end_date
520       ,p_apprvd_fr_pymt_num_o
521       => ben_pry_shd.g_old_rec.apprvd_fr_pymt_num
522       ,p_adjmt_flag_o
523       => ben_pry_shd.g_old_rec.adjmt_flag
524       ,p_aprvd_fr_pymt_amt_o
525       => ben_pry_shd.g_old_rec.aprvd_fr_pymt_amt
526       ,p_pymt_stat_cd_o
527       => ben_pry_shd.g_old_rec.pymt_stat_cd
528       ,p_pymt_stat_rsn_cd_o
529       => ben_pry_shd.g_old_rec.pymt_stat_rsn_cd
530       ,p_pymt_stat_ovrdn_rsn_cd_o
531       => ben_pry_shd.g_old_rec.pymt_stat_ovrdn_rsn_cd
532       ,p_pymt_stat_prr_to_ovrd_cd_o
533       => ben_pry_shd.g_old_rec.pymt_stat_prr_to_ovrd_cd
534       ,p_business_group_id_o
535       => ben_pry_shd.g_old_rec.business_group_id
536       ,p_element_entry_value_id_o => ben_pry_shd.g_old_rec.element_entry_value_id
537       ,p_pry_attribute_category_o
538       => ben_pry_shd.g_old_rec.pry_attribute_category
539       ,p_pry_attribute1_o
540       => ben_pry_shd.g_old_rec.pry_attribute1
541       ,p_pry_attribute2_o
542       => ben_pry_shd.g_old_rec.pry_attribute2
543       ,p_pry_attribute3_o
544       => ben_pry_shd.g_old_rec.pry_attribute3
545       ,p_pry_attribute4_o
546       => ben_pry_shd.g_old_rec.pry_attribute4
547       ,p_pry_attribute5_o
548       => ben_pry_shd.g_old_rec.pry_attribute5
549       ,p_pry_attribute6_o
550       => ben_pry_shd.g_old_rec.pry_attribute6
551       ,p_pry_attribute7_o
552       => ben_pry_shd.g_old_rec.pry_attribute7
553       ,p_pry_attribute8_o
554       => ben_pry_shd.g_old_rec.pry_attribute8
555       ,p_pry_attribute9_o
556       => ben_pry_shd.g_old_rec.pry_attribute9
557       ,p_pry_attribute10_o
558       => ben_pry_shd.g_old_rec.pry_attribute10
559       ,p_pry_attribute11_o
560       => ben_pry_shd.g_old_rec.pry_attribute11
561       ,p_pry_attribute12_o
562       => ben_pry_shd.g_old_rec.pry_attribute12
563       ,p_pry_attribute13_o
564       => ben_pry_shd.g_old_rec.pry_attribute13
565       ,p_pry_attribute14_o
566       => ben_pry_shd.g_old_rec.pry_attribute14
567       ,p_pry_attribute15_o
568       => ben_pry_shd.g_old_rec.pry_attribute15
569       ,p_pry_attribute16_o
570       => ben_pry_shd.g_old_rec.pry_attribute16
571       ,p_pry_attribute17_o
572       => ben_pry_shd.g_old_rec.pry_attribute17
573       ,p_pry_attribute18_o
574       => ben_pry_shd.g_old_rec.pry_attribute18
575       ,p_pry_attribute19_o
576       => ben_pry_shd.g_old_rec.pry_attribute19
577       ,p_pry_attribute20_o
578       => ben_pry_shd.g_old_rec.pry_attribute20
579       ,p_pry_attribute21_o
580       => ben_pry_shd.g_old_rec.pry_attribute21
581       ,p_pry_attribute22_o
582       => ben_pry_shd.g_old_rec.pry_attribute22
583       ,p_pry_attribute23_o
584       => ben_pry_shd.g_old_rec.pry_attribute23
585       ,p_pry_attribute24_o
586       => ben_pry_shd.g_old_rec.pry_attribute24
587       ,p_pry_attribute25_o
588       => ben_pry_shd.g_old_rec.pry_attribute25
589       ,p_pry_attribute26_o
590       => ben_pry_shd.g_old_rec.pry_attribute26
591       ,p_pry_attribute27_o
592       => ben_pry_shd.g_old_rec.pry_attribute27
593       ,p_pry_attribute28_o
594       => ben_pry_shd.g_old_rec.pry_attribute28
595       ,p_pry_attribute29_o
596       => ben_pry_shd.g_old_rec.pry_attribute29
597       ,p_pry_attribute30_o
598       => ben_pry_shd.g_old_rec.pry_attribute30
599       ,p_object_version_number_o
600       => ben_pry_shd.g_old_rec.object_version_number
601       );
602     --
603   exception
604     --
605     when hr_api.cannot_find_prog_unit then
606       --
607       hr_api.cannot_find_prog_unit_error
608         (p_module_name => 'BEN_PRTT_RMT_APRVD_FR_PYMT_F'
609         ,p_hook_type   => 'AU');
610       --
611   end;
612   --
613   hr_utility.set_location(' Leaving:'||l_proc, 10);
614 End post_update;
615 --
616 -- ----------------------------------------------------------------------------
617 -- |-----------------------------< convert_defs >-----------------------------|
618 -- ----------------------------------------------------------------------------
619 -- {Start Of Comments}
620 --
621 -- Description:
622 --   The Convert_Defs procedure has one very important function:
623 --   It must return the record structure for the row with all system defaulted
624 --   values converted into its corresponding parameter value for update. When
625 --   we attempt to update a row through the Upd process , certain
626 --   parameters can be defaulted which enables flexibility in the calling of
627 --   the upd process (e.g. only attributes which need to be updated need to be
628 --   specified). For the upd process to determine which attributes
629 --   have NOT been specified we need to check if the parameter has a reserved
630 --   system default value. Therefore, for all parameters which have a
631 --   corresponding reserved system default mechanism specified we need to
632 --   check if a system default is being used. If a system default is being
633 --   used then we convert the defaulted value into its corresponding attribute
634 --   value held in the g_old_rec data structure.
635 --
636 -- Prerequisites:
637 --   This private function can only be called from the upd process.
638 --
639 -- In Parameters:
640 --   A Pl/Sql record structure.
641 --
642 -- Post Success:
643 --   The record structure will be returned with all system defaulted parameter
644 --   values converted into its current row attribute value.
645 --
646 -- Post Failure:
647 --   No direct error handling is required within this function. Any possible
648 --   errors within this procedure will be a PL/SQL value error due to
649 --   conversion of datatypes or data lengths.
650 --
651 -- Developer Implementation Notes:
652 --   None.
653 --
654 -- Access Status:
655 --   Internal Row Handler Use Only.
656 --
657 -- {End Of Comments}
658 -- ----------------------------------------------------------------------------
659 Procedure convert_defs
660   (p_rec in out nocopy ben_pry_shd.g_rec_type
661   ) is
662 --
663 Begin
664   --
665   -- We must now examine each argument value in the
666   -- p_rec plsql record structure
667   -- to see if a system default is being used. If a system default
668   -- is being used then we must set to the 'current' argument value.
669   --
670   If (p_rec.prtt_reimbmt_rqst_id = hr_api.g_number) then
671     p_rec.prtt_reimbmt_rqst_id :=
672     ben_pry_shd.g_old_rec.prtt_reimbmt_rqst_id;
673   End If;
674   If (p_rec.apprvd_fr_pymt_num = hr_api.g_number) then
675     p_rec.apprvd_fr_pymt_num :=
676     ben_pry_shd.g_old_rec.apprvd_fr_pymt_num;
677   End If;
678   If (p_rec.adjmt_flag = hr_api.g_varchar2) then
679     p_rec.adjmt_flag :=
680     ben_pry_shd.g_old_rec.adjmt_flag;
681   End If;
682   If (p_rec.aprvd_fr_pymt_amt = hr_api.g_number) then
683     p_rec.aprvd_fr_pymt_amt :=
684     ben_pry_shd.g_old_rec.aprvd_fr_pymt_amt;
685   End If;
686   If (p_rec.pymt_stat_cd = hr_api.g_varchar2) then
687     p_rec.pymt_stat_cd :=
688     ben_pry_shd.g_old_rec.pymt_stat_cd;
689   End If;
690   If (p_rec.pymt_stat_rsn_cd = hr_api.g_varchar2) then
691     p_rec.pymt_stat_rsn_cd :=
692     ben_pry_shd.g_old_rec.pymt_stat_rsn_cd;
693   End If;
694   If (p_rec.pymt_stat_ovrdn_rsn_cd = hr_api.g_varchar2) then
695     p_rec.pymt_stat_ovrdn_rsn_cd :=
696     ben_pry_shd.g_old_rec.pymt_stat_ovrdn_rsn_cd;
697   End If;
698   If (p_rec.pymt_stat_prr_to_ovrd_cd = hr_api.g_varchar2) then
699     p_rec.pymt_stat_prr_to_ovrd_cd :=
700     ben_pry_shd.g_old_rec.pymt_stat_prr_to_ovrd_cd;
701   End If;
702   If (p_rec.business_group_id = hr_api.g_number) then
703     p_rec.business_group_id :=
704     ben_pry_shd.g_old_rec.business_group_id;
705   End If;
706   If (p_rec.element_entry_value_id = hr_api.g_number) then
707     p_rec.element_entry_value_id :=
708     ben_pry_shd.g_old_rec.element_entry_value_id;
709   End If;
710 
711   If (p_rec.pry_attribute_category = hr_api.g_varchar2) then
712     p_rec.pry_attribute_category :=
713     ben_pry_shd.g_old_rec.pry_attribute_category;
714   End If;
715   If (p_rec.pry_attribute1 = hr_api.g_varchar2) then
716     p_rec.pry_attribute1 :=
717     ben_pry_shd.g_old_rec.pry_attribute1;
718   End If;
719   If (p_rec.pry_attribute2 = hr_api.g_varchar2) then
720     p_rec.pry_attribute2 :=
721     ben_pry_shd.g_old_rec.pry_attribute2;
722   End If;
723   If (p_rec.pry_attribute3 = hr_api.g_varchar2) then
724     p_rec.pry_attribute3 :=
725     ben_pry_shd.g_old_rec.pry_attribute3;
726   End If;
727   If (p_rec.pry_attribute4 = hr_api.g_varchar2) then
728     p_rec.pry_attribute4 :=
729     ben_pry_shd.g_old_rec.pry_attribute4;
730   End If;
731   If (p_rec.pry_attribute5 = hr_api.g_varchar2) then
732     p_rec.pry_attribute5 :=
733     ben_pry_shd.g_old_rec.pry_attribute5;
734   End If;
735   If (p_rec.pry_attribute6 = hr_api.g_varchar2) then
736     p_rec.pry_attribute6 :=
737     ben_pry_shd.g_old_rec.pry_attribute6;
738   End If;
739   If (p_rec.pry_attribute7 = hr_api.g_varchar2) then
740     p_rec.pry_attribute7 :=
741     ben_pry_shd.g_old_rec.pry_attribute7;
742   End If;
743   If (p_rec.pry_attribute8 = hr_api.g_varchar2) then
744     p_rec.pry_attribute8 :=
745     ben_pry_shd.g_old_rec.pry_attribute8;
746   End If;
747   If (p_rec.pry_attribute9 = hr_api.g_varchar2) then
748     p_rec.pry_attribute9 :=
749     ben_pry_shd.g_old_rec.pry_attribute9;
750   End If;
751   If (p_rec.pry_attribute10 = hr_api.g_varchar2) then
752     p_rec.pry_attribute10 :=
753     ben_pry_shd.g_old_rec.pry_attribute10;
754   End If;
755   If (p_rec.pry_attribute11 = hr_api.g_varchar2) then
756     p_rec.pry_attribute11 :=
757     ben_pry_shd.g_old_rec.pry_attribute11;
758   End If;
759   If (p_rec.pry_attribute12 = hr_api.g_varchar2) then
760     p_rec.pry_attribute12 :=
761     ben_pry_shd.g_old_rec.pry_attribute12;
762   End If;
763   If (p_rec.pry_attribute13 = hr_api.g_varchar2) then
764     p_rec.pry_attribute13 :=
765     ben_pry_shd.g_old_rec.pry_attribute13;
766   End If;
767   If (p_rec.pry_attribute14 = hr_api.g_varchar2) then
768     p_rec.pry_attribute14 :=
769     ben_pry_shd.g_old_rec.pry_attribute14;
770   End If;
771   If (p_rec.pry_attribute15 = hr_api.g_varchar2) then
772     p_rec.pry_attribute15 :=
773     ben_pry_shd.g_old_rec.pry_attribute15;
774   End If;
775   If (p_rec.pry_attribute16 = hr_api.g_varchar2) then
776     p_rec.pry_attribute16 :=
777     ben_pry_shd.g_old_rec.pry_attribute16;
778   End If;
779   If (p_rec.pry_attribute17 = hr_api.g_varchar2) then
780     p_rec.pry_attribute17 :=
781     ben_pry_shd.g_old_rec.pry_attribute17;
782   End If;
783   If (p_rec.pry_attribute18 = hr_api.g_varchar2) then
784     p_rec.pry_attribute18 :=
785     ben_pry_shd.g_old_rec.pry_attribute18;
786   End If;
787   If (p_rec.pry_attribute19 = hr_api.g_varchar2) then
788     p_rec.pry_attribute19 :=
789     ben_pry_shd.g_old_rec.pry_attribute19;
790   End If;
791   If (p_rec.pry_attribute20 = hr_api.g_varchar2) then
792     p_rec.pry_attribute20 :=
793     ben_pry_shd.g_old_rec.pry_attribute20;
794   End If;
795   If (p_rec.pry_attribute21 = hr_api.g_varchar2) then
796     p_rec.pry_attribute21 :=
797     ben_pry_shd.g_old_rec.pry_attribute21;
798   End If;
799   If (p_rec.pry_attribute22 = hr_api.g_varchar2) then
800     p_rec.pry_attribute22 :=
801     ben_pry_shd.g_old_rec.pry_attribute22;
802   End If;
803   If (p_rec.pry_attribute23 = hr_api.g_varchar2) then
804     p_rec.pry_attribute23 :=
805     ben_pry_shd.g_old_rec.pry_attribute23;
806   End If;
807   If (p_rec.pry_attribute24 = hr_api.g_varchar2) then
808     p_rec.pry_attribute24 :=
809     ben_pry_shd.g_old_rec.pry_attribute24;
810   End If;
811   If (p_rec.pry_attribute25 = hr_api.g_varchar2) then
812     p_rec.pry_attribute25 :=
813     ben_pry_shd.g_old_rec.pry_attribute25;
814   End If;
815   If (p_rec.pry_attribute26 = hr_api.g_varchar2) then
816     p_rec.pry_attribute26 :=
817     ben_pry_shd.g_old_rec.pry_attribute26;
818   End If;
819   If (p_rec.pry_attribute27 = hr_api.g_varchar2) then
820     p_rec.pry_attribute27 :=
821     ben_pry_shd.g_old_rec.pry_attribute27;
822   End If;
823   If (p_rec.pry_attribute28 = hr_api.g_varchar2) then
824     p_rec.pry_attribute28 :=
825     ben_pry_shd.g_old_rec.pry_attribute28;
826   End If;
827   If (p_rec.pry_attribute29 = hr_api.g_varchar2) then
828     p_rec.pry_attribute29 :=
829     ben_pry_shd.g_old_rec.pry_attribute29;
830   End If;
831   If (p_rec.pry_attribute30 = hr_api.g_varchar2) then
832     p_rec.pry_attribute30 :=
833     ben_pry_shd.g_old_rec.pry_attribute30;
834   End If;
835   --
836 End convert_defs;
837 --
838 -- ----------------------------------------------------------------------------
839 -- |---------------------------------< upd >----------------------------------|
840 -- ----------------------------------------------------------------------------
841 Procedure upd
842   (p_effective_date in     date
843   ,p_datetrack_mode in     varchar2
844   ,p_rec            in out nocopy ben_pry_shd.g_rec_type
845   ) is
846 --
847   l_proc                        varchar2(72) := g_package||'upd';
848   l_validation_start_date       date;
849   l_validation_end_date         date;
850 --
851 Begin
852   hr_utility.set_location('Entering:'||l_proc, 5);
853   --
854   -- Ensure that the DateTrack update mode is valid
855   --
856   dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
857   --
858   -- We must lock the row which we need to update.
859   --
860   ben_pry_shd.lck
861     (p_effective_date                   => p_effective_date
862     ,p_datetrack_mode                   => p_datetrack_mode
863     ,p_prtt_rmt_aprvd_fr_pymt_id        => p_rec.prtt_rmt_aprvd_fr_pymt_id
864     ,p_object_version_number            => p_rec.object_version_number
865     ,p_validation_start_date            => l_validation_start_date
866     ,p_validation_end_date              => l_validation_end_date
867     );
868   --
869   -- 1. During an update system defaults are used to determine if
870   --    arguments have been defaulted or not. We must therefore
871   --    derive the full record structure values to be updated.
872   --
873   -- 2. Call the supporting update validate operations.
874   --
875   ben_pry_upd.convert_defs(p_rec);
876   --
877   ben_pry_bus.update_validate
878     (p_rec                              => p_rec
879     ,p_effective_date                   => p_effective_date
880     ,p_datetrack_mode                   => p_datetrack_mode
881     ,p_validation_start_date            => l_validation_start_date
882     ,p_validation_end_date              => l_validation_end_date
883     );
884   --
885   -- Call the supporting pre-update operation
886   --
887   pre_update
888     (p_rec                              => p_rec
889     ,p_effective_date                   => p_effective_date
890     ,p_datetrack_mode                   => p_datetrack_mode
891     ,p_validation_start_date            => l_validation_start_date
892     ,p_validation_end_date              => l_validation_end_date
893     );
894   --
895   -- Update the row.
896   --
897   update_dml
898     (p_rec                              => p_rec
899     ,p_effective_date                   => p_effective_date
900     ,p_datetrack_mode                   => p_datetrack_mode
901     ,p_validation_start_date            => l_validation_start_date
902     ,p_validation_end_date                  => l_validation_end_date
903     );
904   --
905   -- Call the supporting post-update operation
906   --
907   post_update
908     (p_rec                              => p_rec
909     ,p_effective_date                   => p_effective_date
910     ,p_datetrack_mode                   => p_datetrack_mode
911     ,p_validation_start_date            => l_validation_start_date
912     ,p_validation_end_date              => l_validation_end_date
913     );
914 End upd;
915 --
916 -- ----------------------------------------------------------------------------
917 -- |------------------------------< upd >-------------------------------------|
918 -- ----------------------------------------------------------------------------
919 Procedure upd
920   (p_effective_date               in     date
921   ,p_datetrack_mode               in     varchar2
922   ,p_prtt_rmt_aprvd_fr_pymt_id    in     number
923   ,p_object_version_number        in out nocopy number
924   ,p_prtt_reimbmt_rqst_id         in     number    default hr_api.g_number
925   ,p_apprvd_fr_pymt_num           in     number    default hr_api.g_number
926   ,p_adjmt_flag                   in     varchar2  default hr_api.g_varchar2
927   ,p_aprvd_fr_pymt_amt            in     number    default hr_api.g_number
928   ,p_pymt_stat_cd                 in     varchar2  default hr_api.g_varchar2
929   ,p_pymt_stat_rsn_cd             in     varchar2  default hr_api.g_varchar2
930   ,p_pymt_stat_ovrdn_rsn_cd       in     varchar2  default hr_api.g_varchar2
931   ,p_pymt_stat_prr_to_ovrd_cd     in     varchar2  default hr_api.g_varchar2
932   ,p_business_group_id            in     number    default hr_api.g_number
933   ,p_element_entry_value_id       in     number    default hr_api.g_number
934   ,p_pry_attribute_category       in     varchar2  default hr_api.g_varchar2
935   ,p_pry_attribute1               in     varchar2  default hr_api.g_varchar2
936   ,p_pry_attribute2               in     varchar2  default hr_api.g_varchar2
937   ,p_pry_attribute3               in     varchar2  default hr_api.g_varchar2
938   ,p_pry_attribute4               in     varchar2  default hr_api.g_varchar2
939   ,p_pry_attribute5               in     varchar2  default hr_api.g_varchar2
940   ,p_pry_attribute6               in     varchar2  default hr_api.g_varchar2
941   ,p_pry_attribute7               in     varchar2  default hr_api.g_varchar2
942   ,p_pry_attribute8               in     varchar2  default hr_api.g_varchar2
943   ,p_pry_attribute9               in     varchar2  default hr_api.g_varchar2
944   ,p_pry_attribute10              in     varchar2  default hr_api.g_varchar2
945   ,p_pry_attribute11              in     varchar2  default hr_api.g_varchar2
946   ,p_pry_attribute12              in     varchar2  default hr_api.g_varchar2
947   ,p_pry_attribute13              in     varchar2  default hr_api.g_varchar2
948   ,p_pry_attribute14              in     varchar2  default hr_api.g_varchar2
949   ,p_pry_attribute15              in     varchar2  default hr_api.g_varchar2
950   ,p_pry_attribute16              in     varchar2  default hr_api.g_varchar2
951   ,p_pry_attribute17              in     varchar2  default hr_api.g_varchar2
952   ,p_pry_attribute18              in     varchar2  default hr_api.g_varchar2
953   ,p_pry_attribute19              in     varchar2  default hr_api.g_varchar2
954   ,p_pry_attribute20              in     varchar2  default hr_api.g_varchar2
955   ,p_pry_attribute21              in     varchar2  default hr_api.g_varchar2
956   ,p_pry_attribute22              in     varchar2  default hr_api.g_varchar2
957   ,p_pry_attribute23              in     varchar2  default hr_api.g_varchar2
958   ,p_pry_attribute24              in     varchar2  default hr_api.g_varchar2
959   ,p_pry_attribute25              in     varchar2  default hr_api.g_varchar2
960   ,p_pry_attribute26              in     varchar2  default hr_api.g_varchar2
961   ,p_pry_attribute27              in     varchar2  default hr_api.g_varchar2
962   ,p_pry_attribute28              in     varchar2  default hr_api.g_varchar2
963   ,p_pry_attribute29              in     varchar2  default hr_api.g_varchar2
964   ,p_pry_attribute30              in     varchar2  default hr_api.g_varchar2
965   ,p_effective_start_date            out nocopy date
966   ,p_effective_end_date              out nocopy date
967   ) is
968 --
969   l_rec         ben_pry_shd.g_rec_type;
970   l_proc        varchar2(72) := g_package||'upd';
971 --
972 Begin
973   hr_utility.set_location('Entering:'||l_proc, 5);
974   --
975   -- Call conversion function to turn arguments into the
976   -- l_rec structure.
977   --
978   l_rec :=
979   ben_pry_shd.convert_args
980     (p_prtt_rmt_aprvd_fr_pymt_id
981     ,p_prtt_reimbmt_rqst_id
982     ,null
983     ,null
984     ,p_apprvd_fr_pymt_num
985     ,p_adjmt_flag
986     ,p_aprvd_fr_pymt_amt
987     ,p_pymt_stat_cd
988     ,p_pymt_stat_rsn_cd
989     ,p_pymt_stat_ovrdn_rsn_cd
990     ,p_pymt_stat_prr_to_ovrd_cd
991     ,p_business_group_id
992     ,p_element_entry_value_id
993     ,p_pry_attribute_category
994     ,p_pry_attribute1
995     ,p_pry_attribute2
996     ,p_pry_attribute3
997     ,p_pry_attribute4
998     ,p_pry_attribute5
999     ,p_pry_attribute6
1000     ,p_pry_attribute7
1001     ,p_pry_attribute8
1002     ,p_pry_attribute9
1003     ,p_pry_attribute10
1004     ,p_pry_attribute11
1005     ,p_pry_attribute12
1006     ,p_pry_attribute13
1007     ,p_pry_attribute14
1008     ,p_pry_attribute15
1009     ,p_pry_attribute16
1010     ,p_pry_attribute17
1011     ,p_pry_attribute18
1012     ,p_pry_attribute19
1013     ,p_pry_attribute20
1014     ,p_pry_attribute21
1015     ,p_pry_attribute22
1016     ,p_pry_attribute23
1017     ,p_pry_attribute24
1018     ,p_pry_attribute25
1019     ,p_pry_attribute26
1020     ,p_pry_attribute27
1021     ,p_pry_attribute28
1022     ,p_pry_attribute29
1023     ,p_pry_attribute30
1024     ,p_object_version_number
1025     );
1026   --
1027   -- Having converted the arguments into the
1028   -- plsql record structure we call the corresponding record
1029   -- business process.
1030   --
1031   ben_pry_upd.upd
1032     (p_effective_date
1033     ,p_datetrack_mode
1034     ,l_rec
1035     );
1036   --
1037   -- Set the out parameters
1038   --
1039   p_object_version_number            := l_rec.object_version_number;
1040   p_effective_start_date             := l_rec.effective_start_date;
1041   p_effective_end_date               := l_rec.effective_end_date;
1042   --
1043   --
1044   hr_utility.set_location(' Leaving:'||l_proc, 10);
1045 End upd;
1046 --
1047 end ben_pry_upd;