[Home] [Help]
PACKAGE BODY: APPS.PAY_AIF_BUS
Source
1 Package Body pay_aif_bus as
2 /* $Header: pyaifrhi.pkb 120.3.12020000.2 2012/07/04 20:39:11 amnaraya ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pay_aif_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_action_information_id number default null;
15 --
16 -- The following three global variables are only to be used by
17 -- the return_nonpk_leg_code function.
18 --
19 g_nonpk_leg_code varchar2(150) default null;
20 g_action_context_id number default null;
21 g_action_context_type varchar2(15) default null;
22 --
23 -- ---------------------------------------------------------------------------
24 -- |----------------------< set_security_group_id >--------------------------|
25 -- ---------------------------------------------------------------------------
26 --
27 Procedure set_security_group_id
28 (p_action_information_id in number
29 ) is
30 --
31 -- Declare cursor
32 --
33 cursor csr_sec_grp is
34 select pbg.security_group_id
35 from per_business_groups pbg
36 , pay_action_information aif
37 , pay_assignment_actions act
38 , pay_payroll_actions pct
39 where aif.action_information_id = p_action_information_id
40 and pbg.business_group_id = pct.business_group_id
41 and act.payroll_action_id = pct.payroll_action_id
42 and act.assignment_action_id = aif.action_context_id
43 and aif.action_context_type in ('AAP', 'AAC')
44 union all
45 select pbg.security_group_id
46 from per_business_groups pbg
47 , pay_action_information aif
48 , pay_payroll_actions pct
49 where aif.action_information_id = p_action_information_id
50 and pbg.business_group_id = pct.business_group_id
51 and pct.payroll_action_id = aif.action_context_id
52 and aif.action_context_type = 'PA';
53 --
54 -- Declare local variables
55 --
56 l_security_group_id number;
57 l_proc varchar2(72) := g_package||'set_security_group_id';
58 --
59 Begin
60 --
61 hr_utility.set_location('Entering:'|| l_proc, 10);
62 --
63 -- Ensure that all the mandatory parameter are not null
64 --
65 hr_api.mandatory_arg_error
66 (p_api_name => l_proc
67 ,p_argument => 'action_information_id'
68 ,p_argument_value => p_action_information_id
69 );
70 --
71 open csr_sec_grp;
72 fetch csr_sec_grp into l_security_group_id;
73 --
74 if csr_sec_grp%notfound then
75 --
76 close csr_sec_grp;
80 fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
77 --
78 -- The primary key is invalid therefore we must error
79 --
81 fnd_message.raise_error;
82 --
83 end if;
84 close csr_sec_grp;
85 --
86 -- Set the security_group_id in CLIENT_INFO
87 --
88 hr_api.set_security_group_id
89 (p_security_group_id => l_security_group_id
90 );
91 --
92 hr_utility.set_location(' Leaving:'|| l_proc, 20);
93 --
94 End set_security_group_id;
95 --
96 -- ---------------------------------------------------------------------------
97 -- |---------------------< return_legislation_code >-------------------------|
98 -- ---------------------------------------------------------------------------
99 --
100 Function return_legislation_code
101 (p_action_information_id in number
102 )
103 Return Varchar2 Is
104 --
105 -- Declare cursor
106 --
107 cursor csr_leg_code is
108 select pbg.legislation_code
109 from per_business_groups pbg
110 , pay_action_information aif
111 , pay_assignment_actions act
112 , pay_payroll_actions pct
113 where aif.action_information_id = p_action_information_id
114 and pbg.business_group_id = pct.business_group_id
115 and act.payroll_action_id = pct.payroll_action_id
116 and act.assignment_action_id = aif.action_context_id
117 and aif.action_context_type in ('AAP', 'AAC')
118 union all
119 select pbg.legislation_code
120 from per_business_groups pbg
121 , pay_action_information aif
122 , pay_payroll_actions pct
123 where aif.action_information_id = p_action_information_id
124 and pbg.business_group_id = pct.business_group_id
125 and pct.payroll_action_id = aif.action_context_id
126 and aif.action_context_type = 'PA';
127 --
128 -- Declare local variables
129 --
130 l_legislation_code varchar2(150);
131 l_proc varchar2(72) := g_package||'return_legislation_code';
132 --
133 Begin
134 --
135 hr_utility.set_location('Entering:'|| l_proc, 10);
136 --
137 -- Ensure that all the mandatory parameter are not null
138 --
139 hr_api.mandatory_arg_error
140 (p_api_name => l_proc
141 ,p_argument => 'action_information_id'
142 ,p_argument_value => p_action_information_id
143 );
144 --
145 if ( nvl(pay_aif_bus.g_action_information_id, hr_api.g_number)
146 = p_action_information_id) then
147 --
148 -- The legislation code has already been found with a previous
149 -- call to this function. Just return the value in the global
150 -- variable.
151 --
152 l_legislation_code := pay_aif_bus.g_legislation_code;
153 hr_utility.set_location(l_proc, 20);
154 else
155 --
156 -- The ID is different to the last call to this function
157 -- or this is the first call to this function.
158 --
159 open csr_leg_code;
160 fetch csr_leg_code into l_legislation_code;
161 --
162 if csr_leg_code%notfound then
163 --
164 -- The primary key is invalid therefore we must error
165 --
166 close csr_leg_code;
167 fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
168 fnd_message.raise_error;
169 end if;
170 hr_utility.set_location(l_proc,30);
171 --
172 -- Set the global variables so the values are
173 -- available for the next call to this function.
174 --
175 close csr_leg_code;
176 pay_aif_bus.g_action_information_id := p_action_information_id;
177 pay_aif_bus.g_legislation_code := l_legislation_code;
178 end if;
179 hr_utility.set_location(' Leaving:'|| l_proc, 40);
180 return l_legislation_code;
181 end return_legislation_code;
182 --
183 -- ---------------------------------------------------------------------------
184 -- |----------------------<return_nonpk_leg_code >---------------------------|
185 -- ---------------------------------------------------------------------------
186 --
187 Function return_nonpk_leg_code
188 (p_action_context_id in number
189 ,p_action_context_type in varchar2
190 )
191 Return Varchar2 Is
192 --
193 -- Declare cursor
194 --
195 cursor csr_aa_leg_code is
196 select pbg.legislation_code
197 from per_business_groups pbg
198 , pay_assignment_actions act
199 , pay_payroll_actions pct
200 where act.assignment_action_id = p_action_context_id
201 and act.payroll_action_id = pct.payroll_action_id
202 and pct.business_group_id = pbg.business_group_id;
203 --
204 cursor csr_pa_leg_code is
205 select pbg.legislation_code
206 from per_business_groups pbg
207 , pay_payroll_actions pct
208 where pct.payroll_action_id = p_action_context_id
209 and pct.business_group_id = pbg.business_group_id;
210 --
211 -- Declare local variables
212 --
213 l_legislation_code varchar2(150);
214 l_proc varchar2(72) := g_package||'return_nonpk_leg_code';
215 --
216 Begin
217 --
218 hr_utility.set_location('Entering:'|| l_proc, 10);
219 --
223 (p_api_name => l_proc
220 -- Ensure that all the mandatory parameter are not null
221 --
222 hr_api.mandatory_arg_error
224 ,p_argument => 'action_context_id'
225 ,p_argument_value => p_action_context_id
226 );
227 hr_api.mandatory_arg_error
228 (p_api_name => l_proc
229 ,p_argument => 'action_context_type'
230 ,p_argument_value => p_action_context_type
231 );
232 --
233 if ((nvl(pay_aif_bus.g_action_context_id,hr_api.g_number) = p_action_context_id)
234 and (nvl(pay_aif_bus.g_action_context_type,hr_api.g_varchar2) = p_action_context_type)) then
235 --
236 --
237 -- Legislation code is for same row as cached values therefore return
238 -- cached legislation code
239 --
240 l_legislation_code := pay_aif_bus.g_nonpk_leg_code;
241 --
242 else
243 --
244 if (p_action_context_type = 'PA') then
245 --
246 open csr_pa_leg_code;
247 fetch csr_pa_leg_code into l_legislation_code;
248 --
249 if csr_pa_leg_code%notfound then
250 --
251 --
252 -- The payroll action is invalid therefore we must error
253 --
254 close csr_pa_leg_code;
255 fnd_message.set_name('PAY','PAY_34985_INVALID_PAY_ACTION');
256 fnd_message.raise_error;
257 --
258 else
259 --
260 close csr_pa_leg_code;
261 --
262 end if;
263 --
264 elsif (p_action_context_type in ('AAC','AAP')) then
265 --
266 open csr_aa_leg_code;
267 fetch csr_aa_leg_code into l_legislation_code;
268 --
269 if csr_aa_leg_code%notfound then
270 --
271 --
272 -- The assignment action is invalid therefore we must error
273 --
274 close csr_aa_leg_code;
275 fnd_message.set_name('PAY','PAY_34987_INVALID_ASG_ACTION');
276 fnd_message.raise_error;
277 --
278 else
279 --
280 close csr_aa_leg_code;
281 --
282 end if;
283 --
284 else
285 --
286 --
287 -- The action context type is invalid therefore we must error
288 --
289 fnd_message.set_name('PAY','PAY_34986_INV_ACT_CONTEXT_TYPE');
290 fnd_message.raise_error;
291 --
292 end if;
293 --
294 pay_aif_bus.g_action_context_id := p_action_context_id;
295 pay_aif_bus.g_action_context_type := p_action_context_type;
296 pay_aif_bus.g_nonpk_leg_code := l_legislation_code;
297 --
298 end if;
299 --
300 hr_utility.set_location(' Leaving:'|| l_proc, 20);
301 --
302 return l_legislation_code;
303 --
304 end return_nonpk_leg_code;
305 --
306 -- ----------------------------------------------------------------------------
307 -- |-----------------------------< chk_ddf >----------------------------------|
308 -- ----------------------------------------------------------------------------
309 --
310 -- Description:
311 -- Validates all the Developer Descriptive Flexfield values.
312 --
313 -- Prerequisites:
314 -- All other columns have been validated. Must be called as the
315 -- last step from insert_validate and update_validate.
316 --
317 -- In Arguments:
318 -- p_rec
319 --
320 -- Post Success:
321 -- If the Developer Descriptive Flexfield structure column and data values
322 -- are all valid this procedure will end normally and processing will
323 -- continue.
324 --
325 -- Post Failure:
326 -- If the Developer Descriptive Flexfield structure column value or any of
327 -- the data values are invalid then an application error is raised as
328 -- a PL/SQL exception.
329 --
330 -- Access Status:
331 -- Internal Row Handler Use Only.
332 --
333 -- ----------------------------------------------------------------------------
334 procedure chk_ddf
335 (p_rec in pay_aif_shd.g_rec_type
336 ) is
337 --
338 l_proc varchar2(72) := g_package || 'chk_ddf';
339 --
340 begin
341 hr_utility.set_location('Entering:'||l_proc,10);
342 --
343 if ((p_rec.action_information_id is not null) and (
344 nvl(pay_aif_shd.g_old_rec.action_information_id, hr_api.g_number) <>
345 nvl(p_rec.action_information_id, hr_api.g_number) or
346 nvl(pay_aif_shd.g_old_rec.effective_date, hr_api.g_date) <>
347 nvl(p_rec.effective_date, hr_api.g_date) or
348 nvl(pay_aif_shd.g_old_rec.assignment_id, hr_api.g_number) <>
349 nvl(p_rec.assignment_id, hr_api.g_number) or
350 nvl(pay_aif_shd.g_old_rec.action_information_category, hr_api.g_varchar2) <>
351 nvl(p_rec.action_information_category, hr_api.g_varchar2) or
352 nvl(pay_aif_shd.g_old_rec.action_information1, hr_api.g_varchar2) <>
353 nvl(p_rec.action_information1, hr_api.g_varchar2) or
354 nvl(pay_aif_shd.g_old_rec.action_information2, hr_api.g_varchar2) <>
355 nvl(p_rec.action_information2, hr_api.g_varchar2) or
356 nvl(pay_aif_shd.g_old_rec.action_information3, hr_api.g_varchar2) <>
357 nvl(p_rec.action_information3, hr_api.g_varchar2) or
358 nvl(pay_aif_shd.g_old_rec.action_information4, hr_api.g_varchar2) <>
359 nvl(p_rec.action_information4, hr_api.g_varchar2) or
360 nvl(pay_aif_shd.g_old_rec.action_information5, hr_api.g_varchar2) <>
364 nvl(pay_aif_shd.g_old_rec.action_information7, hr_api.g_varchar2) <>
361 nvl(p_rec.action_information5, hr_api.g_varchar2) or
362 nvl(pay_aif_shd.g_old_rec.action_information6, hr_api.g_varchar2) <>
363 nvl(p_rec.action_information6, hr_api.g_varchar2) or
365 nvl(p_rec.action_information7, hr_api.g_varchar2) or
366 nvl(pay_aif_shd.g_old_rec.action_information8, hr_api.g_varchar2) <>
367 nvl(p_rec.action_information8, hr_api.g_varchar2) or
368 nvl(pay_aif_shd.g_old_rec.action_information9, hr_api.g_varchar2) <>
369 nvl(p_rec.action_information9, hr_api.g_varchar2) or
370 nvl(pay_aif_shd.g_old_rec.action_information10, hr_api.g_varchar2) <>
371 nvl(p_rec.action_information10, hr_api.g_varchar2) or
372 nvl(pay_aif_shd.g_old_rec.action_information11, hr_api.g_varchar2) <>
373 nvl(p_rec.action_information11, hr_api.g_varchar2) or
374 nvl(pay_aif_shd.g_old_rec.action_information12, hr_api.g_varchar2) <>
375 nvl(p_rec.action_information12, hr_api.g_varchar2) or
376 nvl(pay_aif_shd.g_old_rec.action_information13, hr_api.g_varchar2) <>
377 nvl(p_rec.action_information13, hr_api.g_varchar2) or
378 nvl(pay_aif_shd.g_old_rec.action_information14, hr_api.g_varchar2) <>
379 nvl(p_rec.action_information14, hr_api.g_varchar2) or
380 nvl(pay_aif_shd.g_old_rec.action_information15, hr_api.g_varchar2) <>
381 nvl(p_rec.action_information15, hr_api.g_varchar2) or
382 nvl(pay_aif_shd.g_old_rec.action_information16, hr_api.g_varchar2) <>
383 nvl(p_rec.action_information16, hr_api.g_varchar2) or
384 nvl(pay_aif_shd.g_old_rec.action_information17, hr_api.g_varchar2) <>
385 nvl(p_rec.action_information17, hr_api.g_varchar2) or
386 nvl(pay_aif_shd.g_old_rec.action_information18, hr_api.g_varchar2) <>
387 nvl(p_rec.action_information18, hr_api.g_varchar2) or
388 nvl(pay_aif_shd.g_old_rec.action_information19, hr_api.g_varchar2) <>
389 nvl(p_rec.action_information19, hr_api.g_varchar2) or
390 nvl(pay_aif_shd.g_old_rec.action_information20, hr_api.g_varchar2) <>
391 nvl(p_rec.action_information20, hr_api.g_varchar2) or
392 nvl(pay_aif_shd.g_old_rec.action_information21, hr_api.g_varchar2) <>
393 nvl(p_rec.action_information21, hr_api.g_varchar2) or
394 nvl(pay_aif_shd.g_old_rec.action_information22, hr_api.g_varchar2) <>
395 nvl(p_rec.action_information22, hr_api.g_varchar2) or
396 nvl(pay_aif_shd.g_old_rec.action_information23, hr_api.g_varchar2) <>
397 nvl(p_rec.action_information23, hr_api.g_varchar2) or
398 nvl(pay_aif_shd.g_old_rec.action_information24, hr_api.g_varchar2) <>
399 nvl(p_rec.action_information24, hr_api.g_varchar2) or
400 nvl(pay_aif_shd.g_old_rec.action_information25, hr_api.g_varchar2) <>
401 nvl(p_rec.action_information25, hr_api.g_varchar2) or
402 nvl(pay_aif_shd.g_old_rec.action_information26, hr_api.g_varchar2) <>
403 nvl(p_rec.action_information26, hr_api.g_varchar2) or
404 nvl(pay_aif_shd.g_old_rec.action_information27, hr_api.g_varchar2) <>
405 nvl(p_rec.action_information27, hr_api.g_varchar2) or
406 nvl(pay_aif_shd.g_old_rec.action_information28, hr_api.g_varchar2) <>
407 nvl(p_rec.action_information28, hr_api.g_varchar2) or
408 nvl(pay_aif_shd.g_old_rec.action_information29, hr_api.g_varchar2) <>
409 nvl(p_rec.action_information29, hr_api.g_varchar2) or
410 nvl(pay_aif_shd.g_old_rec.action_information30, hr_api.g_varchar2) <>
411 nvl(p_rec.action_information30, hr_api.g_varchar2) ))
412 or (p_rec.action_information_id is null) then
413 --
414 -- Only execute the validation if absolutely necessary:
415 -- a) During update, the structure column value or any
416 -- of the attribute values have actually changed.
417 -- b) During insert.
418 --
419 hr_dflex_utility.ins_or_upd_descflex_attribs
420 (p_appl_short_name => 'PAY'
421 ,p_descflex_name => 'Action Information DF'
422 ,p_attribute_category => p_rec.action_information_category
423 ,p_attribute1_name => 'ACTION_INFORMATION1'
424 ,p_attribute1_value => p_rec.action_information1
425 ,p_attribute2_name => 'ACTION_INFORMATION2'
426 ,p_attribute2_value => p_rec.action_information2
427 ,p_attribute3_name => 'ACTION_INFORMATION3'
428 ,p_attribute3_value => p_rec.action_information3
429 ,p_attribute4_name => 'ACTION_INFORMATION4'
430 ,p_attribute4_value => p_rec.action_information4
431 ,p_attribute5_name => 'ACTION_INFORMATION5'
432 ,p_attribute5_value => p_rec.action_information5
433 ,p_attribute6_name => 'ACTION_INFORMATION6'
434 ,p_attribute6_value => p_rec.action_information6
435 ,p_attribute7_name => 'ACTION_INFORMATION7'
436 ,p_attribute7_value => p_rec.action_information7
437 ,p_attribute8_name => 'ACTION_INFORMATION8'
438 ,p_attribute8_value => p_rec.action_information8
439 ,p_attribute9_name => 'ACTION_INFORMATION9'
440 ,p_attribute9_value => p_rec.action_information9
441 ,p_attribute10_name => 'ACTION_INFORMATION10'
442 ,p_attribute10_value => p_rec.action_information10
443 ,p_attribute11_name => 'ACTION_INFORMATION11'
444 ,p_attribute11_value => p_rec.action_information11
445 ,p_attribute12_name => 'ACTION_INFORMATION12'
446 ,p_attribute12_value => p_rec.action_information12
447 ,p_attribute13_name => 'ACTION_INFORMATION13'
448 ,p_attribute13_value => p_rec.action_information13
449 ,p_attribute14_name => 'ACTION_INFORMATION14'
450 ,p_attribute14_value => p_rec.action_information14
454 ,p_attribute16_value => p_rec.action_information16
451 ,p_attribute15_name => 'ACTION_INFORMATION15'
452 ,p_attribute15_value => p_rec.action_information15
453 ,p_attribute16_name => 'ACTION_INFORMATION16'
455 ,p_attribute17_name => 'ACTION_INFORMATION17'
456 ,p_attribute17_value => p_rec.action_information17
457 ,p_attribute18_name => 'ACTION_INFORMATION18'
458 ,p_attribute18_value => p_rec.action_information18
459 ,p_attribute19_name => 'ACTION_INFORMATION19'
460 ,p_attribute19_value => p_rec.action_information19
461 ,p_attribute20_name => 'ACTION_INFORMATION20'
462 ,p_attribute20_value => p_rec.action_information20
463 ,p_attribute21_name => 'ACTION_INFORMATION21'
464 ,p_attribute21_value => p_rec.action_information21
465 ,p_attribute22_name => 'ACTION_INFORMATION22'
466 ,p_attribute22_value => p_rec.action_information22
467 ,p_attribute23_name => 'ACTION_INFORMATION23'
468 ,p_attribute23_value => p_rec.action_information23
469 ,p_attribute24_name => 'ACTION_INFORMATION24'
470 ,p_attribute24_value => p_rec.action_information24
471 ,p_attribute25_name => 'ACTION_INFORMATION25'
472 ,p_attribute25_value => p_rec.action_information25
473 ,p_attribute26_name => 'ACTION_INFORMATION26'
474 ,p_attribute26_value => p_rec.action_information26
475 ,p_attribute27_name => 'ACTION_INFORMATION27'
476 ,p_attribute27_value => p_rec.action_information27
477 ,p_attribute28_name => 'ACTION_INFORMATION28'
478 ,p_attribute28_value => p_rec.action_information28
479 ,p_attribute29_name => 'ACTION_INFORMATION29'
480 ,p_attribute29_value => p_rec.action_information29
481 ,p_attribute30_name => 'ACTION_INFORMATION30'
482 ,p_attribute30_value => p_rec.action_information30
483 );
484 end if;
485 --
486 hr_utility.set_location(' Leaving:'||l_proc,20);
487 end chk_ddf;
488 --
489 -- ----------------------------------------------------------------------------
490 -- |---------------------< chk_action_context_type >--------------------------|
491 -- ----------------------------------------------------------------------------
492 --
493 -- Description:
494 -- Validates the action context type.
495 --
496 -- Prerequisites:
497 -- None.
498 --
499 -- In Arguments:
500 -- p_action_context_type
501 --
502 -- Post Success:
503 -- If the action context type is valid this procedure will end normally and
504 -- processing will continue.
505 --
506 -- Post Failure:
507 -- If the action context type is invalid then an application error is
508 -- raised as a PL/SQL exception.
509 --
510 -- Access Status:
511 -- Internal Row Handler Use Only.
512 --
513 -- ----------------------------------------------------------------------------
514 Procedure chk_action_context_type
515 (p_action_context_type in varchar2
516 ) is
517 --
518 l_proc varchar2(72) := g_package || 'chk_action_context_type';
519 --
520 Begin
521 --
522 hr_utility.set_location('Entering:'||l_proc,10);
523 --
524 if p_action_context_type not in ('PA','AAC','AAP','BEE') then
525 --
526 fnd_message.set_name('PAY','PAY_34986_INV_ACT_CONTEXT_TYPE');
527 fnd_message.raise_error;
528 --
529 end if;
530 --
531 hr_utility.set_location('Leaving:'||l_proc,20);
532 --
533 End chk_action_context_type;
534 --
535 -- ----------------------------------------------------------------------------
536 -- |----------------------< chk_action_context_id >---------------------------|
537 -- ----------------------------------------------------------------------------
538 --
539 -- Description:
540 -- Validates the action context.
541 --
542 -- Prerequisites:
543 -- Must have already validated action context type.
544 --
545 -- In Arguments:
546 -- p_action_context_id
547 -- p_action_context_type
548 --
549 -- Post Success:
550 -- If the action context is valid this procedure will end normally and
551 -- processing will continue.
552 --
553 -- Post Failure:
554 -- If the action context is invalid then an application error is
555 -- raised as a PL/SQL exception.
556 --
557 -- Access Status:
558 -- Internal Row Handler Use Only.
559 --
560 -- ----------------------------------------------------------------------------
561 Procedure chk_action_context_id
562 (p_action_context_id in number
563 ,p_action_context_type in varchar2
564 ) is
565 --
566 cursor csr_pact_exists is
567 select 'X'
568 from pay_payroll_actions
569 where payroll_action_id = p_action_context_id;
570 --
571 cursor csr_aact_exists is
572 select 'X'
573 from pay_assignment_actions
574 where assignment_action_id = p_action_context_id;
575 --
576 l_proc varchar2(72) := g_package || 'chk_action_context_id';
577 l_dummy varchar2(1);
578 --
579 Begin
580 --
581 hr_utility.set_location('Entering:'||l_proc,10);
582 --
583 if (p_action_context_type = 'PA') then
584 --
585 open csr_pact_exists;
586 fetch csr_pact_exists into l_dummy;
587 if csr_pact_exists%notfound then
591 --
588 --
589 fnd_message.set_name('PAY','PAY_34985_INVALID_PAY_ACTION');
590 fnd_message.raise_error;
592 end if;
593 --
594 elsif (p_action_context_type in ('AAC','AAP')) then
595 --
596 open csr_aact_exists;
597 fetch csr_aact_exists into l_dummy;
598 if csr_aact_exists%notfound then
599 --
600 fnd_message.set_name('PAY','PAY_34985_INVALID_PAY_ACTION');
601 fnd_message.raise_error;
602 --
603 end if;
604 --
605 elsif (p_action_context_type in ('BEE')) then
606 --
607 null;
608 --
609 else
610 --
611 fnd_message.set_name('PAY','PAY_34986_INV_ACT_CONTEXT_TYPE');
612 fnd_message.raise_error;
613 --
614 end if;
615 --
616 hr_utility.set_location('Leaving:'||l_proc,20);
617 --
618 End chk_action_context_id;
619 --
620 -- ----------------------------------------------------------------------------
621 -- |------------------------< chk_assignment_id >-----------------------------|
622 -- ----------------------------------------------------------------------------
623 --
624 -- Description:
625 -- Validates the assignment.
626 --
627 -- Prerequisites:
628 -- None
629 --
630 -- In Arguments:
631 -- p_assignment_id
632 --
633 -- Post Success:
634 -- If the assignment is valid this procedure will end normally and
635 -- processing will continue.
636 --
637 -- Post Failure:
638 -- If the assignment is invalid then an application error is
639 -- raised as a PL/SQL exception.
640 --
641 -- Access Status:
642 -- Internal Row Handler Use Only.
643 --
644 -- ----------------------------------------------------------------------------
645 Procedure chk_assignment_id
646 (p_assignment_id in number
647 ) is
648 --
649 cursor csr_asg_exists is
650 select 'X'
651 from per_all_assignments_f
652 where assignment_id = p_assignment_id;
653 --
654 l_proc varchar2(72) := g_package || 'chk_assignment_id';
655 l_dummy varchar2(1);
656 --
657 Begin
658 --
659 hr_utility.set_location('Entering:'||l_proc,10);
660 --
661 if (p_assignment_id is not null) then
662 --
663 open csr_asg_exists;
664 fetch csr_asg_exists into l_dummy;
665 if csr_asg_exists%notfound then
666 --
667 fnd_message.set_name('PAY','PAY_52099_ASG_INV_ASG_ID');
668 fnd_message.raise_error;
669 --
670 end if;
671 --
672 end if;
673 --
674 hr_utility.set_location('Leaving:'||l_proc,20);
675 --
676 End chk_assignment_id;
677 --
678 -- ----------------------------------------------------------------------------
679 -- |-----------------------< chk_non_updateable_args >------------------------|
680 -- ----------------------------------------------------------------------------
681 -- {Start Of Comments}
682 --
683 -- Description:
684 -- This procedure is used to ensure that non updateable attributes have
685 -- not been updated. If an attribute has been updated an error is generated.
686 --
687 -- Pre Conditions:
688 -- g_old_rec has been populated with details of the values currently in
689 -- the database.
690 --
691 -- In Arguments:
692 -- p_rec has been populated with the updated values the user would like the
693 -- record set to.
694 --
695 -- Post Success:
696 -- Processing continues if all the non updateable attributes have not
697 -- changed.
698 --
699 -- Post Failure:
700 -- An application error is raised if any of the non updatable attributes
701 -- have been altered.
702 --
703 -- {End Of Comments}
704 -- ----------------------------------------------------------------------------
705 Procedure chk_non_updateable_args
706 (p_rec in pay_aif_shd.g_rec_type
707 ) IS
708 --
709 l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
710 l_error EXCEPTION;
711 l_argument varchar2(30);
712 --
713 Begin
714 --
715 -- Only proceed with the validation if a row exists for the current
716 -- record in the HR Schema.
717 --
718 IF NOT pay_aif_shd.api_updating
719 (p_action_information_id => p_rec.action_information_id
720 ,p_object_version_number => p_rec.object_version_number
721 ) THEN
722 fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
723 fnd_message.set_token('PROCEDURE ', l_proc);
724 fnd_message.set_token('STEP ', '5');
725 fnd_message.raise_error;
726 END IF;
727 --
728 -- action_context_id
729 --
730 if nvl(p_rec.action_context_id,hr_api.g_number) <>
731 nvl(pay_aif_shd.g_old_rec.action_context_id,hr_api.g_number) then
732 --
733 l_argument := 'p_rec.action_context_id';
734 raise l_error;
735 --
736 end if;
737 --
738 -- action_context_type
739 --
740 if nvl(p_rec.action_context_type,hr_api.g_varchar2) <>
741 nvl(pay_aif_shd.g_old_rec.action_context_type,hr_api.g_varchar2) then
742 --
743 l_argument := 'p_rec.action_context_type';
744 raise l_error;
745 --
746 end if;
747 --
748 -- effective_date
749 --
750 if nvl(p_rec.effective_date,hr_api.g_date) <>
751 nvl(pay_aif_shd.g_old_rec.effective_date,hr_api.g_date) then
752 --
753 l_argument := 'p_rec.effective_date';
754 raise l_error;
755 --
756 end if;
760 if nvl(p_rec.assignment_id,hr_api.g_number) <>
757 --
758 -- assignment_id
759 --
761 nvl(pay_aif_shd.g_old_rec.assignment_id,hr_api.g_number) then
762 --
763 l_argument := 'p_rec.assignment_id';
764 raise l_error;
765 --
766 end if;
767 --
768 -- action_information_category
769 --
770 if nvl(p_rec.action_information_category,hr_api.g_varchar2) <>
771 nvl(pay_aif_shd.g_old_rec.action_information_category,hr_api.g_varchar2) then
772 --
773 l_argument := 'p_rec.action_information_category';
774 raise l_error;
775 --
776 end if;
777 --
778 -- tax_unit_id
779 --
780 if nvl(p_rec.tax_unit_id,hr_api.g_number) <>
781 nvl(pay_aif_shd.g_old_rec.tax_unit_id,hr_api.g_number) then
782 --
783 l_argument := 'p_rec.tax_unit_id';
784 raise l_error;
785 --
786 end if;
787 --
788 -- jurisdiction_code
789 --
790 if nvl(p_rec.jurisdiction_code,hr_api.g_varchar2) <>
791 nvl(pay_aif_shd.g_old_rec.jurisdiction_code,hr_api.g_varchar2) then
792 --
793 l_argument := 'p_rec.jurisdiction_code';
794 raise l_error;
795 --
796 end if;
797 --
798 -- source_id
799 --
800 if nvl(p_rec.source_id,hr_api.g_number) <>
801 nvl(pay_aif_shd.g_old_rec.source_id,hr_api.g_number) then
802 --
803 l_argument := 'p_rec.source_id';
804 raise l_error;
805 --
806 end if;
807 --
808 -- source_text
809 --
810 if nvl(p_rec.source_text,hr_api.g_varchar2) <>
811 nvl(pay_aif_shd.g_old_rec.source_text,hr_api.g_varchar2) then
812 --
813 l_argument := 'p_rec.source_text';
814 raise l_error;
815 --
816 end if;
817 --
818 -- tax_group
819 --
820 if nvl(p_rec.tax_group,hr_api.g_varchar2) <>
821 nvl(pay_aif_shd.g_old_rec.tax_group,hr_api.g_varchar2) then
822 --
823 l_argument := 'p_rec.tax_group';
824 raise l_error;
825 --
826 end if;
827 --
828 EXCEPTION
829 WHEN l_error THEN
830 hr_api.argument_changed_error
831 (p_api_name => l_proc
832 ,p_argument => l_argument);
833 WHEN OTHERS THEN
834 RAISE;
835 End chk_non_updateable_args;
836 --
837 -- ----------------------------------------------------------------------------
838 -- |---------------------------< insert_validate >----------------------------|
839 -- ----------------------------------------------------------------------------
840 Procedure insert_validate
841 (p_rec in pay_aif_shd.g_rec_type
842 ) is
843 --
844 l_proc varchar2(72) := g_package||'insert_validate';
845 --
846 Begin
847 --
848 hr_utility.set_location('Entering:'||l_proc, 5);
849 --
850 -- Call all supporting business operations
851 --
852 pay_aif_bus.chk_action_context_type(p_rec.action_context_type);
853 --
854 pay_aif_bus.chk_action_context_id(p_rec.action_context_id,p_rec.action_context_type);
855 --
856 pay_aif_bus.chk_assignment_id(p_rec.assignment_id);
857 --
858 -- Removed call - assume trusted source (performance implications
859 -- in calling this for large volumes)
860 -- pay_aif_bus.chk_ddf(p_rec);
861 --
862 hr_utility.set_location(' Leaving:'||l_proc, 10);
863 --
864 End insert_validate;
865 --
866 -- ----------------------------------------------------------------------------
867 -- |---------------------------< update_validate >----------------------------|
868 -- ----------------------------------------------------------------------------
869 Procedure update_validate
870 (p_rec in pay_aif_shd.g_rec_type
871 ) is
872 --
873 l_proc varchar2(72) := g_package||'update_validate';
874 --
875 Begin
876 --
877 hr_utility.set_location('Entering:'||l_proc, 5);
878 --
879 chk_non_updateable_args(p_rec);
880 --
881 -- Removed call - assume trusted source (performance implications
882 -- in calling this for large volumes)
883 -- pay_aif_bus.chk_ddf(p_rec);
884 --
885 hr_utility.set_location(' Leaving:'||l_proc, 10);
886 --
887 End update_validate;
888 --
889 -- ----------------------------------------------------------------------------
890 -- |---------------------------< delete_validate >----------------------------|
891 -- ----------------------------------------------------------------------------
892 Procedure delete_validate
893 (p_rec in pay_aif_shd.g_rec_type
894 ) is
895 --
896 l_proc varchar2(72) := g_package||'delete_validate';
897 --
898 Begin
899 hr_utility.set_location('Entering:'||l_proc, 5);
900 --
901 -- Call all supporting business operations
902 --
903 hr_utility.set_location(' Leaving:'||l_proc, 10);
904 End delete_validate;
905 --
906 end pay_aif_bus;