DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_CAL_BUS

Source


1 Package Body pay_cal_bus as
2 /* $Header: pycalrhi.pkb 120.1 2005/11/11 07:06:15 adkumar noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pay_cal_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_cost_allocation_id          number         default null;
15 --
16 --  ---------------------------------------------------------------------------
17 --  |----------------------< set_security_group_id >--------------------------|
18 --  ---------------------------------------------------------------------------
19 --
20 Procedure set_security_group_id
21   (p_cost_allocation_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          , pay_cost_allocations_f cal
30      where cal.cost_allocation_id = p_cost_allocation_id
31        and pbg.business_group_id = cal.business_group_id;
32   --
33   -- Declare local variables
34   --
35   l_security_group_id number;
36   l_proc              varchar2(72)  :=  g_package||'set_security_group_id';
37   --
38 begin
39   --
40   hr_utility.set_location('Entering:'|| l_proc, 10);
41   --
42   -- Ensure that all the mandatory parameter are not null
43   --
44   hr_api.mandatory_arg_error
45     (p_api_name           => l_proc
46     ,p_argument           => 'cost_allocation_id'
47     ,p_argument_value     => p_cost_allocation_id
48     );
49   --
50   open csr_sec_grp;
51   fetch csr_sec_grp into l_security_group_id;
52   --
53   if csr_sec_grp%notfound then
54      --
55      close csr_sec_grp;
56      --
57      -- The primary key is invalid therefore we must error
58      --
59      fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
60      fnd_message.raise_error;
61      --
62   end if;
63   close csr_sec_grp;
64   --
65   -- Set the security_group_id in CLIENT_INFO
66   --
67   hr_api.set_security_group_id
68     (p_security_group_id => l_security_group_id
69     );
70   --
71   hr_utility.set_location(' Leaving:'|| l_proc, 20);
72   --
73 end set_security_group_id;
74 --
75 --  ---------------------------------------------------------------------------
76 --  |---------------------< return_legislation_code >-------------------------|
77 --  ---------------------------------------------------------------------------
78 --
79 Function return_legislation_code
80   (p_cost_allocation_id                   in     number
81   )
82   Return Varchar2 Is
83   --
84   -- Declare cursor
85   --
86  cursor csr_leg_code is
87     select pbg.legislation_code
88       from per_business_groups pbg
89          , pay_cost_allocations_f cal
90      where cal.cost_allocation_id = p_cost_allocation_id
91        and pbg.business_group_id = cal.business_group_id;
92   --
93   -- Declare local variables
94   --
95   l_legislation_code  varchar2(150);
96   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
97   --
98 Begin
99   --
100   hr_utility.set_location('Entering:'|| l_proc, 10);
101   --
102   -- Ensure that all the mandatory parameter are not null
103   --
104   hr_api.mandatory_arg_error
105     (p_api_name           => l_proc
106     ,p_argument           => 'cost_allocation_id'
107     ,p_argument_value     => p_cost_allocation_id
108     );
109   --
110   if ( nvl(pay_cal_bus.g_cost_allocation_id, hr_api.g_number)
111        = p_cost_allocation_id) then
112     --
113     -- The legislation code has already been found with a previous
114     -- call to this function. Just return the value in the global
115     -- variable.
116     --
117     l_legislation_code := pay_cal_bus.g_legislation_code;
118     hr_utility.set_location(l_proc, 20);
119   else
120     --
121     -- The ID is different to the last call to this function
122     -- or this is the first call to this function.
123     --
124     open csr_leg_code;
125     fetch csr_leg_code into l_legislation_code;
126     --
127     if csr_leg_code%notfound then
128       --
129       -- The primary key is invalid therefore we must error
130       --
131       close csr_leg_code;
132       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
133       fnd_message.raise_error;
134     end if;
135     hr_utility.set_location(l_proc,30);
136     --
137     -- Set the global variables so the values are
138     -- available for the next call to this function.
139     --
140     close csr_leg_code;
141     pay_cal_bus.g_cost_allocation_id          := p_cost_allocation_id;
142     pay_cal_bus.g_legislation_code  := l_legislation_code;
143   end if;
144   hr_utility.set_location(' Leaving:'|| l_proc, 40);
145   return l_legislation_code;
146 end return_legislation_code;
147 --
148 -- ----------------------------------------------------------------------------
149 -- |-----------------------< chk_non_updateable_args >------------------------|
150 -- ----------------------------------------------------------------------------
151 -- {Start Of Comments}
152 --
153 -- Description:
154 --   This procedure is used to ensure that non updateable attributes have
155 --   not been updated. If an attribute has been updated an error is generated.
156 --
157 -- Pre Conditions:
158 --   g_old_rec has been populated with details of the values currently in
159 --   the database.
160 --
161 -- In Arguments:
162 --   p_rec has been populated with the updated values the user would like the
163 --   record set to.
164 --
165 -- Post Success:
166 --   Processing continues if all the non updateable attributes have not
167 --   changed.
168 --
169 -- Post Failure:
170 --   An application error is raised if any of the non updatable attributes
171 --   have been altered.
172 --
173 -- {End Of Comments}
174 -- ----------------------------------------------------------------------------
175 Procedure chk_non_updateable_args
176   (p_effective_date  in date
177   ,p_rec             in pay_cal_shd.g_rec_type
178   ) IS
179 --
180   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
181   l_error    EXCEPTION;
182   l_argument varchar2(30);
183 --
184 Begin
185   --
186   -- Only proceed with the validation if a row exists for the current
187   -- record in the HR Schema.
188   --
189   IF NOT pay_cal_shd.api_updating
190       (p_cost_allocation_id               => p_rec.cost_allocation_id
191       ,p_effective_date                   => p_effective_date
192       ,p_object_version_number            => p_rec.object_version_number
193       ) THEN
194      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
195      fnd_message.set_token('PROCEDURE ', l_proc);
196      fnd_message.set_token('STEP ', '5');
197      fnd_message.raise_error;
198   END IF;
199   --
200   -- p_cost_allocation_id
201   --
202   if nvl(p_rec.cost_allocation_id, hr_api.g_number) <>
203      nvl(pay_cal_shd.g_old_rec.cost_allocation_id, hr_api.g_number)
204   then
205     l_argument := 'p_rec.cost_allocation_id';
206     raise l_error;
207   end if;
208   --
209   -- p_assignment_id
210   --
211   if nvl(p_rec.assignment_id, hr_api.g_number) <>
212      nvl(pay_cal_shd.g_old_rec.assignment_id, hr_api.g_number)
213   then
214     l_argument := 'p_rec.assignment_id';
215     raise l_error;
216   end if;
217   --
218   -- p_business_group_id
219   --
220   if nvl(p_rec.business_group_id, hr_api.g_number) <>
221      nvl(pay_cal_shd.g_old_rec.business_group_id, hr_api.g_number)
222   then
223     l_argument := 'p_rec.business_group_id';
224     raise l_error;
225   end if;
226   --
227   EXCEPTION
228     WHEN l_error THEN
229        hr_api.argument_changed_error
230          (p_api_name => l_proc
231          ,p_argument => l_argument);
232     WHEN OTHERS THEN
233        RAISE;
234 End chk_non_updateable_args;
235 --
236 -- ----------------------------------------------------------------------------
237 -- |---------------------< chk_cost_allocation_keyflex_id >-------------------|
238 -- ----------------------------------------------------------------------------
239 Procedure chk_cost_allocation_keyflex_id
240   (p_cost_allocation_keyflex_id     in     number
241   ,p_effective_date                 in     date
242   ) is
243   --
244   -- Cursor to check that the flexfield combination exists.
245   --
246   cursor csr_combination_exists is
247   select 'Y'
248   from   pay_cost_allocation_keyflex ckf
249   where  ckf.cost_allocation_keyflex_id = p_cost_allocation_keyflex_id
250   and    p_effective_date between nvl(ckf.start_date_active,p_effective_date)
251                           and     nvl(ckf.end_date_active,p_effective_date)
252   and    ckf.enabled_flag = 'Y';
253 --
254   l_proc  varchar2(72) := g_package||'chk_cost_allocation_keyflex_id';
255   l_exists varchar2(1);
256 --
257 Begin
258   --
259   -- Check that the combination_id is not null.
260   --
261   hr_api.mandatory_arg_error
262   (p_api_name       => l_proc
263   ,p_argument       => 'p_cost_allocation_keyflex_id'
264   ,p_argument_value => p_cost_allocation_keyflex_id
265   );
266   --
267   -- Check that the combination exists.
268   --
269   open csr_combination_exists;
270   fetch csr_combination_exists into l_exists;
271   if csr_combination_exists%notfound then
272     close csr_combination_exists;
273     fnd_message.set_name('PAY', 'PAY_50982_INVALID_COST_KEYFLEX');
274     fnd_message.raise_error;
275   end if;
276   close csr_combination_exists;
277 End chk_cost_allocation_keyflex_id;
278 --
279 -- ----------------------------------------------------------------------------
280 -- |----------------------------< chk_assignment_id >-------------------------|
281 -- ----------------------------------------------------------------------------
282 Procedure chk_assignment_id
283   (p_assignment_id                  in     number
284   ,p_business_group_id              in     number
285   ,p_effective_date                 in     date
286   ) is
287   --
288   -- Cursor to check that the assignment exists.
289   --
290   cursor csr_assignment_exists is
291   select 'Y'
292   from   per_assignments_f paf
293   where  paf.assignment_id = p_assignment_id
294   and    p_effective_date between paf.effective_start_date
295                           and     paf.effective_end_date
296   and    paf.business_group_id = p_business_group_id;
297 --
298   l_proc              varchar2(72) := g_package||'chk_assignment_id';
299   l_exists            varchar2(1);
300 --
301 Begin
302   --
303   -- Check that the combination_id is not null.
304   --
305   hr_api.mandatory_arg_error
306   (p_api_name       => l_proc
307   ,p_argument       => 'p_assignment_id'
308   ,p_argument_value => p_assignment_id
309   );
310   --
311   -- Check that the combination exists.
312   --
313   open csr_assignment_exists;
314   fetch csr_assignment_exists into l_exists;
315   if csr_assignment_exists%notfound then
316     close csr_assignment_exists;
317     fnd_message.set_name('PAY', 'HR_7467_PLK_NOT_ELGBLE_ASS_ID');
318     fnd_message.set_token('ASSIGNMENT_ID', p_assignment_id);
319     fnd_message.raise_error;
320   end if;
321   close csr_assignment_exists;
322 End chk_assignment_id;
323 --
324 -- ----------------------------------------------------------------------------
325 -- |-----------------------------< chk_proportion >---------------------------|
326 -- ----------------------------------------------------------------------------
327 Procedure chk_proportion
328   (p_cost_allocation_id in number
329   ,p_proportion         in number) is
330 --
331   l_proc  varchar2(72) := g_package||'chk_proportion';
332 --
333 Begin
334   --
335   -- Check that the proportion is not null.
336   --
337   hr_api.mandatory_arg_error
338   (p_api_name       => l_proc
339   ,p_argument       => 'p_proportion'
340   ,p_argument_value => p_proportion
341   );
342   --
343   -- Check that the proportion is between 0 and 1
344   --
345   if ((nvl(pay_cal_shd.g_old_rec.proportion,hr_api.g_number) <> p_proportion)
346   or (p_cost_allocation_id is null)) then
347   --
348     if p_proportion not between 0 and 1 then
349       fnd_message.set_name('PAY', 'PAY_50983_INVALID_PROPORTION');
350       fnd_message.raise_error;
351     end if;
352   --
353   end if;
354   --
355 End chk_proportion;
356 --
357 -- -------------------------------------------------------------------------
358 -- |--------------------< chk_duplicate_cost_keyflex >---------------------|
359 -- -------------------------------------------------------------------------
360 -- {Start Of Comments}
361 --
362 -- Description:
363 --   Validates that no duplicate cost allocation keyflex id exists for the
364 --   same assignment on any date in the validation date range.
365 --
366 -- Prerequisites:
367 --   None.
368 --
369 -- In Parameters:
370 --   p_cost_allocation_id
371 --   p_cost_allocation_keyflex_id
372 --   p_assignment_id
373 --   p_datetrack_mode
374 --   p_validation_start_date
375 --   p_validation_end_date
376 --
377 -- Post Success:
378 --   Processing continues if the cost allocation keyflex id is valid.
379 --
380 --
381 -- Post Failure:
382 --   An application error is raised and processing is terminated if the
383 --   cost allocation keyflex id is invalid.
384 --
385 -- Access Status:
386 --   Internal Row Handler Use Only.
387 --
388 -- {End Of Comments}
389 --
390 procedure chk_duplicate_cost_keyflex
391   (p_cost_allocation_id          in number
392   ,p_cost_allocation_keyflex_id  in number
393   ,p_assignment_id               in number
394   ,p_datetrack_mode              in varchar2
395   ,p_validation_start_date       in date
396   ,p_validation_end_date         in date
397   )
398 is
399   --
400   -- Declare local variables
401   --
402   l_proc             varchar2(72) := g_package||'chk_duplicate_cost_keyflex';
403   l_exists           varchar2(1);
404 
405   --
406   -- Cursor to check that a retro component exists.
407   --
408   cursor csr_duplicate_cost_keyflex is
409     select null
410     from pay_cost_allocations_f
411     where assignment_id = p_assignment_id
412       and cost_allocation_id <> nvl(p_cost_allocation_id, hr_api.g_number)
413       and cost_allocation_keyflex_id = p_cost_allocation_keyflex_id
414       and effective_start_date <= p_validation_end_date
415       and effective_end_date   >= p_validation_start_date
416     ;
417 --
418 begin
419   hr_utility.set_location('Entering:'|| l_proc, 10);
420 
421   hr_utility.set_location('Cost Allocation ID:'|| p_cost_allocation_id, 10);
422   hr_utility.set_location('p_cost_allocation_keyflex_id:'|| p_cost_allocation_keyflex_id, 10);
426   hr_utility.set_location('p_validation_end_date:'|| p_validation_end_date, 10);
423   hr_utility.set_location('p_assignment_id:'|| p_assignment_id, 10);
424   hr_utility.set_location('p_datetrack_mode:'|| p_datetrack_mode, 10);
425   hr_utility.set_location('p_validation_start_date:'|| p_validation_start_date, 10);
427 
428   --
429   -- Check p_datetrack_mode has been set
430   --
431   hr_api.mandatory_arg_error
432     (p_api_name       => l_proc
433     ,p_argument       => 'datetrack_mode'
434     ,p_argument_value => p_datetrack_mode
435     );
436 
437   --
438   -- Perform the validity check when the datetrack mode is not
439   -- ZAP or DELETE.
440   --
441   if p_datetrack_mode not in (hr_api.g_zap, hr_api.g_delete) then
442 
443     --
444     -- Check mandatory parameters have been set
445     --
446 
447     --
448     -- Note: cost_allocation_id is not yet populated when inserting.
449     --
450     if p_datetrack_mode <> hr_api.g_insert then
451 
452       hr_api.mandatory_arg_error
453         (p_api_name       => l_proc
454         ,p_argument       => 'cost_allocation_id'
455         ,p_argument_value => p_cost_allocation_id
456         );
457 
458     end if;
459 
460     hr_api.mandatory_arg_error
461       (p_api_name       => l_proc
462       ,p_argument       => 'cost_allocation_keyflex_id'
463       ,p_argument_value => p_cost_allocation_keyflex_id
464       );
465     hr_api.mandatory_arg_error
466       (p_api_name       => l_proc
467       ,p_argument       => 'assignment_id'
468       ,p_argument_value => p_assignment_id
469       );
470     hr_api.mandatory_arg_error
471       (p_api_name       => l_proc
472       ,p_argument       => 'validation_start_date'
473       ,p_argument_value => p_validation_start_date
474       );
475     hr_api.mandatory_arg_error
476       (p_api_name       => l_proc
477       ,p_argument       => 'validation_end_date'
478       ,p_argument_value => p_validation_end_date
479       );
480 
481     --
482     -- Check if a duplicate record exists.
483     --
484     hr_utility.set_location(l_proc, 20);
485     open csr_duplicate_cost_keyflex;
486     fetch csr_duplicate_cost_keyflex into l_exists;
487     if csr_duplicate_cost_keyflex%found then
488       close csr_duplicate_cost_keyflex;
489 
490       fnd_message.set_name('PER','HR_6645_ASS_COST_DUPL');
491       fnd_message.raise_error;
492 
493     end if;
494     close csr_duplicate_cost_keyflex;
495   end if;
496 
497   hr_utility.set_location(' Leaving:'|| l_proc, 50);
498 end chk_duplicate_cost_keyflex;
499 --
500 -- ----------------------------------------------------------------------------
501 -- |--------------------------< dt_update_validate >--------------------------|
502 -- ----------------------------------------------------------------------------
503 -- {Start Of Comments}
504 --
505 -- Description:
506 --   This procedure is used for referential integrity of datetracked
507 --   parent entities when a datetrack update operation is taking place
508 --   and where there is no cascading of update defined for this entity.
509 --
510 -- Prerequisites:
511 --   This procedure is called from the update_validate.
512 --
513 -- In Parameters:
514 --
515 -- Post Success:
516 --   Processing continues.
517 --
518 -- Post Failure:
519 --
520 -- Developer Implementation Notes:
521 --   This procedure should not need maintenance unless the HR Schema model
522 --   changes.
523 --
524 -- Access Status:
525 --   Internal Row Handler Use Only.
526 --
527 -- {End Of Comments}
528 -- ----------------------------------------------------------------------------
529 Procedure dt_update_validate
530   (p_datetrack_mode                in varchar2
531   ,p_validation_start_date         in date
532   ,p_validation_end_date           in date
533   ) Is
534 --
535   l_proc  varchar2(72) := g_package||'dt_update_validate';
536   l_integrity_error Exception;
537   l_table_name      all_tables.table_name%TYPE;
538 --
539 Begin
540   --
541   -- Ensure that the p_datetrack_mode argument is not null
542   --
543   hr_api.mandatory_arg_error
544     (p_api_name       => l_proc
545     ,p_argument       => 'datetrack_mode'
546     ,p_argument_value => p_datetrack_mode
547     );
548   --
549   -- Mode will be valid, as this is checked at the start of the upd.
550   --
551   -- Ensure the arguments are not null
552   --
553   hr_api.mandatory_arg_error
554     (p_api_name       => l_proc
555     ,p_argument       => 'validation_start_date'
556     ,p_argument_value => p_validation_start_date
557     );
558   --
559   hr_api.mandatory_arg_error
560     (p_api_name       => l_proc
561     ,p_argument       => 'validation_end_date'
562     ,p_argument_value => p_validation_end_date
563     );
564   --
565     --
566   --
567 Exception
568   When l_integrity_error Then
569     --
570     -- A referential integrity check was violated therefore
571     -- we must error
572     --
573     fnd_message.set_name('PAY', 'HR_7216_DT_UPD_INTEGRITY_ERR');
577     --
574     fnd_message.set_token('TABLE_NAME', l_table_name);
575     fnd_message.raise_error;
576   When Others Then
578     -- An unhandled or unexpected error has occurred which
579     -- we must report
580     --
581     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
582     fnd_message.set_token('PROCEDURE', l_proc);
583     fnd_message.set_token('STEP','15');
584     fnd_message.raise_error;
585 End dt_update_validate;
586 --
587 -- ----------------------------------------------------------------------------
588 -- |--------------------------< dt_delete_validate >--------------------------|
589 -- ----------------------------------------------------------------------------
590 -- {Start Of Comments}
591 --
592 -- Description:
593 --   This procedure is used for referential integrity of datetracked
594 --   child entities when either a datetrack DELETE or ZAP is in operation
595 --   and where there is no cascading of delete defined for this entity.
596 --   For the datetrack mode of DELETE or ZAP we must ensure that no
597 --   datetracked child rows exist between the validation start and end
598 --   dates.
599 --
600 -- Prerequisites:
601 --   This procedure is called from the delete_validate.
602 --
603 -- In Parameters:
604 --
605 -- Post Success:
606 --   Processing continues.
607 --
608 -- Post Failure:
609 --   If a row exists by determining the returning Boolean value from the
610 --   generic dt_api.rows_exist function then we must supply an error via
611 --   the use of the local exception handler l_rows_exist.
612 --
613 -- Developer Implementation Notes:
614 --   This procedure should not need maintenance unless the HR Schema model
615 --   changes.
616 --
617 -- Access Status:
618 --   Internal Row Handler Use Only.
619 --
620 -- {End Of Comments}
621 -- ----------------------------------------------------------------------------
622 Procedure dt_delete_validate
623   (p_cost_allocation_id               in number
624   ,p_datetrack_mode                   in varchar2
625   ,p_validation_start_date            in date
626   ,p_validation_end_date              in date
627   ) Is
628 --
629   l_proc        varchar2(72)    := g_package||'dt_delete_validate';
630   l_rows_exist  Exception;
631   l_table_name  all_tables.table_name%TYPE;
632 --
633 Begin
634   --
635   -- Ensure that the p_datetrack_mode argument is not null
636   --
637   hr_api.mandatory_arg_error
638     (p_api_name       => l_proc
639     ,p_argument       => 'datetrack_mode'
640     ,p_argument_value => p_datetrack_mode
641     );
642   --
643   -- Only perform the validation if the datetrack mode is either
644   -- DELETE or ZAP
645   --
646   If (p_datetrack_mode = hr_api.g_delete or
647       p_datetrack_mode = hr_api.g_zap) then
648     --
649     --
650     -- Ensure the arguments are not null
651     --
652     hr_api.mandatory_arg_error
653       (p_api_name       => l_proc
654       ,p_argument       => 'validation_start_date'
655       ,p_argument_value => p_validation_start_date
656       );
657     --
658     hr_api.mandatory_arg_error
659       (p_api_name       => l_proc
660       ,p_argument       => 'validation_end_date'
661       ,p_argument_value => p_validation_end_date
662       );
663     --
664     hr_api.mandatory_arg_error
665       (p_api_name       => l_proc
666       ,p_argument       => 'cost_allocation_id'
667       ,p_argument_value => p_cost_allocation_id
668       );
669     --
670   --
671     --
672   End If;
673   --
674 Exception
675   When l_rows_exist Then
676     --
677     -- A referential integrity check was violated therefore
678     -- we must error
679     --
680     fnd_message.set_name('PAY', 'HR_7215_DT_CHILD_EXISTS');
681     fnd_message.set_token('TABLE_NAME', l_table_name);
682     fnd_message.raise_error;
683   When Others Then
684     --
685     -- An unhandled or unexpected error has occurred which
686     -- we must report
687     --
688     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
689     fnd_message.set_token('PROCEDURE', l_proc);
690     fnd_message.set_token('STEP','15');
691     fnd_message.raise_error;
692   --
693 End dt_delete_validate;
694 --
695 -- ----------------------------------------------------------------------------
696 -- |---------------------------< insert_validate >----------------------------|
697 -- ----------------------------------------------------------------------------
698 Procedure insert_validate
699   (p_rec                   in pay_cal_shd.g_rec_type
700   ,p_effective_date        in date
701   ,p_datetrack_mode        in varchar2
702   ,p_validation_start_date in date
703   ,p_validation_end_date   in date
704   ) is
705 --
706   l_proc        varchar2(72) := g_package||'insert_validate';
707 --
708 Begin
709   hr_utility.set_location('Entering:'||l_proc, 5);
710   --
711   -- Call all supporting business operations
712   --
713   hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate Bus Grp
714   --
715   chk_cost_allocation_keyflex_id
716     (p_cost_allocation_keyflex_id => p_rec.cost_allocation_keyflex_id
720     (p_assignment_id     => p_rec.assignment_id
717     ,p_effective_date             => p_effective_date);
718   --
719   chk_assignment_id
721     ,p_business_group_id => p_rec.business_group_id
722     ,p_effective_date    => p_effective_date);
723   --
724   chk_proportion
725     (p_cost_allocation_id => p_rec.cost_allocation_id
726     ,p_proportion         => p_rec.proportion);
727   --
728   chk_duplicate_cost_keyflex
729     (p_cost_allocation_id          => p_rec.cost_allocation_id
730     ,p_cost_allocation_keyflex_id  => p_rec.cost_allocation_keyflex_id
731     ,p_assignment_id               => p_rec.assignment_id
732     ,p_datetrack_mode              => p_datetrack_mode
733     ,p_validation_start_date       => p_validation_start_date
734     ,p_validation_end_date         => p_validation_end_date
735     );
736   hr_utility.set_location(' Leaving:'||l_proc, 10);
737 End insert_validate;
738 --
739 -- ----------------------------------------------------------------------------
740 -- |---------------------------< update_validate >----------------------------|
741 -- ----------------------------------------------------------------------------
742 Procedure update_validate
743   (p_rec                     in pay_cal_shd.g_rec_type
744   ,p_effective_date          in date
745   ,p_datetrack_mode          in varchar2
746   ,p_validation_start_date   in date
747   ,p_validation_end_date     in date
748   ) is
749 --
750   l_proc        varchar2(72) := g_package||'update_validate';
751 --
752 Begin
753   hr_utility.set_location('Entering:'||l_proc, 5);
754   --
755   -- Call all supporting business operations
756   --
757   hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate Bus Grp
758   --
759   chk_cost_allocation_keyflex_id
760     (p_cost_allocation_keyflex_id => p_rec.cost_allocation_keyflex_id
761     ,p_effective_date             => p_effective_date);
762   --
763   chk_proportion
764     (p_cost_allocation_id => p_rec.cost_allocation_id
765     ,p_proportion         => p_rec.proportion);
766   --
767   -- Call the datetrack update integrity operation
768   --
769   dt_update_validate
770     (p_datetrack_mode                 => p_datetrack_mode
771     ,p_validation_start_date          => p_validation_start_date
772     ,p_validation_end_date            => p_validation_end_date
773     );
774   --
775   chk_non_updateable_args
776     (p_effective_date  => p_effective_date
777     ,p_rec             => p_rec
778     );
779   --
780   chk_duplicate_cost_keyflex
781     (p_cost_allocation_id          => p_rec.cost_allocation_id
782     ,p_cost_allocation_keyflex_id  => p_rec.cost_allocation_keyflex_id
783     ,p_assignment_id               => p_rec.assignment_id
784     ,p_datetrack_mode              => p_datetrack_mode
785     ,p_validation_start_date       => p_validation_start_date
786     ,p_validation_end_date         => p_validation_end_date
787     );
788   --
789   hr_utility.set_location(' Leaving:'||l_proc, 10);
790 End update_validate;
791 --
792 -- ----------------------------------------------------------------------------
793 -- |---------------------------< delete_validate >----------------------------|
794 -- ----------------------------------------------------------------------------
795 Procedure delete_validate
796   (p_rec                    in pay_cal_shd.g_rec_type
797   ,p_effective_date         in date
798   ,p_datetrack_mode         in varchar2
799   ,p_validation_start_date  in date
800   ,p_validation_end_date    in date
801   ) is
802 --
803   l_proc        varchar2(72) := g_package||'delete_validate';
804 --
805 Begin
806   hr_utility.set_location('Entering:'||l_proc, 5);
807   --
808   -- Call all supporting business operations
809   --
810   dt_delete_validate
811     (p_datetrack_mode                   => p_datetrack_mode
812     ,p_validation_start_date            => p_validation_start_date
813     ,p_validation_end_date              => p_validation_end_date
814     ,p_cost_allocation_id               => p_rec.cost_allocation_id
815     );
816   --
817   chk_duplicate_cost_keyflex
818     (p_cost_allocation_id          => p_rec.cost_allocation_id
819     ,p_cost_allocation_keyflex_id  => pay_cal_shd.g_old_rec.cost_allocation_keyflex_id
820     ,p_assignment_id               => pay_cal_shd.g_old_rec.assignment_id
821     ,p_datetrack_mode              => p_datetrack_mode
822     ,p_validation_start_date       => p_validation_start_date
823     ,p_validation_end_date         => p_validation_end_date
824     );
825   --
826   hr_utility.set_location(' Leaving:'||l_proc, 10);
827 End delete_validate;
828 --
829 end pay_cal_bus;