DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PQC_UPD

Source


1 Package Body ben_pqc_upd as
2 /* $Header: bepqcrhi.pkb 120.0.12010000.2 2008/08/05 15:17:32 ubhat ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  ben_pqc_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_pqc_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_rqst_ctfn_prvdd_f'
79         ,p_base_key_column => 'prtt_rmt_rqst_ctfn_prvdd_id'
80         ,p_base_key_value  => p_rec.prtt_rmt_rqst_ctfn_prvdd_id
81         );
82     --
83     ben_pqc_shd.g_api_dml := true;  -- Set the api dml status
84     --
85     -- Update the ben_prtt_rmt_rqst_ctfn_prvdd_f Row
86     --
87     update  ben_prtt_rmt_rqst_ctfn_prvdd_f
88     set
89      prtt_rmt_rqst_ctfn_prvdd_id          = p_rec.prtt_rmt_rqst_ctfn_prvdd_id
90     ,prtt_clm_gd_or_svc_typ_id            = p_rec.prtt_clm_gd_or_svc_typ_id
91     ,pl_gd_r_svc_ctfn_id                  = p_rec.pl_gd_r_svc_ctfn_id
92     ,reimbmt_ctfn_rqd_flag                = p_rec.reimbmt_ctfn_rqd_flag
93     ,business_group_id                    = p_rec.business_group_id
94     ,prtt_enrt_actn_id                    = p_rec.prtt_enrt_actn_id
95     ,reimbmt_ctfn_recd_dt                 = p_rec.reimbmt_ctfn_recd_dt
96     ,reimbmt_ctfn_dnd_dt                  = p_rec.reimbmt_ctfn_dnd_dt
97     ,reimbmt_ctfn_typ_cd                  = p_rec.reimbmt_ctfn_typ_cd
98     ,pqc_attribute_category               = p_rec.pqc_attribute_category
99     ,pqc_attribute1                       = p_rec.pqc_attribute1
100     ,pqc_attribute2                       = p_rec.pqc_attribute2
101     ,pqc_attribute3                       = p_rec.pqc_attribute3
102     ,pqc_attribute4                       = p_rec.pqc_attribute4
103     ,pqc_attribute5                       = p_rec.pqc_attribute5
104     ,pqc_attribute6                       = p_rec.pqc_attribute6
105     ,pqc_attribute7                       = p_rec.pqc_attribute7
106     ,pqc_attribute8                       = p_rec.pqc_attribute8
107     ,pqc_attribute9                       = p_rec.pqc_attribute9
108     ,pqc_attribute10                      = p_rec.pqc_attribute10
109     ,pqc_attribute11                      = p_rec.pqc_attribute11
110     ,pqc_attribute12                      = p_rec.pqc_attribute12
111     ,pqc_attribute13                      = p_rec.pqc_attribute13
112     ,pqc_attribute14                      = p_rec.pqc_attribute14
113     ,pqc_attribute15                      = p_rec.pqc_attribute15
114     ,pqc_attribute16                      = p_rec.pqc_attribute16
115     ,pqc_attribute17                      = p_rec.pqc_attribute17
116     ,pqc_attribute18                      = p_rec.pqc_attribute18
117     ,pqc_attribute19                      = p_rec.pqc_attribute19
118     ,pqc_attribute20                      = p_rec.pqc_attribute20
119     ,pqc_attribute21                      = p_rec.pqc_attribute21
120     ,pqc_attribute22                      = p_rec.pqc_attribute22
121     ,pqc_attribute23                      = p_rec.pqc_attribute23
122     ,pqc_attribute24                      = p_rec.pqc_attribute24
123     ,pqc_attribute25                      = p_rec.pqc_attribute25
124     ,pqc_attribute26                      = p_rec.pqc_attribute26
125     ,pqc_attribute27                      = p_rec.pqc_attribute27
126     ,pqc_attribute28                      = p_rec.pqc_attribute28
127     ,pqc_attribute29                      = p_rec.pqc_attribute29
128     ,pqc_attribute30                      = p_rec.pqc_attribute30
129     ,object_version_number                = p_rec.object_version_number
130     where   prtt_rmt_rqst_ctfn_prvdd_id = p_rec.prtt_rmt_rqst_ctfn_prvdd_id
131     and     effective_start_date = p_validation_start_date
132     and     effective_end_date   = p_validation_end_date;
133     --
134     ben_pqc_shd.g_api_dml := false;   -- Unset the api dml status
135     --
136     -- Set the effective start and end dates
137     --
138     p_rec.effective_start_date := p_validation_start_date;
139     p_rec.effective_end_date   := p_validation_end_date;
140   End If;
141 --
142 hr_utility.set_location(' Leaving:'||l_proc, 15);
143 Exception
144   When hr_api.check_integrity_violated Then
145     -- A check constraint has been violated
146     ben_pqc_shd.g_api_dml := false;   -- Unset the api dml status
147     ben_pqc_shd.constraint_error
148       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
149   When hr_api.unique_integrity_violated Then
150     -- Unique integrity has been violated
151     ben_pqc_shd.g_api_dml := false;   -- Unset the api dml status
152     ben_pqc_shd.constraint_error
153       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
154   When Others Then
155     ben_pqc_shd.g_api_dml := false;   -- Unset the api dml status
156     Raise;
157 End dt_update_dml;
158 --
159 -- ----------------------------------------------------------------------------
160 -- |------------------------------< update_dml >------------------------------|
161 -- ----------------------------------------------------------------------------
162 -- {Start Of Comments}
163 --
164 -- Description:
165 --   This procedure calls the dt_update_dml control logic which handles
166 --   the actual datetrack dml.
167 --
168 -- Prerequisites:
169 --   This is an internal private procedure which must be called from the upd
170 --   procedure.
171 --
172 -- In Parameters:
173 --   A Pl/Sql record structre.
174 --
175 -- Post Success:
176 --   Processing contines.
177 --
178 -- Post Failure:
179 --   No specific error handling is required within this procedure.
180 --
181 -- Developer Implementation Notes:
182 --   The update 'set' arguments list should be modified if any of your
183 --   attributes are not updateable.
184 --
185 -- Access Status:
186 --   Internal Row Handler Use Only.
187 --
188 -- {End Of Comments}
189 -- ----------------------------------------------------------------------------
190 Procedure update_dml
191   (p_rec                      in out nocopy ben_pqc_shd.g_rec_type
192   ,p_effective_date           in date
193   ,p_datetrack_mode           in varchar2
194   ,p_validation_start_date    in date
195   ,p_validation_end_date      in date
196   ) is
197 --
198   l_proc        varchar2(72) := g_package||'update_dml';
199 --
200 Begin
201   hr_utility.set_location('Entering:'||l_proc, 5);
202   --
203   ben_pqc_upd.dt_update_dml
204     (p_rec                   => p_rec
205     ,p_effective_date        => p_effective_date
206     ,p_datetrack_mode        => p_datetrack_mode
207     ,p_validation_start_date => p_validation_start_date
208     ,p_validation_end_date   => p_validation_end_date
209     );
210   --
211   hr_utility.set_location(' Leaving:'||l_proc, 10);
212 End update_dml;
213 --
214 -- ----------------------------------------------------------------------------
215 -- |----------------------------< dt_pre_update >-----------------------------|
216 -- ----------------------------------------------------------------------------
217 -- {Start Of Comments}
218 --
219 -- Description:
220 --   The dt_pre_update procedure controls the execution
221 --   of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
222 --   and UPDATE_CHANGE_INSERT only. The execution required is as
223 --   follows:
224 --
225 --   1) Providing the datetrack update mode is not 'CORRECTION'
226 --      then set the effective end date of the current row (this
227 --      will be the validation_start_date - 1).
228 --   2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
229 --      corresponding delete_dml process to delete any future rows
230 --      where the effective_start_date is greater than or equal to
231 --      the validation_start_date.
232 --   3) Call the insert_dml process to insert the new updated row
233 --      details.
234 --
235 -- Prerequisites:
236 --   This is an internal procedure which is called from the
237 --   pre_update procedure.
238 --
239 -- In Parameters:
240 --
241 -- Post Success:
242 --   Processing continues.
243 --
244 -- Post Failure:
245 --   If an error has occurred, an error message and exception will be raised
246 --   but not handled.
247 --
248 -- Developer Implementation Notes:
249 --   This is an internal procedure which is required by Datetrack. Don't
250 --   remove or modify.
251 --
252 -- Access Status:
253 --   Internal Row Handler Use Only.
254 --
255 -- {End Of Comments}
256 -- ----------------------------------------------------------------------------
257 Procedure dt_pre_update
258   (p_rec                     in out nocopy     ben_pqc_shd.g_rec_type
259   ,p_effective_date          in date
260   ,p_datetrack_mode          in varchar2
261   ,p_validation_start_date   in date
262   ,p_validation_end_date     in date
263   ) is
264 --
265   l_proc                 varchar2(72) := g_package||'dt_pre_update';
266   l_dummy_version_number number;
267 --
268 Begin
269   hr_utility.set_location('Entering:'||l_proc, 5);
270   If (p_datetrack_mode <> hr_api.g_correction) then
271     --
272     -- Update the current effective end date
273     --
274     ben_pqc_shd.upd_effective_end_date
275       (p_effective_date         => p_effective_date
276       ,p_base_key_value         => p_rec.prtt_rmt_rqst_ctfn_prvdd_id
277       ,p_new_effective_end_date => (p_validation_start_date - 1)
278       ,p_validation_start_date  => p_validation_start_date
279       ,p_validation_end_date    => p_validation_end_date
280       ,p_object_version_number  => l_dummy_version_number
281       );
282     --
283     If (p_datetrack_mode = hr_api.g_update_override) then
284       --
285       -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
286       -- delete any future rows
287       --
288       ben_pqc_del.delete_dml
289         (p_rec                   => p_rec
290         ,p_effective_date        => p_effective_date
291         ,p_datetrack_mode        => p_datetrack_mode
292         ,p_validation_start_date => p_validation_start_date
293         ,p_validation_end_date   => p_validation_end_date
294         );
295     End If;
296     --
297     -- We must now insert the updated row
298     --
299     ben_pqc_ins.insert_dml
300       (p_rec                    => p_rec
301       ,p_effective_date         => p_effective_date
302       ,p_datetrack_mode         => p_datetrack_mode
303       ,p_validation_start_date  => p_validation_start_date
304       ,p_validation_end_date    => p_validation_end_date
305       );
306   End If;
307   hr_utility.set_location(' Leaving:'||l_proc, 20);
308 End dt_pre_update;
309 --
310 -- ----------------------------------------------------------------------------
311 -- |------------------------------< pre_update >------------------------------|
312 -- ----------------------------------------------------------------------------
313 -- {Start Of Comments}
314 --
315 -- Description:
316 --   This private procedure contains any processing which is required before
317 --   the update dml.
318 --
319 -- Prerequisites:
320 --   This is an internal procedure which is called from the upd procedure.
321 --
322 -- In Parameters:
323 --   A Pl/Sql record structure.
324 --
325 -- Post Success:
326 --   Processing continues.
327 --
328 -- Post Failure:
329 --   If an error has occurred, an error message and exception will be raised
330 --   but not handled.
331 -- Developer Implementation Notes:
332 --   Any pre-processing required before the update dml is issued should be
333 --   coded within this procedure. It is important to note that any 3rd party
334 --   maintenance should be reviewed before placing in this procedure. The call
335 --   to the dt_update_dml procedure should NOT be removed.
336 --
337 -- Access Status:
338 --   Internal Row Handler Use Only.
339 --
340 -- {End Of Comments}
341 -- ----------------------------------------------------------------------------
342 Procedure pre_update
343   (p_rec                   in out nocopy ben_pqc_shd.g_rec_type
344   ,p_effective_date        in date
345   ,p_datetrack_mode        in varchar2
346   ,p_validation_start_date in date
347   ,p_validation_end_date   in date
348   ) is
349 --
350   l_proc        varchar2(72) := g_package||'pre_update';
351 --
352 Begin
353   hr_utility.set_location('Entering:'||l_proc, 5);
354   --
355   --
356   --
357   dt_pre_update
358     (p_rec                   => p_rec
359     ,p_effective_date        => p_effective_date
360     ,p_datetrack_mode        => p_datetrack_mode
361     ,p_validation_start_date => p_validation_start_date
362     ,p_validation_end_date   => p_validation_end_date
363     );
364   --
365   hr_utility.set_location(' Leaving:'||l_proc, 10);
366 End pre_update;
367 --
368 -- ----------------------------------------------------------------------------
369 -- |----------------------------< post_update >-------------------------------|
370 -- ----------------------------------------------------------------------------
371 -- {Start Of Comments}
372 --
373 -- Description:
374 --   This private procedure contains any processing which is required after
375 --   the update dml.
376 --
377 -- Prerequisites:
378 --   This is an internal procedure which is called from the upd procedure.
379 --
380 -- In Parameters:
381 --   A Pl/Sql record structure.
382 --
383 -- Post Success:
384 --   Processing continues.
385 --
386 -- Post Failure:
387 --   If an error has occurred, an error message and exception will be raised
388 --   but not handled.
389 --
390 -- Developer Implementation Notes:
391 --   Any post-processing required after the update dml is issued should be
392 --   coded within this procedure. It is important to note that any 3rd party
393 --   maintenance should be reviewed before placing in this procedure.
394 --
395 -- Access Status:
396 --   Internal Row Handler Use Only.
397 --
398 -- {End Of Comments}
399 -- ----------------------------------------------------------------------------
400 Procedure post_update
401   (p_rec                   in ben_pqc_shd.g_rec_type
402   ,p_effective_date        in date
403   ,p_datetrack_mode        in varchar2
404   ,p_validation_start_date in date
405   ,p_validation_end_date   in date
406   ) is
407 --
408   l_proc        varchar2(72) := g_package||'post_update';
409 --
410 Begin
411   hr_utility.set_location('Entering:'||l_proc, 5);
412   begin
413     --
414     ben_pqc_rku.after_update
415       (p_effective_date
416       => p_effective_date
417       ,p_datetrack_mode
418       => p_datetrack_mode
419       ,p_validation_start_date
420       => p_validation_start_date
421       ,p_validation_end_date
422       => p_validation_end_date
423       ,p_prtt_rmt_rqst_ctfn_prvdd_id
424       => p_rec.prtt_rmt_rqst_ctfn_prvdd_id
425       ,p_prtt_clm_gd_or_svc_typ_id
426       => p_rec.prtt_clm_gd_or_svc_typ_id
427       ,p_pl_gd_r_svc_ctfn_id
428       => p_rec.pl_gd_r_svc_ctfn_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_reimbmt_ctfn_rqd_flag
434       => p_rec.reimbmt_ctfn_rqd_flag
435       ,p_business_group_id
436       => p_rec.business_group_id
437       ,p_prtt_enrt_actn_id
438       => p_rec.prtt_enrt_actn_id
439       ,p_reimbmt_ctfn_recd_dt
440       => p_rec.reimbmt_ctfn_recd_dt
441       ,p_reimbmt_ctfn_dnd_dt
442       => p_rec.reimbmt_ctfn_dnd_dt
443       ,p_reimbmt_ctfn_typ_cd
444       => p_rec.reimbmt_ctfn_typ_cd
445       ,p_pqc_attribute_category
446       => p_rec.pqc_attribute_category
447       ,p_pqc_attribute1
448       => p_rec.pqc_attribute1
449       ,p_pqc_attribute2
450       => p_rec.pqc_attribute2
451       ,p_pqc_attribute3
452       => p_rec.pqc_attribute3
453       ,p_pqc_attribute4
454       => p_rec.pqc_attribute4
455       ,p_pqc_attribute5
456       => p_rec.pqc_attribute5
457       ,p_pqc_attribute6
458       => p_rec.pqc_attribute6
459       ,p_pqc_attribute7
460       => p_rec.pqc_attribute7
461       ,p_pqc_attribute8
462       => p_rec.pqc_attribute8
463       ,p_pqc_attribute9
464       => p_rec.pqc_attribute9
465       ,p_pqc_attribute10
466       => p_rec.pqc_attribute10
467       ,p_pqc_attribute11
468       => p_rec.pqc_attribute11
469       ,p_pqc_attribute12
470       => p_rec.pqc_attribute12
471       ,p_pqc_attribute13
472       => p_rec.pqc_attribute13
473       ,p_pqc_attribute14
474       => p_rec.pqc_attribute14
475       ,p_pqc_attribute15
476       => p_rec.pqc_attribute15
477       ,p_pqc_attribute16
478       => p_rec.pqc_attribute16
479       ,p_pqc_attribute17
480       => p_rec.pqc_attribute17
481       ,p_pqc_attribute18
482       => p_rec.pqc_attribute18
483       ,p_pqc_attribute19
484       => p_rec.pqc_attribute19
485       ,p_pqc_attribute20
486       => p_rec.pqc_attribute20
487       ,p_pqc_attribute21
488       => p_rec.pqc_attribute21
489       ,p_pqc_attribute22
490       => p_rec.pqc_attribute22
491       ,p_pqc_attribute23
492       => p_rec.pqc_attribute23
493       ,p_pqc_attribute24
494       => p_rec.pqc_attribute24
495       ,p_pqc_attribute25
496       => p_rec.pqc_attribute25
497       ,p_pqc_attribute26
498       => p_rec.pqc_attribute26
499       ,p_pqc_attribute27
500       => p_rec.pqc_attribute27
501       ,p_pqc_attribute28
502       => p_rec.pqc_attribute28
503       ,p_pqc_attribute29
504       => p_rec.pqc_attribute29
505       ,p_pqc_attribute30
506       => p_rec.pqc_attribute30
507       ,p_object_version_number
508       => p_rec.object_version_number
509       ,p_prtt_clm_gd_or_svc_typ_id_o
510       => ben_pqc_shd.g_old_rec.prtt_clm_gd_or_svc_typ_id
511       ,p_pl_gd_r_svc_ctfn_id_o
512       => ben_pqc_shd.g_old_rec.pl_gd_r_svc_ctfn_id
513       ,p_effective_start_date_o
514       => ben_pqc_shd.g_old_rec.effective_start_date
515       ,p_effective_end_date_o
516       => ben_pqc_shd.g_old_rec.effective_end_date
517       ,p_reimbmt_ctfn_rqd_flag_o
518       => ben_pqc_shd.g_old_rec.reimbmt_ctfn_rqd_flag
519       ,p_business_group_id_o
520       => ben_pqc_shd.g_old_rec.business_group_id
521       ,p_prtt_enrt_actn_id_o
522       => ben_pqc_shd.g_old_rec.prtt_enrt_actn_id
523       ,p_reimbmt_ctfn_recd_dt_o
524       => ben_pqc_shd.g_old_rec.reimbmt_ctfn_recd_dt
525       ,p_reimbmt_ctfn_dnd_dt_o
526       => ben_pqc_shd.g_old_rec.reimbmt_ctfn_dnd_dt
527       ,p_reimbmt_ctfn_typ_cd_o
528       => ben_pqc_shd.g_old_rec.reimbmt_ctfn_typ_cd
529       ,p_pqc_attribute_category_o
530       => ben_pqc_shd.g_old_rec.pqc_attribute_category
531       ,p_pqc_attribute1_o
532       => ben_pqc_shd.g_old_rec.pqc_attribute1
533       ,p_pqc_attribute2_o
534       => ben_pqc_shd.g_old_rec.pqc_attribute2
535       ,p_pqc_attribute3_o
536       => ben_pqc_shd.g_old_rec.pqc_attribute3
537       ,p_pqc_attribute4_o
538       => ben_pqc_shd.g_old_rec.pqc_attribute4
539       ,p_pqc_attribute5_o
540       => ben_pqc_shd.g_old_rec.pqc_attribute5
541       ,p_pqc_attribute6_o
542       => ben_pqc_shd.g_old_rec.pqc_attribute6
543       ,p_pqc_attribute7_o
544       => ben_pqc_shd.g_old_rec.pqc_attribute7
545       ,p_pqc_attribute8_o
546       => ben_pqc_shd.g_old_rec.pqc_attribute8
547       ,p_pqc_attribute9_o
548       => ben_pqc_shd.g_old_rec.pqc_attribute9
549       ,p_pqc_attribute10_o
550       => ben_pqc_shd.g_old_rec.pqc_attribute10
551       ,p_pqc_attribute11_o
552       => ben_pqc_shd.g_old_rec.pqc_attribute11
553       ,p_pqc_attribute12_o
554       => ben_pqc_shd.g_old_rec.pqc_attribute12
555       ,p_pqc_attribute13_o
556       => ben_pqc_shd.g_old_rec.pqc_attribute13
557       ,p_pqc_attribute14_o
558       => ben_pqc_shd.g_old_rec.pqc_attribute14
559       ,p_pqc_attribute15_o
560       => ben_pqc_shd.g_old_rec.pqc_attribute15
561       ,p_pqc_attribute16_o
562       => ben_pqc_shd.g_old_rec.pqc_attribute16
563       ,p_pqc_attribute17_o
564       => ben_pqc_shd.g_old_rec.pqc_attribute17
565       ,p_pqc_attribute18_o
566       => ben_pqc_shd.g_old_rec.pqc_attribute18
567       ,p_pqc_attribute19_o
568       => ben_pqc_shd.g_old_rec.pqc_attribute19
569       ,p_pqc_attribute20_o
570       => ben_pqc_shd.g_old_rec.pqc_attribute20
571       ,p_pqc_attribute21_o
572       => ben_pqc_shd.g_old_rec.pqc_attribute21
573       ,p_pqc_attribute22_o
574       => ben_pqc_shd.g_old_rec.pqc_attribute22
575       ,p_pqc_attribute23_o
576       => ben_pqc_shd.g_old_rec.pqc_attribute23
577       ,p_pqc_attribute24_o
578       => ben_pqc_shd.g_old_rec.pqc_attribute24
579       ,p_pqc_attribute25_o
580       => ben_pqc_shd.g_old_rec.pqc_attribute25
581       ,p_pqc_attribute26_o
582       => ben_pqc_shd.g_old_rec.pqc_attribute26
583       ,p_pqc_attribute27_o
584       => ben_pqc_shd.g_old_rec.pqc_attribute27
585       ,p_pqc_attribute28_o
586       => ben_pqc_shd.g_old_rec.pqc_attribute28
587       ,p_pqc_attribute29_o
588       => ben_pqc_shd.g_old_rec.pqc_attribute29
589       ,p_pqc_attribute30_o
590       => ben_pqc_shd.g_old_rec.pqc_attribute30
591       ,p_object_version_number_o
592       => ben_pqc_shd.g_old_rec.object_version_number
593       );
594     --
595   exception
596     --
597     when hr_api.cannot_find_prog_unit then
598       --
599       hr_api.cannot_find_prog_unit_error
600         (p_module_name => 'BEN_PRTT_RMT_RQST_CTFN_PRVDD_F'
601         ,p_hook_type   => 'AU');
602       --
603   end;
604   --
605   hr_utility.set_location(' Leaving:'||l_proc, 10);
606 End post_update;
607 --
608 -- ----------------------------------------------------------------------------
609 -- |-----------------------------< convert_defs >-----------------------------|
610 -- ----------------------------------------------------------------------------
611 -- {Start Of Comments}
612 --
613 -- Description:
614 --   The Convert_Defs procedure has one very important function:
615 --   It must return the record structure for the row with all system defaulted
616 --   values converted into its corresponding parameter value for update. When
617 --   we attempt to update a row through the Upd process , certain
618 --   parameters can be defaulted which enables flexibility in the calling of
619 --   the upd process (e.g. only attributes which need to be updated need to be
620 --   specified). For the upd process to determine which attributes
621 --   have NOT been specified we need to check if the parameter has a reserved
622 --   system default value. Therefore, for all parameters which have a
623 --   corresponding reserved system default mechanism specified we need to
624 --   check if a system default is being used. If a system default is being
625 --   used then we convert the defaulted value into its corresponding attribute
626 --   value held in the g_old_rec data structure.
627 --
628 -- Prerequisites:
629 --   This private function can only be called from the upd process.
630 --
631 -- In Parameters:
632 --   A Pl/Sql record structure.
633 --
634 -- Post Success:
635 --   The record structure will be returned with all system defaulted parameter
636 --   values converted into its current row attribute value.
637 --
638 -- Post Failure:
639 --   No direct error handling is required within this function. Any possible
640 --   errors within this procedure will be a PL/SQL value error due to
641 --   conversion of datatypes or data lengths.
642 --
643 -- Developer Implementation Notes:
644 --   None.
645 --
646 -- Access Status:
647 --   Internal Row Handler Use Only.
648 --
649 -- {End Of Comments}
650 -- ----------------------------------------------------------------------------
651 Procedure convert_defs
652   (p_rec in out nocopy ben_pqc_shd.g_rec_type
653   ) is
654 --
655 Begin
656   --
657   -- We must now examine each argument value in the
658   -- p_rec plsql record structure
659   -- to see if a system default is being used. If a system default
660   -- is being used then we must set to the 'current' argument value.
661   --
662   If (p_rec.prtt_clm_gd_or_svc_typ_id = hr_api.g_number) then
663     p_rec.prtt_clm_gd_or_svc_typ_id :=
664     ben_pqc_shd.g_old_rec.prtt_clm_gd_or_svc_typ_id;
665   End If;
666   If (p_rec.pl_gd_r_svc_ctfn_id = hr_api.g_number) then
667     p_rec.pl_gd_r_svc_ctfn_id :=
668     ben_pqc_shd.g_old_rec.pl_gd_r_svc_ctfn_id;
669   End If;
670   If (p_rec.reimbmt_ctfn_rqd_flag = hr_api.g_varchar2) then
671     p_rec.reimbmt_ctfn_rqd_flag :=
672     ben_pqc_shd.g_old_rec.reimbmt_ctfn_rqd_flag;
673   End If;
674   If (p_rec.business_group_id = hr_api.g_number) then
675     p_rec.business_group_id :=
676     ben_pqc_shd.g_old_rec.business_group_id;
677   End If;
678   If (p_rec.prtt_enrt_actn_id = hr_api.g_number) then
679     p_rec.prtt_enrt_actn_id :=
680     ben_pqc_shd.g_old_rec.prtt_enrt_actn_id;
681   End If;
682   If (p_rec.reimbmt_ctfn_recd_dt = hr_api.g_date) then
683     p_rec.reimbmt_ctfn_recd_dt :=
684     ben_pqc_shd.g_old_rec.reimbmt_ctfn_recd_dt;
685   End If;
686   If (p_rec.reimbmt_ctfn_dnd_dt = hr_api.g_date) then
687     p_rec.reimbmt_ctfn_dnd_dt :=
688     ben_pqc_shd.g_old_rec.reimbmt_ctfn_dnd_dt;
689   End If;
690   If (p_rec.reimbmt_ctfn_typ_cd = hr_api.g_varchar2) then
691     p_rec.reimbmt_ctfn_typ_cd :=
692     ben_pqc_shd.g_old_rec.reimbmt_ctfn_typ_cd;
693   End If;
694   If (p_rec.pqc_attribute_category = hr_api.g_varchar2) then
695     p_rec.pqc_attribute_category :=
696     ben_pqc_shd.g_old_rec.pqc_attribute_category;
697   End If;
698   If (p_rec.pqc_attribute1 = hr_api.g_varchar2) then
699     p_rec.pqc_attribute1 :=
700     ben_pqc_shd.g_old_rec.pqc_attribute1;
701   End If;
702   If (p_rec.pqc_attribute2 = hr_api.g_varchar2) then
703     p_rec.pqc_attribute2 :=
704     ben_pqc_shd.g_old_rec.pqc_attribute2;
705   End If;
706   If (p_rec.pqc_attribute3 = hr_api.g_varchar2) then
707     p_rec.pqc_attribute3 :=
708     ben_pqc_shd.g_old_rec.pqc_attribute3;
709   End If;
710   If (p_rec.pqc_attribute4 = hr_api.g_varchar2) then
711     p_rec.pqc_attribute4 :=
712     ben_pqc_shd.g_old_rec.pqc_attribute4;
713   End If;
714   If (p_rec.pqc_attribute5 = hr_api.g_varchar2) then
715     p_rec.pqc_attribute5 :=
716     ben_pqc_shd.g_old_rec.pqc_attribute5;
717   End If;
718   If (p_rec.pqc_attribute6 = hr_api.g_varchar2) then
719     p_rec.pqc_attribute6 :=
720     ben_pqc_shd.g_old_rec.pqc_attribute6;
721   End If;
722   If (p_rec.pqc_attribute7 = hr_api.g_varchar2) then
723     p_rec.pqc_attribute7 :=
724     ben_pqc_shd.g_old_rec.pqc_attribute7;
725   End If;
726   If (p_rec.pqc_attribute8 = hr_api.g_varchar2) then
727     p_rec.pqc_attribute8 :=
728     ben_pqc_shd.g_old_rec.pqc_attribute8;
729   End If;
730   If (p_rec.pqc_attribute9 = hr_api.g_varchar2) then
731     p_rec.pqc_attribute9 :=
732     ben_pqc_shd.g_old_rec.pqc_attribute9;
733   End If;
734   If (p_rec.pqc_attribute10 = hr_api.g_varchar2) then
735     p_rec.pqc_attribute10 :=
736     ben_pqc_shd.g_old_rec.pqc_attribute10;
737   End If;
738   If (p_rec.pqc_attribute11 = hr_api.g_varchar2) then
739     p_rec.pqc_attribute11 :=
740     ben_pqc_shd.g_old_rec.pqc_attribute11;
741   End If;
742   If (p_rec.pqc_attribute12 = hr_api.g_varchar2) then
743     p_rec.pqc_attribute12 :=
744     ben_pqc_shd.g_old_rec.pqc_attribute12;
745   End If;
746   If (p_rec.pqc_attribute13 = hr_api.g_varchar2) then
747     p_rec.pqc_attribute13 :=
748     ben_pqc_shd.g_old_rec.pqc_attribute13;
749   End If;
750   If (p_rec.pqc_attribute14 = hr_api.g_varchar2) then
751     p_rec.pqc_attribute14 :=
752     ben_pqc_shd.g_old_rec.pqc_attribute14;
753   End If;
754   If (p_rec.pqc_attribute15 = hr_api.g_varchar2) then
755     p_rec.pqc_attribute15 :=
756     ben_pqc_shd.g_old_rec.pqc_attribute15;
757   End If;
758   If (p_rec.pqc_attribute16 = hr_api.g_varchar2) then
759     p_rec.pqc_attribute16 :=
760     ben_pqc_shd.g_old_rec.pqc_attribute16;
761   End If;
762   If (p_rec.pqc_attribute17 = hr_api.g_varchar2) then
763     p_rec.pqc_attribute17 :=
764     ben_pqc_shd.g_old_rec.pqc_attribute17;
765   End If;
766   If (p_rec.pqc_attribute18 = hr_api.g_varchar2) then
767     p_rec.pqc_attribute18 :=
768     ben_pqc_shd.g_old_rec.pqc_attribute18;
769   End If;
770   If (p_rec.pqc_attribute19 = hr_api.g_varchar2) then
771     p_rec.pqc_attribute19 :=
772     ben_pqc_shd.g_old_rec.pqc_attribute19;
773   End If;
774   If (p_rec.pqc_attribute20 = hr_api.g_varchar2) then
775     p_rec.pqc_attribute20 :=
776     ben_pqc_shd.g_old_rec.pqc_attribute20;
777   End If;
778   If (p_rec.pqc_attribute21 = hr_api.g_varchar2) then
779     p_rec.pqc_attribute21 :=
780     ben_pqc_shd.g_old_rec.pqc_attribute21;
781   End If;
782   If (p_rec.pqc_attribute22 = hr_api.g_varchar2) then
783     p_rec.pqc_attribute22 :=
784     ben_pqc_shd.g_old_rec.pqc_attribute22;
785   End If;
786   If (p_rec.pqc_attribute23 = hr_api.g_varchar2) then
787     p_rec.pqc_attribute23 :=
788     ben_pqc_shd.g_old_rec.pqc_attribute23;
789   End If;
790   If (p_rec.pqc_attribute24 = hr_api.g_varchar2) then
791     p_rec.pqc_attribute24 :=
792     ben_pqc_shd.g_old_rec.pqc_attribute24;
793   End If;
794   If (p_rec.pqc_attribute25 = hr_api.g_varchar2) then
795     p_rec.pqc_attribute25 :=
796     ben_pqc_shd.g_old_rec.pqc_attribute25;
797   End If;
798   If (p_rec.pqc_attribute26 = hr_api.g_varchar2) then
799     p_rec.pqc_attribute26 :=
800     ben_pqc_shd.g_old_rec.pqc_attribute26;
801   End If;
802   If (p_rec.pqc_attribute27 = hr_api.g_varchar2) then
803     p_rec.pqc_attribute27 :=
804     ben_pqc_shd.g_old_rec.pqc_attribute27;
805   End If;
806   If (p_rec.pqc_attribute28 = hr_api.g_varchar2) then
807     p_rec.pqc_attribute28 :=
808     ben_pqc_shd.g_old_rec.pqc_attribute28;
809   End If;
810   If (p_rec.pqc_attribute29 = hr_api.g_varchar2) then
811     p_rec.pqc_attribute29 :=
812     ben_pqc_shd.g_old_rec.pqc_attribute29;
813   End If;
814   If (p_rec.pqc_attribute30 = hr_api.g_varchar2) then
815     p_rec.pqc_attribute30 :=
816     ben_pqc_shd.g_old_rec.pqc_attribute30;
817   End If;
818   --
819 End convert_defs;
820 --
821 -- ----------------------------------------------------------------------------
822 -- |---------------------------------< upd >----------------------------------|
823 -- ----------------------------------------------------------------------------
824 Procedure upd
825   (p_effective_date in     date
826   ,p_datetrack_mode in     varchar2
827   ,p_rec            in out nocopy ben_pqc_shd.g_rec_type
828   ) is
829 --
830   l_proc                        varchar2(72) := g_package||'upd';
831   l_validation_start_date       date;
832   l_validation_end_date         date;
833 --
834 Begin
835   hr_utility.set_location('Entering:'||l_proc, 5);
836   --
837   -- Ensure that the DateTrack update mode is valid
838   --
839   dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
840   --
841   -- We must lock the row which we need to update.
842   --
843   ben_pqc_shd.lck
844     (p_effective_date                   => p_effective_date
845     ,p_datetrack_mode                   => p_datetrack_mode
846     ,p_prtt_rmt_rqst_ctfn_prvdd_id      => p_rec.prtt_rmt_rqst_ctfn_prvdd_id
847     ,p_object_version_number            => p_rec.object_version_number
848     ,p_validation_start_date            => l_validation_start_date
849     ,p_validation_end_date              => l_validation_end_date
850     );
851   --
852   -- 1. During an update system defaults are used to determine if
853   --    arguments have been defaulted or not. We must therefore
854   --    derive the full record structure values to be updated.
855   --
856   -- 2. Call the supporting update validate operations.
857   --
858   ben_pqc_upd.convert_defs(p_rec);
859   --
860   ben_pqc_bus.update_validate
861     (p_rec                              => p_rec
862     ,p_effective_date                   => p_effective_date
863     ,p_datetrack_mode                   => p_datetrack_mode
864     ,p_validation_start_date            => l_validation_start_date
865     ,p_validation_end_date              => l_validation_end_date
866     );
867   --
868   -- Call the supporting pre-update operation
869   --
870   pre_update
871     (p_rec                              => p_rec
872     ,p_effective_date                   => p_effective_date
873     ,p_datetrack_mode                   => p_datetrack_mode
874     ,p_validation_start_date            => l_validation_start_date
875     ,p_validation_end_date              => l_validation_end_date
876     );
877   --
878   -- Update the row.
879   --
880   update_dml
881     (p_rec                              => p_rec
882     ,p_effective_date                   => p_effective_date
883     ,p_datetrack_mode                   => p_datetrack_mode
884     ,p_validation_start_date            => l_validation_start_date
885     ,p_validation_end_date                  => l_validation_end_date
886     );
887   --
888   -- Call the su operation
889   --
890   post_update
891     (p_rec                              => p_rec
892     ,p_effective_date                   => p_effective_date
893     ,p_datetrack_mode                   => p_datetrack_mode
894     ,p_validation_start_date            => l_validation_start_date
895     ,p_validation_end_date              => l_validation_end_date
896     );
897 End upd;
898 --
899 -- ----------------------------------------------------------------------------
900 -- |------------------------------< upd >-------------------------------------|
901 -- ----------------------------------------------------------------------------
902 Procedure upd
903   (p_effective_date               in     date
904   ,p_datetrack_mode               in     varchar2
905   ,p_prtt_rmt_rqst_ctfn_prvdd_id  in     number
906   ,p_object_version_number        in out nocopy number
907   ,p_prtt_clm_gd_or_svc_typ_id    in     number    default hr_api.g_number
908   ,p_pl_gd_r_svc_ctfn_id          in     number    default hr_api.g_number
909   ,p_reimbmt_ctfn_rqd_flag        in     varchar2  default hr_api.g_varchar2
910   ,p_prtt_enrt_actn_id            in     number    default hr_api.g_number
911   ,p_business_group_id            in     number    default hr_api.g_number
912   ,p_reimbmt_ctfn_recd_dt         in     date      default hr_api.g_date
913   ,p_reimbmt_ctfn_dnd_dt          in     date      default hr_api.g_date
914   ,p_reimbmt_ctfn_typ_cd          in     varchar2  default hr_api.g_varchar2
915   ,p_pqc_attribute_category       in     varchar2  default hr_api.g_varchar2
916   ,p_pqc_attribute1               in     varchar2  default hr_api.g_varchar2
917   ,p_pqc_attribute2               in     varchar2  default hr_api.g_varchar2
918   ,p_pqc_attribute3               in     varchar2  default hr_api.g_varchar2
919   ,p_pqc_attribute4               in     varchar2  default hr_api.g_varchar2
920   ,p_pqc_attribute5               in     varchar2  default hr_api.g_varchar2
921   ,p_pqc_attribute6               in     varchar2  default hr_api.g_varchar2
922   ,p_pqc_attribute7               in     varchar2  default hr_api.g_varchar2
923   ,p_pqc_attribute8               in     varchar2  default hr_api.g_varchar2
924   ,p_pqc_attribute9               in     varchar2  default hr_api.g_varchar2
925   ,p_pqc_attribute10              in     varchar2  default hr_api.g_varchar2
926   ,p_pqc_attribute11              in     varchar2  default hr_api.g_varchar2
927   ,p_pqc_attribute12              in     varchar2  default hr_api.g_varchar2
928   ,p_pqc_attribute13              in     varchar2  default hr_api.g_varchar2
929   ,p_pqc_attribute14              in     varchar2  default hr_api.g_varchar2
930   ,p_pqc_attribute15              in     varchar2  default hr_api.g_varchar2
931   ,p_pqc_attribute16              in     varchar2  default hr_api.g_varchar2
932   ,p_pqc_attribute17              in     varchar2  default hr_api.g_varchar2
933   ,p_pqc_attribute18              in     varchar2  default hr_api.g_varchar2
934   ,p_pqc_attribute19              in     varchar2  default hr_api.g_varchar2
935   ,p_pqc_attribute20              in     varchar2  default hr_api.g_varchar2
936   ,p_pqc_attribute21              in     varchar2  default hr_api.g_varchar2
937   ,p_pqc_attribute22              in     varchar2  default hr_api.g_varchar2
938   ,p_pqc_attribute23              in     varchar2  default hr_api.g_varchar2
939   ,p_pqc_attribute24              in     varchar2  default hr_api.g_varchar2
940   ,p_pqc_attribute25              in     varchar2  default hr_api.g_varchar2
941   ,p_pqc_attribute26              in     varchar2  default hr_api.g_varchar2
942   ,p_pqc_attribute27              in     varchar2  default hr_api.g_varchar2
943   ,p_pqc_attribute28              in     varchar2  default hr_api.g_varchar2
944   ,p_pqc_attribute29              in     varchar2  default hr_api.g_varchar2
945   ,p_pqc_attribute30              in     varchar2  default hr_api.g_varchar2
946   ,p_effective_start_date            out nocopy date
947   ,p_effective_end_date              out nocopy date
948   ) is
949 --
950   l_rec         ben_pqc_shd.g_rec_type;
951   l_proc        varchar2(72) := g_package||'upd';
952 --
953 Begin
954   hr_utility.set_location('Entering:'||l_proc, 5);
955   --
956   -- Call conversion function to turn arguments into the
957   -- l_rec structure.
958   --
959   l_rec :=
960   ben_pqc_shd.convert_args
961     (p_prtt_rmt_rqst_ctfn_prvdd_id
962     ,p_prtt_clm_gd_or_svc_typ_id
963     ,p_pl_gd_r_svc_ctfn_id
964     ,null
965     ,null
966     ,p_reimbmt_ctfn_rqd_flag
967     ,p_business_group_id
968     ,p_prtt_enrt_actn_id
969     ,p_reimbmt_ctfn_recd_dt
970     ,p_reimbmt_ctfn_dnd_dt
971     ,p_reimbmt_ctfn_typ_cd
972     ,p_pqc_attribute_category
973     ,p_pqc_attribute1
974     ,p_pqc_attribute2
975     ,p_pqc_attribute3
976     ,p_pqc_attribute4
977     ,p_pqc_attribute5
978     ,p_pqc_attribute6
979     ,p_pqc_attribute7
980     ,p_pqc_attribute8
981     ,p_pqc_attribute9
982     ,p_pqc_attribute10
983     ,p_pqc_attribute11
984     ,p_pqc_attribute12
985     ,p_pqc_attribute13
986     ,p_pqc_attribute14
987     ,p_pqc_attribute15
988     ,p_pqc_attribute16
989     ,p_pqc_attribute17
990     ,p_pqc_attribute18
991     ,p_pqc_attribute19
992     ,p_pqc_attribute20
993     ,p_pqc_attribute21
994     ,p_pqc_attribute22
995     ,p_pqc_attribute23
996     ,p_pqc_attribute24
997     ,p_pqc_attribute25
998     ,p_pqc_attribute26
999     ,p_pqc_attribute27
1000     ,p_pqc_attribute28
1001     ,p_pqc_attribute29
1002     ,p_pqc_attribute30
1003     ,p_object_version_number
1004     );
1005   --
1006   -- Having converted the arguments into the
1007   -- plsql record structure we call the corresponding record
1008   -- business process.
1009   --
1010   ben_pqc_upd.upd
1011     (p_effective_date
1012     ,p_datetrack_mode
1013     ,l_rec
1014     );
1015   --
1016   -- Set the out parameters
1017   --
1018   p_object_version_number            := l_rec.object_version_number;
1019   p_effective_start_date             := l_rec.effective_start_date;
1020   p_effective_end_date               := l_rec.effective_end_date;
1021   --
1022   --
1023   hr_utility.set_location(' Leaving:'||l_proc, 10);
1024 End upd;
1025 --
1026 end ben_pqc_upd;