DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_RTS_SHD

Source


1 Package Body ben_rts_shd as
5 -- |                     Private Global Definitions                           |
2 /* $Header: bertsrhi.pkb 120.1 2006/01/09 14:37:17 maagrawa noship $ */
3 --
4 -- ----------------------------------------------------------------------------
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  ben_rts_shd.';  -- Global package name
9 g_debug boolean := hr_utility.debug_enabled;
10 --
11 -- ----------------------------------------------------------------------------
12 -- |------------------------< return_api_dml_status >-------------------------|
13 -- ----------------------------------------------------------------------------
14 Function return_api_dml_status Return Boolean Is
15 --
16 Begin
17   --
18   Return (nvl(g_api_dml, false));
19   --
20 End return_api_dml_status;
21 --
22 -- ----------------------------------------------------------------------------
23 -- |---------------------------< constraint_error >---------------------------|
24 -- ----------------------------------------------------------------------------
25 Procedure constraint_error
26   (p_constraint_name in all_constraints.constraint_name%TYPE
27   ) Is
28 --
29   l_proc        varchar2(72) := g_package||'constraint_error';
30 --
31 Begin
32   --
33   If (p_constraint_name = 'BEN_CWB_PERSON_RATES_PK') Then
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   Else
39     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
40     fnd_message.set_token('PROCEDURE', l_proc);
41     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
42     fnd_message.raise_error;
43   End If;
44   --
45 End constraint_error;
46 --
47 -- ----------------------------------------------------------------------------
48 -- |-----------------------------< api_updating >-----------------------------|
49 -- ----------------------------------------------------------------------------
50 Function api_updating
51   (p_group_per_in_ler_id                  in     number
52   ,p_pl_id                                in     number
53   ,p_oipl_id                              in     number
54   ,p_object_version_number                in     number
55   )
56   Return Boolean Is
57   --
58   --
59   -- Cursor selects the 'current' row from the HR Schema
60   --
61   Cursor C_Sel1 is
62     select
63        person_rate_id
64       ,group_per_in_ler_id
65       ,pl_id
66       ,oipl_id
67       ,group_pl_id
68       ,group_oipl_id
69       ,lf_evt_ocrd_dt
70       ,person_id
71       ,assignment_id
72       ,elig_flag
73       ,ws_val
74       ,ws_mn_val
75       ,ws_mx_val
76       ,ws_incr_val
77       ,elig_sal_val
78       ,stat_sal_val
79       ,oth_comp_val
80       ,tot_comp_val
81       ,misc1_val
82       ,misc2_val
83       ,misc3_val
84       ,rec_val
85       ,rec_mn_val
86       ,rec_mx_val
87       ,rec_incr_val
88       ,ws_val_last_upd_date
89       ,ws_val_last_upd_by
90       ,pay_proposal_id
91       ,element_entry_value_id
92       ,inelig_rsn_cd
93       ,elig_ovrid_dt
94       ,elig_ovrid_person_id
95       ,copy_dist_bdgt_val
96       ,copy_ws_bdgt_val
97       ,copy_rsrv_val
98       ,copy_dist_bdgt_mn_val
99       ,copy_dist_bdgt_mx_val
100       ,copy_dist_bdgt_incr_val
101       ,copy_ws_bdgt_mn_val
102       ,copy_ws_bdgt_mx_val
103       ,copy_ws_bdgt_incr_val
104       ,copy_rsrv_mn_val
105       ,copy_rsrv_mx_val
106       ,copy_rsrv_incr_val
107       ,copy_dist_bdgt_iss_val
108       ,copy_ws_bdgt_iss_val
109       ,copy_dist_bdgt_iss_date
110       ,copy_ws_bdgt_iss_date
111       ,comp_posting_date
112       ,ws_rt_start_date
113       ,currency
114       ,object_version_number
115     from        ben_cwb_person_rates
116     where       group_per_in_ler_id = p_group_per_in_ler_id
117     and   pl_id = p_pl_id
118     and   oipl_id = p_oipl_id;
119   --
120   l_fct_ret     boolean;
121   --
122 Begin
123   --
124   If (p_group_per_in_ler_id is null and
125       p_pl_id is null and
126       p_oipl_id is null and
127       p_object_version_number is null
128      ) Then
129     --
130     -- One of the primary key arguments is null therefore we must
131     -- set the returning function value to false
132     --
133     l_fct_ret := false;
134   Else
135     If (p_group_per_in_ler_id
136         = ben_rts_shd.g_old_rec.group_per_in_ler_id and
137         p_pl_id
138         = ben_rts_shd.g_old_rec.pl_id and
139         p_oipl_id
140         = ben_rts_shd.g_old_rec.oipl_id and
141         p_object_version_number
142         = ben_rts_shd.g_old_rec.object_version_number
143        ) Then
144       --
145       -- The g_old_rec is current therefore we must
146       -- set the returning function to true
147       --
148       l_fct_ret := true;
149     Else
150       --
151       -- Select the current row into g_old_rec
152       --
153       Open C_Sel1;
154       Fetch C_Sel1 Into ben_rts_shd.g_old_rec;
155       If C_Sel1%notfound Then
156         Close C_Sel1;
157         --
158         -- The primary key is invalid therefore we must error
159         --
160         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
161         fnd_message.raise_error;
162       End If;
163       Close C_Sel1;
164       If (p_object_version_number
168       End If;
165           <> ben_rts_shd.g_old_rec.object_version_number) Then
166         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
167         fnd_message.raise_error;
169       l_fct_ret := true;
170     End If;
171   End If;
172   Return (l_fct_ret);
173 --
174 End api_updating;
175 --
176 -- ----------------------------------------------------------------------------
177 -- |---------------------------------< lck >----------------------------------|
178 -- ----------------------------------------------------------------------------
179 Procedure lck
180   (p_group_per_in_ler_id                  in     number
181   ,p_pl_id                                in     number
182   ,p_oipl_id                              in     number
183   ,p_object_version_number                in     number
184   ) is
185 --
186 -- Cursor selects the 'current' row from the HR Schema
187 --
188   Cursor C_Sel1 is
189     select
190        person_rate_id
191       ,group_per_in_ler_id
192       ,pl_id
193       ,oipl_id
194       ,group_pl_id
195       ,group_oipl_id
196       ,lf_evt_ocrd_dt
197       ,person_id
198       ,assignment_id
199       ,elig_flag
200       ,ws_val
201       ,ws_mn_val
202       ,ws_mx_val
203       ,ws_incr_val
204       ,elig_sal_val
205       ,stat_sal_val
206       ,oth_comp_val
207       ,tot_comp_val
208       ,misc1_val
209       ,misc2_val
210       ,misc3_val
211       ,rec_val
212       ,rec_mn_val
213       ,rec_mx_val
214       ,rec_incr_val
215       ,ws_val_last_upd_date
216       ,ws_val_last_upd_by
217       ,pay_proposal_id
218       ,element_entry_value_id
219       ,inelig_rsn_cd
220       ,elig_ovrid_dt
221       ,elig_ovrid_person_id
222       ,copy_dist_bdgt_val
223       ,copy_ws_bdgt_val
224       ,copy_rsrv_val
225       ,copy_dist_bdgt_mn_val
226       ,copy_dist_bdgt_mx_val
227       ,copy_dist_bdgt_incr_val
228       ,copy_ws_bdgt_mn_val
229       ,copy_ws_bdgt_mx_val
230       ,copy_ws_bdgt_incr_val
231       ,copy_rsrv_mn_val
232       ,copy_rsrv_mx_val
233       ,copy_rsrv_incr_val
234       ,copy_dist_bdgt_iss_val
235       ,copy_ws_bdgt_iss_val
236       ,copy_dist_bdgt_iss_date
237       ,copy_ws_bdgt_iss_date
238       ,comp_posting_date
239       ,ws_rt_start_date
240       ,currency
241       ,object_version_number
242     from        ben_cwb_person_rates
243     where       group_per_in_ler_id = p_group_per_in_ler_id
244     and   pl_id = p_pl_id
245     and   oipl_id = p_oipl_id
246     for update nowait;
247 --
248   l_proc        varchar2(72) := g_package||'lck';
249 --
250 Begin
251   hr_utility.set_location('Entering:'||l_proc, 5);
252   --
253   hr_api.mandatory_arg_error
254     (p_api_name           => l_proc
255     ,p_argument           => 'GROUP_PER_IN_LER_ID'
256     ,p_argument_value     => p_group_per_in_ler_id
257     );
258   hr_utility.set_location(l_proc,6);
259   hr_api.mandatory_arg_error
260     (p_api_name           => l_proc
261     ,p_argument           => 'PL_ID'
262     ,p_argument_value     => p_pl_id
263     );
264   hr_utility.set_location(l_proc,7);
265   hr_api.mandatory_arg_error
266     (p_api_name           => l_proc
267     ,p_argument           => 'OIPL_ID'
268     ,p_argument_value     => p_oipl_id
269     );
270   hr_utility.set_location(l_proc,8);
271   hr_api.mandatory_arg_error
272     (p_api_name           => l_proc
273     ,p_argument           => 'OBJECT_VERSION_NUMBER'
274     ,p_argument_value     => p_object_version_number
275     );
276   --
277   Open  C_Sel1;
278   Fetch C_Sel1 Into ben_rts_shd.g_old_rec;
279   If C_Sel1%notfound then
280     Close C_Sel1;
281     --
282     -- The primary key is invalid therefore we must error
283     --
284     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
285     fnd_message.raise_error;
286   End If;
287   Close C_Sel1;
288   If (p_object_version_number
289       <> ben_rts_shd.g_old_rec.object_version_number) Then
290         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
291         fnd_message.raise_error;
292   End If;
293   --
294   hr_utility.set_location(' Leaving:'||l_proc, 10);
295   --
296   -- We need to trap the ORA LOCK exception
297   --
298 Exception
299   When HR_Api.Object_Locked then
300     --
301     -- The object is locked therefore we need to supply a meaningful
302     -- error message.
303     --
304     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
305     fnd_message.set_token('TABLE_NAME', 'ben_cwb_person_rates');
306     fnd_message.raise_error;
307 End lck;
308 --
309 -- ----------------------------------------------------------------------------
310 -- |-----------------------------< convert_args >-----------------------------|
311 -- ----------------------------------------------------------------------------
312 Function convert_args
313   (p_person_rate_id                 in number
314   ,p_group_per_in_ler_id            in number
315   ,p_pl_id                          in number
316   ,p_oipl_id                        in number
317   ,p_group_pl_id                    in number
318   ,p_group_oipl_id                  in number
319   ,p_lf_evt_ocrd_dt                 in date
320   ,p_person_id                      in number
321   ,p_assignment_id                  in number
322   ,p_elig_flag                      in varchar2
323   ,p_ws_val                         in number
324   ,p_ws_mn_val                      in number
325   ,p_ws_mx_val                      in number
329   ,p_oth_comp_val                   in number
326   ,p_ws_incr_val                    in number
327   ,p_elig_sal_val                   in number
328   ,p_stat_sal_val                   in number
330   ,p_tot_comp_val                   in number
331   ,p_misc1_val                      in number
332   ,p_misc2_val                      in number
333   ,p_misc3_val                      in number
334   ,p_rec_val                        in number
335   ,p_rec_mn_val                     in number
336   ,p_rec_mx_val                     in number
337   ,p_rec_incr_val                   in number
338   ,p_ws_val_last_upd_date           in date
339   ,p_ws_val_last_upd_by             in number
340   ,p_pay_proposal_id                in number
341   ,p_element_entry_value_id         in number
342   ,p_inelig_rsn_cd                  in varchar2
343   ,p_elig_ovrid_dt                  in date
344   ,p_elig_ovrid_person_id           in number
345   ,p_copy_dist_bdgt_val             in number
346   ,p_copy_ws_bdgt_val               in number
347   ,p_copy_rsrv_val                  in number
348   ,p_copy_dist_bdgt_mn_val          in number
349   ,p_copy_dist_bdgt_mx_val          in number
350   ,p_copy_dist_bdgt_incr_val        in number
351   ,p_copy_ws_bdgt_mn_val            in number
352   ,p_copy_ws_bdgt_mx_val            in number
353   ,p_copy_ws_bdgt_incr_val          in number
354   ,p_copy_rsrv_mn_val               in number
355   ,p_copy_rsrv_mx_val               in number
356   ,p_copy_rsrv_incr_val             in number
357   ,p_copy_dist_bdgt_iss_val         in number
358   ,p_copy_ws_bdgt_iss_val           in number
359   ,p_copy_dist_bdgt_iss_date        in date
360   ,p_copy_ws_bdgt_iss_date          in date
361   ,p_comp_posting_date              in date
362   ,p_ws_rt_start_date               in date
363   ,p_currency                       in varchar2
364   ,p_object_version_number          in number
365   )
366   Return g_rec_type is
367 --
368   l_rec   g_rec_type;
369 --
370 Begin
371   --
372   -- Convert arguments into local l_rec structure.
373   --
374   l_rec.person_rate_id                   := p_person_rate_id;
375   l_rec.group_per_in_ler_id              := p_group_per_in_ler_id;
376   l_rec.pl_id                            := p_pl_id;
377   l_rec.oipl_id                          := p_oipl_id;
378   l_rec.group_pl_id                      := p_group_pl_id;
379   l_rec.group_oipl_id                    := p_group_oipl_id;
380   l_rec.lf_evt_ocrd_dt                   := p_lf_evt_ocrd_dt;
381   l_rec.person_id                        := p_person_id;
382   l_rec.assignment_id                    := p_assignment_id;
383   l_rec.elig_flag                        := p_elig_flag;
384   l_rec.ws_val                           := p_ws_val;
385   l_rec.ws_mn_val                        := p_ws_mn_val;
386   l_rec.ws_mx_val                        := p_ws_mx_val;
387   l_rec.ws_incr_val                      := p_ws_incr_val;
388   l_rec.elig_sal_val                     := p_elig_sal_val;
389   l_rec.stat_sal_val                     := p_stat_sal_val;
390   l_rec.oth_comp_val                     := p_oth_comp_val;
391   l_rec.tot_comp_val                     := p_tot_comp_val;
392   l_rec.misc1_val                        := p_misc1_val;
393   l_rec.misc2_val                        := p_misc2_val;
394   l_rec.misc3_val                        := p_misc3_val;
395   l_rec.rec_val                          := p_rec_val;
396   l_rec.rec_mn_val                       := p_rec_mn_val;
397   l_rec.rec_mx_val                       := p_rec_mx_val;
398   l_rec.rec_incr_val                     := p_rec_incr_val;
399   l_rec.ws_val_last_upd_date             := p_ws_val_last_upd_date;
400   l_rec.ws_val_last_upd_by               := p_ws_val_last_upd_by;
401   l_rec.pay_proposal_id                  := p_pay_proposal_id;
402   l_rec.element_entry_value_id           := p_element_entry_value_id;
403   l_rec.inelig_rsn_cd                    := p_inelig_rsn_cd;
404   l_rec.elig_ovrid_dt                    := p_elig_ovrid_dt;
405   l_rec.elig_ovrid_person_id             := p_elig_ovrid_person_id;
406   l_rec.copy_dist_bdgt_val               := p_copy_dist_bdgt_val;
407   l_rec.copy_ws_bdgt_val                 := p_copy_ws_bdgt_val;
408   l_rec.copy_rsrv_val                    := p_copy_rsrv_val;
409   l_rec.copy_dist_bdgt_mn_val            := p_copy_dist_bdgt_mn_val;
410   l_rec.copy_dist_bdgt_mx_val            := p_copy_dist_bdgt_mx_val;
411   l_rec.copy_dist_bdgt_incr_val          := p_copy_dist_bdgt_incr_val;
412   l_rec.copy_ws_bdgt_mn_val              := p_copy_ws_bdgt_mn_val;
413   l_rec.copy_ws_bdgt_mx_val              := p_copy_ws_bdgt_mx_val;
414   l_rec.copy_ws_bdgt_incr_val            := p_copy_ws_bdgt_incr_val;
415   l_rec.copy_rsrv_mn_val                 := p_copy_rsrv_mn_val;
416   l_rec.copy_rsrv_mx_val                 := p_copy_rsrv_mx_val;
417   l_rec.copy_rsrv_incr_val               := p_copy_rsrv_incr_val;
418   l_rec.copy_dist_bdgt_iss_val           := p_copy_dist_bdgt_iss_val;
419   l_rec.copy_ws_bdgt_iss_val             := p_copy_ws_bdgt_iss_val;
420   l_rec.copy_dist_bdgt_iss_date          := p_copy_dist_bdgt_iss_date;
421   l_rec.copy_ws_bdgt_iss_date            := p_copy_ws_bdgt_iss_date;
422   l_rec.comp_posting_date                := p_comp_posting_date;
423   l_rec.ws_rt_start_date                 := p_ws_rt_start_date;
424   l_rec.currency                         := p_currency;
425   l_rec.object_version_number            := p_object_version_number;
426   --
427   -- Return the plsql record structure.
428   --
429   Return(l_rec);
430 --
431 End convert_args;
432 --
433 end ben_rts_shd;