DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_BLT_SHD

Source


6 -- ----------------------------------------------------------------------------
1 Package Body pay_blt_shd as
2 /* $Header: pybltrhi.pkb 120.4 2012/03/01 05:23:29 vvijayku ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
7 --
8 g_package  varchar2(33) := '  pay_blt_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_BALANCE_TYPES_PK') Then
33     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
34     fnd_message.set_token('PROCEDURE', l_proc);
35     fnd_message.set_token('STEP','5');
36     fnd_message.raise_error;
37   ElsIf (p_constraint_name = 'PAY_BALANCE_TYPES_UK2') Then
38     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
39     fnd_message.set_token('PROCEDURE', l_proc);
40     fnd_message.set_token('STEP','10');
41     fnd_message.raise_error;
42   ElsIf (p_constraint_name = 'PAY_BAL_ASSIGNMENT_REMUNER_CHK') Then
43     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
44     fnd_message.set_token('PROCEDURE', l_proc);
45     fnd_message.set_token('STEP','15');
46     fnd_message.raise_error;
47   ElsIf (p_constraint_name = 'PAY_BAL_BALANCE_UOM_CHK') Then
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','20');
51     fnd_message.raise_error;
52   ElsIf (p_constraint_name = 'PAY_BAL_TAX_TYPE_CHK') Then
53     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
54     fnd_message.set_token('PROCEDURE', l_proc);
55     fnd_message.set_token('STEP','25');
56     fnd_message.raise_error;
57   Else
58     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
59     fnd_message.set_token('PROCEDURE', l_proc);
60     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
61     fnd_message.raise_error;
62   End If;
63   --
64 End constraint_error;
65 --
66 -- ----------------------------------------------------------------------------
67 -- |-----------------------------< api_updating >-----------------------------|
68 -- ----------------------------------------------------------------------------
69 Function api_updating
70   (p_balance_type_id                      in     number
71   ,p_object_version_number                in     number
72   )
73   Return Boolean Is
74   --
75   --
76   -- Cursor selects the 'current' row from the HR Schema
77   --
78   Cursor C_Sel1 is
79     select
80        balance_type_id
81       ,business_group_id
82       ,legislation_code
83       ,currency_code
84       ,assignment_remuneration_flag
85       ,balance_name
86       ,balance_uom
87       ,comments
88       ,legislation_subgroup
89       ,reporting_name
90       ,attribute_category
91       ,attribute1
92       ,attribute2
93       ,attribute3
94       ,attribute4
95       ,attribute5
96       ,attribute6
97       ,attribute7
98       ,attribute8
99       ,attribute9
100       ,attribute10
101       ,attribute11
102       ,attribute12
103       ,attribute13
104       ,attribute14
105       ,attribute15
106       ,attribute16
107       ,attribute17
108       ,attribute18
109       ,attribute19
110       ,attribute20
111       ,jurisdiction_level
112       ,tax_type
113       ,object_version_number
114       ,balance_category_id
115       ,base_balance_type_id
116       ,input_value_id
117     from        pay_balance_types
118     where       balance_type_id = p_balance_type_id;
119   --
120   l_fct_ret     boolean;
121   --
122 Begin
123   --
124   If (p_balance_type_id is null and
125       p_object_version_number is null
126      ) Then
127     --
128     -- One of the primary key arguments is null therefore we must
129     -- set the returning function value to false
130     --
134         = pay_blt_shd.g_old_rec.balance_type_id and
131     l_fct_ret := false;
132   Else
133     If (p_balance_type_id
135         p_object_version_number
136         = pay_blt_shd.g_old_rec.object_version_number
137        ) Then
138       --
139       -- The g_old_rec is current therefore we must
140       -- set the returning function to true
141       --
142       l_fct_ret := true;
143     Else
144       --
145       -- Select the current row into g_old_rec
146       --
147       Open C_Sel1;
148       Fetch C_Sel1 Into pay_blt_shd.g_old_rec;
149       If C_Sel1%notfound Then
150         Close C_Sel1;
151         --
152         -- The primary key is invalid therefore we must error
153         --
154         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
155         fnd_message.raise_error;
156       End If;
157       Close C_Sel1;
158       If (p_object_version_number
159           <> pay_blt_shd.g_old_rec.object_version_number) Then
160         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
161         fnd_message.raise_error;
162       End If;
163       l_fct_ret := true;
164     End If;
165   End If;
166   Return (l_fct_ret);
167 --
168 End api_updating;
169 --
170 -- ----------------------------------------------------------------------------
171 -- |---------------------------------< lck >----------------------------------|
172 -- ----------------------------------------------------------------------------
173 Procedure lck
174   (p_balance_type_id                      in     number
175   ,p_object_version_number                in     number
176   ) is
177 --
178 -- Cursor selects the 'current' row from the HR Schema
179 --
180   Cursor C_Sel1 is
181     select
182        balance_type_id
183       ,business_group_id
184       ,legislation_code
185       ,currency_code
186       ,assignment_remuneration_flag
187       ,balance_name
188       ,balance_uom
189       ,comments
190       ,legislation_subgroup
191       ,reporting_name
192       ,attribute_category
193       ,attribute1
194       ,attribute2
195       ,attribute3
196       ,attribute4
197       ,attribute5
198       ,attribute6
199       ,attribute7
200       ,attribute8
201       ,attribute9
202       ,attribute10
203       ,attribute11
204       ,attribute12
205       ,attribute13
206       ,attribute14
207       ,attribute15
208       ,attribute16
209       ,attribute17
210       ,attribute18
211       ,attribute19
212       ,attribute20
213       ,jurisdiction_level
214       ,tax_type
215       ,object_version_number
216       ,balance_category_id
217       ,base_balance_type_id
218       ,input_value_id
219     from        pay_balance_types
220     where       balance_type_id = p_balance_type_id
221     for update nowait;
222 --
223   l_proc        varchar2(72) := g_package||'lck';
224 --
225 Begin
226   hr_utility.set_location('Entering:'||l_proc, 5);
227   --
228   hr_api.mandatory_arg_error
229     (p_api_name           => l_proc
230     ,p_argument           => 'BALANCE_TYPE_ID'
231     ,p_argument_value     => p_balance_type_id
232     );
233   hr_utility.set_location(l_proc,6);
234   hr_api.mandatory_arg_error
235     (p_api_name           => l_proc
236     ,p_argument           => 'OBJECT_VERSION_NUMBER'
237     ,p_argument_value     => p_object_version_number
238     );
239   --
240   Open  C_Sel1;
241   Fetch C_Sel1 Into pay_blt_shd.g_old_rec;
242   If C_Sel1%notfound then
243     Close C_Sel1;
244     --
245     -- The primary key is invalid therefore we must error
246     --
247     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
248     fnd_message.raise_error;
249   End If;
250   Close C_Sel1;
251   If (p_object_version_number
252       <> pay_blt_shd.g_old_rec.object_version_number) Then
253         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
254         fnd_message.raise_error;
255   End If;
256   --
257   hr_utility.set_location(' Leaving:'||l_proc, 10);
258   --
259   -- We need to trap the ORA LOCK exception
260   --
261 Exception
262   When HR_Api.Object_Locked then
263     --
264     -- The object is locked therefore we need to supply a meaningful
265     -- error message.
266     --
267     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
268     fnd_message.set_token('TABLE_NAME', 'pay_balance_types');
269     fnd_message.raise_error;
270 End lck;
271 --
272 -- ----------------------------------------------------------------------------
273 -- |-----------------------------< convert_args >-----------------------------|
274 -- ----------------------------------------------------------------------------
275 Function convert_args
276   (p_balance_type_id                in number
277   ,p_business_group_id              in number
278   ,p_legislation_code               in varchar2
279   ,p_currency_code                  in varchar2
280   ,p_assignment_remuneration_flag   in varchar2
281   ,p_balance_name                   in varchar2
282   ,p_balance_uom                    in varchar2
283   ,p_comments                       in varchar2
284   ,p_legislation_subgroup           in varchar2
285   ,p_reporting_name                 in varchar2
286   ,p_attribute_category             in varchar2
287   ,p_attribute1                     in varchar2
288   ,p_attribute2                     in varchar2
292   ,p_attribute6                     in varchar2
289   ,p_attribute3                     in varchar2
290   ,p_attribute4                     in varchar2
291   ,p_attribute5                     in varchar2
293   ,p_attribute7                     in varchar2
294   ,p_attribute8                     in varchar2
295   ,p_attribute9                     in varchar2
296   ,p_attribute10                    in varchar2
297   ,p_attribute11                    in varchar2
298   ,p_attribute12                    in varchar2
299   ,p_attribute13                    in varchar2
300   ,p_attribute14                    in varchar2
301   ,p_attribute15                    in varchar2
302   ,p_attribute16                    in varchar2
303   ,p_attribute17                    in varchar2
304   ,p_attribute18                    in varchar2
305   ,p_attribute19                    in varchar2
306   ,p_attribute20                    in varchar2
307   ,p_jurisdiction_level             in number
308   ,p_tax_type                       in varchar2
309   ,p_object_version_number          in number
310   ,p_balance_category_id            in number
311   ,p_base_balance_type_id           in number
312   ,p_input_value_id                 in number
313   )
314   Return g_rec_type is
315 --
316   l_rec   g_rec_type;
317 --
318 Begin
319   --
320   -- Convert arguments into local l_rec structure.
321   --
322   l_rec.balance_type_id                  := p_balance_type_id;
323   l_rec.business_group_id                := p_business_group_id;
324   l_rec.legislation_code                 := p_legislation_code;
325   l_rec.currency_code                    := p_currency_code;
326   l_rec.assignment_remuneration_flag     := p_assignment_remuneration_flag;
327   l_rec.balance_name                     := p_balance_name;
328   l_rec.balance_uom                      := p_balance_uom;
329   l_rec.comments                         := p_comments;
330   l_rec.legislation_subgroup             := p_legislation_subgroup;
331   l_rec.reporting_name                   := p_reporting_name;
332   l_rec.attribute_category               := p_attribute_category;
333   l_rec.attribute1                       := p_attribute1;
334   l_rec.attribute2                       := p_attribute2;
335   l_rec.attribute3                       := p_attribute3;
336   l_rec.attribute4                       := p_attribute4;
337   l_rec.attribute5                       := p_attribute5;
338   l_rec.attribute6                       := p_attribute6;
339   l_rec.attribute7                       := p_attribute7;
340   l_rec.attribute8                       := p_attribute8;
341   l_rec.attribute9                       := p_attribute9;
342   l_rec.attribute10                      := p_attribute10;
343   l_rec.attribute11                      := p_attribute11;
344   l_rec.attribute12                      := p_attribute12;
345   l_rec.attribute13                      := p_attribute13;
346   l_rec.attribute14                      := p_attribute14;
347   l_rec.attribute15                      := p_attribute15;
348   l_rec.attribute16                      := p_attribute16;
349   l_rec.attribute17                      := p_attribute17;
350   l_rec.attribute18                      := p_attribute18;
351   l_rec.attribute19                      := p_attribute19;
352   l_rec.attribute20                      := p_attribute20;
353   l_rec.jurisdiction_level               := p_jurisdiction_level;
354   l_rec.tax_type                         := p_tax_type;
355   l_rec.object_version_number            := p_object_version_number;
356   l_rec.balance_category_id              := p_balance_category_id;
357   l_rec.base_balance_type_id             := p_base_balance_type_id;
358   l_rec.input_value_id                   := p_input_value_id;
359   --
360   -- Return the plsql record structure.
361   --
362   Return(l_rec);
363 --
364 End convert_args;
365 --
366 end pay_blt_shd;