[Home] [Help]
PACKAGE BODY: APPS.BEN_RCL_BUS
Source
1 Package Body ben_rcl_bus as
2 /* $Header: berclrhi.pkb 115.13 2004/06/30 23:53:24 hmani ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_rcl_bus.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------< chk_rltd_per_chg_cs_ler_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 -- rltd_per_chg_cs_ler_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_rltd_per_chg_cs_ler_id(p_rltd_per_chg_cs_ler_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_rltd_per_chg_cs_ler_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_rcl_shd.api_updating
49 (p_effective_date => p_effective_date,
50 p_rltd_per_chg_cs_ler_id => p_rltd_per_chg_cs_ler_id,
51 p_object_version_number => p_object_version_number);
52 --
53 if (l_api_updating
54 and nvl(p_rltd_per_chg_cs_ler_id,hr_api.g_number)
55 <> ben_rcl_shd.g_old_rec.rltd_per_chg_cs_ler_id) then
56 --
57 -- raise error as PK has changed
58 --
59 ben_rcl_shd.constraint_error('BEN_RLTD_PER_CHG_CS_LER_F_PK');
60 --
61 elsif not l_api_updating then
62 --
63 -- check if PK is null
64 --
65 if p_rltd_per_chg_cs_ler_id is not null then
66 --
67 -- raise error as PK is not null
68 --
69 ben_rcl_shd.constraint_error('BEN_RLTD_PER_CHG_CS_LER_F_PK');
70 --
71 end if;
72 --
73 end if;
74 --
75 hr_utility.set_location('Leaving:'||l_proc, 10);
76 --
77 End chk_rltd_per_chg_cs_ler_id;
78 --
79 -- ----------------------------------------------------------------------------
80 -- |------< chk_rltd_per_chg_cs_ler_rl >------|
81 -- ----------------------------------------------------------------------------
82 --
83 -- Description
84 -- This procedure is used to check that the Formula Rule is valid.
85 --
86 -- Pre Conditions
87 -- None.
88 --
89 -- In Parameters
90 -- rltd_per_chg_cs_ler_id PK of record being inserted or updated.
91 -- rltd_per_chg_cs_ler_rl Value of formula rule id.
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_rltd_per_chg_cs_ler_rl(p_rltd_per_chg_cs_ler_id in number,
106 p_rltd_per_chg_cs_ler_rl in number,
107 p_business_group_id in number,
108 p_effective_date in date,
109 p_object_version_number in number) is
110 --
111 l_proc varchar2(72) := g_package||'chk_rltd_per_chg_cs_ler_rl';
112 l_api_updating boolean;
113 l_dummy varchar2(1);
114 --
115 cursor c1 is
116 select null
117 from ff_formulas_f ff
118 ,per_business_groups pbg
119 where ff.formula_id = p_rltd_per_chg_cs_ler_rl
120 and ff.formula_type_id = -168 -- Person Information Causes Life Event
121 and pbg.business_group_id = p_business_group_id
122 and nvl(ff.business_group_id, p_business_group_id) = p_business_group_id
123 and nvl(ff.legislation_code, pbg.legislation_code) = pbg.legislation_code
124 and p_effective_date
125 between ff.effective_start_date
126 and ff.effective_end_date;
127 --
128 Begin
129 --
130 hr_utility.set_location('Entering:'||l_proc, 5);
131 --
132 l_api_updating := ben_rcl_shd.api_updating
133 (p_rltd_per_chg_cs_ler_id => p_rltd_per_chg_cs_ler_id,
134 p_effective_date => p_effective_date,
135 p_object_version_number => p_object_version_number);
136 --
137 if (l_api_updating
138 and nvl(p_rltd_per_chg_cs_ler_rl,hr_api.g_number)
139 <> ben_rcl_shd.g_old_rec.rltd_per_chg_cs_ler_rl
140 or not l_api_updating)
141 and p_rltd_per_chg_cs_ler_rl is not null then
142 --
143 -- check if value of formula rule is valid.
144 --
145 open c1;
146 --
147 -- fetch value from cursor if it returns a record then the
148 -- formula is valid otherwise its invalid
149 --
150 fetch c1 into l_dummy;
151 if c1%notfound then
152 --
153 close c1;
154 --
155 -- raise error
156 --
157 fnd_message.set_name('BEN','BEN_91007_INVALID_RULE');
158 fnd_message.raise_error;
159 --
160 end if;
161 --
162 close c1;
163 --
164 end if;
165 --
166 hr_utility.set_location('Leaving:'||l_proc,10);
167 --
168 end chk_rltd_per_chg_cs_ler_rl;
169 --
170 -- ----------------------------------------------------------------------------
171 -- |------< chk_table_column_val >------|
172 -- ----------------------------------------------------------------------------
173 --
174 -- Description
175 -- This procedure is used to check that the source table and source
176 -- column are entered and that the combo of table, column, new_value, and
177 -- old_value is unique
178 --
179 -- Pre Conditions
180 -- None.
181 --
182 -- In Parameters
183 -- rltd_per_chg_cs_ler_id PK of record being inserted or updated.
184 -- source_table table name selected
185 -- source_column column name selected
186 -- new_val New value being entered. When this value is detected
187 -- in this table.column, a database trigger should fire
188 -- that checks for life events to be created for the person
189 -- to which the data change is happening.
190 -- old_val Old value being entered. When this value is detected
191 -- in this table.column (pre-change), a database trigger
192 -- should fire
193 -- that checks for life events to be created for the person
194 -- to which the data change is happening.
195 -- object_version_number Object version number of record being
196 -- inserted or updated.
197 --
198 -- Post Success
199 -- Processing continues
200 --
201 -- Post Failure
202 -- Errors handled by the procedure
203 --
204 -- Access Status
205 -- Internal table handler use only.
206 --
207 Procedure chk_table_column_val(p_rltd_per_chg_cs_ler_id in number,
208 p_source_table in varchar2,
209 p_source_column in varchar2,
210 p_new_val in varchar2,
211 p_old_val in varchar2,
212 P_business_group_id in number,
213 p_effective_date in date,
214 p_object_version_number in number) is
215 --
216 CURSOR c1 (p_rltd_per_chg_cs_ler_id number
217 ,p_source_table varchar2
218 ,p_source_column varchar2
219 ,p_new_val varchar2
220 ,p_old_val varchar2
221 ,p_business_group_id number) IS
222 SELECT 'x'
223 FROM ben_rltd_per_chg_cs_ler_f
224 WHERE rltd_per_chg_cs_ler_id <> nvl(p_rltd_per_chg_cs_ler_id,
225 hr_api.g_number)
226 AND source_table = p_source_table
227 AND source_column = p_source_column
228 AND new_val = nvl(p_new_val, hr_api.g_varchar2)
229 AND old_val = nvl(p_old_val, hr_api.g_varchar2)
230 AND business_group_id + 0 = p_business_group_id
231 AND p_effective_date between effective_start_date
232 AND effective_end_date;
233 --
234 l_proc varchar2(72) := g_package||'chk_table_column_val';
235 l_api_updating boolean;
236 l_dummy varchar2(1);
237 --
238 Begin
239 --
240 hr_utility.set_location('Entering:'||l_proc, 5);
241 --
242 if p_source_table is null then
243 fnd_message.set_name('BEN', 'BEN_91020_TABLE_REQUIRED');
244 fnd_message.raise_error;
245 elsif p_source_column is null then
246 fnd_message.set_name('BEN', 'BEN_91021_COLUMN_REQUIRED');
247 fnd_message.raise_error;
248 else
249 -- check if table, column, new value, old value is unique
250 --
251 open c1
252 (p_rltd_per_chg_cs_ler_id => p_rltd_per_chg_cs_ler_id
253 ,p_source_table => p_source_table
254 ,p_source_column => p_source_column
255 ,p_new_val => p_new_val
256 ,p_old_val => p_old_val
257 ,p_business_group_id => p_business_group_id) ;
258 fetch c1 into l_dummy;
259 if c1%found then
260 close c1;
261 fnd_message.set_name('BEN', 'BEN_91017_PERSON_CHANGE_UNIQUE');
262 fnd_message.raise_error;
263 end if;
264 close c1;
265 end if;
266 --
267 hr_utility.set_location('Leaving:'||l_proc, 10);
268 --
269 End chk_table_column_val;
270 --
271 -- ----------------------------------------------------------------------------
272 -- |------< chk_name_unique >------|
273 -- ----------------------------------------------------------------------------
274 --
275 -- Description
276 -- This procedure is used to check that the name is unique
277 --
278 -- Pre Conditions
279 -- None.
280 --
281 -- In Parameters
282 -- rltd_per_chg_cs_ler_id PK of record being inserted or updated.
283 -- old_val Name being entered.
284 -- object_version_number Object version number of record being
285 -- inserted or updated.
286 --
287 -- Post Success
288 -- Processing continues
289 --
290 -- Post Failure
291 -- Errors handled by the procedure
292 --
293 -- Access Status
294 -- Internal table handler use only.
295 --
296 Procedure chk_name_unique(p_rltd_per_chg_cs_ler_id in number,
297 p_name in varchar2,
298 P_business_group_id in number,
299 p_effective_date in date,
300 p_object_version_number in number) is
301 --
302 CURSOR c1 (p_rltd_per_chg_cs_ler_id number
303 ,p_name varchar2
304 ,p_business_group_id number) IS
305 SELECT 'x'
306 FROM ben_rltd_per_chg_cs_ler_f
307 WHERE rltd_per_chg_cs_ler_id <> nvl(p_rltd_per_chg_cs_ler_id,
308 hr_api.g_number)
309 AND name = nvl(p_name, hr_api.g_varchar2)
310 AND business_group_id + 0 = p_business_group_id
311 AND p_effective_date between effective_start_date
312 AND effective_end_date;
313 --
314 l_proc varchar2(72) := g_package||'chk_name_unique';
315 l_api_updating boolean;
316 l_dummy varchar2(1);
317 --
318 Begin
319 --
320 hr_utility.set_location('Entering:'||l_proc, 5);
321 --
322 -- check name is unique
323 --
324 open c1
325 (p_rltd_per_chg_cs_ler_id => p_rltd_per_chg_cs_ler_id
326 ,p_name => p_name
327 ,p_business_group_id => p_business_group_id) ;
328 fetch c1 into l_dummy;
329 if c1%found then
330 close c1;
331 fnd_message.set_name('BEN', 'BEN_91009_NAME_NOT_UNIQUE');
332 fnd_message.raise_error;
333 end if;
334 close c1;
335 --
336 hr_utility.set_location('Leaving:'||l_proc, 10);
337 --
338 End chk_name_unique;
339 --
340 --
341 -- ----------------------------------------------------------------------------
342 -- |------< chk_whatif_lbl_unique >------|
343 -- ----------------------------------------------------------------------------
344 --
345 -- Description
346 -- This procedure is used to check that the whatif label is unique.
347 --
348 -- Pre Conditions
349 -- None.
350 --
351 -- In Parameters
352 -- p_rltd_per_chg_cs_ler_id PK of record being inserted or updated.
353 -- whatif_lbl What If Label being entered.
354 -- effective_date
355 --
356 -- Post Success
357 -- Processing continues
358 --
359 -- Post Failure
360 -- Errors handled by the procedure
361 --
362 -- Access Status
363 -- Internal table handler use only.
364 --
365 Procedure chk_whatif_lbl_unique( p_rltd_per_chg_cs_ler_id in number,
366 p_whatif_lbl_txt in varchar2,
367 p_business_group_id in number,
368 p_effective_date in date) is
369 --
370 CURSOR c1 (p_rltd_per_chg_cs_ler_id number
371 ,p_whatif_lbl_txt varchar2
372 ,p_effective_date date
373 ,p_business_group_id number) IS
374 SELECT 'x'
375 FROM ben_rltd_per_chg_cs_ler_f
376 WHERE whatif_lbl_txt = p_whatif_lbl_txt
377 and rltd_per_chg_cs_ler_id <> nvl(p_rltd_per_chg_cs_ler_id,
378 hr_api.g_number)
379 AND business_group_id + 0 = p_business_group_id
380 AND p_effective_date between effective_start_date
381 AND effective_end_date;
382 --
383 l_proc varchar2(72) := g_package||'chk_whatif_lbl_unique';
384 l_api_updating boolean;
385 l_dummy varchar2(1);
386 --
387 Begin
388 --
389 hr_utility.set_location('Entering:'||l_proc, 5);
390 --
391 -- check what if label is unique
392 --
393 if p_whatif_lbl_txt is not null then
394 hr_utility.set_location(' What IF Label is not null'||l_proc, 5);
395 open c1(p_rltd_per_chg_cs_ler_id => p_rltd_per_chg_cs_ler_id
396 ,p_whatif_lbl_txt => p_whatif_lbl_txt
397 ,p_effective_date => p_effective_date
398 ,p_business_group_id => p_business_group_id) ;
399 fetch c1 into l_dummy;
400 if c1%found then
401 close c1;
402 fnd_message.set_name('BEN', 'BEN_94013_WHATIF_LBL_UNIQUE');
403 fnd_message.raise_error;
404 end if;
405 close c1;
406 --
407 end if;
408 hr_utility.set_location('Leaving:'||l_proc, 10);
409 --
410 End chk_whatif_lbl_unique;
411 --
412 -- ----------------------------------------------------------------------------
413 -- |--------------------------< dt_update_validate >--------------------------|
414 -- ----------------------------------------------------------------------------
415 -- {Start Of Comments}
416 --
417 -- Description:
418 -- This procedure is used for referential integrity of datetracked
419 -- parent entities when a datetrack update operation is taking place
420 -- and where there is no cascading of update defined for this entity.
421 --
422 -- Prerequisites:
423 -- This procedure is called from the update_validate.
424 --
425 -- In Parameters:
426 --
427 -- Post Success:
428 -- Processing continues.
429 --
430 -- Post Failure:
431 --
432 -- Developer Implementation Notes:
433 -- This procedure should not need maintenance unless the HR Schema model
434 -- changes.
435 --
436 -- Access Status:
437 -- Internal Row Handler Use Only.
438 --
439 -- {End Of Comments}
440 -- ----------------------------------------------------------------------------
441 Procedure dt_update_validate
442 (
443 p_datetrack_mode in varchar2,
444 p_validation_start_date in date,
445 p_validation_end_date in date) Is
446 --
447 l_proc varchar2(72) := g_package||'dt_update_validate';
448 l_integrity_error Exception;
449 l_table_name all_tables.table_name%TYPE;
450 --
451 Begin
452 hr_utility.set_location('Entering:'||l_proc, 5);
453 --
454 -- Ensure that the p_datetrack_mode argument is not null
455 --
456 hr_api.mandatory_arg_error
457 (p_api_name => l_proc,
458 p_argument => 'datetrack_mode',
459 p_argument_value => p_datetrack_mode);
460 --
461 -- Only perform the validation if the datetrack update mode is valid
462 --
463 If (dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode)) then
464 --
465 --
466 -- Ensure the arguments are not null
467 --
468 hr_api.mandatory_arg_error
469 (p_api_name => l_proc,
470 p_argument => 'validation_start_date',
471 p_argument_value => p_validation_start_date);
472 --
473 hr_api.mandatory_arg_error
474 (p_api_name => l_proc,
475 p_argument => 'validation_end_date',
476 p_argument_value => p_validation_end_date);
477 --
478 --
479 --
480 End If;
481 --
482 hr_utility.set_location(' Leaving:'||l_proc, 10);
483 Exception
484 When l_integrity_error Then
485 --
486 -- A referential integrity check was violated therefore
487 -- we must error
488 --
489 ben_utility.parent_integrity_error(p_table_name => l_table_name);
490 When Others Then
491 --
492 -- An unhandled or unexpected error has occurred which
493 -- we must report
494 --
495 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
496 fnd_message.set_token('PROCEDURE', l_proc);
497 fnd_message.set_token('STEP','15');
498 fnd_message.raise_error;
499 End dt_update_validate;
500 --
501 -- ----------------------------------------------------------------------------
502 -- |--------------------------< dt_delete_validate >--------------------------|
503 -- ----------------------------------------------------------------------------
504 -- {Start Of Comments}
505 --
506 -- Description:
507 -- This procedure is used for referential integrity of datetracked
508 -- child entities when either a datetrack DELETE or ZAP is in operation
509 -- and where there is no cascading of delete defined for this entity.
510 -- For the datetrack mode of DELETE or ZAP we must ensure that no
511 -- datetracked child rows exist between the validation start and end
512 -- dates.
513 --
514 -- Prerequisites:
515 -- This procedure is called from the delete_validate.
516 --
517 -- In Parameters:
518 --
519 -- Post Success:
520 -- Processing continues.
521 --
522 -- Post Failure:
523 -- If a row exists by determining the returning Boolean value from the
524 -- generic dt_api.rows_exist function then we must supply an error via
525 -- the use of the local exception handler l_rows_exist.
526 --
527 -- Developer Implementation Notes:
528 -- This procedure should not need maintenance unless the HR Schema model
529 -- changes.
530 --
531 -- Access Status:
532 -- Internal Row Handler Use Only.
533 --
534 -- {End Of Comments}
535 -- ----------------------------------------------------------------------------
536 Procedure dt_delete_validate
537 (p_rltd_per_chg_cs_ler_id in number,
538 p_datetrack_mode in varchar2,
539 p_validation_start_date in date,
540 p_validation_end_date in date) Is
541 --
542 l_proc varchar2(72) := g_package||'dt_delete_validate';
543 l_rows_exist Exception;
544 l_table_name all_tables.table_name%TYPE;
545 --
546 Begin
547 hr_utility.set_location('Entering:'||l_proc, 5);
548 --
549 -- Ensure that the p_datetrack_mode argument is not null
550 --
551 hr_api.mandatory_arg_error
552 (p_api_name => l_proc,
553 p_argument => 'datetrack_mode',
554 p_argument_value => p_datetrack_mode);
555 --
556 -- Only perform the validation if the datetrack mode is either
557 -- DELETE or ZAP
558 --
559 If (p_datetrack_mode = 'DELETE' or
560 p_datetrack_mode = 'ZAP') then
561 --
562 --
563 -- Ensure the arguments are not null
564 --
565 hr_api.mandatory_arg_error
566 (p_api_name => l_proc,
567 p_argument => 'validation_start_date',
568 p_argument_value => p_validation_start_date);
569 --
570 hr_api.mandatory_arg_error
571 (p_api_name => l_proc,
572 p_argument => 'validation_end_date',
573 p_argument_value => p_validation_end_date);
574 --
575 hr_api.mandatory_arg_error
576 (p_api_name => l_proc,
577 p_argument => 'rltd_per_chg_cs_ler_id',
578 p_argument_value => p_rltd_per_chg_cs_ler_id);
579 --
580 If (dt_api.rows_exist
581 (p_base_table_name => 'ben_ler_rltd_per_cs_ler_f',
582 p_base_key_column => 'rltd_per_chg_cs_ler_id',
583 p_base_key_value => p_rltd_per_chg_cs_ler_id,
584 p_from_date => p_validation_start_date,
585 p_to_date => p_validation_end_date)) Then
586 l_table_name := 'ben_ler_rltd_per_cs_ler_f';
587 Raise l_rows_exist;
588 End If;
589 --
590 End If;
591 --
592 hr_utility.set_location(' Leaving:'||l_proc, 10);
593 Exception
594 When l_rows_exist Then
595 --
596 -- A referential integrity check was violated therefore
597 -- we must error
598 --
599 ben_utility.child_exists_error(p_table_name => l_table_name);
600 When Others Then
601 --
602 -- An unhandled or unexpected error has occurred which
603 -- we must report
604 --
605 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
606 fnd_message.set_token('PROCEDURE', l_proc);
607 fnd_message.set_token('STEP','15');
608 fnd_message.raise_error;
609 End dt_delete_validate;
610 --
611 -- ----------------------------------------------------------------------------
612 -- |---------------------------< insert_validate >----------------------------|
613 -- ----------------------------------------------------------------------------
614 Procedure insert_validate
615 (p_rec in ben_rcl_shd.g_rec_type,
616 p_effective_date in date,
617 p_datetrack_mode in varchar2,
618 p_validation_start_date in date,
619 p_validation_end_date in date) is
620 --
621 l_proc varchar2(72) := g_package||'insert_validate';
622 --
623 Begin
624 hr_utility.set_location('Entering:'||l_proc, 5);
625 --
626 -- Call all supporting business operations
627 --
628 --
629 hr_api.validate_bus_grp_id(p_rec.business_group_id); -- Validate Bus Grp
630 --
631 chk_rltd_per_chg_cs_ler_id
632 (p_rltd_per_chg_cs_ler_id => p_rec.rltd_per_chg_cs_ler_id,
633 p_effective_date => p_effective_date,
634 p_object_version_number => p_rec.object_version_number);
635 --
636 chk_rltd_per_chg_cs_ler_rl
637 (p_rltd_per_chg_cs_ler_id => p_rec.rltd_per_chg_cs_ler_id,
638 p_rltd_per_chg_cs_ler_rl => p_rec.rltd_per_chg_cs_ler_rl,
639 p_business_group_id => p_rec.business_group_id,
640 p_effective_date => p_effective_date,
641 p_object_version_number => p_rec.object_version_number);
642 --
643 chk_table_column_val
644 (p_rltd_per_chg_cs_ler_id => p_rec.rltd_per_chg_cs_ler_id,
645 p_source_table => p_rec.source_table,
646 p_source_column => p_rec.source_column,
647 p_new_val => p_rec.new_val,
648 p_old_val => p_rec.old_val,
649 p_business_group_id => p_rec.business_group_id,
650 p_effective_date => p_effective_date,
651 p_object_version_number => p_rec.object_version_number);
652 --
653 chk_name_unique
654 (p_rltd_per_chg_cs_ler_id => p_rec.rltd_per_chg_cs_ler_id,
655 p_name => p_rec.name,
656 p_business_group_id => p_rec.business_group_id,
657 p_effective_date => p_effective_date,
658 p_object_version_number => p_rec.object_version_number);
659 --
660 chk_whatif_lbl_unique
661 (p_rltd_per_chg_cs_ler_id => p_rec.rltd_per_chg_cs_ler_id,
662 p_whatif_lbl_txt => p_rec.whatif_lbl_txt,
663 p_business_group_id => p_rec.business_group_id,
664 p_effective_date => p_effective_date);
665 --
666 hr_utility.set_location(' Leaving:'||l_proc, 10);
667 End insert_validate;
668 --
669 -- ----------------------------------------------------------------------------
670 -- |---------------------------< update_validate >----------------------------|
671 -- ----------------------------------------------------------------------------
672 Procedure update_validate
673 (p_rec in ben_rcl_shd.g_rec_type,
674 p_effective_date in date,
675 p_datetrack_mode in varchar2,
676 p_validation_start_date in date,
677 p_validation_end_date in date) is
678 --
679 l_proc varchar2(72) := g_package||'update_validate';
680 --
681 Begin
682 hr_utility.set_location('Entering:'||l_proc, 5);
683 --
684 -- Call all supporting business operations
685 --
686 --
687 hr_api.validate_bus_grp_id(p_rec.business_group_id); -- Validate Bus Grp
688 --
689 chk_rltd_per_chg_cs_ler_id
690 (p_rltd_per_chg_cs_ler_id => p_rec.rltd_per_chg_cs_ler_id,
691 p_effective_date => p_effective_date,
692 p_object_version_number => p_rec.object_version_number);
693 --
694 chk_rltd_per_chg_cs_ler_rl
695 (p_rltd_per_chg_cs_ler_id => p_rec.rltd_per_chg_cs_ler_id,
696 p_rltd_per_chg_cs_ler_rl => p_rec.rltd_per_chg_cs_ler_rl,
697 p_business_group_id => p_rec.business_group_id,
698 p_effective_date => p_effective_date,
699 p_object_version_number => p_rec.object_version_number);
700 --
701 chk_table_column_val
702 (p_rltd_per_chg_cs_ler_id => p_rec.rltd_per_chg_cs_ler_id,
703 p_source_table => p_rec.source_table,
704 p_source_column => p_rec.source_column,
705 p_new_val => p_rec.new_val,
706 p_old_val => p_rec.old_val,
707 p_business_group_id => p_rec.business_group_id,
708 p_effective_date => p_effective_date,
709 p_object_version_number => p_rec.object_version_number);
710 --
711 chk_name_unique
712 (p_rltd_per_chg_cs_ler_id => p_rec.rltd_per_chg_cs_ler_id,
713 p_name => p_rec.name,
714 p_business_group_id => p_rec.business_group_id,
715 p_effective_date => p_effective_date,
716 p_object_version_number => p_rec.object_version_number);
717 --
718 --
719 chk_whatif_lbl_unique
720 (p_rltd_per_chg_cs_ler_id => p_rec.rltd_per_chg_cs_ler_id,
721 p_whatif_lbl_txt => p_rec.whatif_lbl_txt,
722 p_business_group_id => p_rec.business_group_id,
723 p_effective_date => p_effective_date);
724 --
725 -- Call the datetrack update integrity operation
726 --
727 dt_update_validate
728 (
729 p_datetrack_mode => p_datetrack_mode,
730 p_validation_start_date => p_validation_start_date,
731 p_validation_end_date => p_validation_end_date);
732 --
733 hr_utility.set_location(' Leaving:'||l_proc, 10);
734 End update_validate;
735 --
736 -- ----------------------------------------------------------------------------
737 -- |---------------------------< delete_validate >----------------------------|
738 -- ----------------------------------------------------------------------------
739 Procedure delete_validate
740 (p_rec in ben_rcl_shd.g_rec_type,
741 p_effective_date in date,
742 p_datetrack_mode in varchar2,
743 p_validation_start_date in date,
744 p_validation_end_date in date) is
745 --
746 l_proc varchar2(72) := g_package||'delete_validate';
747 --
748 Begin
749 hr_utility.set_location('Entering:'||l_proc, 5);
750 --
751 -- Call all supporting business operations
752 --
753 dt_delete_validate
754 (p_datetrack_mode => p_datetrack_mode,
755 p_validation_start_date => p_validation_start_date,
756 p_validation_end_date => p_validation_end_date,
757 p_rltd_per_chg_cs_ler_id => p_rec.rltd_per_chg_cs_ler_id);
758 --
759 hr_utility.set_location(' Leaving:'||l_proc, 10);
760 End delete_validate;
761 --
762 --
763 -- ---------------------------------------------------------------------------
764 -- |---------------------< return_legislation_code >-------------------------|
765 -- ---------------------------------------------------------------------------
766 --
767 function return_legislation_code
768 (p_rltd_per_chg_cs_ler_id in number) return varchar2 is
769 --
770 -- Declare cursor
771 --
772 cursor csr_leg_code is
773 select a.legislation_code
774 from per_business_groups a,
775 ben_rltd_per_chg_cs_ler_f b
776 where b.rltd_per_chg_cs_ler_id = p_rltd_per_chg_cs_ler_id
777 and a.business_group_id = b.business_group_id;
778 --
779 -- Declare local variables
780 --
781 l_legislation_code varchar2(150);
782 l_proc varchar2(72) := g_package||'return_legislation_code';
783 --
784 begin
785 --
786 hr_utility.set_location('Entering:'|| l_proc, 10);
787 --
788 -- Ensure that all the mandatory parameter are not null
789 --
790 hr_api.mandatory_arg_error(p_api_name => l_proc,
791 p_argument => 'rltd_per_chg_cs_ler_id',
792 p_argument_value => p_rltd_per_chg_cs_ler_id);
793 --
794 open csr_leg_code;
795 --
796 fetch csr_leg_code into l_legislation_code;
797 --
798 if csr_leg_code%notfound then
799 --
800 close csr_leg_code;
801 --
802 -- The primary key is invalid therefore we must error
803 --
804 fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
805 fnd_message.raise_error;
806 --
807 end if;
808 --
809 close csr_leg_code;
810 --
811 hr_utility.set_location(' Leaving:'|| l_proc, 20);
812 --
813 return l_legislation_code;
814 --
815 end return_legislation_code;
816 --
817 end ben_rcl_bus;