DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_GB_REVERSE_TERM_RULES

Source


1 PACKAGE BODY PER_GB_REVERSE_TERM_RULES AS
2 /* $Header: pegbrtmr.pkb 120.1 2010/05/14 08:29:47 dwkrishn noship $ */
3 
4 --
5 -------------------------------------------------------------------------------
6 -- VALIDATE_REVERSE_TERMINATION
7 -------------------------------------------------------------------------------
8 
9 PROCEDURE VALIDATE_REVERSE_TERMINATION(p_person_id          		IN NUMBER
10 									  ,p_actual_termination_date 	IN DATE
11 ) IS
12 --
13 l_proc VARCHAR2(30) ;
14 --
15 cursor csr_all_assignments is
16 SELECT paaf.assignment_id,
17 		 paaf.assignment_number
18 FROM     per_all_assignments_f  paaf,
19          per_assignment_status_types past
20 WHERE  paaf.person_id = p_person_id
21 and p_actual_termination_date between paaf.effective_start_date and paaf.effective_end_date
22 AND paaf.assignment_status_type_id = past.assignment_status_type_id
23 AND past.per_system_status in ('ACTIVE_ASSIGN','SUSP_ASSIGN');
24 
25 --
26 BEGIN
27   --
28   --
29   IF hr_utility.chk_product_install('Oracle Human Resources', 'GB') THEN
30    --
31    l_proc := 'VALIDATE_REVERSE_TERMINATION';
32 
33    hr_utility.set_location('Entering:'|| l_proc, 10);
34    for l_asg in csr_all_assignments
35    loop
36    hr_utility.trace(l_proc||': Checking for P45'||
37                       ', p_assignment_id='||l_asg.assignment_id);
38    --
39    -- Check if P45 is issued for this Assignnment
40    -- if issued, error message should be shown.
41    --
42    if pay_p45_pkg.return_p45_issued_flag(l_asg.assignment_id) = 'Y' then
43            hr_utility.trace(l_proc||': P45 issued for Assignment ID : '||l_asg.assignment_id);
44 	   hr_utility.set_message(800,'HR_GB_78150_P45_ISSUED_SS');
45   	   hr_utility.raise_error;
46    end if;
47    --
48    end loop;
49    hr_utility.trace(l_proc||': P45 check completed ');
50    --
51 
52  END IF;
53  --
54  hr_utility.set_location('Leaving:'|| l_proc, 100);
55  --
56 END VALIDATE_REVERSE_TERMINATION;
57 --
58 
59 --
60 END PER_GB_REVERSE_TERM_RULES;