32: --
33: BEGIN
34: g_debug := hr_utility.debug_enabled ;
35: l_procedure := g_package || 'get_date_earned' ;
36: pay_in_utils.set_location(g_debug,'Entering: '||l_procedure,10);
37:
38: if g_debug then
39: pay_in_utils.trace('******************************','********************');
40: pay_in_utils.trace('p_date_earned : ',p_date_earned);
35: l_procedure := g_package || 'get_date_earned' ;
36: pay_in_utils.set_location(g_debug,'Entering: '||l_procedure,10);
37:
38: if g_debug then
39: pay_in_utils.trace('******************************','********************');
40: pay_in_utils.trace('p_date_earned : ',p_date_earned);
41: pay_in_utils.trace('******************************','********************');
42: end if;
43:
36: pay_in_utils.set_location(g_debug,'Entering: '||l_procedure,10);
37:
38: if g_debug then
39: pay_in_utils.trace('******************************','********************');
40: pay_in_utils.trace('p_date_earned : ',p_date_earned);
41: pay_in_utils.trace('******************************','********************');
42: end if;
43:
44: RETURN trunc(p_date_earned);
37:
38: if g_debug then
39: pay_in_utils.trace('******************************','********************');
40: pay_in_utils.trace('p_date_earned : ',p_date_earned);
41: pay_in_utils.trace('******************************','********************');
42: end if;
43:
44: RETURN trunc(p_date_earned);
45: END get_date_earned;
111: BEGIN
112:
113: g_debug := hr_utility.debug_enabled ;
114: l_procedure := g_package || 'get_date_earned' ;
115: pay_in_utils.set_location(g_debug,'Entering: '||l_procedure,10);
116:
117: if g_debug then
118: pay_in_utils.trace('******************************','********************');
119: pay_in_utils.trace('p_date_earned : ',p_date_earned);
114: l_procedure := g_package || 'get_date_earned' ;
115: pay_in_utils.set_location(g_debug,'Entering: '||l_procedure,10);
116:
117: if g_debug then
118: pay_in_utils.trace('******************************','********************');
119: pay_in_utils.trace('p_date_earned : ',p_date_earned);
120: pay_in_utils.trace('p_assignment_id : ',p_assignment_id);
121: pay_in_utils.trace('******************************','********************');
122: end if;
115: pay_in_utils.set_location(g_debug,'Entering: '||l_procedure,10);
116:
117: if g_debug then
118: pay_in_utils.trace('******************************','********************');
119: pay_in_utils.trace('p_date_earned : ',p_date_earned);
120: pay_in_utils.trace('p_assignment_id : ',p_assignment_id);
121: pay_in_utils.trace('******************************','********************');
122: end if;
123:
116:
117: if g_debug then
118: pay_in_utils.trace('******************************','********************');
119: pay_in_utils.trace('p_date_earned : ',p_date_earned);
120: pay_in_utils.trace('p_assignment_id : ',p_assignment_id);
121: pay_in_utils.trace('******************************','********************');
122: end if;
123:
124: IF to_number(to_char(p_date_earned,'mm')) > 3 THEN
117: if g_debug then
118: pay_in_utils.trace('******************************','********************');
119: pay_in_utils.trace('p_date_earned : ',p_date_earned);
120: pay_in_utils.trace('p_assignment_id : ',p_assignment_id);
121: pay_in_utils.trace('******************************','********************');
122: end if;
123:
124: IF to_number(to_char(p_date_earned,'mm')) > 3 THEN
125: l_fy_start_date := to_date('01-04-'||to_char(p_date_earned,'YYYY'),'dd-mm-yyyy');
127: l_fy_start_date := add_months(to_date('01-04-'||to_char(p_date_earned,'YYYY'),'dd-mm-yyyy'),-12);
128: END IF;
129:
130: if g_debug then
131: pay_in_utils.trace('l_fy_start_date : ',l_fy_start_date);
132: end if;
133:
134: OPEN c_assign_action(l_fy_start_date);
135: FETCH c_assign_action INTO l_assignment_action_id, l_last_earn_date;
135: FETCH c_assign_action INTO l_assignment_action_id, l_last_earn_date;
136: CLOSE c_assign_action;
137:
138: if g_debug then
139: pay_in_utils.trace('l_assignment_action_id : ',l_assignment_action_id);
140: pay_in_utils.trace('l_last_earn_date : ',l_last_earn_date);
141: end if;
142:
143: OPEN c_defined_balance_id;
136: CLOSE c_assign_action;
137:
138: if g_debug then
139: pay_in_utils.trace('l_assignment_action_id : ',l_assignment_action_id);
140: pay_in_utils.trace('l_last_earn_date : ',l_last_earn_date);
141: end if;
142:
143: OPEN c_defined_balance_id;
144: FETCH c_defined_balance_id INTO l_defined_balance_id;
144: FETCH c_defined_balance_id INTO l_defined_balance_id;
145: CLOSE c_defined_balance_id;
146:
147: if g_debug then
148: pay_in_utils.trace('l_defined_balance_id : ',l_defined_balance_id);
149: end if;
150:
151: l_balance_value := pay_balance_pkg.get_value(p_defined_balance_id => l_defined_balance_id
152: ,p_assignment_action_id => l_assignment_action_id);
151: l_balance_value := pay_balance_pkg.get_value(p_defined_balance_id => l_defined_balance_id
152: ,p_assignment_action_id => l_assignment_action_id);
153:
154: if g_debug then
155: pay_in_utils.trace('******************************','********************');
156: pay_in_utils.trace('l_balance_value : ',l_balance_value);
157: pay_in_utils.trace('l_last_earn_date : ',l_last_earn_date);
158: pay_in_utils.trace('******************************','********************');
159: end if;
152: ,p_assignment_action_id => l_assignment_action_id);
153:
154: if g_debug then
155: pay_in_utils.trace('******************************','********************');
156: pay_in_utils.trace('l_balance_value : ',l_balance_value);
157: pay_in_utils.trace('l_last_earn_date : ',l_last_earn_date);
158: pay_in_utils.trace('******************************','********************');
159: end if;
160:
153:
154: if g_debug then
155: pay_in_utils.trace('******************************','********************');
156: pay_in_utils.trace('l_balance_value : ',l_balance_value);
157: pay_in_utils.trace('l_last_earn_date : ',l_last_earn_date);
158: pay_in_utils.trace('******************************','********************');
159: end if;
160:
161: pay_in_utils.set_location(g_debug,'Leaving: '||l_procedure,20);
154: if g_debug then
155: pay_in_utils.trace('******************************','********************');
156: pay_in_utils.trace('l_balance_value : ',l_balance_value);
157: pay_in_utils.trace('l_last_earn_date : ',l_last_earn_date);
158: pay_in_utils.trace('******************************','********************');
159: end if;
160:
161: pay_in_utils.set_location(g_debug,'Leaving: '||l_procedure,20);
162:
157: pay_in_utils.trace('l_last_earn_date : ',l_last_earn_date);
158: pay_in_utils.trace('******************************','********************');
159: end if;
160:
161: pay_in_utils.set_location(g_debug,'Leaving: '||l_procedure,20);
162:
163: p_last_earn_date := NVL(l_last_earn_date, to_date('31-12-4712','dd-mm-yyyy'));
164: RETURN l_balance_value;
165:
165:
166: Exception
167: when others then
168: p_last_earn_date := to_date('31-12-4712','dd-mm-yyyy');
169: l_message := pay_in_utils.get_pay_message('PER_IN_ORACLE_GENERIC_ERROR', 'FUNCTION:'||l_procedure, 'SQLERRMC:'||sqlerrm);
170: pay_in_utils.set_location(g_debug,'Leaving : '||l_procedure, 30);
171: pay_in_utils.trace(l_message,l_procedure);
172: RETURN 0;
173:
166: Exception
167: when others then
168: p_last_earn_date := to_date('31-12-4712','dd-mm-yyyy');
169: l_message := pay_in_utils.get_pay_message('PER_IN_ORACLE_GENERIC_ERROR', 'FUNCTION:'||l_procedure, 'SQLERRMC:'||sqlerrm);
170: pay_in_utils.set_location(g_debug,'Leaving : '||l_procedure, 30);
171: pay_in_utils.trace(l_message,l_procedure);
172: RETURN 0;
173:
174: END get_balance_value;
167: when others then
168: p_last_earn_date := to_date('31-12-4712','dd-mm-yyyy');
169: l_message := pay_in_utils.get_pay_message('PER_IN_ORACLE_GENERIC_ERROR', 'FUNCTION:'||l_procedure, 'SQLERRMC:'||sqlerrm);
170: pay_in_utils.set_location(g_debug,'Leaving : '||l_procedure, 30);
171: pay_in_utils.trace(l_message,l_procedure);
172: RETURN 0;
173:
174: END get_balance_value;
175: