1 Package Body pay_pbc_bus as
2 /* $Header: pypbcrhi.pkb 120.0 2005/05/29 07:19:45 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pay_pbc_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_category_id number default null;
15 --
16 -- ---------------------------------------------------------------------------
17 -- |----------------------< set_security_group_id >--------------------------|
18 -- ---------------------------------------------------------------------------
19 --
20 Procedure set_security_group_id
21 (p_balance_category_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_balance_categories_f pbc
31 where pbc.balance_category_id = p_balance_category_id
32 and pbg.business_group_id = pbc.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 => 'balance_category_id'
48 ,p_argument_value => p_balance_category_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,'BALANCE_CATEGORY_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_balance_category_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_balance_categories_f pbc
95 where pbc.balance_category_id = p_balance_category_id
96 and pbg.business_group_id (+) = pbc.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 => 'balance_category_id'
112 ,p_argument_value => p_balance_category_id
113 );
114 --
115 if ( nvl(pay_pbc_bus.g_balance_category_id, hr_api.g_number)
116 = p_balance_category_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_pbc_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_pbc_bus.g_balance_category_id := p_balance_category_id;
147 pay_pbc_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_category_name >----------------------------|
155 -- ----------------------------------------------------------------------------
156 -- {Start Of Comments}
157 --
158 -- Description:
159 -- This procedure is used to ensure that the category_name is unique.
160 -- A hierachy is used to prevent duplicate category names. GENERIC mode takes
161 -- priority, if a generic row exists then error with duplicate name, but if a
162 -- startup or user row exists with same name then error, saying the existig
163 -- row must be deleted and retry insert of GENERIC.
164 -- IF in STARTUP mode, if generic row or startup row in same legislation
165 -- exists then error - duplicate row.
166 -- NB. user rows cannot be created for balance categories. If in the future
167 -- they can be created see pay_bad_bus.chk_attribute_name for additional
168 -- functionality.
169 --
170 -- Pre Conditions:
171 -- g_old_rec has been populated with details of the values currently in
172 -- the database.
173 --
174 -- In Arguments:
175 -- p_rec has been populated with the updated values the user would like the
176 -- record set to.
177 --
178 -- Post Success:
179 -- Processing continues if a valid category_name has been entered.
180 --
181 -- Post Failure:
182 -- An application error is raised if a duplicate category_name has been
183 -- entered.
184 --
185 -- {End Of Comments}
186 -- ----------------------------------------------------------------------------
187 Procedure chk_category_name
188 (p_balance_category_id in number
189 ,p_category_name in varchar2
190 ,p_effective_date in date
191 ,p_business_group_id in number default null
192 ,p_legislation_code in varchar2 default null) IS
193 --
194 l_proc varchar2(72) := g_package || 'chk_category_name';
195 l_error EXCEPTION;
196 l_argument varchar2(30);
197 l_category_name varchar2(80);
198 l_bg_id number;
199 l_leg_code varchar2(80);
200 l_mode varchar2(30);
201 l_bg_leg varchar2(80);
202 --
203 -- NB removed date restriction, as does not work if p_effective_date
204 -- is before the p_effective_start_date.
205 --
206 cursor csr_category_name is
207 select pbc.category_name
208 , pbc.legislation_code
209 , pbc.business_group_id
210 from pay_balance_categories_f pbc
211 where pbc.category_name = p_category_name;
212 Begin
213 --
214 hr_utility.set_location('Entering: '||l_proc,5);
215 --
216 -- Only execute the cursor if absolutely necessary.
217 -- a) During update, the run_type_name has actually changed to another not
218 -- null value, i,e, the value passed to this procedure is different to the
219 -- g_old_rec value.
220 -- b) During insert, the run_type_name is null.
221 -- Can tell the difference between insert and update by looking at the
222 -- primary key value. For update it will be not null. For insert it will be
223 -- null, because pre_inset has not been called yet.
224 --
225 IF (((p_balance_category_id is not null) and
226 nvl(pay_pbc_shd.g_old_rec.category_name, hr_api.g_varchar2) <>
227 nvl(p_category_name, hr_api.g_varchar2))
228 or
229 (p_balance_category_id is null)) then
230 --
231 hr_utility.set_location(l_proc, 10);
232 --
233 -- Only need to open the cursor if category_name is not null
234 --
235 if p_category_name is not null then
236 --
237 l_mode := hr_startup_data_api_support.return_startup_mode;
238 --
239 OPEN csr_category_name;
240 FETCH csr_category_name INTO l_category_name
241 ,l_leg_code
242 ,l_bg_id;
243 IF csr_category_name%NOTFOUND THEN
244 --
245 hr_utility.trace('insert row');
246 CLOSE csr_category_name;
247 ELSE
248 --
249 if l_mode = 'GENERIC' then
250 hr_utility.set_location(l_proc, 15);
251 if (l_leg_code is null and l_bg_id is null) then
252 hr_utility.set_message(801,'PAY_34223_CAT_DUP_GEN');
253 hr_utility.raise_error;
254 elsif
255 l_leg_code is not null
256 or l_bg_id is not null then
257 -- name exists at lower level, existing row must be deleted
258 -- so new seeded row can be inserted.
259 hr_utility.set_message(801,'PAY_34224_S_CAT_LOW_LVL_DEL');
260 hr_utility.raise_error;
264 if (l_leg_code = p_legislation_code) then
261 end if;
262 elsif l_mode = 'STARTUP' THEN
263 hr_utility.set_location(l_proc, 20);
265 hr_utility.set_message(801,'PAY_34225_CAT_DUP_S');
266 hr_utility.raise_error;
267 elsif
268 l_leg_code is null then
269 if l_bg_id is not null then
270 hr_utility.trace('here');
271 hr_utility.set_message(801,'PAY_34226_U_CAT_LOW_LVL_DEL');
272 hr_utility.raise_error;
273 else -- l_bg_id is null then
274 hr_utility.trace('here2');
275 hr_utility.set_message(801,'PAY_34227_G_CAT_HI_LVL');
276 hr_utility.raise_error;
277 end if;
278 end if;
279 end if; -- what mode
280 close csr_category_name;
281 --
282 END IF;
283 end if;
284 end if;
285 hr_utility.set_location('Leaving: '||l_proc, 20);
286 --
287 END chk_category_name;
288 -- ----------------------------------------------------------------------------
289 -- |-----------------------< chk_user_category_name >-------------------------|
290 -- ----------------------------------------------------------------------------
291 -- {Start Of Comments}
292 --
293 -- Description:
294 -- Note: user_category_name is being added for NLS support of this table.
295 -- The check functionality is the same as for category_name.
296 -- This procedure is used to ensure that the user_category_name is unique.
297 -- A hierachy is used to prevent duplicate user category names. GENERIC mode
298 -- takes priority, if a generic row exists then error with duplicate name,
299 -- but if a startup or user row exists with same name then error, saying the
300 -- existig row must be deleted and retry insert of GENERIC.
301 -- IF in STARTUP mode, if generic row or startup row in same legislation
302 -- exists then error - duplicate row.
303 -- NB. user rows cannot be created for balance categories. If in the future
304 -- they can be created see pay_bad_bus.chk_attribute_name for additional
305 -- functionality.
306 --
307 -- Pre Conditions:
308 -- g_old_rec has been populated with details of the values currently in
309 -- the database.
310 --
311 -- In Arguments:
312 -- p_rec has been populated with the updated values the user would like the
313 -- record set to.
314 --
315 -- Post Success:
316 -- Processing continues if a valid user_category_name has been entered.
317 --
318 -- Post Failure:
319 -- An application error is raised if a duplicate user_category_name has been
320 -- entered.
321 --
322 -- {End Of Comments}
323 -- ----------------------------------------------------------------------------
324 Procedure chk_user_category_name
325 (p_balance_category_id in number
326 ,p_user_category_name in varchar2
327 ,p_business_group_id in number default null
328 ,p_legislation_code in varchar2 default null) IS
329 --
333 l_user_category_name varchar2(80);
330 l_proc varchar2(72) := g_package || 'chk_user_category_name';
331 l_error EXCEPTION;
332 l_argument varchar2(30);
334 l_bg_id number;
335 l_leg_code varchar2(80);
336 l_mode varchar2(30);
337 l_bg_leg varchar2(80);
338 --
339 cursor csr_user_category_name is
340 select pbc.user_category_name
341 , pbc.legislation_code
342 , pbc.business_group_id
343 from pay_balance_categories_f pbc
344 where pbc.user_category_name = p_user_category_name;
345 Begin
346 --
347 hr_utility.set_location('Entering: '||l_proc,5);
348 --
349 -- Only execute the cursor if absolutely necessary.
350 -- a) During update, the user_category_name has actually changed to another not
351 -- null value, i,e, the value passed to this procedure is different to the
352 -- g_old_rec value.
353 -- b) During insert, the user_category_name is null.
354 -- Can tell the difference between insert and update by looking at the
355 -- primary key value. For update it will be not null. For insert it will be
356 -- null, because pre_inset has not been called yet.
357 --
358 IF (((p_balance_category_id is not null) and
359 nvl(pay_pbc_shd.g_old_rec.user_category_name, hr_api.g_varchar2) <>
360 nvl(p_user_category_name, hr_api.g_varchar2))
361 or
362 (p_balance_category_id is null)) then
363 --
364 hr_utility.set_location(l_proc, 10);
365 --
366 -- Only need to open the cursor if user_category_name is not null
367 --
368 if p_user_category_name is not null then
369 --
370 l_mode := hr_startup_data_api_support.return_startup_mode;
371 --
372 OPEN csr_user_category_name;
373 FETCH csr_user_category_name INTO l_user_category_name
374 ,l_leg_code
375 ,l_bg_id;
376 IF csr_user_category_name%NOTFOUND THEN
377 --
378 hr_utility.trace('insert row');
379 CLOSE csr_user_category_name;
380 ELSE
381 --
382 if l_mode = 'GENERIC' then
383 hr_utility.set_location(l_proc, 15);
384 if (l_leg_code is null and l_bg_id is null) then
385 hr_utility.set_message(801,'PAY_34272_USR_CAT_DUP_GEN');
386 hr_utility.raise_error;
387 elsif
388 l_leg_code is not null
389 or l_bg_id is not null then
390 -- name exists at lower level, existing row must be deleted
391 -- so new seeded row can be inserted.
392 hr_utility.set_message(801,'PAY_34273_S_USRCAT_LOWLVL_DEL');
393 hr_utility.raise_error;
394 end if;
395 elsif l_mode = 'STARTUP' THEN
396 hr_utility.set_location(l_proc, 20);
397 if (l_leg_code = p_legislation_code) then
398 hr_utility.set_message(801,'PAY_34274_USRCAT_DUP_S');
399 hr_utility.raise_error;
400 elsif
401 l_leg_code is null then
402 if l_bg_id is not null then
403 hr_utility.trace('here');
404 hr_utility.set_message(801,'PAY_34275_U_USRCAT_LOWLVL_DEL');
405 hr_utility.raise_error;
406 else -- l_bg_id is null then
407 hr_utility.trace('here2');
408 hr_utility.set_message(801,'PAY_34276_G_USRCAT_HI_LVL');
409 hr_utility.raise_error;
410 end if;
411 end if;
412 end if; -- what mode
413 close csr_user_category_name;
414 --
415 END IF;
416 end if;
417 end if;
418 hr_utility.set_location('Leaving: '||l_proc, 20);
419 --
420 END chk_user_category_name;
421 -- ----------------------------------------------------------------------------
422 -- |----------------------< chk_save_run_bal_enabled >------------------------|
423 -- ----------------------------------------------------------------------------
424 -- {Start Of Comments}
425 --
426 -- Description:
427 -- This procedure is used to ensure that a valid value is entered in
428 -- save_run_balance_enabled.
429 --
430 -- Pre Conditions:
431 -- g_old_rec has been populated with details of the values currently in
432 -- the database.
433 --
434 -- In Arguments:
435 -- p_rec has been populated with the updated values the user would like the
436 -- record set to.
437 --
438 -- Post Success:
439 -- Processing continues if a valid value is entered in
440 -- save_run_balance_enabled.
441 --
442 -- Post Failure:
443 -- An application error is raised if a value other than those returned from
444 -- HR_STANDARD_LOOKUPS with lookup_type = 'YES_NO'.
445 -- entered.
446 --
447 -- {End Of Comments}
448 -- ----------------------------------------------------------------------------
449 Procedure chk_save_run_bal_enabled
450 (p_effective_date in date
451 ,p_validation_start_date in date
452 ,p_validation_end_date in date
453 ,p_save_run_balance_enabled in varchar2) IS
454 --
458 --
455 l_proc varchar2(72) := g_package || 'chk_save_run_bal_enabled';
456 l_error EXCEPTION;
457 l_argument varchar2(30);
459 Begin
460 --
461 hr_utility.set_location('Entering: '||l_proc,5);
462 --
463 -- YES_NO is a system level lookup, so only need to validate against
464 -- hr_standar_lookups, even though the table has a business_group_id and
465 -- would expect to need to validate against hr_lookups.
466 --
467 if p_save_run_balance_enabled is not null then
468 --
469 IF hr_api.not_exists_in_dt_hrstanlookups
470 (p_effective_date => p_effective_date
471 ,p_validation_start_date => p_validation_start_date
472 ,p_validation_end_date => p_validation_end_date
473 ,p_lookup_type => 'YES_NO'
474 ,p_lookup_code => p_save_run_balance_enabled
475 )
476 THEN
477 --
478 -- the value entered for this record is not recognised
479 --
480 fnd_message.set_name('PAY', 'PAY_34228_PBC_INV_LOOKUP');
481 fnd_message.raise_error;
482 --
483 hr_utility.set_location(l_proc,10);
484 END IF;
485 end if;
486 --
487 hr_utility.set_location('Leaving: '||l_proc,15);
488 --
489 End chk_save_run_bal_enabled;
490 --
491 -- ----------------------------------------------------------------------------
492 -- |-----------------------------< chk_ddf >----------------------------------|
493 -- ----------------------------------------------------------------------------
494 --
495 -- Description:
496 -- Validates all the Developer Descriptive Flexfield values.
497 --
498 -- Prerequisites:
499 -- All other columns have been validated. Must be called as the
500 -- last step from insert_validate and update_validate.
501 --
502 -- In Arguments:
503 -- p_rec
504 --
505 -- Post Success:
506 -- If the Developer Descriptive Flexfield structure column and data values
507 -- are all valid this procedure will end normally and processing will
508 -- continue.
509 --
510 -- Post Failure:
511 -- If the Developer Descriptive Flexfield structure column value or any of
512 -- the data values are invalid then an application error is raised as
513 -- a PL/SQL exception.
514 --
515 -- Access Status:
516 -- Internal Row Handler Use Only.
517 --
518 -- ----------------------------------------------------------------------------
519 procedure chk_ddf
520 (p_rec in pay_pbc_shd.g_rec_type
521 ) is
522 --
523 l_proc varchar2(72) := g_package || 'chk_ddf';
524 --
525 begin
526 hr_utility.set_location('Entering:'||l_proc,10);
527 --
528 if ((p_rec.balance_category_id is not null) and (
529 nvl(pay_pbc_shd.g_old_rec.pbc_information_category, hr_api.g_varchar2) <>
530 nvl(p_rec.pbc_information_category, hr_api.g_varchar2) or
531 nvl(pay_pbc_shd.g_old_rec.pbc_information1, hr_api.g_varchar2) <>
532 nvl(p_rec.pbc_information1, hr_api.g_varchar2) or
533 nvl(pay_pbc_shd.g_old_rec.pbc_information2, hr_api.g_varchar2) <>
534 nvl(p_rec.pbc_information2, hr_api.g_varchar2) or
535 nvl(pay_pbc_shd.g_old_rec.pbc_information3, hr_api.g_varchar2) <>
536 nvl(p_rec.pbc_information3, hr_api.g_varchar2) or
537 nvl(pay_pbc_shd.g_old_rec.pbc_information4, hr_api.g_varchar2) <>
538 nvl(p_rec.pbc_information4, hr_api.g_varchar2) or
539 nvl(pay_pbc_shd.g_old_rec.pbc_information5, hr_api.g_varchar2) <>
540 nvl(p_rec.pbc_information5, hr_api.g_varchar2) or
541 nvl(pay_pbc_shd.g_old_rec.pbc_information6, hr_api.g_varchar2) <>
542 nvl(p_rec.pbc_information6, hr_api.g_varchar2) or
543 nvl(pay_pbc_shd.g_old_rec.pbc_information7, hr_api.g_varchar2) <>
544 nvl(p_rec.pbc_information7, hr_api.g_varchar2) or
545 nvl(pay_pbc_shd.g_old_rec.pbc_information8, hr_api.g_varchar2) <>
546 nvl(p_rec.pbc_information8, hr_api.g_varchar2) or
547 nvl(pay_pbc_shd.g_old_rec.pbc_information9, hr_api.g_varchar2) <>
548 nvl(p_rec.pbc_information9, hr_api.g_varchar2) or
549 nvl(pay_pbc_shd.g_old_rec.pbc_information10, hr_api.g_varchar2) <>
550 nvl(p_rec.pbc_information10, hr_api.g_varchar2) or
551 nvl(pay_pbc_shd.g_old_rec.pbc_information11, hr_api.g_varchar2) <>
552 nvl(p_rec.pbc_information11, hr_api.g_varchar2) or
553 nvl(pay_pbc_shd.g_old_rec.pbc_information12, hr_api.g_varchar2) <>
554 nvl(p_rec.pbc_information12, hr_api.g_varchar2) or
555 nvl(pay_pbc_shd.g_old_rec.pbc_information13, hr_api.g_varchar2) <>
556 nvl(p_rec.pbc_information13, hr_api.g_varchar2) or
557 nvl(pay_pbc_shd.g_old_rec.pbc_information14, hr_api.g_varchar2) <>
558 nvl(p_rec.pbc_information14, hr_api.g_varchar2) or
559 nvl(pay_pbc_shd.g_old_rec.pbc_information15, hr_api.g_varchar2) <>
560 nvl(p_rec.pbc_information15, hr_api.g_varchar2) or
561 nvl(pay_pbc_shd.g_old_rec.pbc_information16, hr_api.g_varchar2) <>
562 nvl(p_rec.pbc_information16, hr_api.g_varchar2) or
563 nvl(pay_pbc_shd.g_old_rec.pbc_information17, hr_api.g_varchar2) <>
564 nvl(p_rec.pbc_information17, hr_api.g_varchar2) or
565 nvl(pay_pbc_shd.g_old_rec.pbc_information18, hr_api.g_varchar2) <>
566 nvl(p_rec.pbc_information18, hr_api.g_varchar2) or
567 nvl(pay_pbc_shd.g_old_rec.pbc_information19, hr_api.g_varchar2) <>
571 nvl(pay_pbc_shd.g_old_rec.pbc_information21, hr_api.g_varchar2) <>
568 nvl(p_rec.pbc_information19, hr_api.g_varchar2) or
569 nvl(pay_pbc_shd.g_old_rec.pbc_information20, hr_api.g_varchar2) <>
570 nvl(p_rec.pbc_information20, hr_api.g_varchar2) or
572 nvl(p_rec.pbc_information21, hr_api.g_varchar2) or
573 nvl(pay_pbc_shd.g_old_rec.pbc_information22, hr_api.g_varchar2) <>
574 nvl(p_rec.pbc_information22, hr_api.g_varchar2) or
575 nvl(pay_pbc_shd.g_old_rec.pbc_information23, hr_api.g_varchar2) <>
576 nvl(p_rec.pbc_information23, hr_api.g_varchar2) or
577 nvl(pay_pbc_shd.g_old_rec.pbc_information24, hr_api.g_varchar2) <>
578 nvl(p_rec.pbc_information24, hr_api.g_varchar2) or
579 nvl(pay_pbc_shd.g_old_rec.pbc_information25, hr_api.g_varchar2) <>
580 nvl(p_rec.pbc_information25, hr_api.g_varchar2) or
581 nvl(pay_pbc_shd.g_old_rec.pbc_information26, hr_api.g_varchar2) <>
582 nvl(p_rec.pbc_information26, hr_api.g_varchar2) or
583 nvl(pay_pbc_shd.g_old_rec.pbc_information27, hr_api.g_varchar2) <>
584 nvl(p_rec.pbc_information27, hr_api.g_varchar2) or
585 nvl(pay_pbc_shd.g_old_rec.pbc_information28, hr_api.g_varchar2) <>
586 nvl(p_rec.pbc_information28, hr_api.g_varchar2) or
587 nvl(pay_pbc_shd.g_old_rec.pbc_information29, hr_api.g_varchar2) <>
588 nvl(p_rec.pbc_information29, hr_api.g_varchar2) or
589 nvl(pay_pbc_shd.g_old_rec.pbc_information30, hr_api.g_varchar2) <>
590 nvl(p_rec.pbc_information30, hr_api.g_varchar2) ))
591 or (p_rec.balance_category_id is null) then
592 --
593 -- Only execute the validation if absolutely necessary:
594 -- a) During update, the structure column value or any
595 -- of the attribute values have actually changed.
596 -- b) During insert.
597 --
598 hr_dflex_utility.ins_or_upd_descflex_attribs
599 (p_appl_short_name => 'PAY'
600 ,p_descflex_name => 'Balance Category Developer DF'
601 -- ,p_attribute_category => 'PBC_INFORMATION_CATEGORY'
602 ,p_attribute_category => p_rec.pbc_information_category
603 ,p_attribute1_name => 'PBC_INFORMATION1'
604 ,p_attribute1_value => p_rec.pbc_information1
605 ,p_attribute2_name => 'PBC_INFORMATION2'
606 ,p_attribute2_value => p_rec.pbc_information2
607 ,p_attribute3_name => 'PBC_INFORMATION3'
608 ,p_attribute3_value => p_rec.pbc_information3
609 ,p_attribute4_name => 'PBC_INFORMATION4'
610 ,p_attribute4_value => p_rec.pbc_information4
611 ,p_attribute5_name => 'PBC_INFORMATION5'
612 ,p_attribute5_value => p_rec.pbc_information5
613 ,p_attribute6_name => 'PBC_INFORMATION6'
614 ,p_attribute6_value => p_rec.pbc_information6
615 ,p_attribute7_name => 'PBC_INFORMATION7'
616 ,p_attribute7_value => p_rec.pbc_information7
617 ,p_attribute8_name => 'PBC_INFORMATION8'
618 ,p_attribute8_value => p_rec.pbc_information8
619 ,p_attribute9_name => 'PBC_INFORMATION9'
620 ,p_attribute9_value => p_rec.pbc_information9
621 ,p_attribute10_name => 'PBC_INFORMATION10'
622 ,p_attribute10_value => p_rec.pbc_information10
623 ,p_attribute11_name => 'PBC_INFORMATION11'
624 ,p_attribute11_value => p_rec.pbc_information11
625 ,p_attribute12_name => 'PBC_INFORMATION12'
626 ,p_attribute12_value => p_rec.pbc_information12
627 ,p_attribute13_name => 'PBC_INFORMATION13'
628 ,p_attribute13_value => p_rec.pbc_information13
629 ,p_attribute14_name => 'PBC_INFORMATION14'
630 ,p_attribute14_value => p_rec.pbc_information14
631 ,p_attribute15_name => 'PBC_INFORMATION15'
632 ,p_attribute15_value => p_rec.pbc_information15
633 ,p_attribute16_name => 'PBC_INFORMATION16'
634 ,p_attribute16_value => p_rec.pbc_information16
635 ,p_attribute17_name => 'PBC_INFORMATION17'
636 ,p_attribute17_value => p_rec.pbc_information17
637 ,p_attribute18_name => 'PBC_INFORMATION18'
638 ,p_attribute18_value => p_rec.pbc_information18
639 ,p_attribute19_name => 'PBC_INFORMATION19'
640 ,p_attribute19_value => p_rec.pbc_information19
641 ,p_attribute20_name => 'PBC_INFORMATION20'
642 ,p_attribute20_value => p_rec.pbc_information20
643 ,p_attribute21_name => 'PBC_INFORMATION21'
644 ,p_attribute21_value => p_rec.pbc_information21
645 ,p_attribute22_name => 'PBC_INFORMATION22'
646 ,p_attribute22_value => p_rec.pbc_information22
647 ,p_attribute23_name => 'PBC_INFORMATION23'
648 ,p_attribute23_value => p_rec.pbc_information23
649 ,p_attribute24_name => 'PBC_INFORMATION24'
650 ,p_attribute24_value => p_rec.pbc_information24
651 ,p_attribute25_name => 'PBC_INFORMATION25'
652 ,p_attribute25_value => p_rec.pbc_information25
653 ,p_attribute26_name => 'PBC_INFORMATION26'
654 ,p_attribute26_value => p_rec.pbc_information26
655 ,p_attribute27_name => 'PBC_INFORMATION27'
659 ,p_attribute29_name => 'PBC_INFORMATION29'
656 ,p_attribute27_value => p_rec.pbc_information27
657 ,p_attribute28_name => 'PBC_INFORMATION28'
658 ,p_attribute28_value => p_rec.pbc_information28
660 ,p_attribute29_value => p_rec.pbc_information29
661 ,p_attribute30_name => 'PBC_INFORMATION30'
662 ,p_attribute30_value => p_rec.pbc_information30
663 );
664 end if;
665 --
666 hr_utility.set_location(' Leaving:'||l_proc,20);
667 end chk_ddf;
668 --
669 -- ----------------------------------------------------------------------------
670 -- |-------------------------< chk_for_child_rows >---------------------------|
671 -- ----------------------------------------------------------------------------
672 -- {Start Of Comments}
673 --
674 -- Description:
675 -- This procedure is used to ensure that non updateable attributes have
676 -- not been updated. If an attribute has been updated an error is generated.
677 --
678 -- Pre Conditions:
679 -- g_old_rec has been populated with details of the values currently in
680 -- the database.
681 --
682 -- In Arguments:
683 -- p_rec has been populated with the updated values the user would like the
684 -- record set to.
685 --
686 --
687 -- Post Success:
688 -- Processing continues if all the non updateable attributes have not
689 -- changed.
690 --
691 -- Post Failure:
692 -- An application error is raised if any of the non updatable attributes
693 -- have been altered.
694 --
695 -- {End Of Comments}
696 -- ----------------------------------------------------------------------------
697 Procedure chk_for_child_rows
698 (p_balance_category_id in number
699 ,p_effective_date in date
700 ,p_business_group_id in number default null
701 ,p_legislation_code in varchar2 default null) is
702 --
703 cursor csr_child_balance(p_bal_cat_id number
704 ,p_bg_id number)
705 is
706 select 1
707 from pay_balance_types pbt
708 where pbt.balance_category_id = p_bal_cat_id
709 and pbt.business_group_id = nvl(p_bg_id, pbt.business_group_id);
710 --
711 cursor csr_child_defaults(p_bal_cat_id number
712 ,p_bg_id number)
713 is
714 select 1
715 from pay_bal_attribute_defaults pbd
716 where pbd.balance_category_id = p_bal_cat_id
717 and pbd.business_group_id = nvl(p_bg_id, pbd.business_group_id);
718 --
719 cursor get_bg_id
720 is
721 select business_group_id
722 from per_business_groups
723 where legislation_code = p_legislation_code;
724 --
725 l_proc varchar2(72) := g_package || 'chk_for_child_rows';
726 l_error EXCEPTION;
727 l_argument varchar2(30);
728 l_exists number(1);
729 --
730 BEGIN
731 hr_utility.set_location('Entering: '||l_proc,5);
732 --
733 if p_legislation_code is not null then -- startup category
734 --
735 for each_bg in get_bg_id loop
736 open csr_child_balance(p_balance_category_id, each_bg.business_group_id);
737 fetch csr_child_balance into l_exists;
738 if csr_child_balance%FOUND then
739 close csr_child_balance;
740 hr_utility.set_message(801,'PAY_34230_PBC_CHILD_BAL');
741 hr_utility.raise_error;
742 hr_utility.set_location(l_proc, 10);
743 else
744 close csr_child_balance;
745 end if;
746 --
747 -- check for existing child pay_bal_attribute_defaults
748 --
749 open csr_child_defaults(p_balance_category_id, each_bg.business_group_id);
750 fetch csr_child_defaults into l_exists;
751 if csr_child_defaults%FOUND then
752 close csr_child_defaults;
753 hr_utility.set_message(801,'PAY_34229_PBC_CHLD_ATT_DEFAULT');
754 hr_utility.raise_error;
755 hr_utility.set_location(l_proc, 15);
756 else
757 close csr_child_defaults;
758 end if;
759 end loop;
760 --
761 ELSE -- generic category
762 open csr_child_balance(p_balance_category_id, p_business_group_id);
763 fetch csr_child_balance into l_exists;
764 if csr_child_balance%FOUND then
765 close csr_child_balance;
766 hr_utility.set_message(801,'PAY_34230_PBC_CHILD_BAL');
767 hr_utility.raise_error;
768 hr_utility.set_location(l_proc, 20);
769 else
770 close csr_child_balance;
771 end if;
772 --
773 -- check for existing child pay_bal_attribute_definitions
774 --
775 open csr_child_defaults(p_balance_category_id, p_business_group_id);
776 fetch csr_child_defaults into l_exists;
777 if csr_child_defaults%FOUND then
778 close csr_child_defaults;
779 hr_utility.set_message(801,'PAY_34229_PBC_CHLD_ATT_DEFAULT');
780 hr_utility.raise_error;
781 hr_utility.set_location(l_proc, 25);
782 else
783 close csr_child_defaults;
784 end if;
785 END IF;
786 hr_utility.set_location(' Leaving:'|| l_proc, 40);
787 --
788 End chk_for_child_rows;
789 -- ----------------------------------------------------------------------------
790 -- |-----------------------< chk_non_updateable_args >------------------------|
791 -- ----------------------------------------------------------------------------
792 -- {Start Of Comments}
793 --
794 -- Description:
798 -- Pre Conditions:
795 -- This procedure is used to ensure that non updateable attributes have
796 -- not been updated. If an attribute has been updated an error is generated.
797 --
799 -- g_old_rec has been populated with details of the values currently in
800 -- the database.
801 --
802 -- In Arguments:
803 -- p_rec has been populated with the updated values the user would like the
804 -- record set to.
805 --
806 -- Post Success:
807 -- Processing continues if all the non updateable attributes have not
808 -- changed.
809 --
810 -- Post Failure:
811 -- An application error is raised if any of the non updatable attributes
812 -- have been altered.
813 --
814 -- {End Of Comments}
815 -- ----------------------------------------------------------------------------
816 Procedure chk_non_updateable_args
817 (p_effective_date in date
818 ,p_rec in pay_pbc_shd.g_rec_type
819 ) IS
820 --
821 l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
822 l_error EXCEPTION;
823 l_argument varchar2(30);
824 --
825 Begin
826 --
827 -- Only proceed with the validation if a row exists for the current
828 -- record in the HR Schema.
829 --
830 IF NOT pay_pbc_shd.api_updating
831 (p_balance_category_id => p_rec.balance_category_id
832 ,p_effective_date => p_effective_date
833 ,p_object_version_number => p_rec.object_version_number
834 ) THEN
835 fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
836 fnd_message.set_token('PROCEDURE ', l_proc);
837 fnd_message.set_token('STEP ', '5');
838 fnd_message.raise_error;
839 END IF;
840 --
841 hr_utility.set_location(l_proc, 10);
842 --
843 if nvl(p_rec.business_group_id, hr_api.g_number) <>
844 nvl(pay_pbc_shd.g_old_rec.business_group_id, hr_api.g_number) then
845 l_argument := 'business_group_id';
846 raise l_error;
847 end if;
848 hr_utility.set_location(l_proc, 15);
849 --
850 if p_rec.balance_category_id <> pay_pbc_shd.g_old_rec.balance_category_id then
851 l_argument := 'balance_category_id';
852 raise l_error;
853 end if;
854 hr_utility.set_location(l_proc, 20);
855 --
856 if p_rec.legislation_code <> pay_pbc_shd.g_old_rec.legislation_code then
857 l_argument := 'legislation_code';
858 raise l_error;
859 end if;
860 hr_utility.set_location(l_proc, 25);
861 --
862 if p_rec.category_name <> pay_pbc_shd.g_old_rec.category_name then
863 l_argument := 'category_name';
864 raise l_error;
865 end if;
866 hr_utility.set_location(l_proc, 30);
867 --
868 EXCEPTION
869 WHEN l_error THEN
870 hr_api.argument_changed_error
871 (p_api_name => l_proc
872 ,p_argument => l_argument);
873 WHEN OTHERS THEN
874 RAISE;
875 hr_utility.set_location(' Leaving:'|| l_proc, 40);
876 --
877 End chk_non_updateable_args;
878 --
879 -- ----------------------------------------------------------------------------
880 -- |--------------------------< dt_update_validate >--------------------------|
881 -- ----------------------------------------------------------------------------
882 -- {Start Of Comments}
883 --
884 -- Description:
885 -- This procedure is used for referential integrity of datetracked
886 -- parent entities when a datetrack update operation is taking place
887 -- and where there is no cascading of update defined for this entity.
888 --
889 -- Prerequisites:
890 -- This procedure is called from the update_validate.
891 --
892 -- In Parameters:
893 --
894 -- Post Success:
895 -- Processing continues.
896 --
897 -- Post Failure:
898 --
899 -- Developer Implementation Notes:
900 -- This procedure should not need maintenance unless the HR Schema model
901 -- changes.
902 --
903 -- Access Status:
904 -- Internal Row Handler Use Only.
905 --
906 -- {End Of Comments}
907 -- ----------------------------------------------------------------------------
908 Procedure dt_update_validate
909 (p_datetrack_mode in varchar2
910 ,p_validation_start_date in date
911 ,p_validation_end_date in date
912 ) Is
913 --
914 l_proc varchar2(72) := g_package||'dt_update_validate';
915 --
916 Begin
917 --
918 -- Ensure that the p_datetrack_mode argument is not null
919 --
920 hr_api.mandatory_arg_error
921 (p_api_name => l_proc
922 ,p_argument => 'datetrack_mode'
923 ,p_argument_value => p_datetrack_mode
924 );
925 --
926 -- Mode will be valid, as this is checked at the start of the upd.
927 --
928 -- Ensure the arguments are not null
929 --
930 hr_api.mandatory_arg_error
931 (p_api_name => l_proc
932 ,p_argument => 'validation_start_date'
933 ,p_argument_value => p_validation_start_date
934 );
935 --
936 hr_api.mandatory_arg_error
937 (p_api_name => l_proc
938 ,p_argument => 'validation_end_date'
939 ,p_argument_value => p_validation_end_date
940 );
941 --
942 --
943 --
944 Exception
948 -- we must report
945 When Others Then
946 --
947 -- An unhandled or unexpected error has occurred which
949 --
950 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
951 fnd_message.set_token('PROCEDURE', l_proc);
952 fnd_message.set_token('STEP','15');
953 fnd_message.raise_error;
954 End dt_update_validate;
955 --
956 -- ----------------------------------------------------------------------------
957 -- |--------------------------< dt_delete_validate >--------------------------|
958 -- ----------------------------------------------------------------------------
959 -- {Start Of Comments}
960 --
961 -- Description:
962 -- This procedure is used for referential integrity of datetracked
963 -- child entities when either a datetrack DELETE or ZAP is in operation
964 -- and where there is no cascading of delete defined for this entity.
965 -- For the datetrack mode of DELETE or ZAP we must ensure that no
966 -- datetracked child rows exist between the validation start and end
967 -- dates.
968 --
969 -- Prerequisites:
970 -- This procedure is called from the delete_validate.
971 --
972 -- In Parameters:
973 --
974 -- Post Success:
975 -- Processing continues.
976 --
977 -- Post Failure:
978 -- If a row exists by determining the returning Boolean value from the
979 -- generic dt_api.rows_exist function then we must supply an error via
980 -- the use of the local exception handler l_rows_exist.
981 --
982 -- Developer Implementation Notes:
983 -- This procedure should not need maintenance unless the HR Schema model
984 -- changes.
985 --
986 -- Access Status:
987 -- Internal Row Handler Use Only.
988 --
989 -- {End Of Comments}
990 -- ----------------------------------------------------------------------------
991 Procedure dt_delete_validate
992 (p_balance_category_id in number
993 ,p_datetrack_mode in varchar2
994 ,p_validation_start_date in date
995 ,p_validation_end_date in date
996 ) Is
997 --
998 l_proc varchar2(72) := g_package||'dt_delete_validate';
999 --
1000 Begin
1001 --
1002 -- Ensure that the p_datetrack_mode argument is not null
1003 --
1004 hr_api.mandatory_arg_error
1005 (p_api_name => l_proc
1006 ,p_argument => 'datetrack_mode'
1007 ,p_argument_value => p_datetrack_mode
1008 );
1009 --
1010 -- Only perform the validation if the datetrack mode is either
1011 -- DELETE or ZAP
1012 --
1013 If (p_datetrack_mode = hr_api.g_delete or
1014 p_datetrack_mode = hr_api.g_zap) then
1015 --
1016 --
1017 -- Ensure the arguments are not null
1018 --
1019 hr_api.mandatory_arg_error
1020 (p_api_name => l_proc
1021 ,p_argument => 'validation_start_date'
1022 ,p_argument_value => p_validation_start_date
1023 );
1024 --
1025 hr_api.mandatory_arg_error
1026 (p_api_name => l_proc
1027 ,p_argument => 'validation_end_date'
1028 ,p_argument_value => p_validation_end_date
1029 );
1030 --
1031 hr_api.mandatory_arg_error
1032 (p_api_name => l_proc
1033 ,p_argument => 'balance_category_id'
1034 ,p_argument_value => p_balance_category_id
1035 );
1036 --
1037 --
1038 --
1039 End If;
1040 --
1041 Exception
1042 When Others Then
1043 --
1044 -- An unhandled or unexpected error has occurred which
1045 -- we must report
1046 --
1047 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
1048 fnd_message.set_token('PROCEDURE', l_proc);
1049 fnd_message.set_token('STEP','15');
1050 fnd_message.raise_error;
1051 --
1052 End dt_delete_validate;
1053 --
1054 -- ----------------------------------------------------------------------------
1055 -- |----------------------< chk_startup_action >------------------------------|
1056 -- ----------------------------------------------------------------------------
1057 --
1058 -- Description:
1059 -- This procedure will check that the current action is allowed according
1060 -- to the current startup mode.
1061 --
1062 -- ----------------------------------------------------------------------------
1063 PROCEDURE chk_startup_action
1064 (p_insert IN boolean
1065 ,p_business_group_id IN number
1066 ,p_legislation_code IN varchar2
1067 ,p_legislation_subgroup IN varchar2 DEFAULT NULL) IS
1068 --
1069 BEGIN
1070 --
1071 -- Call the supporting procedure to check startup mode
1072 -- NOTE: USER rows are not permitted in PAY_BALANCE_CATEGORIES_F
1073 --
1074 IF (p_insert) THEN
1075 hr_startup_data_api_support.chk_startup_action
1076 (p_generic_allowed => TRUE
1077 ,p_startup_allowed => TRUE
1078 ,p_user_allowed => FALSE
1079 ,p_business_group_id => p_business_group_id
1080 ,p_legislation_code => p_legislation_code
1081 ,p_legislation_subgroup => p_legislation_subgroup
1082 );
1083 ELSE
1084 hr_startup_data_api_support.chk_upd_del_startup_action
1085 (p_generic_allowed => TRUE
1086 ,p_startup_allowed => TRUE
1087 ,p_user_allowed => FALSE
1091 );
1088 ,p_business_group_id => p_business_group_id
1089 ,p_legislation_code => p_legislation_code
1090 ,p_legislation_subgroup => p_legislation_subgroup
1092 END IF;
1093 --
1094 END chk_startup_action;
1095 --
1096 -- ----------------------------------------------------------------------------
1097 -- |---------------------------< insert_validate >----------------------------|
1098 -- ----------------------------------------------------------------------------
1099 Procedure insert_validate
1100 (p_rec in pay_pbc_shd.g_rec_type
1101 ,p_effective_date in date
1102 ,p_datetrack_mode in varchar2
1103 ,p_validation_start_date in date
1104 ,p_validation_end_date in date
1105 ) is
1106 --
1107 l_proc varchar2(72) := g_package||'insert_validate';
1108 --
1109 Begin
1110 hr_utility.set_location('Entering:'||l_proc, 5);
1111 --
1112 -- Call all supporting business operations
1113 --
1114 --
1115 chk_startup_action(true
1116 ,p_rec.business_group_id
1117 ,p_rec.legislation_code
1118 );
1119 IF hr_startup_data_api_support.g_startup_mode
1120 NOT IN ('GENERIC','STARTUP') THEN
1121 --
1122 -- Validate Important Attributes
1123 --
1124 hr_api.validate_bus_grp_id
1125 (p_business_group_id => p_rec.business_group_id
1126 ,p_associated_column1 => pay_pbc_shd.g_tab_nam
1127 || '.BUSINESS_GROUP_ID');
1128 --
1129 -- after validating the set of important attributes,
1130 -- if Multiple Message Detection is enabled and at least
1131 -- one error has been found then abort further validation.
1132 --
1133 hr_multi_message.end_validation_set;
1134 END IF;
1135 --
1136 -- Validate Dependent Attributes
1137 --
1138 pay_pbc_bus.chk_category_name
1139 (p_balance_category_id => p_rec.balance_category_id
1140 ,p_category_name => p_rec.category_name
1141 ,p_effective_date => p_effective_date
1142 ,p_business_group_id => p_rec.business_group_id
1143 ,p_legislation_code => p_rec.legislation_code
1144 );
1145 --
1146 pay_pbc_bus.chk_user_category_name
1147 (p_balance_category_id => p_rec.balance_category_id
1148 ,p_user_category_name => p_rec.user_category_name
1149 ,p_business_group_id => p_rec.business_group_id
1150 ,p_legislation_code => p_rec.legislation_code
1151 );
1152 --
1153 pay_pbc_bus.chk_save_run_bal_enabled
1154 (p_effective_date => p_effective_date
1155 ,p_validation_start_date => p_validation_start_date
1156 ,p_validation_end_date => p_validation_end_date
1157 ,p_save_run_balance_enabled => p_rec.save_run_balance_enabled
1158 );
1159 --
1160 pay_pbc_bus.chk_ddf(p_rec);
1161 --
1162 hr_utility.set_location(' Leaving:'||l_proc, 10);
1163 End insert_validate;
1164 --
1165 -- ----------------------------------------------------------------------------
1166 -- |---------------------------< update_validate >----------------------------|
1167 -- ----------------------------------------------------------------------------
1168 Procedure update_validate
1169 (p_rec in pay_pbc_shd.g_rec_type
1170 ,p_effective_date in date
1171 ,p_datetrack_mode in varchar2
1172 ,p_validation_start_date in date
1173 ,p_validation_end_date in date
1174 ) is
1175 --
1176 l_proc varchar2(72) := g_package||'update_validate';
1177 --
1178 Begin
1179 hr_utility.set_location('Entering:'||l_proc, 5);
1180 --
1181 -- Call all supporting business operations
1182 --
1183 --
1184 chk_startup_action(false
1185 ,p_rec.business_group_id
1186 ,p_rec.legislation_code
1187 );
1188 IF hr_startup_data_api_support.g_startup_mode
1189 NOT IN ('GENERIC','STARTUP') THEN
1190 --
1191 --
1192 -- Validate Important Attributes
1193 --
1194 hr_api.validate_bus_grp_id
1195 (p_business_group_id => p_rec.business_group_id
1196 ,p_associated_column1 => pay_pbc_shd.g_tab_nam
1197 || '.BUSINESS_GROUP_ID');
1198 --
1199 -- After validating the set of important attributes,
1200 -- if Multiple Message Detection is enabled and at least
1201 -- one error has been found then abort further validation.
1202 --
1203 hr_multi_message.end_validation_set;
1204 END IF;
1205 --
1206 -- Validate Dependent Attributes
1207 --
1208 pay_pbc_bus.chk_category_name
1209 (p_balance_category_id => p_rec.balance_category_id
1210 ,p_category_name => p_rec.category_name
1211 ,p_effective_date => p_effective_date
1212 ,p_business_group_id => p_rec.business_group_id
1213 ,p_legislation_code => p_rec.legislation_code
1214 );
1215 --
1216 pay_pbc_bus.chk_user_category_name
1217 (p_balance_category_id => p_rec.balance_category_id
1218 ,p_user_category_name => p_rec.user_category_name
1222 --
1219 ,p_business_group_id => p_rec.business_group_id
1220 ,p_legislation_code => p_rec.legislation_code
1221 );
1223 pay_pbc_bus.chk_save_run_bal_enabled
1224 (p_effective_date => p_effective_date
1225 ,p_validation_start_date => p_validation_start_date
1226 ,p_validation_end_date => p_validation_end_date
1227 ,p_save_run_balance_enabled => p_rec.save_run_balance_enabled
1228 );
1229 --
1230 -- Call the datetrack update integrity operation
1231 --
1232 dt_update_validate
1233 (p_datetrack_mode => p_datetrack_mode
1234 ,p_validation_start_date => p_validation_start_date
1235 ,p_validation_end_date => p_validation_end_date
1236 );
1237 --
1238 chk_non_updateable_args
1239 (p_effective_date => p_effective_date
1240 ,p_rec => p_rec
1241 );
1242 --
1243 --
1244 pay_pbc_bus.chk_ddf(p_rec);
1245 --
1246 hr_utility.set_location(' Leaving:'||l_proc, 10);
1247 End update_validate;
1248 --
1249 -- ----------------------------------------------------------------------------
1250 -- |---------------------------< delete_validate >----------------------------|
1251 -- ----------------------------------------------------------------------------
1252 Procedure delete_validate
1253 (p_rec in pay_pbc_shd.g_rec_type
1254 ,p_effective_date in date
1255 ,p_datetrack_mode in varchar2
1256 ,p_validation_start_date in date
1257 ,p_validation_end_date in date
1258 ) is
1259 --
1260 l_proc varchar2(72) := g_package||'delete_validate';
1261 --
1262 Begin
1263 hr_utility.set_location('Entering:'||l_proc, 5);
1264 --
1265 -- NB. need to use g_old_rec, as p_rec is not pupulated with all the columns
1266 -- for delete mode.
1267 --
1268 chk_for_child_rows
1269 (p_balance_category_id => p_rec.balance_category_id
1270 ,p_effective_date => p_effective_date
1271 ,p_business_group_id => pay_pbc_shd.g_old_rec.business_group_id
1272 ,p_legislation_code => pay_pbc_shd.g_old_rec.legislation_code);
1273 --
1274 chk_startup_action(false
1275 ,pay_pbc_shd.g_old_rec.business_group_id
1276 ,pay_pbc_shd.g_old_rec.legislation_code
1277 );
1278 --
1279 -- Call all supporting business operations
1280 --
1281 dt_delete_validate
1282 (p_datetrack_mode => p_datetrack_mode
1283 ,p_validation_start_date => p_validation_start_date
1284 ,p_validation_end_date => p_validation_end_date
1285 ,p_balance_category_id => p_rec.balance_category_id
1286 );
1287 --
1288 hr_utility.set_location(' Leaving:'||l_proc, 10);
1289 End delete_validate;
1290 --
1291 end pay_pbc_bus;