DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_IN_DISABILITY_LEG_HOOK

Source


1 PACKAGE BODY  per_in_disability_leg_hook AS
2 /* $Header: peinlhdi.pkb 120.3 2007/09/25 11:54:29 rsaharay ship $ */
3 --
4 --
5 -- Globals
6 --
7 g_package         constant VARCHAR2(100) := 'per_in_disability_leg_hook.' ;
8 g_debug           BOOLEAN ;
9 g_message_name    VARCHAR2(30);
10 g_token_name      pay_in_utils.char_tab_type;
11 g_token_value     pay_in_utils.char_tab_type;
12 
13 --------------------------------------------------------------------------
14 --                                                                      --
15 -- Name           : EMP_DISABILITY_INT                                  --
16 -- Type           : PROCEDURE                                           --
17 -- Access         : Private                                             --
18 -- Description    : Internal Procedure for IN localization              --
19 -- Parameters     :                                                     --
20 --             IN : p_effective_date  DATE                              --
21 --                  p_person_id       NUMBER                            --
22 --                  p_category        VARCHAR2                          --
23 --                  p_status          VARCHAR2                          --
24 --                  p_degree          NUMBER                            --
25 --                  p_dis_information1 VARCHAR2                         --
26 --                  p_calling_procedure VARCHAR2                        --
27 --                                                                      --
28 --            OUT : p_message_name  VARCHAR2                            --
29 --                  p_token_name    VARCHAR2                            --
30 --                  p_token_value   VARCHAR2                            --
31 --         RETURN : N/A                                                 --
32 --                                                                      --
33 -- Change History :                                                     --
34 --------------------------------------------------------------------------
35 -- Rev#  Date       Userid    Bug      Description                      --
36 --------------------------------------------------------------------------
37 -- 1.0   24-Nov-04  vgsriniv 3994151  Created this procedure            --
38 -- 1.1   26-Nov-04  vgsriniv 3994151  Corrected the message call        --
39 -- 1.2   25-Apr-05  vgsriniv 4251141  Made a call to pay_in_tax_        --
40 --                                    declaration.declare_section80u    --
41 -- 1.3   25-Sep-07  rsaharay 6401091  Added primary_flag join in        --
42 --                                    cursor c_asg_details              --
43 --------------------------------------------------------------------------
44 PROCEDURE emp_disability_int
45              (p_effective_date          IN DATE
46 	     ,p_person_id               IN NUMBER
47 	     ,p_category                IN VARCHAR2
48 	     ,p_status                  IN VARCHAR2
49 	     ,p_degree                  IN NUMBER
50 	     ,p_dis_information1        IN VARCHAR2
51              ,p_calling_procedure       IN VARCHAR2
52        	     ,p_message_name            OUT NOCOPY VARCHAR2
53              ,p_token_name              OUT NOCOPY pay_in_utils.char_tab_type
54              ,p_token_value             OUT NOCOPY pay_in_utils.char_tab_type)
55 IS
56 
57 --
58 l_procedure            VARCHAR2(100);
59 l_message              VARCHAR2(255);
60 l_assignment_id        per_assignments_f.assignment_id%TYPE;
61 l_pension_fund_80ccc   NUMBER;
62 l_med_ins_prem_80d     NUMBER;
63 l_80ddb_sr             VARCHAR2(5);
64 l_disease_trt          NUMBER;
65 l_80d_sr               VARCHAR2(5);
66 l_edu_80e              NUMBER;
67 l_claim_80gg           VARCHAR2(5);
68 l_don_80gga            NUMBER;
69 l_inv_80l              NUMBER;
70 l_sec_80l              NUMBER;
71 l_date                 DATE;
72 l_warning              BOOLEAN;
73 l_payroll_id           per_assignments_f.payroll_id%TYPE;
74 l_element_entry_id     NUMBER;
75 
76 
77    CURSOR c_asg_details IS
78    SELECT assignment_id
79      FROM per_assignments_f
80     WHERE person_id = p_person_id
81       AND primary_flag = 'Y'
82       AND p_effective_date BETWEEN effective_start_date
83                                AND effective_end_date;
84 
85 --
86 BEGIN
87 --
88   g_debug := hr_utility.debug_enabled;
89   l_procedure := g_package || 'emp_disability_int';
90   pay_in_utils.set_location(g_debug,'Entering: '||l_procedure,10);
91 
92   IF g_debug THEN
93      pay_in_utils.trace('**************************************************','********************');
94      pay_in_utils.trace('p_effective_date',p_effective_date);
95      pay_in_utils.trace('p_person_id',p_person_id);
96      pay_in_utils.trace('p_category',p_category);
97      pay_in_utils.trace('p_status',p_status);
98      pay_in_utils.trace('p_degree',p_degree);
99      pay_in_utils.trace('p_dis_information1',p_dis_information1);
100      pay_in_utils.trace('p_calling_procedure',p_calling_procedure);
101      pay_in_utils.trace('**************************************************','********************');
102   END IF;
103 
104   pay_in_utils.null_message(p_token_name, p_token_value);
105   p_message_name := 'SUCCESS';
106   --
107   pay_in_utils.set_location(g_debug, l_procedure, 20);
108   --
109   OPEN c_asg_details;
110   FETCH c_asg_details INTO l_assignment_id;
111   CLOSE c_asg_details;
112   --
113   pay_in_utils.set_location(g_debug, l_procedure, 30);
114   --
115 
116   IF p_dis_information1 = 'Y' AND
117      p_degree >= 40 AND
118      p_category IN ('BLIND','SA_VIS_IMP','LC','SA_HEA_IMP','LD','07','MI','AU','CP','MD')
119   THEN
120      --
121      pay_in_utils.set_location(g_debug, l_procedure, 50);
122      --
123 
124     pay_in_tax_declaration.declare_section80u
125      (p_assignment_id                   => l_assignment_id
126      ,p_effective_date                  => p_effective_date
127      ,p_warnings                        => l_warning
128      );
129      --
130      pay_in_utils.set_location(g_debug, l_procedure, 60);
131      --
132   END IF;
133   pay_in_utils.set_location(g_debug, 'Leaving: '||l_procedure, 100);
134 
135 END emp_disability_int;
136 
137 --------------------------------------------------------------------------
138 --                                                                      --
139 -- Name           : EMP_DISABILITY_CREATE                               --
140 -- Type           : PROCEDURE                                           --
141 -- Access         : Public                                              --
142 -- Description    : Generic Procedure to be called for IN localization  --
143 -- Parameters     :                                                     --
144 --             IN : p_effective_date   DATE                             --
145 --                  p_person_id        NUMBER                           --
146 --                  p_category         VARCHAR2                         --
147 --                  p_status           VARCHAR2                         --
148 --                  p_degree           NUMBER                           --
149 --                  p_dis_information1 VARCHAR2                         --
150 --            OUT : N/A                                                 --
151 --         RETURN : N/A                                                 --
152 --                                                                      --
153 -- Change History :                                                     --
154 --------------------------------------------------------------------------
155 -- Rev#  Date       Userid    Bug      Description                      --
156 --------------------------------------------------------------------------
157 -- 1.0   24-Nov-04  vgsriniv 3994151  Created this procedure            --
158 --------------------------------------------------------------------------
159 PROCEDURE emp_disability_create
160              (p_effective_date   IN DATE
161 	     ,p_person_id        IN NUMBER
162 	     ,p_category         IN VARCHAR2
163 	     ,p_status           IN VARCHAR2
164 	     ,p_degree           IN NUMBER
165 	     ,p_dis_information1 IN VARCHAR2
166 	     )
167 IS
168 --
169 
170 l_procedure    VARCHAR2(100);
171 l_message      VARCHAR2(255);
172 
173 --
174 BEGIN
175 --
176   g_debug := hr_utility.debug_enabled ;
177 
178   l_procedure := g_package || 'emp_disability_create' ;
179   pay_in_utils.set_location(g_debug,'Entering: '||l_procedure,10);
180   g_message_name := 'SUCCESS';
181   pay_in_utils.null_message (g_token_name, g_token_value);
182 
183   IF g_debug THEN
184      pay_in_utils.trace('**************************************************','********************');
185      pay_in_utils.trace('p_effective_date',p_effective_date);
186      pay_in_utils.trace('p_person_id',p_person_id);
187      pay_in_utils.trace('p_category',p_category);
188      pay_in_utils.trace('p_status',p_status);
189      pay_in_utils.trace('p_degree',p_degree);
190      pay_in_utils.trace('p_dis_information1',p_dis_information1);
191      pay_in_utils.trace('**************************************************','********************');
192   END IF;
193   --
194   -- Check if PAY is installed for India Localization
195   --
196   IF hr_utility.chk_product_install('Oracle Payroll','IN') THEN
197 
198      pay_in_utils.set_location(g_debug,l_procedure,20);
199 
200      emp_disability_int
201              (p_effective_date          => p_effective_date
202 	     ,p_person_id               => p_person_id
203 	     ,p_category                => p_category
204 	     ,p_status                  => p_status
205 	     ,p_degree                  => p_degree
206 	     ,p_dis_information1        => p_dis_information1
207 	     ,p_calling_procedure       => l_procedure
208 	     ,p_message_name            => g_message_name
209 	     ,p_token_name              => g_token_name
210              ,p_token_value             => g_token_value
211 	     );
212 
213   --
214   END IF ;
215   pay_in_utils.set_location(g_debug,'Leaving: '||l_procedure,30);
216   pay_in_utils.raise_message(800, g_message_name, g_token_name, g_token_value);
217 --
218 END emp_disability_create;
219 
220 --------------------------------------------------------------------------
221 --                                                                      --
222 -- Name           : EMP_DISABILITY_UPDATE                               --
223 -- Type           : PROCEDURE                                           --
224 -- Access         : Public                                              --
225 -- Description    : Generic Procedure to be called for IN localization  --
226 -- Parameters     :                                                     --
227 --             IN : p_effective_date   DATE                             --
228 --                  p_disability_id    NUMBER                           --
229 --                  p_category         VARCHAR2                         --
230 --                  p_status           VARCHAR2                         --
231 --                  p_degree           NUMBER                           --
232 --                  p_dis_information1 VARCHAR2                         --
233 --            OUT : N/A                                                 --
234 --         RETURN : N/A                                                 --
235 --                                                                      --
236 -- Change History :                                                     --
237 --------------------------------------------------------------------------
238 -- Rev#  Date       Userid    Bug      Description                      --
239 --------------------------------------------------------------------------
240 -- 1.0   24-Nov-04  vgsriniv 3994151  Created this procedure            --
241 --------------------------------------------------------------------------
242 
243 PROCEDURE emp_disability_update
244              (p_effective_date   IN DATE
245              ,p_disability_id    IN NUMBER
246 	     ,p_category         IN VARCHAR2
247              ,p_status           IN VARCHAR2
248              ,p_degree           IN NUMBER
249              ,p_dis_information1 IN VARCHAR2
250 	     )
251 IS
252 --
253 l_procedure         VARCHAR2(100);
254 l_message           VARCHAR2(255);
255 l_person_id         per_disabilities_f.person_id%TYPE;
256 l_category          VARCHAR2(20);
257 l_status            VARCHAR2(20);
258 l_degree            NUMBER;
259 l_dis_information1  VARCHAR2(3);
260 --
261 
262 CURSOR c_person_id IS
263 SELECT person_id,category,status,degree,dis_information1
264   FROM per_disabilities_f
265  WHERE disability_id = p_disability_id
266    AND p_effective_date BETWEEN effective_start_date AND effective_end_date;
267 
268 BEGIN
269 --
270   g_debug := hr_utility.debug_enabled ;
271 
272   l_procedure := g_package || 'emp_disability_update' ;
273   pay_in_utils.set_location(g_debug,'Entering: '||l_procedure,10);
274   g_message_name := 'SUCCESS';
275   pay_in_utils.null_message (g_token_name, g_token_value);
276 
277   IF g_debug THEN
278      pay_in_utils.trace('**************************************************','********************');
279      pay_in_utils.trace('p_effective_date',p_effective_date);
280      pay_in_utils.trace('p_disability_id',p_disability_id);
281      pay_in_utils.trace('p_category',p_category);
282      pay_in_utils.trace('p_status',p_status);
283      pay_in_utils.trace('p_degree',p_degree);
284      pay_in_utils.trace('p_dis_information1',p_dis_information1);
285      pay_in_utils.trace('**************************************************','********************');
286   END IF;
287   --
288   -- Check if PAY is installed for India Localization
289   --
290   IF hr_utility.chk_product_install('Oracle Payroll','IN') THEN
291 
292      pay_in_utils.set_location(g_debug,l_procedure,20);
293 
294      OPEN c_person_id;
295      FETCH c_person_id INTO l_person_id,l_category,l_status,l_degree,l_dis_information1;
296      CLOSE c_person_id;
297 
298      pay_in_utils.set_location(g_debug,l_procedure,30);
299 
300      IF p_category <> hr_api.g_varchar2 THEN
301        l_category := p_category;
302      END IF;
303 
304      IF l_status <> hr_api.g_varchar2 THEN
305        l_status := p_status;
306      END IF;
307 
308      IF p_degree <> hr_api.g_number THEN
309        l_degree := p_degree;
310      END IF;
311 
312      IF p_dis_information1 <> hr_api.g_varchar2 THEN
313        l_dis_information1 := p_dis_information1;
314      END IF;
315 
316      emp_disability_int
317              (p_effective_date          => p_effective_date
318 	     ,p_person_id               => l_person_id
319 	     ,p_category                => l_category
320 	     ,p_status                  => l_status
321 	     ,p_degree                  => l_degree
322 	     ,p_dis_information1        => l_dis_information1
323 	     ,p_calling_procedure       => l_procedure
324 	     ,p_message_name            => g_message_name
325 	     ,p_token_name              => g_token_name
326              ,p_token_value             => g_token_value
327 	     );
328 
329 
330   --
331   END IF ;
332 
333   pay_in_utils.set_location(g_debug,'Leaving: '||l_procedure,40);
334   pay_in_utils.raise_message(800, g_message_name, g_token_name, g_token_value);
335 --
336 END emp_disability_update;
337 
338 END per_in_disability_leg_hook;