DBA Data[Home] [Help]

PACKAGE BODY: APPS.HXC_TER_SHD

Source


1 Package Body hxc_ter_shd as
2 /* $Header: hxcterrhi.pkb 120.2 2005/09/23 09:19:47 nissharm noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  hxc_ter_shd.';  -- Global package name
9 
10 g_debug boolean := hr_utility.debug_enabled;
11 --
12 -- ----------------------------------------------------------------------------
13 -- |------------------------< return_api_dml_status >-------------------------|
14 -- ----------------------------------------------------------------------------
15 Function return_api_dml_status Return Boolean Is
16 --
17 Begin
18   --
19   Return (nvl(g_api_dml, false));
20   --
21 End return_api_dml_status;
22 --
23 -- ----------------------------------------------------------------------------
24 -- |---------------------------< constraint_error >---------------------------|
25 -- ----------------------------------------------------------------------------
26 Procedure constraint_error
27   (p_constraint_name in all_constraints.constraint_name%TYPE
28   ) Is
29 --
30   l_proc 	varchar2(72) := g_package||'constraint_error';
31 --
32 Begin
33   --
34 null;
35 -- gaz - need to define constraint error messages
36   --
37 End constraint_error;
38 --
39 -- ----------------------------------------------------------------------------
40 -- |-----------------------------< api_updating >-----------------------------|
41 -- ----------------------------------------------------------------------------
42 Function api_updating
43   (p_time_entry_rule_id                in     number
44   ,p_object_version_number                in     number
45   )
46   Return Boolean Is
47 --
48   --
49   -- Cursor selects the 'current' row from the HR Schema
50   --
51   Cursor C_Sel1 is
52     select
53        time_entry_rule_id
54       ,name
55       ,business_group_id
56       ,legislation_code
57       ,rule_usage
58       ,mapping_id
59       ,formula_id
60       ,description
61       ,start_date
62       ,end_date
63       ,object_version_number
64       ,attribute_category
65       ,attribute1
66       ,attribute2
67       ,attribute3
68       ,attribute4
69       ,attribute5
70       ,attribute6
71       ,attribute7
72       ,attribute8
73       ,attribute9
74       ,attribute10
75       ,attribute11
76       ,attribute12
77       ,attribute13
78       ,attribute14
79       ,attribute15
80       ,attribute16
81       ,attribute17
82       ,attribute18
83       ,attribute19
84       ,attribute20
85       ,attribute21
86       ,attribute22
87       ,attribute23
88       ,attribute24
89       ,attribute25
90       ,attribute26
91       ,attribute27
92       ,attribute28
93       ,attribute29
94       ,attribute30
95     from	hxc_time_entry_rules
96     where	time_entry_rule_id = p_time_entry_rule_id;
97 --
98   l_fct_ret	boolean;
99 --
100 Begin
101   --
102   If (p_time_entry_rule_id is null and
103       p_object_version_number is null
104      ) Then
105     --
106     -- One of the primary key arguments is null therefore we must
107     -- set the returning function value to false
108     --
109     l_fct_ret := false;
110   Else
111     If (p_time_entry_rule_id
112         = hxc_ter_shd.g_old_rec.time_entry_rule_id and
113         p_object_version_number
114         = hxc_ter_shd.g_old_rec.object_version_number
115        ) Then
116       --
117       -- The g_old_rec is current therefore we must
118       -- set the returning function to true
119       --
120       l_fct_ret := true;
121     Else
122       --
123       -- Select the current row into g_old_rec
124       --
125       Open C_Sel1;
126       Fetch C_Sel1 Into hxc_ter_shd.g_old_rec;
127       If C_Sel1%notfound Then
128         Close C_Sel1;
129         --
130         -- The primary key is invalid therefore we must error
131         --
132         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
133         fnd_message.raise_error;
134       End If;
135       Close C_Sel1;
136       If (p_object_version_number
137           <> hxc_ter_shd.g_old_rec.object_version_number) Then
138         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
139         fnd_message.raise_error;
140       End If;
141       l_fct_ret := true;
142     End If;
143   End If;
144   Return (l_fct_ret);
145 --
146 End api_updating;
147 --
148 -- ----------------------------------------------------------------------------
149 -- |---------------------------------< lck >----------------------------------|
150 -- ----------------------------------------------------------------------------
151 Procedure lck
152   (p_time_entry_rule_id                in     number
153   ,p_object_version_number                in     number
154   ) is
155 --
156 -- Cursor selects the 'current' row from the HR Schema
157 --
158   Cursor C_Sel1 is
159     select
160        time_entry_rule_id
161       ,name
162       ,business_group_id
163       ,legislation_code
164       ,rule_usage
165       ,mapping_id
166       ,formula_id
167       ,description
168       ,start_date
169       ,end_date
170       ,object_version_number
171       ,attribute_category
172       ,attribute1
173       ,attribute2
174       ,attribute3
175       ,attribute4
176       ,attribute5
177       ,attribute6
178       ,attribute7
179       ,attribute8
180       ,attribute9
181       ,attribute10
182       ,attribute11
183       ,attribute12
184       ,attribute13
185       ,attribute14
186       ,attribute15
187       ,attribute16
188       ,attribute17
189       ,attribute18
190       ,attribute19
191       ,attribute20
192       ,attribute21
193       ,attribute22
194       ,attribute23
195       ,attribute24
196       ,attribute25
197       ,attribute26
198       ,attribute27
199       ,attribute28
200       ,attribute29
201       ,attribute30
202     from	hxc_time_entry_rules
203     where	time_entry_rule_id = p_time_entry_rule_id
204     for	update nowait;
205 --
206   l_proc	varchar2(72);
207 --
208 Begin
209   g_debug := hr_utility.debug_enabled;
210 
211   if g_debug then
212   	l_proc := g_package||'lck';
216   hr_api.mandatory_arg_error
213   	hr_utility.set_location('Entering:'||l_proc, 5);
214   end if;
215   --
217     (p_api_name           => l_proc
218     ,p_argument           => 'TIME_ENTRY_RULE_ID'
219     ,p_argument_value     => p_time_entry_rule_id
220     );
221   --
222   Open  C_Sel1;
223   Fetch C_Sel1 Into hxc_ter_shd.g_old_rec;
224   If C_Sel1%notfound then
225     Close C_Sel1;
226     --
227     -- The primary key is invalid therefore we must error
228     --
229     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
230     fnd_message.raise_error;
231   End If;
232   Close C_Sel1;
233   If (p_object_version_number
234       <> hxc_ter_shd.g_old_rec.object_version_number) Then
235         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
236         fnd_message.raise_error;
237   End If;
238   --
239   if g_debug then
240   	hr_utility.set_location(' Leaving:'||l_proc, 10);
241   end if;
242   --
243   -- We need to trap the ORA LOCK exception
244   --
245 Exception
246   When HR_Api.Object_Locked then
247     --
248     -- The object is locked therefore we need to supply a meaningful
249     -- error message.
250     --
251     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
252     fnd_message.set_token('TABLE_NAME', 'hxc_time_entry_rules');
253     fnd_message.raise_error;
254 End lck;
255 --
256 -- ----------------------------------------------------------------------------
257 -- |-----------------------------< convert_args >-----------------------------|
258 -- ----------------------------------------------------------------------------
259 Function convert_args
260   (p_time_entry_rule_id             in number
261   ,p_name                           in varchar2
262   ,p_business_group_id              in number
263   ,p_legislation_code               in varchar2
264   ,p_rule_usage                     in varchar2
265   ,p_mapping_id                     in number
266   ,p_formula_id                     in number
267   ,p_description                    in varchar2
268   ,p_start_date                     in date
269   ,p_end_date                       in date
270   ,p_object_version_number          in number
271   ,p_attribute_category             in varchar2
272   ,p_attribute1                     in varchar2
273   ,p_attribute2                     in varchar2
274   ,p_attribute3                     in varchar2
275   ,p_attribute4                     in varchar2
276   ,p_attribute5                     in varchar2
277   ,p_attribute6                     in varchar2
278   ,p_attribute7                     in varchar2
279   ,p_attribute8                     in varchar2
280   ,p_attribute9                     in varchar2
281   ,p_attribute10                    in varchar2
282   ,p_attribute11                    in varchar2
283   ,p_attribute12                    in varchar2
284   ,p_attribute13                    in varchar2
285   ,p_attribute14                    in varchar2
286   ,p_attribute15                    in varchar2
287   ,p_attribute16                    in varchar2
288   ,p_attribute17                    in varchar2
289   ,p_attribute18                    in varchar2
290   ,p_attribute19                    in varchar2
291   ,p_attribute20                    in varchar2
292   ,p_attribute21                    in varchar2
293   ,p_attribute22                    in varchar2
294   ,p_attribute23                    in varchar2
295   ,p_attribute24                    in varchar2
296   ,p_attribute25                    in varchar2
297   ,p_attribute26                    in varchar2
298   ,p_attribute27                    in varchar2
299   ,p_attribute28                    in varchar2
300   ,p_attribute29                    in varchar2
301   ,p_attribute30                    in varchar2
302   )
303   Return g_rec_type is
304 --
305   l_rec   g_rec_type;
306 --
307 Begin
308   g_debug := hr_utility.debug_enabled;
309 
310   --
311   -- Convert arguments into local l_rec structure.
312   --
313   if g_debug then
314   	hr_utility.set_location('Entering convert args', 10);
315   end if;
316   --
317   l_rec.time_entry_rule_id               := p_time_entry_rule_id;
318   l_rec.name                             := p_name;
319   l_rec.business_group_id                 := p_business_group_id;
320   l_rec.legislation_code                 := p_legislation_code;
321   l_rec.rule_usage                       := p_rule_usage;
322   l_rec.formula_id                       := p_formula_id;
323   l_rec.mapping_id                       := p_mapping_id;
324   l_rec.description                      := p_description;
325   l_rec.start_date                       := p_start_date;
326   l_rec.end_date                         := p_end_date;
327   l_rec.object_version_number            := p_object_version_number;
328   l_rec.attribute_category               := p_attribute_category;
329   l_rec.attribute1                       := p_attribute1;
330   l_rec.attribute2                       := p_attribute2;
331   l_rec.attribute3                       := p_attribute3;
332   l_rec.attribute4                       := p_attribute4;
333   l_rec.attribute5                       := p_attribute5;
334   l_rec.attribute6                       := p_attribute6;
335   l_rec.attribute7                       := p_attribute7;
336   l_rec.attribute8                       := p_attribute8;
337   l_rec.attribute9                       := p_attribute9;
338   l_rec.attribute10                      := p_attribute10;
339   l_rec.attribute11                      := p_attribute11;
340   l_rec.attribute12                      := p_attribute12;
341   l_rec.attribute13                      := p_attribute13;
342   l_rec.attribute14                      := p_attribute14;
343   l_rec.attribute15                      := p_attribute15;
344   l_rec.attribute16                      := p_attribute16;
345   l_rec.attribute17                      := p_attribute17;
346   l_rec.attribute18                      := p_attribute18;
347   l_rec.attribute19                      := p_attribute19;
348   l_rec.attribute20                      := p_attribute20;
349   l_rec.attribute21                      := p_attribute21;
350   l_rec.attribute22                      := p_attribute22;
351   l_rec.attribute23                      := p_attribute23;
352   l_rec.attribute24                      := p_attribute24;
353   l_rec.attribute25                      := p_attribute25;
354   l_rec.attribute26                      := p_attribute26;
355   l_rec.attribute27                      := p_attribute27;
356   l_rec.attribute28                      := p_attribute28;
357   l_rec.attribute29                      := p_attribute29;
358   l_rec.attribute30                      := p_attribute30;
359   --
360   if g_debug then
361   	hr_utility.set_location('Leaving convert args', 20);
362   end if;
363   --
364   -- Return the plsql record structure.
365   --
366   Return(l_rec);
367 --
368 End convert_args;
369 --
370 end hxc_ter_shd;