1 Package Body pay_itr_bus as
2 /* $Header: pyitrrhi.pkb 115.6 2002/12/16 17:48:51 dsaxby noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pay_itr_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_iterative_rule_id number default null;
15 --
16 -- ---------------------------------------------------------------------------
17 -- |----------------------< set_security_group_id >--------------------------|
18 -- ---------------------------------------------------------------------------
19 --
20 Procedure set_security_group_id
21 (p_iterative_rule_id in number
22 ) is
23 --
24 -- Declare cursor
25 --
26 cursor csr_sec_grp is
27 select pbg.security_group_id
28 from per_business_groups pbg
29 , pay_iterative_rules_f itr
30 where itr.iterative_rule_id = p_iterative_rule_id
31 and pbg.business_group_id = itr.business_group_id;
32 --
33 -- Declare local variables
34 --
35 l_security_group_id number;
36 l_proc varchar2(72) := g_package||'set_security_group_id';
37 --
38 begin
39 --
40 hr_utility.set_location('Entering:'|| l_proc, 10);
41 --
42 -- Ensure that all the mandatory parameter are not null
43 --
44 hr_api.mandatory_arg_error
45 (p_api_name => l_proc
46 ,p_argument => 'iterative_rule_id'
47 ,p_argument_value => p_iterative_rule_id
48 );
49 --
50 open csr_sec_grp;
51 fetch csr_sec_grp into l_security_group_id;
52 --
53 if csr_sec_grp%notfound then
54 --
55 close csr_sec_grp;
56 --
57 -- The primary key is invalid therefore we must error
58 --
59 fnd_message.set_name(801,'HR_7220_INVALID_PRIMARY_KEY');
60 fnd_message.raise_error;
61 --
62 end if;
63 close csr_sec_grp;
64 --
65 -- Set the security_group_id in CLIENT_INFO
66 --
67 hr_api.set_security_group_id
68 (p_security_group_id => l_security_group_id
69 );
70 --
71 hr_utility.set_location(' Leaving:'|| l_proc, 20);
72 --
73 end set_security_group_id;
74 --
75 -- ---------------------------------------------------------------------------
76 -- |---------------------< return_legislation_code >-------------------------|
80 (p_iterative_rule_id in number
77 -- ---------------------------------------------------------------------------
78 --
79 Function return_legislation_code
81 )
82 Return Varchar2 Is
83 --
84 -- Declare cursor
85 --
86 cursor csr_leg_code is
87 select pbg.legislation_code
88 from per_business_groups pbg
89 , pay_iterative_rules_f itr
90 where itr.iterative_rule_id = p_iterative_rule_id
91 and pbg.business_group_id (+) = itr.business_group_id;
92 --
93 -- Declare local variables
94 --
95 l_legislation_code varchar2(150);
96 l_proc varchar2(72) := g_package||'return_legislation_code';
97 --
98 Begin
99 --
100 hr_utility.set_location('Entering:'|| l_proc, 10);
101 --
102 -- Ensure that all the mandatory parameter are not null
103 --
104 hr_api.mandatory_arg_error
105 (p_api_name => l_proc
106 ,p_argument => 'iterative_rule_id'
107 ,p_argument_value => p_iterative_rule_id
108 );
109 --
110 if ( nvl(pay_itr_bus.g_iterative_rule_id, hr_api.g_number)
111 = p_iterative_rule_id) then
112 --
113 -- The legislation code has already been found with a previous
114 -- call to this function. Just return the value in the global
115 -- variable.
116 --
117 l_legislation_code := pay_itr_bus.g_legislation_code;
118 hr_utility.set_location(l_proc, 20);
119 else
120 --
121 -- The ID is different to the last call to this function
122 -- or this is the first call to this function.
123 --
124 open csr_leg_code;
125 fetch csr_leg_code into l_legislation_code;
126 --
127 if csr_leg_code%notfound then
128 --
129 -- The primary key is invalid therefore we must error
130 --
131 close csr_leg_code;
132 fnd_message.set_name(801,'HR_7220_INVALID_PRIMARY_KEY');
133 fnd_message.raise_error;
134 end if;
135 hr_utility.set_location(l_proc,30);
136 --
137 -- Set the global variables so the values are
138 -- available for the next call to this function.
139 --
140 close csr_leg_code;
141 pay_itr_bus.g_iterative_rule_id := p_iterative_rule_id;
142 pay_itr_bus.g_legislation_code := l_legislation_code;
143 end if;
144 hr_utility.set_location(' Leaving:'|| l_proc, 40);
145 return l_legislation_code;
146 end return_legislation_code;
147 --
148 -- ----------------------------------------------------------------------------
149 -- |-----------------------< chk_non_updateable_args >------------------------|
150 -- ----------------------------------------------------------------------------
151 -- {Start Of Comments}
152 --
153 -- Description:
154 -- This procedure is used to ensure that non updateable attributes have
155 -- not been updated. If an attribute has been updated an error is generated.
156 --
157 -- Pre Conditions:
158 -- g_old_rec has been populated with details of the values currently in
159 -- the database.
160 --
161 -- In Arguments:
162 -- p_rec has been populated with the updated values the user would like the
163 -- record set to.
164 --
165 -- Post Success:
166 -- Processing continues if all the non updateable attributes have not
167 -- changed.
168 --
169 -- Post Failure:
170 -- An application error is raised if any of the non updatable attributes
171 -- have been altered.
172 --
173 -- {End Of Comments}
174 -- ----------------------------------------------------------------------------
175 Procedure chk_non_updateable_args
176 (p_effective_date in date
177 ,p_rec in pay_itr_shd.g_rec_type
178 ) IS
179 --
183 --
180 l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
181 l_error EXCEPTION;
182 l_argument varchar2(30);
184 Begin
185 --
186 -- Only proceed with the validation if a row exists for the current
187 -- record in the HR Schema.
188 --
189 IF NOT pay_itr_shd.api_updating
190 (p_iterative_rule_id => p_rec.iterative_rule_id
191 ,p_effective_date => p_effective_date
192 ,p_object_version_number => p_rec.object_version_number
193 ) THEN
194 fnd_message.set_name(800, 'HR_6153_ALL_PROCEDURE_FAIL');
198 END IF;
195 fnd_message.set_token('PROCEDURE ', l_proc);
196 fnd_message.set_token('STEP ', '5');
197 fnd_message.raise_error;
199 --
200 -- EDIT_HERE: Add checks to ensure non-updateable args have
201 -- not been updated.
202 --
203 if nvl(p_rec.business_group_id, hr_api.g_number) <>
204 nvl(pay_itr_shd.g_old_rec.business_group_id, hr_api.g_number) then
205 l_argument := 'business_group_id';
206 raise l_error;
207 end if;
208 hr_utility.set_location(l_proc, 7);
209 --
210 if nvl(p_rec.iterative_rule_id, hr_api.g_number) <>
211 nvl(pay_itr_shd.g_old_rec.iterative_rule_id, hr_api.g_number) then
212 l_argument := 'iterative_rule_id';
213 raise l_error;
214 end if;
215 hr_utility.set_location(l_proc, 8);
216 --
217 EXCEPTION
218 WHEN l_error THEN
219 hr_api.argument_changed_error
220 (p_api_name => l_proc
221 ,p_argument => l_argument);
222 WHEN OTHERS THEN
223 RAISE;
224 End chk_non_updateable_args;
225 --
226 -- ----------------------------------------------------------------------------
227 -- |---------------------------< chk_unique_key >-----------------------------|
228 -- ----------------------------------------------------------------------------
229 --
230 -- Description
231 -- This procedure is used to check that the row being inserted or updated does
232 -- not already exists on the database, i.e, has the same RESULT_NAME, RULE_TYPE,
233 -- INPUT_VALUE_ID, ELEMENT_TYPE_ID, EFFECTIVE_START_DATE and EFFECTIVE_END_DATE
234 -- combination.
235 --
236 -- Pre Conditions
237 -- None.
238 --
239 -- In Parameters
240 -- p_result_name
241 -- p_iterative_rule_type
242 -- p_input_value_id
243 -- p_element_type_id
244 -- p_validation_start_date
245 -- p_validation_end_date
246 --
247 -- Post Success
248 -- Processing continues
249 --
250 -- Post Failure
251 -- Errors handled by the procedure
252 --
253 -- Access Status
254 -- Internal table handler use only.
255 --
256 Procedure chk_unique_key
257 ( p_result_name in varchar2
258 ,p_iterative_rule_type in varchar2
259 ,p_input_value_id in number
260 ,p_element_type_id in number
261 ,p_validation_start_date in date
262 ,p_validation_end_date in date
263 ) is
264 --
265 l_exists varchar2(1);
266 l_proc varchar2(72) := g_package||'chk_unique_key';
267 --
268 cursor C1 is
269 select 'Y'
270 from pay_iterative_rules_f pir
271 where pir.result_name = p_result_name
272 and pir.element_type_id = p_element_type_id
273 and pir.iterative_rule_type = p_iterative_rule_type
274 and pir.input_value_id = p_input_value_id
275 and pir.effective_start_date = p_validation_start_date
276 and pir.effective_end_date = p_validation_end_date ;
277 --
278 begin
279 --
280 hr_utility.set_location('Entering:'|| l_proc, 1);
281 --
282 open C1;
283 fetch C1 into l_exists;
284 if C1%found then
285 hr_utility.set_location(l_proc, 3);
286 -- row is not unique
287 close C1;
288 pay_itr_shd.constraint_error('PAY_ITERATIVE_RULES_UK1');
289 end if;
290 close C1;
291 --
292 hr_utility.set_location('Leaving:'|| l_proc, 10);
293 --
294 end chk_unique_key;
295 --
296 -- ----------------------------------------------------------------------------
297 -- |---------------------------< chk_element_type_id >-------------------------|
298 -- ----------------------------------------------------------------------------
299 -- {Start Of Comments}
300 --
301 -- Description:
302 -- This procedure is used to check that the element_type of the row being
303 -- inserted or updated exists on pay_element_types_f and is date effective.
304 --
305 -- Prerequisites:
306 -- This procedure is called from the update_validate and insert_validate.
307 --
308 -- In Parameters:
309 -- p_element_type_id
310 -- p_validation_start_date
311 -- p_validation_end_date
312 --
313 -- Post Success:
314 -- Processing continues.
315 --
316 -- Post Failure:
317 -- Errors handled by the procedure
318 --
319 -- Access Status
320 -- Internal table handler use only.
321 --
322 Procedure chk_element_type_id
323 ( p_element_type_id in number
324 ,p_validation_start_date in date
325 ,p_validation_end_date in date
326 )
327 is
328 l_exists number;
329 l_proc varchar2(72) := g_package||'chk_element_type_id';
330 --
331 Cursor C1 is
332 select distinct et.element_type_id
333 from pay_element_types_f et
334 where et.element_type_id = p_element_type_id
335 and (p_validation_start_date between et.effective_start_date
336 and et.effective_end_date
337 or ( p_validation_start_date < et.effective_start_date
338 and p_validation_end_date > et.effective_start_date) ) ;
339 --
340 begin
341 hr_utility.set_location('Entering:'|| l_proc, 1);
342 --
343 hr_api.mandatory_arg_error
344 (p_api_name => l_proc
345 ,p_argument => 'element_type_id'
346 ,p_argument_value => p_element_type_id
347 );
348 --
349 open C1;
350 fetch C1 into l_exists;
351 if C1%notfound then
355 hr_utility.raise_error;
352 hr_utility.set_location(l_proc, 3);
353 close C1;
354 hr_utility.set_message(801, 'PAY_52908_ITR_ETYPE_ERROR');
356 end if;
357 close C1;
358 --
359 hr_utility.set_location(l_proc, 2);
360 --
361 end chk_element_type_id;
362 --
366 --
363 -- ----------------------------------------------------------------------------
364 -- |---------------------------< chk_result_name >----------------------------|
365 -- ----------------------------------------------------------------------------
367 -- Description
368 -- This procedure is used to check that the iterative rule being inserted or
369 -- updated has a valid result name.
370 --
371 -- Pre Conditions
372 -- None.
373 --
374 -- In Parameters
375 -- p_element_type_id
376 -- p_result_name
377 -- p_validation_start_date
378 -- p_validation_end_date
379 --
380 -- Post Success
381 -- Processing continues
382 --
383 -- Post Failure
384 -- Errors handled by the procedure
385 --
386 -- Access Status
387 -- Internal table handler use only.
388 --
389 --
390 procedure chk_result_name
391 ( p_element_type_id in number
392 ,p_result_name in varchar2
393 ,p_validation_start_date in date
394 ,p_validation_end_date in date
395 )
396 is
397 --
398 l_exists varchar2(80);
399 l_proc varchar2(72) := g_package||'chk_result_name ';
400 --
401 cursor C1 is
402 select distinct f.item_name
403 from pay_element_types_f e
404 ,ff_fdi_usages_f f
405 where e.element_type_id = p_element_type_id
406 and e.iterative_formula_id = f.formula_id
407 and f.usage in ('O', 'B')
408 and f.item_name = p_result_name
409 and (p_validation_start_date between e.effective_start_date
410 and e.effective_end_date
411 or ( p_validation_start_date < e.effective_start_date
412 and p_validation_end_date > e.effective_start_date) )
413 and (p_validation_start_date between f.effective_start_date
414 and f.effective_end_date
415 or ( p_validation_start_date < f.effective_start_date
416 and p_validation_end_date > f.effective_start_date) ) ;
417 --
418 begin
419 hr_utility.set_location('Entering : '|| l_proc, 1);
420 hr_api.mandatory_arg_error
421 (p_api_name => l_proc
422 ,p_argument => 'result_name'
423 ,p_argument_value => p_result_name
424 );
425 --
426 open C1;
427 fetch C1 into l_exists;
428 if C1%notfound then
429 hr_utility.set_location(l_proc, 3);
430 close C1;
431 hr_utility.set_message(801, 'PAY_52903_ITR_RESULT_ERROR');
432 hr_utility.raise_error;
433 end if;
434 close C1;
435 --
436 hr_utility.set_location('Leaving:'|| l_proc, 10);
437 end chk_result_name ;
438 --
439 -- ----------------------------------------------------------------------------
440 -- |--------------------------< chk_iterative_rule_cond >----------------------|
441 -- ----------------------------------------------------------------------------
442 --
443 -- Description
444 -- This procedure is used check that for the row being inserted or updated
445 -- the iterative_rule_type is valid. Also checks that if iterative_rule_type
446 -- is 'M', then severity level is not null and is in ('F', 'I', 'W').
447 -- If iterative_rule_type is 'A', then input value id is not null and
448 -- is a valid input value id (i.e. exists on the element).
449 --
450 -- Prerequisites:
451 -- This procedure is called from the update_validate and insert_validate.
452 --
453 -- In Parameters:
454 -- p_element_type_id
455 -- p_input_value_id
456 -- p_severity_level
457 -- p_iterative_rule_type
458 -- p_validation_start_date
459 -- p_validation_end_date
460 --
461 -- Post Success:
462 -- Processing continues.
463 --
464 -- Post Failure:
465 -- Errors handled by the procedure
466 --
467 -- Access Status
468 -- Internal table handler use only.
469 --
470 Procedure chk_iterative_rule_cond
471 ( p_element_type_id in number
472 ,p_input_value_id in number
473 ,p_severity_level in varchar2
474 ,p_iterative_rule_type in varchar2
475 ,p_validation_start_date in date
476 ,p_validation_end_date in date
477 )
478 is
479 l_exists number;
480 l_proc varchar2(72) := g_package||'chk_iterative_rule_cond';
481 --
482 Cursor C1 is
483 Select distinct piv.input_value_id
484 from pay_input_values_f piv
485 where piv.element_type_id = p_element_type_id
486 and piv.input_value_id = p_input_value_id
487 and (p_validation_start_date between piv.effective_start_date
488 and piv.effective_end_date
489 or ( p_validation_start_date < piv.effective_start_date
490 and p_validation_end_date > piv.effective_start_date) ) ;
491 --
492 begin
493 hr_utility.set_location('Entering:'|| l_proc, 1);
494 --
495 hr_api.mandatory_arg_error
496 (p_api_name => l_proc
497 ,p_argument => 'iterative_rule_type'
498 ,p_argument_value => p_iterative_rule_type
499 );
500 --
501 if (p_iterative_rule_type not in ('M', 'A' , 'S')) then
502 pay_itr_shd.constraint_error('PAY_ITR_RULE_TYPE_CHK');
503 --
504 elsif (p_iterative_rule_type = 'M') then
505 --
506 hr_api.mandatory_arg_error
507 ( p_api_name => l_proc
508 ,p_argument => 'severity_level'
509 ,p_argument_value => p_severity_level
510 );
511 --
512 if ( p_severity_level not in ('F', 'I', 'W')) then
513 pay_itr_shd.constraint_error('PAY_ITR_SEV_LEVEL_CHK');
514 end if;
515 --
516 if (p_input_value_id is not null) then
517 fnd_message.set_name('PAY', 'PAY_52906_ITR_MESSAGE_ERRROR');
518 fnd_message.raise_error;
519 end if;
520 --
521 elsif (p_iterative_rule_type = 'A') then
522 --
523 hr_api.mandatory_arg_error
524 ( p_api_name => l_proc
525 ,p_argument => 'input_value_id'
526 ,p_argument_value => p_input_value_id
527 );
528 --
529 open C1;
530 fetch C1 into l_exists;
531 if ( C1%notfound ) then
532 close C1;
533 fnd_message.set_name('PAY', 'PAY_52904_ITR_INPVAL_ERROR');
534 fnd_message.raise_error;
535 else Close c1;
536 end if;
537 --
538 if (p_severity_level is not null) then
539 fnd_message.set_name('PAY', 'PAY_52907_ITR_ADJUST_ERROR');
540 fnd_message.raise_error;
541 end if;
542 --
543 elsif (p_iterative_rule_type = 'S') then
544 if (p_input_value_id is not null or p_severity_level is not null) then
545 fnd_message.set_name('PAY', 'PAY_52905_ITR_STOP_ERROR');
546 fnd_message.raise_error;
547 end if;
548 end if;
549 end chk_iterative_rule_cond;
550 --
551 -- ----------------------------------------------------------------------------
552 -- |--------------------------< dt_update_validate >--------------------------|
553 -- ----------------------------------------------------------------------------
554 -- {Start Of Comments}
555 --
556 -- Description:
557 -- This procedure is used for referential integrity of datetracked
558 -- parent entities when a datetrack update operation is taking place
559 -- and where there is no cascading of update defined for this entity.
560 --
561 -- Prerequisites:
562 -- This procedure is called from the update_validate.
563 --
564 -- In Parameters:
565 --
566 -- Post Success:
567 -- Processing continues.
568 --
569 -- Post Failure:
570 --
571 -- Developer Implementation Notes:
572 -- This procedure should not need maintenance unless the HR Schema model
573 -- changes.
574 --
575 -- Access Status:
576 -- Internal Row Handler Use Only.
577 --
578 -- {End Of Comments}
579 -- ----------------------------------------------------------------------------
580 Procedure dt_update_validate
581 (p_datetrack_mode in varchar2
582 ,p_validation_start_date in date
583 ,p_validation_end_date in date
584 ) Is
585 --
586 l_proc varchar2(72) := g_package||'dt_update_validate';
587 l_integrity_error Exception;
588 l_table_name all_tables.table_name%TYPE;
589 --
590 Begin
591 --
592 -- Ensure that the p_datetrack_mode argument is not null
593 --
594 hr_api.mandatory_arg_error
595 (p_api_name => l_proc
596 ,p_argument => 'datetrack_mode'
597 ,p_argument_value => p_datetrack_mode
598 );
599 --
600 -- Mode will be valid, as this is checked at the start of the upd.
601 --
602 -- Ensure the arguments are not null
603 --
604 hr_api.mandatory_arg_error
605 (p_api_name => l_proc
606 ,p_argument => 'validation_start_date'
607 ,p_argument_value => p_validation_start_date
608 );
609 --
610 hr_api.mandatory_arg_error
611 (p_api_name => l_proc
612 ,p_argument => 'validation_end_date'
613 ,p_argument_value => p_validation_end_date
614 );
615 --
616 --
617 --
618 Exception
619 When l_integrity_error Then
620 --
621 -- A referential integrity check was violated therefore
622 -- we must error
623 --
624 fnd_message.set_name(801, 'HR_7216_DT_UPD_INTEGRITY_ERR');
625 fnd_message.set_token('TABLE_NAME', l_table_name);
626 fnd_message.raise_error;
627 When Others Then
628 --
629 -- An unhandled or unexpected error has occurred which
630 -- we must report
631 --
632 fnd_message.set_name(801, 'HR_6153_ALL_PROCEDURE_FAIL');
633 fnd_message.set_token('PROCEDURE', l_proc);
634 fnd_message.set_token('STEP','15');
635 fnd_message.raise_error;
636 End dt_update_validate;
637 --
638 -- ----------------------------------------------------------------------------
639 -- |--------------------------< dt_delete_validate >--------------------------|
640 -- ----------------------------------------------------------------------------
641 -- {Start Of Comments}
642 --
643 -- Description:
644 -- This procedure is used for referential integrity of datetracked
645 -- child entities when either a datetrack DELETE or ZAP is in operation
646 -- and where there is no cascading of delete defined for this entity.
647 -- For the datetrack mode of DELETE or ZAP we must ensure that no
648 -- datetracked child rows exist between the validation start and end
649 -- dates.
650 --
651 -- Prerequisites:
652 -- This procedure is called from the delete_validate.
653 --
654 -- In Parameters:
655 --
656 -- Post Success:
657 -- Processing continues.
658 --
659 -- Post Failure:
660 -- If a row exists by determining the returning Boolean value from the
661 -- generic dt_api.rows_exist function then we must supply an error via
662 -- the use of the local exception handler l_rows_exist.
663 --
664 -- Developer Implementation Notes:
665 -- This procedure should not need maintenance unless the HR Schema model
666 -- changes.
667 --
668 -- Access Status:
669 -- Internal Row Handler Use Only.
670 --
671 -- {End Of Comments}
672 -- ----------------------------------------------------------------------------
673 Procedure dt_delete_validate
674 (p_iterative_rule_id in number
675 ,p_datetrack_mode in varchar2
676 ,p_validation_start_date in date
677 ,p_validation_end_date in date
678 ) Is
679 --
680 l_proc varchar2(72) := g_package||'dt_delete_validate';
681 l_rows_exist Exception;
682 l_table_name all_tables.table_name%TYPE;
683 --
684 Begin
685 --
686 -- Ensure that the p_datetrack_mode argument is not null
687 --
688 hr_api.mandatory_arg_error
689 (p_api_name => l_proc
690 ,p_argument => 'datetrack_mode'
691 ,p_argument_value => p_datetrack_mode
692 );
693 --
694 -- Only perform the validation if the datetrack mode is either
695 -- DELETE or ZAP
696 --
697 If (p_datetrack_mode = hr_api.g_delete or
698 p_datetrack_mode = hr_api.g_zap) then
699 --
700 --
701 -- Ensure the arguments are not null
702 --
703 hr_api.mandatory_arg_error
704 (p_api_name => l_proc
705 ,p_argument => 'validation_start_date'
706 ,p_argument_value => p_validation_start_date
707 );
708 --
709 hr_api.mandatory_arg_error
710 (p_api_name => l_proc
711 ,p_argument => 'validation_end_date'
712 ,p_argument_value => p_validation_end_date
713 );
714 --
715 hr_api.mandatory_arg_error
716 (p_api_name => l_proc
717 ,p_argument => 'iterative_rule_id'
718 ,p_argument_value => p_iterative_rule_id
719 );
720 --
721 --
722 --
723 End If;
724 --
725 Exception
726 When l_rows_exist Then
727 --
731 fnd_message.set_name(801, 'HR_7215_DT_CHILD_EXISTS');
728 -- A referential integrity check was violated therefore
729 -- we must error
730 --
732 fnd_message.set_token('TABLE_NAME', l_table_name);
733 fnd_message.raise_error;
734 When Others Then
735 --
736 -- An unhandled or unexpected error has occurred which
737 -- we must report
738 --
739 fnd_message.set_name(801, 'HR_6153_ALL_PROCEDURE_FAIL');
740 fnd_message.set_token('PROCEDURE', l_proc);
741 fnd_message.set_token('STEP','15');
742 fnd_message.raise_error;
743 --
744 End dt_delete_validate;
745 --
746 -- ----------------------------------------------------------------------------
747 -- |---------------------------< insert_validate >----------------------------|
748 -- ----------------------------------------------------------------------------
749 Procedure insert_validate
750 (p_rec in pay_itr_shd.g_rec_type
751 ,p_effective_date in date
752 ,p_datetrack_mode in varchar2
753 ,p_validation_start_date in date
754 ,p_validation_end_date in date
755 ) is
756 --
757 l_proc varchar2(72) := g_package||'insert_validate';
758 --
759 Begin
760 hr_utility.set_location('Entering:'||l_proc, 5);
761 --
762 IF hr_startup_data_api_support.g_startup_mode
763 NOT IN ('GENERIC','STARTUP') THEN
764 hr_api.validate_bus_grp_id(p_rec.business_group_id); -- Validate Bus Grp
765 END IF;
766 --
767 chk_unique_key
768 ( p_result_name => p_rec.result_name
769 ,p_iterative_rule_type => p_rec.iterative_rule_type
770 ,p_input_value_id => p_rec.input_value_id
771 ,p_element_type_id => p_rec.element_type_id
772 ,p_validation_start_date => p_validation_start_date
773 ,p_validation_end_date => p_validation_end_date
774 );
775 --
776 chk_element_type_id
777 ( p_element_type_id => p_rec.element_type_id
778 ,p_validation_start_date => p_validation_start_date
779 ,p_validation_end_date => p_validation_end_date
780 );
781 --
782 chk_result_name
783 ( p_element_type_id => p_rec.element_type_id
784 ,p_result_name => p_rec.result_name
785 ,p_validation_start_date => p_validation_start_date
786 ,p_validation_end_date => p_validation_end_date
787 );
788 --
789 chk_iterative_rule_cond
790 ( p_element_type_id => p_rec.element_type_id
791 ,p_input_value_id => p_rec.input_value_id
792 ,p_severity_level => p_rec.severity_level
793 ,p_iterative_rule_type => p_rec.iterative_rule_type
794 ,p_validation_start_date => p_validation_start_date
795 ,p_validation_end_date => p_validation_end_date
796 );
797 --
798 hr_utility.set_location(' Leaving:'||l_proc, 10);
799 End insert_validate;
800 --
801 -- ----------------------------------------------------------------------------
802 -- |---------------------------< update_validate >----------------------------|
803 -- ----------------------------------------------------------------------------
804 Procedure update_validate
805 (p_rec in pay_itr_shd.g_rec_type
806 ,p_effective_date in date
807 ,p_datetrack_mode in varchar2
808 ,p_validation_start_date in date
809 ,p_validation_end_date in date
810 ) is
811 --
812 l_proc varchar2(72) := g_package||'update_validate';
813 --
814 Begin
815 hr_utility.set_location('Entering:'||l_proc, 5);
816 --
817 IF hr_startup_data_api_support.g_startup_mode
818
819 NOT IN ('GENERIC','STARTUP') THEN
820 hr_api.validate_bus_grp_id(p_rec.business_group_id); -- Validate Bus Grp
821 END IF;
822
823 --
824 chk_unique_key
825 ( p_result_name => p_rec.result_name
826 ,p_iterative_rule_type => p_rec.iterative_rule_type
827 ,p_input_value_id => p_rec.input_value_id
828 ,p_element_type_id => p_rec.element_type_id
829 ,p_validation_start_date => p_validation_start_date
830 ,p_validation_end_date => p_validation_end_date
831 );
832 --
833 chk_element_type_id
834 ( p_element_type_id => p_rec.element_type_id
835 ,p_validation_start_date => p_validation_start_date
836 ,p_validation_end_date => p_validation_end_date
837 );
838 --
839 chk_result_name
840 ( p_element_type_id => p_rec.element_type_id
841 ,p_result_name => p_rec.result_name
842 ,p_validation_start_date => p_validation_start_date
843 ,p_validation_end_date => p_validation_end_date
844 );
845 --
846 chk_iterative_rule_cond
847 ( p_element_type_id => p_rec.element_type_id
848 ,p_input_value_id => p_rec.input_value_id
849 ,p_severity_level => p_rec.severity_level
850 ,p_iterative_rule_type => p_rec.iterative_rule_type
851 ,p_validation_start_date => p_validation_start_date
852 ,p_validation_end_date => p_validation_end_date
853 );
854 --
855 -- Call the datetrack update integrity operation
856 --
857 dt_update_validate
858 (p_datetrack_mode => p_datetrack_mode
859 ,p_validation_start_date => p_validation_start_date
860 ,p_validation_end_date => p_validation_end_date
861 );
862 --
863 chk_non_updateable_args
864 (p_effective_date => p_effective_date
865 ,p_rec => p_rec
866 );
867 --
868 --
869 hr_utility.set_location(' Leaving:'||l_proc, 10);
870 End update_validate;
871 --
872 -- ----------------------------------------------------------------------------
873 -- |---------------------------< delete_validate >----------------------------|
874 -- ----------------------------------------------------------------------------
875 Procedure delete_validate
876 (p_rec in pay_itr_shd.g_rec_type
877 ,p_effective_date in date
878 ,p_datetrack_mode in varchar2
879 ,p_validation_start_date in date
880 ,p_validation_end_date in date
881 ) is
882 --
883 l_proc varchar2(72) := g_package||'delete_validate';
884 --
885 Begin
886 hr_utility.set_location('Entering:'||l_proc, 5);
887 --
888 -- Call all supporting business operations
889 --
890 dt_delete_validate
891 (p_datetrack_mode => p_datetrack_mode
892 ,p_validation_start_date => p_validation_start_date
893 ,p_validation_end_date => p_validation_end_date
894 ,p_iterative_rule_id => p_rec.iterative_rule_id
895 );
896 --
897 hr_utility.set_location(' Leaving:'||l_proc, 10);
898 End delete_validate;
899 --
900 end pay_itr_bus;