DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_PBC_UPD

Source


1 Package Body pay_pbc_upd as
2 /* $Header: pypbcrhi.pkb 120.0 2005/05/29 07:19:45 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pay_pbc_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_pbc_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_balance_categories_f'
79         ,p_base_key_column => 'balance_category_id'
80         ,p_base_key_value  => p_rec.balance_category_id
81         );
82     --
83     --
84     --
85     -- Update the pay_balance_categories_f Row
86     --
87     update  pay_balance_categories_f
88     set
89      balance_category_id                  = p_rec.balance_category_id
90     ,category_name                        = p_rec.category_name
91     ,legislation_code                     = p_rec.legislation_code
92     ,business_group_id                    = p_rec.business_group_id
93     ,save_run_balance_enabled             = p_rec.save_run_balance_enabled
94     ,user_category_name                   = p_rec.user_category_name
95     ,pbc_information_category             = p_rec.pbc_information_category
96     ,pbc_information1                     = p_rec.pbc_information1
97     ,pbc_information2                     = p_rec.pbc_information2
98     ,pbc_information3                     = p_rec.pbc_information3
99     ,pbc_information4                     = p_rec.pbc_information4
100     ,pbc_information5                     = p_rec.pbc_information5
101     ,pbc_information6                     = p_rec.pbc_information6
102     ,pbc_information7                     = p_rec.pbc_information7
103     ,pbc_information8                     = p_rec.pbc_information8
104     ,pbc_information9                     = p_rec.pbc_information9
105     ,pbc_information10                    = p_rec.pbc_information10
106     ,pbc_information11                    = p_rec.pbc_information11
107     ,pbc_information12                    = p_rec.pbc_information12
108     ,pbc_information13                    = p_rec.pbc_information13
109     ,pbc_information14                    = p_rec.pbc_information14
110     ,pbc_information15                    = p_rec.pbc_information15
111     ,pbc_information16                    = p_rec.pbc_information16
112     ,pbc_information17                    = p_rec.pbc_information17
113     ,pbc_information18                    = p_rec.pbc_information18
114     ,pbc_information19                    = p_rec.pbc_information19
115     ,pbc_information20                    = p_rec.pbc_information20
116     ,pbc_information21                    = p_rec.pbc_information21
117     ,pbc_information22                    = p_rec.pbc_information22
118     ,pbc_information23                    = p_rec.pbc_information23
119     ,pbc_information24                    = p_rec.pbc_information24
120     ,pbc_information25                    = p_rec.pbc_information25
121     ,pbc_information26                    = p_rec.pbc_information26
122     ,pbc_information27                    = p_rec.pbc_information27
123     ,pbc_information28                    = p_rec.pbc_information28
124     ,pbc_information29                    = p_rec.pbc_information29
125     ,pbc_information30                    = p_rec.pbc_information30
126     ,object_version_number                = p_rec.object_version_number
127     where   balance_category_id = p_rec.balance_category_id
128     and     effective_start_date = p_validation_start_date
129     and     effective_end_date   = p_validation_end_date;
130     --
131     --
132     --
133     -- Set the effective start and end dates
134     --
135     p_rec.effective_start_date := p_validation_start_date;
136     p_rec.effective_end_date   := p_validation_end_date;
137   End If;
138 --
139 hr_utility.set_location(' Leaving:'||l_proc, 15);
140 Exception
141   When hr_api.check_integrity_violated Then
142     -- A check constraint has been violated
143     --
144     pay_pbc_shd.constraint_error
145       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
146   When hr_api.unique_integrity_violated Then
147     -- Unique integrity has been violated
148     --
149     pay_pbc_shd.constraint_error
150       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
151   When Others Then
152     --
153     Raise;
154 End dt_update_dml;
155 --
156 -- ----------------------------------------------------------------------------
157 -- |------------------------------< update_dml >------------------------------|
158 -- ----------------------------------------------------------------------------
159 -- {Start Of Comments}
160 --
161 -- Description:
162 --   This procedure calls the dt_update_dml control logic which handles
163 --   the actual datetrack dml.
164 --
165 -- Prerequisites:
166 --   This is an internal private procedure which must be called from the upd
167 --   procedure.
168 --
169 -- In Parameters:
170 --   A Pl/Sql record structre.
171 --
172 -- Post Success:
173 --   Processing contines.
174 --
175 -- Post Failure:
176 --   No specific error handling is required within this procedure.
177 --
178 -- Developer Implementation Notes:
179 --   The update 'set' arguments list should be modified if any of your
180 --   attributes are not updateable.
181 --
182 -- Access Status:
183 --   Internal Row Handler Use Only.
184 --
185 -- {End Of Comments}
186 -- ----------------------------------------------------------------------------
187 Procedure update_dml
188   (p_rec                      in out nocopy pay_pbc_shd.g_rec_type
189   ,p_effective_date           in date
190   ,p_datetrack_mode           in varchar2
191   ,p_validation_start_date    in date
192   ,p_validation_end_date      in date
193   ) is
194 --
195   l_proc        varchar2(72) := g_package||'update_dml';
196 --
197 Begin
198   hr_utility.set_location('Entering:'||l_proc, 5);
199   --
200   pay_pbc_upd.dt_update_dml
201     (p_rec                   => p_rec
202     ,p_effective_date        => p_effective_date
203     ,p_datetrack_mode        => p_datetrack_mode
204     ,p_validation_start_date => p_validation_start_date
205     ,p_validation_end_date   => p_validation_end_date
206     );
207   --
208   hr_utility.set_location(' Leaving:'||l_proc, 10);
209 End update_dml;
210 --
211 -- ----------------------------------------------------------------------------
212 -- |----------------------------< dt_pre_update >-----------------------------|
213 -- ----------------------------------------------------------------------------
214 -- {Start Of Comments}
215 --
216 -- Description:
217 --   The dt_pre_update procedure controls the execution
218 --   of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
219 --   and UPDATE_CHANGE_INSERT only. The execution required is as
220 --   follows:
221 --
222 --   1) Providing the datetrack update mode is not 'CORRECTION'
223 --      then set the effective end date of the current row (this
224 --      will be the validation_start_date - 1).
225 --   2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
226 --      corresponding delete_dml process to delete any future rows
227 --      where the effective_start_date is greater than or equal to
228 --      the validation_start_date.
229 --   3) Call the insert_dml process to insert the new updated row
230 --      details.
231 --
232 -- Prerequisites:
233 --   This is an internal procedure which is called from the
234 --   pre_update procedure.
235 --
236 -- In Parameters:
237 --
238 -- Post Success:
239 --   Processing continues.
240 --
241 -- Post Failure:
242 --   If an error has occurred, an error message and exception will be raised
243 --   but not handled.
244 --
245 -- Developer Implementation Notes:
246 --   This is an internal procedure which is required by Datetrack. Don't
247 --   remove or modify.
248 --
249 -- Access Status:
250 --   Internal Row Handler Use Only.
251 --
252 -- {End Of Comments}
253 -- ----------------------------------------------------------------------------
254 Procedure dt_pre_update
255   (p_rec                     in out nocopy     pay_pbc_shd.g_rec_type
256   ,p_effective_date          in date
257   ,p_datetrack_mode          in varchar2
258   ,p_validation_start_date   in date
259   ,p_validation_end_date     in date
260   ) is
261 --
262   l_proc                 varchar2(72) := g_package||'dt_pre_update';
263   l_dummy_version_number number;
264 --
265 Begin
266   hr_utility.set_location('Entering:'||l_proc, 5);
267   If (p_datetrack_mode <> hr_api.g_correction) then
268     --
269     -- Update the current effective end date
270     --
271     pay_pbc_shd.upd_effective_end_date
272       (p_effective_date         => p_effective_date
273       ,p_base_key_value         => p_rec.balance_category_id
274       ,p_new_effective_end_date => (p_validation_start_date - 1)
275       ,p_validation_start_date  => p_validation_start_date
276       ,p_validation_end_date    => p_validation_end_date
277       ,p_object_version_number  => l_dummy_version_number
278       );
279     --
280     If (p_datetrack_mode = hr_api.g_update_override) then
281       --
282       -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
283       -- delete any future rows
284       --
285       pay_pbc_del.delete_dml
286         (p_rec                   => p_rec
287         ,p_effective_date        => p_effective_date
288         ,p_datetrack_mode        => p_datetrack_mode
289         ,p_validation_start_date => p_validation_start_date
290         ,p_validation_end_date   => p_validation_end_date
291         );
292     End If;
293     --
294     -- We must now insert the updated row
295     --
296     pay_pbc_ins.insert_dml
297       (p_rec                    => p_rec
298       ,p_effective_date         => p_effective_date
299       ,p_datetrack_mode         => p_datetrack_mode
300       ,p_validation_start_date  => p_validation_start_date
301       ,p_validation_end_date    => p_validation_end_date
302       );
303   End If;
304   hr_utility.set_location(' Leaving:'||l_proc, 20);
305 End dt_pre_update;
306 --
307 -- ----------------------------------------------------------------------------
308 -- |------------------------------< pre_update >------------------------------|
309 -- ----------------------------------------------------------------------------
310 -- {Start Of Comments}
311 --
312 -- Description:
313 --   This private procedure contains any processing which is required before
314 --   the update dml.
315 --
316 -- Prerequisites:
317 --   This is an internal procedure which is called from the upd procedure.
318 --
319 -- In Parameters:
320 --   A Pl/Sql record structure.
321 --
322 -- Post Success:
323 --   Processing continues.
324 --
325 -- Post Failure:
326 --   If an error has occurred, an error message and exception will be raised
327 --   but not handled.
328 -- Developer Implementation Notes:
329 --   Any pre-processing required before the update dml is issued should be
330 --   coded within this procedure. It is important to note that any 3rd party
331 --   maintenance should be reviewed before placing in this procedure. The call
332 --   to the dt_update_dml procedure should NOT be removed.
333 --
334 -- Access Status:
335 --   Internal Row Handler Use Only.
336 --
337 -- {End Of Comments}
338 -- ----------------------------------------------------------------------------
339 Procedure pre_update
340   (p_rec                   in out nocopy pay_pbc_shd.g_rec_type
341   ,p_effective_date        in date
342   ,p_datetrack_mode        in varchar2
343   ,p_validation_start_date in date
344   ,p_validation_end_date   in date
345   ) is
346 --
347   l_proc        varchar2(72) := g_package||'pre_update';
348 --
349 Begin
350   hr_utility.set_location('Entering:'||l_proc, 5);
351   --
352   --
353   --
354   dt_pre_update
355     (p_rec                   => p_rec
356     ,p_effective_date        => p_effective_date
357     ,p_datetrack_mode        => p_datetrack_mode
358     ,p_validation_start_date => p_validation_start_date
359     ,p_validation_end_date   => p_validation_end_date
360     );
361   --
362   hr_utility.set_location(' Leaving:'||l_proc, 10);
363 End pre_update;
364 --
365 -- ----------------------------------------------------------------------------
366 -- |----------------------------< post_update >-------------------------------|
367 -- ----------------------------------------------------------------------------
368 -- {Start Of Comments}
369 --
370 -- Description:
371 --   This private procedure contains any processing which is required after
372 --   the update dml.
373 --
374 -- Prerequisites:
375 --   This is an internal procedure which is called from the upd procedure.
376 --
377 -- In Parameters:
378 --   A Pl/Sql record structure.
379 --
380 -- Post Success:
381 --   Processing continues.
382 --
383 -- Post Failure:
384 --   If an error has occurred, an error message and exception will be raised
385 --   but not handled.
386 --
387 -- Developer Implementation Notes:
388 --   Any post-processing required after the update dml is issued should be
389 --   coded within this procedure. It is important to note that any 3rd party
390 --   maintenance should be reviewed before placing in this procedure.
391 --
392 -- Access Status:
393 --   Internal Row Handler Use Only.
394 --
395 -- {End Of Comments}
396 -- ----------------------------------------------------------------------------
397 Procedure post_update
398   (p_rec                   in pay_pbc_shd.g_rec_type
399   ,p_effective_date        in date
400   ,p_datetrack_mode        in varchar2
401   ,p_validation_start_date in date
402   ,p_validation_end_date   in date
403   ) is
404 --
405   l_proc        varchar2(72) := g_package||'post_update';
406 --
407 Begin
408   hr_utility.set_location('Entering:'||l_proc, 5);
409   begin
410     --
411     pay_pbc_rku.after_update
412       (p_effective_date => p_effective_date
413       ,p_datetrack_mode => p_datetrack_mode
414       ,p_validation_start_date => p_validation_start_date
415       ,p_validation_end_date => p_validation_end_date
416       ,p_balance_category_id => p_rec.balance_category_id
417       ,p_effective_start_date => p_rec.effective_start_date
418       ,p_effective_end_date => p_rec.effective_end_date
419       ,p_save_run_balance_enabled => p_rec.save_run_balance_enabled
420       ,p_user_category_name => p_rec.user_category_name
421       ,p_pbc_information_category => p_rec.pbc_information_category
422       ,p_pbc_information1 => p_rec.pbc_information1
423       ,p_pbc_information2 => p_rec.pbc_information2
424       ,p_pbc_information3 => p_rec.pbc_information3
425       ,p_pbc_information4 => p_rec.pbc_information4
426       ,p_pbc_information5 => p_rec.pbc_information5
427       ,p_pbc_information6 => p_rec.pbc_information6
428       ,p_pbc_information7 => p_rec.pbc_information7
429       ,p_pbc_information8 => p_rec.pbc_information8
430       ,p_pbc_information9 => p_rec.pbc_information9
431       ,p_pbc_information10 => p_rec.pbc_information10
432       ,p_pbc_information11 => p_rec.pbc_information11
433       ,p_pbc_information12 => p_rec.pbc_information12
434       ,p_pbc_information13 => p_rec.pbc_information13
435       ,p_pbc_information14 => p_rec.pbc_information14
436       ,p_pbc_information15 => p_rec.pbc_information15
437       ,p_pbc_information16 => p_rec.pbc_information16
438       ,p_pbc_information17 => p_rec.pbc_information17
439       ,p_pbc_information18 => p_rec.pbc_information18
440       ,p_pbc_information19 => p_rec.pbc_information19
441       ,p_pbc_information20 => p_rec.pbc_information20
442       ,p_pbc_information21 => p_rec.pbc_information21
443       ,p_pbc_information22 => p_rec.pbc_information22
444       ,p_pbc_information23 => p_rec.pbc_information23
445       ,p_pbc_information24 => p_rec.pbc_information24
446       ,p_pbc_information25 => p_rec.pbc_information25
447       ,p_pbc_information26 => p_rec.pbc_information26
448       ,p_pbc_information27 => p_rec.pbc_information27
449       ,p_pbc_information28 => p_rec.pbc_information28
450       ,p_pbc_information29 => p_rec.pbc_information29
451       ,p_pbc_information30 => p_rec.pbc_information30
452       ,p_object_version_number => p_rec.object_version_number
453       ,p_category_name_o => pay_pbc_shd.g_old_rec.category_name
454       ,p_effective_start_date_o => pay_pbc_shd.g_old_rec.effective_start_date
455       ,p_effective_end_date_o => pay_pbc_shd.g_old_rec.effective_end_date
456       ,p_legislation_code_o => pay_pbc_shd.g_old_rec.legislation_code
457       ,p_business_group_id_o => pay_pbc_shd.g_old_rec.business_group_id
458       ,p_save_run_balance_enabled_o
459        => pay_pbc_shd.g_old_rec.save_run_balance_enabled
460       ,p_user_category_name_o => pay_pbc_shd.g_old_rec.user_category_name
461       ,p_pbc_information_category_o
462        => pay_pbc_shd.g_old_rec.pbc_information_category
463       ,p_pbc_information1_o => pay_pbc_shd.g_old_rec.pbc_information1
464       ,p_pbc_information2_o => pay_pbc_shd.g_old_rec.pbc_information2
465       ,p_pbc_information3_o => pay_pbc_shd.g_old_rec.pbc_information3
466       ,p_pbc_information4_o => pay_pbc_shd.g_old_rec.pbc_information4
467       ,p_pbc_information5_o => pay_pbc_shd.g_old_rec.pbc_information5
468       ,p_pbc_information6_o => pay_pbc_shd.g_old_rec.pbc_information6
469       ,p_pbc_information7_o => pay_pbc_shd.g_old_rec.pbc_information7
470       ,p_pbc_information8_o => pay_pbc_shd.g_old_rec.pbc_information8
471       ,p_pbc_information9_o => pay_pbc_shd.g_old_rec.pbc_information9
472       ,p_pbc_information10_o => pay_pbc_shd.g_old_rec.pbc_information10
473       ,p_pbc_information11_o => pay_pbc_shd.g_old_rec.pbc_information11
474       ,p_pbc_information12_o => pay_pbc_shd.g_old_rec.pbc_information12
475       ,p_pbc_information13_o => pay_pbc_shd.g_old_rec.pbc_information13
476       ,p_pbc_information14_o => pay_pbc_shd.g_old_rec.pbc_information14
477       ,p_pbc_information15_o => pay_pbc_shd.g_old_rec.pbc_information15
478       ,p_pbc_information16_o => pay_pbc_shd.g_old_rec.pbc_information16
479       ,p_pbc_information17_o => pay_pbc_shd.g_old_rec.pbc_information17
480       ,p_pbc_information18_o => pay_pbc_shd.g_old_rec.pbc_information18
481       ,p_pbc_information19_o => pay_pbc_shd.g_old_rec.pbc_information19
482       ,p_pbc_information20_o => pay_pbc_shd.g_old_rec.pbc_information20
483       ,p_pbc_information21_o => pay_pbc_shd.g_old_rec.pbc_information21
484       ,p_pbc_information22_o => pay_pbc_shd.g_old_rec.pbc_information22
485       ,p_pbc_information23_o => pay_pbc_shd.g_old_rec.pbc_information23
486       ,p_pbc_information24_o => pay_pbc_shd.g_old_rec.pbc_information24
487       ,p_pbc_information25_o => pay_pbc_shd.g_old_rec.pbc_information25
488       ,p_pbc_information26_o => pay_pbc_shd.g_old_rec.pbc_information26
489       ,p_pbc_information27_o => pay_pbc_shd.g_old_rec.pbc_information27
490       ,p_pbc_information28_o => pay_pbc_shd.g_old_rec.pbc_information28
491       ,p_pbc_information29_o => pay_pbc_shd.g_old_rec.pbc_information29
492       ,p_pbc_information30_o => pay_pbc_shd.g_old_rec.pbc_information30
493       ,p_object_version_number_o => pay_pbc_shd.g_old_rec.object_version_number
494       );
495     --
496   exception
497     --
498     when hr_api.cannot_find_prog_unit then
499       --
500       hr_api.cannot_find_prog_unit_error
501         (p_module_name => 'PAY_BALANCE_CATEGORIES_F'
502         ,p_hook_type   => 'AU');
503       --
504   end;
505   --
506   hr_utility.set_location(' Leaving:'||l_proc, 10);
507 End post_update;
508 --
509 -- ----------------------------------------------------------------------------
510 -- |-----------------------------< convert_defs >-----------------------------|
511 -- ----------------------------------------------------------------------------
512 -- {Start Of Comments}
513 --
514 -- Description:
515 --   The Convert_Defs procedure has one very important function:
516 --   It must return the record structure for the row with all system defaulted
517 --   values converted into its corresponding parameter value for update. When
518 --   we attempt to update a row through the Upd process , certain
519 --   parameters can be defaulted which enables flexibility in the calling of
520 --   the upd process (e.g. only attributes which need to be updated need to be
521 --   specified). For the upd process to determine which attributes
522 --   have NOT been specified we need to check if the parameter has a reserved
523 --   system default value. Therefore, for all parameters which have a
524 --   corresponding reserved system default mechanism specified we need to
525 --   check if a system default is being used. If a system default is being
526 --   used then we convert the defaulted value into its corresponding attribute
527 --   value held in the g_old_rec data structure.
528 --
529 -- Prerequisites:
530 --   This private function can only be called from the upd process.
531 --
532 -- In Parameters:
533 --   A Pl/Sql record structure.
534 --
535 -- Post Success:
536 --   The record structure will be returned with all system defaulted parameter
537 --   values converted into its current row attribute value.
538 --
539 -- Post Failure:
540 --   No direct error handling is required within this function. Any possible
541 --   errors within this procedure will be a PL/SQL value error due to
542 --   conversion of datatypes or data lengths.
543 --
544 -- Developer Implementation Notes:
545 --   None.
546 --
547 -- Access Status:
548 --   Internal Row Handler Use Only.
549 --
550 -- {End Of Comments}
551 -- ----------------------------------------------------------------------------
552 Procedure convert_defs
553   (p_rec in out nocopy pay_pbc_shd.g_rec_type
554   ) is
555 --
556 Begin
557   --
558   -- We must now examine each argument value in the
559   -- p_rec plsql record structure
560   -- to see if a system default is being used. If a system default
561   -- is being used then we must set to the 'current' argument value.
562   --
563   If (p_rec.category_name = hr_api.g_varchar2) then
564     p_rec.category_name :=
565     pay_pbc_shd.g_old_rec.category_name;
566   End If;
567   If (p_rec.legislation_code = hr_api.g_varchar2) then
568     p_rec.legislation_code :=
569     pay_pbc_shd.g_old_rec.legislation_code;
570   End If;
571   If (p_rec.business_group_id = hr_api.g_number) then
572     p_rec.business_group_id :=
573     pay_pbc_shd.g_old_rec.business_group_id;
574   End If;
575   If (p_rec.save_run_balance_enabled = hr_api.g_varchar2) then
576     p_rec.save_run_balance_enabled :=
577     pay_pbc_shd.g_old_rec.save_run_balance_enabled;
578   End If;
579   If (p_rec.user_category_name = hr_api.g_varchar2) then
580     p_rec.user_category_name :=
581     pay_pbc_shd.g_old_rec.user_category_name;
582   End If;
583   If (p_rec.pbc_information_category = hr_api.g_varchar2) then
584     p_rec.pbc_information_category :=
585     pay_pbc_shd.g_old_rec.pbc_information_category;
586   End If;
587   If (p_rec.pbc_information1 = hr_api.g_varchar2) then
588     p_rec.pbc_information1 :=
589     pay_pbc_shd.g_old_rec.pbc_information1;
590   End If;
591   If (p_rec.pbc_information2 = hr_api.g_varchar2) then
592     p_rec.pbc_information2 :=
593     pay_pbc_shd.g_old_rec.pbc_information2;
594   End If;
595   If (p_rec.pbc_information3 = hr_api.g_varchar2) then
596     p_rec.pbc_information3 :=
597     pay_pbc_shd.g_old_rec.pbc_information3;
598   End If;
599   If (p_rec.pbc_information4 = hr_api.g_varchar2) then
600     p_rec.pbc_information4 :=
601     pay_pbc_shd.g_old_rec.pbc_information4;
602   End If;
603   If (p_rec.pbc_information5 = hr_api.g_varchar2) then
604     p_rec.pbc_information5 :=
605     pay_pbc_shd.g_old_rec.pbc_information5;
606   End If;
607   If (p_rec.pbc_information6 = hr_api.g_varchar2) then
608     p_rec.pbc_information6 :=
609     pay_pbc_shd.g_old_rec.pbc_information6;
610   End If;
611   If (p_rec.pbc_information7 = hr_api.g_varchar2) then
612     p_rec.pbc_information7 :=
613     pay_pbc_shd.g_old_rec.pbc_information7;
614   End If;
615   If (p_rec.pbc_information8 = hr_api.g_varchar2) then
616     p_rec.pbc_information8 :=
617     pay_pbc_shd.g_old_rec.pbc_information8;
618   End If;
619   If (p_rec.pbc_information9 = hr_api.g_varchar2) then
620     p_rec.pbc_information9 :=
621     pay_pbc_shd.g_old_rec.pbc_information9;
622   End If;
623   If (p_rec.pbc_information10 = hr_api.g_varchar2) then
624     p_rec.pbc_information10 :=
625     pay_pbc_shd.g_old_rec.pbc_information10;
626   End If;
627   If (p_rec.pbc_information11 = hr_api.g_varchar2) then
628     p_rec.pbc_information11 :=
629     pay_pbc_shd.g_old_rec.pbc_information11;
630   End If;
631   If (p_rec.pbc_information12 = hr_api.g_varchar2) then
632     p_rec.pbc_information12 :=
633     pay_pbc_shd.g_old_rec.pbc_information12;
634   End If;
635   If (p_rec.pbc_information13 = hr_api.g_varchar2) then
636     p_rec.pbc_information13 :=
637     pay_pbc_shd.g_old_rec.pbc_information13;
638   End If;
639   If (p_rec.pbc_information14 = hr_api.g_varchar2) then
640     p_rec.pbc_information14 :=
641     pay_pbc_shd.g_old_rec.pbc_information14;
642   End If;
643   If (p_rec.pbc_information15 = hr_api.g_varchar2) then
644     p_rec.pbc_information15 :=
645     pay_pbc_shd.g_old_rec.pbc_information15;
646   End If;
647   If (p_rec.pbc_information16 = hr_api.g_varchar2) then
648     p_rec.pbc_information16 :=
649     pay_pbc_shd.g_old_rec.pbc_information16;
650   End If;
651   If (p_rec.pbc_information17 = hr_api.g_varchar2) then
652     p_rec.pbc_information17 :=
653     pay_pbc_shd.g_old_rec.pbc_information17;
654   End If;
655   If (p_rec.pbc_information18 = hr_api.g_varchar2) then
656     p_rec.pbc_information18 :=
657     pay_pbc_shd.g_old_rec.pbc_information18;
658   End If;
659   If (p_rec.pbc_information19 = hr_api.g_varchar2) then
660     p_rec.pbc_information19 :=
661     pay_pbc_shd.g_old_rec.pbc_information19;
662   End If;
663   If (p_rec.pbc_information20 = hr_api.g_varchar2) then
664     p_rec.pbc_information20 :=
665     pay_pbc_shd.g_old_rec.pbc_information20;
666   End If;
667   If (p_rec.pbc_information21 = hr_api.g_varchar2) then
668     p_rec.pbc_information21 :=
669     pay_pbc_shd.g_old_rec.pbc_information21;
670   End If;
671   If (p_rec.pbc_information22 = hr_api.g_varchar2) then
672     p_rec.pbc_information22 :=
673     pay_pbc_shd.g_old_rec.pbc_information22;
674   End If;
675   If (p_rec.pbc_information23 = hr_api.g_varchar2) then
676     p_rec.pbc_information23 :=
677     pay_pbc_shd.g_old_rec.pbc_information23;
678   End If;
679   If (p_rec.pbc_information24 = hr_api.g_varchar2) then
680     p_rec.pbc_information24 :=
681     pay_pbc_shd.g_old_rec.pbc_information24;
682   End If;
683   If (p_rec.pbc_information25 = hr_api.g_varchar2) then
684     p_rec.pbc_information25 :=
685     pay_pbc_shd.g_old_rec.pbc_information25;
686   End If;
687   If (p_rec.pbc_information26 = hr_api.g_varchar2) then
688     p_rec.pbc_information26 :=
689     pay_pbc_shd.g_old_rec.pbc_information26;
690   End If;
691   If (p_rec.pbc_information27 = hr_api.g_varchar2) then
692     p_rec.pbc_information27 :=
693     pay_pbc_shd.g_old_rec.pbc_information27;
694   End If;
695   If (p_rec.pbc_information28 = hr_api.g_varchar2) then
696     p_rec.pbc_information28 :=
697     pay_pbc_shd.g_old_rec.pbc_information28;
698   End If;
699   If (p_rec.pbc_information29 = hr_api.g_varchar2) then
700     p_rec.pbc_information29 :=
701     pay_pbc_shd.g_old_rec.pbc_information29;
702   End If;
703   If (p_rec.pbc_information30 = hr_api.g_varchar2) then
704     p_rec.pbc_information30 :=
705     pay_pbc_shd.g_old_rec.pbc_information30;
706   End If;
707   --
708 End convert_defs;
709 --
710 -- ----------------------------------------------------------------------------
711 -- |---------------------------------< upd >----------------------------------|
712 -- ----------------------------------------------------------------------------
713 Procedure upd
714   (p_effective_date in     date
715   ,p_datetrack_mode in     varchar2
716   ,p_rec            in out nocopy pay_pbc_shd.g_rec_type
717   ) is
718 --
719   l_proc                        varchar2(72) := g_package||'upd';
720   l_validation_start_date       date;
721   l_validation_end_date         date;
722 --
723 Begin
724   hr_utility.set_location('Entering:'||l_proc, 5);
725   --
726   -- Ensure that the DateTrack update mode is valid
727   --
728   dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
729   --
730   -- We must lock the row which we need to update.
731   --
732   pay_pbc_shd.lck
733     (p_effective_date                   => p_effective_date
734     ,p_datetrack_mode                   => p_datetrack_mode
735     ,p_balance_category_id              => p_rec.balance_category_id
736     ,p_object_version_number            => p_rec.object_version_number
737     ,p_validation_start_date            => l_validation_start_date
738     ,p_validation_end_date              => l_validation_end_date
739     );
740   --
741   -- 1. During an update system defaults are used to determine if
742   --    arguments have been defaulted or not. We must therefore
743   --    derive the full record structure values to be updated.
744   --
745   -- 2. Call the supporting update validate operations.
746   --
747   pay_pbc_upd.convert_defs(p_rec);
748   --
749   pay_pbc_bus.update_validate
750     (p_rec                              => p_rec
751     ,p_effective_date                   => p_effective_date
752     ,p_datetrack_mode                   => p_datetrack_mode
753     ,p_validation_start_date            => l_validation_start_date
754     ,p_validation_end_date              => l_validation_end_date
755     );
756   --
757   -- Call to raise any errors on multi-message list
758   hr_multi_message.end_validation_set;
759   --
760   -- Call the supporting pre-update operation
761   --
762   pre_update
763     (p_rec                              => p_rec
764     ,p_effective_date                   => p_effective_date
765     ,p_datetrack_mode                   => p_datetrack_mode
766     ,p_validation_start_date            => l_validation_start_date
767     ,p_validation_end_date              => l_validation_end_date
768     );
769   --
770   -- Update the row.
771   --
772   update_dml
773     (p_rec                              => p_rec
774     ,p_effective_date                   => p_effective_date
775     ,p_datetrack_mode                   => p_datetrack_mode
776     ,p_validation_start_date            => l_validation_start_date
777     ,p_validation_end_date                  => l_validation_end_date
778     );
779   --
780   -- Call the supporting post-update operation
781   --
782   post_update
783     (p_rec                              => p_rec
784     ,p_effective_date                   => p_effective_date
785     ,p_datetrack_mode                   => p_datetrack_mode
786     ,p_validation_start_date            => l_validation_start_date
787     ,p_validation_end_date              => l_validation_end_date
788     );
789   --
790   -- Call to raise any errors on multi-message list
791   hr_multi_message.end_validation_set;
792 End upd;
793 --
794 -- ----------------------------------------------------------------------------
795 -- |------------------------------< upd >-------------------------------------|
796 -- ----------------------------------------------------------------------------
797 Procedure upd
798   (p_effective_date               in     date
799   ,p_datetrack_mode               in     varchar2
800   ,p_balance_category_id          in     number
801   ,p_object_version_number        in out nocopy number
802   ,p_save_run_balance_enabled     in     varchar2  default hr_api.g_varchar2
803   ,p_user_category_name           in     varchar2  default hr_api.g_varchar2
804   ,p_pbc_information_category     in     varchar2  default hr_api.g_varchar2
805   ,p_pbc_information1             in     varchar2  default hr_api.g_varchar2
806   ,p_pbc_information2             in     varchar2  default hr_api.g_varchar2
807   ,p_pbc_information3             in     varchar2  default hr_api.g_varchar2
808   ,p_pbc_information4             in     varchar2  default hr_api.g_varchar2
809   ,p_pbc_information5             in     varchar2  default hr_api.g_varchar2
810   ,p_pbc_information6             in     varchar2  default hr_api.g_varchar2
811   ,p_pbc_information7             in     varchar2  default hr_api.g_varchar2
812   ,p_pbc_information8             in     varchar2  default hr_api.g_varchar2
813   ,p_pbc_information9             in     varchar2  default hr_api.g_varchar2
814   ,p_pbc_information10            in     varchar2  default hr_api.g_varchar2
815   ,p_pbc_information11            in     varchar2  default hr_api.g_varchar2
816   ,p_pbc_information12            in     varchar2  default hr_api.g_varchar2
817   ,p_pbc_information13            in     varchar2  default hr_api.g_varchar2
818   ,p_pbc_information14            in     varchar2  default hr_api.g_varchar2
819   ,p_pbc_information15            in     varchar2  default hr_api.g_varchar2
820   ,p_pbc_information16            in     varchar2  default hr_api.g_varchar2
821   ,p_pbc_information17            in     varchar2  default hr_api.g_varchar2
822   ,p_pbc_information18            in     varchar2  default hr_api.g_varchar2
823   ,p_pbc_information19            in     varchar2  default hr_api.g_varchar2
824   ,p_pbc_information20            in     varchar2  default hr_api.g_varchar2
825   ,p_pbc_information21            in     varchar2  default hr_api.g_varchar2
826   ,p_pbc_information22            in     varchar2  default hr_api.g_varchar2
827   ,p_pbc_information23            in     varchar2  default hr_api.g_varchar2
828   ,p_pbc_information24            in     varchar2  default hr_api.g_varchar2
829   ,p_pbc_information25            in     varchar2  default hr_api.g_varchar2
830   ,p_pbc_information26            in     varchar2  default hr_api.g_varchar2
831   ,p_pbc_information27            in     varchar2  default hr_api.g_varchar2
832   ,p_pbc_information28            in     varchar2  default hr_api.g_varchar2
833   ,p_pbc_information29            in     varchar2  default hr_api.g_varchar2
834   ,p_pbc_information30            in     varchar2  default hr_api.g_varchar2
835   ,p_effective_start_date            out nocopy date
836   ,p_effective_end_date              out nocopy date
837   ) is
838 --
839   l_rec         pay_pbc_shd.g_rec_type;
840   l_proc        varchar2(72) := g_package||'upd';
841 --
842 Begin
843   hr_utility.set_location('Entering:'||l_proc, 5);
844   --
845   -- Call conversion function to turn arguments into the
846   -- l_rec structure.
847   --
848   l_rec :=
849   pay_pbc_shd.convert_args
850     (p_balance_category_id
851     ,hr_api.g_varchar2
852     ,null
853     ,null
854     ,hr_api.g_varchar2
855     ,hr_api.g_number
856     ,p_save_run_balance_enabled
857     ,p_user_category_name
858     ,p_pbc_information_category
859     ,p_pbc_information1
860     ,p_pbc_information2
861     ,p_pbc_information3
862     ,p_pbc_information4
863     ,p_pbc_information5
864     ,p_pbc_information6
865     ,p_pbc_information7
866     ,p_pbc_information8
867     ,p_pbc_information9
868     ,p_pbc_information10
869     ,p_pbc_information11
870     ,p_pbc_information12
871     ,p_pbc_information13
872     ,p_pbc_information14
873     ,p_pbc_information15
874     ,p_pbc_information16
875     ,p_pbc_information17
876     ,p_pbc_information18
877     ,p_pbc_information19
878     ,p_pbc_information20
879     ,p_pbc_information21
880     ,p_pbc_information22
881     ,p_pbc_information23
882     ,p_pbc_information24
883     ,p_pbc_information25
884     ,p_pbc_information26
885     ,p_pbc_information27
886     ,p_pbc_information28
887     ,p_pbc_information29
888     ,p_pbc_information30
889     ,p_object_version_number
890     );
891   --
892   -- Having converted the arguments into the
893   -- plsql record structure we call the corresponding record
894   -- business process.
895   --
896   pay_pbc_upd.upd
897     (p_effective_date
898     ,p_datetrack_mode
899     ,l_rec
900     );
901   --
902   -- Set the out parameters
903   --
904   p_object_version_number            := l_rec.object_version_number;
905   p_effective_start_date             := l_rec.effective_start_date;
906   p_effective_end_date               := l_rec.effective_end_date;
907   --
908   --
909   hr_utility.set_location(' Leaving:'||l_proc, 10);
910 End upd;
911 --
912 end pay_pbc_upd;