[Home] [Help]
PACKAGE BODY: APPS.PER_IN_ASG_LEG_HOOK
Source
1 PACKAGE BODY per_in_asg_leg_hook AS
2 /* $Header: peinlhas.pkb 120.2 2006/04/27 00:04 vgsriniv noship $ */
3
4 g_package CONSTANT VARCHAR2(100) :='per_in_asg_leg_hook.';
5 g_debug BOOLEAN;
6 g_procedure_name VARCHAR2(100);
7
8 --------------------------------------------------------------------------
9 -- --
10 -- Name : CHECK_ASG --
11 -- Type : Procedure --
12 -- Access : Private --
13 -- Description : Procedure is the driver procedure for the validation--
14 -- of the assignment. --
15 -- This procedure is the internal procedure to be used --
16 -- as common point to code for INS and UPD --
17 -- Parameters : --
18 -- IN : p_dt_mode IN VARCHAR2 --
19 -- p_pt_org_id IN VARCHAR2 --
20 -- p_effective_date IN DATE --
21 -- p_assignment_id IN NUMBER DEFAULT null --
22 -- --
23 -- Change History : --
24 --------------------------------------------------------------------------
25 -- Rev# Date Userid Description --
26 --------------------------------------------------------------------------
27 -- 1.0 06-Sep-04 statkar 3768210 - created --
28 -- 1.1 04-Dec-04 statkar 4029400 - added 2 new procs for ESI/PF --
29 -- 1.2 18-Jan-05 rpalli 4114216 - Corrected code for support for --
30 -- ESI/PF --
31 -- 1.3 02-Feb-05 rpalli 4158566 - Modified message_name to --
32 -- 'SUCCESS' --
33 -- 1.4 10-Apr-05 abhjain 4270513 - Removed call to check_pt_update --
34 -- and check_esi_update --
35 -- 1.5 02-Sep-05 aaagarwa 4589599 - Added p_gre parameter. --
36 --------------------------------------------------------------------------
37 PROCEDURE check_asg (p_dt_mode IN VARCHAR2
38 ,p_effective_date IN DATE
39 ,p_assignment_id IN NUMBER
40 ,p_gre_id IN VARCHAR2
41 ,p_pf_org_id IN VARCHAR2
42 ,p_pt_org_id IN VARCHAR2
43 ,p_esi_org_id IN VARCHAR2
44 ,p_factory_id IN VARCHAR2
45 ,p_estab_id IN VARCHAR2
46 ,p_pga_flag IN VARCHAR2
47 ,p_subint_flag IN VARCHAR2
48 ,p_director IN VARCHAR2
49 ,p_specified IN VARCHAR2
50 )
51 IS
52 CURSOR c_org_name (p_org_id IN NUMBER) IS
53 SELECT name
54 FROM hr_all_organization_units_tl
55 WHERE organization_id = p_org_id
56 AND language = userenv('LANG');
57
58 l_pf_org hr_all_organization_units_tl.name%TYPE;
59 l_gre_org hr_all_organization_units_tl.name%TYPE;
60 l_esi_org hr_all_organization_units_tl.name%TYPE;
61 l_message VARCHAR2(255);
62 l_procedure VARCHAR2(100);
63
64 BEGIN
65
66 g_debug := hr_utility.debug_enabled ;
67 l_procedure := g_package ||'check_asg';
68 pay_in_utils.set_location(g_debug,'Entering: '||l_procedure,10);
69
70 IF NOT hr_utility.chk_product_install('Oracle Human Resources', 'IN') THEN
71 hr_utility.trace ('IN Legislation not installed. Not performing the validations');
72 pay_in_utils.set_location(g_debug,'Leaving: '||l_procedure,20);
73 RETURN;
74 END IF;
75
76 pay_in_utils.set_location(g_debug,l_procedure,30);
77 --
78 -- Code for PF Information
79 --
80 l_message := 'SUCCESS';
81
82 OPEN c_org_name(p_gre_id);
83 FETCH c_org_name
84 INTO l_gre_org;
85 IF c_org_name%NOTFOUND THEN
86 pay_in_utils.set_location(g_debug,l_procedure,40);
87 l_gre_org := NULL;
88 END IF;
89 CLOSE c_org_name;
90
91 OPEN c_org_name(p_pf_org_id);
92 FETCH c_org_name
93 INTO l_pf_org;
94 IF c_org_name%NOTFOUND THEN
95 pay_in_utils.set_location(g_debug,l_procedure,40);
96 l_pf_org := NULL;
97 END IF;
98 CLOSE c_org_name;
99
100 OPEN c_org_name(p_esi_org_id);
101 FETCH c_org_name
102 INTO l_esi_org;
103 IF c_org_name%NOTFOUND THEN
104 pay_in_utils.set_location(g_debug,l_procedure,40);
105 l_esi_org := NULL;
106 END IF;
107 CLOSE c_org_name;
108
109 pay_in_utils.set_location(g_debug,l_procedure,50);
110
111 pay_in_ff_pkg.check_pf_update
112 (p_effective_date => p_effective_date
113 ,p_dt_mode => p_dt_mode
114 ,p_assignment_id => p_assignment_id
115 ,p_gre_org => l_gre_org
116 ,p_pf_org => l_pf_org
117 ,p_esi_org => l_esi_org
118 ,p_message => l_message
119 ,p_gre => NULL
120 ,p_pf => NULL
121 ,p_esi => NULL
122 );
123
124 pay_in_utils.set_location(g_debug,'Leaving: '||l_procedure,60);
125
126 EXCEPTION
127 WHEN OTHERS THEN
128 IF c_org_name%ISOPEN THEN close c_org_name; END IF;
129 hr_utility.set_message(800, 'PER_IN_ORACLE_GENERIC_ERROR');
130 hr_utility.set_message_token('FUNCTION',l_procedure);
131 hr_utility.set_message_token('SQLERRMC',sqlerrm);
132 hr_utility.raise_error;
133 END check_asg;
134
135
136 --------------------------------------------------------------------------
137 -- --
138 -- Name : CHECK_ASG_UPDATE --
139 -- Type : Procedure --
140 -- Access : Public --
141 -- Description : Procedure is the driver procedure for the validation--
142 -- of the assignment. --
143 -- This procedure is the hook procedure for update --
144 -- employee assignment. --
145 -- Parameters : --
146 -- IN : p_datetrack_update_mode VARCHAR2 --
147 -- p_effective_date DATE --
148 -- p_assignment_id NUMBER --
149 -- p_segment1 VARCHAR2 --
150 -- p_segment2 VARCHAR2 --
151 -- p_segment3 VARCHAR2 --
152 -- p_segment4 VARCHAR2 --
153 -- p_segment5 VARCHAR2 --
154 -- p_segment6 VARCHAR2 --
155 -- p_segment8 VARCHAR2 --
156 -- p_segment9 VARCHAR2 --
157 -- p_segment10 VARCHAR2 --
158 -- p_segment11 VARCHAR2 --
159 -- --
160 -- Change History : --
161 --------------------------------------------------------------------------
162 -- Rev# Date Userid Description --
163 --------------------------------------------------------------------------
164 -- 1.0 06-Sep-04 statkar 3768210 - created --
165 -- 1.1 04-Dec-04 statkar 4029400 - added PF/ESI support --
166 -- 1.2 09-Feb-05 rpalli 4158566 - Commented out call for --
167 -- validations for assignment api --
168 --------------------------------------------------------------------------
169 PROCEDURE check_asg_update (p_datetrack_update_mode IN VARCHAR2
170 ,p_effective_date IN DATE
171 ,p_assignment_id IN NUMBER
172 ,p_segment1 IN VARCHAR2 -- tax unit
173 ,p_segment2 IN VARCHAR2 -- pf_org
174 ,p_segment3 IN VARCHAR2 -- pt_org
175 ,p_segment4 IN VARCHAR2 -- esi_org
176 ,p_segment5 IN VARCHAR2 -- factory
177 ,p_segment6 IN VARCHAR2 -- estb
178 ,p_segment8 IN VARCHAR2 -- PGA flag
179 ,p_segment9 IN VARCHAR2 -- Sub Interest
180 ,p_segment10 IN VARCHAR2 -- Director
181 ,p_segment11 IN VARCHAR2 -- Specified
182 )
183 IS
184 l_procedure VARCHAR2(100);
185 BEGIN
186 g_debug := hr_utility.debug_enabled;
187 l_procedure := g_package ||'check_asg_update';
188 pay_in_utils.set_location(g_debug,'Entering: '||l_procedure,10);
189 --
190
191 /* check_asg
192 (p_dt_mode => p_datetrack_update_mode
193 ,p_effective_date => p_effective_date
194 ,p_assignment_id => p_assignment_id
195 ,p_gre_id => p_segment1
196 ,p_pf_org_id => p_segment2
197 ,p_pt_org_id => p_segment3
198 ,p_esi_org_id => p_segment4
199 ,p_factory_id => p_segment5
200 ,p_estab_id => p_segment6
201 ,p_pga_flag => p_segment8
202 ,p_subint_flag => p_segment9
203 ,p_director => p_segment10
204 ,p_specified => p_segment11
205 );
206
207 pay_in_utils.set_location(g_debug,'Leaving: '||g_procedure_name,20);
208
209 EXCEPTION
210 WHEN OTHERS THEN
211 hr_utility.set_message(800, 'PER_IN_ORACLE_GENERIC_ERROR');
212 hr_utility.set_message_token('FUNCTION',g_procedure_name);
213 hr_utility.set_message_token('SQLERRMC',sqlerrm);
214 hr_utility.raise_error; */
215
216 pay_in_utils.set_location(g_debug,'Leaving: '||l_procedure,20);
217 END check_asg_update;
218
219
220 END per_in_asg_leg_hook;