1 Package Body hr_nmf_bus as
2 /* $Header: hrnmfrhi.pkb 120.0 2005/05/31 01:34 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' hr_nmf_bus.'; -- Global package name
9 g_debug boolean := hr_utility.debug_enabled;
10 --
11 -- The following two global variables are only to be
12 -- used by the return_legislation_code function.
13 --
14 g_legislation_code varchar2(150) default null;
15 g_name_format_id number default null;
16 --
17 --
18 -- ---------------------------------------------------------------------------
19 -- |---------------------< return_legislation_code >-------------------------|
20 -- ---------------------------------------------------------------------------
21 --
22 Function return_legislation_code
23 (p_name_format_id in number
24 )
25 Return Varchar2 Is
26 --
27 -- Declare cursor
28 --
29 cursor csr_leg_code is
30 select nmf.legislation_code
31 from hr_name_formats nmf
32 where nmf.name_format_id = p_name_format_id;
33 --
34 -- Declare local variables
35 --
36 l_legislation_code varchar2(150);
37 l_proc varchar2(72) := g_package||'return_legislation_code';
38 --
39 Begin
40 --
41 if g_debug then
42 hr_utility.set_location('Entering:'|| l_proc, 10);
43 end if;
44 --
45 -- Ensure that all the mandatory parameter are not null
46 --
47 hr_api.mandatory_arg_error
48 (p_api_name => l_proc
49 ,p_argument => 'name_format_id'
50 ,p_argument_value => p_name_format_id
51 );
52 --
53 if ( nvl(hr_nmf_bus.g_name_format_id, hr_api.g_number)
54 = p_name_format_id) then
55 --
56 -- The legislation code has already been found with a previous
57 -- call to this function. Just return the value in the global
58 -- variable.
59 --
60 l_legislation_code := hr_nmf_bus.g_legislation_code;
61 if g_debug then
62 hr_utility.set_location(l_proc, 20);
63 end if;
64 else
65 --
66 -- The ID is different to the last call to this function
67 -- or this is the first call to this function.
68 --
69 open csr_leg_code;
70 fetch csr_leg_code into l_legislation_code;
71 --
72 if csr_leg_code%notfound then
73 --
74 -- The primary key is invalid therefore we must error
75 --
76 close csr_leg_code;
77 fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
78 fnd_message.raise_error;
79 end if;
80 if g_debug then
81 hr_utility.set_location(l_proc,30);
82 end if;
83 --
84 -- Set the global variables so the values are
85 -- available for the next call to this function.
86 --
87 close csr_leg_code;
88 hr_nmf_bus.g_name_format_id := p_name_format_id;
89 hr_nmf_bus.g_legislation_code := l_legislation_code;
90 end if;
91 if g_debug then
92 hr_utility.set_location(' Leaving:'|| l_proc, 40);
93 end if;
94 return l_legislation_code;
95 end return_legislation_code;
96 --
97 -- ---------------------------------------------------------------------------
98 -- |------------------------< chk_delete >----------------------------|
99 -- ---------------------------------------------------------------------------
100 --
101 -- Description:
102 -- Validates that rows may be deleted from per_all_people_f
103 --
104 -- Pre-conditions:
105 -- None
106 --
107 -- In Arguments:
108 -- p_name_format_id
109 --
110 -- Post Success:
111 -- If a row may be deleted then
112 -- processing continues
113 --
114 -- Post Failure:
115 -- If row is seeded an application error will be raised and processing
116 -- is terminated.
117 --
118 -- Access Status:
119 -- Internal Table Handler Use Only.
120 --
121 Procedure chk_delete(p_name_format_id in hr_name_formats.name_format_id%TYPE
122 ) IS
123 --
124 l_proc varchar2(72) := g_package || 'chk_delete';
125 l_created_by hr_name_formats.created_by%TYPE;
126 --
127 cursor csr_get_created_by(p_id hr_name_formats.name_format_id%TYPE) is
128 select created_by
129 from hr_name_formats
130 where name_format_id = p_id;
131 --
132 Begin
133 --
134 if g_debug then
135 hr_utility.set_location('Entering:'||l_proc, 10);
136 end if;
137 --
138 -- Raise error if row is seeded
139 --
140 open csr_get_created_by(p_name_format_id);
141 fetch csr_get_created_by into l_created_by;
142 close csr_get_created_by;
143 if l_created_by is not null and l_created_by = 2 then
144 fnd_message.set_name('PER','HR_449576_SEED_NMF_DEL');
145 fnd_message.raise_error;
146 end if;
147 --
148 if g_debug then
149 hr_utility.set_location('Leaving:'||l_proc, 100);
150 end if;
151 End chk_delete;
152 --
153 -- ----------------------------------------------------------------------------
154 -- |-----------------------< chk_non_updateable_args >------------------------|
155 -- ----------------------------------------------------------------------------
156 -- {Start Of Comments}
157 --
158 -- Description:
159 -- This procedure is used to ensure that non updateable attributes have
160 -- not been updated. If an attribute has been updated an error is generated.
161 --
162 -- Pre Conditions:
163 -- g_old_rec has been populated with details of the values currently in
164 -- the database.
165 --
166 -- In Arguments:
167 -- p_rec has been populated with the updated values the user would like the
168 -- record set to.
169 --
170 -- Post Success:
171 -- Processing continues if all the non updateable attributes have not
172 -- changed.
173 --
174 -- Post Failure:
175 -- An application error is raised if any of the non updatable attributes
176 -- have been altered.
177 --
178 -- {End Of Comments}
179 -- ----------------------------------------------------------------------------
180 Procedure chk_non_updateable_args
181 (p_effective_date in date
182 ,p_rec in hr_nmf_shd.g_rec_type
183 ) IS
184 --
185 l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
186 l_argument varchar2(30);
187 l_error exception;
188 --
189 Begin
190 --
191 if g_debug then
192 hr_utility.set_location('Entering:'||l_proc, 10);
193 end if;
194 --
195 -- Only proceed with the validation if a row exists for the current
196 -- record in the HR Schema.
197 --
198 IF NOT hr_nmf_shd.api_updating
199 (p_name_format_id => p_rec.name_format_id
200 ,p_object_version_number => p_rec.object_version_number
201 ) THEN
202 fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
203 fnd_message.set_token('PROCEDURE ', l_proc);
204 fnd_message.set_token('STEP ', '5');
205 fnd_message.raise_error;
206 END IF;
207 --
208 if nvl(p_rec.format_name,hr_api.g_varchar2) <> hr_nmf_shd.g_old_rec.format_name then
209 l_argument := 'format_name';
210 raise l_error;
211 end if;
212 --
213 if g_debug then
214 hr_utility.set_location(l_proc, 20);
215 end if;
216 --
217 if nvl(p_rec.legislation_code, hr_api.g_varchar2) <>
218 nvl(hr_nmf_shd.g_old_rec.legislation_code ,hr_api.g_varchar2)
219 then
220 l_argument := 'legislation_code';
221 raise l_error;
222 end if;
223 --
224 if g_debug then
225 hr_utility.set_location(l_proc, 30);
226 end if;
227 --
228 if nvl(p_rec.user_format_choice,hr_api.g_varchar2) <>
229 hr_nmf_shd.g_old_rec.user_format_choice then
230 l_argument := 'user_format_choice';
231 raise l_error;
232 end if;
233 --
234 if g_debug then
235 hr_utility.set_location(' Leaving:'||l_proc, 100);
236 end if;
237 exception
238 when l_error then
239 hr_api.argument_changed_error
240 (p_api_name => l_proc
241 ,p_argument => l_argument
242 );
243 when others then
244 raise;
245
246 End chk_non_updateable_args;
247 --
248 --
249 -- -----------------------------------------------------------------
250 -- |-----------------< chk_name_format_id >------------------------|
251 -- -----------------------------------------------------------------
252 --
253 -- Description:
254 -- Check that the name_format_id is not null.
255 --
256 -- Pre-Requisites:
257 -- None
258 --
259 -- In Parameters:
260 -- p_name_format_id
261 --
262 -- Post Success:
263 -- Processing continues if the name_format_id is valid.
264 --
265 -- Post Failure:
266 -- An application error is raised and processing is terminated if
267 -- the name_format_id is invalid.
268 --
269 -- Access Status:
270 -- Internal Row Handler Use Only.
271 --
272 Procedure chk_name_format_id
273 (p_name_format_id in hr_name_formats.name_format_id%TYPE
274 ) is
275 --
276 -- Local declarations
277 l_proc varchar2(72) := g_package||' chk_name_format_id';
278 l_name_format_id number;
279 --
280 begin
281 if g_debug then
282 hr_utility.set_location('Entering: '||l_proc,5);
283 end if;
284 --
285 -----------------------------------
286 -- Check name format id not null --
287 -----------------------------------
288 hr_api.mandatory_arg_error
289 (p_api_name => l_proc,
290 p_argument => 'p_name_format_id',
291 p_argument_value => p_name_format_id);
292 --
293 if g_debug then
294 hr_utility.set_location('Leaving: '||l_proc,10);
295 end if;
296 end chk_name_format_id;
297 --
298 -- -----------------------------------------------------------------
299 -- |--------------------< chk_format_name >------------------------|
300 -- -----------------------------------------------------------------
301 --
302 -- Description:
303 -- Check that the format_name exists in FND_LOOKUP_VALUES.
304 --
305 -- Pre-Requisites:
306 -- None
307 --
308 -- In Parameters:
309 -- p_format_name
310 --
311 -- Post Success:
312 -- Processing continues if the format_name is valid.
313 --
314 -- Post Failure:
315 -- An application error is raised and processing is terminated if
316 -- the format_name is invalid.
317 --
318 -- Access Status:
319 -- Internal Row Handler Use Only.
320 --
321 Procedure chk_format_name
322 (p_name_format_id in hr_name_formats.name_format_id%TYPE
323 ,p_format_name in hr_name_formats.format_name%TYPE
324 ,p_object_version_number in hr_name_formats.object_version_number%TYPE
325 ,p_effective_date in date
326 ) is
327 --
328 -- Local declarations
329 l_proc varchar2(72) := g_package||' chk_format_name';
330 l_api_updating boolean;
331 --
332 begin
333 if g_debug then
334 hr_utility.set_location('Entering: '||l_proc,5);
335 end if;
336 --
337 -- Check mandatory parameters have been set
338 --
339 hr_api.mandatory_arg_error
340 (p_api_name => l_proc
341 ,p_argument => 'effective date'
342 ,p_argument_value => p_effective_date
343 );
344 --
345 hr_api.mandatory_arg_error
346 (p_api_name => l_proc,
347 p_argument => 'format name',
348 p_argument_value => p_format_name);
349 --
350 l_api_updating := hr_nmf_shd.api_updating
351 (p_name_format_id => p_name_format_id
352 ,p_object_version_number => p_object_version_number
353 );
354 --
355 if ((l_api_updating and
356 hr_nmf_shd.g_old_rec.format_name <> p_format_name) or
357 (not l_api_updating)) then
358 --
359 if hr_api.not_exists_in_hrstanlookups
360 (p_effective_date => p_effective_date
361 ,p_lookup_type => 'PER_NAME_FORMATS'
362 ,p_lookup_code => p_format_name) then
363 --
364 fnd_message.set_name('PER', 'HR_449575_FORMAT_NAME_INV');
365 fnd_message.raise_error;
366 end if;
367 end if;
368 --
369 if g_debug then
370 hr_utility.set_location('Leaving: '||l_proc,70);
371 end if;
372 --
373 Exception
374 when app_exception.application_exception then
375 if hr_multi_message.exception_add
376 (p_associated_column1 => 'HR_NAME_FORMATS.FORMAT_NAME') then
377 if g_debug then
378 hr_utility.set_location(' Leaving:'||l_proc, 80);
379 end if;
380 raise;
381 end if;
382 if g_debug then
383 hr_utility.set_location(' Leaving:'||l_proc,90);
384 end if;
385 end chk_format_name;
386 --
387 --
388 -- -----------------------------------------------------------------
389 -- |-----------------< chk_legislation_code >----------------------|
390 -- -----------------------------------------------------------------
391 --
392 -- Description:
393 -- Check if legislation code is not null, that the value exists in
394 -- FND_TERRITORIES table.
395 --
396 -- Pre-Requisites:
397 -- None
398 --
399 -- In Parameters:
400 -- p_legislation_code
401 --
402 -- Post Success:
403 -- Processing continues if the legislation_code is valid.
404 --
405 -- Post Failure:
406 -- An application error is raised and processing is terminated if
407 -- the legislation_code is invalid.
408 --
409 -- Access Status:
410 -- Internal Row Handler Use Only.
411 --
412 Procedure chk_legislation_code(p_legislation_code in hr_name_formats.legislation_code%TYPE) is
413 --
414 -- Local declarations
415 l_proc varchar2(72) := g_package||' chk_legislation_code';
416 l_value varchar2(240) := 'DUMMY';
417 --
418 begin
419 if g_debug then
420 hr_utility.set_location('Entering:'||l_proc, 5);
421 end if;
422 --
423 IF p_legislation_code IS NOT NULL THEN
424 l_value := hr_general.DECODE_TERRITORY(P_TERRITORY_CODE => p_legislation_code);
425
426 IF l_value IS NULL then
427 fnd_message.set_name('PER','PER_449075_CAL_LEG_CODE');
428 fnd_message.raise_error;
429 END IF;
430 --
431 END IF;
432 --
433 if g_debug then
434 hr_utility.set_location('Leaving:'||l_proc, 70);
435 end if;
436 --
437 Exception
438 when app_exception.application_exception then
439 if hr_multi_message.exception_add
440 (p_associated_column1 => 'HR_NAME_FORMATS.LEGISLATION_CODE') then
441 if g_debug then
442 hr_utility.set_location(' Leaving:'||l_proc, 80);
443 end if;
444 raise;
445 end if;
446 if g_debug then
447 hr_utility.set_location(' Leaving:'||l_proc,90);
448 end if;
449 end chk_legislation_code;
450 --
451 -- -----------------------------------------------------------------
452 -- |-----------------< chk_user_format_choice >----------------------|
453 -- -----------------------------------------------------------------
454 --
455 -- Description:
456 -- Check that the user_format_choice exists in fnd_lookup_values.
457 -- The only acceptable values are 'G' and 'L'.
458 -- If format_name is DISPLAY_NAME or LIST_NAME then this is mandatory.
459 -- If format_name is FULL_NAME or ORDER_NAME then user_format_choice
460 -- must be 'L'.
461 --
462 -- Pre-Requisites:
463 -- None
464 --
465 -- In Parameters:
466 -- p_user_format_choice
467 -- p_format_name
468 -- p_effective_date
469 --
470 -- Post Success:
471 -- Processing continues if the user_format_choice is valid.
472 --
473 -- Post Failure:
474 -- An application error is raised and processing is terminated if
475 -- the user_format_choice is invalid.
476 --
477 -- Access Status:
478 -- Internal Row Handler Use Only.
479 --
480 Procedure chk_user_format_choice
481 (p_user_format_choice in hr_name_formats.user_format_choice%TYPE
482 ,p_format_name in hr_name_formats.format_name%TYPE
483 ,p_effective_date in date) is
484
485 --
486 -- Local declarations
487 l_proc varchar2(72) := g_package||' chk_user_format_choice';
488 --
489 begin
490 if g_debug then
491 hr_utility.set_location('Entering:'||l_proc, 5);
492 end if;
493 --
494 -- Check mandatory parameters have been set
495 --
496 hr_api.mandatory_arg_error
497 (p_api_name => l_proc
498 ,p_argument => 'effective date'
499 ,p_argument_value => p_effective_date
500 );
501 --
502 hr_api.mandatory_arg_error
503 (p_api_name => l_proc
504 ,p_argument => 'user format choice'
505 ,p_argument_value => p_user_format_choice
506 );
507 --
508 hr_api.mandatory_arg_error
509 (p_api_name => l_proc
510 ,p_argument => 'format name'
511 ,p_argument_value => p_format_name
512 );
513 --
514 if g_debug then
515 hr_utility.set_location(l_proc, 10);
516 end if;
517 --
518 if p_user_format_choice is not null then
519 --
520 -- validate the formart choice represents a valid lookup
521 --
522 if hr_api.not_exists_in_hrstanlookups
523 (p_effective_date => p_effective_date
524 ,p_lookup_type => 'PER_NAME_FORMAT_CHOICE'
525 ,p_lookup_code => p_user_format_choice) then
526
527 fnd_message.set_name('PER', 'HR_449571_FORMAT_CHOICE_INV');
528 fnd_message.raise_error;
529 elsif p_user_format_choice not in ('G','L') then
530 --
531 -- ensure it only uses 'G' or 'L'
532 --
533 fnd_message.set_name('PER', 'HR_449571_FORMAT_CHOICE_INV');
534 fnd_message.raise_error;
535 end if;
536 end if;
537 --
538 if p_format_name = 'DISPLAY_NAME' OR p_format_name = 'LIST_NAME' then
539 --
540 -- Ensure user_format_choice is not null
541 --
542 hr_api.mandatory_arg_error
543 (p_api_name => l_proc,
544 p_argument => 'p_user_format_choice',
545 p_argument_value => p_user_format_choice);
546 end if;
547 --
548 if (p_format_name = 'FULL_NAME' OR p_format_name = 'ORDER_NAME')
549 AND (p_user_format_choice is not null and p_user_format_choice <> 'L') then
550 --
551 fnd_message.set_name('PER', 'HR_449572_FORMAT_CHOICE_INV');
552 fnd_message.raise_error;
553 end if;
554 --
555 if g_debug then
556 hr_utility.set_location('Leaving:'||l_proc, 70);
557 end if;
558 Exception
559 when app_exception.application_exception then
560 if hr_multi_message.exception_add
561 (p_associated_column1 => 'HR_NAME_FORMATS.USER_FORMAT_CHOICE') then
562 if g_debug then
563 hr_utility.set_location(' Leaving:'||l_proc, 80);
564 end if;
565 raise;
566 end if;
567 if g_debug then
568 hr_utility.set_location(' Leaving:'||l_proc,90);
569 end if;
570 End chk_user_format_choice;
571 --
572 -- -----------------------------------------------------------------
573 -- |---------------------< chk_format_mask >-----------------------|
574 -- -----------------------------------------------------------------
575 --
576 -- Description:
577 -- Check that the format_mask does not contain invalid tokens.
578 -- Valid tokens are stored in FND_LOOKUP_VALUES table
579 -- where LOOKUP TYPE = 'PER_FORMAT_MASK_TOKENS'
580 --
581 -- The format mask has been stored as follows:
582 -- [prefix] space $TOKEN space [suffix]
583 --
584 -- []: indicates argument is optional
585 -- Also, it can contain several occurrences of the above syntax:
586 -- [prefix] space $TOKEN space [suffix] space $TOKEN
587 --
588 -- Pre-Requisites:
589 -- None
590 --
591 -- In Parameters:
592 -- p_format_mask
593 -- p_effective_date
594 --
595 -- Post Success:
596 -- Processing continues if the format_mask is valid.
597 --
598 -- Post Failure:
599 -- An application error is raised and processing is terminated if
600 -- the format_mask is invalid.
601 --
602 -- Access Status:
603 -- Internal Row Handler Use Only.
604 --
605 Procedure chk_format_mask
606 (p_format_mask in hr_name_formats.format_mask%TYPE
607 ,p_effective_date in date) is
608 --
609 -- Local declarations
610 l_proc varchar2(72) := g_package||' chk_format_mask';
611 l_format hr_name_formats.format_mask%TYPE;
612 l_token_start_pos number;
613 l_token_end_pos number;
614 l_token fnd_lookup_values.lookup_code%TYPE;
615 --
616 begin
617 if g_debug then
618 hr_utility.set_location('Entering:'||l_proc, 5);
619 end if;
620 --
621 -- Check mandatory parameters have been set
622 --
623 hr_api.mandatory_arg_error
624 (p_api_name => l_proc
625 ,p_argument => 'effective date'
626 ,p_argument_value => p_effective_date
627 );
628 --
629 l_format := p_format_mask;
630 if l_format is null then
631 fnd_message.set_name('PER','HR_449604_NMF_NULL_MASK');
632 fnd_message.raise_error;
633 end if;
634 --
635 -- Verify a token might exist
636 -- Minimum required syntax: '|$token$|' where min(length(token)) = 1
637 --
638 l_token_start_pos := instr(l_format,'$');
639 if l_token_start_pos = 0 or length(l_format) < 5 then
640 fnd_message.set_name('PER','HR_449573_FORMAT_MASK_INV');
641 fnd_message.raise_error;
642 end if;
643 while l_format is not null loop
644 l_token_start_pos := instr(l_format,'$')+1;
645 --
646 if (l_token_start_pos-1) > 0 then
647 l_token_end_pos := instr(l_format,'$',l_token_start_pos);
648 if nvl(l_token_end_pos,0) <> 0 then
649 l_token := substr(l_format,l_token_start_pos, l_token_end_pos - l_token_start_pos);
650 l_format := substr(l_format,l_token_end_pos+1);
651 else
652 l_token := substr(l_format,l_token_start_pos);
653 l_format := null;
654 end if;
655 if l_token is null then
656 fnd_message.set_name('PER','HR_449573_FORMAT_MASK_INV');
657 fnd_message.raise_error;
658 else
659 if hr_api.not_exists_in_hrstanlookups
660 (p_effective_date => p_effective_date
661 ,p_lookup_type => 'PER_FORMAT_MASK_TOKENS'
662 ,p_lookup_code => l_token) then
663 --
664 fnd_message.set_name('PER','HR_449573_FORMAT_MASK_INV');
665 fnd_message.raise_error;
666 end if;
667 end if;
668 else
669 l_format := null;
670 end if;
671 end loop;
672 --
673 if g_debug then
674 hr_utility.set_location(' Leaving:'||l_proc,70);
675 end if;
676 Exception
677 when app_exception.application_exception then
678 if hr_multi_message.exception_add
679 (p_associated_column1 => 'HR_NAME_FORMATS.FORMAT_MASK') then
680 if g_debug then
681 hr_utility.set_location(' Leaving:'||l_proc, 80);
682 end if;
683 raise;
684 end if;
685 if g_debug then
686 hr_utility.set_location(' Leaving:'||l_proc,90);
687 end if;
688
689 End chk_format_mask;
690 --
691 -- -----------------------------------------------------------------
692 -- |--------------< chk_format_and_legislation >-------------------|
693 -- -----------------------------------------------------------------
694 --
695 -- Description:
696 -- Check that the combination of format_name, legislation code and
697 -- user format choice is unique.
698 --
699 -- Pre-Requisites:
700 -- None
701 --
702 -- In Parameters:
703 -- p_format_name
704 -- p_legislation_code
705 -- p_user_format_choice
706 --
707 -- Post Success:
708 -- Processing continues if combination of all three parameters is valid.
709 --
710 -- Post Failure:
711 -- An application error is raised and processing is terminated if
712 -- the combination of all three parameters is invalid.
713 --
714 -- Access Status:
715 -- Internal Row Handler Use Only.
716 --
717 Procedure chk_format_and_legislation
718 (p_format_name in hr_name_formats.format_name%TYPE
719 ,p_legislation_code in hr_name_formats.legislation_code%TYPE
720 ,p_user_format_choice in hr_name_formats.user_format_choice%TYPE
721 ) is
722 --
723 -- Local declarations
724 l_proc varchar2(72) := g_package||' chk_format_and_legislation';
725 l_value_exists varchar2(10);
726 --
727 cursor csr_validate_combination(p_format_name varchar2
728 ,p_leg_code varchar2
729 ,p_user_choice varchar2) is
730 select 'Y'
731 from HR_NAME_FORMATS
732 where format_name = p_format_name
733 and (p_leg_code is null and legislation_code is null
734 or p_leg_code is not null and legislation_code = p_leg_code)
735 and user_format_choice = p_user_choice;
736 --
737 Begin
738 if g_debug then
739 hr_utility.set_location('Entering:'||l_proc, 5);
740 end if;
741 --
742 -- Check mandatory parameters have been set
743 --
744 hr_api.mandatory_arg_error
745 (p_api_name => l_proc
746 ,p_argument => 'format name'
747 ,p_argument_value => p_format_name
748 );
749 hr_api.mandatory_arg_error
750 (p_api_name => l_proc
751 ,p_argument => 'user format choice'
752 ,p_argument_value => p_user_format_choice
753 );
754 open csr_validate_combination(p_format_name,p_legislation_code,p_user_format_choice);
755 fetch csr_validate_combination into l_value_exists;
756 if csr_validate_combination%FOUND then
757 close csr_validate_combination;
758 fnd_message.set_name('PER','HR_449574_NAME_LEG_INV');
759 fnd_message.raise_error;
760 else
761 close csr_validate_combination;
762 end if;
763 if g_debug then
764 hr_utility.set_location(' Leaving:'||l_proc,70);
765 end if;
766 Exception
767 when app_exception.application_exception then
768 if hr_multi_message.exception_add
769 (p_associated_column1 => 'HR_NAME_FORMATS.FORMAT_NAME'
770 ,p_associated_column2 => 'HR_NAME_FORMATS.LEGISLATION_CODE'
771 ,p_associated_column3 => 'HR_NAME_FORMATS.USER_FORMAT_CHOICE') then
772 if g_debug then
773 hr_utility.set_location(' Leaving:'||l_proc, 80);
774 end if;
775 raise;
776 end if;
777 if g_debug then
778 hr_utility.set_location(' Leaving:'||l_proc,90);
779 end if;
780
781 End chk_format_and_legislation;
782 --
783 -- ----------------------------------------------------------------------------
784 -- |---------------------------< insert_validate >----------------------------|
785 -- ----------------------------------------------------------------------------
786 Procedure insert_validate
787 (p_effective_date in date
788 ,p_rec in hr_nmf_shd.g_rec_type
789 ) is
790 --
791 l_proc varchar2(72) := g_package||'insert_validate';
792 --
793 Begin
794 if g_debug then
795 hr_utility.set_location('Entering:'||l_proc, 5);
796 end if;
797 --
798 -- Call all supporting business operations
799 --
800 -- No business group context. HR_STANDARD_LOOKUPS used for validation.
801 --
802 -- Validate format name
803 --
804 chk_format_name
805 (p_name_format_id => p_rec.name_format_id
806 ,p_format_name => p_rec.format_name
807 ,p_object_version_number => p_rec.object_version_number
808 ,p_effective_date => p_effective_date);
809 if g_debug then
810 hr_utility.set_location(l_proc, 20);
811 end if;
812 --
813 -- Validate legislation code
814 --
815 chk_legislation_code(p_legislation_code => p_rec.legislation_code);
816 if g_debug then
817 hr_utility.set_location(l_proc, 30);
818 end if;
819 --
820 -- Validate user format choice
821 --
822 chk_user_format_choice
823 (p_user_format_choice => p_rec.user_format_choice
824 ,p_format_name => p_rec.format_name
825 ,p_effective_date => p_effective_date);
826 --
827 if g_debug then
828 hr_utility.set_location(l_proc, 40);
829 end if;
830 --
831 -- Validate format mask
832 --
833 chk_format_mask(p_format_mask => p_rec.format_mask
834 ,p_effective_date => p_effective_date);
835 --
836 if g_debug then
837 hr_utility.set_location(l_proc, 50);
838 end if;
839 --
840 -- Validate format name, legislation code and user format choice
841 --
842 chk_format_and_legislation
843 (p_format_name => p_rec.format_name
844 ,p_legislation_code => p_rec.legislation_code
845 ,p_user_format_choice => p_rec.user_format_choice);
846 --
847 --
848 if g_debug then
849 hr_utility.set_location(' Leaving:'||l_proc, 100);
850 end if;
851 End insert_validate;
852 --
853 -- ----------------------------------------------------------------------------
854 -- |---------------------------< update_validate >----------------------------|
855 -- ----------------------------------------------------------------------------
856 Procedure update_validate
857 (p_effective_date in date
858 ,p_rec in hr_nmf_shd.g_rec_type
859 ) is
860 --
861 l_proc varchar2(72) := g_package||'update_validate';
862 --
863 Begin
864 if g_debug then
865 hr_utility.set_location('Entering:'||l_proc, 5);
866 end if;
867 --
868 -- Call all supporting business operations
869 --
870 -- No business group context. HR_STANDARD_LOOKUPS used for validation.
871 --
872 -- Validate Dependent Attributes
873 --
874 chk_non_updateable_args
875 (p_effective_date => p_effective_date
876 ,p_rec => p_rec
877 );
878 --
879 if g_debug then
880 hr_utility.set_location(l_proc, 30);
881 end if;
882 --
883 -- Validate format mask
884 --
885 chk_format_mask(p_format_mask => p_rec.format_mask
886 ,p_effective_date => p_effective_date);
887 --
888 if g_debug then
889 hr_utility.set_location(l_proc, 50);
890 end if;
891 --
892 if g_debug then
893 hr_utility.set_location(' Leaving:'||l_proc, 100);
894 end if;
895 End update_validate;
896 --
897 -- ----------------------------------------------------------------------------
898 -- |---------------------------< delete_validate >----------------------------|
899 -- ----------------------------------------------------------------------------
900 Procedure delete_validate
901 (p_rec in hr_nmf_shd.g_rec_type
902 ) is
903 --
904 l_proc varchar2(72) := g_package||' delete_validate';
905 --
906 Begin
907 if g_debug then
908 hr_utility.set_location('Entering:'||l_proc, 5);
909 end if;
910 --
911 -- Call all supporting business operations
912 --
913 chk_delete(p_name_format_id => p_rec.name_format_id);
914 --
915 if g_debug then
916 hr_utility.set_location(' Leaving:'||l_proc, 10);
917 end if;
918 End delete_validate;
919 --
920 end hr_nmf_bus;