DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_BLT_BUS

Source


1 Package Body pay_blt_bus as
2 /* $Header: pybltrhi.pkb 120.0 2005/05/29 03:21 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pay_blt_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_balance_type_id             number         default null;
15 --
16 --  ---------------------------------------------------------------------------
17 --  |----------------------< set_security_group_id >--------------------------|
18 --  ---------------------------------------------------------------------------
19 --
20 Procedure set_security_group_id
21   (p_balance_type_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            pbg.legislation_code
30       from per_business_groups_perf pbg
31          , pay_balance_types blt
32      where blt.balance_type_id = p_balance_type_id
33        and pbg.business_group_id (+) = blt.business_group_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   l_legislation_code  varchar2(150);
40   --
41 begin
42   --
43   hr_utility.set_location('Entering:'|| l_proc, 10);
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           => 'balance_type_id'
50     ,p_argument_value     => p_balance_type_id
51     );
52   --
53   open csr_sec_grp;
54   fetch csr_sec_grp into l_security_group_id
55                        , l_legislation_code;
56   --
57   if csr_sec_grp%notfound then
58      --
59      close csr_sec_grp;
60      --
61      -- The primary key is invalid therefore we must error
62      --
63      fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
64      hr_multi_message.add
65        (p_associated_column1
66         => nvl(p_associated_column1,'BALANCE_TYPE_ID')
67        );
68      --
69   else
70     close csr_sec_grp;
71     --
72     -- Set the security_group_id in CLIENT_INFO
73     --
74     hr_api.set_security_group_id
75       (p_security_group_id => l_security_group_id
76       );
77     --
78     -- Set the sessions legislation context in HR_SESSION_DATA
79     --
80     hr_api.set_legislation_context(l_legislation_code);
81   end if;
82   --
83   hr_utility.set_location(' Leaving:'|| l_proc, 20);
84   --
85 end set_security_group_id;
86 --
87 --  ---------------------------------------------------------------------------
88 --  |---------------------< return_legislation_code >-------------------------|
89 --  ---------------------------------------------------------------------------
90 --
91 Function return_legislation_code
92   (p_balance_type_id                      in     number
93   )
94   Return Varchar2 Is
95   --
96   -- Declare cursor
97   --
98   cursor csr_leg_code is
99     select pbg.legislation_code
100       from per_business_groups_perf pbg
101          , pay_balance_types blt
102      where blt.balance_type_id = p_balance_type_id
103        and pbg.business_group_id (+) = blt.business_group_id;
104   --
105   -- Declare local variables
106   --
107   l_legislation_code  varchar2(150);
108   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
109   --
110 Begin
111   --
112   hr_utility.set_location('Entering:'|| l_proc, 10);
113   --
114   -- Ensure that all the mandatory parameter are not null
115   --
116   hr_api.mandatory_arg_error
117     (p_api_name           => l_proc
118     ,p_argument           => 'balance_type_id'
119     ,p_argument_value     => p_balance_type_id
120     );
121   --
122   if ( nvl(pay_blt_bus.g_balance_type_id, hr_api.g_number)
123        = p_balance_type_id) then
124     --
125     -- The legislation code has already been found with a previous
126     -- call to this function. Just return the value in the global
127     -- variable.
128     --
129     l_legislation_code := pay_blt_bus.g_legislation_code;
130     hr_utility.set_location(l_proc, 20);
131   else
132     --
133     -- The ID is different to the last call to this function
134     -- or this is the first call to this function.
135     --
136     open csr_leg_code;
137     fetch csr_leg_code into l_legislation_code;
138     --
139     if csr_leg_code%notfound then
140       --
141       -- The primary key is invalid therefore we must error
142       --
143       close csr_leg_code;
144       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
145       fnd_message.raise_error;
146     end if;
147     hr_utility.set_location(l_proc,30);
148     --
149     -- Set the global variables so the values are
150     -- available for the next call to this function.
151     --
152     close csr_leg_code;
153     pay_blt_bus.g_balance_type_id             := p_balance_type_id;
154     pay_blt_bus.g_legislation_code  := l_legislation_code;
155   end if;
156   hr_utility.set_location(' Leaving:'|| l_proc, 40);
157   return l_legislation_code;
158 end return_legislation_code;
159 --
160 -- ----------------------------------------------------------------------------
161 -- |------------------------------< chk_df >----------------------------------|
162 -- ----------------------------------------------------------------------------
163 --
164 -- Description:
165 --   Validates all the Descriptive Flexfield values.
166 --
167 -- Prerequisites:
168 --   All other columns have been validated.  Must be called as the
169 --   last step from insert_validate and update_validate.
170 --
171 -- In Arguments:
172 --   p_rec
173 --
174 -- Post Success:
175 --   If the Descriptive Flexfield structure column and data values are
176 --   all valid this procedure will end normally and processing will
177 --   continue.
178 --
179 -- Post Failure:
180 --   If the Descriptive Flexfield structure column value or any of
181 --   the data values are invalid then an application error is raised as
182 --   a PL/SQL exception.
183 --
184 -- Access Status:
185 --   Internal Row Handler Use Only.
186 --
187 -- ----------------------------------------------------------------------------
188 procedure chk_df
189   (p_rec in pay_blt_shd.g_rec_type
190   ) is
191 --
192   l_proc   varchar2(72) := g_package || 'chk_df';
193 --
194 begin
195   hr_utility.set_location('Entering:'||l_proc,10);
196   --
197   if ((p_rec.balance_type_id is not null)  and (
198     nvl(pay_blt_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
199     nvl(p_rec.attribute_category, hr_api.g_varchar2)  or
200     nvl(pay_blt_shd.g_old_rec.attribute1, hr_api.g_varchar2) <>
201     nvl(p_rec.attribute1, hr_api.g_varchar2)  or
202     nvl(pay_blt_shd.g_old_rec.attribute2, hr_api.g_varchar2) <>
203     nvl(p_rec.attribute2, hr_api.g_varchar2)  or
204     nvl(pay_blt_shd.g_old_rec.attribute3, hr_api.g_varchar2) <>
205     nvl(p_rec.attribute3, hr_api.g_varchar2)  or
206     nvl(pay_blt_shd.g_old_rec.attribute4, hr_api.g_varchar2) <>
207     nvl(p_rec.attribute4, hr_api.g_varchar2)  or
208     nvl(pay_blt_shd.g_old_rec.attribute5, hr_api.g_varchar2) <>
209     nvl(p_rec.attribute5, hr_api.g_varchar2)  or
210     nvl(pay_blt_shd.g_old_rec.attribute6, hr_api.g_varchar2) <>
211     nvl(p_rec.attribute6, hr_api.g_varchar2)  or
212     nvl(pay_blt_shd.g_old_rec.attribute7, hr_api.g_varchar2) <>
213     nvl(p_rec.attribute7, hr_api.g_varchar2)  or
214     nvl(pay_blt_shd.g_old_rec.attribute8, hr_api.g_varchar2) <>
215     nvl(p_rec.attribute8, hr_api.g_varchar2)  or
216     nvl(pay_blt_shd.g_old_rec.attribute9, hr_api.g_varchar2) <>
217     nvl(p_rec.attribute9, hr_api.g_varchar2)  or
218     nvl(pay_blt_shd.g_old_rec.attribute10, hr_api.g_varchar2) <>
219     nvl(p_rec.attribute10, hr_api.g_varchar2)  or
220     nvl(pay_blt_shd.g_old_rec.attribute11, hr_api.g_varchar2) <>
221     nvl(p_rec.attribute11, hr_api.g_varchar2)  or
222     nvl(pay_blt_shd.g_old_rec.attribute12, hr_api.g_varchar2) <>
223     nvl(p_rec.attribute12, hr_api.g_varchar2)  or
224     nvl(pay_blt_shd.g_old_rec.attribute13, hr_api.g_varchar2) <>
225     nvl(p_rec.attribute13, hr_api.g_varchar2)  or
226     nvl(pay_blt_shd.g_old_rec.attribute14, hr_api.g_varchar2) <>
227     nvl(p_rec.attribute14, hr_api.g_varchar2)  or
228     nvl(pay_blt_shd.g_old_rec.attribute15, hr_api.g_varchar2) <>
229     nvl(p_rec.attribute15, hr_api.g_varchar2)  or
230     nvl(pay_blt_shd.g_old_rec.attribute16, hr_api.g_varchar2) <>
231     nvl(p_rec.attribute16, hr_api.g_varchar2)  or
232     nvl(pay_blt_shd.g_old_rec.attribute17, hr_api.g_varchar2) <>
233     nvl(p_rec.attribute17, hr_api.g_varchar2)  or
234     nvl(pay_blt_shd.g_old_rec.attribute18, hr_api.g_varchar2) <>
235     nvl(p_rec.attribute18, hr_api.g_varchar2)  or
236     nvl(pay_blt_shd.g_old_rec.attribute19, hr_api.g_varchar2) <>
237     nvl(p_rec.attribute19, hr_api.g_varchar2)  or
238     nvl(pay_blt_shd.g_old_rec.attribute20, hr_api.g_varchar2) <>
239     nvl(p_rec.attribute20, hr_api.g_varchar2) ))
240     or (p_rec.balance_type_id is null)  then
241     --
242     -- Only execute the validation if absolutely necessary:
243     -- a) During update, the structure column value or any
244     --    of the attribute values have actually changed.
245     -- b) During insert.
246     --
247     hr_dflex_utility.ins_or_upd_descflex_attribs
248       (p_appl_short_name                 => 'PAY'
249       ,p_descflex_name                   => 'PAY_BALANCE_TYPES'
250       ,p_attribute_category              =>  p_rec.ATTRIBUTE_CATEGORY
251       ,p_attribute1_name                 => 'ATTRIBUTE1'
252       ,p_attribute1_value                => p_rec.attribute1
253       ,p_attribute2_name                 => 'ATTRIBUTE2'
254       ,p_attribute2_value                => p_rec.attribute2
255       ,p_attribute3_name                 => 'ATTRIBUTE3'
256       ,p_attribute3_value                => p_rec.attribute3
257       ,p_attribute4_name                 => 'ATTRIBUTE4'
258       ,p_attribute4_value                => p_rec.attribute4
259       ,p_attribute5_name                 => 'ATTRIBUTE5'
260       ,p_attribute5_value                => p_rec.attribute5
261       ,p_attribute6_name                 => 'ATTRIBUTE6'
262       ,p_attribute6_value                => p_rec.attribute6
263       ,p_attribute7_name                 => 'ATTRIBUTE7'
264       ,p_attribute7_value                => p_rec.attribute7
265       ,p_attribute8_name                 => 'ATTRIBUTE8'
266       ,p_attribute8_value                => p_rec.attribute8
267       ,p_attribute9_name                 => 'ATTRIBUTE9'
268       ,p_attribute9_value                => p_rec.attribute9
269       ,p_attribute10_name                => 'ATTRIBUTE10'
270       ,p_attribute10_value               => p_rec.attribute10
271       ,p_attribute11_name                => 'ATTRIBUTE11'
272       ,p_attribute11_value               => p_rec.attribute11
273       ,p_attribute12_name                => 'ATTRIBUTE12'
274       ,p_attribute12_value               => p_rec.attribute12
275       ,p_attribute13_name                => 'ATTRIBUTE13'
276       ,p_attribute13_value               => p_rec.attribute13
277       ,p_attribute14_name                => 'ATTRIBUTE14'
278       ,p_attribute14_value               => p_rec.attribute14
279       ,p_attribute15_name                => 'ATTRIBUTE15'
280       ,p_attribute15_value               => p_rec.attribute15
281       ,p_attribute16_name                => 'ATTRIBUTE16'
282       ,p_attribute16_value               => p_rec.attribute16
283       ,p_attribute17_name                => 'ATTRIBUTE17'
284       ,p_attribute17_value               => p_rec.attribute17
285       ,p_attribute18_name                => 'ATTRIBUTE18'
286       ,p_attribute18_value               => p_rec.attribute18
287       ,p_attribute19_name                => 'ATTRIBUTE19'
288       ,p_attribute19_value               => p_rec.attribute19
289       ,p_attribute20_name                => 'ATTRIBUTE20'
290       ,p_attribute20_value               => p_rec.attribute20
291       );
292   end if;
293   --
294   hr_utility.set_location(' Leaving:'||l_proc,20);
295 end chk_df;
296 --
297 --
298 -- ----------------------------------------------------------------------------
299 -- |------------------------< chk_assignment_remuneration_fg >----------------|
300 -- ----------------------------------------------------------------------------
301 --
302 Procedure chk_assignment_remuneration_fg
303   (p_assignment_remuneration_flag   in varchar2
304   ,p_business_group_id              in number
305   ,p_legislation_code               in varchar2
306   )  is
307 --
308   l_proc        varchar2(72) := g_package||'chk_assignment_remuneration_fg';
309 
310 --
311 Begin
312   hr_utility.set_location('Entering:'||l_proc, 5);
313   --
314 
315   if p_assignment_remuneration_flag = 'Y' then
316      pay_balance_types_pkg.chk_balance_type
317          ( p_row_id            => null,
318            p_business_group_id => p_business_group_id,
319            p_legislation_code  => nvl(p_legislation_code,
320                       hr_api.return_legislation_code(p_business_group_id)),
321            p_balance_name      => null,
322            p_reporting_name    => null,
326 	    --
323            p_assignment_remuneration_flag =>p_assignment_remuneration_flag
324 	 );
325   end if;
327   hr_utility.set_location('Leaving:'||l_proc, 10);
328 End;
329 --
330 --
331 -- ----------------------------------------------------------------------------
332 -- |--------------------------< chk_currency_code >--------------------------|
333 -- ----------------------------------------------------------------------------
334 --
335 Procedure chk_currency_code
336   (p_effective_date  	   in date
337   ,p_business_group_id     in number
338   ,p_legislation_code      in varchar2
339   ,p_balance_uom           in varchar2
340   ,p_currency_code         in varchar2
341   ) is
342 --
343   l_proc                  varchar2(72) := g_package||'chk_currency_code';
344   l_exists	          varchar2(1);
345 
346   Cursor c_chk_currency
347   is
348     select '1'
349       from fnd_currencies
350      where currency_code = p_currency_code
351        and enabled_flag = 'Y'
352        and currency_flag = 'Y'
353        and p_effective_date between nvl(start_date_active,p_effective_date)
354        and nvl(end_date_active,p_effective_date);
355 --
356 Begin
357   hr_utility.set_location('Entering:'||l_proc, 5);
358   --
359   If (p_balance_uom <> 'M' and p_currency_code is not null) then
360       fnd_message.set_name('PAY','PAY_34193_UOM_NOT_MONEY');
361       fnd_message.raise_error;
362   elsIf p_currency_code is not null then
363     --
364     Open c_chk_currency;
365     Fetch c_chk_currency into l_exists;
366     If c_chk_currency%notfound Then
367     --
368       Close c_chk_currency;
369       fnd_message.set_name('PAY','HR_51855_QUA_CCY_INV');
370       fnd_message.raise_error;
371     End if;
372     --
373     Close c_chk_currency;
374     --
375   end if;
376   --
377   hr_utility.set_location('Leaving:'||l_proc, 10);
378 End;
379 --
380 -- ----------------------------------------------------------------------------
381 -- |--------------------------< chk_balance_name >----------------------------|
382 -- ----------------------------------------------------------------------------
383 --
384 Procedure chk_balance_name
385   (p_business_group_id         in number
386   ,p_legislation_code          in varchar2
387   ,p_balance_type_id           in number
388   ,p_balance_name              in varchar2
389   ,p_balance_name_warning      out nocopy number
390   ) is
391 --
392   l_proc         varchar2(72) := g_package||'chk_balance_name';
393   l_exists       varchar2(1);
394   l_dbi_exists   varchar2(1);
395 --
396   cursor chk_source_lang is
397     select '1'
398       from pay_balance_types_tl
399      where balance_type_id = p_balance_type_id
400        and source_lang <> userenv('LANG');
401 
402   cursor chk_db_items is
403     select '1'
404       from ff_user_entities uet,
405            pay_defined_balances dfb
406      where uet.creator_id = dfb.defined_balance_id
407        and uet.creator_type = 'B'
408        and dfb.balance_type_id = p_balance_type_id;
409 --
410 Begin
411   hr_utility.set_location('Entering:'||l_proc, 5);
412   --
413   pay_balance_types_pkg.chk_balance_type
414        (null,
415         p_business_group_id,
416         p_legislation_code,
417         p_balance_name,
418         null,
419         null);
420   --
421   hr_utility.set_location('Entering:'||l_proc, 10);
422   --
423   if( p_balance_name <> nvl(pay_blt_shd.g_old_rec.balance_name,p_balance_name)) then
424      --
425      -- Check db items exist for this balance
426      --
427      open chk_db_items;
428      fetch chk_db_items into l_dbi_exists;
429      close chk_db_items;
430      --
431        hr_utility.set_location('Entering:'||l_proc, 15);
432      --
433      if l_dbi_exists is null then
434          -- if database item does not exist
435           p_balance_name_warning := 1;
436      else
437      --
438      -- Check between source and env languages for update operations
439      -- against the base table
440      --
441         open chk_source_lang;
442         fetch chk_source_lang into l_exists;
443         close chk_source_lang;
444      --
445         if l_exists is null then
446           -- fnd_message.set_name ('PAY', 'PAY_34172_BAL_DBI_UPD');
447    	  p_balance_name_warning := 2;
448         else
449           -- fnd_message.set_name('PAY','PAY_34173_BASE_TBL_UPD');
450           p_balance_name_warning := 3;
451         end if;
452      --
453      end if;
454   end if;
455   --
456   hr_utility.set_location('Leaving:'||l_proc, 20);
457 End;
458 --
459 --
460 -- ----------------------------------------------------------------------------
461 -- |--------------------------< chk_balance_uom >--------------------------|
462 -- ----------------------------------------------------------------------------
463 --
464 Procedure chk_balance_uom
465   (p_effective_date  	   in date
466   ,p_balance_uom           in varchar2
467   ,p_assignment_remuneration_flag in varchar2
468   ,p_balance_type_id       in number
469   ,p_object_version_number in number
470   ) is
471 --
472   l_proc              varchar2(72) := g_package||'chk_balance_uom';
473   l_exists	      varchar2(1);
474   l_class_exists      varchar2(1);
475 
476   Cursor c_chk_balance_uom
477   is
478     select '1'
479       from hr_lookups hl
480      where hl.lookup_type = 'UNITS' and
481        (hl.lookup_code in ('M','I','N','ND') or hl.lookup_code like 'H%') and
482         hl.enabled_flag = 'Y' and
483         hl.lookup_code = p_balance_uom and
484         p_effective_date between nvl(hl.start_date_active,p_effective_date) and
485         nvl(hl.end_date_active,p_effective_date);
486 
487   Cursor c_chk_balance_uom_class(p_balance_uom_old varchar2)
488   is
489     select '1'
490       from hr_lookups hl
491      where hl.lookup_type = 'UNITS' and
492            hl.lookup_code = p_balance_uom and
493            substr(hl.lookup_code,1,1) = substr(p_balance_uom_old,1,1) and
494            hl.enabled_flag = 'Y' and
495            p_effective_date between nvl(hl.start_date_active,p_effective_date) and
496            nvl(hl.end_date_active,p_effective_date);
497 
498 --
499 Begin
500   hr_utility.set_location('Entering:'||l_proc, 5);
501   --
502   If (p_assignment_remuneration_flag = 'Y' and p_balance_uom <> 'M') then
503       fnd_message.set_name('PAY','PAY_34194_UOM_MUST_BE_MONEY');
504       fnd_message.raise_error;
505   elsif((pay_blt_shd.api_updating
506             (p_balance_type_id => p_balance_type_id
507             ,p_object_version_number  => p_object_version_number)) and
508     nvl(p_balance_uom,hr_api.g_varchar2) <>
509     nvl(pay_blt_shd.g_old_rec.balance_uom,hr_api.g_varchar2)) then
510     --
511     hr_utility.set_location('Entering:'||l_proc|| ' new :'||p_balance_uom||' old '||pay_blt_shd.g_old_rec.balance_uom, 10);
512     --
513     Open c_chk_balance_uom_class(pay_blt_shd.g_old_rec.balance_uom);
514     Fetch c_chk_balance_uom_class into l_class_exists;
515     If c_chk_balance_uom_class%notfound Then
516     --
517       Close c_chk_balance_uom_class;
518       fnd_message.set_name('PAY', 'HR_7462_PLK_INVLD_VALUE');
519       fnd_message.set_token('COLUMN_NAME', 'BALANCE_UOM');
520       fnd_message.raise_error;
521     --
522     End If;
523     Close c_chk_balance_uom_class;
524     --
525   else
526     --
527     hr_utility.set_location('Entering:'||l_proc, 15);
528     --
529     Open c_chk_balance_uom;
530     Fetch c_chk_balance_uom into l_exists;
531     If c_chk_balance_uom%notfound Then
532     --
533       Close c_chk_balance_uom;
534       fnd_message.set_name('PAY', 'HR_7462_PLK_INVLD_VALUE');
535       fnd_message.set_token('COLUMN_NAME', 'BALANCE_UOM');
536       fnd_message.raise_error;
537     --
538      End If;
539     Close c_chk_balance_uom;
540   End If;
541   --
545 -- ----------------------------------------------------------------------------
542   hr_utility.set_location('Leaving:'||l_proc, 20);
543 End;
544 --
546 -- |--------------------------< chk_reporting_name >----------------------------|
547 -- ----------------------------------------------------------------------------
548 --
549 Procedure chk_reporting_name
550   (p_business_group_id         in number
551   ,p_legislation_code          in varchar2
552   ,p_reporting_name            in varchar2
553   ) is
554 --
555   l_proc         varchar2(72) := g_package||'chk_reporting_name';
556   l_exists       varchar2(1);
557 --
558 Begin
559   hr_utility.set_location('Entering:'||l_proc, 5);
560   --
561   pay_balance_types_pkg.chk_balance_type
562        (null,
563         p_business_group_id,
564         p_legislation_code,
565         null,
566         p_reporting_name,
567         null);
568   --
569   hr_utility.set_location('Leaving:'||l_proc, 10);
570 End;
571 --
572 --
573 -- ----------------------------------------------------------------------------
574 -- |--------------------------< chk_balance_category_id >---------------------|
575 -- ----------------------------------------------------------------------------
576 --
577 Procedure chk_balance_category_id
578   (p_effective_date  	          in date
579   ,p_business_group_id            in number
580   ,p_legislation_code             in varchar2
581   ,p_balance_category_id          in number
582   ) is
583 --
584   l_proc              varchar2(72) := g_package||'chk_balance_category_id';
585   l_exists	      varchar2(1);
586 
587   Cursor c_chk_balance_category
588   is
589    select '1'
590      from pay_balance_categories_f
591     where balance_category_id = p_balance_category_id
592        and  nvl(legislation_code,
593          nvl(HR_API.RETURN_LEGISLATION_CODE(p_business_group_id),'~~nvl~~')) =
594        nvl(p_legislation_code,nvl(HR_API.RETURN_LEGISLATION_CODE(p_business_group_id),'~~nvl~~'))
595       and p_effective_date between effective_start_date
596                                      and effective_end_date;
597 --
598 Begin
599   hr_utility.set_location('Entering:'||l_proc, 5);
600   --
601   if (p_balance_category_id is null and
602      pay_balance_types_pkg.chk_balance_category_rule(
603         nvl(p_legislation_code,hr_api.return_legislation_code(p_business_group_id)))) then
604      hr_api.mandatory_arg_error
605      (p_api_name                     => l_proc
606      ,p_argument                     => 'balance_category_id'
607      ,p_argument_value               => p_balance_category_id
608     );
609   end if;
610    --
611    hr_utility.set_location('Entering:'||l_proc, 10);
612    --
613    Open c_chk_balance_category;
614    Fetch c_chk_balance_category into l_exists;
615    If c_chk_balance_category%notfound Then
616     --
617       Close c_chk_balance_category;
618       fnd_message.set_name('PAY', 'HR_7462_PLK_INVLD_VALUE');
619       fnd_message.set_token('COLUMN_NAME', 'BALANCE_CATEGORY_ID');
620       fnd_message.raise_error;
621     --
622    End If;
623     Close c_chk_balance_category;
624   --
625   hr_utility.set_location('Leaving:'||l_proc, 15);
626 End;
627 --
628 --
629 -- ----------------------------------------------------------------------------
630 -- |--------------------------< chk_base_balance_type_id >---------------------|
631 -- ----------------------------------------------------------------------------
632 --
633 Procedure chk_base_balance_type_id
634   (p_effective_date  	          in date
635   ,p_business_group_id            in number
636   ,p_legislation_code             in varchar2
637   ,p_base_balance_type_id         in number
638   ) is
639 --
640   l_proc              varchar2(72) := g_package||'chk_base_balance_type_id';
641   l_exists	      varchar2(1);
642 
643   Cursor c_chk_base_balance
644   is
645    select '1'
646      from  pay_balance_types
647     where  base_balance_type_id is null
648       and  balance_type_id = p_base_balance_type_id
649       and    ((p_business_group_id is not null
650       and    nvl(business_group_id,-1) = p_business_group_id
651        or     nvl(legislation_code,nvl(HR_API.RETURN_LEGISLATION_CODE(p_business_group_id),'~~nvl~~')) =
652                     nvl(p_legislation_code,nvl(hr_api.return_legislation_code(p_business_group_id),'~~nvl~~')))
653        or     (p_legislation_code is not null
654       and    nvl(legislation_code,' ') = p_legislation_code
655        or     business_group_id is not null
656       and    legislation_code = p_legislation_code)
657        or     business_group_id is null
658       and    legislation_code is null)	;
659 --
660 Begin
661   hr_utility.set_location('Entering:'||l_proc, 5);
662   --
663    Open c_chk_base_balance;
664    Fetch c_chk_base_balance into l_exists;
665    If c_chk_base_balance%notfound Then
666     --
667       Close c_chk_base_balance;
668       fnd_message.set_name('PAY', 'HR_7462_PLK_INVLD_VALUE');
669       fnd_message.set_token('COLUMN_NAME', 'BASE_BALANCE_TYPE_ID'||p_base_balance_type_id||'value unknown');
670       fnd_message.raise_error;
671     --
672      End If;
673     Close c_chk_base_balance;
674   --
675   hr_utility.set_location('Leaving:'||l_proc, 10);
676 End;
677 --
678 --
679 -- ----------------------------------------------------------------------------
680 -- |--------------------------< chk_input_value_id >--------------------------|
681 -- ----------------------------------------------------------------------------
682 --
683 Procedure chk_input_value_id
684   (p_effective_date  	    in date
685   ,p_input_value_id         in number
689 --
686   ,p_balance_uom            in varchar2
687   ,p_balance_type_id        in number
688   ) is
690   l_proc              varchar2(72) := g_package||'chk_input_value_id';
691   l_exists	      varchar2(1);
692 
693   Cursor c_chk_input_value
694   is
695     select '1'
696       from pay_input_values_f
697      where input_value_id = p_input_value_id
698        and uom = p_balance_uom
699        and p_effective_date between effective_start_date and effective_end_date;
700 --
701 Begin
702   hr_utility.set_location('Entering:'||l_proc, 5);
703   --
704    Open c_chk_input_value;
705    Fetch c_chk_input_value into l_exists;
706    If c_chk_input_value%notfound Then
707     --
708       Close c_chk_input_value;
709       fnd_message.set_name('PAY', 'HR_7462_PLK_INVLD_VALUE');
710       fnd_message.set_token('COLUMN_NAME', 'INPUT_VALUE_ID');
711       fnd_message.raise_error;
712     --
713    End If;
714    Close c_chk_input_value;
715   --
716   --
717   hr_utility.set_location('Entering:'||l_proc, 10);
718   --
719   --
720   -- INPUT_VALUE_ID can be updated only if its value is null and there is
721   -- no balance feed exist except initial feed or there is no balance
722   -- classification exists.
723   --
724   If(p_input_value_id is not null and
725     nvl(p_input_value_id,hr_api.g_number) <>
726      nvl(pay_blt_shd.g_old_rec.input_value_id,hr_api.g_number)) then
727      --
728 
729      if (hr_balance_feeds.manual_bal_feeds_exist(p_balance_type_id) or
730         hr_balance_feeds.bal_classifications_exist(p_balance_type_id)) then
731      --
732         fnd_message.set_name('PAY','PAY_34195_FEED_OR_CLASS_EXIST');
733         fnd_message.raise_error;
734      end if;
735     --
736   End if;
737 
738 
739   hr_utility.set_location('Leaving:'||l_proc, 10);
740 End;
741 --
742 --
743 -- ----------------------------------------------------------------------------
744 -- |--------------------------< recreate_db_items >---------------------------|
745 -- ----------------------------------------------------------------------------
746 --
747 PROCEDURE recreate_db_items(p_balance_type_id in number) is
748   cursor get_defined_balances is
749     select defined_balance_id,
750            balance_dimension_id,
751            business_group_id,
752            legislation_code
753       from pay_defined_balances dfb
754      where dfb.balance_type_id = p_balance_type_id;
755   --
756   l_exists varchar2(1);
757   --
758   BEGIN
759     --
760       for l_dfb in get_defined_balances loop
761         hrdyndbi.recreate_defined_balance
762           (p_defined_balance_id   => l_dfb.defined_balance_id,
763            p_balance_dimension_id => l_dfb.balance_dimension_id,
764            p_balance_type_id      => p_balance_type_id,
765            p_business_group_id    => l_dfb.business_group_id,
766            p_legislation_code     => l_dfb.legislation_code);
767        end loop;
768     --
769   END recreate_db_items;
770 --
771 -- ----------------------------------------------------------------------------
772 -- |--------------------------< insert_primary_balance_feed >-----------------|
773 -- ----------------------------------------------------------------------------
774 --
775 procedure insert_primary_balance_feed
776    ( p_effective_date       in date
777     ,p_business_group_id    in number
778     ,p_balance_type_id      in number
779     ,p_input_value_id       in number
780    ) is
781   --
782   l_proc   varchar2(72) := g_package||'insert_primary_balance_feed';
783   l_exists number;
784 
785   cursor feed_exists
786   is
787   select null
788   from   pay_balance_feeds_f pbf
789   where  pbf.balance_type_id = p_balance_type_id
790   and    pbf.input_value_id  = p_input_value_id
791   and    nvl(pbf.business_group_id, -1) = nvl(p_business_group_id, -1)
792   and    nvl(pbf.legislation_code, 'NULL') =
793          nvl(hr_api.return_legislation_code(p_business_group_id), 'NULL')
794   and    p_effective_date between pbf.effective_start_date
795                                        and pbf.effective_end_date;
796 
797 
798   BEGIN
799     hr_utility.set_location('Entering:'||l_proc, 5);
800     --
801     open  feed_exists;
802     fetch feed_exists into l_exists;
803     if feed_exists%notfound then
804       close feed_exists;
805       --
806       hr_utility.set_location('Entering:'||l_proc, 10);
807       --
808       hr_balances.ins_balance_feed
809         (p_option                     => 'INS_PRIMARY_BALANCE_FEED'
810         ,p_input_value_id             => p_input_value_id
811         ,p_element_type_id            => null
812         ,p_primary_classification_id  => ''
813         ,p_sub_classification_id      => ''
814         ,p_sub_classification_rule_id => ''
815         ,p_balance_type_id            => p_balance_type_id
816         ,p_scale                      => 1
817         ,p_session_date               => p_effective_date
818         ,p_business_group             => p_business_group_id
819         ,p_legislation_code
820 	             => hr_api.return_legislation_code(p_business_group_id)
821         ,p_mode
822 	             => hr_startup_data_api_support.g_startup_mode
823         );
824     else
825       close feed_exists;
826     end if;
827     --
828     hr_utility.set_location('Leaving:'||l_proc, 15);
829     --
830   END Insert_primary_balance_feed;
831 --
832 -- ----------------------------------------------------------------------------
833 -- |------------------------< chk_legislation_code >--------------------------|
834 -- ----------------------------------------------------------------------------
838 --   parent table
835 --
836 -- Description:
837 --   This procedure is used to validate the legislation code against the
839 --
840 -- ----------------------------------------------------------------------------
841 Procedure chk_legislation_code
842   (p_legislation_code  in varchar2)
843   is
844 --
845   l_proc        varchar2(72) := g_package||'chk_legislation_code';
846   l_exists varchar2(1);
847 
848   Cursor c_chk_leg_code
849   is
850     select null
851       from fnd_territories
852      where territory_code = p_legislation_code;
853 --
854 Begin
855   hr_utility.set_location('Entering:'||l_proc, 5);
856   --
857   If p_legislation_code is not null then
858 
859     Open c_chk_leg_code;
860     Fetch c_chk_leg_code into l_exists;
861     If c_chk_leg_code%notfound Then
862       --
863       Close c_chk_leg_code;
864       fnd_message.set_name('PAY','PAY_33085_INVALID_FK');
865       fnd_message.set_token('COLUMN','LEGISLATION_CODE');
866       fnd_message.set_token('TABLE','FND_TERRITORIES');
867       fnd_message.raise_error;
868       --
869     End If;
870     Close c_chk_leg_code;
871 
872   End If;
873   --
874   hr_utility.set_location('Leaving:'||l_proc, 10);
875 End;
876 
877 --
878 -- ----------------------------------------------------------------------------
879 -- |-----------------------< chk_non_updateable_args >------------------------|
880 -- ----------------------------------------------------------------------------
881 -- {Start Of Comments}
882 --
883 -- Description:
884 --   This procedure is used to ensure that non updateable attributes have
885 --   not been updated. If an attribute has been updated an error is generated.
886 --
887 -- Pre Conditions:
888 --   g_old_rec has been populated with details of the values currently in
889 --   the database.
890 --
891 -- In Arguments:
892 --   p_rec has been populated with the updated values the user would like the
893 --   record set to.
894 --
895 -- Post Success:
896 --   Processing continues if all the non updateable attributes have not
897 --   changed.
898 --
899 -- Post Failure:
900 --   An application error is raised if any of the non updatable attributes
901 --   have been altered.
902 --
903 -- {End Of Comments}
904 -- ----------------------------------------------------------------------------
905 Procedure chk_non_updateable_args
906   (p_effective_date               in date
907   ,p_rec in pay_blt_shd.g_rec_type
908   ) IS
909 --
910   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
911   l_argument varchar2(80);
912   l_error    exception;
913 --
914 Begin
915   --
916   -- Only proceed with the validation if a row exists for the current
917   -- record in the HR Schema.
918   --
919   IF NOT pay_blt_shd.api_updating
920       (p_balance_type_id                   => p_rec.balance_type_id
921       ,p_object_version_number             => p_rec.object_version_number
922       ) THEN
923      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
924      fnd_message.set_token('PROCEDURE ', l_proc);
925      fnd_message.set_token('STEP ', '5');
926      fnd_message.raise_error;
927   END IF;
928   --
929    hr_utility.set_location('Entering:'||l_proc, 10);
930   --
931   -- Ensure that the following attributes are not updated.
932   --
933   If nvl(p_rec.business_group_id,hr_api.g_number) <>
934      nvl(pay_blt_shd.g_old_rec.business_group_id,hr_api.g_number) then
935     --
936     l_argument := 'business_group_id';
937     raise l_error;
938     --
939   End if;
940   --
941   hr_utility.set_location('Entering:'||l_proc, 15);
942   --
943   If nvl(p_rec.legislation_code,hr_api.g_varchar2) <>
944      nvl(pay_blt_shd.g_old_rec.legislation_code,hr_api.g_varchar2) then
945     --
946     l_argument := 'legislation_code';
947     raise l_error;
948     --
949   End if;
950   --
951   hr_utility.set_location('Entering:'||l_proc, 20);
952   --
953   If nvl(p_rec.balance_type_id,hr_api.g_number) <>
954      nvl(pay_blt_shd.g_old_rec.balance_type_id,hr_api.g_number) then
955     --
956     l_argument := 'balance_type_id';
957     raise l_error;
958     --
959   End if;
960   --
961   hr_utility.set_location('Entering:'||l_proc, 25);
962   -- balance category can be updated only if it is null
963   --
964   If(pay_blt_shd.g_old_rec.balance_category_id is not null and
965     nvl(p_rec.balance_category_id,hr_api.g_number) <>
966      nvl(pay_blt_shd.g_old_rec.balance_category_id,hr_api.g_number)) then
967     --
968     l_argument := 'balance_category_id';
969     raise l_error;
970     --
971   End if;
972   --
973    hr_utility.set_location('Entering:'||l_proc, 30);
974   -- jurisdiction_level can not be updated
975   --
976   If nvl(p_rec.jurisdiction_level,hr_api.g_number) <>
977      nvl(pay_blt_shd.g_old_rec.jurisdiction_level,hr_api.g_number) then
978     --
979     l_argument := 'jurisdiction_level';
980     raise l_error;
981     --
982   End if;
983   --
984      hr_utility.set_location('Entering:'||l_proc, 35);
985   -- Tax_Type can not be updated
986   --
987   If nvl(p_rec.tax_type,hr_api.g_varchar2) <>
988      nvl(pay_blt_shd.g_old_rec.tax_type,hr_api.g_varchar2) then
989     --
990     l_argument := 'tax_type';
991     raise l_error;
992     --
993   End if;
994   --
995    --
996   hr_utility.set_location('Entering:'||l_proc, 45);
997   --
998   If nvl(p_rec.legislation_subgroup,hr_api.g_varchar2) <>
1002     raise l_error;
999      nvl(pay_blt_shd.g_old_rec.legislation_subgroup,hr_api.g_varchar2) then
1000     --
1001     l_argument := 'legislation_subgroup';
1003     --
1004   End if;
1005   --
1006   hr_utility.set_location('Leaving :'||l_proc, 50);
1007 EXCEPTION
1008   WHEN l_error THEN
1009       hr_api.argument_changed_error
1010          (p_api_name => l_proc
1011          ,p_argument => l_argument);
1012   WHEN OTHERS THEN
1013       RAISE;
1014   --
1015 End chk_non_updateable_args;
1016 --
1017 --
1018 -- ----------------------------------------------------------------------------
1019 -- |----------------------< chk_startup_action >------------------------------|
1020 -- ----------------------------------------------------------------------------
1021 --
1022 -- Description:
1023 --  This procedure will check that the current action is allowed according
1024 --  to the current startup mode.
1025 --
1026 -- ----------------------------------------------------------------------------
1027 PROCEDURE chk_startup_action
1028   (p_insert               IN boolean
1029   ,p_business_group_id    IN number
1030   ,p_legislation_code     IN varchar2
1031   ,p_legislation_subgroup IN varchar2 DEFAULT NULL) IS
1032 --
1033 BEGIN
1034   --
1035   -- Call the supporting procedure to check startup mode
1036   -- EDIT_HERE: The following call should be edited if certain types of rows
1037   -- are not permitted.
1038   IF (p_insert) THEN
1039     hr_startup_data_api_support.chk_startup_action
1040       (p_generic_allowed   => FALSE
1041       ,p_startup_allowed   => TRUE
1042       ,p_user_allowed      => TRUE
1043       ,p_business_group_id => p_business_group_id
1044       ,p_legislation_code  => p_legislation_code
1045       ,p_legislation_subgroup => p_legislation_subgroup
1046       );
1047   ELSE
1048     hr_startup_data_api_support.chk_upd_del_startup_action
1049       (p_generic_allowed   => FALSE
1050       ,p_startup_allowed   => TRUE
1051       ,p_user_allowed      => TRUE
1052       ,p_business_group_id => p_business_group_id
1053       ,p_legislation_code  => p_legislation_code
1054       ,p_legislation_subgroup => p_legislation_subgroup
1055       );
1056   END IF;
1057   --
1058 END chk_startup_action;
1059 --
1060 -- ----------------------------------------------------------------------------
1061 -- |---------------------------< insert_validate >----------------------------|
1062 -- ----------------------------------------------------------------------------
1063 Procedure insert_validate
1064   (p_effective_date               in date
1065   ,p_rec                          in pay_blt_shd.g_rec_type
1066   ) is
1067 --
1068   l_proc                    varchar2(72) := g_package||'insert_validate';
1069   l_balance_name_warning    number;
1070 --
1071 Begin
1072   hr_utility.set_location('Entering:'||l_proc, 5);
1073   --
1074   -- Call all supporting business operations
1075   --
1076   --
1077   chk_startup_action(true
1078                     ,p_rec.business_group_id
1079                     ,p_rec.legislation_code
1080                     );
1081   IF hr_startup_data_api_support.g_startup_mode
1082                      NOT IN ('GENERIC','STARTUP') THEN
1083      --
1084      -- Validate Important Attributes
1085      --
1086      hr_api.validate_bus_grp_id
1087        (p_business_group_id => p_rec.business_group_id
1088        ,p_associated_column1 => pay_blt_shd.g_tab_nam
1089                                 || '.BUSINESS_GROUP_ID');
1090      --
1091      -- after validating the set of important attributes,
1092      -- if Multiple Message Detection is enabled and at least
1093      -- one error has been found then abort further validation.
1094      --
1095      hr_multi_message.end_validation_set;
1096   END IF;
1097   --
1098   --
1099   -- Validate Dependent Attributes
1100   --
1101   -- ----------------------------------------------------------------------------
1102   IF hr_startup_data_api_support.g_startup_mode
1103                      IN ('STARTUP') THEN
1104 
1105    chk_legislation_code
1106        (p_legislation_code    => p_rec.legislation_code);
1107   End if;
1108   --
1109   -- ----------------------------------------------------------------------------
1110   --
1111   chk_assignment_remuneration_fg
1112   (p_assignment_remuneration_flag   => p_rec.assignment_remuneration_flag
1113   ,p_business_group_id              => p_rec.business_group_id
1114   ,p_legislation_code               => p_rec.legislation_code
1115   );
1116   -- ----------------------------------------------------------------------------
1117   --
1118   chk_currency_code
1119   (p_effective_date  	   => p_effective_date
1120   ,p_business_group_id     => p_rec.business_group_id
1121   ,p_legislation_code      => p_rec.legislation_code
1122   ,p_balance_uom           => p_rec.balance_uom
1123   ,p_currency_code         => p_rec.currency_code
1124   );
1125 
1126   -- ----------------------------------------------------------------------------
1127 
1128  chk_balance_name
1129   (p_business_group_id     => p_rec.business_group_id
1130   ,p_legislation_code      => p_rec.legislation_code
1131   ,p_balance_type_id       => p_rec.balance_type_id
1132   ,p_balance_name          => p_rec.balance_name
1133   ,p_balance_name_warning  => l_balance_name_warning
1134   );
1135 
1136   -- ----------------------------------------------------------------------------
1137 
1138  chk_balance_uom
1139   (p_effective_date  	           => p_effective_date
1140   ,p_balance_uom                   => p_rec.balance_uom
1141   ,p_assignment_remuneration_flag  => p_rec.assignment_remuneration_flag
1142   ,p_balance_type_id               => p_rec.balance_type_id
1143   ,p_object_version_number         => p_rec.object_version_number
1144   );
1148      (p_business_group_id     => p_rec.business_group_id
1145   -- ----------------------------------------------------------------------------
1146   if p_rec.reporting_name is not null then
1147      chk_reporting_name
1149      ,p_legislation_code      => p_rec.legislation_code
1150      ,p_reporting_name        => p_rec.reporting_name
1151      );
1152   end if;
1153   -- ----------------------------------------------------------------------------
1154   if p_rec.balance_category_id is not null then
1155      chk_balance_category_id
1156      (p_effective_date        => p_effective_date
1157      ,p_business_group_id     => p_rec.business_group_id
1158      ,p_legislation_code      => p_rec.legislation_code
1159      ,p_balance_category_id   => p_rec.balance_category_id
1160      );
1161   end if;
1162   -- ----------------------------------------------------------------------------
1163   if p_rec.base_balance_type_id is not null then
1164      chk_base_balance_type_id
1165      (p_effective_date        => p_effective_date
1166      ,p_business_group_id     => p_rec.business_group_id
1167      ,p_legislation_code      => p_rec.legislation_code
1168      ,p_base_balance_type_id  => p_rec.base_balance_type_id
1169      ) ;
1170   end if;
1171   -- ----------------------------------------------------------------------------
1172   if p_rec.input_value_id is not null then
1173      chk_input_value_id
1174      (p_effective_date         => p_effective_date
1175      ,p_input_value_id         => p_rec.input_Value_id
1176      ,p_balance_uom            => p_rec.balance_uom
1177      ,p_balance_type_id        => p_rec.balance_type_id
1178      );
1179   end if;
1180 
1181   pay_blt_bus.chk_df(p_rec);
1182   --
1183   hr_utility.set_location(' Leaving:'||l_proc, 10);
1184 End insert_validate;
1185 --
1186 -- ----------------------------------------------------------------------------
1187 -- |---------------------------< update_validate >----------------------------|
1188 -- ----------------------------------------------------------------------------
1189 Procedure update_validate
1190   (p_effective_date               in date
1191   ,p_rec                          in pay_blt_shd.g_rec_type
1192   ,p_balance_name_warning         out nocopy number
1193 
1194   ) is
1195 --
1196   l_proc  varchar2(72) := g_package||'update_validate';
1197   l_balance_name_warning    number;
1198 
1199 --
1200 Begin
1201   hr_utility.set_location('Entering:'||l_proc, 5);
1202   --
1203   -- Call all supporting business operations
1204   --
1205   --
1206   chk_startup_action(false
1207                     ,p_rec.business_group_id
1208                     ,p_rec.legislation_code
1209                     );
1210   IF hr_startup_data_api_support.g_startup_mode
1211                      NOT IN ('GENERIC','STARTUP') THEN
1212      --
1213      -- Validate Important Attributes
1214      --
1215      hr_api.validate_bus_grp_id
1216        (p_business_group_id => p_rec.business_group_id
1217        ,p_associated_column1 => pay_blt_shd.g_tab_nam
1218                                 || '.BUSINESS_GROUP_ID');
1219      --
1220      -- After validating the set of important attributes,
1221      -- if Multiple Message Detection is enabled and at least
1222      -- one error has been found then abort further validation.
1223      --
1224      hr_multi_message.end_validation_set;
1225   END IF;
1226   --
1227   --
1228   -- Validate Dependent Attributes
1229   --
1230   chk_non_updateable_args
1231     (p_effective_date              => p_effective_date
1232       ,p_rec              => p_rec
1233     );
1234   --
1235   -- ----------------------------------------------------------------------------
1236   --
1237   chk_assignment_remuneration_fg
1238   (p_assignment_remuneration_flag   => p_rec.assignment_remuneration_flag
1239   ,p_business_group_id              => p_rec.business_group_id
1240   ,p_legislation_code               => p_rec.legislation_code
1241   );
1242   -- ----------------------------------------------------------------------------
1243   --
1244   chk_currency_code
1245   (p_effective_date  	   => p_effective_date
1246   ,p_business_group_id     => p_rec.business_group_id
1247   ,p_legislation_code      => p_rec.legislation_code
1248   ,p_balance_uom           => p_rec.balance_uom
1249   ,p_currency_code         => p_rec.currency_code
1250   );
1251 
1252   -- ----------------------------------------------------------------------------
1253   if nvl(p_rec.balance_name,hr_api.g_varchar2) <>
1254        nvl(pay_blt_shd.g_old_rec.balance_name,hr_api.g_varchar2) then
1255      chk_balance_name
1256      (p_business_group_id     => p_rec.business_group_id
1257      ,p_legislation_code      => p_rec.legislation_code
1258      ,p_balance_type_id       => p_rec.balance_type_id
1259      ,p_balance_name          => p_rec.balance_name
1260      ,p_balance_name_warning  => l_balance_name_warning
1261      );
1262       p_balance_name_warning := l_balance_name_warning;
1263   end if;
1264 
1265 
1266   -- ----------------------------------------------------------------------------
1267 
1268   chk_balance_uom
1269   (p_effective_date  	           => p_effective_date
1270   ,p_balance_uom                   => p_rec.balance_uom
1271   ,p_assignment_remuneration_flag  => p_rec.assignment_remuneration_flag
1272   ,p_balance_type_id               => p_rec.balance_type_id
1273   ,p_object_version_number         => p_rec.object_version_number
1274   );
1275   -- ----------------------------------------------------------------------------
1276 
1277   if (p_rec.reporting_name is not null  and
1278       nvl(p_rec.reporting_name,hr_api.g_varchar2) <>
1279            nvl(pay_blt_shd.g_old_rec.reporting_name,hr_api.g_varchar2)) then
1280      chk_reporting_name
1281      (p_business_group_id     => p_rec.business_group_id
1285   end if;
1282      ,p_legislation_code      => p_rec.legislation_code
1283      ,p_reporting_name        => p_rec.reporting_name
1284      );
1286   -- ----------------------------------------------------------------------------
1287   if p_rec.balance_category_id is not null then
1288      chk_balance_category_id
1289      (p_effective_date        => p_effective_date
1290      ,p_business_group_id     => p_rec.business_group_id
1291      ,p_legislation_code      => p_rec.legislation_code
1292      ,p_balance_category_id   => p_rec.balance_category_id
1293      );
1294   end if;
1295   -- ----------------------------------------------------------------------------
1296   if p_rec.base_balance_type_id is not null then
1297      chk_base_balance_type_id
1298      (p_effective_date        => p_effective_date
1299      ,p_business_group_id     => p_rec.business_group_id
1300      ,p_legislation_code      => p_rec.legislation_code
1301      ,p_base_balance_type_id  => p_rec.base_balance_type_id
1302      ) ;
1303   end if;
1304   -- ----------------------------------------------------------------------------
1305   if p_rec.input_value_id is not null then
1306      chk_input_value_id
1307      (p_effective_date         => p_effective_date
1308      ,p_input_value_id         => p_rec.input_Value_id
1309      ,p_balance_uom            => p_rec.balance_uom
1310      ,p_balance_type_id        => p_rec.balance_type_id
1311      );
1312   end if;
1313 -- ----------------------------------------------------------------------------
1314 
1315   --
1316   pay_blt_bus.chk_df(p_rec);
1317   --
1318   hr_utility.set_location(' Leaving:'||l_proc, 10);
1319 End update_validate;
1320 --
1321 -- ----------------------------------------------------------------------------
1322 -- |---------------------------< delete_validate >----------------------------|
1323 -- ----------------------------------------------------------------------------
1324 Procedure delete_validate
1325   (p_rec                          in pay_blt_shd.g_rec_type
1326   ) is
1327 --
1328   l_proc  varchar2(72) := g_package||'delete_validate';
1329 --
1330 Begin
1331   hr_utility.set_location('Entering:'||l_proc, 5);
1332   --
1333     --
1334   chk_startup_action(false
1335                     ,pay_blt_shd.g_old_rec.business_group_id
1336                     ,pay_blt_shd.g_old_rec.legislation_code
1337                     );
1338   IF hr_startup_data_api_support.g_startup_mode
1339                      NOT IN ('GENERIC','STARTUP') THEN
1340      --
1341      -- Validate Important Attributes
1342      --
1343      --
1344      -- After validating the set of important attributes,
1345      -- if Multiple Message Detection is enabled and at least
1346      -- one error has been found then abort further validation.
1347      --
1348      hr_multi_message.end_validation_set;
1349   END IF;
1350   --
1351   -- Call all supporting business operations
1352   --
1353   hr_utility.set_location(' Leaving:'||l_proc, 10);
1354 End delete_validate;
1355 --
1356 end pay_blt_bus;