DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQP_VAI_BUS

Source


1 Package Body pqp_vai_bus as
2 /* $Header: pqvairhi.pkb 120.0.12010000.2 2008/08/08 07:19:09 ubhat ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pqp_vai_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_veh_alloc_extra_info_id     number         default null;
15 g_vehicle_allocation_id       number         default null;
16 
17 --
18 --  ---------------------------------------------------------------------------
19 --  |----------------------< set_security_group_id >--------------------------|
20 --  ---------------------------------------------------------------------------
21 --
22 Procedure set_security_group_id
23   (p_veh_alloc_extra_info_id              in number
24   ,p_associated_column1                   in varchar2 default null
25   ) is
26   --
27   -- Declare cursor
28   --
29   -- EDIT_HERE  In the following cursor statement add join(s) between
30   -- pqp_veh_alloc_extra_info and PER_BUSINESS_GROUPS_PERF
31   -- so that the security_group_id for
32   -- the current business group context can be derived.
33   -- Remove this comment when the edit has been completed.
34   cursor csr_sec_grp is
35     select pbg.security_group_id,
36            pbg.legislation_code
37       from per_business_groups_perf pbg
38          , pqp_veh_alloc_extra_info vai
39       --   , EDIT_HERE table_name(s) 333
40      where vai.veh_alloc_extra_info_id = p_veh_alloc_extra_info_id;
41       -- and pbg.business_group_id = EDIT_HERE 333.business_group_id;
42   --
43   -- Declare local variables
44   --
45   l_security_group_id number;
46   l_proc              varchar2(72)  :=  g_package||'set_security_group_id';
47   l_legislation_code  varchar2(150);
48   --
49 begin
50   --
51   hr_utility.set_location('Entering:'|| l_proc, 10);
52   --
53   -- Ensure that all the mandatory parameter are not null
54   --
55   hr_api.mandatory_arg_error
56     (p_api_name           => l_proc
57     ,p_argument           => 'veh_alloc_extra_info_id'
58     ,p_argument_value     => p_veh_alloc_extra_info_id
59     );
60   --
61   open csr_sec_grp;
62   fetch csr_sec_grp into l_security_group_id
63                        , l_legislation_code;
64   --
65   if csr_sec_grp%notfound then
66      --
67      close csr_sec_grp;
68      --
69      -- The primary key is invalid therefore we must error
70      --
71      fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
72      hr_multi_message.add
73        (p_associated_column1
74         => nvl(p_associated_column1,'VEH_ALLOC_EXTRA_INFO_ID')
75        );
76      --
77   else
78     close csr_sec_grp;
79     --
80     -- Set the security_group_id in CLIENT_INFO
81     --
82     hr_api.set_security_group_id
83       (p_security_group_id => l_security_group_id
84       );
85     --
86     -- Set the sessions legislation context in HR_SESSION_DATA
87     --
88     hr_api.set_legislation_context(l_legislation_code);
89   end if;
90   --
91   hr_utility.set_location(' Leaving:'|| l_proc, 20);
92   --
93 end set_security_group_id;
94 --
95 --  ---------------------------------------------------------------------------
96 --  |---------------------< return_legislation_code >-------------------------|
97 --  ---------------------------------------------------------------------------
98 --
99 Function return_legislation_code
100   (p_vehicle_allocation_id              in     number
101   )
102   Return Varchar2 Is
103   --
104   -- Declare cursor
105   --
106   cursor csr_leg_code is
107     select pbg.legislation_code
108       from per_business_groups_perf     pbg
109           ,pqp_vehicle_allocations_f    pva
110      where pva.vehicle_allocation_id = p_vehicle_allocation_id
111        and pbg.business_group_id     = pva.business_group_id;
112   --
113   -- Declare local variables
114   --
115   l_legislation_code  varchar2(150);
116   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
117   --
118 Begin
119   --
120   hr_utility.set_location('Entering:'|| l_proc, 10);
121   --
122   -- Ensure that all the mandatory parameter are not null
123   --
124   hr_api.mandatory_arg_error
125     (p_api_name           => l_proc
126     ,p_argument           => 'vehicle_allocation_id'
127     ,p_argument_value     => p_vehicle_allocation_id
128     );
129   --
130   if ( nvl(pqp_vai_bus.g_vehicle_allocation_id, hr_api.g_number)
131        = p_vehicle_allocation_id) then
132     --
133     -- The legislation code has already been found with a previous
134     -- call to this function. Just return the value in the global
135     -- variable.
136     --
137     l_legislation_code := pqp_vai_bus.g_legislation_code;
138     hr_utility.set_location(l_proc, 20);
139   else
140     --
141     -- The ID is different to the last call to this function
142     -- or this is the first call to this function.
143     --
144     open csr_leg_code;
145     fetch csr_leg_code into l_legislation_code;
146     --
147     if csr_leg_code%notfound then
148       --
149       -- The primary key is invalid therefore we must error
150       --
151       close csr_leg_code;
152       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
153       fnd_message.raise_error;
154     end if;
155     hr_utility.set_location(l_proc,30);
156     --
157     -- Set the global variables so the values are
158     -- available for the next call to this function.
159     --
160     close csr_leg_code;
161     pqp_vai_bus.g_vehicle_allocation_id     := p_vehicle_allocation_id;
162     pqp_vai_bus.g_legislation_code  := l_legislation_code;
163   end if;
164   hr_utility.set_location(' Leaving:'|| l_proc, 40);
165   return l_legislation_code;
166 end return_legislation_code;
167 --
168 
169 --  ---------------------------------------------------------------------------
170 --  |---------------------< return_alloc_legislation_code >-------------------------|
171 --  ---------------------------------------------------------------------------
172 --
173 Function return_alloc_legislation_code
174   (p_vehicle_allocation_id                in     number
175   )
176   Return Varchar2 Is
177   --
178   -- Declare cursor
179   --
180  cursor csr_leg_code is
181     select pbg.legislation_code
182       from per_business_groups_perf pbg
183          , pqp_vehicle_allocations_f val
184      where val.vehicle_allocation_id = p_vehicle_allocation_id
185       AND   pbg.business_group_id=val.business_group_id ;
186   --
187   -- Declare local variables
188   --
189   l_legislation_code  varchar2(150);
190   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
191   --
192 Begin
193   --
194   hr_utility.set_location('Entering:'|| l_proc, 10);
195   --
196   -- Ensure that all the mandatory parameter are not null
197   --
198   hr_api.mandatory_arg_error
199     (p_api_name           => l_proc
200     ,p_argument           => 'vehicle_allocation_id'
201     ,p_argument_value     => p_vehicle_allocation_id
202     );
203   --
204   if ( nvl(pqp_vai_bus.g_vehicle_allocation_id, hr_api.g_number)
205        = p_vehicle_allocation_id) then
206     --
207     -- The legislation code has already been found with a previous
208     -- call to this function. Just return the value in the global
209     -- variable.
210     --
211     l_legislation_code := pqp_vai_bus.g_legislation_code;
212     hr_utility.set_location(l_proc, 20);
213   else
214     --
215     -- The ID is different to the last call to this function
216     -- or this is the first call to this function.
217     --
218     open csr_leg_code;
219     fetch csr_leg_code into l_legislation_code;
220     --
221     if csr_leg_code%notfound then
222       --
223       -- The primary key is invalid therefore we must error
224       --
225       close csr_leg_code;
226       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
227       fnd_message.raise_error;
228     end if;
229     hr_utility.set_location(l_proc,30);
230     --
231     -- Set the global variables so the values are
232     -- available for the next call to this function.
233     --
234     close csr_leg_code;
235     pqp_vai_bus.g_vehicle_allocation_id       := p_vehicle_allocation_id;
236     pqp_vai_bus.g_legislation_code  := l_legislation_code;
237   end if;
238   hr_utility.set_location(' Leaving:'|| l_proc, 40);
239   return l_legislation_code;
240 end return_alloc_legislation_code;
241 --
242 -- ----------------------------------------------------------------------------
243 -- |-----------------------------< chk_ddf >----------------------------------|
244 -- ----------------------------------------------------------------------------
245 --
246 -- Description:
247 --   Validates all the Developer Descriptive Flexfield values.
248 --
249 -- Prerequisites:
250 --   All other columns have been validated.  Must be called as the
251 --   last step from insert_validate and update_validate.
252 --
253 -- In Arguments:
254 --   p_rec
255 --
256 -- Post Success:
257 --   If the Developer Descriptive Flexfield structure column and data values
258 --   are all valid this procedure will end normally and processing will
259 --   continue.
260 --
261 -- Post Failure:
262 --   If the Developer Descriptive Flexfield structure column value or any of
263 --   the data values are invalid then an application error is raised as
264 --   a PL/SQL exception.
265 --
266 -- Access Status:
267 --   Internal Row Handler Use Only.
268 --
269 -- ----------------------------------------------------------------------------
270 procedure chk_ddf
271   (p_rec in pqp_vai_shd.g_rec_type
272   ) is
273 --
274   l_proc   varchar2(72) := g_package || 'chk_ddf';
275 --
276 begin
277   hr_utility.set_location('Entering:'||l_proc,10);
278   --
279   if ((p_rec.veh_alloc_extra_info_id is not null)  and (
280     nvl(pqp_vai_shd.g_old_rec.information_type, hr_api.g_varchar2) <>
281     nvl(p_rec.information_type, hr_api.g_varchar2)  or
282     nvl(pqp_vai_shd.g_old_rec.vaei_information_category, hr_api.g_varchar2) <>
283     nvl(p_rec.vaei_information_category, hr_api.g_varchar2)  or
284     nvl(pqp_vai_shd.g_old_rec.vaei_information1, hr_api.g_varchar2) <>
285     nvl(p_rec.vaei_information1, hr_api.g_varchar2)  or
286     nvl(pqp_vai_shd.g_old_rec.vaei_information2, hr_api.g_varchar2) <>
287     nvl(p_rec.vaei_information2, hr_api.g_varchar2)  or
288     nvl(pqp_vai_shd.g_old_rec.vaei_information3, hr_api.g_varchar2) <>
289     nvl(p_rec.vaei_information3, hr_api.g_varchar2)  or
290     nvl(pqp_vai_shd.g_old_rec.vaei_information4, hr_api.g_varchar2) <>
291     nvl(p_rec.vaei_information4, hr_api.g_varchar2)  or
292     nvl(pqp_vai_shd.g_old_rec.vaei_information5, hr_api.g_varchar2) <>
293     nvl(p_rec.vaei_information5, hr_api.g_varchar2)  or
294     nvl(pqp_vai_shd.g_old_rec.vaei_information6, hr_api.g_varchar2) <>
295     nvl(p_rec.vaei_information6, hr_api.g_varchar2)  or
296     nvl(pqp_vai_shd.g_old_rec.vaei_information7, hr_api.g_varchar2) <>
297     nvl(p_rec.vaei_information7, hr_api.g_varchar2)  or
298     nvl(pqp_vai_shd.g_old_rec.vaei_information8, hr_api.g_varchar2) <>
299     nvl(p_rec.vaei_information8, hr_api.g_varchar2)  or
300     nvl(pqp_vai_shd.g_old_rec.vaei_information9, hr_api.g_varchar2) <>
301     nvl(p_rec.vaei_information9, hr_api.g_varchar2)  or
302     nvl(pqp_vai_shd.g_old_rec.vaei_information10, hr_api.g_varchar2) <>
303     nvl(p_rec.vaei_information10, hr_api.g_varchar2)  or
304     nvl(pqp_vai_shd.g_old_rec.vaei_information11, hr_api.g_varchar2) <>
305     nvl(p_rec.vaei_information11, hr_api.g_varchar2)  or
306     nvl(pqp_vai_shd.g_old_rec.vaei_information12, hr_api.g_varchar2) <>
307     nvl(p_rec.vaei_information12, hr_api.g_varchar2)  or
308     nvl(pqp_vai_shd.g_old_rec.vaei_information13, hr_api.g_varchar2) <>
309     nvl(p_rec.vaei_information13, hr_api.g_varchar2)  or
310     nvl(pqp_vai_shd.g_old_rec.vaei_information14, hr_api.g_varchar2) <>
311     nvl(p_rec.vaei_information14, hr_api.g_varchar2)  or
312     nvl(pqp_vai_shd.g_old_rec.vaei_information15, hr_api.g_varchar2) <>
313     nvl(p_rec.vaei_information15, hr_api.g_varchar2)  or
314     nvl(pqp_vai_shd.g_old_rec.vaei_information16, hr_api.g_varchar2) <>
315     nvl(p_rec.vaei_information16, hr_api.g_varchar2)  or
316     nvl(pqp_vai_shd.g_old_rec.vaei_information17, hr_api.g_varchar2) <>
317     nvl(p_rec.vaei_information17, hr_api.g_varchar2)  or
318     nvl(pqp_vai_shd.g_old_rec.vaei_information18, hr_api.g_varchar2) <>
319     nvl(p_rec.vaei_information18, hr_api.g_varchar2)  or
320     nvl(pqp_vai_shd.g_old_rec.vaei_information19, hr_api.g_varchar2) <>
321     nvl(p_rec.vaei_information19, hr_api.g_varchar2)  or
322     nvl(pqp_vai_shd.g_old_rec.vaei_information20, hr_api.g_varchar2) <>
323     nvl(p_rec.vaei_information20, hr_api.g_varchar2)  or
324     nvl(pqp_vai_shd.g_old_rec.vaei_information21, hr_api.g_varchar2) <>
325     nvl(p_rec.vaei_information21, hr_api.g_varchar2)  or
326     nvl(pqp_vai_shd.g_old_rec.vaei_information22, hr_api.g_varchar2) <>
327     nvl(p_rec.vaei_information22, hr_api.g_varchar2)  or
328     nvl(pqp_vai_shd.g_old_rec.vaei_information23, hr_api.g_varchar2) <>
329     nvl(p_rec.vaei_information23, hr_api.g_varchar2)  or
330     nvl(pqp_vai_shd.g_old_rec.vaei_information24, hr_api.g_varchar2) <>
331     nvl(p_rec.vaei_information24, hr_api.g_varchar2)  or
332     nvl(pqp_vai_shd.g_old_rec.vaei_information25, hr_api.g_varchar2) <>
333     nvl(p_rec.vaei_information25, hr_api.g_varchar2)  or
334     nvl(pqp_vai_shd.g_old_rec.vaei_information26, hr_api.g_varchar2) <>
335     nvl(p_rec.vaei_information26, hr_api.g_varchar2)  or
336     nvl(pqp_vai_shd.g_old_rec.vaei_information27, hr_api.g_varchar2) <>
337     nvl(p_rec.vaei_information27, hr_api.g_varchar2)  or
338     nvl(pqp_vai_shd.g_old_rec.vaei_information28, hr_api.g_varchar2) <>
339     nvl(p_rec.vaei_information28, hr_api.g_varchar2)  or
340     nvl(pqp_vai_shd.g_old_rec.vaei_information29, hr_api.g_varchar2) <>
341     nvl(p_rec.vaei_information29, hr_api.g_varchar2)  or
342     nvl(pqp_vai_shd.g_old_rec.vaei_information30, hr_api.g_varchar2) <>
343     nvl(p_rec.vaei_information30, hr_api.g_varchar2) ))
344     or (p_rec.veh_alloc_extra_info_id is null)  then
345     --
346     -- Only execute the validation if absolutely necessary:
347     -- a) During update, the structure column value or any
348     --    of the attribute values have actually changed.
349     -- b) During insert.
350     --
351   hr_utility.set_location('Entering inf1:'||p_rec.vaei_information1,10);
352    hr_utility.set_location('Entering inf2:'||p_rec.vaei_information2,10);
353    hr_utility.set_location('Entering: inf3'||p_rec.vaei_information3,10);
354    hr_utility.set_location('Entering: inf4'||p_rec.vaei_information9,10);
355     hr_dflex_utility.ins_or_upd_descflex_attribs
356       (p_appl_short_name                 => 'PQP'
357       ,p_descflex_name                   => 'Vehicle Alloc Extra Info DDF'
358       ,p_attribute_category              => p_rec.vaei_information_category
359       ,p_attribute1_name                 => 'VAEI_INFORMATION1'
360       ,p_attribute1_value                => p_rec.vaei_information1
361       ,p_attribute2_name                 => 'VAEI_INFORMATION2'
362       ,p_attribute2_value                => p_rec.vaei_information2
363       ,p_attribute3_name                 => 'VAEI_INFORMATION3'
364       ,p_attribute3_value                => p_rec.vaei_information3
365       ,p_attribute4_name                 => 'VAEI_INFORMATION4'
366       ,p_attribute4_value                => p_rec.vaei_information4
367       ,p_attribute5_name                 => 'VAEI_INFORMATION5'
368       ,p_attribute5_value                => p_rec.vaei_information5
369       ,p_attribute6_name                 => 'VAEI_INFORMATION6'
370       ,p_attribute6_value                => p_rec.vaei_information6
371       ,p_attribute7_name                 => 'VAEI_INFORMATION7'
372       ,p_attribute7_value                => p_rec.vaei_information7
376       ,p_attribute9_value               => p_rec.vaei_information9
373       ,p_attribute8_name                 => 'VAEI_INFORMATION8'
374       ,p_attribute8_value                => p_rec.vaei_information8
375       ,p_attribute9_name                => 'VAEI_INFORMATION9'
377       ,p_attribute10_name                => 'VAEI_INFORMATION10'
378       ,p_attribute10_value               => p_rec.vaei_information10
379       ,p_attribute11_name                => 'VAEI_INFORMATION11'
380       ,p_attribute11_value               => p_rec.vaei_information11
381       ,p_attribute12_name                => 'VAEI_INFORMATION12'
382       ,p_attribute12_value               => p_rec.vaei_information12
383       ,p_attribute13_name                => 'VAEI_INFORMATION13'
384       ,p_attribute13_value               => p_rec.vaei_information13
385       ,p_attribute14_name                => 'VAEI_INFORMATION14'
386       ,p_attribute14_value               => p_rec.vaei_information14
387       ,p_attribute15_name                => 'VAEI_INFORMATION15'
388       ,p_attribute15_value               => p_rec.vaei_information15
389       ,p_attribute16_name                => 'VAEI_INFORMATION16'
390       ,p_attribute16_value               => p_rec.vaei_information16
391       ,p_attribute17_name                => 'VAEI_INFORMATION17'
392       ,p_attribute17_value               => p_rec.vaei_information17
393       ,p_attribute18_name                => 'VAEI_INFORMATION18'
394       ,p_attribute18_value               => p_rec.vaei_information18
395       ,p_attribute19_name                => 'VAEI_INFORMATION19'
396       ,p_attribute19_value               => p_rec.vaei_information19
397       ,p_attribute20_name                => 'VAEI_INFORMATION20'
398       ,p_attribute20_value               => p_rec.vaei_information20
399       ,p_attribute21_name                => 'VAEI_INFORMATION21'
400       ,p_attribute21_value               => p_rec.vaei_information21
401       ,p_attribute22_name                => 'VAEI_INFORMATION22'
402       ,p_attribute22_value               => p_rec.vaei_information22
403       ,p_attribute23_name                => 'VAEI_INFORMATION23'
404       ,p_attribute23_value               => p_rec.vaei_information23
405       ,p_attribute24_name                => 'VAEI_INFORMATION24'
406       ,p_attribute24_value               => p_rec.vaei_information24
407       ,p_attribute25_name                => 'VAEI_INFORMATION25'
408       ,p_attribute25_value               => p_rec.vaei_information25
409       ,p_attribute26_name                => 'VAEI_INFORMATION26'
410       ,p_attribute26_value               => p_rec.vaei_information26
411       ,p_attribute27_name                => 'VAEI_INFORMATION27'
412       ,p_attribute27_value               => p_rec.vaei_information27
413       ,p_attribute28_name                => 'VAEI_INFORMATION28'
414       ,p_attribute28_value               => p_rec.vaei_information28
415       ,p_attribute29_name                => 'VAEI_INFORMATION29'
416       ,p_attribute29_value               => p_rec.vaei_information29
417       ,p_attribute30_name                => 'VAEI_INFORMATION30'
418       ,p_attribute30_value               => p_rec.vaei_information30
419       );
420   end if;
421   --
422   hr_utility.set_location(' Leaving:'||l_proc,20);
423 end chk_ddf;
424 --
425 -- ----------------------------------------------------------------------------
426 -- |------------------------------< chk_df >----------------------------------|
427 -- ----------------------------------------------------------------------------
428 --
429 -- Description:
430 --   Validates all the Descriptive Flexfield values.
431 --
432 -- Prerequisites:
433 --   All other columns have been validated.  Must be called as the
434 --   last step from insert_validate and update_validate.
435 --
436 -- In Arguments:
437 --   p_rec
438 --
439 -- Post Success:
440 --   If the Descriptive Flexfield structure column and data values are
441 --   all valid this procedure will end normally and processing will
442 --   continue.
443 --
444 -- Post Failure:
445 --   If the Descriptive Flexfield structure column value or any of
446 --   the data values are invalid then an application error is raised as
447 --   a PL/SQL exception.
448 --
449 -- Access Status:
450 --   Internal Row Handler Use Only.
451 --
452 -- ----------------------------------------------------------------------------
453 procedure chk_df
454   (p_rec in pqp_vai_shd.g_rec_type
455   ) is
456 --
457   l_proc   varchar2(72) := g_package || 'chk_df';
458 --
459 begin
460   hr_utility.set_location('Entering:'||l_proc,10);
461   --
462   if ((p_rec.veh_alloc_extra_info_id is not null)  and (
463     nvl(pqp_vai_shd.g_old_rec.vaei_attribute_category, hr_api.g_varchar2) <>
464     nvl(p_rec.vaei_attribute_category, hr_api.g_varchar2)  or
465     nvl(pqp_vai_shd.g_old_rec.vaei_attribute1, hr_api.g_varchar2) <>
466     nvl(p_rec.vaei_attribute1, hr_api.g_varchar2)  or
467     nvl(pqp_vai_shd.g_old_rec.vaei_attribute2, hr_api.g_varchar2) <>
468     nvl(p_rec.vaei_attribute2, hr_api.g_varchar2)  or
469     nvl(pqp_vai_shd.g_old_rec.vaei_attribute3, hr_api.g_varchar2) <>
470     nvl(p_rec.vaei_attribute3, hr_api.g_varchar2)  or
471     nvl(pqp_vai_shd.g_old_rec.vaei_attribute4, hr_api.g_varchar2) <>
472     nvl(p_rec.vaei_attribute4, hr_api.g_varchar2)  or
473     nvl(pqp_vai_shd.g_old_rec.vaei_attribute5, hr_api.g_varchar2) <>
474     nvl(p_rec.vaei_attribute5, hr_api.g_varchar2)  or
478     nvl(p_rec.vaei_attribute7, hr_api.g_varchar2)  or
475     nvl(pqp_vai_shd.g_old_rec.vaei_attribute6, hr_api.g_varchar2) <>
476     nvl(p_rec.vaei_attribute6, hr_api.g_varchar2)  or
477     nvl(pqp_vai_shd.g_old_rec.vaei_attribute7, hr_api.g_varchar2) <>
479     nvl(pqp_vai_shd.g_old_rec.vaei_attribute8, hr_api.g_varchar2) <>
480     nvl(p_rec.vaei_attribute8, hr_api.g_varchar2)  or
481     nvl(pqp_vai_shd.g_old_rec.vaei_attribute9, hr_api.g_varchar2) <>
482     nvl(p_rec.vaei_attribute9, hr_api.g_varchar2)  or
483     nvl(pqp_vai_shd.g_old_rec.vaei_attribute10, hr_api.g_varchar2) <>
484     nvl(p_rec.vaei_attribute10, hr_api.g_varchar2)  or
485     nvl(pqp_vai_shd.g_old_rec.vaei_attribute11, hr_api.g_varchar2) <>
486     nvl(p_rec.vaei_attribute11, hr_api.g_varchar2)  or
487     nvl(pqp_vai_shd.g_old_rec.vaei_attribute12, hr_api.g_varchar2) <>
488     nvl(p_rec.vaei_attribute12, hr_api.g_varchar2)  or
489     nvl(pqp_vai_shd.g_old_rec.vaei_attribute13, hr_api.g_varchar2) <>
490     nvl(p_rec.vaei_attribute13, hr_api.g_varchar2)  or
491     nvl(pqp_vai_shd.g_old_rec.vaei_attribute14, hr_api.g_varchar2) <>
492     nvl(p_rec.vaei_attribute14, hr_api.g_varchar2)  or
493     nvl(pqp_vai_shd.g_old_rec.vaei_attribute15, hr_api.g_varchar2) <>
494     nvl(p_rec.vaei_attribute15, hr_api.g_varchar2)  or
495     nvl(pqp_vai_shd.g_old_rec.vaei_attribute16, hr_api.g_varchar2) <>
496     nvl(p_rec.vaei_attribute16, hr_api.g_varchar2)  or
497     nvl(pqp_vai_shd.g_old_rec.vaei_attribute17, hr_api.g_varchar2) <>
498     nvl(p_rec.vaei_attribute17, hr_api.g_varchar2)  or
499     nvl(pqp_vai_shd.g_old_rec.vaei_attribute18, hr_api.g_varchar2) <>
500     nvl(p_rec.vaei_attribute18, hr_api.g_varchar2)  or
501     nvl(pqp_vai_shd.g_old_rec.vaei_attribute19, hr_api.g_varchar2) <>
502     nvl(p_rec.vaei_attribute19, hr_api.g_varchar2)  or
503     nvl(pqp_vai_shd.g_old_rec.vaei_attribute20, hr_api.g_varchar2) <>
504     nvl(p_rec.vaei_attribute20, hr_api.g_varchar2) ))
505     or (p_rec.veh_alloc_extra_info_id is null)  then
506     --
507     -- Only execute the validation if absolutely necessary:
508     -- a) During update, the structure column value or any
509     --    of the attribute values have actually changed.
510     -- b) During insert.
511     --
512     hr_dflex_utility.ins_or_upd_descflex_attribs
513       (p_appl_short_name                 => 'PQP'
514       ,p_descflex_name                   =>'Vehicle Alloc Extra Info DF'
515       ,p_attribute_category              =>  p_rec.vaei_attribute_category
516       ,p_attribute1_name                 => 'VAEI_ATTRIBUTE1'
517       ,p_attribute1_value                => p_rec.vaei_attribute1
518       ,p_attribute2_name                 => 'VAEI_ATTRIBUTE2'
519       ,p_attribute2_value                => p_rec.vaei_attribute2
520       ,p_attribute3_name                 => 'VAEI_ATTRIBUTE3'
521       ,p_attribute3_value                => p_rec.vaei_attribute3
522       ,p_attribute4_name                 => 'VAEI_ATTRIBUTE4'
523       ,p_attribute4_value                => p_rec.vaei_attribute4
524       ,p_attribute5_name                 => 'VAEI_ATTRIBUTE5'
525       ,p_attribute5_value                => p_rec.vaei_attribute5
526       ,p_attribute6_name                 => 'VAEI_ATTRIBUTE6'
527       ,p_attribute6_value                => p_rec.vaei_attribute6
528       ,p_attribute7_name                 => 'VAEI_ATTRIBUTE7'
529       ,p_attribute7_value                => p_rec.vaei_attribute7
530       ,p_attribute8_name                 => 'VAEI_ATTRIBUTE8'
531       ,p_attribute8_value                => p_rec.vaei_attribute8
532       ,p_attribute9_name                 => 'VAEI_ATTRIBUTE9'
533       ,p_attribute9_value                => p_rec.vaei_attribute9
534       ,p_attribute10_name                => 'VAEI_ATTRIBUTE10'
535       ,p_attribute10_value               => p_rec.vaei_attribute10
536       ,p_attribute11_name                => 'VAEI_ATTRIBUTE11'
537       ,p_attribute11_value               => p_rec.vaei_attribute11
538       ,p_attribute12_name                => 'VAEI_ATTRIBUTE12'
539       ,p_attribute12_value               => p_rec.vaei_attribute12
540       ,p_attribute13_name                => 'VAEI_ATTRIBUTE13'
541       ,p_attribute13_value               => p_rec.vaei_attribute13
542       ,p_attribute14_name                => 'VAEI_ATTRIBUTE14'
543       ,p_attribute14_value               => p_rec.vaei_attribute14
544       ,p_attribute15_name                => 'VAEI_ATTRIBUTE15'
545       ,p_attribute15_value               => p_rec.vaei_attribute15
546       ,p_attribute16_name                => 'VAEI_ATTRIBUTE16'
547       ,p_attribute16_value               => p_rec.vaei_attribute16
548       ,p_attribute17_name                => 'VAEI_ATTRIBUTE17'
549       ,p_attribute17_value               => p_rec.vaei_attribute17
550       ,p_attribute18_name                => 'VAEI_ATTRIBUTE18'
551       ,p_attribute18_value               => p_rec.vaei_attribute18
552       ,p_attribute19_name                => 'VAEI_ATTRIBUTE19'
553       ,p_attribute19_value               => p_rec.vaei_attribute19
554       ,p_attribute20_name                => 'VAEI_ATTRIBUTE20'
555       ,p_attribute20_value               => p_rec.vaei_attribute20
556       );
557   end if;
558   --
559   hr_utility.set_location(' Leaving:'||l_proc,20);
560 end chk_df;
561 --
562 -- ----------------------------------------------------------------------------
563 -- |-----------------------< chk_non_updateable_args >------------------------|
564 -- ----------------------------------------------------------------------------
565 -- {Start Of Comments}
569 --   not been updated. If an attribute has been updated an error is generated.
566 --
567 -- Description:
568 --   This procedure is used to ensure that non updateable attributes have
570 --
571 -- Pre Conditions:
572 --   g_old_rec has been populated with details of the values currently in
573 --   the database.
574 --
575 -- In Arguments:
576 --   p_rec has been populated with the updated values the user would like the
577 --   record set to.
578 --
579 -- Post Success:
580 --   Processing continues if all the non updateable attributes have not
581 --   changed.
582 --
583 -- Post Failure:
584 --   An application error is raised if any of the non updatable attributes
585 --   have been altered.
586 --
587 -- {End Of Comments}
588 -- ----------------------------------------------------------------------------
589 Procedure chk_non_updateable_args
590   (p_rec in pqp_vai_shd.g_rec_type
591   ) IS
592 --
593   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
594 --
595 Begin
596   --
597   -- Only proceed with the validation if a row exists for the current
598   -- record in the HR Schema.
599   --
600   IF NOT pqp_vai_shd.api_updating
601       (p_veh_alloc_extra_info_id           => p_rec.veh_alloc_extra_info_id
602       ,p_object_version_number             => p_rec.object_version_number
603       ) THEN
604      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
605      fnd_message.set_token('PROCEDURE ', l_proc);
606      fnd_message.set_token('STEP ', '5');
607      fnd_message.raise_error;
608   END IF;
609   --
610   -- EDIT_HERE: Add checks to ensure non-updateable args have
611   --            not been updated.
612   --
613 End chk_non_updateable_args;
614 --
615 -- ----------------------------------------------------------------------------
616 -- |---------------------------< insert_validate >----------------------------|
617 -- ----------------------------------------------------------------------------
618 Procedure insert_validate
619   (p_rec                          in pqp_vai_shd.g_rec_type
620   ) is
621 --
622   l_proc  varchar2(72) := g_package||'insert_validate';
623 --
624 Begin
625   hr_utility.set_location('Entering:'||l_proc, 5);
626   --
627   -- Call all supporting business operations
628   --
629   --
630   -- EDIT_HERE: As this table does not have a mandatory business_group_id
631   -- column, ensure client_info is populated by calling a suitable
632   -- ???_???_bus.set_security_group_id procedure, or add one of the following
633   -- comments:
634   -- "-- No business group context.  HR_STANDARD_LOOKUPS used for validation."
635   -- "-- CLIENT_INFO not set.  No lookup validation or joins to HR_LOOKUPS."
636   --
637   -- Validate Dependent Attributes
638   --
639   --
640   pqp_vai_bus.chk_ddf(p_rec);
641   --
642  -- pqp_vai_bus.chk_df(p_rec);
643   --
644   hr_utility.set_location(' Leaving:'||l_proc, 10);
645 End insert_validate;
646 --
647 -- ----------------------------------------------------------------------------
648 -- |---------------------------< update_validate >----------------------------|
649 -- ----------------------------------------------------------------------------
650 Procedure update_validate
651   (p_rec                          in pqp_vai_shd.g_rec_type
652   ) is
653 --
654   l_proc  varchar2(72) := g_package||'update_validate';
655 --
656 Begin
657   hr_utility.set_location('Entering:'||l_proc, 5);
658   --
659   -- Call all supporting business operations
660   --
661   --
662   -- EDIT_HERE: As this table does not have a mandatory business_group_id
663   -- column, ensure client_info is populated by calling a suitable
664   -- ???_???_bus.set_security_group_id procedure, or add one of the following
665   -- comments:
666   -- "-- No business group context.  HR_STANDARD_LOOKUPS used for validation."
667   -- "-- CLIENT_INFO not set.  No lookup validation or joins to HR_LOOKUPS."
668   --
669   -- Validate Dependent Attributes
670   --
671   chk_non_updateable_args
672     (p_rec              => p_rec
673     );
674   --
675   --
676   pqp_vai_bus.chk_ddf(p_rec);
677   --
678   pqp_vai_bus.chk_df(p_rec);
679   --
680   hr_utility.set_location(' Leaving:'||l_proc, 10);
681 End update_validate;
682 --
683 -- ----------------------------------------------------------------------------
684 -- |---------------------------< delete_validate >----------------------------|
685 -- ----------------------------------------------------------------------------
686 Procedure delete_validate
687   (p_rec                          in pqp_vai_shd.g_rec_type
688   ) is
689 --
690   l_proc  varchar2(72) := g_package||'delete_validate';
691 --
692 Begin
693   hr_utility.set_location('Entering:'||l_proc, 5);
694   --
695   -- Call all supporting business operations
696   --
697   hr_utility.set_location(' Leaving:'||l_proc, 10);
698 End delete_validate;
699 --
700 end pqp_vai_bus;