108: BEGIN
109:
110: /*Inserts final calculated values into temp table*/
111:
112: hr_utility.trace('Entering load_data ...' ||SQLERRM);
113:
114:
115:
116: INSERT INTO pay_us_rpt_totals
161: EXCEPTION
162: ---------
163: WHEN OTHERS THEN
164:
165: hr_utility.trace('Error occurred load balances...' ||SQLERRM);
166:
167: END load_balances;
168:
169: FUNCTION get_legislation_code (p_business_group_id IN NUMBER)
173: IS
174:
175: l_legislation_code_l per_business_groups.legislation_code%TYPE;
176: BEGIN
177: hr_utility.trace('Enter Legislation code');
178: SELECT legislation_code
179: INTO l_legislation_code_l
180: FROM per_business_groups
181: WHERE business_group_id =p_business_group_id;
180: FROM per_business_groups
181: WHERE business_group_id =p_business_group_id;
182:
183: RETURN (l_legislation_code_l);
184: hr_utility.trace('Leaving Legislation code' );
185:
186: EXCEPTION
187: ---------
188: WHEN OTHERS THEN
234: OR p_comp_type='PADP' OR p_comp_type='PADT'
235: OR p_comp_type= 'PANP' OR p_comp_type= 'PANT'
236: OR p_comp_type= 'PC' OR p_comp_type= 'PP'
237: OR p_comp_type= 'QC' OR p_comp_type= 'YC') THEN
238: hr_utility.trace('Enter GB Legislation');
239: --l_ret_value:=hr_gbbal.calc_all_balances (p_paydate, p_assignment_id,p_defined_balance_id);
240: l_ret_value:=pay_balance_pkg.get_value(p_defined_balance_id,p_assignment_id,p_paydate );
241: --Commented out as we are using a wrapper after the bug was fixed for PTD dim.
242: -- l_ret_value:=hr_dirbal.get_balance(p_assignment_id,p_defined_balance_id,p_paydate );
239: --l_ret_value:=hr_gbbal.calc_all_balances (p_paydate, p_assignment_id,p_defined_balance_id);
240: l_ret_value:=pay_balance_pkg.get_value(p_defined_balance_id,p_assignment_id,p_paydate );
241: --Commented out as we are using a wrapper after the bug was fixed for PTD dim.
242: -- l_ret_value:=hr_dirbal.get_balance(p_assignment_id,p_defined_balance_id,p_paydate );
243: hr_utility.trace('Leaving GB Legislation');
244: p_errmsg:='NOERROR' ;
245: --MAN,MP,QAN,QP,YP
246: ELSIF p_legislation_code='GB' AND ( p_comp_type='MAN' OR p_comp_type= 'MP'
247: OR p_comp_type= 'QAN' OR p_comp_type= 'QP'
266: END IF;
267: IF g_jd_code IS NOT NULL THEN
268: pay_balance_pkg.set_context('JURISDICTION_CODE',g_jd_code);
269: END IF;
270: hr_utility.trace('Entering US OR CA Legislation');
271: l_ret_value:=pay_balance_pkg.get_value(p_defined_balance_id,p_assignment_id,p_paydate );
272: hr_utility.trace('Leaving US OR CA Legislation');
273: p_errmsg:='NOERROR' ;
274: ELSE
268: pay_balance_pkg.set_context('JURISDICTION_CODE',g_jd_code);
269: END IF;
270: hr_utility.trace('Entering US OR CA Legislation');
271: l_ret_value:=pay_balance_pkg.get_value(p_defined_balance_id,p_assignment_id,p_paydate );
272: hr_utility.trace('Leaving US OR CA Legislation');
273: p_errmsg:='NOERROR' ;
274: ELSE
275: -- Call the core get_balance pkg
276: hr_utility.trace('Entering General Legislation');
272: hr_utility.trace('Leaving US OR CA Legislation');
273: p_errmsg:='NOERROR' ;
274: ELSE
275: -- Call the core get_balance pkg
276: hr_utility.trace('Entering General Legislation');
277: l_ret_value:=pay_balance_pkg.get_value(p_defined_balance_id,p_assignment_id,p_paydate );
278: hr_utility.trace('Leaving General Legislation');
279: p_errmsg:='NOERROR' ;
280: END IF;
274: ELSE
275: -- Call the core get_balance pkg
276: hr_utility.trace('Entering General Legislation');
277: l_ret_value:=pay_balance_pkg.get_value(p_defined_balance_id,p_assignment_id,p_paydate );
278: hr_utility.trace('Leaving General Legislation');
279: p_errmsg:='NOERROR' ;
280: END IF;
281:
282: RETURN(l_ret_value);
416: l_temp_date Date;
417: l_tax_year_start_date Date;
418:
419: BEGIN
420: hr_utility.trace('Enter Get balances');
421: hr_utility.trace('Enter legislation code');
422:
423: -- Nocopy changes
424: l_ret_value_nc := p_ret_value;
417: l_tax_year_start_date Date;
418:
419: BEGIN
420: hr_utility.trace('Enter Get balances');
421: hr_utility.trace('Enter legislation code');
422:
423: -- Nocopy changes
424: l_ret_value_nc := p_ret_value;
425:
430: l_business_group_id_ct:=p_business_group_id;
431: l_legislation_code:=get_legislation_code(p_business_group_id);
432: END IF;
433:
434: hr_utility.trace('Exit legislation code');
435: /*Check Report or Group id is entered by user*/
436: IF l_rep_detail.count=0 THEN
437: IF p_report_id IS NOT NULL THEN
438: hr_utility.trace('Enter Report id loop');
434: hr_utility.trace('Exit legislation code');
435: /*Check Report or Group id is entered by user*/
436: IF l_rep_detail.count=0 THEN
437: IF p_report_id IS NOT NULL THEN
438: hr_utility.trace('Enter Report id loop');
439: /*Get report detail*/
440: OPEN c_rep_name (l_legislation_code);
441: LOOP
442: FETCH c_rep_name INTO l_rep_detail(1).exception_report_id ,
456: END LOOP;
457: CLOSE c_def_bal;
458: END LOOP;
459: CLOSE c_rep_name;
460: hr_utility.trace('Leaving Report id loop');
461: ELSIF p_group_id IS NOT NULL AND p_report_id IS NULL THEN
462: hr_utility.trace('Enter Group loop');
463: l_count:=0;
464: /*Get Group detail*/
458: END LOOP;
459: CLOSE c_rep_name;
460: hr_utility.trace('Leaving Report id loop');
461: ELSIF p_group_id IS NOT NULL AND p_report_id IS NULL THEN
462: hr_utility.trace('Enter Group loop');
463: l_count:=0;
464: /*Get Group detail*/
465: OPEN c_group_name (l_legislation_code) ;
466: LOOP
491: l_date_detail.DELETE;
492:
493: END IF;
494: /*Calculation based on comparison type*/
495: hr_utility.trace('Enter date calc loop');
496: IF l_date_detail.count=0 THEN
497: OPEN c_maxdate;
498: LOOP
499: FETCH c_maxdate INTO l_maxdate,l_maxdate1;
503: l_def_bal_id := l_rep_detail(i).defined_balance_id;
504: l_comp_type := l_rep_detail(i).comparison_type;
505: l_comp_value := l_rep_detail(i).comparison_value;
506:
507: hr_utility.trace('Enter conditions loop');
508:
509: --Added by Gattu for tax year change
510: --Getting the financial tax year
511: l_tax_year_start_date := Get_Tax_Start_Date(l_legislation_code
679: END IF; --end if for comparison type
680: END LOOP;--endloop for l_repdetail_table
681: END LOOP;
682: CLOSE c_maxdate;
683: hr_utility.trace('Leaving conditions loop');
684: hr_utility.trace('Complete Populating table');
685: END IF;
686: hr_utility.trace('Enter Balance and calc loop');
687: l_loop_count:=0;
680: END LOOP;--endloop for l_repdetail_table
681: END LOOP;
682: CLOSE c_maxdate;
683: hr_utility.trace('Leaving conditions loop');
684: hr_utility.trace('Complete Populating table');
685: END IF;
686: hr_utility.trace('Enter Balance and calc loop');
687: l_loop_count:=0;
688: l_rowcount:=1;
682: CLOSE c_maxdate;
683: hr_utility.trace('Leaving conditions loop');
684: hr_utility.trace('Complete Populating table');
685: END IF;
686: hr_utility.trace('Enter Balance and calc loop');
687: l_loop_count:=0;
688: l_rowcount:=1;
689: FOR i IN 1..l_rep_detail.count
690: LOOP
704: FOR j in l_rowcount..l_date_detail.count
705: LOOP
706: IF l_def_bal_id=l_date_detail(j).defined_balance_id
707: AND l_exp_rep_id=l_date_detail(j).exception_report_id THEN
708: hr_utility.trace('Enter Balance call');
709: IF l_loop_count=0 THEN
710: l_max_balance:= get_value (p_assignment_id ,
711: l_def_bal_id,
712: l_date_detail(j).pay_date,
727:
728: IF l_errmsg='NOERROR' THEN
729: l_tot_count:=l_tot_count+1;
730: END IF;
731: hr_utility.trace('Leaving Balance call');
732: IF l_prev_balance1<>0 THEN
733: l_pay_count:=l_pay_count+1;
734: END IF;
735: END IF;
737: --l_rowcount:=j-1;
738: l_rowcount:=j;
739: EXIT;
740: END IF;--end if for def balance comparison
741: hr_utility.trace('Enter final calc loop');
742: END LOOP;--endloop for l_date_detail forloop
743: IF l_comp_type ='PADT'OR l_comp_type ='PANT'
744: OR l_comp_type='QP'OR l_comp_type='QAN'
745: OR l_comp_type='MP'OR l_comp_type='MAN' THEN
807: l_total_balance:=100*l_total_balance/l_prev_balance;
808: ELSE
809: l_total_balance:=l_total_balance;
810: END IF;
811: hr_utility.trace('Leaving final calc loop');
812: END IF;
813: -- Code for variance operator
814: IF l_rep_detail(i).variance_operator = '=' THEN
815: IF (l_total_balance)=l_rep_detail(i).variance_value THEN
856: p_ret_value(l_retvalue_count).curent_balance:=l_max_balance;
857: p_ret_value(l_retvalue_count).previous_balance:=l_prev_balance;
858: p_ret_value(l_retvalue_count).ret_val:=l_return_value;
859: END LOOP; --end loop for repdetail for loop
860: hr_utility.trace('Leaving Balance and calc loop');
861: hr_utility.trace('Leaving Get Balances');
862:
863: -- Added by tmehra for nocopy changes - Feb03
864: EXCEPTION
857: p_ret_value(l_retvalue_count).previous_balance:=l_prev_balance;
858: p_ret_value(l_retvalue_count).ret_val:=l_return_value;
859: END LOOP; --end loop for repdetail for loop
860: hr_utility.trace('Leaving Balance and calc loop');
861: hr_utility.trace('Leaving Get Balances');
862:
863: -- Added by tmehra for nocopy changes - Feb03
864: EXCEPTION
865: ---------
863: -- Added by tmehra for nocopy changes - Feb03
864: EXCEPTION
865: ---------
866: WHEN OTHERS THEN
867: hr_utility.trace('Error occurred' ||SQLERRM);
868: p_ret_value := l_ret_value_nc;
869: RAISE;
870:
871: END;
899: l_temp_date DATE ;
900: l_temp_date1 DATE ;
901: l_count NUMBER ;
902: BEGIN
903: hr_utility.trace('Enter update payroll action');
904: OPEN c_set_paydate ;
905: LOOP
906: FETCH c_set_paydate INTO l_maxdate,l_mindate;
907: EXIT WHEN c_set_paydate%NOTFOUND;
912: SET Start_date= NVL(l_mindate,p_effective_date)
913: , effective_date=NVL(l_maxdate,p_effective_date)
914: WHERE payroll_action_id=pactid;
915:
916: hr_utility.trace('Leaving Update payroll action') ;
917:
918: END;
919:
920: PROCEDURE load_details (p_assignment IN NUMBER)
941: --ORDER BY ppv.last_update_date;
942:
943:
944: BEGIN
945: hr_utility.trace('Enter Load details');
946: l_last_name:='';
947: l_first_name:='';
948: l_middle_name:='';
949: l_full_name := '';
969:
970: END LOOP;
971: CLOSE per_det;
972:
973: hr_utility.trace('Leaving Load details');
974:
975: EXCEPTION
976: --------
977: WHEN OTHERS THEN
975: EXCEPTION
976: --------
977: WHEN OTHERS THEN
978: msg1:=SQLERRM;
979: hr_utility.trace('Error occurred load_er_liab ...' ||SQLERRM);
980: END load_details;
981:
982:
983:
1047: l_act_date DATE;
1048: l_offset_date NUMBER;
1049:
1050: BEGIN
1051: hr_utility.trace('ACTID = '||actid);
1052: hr_utility.trace('Enter Load data');
1053: OPEN sel_aaid (actid);
1054: LOOP
1055: FETCH sel_aaid INTO l_assignment_id,
1048: l_offset_date NUMBER;
1049:
1050: BEGIN
1051: hr_utility.trace('ACTID = '||actid);
1052: hr_utility.trace('Enter Load data');
1053: OPEN sel_aaid (actid);
1054: LOOP
1055: FETCH sel_aaid INTO l_assignment_id,
1056: l_start_date,
1107:
1108: EXCEPTION
1109: ---------
1110: WHEN NO_DATA_FOUND THEN
1111: hr_utility.trace('Legislative Details not found...');
1112: RAISE;
1113: END;
1114: END IF;
1115: hr_utility.trace('Number of Records fetched = '||to_char(sel_aaid%ROWCOUNT));
1111: hr_utility.trace('Legislative Details not found...');
1112: RAISE;
1113: END;
1114: END IF;
1115: hr_utility.trace('Number of Records fetched = '||to_char(sel_aaid%ROWCOUNT));
1116: hr_utility.trace('Payroll Action ID = '||to_char(l_payroll_action_id));
1117: hr_utility.trace('Effective Date = '||to_char(l_effective_date));
1118: hr_utility.trace('Action Type = '||l_action_type);
1119: hr_utility.trace('Asg Act ID = '||to_char(l_assignment_action_id));
1112: RAISE;
1113: END;
1114: END IF;
1115: hr_utility.trace('Number of Records fetched = '||to_char(sel_aaid%ROWCOUNT));
1116: hr_utility.trace('Payroll Action ID = '||to_char(l_payroll_action_id));
1117: hr_utility.trace('Effective Date = '||to_char(l_effective_date));
1118: hr_utility.trace('Action Type = '||l_action_type);
1119: hr_utility.trace('Asg Act ID = '||to_char(l_assignment_action_id));
1120: hr_utility.trace('Asg ID = '||to_char(l_assignment_id));
1113: END;
1114: END IF;
1115: hr_utility.trace('Number of Records fetched = '||to_char(sel_aaid%ROWCOUNT));
1116: hr_utility.trace('Payroll Action ID = '||to_char(l_payroll_action_id));
1117: hr_utility.trace('Effective Date = '||to_char(l_effective_date));
1118: hr_utility.trace('Action Type = '||l_action_type);
1119: hr_utility.trace('Asg Act ID = '||to_char(l_assignment_action_id));
1120: hr_utility.trace('Asg ID = '||to_char(l_assignment_id));
1121: IF l_group_id IS NOT NULL THEN
1114: END IF;
1115: hr_utility.trace('Number of Records fetched = '||to_char(sel_aaid%ROWCOUNT));
1116: hr_utility.trace('Payroll Action ID = '||to_char(l_payroll_action_id));
1117: hr_utility.trace('Effective Date = '||to_char(l_effective_date));
1118: hr_utility.trace('Action Type = '||l_action_type);
1119: hr_utility.trace('Asg Act ID = '||to_char(l_assignment_action_id));
1120: hr_utility.trace('Asg ID = '||to_char(l_assignment_id));
1121: IF l_group_id IS NOT NULL THEN
1122: l_vartype:=NULL;
1115: hr_utility.trace('Number of Records fetched = '||to_char(sel_aaid%ROWCOUNT));
1116: hr_utility.trace('Payroll Action ID = '||to_char(l_payroll_action_id));
1117: hr_utility.trace('Effective Date = '||to_char(l_effective_date));
1118: hr_utility.trace('Action Type = '||l_action_type);
1119: hr_utility.trace('Asg Act ID = '||to_char(l_assignment_action_id));
1120: hr_utility.trace('Asg ID = '||to_char(l_assignment_id));
1121: IF l_group_id IS NOT NULL THEN
1122: l_vartype:=NULL;
1123: l_varvalue:=NULL;
1116: hr_utility.trace('Payroll Action ID = '||to_char(l_payroll_action_id));
1117: hr_utility.trace('Effective Date = '||to_char(l_effective_date));
1118: hr_utility.trace('Action Type = '||l_action_type);
1119: hr_utility.trace('Asg Act ID = '||to_char(l_assignment_action_id));
1120: hr_utility.trace('Asg ID = '||to_char(l_assignment_id));
1121: IF l_group_id IS NOT NULL THEN
1122: l_vartype:=NULL;
1123: l_varvalue:=NULL;
1124: END IF;
1168: END IF;
1169: END LOOP;
1170: END IF;
1171: END LOOP;
1172: hr_utility.trace('End of LOAD DATA');
1173: CLOSE sel_aaid;
1174: hr_utility.trace('Leaving Load data');
1175: EXCEPTION
1176: ---------
1170: END IF;
1171: END LOOP;
1172: hr_utility.trace('End of LOAD DATA');
1173: CLOSE sel_aaid;
1174: hr_utility.trace('Leaving Load data');
1175: EXCEPTION
1176: ---------
1177: WHEN OTHERS THEN
1178: hr_utility.trace('Error occurred load_data ...' ||SQLERRM);
1174: hr_utility.trace('Leaving Load data');
1175: EXCEPTION
1176: ---------
1177: WHEN OTHERS THEN
1178: hr_utility.trace('Error occurred load_data ...' ||SQLERRM);
1179: RAISE;
1180: END load_data;
1181:
1182: --This function determines if there are any offset date.
1218: v_alter_string VARCHAR2(100);
1219: v_numrows NUMBER;
1220: BEGIN
1221:
1222: hr_utility.trace('Enter run preprocess');
1223: -- ppa_finder := pqp_ustiaa_pkg.get_parameter('TRANSFER_PPA_FINDER',l_param);
1224:
1225: load_data(actid,
1226: p_effective_date );
1223: -- ppa_finder := pqp_ustiaa_pkg.get_parameter('TRANSFER_PPA_FINDER',l_param);
1224:
1225: load_data(actid,
1226: p_effective_date );
1227: hr_utility.trace('Leaving run preprocess');
1228: EXCEPTION
1229: ---------
1230: WHEN no_data_found THEN
1231: RAISE;
1257: l_tax_year_start_dt Date;
1258: l_proc_name Varchar2(150) := g_proc_name ||'Get_Tax_Start_Date';
1259:
1260: BEGIN
1261: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
1262: Hr_Utility.set_location('p_legislation_code '||p_legislation_code, 5);
1263: Hr_Utility.set_location('p_effective_date '||p_effective_date, 5);
1264: Hr_Utility.set_location('p_dimension_type_id '||p_dimension_type_id, 5);
1265:
1258: l_proc_name Varchar2(150) := g_proc_name ||'Get_Tax_Start_Date';
1259:
1260: BEGIN
1261: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
1262: Hr_Utility.set_location('p_legislation_code '||p_legislation_code, 5);
1263: Hr_Utility.set_location('p_effective_date '||p_effective_date, 5);
1264: Hr_Utility.set_location('p_dimension_type_id '||p_dimension_type_id, 5);
1265:
1266:
1259:
1260: BEGIN
1261: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
1262: Hr_Utility.set_location('p_legislation_code '||p_legislation_code, 5);
1263: Hr_Utility.set_location('p_effective_date '||p_effective_date, 5);
1264: Hr_Utility.set_location('p_dimension_type_id '||p_dimension_type_id, 5);
1265:
1266:
1267: OPEN c_tax_start_date(p_dimension_type_id,p_legislation_code);
1260: BEGIN
1261: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
1262: Hr_Utility.set_location('p_legislation_code '||p_legislation_code, 5);
1263: Hr_Utility.set_location('p_effective_date '||p_effective_date, 5);
1264: Hr_Utility.set_location('p_dimension_type_id '||p_dimension_type_id, 5);
1265:
1266:
1267: OPEN c_tax_start_date(p_dimension_type_id,p_legislation_code);
1268: FETCH c_tax_start_date INTO l_tax_year_start;
1267: OPEN c_tax_start_date(p_dimension_type_id,p_legislation_code);
1268: FETCH c_tax_start_date INTO l_tax_year_start;
1269: CLOSE c_tax_start_date;
1270:
1271: Hr_Utility.set_location('l_tax_year_start '||l_tax_year_start, 5);
1272:
1273:
1274: IF l_tax_year_start IS NOT NULL THEN
1275: SELECT fnd_date.canonical_to_date(to_char(p_effective_date,'YYYY') ||
1278:
1279: --SELECT to_date(to_char(l_tax_year_start,'DD-MON-')|| to_char(p_effective_date,'YYYY'),'DD-MON-YYYY')
1280: --INTO l_tax_year_start_dt from dual;
1281: END IF;
1282: Hr_Utility.set_location('l_tax_year_start_dt '||l_tax_year_start_dt, 5);
1283: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
1284: RETURN l_tax_year_start_dt;
1285:
1286: EXCEPTION
1279: --SELECT to_date(to_char(l_tax_year_start,'DD-MON-')|| to_char(p_effective_date,'YYYY'),'DD-MON-YYYY')
1280: --INTO l_tax_year_start_dt from dual;
1281: END IF;
1282: Hr_Utility.set_location('l_tax_year_start_dt '||l_tax_year_start_dt, 5);
1283: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
1284: RETURN l_tax_year_start_dt;
1285:
1286: EXCEPTION
1287: WHEN Others THEN
1284: RETURN l_tax_year_start_dt;
1285:
1286: EXCEPTION
1287: WHEN Others THEN
1288: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
1289: RETURN null;
1290: END Get_Tax_Start_Date;
1291:
1292: -- =============================================================================
1300: l_previous_year_tax_dt Date;
1301: l_proc_name Varchar2(150) := g_proc_name ||'Get_Previous_Year_Tax_Date';
1302:
1303: BEGIN
1304: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
1305: Hr_Utility.set_location('p_effective_date: '||p_effective_date, 5);
1306: Hr_Utility.set_location('p_tax_year_start_date:'||p_tax_year_start_date, 5);
1307:
1308: IF p_tax_year_start_date IS NOT NULL THEN
1301: l_proc_name Varchar2(150) := g_proc_name ||'Get_Previous_Year_Tax_Date';
1302:
1303: BEGIN
1304: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
1305: Hr_Utility.set_location('p_effective_date: '||p_effective_date, 5);
1306: Hr_Utility.set_location('p_tax_year_start_date:'||p_tax_year_start_date, 5);
1307:
1308: IF p_tax_year_start_date IS NOT NULL THEN
1309: IF p_tax_year_start_date > p_effective_date THEN
1302:
1303: BEGIN
1304: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
1305: Hr_Utility.set_location('p_effective_date: '||p_effective_date, 5);
1306: Hr_Utility.set_location('p_tax_year_start_date:'||p_tax_year_start_date, 5);
1307:
1308: IF p_tax_year_start_date IS NOT NULL THEN
1309: IF p_tax_year_start_date > p_effective_date THEN
1310: l_previous_year_tax_dt := ADD_MONTHS(p_tax_year_start_date ,-12)-1;
1311: ELSE
1312: l_previous_year_tax_dt := p_tax_year_start_date-1;
1313: END IF;
1314: END IF;
1315: Hr_Utility.set_location('l_previous_year_tax_dt '||l_previous_year_tax_dt, 5);
1316: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
1317: RETURN l_previous_year_tax_dt;
1318:
1319: EXCEPTION
1312: l_previous_year_tax_dt := p_tax_year_start_date-1;
1313: END IF;
1314: END IF;
1315: Hr_Utility.set_location('l_previous_year_tax_dt '||l_previous_year_tax_dt, 5);
1316: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
1317: RETURN l_previous_year_tax_dt;
1318:
1319: EXCEPTION
1320: WHEN Others THEN
1317: RETURN l_previous_year_tax_dt;
1318:
1319: EXCEPTION
1320: WHEN Others THEN
1321: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
1322: RETURN null;
1323: END Get_Previous_Year_Tax_Date;
1324:
1325:
1336: l_proc_name Varchar2(150) := g_proc_name ||'Get_Previous_Quarter_Tax_Date';
1337: l_tax_year_start_date Date;
1338: l_sign number;
1339: BEGIN
1340: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
1341: Hr_Utility.set_location('p_tax_year_start_date:'||p_tax_year_start_date, 5);
1342: Hr_Utility.set_location('p_effective_date: '||p_effective_date, 5);
1343: Hr_Utility.set_location('p_count: '||p_count, 5);
1344:
1337: l_tax_year_start_date Date;
1338: l_sign number;
1339: BEGIN
1340: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
1341: Hr_Utility.set_location('p_tax_year_start_date:'||p_tax_year_start_date, 5);
1342: Hr_Utility.set_location('p_effective_date: '||p_effective_date, 5);
1343: Hr_Utility.set_location('p_count: '||p_count, 5);
1344:
1345: IF p_tax_year_start_date IS NOT NULL THEN
1338: l_sign number;
1339: BEGIN
1340: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
1341: Hr_Utility.set_location('p_tax_year_start_date:'||p_tax_year_start_date, 5);
1342: Hr_Utility.set_location('p_effective_date: '||p_effective_date, 5);
1343: Hr_Utility.set_location('p_count: '||p_count, 5);
1344:
1345: IF p_tax_year_start_date IS NOT NULL THEN
1346: IF p_tax_year_start_date > p_effective_date THEN
1339: BEGIN
1340: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
1341: Hr_Utility.set_location('p_tax_year_start_date:'||p_tax_year_start_date, 5);
1342: Hr_Utility.set_location('p_effective_date: '||p_effective_date, 5);
1343: Hr_Utility.set_location('p_count: '||p_count, 5);
1344:
1345: IF p_tax_year_start_date IS NOT NULL THEN
1346: IF p_tax_year_start_date > p_effective_date THEN
1347: l_tax_year_start_date := ADD_MONTHS(p_tax_year_start_date ,-12);
1381: l_previous_quater_tax_dt:= ADD_MONTHS(l_previous_quater_tax_dt,((p_count-1)*-3));
1382: END IF;
1383: END IF;
1384:
1385: Hr_Utility.set_location('l_previous_quater_tax_dt '||l_previous_quater_tax_dt, 5);
1386: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
1387: RETURN l_previous_quater_tax_dt;
1388:
1389: EXCEPTION
1382: END IF;
1383: END IF;
1384:
1385: Hr_Utility.set_location('l_previous_quater_tax_dt '||l_previous_quater_tax_dt, 5);
1386: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
1387: RETURN l_previous_quater_tax_dt;
1388:
1389: EXCEPTION
1390: WHEN Others THEN
1387: RETURN l_previous_quater_tax_dt;
1388:
1389: EXCEPTION
1390: WHEN Others THEN
1391: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
1392: RETURN null;
1393: END Get_Previous_Quarter_Tax_Date;
1394: ------------------------------ end load data -------------------------------
1395: END ;