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