DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_EVC_BUS

Source


1 Package Body pay_evc_bus as
2 /* $Header: pyevcrhi.pkb 115.6 2003/05/27 17:21:31 jford noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pay_evc_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_event_value_change_id       number         default null;
15 --
16 --  ---------------------------------------------------------------------------
17 --  |----------------------< set_security_group_id >--------------------------|
18 --  ---------------------------------------------------------------------------
19 --
20 Procedure set_security_group_id
21   (p_event_value_change_id                in number
22   ,p_associated_column1                   in varchar2 default null
23   ) is
24   --
25   -- Declare cursor
26   --
27   cursor csr_sec_grp is
28     select pbg.security_group_id
29       from per_business_groups pbg
30          , pay_event_value_changes_f evc
31      where evc.event_value_change_id = p_event_value_change_id
32        and pbg.business_group_id = evc.business_group_id;
33   --
34   -- Declare local variables
35   --
36   l_security_group_id number;
37   l_proc              varchar2(72)  :=  g_package||'set_security_group_id';
38   --
39 begin
40   --
41   hr_utility.set_location('Entering:'|| l_proc, 10);
42   --
43   -- Ensure that all the mandatory parameter are not null
44   --
45   hr_api.mandatory_arg_error
46     (p_api_name           => l_proc
47     ,p_argument           => 'event_value_change_id'
48     ,p_argument_value     => p_event_value_change_id
49     );
50   --
51   open csr_sec_grp;
52   fetch csr_sec_grp into l_security_group_id;
53   --
54   if csr_sec_grp%notfound then
55      --
56      close csr_sec_grp;
57      --
58      -- The primary key is invalid therefore we must error
59      --
60      fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
61      hr_multi_message.add
62        (p_associated_column1
63          => nvl(p_associated_column1,'EVENT_VALUE_CHANGE_ID')
64        );
65      --
66   else
67     close csr_sec_grp;
68     --
69     -- Set the security_group_id in CLIENT_INFO
70     --
71     hr_api.set_security_group_id
72       (p_security_group_id => l_security_group_id
73       );
74   end if;
75   --
76   hr_utility.set_location(' Leaving:'|| l_proc, 20);
77   --
78 end set_security_group_id;
79 --
80 --  ---------------------------------------------------------------------------
81 --  |---------------------< return_legislation_code >-------------------------|
82 --  ---------------------------------------------------------------------------
83 --
84 Function return_legislation_code
85   (p_event_value_change_id                in     number
86   )
87   Return Varchar2 Is
88   --
89   -- Declare cursor
90   --
91   cursor csr_leg_code is
92     select pbg.legislation_code
93       from per_business_groups pbg
94          , pay_event_value_changes_f evc
95      where evc.event_value_change_id = p_event_value_change_id
96        and pbg.business_group_id (+) = evc.business_group_id;
97   --
98   -- Declare local variables
99   --
100   l_legislation_code  varchar2(150);
101   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
102   --
103 Begin
104   --
105   hr_utility.set_location('Entering:'|| l_proc, 10);
106   --
107   -- Ensure that all the mandatory parameter are not null
108   --
109   hr_api.mandatory_arg_error
110     (p_api_name           => l_proc
111     ,p_argument           => 'event_value_change_id'
112     ,p_argument_value     => p_event_value_change_id
113     );
114   --
115   if ( nvl(pay_evc_bus.g_event_value_change_id, hr_api.g_number)
116        = p_event_value_change_id) then
117     --
118     -- The legislation code has already been found with a previous
119     -- call to this function. Just return the value in the global
120     -- variable.
121     --
122     l_legislation_code := pay_evc_bus.g_legislation_code;
123     hr_utility.set_location(l_proc, 20);
124   else
125     --
126     -- The ID is different to the last call to this function
127     -- or this is the first call to this function.
128     --
129     open csr_leg_code;
130     fetch csr_leg_code into l_legislation_code;
131     --
132     if csr_leg_code%notfound then
133       --
134       -- The primary key is invalid therefore we must error
135       --
136       close csr_leg_code;
137       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
138       fnd_message.raise_error;
139     end if;
140     hr_utility.set_location(l_proc,30);
141     --
142     -- Set the global variables so the values are
143     -- available for the next call to this function.
144     --
145     close csr_leg_code;
146     pay_evc_bus.g_event_value_change_id       := p_event_value_change_id;
147     pay_evc_bus.g_legislation_code  := l_legislation_code;
148   end if;
149   hr_utility.set_location(' Leaving:'|| l_proc, 40);
150   return l_legislation_code;
151 end return_legislation_code;
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 pay_evc_shd.g_rec_type
183   ) IS
184 --
185   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
186   l_error    EXCEPTION;
187   l_argument varchar2(30);
188 
189 --
190 Begin
191   --
192   -- Only proceed with the validation if a row exists for the current
193   -- record in the HR Schema.
194   --
195   IF NOT pay_evc_shd.api_updating
196       (p_event_value_change_id            => p_rec.event_value_change_id
197       ,p_effective_date                   => p_effective_date
198       ,p_object_version_number            => p_rec.object_version_number
199       ) THEN
200      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
201      fnd_message.set_token('PROCEDURE ', l_proc);
202      fnd_message.set_token('STEP ', '5');
203      fnd_message.raise_error;
204   END IF;
205   --
206   -- Checks to ensure non-updateable args have
207   --   not been updated.
208   if (nvl(p_rec.event_value_change_id, hr_api.g_number) <>
209      nvl(pay_evc_shd.g_old_rec.event_value_change_id,hr_api.g_number)
210      ) then
211      l_argument := 'event_value_change_id';
212      raise l_error;
213   END IF;
214   --
215   if (nvl(p_rec.event_qualifier_id, hr_api.g_number) <>
216      nvl(pay_evc_shd.g_old_rec.event_qualifier_id,hr_api.g_number)
217      ) then
218      l_argument := 'event_qualifier_id';
219      raise l_error;
220   END IF;
221   --
222   if (nvl(p_rec.datetracked_event_id, hr_api.g_number) <>
223      nvl(pay_evc_shd.g_old_rec.datetracked_event_id,hr_api.g_number)
224      ) then
225      l_argument := 'datetracked_event_id';
226      raise l_error;
227   END IF;
228   --
229   if (nvl(p_rec.default_event, hr_api.g_varchar2) <>
230      nvl(pay_evc_shd.g_old_rec.default_event,hr_api.g_varchar2)
231      ) then
232      l_argument := 'default_event';
233      raise l_error;
234   END IF;
235   --
236   if (nvl(p_rec.qualifier_value, hr_api.g_varchar2) <>
237      nvl(pay_evc_shd.g_old_rec.qualifier_value,hr_api.g_varchar2)
238      ) then
239      l_argument := 'qualifier_value';
240      raise l_error;
241   END IF;
242   --
243   if (nvl(p_rec.business_group_id, hr_api.g_number) <>
244      nvl(pay_evc_shd.g_old_rec.business_group_id,hr_api.g_number)
245      ) then
246      l_argument := 'business_group_id';
247      raise l_error;
248   END IF;
249   --
250   if (nvl(p_rec.legislation_code, hr_api.g_varchar2) <>
251      nvl(pay_evc_shd.g_old_rec.legislation_code,hr_api.g_varchar2)
252      ) then
253      l_argument := 'legislation_code';
254      raise l_error;
255   END IF;
256   --
257   --
258 
259   --
260 End chk_non_updateable_args;
261 --
262 -- ----------------------------------------------------------------------------
263 -- |---------------------------< chk_default_event >----------------------------|
264 -- ----------------------------------------------------------------------------
265 -- {Start of comments}
266 --
267 -- Description:
268 --   This procedure validates the default value passed actually exists
269 --   in the appropriate lookup.
270 --
271 -- In Parameters:
272 --   A Pl/Sql record structure.
273 --
274 -- Post Success:
275 --   Processing continues.
276 --
277 -- Post Failure:
278 --   Error if incorrect value is being attempted to insert.
279 --
280 -- Access Status:
281 --   Internal Row Handler Use Only.
282 --
283 -- {End of comments}
284 --
285 Procedure chk_default_event
286   (p_rec                   in pay_evc_shd.g_rec_type
287   ,p_effective_date        in date
288   ,p_validation_start_date in date
289   ,p_validation_end_date   in date
290   ) is
291 --
292   l_proc  varchar2(72) := g_package||'chk_default_event';
293 --
294 Begin
295   hr_utility.set_location('Entering:'||l_proc, 5);
296   --
297   -- Check that the mandatory effective date is not null.
298   --
299   hr_api.mandatory_arg_error
300   (p_api_name       => l_proc
301   ,p_argument       => 'effective_date'
302   ,p_argument_value => p_effective_date
303   );
304   --
305   IF p_rec.business_group_id <> null then
306   --got BG so validate against hr_lookups
307      if hr_api.not_exists_in_hr_lookups
308             (p_lookup_type    => 'YES_NO',
309              p_lookup_code    => p_rec.default_event,
310              p_effective_date => p_effective_date)
311      then
312       hr_utility.set_location(' Leaving:'||l_proc, 10);
313       fnd_message.set_name('PAY', 'INVALID_LOOKUP_CODE');
314       fnd_message.set_token('LOOKUP_TYPE', 'YES_NO');
315       fnd_message.set_token('VALUE', p_rec.default_event);
316       fnd_message.raise_error;
317     end if;
318   ELSE
319     -- Validate against hr_standard_lookups as DateTracked and no bg context.
320     if hr_api.not_exists_in_dt_hrstanlookups
321        (p_effective_date         => p_effective_date
322        ,p_validation_start_date  => p_validation_start_date
323        ,p_validation_end_date    => p_validation_end_date
324        ,p_lookup_type            => 'YES_NO'
325        ,p_lookup_code            => p_rec.default_event
326        )
327     then
328       hr_utility.set_location(' Leaving:'||l_proc, 10);
329       fnd_message.set_name('PAY', 'INVALID_LOOKUP_CODE');
330       fnd_message.set_token('LOOKUP_TYPE', 'YES_NO');
331       fnd_message.set_token('VALUE', p_rec.default_event);
332       fnd_message.raise_error;
333     end if;
334   END IF;
335   hr_utility.set_location(' Leaving:'||l_proc, 20);
336 End chk_default_event;
337 
338 --
339 -- ----------------------------------------------------------------------------
340 -- |---------------------------< chk_valid_event >----------------------------|
341 -- ----------------------------------------------------------------------------
342 -- {Start of comments}
343 --
344 -- Description:
345 --   This procedure validates the valid event value passed actually exists
346 --   in the appropriate lookup.
347 --
348 -- In Parameters:
349 --   A Pl/Sql record structure. Dates
350 --
351 -- Post Success:
352 --   Processing continues.
353 --
354 -- Post Failure:
355 --   Error if incorrect value is being attempted to insert.
356 --
357 -- Access Status:
358 --   Internal Row Handler Use Only.
359 --
360 -- {End of comments}
361 --
362 Procedure chk_valid_event
363   (p_rec                   in pay_evc_shd.g_rec_type
364   ,p_effective_date        in date
365   ,p_validation_start_date in date
366   ,p_validation_end_date   in date
367   ) is
368 --
369   l_proc  varchar2(72) := g_package||'chk_valid_event';
370 --
371 Begin
372   hr_utility.set_location('Entering:'||l_proc, 5);
373   --
374   -- Check that the mandatory effective date is not null.
375   --
376   hr_api.mandatory_arg_error
377   (p_api_name       => l_proc
378   ,p_argument       => 'effective_date'
379   ,p_argument_value => p_effective_date
380   );
381 
382   IF p_rec.business_group_id <> null then
383     --got BG so validate against hr_lookups
384     if hr_api.not_exists_in_hr_lookups
385             (p_lookup_type    => 'YES_NO',
386              p_lookup_code    => p_rec.valid_event,
387              p_effective_date => p_effective_date)
388     then
389       hr_utility.set_location(' Leaving:'||l_proc, 10);
390       fnd_message.set_name('PAY', 'INVALID_LOOKUP_CODE');
391       fnd_message.set_token('LOOKUP_TYPE', 'YES_NO');
392       fnd_message.set_token('VALUE', p_rec.valid_event);
393       fnd_message.raise_error;
394     end if;
395   ELSE
396     -- Validate against hr_standard_lookups as DateTracked and no bg context.
397     if hr_api.not_exists_in_dt_hrstanlookups
398        (p_effective_date         => p_effective_date
402        ,p_lookup_code            => p_rec.valid_event
399        ,p_validation_start_date  => p_validation_start_date
400        ,p_validation_end_date    => p_validation_end_date
401        ,p_lookup_type            => 'YES_NO'
403        )
404     then
405       hr_utility.set_location(' Leaving:'||l_proc, 10);
406       fnd_message.set_name('PAY', 'INVALID_LOOKUP_CODE');
407       fnd_message.set_token('LOOKUP_TYPE', 'YES_NO');
408       fnd_message.set_token('VALUE', p_rec.valid_event);
409       fnd_message.raise_error;
410     end if;
411   END IF;
412   hr_utility.set_location(' Leaving:'||l_proc, 20);
413 End chk_valid_event;
414 
415 --
416 -- ----------------------------------------------------------------------------
417 -- |---------------------------< chk_proration_style >------------------------|
418 -- ----------------------------------------------------------------------------
419 -- {Start of comments}
420 --
421 -- Description:
422 --   This procedure validates the valid event value passed actually exists
423 --   in the appropriate lookup.
424 --
425 -- In Parameters:
426 --   A Pl/Sql record structure. Dates
427 --
428 -- Post Success:
429 --   Processing continues.
430 --
431 -- Post Failure:
432 --   Error if incorrect value is being attempted to insert.
433 --
434 -- Access Status:
435 --   Internal Row Handler Use Only.
436 --
437 -- {End of comments}
438 --
439 
440 --
441 Procedure chk_proration_style
442   (p_rec                   in pay_evc_shd.g_rec_type
443   ,p_effective_date        in date
444   ,p_validation_start_date in date
445   ,p_validation_end_date   in date
446   ) is
447 --
448   l_proc  varchar2(72) := g_package||'chk_proration_style';
449 --
450 Begin
451   hr_utility.set_location('Entering:'||l_proc, 5);
452   --
453   -- Check that the mandatory effective date is not null.
454   --
455   hr_api.mandatory_arg_error
456   (p_api_name       => l_proc
457   ,p_argument       => 'effective_date'
458   ,p_argument_value => p_effective_date
459   );
460 
461   IF p_rec.business_group_id <> null then
462     --got BG so validate against hr_lookups
463     if hr_api.not_exists_in_hr_lookups
464             (p_lookup_type    => 'PAY_PRORATION_STYLE',
465              p_lookup_code    => p_rec.proration_style,
466              p_effective_date => p_effective_date)
467     then
468       hr_utility.set_location(' Leaving:'||l_proc, 10);
469       fnd_message.set_name('PAY', 'INVALID_LOOKUP_CODE');
470       fnd_message.set_token('LOOKUP_TYPE', 'PAY_PRORATION_STYLE');
471       fnd_message.set_token('VALUE', p_rec.proration_style);
472       fnd_message.raise_error;
473     end if;
474   ELSE
475     -- Validate against hr_standard_lookups as DateTracked and no bg context.
476     if hr_api.not_exists_in_dt_hrstanlookups
477        (p_effective_date         => p_effective_date
478        ,p_validation_start_date  => p_validation_start_date
479        ,p_validation_end_date    => p_validation_end_date
480        ,p_lookup_type            => 'PAY_PRORATION_STYLE'
481        ,p_lookup_code            => p_rec.proration_style
482        )
483     then
484       hr_utility.set_location(' Leaving:'||l_proc, 10);
485       fnd_message.set_name('PAY', 'INVALID_LOOKUP_CODE');
486       fnd_message.set_token('LOOKUP_TYPE', 'PAY_PRORATION_STYLE');
487       fnd_message.set_token('VALUE', p_rec.proration_style);
488       fnd_message.raise_error;
489     end if;
490   END IF;
491   hr_utility.set_location(' Leaving:'||l_proc, 20);
492 End chk_proration_style;
493 
494 --
495 -- ----------------------------------------------------------------------------
496 -- |--------------------------< dt_update_validate >--------------------------|
497 -- ----------------------------------------------------------------------------
498 -- {Start Of Comments}
499 --
500 -- Description:
501 --   This procedure is used for referential integrity of datetracked
502 --   parent entities when a datetrack update operation is taking place
503 --   and where there is no cascading of update defined for this entity.
504 --
505 -- Prerequisites:
506 --   This procedure is called from the update_validate.
507 --
508 -- In Parameters:
509 --
510 -- Post Success:
511 --   Processing continues.
512 --
513 -- Post Failure:
514 --
515 -- Developer Implementation Notes:
516 --   This procedure should not need maintenance unless the HR Schema model
517 --   changes.
518 --
519 -- Access Status:
520 --   Internal Row Handler Use Only.
521 --
522 -- {End Of Comments}
523 -- ----------------------------------------------------------------------------
524 Procedure dt_update_validate
525   (p_event_qualifier_id            in number default hr_api.g_number
526   ,p_datetrack_mode                in varchar2
527   ,p_validation_start_date         in date
528   ,p_validation_end_date           in date
529   ) Is
530 --
531   l_proc  varchar2(72) := g_package||'dt_update_validate';
532 --
533 Begin
534   --
535   -- Ensure that the p_datetrack_mode argument is not null
536   --
537   hr_api.mandatory_arg_error
538     (p_api_name       => l_proc
542   --
539     ,p_argument       => 'datetrack_mode'
540     ,p_argument_value => p_datetrack_mode
541     );
543   -- Mode will be valid, as this is checked at the start of the upd.
544   --
545   -- Ensure the arguments are not null
546   --
547   hr_api.mandatory_arg_error
548     (p_api_name       => l_proc
549     ,p_argument       => 'validation_start_date'
550     ,p_argument_value => p_validation_start_date
551     );
552   --
553   hr_api.mandatory_arg_error
554     (p_api_name       => l_proc
555     ,p_argument       => 'validation_end_date'
556     ,p_argument_value => p_validation_end_date
557     );
558   --
559   If ((nvl(p_event_qualifier_id, hr_api.g_number) <> hr_api.g_number) and
560       NOT (dt_api.check_min_max_dates
561             (p_base_table_name => 'pay_event_qualifiers_f'
562             ,p_base_key_column => 'EVENT_QUALIFIER_ID'
563             ,p_base_key_value  => p_event_qualifier_id
564             ,p_from_date       => p_validation_start_date
565             ,p_to_date         => p_validation_end_date))) Then
566      fnd_message.set_name('PAY', 'HR_7216_DT_UPD_INTEGRITY_ERR');
567      fnd_message.set_token('TABLE_NAME','event qualifiers');
568      hr_multi_message.add
569        (p_associated_column1 => pay_evc_shd.g_tab_nam || '.EVENT_QUALIFIER_ID');
570   End If;
571   --
572 Exception
573   When Others Then
574     --
575     -- An unhandled or unexpected error has occurred which
576     -- we must report
577     --
578     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
579     fnd_message.set_token('PROCEDURE', l_proc);
580     fnd_message.set_token('STEP','15');
581     fnd_message.raise_error;
582 End dt_update_validate;
583 --
584 -- ----------------------------------------------------------------------------
585 -- |--------------------------< dt_delete_validate >--------------------------|
586 -- ----------------------------------------------------------------------------
587 -- {Start Of Comments}
588 --
589 -- Description:
590 --   This procedure is used for referential integrity of datetracked
591 --   child entities when either a datetrack DELETE or ZAP is in operation
592 --   and where there is no cascading of delete defined for this entity.
593 --   For the datetrack mode of DELETE or ZAP we must ensure that no
594 --   datetracked child rows exist between the validation start and end
595 --   dates.
596 --
597 -- Prerequisites:
598 --   This procedure is called from the delete_validate.
599 --
600 -- In Parameters:
601 --
602 -- Post Success:
603 --   Processing continues.
604 --
605 -- Post Failure:
606 --   If a row exists by determining the returning Boolean value from the
607 --   generic dt_api.rows_exist function then we must supply an error via
608 --   the use of the local exception handler l_rows_exist.
609 --
610 -- Developer Implementation Notes:
611 --   This procedure should not need maintenance unless the HR Schema model
612 --   changes.
613 --
614 -- Access Status:
615 --   Internal Row Handler Use Only.
616 --
617 -- {End Of Comments}
618 -- ----------------------------------------------------------------------------
619 Procedure dt_delete_validate
620   (p_event_value_change_id            in number
621   ,p_datetrack_mode                   in varchar2
622   ,p_validation_start_date            in date
623   ,p_validation_end_date              in date
624   ) Is
625 --
626   l_proc        varchar2(72)    := g_package||'dt_delete_validate';
627 --
628 Begin
629   --
630   -- Ensure that the p_datetrack_mode argument is not null
631   --
632   hr_api.mandatory_arg_error
633     (p_api_name       => l_proc
634     ,p_argument       => 'datetrack_mode'
635     ,p_argument_value => p_datetrack_mode
636     );
637   --
638   -- Only perform the validation if the datetrack mode is either
639   -- DELETE or ZAP
640   --
641   If (p_datetrack_mode = hr_api.g_delete or
642       p_datetrack_mode = hr_api.g_zap) then
643     --
644     --
645     -- Ensure the arguments are not null
646     --
647     hr_api.mandatory_arg_error
648       (p_api_name       => l_proc
649       ,p_argument       => 'validation_start_date'
650       ,p_argument_value => p_validation_start_date
651       );
652     --
653     hr_api.mandatory_arg_error
654       (p_api_name       => l_proc
655       ,p_argument       => 'validation_end_date'
656       ,p_argument_value => p_validation_end_date
657       );
658     --
659     hr_api.mandatory_arg_error
660       (p_api_name       => l_proc
661       ,p_argument       => 'event_value_change_id'
662       ,p_argument_value => p_event_value_change_id
663       );
664     --
665   --
666     --
667   End If;
668   --
669 Exception
670   When Others Then
671     --
672     -- An unhandled or unexpected error has occurred which
673     -- we must report
674     --
675     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
676     fnd_message.set_token('PROCEDURE', l_proc);
677     fnd_message.set_token('STEP','15');
678     fnd_message.raise_error;
679   --
680 End dt_delete_validate;
684 -- ----------------------------------------------------------------------------
681 --
682 -- ----------------------------------------------------------------------------
683 -- |----------------------< chk_startup_action >------------------------------|
685 --
686 -- Description:
687 --  This procedure will check that the current action is allowed according
688 --  to the current startup mode.
689 --
690 -- ----------------------------------------------------------------------------
691 PROCEDURE chk_startup_action
692   (p_insert               IN boolean
693   ,p_business_group_id    IN number
694   ,p_legislation_code     IN varchar2
695   ,p_legislation_subgroup IN varchar2 DEFAULT NULL) IS
696 --
697 BEGIN
698   --
699   -- Call the supporting procedure to check startup mode
700   -- EDIT_HERE: The following call should be edited if certain types of rows
701   -- are not permitted.
702   IF (p_insert) THEN
703     hr_startup_data_api_support.chk_startup_action
704       (p_generic_allowed   => TRUE
705       ,p_startup_allowed   => TRUE
706       ,p_user_allowed      => TRUE
707       ,p_business_group_id => p_business_group_id
708       ,p_legislation_code  => p_legislation_code
709       ,p_legislation_subgroup => p_legislation_subgroup
710       );
711   ELSE
712     hr_startup_data_api_support.chk_upd_del_startup_action
713       (p_generic_allowed   => TRUE
714       ,p_startup_allowed   => TRUE
715       ,p_user_allowed      => TRUE
716       ,p_business_group_id => p_business_group_id
717       ,p_legislation_code  => p_legislation_code
718       ,p_legislation_subgroup => p_legislation_subgroup
719       );
720   END IF;
721   --
722 END chk_startup_action;
723 --
724 -- ----------------------------------------------------------------------------
725 -- |---------------------------< insert_validate >----------------------------|
726 -- ----------------------------------------------------------------------------
727 Procedure insert_validate
728   (p_rec                   in pay_evc_shd.g_rec_type
729   ,p_effective_date        in date
730   ,p_datetrack_mode        in varchar2
731   ,p_validation_start_date in date
732   ,p_validation_end_date   in date
733   ) is
734 --
735   l_proc        varchar2(72) := g_package||'insert_validate';
736 --
737 Begin
738   hr_utility.set_location('Entering:'||l_proc, 5);
739   --
740   -- Call all supporting business operations
741   --
742   --
743   chk_startup_action(true
744                     ,p_rec.business_group_id
745                     ,p_rec.legislation_code
746                     );
747   IF hr_startup_data_api_support.g_startup_mode
748                      NOT IN ('GENERIC','STARTUP') THEN
749      --
750      -- Validate Important Attributes
751      --
752      hr_api.validate_bus_grp_id
753        (p_business_group_id => p_rec.business_group_id
754        ,p_associated_column1 => pay_evc_shd.g_tab_nam
755                                 || '.BUSINESS_GROUP_ID');
756      --
757      -- after validating the set of important attributes,
758      -- if Multiple Message Detection is enabled and at least
759      -- one error has been found then abort further validation.
760      --
761      hr_multi_message.end_validation_set;
762   END IF;
763   --
764   --
765   -- Validate Dependent Attributes
766   --
767   chk_default_event(p_rec, p_effective_date
768                    ,p_validation_start_date ,p_validation_end_date);
769   chk_valid_event(p_rec, p_effective_date
770                    ,p_validation_start_date ,p_validation_end_date);
771   chk_proration_style(p_rec, p_effective_date
772                    ,p_validation_start_date ,p_validation_end_date);
773 
774   --
775   hr_utility.set_location(' Leaving:'||l_proc, 10);
776 End insert_validate;
777 --
778 -- ----------------------------------------------------------------------------
779 -- |---------------------------< update_validate >----------------------------|
780 -- ----------------------------------------------------------------------------
781 Procedure update_validate
782   (p_rec                     in pay_evc_shd.g_rec_type
783   ,p_effective_date          in date
784   ,p_datetrack_mode          in varchar2
785   ,p_validation_start_date   in date
786   ,p_validation_end_date     in date
787   ) is
788 --
789   l_proc        varchar2(72) := g_package||'update_validate';
790 --
791 Begin
792   hr_utility.set_location('Entering:'||l_proc, 5);
793   --
794   -- Call all supporting business operations
795   --
796   --
797   chk_startup_action(false
798                     ,p_rec.business_group_id
799                     ,p_rec.legislation_code
800                     );
801   IF hr_startup_data_api_support.g_startup_mode
802                      NOT IN ('GENERIC','STARTUP') THEN
803      --
804      -- Validate Important Attributes
805      --
806      hr_api.validate_bus_grp_id
807        (p_business_group_id => p_rec.business_group_id
808        ,p_associated_column1 => pay_evc_shd.g_tab_nam
809                                 || '.BUSINESS_GROUP_ID');
810      --
811      -- After validating the set of important attributes,
815      hr_multi_message.end_validation_set;
812      -- if Multiple Message Detection is enabled and at least
813      -- one error has been found then abort further validation.
814      --
816   END IF;
817   --
818   --
819   -- Validate Dependent Attributes
820   --
821   chk_default_event(p_rec, p_effective_date
822                    ,p_validation_start_date ,p_validation_end_date);
823   chk_valid_event(p_rec, p_effective_date
824                    ,p_validation_start_date ,p_validation_end_date);
825   chk_proration_style(p_rec, p_effective_date
826                    ,p_validation_start_date ,p_validation_end_date);
827   --
828   --
829   -- Call the datetrack update integrity operation
830   --
831   dt_update_validate
832     (p_event_qualifier_id             => p_rec.event_qualifier_id
833     ,p_datetrack_mode                 => p_datetrack_mode
837   --
834     ,p_validation_start_date          => p_validation_start_date
835     ,p_validation_end_date            => p_validation_end_date
836     );
838   chk_non_updateable_args
839     (p_effective_date  => p_effective_date
840     ,p_rec             => p_rec
841     );
842   --
843   --
844   hr_utility.set_location(' Leaving:'||l_proc, 10);
845 End update_validate;
846 --
847 -- ----------------------------------------------------------------------------
848 -- |---------------------------< delete_validate >----------------------------|
849 -- ----------------------------------------------------------------------------
850 Procedure delete_validate
851   (p_rec                    in pay_evc_shd.g_rec_type
852   ,p_effective_date         in date
853   ,p_datetrack_mode         in varchar2
854   ,p_validation_start_date  in date
855   ,p_validation_end_date    in date
856   ) is
857 --
858   l_proc        varchar2(72) := g_package||'delete_validate';
859 --
860 Begin
861   hr_utility.set_location('Entering:'||l_proc, 5);
862   --
863     --
864   chk_startup_action(false
865                     ,pay_evc_shd.g_old_rec.business_group_id
866                     ,pay_evc_shd.g_old_rec.legislation_code
867                     );
868   IF hr_startup_data_api_support.g_startup_mode
869                      NOT IN ('GENERIC','STARTUP') THEN
870      --
871      -- Validate Important Attributes
872      --
873      --
874      -- After validating the set of important attributes,
875      -- if Multiple Message Detection is enabled and at least
876      -- one error has been found then abort further validation.
877      --
878      hr_multi_message.end_validation_set;
879   END IF;
880   --
881   -- Call all supporting business operations
882   --
883   dt_delete_validate
884     (p_datetrack_mode                   => p_datetrack_mode
885     ,p_validation_start_date            => p_validation_start_date
886     ,p_validation_end_date              => p_validation_end_date
887     ,p_event_value_change_id            => p_rec.event_value_change_id
888     );
889   --
890   hr_utility.set_location(' Leaving:'||l_proc, 10);
891 End delete_validate;
892 --
893 end pay_evc_bus;