DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_PAY_SHD

Source


1 Package Body pay_pay_shd as
2 /* $Header: pypayrhi.pkb 120.0.12000000.3 2007/03/08 09:23:27 mshingan noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pay_pay_shd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------< return_api_dml_status >-------------------------|
12 -- ----------------------------------------------------------------------------
13 Function return_api_dml_status Return Boolean Is
14 --
15 Begin
16   --
17   Return (nvl(g_api_dml, false));
18   --
19 End return_api_dml_status;
20 --
21 -- ----------------------------------------------------------------------------
22 -- |---------------------------< constraint_error >---------------------------|
23 -- ----------------------------------------------------------------------------
24 Procedure constraint_error
25   (p_constraint_name in all_constraints.constraint_name%TYPE
26   ) Is
27 --
28   l_proc        varchar2(72) := g_package||'constraint_error';
29 --
30 Begin
31   --
32   If (p_constraint_name = 'PAY_PAYROLLS_F_FK2') Then
33   --
34     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
35     fnd_message.set_token('PROCEDURE', l_proc);
36     fnd_message.set_token('STEP','5');
37     fnd_message.raise_error;
38   --
39   ElsIf (p_constraint_name = 'PAY_PAYROLLS_F_FK3') Then
40   --
41     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
42     fnd_message.set_token('PROCEDURE', l_proc);
43     fnd_message.set_token('STEP','10');
44     fnd_message.raise_error;
45   --
46   ElsIf (p_constraint_name = 'PAY_PAYROLLS_F_FK4') Then
47   --
48     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
49     fnd_message.set_token('PROCEDURE', l_proc);
50     fnd_message.set_token('STEP','15');
51     fnd_message.raise_error;
52   --
53   ElsIf (p_constraint_name = 'PAY_PAYROLLS_F_FK5') Then
54   --
55     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
56     fnd_message.set_token('PROCEDURE', l_proc);
57     fnd_message.set_token('STEP','20');
58     fnd_message.raise_error;
59   --
60   ElsIf (p_constraint_name = 'PAY_PAYROLLS_F_FK6') Then
61   --
62     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
63     fnd_message.set_token('PROCEDURE', l_proc);
64     fnd_message.set_token('STEP','25');
65     fnd_message.raise_error;
66   --
67   ElsIf (p_constraint_name = 'PAY_PAYROLLS_F_FK7') Then
68   --
69     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
70     fnd_message.set_token('PROCEDURE', l_proc);
71     fnd_message.set_token('STEP','30');
72     fnd_message.raise_error;
73   --
74   ElsIf (p_constraint_name = 'PAY_PAYROLLS_F_FK8') Then
75   --
76     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
77     fnd_message.set_token('PROCEDURE', l_proc);
78     fnd_message.set_token('STEP','35');
79     fnd_message.raise_error;
80   --
81   ElsIf (p_constraint_name = 'PAY_PAYROLLS_F_PK') Then
82   --
83     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
84     fnd_message.set_token('PROCEDURE', l_proc);
85     fnd_message.set_token('STEP','40');
86     fnd_message.raise_error;
87   --
88   ElsIf (p_constraint_name = 'PAY_PAYROLL_NEGATIVE_PAY_A_CHK') Then
89   --
90     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
91     fnd_message.set_token('PROCEDURE', l_proc);
92     fnd_message.set_token('STEP','45');
93     fnd_message.raise_error;
94   --
95   ElsIf (p_constraint_name = 'PAY_PAYROLL_WORKLOAD_SHIFT_CHK') Then
96   --
97     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
98     fnd_message.set_token('PROCEDURE', l_proc);
99     fnd_message.set_token('STEP','50');
100     fnd_message.raise_error;
101   --
102   Else
103   --
104     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
105     fnd_message.set_token('PROCEDURE', l_proc);
106     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
107     fnd_message.raise_error;
108   --
109   End If;
110   --
111 End constraint_error;
112 --
113 -- ----------------------------------------------------------------------------
114 -- |-----------------------------< api_updating >-----------------------------|
115 -- ----------------------------------------------------------------------------
116 Function api_updating
117   (p_effective_date                   in date
118   ,p_payroll_id                       in number
119   ,p_object_version_number            in number
120   ) Return Boolean Is
121   --
122   -- Cursor selects the 'current' row from the HR Schema
123   --
124   Cursor C_Sel1 is
125     select
126      payroll_id
127     ,effective_start_date
128     ,effective_end_date
129     ,default_payment_method_id
130     ,business_group_id
131     ,consolidation_set_id
132     ,cost_allocation_keyflex_id
133     ,suspense_account_keyflex_id
134     ,gl_set_of_books_id
135     ,soft_coding_keyflex_id
136     ,period_type
137     ,organization_id
138     ,cut_off_date_offset
139     ,direct_deposit_date_offset
140     ,first_period_end_date
141     ,negative_pay_allowed_flag
142     ,number_of_years
143     ,pay_advice_date_offset
144     ,pay_date_offset
145     ,payroll_name
146     ,workload_shifting_level
147     ,comment_id
148     ,null
149     ,midpoint_offset
150     ,attribute_category
151     ,attribute1
152     ,attribute2
153     ,attribute3
154     ,attribute4
155     ,attribute5
156     ,attribute6
157     ,attribute7
158     ,attribute8
159     ,attribute9
160     ,attribute10
161     ,attribute11
162     ,attribute12
163     ,attribute13
164     ,attribute14
165     ,attribute15
166     ,attribute16
167     ,attribute17
168     ,attribute18
169     ,attribute19
170     ,attribute20
171     ,arrears_flag
172     ,payroll_type
173     ,prl_information_category
174     ,prl_information1
175     ,prl_information2
176     ,prl_information3
177     ,prl_information4
178     ,prl_information5
179     ,prl_information6
180     ,prl_information7
181     ,prl_information8
182     ,prl_information9
183     ,prl_information10
184     ,prl_information11
185     ,prl_information12
186     ,prl_information13
187     ,prl_information14
188     ,prl_information15
189     ,prl_information16
190     ,prl_information17
191     ,prl_information18
192     ,prl_information19
193     ,prl_information20
194     ,prl_information21
195     ,prl_information22
196     ,prl_information23
197     ,prl_information24
198     ,prl_information25
199     ,prl_information26
200     ,prl_information27
201     ,prl_information28
202     ,prl_information29
203     ,prl_information30
204     ,multi_assignments_flag
205     ,period_reset_years
206     ,object_version_number
207     ,payslip_view_date_offset
208     from        pay_all_payrolls_f
209     where       payroll_id = p_payroll_id
210     and         p_effective_date
211     between     effective_start_date and effective_end_date;
212 --
213   l_fct_ret     boolean;
214 --
215 Begin
216   --
217   If (p_effective_date is null or
218       p_payroll_id is null or
219       (p_object_version_number is null and
220        pay_pay_shd.g_old_rec.object_version_number is not null)) Then
221     --
222     -- One of the primary key arguments is null therefore we must
223     -- set the returning function value to false
224     --
225     l_fct_ret := false;
226   Else
227     If (p_payroll_id =
228         pay_pay_shd.g_old_rec.payroll_id and (
229        (p_object_version_number =
230          pay_pay_shd.g_old_rec.object_version_number) or
231         (p_object_version_number is null and
232          pay_pay_shd.g_old_rec.object_version_number is null))) then
233       --
234       -- The g_old_rec is current therefore we must
235       -- set the returning function to true
236       --
237       l_fct_ret := true;
238     Else
239       --
240       -- Select the current row
241       --
242       Open C_Sel1;
243       Fetch C_Sel1 Into pay_pay_shd.g_old_rec;
244       If C_Sel1%notfound Then
245       --
246         Close C_Sel1;
247         --
248         -- The primary key is invalid therefore we must error
249         --
250         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
251         fnd_message.raise_error;
252       --
253       End If;
254       Close C_Sel1;
255       If (p_object_version_number <> pay_pay_shd.g_old_rec.object_version_number) Then
256       --
257         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
258         fnd_message.raise_error;
259       --
260       End If;
261       l_fct_ret := true;
262     --
263     End If;
264   --
265   End If;
266   Return (l_fct_ret);
267 --
268 End api_updating;
269 --
270 -- ----------------------------------------------------------------------------
271 -- |---------------------------< find_dt_upd_modes >--------------------------|
272 -- ----------------------------------------------------------------------------
273 Procedure find_dt_upd_modes
274   (p_effective_date         in date
275   ,p_base_key_value         in number
276   ,p_correction             out nocopy boolean
277   ,p_update                 out nocopy boolean
278   ,p_update_override        out nocopy boolean
279   ,p_update_change_insert   out nocopy boolean
280   ) is
281 --
282   l_proc        varchar2(72) := g_package||'find_dt_upd_modes';
283 --
284 Begin
285   hr_utility.set_location('Entering:'||l_proc, 5);
286   --
287   -- Call the corresponding datetrack api
288   --
289   dt_api.find_dt_upd_modes
290     (p_effective_date        => p_effective_date
291     ,p_base_table_name       => 'pay_all_payrolls_f'
292     ,p_base_key_column       => 'payroll_id'
293     ,p_base_key_value        => p_base_key_value
294     ,p_correction            => p_correction
295     ,p_update                => p_update
296     ,p_update_override       => p_update_override
297     ,p_update_change_insert  => p_update_change_insert
298     );
299   --
300   hr_utility.set_location(' Leaving:'||l_proc, 10);
301 End find_dt_upd_modes;
302 --
303 -- ----------------------------------------------------------------------------
304 -- |---------------------------< find_dt_del_modes >--------------------------|
305 -- ----------------------------------------------------------------------------
306 Procedure find_dt_del_modes
307   (p_effective_date        in date
308   ,p_base_key_value        in number
309   ,p_zap                   out nocopy boolean
310   ,p_delete                out nocopy boolean
311   ,p_future_change         out nocopy boolean
312   ,p_delete_next_change    out nocopy boolean
313   ) is
314   --
315   l_proc                varchar2(72)    := g_package||'find_dt_del_modes';
316   --
317   l_parent_key_value1     number;
318   --
319   Cursor C_Sel1 Is
320     select t.default_payment_method_id
321     from   pay_all_payrolls_f t
322     where  t.payroll_id = p_base_key_value
323     and    p_effective_date
324     between t.effective_start_date and t.effective_end_date;
325   --
326 Begin
327 --
328   hr_utility.set_location('Entering:'||l_proc, 5);
329   Open C_sel1;
330   Fetch C_Sel1 Into
331      l_parent_key_value1;
332 
333   If C_Sel1%NOTFOUND then
334   --
335      Close C_Sel1;
336      fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
337      fnd_message.set_token('PROCEDURE',l_proc);
338      fnd_message.set_token('STEP','10');
339      fnd_message.raise_error;
340   --
341   End If;
342   Close C_Sel1;
343   --
344   -- Call the corresponding datetrack api
345   --
346   dt_api.find_dt_del_modes
347    (p_effective_date                => p_effective_date
348    ,p_base_table_name               => 'pay_all_payrolls_f'
349    ,p_base_key_column               => 'payroll_id'
350    ,p_base_key_value                => p_base_key_value
351 
352    ,p_parent_table_name1            => 'pay_org_payment_methods_f'
353    ,p_parent_key_column1            => 'org_payment_method_id'
354    ,p_parent_key_value1             => l_parent_key_value1
355 
356    ,p_zap                           => p_zap
357    ,p_delete                        => p_delete
358    ,p_future_change                 => p_future_change
359    ,p_delete_next_change            => p_delete_next_change
360    );
361   --
362   hr_utility.set_location(' Leaving:'||l_proc, 10);
363 --
364 End find_dt_del_modes;
365 --
366 -- ----------------------------------------------------------------------------
367 -- |-----------------------< upd_effective_end_date >-------------------------|
368 -- ----------------------------------------------------------------------------
369 Procedure upd_effective_end_date
370   (p_effective_date                   in date
371   ,p_base_key_value                   in number
372   ,p_new_effective_end_date           in date
373   ,p_validation_start_date            in date
374   ,p_validation_end_date              in date
375   ,p_object_version_number  out nocopy number
376   ) is
377 --
378   l_proc                  varchar2(72) := g_package||'upd_effective_end_date';
379   l_object_version_number number;
380   l_status_of_dml boolean;
381 --
382 Begin
383 --
384   hr_utility.set_location('Entering:'||l_proc, 5);
385   --
386   -- Because we are updating a row we must get the next object
387   -- version number.
388   --
389   l_object_version_number :=
390     dt_api.get_object_version_number
391       (p_base_table_name    => 'pay_all_payrolls_f'
392       ,p_base_key_column    => 'payroll_id'
393       ,p_base_key_value     => p_base_key_value
394       );
395   --
396   hr_utility.set_location(l_proc, 10);
397   pay_pay_shd.g_api_dml := true;  -- Set the api dml status
398   --
399   -- Update the specified datetrack row setting the effective
400   -- end date to the specified new effective end date.
401   --
402   update  pay_all_payrolls_f t
403   set     t.effective_end_date    = p_new_effective_end_date
404     ,     t.object_version_number = l_object_version_number
405   where   t.payroll_id        = p_base_key_value
406   and     p_effective_date
407   between t.effective_start_date and t.effective_end_date;
408   --
409   l_status_of_dml := SQL%NOTFOUND;
410   pay_pay_shd.g_api_dml := false;   -- Unset the api dml status
411 
412     if (l_status_of_dml) then
413     --
414       hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
415       hr_utility.set_message_token('PROCEDURE',
416                                  'pay_payrolls_f_pkg.update_row');
417       hr_utility.set_message_token('STEP','1');
418       hr_utility.raise_error;
419     --
420     End if;
421 
422   p_object_version_number := l_object_version_number;
423   hr_utility.set_location(' Leaving:'||l_proc, 15);
424 --
425 Exception
426   When Others Then
427     pay_pay_shd.g_api_dml := false;   -- Unset the api dml status
428     Raise;
429 --
430 End upd_effective_end_date;
431 --
432 -- ----------------------------------------------------------------------------
433 -- |---------------------------------< lck >----------------------------------|
434 -- ----------------------------------------------------------------------------
435 Procedure lck
436   (p_effective_date                   in date
437   ,p_datetrack_mode                   in varchar2
438   ,p_payroll_id                       in number
439   ,p_object_version_number            in number
440   ,p_validation_start_date            out nocopy date
441   ,p_validation_end_date              out nocopy date
442   ) is
443 --
444   l_proc                  varchar2(72) := g_package||'lck';
445   l_validation_start_date date;
446   l_validation_end_date   date;
447   l_argument              varchar2(30);
448   --
449   -- Cursor C_Sel1 selects the current locked row as of session date
450   -- ensuring that the object version numbers match.
451   --
452   Cursor C_Sel1 is
453     select
454      payroll_id
455     ,effective_start_date
456     ,effective_end_date
457     ,default_payment_method_id
458     ,business_group_id
459     ,consolidation_set_id
460     ,cost_allocation_keyflex_id
461     ,suspense_account_keyflex_id
462     ,gl_set_of_books_id
463     ,soft_coding_keyflex_id
464     ,period_type
465     ,organization_id
466     ,cut_off_date_offset
467     ,direct_deposit_date_offset
468     ,first_period_end_date
469     ,negative_pay_allowed_flag
470     ,number_of_years
471     ,pay_advice_date_offset
472     ,pay_date_offset
473     ,payroll_name
474     ,workload_shifting_level
475     ,comment_id
476     ,null
477     ,midpoint_offset
478     ,attribute_category
479     ,attribute1
480     ,attribute2
481     ,attribute3
482     ,attribute4
483     ,attribute5
484     ,attribute6
485     ,attribute7
486     ,attribute8
487     ,attribute9
488     ,attribute10
489     ,attribute11
490     ,attribute12
491     ,attribute13
492     ,attribute14
493     ,attribute15
494     ,attribute16
495     ,attribute17
496     ,attribute18
497     ,attribute19
498     ,attribute20
499     ,arrears_flag
500     ,payroll_type
501     ,prl_information_category
502     ,prl_information1
503     ,prl_information2
504     ,prl_information3
505     ,prl_information4
506     ,prl_information5
507     ,prl_information6
508     ,prl_information7
509     ,prl_information8
510     ,prl_information9
511     ,prl_information10
512     ,prl_information11
513     ,prl_information12
514     ,prl_information13
515     ,prl_information14
516     ,prl_information15
517     ,prl_information16
518     ,prl_information17
519     ,prl_information18
520     ,prl_information19
521     ,prl_information20
522     ,prl_information21
523     ,prl_information22
524     ,prl_information23
525     ,prl_information24
526     ,prl_information25
527     ,prl_information26
528     ,prl_information27
529     ,prl_information28
530     ,prl_information29
531     ,prl_information30
532     ,multi_assignments_flag
533     ,period_reset_years
534     ,object_version_number
535     ,payslip_view_date_offset
536     from    pay_all_payrolls_f
537     where   payroll_id = p_payroll_id
538     and     p_effective_date
539     between effective_start_date and effective_end_date
540     for update nowait;
541   --
542   -- Cursor C_Sel3 select comment text
543   --
544   Cursor C_Sel3 is
545     select hc.comment_text
546     from   hr_comments hc
547     where  hc.comment_id = pay_pay_shd.g_old_rec.comment_id;
548   --
549 Begin
550   hr_utility.set_location('Entering:'||l_proc, 5);
551   --
552   -- Ensure that all the mandatory arguments are not null
553   --
554   hr_api.mandatory_arg_error(p_api_name       => l_proc
555                             ,p_argument       => 'effective_date'
556                             ,p_argument_value => p_effective_date
557                             );
558   --
559   hr_api.mandatory_arg_error(p_api_name       => l_proc
560                             ,p_argument       => 'datetrack_mode'
561                             ,p_argument_value => p_datetrack_mode
562                             );
563   --
564   hr_api.mandatory_arg_error(p_api_name       => l_proc
565                             ,p_argument       => 'payroll_id'
566                             ,p_argument_value => p_payroll_id
570       hr_api.mandatory_arg_error(p_api_name       => l_proc
567                             );
568 
569   if  (p_datetrack_mode = hr_api.g_insert) then
571                             ,p_argument       => 'object_version_number'
572                             ,p_argument_value => p_object_version_number
573                             );
574   end if;
575 
576   --
577   -- Check to ensure the datetrack mode is not INSERT.
578   --
579   If (p_datetrack_mode <> hr_api.g_insert) then
580   --
581 	    -- We must select and lock the current row.
582 	    --
583 	    Open  C_Sel1;
584 	    Fetch C_Sel1 Into pay_pay_shd.g_old_rec;
585 	    If C_Sel1%notfound then
586 	    --
587 		      Close C_Sel1;
588 		      --
589 		      -- The primary key is invalid therefore we must error
590 		      --
591 		      fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
592 		      fnd_message.raise_error;
593 	    --
594 	    End If;
595 	    Close C_Sel1;
596 
597         if (pay_pay_shd.g_old_rec.object_version_number is not null) then
598            hr_api.mandatory_arg_error(p_api_name       => l_proc
599                             ,p_argument       => 'object_version_number'
600                             ,p_argument_value => p_object_version_number
601                             );
602         end if;
603 
604 	    If (p_object_version_number <> pay_pay_shd.g_old_rec.object_version_number and
605             pay_pay_shd.g_old_rec.object_version_number is not null) Then
606 	       --
607 		   fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
608 	   	   fnd_message.raise_error;
609 	       --
610 	    End If;
611 	    --
612 	    -- Providing we are doing an update and a comment_id exists then
613 	    -- we select the comment text.
614 	    --
615 	    If ((pay_pay_shd.g_old_rec.comment_id is not null) and
616 		(p_datetrack_mode = hr_api.g_update             or
617 		 p_datetrack_mode = hr_api.g_correction         or
618 		 p_datetrack_mode = hr_api.g_update_override    or
619 		 p_datetrack_mode = hr_api.g_update_change_insert)) then
620 	    --
621 	       Open C_Sel3;
622 	       Fetch C_Sel3 Into pay_pay_shd.g_old_rec.comments;
623 	       If C_Sel3%notfound then
624 	       --
625 			  -- The comments for the specified comment_id does not exist.
626 			  -- We must error due to data integrity problems.
627 			  --
628 			  Close C_Sel3;
629 			  fnd_message.set_name('PAY', 'HR_7202_COMMENT_TEXT_NOT_EXIST');
630 			  fnd_message.raise_error;
631 	       --
632 	       End If;
633                Close C_Sel3;
634 	    --
635 	    End If;
636 	    --
637 	    -- Validate the datetrack mode mode getting the validation start
638 	    -- and end dates for the specified datetrack operation.
639 
640 	    dt_api.validate_dt_mode
641 	      (p_effective_date             => p_effective_date
642 	      ,p_datetrack_mode             => p_datetrack_mode
643 	      ,p_base_table_name            => 'pay_all_payrolls_f'
644 	      ,p_base_key_column            => 'payroll_id'
645 	      ,p_base_key_value             => p_payroll_id
646 
647 	      ,p_parent_table_name1         => 'pay_org_payment_methods_f'
648 	      ,p_parent_key_column1         => 'org_payment_method_id'
649 	      ,p_parent_key_value1          => pay_pay_shd.g_old_rec.default_payment_method_id
650 
651 	      ,p_child_table_name1          => 'per_all_assignments_f'
652 	      ,p_child_key_column1          => 'assignment_id'
653 	      ,p_child_alt_base_key_column1 => 'payroll_id'
654 
655 	      ,p_child_table_name2          => 'pay_element_links_f'
656 	      ,p_child_key_column2          => 'element_link_id'
657 	      ,p_child_alt_base_key_column2 => 'payroll_id'
658 
659 	      ,p_child_table_name3          => 'hr_all_positions_f'
660 	      ,p_child_key_column3	    => 'position_id'
661 	      ,p_child_alt_base_key_column3 => 'pay_freq_payroll_id'
662 
663 	      ,p_enforce_foreign_locking    => true
664 	      ,p_validation_start_date      => l_validation_start_date
665 	      ,p_validation_end_date        => l_validation_end_date
666 	      );
667   Else
668     --
669     -- We are doing a datetrack 'INSERT' which is illegal within this
670     -- procedure therefore we must error (note: to lck on insert the
671     -- private procedure ins_lck should be called).
672     --
673     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
674     fnd_message.set_token('PROCEDURE', l_proc);
675     fnd_message.set_token('STEP','20');
676     fnd_message.raise_error;
677   --
678   End If;
679   --
680   -- Set the validation start and end date OUT arguments
681   --
682   p_validation_start_date := l_validation_start_date;
683   p_validation_end_date   := l_validation_end_date;
684 
685   hr_utility.set_location(' Leaving:'||l_proc, 30);
686 --
687 -- We need to trap the ORA LOCK exception
688 --
689 Exception
690   When HR_Api.Object_Locked then
691     --
692     -- The object is locked therefore we need to supply a meaningful
693     -- error message.
694     --
695     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
696     fnd_message.set_token('TABLE_NAME', 'pay_all_payrolls_f');
697     fnd_message.raise_error;
698 --
699 End lck;
700 --
701 -- ----------------------------------------------------------------------------
702 -- |-----------------------------< convert_args >-----------------------------|
703 -- ----------------------------------------------------------------------------
704 --
705 Function convert_args
706   (p_payroll_id                     in number
707   ,p_effective_start_date           in date
708   ,p_effective_end_date             in date
709   ,p_default_payment_method_id      in number
710   ,p_business_group_id              in number
711   ,p_consolidation_set_id           in number
712   ,p_cost_allocation_keyflex_id     in number
713   ,p_suspense_account_keyflex_id    in number
714   ,p_gl_set_of_books_id             in number
715   ,p_soft_coding_keyflex_id         in number
716   ,p_period_type                    in varchar2
717   ,p_organization_id                in number
718   ,p_cut_off_date_offset            in number
719   ,p_direct_deposit_date_offset     in number
720   ,p_first_period_end_date          in date
721   ,p_negative_pay_allowed_flag      in varchar2
722   ,p_number_of_years                in number
723   ,p_pay_advice_date_offset         in number
724   ,p_pay_date_offset                in number
725   ,p_payroll_name                   in varchar2
726   ,p_workload_shifting_level        in varchar2
727   ,p_comment_id                     in number
728   ,p_comments                       in varchar2
729   ,p_midpoint_offset                in number
730   ,p_attribute_category             in varchar2
731   ,p_attribute1                     in varchar2
732   ,p_attribute2                     in varchar2
733   ,p_attribute3                     in varchar2
734   ,p_attribute4                     in varchar2
735   ,p_attribute5                     in varchar2
736   ,p_attribute6                     in varchar2
737   ,p_attribute7                     in varchar2
738   ,p_attribute8                     in varchar2
739   ,p_attribute9                     in varchar2
740   ,p_attribute10                    in varchar2
741   ,p_attribute11                    in varchar2
742   ,p_attribute12                    in varchar2
743   ,p_attribute13                    in varchar2
744   ,p_attribute14                    in varchar2
745   ,p_attribute15                    in varchar2
746   ,p_attribute16                    in varchar2
747   ,p_attribute17                    in varchar2
748   ,p_attribute18                    in varchar2
749   ,p_attribute19                    in varchar2
750   ,p_attribute20                    in varchar2
751   ,p_arrears_flag                   in varchar2
752   ,p_payroll_type                   in varchar2
753   ,p_prl_information_category       in varchar2
754   ,p_prl_information1               in varchar2
755   ,p_prl_information2               in varchar2
756   ,p_prl_information3               in varchar2
757   ,p_prl_information4               in varchar2
758   ,p_prl_information5               in varchar2
759   ,p_prl_information6               in varchar2
760   ,p_prl_information7               in varchar2
761   ,p_prl_information8               in varchar2
762   ,p_prl_information9               in varchar2
763   ,p_prl_information10              in varchar2
764   ,p_prl_information11              in varchar2
765   ,p_prl_information12              in varchar2
766   ,p_prl_information13              in varchar2
767   ,p_prl_information14              in varchar2
768   ,p_prl_information15              in varchar2
769   ,p_prl_information16              in varchar2
770   ,p_prl_information17              in varchar2
771   ,p_prl_information18              in varchar2
772   ,p_prl_information19              in varchar2
773   ,p_prl_information20              in varchar2
774   ,p_prl_information21              in varchar2
775   ,p_prl_information22              in varchar2
776   ,p_prl_information23              in varchar2
777   ,p_prl_information24              in varchar2
778   ,p_prl_information25              in varchar2
779   ,p_prl_information26              in varchar2
780   ,p_prl_information27              in varchar2
781   ,p_prl_information28              in varchar2
782   ,p_prl_information29              in varchar2
783   ,p_prl_information30              in varchar2
784   ,p_multi_assignments_flag         in varchar2
785   ,p_period_reset_years             in varchar2
786   ,p_object_version_number          in number
787 
788   ,p_payslip_view_date_offset       in number
789   )
790   Return g_rec_type is
791 --
792   l_rec   g_rec_type;
793 --
794 Begin
795   --
796   -- Convert arguments into local l_rec structure.
797   --
798   l_rec.payroll_id                       := p_payroll_id;
799   l_rec.effective_start_date             := p_effective_start_date;
800   l_rec.effective_end_date               := p_effective_end_date;
801   l_rec.default_payment_method_id        := p_default_payment_method_id;
802   l_rec.business_group_id                := p_business_group_id;
803   l_rec.consolidation_set_id             := p_consolidation_set_id;
804   l_rec.cost_allocation_keyflex_id       := p_cost_allocation_keyflex_id;
805   l_rec.suspense_account_keyflex_id      := p_suspense_account_keyflex_id;
806   l_rec.gl_set_of_books_id               := p_gl_set_of_books_id;
807   l_rec.soft_coding_keyflex_id           := p_soft_coding_keyflex_id;
808   l_rec.period_type                      := p_period_type;
809   l_rec.organization_id                  := p_organization_id;
810   l_rec.cut_off_date_offset              := p_cut_off_date_offset;
811   l_rec.direct_deposit_date_offset       := p_direct_deposit_date_offset;
812   l_rec.first_period_end_date            := p_first_period_end_date;
813   l_rec.negative_pay_allowed_flag        := p_negative_pay_allowed_flag;
814   l_rec.number_of_years                  := p_number_of_years;
815   l_rec.pay_advice_date_offset           := p_pay_advice_date_offset;
816   l_rec.pay_date_offset                  := p_pay_date_offset;
817   l_rec.payroll_name                     := p_payroll_name;
818   l_rec.workload_shifting_level          := p_workload_shifting_level;
819   l_rec.comment_id                       := p_comment_id;
820   l_rec.comments                         := p_comments;
821   l_rec.midpoint_offset                  := p_midpoint_offset;
822   l_rec.attribute_category               := p_attribute_category;
823   l_rec.attribute1                       := p_attribute1;
824   l_rec.attribute2                       := p_attribute2;
825   l_rec.attribute3                       := p_attribute3;
826   l_rec.attribute4                       := p_attribute4;
827   l_rec.attribute5                       := p_attribute5;
828   l_rec.attribute6                       := p_attribute6;
829   l_rec.attribute7                       := p_attribute7;
830   l_rec.attribute8                       := p_attribute8;
831   l_rec.attribute9                       := p_attribute9;
832   l_rec.attribute10                      := p_attribute10;
833   l_rec.attribute11                      := p_attribute11;
834   l_rec.attribute12                      := p_attribute12;
835   l_rec.attribute13                      := p_attribute13;
836   l_rec.attribute14                      := p_attribute14;
837   l_rec.attribute15                      := p_attribute15;
838   l_rec.attribute16                      := p_attribute16;
839   l_rec.attribute17                      := p_attribute17;
840   l_rec.attribute18                      := p_attribute18;
841   l_rec.attribute19                      := p_attribute19;
842   l_rec.attribute20                      := p_attribute20;
843   l_rec.arrears_flag                     := p_arrears_flag;
844   l_rec.payroll_type                     := p_payroll_type;
845   l_rec.prl_information_category         := p_prl_information_category;
846   l_rec.prl_information1                 := p_prl_information1;
847   l_rec.prl_information2                 := p_prl_information2;
848   l_rec.prl_information3                 := p_prl_information3;
849   l_rec.prl_information4                 := p_prl_information4;
850   l_rec.prl_information5                 := p_prl_information5;
851   l_rec.prl_information6                 := p_prl_information6;
852   l_rec.prl_information7                 := p_prl_information7;
853   l_rec.prl_information8                 := p_prl_information8;
854   l_rec.prl_information9                 := p_prl_information9;
855   l_rec.prl_information10                := p_prl_information10;
856   l_rec.prl_information11                := p_prl_information11;
857   l_rec.prl_information12                := p_prl_information12;
858   l_rec.prl_information13                := p_prl_information13;
859   l_rec.prl_information14                := p_prl_information14;
860   l_rec.prl_information15                := p_prl_information15;
861   l_rec.prl_information16                := p_prl_information16;
862   l_rec.prl_information17                := p_prl_information17;
863   l_rec.prl_information18                := p_prl_information18;
864   l_rec.prl_information19                := p_prl_information19;
865   l_rec.prl_information20                := p_prl_information20;
866   l_rec.prl_information21                := p_prl_information21;
867   l_rec.prl_information22                := p_prl_information22;
868   l_rec.prl_information23                := p_prl_information23;
869   l_rec.prl_information24                := p_prl_information24;
870   l_rec.prl_information25                := p_prl_information25;
871   l_rec.prl_information26                := p_prl_information26;
872   l_rec.prl_information27                := p_prl_information27;
873   l_rec.prl_information28                := p_prl_information28;
874   l_rec.prl_information29                := p_prl_information29;
875   l_rec.prl_information30                := p_prl_information30;
876   l_rec.multi_assignments_flag           := p_multi_assignments_flag;
877   l_rec.period_reset_years               := p_period_reset_years;
878   l_rec.object_version_number            := p_object_version_number;
879   l_rec.payslip_view_date_offset	 := p_payslip_view_date_offset;
880   --
881   -- Return the plsql record structure.
882   --
883   Return(l_rec);
884 --
885 End convert_args;
886 --
887 end pay_pay_shd;