[Home] [Help]
PACKAGE BODY: APPS.PAY_ESU_BUS
Source
1 Package Body pay_esu_bus as
2 /* $Header: pyesurhi.pkb 115.1 2003/08/15 02:39:10 thabara noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pay_esu_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_element_span_usage_id number default null;
15 --
16 -- ---------------------------------------------------------------------------
17 -- |----------------------< set_security_group_id >--------------------------|
18 -- ---------------------------------------------------------------------------
19 --
20 Procedure set_security_group_id
21 (p_element_span_usage_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 pbg.legislation_code
30 from per_business_groups_perf pbg
31 , pay_element_span_usages esu
32 where esu.element_span_usage_id = p_element_span_usage_id
33 and pbg.business_group_id (+) = esu.business_group_id;
34 --
35 -- Declare local variables
36 --
37 l_security_group_id number;
38 l_proc varchar2(72) := g_package||'set_security_group_id';
39 l_legislation_code varchar2(150);
40 --
41 begin
42 --
43 hr_utility.set_location('Entering:'|| l_proc, 10);
44 --
45 -- Ensure that all the mandatory parameter are not null
46 --
47 hr_api.mandatory_arg_error
48 (p_api_name => l_proc
49 ,p_argument => 'element_span_usage_id'
50 ,p_argument_value => p_element_span_usage_id
51 );
52 --
53 open csr_sec_grp;
54 fetch csr_sec_grp into l_security_group_id
55 , l_legislation_code;
56 --
57 if csr_sec_grp%notfound then
58 --
59 close csr_sec_grp;
60 --
61 -- The primary key is invalid therefore we must error
62 --
63 fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
64 hr_multi_message.add
65 (p_associated_column1
66 => nvl(p_associated_column1,'ELEMENT_SPAN_USAGE_ID')
67 );
68 --
69 else
70 close csr_sec_grp;
71 --
72 -- Set the security_group_id in CLIENT_INFO
73 --
74 hr_api.set_security_group_id
75 (p_security_group_id => l_security_group_id
76 );
77 --
78 -- Set the sessions legislation context in HR_SESSION_DATA
79 --
80 hr_api.set_legislation_context(l_legislation_code);
81 end if;
82 --
83 hr_utility.set_location(' Leaving:'|| l_proc, 20);
84 --
85 end set_security_group_id;
86 --
87 -- ---------------------------------------------------------------------------
88 -- |---------------------< return_legislation_code >-------------------------|
89 -- ---------------------------------------------------------------------------
90 --
91 Function return_legislation_code
92 (p_element_span_usage_id in number
93 )
94 Return Varchar2 Is
95 --
96 -- Declare cursor
97 --
98 cursor csr_leg_code is
99 select pbg.legislation_code
100 from per_business_groups_perf pbg
101 , pay_element_span_usages esu
102 where esu.element_span_usage_id = p_element_span_usage_id
103 and pbg.business_group_id (+) = esu.business_group_id;
104 --
105 -- Declare local variables
106 --
107 l_legislation_code varchar2(150);
108 l_proc varchar2(72) := g_package||'return_legislation_code';
109 --
110 Begin
111 --
112 hr_utility.set_location('Entering:'|| l_proc, 10);
113 --
114 -- Ensure that all the mandatory parameter are not null
115 --
116 hr_api.mandatory_arg_error
117 (p_api_name => l_proc
118 ,p_argument => 'element_span_usage_id'
119 ,p_argument_value => p_element_span_usage_id
120 );
121 --
122 if ( nvl(pay_esu_bus.g_element_span_usage_id, hr_api.g_number)
123 = p_element_span_usage_id) then
124 --
125 -- The legislation code has already been found with a previous
126 -- call to this function. Just return the value in the global
127 -- variable.
128 --
129 l_legislation_code := pay_esu_bus.g_legislation_code;
130 hr_utility.set_location(l_proc, 20);
131 else
132 --
133 -- The ID is different to the last call to this function
134 -- or this is the first call to this function.
135 --
136 open csr_leg_code;
137 fetch csr_leg_code into l_legislation_code;
138 --
139 if csr_leg_code%notfound then
140 --
141 -- The primary key is invalid therefore we must error
142 --
143 close csr_leg_code;
144 fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
145 fnd_message.raise_error;
146 end if;
147 hr_utility.set_location(l_proc,30);
148 --
149 -- Set the global variables so the values are
150 -- available for the next call to this function.
151 --
152 close csr_leg_code;
153 pay_esu_bus.g_element_span_usage_id := p_element_span_usage_id;
154 pay_esu_bus.g_legislation_code := l_legislation_code;
155 end if;
156 hr_utility.set_location(' Leaving:'|| l_proc, 40);
157 return l_legislation_code;
158 end return_legislation_code;
159 --
160 -- ----------------------------------------------------------------------------
161 -- |-----------------------< chk_non_updateable_args >------------------------|
162 -- ----------------------------------------------------------------------------
163 -- {Start Of Comments}
164 --
165 -- Description:
166 -- This procedure is used to ensure that non updateable attributes have
167 -- not been updated. If an attribute has been updated an error is generated.
168 --
169 -- Pre Conditions:
170 -- g_old_rec has been populated with details of the values currently in
171 -- the database.
172 --
173 -- In Arguments:
174 -- p_rec has been populated with the updated values the user would like the
175 -- record set to.
176 --
177 -- Post Success:
178 -- Processing continues if all the non updateable attributes have not
179 -- changed.
180 --
181 -- Post Failure:
182 -- An application error is raised if any of the non updatable attributes
183 -- have been altered.
184 --
185 -- {End Of Comments}
186 -- ----------------------------------------------------------------------------
187 Procedure chk_non_updateable_args
188 (p_effective_date in date
189 ,p_rec in pay_esu_shd.g_rec_type
190 ) IS
191 --
192 l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
193 l_error exception;
194 l_argument varchar2(30);
195 --
196 Begin
197 --
198 -- Only proceed with the validation if a row exists for the current
199 -- record in the HR Schema.
200 --
201 IF NOT pay_esu_shd.api_updating
202 (p_element_span_usage_id => p_rec.element_span_usage_id
203 ,p_object_version_number => p_rec.object_version_number
204 ) THEN
205 fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
206 fnd_message.set_token('PROCEDURE ', l_proc);
207 fnd_message.set_token('STEP ', '5');
208 fnd_message.raise_error;
209 END IF;
210 --
211 hr_utility.set_location(l_proc, 10);
212 --
213 if nvl(p_rec.business_group_id, hr_api.g_number) <>
214 nvl(pay_esu_shd.g_old_rec.business_group_id, hr_api.g_number) then
215 l_argument := 'business_group_id';
216 raise l_error;
217 end if;
218 hr_utility.set_location(l_proc, 15);
219 --
220 if nvl(p_rec.legislation_code, hr_api.g_varchar2) <>
221 nvl(pay_esu_shd.g_old_rec.legislation_code, hr_api.g_varchar2) then
222 l_argument := 'legislation_code';
223 raise l_error;
224 end if;
225 hr_utility.set_location(l_proc, 20);
226 --
227 if nvl(p_rec.retro_component_usage_id, hr_api.g_number) <>
228 nvl(pay_esu_shd.g_old_rec.retro_component_usage_id, hr_api.g_number) then
229 l_argument := 'retro_component_usage_id';
230 raise l_error;
231 end if;
232 hr_utility.set_location(l_proc, 25);
233 --
234 if nvl(p_rec.time_span_id, hr_api.g_number) <>
235 nvl(pay_esu_shd.g_old_rec.time_span_id, hr_api.g_number) then
236 l_argument := 'time_span_id';
237 raise l_error;
238 end if;
239 hr_utility.set_location(l_proc, 30);
240 --
241 exception
242 when l_error then
243 hr_api.argument_changed_error
244 (p_api_name => l_proc
245 ,p_argument => l_argument
246 );
247 when others then
248 raise;
249
250 End chk_non_updateable_args;
251 --
252 -- ----------------------------------------------------------------------------
253 -- |----------------------< chk_startup_action >------------------------------|
254 -- ----------------------------------------------------------------------------
255 --
256 -- Description:
257 -- This procedure will check that the current action is allowed according
258 -- to the current startup mode.
259 --
260 -- ----------------------------------------------------------------------------
261 PROCEDURE chk_startup_action
262 (p_insert IN boolean
263 ,p_business_group_id IN number
264 ,p_legislation_code IN varchar2
265 ,p_legislation_subgroup IN varchar2 DEFAULT NULL) IS
266 --
267 BEGIN
268 --
269 -- Call the supporting procedure to check startup mode
270 IF (p_insert) THEN
271 hr_startup_data_api_support.chk_startup_action
272 (p_generic_allowed => TRUE
273 ,p_startup_allowed => TRUE
274 ,p_user_allowed => TRUE
275 ,p_business_group_id => p_business_group_id
276 ,p_legislation_code => p_legislation_code
277 ,p_legislation_subgroup => p_legislation_subgroup
278 );
279 ELSE
280 hr_startup_data_api_support.chk_upd_del_startup_action
281 (p_generic_allowed => TRUE
282 ,p_startup_allowed => TRUE
283 ,p_user_allowed => TRUE
284 ,p_business_group_id => p_business_group_id
285 ,p_legislation_code => p_legislation_code
286 ,p_legislation_subgroup => p_legislation_subgroup
287 );
288 END IF;
289 --
290 END chk_startup_action;
291
292 -- -------------------------------------------------------------------------
293 -- |-------------------< chk_retro_component_usage_id >--------------------|
294 -- -------------------------------------------------------------------------
295 -- {Start Of Comments}
296 --
297 -- Description:
298 -- Validates that the retro component usage id exists in
299 -- pay_retro_component_usages.
300 --
301 -- Prerequisites:
302 -- None.
303 --
304 -- In Parameters:
305 -- p_retro_component_usage_id
306 -- p_business_group_id
307 -- p_legislation_code
308 --
309 -- Post Success:
310 -- Processing continues if the retro_component_usage_id is valid.
311 --
312 --
313 -- Post Failure:
314 -- An application error is raised and processing is terminated if the
315 -- retro_component_usage_id is invalid.
316 --
317 -- Access Status:
318 -- Internal Row Handler Use Only.
319 --
320 -- {End Of Comments}
321 --
322 procedure chk_retro_component_usage_id
323 (p_retro_component_usage_id in pay_element_span_usages.time_span_id%type
324 ,p_business_group_id in pay_element_span_usages.business_group_id%type
325 ,p_legislation_code in pay_element_span_usages.legislation_code%type
326 )
327 is
328 --
329 -- Declare local variables
333 l_number number := hr_api.g_number;
330 --
331 l_proc varchar2(72) := g_package||'chk_retro_component_usage_id';
332 l_varchar2 varchar2(30) := hr_api.g_varchar2;
334 l_exists varchar2(1);
335 l_legislation_code pay_element_span_usages.legislation_code%type;
336
337 --
338 -- Cursor to check that a retro component exists.
339 --
340 cursor csr_retro_component_usage is
341 select null
342 from pay_retro_component_usages
343 where retro_component_usage_id = p_retro_component_usage_id
344 and nvl(legislation_code, nvl(l_legislation_code, l_varchar2))
345 = nvl(l_legislation_code, l_varchar2)
346 and nvl(business_group_id, nvl(p_business_group_id, l_number))
347 = nvl(p_business_group_id, l_number);
348 --
349 begin
350 hr_utility.set_location('Entering:'|| l_proc, 10);
351 --
352 -- Check mandatory parameters have been set
353 --
354 hr_api.mandatory_arg_error
355 (p_api_name => l_proc
356 ,p_argument => 'retro_component_usage_id'
357 ,p_argument_value => p_retro_component_usage_id
358 );
359
360 --
361 -- Set the legislation code
362 --
363 l_legislation_code
364 := nvl(p_legislation_code
365 ,hr_api.return_legislation_code(p_business_group_id));
366
367 --
368 -- Check if the retro component usage exists.
369 --
370 hr_utility.set_location(l_proc, 20);
371 open csr_retro_component_usage;
372 fetch csr_retro_component_usage into l_exists;
373 if csr_retro_component_usage%notfound then
374 close csr_retro_component_usage;
375
376 fnd_message.set_name('PAY','PAY_33164_ESU_INV_RET_COMP_USG');
377 fnd_message.raise_error;
378
379 end if;
380 close csr_retro_component_usage;
381
382 hr_utility.set_location(' Leaving:'|| l_proc, 50);
383 end chk_retro_component_usage_id;
384 --
385 -- -------------------------------------------------------------------------
386 -- |-------------------------< chk_time_span_id >--------------------------|
387 -- -------------------------------------------------------------------------
388 -- {Start Of Comments}
389 --
390 -- Description:
391 -- Validates that the time span id exists in pay_time_spans.
392 --
393 -- Prerequisites:
394 -- None.
395 --
396 -- In Parameters:
397 -- p_time_span_id
398 -- p_retro_component_usage_id
399 --
400 -- Post Success:
401 -- Processing continues if the time_span_id is valid.
402 --
403 --
404 -- Post Failure:
405 -- An application error is raised and processing is terminated if the
406 -- time_span_id is invalid.
407 --
408 -- Access Status:
409 -- Internal Row Handler Use Only.
410 --
411 -- {End Of Comments}
412 --
413 procedure chk_time_span_id
414 (p_time_span_id in pay_element_span_usages.time_span_id%type
415 ,p_retro_component_usage_id in pay_element_span_usages.retro_component_usage_id%type
416 )
417 is
418 --
419 -- Declare local variables
420 --
421 l_proc varchar2(72) := g_package||'chk_time_span_id';
422 l_varchar2 varchar2(30) := hr_api.g_varchar2;
423 l_number number := hr_api.g_number;
424 l_exists varchar2(1);
425
426 --
427 -- Cursor to check that a retro component exists.
428 --
429 cursor csr_time_span is
430 select null
431 from pay_time_spans pts
432 ,pay_retro_component_usages rcu
433 where pts.time_span_id = p_time_span_id
434 and rcu.retro_component_usage_id = p_retro_component_usage_id
435 and pts.creator_type = 'RC'
436 and pts.creator_id = rcu.retro_component_id;
437 --
438 begin
439 hr_utility.set_location('Entering:'|| l_proc, 10);
440 --
441 -- Check mandatory parameters have been set
442 --
443 hr_api.mandatory_arg_error
444 (p_api_name => l_proc
445 ,p_argument => 'time_span_id'
446 ,p_argument_value => p_time_span_id
447 );
448 hr_api.mandatory_arg_error
449 (p_api_name => l_proc
450 ,p_argument => 'retro_component_usage_id'
451 ,p_argument_value => p_retro_component_usage_id
452 );
453
454 --
455 -- Check if the time span exists.
456 --
457 hr_utility.set_location(l_proc, 20);
458 open csr_time_span;
459 fetch csr_time_span into l_exists;
460 if csr_time_span%notfound then
461 close csr_time_span;
462
463 fnd_message.set_name('PAY','PAY_33165_ESU_INV_TIME_SPAN');
464 fnd_message.raise_error;
465
466 end if;
467 close csr_time_span;
468
469 hr_utility.set_location(' Leaving:'|| l_proc, 50);
470 end chk_time_span_id;
471 --
472 -- -------------------------------------------------------------------------
473 -- |------------------------< chk_adjustment_type >------------------------|
474 -- -------------------------------------------------------------------------
475 -- {Start Of Comments}
476 --
477 -- Description:
478 -- Validates that the adjustment type exists in lookup type
479 -- RETRO_ADJUSTMENT_TYPE.
480 --
481 -- Prerequisites:
482 -- None.
483 --
484 -- In Parameters:
485 -- p_element_span_usage_id
486 -- p_adjustment_type
487 -- p_object_version_number
488 -- p_effective_date
489 --
490 --
491 -- Post Success:
492 -- Processing continues if the adjustment_type is valid.
493 --
494 --
495 -- Post Failure:
499 -- Access Status:
496 -- An application error is raised and processing is terminated if the
497 -- adjustment_type is invalid.
498 --
500 -- Internal Row Handler Use Only.
501 --
502 -- {End Of Comments}
503 --
504 procedure chk_adjustment_type
505 (p_element_span_usage_id in pay_element_span_usages.retro_component_usage_id%type
506 ,p_adjustment_type in pay_element_span_usages.adjustment_type%type
507 ,p_object_version_number in pay_element_span_usages.object_version_number%type
508 ,p_effective_date in date
509 )
510 is
511 --
512 -- Declare local variables
513 --
514 l_proc varchar2(72) := g_package||'chk_adjustment_type';
515 l_api_updating boolean;
516
517 --
518 begin
519 hr_utility.set_location('Entering:'|| l_proc, 10);
520 --
521 -- Check mandatory parameters have been set
522 --
523 hr_api.mandatory_arg_error
524 (p_api_name => l_proc
525 ,p_argument => 'effective_date'
526 ,p_argument_value => p_effective_date
527 );
528
529 hr_utility.set_location(l_proc, 15);
530 --
531 -- Check if the element span usage is being updated and ensure that
532 -- g_old_rec contains the values for this element_span_usage_id.
533 --
534 l_api_updating :=
535 pay_esu_shd.api_updating
536 (p_element_span_usage_id => p_element_span_usage_id
537 ,p_object_version_number => p_object_version_number);
538
539 hr_utility.set_location(l_proc, 20);
540 --
541 -- Only proceed with validation if:
542 -- a) During update, the value has actually changed to
543 -- another not null value.
544 -- b) During insert, the value is not null.
545 --
546 if ((l_api_updating and
547 nvl(pay_esu_shd.g_old_rec.adjustment_type, hr_api.g_varchar2)
548 <> nvl(p_adjustment_type, hr_api.g_varchar2))
549 or
550 NOT l_api_updating) then
551 --
552 hr_utility.set_location(l_proc, 30);
553
554 --
555 -- If adjustment_type is not null then
556 -- Check if the adjustment_type value exists in hr_lookups
557 -- where the lookup_type is 'RETRO_ADJUSTMENT_TYPE'
558 --
559 if p_adjustment_type is not null then
560 if hr_api.not_exists_in_hr_lookups
561 (p_effective_date => p_effective_date
562 ,p_lookup_type => 'RETRO_ADJUSTMENT_TYPE'
563 ,p_lookup_code => p_adjustment_type
564 ) then
565
566 fnd_message.set_name('PAY','HR_52966_INVALID_LOOKUP');
567 fnd_message.set_token('COLUMN','ADJUSTMENT_TYPE');
568 fnd_message.set_token('LOOKUP_TYPE','RETRO_ADJUSTMENT_TYPE');
569 fnd_message.raise_error;
570
571 end if;
572 end if;
573 end if;
574
575 hr_utility.set_location(' Leaving:'|| l_proc, 50);
576 end chk_adjustment_type;
577 --
578 --
579 -- -------------------------------------------------------------------------
580 -- |---------------------< chk_retro_element_type_id >---------------------|
581 -- -------------------------------------------------------------------------
582 -- {Start Of Comments}
583 --
584 -- Description:
585 -- Validates that the retro_element_type_id exists in pay_element_types_f.
586 --
587 -- Prerequisites:
588 -- None.
589 --
590 -- In Parameters:
591 -- p_element_span_usage_id
592 -- p_retro_element_type_id
593 -- p_object_version_number
594 -- p_effective_date
595 --
596 --
597 -- Post Success:
598 -- Processing continues if the retro_element_type_id is valid.
599 --
600 --
601 -- Post Failure:
602 -- An application error is raised and processing is terminated if the
603 -- retro_element_type_id is invalid.
604 --
605 -- Access Status:
606 -- Internal Row Handler Use Only.
607 --
608 -- {End Of Comments}
609 --
610 procedure chk_retro_element_type_id
611 (p_element_span_usage_id in pay_element_span_usages.retro_component_usage_id%type
612 ,p_retro_element_type_id in pay_element_span_usages.retro_element_type_id%type
613 ,p_business_group_id in pay_element_span_usages.business_group_id%type
614 ,p_legislation_code in pay_element_span_usages.legislation_code%type
615 ,p_object_version_number in pay_element_span_usages.object_version_number%type
616 ,p_effective_date in date
617 )
618 is
619 --
620 -- Declare local variables
621 --
622 l_proc varchar2(72) := g_package||'chk_retro_element_type_id';
623 l_varchar2 varchar2(30) := hr_api.g_varchar2;
624 l_number number := hr_api.g_number;
625 l_exists varchar2(1);
626 l_api_updating boolean;
627 l_legislation_code pay_element_span_usages.legislation_code%type;
628
629 --
630 -- Cursor to check that a retro component exists.
631 --
632 cursor csr_retro_element_type is
633 select null
634 from pay_element_types_f
635 where element_type_id = p_retro_element_type_id
636 and p_effective_date between effective_start_date
637 and effective_end_date
638 and nvl(legislation_code, nvl(l_legislation_code, l_varchar2))
639 = nvl(l_legislation_code, l_varchar2)
640 and nvl(business_group_id, nvl(p_business_group_id, l_number))
641 = nvl(p_business_group_id, l_number);
642 --
643 begin
644 hr_utility.set_location('Entering:'|| l_proc, 10);
645 --
646 -- Check mandatory parameters have been set
647 --
648 hr_api.mandatory_arg_error
649 (p_api_name => l_proc
650 ,p_argument => 'retro_element_type_id'
654 -- Set the legislation code
651 ,p_argument_value => p_retro_element_type_id
652 );
653 --
655 --
656 l_legislation_code
657 := nvl(p_legislation_code
658 ,hr_api.return_legislation_code(p_business_group_id));
659
660 --
661 -- Check if the retro component usage is being updated and ensure that
662 -- g_old_rec contains the values for this retro_component_usage_id.
663 --
664 l_api_updating :=
665 pay_esu_shd.api_updating
666 (p_element_span_usage_id => p_element_span_usage_id
667 ,p_object_version_number => p_object_version_number);
668
669 hr_utility.set_location(l_proc, 20);
670 --
671 -- Only proceed with validation if:
672 -- a) During update, the value has actually changed to
673 -- another not null value.
674 -- b) During insert.
675 --
676 if ((l_api_updating and
677 pay_esu_shd.g_old_rec.retro_element_type_id <> p_retro_element_type_id)
678 or
679 NOT l_api_updating) then
680 --
681 hr_utility.set_location(l_proc, 30);
682
683 --
684 -- Check if the retro element type exists.
685 --
686 hr_utility.set_location(l_proc, 40);
687 open csr_retro_element_type;
688 fetch csr_retro_element_type into l_exists;
689 if csr_retro_element_type%notfound then
690 close csr_retro_element_type;
691
692 fnd_message.set_name('PAY','PAY_33166_ESU_INV_RET_ELE_TYP');
693 fnd_message.raise_error;
694
695 end if;
696 close csr_retro_element_type;
697 end if;
698
699 hr_utility.set_location(' Leaving:'|| l_proc, 50);
700 end chk_retro_element_type_id;
701 --
702
703 --
704 -- ----------------------------------------------------------------------------
705 -- |---------------------------< insert_validate >----------------------------|
706 -- ----------------------------------------------------------------------------
707 Procedure insert_validate
708 (p_effective_date in date
709 ,p_rec in pay_esu_shd.g_rec_type
710 ) is
711 --
712 l_proc varchar2(72) := g_package||'insert_validate';
713 --
714 Begin
715 hr_utility.set_location('Entering:'||l_proc, 5);
716 --
717 -- Call all supporting business operations
718 --
719 --
720 chk_startup_action(true
721 ,p_rec.business_group_id
722 ,p_rec.legislation_code
723 );
724 IF hr_startup_data_api_support.g_startup_mode
725 NOT IN ('GENERIC','STARTUP') THEN
726 --
727 -- Validate Important Attributes
728 --
729 hr_api.validate_bus_grp_id
730 (p_business_group_id => p_rec.business_group_id
731 ,p_associated_column1 => pay_esu_shd.g_tab_nam
732 || '.BUSINESS_GROUP_ID');
733 --
734 -- after validating the set of important attributes,
735 -- if Multiple Message Detection is enabled and at least
736 -- one error has been found then abort further validation.
737 --
738 hr_multi_message.end_validation_set;
739 END IF;
740 --
741 --
742 -- Validate Dependent Attributes
743 --
744 --
745 chk_retro_component_usage_id
746 (p_retro_component_usage_id => p_rec.retro_component_usage_id
747 ,p_business_group_id => p_rec.business_group_id
748 ,p_legislation_code => p_rec.legislation_code
749 );
750
751 chk_time_span_id
752 (p_time_span_id => p_rec.time_span_id
756 chk_adjustment_type
753 ,p_retro_component_usage_id => p_rec.retro_component_usage_id
754 );
755
757 (p_element_span_usage_id => p_rec.element_span_usage_id
758 ,p_adjustment_type => p_rec.adjustment_type
759 ,p_object_version_number => p_rec.object_version_number
760 ,p_effective_date => p_effective_date
761 );
762
763 chk_retro_element_type_id
764 (p_element_span_usage_id => p_rec.element_span_usage_id
765 ,p_retro_element_type_id => p_rec.retro_element_type_id
766 ,p_business_group_id => p_rec.business_group_id
767 ,p_legislation_code => p_rec.legislation_code
768 ,p_object_version_number => p_rec.object_version_number
769 ,p_effective_date => p_effective_date
770 );
771
772 hr_utility.set_location(' Leaving:'||l_proc, 10);
773 End insert_validate;
774 --
775 -- ----------------------------------------------------------------------------
776 -- |---------------------------< update_validate >----------------------------|
777 -- ----------------------------------------------------------------------------
778 Procedure update_validate
779 (p_effective_date in date
780 ,p_rec in pay_esu_shd.g_rec_type
781 ) is
782 --
783 l_proc varchar2(72) := g_package||'update_validate';
784 --
785 Begin
786 hr_utility.set_location('Entering:'||l_proc, 5);
787 --
788 -- Call all supporting business operations
789 --
790 --
791 chk_startup_action(false
792 ,p_rec.business_group_id
793 ,p_rec.legislation_code
794 );
795 IF hr_startup_data_api_support.g_startup_mode
796 NOT IN ('GENERIC','STARTUP') THEN
797 --
798 -- Validate Important Attributes
799 --
800 hr_api.validate_bus_grp_id
801 (p_business_group_id => p_rec.business_group_id
802 ,p_associated_column1 => pay_esu_shd.g_tab_nam
803 || '.BUSINESS_GROUP_ID');
804 --
805 -- After validating the set of important attributes,
806 -- if Multiple Message Detection is enabled and at least
807 -- one error has been found then abort further validation.
808 --
809 hr_multi_message.end_validation_set;
810 END IF;
811 --
812 --
813 -- Validate Dependent Attributes
814 --
815 chk_non_updateable_args
816 (p_effective_date => p_effective_date
817 ,p_rec => p_rec
818 );
819 --
820 chk_adjustment_type
821 (p_element_span_usage_id => p_rec.element_span_usage_id
822 ,p_adjustment_type => p_rec.adjustment_type
823 ,p_object_version_number => p_rec.object_version_number
824 ,p_effective_date => p_effective_date
825 );
826
827 chk_retro_element_type_id
828 (p_element_span_usage_id => p_rec.element_span_usage_id
829 ,p_retro_element_type_id => p_rec.retro_element_type_id
830 ,p_business_group_id => p_rec.business_group_id
831 ,p_legislation_code => p_rec.legislation_code
832 ,p_object_version_number => p_rec.object_version_number
833 ,p_effective_date => p_effective_date
834 );
835
836 --
837 hr_utility.set_location(' Leaving:'||l_proc, 10);
838 End update_validate;
839 --
840 -- ----------------------------------------------------------------------------
841 -- |---------------------------< delete_validate >----------------------------|
842 -- ----------------------------------------------------------------------------
843 Procedure delete_validate
844 (p_rec in pay_esu_shd.g_rec_type
845 ) is
846 --
847 l_proc varchar2(72) := g_package||'delete_validate';
848 --
849 Begin
850 hr_utility.set_location('Entering:'||l_proc, 5);
851 --
852 --
853 chk_startup_action(false
854 ,pay_esu_shd.g_old_rec.business_group_id
855 ,pay_esu_shd.g_old_rec.legislation_code
856 );
857 IF hr_startup_data_api_support.g_startup_mode
858 NOT IN ('GENERIC','STARTUP') THEN
859 --
860 -- Validate Important Attributes
861 --
862 --
863 -- After validating the set of important attributes,
864 -- if Multiple Message Detection is enabled and at least
865 -- one error has been found then abort further validation.
866 --
867 hr_multi_message.end_validation_set;
868 END IF;
869 --
870 -- Call all supporting business operations
871 --
872 hr_utility.set_location(' Leaving:'||l_proc, 10);
873 End delete_validate;
874 --
875 end pay_esu_bus;