[Home] [Help]
PACKAGE BODY: APPS.BEN_PYR_BUS
Source
1 Package Body ben_pyr_bus as
2 /* $Header: bepyrrhi.pkb 120.3 2008/02/05 08:43:04 rtagarra noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_pyr_bus.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------< chk_pyrl_rt_id >------|
12 -- ----------------------------------------------------------------------------
13 --
14 -- Description
15 -- This procedure is used to check that the primary key for the table
16 -- is created properly. It should be null on insert and
17 -- should not be able to be updated.
18 --
19 -- Pre Conditions
20 -- None.
21 --
22 -- In Parameters
23 -- pyrl_rt_id PK of record being inserted or updated.
24 -- effective_date Effective Date of session
25 -- object_version_number Object version number of record being
26 -- inserted or updated.
27 --
28 -- Post Success
29 -- Processing continues
30 --
31 -- Post Failure
32 -- Errors handled by the procedure
33 --
34 -- Access Status
35 -- Internal table handler use only.
36 --
37 Procedure chk_pyrl_rt_id(p_pyrl_rt_id in number,
38 p_effective_date in date,
39 p_object_version_number in number) is
40 --
41 l_proc varchar2(72) := g_package||'chk_pyrl_rt_id';
42 l_api_updating boolean;
43 --
44 Begin
45 --
46 hr_utility.set_location('Entering:'||l_proc, 5);
47 --
48 l_api_updating := ben_pyr_shd.api_updating
49 (p_effective_date => p_effective_date,
50 p_pyrl_rt_id => p_pyrl_rt_id,
51 p_object_version_number => p_object_version_number);
52 --
53 if (l_api_updating
54 and nvl(p_pyrl_rt_id,hr_api.g_number)
55 <> ben_pyr_shd.g_old_rec.pyrl_rt_id) then
56 --
57 -- raise error as PK has changed
58 --
59 ben_pyr_shd.constraint_error('BEN_PYRL_RTS_F_PK');
60 --
61 elsif not l_api_updating then
62 --
63 -- check if PK is null
64 --
65 if p_pyrl_rt_id is not null then
66 --
67 -- raise error as PK is not null
68 --
69 ben_pyr_shd.constraint_error('BEN_PYRL_RTS_F_PK');
70 --
71 end if;
72 --
73 end if;
74 --
75 hr_utility.set_location('Leaving:'||l_proc, 10);
76 --
77 End chk_pyrl_rt_id;
78 --
79 -- ----------------------------------------------------------------------------
80 -- |------< chk_excld_flag >------|
81 -- ----------------------------------------------------------------------------
82 --
83 -- Description
84 -- This procedure is used to check that the lookup value is valid.
85 --
86 -- Pre Conditions
87 -- None.
88 --
89 -- In Parameters
90 -- pyrl_rt_id PK of record being inserted or updated.
91 -- excld_flag Value of lookup code.
92 -- effective_date effective date
93 -- object_version_number Object version number of record being
94 -- inserted or updated.
95 --
96 -- Post Success
97 -- Processing continues
98 --
99 -- Post Failure
100 -- Error handled by procedure
101 --
102 -- Access Status
103 -- Internal table handler use only.
104 --
105 Procedure chk_excld_flag(p_pyrl_rt_id in number,
106 p_excld_flag in varchar2,
107 p_effective_date in date,
108 p_object_version_number in number) is
109 --
110 l_proc varchar2(72) := g_package||'chk_excld_flag';
111 l_api_updating boolean;
112 --
113 Begin
114 --
115 hr_utility.set_location('Entering:'||l_proc, 5);
116 --
117 l_api_updating := ben_pyr_shd.api_updating
118 (p_pyrl_rt_id => p_pyrl_rt_id,
119 p_effective_date => p_effective_date,
120 p_object_version_number => p_object_version_number);
121 --
122 if (l_api_updating
123 and p_excld_flag
124 <> nvl(ben_pyr_shd.g_old_rec.excld_flag,hr_api.g_varchar2)
125 or not l_api_updating) then
126 --
127 -- check if value of lookup falls within lookup type.
128 --
129 --
130 if hr_api.not_exists_in_hr_lookups
131 (p_lookup_type => 'YES_NO',
132 p_lookup_code => p_excld_flag,
133 p_effective_date => p_effective_date) then
134 --
135 -- raise error as does not exist as lookup
136 --
137 hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
138 hr_utility.raise_error;
139 --
140 end if;
141 --
142 end if;
143 --
144 hr_utility.set_location('Leaving:'||l_proc,10);
145 --
146 end chk_excld_flag;
147 --
148 -- ----------------------------------------------------------------------------
149 -- |-------------------------< chk_payroll_id >-------------------------------|
150 -- ----------------------------------------------------------------------------
151 --
152 -- Description
153 -- This procedure is used to check that the foreign key for the table
154 -- is created properly. a corresponding record should exist in the
155 -- PAY_ALL_PAYROLLS_F table.
156 --
157 -- Pre Conditions
158 -- None.
159 --
160 -- In Parameters
161 -- payroll_id FK of pointing to PAY_ALL_PAYROLLS_F tables.
162 -- business_group_id or record being inserted or updated
163 -- effective_date Effective Date of session
164 --
165 -- Post Success
166 -- Processing continues
167 --
168 -- Post Failure
169 -- Errors handled by the procedure
170 --
171 -- Access Status
172 -- Internal table handler use only.
173 --
174 Procedure chk_payroll_id(p_payroll_id in number,
175 p_business_group_id in number,
176 p_effective_date in date ) is
177 --
178 l_proc varchar2(72) := g_package||'chk_payroll_id';
179 l_dummy varchar2(1);
180 cursor c1 is select null
181 from PAY_ALL_PAYROLLS_F
182 where payroll_id = p_payroll_id
183 and p_effective_date between
184 nvl(effective_start_date, p_effective_date)
185 and nvl(effective_end_date, p_effective_date)
186 and business_group_id = p_business_group_id;
187 --
188
189 Begin
190 --
191 hr_utility.set_location('Entering:'||l_proc, 5);
192 --
193 if p_payroll_id is not null then
194 open c1;
195 fetch c1 into l_dummy;
196 if c1%notfound then
197 hr_utility.set_message(801,'Payroll_NotExist');
198 hr_utility.raise_error;
199 end if;
200 close c1;
201 end if;
202 --
203 hr_utility.set_location('Leaving:'||l_proc, 10);
204 --
205 End chk_payroll_id;
206
207 --
208 -- ----------------------------------------------------------------------------
209 -- |------< chk_dup_record >------|
210 -- ----------------------------------------------------------------------------
211 --
212 -- Description
213 -- This procedure is used to check that there is no duplicate record
214 --
215 -- Pre Conditions
216 -- None.
217 --
218 -- In Parameters
219 -- p_pyrl_rt_id PK of record being inserted or updated.
220 -- p_payroll_id Value of FK.
221 -- p_vrbl_rt_prfl_id FK of the record
222 -- p_effective_date effective date
223 -- p_object_version_number Object version number of record being
224 -- inserted or updated.
225 -- p_business_group_id business_group_id of the record
226 -- p_validation_start_date validation_start_date of record
227 -- p_validation_end_date validation_end_date of record
228 --
229 -- Post Success
230 -- Processing continues
231 --
232 -- Post Failure
233 -- Error handled by procedure
234 --
235 -- Access Status
236 -- Internal table handler use only.
237 --
238 Procedure chk_dup_record
239 (p_pyrl_rt_id in number,
240 p_payroll_id in number,
241 p_vrbl_rt_prfl_id in number,
242 p_effective_date in date,
243 p_object_version_number in number,
244 p_business_group_id in number,
245 p_validation_start_date in date,
246 p_validation_end_date in date )
247 is
248 --
249 l_proc varchar2(72) := g_package||'chk_dup_record';
250 l_api_updating boolean;
251 l_exists varchar2(1);
252 --
253 cursor c_dup is
254 select null
255 from ben_pyrl_rt_f
256 where payroll_id = p_payroll_id
257 and vrbl_rt_prfl_id = p_vrbl_rt_prfl_id
258 and pyrl_rt_id <> nvl(p_pyrl_rt_id,hr_api.g_number)
259 and business_group_id + 0 = p_business_group_id
260 and p_validation_start_date <= effective_end_date
261 and p_validation_end_date >= effective_start_date;
262 --
263 BEGIN
264 --
265 hr_utility.set_location('Entering:'||l_proc, 5);
266 --
267 l_api_updating := ben_pyr_shd.api_updating
268 (p_pyrl_rt_id => p_pyrl_rt_id,
269 p_effective_date => p_effective_date,
270 p_object_version_number => p_object_version_number);
271 --
272 if (l_api_updating
273 and p_payroll_id <> nvl(ben_pyr_shd.g_old_rec.payroll_id,hr_api.g_number)
274 or not l_api_updating) then
275
276 open c_dup;
277 fetch c_dup into l_exists;
278 if c_dup%found then
279 close c_dup;
280 --
281 -- raise error as this Payroll criteria already exists for this profile
282 --
283 fnd_message.set_name('BEN', 'BEN_92992_DUPS_ROW');
284 fnd_message.set_token('VAR1','Payroll criteria',TRUE);
285 fnd_message.set_token('VAR2','Variable Rate Profile',TRUE);
286 fnd_message.raise_error;
287 --
288 end if;
289 close c_dup;
290 --
291 end if;
292 hr_utility.set_location('Leaving:'||l_proc,10);
293 --
294 END chk_dup_record;
295
296 --
297 -- added for Bug 5078478 .. add this procedure to check the duplicate seq no
298 -- |--------------------< chk_duplicate_ordr_num >----------------------------|
299 -- ----------------------------------------------------------------------------
300 --
301 -- Description
302 --
303 -- Pre Conditions
304 -- None.
305 --
306 -- In Parameters
307 -- p_pyrl_rt_id
308 -- p_vrbl_rt_prfl_id
309 -- p_ordr_num
310 -- p_effective_date
311 -- p_business_group_id
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 -- ----------------------------------------------------------------------------
323
324
325 procedure chk_duplicate_ordr_num
326 (p_vrbl_rt_prfl_id in number
327 ,p_pyrl_rt_id in number
328 ,p_ordr_num in number
329 ,p_validation_start_date in date
330 ,p_validation_end_date in date
331 ,p_business_group_id in number)
332 is
333 l_proc varchar2(72) := g_package||' chk_duplicate_ordr_num ';
334 l_dummy char(1);
335 cursor c1 is select null
336 from ben_pyrl_rt_f
337 where vrbl_rt_prfl_id = p_vrbl_rt_prfl_id
338 -- changed against bug: 5113011
339 and pyrl_rt_id <> nvl(p_pyrl_rt_id ,-1)
340 --and payroll_id <> nvl(p_payroll_id ,-1)
341 --and p_effective_date between effective_start_date
342 -- and effective_end_date
343 and p_validation_start_date <= effective_end_date
344 and p_validation_end_date >= effective_start_date
345 and business_group_id + 0 = p_business_group_id
346 and ordr_num = p_ordr_num;
347 --
348 Begin
349 hr_utility.set_location('Entering:'||l_proc, 5);
350
351 --
352 open c1;
353 fetch c1 into l_dummy;
354 --
355 if c1%found then
356 fnd_message.set_name('BEN','BEN_91001_SEQ_NOT_UNIQUE');
357 fnd_message.raise_error;
358 end if;
359 close c1;
360 --
361 hr_utility.set_location('Leaving:'||l_proc, 15);
362 End chk_duplicate_ordr_num;
363
364
365
366 --
367 --
368 -- ----------------------------------------------------------------------------
369 -- |--------------------------< dt_update_validate >--------------------------|
370 -- ----------------------------------------------------------------------------
371 -- {Start Of Comments}
372 --
373 -- Description:
374 -- This procedure is used for referential integrity of datetracked
375 -- parent entities when a datetrack update operation is taking place
376 -- and where there is no cascading of update defined for this entity.
377 --
378 -- Prerequisites:
379 -- This procedure is called from the update_validate.
380 --
381 -- In Parameters:
382 --
383 -- Post Success:
384 -- Processing continues.
385 --
386 -- Post Failure:
387 --
388 -- Developer Implementation Notes:
389 -- This procedure should not need maintenance unless the HR Schema model
390 -- changes.
391 --
392 -- Access Status:
393 -- Internal Row Handler Use Only.
394 --
395 -- {End Of Comments}
396 -- ----------------------------------------------------------------------------
397 Procedure dt_update_validate
398 (p_vrbl_rt_prfl_id in number default hr_api.g_number,
399 p_payroll_id in number,
400 p_datetrack_mode in varchar2,
401 p_validation_start_date in date,
402 p_validation_end_date in date) Is
403 --
404 l_proc varchar2(72) := g_package||'dt_update_validate';
405 l_integrity_error Exception;
406 l_table_name all_tables.table_name%TYPE;
407 --
408 Begin
409 hr_utility.set_location('Entering:'||l_proc, 5);
410 --
411 -- Ensure that the p_datetrack_mode argument is not null
412 --
413 hr_api.mandatory_arg_error
414 (p_api_name => l_proc,
415 p_argument => 'datetrack_mode',
416 p_argument_value => p_datetrack_mode);
417 --
418 -- Only perform the validation if the datetrack update mode is valid
419 --
420 If (dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode)) then
421 --
422 --
423 -- Ensure the arguments are not null
424 --
425 hr_api.mandatory_arg_error
426 (p_api_name => l_proc,
427 p_argument => 'validation_start_date',
428 p_argument_value => p_validation_start_date);
429 --
430 hr_api.mandatory_arg_error
431 (p_api_name => l_proc,
432 p_argument => 'validation_end_date',
433 p_argument_value => p_validation_end_date);
434 --
435 If ((nvl(p_vrbl_rt_prfl_id, hr_api.g_number) <> hr_api.g_number) and
436 NOT (dt_api.check_min_max_dates
437 (p_base_table_name => 'ben_vrbl_rt_prfl_f',
438 p_base_key_column => 'vrbl_rt_prfl_id',
439 p_base_key_value => p_vrbl_rt_prfl_id,
440 p_from_date => p_validation_start_date,
441 p_to_date => p_validation_end_date))) Then
442 l_table_name := 'ben_vrbl_rt_prfl_f';
443 Raise l_integrity_error;
444 End If;
445 --
446 --Check for Bug 3219987
447 --
448 If ((nvl(p_vrbl_rt_prfl_id, hr_api.g_number) <> hr_api.g_number) and
449 NOT (dt_api.check_min_max_dates
450 (p_base_table_name => 'pay_payrolls_f',
451 p_base_key_column => 'payroll_id',
452 p_base_key_value => p_payroll_id,
453 p_from_date => p_validation_start_date,
454 p_to_date => p_validation_end_date))) Then
455 l_table_name := 'ben_pyrl_rt_f';
456 Raise l_integrity_error;
457 End If;
458 --
459 End If;
460 --
461 hr_utility.set_location(' Leaving:'||l_proc, 10);
462 Exception
463 When l_integrity_error Then
464 --
465 -- A referential integrity check was violated therefore
466 -- we must error
467 --
468 hr_utility.set_message(801, 'HR_7216_DT_UPD_INTEGRITY_ERR');
469 hr_utility.set_message_token('TABLE_NAME', l_table_name);
470 hr_utility.raise_error;
471 When Others Then
472 --
473 -- An unhandled or unexpected error has occurred which
474 -- we must report
475 --
476 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
477 hr_utility.set_message_token('PROCEDURE', l_proc);
478 hr_utility.set_message_token('STEP','15');
479 hr_utility.raise_error;
480 End dt_update_validate;
481 --
482 -- ----------------------------------------------------------------------------
483 -- |--------------------------< dt_delete_validate >--------------------------|
484 -- ----------------------------------------------------------------------------
485 -- {Start Of Comments}
486 --
487 -- Description:
488 -- This procedure is used for referential integrity of datetracked
489 -- child entities when either a datetrack DELETE or ZAP is in operation
490 -- and where there is no cascading of delete defined for this entity.
491 -- For the datetrack mode of DELETE or ZAP we must ensure that no
492 -- datetracked child rows exist between the validation start and end
493 -- dates.
494 --
495 -- Prerequisites:
496 -- This procedure is called from the delete_validate.
497 --
498 -- In Parameters:
499 --
500 -- Post Success:
501 -- Processing continues.
502 --
503 -- Post Failure:
504 -- If a row exists by determining the returning Boolean value from the
505 -- generic dt_api.rows_exist function then we must supply an error via
506 -- the use of the local exception handler l_rows_exist.
507 --
508 -- Developer Implementation Notes:
509 -- This procedure should not need maintenance unless the HR Schema model
510 -- changes.
511 --
512 -- Access Status:
513 -- Internal Row Handler Use Only.
514 --
515 -- {End Of Comments}
516 -- ----------------------------------------------------------------------------
517 Procedure dt_delete_validate
518 (p_pyrl_rt_id in number,
519 p_datetrack_mode in varchar2,
520 p_validation_start_date in date,
521 p_validation_end_date in date) Is
522 --
523 l_proc varchar2(72) := g_package||'dt_delete_validate';
524 l_rows_exist Exception;
525 l_table_name all_tables.table_name%TYPE;
526 --
527 Begin
528 hr_utility.set_location('Entering:'||l_proc, 5);
529 --
530 -- Ensure that the p_datetrack_mode argument is not null
531 --
532 hr_api.mandatory_arg_error
533 (p_api_name => l_proc,
534 p_argument => 'datetrack_mode',
535 p_argument_value => p_datetrack_mode);
536 --
537 -- Only perform the validation if the datetrack mode is either
538 -- DELETE or ZAP
539 --
540 If (p_datetrack_mode = 'DELETE' or
541 p_datetrack_mode = 'ZAP') then
542 --
543 --
544 -- Ensure the arguments are not null
545 --
546 hr_api.mandatory_arg_error
547 (p_api_name => l_proc,
548 p_argument => 'validation_start_date',
549 p_argument_value => p_validation_start_date);
550 --
551 hr_api.mandatory_arg_error
552 (p_api_name => l_proc,
553 p_argument => 'validation_end_date',
554 p_argument_value => p_validation_end_date);
555 --
556 hr_api.mandatory_arg_error
557 (p_api_name => l_proc,
558 p_argument => 'pyrl_rt_id',
559 p_argument_value => p_pyrl_rt_id);
560 --
561 --
562 --
563 End If;
564 --
565 hr_utility.set_location(' Leaving:'||l_proc, 10);
566 Exception
567 When l_rows_exist Then
568 --
569 -- A referential integrity check was violated therefore
570 -- we must error
571 --
572 hr_utility.set_message(801, 'HR_7215_DT_CHILD_EXISTS');
573 hr_utility.set_message_token('TABLE_NAME', l_table_name);
574 hr_utility.raise_error;
575 When Others Then
576 --
577 -- An unhandled or unexpected error has occurred which
578 -- we must report
579 --
580 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
581 hr_utility.set_message_token('PROCEDURE', l_proc);
582 hr_utility.set_message_token('STEP','15');
583 hr_utility.raise_error;
584 End dt_delete_validate;
585 --
586 -- ----------------------------------------------------------------------------
587 -- |---------------------------< insert_validate >----------------------------|
588 -- ----------------------------------------------------------------------------
589 Procedure insert_validate
590 (p_rec in ben_pyr_shd.g_rec_type,
591 p_effective_date in date,
592 p_datetrack_mode in varchar2,
593 p_validation_start_date in date,
594 p_validation_end_date in date) is
595 --
596 l_proc varchar2(72) := g_package||'insert_validate';
597 --
598 Begin
599 hr_utility.set_location('Entering:'||l_proc, 5);
600 --
601 -- Call all supporting business operations
602 --
603 --
604 hr_api.validate_bus_grp_id(p_rec.business_group_id); -- Validate Bus Grp
605 --
606 chk_pyrl_rt_id
607 (p_pyrl_rt_id => p_rec.pyrl_rt_id,
608 p_effective_date => p_effective_date,
609 p_object_version_number => p_rec.object_version_number);
610 --
611 chk_excld_flag
612 (p_pyrl_rt_id => p_rec.pyrl_rt_id,
613 p_excld_flag => p_rec.excld_flag,
614 p_effective_date => p_effective_date,
615 p_object_version_number => p_rec.object_version_number);
616 --
617 chk_payroll_id
618 (p_payroll_id => p_rec.payroll_id,
619 p_business_group_id => p_rec.business_group_id,
620 p_effective_date => p_effective_date );
621 --
622 chk_dup_record
623 (p_pyrl_rt_id => p_rec.pyrl_rt_id,
624 p_payroll_id => p_rec.payroll_id,
625 p_vrbl_rt_prfl_id => p_rec.vrbl_rt_prfl_id,
626 p_effective_date => p_effective_date,
627 p_object_version_number => p_rec.object_version_number,
628 p_business_group_id => p_rec.business_group_id,
629 p_validation_start_date => p_validation_start_date,
630 p_validation_end_date => p_validation_end_date);
631 --
632 -- added for Bug 5078478 .. add this procedure to check the duplicate seq no
633
634 chk_duplicate_ordr_num
635 (p_vrbl_rt_prfl_id => p_rec.vrbl_rt_prfl_id
636 ,p_pyrl_rt_id => p_rec.pyrl_rt_id
637 ,p_ordr_num => p_rec.ordr_num
638 ,p_validation_start_date => p_validation_start_date
639 ,p_validation_end_date => p_validation_end_date
640 ,p_business_group_id => p_rec.business_group_id);
641
642
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 ben_pyr_shd.g_rec_type,
652 p_effective_date in date,
653 p_datetrack_mode in varchar2,
654 p_validation_start_date in date,
655 p_validation_end_date in date) is
656 --
657 l_proc varchar2(72) := g_package||'update_validate';
658 --
659 Begin
660 hr_utility.set_location('Entering:'||l_proc, 5);
661 --
662 -- Call all supporting business operations
663 --
664 --
665 hr_api.validate_bus_grp_id(p_rec.business_group_id); -- Validate Bus Grp
666 --
667 chk_pyrl_rt_id
668 (p_pyrl_rt_id => p_rec.pyrl_rt_id,
669 p_effective_date => p_effective_date,
670 p_object_version_number => p_rec.object_version_number);
671 --
672 chk_excld_flag
673 (p_pyrl_rt_id => p_rec.pyrl_rt_id,
674 p_excld_flag => p_rec.excld_flag,
675 p_effective_date => p_effective_date,
676 p_object_version_number => p_rec.object_version_number);
677 --
678 chk_payroll_id
679 (p_payroll_id => p_rec.payroll_id,
680 p_business_group_id => p_rec.business_group_id,
681 p_effective_date => p_effective_date );
682 --
683 chk_dup_record
684 (p_pyrl_rt_id => p_rec.pyrl_rt_id,
685 p_payroll_id => p_rec.payroll_id,
686 p_vrbl_rt_prfl_id => p_rec.vrbl_rt_prfl_id,
687 p_effective_date => p_effective_date,
688 p_object_version_number => p_rec.object_version_number,
689 p_business_group_id => p_rec.business_group_id,
690 p_validation_start_date => p_validation_start_date,
691 p_validation_end_date => p_validation_end_date);
692
693 --
694
695 -- added for Bug 5078478 .. add this procedure to check the duplicate seq no
696 chk_duplicate_ordr_num
697 (p_vrbl_rt_prfl_id => p_rec.vrbl_rt_prfl_id
698 ,p_pyrl_rt_id => p_rec.pyrl_rt_id
699 ,p_ordr_num => p_rec.ordr_num
700 ,p_validation_start_date => p_validation_start_date
701 ,p_validation_end_date => p_validation_end_date
702 ,p_business_group_id => p_rec.business_group_id);
703
704
705 --
706 -- Call the datetrack update integrity operation
707 --
708 dt_update_validate
709 (p_vrbl_rt_prfl_id => p_rec.vrbl_rt_prfl_id,
710 p_payroll_id => p_rec.payroll_id,
711 p_datetrack_mode => p_datetrack_mode,
712 p_validation_start_date => p_validation_start_date,
713 p_validation_end_date => p_validation_end_date);
714 --
715
716
717 --
718 hr_utility.set_location(' Leaving:'||l_proc, 10);
719 End update_validate;
720 --
721 -- ----------------------------------------------------------------------------
722 -- |---------------------------< delete_validate >----------------------------|
723 -- ----------------------------------------------------------------------------
724 Procedure delete_validate
725 (p_rec in ben_pyr_shd.g_rec_type,
726 p_effective_date in date,
727 p_datetrack_mode in varchar2,
728 p_validation_start_date in date,
729 p_validation_end_date in date) is
730 --
731 l_proc varchar2(72) := g_package||'delete_validate';
732 --
733 Begin
734 hr_utility.set_location('Entering:'||l_proc, 5);
735 --
736 -- Call all supporting business operations
737 --
738 dt_delete_validate
739 (p_datetrack_mode => p_datetrack_mode,
740 p_validation_start_date => p_validation_start_date,
741 p_validation_end_date => p_validation_end_date,
742 p_pyrl_rt_id => p_rec.pyrl_rt_id);
743 --
744 hr_utility.set_location(' Leaving:'||l_proc, 10);
745 End delete_validate;
746 --
747 --
748 -- ---------------------------------------------------------------------------
749 -- |---------------------< return_legislation_code >-------------------------|
750 -- ---------------------------------------------------------------------------
751 --
752 function return_legislation_code
753 (p_pyrl_rt_id in number) return varchar2 is
754 --
755 -- Declare cursor
756 --
757 cursor csr_leg_code is
758 select a.legislation_code
759 from per_business_groups a,
760 ben_pyrl_rt_f b
761 where b.pyrl_rt_id = p_pyrl_rt_id
762 and a.business_group_id = b.business_group_id;
763 --
764 -- Declare local variables
765 --
766 l_legislation_code varchar2(150);
767 l_proc varchar2(72) := g_package||'return_legislation_code';
768 --
769 begin
770 --
771 hr_utility.set_location('Entering:'|| l_proc, 10);
772 --
773 -- Ensure that all the mandatory parameter are not null
774 --
775 hr_api.mandatory_arg_error(p_api_name => l_proc,
776 p_argument => 'pyrl_rt_id',
777 p_argument_value => p_pyrl_rt_id);
778 --
779 open csr_leg_code;
780 --
781 fetch csr_leg_code into l_legislation_code;
782 --
783 if csr_leg_code%notfound then
784 --
785 close csr_leg_code;
786 --
787 -- The primary key is invalid therefore we must error
788 --
789 hr_utility.set_message(801,'HR_7220_INVALID_PRIMARY_KEY');
790 hr_utility.raise_error;
791 --
792 end if;
793 --
794 close csr_leg_code;
795 --
796 hr_utility.set_location(' Leaving:'|| l_proc, 20);
797 --
798 return l_legislation_code;
799 --
800 end return_legislation_code;
801 --
802 end ben_pyr_bus;