DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQP_ERG_BUS

Source


1 Package Body pqp_erg_bus as
2 /* $Header: pqergrhi.pkb 115.9 2003/02/19 02:25:55 sshetty noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pqp_erg_bus.';  -- Global package name
9 --
10 -- The following two global variables are only to be
11 -- used by the return_legislation_code function.
12 --
13 g_legislation_code            varchar2(150)  default null;
14 g_exception_group_id          number         default null;
15 --
16 --  ---------------------------------------------------------------------------
17 --  |----------------------< set_security_group_id >--------------------------|
18 --  ---------------------------------------------------------------------------
19 --
20 Procedure set_security_group_id
21   (p_exception_group_id                   in number
22   ) is
23   --
24   -- Declare cursor
25   --
26   cursor csr_sec_grp is
27     select pbg.security_group_id
28       from per_business_groups pbg
29          , pqp_exception_report_groups erg
30          , pqp_exception_reports exr
31      where erg.exception_group_id = p_exception_group_id
32      and   pbg.business_group_id = exr.business_group_id
33      and   exr.exception_report_id = erg.exception_report_id;
34   --
35   -- Declare local variables
36   --
37   l_security_group_id number;
38   l_proc              varchar2(72)  :=  g_package||'set_security_group_id';
39   --
40 begin
41   --
42   hr_utility.set_location('Entering:'|| l_proc, 10);
43   --
44   -- Ensure that all the mandatory parameter are not null
45   --
46   hr_api.mandatory_arg_error
47     (p_api_name           => l_proc
48     ,p_argument           => 'exception_group_id'
49     ,p_argument_value     => p_exception_group_id
50     );
51   --
52   open csr_sec_grp;
53   fetch csr_sec_grp into l_security_group_id;
54   --
55   if csr_sec_grp%notfound then
56      --
57      close csr_sec_grp;
58      --
59      -- The primary key is invalid therefore we must error
60      --
61      fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
62      fnd_message.raise_error;
63      --
64   end if;
65   close csr_sec_grp;
66   --
67   -- Set the security_group_id in CLIENT_INFO
68   --
69   hr_api.set_security_group_id
70     (p_security_group_id => l_security_group_id
71     );
72   --
73   hr_utility.set_location(' Leaving:'|| l_proc, 20);
74   --
75 end set_security_group_id;
76 --
77 --  ---------------------------------------------------------------------------
78 --  |---------------------< return_legislation_code >-------------------------|
79 --  ---------------------------------------------------------------------------
80 --
81 Function return_legislation_code
82   (p_exception_group_id                   in     number
83   )
84   Return Varchar2 Is
85   --
86   -- Declare cursor
87   --
88   cursor csr_leg_code is
89     select pbg.legislation_code
90       from per_business_groups     pbg
91          , pqp_exception_report_groups erg
92          , pqp_exception_reports exr
93      where erg.exception_group_id = p_exception_group_id
94      and   exr.exception_report_id = erg.exception_report_id
95      and   pbg.business_group_id = exr.business_group_id;
96   --
97   -- Declare local variables
98   --
99   l_legislation_code  varchar2(150);
100   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
101   --
102 Begin
103   --
104   hr_utility.set_location('Entering:'|| l_proc, 10);
105   --
106   -- Ensure that all the mandatory parameter are not null
107   --
108   hr_api.mandatory_arg_error
109     (p_api_name           => l_proc
110     ,p_argument           => 'exception_group_id'
111     ,p_argument_value     => p_exception_group_id
112     );
113   --
114   if ( nvl(pqp_erg_bus.g_exception_group_id, hr_api.g_number)
115        = p_exception_group_id) then
116     --
117     -- The legislation code has already been found with a previous
118     -- call to this function. Just return the value in the global
119     -- variable.
120     --
121     l_legislation_code := pqp_erg_bus.g_legislation_code;
122     hr_utility.set_location(l_proc, 20);
123   else
124     --
125     -- The ID is different to the last call to this function
126     -- or this is the first call to this function.
127     --
128     open csr_leg_code;
129     fetch csr_leg_code into l_legislation_code;
130     --
131     if csr_leg_code%notfound then
132       --
133       -- The primary key is invalid therefore we must error
134       --
135       close csr_leg_code;
136       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
137       fnd_message.raise_error;
138     end if;
139     hr_utility.set_location(l_proc,30);
140     --
141     -- Set the global variables so the values are
142     -- available for the next call to this function.
143     --
144     close csr_leg_code;
145     pqp_erg_bus.g_exception_group_id          := p_exception_group_id;
146     pqp_erg_bus.g_legislation_code  := l_legislation_code;
147   end if;
148   hr_utility.set_location(' Leaving:'|| l_proc, 40);
149   return l_legislation_code;
150 end return_legislation_code;
151 --
152 -- ----------------------------------------------------------------------------
153 -- |-----------------------< chk_non_updateable_args >------------------------|
154 -- ----------------------------------------------------------------------------
155 -- {Start Of Comments}
156 --
157 -- Description:
158 --   This procedure is used to ensure that non updateable attributes have
159 --   not been updated. If an attribute has been updated an error is generated.
160 --
161 -- Pre Conditions:
162 --   g_old_rec has been populated with details of the values currently in
163 --   the database.
164 --
165 -- In Arguments:
166 --   p_rec has been populated with the updated values the user would like the
167 --   record set to.
168 --
169 -- Post Success:
170 --   Processing continues if all the non updateable attributes have not
171 --   changed.
172 --
173 -- Post Failure:
174 --   An application error is raised if any of the non updatable attributes
175 --   have been altered.
176 --
177 -- {End Of Comments}
178 -- ----------------------------------------------------------------------------
179 Procedure chk_non_updateable_args
180   (p_rec in pqp_erg_shd.g_rec_type
181   ) IS
182 --
183   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
184   l_error    EXCEPTION;
185   l_argument varchar2(30);
186 --
187 Begin
188   --
189   -- Only proceed with the validation if a row exists for the current
190   -- record in the HR Schema.
191   --
192   IF NOT pqp_erg_shd.api_updating
193       (p_exception_group_id                   => p_rec.exception_group_id
194       ,p_object_version_number                => p_rec.object_version_number
195       ) THEN
196      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
197      fnd_message.set_token('PROCEDURE ', l_proc);
198      fnd_message.set_token('STEP ', '5');
199      fnd_message.raise_error;
200   END IF;
201   --
202   IF nvl(p_rec.business_group_id, hr_api.g_number) <>
203        nvl (pqp_erg_shd.g_old_rec.business_group_id, hr_api.g_number) THEN
204      l_argument := 'business_group_id';
205      RAISE l_error;
206   END IF;
207 
208   --
209   EXCEPTION
210     WHEN l_error THEN
211        hr_api.argument_changed_error
212          (p_api_name => l_proc
213          ,p_argument => l_argument);
214     WHEN OTHERS THEN
215        RAISE;
216 End chk_non_updateable_args;
217 --
218 -- ----------------------------------------------------------------------------
219 -- |----------------------< chk_startup_action >------------------------------|
220 -- ----------------------------------------------------------------------------
221 --
222 -- Description:
223 --  This procedure will check that the current action is allowed according
224 --  to the current startup mode.
225 --
226 -- ----------------------------------------------------------------------------
227 PROCEDURE chk_startup_action
228   (p_insert               IN boolean
229   ,p_business_group_id    IN number
230   ,p_legislation_code     IN varchar2
231   ,p_legislation_subgroup IN varchar2 DEFAULT NULL) IS
232 --
233 BEGIN
234   --
235   -- Call the supporting procedure to check startup mode
236   IF (p_insert) THEN
237     hr_startup_data_api_support.chk_startup_action
238       (p_generic_allowed   => TRUE
239       ,p_startup_allowed   => TRUE
240       ,p_user_allowed      => TRUE
241       ,p_business_group_id => p_business_group_id
242       ,p_legislation_code  => p_legislation_code
243       ,p_legislation_subgroup => p_legislation_subgroup
244       );
245   ELSE
246     hr_startup_data_api_support.chk_upd_del_startup_action
247       (p_generic_allowed   => TRUE
248       ,p_startup_allowed   => TRUE
249       ,p_user_allowed      => TRUE
250       ,p_business_group_id => p_business_group_id
251       ,p_legislation_code  => p_legislation_code
252       ,p_legislation_subgroup => p_legislation_subgroup
253       );
254   END IF;
255   --
256 END chk_startup_action;
257 --
258 --
259 -- ----------------------------------------------------------------------------
260 -- |------< chk_exception_report_id >-----------------------------------------|
261 -- ----------------------------------------------------------------------------
262 --
263 -- Description
264 --   This procedure checks that a referenced foreign key actually exists
265 --   in the referenced table.
266 --
267 -- Pre-Conditions
268 --   None.
269 --
270 -- In Parameters
271 --   p_exception_group_id PK
272 --   p_exception_report_id ID of FK column
273 --   p_object_version_number object version number
274 --
275 -- Post Success
276 --   Processing continues
277 --
278 -- Post Failure
279 --   Error raised.
280 --
281 -- Access Status
282 --   Internal table handler use only.
283 --
284 Procedure chk_exception_report_id (p_exception_group_id		in number
285 				  ,p_exception_report_id	in number
286 				  ,p_object_version_number	in number
287 				  ) is
288   --
289   l_proc         varchar2(72) := g_package||'chk_exception_report_id';
290   l_api_updating boolean;
291   l_dummy        varchar2(1);
292   --
293   cursor c1 is
294     select null
295     from   pqp_exception_reports a
296     where  a.exception_report_id = p_exception_report_id;
297   --
298 Begin
299   --
300   hr_utility.set_location('Entering:'||l_proc,5);
301   --
302   l_api_updating := pqp_erg_shd.api_updating
303      (p_exception_group_id	=> p_exception_group_id,
304       p_object_version_number	=> p_object_version_number);
305   --
306   hr_api.mandatory_arg_error
307     (p_api_name           => l_proc
308     ,p_argument           => 'EXCEPTION_REPORT_ID'
309     ,p_argument_value     => p_exception_report_id
310     );
311   --
312   if (l_api_updating
313      and nvl(p_exception_report_id,hr_api.g_number)
314      <> nvl(pqp_erg_shd.g_old_rec.exception_report_id,hr_api.g_number)
315      or not l_api_updating) and
316      p_exception_report_id is not null then
317     --
318     -- check if exception_report_id value exists in pqp_exception_reports table
319     --
320     open c1;
321       --
322       fetch c1 into l_dummy;
323       if c1%notfound then
324         --
325         close c1;
326         --
327         -- raise error as FK does not relate to PK in pqp_exception_reports
328         -- table.
329         --
330         pqp_erg_shd.constraint_error('PQP_REPORT_GROUPS_FK1');
331         --
332       end if;
333       --
334     close c1;
335     --
336   end if;
337   --
338   hr_utility.set_location('Leaving:'||l_proc,10);
339   --
340 End chk_exception_report_id;
341 --
342 --
343 -- ----------------------------------------------------------------------------
344 -- |------< chk_consolidation_set_id >-----------------------------------------|
345 -- ----------------------------------------------------------------------------
346 --
347 -- Description
348 --   This procedure checks that a referenced foreign key actually exists
349 --   in the referenced table.
350 --
351 -- Pre-Conditions
352 --   None.
353 --
354 -- In Parameters
355 --   p_exception_group_id PK
356 --   p_consolidation_set_id ID of FK column
357 --   p_business_group_id ID of business group
358 --   p_object_version_number object version number
359 --
360 -- Post Success
361 --   Processing continues
362 --
363 -- Post Failure
364 --   Error raised.
365 --
366 -- Access Status
367 --   Internal table handler use only.
368 --
369 Procedure chk_consolidation_set_id(p_exception_group_id		in number
370 				  ,p_consolidation_set_id	in number
371 				  ,p_business_group_id		in number
372 				  ,p_object_version_number	in number
373 				  ) is
374   --
375   l_proc         varchar2(72) := g_package||'chk_consolidation_set_id';
376   l_api_updating boolean;
377   l_dummy        varchar2(1);
378   --
379   cursor c1 is
380     select null
381     from   pay_consolidation_sets a
382     where  a.consolidation_set_id = p_consolidation_set_id
383       and  a.business_group_id	  = p_business_group_id;
384   --
385 Begin
386   --
387   hr_utility.set_location('Entering:'||l_proc,5);
388   --
389   l_api_updating := pqp_erg_shd.api_updating
390      (p_exception_group_id	=> p_exception_group_id,
391       p_object_version_number	=> p_object_version_number);
392   --
393   if (l_api_updating
394      and nvl(p_consolidation_set_id,hr_api.g_number)
395      <> nvl(pqp_erg_shd.g_old_rec.consolidation_set_id,hr_api.g_number)
396      or not l_api_updating) and
397      p_consolidation_set_id is not null then
398     --
399     -- check if consolidation_set_id value exists in pqp_exception_reports table
400     --
401     open c1;
402       --
403       fetch c1 into l_dummy;
404       if c1%notfound then
405         --
406         close c1;
407         --
408         -- raise error as FK does not relate to PK in pqp_exception_reports
409         -- table.
410         --
411         pqp_erg_shd.constraint_error('PQP_REPORT_GROUPS_FK2');
412         --
413       end if;
414       --
415     close c1;
416     --
417   end if;
418   --
419   hr_utility.set_location('Leaving:'||l_proc,10);
420   --
421 End chk_consolidation_set_id;
422 --
423 --
424 -- ----------------------------------------------------------------------------
425 -- |------< chk_payroll_id >-----------------------------------------|
426 -- ----------------------------------------------------------------------------
427 --
428 -- Description
429 --   This procedure checks that a referenced foreign key actually exists
430 --   in the referenced table.
431 --
432 -- Pre-Conditions
433 --   None.
434 --
435 -- In Parameters
436 --   p_exception_group_id PK
437 --   p_payroll_id ID of FK column
438 --   p_business_group_id ID of business group
439 --   p_object_version_number object version number
440 --
441 -- Post Success
442 --   Processing continues
443 --
444 -- Post Failure
445 --   Error raised.
446 --
447 -- Access Status
448 --   Internal table handler use only.
449 --
450 Procedure chk_payroll_id(p_exception_group_id		in number
451                         ,p_payroll_id			in number
452                         ,p_business_group_id		in number
453                         ,p_object_version_number	in number
454                         ) is
455   --
456   l_proc         varchar2(72) := g_package||'chk_payroll_id';
457   l_api_updating boolean;
458   l_dummy        varchar2(1);
459   --
460   cursor c1 is
461     select null
462     from   pay_payrolls_f a
463     where  a.payroll_id = p_payroll_id
464       and  a.business_group_id	  = p_business_group_id;
465   --
466 Begin
467   --
468   hr_utility.set_location('Entering:'||l_proc,5);
469   --
470   l_api_updating := pqp_erg_shd.api_updating
471      (p_exception_group_id	=> p_exception_group_id,
472       p_object_version_number	=> p_object_version_number);
473   --
474   if (l_api_updating
475      and nvl(p_payroll_id,hr_api.g_number)
476      <> nvl(pqp_erg_shd.g_old_rec.payroll_id,hr_api.g_number)
477      or not l_api_updating) and
478      p_payroll_id is not null then
479     --
480     -- check if payroll_id value exists in pqp_exception_reports table
481     --
482     open c1;
483       --
484       fetch c1 into l_dummy;
485       if c1%notfound then
486         --
487         close c1;
488         --
489         -- raise error as FK does not relate to PK in pqp_exception_reports
490         -- table.
491         --
492         pqp_erg_shd.constraint_error('PQP_REPORT_GROUPS_FK3');
493         --
494       end if;
495       --
496     close c1;
497     --
498   end if;
499   --
500   hr_utility.set_location('Leaving:'||l_proc,10);
501   --
502 End chk_payroll_id;
503 --
504 --
505 -- ----------------------------------------------------------------------------
506 -- |------------------------< chk_group_name_unique >---------------|
507 -- ----------------------------------------------------------------------------
508 --
509 -- Description
510 --   ensure that the group must have a name and it is not the same as a seeded group name
511 --
512 -- Pre Conditions
513 --   None.
514 --
515 -- In Parameters
516 --     p_exception_group_name is the group name
517 --     p_exception_group_id is exception group id
518 --     p_legislation_code
519 --
520 -- Post Success
521 --   Processing continues
522 --
523 -- Post Failure
524 --   Errors handled by the procedure
525 --
526 -- Access Status
527 --   Internal table handler use only.
528 --
529 -- ----------------------------------------------------------------------------
530 Procedure chk_group_name_unique
531            (p_exception_group_id	in number
532            ,p_exception_group_name	in   varchar2
533            ,p_business_group_id		in number
534            ) is
535 
536 l_proc	    varchar2(72) := g_package||'chk_exception_group_name_unique';
537 l_dummy    char(10);
538 l_leg_code VARCHAR2(20);
539 
540 cursor c1(p_legislation_code VARCHAR2) is select null
541                from pqp_exception_report_groups
542               Where exception_group_id <> nvl(p_exception_group_id,-1)
543                 and exception_group_name = p_exception_group_name
544                and (legislation_code is not null and
545                    legislation_code = p_legislation_code)
546 		    ;
547 cursor c2 is
548 SELECT pbg.legislation_code
549 FROM per_business_groups pbg where pbg.business_group_id=p_business_group_id;
550 --
551 Begin
552   hr_utility.set_location('Entering:'||l_proc, 5);
553   --
554   hr_api.mandatory_arg_error
555     (p_api_name           => l_proc
556     ,p_argument           => 'EXCEPTION_GROUP_NAME'
557     ,p_argument_value     => p_exception_group_name
558     );
559   --
560   open c2;
561   loop
562   fetch c2 into l_leg_code;
563   exit when c2%NOTFOUND;
564   end loop;
565   close c2;
566   open c1(l_leg_code);
567   fetch c1 into l_dummy;
568   if c1%found then
569       close c1;
570 
571       pqp_erg_shd.constraint_error('PQP_REPORT_GROUPS_NAMECHK');
572   end if;
573   --
574   hr_utility.set_location('Leaving:'||l_proc, 15);
575 End chk_group_name_unique;
576 --
577 -- ----------------------------------------------------------------------------
578 -- |------------------------< chk_comp_key_unique >---------------|
579 -- ----------------------------------------------------------------------------
580 --
581 -- Description
582 --   ensure that the group must have a name and it is not the same as a seeded group name
583 --
584 -- Pre Conditions
585 --   None.
586 --
587 -- In Parameters
588 --     p_exception_group_name is the group name
589 --     p_exception_group_id is exception group id
590 --     p_business_group_id is then Id of Business Group
591 --     p_exception_report_id is the Id from (virtual) parent record.
592 --     p_legislation_code
593 --
594 -- Post Success
595 --   Processing continues
596 --
597 -- Post Failure
598 --   Errors handled by the procedure
599 --
600 -- Access Status
601 --   Internal table handler use only.
602 --
603 -- ----------------------------------------------------------------------------
604 Procedure chk_comp_key_unique
605            (p_exception_group_id	in number
606            ,p_exception_group_name	in varchar2
607            ,p_business_group_id		in number
608            ,p_legislation_code		in varchar2
609            ,p_exception_report_id	in number
610            ) is
611 
612 l_proc	    varchar2(72) := g_package||'chk_comp_key_unique';
613 l_dummy    char(1);
614 l_legislation_code pqp_exception_report_groups.legislation_code%TYPE;
615 
616 cursor c1 is select null
617                from pqp_exception_report_groups
618               Where exception_group_id <> nvl(p_exception_group_id,-1)
619                 and exception_group_name = p_exception_group_name
620                 and exception_report_id  = p_exception_report_id
621 		and ((legislation_code is not null
622 		   	    and legislation_code = NVL(p_legislation_code,l_legislation_code))
623 		      or (business_group_id is not null
624 			    and business_group_id = p_business_group_id)
625 		    );
626 cursor c2 is
627 SELECT pbg.legislation_code
628 FROM per_business_groups pbg where pbg.business_group_id=p_business_group_id;
629 
630 --
631 Begin
632 
633   hr_utility.set_location('Entering:'||l_proc, 5);
634   --
635 open c2;
636   loop
637   fetch c2 into l_legislation_code;
638   exit when c2%NOTFOUND;
639   end loop;
640   close c2;
641 
642   open c1;
643   fetch c1 into l_dummy;
644   if c1%found then
645       close c1;
646       pqp_erg_shd.constraint_error('PQP_REPORT_GROUPS_COMPKEY');
647   end if;
648   --
649   hr_utility.set_location('Leaving:'||l_proc, 15);
650 End chk_comp_key_unique;
651 --
652 -- ----------------------------------------------------------------------------
653 -- |---------------------------< insert_validate >----------------------------|
654 -- ----------------------------------------------------------------------------
655 Procedure insert_validate
656   (p_rec                          in pqp_erg_shd.g_rec_type
657   ) is
658 --
659   l_proc  varchar2(72) := g_package||'insert_validate';
660 --
661 Begin
662   hr_utility.set_location('Entering:'||l_proc, 5);
663   --
664   -- Call all supporting business operations
665   --
666   --
667   chk_startup_action(true
668                     ,p_rec.business_group_id
669                     ,p_rec.legislation_code
670                     );
671   IF hr_startup_data_api_support.g_startup_mode NOT IN ('GENERIC','STARTUP') THEN
672      hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate bus_grp
673   END IF;
674   --
675   chk_exception_report_id (p_exception_group_id		=> p_rec.exception_group_id
676   			  ,p_exception_report_id	=> p_rec.exception_report_id
677   			  ,p_object_version_number	=> p_rec.object_version_number
678   			  );
679   --
680   chk_consolidation_set_id (p_exception_group_id	=> p_rec.exception_group_id
681   			   ,p_consolidation_set_id	=> p_rec.consolidation_set_id
682   			   ,p_business_group_id		=> p_rec.business_group_id
683   			   ,p_object_version_number	=> p_rec.object_version_number
684   			   );
685   --
686   chk_payroll_id (p_exception_group_id		=> p_rec.exception_group_id
687   		 ,p_payroll_id			=> p_rec.payroll_id
688   		 ,p_business_group_id		=> p_rec.business_group_id
689   		 ,p_object_version_number	=> p_rec.object_version_number
690   		 );
691   --
692   chk_group_name_unique (p_exception_group_id	=> p_rec.exception_group_id
693   			,p_exception_group_name	=> p_rec.exception_group_name
694   		        ,p_business_group_id	=> p_rec.business_group_id
695   			);
696   --
697   chk_comp_key_unique (p_exception_group_id	=> p_rec.exception_group_id
698   		      ,p_exception_group_name	=> p_rec.exception_group_name
699   		      ,p_business_group_id	=> p_rec.business_group_id
700   		      ,p_legislation_code	=> p_rec.legislation_code
701   		      ,p_exception_report_id	=> p_rec.exception_report_id
702   		      );
703   --
704   -- set_security_group_id(p_rec.exception_group_id);
705   --
706   hr_utility.set_location(' Leaving:'||l_proc, 10);
707 End insert_validate;
708 --
709 -- ----------------------------------------------------------------------------
710 -- |---------------------------< update_validate >----------------------------|
711 -- ----------------------------------------------------------------------------
712 Procedure update_validate
713   (p_rec                          in pqp_erg_shd.g_rec_type
714   ) is
715 --
716   l_proc  varchar2(72) := g_package||'update_validate';
717 --
718 Begin
719   hr_utility.set_location('Entering:'||l_proc, 5);
720   --
721   -- Call all supporting business operations
722   --
723   chk_startup_action(false
724                     ,p_rec.business_group_id
725                     ,p_rec.legislation_code
726                     );
727   IF hr_startup_data_api_support.g_startup_mode NOT IN ('GENERIC','STARTUP') THEN
728      hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate bus_grp
729   END IF;
730   --
731 
732   -- set_security_group_id(p_rec.exception_group_id);
733   --
734   chk_non_updateable_args
735       (p_rec              => p_rec
736     );
737   --
738   chk_exception_report_id (p_exception_group_id		=> p_rec.exception_group_id
739   			  ,p_exception_report_id	=> p_rec.exception_report_id
740   			  ,p_object_version_number	=> p_rec.object_version_number
741   			  );
742   --
743   chk_consolidation_set_id (p_exception_group_id	=> p_rec.exception_group_id
744   			   ,p_consolidation_set_id	=> p_rec.consolidation_set_id
745   			   ,p_business_group_id		=> p_rec.business_group_id
746   			   ,p_object_version_number	=> p_rec.object_version_number
747   			   );
748   --
749   chk_payroll_id (p_exception_group_id		=> p_rec.exception_group_id
750   		 ,p_payroll_id			=> p_rec.payroll_id
751   		 ,p_business_group_id		=> p_rec.business_group_id
752   		 ,p_object_version_number	=> p_rec.object_version_number
753   		 );
754   --
755   chk_group_name_unique (p_exception_group_id	=> p_rec.exception_group_id
756   			,p_exception_group_name	=> p_rec.exception_group_name
757   		        ,p_business_group_id		=> p_rec.business_group_id
758   			);
759   --
760   chk_comp_key_unique (p_exception_group_id	=> p_rec.exception_group_id
761   		      ,p_exception_group_name	=> p_rec.exception_group_name
762   		      ,p_business_group_id	=> p_rec.business_group_id
763   		      ,p_legislation_code	=> p_rec.legislation_code
764   		      ,p_exception_report_id	=> p_rec.exception_report_id
765   		      );
766   --
767   hr_utility.set_location(' Leaving:'||l_proc, 10);
768 End update_validate;
769 --
770 -- ----------------------------------------------------------------------------
771 -- |---------------------------< delete_validate >----------------------------|
772 -- ----------------------------------------------------------------------------
773 Procedure delete_validate
774   (p_rec                          in pqp_erg_shd.g_rec_type
775   ) is
776 --
777   l_proc  varchar2(72) := g_package||'delete_validate';
778 --
779 Begin
780   hr_utility.set_location('Entering:'||l_proc, 5);
781   --
782   chk_startup_action(false
783                     ,pqp_erg_shd.g_old_rec.business_group_id
784                     ,pqp_erg_shd.g_old_rec.legislation_code
785                     );
786   IF hr_startup_data_api_support.g_startup_mode NOT IN ('GENERIC','STARTUP') THEN
787      hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate bus_grp
788   END IF;
789   --
790   -- Call all supporting business operations
791   --
792   hr_utility.set_location(' Leaving:'||l_proc, 10);
793 End delete_validate;
794 --
795 end pqp_erg_bus;