[Home] [Help]
PACKAGE BODY: APPS.HR_CLE_INS
Source
1 Package Body hr_cle_ins as
2 /* $Header: hrclerhi.pkb 115.6 2002/12/03 09:27:16 hjonnala noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' hr_cle_ins.'; -- Global package name
9 --
10 -- The following global variables are only to be used by
11 -- the set_base_key_value and pre_insert procedures.
12 --
13 g_soc_ins_contr_lvls_id_i number default null;
14 --
15 -- ----------------------------------------------------------------------------
16 -- |------------------------< set_base_key_value >----------------------------|
17 -- ----------------------------------------------------------------------------
18 procedure set_base_key_value
19 (p_soc_ins_contr_lvls_id in number) is
20 --
21 l_proc varchar2(72) := g_package||'set_base_key_value';
22 --
23 Begin
24 hr_utility.set_location('Entering:'||l_proc, 10);
25 --
26 hr_cle_ins.g_soc_ins_contr_lvls_id_i := p_soc_ins_contr_lvls_id;
27 --
28 hr_utility.set_location(' Leaving:'||l_proc, 20);
29 End set_base_key_value;
30 --
31 --
32 -- ----------------------------------------------------------------------------
33 -- |----------------------------< dt_insert_dml >-----------------------------|
34 -- ----------------------------------------------------------------------------
35 -- {Start Of Comments}
36 --
37 -- Description:
38 -- This procedure controls the actual dml insert logic for datetrack. The
39 -- functions of this procedure are as follows:
40 -- 1) Get the object_version_number.
41 -- 2) To set the effective start and end dates to the corresponding
42 -- validation start and end dates. Also, the object version number
43 -- record attribute is set.
44 -- 3) To set and unset the g_api_dml status as required (as we are about to
45 -- perform dml).
46 -- 4) To insert the row into the schema with the derived effective start
47 -- and end dates and the object version number.
48 -- 5) To trap any constraint violations that may have occurred.
49 -- 6) To raise any other errors.
50 --
51 -- Prerequisites:
52 -- This is an internal private procedure which must be called from the
53 -- insert_dml and pre_update (logic permitting) procedure and must have
54 -- all mandatory arguments set.
55 --
56 -- In Parameters:
57 -- A Pl/Sql record structure.
58 --
59 -- Post Success:
60 -- The specified row will be inserted into the schema.
61 --
62 -- Post Failure:
63 -- On the insert dml failure it is important to note that we always reset the
64 -- g_api_dml status to false.
65 -- If a check or unique integrity constraint violation is raised the
66 -- constraint_error procedure will be called.
67 -- If any other error is reported, the error will be raised after the
68 -- g_api_dml status is reset.
69 --
70 -- Developer Implementation Notes:
71 -- This is an internal datetrack maintenance procedure which should
72 -- not be modified in anyway.
73 --
74 -- Access Status:
75 -- Internal Row Handler Use Only.
76 --
77 -- {End Of Comments}
78 -- ----------------------------------------------------------------------------
79 Procedure dt_insert_dml
80 (p_rec in out nocopy hr_cle_shd.g_rec_type
81 ,p_effective_date in date
82 ,p_datetrack_mode in varchar2
83 ,p_validation_start_date in date
84 ,p_validation_end_date in date
85 ) is
86 -- Cursor to select 'old' created AOL who column values
87 --
88 Cursor C_Sel1 Is
89 select t.created_by,
90 t.creation_date
91 from hr_de_soc_ins_contr_lvls_f t
92 where t.soc_ins_contr_lvls_id = p_rec.soc_ins_contr_lvls_id
93 and t.effective_start_date =
94 hr_cle_shd.g_old_rec.effective_start_date
95 and t.effective_end_date = (p_validation_start_date - 1);
96 --
97 l_proc varchar2(72) := g_package||'dt_insert_dml';
98 l_created_by hr_de_soc_ins_contr_lvls_f.created_by%TYPE;
99 l_creation_date hr_de_soc_ins_contr_lvls_f.creation_date%TYPE;
100 l_last_update_date hr_de_soc_ins_contr_lvls_f.last_update_date%TYPE;
101 l_last_updated_by hr_de_soc_ins_contr_lvls_f.last_updated_by%TYPE;
102 l_last_update_login hr_de_soc_ins_contr_lvls_f.last_update_login%TYPE;
103 --
104 Begin
105 hr_utility.set_location('Entering:'||l_proc, 5);
106 --
107 -- Get the object version number for the insert
108 --
109 p_rec.object_version_number :=
110 dt_api.get_object_version_number
111 (p_base_table_name => 'hr_de_soc_ins_contr_lvls_f'
112 ,p_base_key_column => 'soc_ins_contr_lvls_id'
113 ,p_base_key_value => p_rec.soc_ins_contr_lvls_id
114 );
115 --
116 -- Set the effective start and end dates to the corresponding
117 -- validation start and end dates
118 --
119 p_rec.effective_start_date := p_validation_start_date;
120 p_rec.effective_end_date := p_validation_end_date;
121 --
122 -- If the datetrack_mode is not INSERT then we must populate the WHO
123 -- columns with the 'old' creation values and 'new' updated values.
124 --
125 If (p_datetrack_mode <> hr_api.g_insert) then
126 hr_utility.set_location(l_proc, 10);
127 --
128 -- Select the 'old' created values
129 --
130 Open C_Sel1;
131 Fetch C_Sel1 Into l_created_by, l_creation_date;
132 If C_Sel1%notfound Then
133 --
134 -- The previous 'old' created row has not been found. We need
135 -- to error as an internal datetrack problem exists.
136 --
137 Close C_Sel1;
138 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
139 fnd_message.set_token('PROCEDURE', l_proc);
140 fnd_message.set_token('STEP','10');
141 fnd_message.raise_error;
142 End If;
143 Close C_Sel1;
144 --
145 -- Set the AOL updated WHO values
146 --
147 l_last_update_date := sysdate;
148 l_last_updated_by := fnd_global.user_id;
149 l_last_update_login := fnd_global.login_id;
150 End If;
151 --
152 --
153 --
154 -- Insert the row into: hr_de_soc_ins_contr_lvls_f
155 --
156 insert into hr_de_soc_ins_contr_lvls_f
157 (soc_ins_contr_lvls_id
158 ,organization_id
159 ,normal_percentage
160 ,normal_amount
161 ,increased_percentage
162 ,increased_amount
163 ,reduced_percentage
164 ,reduced_amount
165 ,effective_start_date
166 ,effective_end_date
167 ,attribute_category
168 ,attribute1
169 ,attribute2
170 ,attribute3
171 ,attribute4
172 ,attribute5
173 ,attribute6
174 ,attribute7
175 ,attribute8
176 ,attribute9
177 ,attribute10
178 ,attribute11
179 ,attribute12
180 ,attribute13
181 ,attribute14
182 ,attribute15
183 ,attribute16
184 ,attribute17
185 ,attribute18
186 ,attribute19
187 ,attribute20
188 ,object_version_number
189 ,attribute21
190 ,attribute22
191 ,attribute23
192 ,attribute24
193 ,attribute25
194 ,attribute26
195 ,attribute27
196 ,attribute28
197 ,attribute29
198 ,attribute30
199 ,flat_tax_limit_per_month
200 ,flat_tax_limit_per_year
201 ,min_increased_contribution
202 ,max_increased_contribution
203 ,month1
204 ,month1_min_contribution
205 ,month1_max_contribution
206 ,month2
207 ,month2_min_contribution
208 ,month2_max_contribution
209 ,employee_contribution
210 ,contribution_level_type
211 ,created_by
212 ,creation_date
213 ,last_update_date
214 ,last_updated_by
215 ,last_update_login
216 )
217 Values
218 (p_rec.soc_ins_contr_lvls_id
219 ,p_rec.organization_id
220 ,p_rec.normal_percentage
221 ,p_rec.normal_amount
222 ,p_rec.increased_percentage
223 ,p_rec.increased_amount
224 ,p_rec.reduced_percentage
225 ,p_rec.reduced_amount
226 ,p_rec.effective_start_date
227 ,p_rec.effective_end_date
228 ,p_rec.attribute_category
229 ,p_rec.attribute1
230 ,p_rec.attribute2
231 ,p_rec.attribute3
232 ,p_rec.attribute4
233 ,p_rec.attribute5
234 ,p_rec.attribute6
235 ,p_rec.attribute7
236 ,p_rec.attribute8
237 ,p_rec.attribute9
238 ,p_rec.attribute10
239 ,p_rec.attribute11
240 ,p_rec.attribute12
241 ,p_rec.attribute13
242 ,p_rec.attribute14
243 ,p_rec.attribute15
244 ,p_rec.attribute16
245 ,p_rec.attribute17
246 ,p_rec.attribute18
247 ,p_rec.attribute19
248 ,p_rec.attribute20
249 ,p_rec.object_version_number
250 ,p_rec.attribute21
251 ,p_rec.attribute22
252 ,p_rec.attribute23
253 ,p_rec.attribute24
254 ,p_rec.attribute25
255 ,p_rec.attribute26
256 ,p_rec.attribute27
257 ,p_rec.attribute28
258 ,p_rec.attribute29
259 ,p_rec.attribute30
260 ,p_rec.flat_tax_limit_per_month
261 ,p_rec.flat_tax_limit_per_year
262 ,p_rec.min_increased_contribution
263 ,p_rec.max_increased_contribution
264 ,p_rec.month1
265 ,p_rec.month1_min_contribution
266 ,p_rec.month1_max_contribution
267 ,p_rec.month2
268 ,p_rec.month2_min_contribution
269 ,p_rec.month2_max_contribution
270 ,p_rec.employee_contribution
271 ,p_rec.contribution_level_type
272 ,l_created_by
273 ,l_creation_date
274 ,l_last_update_date
275 ,l_last_updated_by
276 ,l_last_update_login
277 );
278 --
279 --
280 hr_utility.set_location(' Leaving:'||l_proc, 15);
281 --
282 Exception
283 When hr_api.check_integrity_violated Then
284 -- A check constraint has been violated
285 --
286 hr_cle_shd.constraint_error
287 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
288 When hr_api.unique_integrity_violated Then
289 -- Unique integrity has been violated
290 --
291 hr_cle_shd.constraint_error
292 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
293 When Others Then
294 --
295 Raise;
296 End dt_insert_dml;
297 --
298 -- ----------------------------------------------------------------------------
299 -- |------------------------------< insert_dml >------------------------------|
300 -- ----------------------------------------------------------------------------
301 Procedure insert_dml
302 (p_rec in out nocopy hr_cle_shd.g_rec_type
303 ,p_effective_date in date
304 ,p_datetrack_mode in varchar2
305 ,p_validation_start_date in date
306 ,p_validation_end_date in date
307 ) is
308 --
309 l_proc varchar2(72) := g_package||'insert_dml';
310 --
311 Begin
312 hr_utility.set_location('Entering:'||l_proc, 5);
313 --
314 hr_cle_ins.dt_insert_dml
315 (p_rec => p_rec
316 ,p_effective_date => p_effective_date
317 ,p_datetrack_mode => p_datetrack_mode
318 ,p_validation_start_date => p_validation_start_date
319 ,p_validation_end_date => p_validation_end_date
320 );
321 --
322 hr_utility.set_location(' Leaving:'||l_proc, 10);
323 End insert_dml;
324 --
325 -- ----------------------------------------------------------------------------
326 -- |------------------------------< pre_insert >------------------------------|
327 -- ----------------------------------------------------------------------------
328 -- {Start Of Comments}
329 --
330 -- Description:
331 -- This private procedure contains any processing which is required before
332 -- the insert dml. Presently, if the entity has a corresponding primary
333 -- key which is maintained by an associating sequence, the primary key for
334 -- the entity will be populated with the next sequence value in
335 -- preparation for the insert dml.
336 -- Also, if comments are defined for this entity, the comments insert
337 -- logic will also be called, generating a comment_id if required.
338 --
339 -- Prerequisites:
340 -- This is an internal procedure which is called from the ins procedure.
341 --
342 -- In Parameters:
343 -- A Pl/Sql record structure.
344 --
345 -- Post Success:
346 -- Processing continues.
347 --
348 -- Post Failure:
349 -- If an error has occurred, an error message and exception will be raised
350 -- but not handled.
351 --
352 -- Developer Implementation Notes:
353 -- Any pre-processing required before the insert dml is issued should be
354 -- coded within this procedure. As stated above, a good example is the
355 -- generation of a primary key number via a corresponding sequence.
356 -- It is important to note that any 3rd party maintenance should be reviewed
357 -- before placing in this procedure.
358 --
359 -- Access Status:
360 -- Internal Row Handler Use Only.
361 --
362 -- {End Of Comments}
363 -- ----------------------------------------------------------------------------
364 Procedure pre_insert
365 (p_rec in out nocopy hr_cle_shd.g_rec_type
366 ,p_effective_date in date
367 ,p_datetrack_mode in varchar2
368 ,p_validation_start_date in date
369 ,p_validation_end_date in date
370 ) is
371 --
372 Cursor C_Sel1 is select hr_de_soc_ins_contr_lvls_s.nextval from sys.dual;
373 --
374 Cursor C_Sel2 is
375 Select null
376 from hr_de_soc_ins_contr_lvls_f
377 where soc_ins_contr_lvls_id =
378 hr_cle_ins.g_soc_ins_contr_lvls_id_i;
379 --
380 l_proc varchar2(72) := g_package||'pre_insert';
381 l_exists varchar2(1);
382 --
383 Begin
384 hr_utility.set_location('Entering:'||l_proc, 5);
385 --
386 If (hr_cle_ins.g_soc_ins_contr_lvls_id_i is not null) Then
387 --
388 -- Verify registered primary key values not already in use
389 --
390 Open C_Sel2;
391 Fetch C_Sel2 into l_exists;
392 If C_Sel2%found Then
393 Close C_Sel2;
394 --
395 -- The primary key values are already in use.
396 --
397 fnd_message.set_name('PER','PER_289391_KEY_ALREADY_USED');
398 fnd_message.set_token('TABLE_NAME','hr_de_soc_ins_contr_lvls_f');
399 fnd_message.raise_error;
400 End If;
401 Close C_Sel2;
402 --
403 -- Use registered key values and clear globals
404 --
405 p_rec.soc_ins_contr_lvls_id :=
406 hr_cle_ins.g_soc_ins_contr_lvls_id_i;
407 hr_cle_ins.g_soc_ins_contr_lvls_id_i := null;
408 Else
409 --
410 -- No registerd key values, so select the next sequence number
411 --
412 --
413 -- Select the next sequence number
414 --
415 Open C_Sel1;
416 Fetch C_Sel1 Into p_rec.soc_ins_contr_lvls_id;
417 Close C_Sel1;
418 End If;
419 --
420 --
421 hr_utility.set_location(' Leaving:'||l_proc, 10);
422 End pre_insert;
423 --
424 -- ----------------------------------------------------------------------------
425 -- |----------------------------< post_insert >-------------------------------|
426 -- ----------------------------------------------------------------------------
427 -- {Start Of Comments}
428 --
429 -- Description:
430 -- This private procedure contains any processing which is required after
431 -- the insert dml.
432 --
433 -- Prerequisites:
434 -- This is an internal procedure which is called from the ins procedure.
435 --
436 -- In Parameters:
437 -- A Pl/Sql record structure.
438 --
439 -- Post Success:
440 -- Processing continues.
441 --
442 -- Post Failure:
443 -- If an error has occurred, an error message and exception will be raised
444 -- but not handled.
445 --
446 -- Developer Implementation Notes:
447 -- Any post-processing required after the insert dml is issued should be
448 -- coded within this procedure. It is important to note that any 3rd party
449 -- maintenance should be reviewed before placing in this procedure.
450 --
451 -- Access Status:
452 -- Internal Row Handler Use Only.
453 --
454 -- {End Of Comments}
455 -- ----------------------------------------------------------------------------
456 Procedure post_insert
457 (p_rec in hr_cle_shd.g_rec_type
458 ,p_effective_date in date
459 ,p_datetrack_mode in varchar2
460 ,p_validation_start_date in date
461 ,p_validation_end_date in date
462 ) is
463 --
464 l_proc varchar2(72) := g_package||'post_insert';
465 --
466 Begin
467 hr_utility.set_location('Entering:'||l_proc, 5);
468 begin
469 --
470 hr_cle_rki.after_insert
471 (p_effective_date
472 => p_effective_date
473 ,p_validation_start_date
474 => p_validation_start_date
475 ,p_validation_end_date
476 => p_validation_end_date
477 ,p_soc_ins_contr_lvls_id
478 => p_rec.soc_ins_contr_lvls_id
479 ,p_organization_id
480 => p_rec.organization_id
481 ,p_normal_percentage
482 => p_rec.normal_percentage
483 ,p_normal_amount
484 => p_rec.normal_amount
485 ,p_increased_percentage
486 => p_rec.increased_percentage
487 ,p_increased_amount
488 => p_rec.increased_amount
489 ,p_reduced_percentage
490 => p_rec.reduced_percentage
491 ,p_reduced_amount
492 => p_rec.reduced_amount
493 ,p_effective_start_date
494 => p_rec.effective_start_date
495 ,p_effective_end_date
496 => p_rec.effective_end_date
497 ,p_attribute_category
498 => p_rec.attribute_category
499 ,p_attribute1
500 => p_rec.attribute1
501 ,p_attribute2
502 => p_rec.attribute2
503 ,p_attribute3
504 => p_rec.attribute3
505 ,p_attribute4
506 => p_rec.attribute4
507 ,p_attribute5
508 => p_rec.attribute5
509 ,p_attribute6
510 => p_rec.attribute6
511 ,p_attribute7
512 => p_rec.attribute7
513 ,p_attribute8
514 => p_rec.attribute8
515 ,p_attribute9
516 => p_rec.attribute9
517 ,p_attribute10
518 => p_rec.attribute10
519 ,p_attribute11
520 => p_rec.attribute11
521 ,p_attribute12
522 => p_rec.attribute12
523 ,p_attribute13
524 => p_rec.attribute13
525 ,p_attribute14
526 => p_rec.attribute14
527 ,p_attribute15
528 => p_rec.attribute15
529 ,p_attribute16
530 => p_rec.attribute16
531 ,p_attribute17
532 => p_rec.attribute17
533 ,p_attribute18
534 => p_rec.attribute18
535 ,p_attribute19
536 => p_rec.attribute19
537 ,p_attribute20
538 => p_rec.attribute20
539 ,p_object_version_number
540 => p_rec.object_version_number
541 ,p_attribute21
542 => p_rec.attribute21
543 ,p_attribute22
544 => p_rec.attribute22
545 ,p_attribute23
546 => p_rec.attribute23
547 ,p_attribute24
548 => p_rec.attribute24
549 ,p_attribute25
550 => p_rec.attribute25
551 ,p_attribute26
552 => p_rec.attribute26
553 ,p_attribute27
554 => p_rec.attribute27
555 ,p_attribute28
556 => p_rec.attribute28
557 ,p_attribute29
558 => p_rec.attribute29
559 ,p_attribute30
560 => p_rec.attribute30
561 ,p_flat_tax_limit_per_month
562 => p_rec.flat_tax_limit_per_month
563 ,p_flat_tax_limit_per_year
564 => p_rec.flat_tax_limit_per_year
565 ,p_min_increased_contribution
566 => p_rec.min_increased_contribution
567 ,p_max_increased_contribution
568 => p_rec.max_increased_contribution
569 ,p_month1
570 => p_rec.month1
571 ,p_month1_min_contribution
572 => p_rec.month1_min_contribution
573 ,p_month1_max_contribution
574 => p_rec.month1_max_contribution
575 ,p_month2
576 => p_rec.month2
577 ,p_month2_min_contribution
578 => p_rec.month2_min_contribution
579 ,p_month2_max_contribution
580 => p_rec.month2_max_contribution
581 ,p_employee_contribution
582 => p_rec.employee_contribution
583 ,p_contribution_level_type
584 => p_rec.contribution_level_type
585 );
586 --
587 exception
588 --
589 when hr_api.cannot_find_prog_unit then
590 --
591 hr_api.cannot_find_prog_unit_error
592 (p_module_name => 'HR_DE_SOC_INS_CONTR_LVLS_F'
593 ,p_hook_type => 'AI');
594 --
595 end;
596 --
597 hr_utility.set_location(' Leaving:'||l_proc, 10);
598 End post_insert;
599 --
600 -- ----------------------------------------------------------------------------
601 -- |-------------------------------< ins_lck >--------------------------------|
602 -- ----------------------------------------------------------------------------
603 -- {Start Of Comments}
604 --
605 -- Description:
606 -- The ins_lck process has one main function to perform. When inserting
607 -- a datetracked row, we must validate the DT mode.
608 --
609 -- Prerequisites:
610 -- This procedure can only be called for the datetrack mode of INSERT.
611 --
612 -- In Parameters:
613 --
614 -- Post Success:
615 -- On successful completion of the ins_lck process the parental
616 -- datetracked rows will be locked providing the p_enforce_foreign_locking
617 -- argument value is TRUE.
618 -- If the p_enforce_foreign_locking argument value is FALSE then the
619 -- parential rows are not locked.
620 --
621 -- Post Failure:
622 -- The Lck process can fail for:
623 -- 1) When attempting to lock the row the row could already be locked by
624 -- another user. This will raise the HR_Api.Object_Locked exception.
625 -- 2) When attempting to the lock the parent which doesn't exist.
626 -- For the entity to be locked the parent must exist!
627 --
628 -- Developer Implementation Notes:
629 -- None.
630 --
631 -- Access Status:
632 -- Internal Row Handler Use Only.
633 --
634 -- {End Of Comments}
635 -- ----------------------------------------------------------------------------
636 Procedure ins_lck
637 (p_effective_date in date
638 ,p_datetrack_mode in varchar2
639 ,p_rec in hr_cle_shd.g_rec_type
640 ,p_validation_start_date out nocopy date
641 ,p_validation_end_date out nocopy date
642 ) is
643 --
644 l_proc varchar2(72) := g_package||'ins_lck';
645 l_validation_start_date date;
646 l_validation_end_date date;
647 --
648 Begin
649 hr_utility.set_location('Entering:'||l_proc, 5);
650 --
651 -- Validate the datetrack mode mode getting the validation start
652 -- and end dates for the specified datetrack operation.
653 --
654 dt_api.validate_dt_mode
655 (p_effective_date => p_effective_date
656 ,p_datetrack_mode => p_datetrack_mode
657 ,p_base_table_name => 'hr_de_soc_ins_contr_lvls_f'
658 ,p_base_key_column => 'soc_ins_contr_lvls_id'
659 ,p_base_key_value => p_rec.soc_ins_contr_lvls_id
660 ,p_enforce_foreign_locking => true
661 ,p_validation_start_date => l_validation_start_date
662 ,p_validation_end_date => l_validation_end_date
663 );
664 --
665 -- Set the validation start and end date OUT arguments
666 --
667 p_validation_start_date := l_validation_start_date;
668 p_validation_end_date := l_validation_end_date;
669 --
670 hr_utility.set_location(' Leaving:'||l_proc, 10);
671 --
672 End ins_lck;
673 --
674 -- ----------------------------------------------------------------------------
675 -- |---------------------------------< ins >----------------------------------|
676 -- ----------------------------------------------------------------------------
677 Procedure ins
678 (p_effective_date in date
679 ,p_rec in out nocopy hr_cle_shd.g_rec_type
680 ) is
681 --
682 l_proc varchar2(72) := g_package||'ins';
683 l_datetrack_mode varchar2(30) := hr_api.g_insert;
684 l_validation_start_date date;
685 l_validation_end_date date;
686 --
687 Begin
688 hr_utility.set_location('Entering:'||l_proc, 5);
689 --
690 -- Call the lock operation
691 --
692 hr_cle_ins.ins_lck
693 (p_effective_date => p_effective_date
694 ,p_datetrack_mode => l_datetrack_mode
695 ,p_rec => p_rec
696 ,p_validation_start_date => l_validation_start_date
697 ,p_validation_end_date => l_validation_end_date
698 );
699 --
700 -- Call the supporting insert validate operations
701 --
702 hr_cle_bus.insert_validate
703 (p_rec => p_rec
704 ,p_effective_date => p_effective_date
705 ,p_datetrack_mode => l_datetrack_mode
706 ,p_validation_start_date => l_validation_start_date
707 ,p_validation_end_date => l_validation_end_date
708 );
709 --
710 -- Call the supporting pre-insert operation
711 --
712 hr_cle_ins.pre_insert
713 (p_rec => p_rec
714 ,p_effective_date => p_effective_date
715 ,p_datetrack_mode => l_datetrack_mode
716 ,p_validation_start_date => l_validation_start_date
717 ,p_validation_end_date => l_validation_end_date
718 );
719 --
720 -- Insert the row
721 --
722 hr_cle_ins.insert_dml
723 (p_rec => p_rec
724 ,p_effective_date => p_effective_date
725 ,p_datetrack_mode => l_datetrack_mode
726 ,p_validation_start_date => l_validation_start_date
727 ,p_validation_end_date => l_validation_end_date
728 );
729 --
730 -- Call the supporting post-insert operation
731 --
732 hr_cle_ins.post_insert
733 (p_rec => p_rec
734 ,p_effective_date => p_effective_date
735 ,p_datetrack_mode => l_datetrack_mode
736 ,p_validation_start_date => l_validation_start_date
737 ,p_validation_end_date => l_validation_end_date
738 );
739 --
740 hr_utility.set_location('Leaving:'||l_proc,10);
741 end ins;
742 --
743 -- ----------------------------------------------------------------------------
744 -- |---------------------------------< ins >----------------------------------|
745 -- ----------------------------------------------------------------------------
746 Procedure ins
747 (p_effective_date in date
748 ,p_organization_id in number
749 ,p_normal_percentage in number
750 ,p_increased_percentage in number
751 ,p_reduced_percentage in number
752 ,p_normal_amount in number default null
753 ,p_increased_amount in number default null
754 ,p_reduced_amount in number default null
755 ,p_attribute_category in varchar2 default null
756 ,p_attribute1 in varchar2 default null
757 ,p_attribute2 in varchar2 default null
758 ,p_attribute3 in varchar2 default null
759 ,p_attribute4 in varchar2 default null
760 ,p_attribute5 in varchar2 default null
761 ,p_attribute6 in varchar2 default null
762 ,p_attribute7 in varchar2 default null
763 ,p_attribute8 in varchar2 default null
764 ,p_attribute9 in varchar2 default null
765 ,p_attribute10 in varchar2 default null
766 ,p_attribute11 in varchar2 default null
767 ,p_attribute12 in varchar2 default null
768 ,p_attribute13 in varchar2 default null
769 ,p_attribute14 in varchar2 default null
770 ,p_attribute15 in varchar2 default null
771 ,p_attribute16 in varchar2 default null
772 ,p_attribute17 in varchar2 default null
773 ,p_attribute18 in varchar2 default null
774 ,p_attribute19 in varchar2 default null
775 ,p_attribute20 in varchar2 default null
776 ,p_attribute21 in varchar2 default null
777 ,p_attribute22 in varchar2 default null
778 ,p_attribute23 in varchar2 default null
779 ,p_attribute24 in varchar2 default null
780 ,p_attribute25 in varchar2 default null
781 ,p_attribute26 in varchar2 default null
782 ,p_attribute27 in varchar2 default null
783 ,p_attribute28 in varchar2 default null
784 ,p_attribute29 in varchar2 default null
785 ,p_attribute30 in varchar2 default null
786 ,p_flat_tax_limit_per_month in number default null
787 ,p_flat_tax_limit_per_year in number default null
788 ,p_min_increased_contribution in number default null
789 ,p_max_increased_contribution in number default null
790 ,p_month1 in varchar2 default null
791 ,p_month1_min_contribution in number default null
792 ,p_month1_max_contribution in number default null
793 ,p_month2 in varchar2 default null
794 ,p_month2_min_contribution in number default null
795 ,p_month2_max_contribution in number default null
796 ,p_employee_contribution in number default null
797 ,p_contribution_level_type in varchar2 default null
798 ,p_soc_ins_contr_lvls_id out nocopy number
799 ,p_object_version_number out nocopy number
800 ,p_effective_start_date out nocopy date
801 ,p_effective_end_date out nocopy date
802 ) is
803 --
804 l_rec hr_cle_shd.g_rec_type;
805 l_proc varchar2(72) := g_package||'ins';
806 --
807 Begin
808 hr_utility.set_location('Entering:'||l_proc, 5);
809 --
810 -- Call conversion function to turn arguments into the
811 -- p_rec structure.
812 --
813 l_rec :=
814 hr_cle_shd.convert_args
815 (null
816 ,p_organization_id
817 ,p_normal_percentage
818 ,p_normal_amount
819 ,p_increased_percentage
820 ,p_increased_amount
821 ,p_reduced_percentage
822 ,p_reduced_amount
823 ,null
824 ,null
825 ,p_attribute_category
826 ,p_attribute1
827 ,p_attribute2
828 ,p_attribute3
829 ,p_attribute4
830 ,p_attribute5
831 ,p_attribute6
832 ,p_attribute7
833 ,p_attribute8
834 ,p_attribute9
835 ,p_attribute10
836 ,p_attribute11
837 ,p_attribute12
838 ,p_attribute13
839 ,p_attribute14
840 ,p_attribute15
841 ,p_attribute16
842 ,p_attribute17
843 ,p_attribute18
844 ,p_attribute19
845 ,p_attribute20
846 ,null
847 ,p_attribute21
848 ,p_attribute22
849 ,p_attribute23
850 ,p_attribute24
851 ,p_attribute25
852 ,p_attribute26
853 ,p_attribute27
854 ,p_attribute28
855 ,p_attribute29
856 ,p_attribute30
857 ,p_flat_tax_limit_per_month
858 ,p_flat_tax_limit_per_year
859 ,p_min_increased_contribution
860 ,p_max_increased_contribution
861 ,p_month1
862 ,p_month1_min_contribution
863 ,p_month1_max_contribution
864 ,p_month2
865 ,p_month2_min_contribution
866 ,p_month2_max_contribution
867 ,p_employee_contribution
868 ,p_contribution_level_type
869 );
870 --
871 -- Having converted the arguments into the hr_cle_rec
872 -- plsql record structure we call the corresponding record
873 -- business process.
874 --
875 hr_cle_ins.ins
876 (p_effective_date
877 ,l_rec
878 );
879 --
880 -- Set the OUT arguments.
881 --
882 p_soc_ins_contr_lvls_id := l_rec.soc_ins_contr_lvls_id;
883 p_effective_start_date := l_rec.effective_start_date;
884 p_effective_end_date := l_rec.effective_end_date;
885 p_object_version_number := l_rec.object_version_number;
886 --
887 --
888 hr_utility.set_location(' Leaving:'||l_proc, 10);
889 End ins;
890 --
891 end hr_cle_ins;