DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_PSD_INS

Source


1 Package Body pay_psd_ins as
2 /* $Header: pypsdrhi.pkb 120.1 2005/12/08 05:08 ssekhar noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pay_psd_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_sii_details_id_i  number   default null;
14 --
15 -- ----------------------------------------------------------------------------
16 -- |------------------------< set_base_key_value >----------------------------|
17 -- ----------------------------------------------------------------------------
18 procedure set_base_key_value
19   (p_sii_details_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   pay_psd_ins.g_sii_details_id_i := p_sii_details_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 pay_psd_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   pay_pl_sii_details_f t
92     where  t.sii_details_id       = p_rec.sii_details_id
93     and    t.effective_start_date =
94              pay_psd_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          pay_pl_sii_details_f.created_by%TYPE;
99   l_creation_date       pay_pl_sii_details_f.creation_date%TYPE;
100   l_last_update_date    pay_pl_sii_details_f.last_update_date%TYPE;
101   l_last_updated_by     pay_pl_sii_details_f.last_updated_by%TYPE;
102   l_last_update_login   pay_pl_sii_details_f.last_update_login%TYPE;
103 --
104 Begin
105   hr_utility.set_location('Entering:'||l_proc, 5);
106   --
107   -- Set the effective start and end dates to the corresponding
108   -- validation start and end dates
109   --
110   p_rec.effective_start_date := p_validation_start_date;
111   p_rec.effective_end_date   := p_validation_end_date;
112   --
113   -- If the datetrack_mode is not INSERT then we must populate the WHO
114   -- columns with the 'old' creation values and 'new' updated values.
115   --
116   If (p_datetrack_mode <> hr_api.g_insert) then
117     hr_utility.set_location(l_proc, 10);
118     --
119       -- Get the object version number for the insert
120   --
121   p_rec.object_version_number :=
122     dt_api.get_object_version_number
123       (p_base_table_name => 'pay_pl_sii_details_f'
124       ,p_base_key_column => 'sii_details_id'
125       ,p_base_key_value  => p_rec.sii_details_id
126       );
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   Else
151     p_rec.object_version_number := 1;  -- Initialise the object version
152   End If;
153   --
154   --
155   --
156   -- Insert the row into: pay_pl_sii_details_f
157   --
158   insert into pay_pl_sii_details_f
159       (sii_details_id
160       ,effective_start_date
161       ,effective_end_date
162       ,per_or_asg_id
163       ,business_group_id
164       ,contract_category
165       ,object_version_number
166       ,emp_social_security_info
167       ,old_age_contribution
168       ,pension_contribution
169       ,sickness_contribution
170       ,work_injury_contribution
171       ,labor_contribution
172       ,health_contribution
173       ,unemployment_contribution
174       ,old_age_cont_end_reason
175       ,pension_cont_end_reason
176       ,sickness_cont_end_reason
177       ,work_injury_cont_end_reason
178       ,labor_fund_cont_end_reason
179       ,health_cont_end_reason
180       ,unemployment_cont_end_reason
181       ,program_id
182       ,program_login_id
183       ,program_application_id
184       ,request_id
185       ,created_by
186       ,creation_date
187       ,last_update_date
188       ,last_updated_by
189       ,last_update_login
190       )
191   Values
192     (p_rec.sii_details_id
193     ,p_rec.effective_start_date
194     ,p_rec.effective_end_date
195     ,p_rec.per_or_asg_id
196     ,p_rec.business_group_id
197     ,p_rec.contract_category
198     ,p_rec.object_version_number
199     ,p_rec.emp_social_security_info
200     ,p_rec.old_age_contribution
201     ,p_rec.pension_contribution
202     ,p_rec.sickness_contribution
203     ,p_rec.work_injury_contribution
204     ,p_rec.labor_contribution
205     ,p_rec.health_contribution
206     ,p_rec.unemployment_contribution
207     ,p_rec.old_age_cont_end_reason
208     ,p_rec.pension_cont_end_reason
209     ,p_rec.sickness_cont_end_reason
210     ,p_rec.work_injury_cont_end_reason
211     ,p_rec.labor_fund_cont_end_reason
212     ,p_rec.health_cont_end_reason
213     ,p_rec.unemployment_cont_end_reason
214     ,p_rec.program_id
215     ,p_rec.program_login_id
216     ,p_rec.program_application_id
217     ,p_rec.request_id
218     ,l_created_by
219     ,l_creation_date
220     ,l_last_update_date
221     ,l_last_updated_by
222     ,l_last_update_login
223     );
224   --
225   --
226   hr_utility.set_location(' Leaving:'||l_proc, 15);
227 --
228 Exception
229   When hr_api.check_integrity_violated Then
230     -- A check constraint has been violated
231     --
232     pay_psd_shd.constraint_error
233       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
234   When hr_api.unique_integrity_violated Then
235     -- Unique integrity has been violated
236     --
237     pay_psd_shd.constraint_error
238       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
239   When Others Then
240     --
241     Raise;
242 End dt_insert_dml;
243 --
244 -- ----------------------------------------------------------------------------
245 -- |------------------------------< insert_dml >------------------------------|
246 -- ----------------------------------------------------------------------------
247 Procedure insert_dml
248   (p_rec                   in out nocopy pay_psd_shd.g_rec_type
249   ,p_effective_date        in date
250   ,p_datetrack_mode        in varchar2
251   ,p_validation_start_date in date
252   ,p_validation_end_date   in date
253   ) is
254 --
255   l_proc        varchar2(72) := g_package||'insert_dml';
256 --
257 Begin
258   hr_utility.set_location('Entering:'||l_proc, 5);
259   --
260   pay_psd_ins.dt_insert_dml
261     (p_rec                   => p_rec
262     ,p_effective_date        => p_effective_date
263     ,p_datetrack_mode        => p_datetrack_mode
264     ,p_validation_start_date => p_validation_start_date
265     ,p_validation_end_date   => p_validation_end_date
266     );
267   --
268   hr_utility.set_location(' Leaving:'||l_proc, 10);
269 End insert_dml;
270 --
271 -- ----------------------------------------------------------------------------
272 -- |------------------------------< pre_insert >------------------------------|
273 -- ----------------------------------------------------------------------------
274 -- {Start Of Comments}
275 --
276 -- Description:
277 --   This private procedure contains any processing which is required before
278 --   the insert dml. Presently, if the entity has a corresponding primary
279 --   key which is maintained by an associating sequence, the primary key for
280 --   the entity will be populated with the next sequence value in
281 --   preparation for the insert dml.
282 --   Also, if comments are defined for this entity, the comments insert
283 --   logic will also be called, generating a comment_id if required.
284 --
285 -- Prerequisites:
286 --   This is an internal procedure which is called from the ins procedure.
287 --
288 -- In Parameters:
289 --   A Pl/Sql record structure.
290 --
291 -- Post Success:
292 --   Processing continues.
293 --
294 -- Post Failure:
295 --   If an error has occurred, an error message and exception will be raised
296 --   but not handled.
297 --
298 -- Developer Implementation Notes:
299 --   Any pre-processing required before the insert dml is issued should be
300 --   coded within this procedure. As stated above, a good example is the
301 --   generation of a primary key number via a corresponding sequence.
302 --   It is important to note that any 3rd party maintenance should be reviewed
303 --   before placing in this procedure.
304 --
305 -- Access Status:
306 --   Internal Row Handler Use Only.
307 --
308 -- {End Of Comments}
309 -- ----------------------------------------------------------------------------
310 Procedure pre_insert
311   (p_rec                   in out nocopy pay_psd_shd.g_rec_type
312   ,p_effective_date        in date
313   ,p_datetrack_mode        in varchar2
314   ,p_validation_start_date in date
315   ,p_validation_end_date   in date
316   ) is
317 --
318   Cursor C_Sel1 is select pay_pl_sii_details_s.nextval from sys.dual;
319 --
320  Cursor C_Sel2 is
321     Select null
322       from pay_pl_sii_details_f
323      where sii_details_id =
324              pay_psd_ins.g_sii_details_id_i;
325 --
326   l_proc        varchar2(72) := g_package||'pre_insert';
327   l_exists      varchar2(1);
328 --
329 Begin
330   hr_utility.set_location('Entering:'||l_proc, 5);
331   --
332     If (pay_psd_ins.g_sii_details_id_i is not null) Then
333     --
334     -- Verify registered primary key values not already in use
335     --
336     Open C_Sel2;
337     Fetch C_Sel2 into l_exists;
338     If C_Sel2%found Then
339        Close C_Sel2;
340        --
341        -- The primary key values are already in use.
342        --
343        fnd_message.set_name('PER','PER_289391_KEY_ALREADY_USED');
344        fnd_message.set_token('TABLE_NAME','pay_pl_sii_details_f');
345        fnd_message.raise_error;
346     End If;
347     Close C_Sel2;
348     --
349     -- Use registered key values and clear globals
350     --
351     p_rec.sii_details_id :=
352       pay_psd_ins.g_sii_details_id_i;
353     pay_psd_ins.g_sii_details_id_i := null;
354   Else
355     --
356     -- No registerd key values, so select the next sequence number
357     --
358     --
359     -- Select the next sequence number
360     --
361     Open C_Sel1;
362     Fetch C_Sel1 Into p_rec.sii_details_id;
363     Close C_Sel1;
364   End If;
365   --
366   --
367   hr_utility.set_location(' Leaving:'||l_proc, 10);
368 End pre_insert;
369 --
370 -- ----------------------------------------------------------------------------
371 -- |----------------------------< post_insert >-------------------------------|
372 -- ----------------------------------------------------------------------------
373 -- {Start Of Comments}
374 --
375 -- Description:
376 --   This private procedure contains any processing which is required after
377 --   the insert dml.
378 --
379 -- Prerequisites:
380 --   This is an internal procedure which is called from the ins procedure.
381 --
382 -- In Parameters:
383 --   A Pl/Sql record structure.
384 --
385 -- Post Success:
386 --   Processing continues.
387 --
388 -- Post Failure:
389 --   If an error has occurred, an error message and exception will be raised
390 --   but not handled.
391 --
392 -- Developer Implementation Notes:
393 --   Any post-processing required after the insert dml is issued should be
394 --   coded within this procedure. It is important to note that any 3rd party
395 --   maintenance should be reviewed before placing in this procedure.
396 --
397 -- Access Status:
398 --   Internal Row Handler Use Only.
399 --
400 -- {End Of Comments}
401 -- ----------------------------------------------------------------------------
402 Procedure post_insert
403   (p_rec                   in pay_psd_shd.g_rec_type
404   ,p_effective_date        in date
405   ,p_datetrack_mode        in varchar2
406   ,p_validation_start_date in date
407   ,p_validation_end_date   in date
408   ) is
409 --
410   l_proc        varchar2(72) := g_package||'post_insert';
411 --
412 Begin
413   hr_utility.set_location('Entering:'||l_proc, 5);
414   begin
415     --
416     pay_psd_rki.after_insert
417       (p_effective_date
418       => p_effective_date
419       ,p_validation_start_date
420       => p_validation_start_date
421       ,p_validation_end_date
422       => p_validation_end_date
423       ,p_sii_details_id
424       => p_rec.sii_details_id
425       ,p_effective_start_date
426       => p_rec.effective_start_date
427       ,p_effective_end_date
428       => p_rec.effective_end_date
429       ,p_per_or_asg_id
430       => p_rec.per_or_asg_id
431       ,p_business_group_id
432       => p_rec.business_group_id
433       ,p_contract_category
434       => p_rec.contract_category
435       ,p_object_version_number
436       => p_rec.object_version_number
437       ,p_emp_social_security_info
438       => p_rec.emp_social_security_info
439       ,p_old_age_contribution
440       => p_rec.old_age_contribution
441       ,p_pension_contribution
442       => p_rec.pension_contribution
443       ,p_sickness_contribution
444       => p_rec.sickness_contribution
445       ,p_work_injury_contribution
446       => p_rec.work_injury_contribution
447       ,p_labor_contribution
448       => p_rec.labor_contribution
449       ,p_health_contribution
450       => p_rec.health_contribution
451       ,p_unemployment_contribution
452       => p_rec.unemployment_contribution
453       ,p_old_age_cont_end_reason
454       => p_rec.old_age_cont_end_reason
455       ,p_pension_cont_end_reason
456       => p_rec.pension_cont_end_reason
457       ,p_sickness_cont_end_reason
458       => p_rec.sickness_cont_end_reason
459       ,p_work_injury_cont_end_reason
460       => p_rec.work_injury_cont_end_reason
461       ,p_labor_fund_cont_end_reason
462       => p_rec.labor_fund_cont_end_reason
463       ,p_health_cont_end_reason
464       => p_rec.health_cont_end_reason
465       ,p_unemployment_cont_end_reason
466       => p_rec.unemployment_cont_end_reason
467       ,p_program_id
468       => p_rec.program_id
469       ,p_program_login_id
470       => p_rec.program_login_id
471       ,p_program_application_id
472       => p_rec.program_application_id
473       ,p_request_id
474       => p_rec.request_id
475       );
476     --
477   exception
478     --
479     when hr_api.cannot_find_prog_unit then
480       --
481       hr_api.cannot_find_prog_unit_error
482         (p_module_name => 'PAY_PL_SII_DETAILS_F'
483         ,p_hook_type   => 'AI');
484       --
485   end;
486   --
487   hr_utility.set_location(' Leaving:'||l_proc, 10);
488 End post_insert;
489 --
490 -- ----------------------------------------------------------------------------
491 -- |-------------------------------< ins_lck >--------------------------------|
492 -- ----------------------------------------------------------------------------
493 -- {Start Of Comments}
494 --
495 -- Description:
496 --   The ins_lck process has one main function to perform. When inserting
497 --   a datetracked row, we must validate the DT mode.
498 --
499 -- Prerequisites:
500 --   This procedure can only be called for the datetrack mode of INSERT.
501 --
502 -- In Parameters:
503 --
504 -- Post Success:
505 --   On successful completion of the ins_lck process the parental
506 --   datetracked rows will be locked providing the p_enforce_foreign_locking
507 --   argument value is TRUE.
508 --   If the p_enforce_foreign_locking argument value is FALSE then the
509 --   parential rows are not locked.
510 --
511 -- Post Failure:
512 --   The Lck process can fail for:
513 --   1) When attempting to lock the row the row could already be locked by
514 --      another user. This will raise the HR_Api.Object_Locked exception.
515 --   2) When attempting to the lock the parent which doesn't exist.
516 --      For the entity to be locked the parent must exist!
517 --
518 -- Developer Implementation Notes:
519 --   None.
520 --
521 -- Access Status:
522 --   Internal Row Handler Use Only.
523 --
524 -- {End Of Comments}
525 -- ----------------------------------------------------------------------------
526 Procedure ins_lck
527   (p_effective_date        in date
528   ,p_datetrack_mode        in varchar2
529   ,p_rec                   in pay_psd_shd.g_rec_type
530   ,p_validation_start_date out nocopy date
531   ,p_validation_end_date   out nocopy date
532   ) is
533 --
534   l_proc                  varchar2(72) := g_package||'ins_lck';
535   l_validation_start_date date;
536   l_validation_end_date   date;
537 --
538 Begin
539   hr_utility.set_location('Entering:'||l_proc, 5);
540   --
541   -- Validate the datetrack mode mode getting the validation start
542   -- and end dates for the specified datetrack operation.
543   --
544   if p_rec.contract_category in ('CIVIL','TERM_NORMAL','LUMP','F_LUMP') then
545 
546   -- Here we are locking the corresponding Assignment record if
547   --  a) the Contract category is "CIVIL"  since the SII record for Civil Contracts are stored at the Assignment level
548   --  b) if the Contract Category is Normal and the Assignment is Terminated. This is cos for Normal Terminated assignments
549   --     the SII record is stored at the Assignment level
550   --  c) the Contract category is "LUMP" or "F_LUMP"
551 
552   dt_api.validate_dt_mode
553     (p_effective_date          => p_effective_date
554     ,p_datetrack_mode          => p_datetrack_mode
555     ,p_base_table_name         => 'pay_pl_sii_details_f'
556     ,p_base_key_column         => 'sii_details_id'
557     ,p_base_key_value          => p_rec.sii_details_id
558     ,p_parent_table_name1      => 'per_all_assignments_f'
559     ,p_parent_key_column1      => 'assignment_id'
560     ,p_parent_key_value1       => p_rec.per_or_asg_id
561     ,p_enforce_foreign_locking => true
562     ,p_validation_start_date   => l_validation_start_date
563     ,p_validation_end_date     => l_validation_end_date
564     );
565 
566  elsif p_rec.contract_category = 'NORMAL' then
567 
568   -- Here we are locking the corresponding Person record if the Contract category is
569   -- "NORMAL" since the SII record for Normal Contracts are stored at the Person level
570 
571   dt_api.validate_dt_mode
572     (p_effective_date          => p_effective_date
573     ,p_datetrack_mode          => p_datetrack_mode
574     ,p_base_table_name         => 'pay_pl_sii_details_f'
575     ,p_base_key_column         => 'sii_details_id'
576     ,p_base_key_value          => p_rec.sii_details_id
577     ,p_parent_table_name1      => 'per_people_f'
578     ,p_parent_key_column1      => 'person_id'
579     ,p_parent_key_value1       => p_rec.per_or_asg_id
580     ,p_enforce_foreign_locking => true
581     ,p_validation_start_date   => l_validation_start_date
582     ,p_validation_end_date     => l_validation_end_date
583     );
584 
585   end if;
586 
587   --
588   -- Set the validation start and end date OUT arguments
589   --
590   p_validation_start_date := l_validation_start_date;
591   p_validation_end_date   := l_validation_end_date;
592   --
593   hr_utility.set_location(' Leaving:'||l_proc, 10);
594   --
595 End ins_lck;
596 --
597 -- ----------------------------------------------------------------------------
598 -- |---------------------------------< ins >----------------------------------|
599 -- ----------------------------------------------------------------------------
600 Procedure ins
601   (p_effective_date in     date
602   ,p_rec            in out nocopy pay_psd_shd.g_rec_type
603   ) is
604 --
605   l_proc                        varchar2(72) := g_package||'ins';
606   l_datetrack_mode              varchar2(30) := hr_api.g_insert;
607   l_validation_start_date       date;
608   l_validation_end_date         date;
609 --
610 Begin
611   hr_utility.set_location('Entering:'||l_proc, 5);
612   --
613   -- Call the lock operation
614   --
615   pay_psd_ins.ins_lck
616     (p_effective_date        => p_effective_date
617     ,p_datetrack_mode        => l_datetrack_mode
618     ,p_rec                   => p_rec
619     ,p_validation_start_date => l_validation_start_date
620     ,p_validation_end_date   => l_validation_end_date
621     );
622   --
623   -- Call the supporting insert validate operations
624   --
625   pay_psd_bus.insert_validate
626     (p_rec                   => p_rec
627     ,p_effective_date        => p_effective_date
628     ,p_datetrack_mode        => l_datetrack_mode
629     ,p_validation_start_date => l_validation_start_date
630     ,p_validation_end_date   => l_validation_end_date
631     );
632   --
633   -- Call to raise any errors on multi-message list
634   hr_multi_message.end_validation_set;
635   --
636   -- Call the supporting pre-insert operation
637   --
638   pay_psd_ins.pre_insert
639     (p_rec                   => p_rec
640     ,p_effective_date        => p_effective_date
641     ,p_datetrack_mode        => l_datetrack_mode
642     ,p_validation_start_date => l_validation_start_date
643     ,p_validation_end_date   => l_validation_end_date
644     );
645   --
646   -- Insert the row
647   --
648   pay_psd_ins.insert_dml
649     (p_rec                   => p_rec
650     ,p_effective_date        => p_effective_date
651     ,p_datetrack_mode        => l_datetrack_mode
652     ,p_validation_start_date => l_validation_start_date
653     ,p_validation_end_date   => l_validation_end_date
654     );
655   --
656   -- Call the supporting post-insert operation
657   --
658   pay_psd_ins.post_insert
659     (p_rec                   => p_rec
660     ,p_effective_date        => p_effective_date
661     ,p_datetrack_mode        => l_datetrack_mode
662     ,p_validation_start_date => l_validation_start_date
663     ,p_validation_end_date   => l_validation_end_date
664     );
665   --
666   -- Call to raise any errors on multi-message list
667   hr_multi_message.end_validation_set;
668   --
669   hr_utility.set_location('Leaving:'||l_proc,10);
670 end ins;
671 --
672 -- ----------------------------------------------------------------------------
673 -- |---------------------------------< ins >----------------------------------|
674 -- ----------------------------------------------------------------------------
675 Procedure ins
676   (p_effective_date                 in     date
677   ,p_per_or_asg_id                  in     number
678   ,p_business_group_id              in     number
679   ,p_contract_category              in     varchar2
680   ,p_emp_social_security_info       in     varchar2
681   ,p_old_age_contribution           in     varchar2
682   ,p_pension_contribution           in     varchar2
683   ,p_sickness_contribution          in     varchar2
684   ,p_work_injury_contribution       in     varchar2
685   ,p_labor_contribution             in     varchar2
686   ,p_health_contribution            in     varchar2
687   ,p_unemployment_contribution      in     varchar2
688   ,p_old_age_cont_end_reason        in     varchar2 default null
689   ,p_pension_cont_end_reason        in     varchar2 default null
690   ,p_sickness_cont_end_reason       in     varchar2 default null
691   ,p_work_injury_cont_end_reason    in     varchar2 default null
692   ,p_labor_fund_cont_end_reason     in     varchar2 default null
693   ,p_health_cont_end_reason         in     varchar2 default null
694   ,p_unemployment_cont_end_reason   in     varchar2 default null
695   ,p_program_id                     in     number   default null
696   ,p_program_login_id               in     number   default null
697   ,p_program_application_id         in     number   default null
698   ,p_request_id                     in     number   default null
699   ,p_sii_details_id                    out nocopy number
700   ,p_object_version_number             out nocopy number
701   ,p_effective_start_date              out nocopy date
702   ,p_effective_end_date                out nocopy date
703   ) is
704 --
705   l_rec         pay_psd_shd.g_rec_type;
706   l_proc        varchar2(72) := g_package||'ins';
707 --
708 Begin
709   hr_utility.set_location('Entering:'||l_proc, 5);
710   --
711   -- Call conversion function to turn arguments into the
712   -- p_rec structure.
713   --
714   l_rec :=
715   pay_psd_shd.convert_args
716     (null
717     ,null
718     ,null
719     ,p_per_or_asg_id
720     ,p_business_group_id
721     ,p_contract_category
722     ,null
723     ,p_emp_social_security_info
724     ,p_old_age_contribution
725     ,p_pension_contribution
726     ,p_sickness_contribution
727     ,p_work_injury_contribution
728     ,p_labor_contribution
729     ,p_health_contribution
730     ,p_unemployment_contribution
731     ,p_old_age_cont_end_reason
732     ,p_pension_cont_end_reason
733     ,p_sickness_cont_end_reason
734     ,p_work_injury_cont_end_reason
735     ,p_labor_fund_cont_end_reason
736     ,p_health_cont_end_reason
737     ,p_unemployment_cont_end_reason
738     ,p_program_id
739     ,p_program_login_id
740     ,p_program_application_id
741     ,p_request_id
742     );
743   --
744   -- Having converted the arguments into the pay_psd_rec
745   -- plsql record structure we call the corresponding record
746   -- business process.
747   --
748   pay_psd_ins.ins
749     (p_effective_date
750     ,l_rec
751     );
752   --
753   -- Set the OUT arguments.
754   --
755   p_sii_details_id                   := l_rec.sii_details_id;
756   p_effective_start_date             := l_rec.effective_start_date;
757   p_effective_end_date               := l_rec.effective_end_date;
758   p_object_version_number            := l_rec.object_version_number;
759   --
760   --
761   hr_utility.set_location(' Leaving:'||l_proc, 10);
762 End ins;
763 --
764 end pay_psd_ins;