1 Package Body pqh_bpl_bus as
2 /* $Header: pqbplrhi.pkb 115.9 2003/04/11 11:44:23 mvankada noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pqh_bpl_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_pool_id number default null;
15 --
16 -- ---------------------------------------------------------------------------
17 -- |----------------------< set_security_group_id >--------------------------|
18 -- ---------------------------------------------------------------------------
19 --
20 Procedure set_security_group_id
21 (p_pool_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 , pqh_budget_pools bpl
31 where bpl.pool_id = p_pool_id
32 and pbg.business_group_id = bpl.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 => 'pool_id'
48 ,p_argument_value => p_pool_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,'POOL_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_pool_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 , pqh_budget_pools bpl
95 where bpl.pool_id = p_pool_id
96 and pbg.business_group_id (+) = bpl.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 => 'pool_id'
112 ,p_argument_value => p_pool_id
113 );
114 --
115 if ( nvl(pqh_bpl_bus.g_pool_id, hr_api.g_number)
116 = p_pool_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 := pqh_bpl_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 pqh_bpl_bus.g_pool_id := p_pool_id;
147 pqh_bpl_bus.g_legislation_code := l_legislation_code;
148 end if;
149 hr_utility.set_location(' Leaving:'|| l_proc, 40);
150 return l_legislation_code;
151 end return_legislation_code;
152 --
153 -- ----------------------------------------------------------------------------
154 -- |-----------------------< chk_non_updateable_args >------------------------|
155 -- ----------------------------------------------------------------------------
156 -- {Start Of Comments}
157 --
158 -- Description:
159 -- This procedure is used to ensure that non updateable attributes have
160 -- not been updated. If an attribute has been updated an error is generated.
161 --
162 -- Pre Conditions:
163 -- g_old_rec has been populated with details of the values currently in
164 -- the database.
165 --
166 -- In Arguments:
167 -- p_rec has been populated with the updated values the user would like the
168 -- record set to.
169 --
170 -- Post Success:
171 -- Processing continues if all the non updateable attributes have not
172 -- changed.
173 --
174 -- Post Failure:
175 -- An application error is raised if any of the non updatable attributes
176 -- have been altered.
177 --
178 -- {End Of Comments}
179 -- ----------------------------------------------------------------------------
180 Procedure chk_non_updateable_args
181 (p_effective_date in date
182 ,p_rec in pqh_bpl_shd.g_rec_type
183 ) IS
184 --
185 l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
186 --
187 Begin
188 --
189 -- Only proceed with the validation if a row exists for the current
190 -- record in the HR Schema.
191 --
192 IF NOT pqh_bpl_shd.api_updating
193 (p_pool_id => p_rec.pool_id
194 ,p_object_version_number => p_rec.object_version_number
195 ) THEN
196 fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
197 fnd_message.set_token('PROCEDURE ', l_proc);
198 fnd_message.set_token('STEP ', '5');
199 fnd_message.raise_error;
200 END IF;
201 End chk_non_updateable_args;
202 --
203 -- ----------------------------------------------------------------------------
204 -- |------< chk_pool_id >------|
205 -- ----------------------------------------------------------------------------
206 --
207 -- Description
208 -- This procedure is used to check that the primary key for the table
209 -- is created properly. It should be null on insert and
210 -- should not be able to be updated.
211 --
212 -- Pre Conditions
213 -- None.
214 --
215 -- In Parameters
216 -- pool_id PK of record being inserted or updated.
217 -- object_version_number Object version number of record being
218 -- inserted or updated.
219 --
220 -- Post Success
221 -- Processing continues
222 --
223 -- Post Failure
224 -- Errors handled by the procedure
225 --
226 -- Access Status
227 -- Internal table handler use only.
228 --
229 Procedure chk_pool_id(p_pool_id in number,
230 p_object_version_number in number) is
231 --
232 l_proc varchar2(72) := g_package||'chk_pool_id';
233 l_api_updating boolean;
234 --
235 Begin
236 --
237 hr_utility.set_location('Entering:'||l_proc, 5);
238 --
239 l_api_updating := pqh_bpl_shd.api_updating
240 (p_pool_id => p_pool_id,
241 p_object_version_number => p_object_version_number);
242 --
243 if (l_api_updating
244 and nvl(p_pool_id,hr_api.g_number)
245 <> pqh_bpl_shd.g_old_rec.pool_id) then
246 --
247 -- raise error as PK has changed
248 --
249 pqh_bpl_shd.constraint_error('PQH_BUDGET_POOLS_PK');
250 --
251 elsif not l_api_updating then
252 --
253 -- check if PK is null
254 --
255 if p_pool_id is not null then
256 --
257 -- raise error as PK is not null
258 --
259 pqh_bpl_shd.constraint_error('PQH_BUDGET_POOLS_PK');
260 --
261 end if;
262 --
263 end if;
264 --
265 hr_utility.set_location('Leaving:'||l_proc, 10);
266 --
267 End chk_pool_id;
268 --
269 --
270 -- ----------------------------------------------------------------------------
271 -- |------< chk_budget_version_id >------|
272 -- ----------------------------------------------------------------------------
273 --
274 -- Description
275 -- This procedure checks that a referenced foreign key actually exists
276 -- in the referenced table.
277 --
278 -- Pre-Conditions
279 -- None.
280 --
281 -- In Parameters
282 -- p_pool_id PK
283 -- p_budget_version_id ID of FK column
284 -- p_object_version_number object version number
285 --
286 -- Post Success
287 -- Processing continues
288 --
289 -- Post Failure
290 -- Error raised.
291 --
292 -- Access Status
293 -- Internal table handler use only.
294 --
295 Procedure chk_budget_version_id
296 (p_pool_id in number,
297 p_budget_version_id in number,
298 p_object_version_number in number) is
299 --
300 l_proc varchar2(72) := g_package||'chk_budget_version_id';
301 l_api_updating boolean;
302 l_dummy varchar2(1);
303 l_budgeted_entity_cd pqh_budgets.budgeted_entity_cd%type;
304 --
305 cursor c1 is
306 select a.budgeted_entity_cd
307 from pqh_budgets a
308 where a.budget_id = (Select budget_id
309 From pqh_budget_versions bvr
310 where bvr.budget_version_id = p_budget_version_id);
311 --
312 Begin
313 --
314 hr_utility.set_location('Entering:'||l_proc,5);
315 --
316 l_api_updating := pqh_bpl_shd.api_updating
317 (p_pool_id => p_pool_id,
318 p_object_version_number => p_object_version_number);
319 --
320 if (l_api_updating
321 and nvl(p_budget_version_id,hr_api.g_number)
322 <> nvl(pqh_bpl_shd.g_old_rec.budget_version_id,hr_api.g_number)
323 or not l_api_updating) then
324 --
325 -- check if budget_version_id value exists in pqh_budgets table
326 --
327 open c1;
328 --
329 fetch c1 into l_budgeted_entity_cd;
330 if c1%notfound then
331 --
332 close c1;
333 --
334 -- raise error as FK does not relate to PK in pqh_budgets
335 -- table.
336 --
337 pqh_bpl_shd.constraint_error('PQH_BUDGET_POOLS_FK1');
338 --
339 end if;
340 --
341 close c1;
342 /*kgowripe
343 As per the latest reallocation functionality, reallocation can be performed for
344 all budget entities (except OPEN budgets). so this check is no longer required.
345 Instead we need to check that budgeted entity is not OPEN.
346
347 --
348 -- Check if the budget is budgeted for a position
349 --
350 If l_budgeted_entity_cd <> 'POSITION' then
351 --
352 -- raise error as budgeted entity is not a position
353 --
354 hr_utility.set_message(8302,'PQH_NOT_A_POSITION_BUDGET');
355 hr_utility.raise_error;
356 --
357 End if;
358 --
359 kgowripe */
360 --
361 -- Check if the budget is not budgeted for OPEN
362 --
363 If l_budgeted_entity_cd = 'OPEN' then
364 --
365 -- raise error as budgeted entity is OPEN
366 --
367 hr_utility.set_message(8302,'PQH_OPEN_BUDGET');
368 hr_utility.raise_error;
369 --
370 End if;
371 --
372 end if;
373 --
374 hr_utility.set_location('Leaving:'||l_proc,10);
375 --
376 End chk_budget_version_id;
377 --
378 -- ----------------------------------------------------------------------------
379 -- |------< chk_budget_unit_id >------|
380 -- ----------------------------------------------------------------------------
381 --
382 -- Description
383 -- This procedure is used to check that the lookup value is valid.
384 --
385 -- Pre Conditions
386 -- None.
387 --
388 -- In Parameters
389 -- pool_id PK of record being inserted or updated.
390 -- budget_unit_id Value of lookup code.
391 -- effective_date effective date
392 -- object_version_number Object version number of record being
393 -- inserted or updated.
394 --
395 -- Post Success
396 -- Processing continues
397 --
398 -- Post Failure
399 -- Error handled by procedure
400 --
401 -- Access Status
402 -- Internal table handler use only.
403 --
404 Procedure chk_budget_unit_id(p_pool_id in number,
405 p_budget_version_id in varchar2,
406 p_budget_unit_id in number,
407 p_effective_date in date,
408 p_object_version_number in number) is
409 --
410 l_proc varchar2(72) := g_package||'chk_budget_unit_id';
411 l_api_updating boolean;
412 l_dummy varchar2(1);
413 --
414 -- Check if this is a valid shared type
415 --
416 Cursor c1 is
417 Select null
418 from per_shared_types pst
419 where pst.shared_type_id = p_budget_unit_id
420 AND lookup_type = 'BUDGET_MEASUREMENT_TYPE';
421 --
422 -- Check if the budget unit id belongs to the budget.
423 --
424 Cursor c2 is
425 Select null
426 from pqh_budgets bgt
427 Where bgt.budget_id = (Select budget_id
428 From pqh_budget_versions bvr
429 Where bvr.budget_version_id = p_budget_version_id)
430 and (bgt.budget_unit1_id = p_budget_unit_id or
431 bgt.budget_unit2_id = p_budget_unit_id or
432 bgt.budget_unit3_id = p_budget_unit_id );
433 Begin
434 --
435 hr_utility.set_location('Entering:'||l_proc, 5);
436 --
437 l_api_updating := pqh_bpl_shd.api_updating
438 (p_pool_id => p_pool_id,
439 p_object_version_number => p_object_version_number);
440 --
441 if (l_api_updating
442 and p_budget_unit_id
443 <> nvl(pqh_bpl_shd.g_old_rec.budget_unit_id,hr_api.g_number)
444 or not l_api_updating) then
445 --
446 -- check if value of budget_unit falls within per shared types
447 --
448 Open c1;
449 --
450 Fetch c1 into l_dummy;
451 --
452 If c1%notfound then
453 --
454 Close c1;
455 hr_utility.set_message(8302,'PQH_INVALID_BUDGET_UOM');
456 hr_utility.raise_error;
457 --
458 End if;
459 --
460 Close c1;
461 --
462 --
463 Open c2;
464 --
465 Fetch c2 into l_dummy;
466 --
467 If c2%notfound then
468 --
469 -- Raise error if the budget unit cd does not exist for the budget
470 --
471 Close c2;
472 hr_utility.set_message(8302,'PQH_INVALID_BUDGET_UNIT');
473 hr_utility.raise_error;
474 --
475 End if;
476 --
477 Close c2;
478 --
479 end if;
480 --
481 hr_utility.set_location('Leaving:'||l_proc,10);
482 --
483 end chk_budget_unit_id;
484 --
485 -- ADDITIONAL CHECKS
486 --
487 -- Check if any transactions/details exist for the folder/transaction.
488 -- Raise error if trying to update this folder/transaction
489 --
490 Procedure chk_upd_allowed(p_pool_id in number,
491 p_parent_pool_id in number,
492 p_object_version_number in number) is
493 --
494 l_proc varchar2(72) := g_package||'chk_upd_allowed';
495 l_api_updating boolean;
496 l_dummy varchar2(1);
497 --
498 Cursor csr_folder_trnxs IS
499 select null
500 from pqh_budget_pools
501 where parent_pool_id = p_pool_id;
502 Cursor csr_trnx_dtls is
503 Select null
504 from pqh_bdgt_pool_realloctions a
505 Where a.pool_id = p_pool_id;
506 Begin
507 --
508 hr_utility.set_location('Entering:'||l_proc, 5);
509 --
510 l_api_updating := pqh_bpl_shd.api_updating
511 (p_pool_id => p_pool_id,
512 p_object_version_number => p_object_version_number);
513 --
514 if l_api_updating then
515 --
516 if p_parent_pool_id IS NULL then
517 Open csr_folder_trnxs;
518 Fetch csr_folder_trnxs into l_dummy;
519 if csr_folder_trnxs%found then
520 Close csr_folder_trnxs;
521 hr_utility.set_message(8302,'PQH_TRNX_EXIST_IN_FOLDER');
522 hr_utility.raise_error;
523 End if;
524 Close csr_folder_trnxs;
525 else
526 Open csr_trnx_dtls;
527 Fetch csr_trnx_dtls into l_dummy;
528 if csr_trnx_dtls%found then
529 Close csr_trnx_dtls;
530 hr_utility.set_message(8302,'PQH_DTLS_EXIST_FOR_TRNX');
531 hr_utility.raise_error;
532 End if;
533 Close csr_trnx_dtls;
534 end if;
535 --
536 end if;
537 --
538 hr_utility.set_location('Leaving:'||l_proc, 10);
539 --
540 End chk_upd_allowed;
541 --
542 -- Check if folder_name is unique in pqh_budget_pools_table
543 -- Also, Raise error if the entered folder_name is null.
544 --
545 Procedure chk_pool_name(p_pool_id in number,
546 p_name in varchar2,
547 p_parent_pool_id in number,
548 p_object_version_number in number) is
549 --
550 l_proc varchar2(72) := g_package||'chk_pool_name';
551 l_api_updating boolean;
552 l_dummy varchar2(1);
553 --
554 -- added approval_status<>'T' condition by mvanakda
555 Cursor csr_folder_name is
556 Select null
557 from pqh_budget_pools a
558 Where a.name = p_name
559 AND a.parent_pool_id IS NULL
560 AND (p_pool_id IS NULL or a.pool_id <> p_pool_id)
561 AND a.approval_status<>'T';
562 Cursor csr_trnx_name is
563 Select null
564 from pqh_budget_pools a
565 Where a.name = p_name
566 AND a.parent_pool_id IS NOT NULL
567 AND a.parent_pool_id =p_parent_pool_id
568 AND (p_pool_id IS NULL or a.pool_id <> p_pool_id);
569 --
570 Begin
571 --
572 hr_utility.set_location('Entering:'||l_proc, 5);
573 --
574 l_api_updating := pqh_bpl_shd.api_updating
575 (p_pool_id => p_pool_id,
576 p_object_version_number => p_object_version_number);
577 --
578 if (l_api_updating
579 and p_name
580 <> nvl(pqh_bpl_shd.g_old_rec.name,hr_api.g_varchar2)
581 or not l_api_updating) then
582
583 If p_name IS NULL then
584 If p_parent_pool_id IS NULL Then
585 hr_utility.set_message(8302,'PQH_FOLDER_NAME_IS_NULL');
586 Else
587 hr_utility.set_message(8302,'PQH_TRNX_NAME_IS_NULL');
588 End If;
589 hr_utility.raise_error;
590 End if;
591 --
592 --
593 If p_parent_pool_id IS NULL Then
594 Open csr_folder_name;
595 Fetch csr_folder_name into l_dummy;
596 if csr_folder_name%found then
597 Close csr_folder_name;
598 hr_utility.set_message(8302,'PQH_FOLDER_NAME_MUST_BE_UNIQUE');
599 hr_utility.raise_error;
600 End if;
601 Close csr_folder_name;
602 ELSE
603 Open csr_trnx_name;
604 Fetch csr_trnx_name into l_dummy;
605 if csr_trnx_name%found then
606 Close csr_trnx_name;
607 hr_utility.set_message(8302,'PQH_TRNX_NAME_MUST_BE_UNIQUE');
608 hr_utility.raise_error;
609 End if;
610 Close csr_trnx_name;
611 End If;
612 --
613 end if;
614 --
615 hr_utility.set_location('Leaving:'||l_proc, 10);
616 --
617 End chk_pool_name;
618 /* No longer required as there cane be any number of folders created from a budget
619 --
620 -- Check if there is only one pool per budget_unit_id for a budget
621 --
622 Procedure chk_budget_pool_unique
623 (p_pool_id in number,
624 p_budget_version_id in number,
625 p_budget_unit_id in number,
626 p_object_version_number in number) is
627 --
628 l_proc varchar2(72) := g_package||'chk_budget_pool_unique';
629 l_api_updating boolean;
630 l_dummy varchar2(1);
631 --
632 Cursor c1 is
633 Select null
634 from pqh_budget_pools a
635 Where budget_version_id = p_budget_version_id
636 AND budget_unit_id = p_budget_unit_id
637 AND (p_pool_id IS NULL or a.pool_id <> p_pool_id);
638 --
639 Begin
640 --
641 hr_utility.set_location('Entering:'||l_proc, 5);
642 --
643 l_api_updating := pqh_bpl_shd.api_updating
644 (p_pool_id => p_pool_id,
645 p_object_version_number => p_object_version_number);
646 --
647 if (l_api_updating
648 and (nvl(p_budget_version_id,hr_api.g_number)
649 <> nvl(pqh_bpl_shd.g_old_rec.budget_version_id,hr_api.g_number)
650 or p_budget_unit_id
651 <> nvl(pqh_bpl_shd.g_old_rec.budget_unit_id,hr_api.g_number) )
652 or not l_api_updating) then
653 --
654 --
655 Open c1;
656 --
657 Fetch c1 into l_dummy;
658 --
659 if c1%found then
660
661 Close c1;
662 pqh_bpl_shd.constraint_error('PQH_BUDGET_POOLS_U1');
663
664 End if;
665 --
666 Close c1;
667 --
668 --
669 end if;
670 --
671 hr_utility.set_location('Leaving:'||l_proc, 10);
672 --
673 End chk_budget_pool_unique;
674
675 */
676 PROCEDURE chk_tnx_category_id(p_transaction_category_id IN Number) IS
677
678 Cursor csr_tnx_catg_id IS
679 SELECT 'x'
680 FROM pqh_transaction_categories
681 WHERE transaction_category_id = p_transaction_category_id;
682 l_exist Varchar2(10);
683 l_proc varchar2(72) := g_package||'chk_tnx_category_id';
684 BEGIN
685 hr_utility.set_location('Entering:'||l_proc, 5);
686 OPEN csr_tnx_catg_id;
687 FETCH csr_tnx_catg_id INTO l_exist;
688 IF csr_tnx_catg_id%NOTFOUND THEN
689 CLOSE csr_tnx_catg_id;
690 fnd_message.set_name(8302,'PQH_INVALID_TNX_CATG');
691 fnd_message.raise_error;
692 END IF;
693 CLOSE csr_tnx_catg_id;
694 hr_utility.set_location('Leaving:'||l_proc, 10);
695 END chk_tnx_category_id;
696 -- ----------------------------------------------------------------------------
697 -- |---------------------------< insert_validate >----------------------------|
698 -- ----------------------------------------------------------------------------
699 Procedure insert_validate
700 (p_effective_date in date
701 ,p_rec in pqh_bpl_shd.g_rec_type
702 ) is
703 --
704 l_proc varchar2(72) := g_package||'insert_validate';
705 --
706 Begin
707 hr_utility.set_location('Entering:'||l_proc, 5);
708 --
709 -- Call all supporting business operations
710 --
711 hr_api.validate_bus_grp_id
712 (p_business_group_id => p_rec.business_group_id
713 ,p_associated_column1 => pqh_bpl_shd.g_tab_nam
714 || '.BUSINESS_GROUP_ID');
715 --
716 chk_pool_id
717 (p_pool_id => p_rec.pool_id,
718 p_object_version_number => p_rec.object_version_number);
719 --
720 --
721 if p_rec.parent_pool_id IS NULL then
722 chk_budget_version_id
723 (p_pool_id => p_rec.pool_id,
724 p_budget_version_id => p_rec.budget_version_id,
725 p_object_version_number => p_rec.object_version_number);
726 --
727 chk_budget_unit_id
728 (p_pool_id => p_rec.pool_id,
729 p_budget_version_id => p_rec.budget_version_id,
730 p_budget_unit_id => p_rec.budget_unit_id,
731 p_effective_date => p_effective_date,
732 p_object_version_number => p_rec.object_version_number);
733 --
734 chk_tnx_category_id(p_transaction_category_id => p_rec.wf_transaction_category_id);
735 --
736 end if;
737 --
738 chk_pool_name
739 (p_pool_id => p_rec.pool_id,
740 p_name => p_rec.name,
741 p_parent_pool_id => p_rec.parent_pool_id,
742 p_object_version_number => p_rec.object_version_number);
743 --
744 -- After validating the set of important attributes,
745 -- if Multiple Message detection is enabled and at least
746 -- one error has been found then abort further validation.
747 --
748 hr_multi_message.end_validation_set;
749 --
750 -- Validate Dependent Attributes
751 --
752 --
753 hr_utility.set_location(' Leaving:'||l_proc, 10);
754 End insert_validate;
755 --
756 -- ----------------------------------------------------------------------------
757 -- |---------------------------< update_validate >----------------------------|
758 -- ----------------------------------------------------------------------------
759 Procedure update_validate
760 (p_effective_date in date
761 ,p_rec in pqh_bpl_shd.g_rec_type
762 ) is
763 --
764 l_proc varchar2(72) := g_package||'update_validate';
765 --
766 Begin
767 hr_utility.set_location('Entering:'||l_proc, 5);
768 --
769 -- Call all supporting business operations
770 --
771 hr_api.validate_bus_grp_id
772 (p_business_group_id => p_rec.business_group_id
773 ,p_associated_column1 => pqh_bpl_shd.g_tab_nam
774 || '.BUSINESS_GROUP_ID');
775 chk_pool_id
776 (p_pool_id => p_rec.pool_id,
777 p_object_version_number => p_rec.object_version_number);
778 --
779 /* Should allow updating folders to mark the same as approved/rejected
780 chk_upd_allowed
781 (p_pool_id => p_rec.pool_id,
782 p_parent_pool_id => p_rec.parent_pool_id,
783 p_object_version_number => p_rec.object_version_number);
784 */
785 --
786 if p_rec.parent_pool_id is null then
787 chk_budget_version_id
788 (p_pool_id => p_rec.pool_id,
789 p_budget_version_id => p_rec.budget_version_id,
790 p_object_version_number => p_rec.object_version_number);
791 --
792 chk_budget_unit_id
793 (p_pool_id => p_rec.pool_id,
794 p_budget_version_id => p_rec.budget_version_id,
795 p_budget_unit_id => p_rec.budget_unit_id,
796 p_effective_date => p_effective_date,
797 p_object_version_number => p_rec.object_version_number);
798 --
799 chk_tnx_category_id(p_transaction_category_id => p_rec.wf_transaction_category_id);
800 --
801 end if;
802 --
803 chk_pool_name
804 (p_pool_id => p_rec.pool_id,
805 p_name => p_rec.name,
806 p_parent_pool_id => p_rec.parent_pool_id,
807 p_object_version_number => p_rec.object_version_number);
808 --
809 --
810 -- After validating the set of important attributes,
811 -- if Multiple Message detection is enabled and at least
812 -- one error has been found then abort further validation.
813 --
814 hr_multi_message.end_validation_set;
815 --
816 -- Validate Dependent Attributes
817 --
818 chk_non_updateable_args
819 (p_effective_date => p_effective_date
820 ,p_rec => p_rec
821 );
822 --
823 --
824 hr_utility.set_location(' Leaving:'||l_proc, 10);
825 End update_validate;
826 --
827 -- ----------------------------------------------------------------------------
828 -- |---------------------------< delete_validate >----------------------------|
829 -- ----------------------------------------------------------------------------
830 Procedure delete_validate
831 (p_rec in pqh_bpl_shd.g_rec_type
832 ) is
833 --
834 l_proc varchar2(72) := g_package||'delete_validate';
835 --
836 Begin
837 hr_utility.set_location('Entering:'||l_proc, 5);
838 --
839 -- Call all supporting business operations
840 --
841 hr_utility.set_location(' Leaving:'||l_proc, 10);
842 End delete_validate;
843 --
844 end pqh_bpl_bus;