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