DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_LOS_BUS

Source


1 Package Body pqh_los_bus as
2 /* $Header: pqlosrhi.pkb 120.0 2005/05/29 02:11:26 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pqh_los_bus.';  -- Global package name
9 --
10 -- The following two global variables are only to be
11 -- used by the return_legislation_code function.
12 --
13 g_legislation_code            varchar2(150)  default null;
14 g_situation_id                number         default null;
15 --
16 --  ---------------------------------------------------------------------------
17 --  |----------------------< set_security_group_id >--------------------------|
18 --  ---------------------------------------------------------------------------
19 --
20 Procedure set_security_group_id
21   (p_situation_id                         in number
22   ,p_associated_column1                   in varchar2 default null
23   ) is
24   --
25   -- Declare cursor
26   --
27   cursor csr_sec_grp is
28     select pbg.security_group_id
29       from per_business_groups pbg
30          , pqh_situations los
31      where los.situation_id = p_situation_id
32        and pbg.business_group_id = los.business_group_id;
33   --
34   -- Declare local variables
35   --
36   l_security_group_id number;
37   l_proc              varchar2(72)  :=  g_package||'set_security_group_id';
38   --
39 begin
40   --
41   hr_utility.set_location('Entering:'|| l_proc, 10);
42   --
43   -- Ensure that all the mandatory parameter are not null
44   --
45   hr_api.mandatory_arg_error
46     (p_api_name           => l_proc
47     ,p_argument           => 'situation_id'
48     ,p_argument_value     => p_situation_id
49     );
50   --
51   open csr_sec_grp;
52   fetch csr_sec_grp into l_security_group_id;
53   --
54   if csr_sec_grp%notfound then
55      --
56      close csr_sec_grp;
57      --
58      -- The primary key is invalid therefore we must error
59      --
60      fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
61      hr_multi_message.add
62        (p_associated_column1
63         => nvl(p_associated_column1,'SITUATION_ID')
64        );
65      --
66   else
67     close csr_sec_grp;
68     --
69     -- Set the security_group_id in CLIENT_INFO
70     --
71     hr_api.set_security_group_id
72       (p_security_group_id => l_security_group_id
73       );
74   end if;
75   --
76   hr_utility.set_location(' Leaving:'|| l_proc, 20);
77   --
78 end set_security_group_id;
79 --
80 --  ---------------------------------------------------------------------------
81 --  |---------------------< return_legislation_code >-------------------------|
82 --  ---------------------------------------------------------------------------
83 --
84 Function return_legislation_code
85   (p_situation_id                         in     number
86   )
87   Return Varchar2 Is
88   --
89   -- Declare cursor
90   --
91  cursor csr_leg_code is
92     select pbg.legislation_code
93       from per_business_groups pbg
94          , pqh_situations los
95      where los.situation_id = p_situation_id
96        and pbg.business_group_id = los.business_group_id;
97   --
98   -- Declare local variables
99   --
100   l_legislation_code  varchar2(150);
101   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
102   --
103 Begin
104   --
105   hr_utility.set_location('Entering:'|| l_proc, 10);
106   --
107   -- Ensure that all the mandatory parameter are not null
108   --
109   hr_api.mandatory_arg_error
110     (p_api_name           => l_proc
111     ,p_argument           => 'situation_id'
112     ,p_argument_value     => p_situation_id
113     );
114   --
115   if ( nvl(pqh_los_bus.g_situation_id, hr_api.g_number)
116        = p_situation_id) then
117     --
118     -- The legislation code has already been found with a previous
119     -- call to this function. Just return the value in the global
120     -- variable.
121     --
122     l_legislation_code := pqh_los_bus.g_legislation_code;
123     hr_utility.set_location(l_proc, 20);
124   else
125     --
126     -- The ID is different to the last call to this function
127     -- or this is the first call to this function.
128     --
129     open csr_leg_code;
130     fetch csr_leg_code into l_legislation_code;
131     --
132     if csr_leg_code%notfound then
133       --
134       -- The primary key is invalid therefore we must error
135       --
136       close csr_leg_code;
137       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
138       fnd_message.raise_error;
139     end if;
140     hr_utility.set_location(l_proc,30);
141     --
142     -- Set the global variables so the values are
143     -- available for the next call to this function.
144     --
145     close csr_leg_code;
146     pqh_los_bus.g_situation_id                := p_situation_id;
147     pqh_los_bus.g_legislation_code  := l_legislation_code;
148   end if;
149   hr_utility.set_location(' Leaving:'|| l_proc, 40);
150   return l_legislation_code;
151 end return_legislation_code;
152 --
153 -- ----------------------------------------------------------------------------
154 -- |-----------------------------< chk_ddf >----------------------------------|
155 -- ----------------------------------------------------------------------------
156 --
157 -- Description:
158 --   Validates all the Developer Descriptive Flexfield values.
159 --
160 -- Prerequisites:
161 --   All other columns have been validated.  Must be called as the
162 --   last step from insert_validate and update_validate.
163 --
164 -- In Arguments:
165 --   p_rec
166 --
167 -- Post Success:
168 --   If the Developer Descriptive Flexfield structure column and data values
169 --   are all valid this procedure will end normally and processing will
170 --   continue.
171 --
172 -- Post Failure:
173 --   If the Developer Descriptive Flexfield structure column value or any of
174 --   the data values are invalid then an application error is raised as
175 --   a PL/SQL exception.
176 --
177 -- Access Status:
178 --   Internal Row Handler Use Only.
179 --
180 -- ----------------------------------------------------------------------------
181 procedure chk_ddf
182   (p_rec in pqh_los_shd.g_rec_type
183   ) is
184 --
185   l_proc   varchar2(72) := g_package || 'chk_ddf';
186 --
187 begin
188   hr_utility.set_location('Entering:'||l_proc,10);
189   --
190   if ((p_rec.situation_id is not null)  and (
191     nvl(pqh_los_shd.g_old_rec.information_category, hr_api.g_varchar2) <>
192     nvl(p_rec.information_category, hr_api.g_varchar2)  or
193     nvl(pqh_los_shd.g_old_rec.information1, hr_api.g_varchar2) <>
194     nvl(p_rec.information1, hr_api.g_varchar2)  or
195     nvl(pqh_los_shd.g_old_rec.information2, hr_api.g_varchar2) <>
196     nvl(p_rec.information2, hr_api.g_varchar2)  or
197     nvl(pqh_los_shd.g_old_rec.information3, hr_api.g_varchar2) <>
198     nvl(p_rec.information3, hr_api.g_varchar2)  or
199     nvl(pqh_los_shd.g_old_rec.information4, hr_api.g_varchar2) <>
200     nvl(p_rec.information4, hr_api.g_varchar2)  or
201     nvl(pqh_los_shd.g_old_rec.information5, hr_api.g_varchar2) <>
202     nvl(p_rec.information5, hr_api.g_varchar2)  or
203     nvl(pqh_los_shd.g_old_rec.information6, hr_api.g_varchar2) <>
204     nvl(p_rec.information6, hr_api.g_varchar2)  or
205     nvl(pqh_los_shd.g_old_rec.information7, hr_api.g_varchar2) <>
206     nvl(p_rec.information7, hr_api.g_varchar2)  or
207     nvl(pqh_los_shd.g_old_rec.information8, hr_api.g_varchar2) <>
208     nvl(p_rec.information8, hr_api.g_varchar2)  or
209     nvl(pqh_los_shd.g_old_rec.information9, hr_api.g_varchar2) <>
210     nvl(p_rec.information9, hr_api.g_varchar2)  or
211     nvl(pqh_los_shd.g_old_rec.information10, hr_api.g_varchar2) <>
212     nvl(p_rec.information10, hr_api.g_varchar2)  or
213     nvl(pqh_los_shd.g_old_rec.information11, hr_api.g_varchar2) <>
214     nvl(p_rec.information11, hr_api.g_varchar2)  or
215     nvl(pqh_los_shd.g_old_rec.information12, hr_api.g_varchar2) <>
216     nvl(p_rec.information12, hr_api.g_varchar2)  or
217     nvl(pqh_los_shd.g_old_rec.information13, hr_api.g_varchar2) <>
218     nvl(p_rec.information13, hr_api.g_varchar2)  or
219     nvl(pqh_los_shd.g_old_rec.information14, hr_api.g_varchar2) <>
220     nvl(p_rec.information14, hr_api.g_varchar2)  or
221     nvl(pqh_los_shd.g_old_rec.information15, hr_api.g_varchar2) <>
222     nvl(p_rec.information15, hr_api.g_varchar2)  or
223     nvl(pqh_los_shd.g_old_rec.information16, hr_api.g_varchar2) <>
224     nvl(p_rec.information16, hr_api.g_varchar2)  or
225     nvl(pqh_los_shd.g_old_rec.information17, hr_api.g_varchar2) <>
226     nvl(p_rec.information17, hr_api.g_varchar2)  or
227     nvl(pqh_los_shd.g_old_rec.information18, hr_api.g_varchar2) <>
228     nvl(p_rec.information18, hr_api.g_varchar2)  or
229     nvl(pqh_los_shd.g_old_rec.information19, hr_api.g_varchar2) <>
230     nvl(p_rec.information19, hr_api.g_varchar2)  or
231     nvl(pqh_los_shd.g_old_rec.information20, hr_api.g_varchar2) <>
232     nvl(p_rec.information20, hr_api.g_varchar2)  or
233     nvl(pqh_los_shd.g_old_rec.information21, hr_api.g_varchar2) <>
234     nvl(p_rec.information21, hr_api.g_varchar2)  or
235     nvl(pqh_los_shd.g_old_rec.information22, hr_api.g_varchar2) <>
236     nvl(p_rec.information22, hr_api.g_varchar2)  or
237     nvl(pqh_los_shd.g_old_rec.information23, hr_api.g_varchar2) <>
238     nvl(p_rec.information23, hr_api.g_varchar2)  or
239     nvl(pqh_los_shd.g_old_rec.information24, hr_api.g_varchar2) <>
240     nvl(p_rec.information24, hr_api.g_varchar2)  or
241     nvl(pqh_los_shd.g_old_rec.information25, hr_api.g_varchar2) <>
242     nvl(p_rec.information25, hr_api.g_varchar2)  or
243     nvl(pqh_los_shd.g_old_rec.information26, hr_api.g_varchar2) <>
244     nvl(p_rec.information26, hr_api.g_varchar2)  or
245     nvl(pqh_los_shd.g_old_rec.information27, hr_api.g_varchar2) <>
246     nvl(p_rec.information27, hr_api.g_varchar2)  or
247     nvl(pqh_los_shd.g_old_rec.information28, hr_api.g_varchar2) <>
248     nvl(p_rec.information28, hr_api.g_varchar2)  or
249     nvl(pqh_los_shd.g_old_rec.information29, hr_api.g_varchar2) <>
250     nvl(p_rec.information29, hr_api.g_varchar2)  or
251     nvl(pqh_los_shd.g_old_rec.information30, hr_api.g_varchar2) <>
252     nvl(p_rec.information30, hr_api.g_varchar2) ))
253     or (p_rec.situation_id is null)  then
254     --
255     -- Only execute the validation if absolutely necessary:
256     -- a) During update, the structure column value or any
257     --    of the attribute values have actually changed.
258     -- b) During insert.
259     --
260     hr_dflex_utility.ins_or_upd_descflex_attribs
261       (p_appl_short_name                 => 'PQH'
262       ,p_descflex_name                   => 'EDIT_HERE: Enter descflex name'
263       ,p_attribute_category              => 'INFORMATION_CATEGORY'
264       ,p_attribute1_name                 => 'INFORMATION1'
265       ,p_attribute1_value                => p_rec.information1
266       ,p_attribute2_name                 => 'INFORMATION2'
267       ,p_attribute2_value                => p_rec.information2
268       ,p_attribute3_name                 => 'INFORMATION3'
269       ,p_attribute3_value                => p_rec.information3
270       ,p_attribute4_name                 => 'INFORMATION4'
271       ,p_attribute4_value                => p_rec.information4
272       ,p_attribute5_name                 => 'INFORMATION5'
273       ,p_attribute5_value                => p_rec.information5
274       ,p_attribute6_name                 => 'INFORMATION6'
275       ,p_attribute6_value                => p_rec.information6
276       ,p_attribute7_name                 => 'INFORMATION7'
277       ,p_attribute7_value                => p_rec.information7
278       ,p_attribute8_name                 => 'INFORMATION8'
279       ,p_attribute8_value                => p_rec.information8
280       ,p_attribute9_name                 => 'INFORMATION9'
281       ,p_attribute9_value                => p_rec.information9
282       ,p_attribute10_name                => 'INFORMATION10'
283       ,p_attribute10_value               => p_rec.information10
284       ,p_attribute11_name                => 'INFORMATION11'
285       ,p_attribute11_value               => p_rec.information11
286       ,p_attribute12_name                => 'INFORMATION12'
287       ,p_attribute12_value               => p_rec.information12
288       ,p_attribute13_name                => 'INFORMATION13'
289       ,p_attribute13_value               => p_rec.information13
290       ,p_attribute14_name                => 'INFORMATION14'
291       ,p_attribute14_value               => p_rec.information14
292       ,p_attribute15_name                => 'INFORMATION15'
293       ,p_attribute15_value               => p_rec.information15
294       ,p_attribute16_name                => 'INFORMATION16'
295       ,p_attribute16_value               => p_rec.information16
296       ,p_attribute17_name                => 'INFORMATION17'
297       ,p_attribute17_value               => p_rec.information17
298       ,p_attribute18_name                => 'INFORMATION18'
299       ,p_attribute18_value               => p_rec.information18
300       ,p_attribute19_name                => 'INFORMATION19'
301       ,p_attribute19_value               => p_rec.information19
302       ,p_attribute20_name                => 'INFORMATION20'
303       ,p_attribute20_value               => p_rec.information20
304       ,p_attribute21_name                => 'INFORMATION21'
305       ,p_attribute21_value               => p_rec.information21
306       ,p_attribute22_name                => 'INFORMATION22'
307       ,p_attribute22_value               => p_rec.information22
308       ,p_attribute23_name                => 'INFORMATION23'
309       ,p_attribute23_value               => p_rec.information23
310       ,p_attribute24_name                => 'INFORMATION24'
311       ,p_attribute24_value               => p_rec.information24
312       ,p_attribute25_name                => 'INFORMATION25'
313       ,p_attribute25_value               => p_rec.information25
314       ,p_attribute26_name                => 'INFORMATION26'
315       ,p_attribute26_value               => p_rec.information26
316       ,p_attribute27_name                => 'INFORMATION27'
317       ,p_attribute27_value               => p_rec.information27
318       ,p_attribute28_name                => 'INFORMATION28'
319       ,p_attribute28_value               => p_rec.information28
320       ,p_attribute29_name                => 'INFORMATION29'
321       ,p_attribute29_value               => p_rec.information29
322       ,p_attribute30_name                => 'INFORMATION30'
323       ,p_attribute30_value               => p_rec.information30
324       );
325   end if;
326   --
327   hr_utility.set_location(' Leaving:'||l_proc,20);
328 end chk_ddf;
329 --
330 -- ----------------------------------------------------------------------------
331 -- |------------------------------< chk_df >----------------------------------|
332 -- ----------------------------------------------------------------------------
333 --
334 -- Description:
335 --   Validates all the Descriptive Flexfield values.
336 --
337 -- Prerequisites:
338 --   All other columns have been validated.  Must be called as the
339 --   last step from insert_validate and update_validate.
340 --
341 -- In Arguments:
342 --   p_rec
343 --
344 -- Post Success:
345 --   If the Descriptive Flexfield structure column and data values are
346 --   all valid this procedure will end normally and processing will
347 --   continue.
348 --
349 -- Post Failure:
350 --   If the Descriptive Flexfield structure column value or any of
351 --   the data values are invalid then an application error is raised as
352 --   a PL/SQL exception.
353 --
354 -- Access Status:
355 --   Internal Row Handler Use Only.
356 --
357 -- ----------------------------------------------------------------------------
358 procedure chk_df
359   (p_rec in pqh_los_shd.g_rec_type
360   ) is
361 --
362   l_proc   varchar2(72) := g_package || 'chk_df';
363 --
364 begin
368     nvl(pqh_los_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
365   hr_utility.set_location('Entering:'||l_proc,10);
366   --
367   if ((p_rec.situation_id is not null)  and (
369     nvl(p_rec.attribute_category, hr_api.g_varchar2)  or
370     nvl(pqh_los_shd.g_old_rec.attribute1, hr_api.g_varchar2) <>
371     nvl(p_rec.attribute1, hr_api.g_varchar2)  or
372     nvl(pqh_los_shd.g_old_rec.attribute2, hr_api.g_varchar2) <>
373     nvl(p_rec.attribute2, hr_api.g_varchar2)  or
374     nvl(pqh_los_shd.g_old_rec.attribute3, hr_api.g_varchar2) <>
375     nvl(p_rec.attribute3, hr_api.g_varchar2)  or
376     nvl(pqh_los_shd.g_old_rec.attribute4, hr_api.g_varchar2) <>
377     nvl(p_rec.attribute4, hr_api.g_varchar2)  or
378     nvl(pqh_los_shd.g_old_rec.attribute5, hr_api.g_varchar2) <>
379     nvl(p_rec.attribute5, hr_api.g_varchar2)  or
380     nvl(pqh_los_shd.g_old_rec.attribute6, hr_api.g_varchar2) <>
381     nvl(p_rec.attribute6, hr_api.g_varchar2)  or
382     nvl(pqh_los_shd.g_old_rec.attribute7, hr_api.g_varchar2) <>
383     nvl(p_rec.attribute7, hr_api.g_varchar2)  or
384     nvl(pqh_los_shd.g_old_rec.attribute8, hr_api.g_varchar2) <>
385     nvl(p_rec.attribute8, hr_api.g_varchar2)  or
386     nvl(pqh_los_shd.g_old_rec.attribute9, hr_api.g_varchar2) <>
387     nvl(p_rec.attribute9, hr_api.g_varchar2)  or
388     nvl(pqh_los_shd.g_old_rec.attribute10, hr_api.g_varchar2) <>
389     nvl(p_rec.attribute10, hr_api.g_varchar2)  or
390     nvl(pqh_los_shd.g_old_rec.attribute11, hr_api.g_varchar2) <>
391     nvl(p_rec.attribute11, hr_api.g_varchar2)  or
392     nvl(pqh_los_shd.g_old_rec.attribute12, hr_api.g_varchar2) <>
393     nvl(p_rec.attribute12, hr_api.g_varchar2)  or
394     nvl(pqh_los_shd.g_old_rec.attribute13, hr_api.g_varchar2) <>
395     nvl(p_rec.attribute13, hr_api.g_varchar2)  or
396     nvl(pqh_los_shd.g_old_rec.attribute14, hr_api.g_varchar2) <>
397     nvl(p_rec.attribute14, hr_api.g_varchar2)  or
398     nvl(pqh_los_shd.g_old_rec.attribute15, hr_api.g_varchar2) <>
399     nvl(p_rec.attribute15, hr_api.g_varchar2)  or
400     nvl(pqh_los_shd.g_old_rec.attribute16, hr_api.g_varchar2) <>
401     nvl(p_rec.attribute16, hr_api.g_varchar2)  or
402     nvl(pqh_los_shd.g_old_rec.attribute17, hr_api.g_varchar2) <>
403     nvl(p_rec.attribute17, hr_api.g_varchar2)  or
404     nvl(pqh_los_shd.g_old_rec.attribute18, hr_api.g_varchar2) <>
405     nvl(p_rec.attribute18, hr_api.g_varchar2)  or
406     nvl(pqh_los_shd.g_old_rec.attribute19, hr_api.g_varchar2) <>
407     nvl(p_rec.attribute19, hr_api.g_varchar2)  or
408     nvl(pqh_los_shd.g_old_rec.attribute20, hr_api.g_varchar2) <>
409     nvl(p_rec.attribute20, hr_api.g_varchar2)  or
410     nvl(pqh_los_shd.g_old_rec.attribute21, hr_api.g_varchar2) <>
411     nvl(p_rec.attribute21, hr_api.g_varchar2)  or
412     nvl(pqh_los_shd.g_old_rec.attribute22, hr_api.g_varchar2) <>
413     nvl(p_rec.attribute22, hr_api.g_varchar2)  or
414     nvl(pqh_los_shd.g_old_rec.attribute23, hr_api.g_varchar2) <>
415     nvl(p_rec.attribute23, hr_api.g_varchar2)  or
416     nvl(pqh_los_shd.g_old_rec.attribute24, hr_api.g_varchar2) <>
417     nvl(p_rec.attribute24, hr_api.g_varchar2)  or
418     nvl(pqh_los_shd.g_old_rec.attribute25, hr_api.g_varchar2) <>
419     nvl(p_rec.attribute25, hr_api.g_varchar2)  or
420     nvl(pqh_los_shd.g_old_rec.attribute26, hr_api.g_varchar2) <>
421     nvl(p_rec.attribute26, hr_api.g_varchar2)  or
422     nvl(pqh_los_shd.g_old_rec.attribute27, hr_api.g_varchar2) <>
423     nvl(p_rec.attribute27, hr_api.g_varchar2)  or
424     nvl(pqh_los_shd.g_old_rec.attribute28, hr_api.g_varchar2) <>
425     nvl(p_rec.attribute28, hr_api.g_varchar2)  or
426     nvl(pqh_los_shd.g_old_rec.attribute29, hr_api.g_varchar2) <>
427     nvl(p_rec.attribute29, hr_api.g_varchar2)  or
428     nvl(pqh_los_shd.g_old_rec.attribute30, hr_api.g_varchar2) <>
429     nvl(p_rec.attribute30, hr_api.g_varchar2) ))
430     or (p_rec.situation_id is null)  then
431     --
432     -- Only execute the validation if absolutely necessary:
433     -- a) During update, the structure column value or any
434     --    of the attribute values have actually changed.
435     -- b) During insert.
436     --
437     hr_dflex_utility.ins_or_upd_descflex_attribs
438       (p_appl_short_name                 => 'PQH'
439       ,p_descflex_name                   => 'EDIT_HERE: Enter descflex name'
440       ,p_attribute_category              => 'ATTRIBUTE_CATEGORY'
441       ,p_attribute1_name                 => 'ATTRIBUTE1'
442       ,p_attribute1_value                => p_rec.attribute1
443       ,p_attribute2_name                 => 'ATTRIBUTE2'
444       ,p_attribute2_value                => p_rec.attribute2
445       ,p_attribute3_name                 => 'ATTRIBUTE3'
446       ,p_attribute3_value                => p_rec.attribute3
447       ,p_attribute4_name                 => 'ATTRIBUTE4'
448       ,p_attribute4_value                => p_rec.attribute4
449       ,p_attribute5_name                 => 'ATTRIBUTE5'
450       ,p_attribute5_value                => p_rec.attribute5
451       ,p_attribute6_name                 => 'ATTRIBUTE6'
452       ,p_attribute6_value                => p_rec.attribute6
453       ,p_attribute7_name                 => 'ATTRIBUTE7'
454       ,p_attribute7_value                => p_rec.attribute7
455       ,p_attribute8_name                 => 'ATTRIBUTE8'
456       ,p_attribute8_value                => p_rec.attribute8
457       ,p_attribute9_name                 => 'ATTRIBUTE9'
458       ,p_attribute9_value                => p_rec.attribute9
459       ,p_attribute10_name                => 'ATTRIBUTE10'
460       ,p_attribute10_value               => p_rec.attribute10
464       ,p_attribute12_value               => p_rec.attribute12
461       ,p_attribute11_name                => 'ATTRIBUTE11'
462       ,p_attribute11_value               => p_rec.attribute11
463       ,p_attribute12_name                => 'ATTRIBUTE12'
465       ,p_attribute13_name                => 'ATTRIBUTE13'
466       ,p_attribute13_value               => p_rec.attribute13
467       ,p_attribute14_name                => 'ATTRIBUTE14'
468       ,p_attribute14_value               => p_rec.attribute14
469       ,p_attribute15_name                => 'ATTRIBUTE15'
470       ,p_attribute15_value               => p_rec.attribute15
471       ,p_attribute16_name                => 'ATTRIBUTE16'
472       ,p_attribute16_value               => p_rec.attribute16
473       ,p_attribute17_name                => 'ATTRIBUTE17'
474       ,p_attribute17_value               => p_rec.attribute17
475       ,p_attribute18_name                => 'ATTRIBUTE18'
476       ,p_attribute18_value               => p_rec.attribute18
477       ,p_attribute19_name                => 'ATTRIBUTE19'
478       ,p_attribute19_value               => p_rec.attribute19
479       ,p_attribute20_name                => 'ATTRIBUTE20'
480       ,p_attribute20_value               => p_rec.attribute20
481       ,p_attribute21_name                => 'ATTRIBUTE21'
482       ,p_attribute21_value               => p_rec.attribute21
483       ,p_attribute22_name                => 'ATTRIBUTE22'
484       ,p_attribute22_value               => p_rec.attribute22
485       ,p_attribute23_name                => 'ATTRIBUTE23'
486       ,p_attribute23_value               => p_rec.attribute23
487       ,p_attribute24_name                => 'ATTRIBUTE24'
488       ,p_attribute24_value               => p_rec.attribute24
489       ,p_attribute25_name                => 'ATTRIBUTE25'
490       ,p_attribute25_value               => p_rec.attribute25
491       ,p_attribute26_name                => 'ATTRIBUTE26'
492       ,p_attribute26_value               => p_rec.attribute26
493       ,p_attribute27_name                => 'ATTRIBUTE27'
494       ,p_attribute27_value               => p_rec.attribute27
495       ,p_attribute28_name                => 'ATTRIBUTE28'
496       ,p_attribute28_value               => p_rec.attribute28
497       ,p_attribute29_name                => 'ATTRIBUTE29'
498       ,p_attribute29_value               => p_rec.attribute29
499       ,p_attribute30_name                => 'ATTRIBUTE30'
500       ,p_attribute30_value               => p_rec.attribute30
501       );
502   end if;
503   --
504   hr_utility.set_location(' Leaving:'||l_proc,20);
505 end chk_df;
506 --
507 -- ----------------------------------------------------------------------------
508 -- |-----------------------< chk_non_updateable_args >------------------------|
509 -- ----------------------------------------------------------------------------
510 -- {Start Of Comments}
511 --
512 -- Description:
513 --   This procedure is used to ensure that non updateable attributes have
514 --   not been updated. If an attribute has been updated an error is generated.
515 --
516 -- Pre Conditions:
517 --   g_old_rec has been populated with details of the values currently in
518 --   the database.
519 --
520 -- In Arguments:
521 --   p_rec has been populated with the updated values the user would like the
522 --   record set to.
523 --
524 -- Post Success:
525 --   Processing continues if all the non updateable attributes have not
526 --   changed.
527 --
528 -- Post Failure:
529 --   An application error is raised if any of the non updatable attributes
530 --   have been altered.
531 --
532 -- {End Of Comments}
533 -- ----------------------------------------------------------------------------
534 Procedure chk_non_updateable_args
535   (p_effective_date               in date
536   ,p_rec in pqh_los_shd.g_rec_type
537   ) IS
538 --
539   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
540 --
541 Begin
542   --
543   -- Only proceed with the validation if a row exists for the current
544   -- record in the HR Schema.
545   --
546   IF NOT pqh_los_shd.api_updating
547       (p_situation_id                      => p_rec.situation_id
548       ,p_object_version_number             => p_rec.object_version_number
549       ) THEN
550      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
551      fnd_message.set_token('PROCEDURE ', l_proc);
552      fnd_message.set_token('STEP ', '5');
553      fnd_message.raise_error;
554   END IF;
555   --
556   -- EDIT_HERE: Add checks to ensure non-updateable args have
557   --            not been updated.
558   --
559 End chk_non_updateable_args;
560 --
561 -- ----------------------------------------------------------------------------
562 -- |---------------------------< duplicate_check >----------------------------|
563 -- ----------------------------------------------------------------------------
564 Procedure duplicate_check(p_situation in varchar2,p_situation_type in varchar2,
565          p_length_of_service in varchar2,p_employee_type in varchar2,p_situation_id  in number default NULL ) IS
566 -- Variable to check for duplicate.
567   l_situation_id NUMBER(15,0);
568   CURSOR cur_duplicate is
569   select situation_id from pqh_situations where
570   rownum < 2
571   AND   situation_id <> decode(p_situation_id,null,-1,p_situation_id)
572   AND  SITUATION = p_situation
573   AND SITUATION_TYPE = p_situation_type
574   AND LENGTH_OF_SERVICE = p_length_of_service
575   AND EMPLOYEE_TYPE = p_employee_type
576   AND BUSINESS_GROUP_ID = hr_general.get_business_group_id; --add for BUG#3519152 (reopen)
577   l_proc  varchar2(72);
578 Begin
579   l_proc :=  g_package||'duplicate_check';
580   hr_utility.set_location('Entering:'||l_proc, 5);
581   --
582   -- To check for duplicate value.
583   --
584   OPEN cur_duplicate;
585   FETCH cur_duplicate into l_situation_id;
586   if(cur_duplicate%FOUND ) Then
587     fnd_message.set_name('PQH', 'PQH_FR_DUP_SITUATION');
588     hr_multi_message.add;
589   end if;
590   CLOSE cur_duplicate;
591   hr_utility.set_location(' Leaving:'||l_proc, 10);
592 End duplicate_check;
593 
594 
595 
596 -- ----------------------------------------------------------------------------
597 -- |---------------------------< insert_validate >----------------------------|
598 -- ----------------------------------------------------------------------------
599 Procedure insert_validate
600   (p_effective_date               in date
601   ,p_rec                          in pqh_los_shd.g_rec_type
602   ) is
603 --
604   l_proc  varchar2(72) := g_package||'insert_validate';
605 
606 
607 --
608 Begin
609   hr_utility.set_location('Entering:'||l_proc, 5);
610   --
611   -- Call all supporting business operations
612   --
613   hr_api.validate_bus_grp_id
614     (p_business_group_id => p_rec.business_group_id
615     ,p_associated_column1 => pqh_los_shd.g_tab_nam
616                               || '.BUSINESS_GROUP_ID');
617   --
618   -- To check for duplicate value.
619   --
620 duplicate_check(p_rec.situation ,p_rec.situation_type ,
621          p_rec.length_of_service,p_rec.employee_type,p_rec.situation_id);
622 
623 
624   --
625   -- After validating the set of important attributes,
626   -- if Multiple Message detection is enabled and at least
627   -- one error has been found then abort further validation.
628   --
629   hr_multi_message.end_validation_set;
630   --
631   -- Validate Dependent Attributes
632   --
633   --
634   -- pqh_los_bus.chk_ddf(p_rec);
635   --
636   -- pqh_los_bus.chk_df(p_rec);
637   --
638   hr_utility.set_location(' Leaving:'||l_proc, 10);
639 End insert_validate;
640 --
641 -- ----------------------------------------------------------------------------
642 -- |---------------------------< update_validate >----------------------------|
643 -- ----------------------------------------------------------------------------
644 Procedure update_validate
645   (p_effective_date               in date
646   ,p_rec                          in pqh_los_shd.g_rec_type
647   ) is
648 --
649   l_proc  varchar2(72) := g_package||'update_validate';
650 
651 --
652 Begin
653   hr_utility.set_location('Entering:'||l_proc, 5);
654   --
655   -- Call all supporting business operations
656   --
657   hr_api.validate_bus_grp_id
658     (p_business_group_id => p_rec.business_group_id
659     ,p_associated_column1 => pqh_los_shd.g_tab_nam
660                               || '.BUSINESS_GROUP_ID');
661   --
662   -- To check for duplicate value.
663   --
664 duplicate_check(p_rec.situation ,p_rec.situation_type ,
665          p_rec.length_of_service,p_rec.employee_type,p_rec.situation_id);
666 
667 
668   --
669   -- After validating the set of important attributes,
670   -- if Multiple Message detection is enabled and at least
671   -- one error has been found then abort further validation.
672   --
673   hr_multi_message.end_validation_set;
674   --
675   -- Validate Dependent Attributes
676   --
677   chk_non_updateable_args
678     (p_effective_date              => p_effective_date
679       ,p_rec              => p_rec
680     );
681   --
682   --
683   -- pqh_los_bus.chk_ddf(p_rec);
684   --
685   -- pqh_los_bus.chk_df(p_rec);
686   --
687   hr_utility.set_location(' Leaving:'||l_proc, 10);
688 End update_validate;
689 --
690 -- ----------------------------------------------------------------------------
691 -- |---------------------------< delete_validate >----------------------------|
692 -- ----------------------------------------------------------------------------
693 Procedure delete_validate
694   (p_rec                          in pqh_los_shd.g_rec_type
695   ) is
696 --
697   l_proc  varchar2(72) := g_package||'delete_validate';
698 --
699 Begin
700   hr_utility.set_location('Entering:'||l_proc, 5);
701   --
702   -- Call all supporting business operations
703   --
704   hr_utility.set_location(' Leaving:'||l_proc, 10);
705 End delete_validate;
706 --
707 end pqh_los_bus;