1: PACKAGE BODY PQP_NL_PENSION_EXTRACTS AS
2: /* $Header: pqpnlpext.pkb 120.123.12010000.7 2008/09/04 05:58:24 rsahai ship $ */
3:
4: g_proc_name VARCHAR2(200) :='PQP_NL_Pension_Extracts.';
5: g_debug BOOLEAN := hr_utility.debug_enabled;
6:
7: -- =============================================================================
8: -- Cursor to get the extract record id's for extract definition id
9: -- =============================================================================
1252: l_proc_name Varchar2(150) := g_proc_name ||'Pension_Extract_Process';
1253:
1254: BEGIN
1255: IF g_debug THEN
1256: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
1257: END If;
1258:
1259: g_conc_request_id := Fnd_Global.conc_request_id;
1260:
1273: -- Insert into pay_us_rpt_totals so that we can refer to these parameters
1274: -- when we call the criteria formula for the pension extract.
1275: --
1276: IF g_debug THEN
1277: hr_utility.set_location('inserting into rpt totals : '||p_business_group_id,20);
1278: END IF;
1279:
1280: INSERT INTO pay_us_rpt_totals
1281: (session_id -- Session id
1318: -- Call the actual benefit extract process with the effective date as the
1319: -- extract end date along with the ext def. id and business group id.
1320: --
1321: IF g_debug THEN
1322: Hr_Utility.set_location('..Calling Benefit Ext Process'||l_proc_name, 6);
1323: END IF;
1324:
1325: Ben_Ext_Thread.process
1326: (errbuf => l_errbuff,
1330: p_effective_date => p_end_date,
1331: p_business_group_id => p_business_group_id);
1332:
1333: IF g_debug THEN
1334: Hr_Utility.set_location('Leaving: '||l_proc_name, 80);
1335: END IF;
1336:
1337: EXCEPTION
1338: WHEN Others THEN
1335: END IF;
1336:
1337: EXCEPTION
1338: WHEN Others THEN
1339: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
1340: RAISE;
1341: END Pension_Extract_Process;
1342:
1343: -- ============================================================================
1368: l_ext_dtl_rec_nc ben_ext_rslt_dtl%ROWTYPE;
1369: BEGIN
1370:
1371: IF g_debug THEN
1372: Hr_Utility.set_location('Entering :'||l_proc_name, 5);
1373: END IF;
1374: -- nocopy changes
1375: l_ext_dtl_rec_nc := p_ext_dtl_rec;
1376:
1541: p_ext_dtl_rec.val_75 := p_data_element_value;
1542: END IF;
1543:
1544: IF g_debug THEN
1545: Hr_Utility.set_location('Leaving :'||l_proc_name, 25);
1546: END IF;
1547:
1548: RETURN;
1549: EXCEPTION
1564:
1565: BEGIN -- ins_rslt_dtl
1566:
1567: IF g_debug THEN
1568: Hr_Utility.set_location('Entering :'||l_proc_name, 5);
1569: END IF;
1570: -- nocopy changes
1571: l_dtl_rec_nc := p_dtl_rec;
1572: -- Get the next sequence NUMBER to insert a record into the table
1767: ,p_dtl_rec.RCRD_SEQ_NUM
1768: );
1769:
1770: IF g_debug THEN
1771: Hr_Utility.set_location('Leaving :'||l_proc_name, 25);
1772: END IF;
1773:
1774: RETURN;
1775:
1774: RETURN;
1775:
1776: EXCEPTION
1777: WHEN Others THEN
1778: Hr_Utility.set_location('Leaving :'||l_proc_name, 25);
1779: p_dtl_rec := l_dtl_rec_nc;
1780: RAISE;
1781: END Ins_Rslt_Dtl;
1782:
1943:
1944: BEGIN
1945:
1946: IF g_debug THEN
1947: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
1948: END IF;
1949:
1950: OPEN c_get_org_id;
1951: FETCH c_get_org_id INTO l_org_id,l_bgid;
1952: CLOSE c_get_org_id;
1953:
1954:
1955: IF g_debug THEN
1956: Hr_Utility.set_location('p_ext_dtl_rcd_id: '||p_ext_dtl_rcd_id, 5);
1957: Hr_Utility.set_location('p_assignment_id: '||p_assignment_id, 5);
1958: END IF;
1959:
1960: FOR i IN csr_rule_ele( c_ext_rcd_id => p_ext_dtl_rcd_id)
1953:
1954:
1955: IF g_debug THEN
1956: Hr_Utility.set_location('p_ext_dtl_rcd_id: '||p_ext_dtl_rcd_id, 5);
1957: Hr_Utility.set_location('p_assignment_id: '||p_assignment_id, 5);
1958: END IF;
1959:
1960: FOR i IN csr_rule_ele( c_ext_rcd_id => p_ext_dtl_rcd_id)
1961: LOOP
1964: FETCH csr_ff_type INTO l_foumula_type_id;
1965: CLOSE csr_ff_type;
1966:
1967: IF g_debug THEN
1968: Hr_Utility.set_location('l_foumula_type_id: '||l_foumula_type_id, 5);
1969: END IF;
1970:
1971: IF l_foumula_type_id = -413 THEN -- person level rule
1972: l_outputs := Benutils.formula
1986: IF i.frmt_mask_lookup_cd IS NOT NULL AND
1987: l_ff_value IS NOT NULL THEN
1988: IF Substr(i.frmt_mask_lookup_cd,1,1) = 'N' THEN
1989: IF g_debug THEN
1990: Hr_Utility.set_location('..Applying NUMBER format mask
1991: :ben_ext_fmt.apply_format_mask',50);
1992: END IF;
1993: l_ff_value_fmt := Ben_Ext_Fmt.apply_format_mask(To_Number(l_ff_value), i.frmt_mask_cd);
1994: l_ff_value := l_ff_value_fmt;
1993: l_ff_value_fmt := Ben_Ext_Fmt.apply_format_mask(To_Number(l_ff_value), i.frmt_mask_cd);
1994: l_ff_value := l_ff_value_fmt;
1995: ELSIF Substr(i.frmt_mask_lookup_cd,1,1) = 'D' THEN
1996: IF g_debug THEN
1997: Hr_Utility.set_location('..Applying Date format mask
1998: :ben_ext_fmt.apply_format_mask',55);
1999: END IF;
2000: l_ff_value_fmt := Ben_Ext_Fmt.apply_format_mask(Fnd_Date.canonical_to_date(l_ff_value),
2001: i.frmt_mask_cd);
2018:
2019: Ins_Rslt_Dtl(p_dtl_rec => p_rslt_rec);
2020:
2021: IF g_debug THEN
2022: Hr_Utility.set_location('Leaving: '||l_proc_name, 80);
2023: END IF;
2024:
2025: EXCEPTION
2026: WHEN Others THEN
2023: END IF;
2024:
2025: EXCEPTION
2026: WHEN Others THEN
2027: Hr_Utility.set_location('..error',85);
2028: Hr_Utility.set_location('SQL-ERRM :'||SQLERRM,87);
2029: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
2030: END Process_Ext_Rslt_Dtl_Rec;
2031:
2024:
2025: EXCEPTION
2026: WHEN Others THEN
2027: Hr_Utility.set_location('..error',85);
2028: Hr_Utility.set_location('SQL-ERRM :'||SQLERRM,87);
2029: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
2030: END Process_Ext_Rslt_Dtl_Rec;
2031:
2032: -- ===============================================================================
2025: EXCEPTION
2026: WHEN Others THEN
2027: Hr_Utility.set_location('..error',85);
2028: Hr_Utility.set_location('SQL-ERRM :'||SQLERRM,87);
2029: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
2030: END Process_Ext_Rslt_Dtl_Rec;
2031:
2032: -- ===============================================================================
2033: -- ~ Get_ConcProg_Information : Common function to get the concurrent program parameters
2041:
2042: BEGIN
2043:
2044: IF g_debug THEN
2045: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
2046: END IF;
2047:
2048: IF p_header_type = 'EXTRACT_NAME' THEN
2049: l_return_value := g_conc_prog_details(0).extract_name;
2062: ELSIF p_header_type = 'GRE' THEN
2063: l_return_value := g_conc_prog_details(0).grename;
2064: ELSIF p_header_type = 'PAYROLL_NAME' THEN
2065: IF g_debug THEN
2066: Hr_Utility.set_location('PAYROLL_NAME: '||g_conc_prog_details(0).payrollname, 5);
2067: END IF;
2068: l_return_value := g_conc_prog_details(0).payrollname;
2069: ELSIF p_header_type = 'CON_SET' THEN
2070: l_return_value := g_conc_prog_details(0).consolset;
2068: l_return_value := g_conc_prog_details(0).payrollname;
2069: ELSIF p_header_type = 'CON_SET' THEN
2070: l_return_value := g_conc_prog_details(0).consolset;
2071: IF g_debug THEN
2072: Hr_Utility.set_location('CON_SET: '||l_return_value, 5);
2073: END IF;
2074: END IF;
2075: IF g_debug THEN
2076: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
2072: Hr_Utility.set_location('CON_SET: '||l_return_value, 5);
2073: END IF;
2074: END IF;
2075: IF g_debug THEN
2076: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
2077: END IF;
2078:
2079: RETURN l_return_value;
2080: EXCEPTION
2079: RETURN l_return_value;
2080: EXCEPTION
2081: WHEN Others THEN
2082: p_error_message :='SQL-ERRM :'||SQLERRM;
2083: Hr_Utility.set_location('..Exception Others Raised at Get_ConcProg_Information'||p_error_message,40);
2084: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
2085: RETURN l_return_value;
2086: END Get_ConcProg_Information;
2087:
2080: EXCEPTION
2081: WHEN Others THEN
2082: p_error_message :='SQL-ERRM :'||SQLERRM;
2083: Hr_Utility.set_location('..Exception Others Raised at Get_ConcProg_Information'||p_error_message,40);
2084: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
2085: RETURN l_return_value;
2086: END Get_ConcProg_Information;
2087:
2088: -- =============================================================================
2110: BEGIN
2111:
2112: i := p_business_group_id;
2113: IF g_debug THEN
2114: Hr_Utility.set_location('Entering Get_Balance_Value function:', 5);
2115: END IF;
2116: -- Check this balance already exists in record
2117: -- If it exists then get the balance type id
2118: FOR num IN 1..g_balance_detls.Count LOOP
2164:
2165: EXCEPTION
2166: WHEN Others THEN
2167: p_error_message :='SQL-ERRM :'||SQLERRM;
2168: Hr_Utility.set_location('..'||p_error_message,85);
2169: Hr_Utility.set_location('Leaving Get_Balance_Value function:', 80);
2170: RETURN l_bal_total_amt;
2171: END Get_Balance_Value_Eff_Dt;
2172:
2165: EXCEPTION
2166: WHEN Others THEN
2167: p_error_message :='SQL-ERRM :'||SQLERRM;
2168: Hr_Utility.set_location('..'||p_error_message,85);
2169: Hr_Utility.set_location('Leaving Get_Balance_Value function:', 80);
2170: RETURN l_bal_total_amt;
2171: END Get_Balance_Value_Eff_Dt;
2172:
2173: -- =============================================================================
2188:
2189: i := p_business_group_id;
2190:
2191: IF g_debug THEN
2192: Hr_Utility.set_location('Entering Get_Balance_Value function:', 5);
2193: END IF;
2194:
2195: l_bal_total_amt := Get_Balance_Value_Eff_Dt
2196: (p_assignment_id => p_assignment_id
2205:
2206: EXCEPTION
2207: WHEN Others THEN
2208: p_error_message :='SQL-ERRM :'||SQLERRM;
2209: Hr_Utility.set_location('..'||p_error_message,85);
2210: Hr_Utility.set_location('Leaving Get_Balance_Value function:', 80);
2211: RETURN l_bal_total_amt;
2212: END Get_Balance_Value;
2213:
2206: EXCEPTION
2207: WHEN Others THEN
2208: p_error_message :='SQL-ERRM :'||SQLERRM;
2209: Hr_Utility.set_location('..'||p_error_message,85);
2210: Hr_Utility.set_location('Leaving Get_Balance_Value function:', 80);
2211: RETURN l_bal_total_amt;
2212: END Get_Balance_Value;
2213:
2214: -- ====================================================================
2254:
2255:
2256: BEGIN
2257: IF g_debug THEN
2258: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
2259: END IF;
2260:
2261: OPEN csr_ext_name( c_ext_dfn_id => p_ext_dfn_id);
2262: FETCH csr_ext_name INTO l_extract_name;
2291: g_conc_prog_details(0).orgname := l_org_name;
2292: g_conc_prog_details(0).orgid := p_org_id;
2293:
2294: IF g_debug THEN
2295: Hr_Utility.set_location('Leaving: '||l_proc_name, 80);
2296: END IF;
2297:
2298: EXCEPTION
2299: WHEN Others THEN
2296: END IF;
2297:
2298: EXCEPTION
2299: WHEN Others THEN
2300: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
2301: END Set_ConcProg_Parameter_Values;
2302:
2303: -- ====================================================================
2304: -- Function to check if RR exist for an ass act/element combination
2317:
2318: BEGIN
2319:
2320: IF g_debug THEN
2321: hr_utility.set_location('Entering: '||l_proc_name,5);
2322: hr_utility.set_location('...Ass Act is : '||p_ass_act_id,10);
2323: hr_utility.set_location('...Element Type is : '||p_element_type_id,15);
2324: END IF;
2325:
2318: BEGIN
2319:
2320: IF g_debug THEN
2321: hr_utility.set_location('Entering: '||l_proc_name,5);
2322: hr_utility.set_location('...Ass Act is : '||p_ass_act_id,10);
2323: hr_utility.set_location('...Element Type is : '||p_element_type_id,15);
2324: END IF;
2325:
2326: OPEN c_ass_act;
2319:
2320: IF g_debug THEN
2321: hr_utility.set_location('Entering: '||l_proc_name,5);
2322: hr_utility.set_location('...Ass Act is : '||p_ass_act_id,10);
2323: hr_utility.set_location('...Element Type is : '||p_element_type_id,15);
2324: END IF;
2325:
2326: OPEN c_ass_act;
2327: FETCH c_ass_act INTO l_dummy;
2327: FETCH c_ass_act INTO l_dummy;
2328:
2329: IF c_ass_act%FOUND THEN
2330: IF g_debug THEN
2331: hr_utility.set_location('...Run Results found : ',20);
2332: hr_utility.set_location('Leaving : '||l_proc_name,30);
2333: END IF;
2334: CLOSE c_ass_act;
2335: RETURN TRUE;
2328:
2329: IF c_ass_act%FOUND THEN
2330: IF g_debug THEN
2331: hr_utility.set_location('...Run Results found : ',20);
2332: hr_utility.set_location('Leaving : '||l_proc_name,30);
2333: END IF;
2334: CLOSE c_ass_act;
2335: RETURN TRUE;
2336: ELSE
2334: CLOSE c_ass_act;
2335: RETURN TRUE;
2336: ELSE
2337: IF g_debug THEN
2338: hr_utility.set_location('...Run Results not found : ',20);
2339: hr_utility.set_location('Leaving : '||l_proc_name,30);
2340: END IF;
2341: CLOSE c_ass_act;
2342: RETURN FALSE;
2335: RETURN TRUE;
2336: ELSE
2337: IF g_debug THEN
2338: hr_utility.set_location('...Run Results not found : ',20);
2339: hr_utility.set_location('Leaving : '||l_proc_name,30);
2340: END IF;
2341: CLOSE c_ass_act;
2342: RETURN FALSE;
2343: END IF;
2400:
2401: l_proc_name Varchar2(150) := g_proc_name ||'Get_Asg_Seq_Num';
2402: l_asg_seq_num Varchar2(2);
2403: BEGIN
2404: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
2405: IF g_primary_assig.EXISTS(p_assignment_id) THEN
2406: l_asg_seq_num := g_primary_assig(p_assignment_id).asg_seq_num;
2407: IF To_Number(Nvl(l_asg_seq_num,'1')) < 10 THEN
2408: l_asg_seq_num := '0' ||Nvl(l_asg_seq_num,'1');
2408: l_asg_seq_num := '0' ||Nvl(l_asg_seq_num,'1');
2409: END IF;
2410: END IF;
2411: p_data_element_value := Nvl(l_asg_seq_num,'01');
2412: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
2413: RETURN 0;
2414:
2415: EXCEPTION
2416: WHEN Others THEN
2414:
2415: EXCEPTION
2416: WHEN Others THEN
2417: p_error_message :='SQL-ERRM :'||SQLERRM;
2418: Hr_Utility.set_location('..'||p_error_message,85);
2419: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
2420: RETURN -1;
2421: END Get_Asg_Seq_Num;
2422:
2415: EXCEPTION
2416: WHEN Others THEN
2417: p_error_message :='SQL-ERRM :'||SQLERRM;
2418: Hr_Utility.set_location('..'||p_error_message,85);
2419: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
2420: RETURN -1;
2421: END Get_Asg_Seq_Num;
2422:
2423: --============================================================================
2478: l_asg_seq VARCHAR2(2);
2479:
2480: BEGIN
2481:
2482: hr_utility.set_location('Entering : '||l_proc_name, 90);
2483: hr_utility.set_location('Assignment Id : '||p_assignment_id, 90);
2484: hr_utility.set_location('p_start_date is : '||p_start_date, 90);
2485: hr_utility.set_location('p_end_date is : '||p_end_date, 90);
2486:
2479:
2480: BEGIN
2481:
2482: hr_utility.set_location('Entering : '||l_proc_name, 90);
2483: hr_utility.set_location('Assignment Id : '||p_assignment_id, 90);
2484: hr_utility.set_location('p_start_date is : '||p_start_date, 90);
2485: hr_utility.set_location('p_end_date is : '||p_end_date, 90);
2486:
2487: --
2480: BEGIN
2481:
2482: hr_utility.set_location('Entering : '||l_proc_name, 90);
2483: hr_utility.set_location('Assignment Id : '||p_assignment_id, 90);
2484: hr_utility.set_location('p_start_date is : '||p_start_date, 90);
2485: hr_utility.set_location('p_end_date is : '||p_end_date, 90);
2486:
2487: --
2488: -- Check if the EE assignment was hired in the current extract
2481:
2482: hr_utility.set_location('Entering : '||l_proc_name, 90);
2483: hr_utility.set_location('Assignment Id : '||p_assignment_id, 90);
2484: hr_utility.set_location('p_start_date is : '||p_start_date, 90);
2485: hr_utility.set_location('p_end_date is : '||p_end_date, 90);
2486:
2487: --
2488: -- Check if the EE assignment was hired in the current extract
2489: -- start and end dates
2497: ,p_hire_date
2498: ,p_error_message
2499: ,l_asg_seq);
2500:
2501: hr_utility.set_location('p_hire_date is : '||p_hire_date, 90);
2502:
2503: IF p_hire_date BETWEEN p_start_date AND p_end_date THEN
2504: RETURN 1;
2505: END IF;
2515: FETCH c_rec05_sent INTO l_dummy;
2516: IF c_rec05_sent%NOTFOUND AND
2517: TRUNC(p_hire_date) > TO_DATE('31/12/2005','DD/MM/YYYY') THEN
2518: CLOSE c_rec05_sent;
2519: hr_utility.set_location('Rec 05 Not Sent : '||p_start_date, 90);
2520: RETURN 1;
2521: ELSE
2522: CLOSE c_rec05_sent;
2523: hr_utility.set_location('Rec 05 Sent : '||p_start_date, 90);
2519: hr_utility.set_location('Rec 05 Not Sent : '||p_start_date, 90);
2520: RETURN 1;
2521: ELSE
2522: CLOSE c_rec05_sent;
2523: hr_utility.set_location('Rec 05 Sent : '||p_start_date, 90);
2524: RETURN 0;
2525: END IF;
2526:
2527: hr_utility.set_location('Leaving : '||l_proc_name, 90);
2523: hr_utility.set_location('Rec 05 Sent : '||p_start_date, 90);
2524: RETURN 0;
2525: END IF;
2526:
2527: hr_utility.set_location('Leaving : '||l_proc_name, 90);
2528:
2529: RETURN 0 ;
2530:
2531: EXCEPTION
2531: EXCEPTION
2532:
2533: WHEN OTHERS THEN
2534: p_error_message :='SQL-ERRM :'||SQLERRM;
2535: Hr_Utility.set_location('..'||p_error_message,85);
2536: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
2537: RETURN 0;
2538:
2539: END chk_new_hire_asg;
2532:
2533: WHEN OTHERS THEN
2534: p_error_message :='SQL-ERRM :'||SQLERRM;
2535: Hr_Utility.set_location('..'||p_error_message,85);
2536: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
2537: RETURN 0;
2538:
2539: END chk_new_hire_asg;
2540:
2608: l_proc_name Varchar2(150) := g_proc_name ||'Get_Pen_Prin_Obj_Cd_Cur';
2609:
2610: BEGIN
2611:
2612: Hr_Utility.set_location(' Entering ' || l_proc_name , 5);
2613: OPEN c_obj_cd;
2614: FETCH c_obj_cd INTO l_obj_cd;
2615: IF c_obj_cd%FOUND THEN
2616: CLOSE c_obj_cd;
2620: p_data_element_value := ' ';
2621: END IF;
2622: l_return_value := 0;
2623:
2624: Hr_Utility.set_location(' Leaving ' || l_proc_name , 30);
2625:
2626: RETURN l_return_value;
2627:
2628: EXCEPTION
2627:
2628: EXCEPTION
2629: WHEN Others THEN
2630: p_error_message :='SQL-ERRM :'||SQLERRM;
2631: Hr_Utility.set_location('..'||p_error_message,85);
2632: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
2633: RETURN -1 ;
2634: END Get_Pri_Obj_Cd_Cur;
2635:
2628: EXCEPTION
2629: WHEN Others THEN
2630: p_error_message :='SQL-ERRM :'||SQLERRM;
2631: Hr_Utility.set_location('..'||p_error_message,85);
2632: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
2633: RETURN -1 ;
2634: END Get_Pri_Obj_Cd_Cur;
2635:
2636: -- =============================================================================
2654: l_ret_val NUMBER;
2655:
2656: BEGIN
2657:
2658: Hr_Utility.set_location(' Entering ' || l_proc_name , 30);
2659:
2660: IF l_rec_09_values.count > 0 THEN
2661: j := l_rec_09_values.FIRST;
2662: IF l_rec_09_values.EXISTS(j) THEN
2687: l_return_value := 0;
2688:
2689: END IF;
2690:
2691: Hr_Utility.set_location(' Leaving ' || l_proc_name , 30);
2692:
2693:
2694: RETURN l_return_value;
2695:
2695:
2696: EXCEPTION
2697: WHEN Others THEN
2698: p_error_message :='SQL-ERRM :'||SQLERRM;
2699: Hr_Utility.set_location('..'||p_error_message,85);
2700: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
2701: RETURN -1 ;
2702: END Get_Pri_Obj_Cd;
2703:
2696: EXCEPTION
2697: WHEN Others THEN
2698: p_error_message :='SQL-ERRM :'||SQLERRM;
2699: Hr_Utility.set_location('..'||p_error_message,85);
2700: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
2701: RETURN -1 ;
2702: END Get_Pri_Obj_Cd;
2703:
2704: -- =============================================================================
2757: l_org_struct_ver_id per_org_structure_versions_v.org_structure_version_id%TYPE;
2758: l_tax_org_flag varchar2(1);
2759: l_child_org_flag varchar2(1);
2760: BEGIN
2761: Hr_Utility.set_location(' Entering ' || l_proc_name , 30);
2762:
2763: --Get the org_structure_version_id from the hierarchy atttached to BG
2764: OPEN c_get_org_hierarchy;
2765: FETCH c_get_org_hierarchy INTO l_org_struct_ver_id;
2813:
2814: END LOOP;
2815:
2816:
2817: Hr_Utility.set_location(' Leaving ' || l_proc_name , 100);
2818: EXCEPTION
2819: WHEN Others THEN
2820: l_error_message :='SQL-ERRM :'||SQLERRM;
2821: Hr_Utility.set_location('..'||l_error_message,85);
2817: Hr_Utility.set_location(' Leaving ' || l_proc_name , 100);
2818: EXCEPTION
2819: WHEN Others THEN
2820: l_error_message :='SQL-ERRM :'||SQLERRM;
2821: Hr_Utility.set_location('..'||l_error_message,85);
2822: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
2823: END Set_Er_Children;
2824:
2825: --
2818: EXCEPTION
2819: WHEN Others THEN
2820: l_error_message :='SQL-ERRM :'||SQLERRM;
2821: Hr_Utility.set_location('..'||l_error_message,85);
2822: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
2823: END Set_Er_Children;
2824:
2825: --
2826: -- Function to check if ABP Pensions element is processed for the
2872:
2873: BEGIN
2874:
2875: IF g_debug THEN
2876: Hr_Utility.set_location('Entering: '||l_proc_name,10);
2877: Hr_Utility.set_location('...Assignment Id is : '||p_assignment_id,11);
2878: Hr_Utility.set_location('...Eff Dt is : '||p_effective_date,12);
2879: END IF;
2880:
2873: BEGIN
2874:
2875: IF g_debug THEN
2876: Hr_Utility.set_location('Entering: '||l_proc_name,10);
2877: Hr_Utility.set_location('...Assignment Id is : '||p_assignment_id,11);
2878: Hr_Utility.set_location('...Eff Dt is : '||p_effective_date,12);
2879: END IF;
2880:
2881: l_payroll_id := NULL;
2874:
2875: IF g_debug THEN
2876: Hr_Utility.set_location('Entering: '||l_proc_name,10);
2877: Hr_Utility.set_location('...Assignment Id is : '||p_assignment_id,11);
2878: Hr_Utility.set_location('...Eff Dt is : '||p_effective_date,12);
2879: END IF;
2880:
2881: l_payroll_id := NULL;
2882: l_abp_ee_xst := 0;
2885: l_payroll_id := temp_rec.payroll_id;
2886: END LOOP;
2887:
2888: IF g_debug THEN
2889: Hr_Utility.set_location('...Checking if EE is part of payroll ',20);
2890: Hr_Utility.set_location('...Payroll id is '||NVL(l_payroll_id,-1),25);
2891: END IF;
2892:
2893: IF l_payroll_id IS NULL THEN
2886: END LOOP;
2887:
2888: IF g_debug THEN
2889: Hr_Utility.set_location('...Checking if EE is part of payroll ',20);
2890: Hr_Utility.set_location('...Payroll id is '||NVL(l_payroll_id,-1),25);
2891: END IF;
2892:
2893: IF l_payroll_id IS NULL THEN
2894:
2892:
2893: IF l_payroll_id IS NULL THEN
2894:
2895: IF g_debug THEN
2896: Hr_Utility.set_location('...EE is not part of payroll ',30);
2897: Hr_Utility.set_location('Leaving: '||l_proc_name,90);
2898: END IF;
2899:
2900: RETURN 0;
2893: IF l_payroll_id IS NULL THEN
2894:
2895: IF g_debug THEN
2896: Hr_Utility.set_location('...EE is not part of payroll ',30);
2897: Hr_Utility.set_location('Leaving: '||l_proc_name,90);
2898: END IF;
2899:
2900: RETURN 0;
2901: ELSE
2900: RETURN 0;
2901: ELSE
2902:
2903: IF g_debug THEN
2904: Hr_Utility.set_location('...EE is part of payroll ',40);
2905: END IF;
2906:
2907: OPEN c_abp_entry;
2908: FETCH c_abp_entry INTO l_abp_ee_xst;
2909:
2910: IF c_abp_entry%FOUND THEN
2911:
2912: IF g_debug THEN
2913: Hr_Utility.set_location('...ABP is processed ',50);
2914: Hr_Utility.set_location('Leaving: '||l_proc_name,90);
2915: END IF;
2916:
2917: CLOSE c_abp_entry;
2910: IF c_abp_entry%FOUND THEN
2911:
2912: IF g_debug THEN
2913: Hr_Utility.set_location('...ABP is processed ',50);
2914: Hr_Utility.set_location('Leaving: '||l_proc_name,90);
2915: END IF;
2916:
2917: CLOSE c_abp_entry;
2918: RETURN 1;
2919:
2920: ELSE
2921:
2922: IF g_debug THEN
2923: Hr_Utility.set_location('...ABP is not processed ',50);
2924: Hr_Utility.set_location('Leaving: '||l_proc_name,90);
2925: END IF;
2926:
2927: CLOSE c_abp_entry;
2920: ELSE
2921:
2922: IF g_debug THEN
2923: Hr_Utility.set_location('...ABP is not processed ',50);
2924: Hr_Utility.set_location('Leaving: '||l_proc_name,90);
2925: END IF;
2926:
2927: CLOSE c_abp_entry;
2928: RETURN 0;
3009:
3010: BEGIN
3011:
3012: IF g_debug THEN
3013: Hr_Utility.set_location('Entering : '||l_proc_name,10);
3014: Hr_Utility.set_location('...Assignment Id is : '||p_assignment_id,11);
3015: Hr_Utility.set_location('...Value of p_ext_st is : '||p_ext_st,12);
3016: END IF;
3017:
3010: BEGIN
3011:
3012: IF g_debug THEN
3013: Hr_Utility.set_location('Entering : '||l_proc_name,10);
3014: Hr_Utility.set_location('...Assignment Id is : '||p_assignment_id,11);
3015: Hr_Utility.set_location('...Value of p_ext_st is : '||p_ext_st,12);
3016: END IF;
3017:
3018: OPEN c_get_term_date;
3011:
3012: IF g_debug THEN
3013: Hr_Utility.set_location('Entering : '||l_proc_name,10);
3014: Hr_Utility.set_location('...Assignment Id is : '||p_assignment_id,11);
3015: Hr_Utility.set_location('...Value of p_ext_st is : '||p_ext_st,12);
3016: END IF;
3017:
3018: OPEN c_get_term_date;
3019: FETCH c_get_term_date INTO l_asg_term_dt;
3020:
3021: IF c_get_term_date%NOTFOUND THEN
3022:
3023: IF g_debug THEN
3024: Hr_Utility.set_location('...Termination Date Not found : ',13);
3025: Hr_Utility.set_location('Leaving: '||l_proc_name,17);
3026: END IF;
3027:
3028: CLOSE c_get_term_date;
3021: IF c_get_term_date%NOTFOUND THEN
3022:
3023: IF g_debug THEN
3024: Hr_Utility.set_location('...Termination Date Not found : ',13);
3025: Hr_Utility.set_location('Leaving: '||l_proc_name,17);
3026: END IF;
3027:
3028: CLOSE c_get_term_date;
3029: RETURN FALSE;
3032:
3033: CLOSE c_get_term_date;
3034:
3035: IF g_debug THEN
3036: Hr_Utility.set_location('...Termination Date found : ',14);
3037: END IF;
3038:
3039: IF TO_NUMBER(TO_CHAR(NVL(l_asg_term_dt,p_ext_st),'YYYY')) <
3040: TO_NUMBER(TO_CHAR(p_ext_st,'YYYY')) THEN
3038:
3039: IF TO_NUMBER(TO_CHAR(NVL(l_asg_term_dt,p_ext_st),'YYYY')) <
3040: TO_NUMBER(TO_CHAR(p_ext_st,'YYYY')) THEN
3041: IF g_debug THEN
3042: Hr_Utility.set_location('...Condition met return TRUE : ',15);
3043: Hr_Utility.set_location('Leaving: '||l_proc_name,18);
3044: END IF;
3045: RETURN TRUE;
3046: ELSE
3039: IF TO_NUMBER(TO_CHAR(NVL(l_asg_term_dt,p_ext_st),'YYYY')) <
3040: TO_NUMBER(TO_CHAR(p_ext_st,'YYYY')) THEN
3041: IF g_debug THEN
3042: Hr_Utility.set_location('...Condition met return TRUE : ',15);
3043: Hr_Utility.set_location('Leaving: '||l_proc_name,18);
3044: END IF;
3045: RETURN TRUE;
3046: ELSE
3047: IF g_debug THEN
3044: END IF;
3045: RETURN TRUE;
3046: ELSE
3047: IF g_debug THEN
3048: Hr_Utility.set_location('...Condition not met return FALSE : ',16);
3049: Hr_Utility.set_location('Leaving: '||l_proc_name,19);
3050: END IF;
3051: RETURN FALSE;
3052: END IF;
3045: RETURN TRUE;
3046: ELSE
3047: IF g_debug THEN
3048: Hr_Utility.set_location('...Condition not met return FALSE : ',16);
3049: Hr_Utility.set_location('Leaving: '||l_proc_name,19);
3050: END IF;
3051: RETURN FALSE;
3052: END IF;
3053:
3095:
3096: BEGIN
3097:
3098: IF g_debug THEN
3099: Hr_Utility.set_location('Entering: '||l_proc_name,10);
3100: Hr_Utility.set_location('...Assignment Id is : '||p_assignment_id,11);
3101: END IF;
3102:
3103: l_late_hire_ind := 0;
3096: BEGIN
3097:
3098: IF g_debug THEN
3099: Hr_Utility.set_location('Entering: '||l_proc_name,10);
3100: Hr_Utility.set_location('...Assignment Id is : '||p_assignment_id,11);
3101: END IF;
3102:
3103: l_late_hire_ind := 0;
3104: l_def_bal_id := -1;
3114:
3115: CLOSE csr_defined_bal;
3116:
3117: IF g_debug THEN
3118: Hr_Utility.set_location('...l_def_bal_id is : '||l_def_bal_id,12);
3119: END IF;
3120:
3121: IF l_def_bal_id <> -1 THEN
3122: --
3127: ,p_virtual_date => g_extract_params(p_business_group_id).extract_end_date);
3128: END IF;
3129:
3130: IF g_debug THEN
3131: Hr_Utility.set_location('...l_late_hire_ind is : '||l_late_hire_ind,13);
3132: END IF;
3133:
3134: IF l_late_hire_ind <> 0 THEN
3135: RETURN TRUE;
3137: RETURN FALSE;
3138: END IF;
3139:
3140: IF g_debug THEN
3141: Hr_Utility.set_location('Leaving: '||l_proc_name,10);
3142: END IF;
3143:
3144: EXCEPTION
3145: WHEN OTHERS THEN
3143:
3144: EXCEPTION
3145: WHEN OTHERS THEN
3146: IF g_debug THEN
3147: Hr_Utility.set_location(' Exception occured: '||l_proc_name,10);
3148: END IF;
3149: RETURN FALSE;
3150: END Chk_Asg_Late_Hire;
3151:
3709: END IF;
3710: CLOSE c_hire_dt_chg;
3711:
3712: --If person is not retro hired then g_retro_hires record is null
3713: Hr_Utility.set_location('c_start_date'||g_extract_params(i).extract_start_date, 15);
3714: Hr_Utility.set_location('c_end_date'||g_extract_params(i).extract_end_date, 15);
3715: Hr_Utility.set_location('l_new_start'||l_new_start, 15);
3716: Hr_Utility.set_location('l_old_date'||l_old_start, 15);
3717:
3710: CLOSE c_hire_dt_chg;
3711:
3712: --If person is not retro hired then g_retro_hires record is null
3713: Hr_Utility.set_location('c_start_date'||g_extract_params(i).extract_start_date, 15);
3714: Hr_Utility.set_location('c_end_date'||g_extract_params(i).extract_end_date, 15);
3715: Hr_Utility.set_location('l_new_start'||l_new_start, 15);
3716: Hr_Utility.set_location('l_old_date'||l_old_start, 15);
3717:
3718: -- ============================================================================
3711:
3712: --If person is not retro hired then g_retro_hires record is null
3713: Hr_Utility.set_location('c_start_date'||g_extract_params(i).extract_start_date, 15);
3714: Hr_Utility.set_location('c_end_date'||g_extract_params(i).extract_end_date, 15);
3715: Hr_Utility.set_location('l_new_start'||l_new_start, 15);
3716: Hr_Utility.set_location('l_old_date'||l_old_start, 15);
3717:
3718: -- ============================================================================
3719: -- BEGIN Populate Record 05 Retro PTP change information
3712: --If person is not retro hired then g_retro_hires record is null
3713: Hr_Utility.set_location('c_start_date'||g_extract_params(i).extract_start_date, 15);
3714: Hr_Utility.set_location('c_end_date'||g_extract_params(i).extract_end_date, 15);
3715: Hr_Utility.set_location('l_new_start'||l_new_start, 15);
3716: Hr_Utility.set_location('l_old_date'||l_old_start, 15);
3717:
3718: -- ============================================================================
3719: -- BEGIN Populate Record 05 Retro PTP change information
3720: -- ============================================================================
3769: LOOP
3770: FETCH c_ptp_log_rows INTO l_ptp_log_rows;
3771:
3772: EXIT WHEN c_ptp_log_rows%NOTFOUND;
3773: hr_utility.set_location('....Inside the loop',20);
3774: IF g_retro_ptp_count > 0 THEN
3775: --
3776: -- Check if the ptp is the same and the dates are continuous
3777: --
3779: trunc(l_ptp_log_rows.start_date) AND
3780: l_rec_05_retro_ptp(g_retro_ptp_count).part_time_perc =
3781: l_ptp_log_rows.ptp * 100 ) THEN
3782: l_rec_05_retro_ptp(g_retro_ptp_count).end_date := l_ptp_log_rows.end_date;
3783: hr_utility.set_location('...Updated the date',20);
3784: ELSE
3785: g_retro_ptp_count := g_retro_ptp_count + 1;
3786: l_rec_05_retro_ptp(g_retro_ptp_count).start_date := l_ptp_log_rows.start_date;
3787: l_rec_05_retro_ptp(g_retro_ptp_count).end_date := l_ptp_log_rows.end_date;
3792: l_rec_05_retro_ptp(g_retro_ptp_count).start_date := l_ptp_log_rows.start_date;
3793: l_rec_05_retro_ptp(g_retro_ptp_count).end_date := l_ptp_log_rows.end_date;
3794: l_rec_05_retro_ptp(g_retro_ptp_count).part_time_perc := l_ptp_log_rows.ptp * 100;
3795: END IF;
3796: hr_utility.set_location('...start_date'||l_rec_05_retro_ptp(g_retro_ptp_count).start_date,20);
3797: hr_utility.set_location('...end_date'||l_rec_05_retro_ptp(g_retro_ptp_count).end_date,20);
3798:
3799: END LOOP;
3800: CLOSE c_ptp_log_rows;
3793: l_rec_05_retro_ptp(g_retro_ptp_count).end_date := l_ptp_log_rows.end_date;
3794: l_rec_05_retro_ptp(g_retro_ptp_count).part_time_perc := l_ptp_log_rows.ptp * 100;
3795: END IF;
3796: hr_utility.set_location('...start_date'||l_rec_05_retro_ptp(g_retro_ptp_count).start_date,20);
3797: hr_utility.set_location('...end_date'||l_rec_05_retro_ptp(g_retro_ptp_count).end_date,20);
3798:
3799: END LOOP;
3800: CLOSE c_ptp_log_rows;
3801:
3807: ,c_effective_date => g_extract_params(i).extract_start_date
3808: ,c_ele_type_id => g_retro_ptp_element_id
3809: ,c_input_val_id => g_retro_pv_iv_id)
3810: LOOP
3811: hr_utility.set_location(' -- Inside the loop to fetch retro elements',-999);
3812: l_hourly_ee_avg_ptp_prev := 0;
3813: g_retro_ptp_count := g_retro_ptp_count + 1;
3814: l_rec_05_retro_ptp(g_retro_ptp_count).start_date
3815: := get_min_date(l_asg_hire_dt,retro_rec_05.start_date);
3869:
3870: --7361970
3871: l_rec_05_retro_ptp(g_retro_ptp_count).end_date := l_rec_05_retro_ptp(g_retro_ptp_count).end_date + 1;
3872: --7361970
3873: hr_utility.set_location(' -- Done populating PLSQL tbl',-999);
3874: END LOOP;
3875:
3876: END IF; -- Check for regular or hourly EE's
3877:
3880: CLOSE c_ptp_chg_exist;
3881:
3882: --6501898
3883: IF l_cur_ptp = 0 THEN
3884: hr_utility.set_location(' -- Inside the l_cur_ptp = 0',-999);
3885:
3886: OPEN c_ptp_chg_hrly_exist (c_asg_id => p_assignment_id
3887: ,c_effective_date => g_extract_params(i).extract_start_date
3888: ,c_ele_type_id => g_abp_ptp_ele_id
3891: FETCH c_ptp_chg_hrly_exist INTO l_ptp_chg_hrly_exist;
3892: CLOSE c_ptp_chg_hrly_exist;
3893:
3894: IF l_ptp_chg_hrly_exist.Yes = 'Y' THEN
3895: hr_utility.set_location(' -- Inside the if condition c_ptp_chg_hrly_exist FOUND ',-999);
3896:
3897: FOR non_retro_rec_05 IN c_ptp_chg_hrly_exist(c_asg_id => p_assignment_id
3898: ,c_effective_date => g_extract_params(i).extract_start_date
3899: ,c_ele_type_id => g_abp_ptp_ele_id
3898: ,c_effective_date => g_extract_params(i).extract_start_date
3899: ,c_ele_type_id => g_abp_ptp_ele_id
3900: ,c_input_val_id => g_abp_ptp_iv_id)
3901: LOOP
3902: hr_utility.set_location(' -- Inside the loop to fetch non retro elements',-999);
3903: hr_utility.set_location(' -- g_retro_ptp_count Before'||g_retro_ptp_count,-999);
3904: hr_utility.set_location(' -- p_assignment_id'||p_assignment_id,-999);
3905: hr_utility.set_location(' -- g_extract_params(i).extract_start_date'||g_extract_params(i).extract_start_date,-999);
3906: hr_utility.set_location(' -- g_abp_ptp_ele_id:'||g_abp_ptp_ele_id||' g_abp_ptp_iv_id:'||g_abp_ptp_iv_id,-999);
3899: ,c_ele_type_id => g_abp_ptp_ele_id
3900: ,c_input_val_id => g_abp_ptp_iv_id)
3901: LOOP
3902: hr_utility.set_location(' -- Inside the loop to fetch non retro elements',-999);
3903: hr_utility.set_location(' -- g_retro_ptp_count Before'||g_retro_ptp_count,-999);
3904: hr_utility.set_location(' -- p_assignment_id'||p_assignment_id,-999);
3905: hr_utility.set_location(' -- g_extract_params(i).extract_start_date'||g_extract_params(i).extract_start_date,-999);
3906: hr_utility.set_location(' -- g_abp_ptp_ele_id:'||g_abp_ptp_ele_id||' g_abp_ptp_iv_id:'||g_abp_ptp_iv_id,-999);
3907:
3900: ,c_input_val_id => g_abp_ptp_iv_id)
3901: LOOP
3902: hr_utility.set_location(' -- Inside the loop to fetch non retro elements',-999);
3903: hr_utility.set_location(' -- g_retro_ptp_count Before'||g_retro_ptp_count,-999);
3904: hr_utility.set_location(' -- p_assignment_id'||p_assignment_id,-999);
3905: hr_utility.set_location(' -- g_extract_params(i).extract_start_date'||g_extract_params(i).extract_start_date,-999);
3906: hr_utility.set_location(' -- g_abp_ptp_ele_id:'||g_abp_ptp_ele_id||' g_abp_ptp_iv_id:'||g_abp_ptp_iv_id,-999);
3907:
3908: g_retro_ptp_count := g_retro_ptp_count + 1;
3901: LOOP
3902: hr_utility.set_location(' -- Inside the loop to fetch non retro elements',-999);
3903: hr_utility.set_location(' -- g_retro_ptp_count Before'||g_retro_ptp_count,-999);
3904: hr_utility.set_location(' -- p_assignment_id'||p_assignment_id,-999);
3905: hr_utility.set_location(' -- g_extract_params(i).extract_start_date'||g_extract_params(i).extract_start_date,-999);
3906: hr_utility.set_location(' -- g_abp_ptp_ele_id:'||g_abp_ptp_ele_id||' g_abp_ptp_iv_id:'||g_abp_ptp_iv_id,-999);
3907:
3908: g_retro_ptp_count := g_retro_ptp_count + 1;
3909: l_rec_05_retro_ptp(g_retro_ptp_count).start_date
3902: hr_utility.set_location(' -- Inside the loop to fetch non retro elements',-999);
3903: hr_utility.set_location(' -- g_retro_ptp_count Before'||g_retro_ptp_count,-999);
3904: hr_utility.set_location(' -- p_assignment_id'||p_assignment_id,-999);
3905: hr_utility.set_location(' -- g_extract_params(i).extract_start_date'||g_extract_params(i).extract_start_date,-999);
3906: hr_utility.set_location(' -- g_abp_ptp_ele_id:'||g_abp_ptp_ele_id||' g_abp_ptp_iv_id:'||g_abp_ptp_iv_id,-999);
3907:
3908: g_retro_ptp_count := g_retro_ptp_count + 1;
3909: l_rec_05_retro_ptp(g_retro_ptp_count).start_date
3910: := get_min_date(l_asg_hire_dt,non_retro_rec_05.start_date);
3915: l_rec_05_retro_ptp(g_retro_ptp_count).end_date
3916: := non_retro_rec_05.end_date - 1;
3917: END IF;
3918:
3919: hr_utility.set_location(' -- g_retro_ptp_count After'||g_retro_ptp_count,-999);
3920:
3921:
3922: /*
3923: --
3960:
3961: --7361970
3962: l_rec_05_retro_ptp(g_retro_ptp_count).end_date := l_rec_05_retro_ptp(g_retro_ptp_count).end_date + 1;
3963: --7361970
3964: hr_utility.set_location(' -- Done populating PLSQL tbl for non retro late hire',-999);
3965: END LOOP;
3966:
3967: END IF;
3968: --
3997: LOOP
3998: FETCH c_current_ptp_chgs INTO l_ptp_log_rows;
3999:
4000: EXIT WHEN c_current_ptp_chgs%NOTFOUND;
4001: hr_utility.set_location('....Inside the loop',20);
4002: IF g_retro_ptp_count > 0 THEN
4003: --
4004: -- Check if the ptp is the same and the dates are continuous
4005: --
4008: l_rec_05_retro_ptp(g_retro_ptp_count).part_time_perc =
4009: l_ptp_log_rows.ptp * 100 ) THEN
4010: l_rec_05_retro_ptp(g_retro_ptp_count).end_date
4011: := l_ptp_log_rows.end_date;
4012: hr_utility.set_location('...Updated the date',20);
4013: ELSE
4014: g_retro_ptp_count := g_retro_ptp_count + 1;
4015: l_rec_05_retro_ptp(g_retro_ptp_count).start_date
4016: := l_ptp_log_rows.start_date;
4027: := l_ptp_log_rows.end_date;
4028: l_rec_05_retro_ptp(g_retro_ptp_count).part_time_perc
4029: := l_ptp_log_rows.ptp * 100;
4030: END IF;
4031: hr_utility.set_location('...start_date'
4032: ||l_rec_05_retro_ptp(g_retro_ptp_count).start_date,20);
4033: hr_utility.set_location('...end_date'
4034: ||l_rec_05_retro_ptp(g_retro_ptp_count).end_date,20);
4035:
4029: := l_ptp_log_rows.ptp * 100;
4030: END IF;
4031: hr_utility.set_location('...start_date'
4032: ||l_rec_05_retro_ptp(g_retro_ptp_count).start_date,20);
4033: hr_utility.set_location('...end_date'
4034: ||l_rec_05_retro_ptp(g_retro_ptp_count).end_date,20);
4035:
4036: END LOOP;
4037: CLOSE c_current_ptp_chgs;
4051: k := 1;
4052: FOR i IN l_rec_09.FIRST..l_rec_09.LAST
4053: LOOP
4054: l_rr_exists := 0;
4055: hr_utility.set_location('...Current element : '
4056: ||l_rec_09(i).element_type_id,10);
4057: hr_utility.set_location('..Assignment Id : '||p_assignment_id,12);
4058: hr_utility.set_location('..Payroll id : '
4059: ||g_extract_params(p_business_group_id).payroll_id,13);
4053: LOOP
4054: l_rr_exists := 0;
4055: hr_utility.set_location('...Current element : '
4056: ||l_rec_09(i).element_type_id,10);
4057: hr_utility.set_location('..Assignment Id : '||p_assignment_id,12);
4058: hr_utility.set_location('..Payroll id : '
4059: ||g_extract_params(p_business_group_id).payroll_id,13);
4060: hr_utility.set_location('..Start date : '
4061: ||g_extract_params(p_business_group_id).extract_start_date,14);
4054: l_rr_exists := 0;
4055: hr_utility.set_location('...Current element : '
4056: ||l_rec_09(i).element_type_id,10);
4057: hr_utility.set_location('..Assignment Id : '||p_assignment_id,12);
4058: hr_utility.set_location('..Payroll id : '
4059: ||g_extract_params(p_business_group_id).payroll_id,13);
4060: hr_utility.set_location('..Start date : '
4061: ||g_extract_params(p_business_group_id).extract_start_date,14);
4062: hr_utility.set_location('..End date : '
4056: ||l_rec_09(i).element_type_id,10);
4057: hr_utility.set_location('..Assignment Id : '||p_assignment_id,12);
4058: hr_utility.set_location('..Payroll id : '
4059: ||g_extract_params(p_business_group_id).payroll_id,13);
4060: hr_utility.set_location('..Start date : '
4061: ||g_extract_params(p_business_group_id).extract_start_date,14);
4062: hr_utility.set_location('..End date : '
4063: ||g_extract_params(p_business_group_id).extract_end_date,15);
4064:
4058: hr_utility.set_location('..Payroll id : '
4059: ||g_extract_params(p_business_group_id).payroll_id,13);
4060: hr_utility.set_location('..Start date : '
4061: ||g_extract_params(p_business_group_id).extract_start_date,14);
4062: hr_utility.set_location('..End date : '
4063: ||g_extract_params(p_business_group_id).extract_end_date,15);
4064:
4065: FOR act_rec IN csr_asg_act (
4066: c_assignment_id => p_assignment_id
4068: ,c_con_set_id => NULL
4069: ,c_start_date => g_extract_params(p_business_group_id).extract_start_date
4070: ,c_end_date => g_extract_params(p_business_group_id).extract_end_date)
4071: LOOP
4072: hr_utility.set_location('..Asg act id : '||act_rec.assignment_action_id,20);
4073: --
4074: -- populate the PLSQL table with the retro basis entries
4075: -- and the start and end date of the corresponding retro paid period
4076: -- for ABP (record 09)
4081: (c_element_type_id =>
4082: fnd_number.canonical_to_number(l_rec_09(i).py_retro_element_id)
4083: ,c_assignment_action_id => act_rec.assignment_action_id)
4084: LOOP
4085: hr_utility.set_location('..Found previous year retro entries',30);
4086: --
4087: -- Fetch the input value id for ABP Employee Pension Basis input value
4088: --
4089: OPEN c_get_iv_id(c_element_type_id =>
4132: (c_element_type_id => fnd_number.canonical_to_number(
4133: l_rec_09(i).cy_retro_element_id)
4134: ,c_assignment_action_id => act_rec.assignment_action_id)
4135: LOOP
4136: hr_utility.set_location('...Found current year retro entries',30);
4137: --
4138: -- Fetch the input value id for ABP Employee Pension Basis input value
4139: --
4140: OPEN c_get_iv_id(c_element_type_id =>
4161: l_ee_age_at_retro := Get_Age(
4162: p_assignment_id
4163: ,trunc(l_retro_age_cal_dt)) ;
4164:
4165: hr_utility.set_location('...l_retro_age_cal_dt :'||l_retro_age_cal_dt,50);
4166: hr_utility.set_location('...l_ee_age_at_retro :'||l_ee_age_at_retro,50);
4167:
4168: IF l_ee_age_at_retro < 65 AND chk_subcat_disp (l_rec_09(i).code
4169: ,l_retro_age_cal_dt) THEN
4162: p_assignment_id
4163: ,trunc(l_retro_age_cal_dt)) ;
4164:
4165: hr_utility.set_location('...l_retro_age_cal_dt :'||l_retro_age_cal_dt,50);
4166: hr_utility.set_location('...l_ee_age_at_retro :'||l_ee_age_at_retro,50);
4167:
4168: IF l_ee_age_at_retro < 65 AND chk_subcat_disp (l_rec_09(i).code
4169: ,l_retro_age_cal_dt) THEN
4170: IF l_retro_ptp_value <> 0 THEN
4173: l_rec_09_values(k).processed := 'N';
4174: l_rec_09_values(k).code := l_rec_09(i).code;
4175: l_rec_09_values(k).date_earned := ' ';
4176:
4177: hr_utility.set_location('GAA-- Date Earned used :'
4178: ||l_rec_09_values(k).date_earned,50);
4179:
4180: IF l_rec_09_values(k).basis_amount < 0 THEN
4181: l_rec_09_values(k).sign_code := 'C';
4195: FOR temp_rec IN c_get_retro_entry
4196: (c_element_type_id => l_rec_09(i).py_cy_adj_retro_element_id
4197: ,c_assignment_action_id => act_rec.assignment_action_id)
4198: LOOP
4199: hr_utility.set_location('...Found Adjustment retro entries',30);
4200: --
4201: -- Fetch the input value id for ABP Employee Pension Basis input value
4202: --
4203: OPEN c_get_iv_id(c_element_type_id => l_rec_09(i).py_cy_adj_retro_element_id);
4223: l_ee_age_at_retro := Get_Age(
4224: p_assignment_id
4225: ,trunc(l_retro_age_cal_dt)) ;
4226:
4227: hr_utility.set_location('...l_retro_age_cal_dt :'||l_retro_age_cal_dt,50);
4228: hr_utility.set_location('...l_ee_age_at_retro :'||l_ee_age_at_retro,50);
4229:
4230: IF l_ee_age_at_retro < 65 AND chk_subcat_disp (l_rec_09(i).code
4231: ,l_retro_age_cal_dt) THEN
4224: p_assignment_id
4225: ,trunc(l_retro_age_cal_dt)) ;
4226:
4227: hr_utility.set_location('...l_retro_age_cal_dt :'||l_retro_age_cal_dt,50);
4228: hr_utility.set_location('...l_ee_age_at_retro :'||l_ee_age_at_retro,50);
4229:
4230: IF l_ee_age_at_retro < 65 AND chk_subcat_disp (l_rec_09(i).code
4231: ,l_retro_age_cal_dt) THEN
4232: IF l_retro_ptp_value <> 0 THEN
4235: l_rec_09_values(k).processed := 'N';
4236: l_rec_09_values(k).code := l_rec_09(i).code;
4237: l_rec_09_values(k).date_earned := ' ';
4238:
4239: hr_utility.set_location('GAA-- Date Earned used :'
4240: ||l_rec_09_values(k).date_earned,50);
4241:
4242: IF l_rec_09_values(k).basis_amount < 0 THEN
4243: l_rec_09_values(k).sign_code := 'C';
4269: --
4270: IF chk_rr_exist (p_ass_act_id => act_rec.assignment_action_id
4271: ,p_element_type_id => l_rec_09(i).element_type_id ) THEN
4272: -- Call pay_balance_pkg
4273: hr_utility.set_location('Run results exist for current period',40);
4274:
4275: IF l_rec_09(i).defined_bal_id <> -1 THEN
4276:
4277: l_rec_09_values(k).basis_amount :=
4277: l_rec_09_values(k).basis_amount :=
4278: Pay_Balance_Pkg.get_value
4279: (p_defined_balance_id => l_rec_09(i).defined_bal_id
4280: ,p_assignment_action_id => act_rec.assignment_action_id);
4281: hr_utility.set_location('Defined bal id used :'
4282: ||l_rec_09(i).defined_bal_id,50);
4283: l_rec_09_disp := 'Y';
4284: l_rec_09_values(k).processed := 'N';
4285: l_rec_09_values(k).code := l_rec_09(i).code;
4334: IF l_rec_09.count > 0 THEN
4335: FOR i IN l_rec_09.FIRST..l_rec_09.LAST
4336: LOOP
4337: l_rr_exists := 0;
4338: hr_utility.set_location('current element : '||l_rec_09(i).element_type_id,10);
4339: hr_utility.set_location('asg id : '||p_assignment_id,12);
4340: hr_utility.set_location('start date : ',14);
4341: hr_utility.set_location('end date : ',15);
4342: FOR act_rec IN csr_asg_act (
4335: FOR i IN l_rec_09.FIRST..l_rec_09.LAST
4336: LOOP
4337: l_rr_exists := 0;
4338: hr_utility.set_location('current element : '||l_rec_09(i).element_type_id,10);
4339: hr_utility.set_location('asg id : '||p_assignment_id,12);
4340: hr_utility.set_location('start date : ',14);
4341: hr_utility.set_location('end date : ',15);
4342: FOR act_rec IN csr_asg_act (
4343: c_assignment_id => p_assignment_id
4336: LOOP
4337: l_rr_exists := 0;
4338: hr_utility.set_location('current element : '||l_rec_09(i).element_type_id,10);
4339: hr_utility.set_location('asg id : '||p_assignment_id,12);
4340: hr_utility.set_location('start date : ',14);
4341: hr_utility.set_location('end date : ',15);
4342: FOR act_rec IN csr_asg_act (
4343: c_assignment_id => p_assignment_id
4344: ,c_payroll_id => g_extract_params(p_business_group_id).payroll_id
4337: l_rr_exists := 0;
4338: hr_utility.set_location('current element : '||l_rec_09(i).element_type_id,10);
4339: hr_utility.set_location('asg id : '||p_assignment_id,12);
4340: hr_utility.set_location('start date : ',14);
4341: hr_utility.set_location('end date : ',15);
4342: FOR act_rec IN csr_asg_act (
4343: c_assignment_id => p_assignment_id
4344: ,c_payroll_id => g_extract_params(p_business_group_id).payroll_id
4345: ,c_con_set_id => NULL
4354: -- Check if Run Results exist for this element/ass act
4355: IF chk_rr_exist (p_ass_act_id => act_rec.assignment_action_id
4356: ,p_element_type_id => l_rec_09(i).element_type_id ) THEN
4357: -- Call pay_balance_pkg
4358: hr_utility.set_location('run results exist for current period',40);
4359: IF l_rec_09(i).defined_bal_id <> -1 THEN
4360: l_rec_09_values(k).basis_amount :=
4361: Pay_Balance_Pkg.get_value
4362: (p_defined_balance_id => l_rec_09(i).defined_bal_id
4360: l_rec_09_values(k).basis_amount :=
4361: Pay_Balance_Pkg.get_value
4362: (p_defined_balance_id => l_rec_09(i).defined_bal_id
4363: ,p_assignment_action_id => act_rec.assignment_action_id);
4364: hr_utility.set_location('defined bal id used :'||l_rec_09(i).defined_bal_id,50);
4365: l_rec_09_disp := 'Y';
4366: l_rec_09_values(k).processed := 'N';
4367: l_rec_09_values(k).code := l_rec_09(i).code;
4368: l_rec_09_values(k).date_earned := ' ';
4406: IF l_rec_09.count > 0 THEN
4407: FOR i IN l_rec_09.FIRST..l_rec_09.LAST
4408: LOOP
4409: l_rr_exists := 0;
4410: hr_utility.set_location('current element : '||l_rec_09(i).element_type_id,10);
4411: hr_utility.set_location('asg id : '||p_assignment_id,12);
4412: hr_utility.set_location('start date : ',14);
4413: hr_utility.set_location('end date : ',15);
4414: FOR act_rec IN csr_asg_act (
4407: FOR i IN l_rec_09.FIRST..l_rec_09.LAST
4408: LOOP
4409: l_rr_exists := 0;
4410: hr_utility.set_location('current element : '||l_rec_09(i).element_type_id,10);
4411: hr_utility.set_location('asg id : '||p_assignment_id,12);
4412: hr_utility.set_location('start date : ',14);
4413: hr_utility.set_location('end date : ',15);
4414: FOR act_rec IN csr_asg_act (
4415: c_assignment_id => p_assignment_id
4408: LOOP
4409: l_rr_exists := 0;
4410: hr_utility.set_location('current element : '||l_rec_09(i).element_type_id,10);
4411: hr_utility.set_location('asg id : '||p_assignment_id,12);
4412: hr_utility.set_location('start date : ',14);
4413: hr_utility.set_location('end date : ',15);
4414: FOR act_rec IN csr_asg_act (
4415: c_assignment_id => p_assignment_id
4416: ,c_payroll_id => g_extract_params(p_business_group_id).payroll_id
4409: l_rr_exists := 0;
4410: hr_utility.set_location('current element : '||l_rec_09(i).element_type_id,10);
4411: hr_utility.set_location('asg id : '||p_assignment_id,12);
4412: hr_utility.set_location('start date : ',14);
4413: hr_utility.set_location('end date : ',15);
4414: FOR act_rec IN csr_asg_act (
4415: c_assignment_id => p_assignment_id
4416: ,c_payroll_id => g_extract_params(p_business_group_id).payroll_id
4417: ,c_con_set_id => NULL
4426: -- Check if Run Results exist for this element/ass act
4427: IF chk_rr_exist (p_ass_act_id => act_rec.assignment_action_id
4428: ,p_element_type_id => l_rec_09(i).element_type_id ) THEN
4429: -- Call pay_balance_pkg
4430: hr_utility.set_location('run results exist for current period',40);
4431: IF l_rec_09(i).defined_bal_id <> -1 THEN
4432: l_rec_09_values(k).basis_amount :=
4433: Pay_Balance_Pkg.get_value
4434: (p_defined_balance_id => l_rec_09(i).defined_bal_id
4432: l_rec_09_values(k).basis_amount :=
4433: Pay_Balance_Pkg.get_value
4434: (p_defined_balance_id => l_rec_09(i).defined_bal_id
4435: ,p_assignment_action_id => act_rec.assignment_action_id);
4436: hr_utility.set_location('defined bal id used :'||l_rec_09(i).defined_bal_id,50);
4437: l_rec_09_disp := 'Y';
4438: l_rec_09_values(k).processed := 'N';
4439: l_rec_09_values(k).code := l_rec_09(i).code;
4440: l_rec_09_values(k).date_earned :=
4824: g_extract_params(p_business_group_id).extract_end_date
4825: ,c_asg_id => p_assignment_id
4826: )
4827: LOOP
4828: hr_utility.set_location('chking asg : '||p_assignment_id,10);
4829: hr_utility.set_location('chking code : '||temp_rec.code,10);
4830: --if the amount is -999999 then fetch the balance value
4831: IF temp_rec.amount = -999999 THEN
4832: l_rec12_amt := 0;
4825: ,c_asg_id => p_assignment_id
4826: )
4827: LOOP
4828: hr_utility.set_location('chking asg : '||p_assignment_id,10);
4829: hr_utility.set_location('chking code : '||temp_rec.code,10);
4830: --if the amount is -999999 then fetch the balance value
4831: IF temp_rec.amount = -999999 THEN
4832: l_rec12_amt := 0;
4833: OPEN csr_defined_bal1(c_balance_type_id => temp_rec.ee_contribution_bal_type_id
4858: ELSE
4859: CLOSE csr_defined_bal1;
4860: END IF;
4861:
4862: hr_utility.set_location('chking amt : '||l_rec12_amt,10);
4863:
4864: IF l_rec12_amt <> 0 THEN
4865: l_rec_12_values(i_12).contrib_amount := l_rec12_amt;
4866: l_rec_12_values(i_12).date_earned := ' ';
4876: i_12 := i_12 + 1;
4877: l_rec_12_disp := 'Y';
4878: END IF;
4879: END IF;
4880: hr_utility.set_location('asg : '||p_assignment_id,10);
4881: hr_utility.set_location('amt : '||temp_rec.amount,11);
4882: hr_utility.set_location('date : '||temp_rec.date_earned,11);
4883: hr_utility.set_location('cdoe : '||temp_rec.code,11);
4884: END LOOP;
4877: l_rec_12_disp := 'Y';
4878: END IF;
4879: END IF;
4880: hr_utility.set_location('asg : '||p_assignment_id,10);
4881: hr_utility.set_location('amt : '||temp_rec.amount,11);
4882: hr_utility.set_location('date : '||temp_rec.date_earned,11);
4883: hr_utility.set_location('cdoe : '||temp_rec.code,11);
4884: END LOOP;
4885: END LOOP;
4878: END IF;
4879: END IF;
4880: hr_utility.set_location('asg : '||p_assignment_id,10);
4881: hr_utility.set_location('amt : '||temp_rec.amount,11);
4882: hr_utility.set_location('date : '||temp_rec.date_earned,11);
4883: hr_utility.set_location('cdoe : '||temp_rec.code,11);
4884: END LOOP;
4885: END LOOP;
4886:
4879: END IF;
4880: hr_utility.set_location('asg : '||p_assignment_id,10);
4881: hr_utility.set_location('amt : '||temp_rec.amount,11);
4882: hr_utility.set_location('date : '||temp_rec.date_earned,11);
4883: hr_utility.set_location('cdoe : '||temp_rec.code,11);
4884: END LOOP;
4885: END LOOP;
4886:
4887: i_41 := 1;
4939: i_41 := i_41 + 1;
4940: l_contrib_rec_41_disp := 'Y';
4941: END IF;
4942: END IF;
4943: hr_utility.set_location('amt : '||temp_rec.amount,11);
4944: hr_utility.set_location('date : '||temp_rec.date_earned,11);
4945: hr_utility.set_location('cdoe : '||temp_rec.code,11);
4946: END LOOP;
4947:
4940: l_contrib_rec_41_disp := 'Y';
4941: END IF;
4942: END IF;
4943: hr_utility.set_location('amt : '||temp_rec.amount,11);
4944: hr_utility.set_location('date : '||temp_rec.date_earned,11);
4945: hr_utility.set_location('cdoe : '||temp_rec.code,11);
4946: END LOOP;
4947:
4948: ELSE
4941: END IF;
4942: END IF;
4943: hr_utility.set_location('amt : '||temp_rec.amount,11);
4944: hr_utility.set_location('date : '||temp_rec.date_earned,11);
4945: hr_utility.set_location('cdoe : '||temp_rec.code,11);
4946: END LOOP;
4947:
4948: ELSE
4949: CLOSE csr_asg_act1;
4995: FOR temp_rec IN c_rec_12_ele(c_bg_id => p_business_group_id
4996: ,c_effective_date => l_end_new_st
4997: ,c_asg_id => p_assignment_id)
4998: LOOP
4999: hr_utility.set_location('chking asg : '||p_assignment_id,10);
5000: hr_utility.set_location('chking code : '||temp_rec.code,10);
5001: --if the amount is -999999 then fetch the balance value
5002: IF temp_rec.amount = -999999 THEN
5003: l_rec12_amt := 0;
4996: ,c_effective_date => l_end_new_st
4997: ,c_asg_id => p_assignment_id)
4998: LOOP
4999: hr_utility.set_location('chking asg : '||p_assignment_id,10);
5000: hr_utility.set_location('chking code : '||temp_rec.code,10);
5001: --if the amount is -999999 then fetch the balance value
5002: IF temp_rec.amount = -999999 THEN
5003: l_rec12_amt := 0;
5004: OPEN csr_defined_bal1(c_balance_type_id => temp_rec.ee_contribution_bal_type_id
5026: ELSE
5027: CLOSE csr_defined_bal1;
5028: END IF;
5029:
5030: hr_utility.set_location('chking amt : '||l_rec12_amt,10);
5031:
5032: IF l_rec12_amt <> 0 THEN
5033: l_rec_12_values(i_12).contrib_amount := l_rec12_amt;
5034: l_rec_12_values(i_12).date_earned := ' ';
5066: --
5067: WHILE trunc(l_beg_new_st) < l_loop_end_date
5068: LOOP
5069: l_end_new_st := add_months(trunc(l_beg_new_st),1) -1;
5070: hr_utility.set_location('l_beg_new_st is '||l_beg_new_st,10);
5071: hr_utility.set_location('l_end_new_st is '||l_end_new_st,10);
5072: --
5073: -- First fetch the maximum assignment action id
5074: --
5067: WHILE trunc(l_beg_new_st) < l_loop_end_date
5068: LOOP
5069: l_end_new_st := add_months(trunc(l_beg_new_st),1) -1;
5070: hr_utility.set_location('l_beg_new_st is '||l_beg_new_st,10);
5071: hr_utility.set_location('l_end_new_st is '||l_end_new_st,10);
5072: --
5073: -- First fetch the maximum assignment action id
5074: --
5075: OPEN csr_asg_act1 (
5088: FOR temp_rec IN c_rec_12_ele(c_bg_id => p_business_group_id
5089: ,c_effective_date => l_end_new_st
5090: ,c_asg_id => p_assignment_id)
5091: LOOP
5092: hr_utility.set_location('chking asg : '||p_assignment_id,10);
5093: hr_utility.set_location('chking code : '||temp_rec.code,10);
5094: --if the amount is -999999 then fetch the balance value
5095: IF temp_rec.amount = -999999 THEN
5096: l_rec12_amt := 0;
5089: ,c_effective_date => l_end_new_st
5090: ,c_asg_id => p_assignment_id)
5091: LOOP
5092: hr_utility.set_location('chking asg : '||p_assignment_id,10);
5093: hr_utility.set_location('chking code : '||temp_rec.code,10);
5094: --if the amount is -999999 then fetch the balance value
5095: IF temp_rec.amount = -999999 THEN
5096: l_rec12_amt := 0;
5097: OPEN csr_defined_bal1(c_balance_type_id => temp_rec.ee_contribution_bal_type_id
5119: ELSE
5120: CLOSE csr_defined_bal1;
5121: END IF;
5122:
5123: hr_utility.set_location('chking amt : '||l_rec12_amt,10);
5124:
5125: IF l_rec12_amt <> 0 THEN
5126: l_rec_12_values(i_12).contrib_amount := l_rec12_amt;
5127: l_rec_12_values(i_12).date_earned := substr(fnd_date.date_to_canonical(l_end_new_st),1,10);
5136: FETCH c_12_abp_data INTO l_rec_12_amt_sent_prev;
5137: IF c_12_abp_data%FOUND THEN
5138: l_rec_12_values(i_12).contrib_amount := l_rec_12_values(i_12).contrib_amount
5139: - l_rec_12_amt_sent_prev;
5140: hr_utility.set_location('l_rec_12_amt_sent_prev : '||l_rec_12_amt_sent_prev,10);
5141: END IF;
5142: CLOSE c_12_abp_data;
5143: i_12 := i_12 + 1;
5144: l_rec_12_disp := 'Y';
5148: END LOOP;
5149:
5150: ELSIF l_asg_act_id IS NULL THEN
5151:
5152: hr_utility.set_location('ass act is null fetching data freom sent is '||l_end_new_st,10);
5153: FOR temp_rec IN c_rec_12_ele(c_bg_id => p_business_group_id
5154: ,c_effective_date => l_end_new_st
5155: ,c_asg_id => p_assignment_id)
5156: LOOP
5153: FOR temp_rec IN c_rec_12_ele(c_bg_id => p_business_group_id
5154: ,c_effective_date => l_end_new_st
5155: ,c_asg_id => p_assignment_id)
5156: LOOP
5157: hr_utility.set_location('chking asg : '||p_assignment_id,10);
5158: hr_utility.set_location('chking code : '||temp_rec.code,10);
5159: --if the amount is -999999 then fetch the balance value
5160: IF temp_rec.amount = -999999 THEN
5161: hr_utility.set_location('GXXXXX entrred the if condition for -9999: '||l_rec_12_amt_sent_prev,10);
5154: ,c_effective_date => l_end_new_st
5155: ,c_asg_id => p_assignment_id)
5156: LOOP
5157: hr_utility.set_location('chking asg : '||p_assignment_id,10);
5158: hr_utility.set_location('chking code : '||temp_rec.code,10);
5159: --if the amount is -999999 then fetch the balance value
5160: IF temp_rec.amount = -999999 THEN
5161: hr_utility.set_location('GXXXXX entrred the if condition for -9999: '||l_rec_12_amt_sent_prev,10);
5162: hr_utility.set_location('GXXXXX l_end_new_st : '||l_end_new_st,10);
5157: hr_utility.set_location('chking asg : '||p_assignment_id,10);
5158: hr_utility.set_location('chking code : '||temp_rec.code,10);
5159: --if the amount is -999999 then fetch the balance value
5160: IF temp_rec.amount = -999999 THEN
5161: hr_utility.set_location('GXXXXX entrred the if condition for -9999: '||l_rec_12_amt_sent_prev,10);
5162: hr_utility.set_location('GXXXXX l_end_new_st : '||l_end_new_st,10);
5163: hr_utility.set_location('GXXXXX temp_rec.code : '||temp_rec.code,10);
5164: IF length(temp_rec.code) = 1 THEN
5165: l_gxx_code := '0'||temp_rec.code;
5158: hr_utility.set_location('chking code : '||temp_rec.code,10);
5159: --if the amount is -999999 then fetch the balance value
5160: IF temp_rec.amount = -999999 THEN
5161: hr_utility.set_location('GXXXXX entrred the if condition for -9999: '||l_rec_12_amt_sent_prev,10);
5162: hr_utility.set_location('GXXXXX l_end_new_st : '||l_end_new_st,10);
5163: hr_utility.set_location('GXXXXX temp_rec.code : '||temp_rec.code,10);
5164: IF length(temp_rec.code) = 1 THEN
5165: l_gxx_code := '0'||temp_rec.code;
5166: ELSE
5159: --if the amount is -999999 then fetch the balance value
5160: IF temp_rec.amount = -999999 THEN
5161: hr_utility.set_location('GXXXXX entrred the if condition for -9999: '||l_rec_12_amt_sent_prev,10);
5162: hr_utility.set_location('GXXXXX l_end_new_st : '||l_end_new_st,10);
5163: hr_utility.set_location('GXXXXX temp_rec.code : '||temp_rec.code,10);
5164: IF length(temp_rec.code) = 1 THEN
5165: l_gxx_code := '0'||temp_rec.code;
5166: ELSE
5167: l_gxx_code := temp_rec.code;
5168: END IF;
5169: OPEN c_12_abp_data (l_end_new_st,l_gxx_code);
5170: FETCH c_12_abp_data INTO l_rec_12_amt_sent_prev;
5171: IF c_12_abp_data%FOUND THEN
5172: hr_utility.set_location('GXXXXX the amount is asg : '||l_rec_12_amt_sent_prev,10);
5173: l_rec_12_values(i_12).contrib_amount := -1 * l_rec_12_amt_sent_prev;
5174: l_rec_12_values(i_12).date_earned := substr(fnd_date.date_to_canonical(l_end_new_st),1,10);
5175: l_rec_12_values(i_12).code := temp_rec.code;
5176: i_12 := i_12 + 1;
5231: ,l_term_log_id_XX
5232: ,l_term_pos_id_XX;
5233:
5234: IF c_get_term_rows%FOUND THEN
5235: hr_utility.set_location('....c_get_term_rows Found : ',30);
5236: CLOSE c_get_term_rows;
5237:
5238: OPEN c_get_revt_rows (p_business_group_id
5239: ,p_effective_date
5239: ,p_effective_date
5240: ,p_assignment_id);
5241: FETCH c_get_revt_rows INTO l_old_date2_XX,l_new_date2_XX,l_revt_log_id_XX;
5242: IF c_get_revt_rows%FOUND THEN
5243: hr_utility.set_location('....c_get_revt_rows found : ',34);
5244: CLOSE c_get_revt_rows;
5245: IF l_term_log_id_XX > l_revt_log_id_XX THEN
5246: l_normal_term := 1;
5247: END IF;
5246: l_normal_term := 1;
5247: END IF;
5248: ELSE
5249: CLOSE c_get_revt_rows;
5250: hr_utility.set_location('....Regular values being fetched : ',38);
5251: l_normal_term := 1;
5252: END IF;
5253: ELSE
5254: CLOSE c_get_term_rows;
5256: ,p_effective_date
5257: ,p_assignment_id);
5258: FETCH c_get_revt_rows INTO l_old_date2_XX,l_new_date2_XX,l_revt_log_id_XX;
5259: IF c_get_revt_rows%FOUND THEN
5260: hr_utility.set_location('....c_get_revt_rows Found: ',40);
5261: CLOSE c_get_revt_rows;
5262: l_reversal_term := 1;
5263: ELSE
5264: CLOSE c_get_revt_rows;
5290: IF l_rec_09.count > 0 THEN
5291: FOR i IN l_rec_09.FIRST..l_rec_09.LAST
5292: LOOP
5293: l_rr_exists := 0;
5294: hr_utility.set_location('current element : '||l_rec_09(i).element_type_id,10);
5295: hr_utility.set_location('asg id : '||p_assignment_id,12);
5296: hr_utility.set_location('start date : ',14);
5297: hr_utility.set_location('end date : ',15);
5298: FOR act_rec IN csr_asg_act (
5291: FOR i IN l_rec_09.FIRST..l_rec_09.LAST
5292: LOOP
5293: l_rr_exists := 0;
5294: hr_utility.set_location('current element : '||l_rec_09(i).element_type_id,10);
5295: hr_utility.set_location('asg id : '||p_assignment_id,12);
5296: hr_utility.set_location('start date : ',14);
5297: hr_utility.set_location('end date : ',15);
5298: FOR act_rec IN csr_asg_act (
5299: c_assignment_id => p_assignment_id
5292: LOOP
5293: l_rr_exists := 0;
5294: hr_utility.set_location('current element : '||l_rec_09(i).element_type_id,10);
5295: hr_utility.set_location('asg id : '||p_assignment_id,12);
5296: hr_utility.set_location('start date : ',14);
5297: hr_utility.set_location('end date : ',15);
5298: FOR act_rec IN csr_asg_act (
5299: c_assignment_id => p_assignment_id
5300: ,c_payroll_id => g_extract_params(p_business_group_id).payroll_id
5293: l_rr_exists := 0;
5294: hr_utility.set_location('current element : '||l_rec_09(i).element_type_id,10);
5295: hr_utility.set_location('asg id : '||p_assignment_id,12);
5296: hr_utility.set_location('start date : ',14);
5297: hr_utility.set_location('end date : ',15);
5298: FOR act_rec IN csr_asg_act (
5299: c_assignment_id => p_assignment_id
5300: ,c_payroll_id => g_extract_params(p_business_group_id).payroll_id
5301: ,c_con_set_id => NULL
5310: -- Check if Run Results exist for this element/ass act
5311: IF chk_rr_exist (p_ass_act_id => act_rec.assignment_action_id
5312: ,p_element_type_id => l_rec_09(i).element_type_id ) THEN
5313: -- Call pay_balance_pkg
5314: hr_utility.set_location('run results exist for current period',40);
5315: IF l_rec_09(i).defined_bal_id <> -1 THEN
5316: l_rec_09_values(k).basis_amount :=
5317: Pay_Balance_Pkg.get_value
5318: (p_defined_balance_id => l_rec_09(i).defined_bal_id
5316: l_rec_09_values(k).basis_amount :=
5317: Pay_Balance_Pkg.get_value
5318: (p_defined_balance_id => l_rec_09(i).defined_bal_id
5319: ,p_assignment_action_id => act_rec.assignment_action_id);
5320: hr_utility.set_location('defined bal id used :'||l_rec_09(i).defined_bal_id,50);
5321: l_rec_09_disp := 'Y';
5322: l_rec_09_values(k).processed := 'N';
5323: l_rec_09_values(k).code := l_rec_09(i).code;
5324: l_rec_09_values(k).date_earned :=
5362:
5363: WHILE trunc(l_beg_new_st) < l_loop_end_date
5364: LOOP
5365: l_end_new_st := add_months(trunc(l_beg_new_st),1) -1;
5366: hr_utility.set_location('l_beg_new_st is '||l_beg_new_st,10);
5367: hr_utility.set_location('l_end_new_st is '||l_end_new_st,10);
5368: OPEN c_sent_to_abp(l_end_new_st);
5369: FETCH c_sent_to_abp INTO l_sent_to_abp;
5370: IF c_sent_to_abp%NOTFOUND THEN
5363: WHILE trunc(l_beg_new_st) < l_loop_end_date
5364: LOOP
5365: l_end_new_st := add_months(trunc(l_beg_new_st),1) -1;
5366: hr_utility.set_location('l_beg_new_st is '||l_beg_new_st,10);
5367: hr_utility.set_location('l_end_new_st is '||l_end_new_st,10);
5368: OPEN c_sent_to_abp(l_end_new_st);
5369: FETCH c_sent_to_abp INTO l_sent_to_abp;
5370: IF c_sent_to_abp%NOTFOUND THEN
5371: --
5387: FOR temp_rec IN c_rec_12_ele(c_bg_id => p_business_group_id
5388: ,c_effective_date => l_end_new_st
5389: ,c_asg_id => p_assignment_id)
5390: LOOP
5391: hr_utility.set_location('chking asg : '||p_assignment_id,10);
5392: hr_utility.set_location('chking code : '||temp_rec.code,10);
5393: --if the amount is -999999 then fetch the balance value
5394: IF temp_rec.amount = -999999 THEN
5395: l_rec12_amt := 0;
5388: ,c_effective_date => l_end_new_st
5389: ,c_asg_id => p_assignment_id)
5390: LOOP
5391: hr_utility.set_location('chking asg : '||p_assignment_id,10);
5392: hr_utility.set_location('chking code : '||temp_rec.code,10);
5393: --if the amount is -999999 then fetch the balance value
5394: IF temp_rec.amount = -999999 THEN
5395: l_rec12_amt := 0;
5396: OPEN csr_defined_bal1(c_balance_type_id => temp_rec.ee_contribution_bal_type_id
5418: ELSE
5419: CLOSE csr_defined_bal1;
5420: END IF;
5421:
5422: hr_utility.set_location('chking amt : '||l_rec12_amt,10);
5423:
5424: IF l_rec12_amt <> 0 THEN
5425: l_rec_12_values(i_12).contrib_amount := l_rec12_amt;
5426: l_rec_12_values(i_12).date_earned := substr(fnd_date.date_to_canonical(l_end_new_st),1,10);
5641: l_org_index NUMBER;
5642:
5643: BEGIN
5644:
5645: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
5646: i := p_business_group_id;
5647: l_ext_rslt_id := Ben_Ext_Thread.g_ext_rslt_id;
5648: l_ext_dfn_id := Ben_Ext_Thread.g_ext_dfn_id;
5649:
5647: l_ext_rslt_id := Ben_Ext_Thread.g_ext_rslt_id;
5648: l_ext_dfn_id := Ben_Ext_Thread.g_ext_dfn_id;
5649:
5650: IF NOT g_extract_params.EXISTS(i) THEN
5651: Hr_Utility.set_location('..Exract Params PL/SQL not populated ', 7);
5652: -- Get the extract type, Changes extract or Full Profile
5653: OPEN csr_ext_attr(c_ext_dfn_id=> l_ext_dfn_id);
5654: FETCH csr_ext_attr INTO l_ext_dfn_type;
5655: CLOSE csr_ext_attr;
5652: -- Get the extract type, Changes extract or Full Profile
5653: OPEN csr_ext_attr(c_ext_dfn_id=> l_ext_dfn_id);
5654: FETCH csr_ext_attr INTO l_ext_dfn_type;
5655: CLOSE csr_ext_attr;
5656: Hr_Utility.set_location('..After cursor csr_ext_attr',9);
5657: -- Get the Conc. request id to get the params
5658: OPEN csr_req_id(c_ext_rslt_id => l_ext_rslt_id
5659: ,c_ext_dfn_id => l_ext_dfn_id
5660: ,c_business_group_id => p_business_group_id);
5659: ,c_ext_dfn_id => l_ext_dfn_id
5660: ,c_business_group_id => p_business_group_id);
5661: FETCH csr_req_id INTO l_conc_reqest_id;
5662: CLOSE csr_req_id;
5663: Hr_Utility.set_location('..After Conc.Request id cursor csr_req_id',11);
5664: -- Get the params. based on the conc. request id.
5665: OPEN csr_ext_params (c_request_id => l_conc_reqest_id
5666: ,c_ext_dfn_id => l_ext_dfn_id
5667: ,c_business_group_id => p_business_group_id);
5687: g_extract_params(i).currency_code;
5688: CLOSE csr_leg_code;
5689: g_legislation_code := g_extract_params(i).legislation_code;
5690: g_business_group_id := p_business_group_id;
5691: Hr_Utility.set_location('..Stored the extract parameters in PL/SQL table', 15);
5692:
5693: -- Set the meaning for concurrent program parameters
5694: Set_ConcProg_Parameter_Values
5695: (p_ext_dfn_id => g_extract_params(i).ext_dfn_id
5698: ,p_payroll_id => g_extract_params(i).payroll_id
5699: ,p_con_set => g_extract_params(i).con_set_id
5700: ,p_org_id => g_extract_params(i).org_id
5701: );
5702: Hr_Utility.set_location('..Stored the Conc. Program parameters', 17);
5703: -- Store all record ids in a PL/SQL tbl
5704: FOR rcd_rec IN csr_rcd_ids
5705: LOOP
5706: g_ext_rcds(rcd_rec.ext_rcd_id) := rcd_rec;
5736: FETCH csr_tax_org INTO l_tax_org_flag;
5737: --If employer then add org in employer list
5738: IF csr_tax_org%FOUND THEN
5739: g_employer_list(g_org_list(l_org_index).org_id).gre_org_id:=g_org_list(l_org_index).org_id;
5740: Hr_Utility.set_location('Employer '||l_org_index||g_employer_list(g_org_list(l_org_index).org_id).gre_org_id, 10);
5741: END IF;
5742: CLOSE csr_tax_org;
5743: l_org_index:=g_org_list.NEXT(l_org_index);
5744: END LOOP;
5783: -- Derive the effective date
5784: l_effective_date := Least(g_extract_params(i).extract_end_date,
5785: p_effective_date);
5786:
5787: Hr_Utility.set_location('..Processing Assig Id : '||p_assignment_id, 17);
5788: Hr_Utility.set_location('..Processing Person Id : '||g_person_id, 17);
5789: Hr_Utility.set_location('..Processing Eff.Date : '||p_effective_date, 17);
5790: -- Get the list of employers (HR Orgs) in the current hierarchy.
5791: -- Store this value in a PL/SQL Table.
5784: l_effective_date := Least(g_extract_params(i).extract_end_date,
5785: p_effective_date);
5786:
5787: Hr_Utility.set_location('..Processing Assig Id : '||p_assignment_id, 17);
5788: Hr_Utility.set_location('..Processing Person Id : '||g_person_id, 17);
5789: Hr_Utility.set_location('..Processing Eff.Date : '||p_effective_date, 17);
5790: -- Get the list of employers (HR Orgs) in the current hierarchy.
5791: -- Store this value in a PL/SQL Table.
5792: -- Check if the assignments need to be processed. Assignments are
5785: p_effective_date);
5786:
5787: Hr_Utility.set_location('..Processing Assig Id : '||p_assignment_id, 17);
5788: Hr_Utility.set_location('..Processing Person Id : '||g_person_id, 17);
5789: Hr_Utility.set_location('..Processing Eff.Date : '||p_effective_date, 17);
5790: -- Get the list of employers (HR Orgs) in the current hierarchy.
5791: -- Store this value in a PL/SQL Table.
5792: -- Check if the assignments need to be processed. Assignments are
5793: -- processed if
5905: ELSE
5906: CLOSE csr_asg_act;
5907: p_error_message := 'Payroll or QuickPay is not processed for this assignment.';
5908: END IF;
5909: Hr_Utility.set_location('..Valid Assig Id : '||p_assignment_id, 79);
5910:
5911: IF l_assig_rec.primary_flag = 'Y' THEN
5912: --
5913: -- Populate the PL/SQL structures with data like contribution
5923:
5924:
5925: END IF; -- if l_return_value = 'Y'
5926:
5927: Hr_Utility.set_location('l_return_value : '||l_return_value, 79);
5928: Hr_Utility.set_location('Leaving: '||l_proc_name, 80);
5929: RETURN l_return_value;
5930:
5931: END Pension_Criteria_Full_Profile;
5924:
5925: END IF; -- if l_return_value = 'Y'
5926:
5927: Hr_Utility.set_location('l_return_value : '||l_return_value, 79);
5928: Hr_Utility.set_location('Leaving: '||l_proc_name, 80);
5929: RETURN l_return_value;
5930:
5931: END Pension_Criteria_Full_Profile;
5932:
5952: l_asg_type per_all_assignments_f.assignment_type%TYPE;
5953: l_person_id per_all_people_f.person_id%TYPE;
5954: l_assignment_id per_all_assignments_f.assignment_id%TYPE;
5955: BEGIN
5956: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
5957: i := p_business_group_id;
5958:
5959: IF NOT g_primary_assig.EXISTS(p_assignment_id) THEN
5960: l_return_value := 'NOTFOUND';
5957: i := p_business_group_id;
5958:
5959: IF NOT g_primary_assig.EXISTS(p_assignment_id) THEN
5960: l_return_value := 'NOTFOUND';
5961: Hr_Utility.set_location('..Not a Valid assignment: '||p_assignment_id, 6);
5962: RETURN l_return_value;
5963: ELSIF g_primary_assig(p_assignment_id).assignment_type IN ('B','E') THEN
5964: Hr_Utility.set_location('..Valid Assignment Type B : '||p_assignment_id, 6);
5965: l_person_id := g_primary_assig(p_assignment_id).person_id;
5960: l_return_value := 'NOTFOUND';
5961: Hr_Utility.set_location('..Not a Valid assignment: '||p_assignment_id, 6);
5962: RETURN l_return_value;
5963: ELSIF g_primary_assig(p_assignment_id).assignment_type IN ('B','E') THEN
5964: Hr_Utility.set_location('..Valid Assignment Type B : '||p_assignment_id, 6);
5965: l_person_id := g_primary_assig(p_assignment_id).person_id;
5966: l_asg_type := g_primary_assig(p_assignment_id).assignment_type;
5967: -- Check if there are any other assignments which might be active within the
5968: -- specified extract date range
5976: l_sec_assg_rec := sec_asg_rec;
5977: l_criteria_value := 'N';
5978: l_effective_date := Least(g_extract_params(i).extract_end_date,
5979: l_sec_assg_rec.effective_end_date);
5980: Hr_Utility.set_location('..Checking for assignment id: '||
5981: l_sec_assg_rec.assignment_id, 7);
5982: Hr_Utility.set_location('..p_effective_date : '||l_effective_date, 7);
5983: -- Call the main criteria function for this assignment to check if its a
5984: -- valid assignment that can be reported based on the criteria specified.
5978: l_effective_date := Least(g_extract_params(i).extract_end_date,
5979: l_sec_assg_rec.effective_end_date);
5980: Hr_Utility.set_location('..Checking for assignment id: '||
5981: l_sec_assg_rec.assignment_id, 7);
5982: Hr_Utility.set_location('..p_effective_date : '||l_effective_date, 7);
5983: -- Call the main criteria function for this assignment to check if its a
5984: -- valid assignment that can be reported based on the criteria specified.
5985: l_criteria_value := Pension_Criteria_Full_Profile
5986: (p_assignment_id => l_sec_assg_rec.assignment_id
5993: l_return_value := 'FOUND';
5994: END IF;
5995: END LOOP; -- FOR sec_asg_rec
5996: END IF;
5997: Hr_Utility.set_location('..Assignment Count : '||g_primary_assig.Count, 7);
5998: Hr_Utility.set_location('..l_person_id : '||l_person_id, 7);
5999: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6000: RETURN l_return_value;
6001: EXCEPTION
5994: END IF;
5995: END LOOP; -- FOR sec_asg_rec
5996: END IF;
5997: Hr_Utility.set_location('..Assignment Count : '||g_primary_assig.Count, 7);
5998: Hr_Utility.set_location('..l_person_id : '||l_person_id, 7);
5999: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6000: RETURN l_return_value;
6001: EXCEPTION
6002: WHEN Others THEN
5995: END LOOP; -- FOR sec_asg_rec
5996: END IF;
5997: Hr_Utility.set_location('..Assignment Count : '||g_primary_assig.Count, 7);
5998: Hr_Utility.set_location('..l_person_id : '||l_person_id, 7);
5999: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6000: RETURN l_return_value;
6001: EXCEPTION
6002: WHEN Others THEN
6003: p_error_message :='SQL-ERRM :'||SQLERRM;
6000: RETURN l_return_value;
6001: EXCEPTION
6002: WHEN Others THEN
6003: p_error_message :='SQL-ERRM :'||SQLERRM;
6004: Hr_Utility.set_location('..'||p_error_message,85);
6005: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6006: RETURN l_return_value;
6007: END Check_Addl_Assigs;
6008:
6001: EXCEPTION
6002: WHEN Others THEN
6003: p_error_message :='SQL-ERRM :'||SQLERRM;
6004: Hr_Utility.set_location('..'||p_error_message,85);
6005: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6006: RETURN l_return_value;
6007: END Check_Addl_Assigs;
6008:
6009: -- ====================================================================
6151: l_hire_dt DATE;
6152:
6153: BEGIN
6154:
6155: hr_utility.set_location('Entering: '||l_proc_name, 5);
6156:
6157: p_data_element_value := ' ';
6158: --
6159: -- Check if the EE assignment is a new hire
6167: ELSE
6168: p_data_element_value := 'W';
6169: END IF;
6170:
6171: hr_utility.set_location('p_data_element_value: '||p_data_element_value, 5);
6172: hr_utility.set_location('Leaving: '||l_proc_name, 5);
6173:
6174: RETURN 0 ;
6175:
6168: p_data_element_value := 'W';
6169: END IF;
6170:
6171: hr_utility.set_location('p_data_element_value: '||p_data_element_value, 5);
6172: hr_utility.set_location('Leaving: '||l_proc_name, 5);
6173:
6174: RETURN 0 ;
6175:
6176: EXCEPTION
6176: EXCEPTION
6177:
6178: WHEN OTHERS THEN
6179: p_error_message :='SQL-ERRM :'||SQLERRM;
6180: Hr_Utility.set_location('..'||p_error_message,85);
6181: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6182: RETURN -1;
6183:
6184: END GET_CHANGE_CD_PER;
6177:
6178: WHEN OTHERS THEN
6179: p_error_message :='SQL-ERRM :'||SQLERRM;
6180: Hr_Utility.set_location('..'||p_error_message,85);
6181: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6182: RETURN -1;
6183:
6184: END GET_CHANGE_CD_PER;
6185:
6208: l_return_value Number :=0;
6209:
6210: BEGIN
6211:
6212: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
6213:
6214: OPEN cur_get_initials(g_person_id,p_date_earned);
6215: FETCH cur_get_initials INTO l_initials;
6216: CLOSE cur_get_initials;
6215: FETCH cur_get_initials INTO l_initials;
6216: CLOSE cur_get_initials;
6217:
6218: p_data_element_value := l_initials;
6219: Hr_Utility.set_location('Leaving: '||l_proc_name, 10);
6220: RETURN l_return_value;
6221:
6222: EXCEPTION
6223: WHEN Others THEN
6221:
6222: EXCEPTION
6223: WHEN Others THEN
6224: p_error_message :='SQL-ERRM :'||SQLERRM;
6225: Hr_Utility.set_location('..'||p_error_message,7);
6226: Hr_Utility.set_location('Leaving: '||l_proc_name, 9);
6227: l_return_value := -1;
6228: RETURN l_return_value;
6229: END Get_Person_Initials;
6222: EXCEPTION
6223: WHEN Others THEN
6224: p_error_message :='SQL-ERRM :'||SQLERRM;
6225: Hr_Utility.set_location('..'||p_error_message,7);
6226: Hr_Utility.set_location('Leaving: '||l_proc_name, 9);
6227: l_return_value := -1;
6228: RETURN l_return_value;
6229: END Get_Person_Initials;
6230:
6264: l_proc_name Varchar2(150) := g_proc_name ||'Get_Partner_Last_Name';
6265: l_return_value Number :=-1;
6266:
6267: BEGIN
6268: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
6269:
6270: OPEN cur_last_partner_name(g_person_id,p_effective_date);
6271: FETCH cur_last_partner_name INTO l_last_partner_name;
6272: CLOSE cur_last_partner_name;
6272: CLOSE cur_last_partner_name;
6273:
6274: p_data_element_value := Upper(l_last_partner_name);
6275:
6276: Hr_Utility.set_location('Leaving: '||l_proc_name, 10);
6277: l_return_value :=0;
6278:
6279: RETURN l_return_value;
6280:
6280:
6281: EXCEPTION
6282: WHEN Others THEN
6283: p_error_message :='SQL-ERRM :'||SQLERRM;
6284: Hr_Utility.set_location('..'||p_error_message,7);
6285: Hr_Utility.set_location('Leaving: '||l_proc_name, 9);
6286: RETURN l_return_value;
6287: END Get_Partner_Last_Name;
6288:
6281: EXCEPTION
6282: WHEN Others THEN
6283: p_error_message :='SQL-ERRM :'||SQLERRM;
6284: Hr_Utility.set_location('..'||p_error_message,7);
6285: Hr_Utility.set_location('Leaving: '||l_proc_name, 9);
6286: RETURN l_return_value;
6287: END Get_Partner_Last_Name;
6288:
6289: -- =============================================================================
6309: l_gender Varchar2(2);
6310: l_return_value Number;
6311:
6312: BEGIN
6313: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
6314: OPEN cur_get_gender(p_effective_date,p_business_group_id);
6315: FETCH cur_get_gender INTO l_gender;
6316: CLOSE cur_get_gender;
6317: p_data_element_value := l_gender;
6315: FETCH cur_get_gender INTO l_gender;
6316: CLOSE cur_get_gender;
6317: p_data_element_value := l_gender;
6318:
6319: Hr_Utility.set_location('p_data_element_value:'||p_data_element_value, 5);
6320: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
6321:
6322: l_return_value := 0;
6323: RETURN l_return_value;
6316: CLOSE cur_get_gender;
6317: p_data_element_value := l_gender;
6318:
6319: Hr_Utility.set_location('p_data_element_value:'||p_data_element_value, 5);
6320: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
6321:
6322: l_return_value := 0;
6323: RETURN l_return_value;
6324:
6324:
6325: EXCEPTION
6326: WHEN Others THEN
6327: p_error_message :='SQL-ERRM :'||SQLERRM;
6328: Hr_Utility.set_location('..'||p_error_message,85);
6329: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6330: l_return_value := -1;
6331: RETURN l_return_value;
6332: END Get_Gender;
6325: EXCEPTION
6326: WHEN Others THEN
6327: p_error_message :='SQL-ERRM :'||SQLERRM;
6328: Hr_Utility.set_location('..'||p_error_message,85);
6329: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6330: l_return_value := -1;
6331: RETURN l_return_value;
6332: END Get_Gender;
6333:
6368: l_return_value Number;
6369:
6370:
6371: BEGIN
6372: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
6373: OPEN cur_partner_prefix(p_effective_date);
6374: FETCH cur_partner_prefix INTO l_partner_prefix;
6375: CLOSE cur_partner_prefix;
6376:
6374: FETCH cur_partner_prefix INTO l_partner_prefix;
6375: CLOSE cur_partner_prefix;
6376:
6377: p_data_element_value := Upper(l_partner_prefix);
6378: Hr_Utility.set_location('p_data_element_value:'||p_data_element_value, 5);
6379: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
6380: l_return_value := 0;
6381: RETURN l_return_value;
6382: EXCEPTION
6375: CLOSE cur_partner_prefix;
6376:
6377: p_data_element_value := Upper(l_partner_prefix);
6378: Hr_Utility.set_location('p_data_element_value:'||p_data_element_value, 5);
6379: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
6380: l_return_value := 0;
6381: RETURN l_return_value;
6382: EXCEPTION
6383: WHEN Others THEN
6381: RETURN l_return_value;
6382: EXCEPTION
6383: WHEN Others THEN
6384: p_error_message :='SQL-ERRM :'||SQLERRM;
6385: Hr_Utility.set_location('..'||p_error_message,85);
6386: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6387: l_return_value := -1;
6388: RETURN l_return_value;
6389: END Get_Partner_Prefix;
6382: EXCEPTION
6383: WHEN Others THEN
6384: p_error_message :='SQL-ERRM :'||SQLERRM;
6385: Hr_Utility.set_location('..'||p_error_message,85);
6386: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6387: l_return_value := -1;
6388: RETURN l_return_value;
6389: END Get_Partner_Prefix;
6390:
6410:
6411: l_proc_name Varchar2(150) := g_proc_name ||'Get_Add_Fem_EE';
6412:
6413: BEGIN
6414: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
6415: p_data_element_value := ' ';
6416: FOR temp_rec IN cur_add_fem
6417: LOOP
6418: p_data_element_value := temp_rec.per_information13;
6416: FOR temp_rec IN cur_add_fem
6417: LOOP
6418: p_data_element_value := temp_rec.per_information13;
6419: END LOOP;
6420: Hr_Utility.set_location('p_data_element_value:'||p_data_element_value, 5);
6421: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
6422:
6423: RETURN 0;
6424:
6417: LOOP
6418: p_data_element_value := temp_rec.per_information13;
6419: END LOOP;
6420: Hr_Utility.set_location('p_data_element_value:'||p_data_element_value, 5);
6421: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
6422:
6423: RETURN 0;
6424:
6425: EXCEPTION
6424:
6425: EXCEPTION
6426: WHEN Others THEN
6427: p_error_message :='SQL-ERRM :'||SQLERRM;
6428: Hr_Utility.set_location('..'||p_error_message,85);
6429: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6430: RETURN -1 ;
6431: END Get_Add_Fem_EE;
6432:
6425: EXCEPTION
6426: WHEN Others THEN
6427: p_error_message :='SQL-ERRM :'||SQLERRM;
6428: Hr_Utility.set_location('..'||p_error_message,85);
6429: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6430: RETURN -1 ;
6431: END Get_Add_Fem_EE;
6432:
6433: -- =============================================================================
6443:
6444: l_proc_name Varchar2(150) := g_proc_name ||'Get_EE_Num';
6445: l_per_ee_num per_all_people_f.employee_number%TYPE;
6446: BEGIN
6447: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
6448: IF g_primary_assig.EXISTS(p_assignment_id) THEN
6449: l_per_ee_num := g_primary_assig(p_assignment_id).ee_num;
6450: END IF;
6451: p_data_element_value := Nvl(l_per_ee_num,'000000000000000');
6448: IF g_primary_assig.EXISTS(p_assignment_id) THEN
6449: l_per_ee_num := g_primary_assig(p_assignment_id).ee_num;
6450: END IF;
6451: p_data_element_value := Nvl(l_per_ee_num,'000000000000000');
6452: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
6453: RETURN 0;
6454:
6455: EXCEPTION
6456: WHEN Others THEN
6454:
6455: EXCEPTION
6456: WHEN Others THEN
6457: p_error_message :='SQL-ERRM :'||SQLERRM;
6458: Hr_Utility.set_location('..'||p_error_message,85);
6459: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6460: RETURN -1;
6461: END Get_EE_Num;
6462:
6455: EXCEPTION
6456: WHEN Others THEN
6457: p_error_message :='SQL-ERRM :'||SQLERRM;
6458: Hr_Utility.set_location('..'||p_error_message,85);
6459: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6460: RETURN -1;
6461: END Get_EE_Num;
6462:
6463: -- =============================================================================
6481: l_old_asg_seq_num VARCHAR2(2);
6482:
6483: BEGIN
6484:
6485: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
6486:
6487: OPEN c_get_old_num;
6488: FETCH c_get_old_num INTO l_old_asg_seq_num;
6489: CLOSE c_get_old_num;
6489: CLOSE c_get_old_num;
6490:
6491: p_data_element_value := UPPER(Nvl(l_old_asg_seq_num,'00'));
6492:
6493: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
6494:
6495: RETURN 0;
6496:
6497: EXCEPTION
6496:
6497: EXCEPTION
6498: WHEN Others THEN
6499: p_error_message :='SQL-ERRM :'||SQLERRM;
6500: Hr_Utility.set_location('..'||p_error_message,85);
6501: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6502: RETURN -1;
6503: END Get_Old_Asg_Seq_Num;
6504:
6497: EXCEPTION
6498: WHEN Others THEN
6499: p_error_message :='SQL-ERRM :'||SQLERRM;
6500: Hr_Utility.set_location('..'||p_error_message,85);
6501: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6502: RETURN -1;
6503: END Get_Old_Asg_Seq_Num;
6504:
6505: -- =============================================================================
6585:
6586:
6587: BEGIN
6588:
6589: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
6590:
6591: OPEN csr_get_org_id;
6592: FETCH csr_get_org_id INTO l_org_id;
6593: CLOSE csr_get_org_id ;
6591: OPEN csr_get_org_id;
6592: FETCH csr_get_org_id INTO l_org_id;
6593: CLOSE csr_get_org_id ;
6594:
6595: Hr_Utility.set_location('l_org_id: '||l_org_id, 5);
6596:
6597: --
6598: -- Fetch the values for old and new ER nums
6599: --
6623: --
6624: -- Value not found at this org level,traverse up the
6625: -- org hierarchy to find a value at the parent level
6626: --
6627: hr_utility.set_location('....No value found at HR org level,searching up the tree',40);
6628: --
6629: -- Check to see if a named hierarchy exists for the BG
6630: --
6631: OPEN c_find_named_hierarchy;
6669: FETCH c_find_ver_frm_bg INTO l_version_id;
6670: CLOSE c_find_ver_frm_bg;
6671: END IF; -- end of if named hierarchy found
6672:
6673: hr_utility.set_location(' l_version_id '||l_version_id,50);
6674:
6675: IF l_version_id IS NULL THEN
6676: --
6677: -- No hierarchy has been defined, so return 00000
6675: IF l_version_id IS NULL THEN
6676: --
6677: -- No hierarchy has been defined, so return 00000
6678: --
6679: hr_utility.set_location('No hierarchy found,hence returning 0',60);
6680: hr_utility.set_location('Leaving get_abp_er_num',65);
6681: p_data_element_value := '';
6682: RETURN 0;
6683: END IF;
6676: --
6677: -- No hierarchy has been defined, so return 00000
6678: --
6679: hr_utility.set_location('No hierarchy found,hence returning 0',60);
6680: hr_utility.set_location('Leaving get_abp_er_num',65);
6681: p_data_element_value := '';
6682: RETURN 0;
6683: END IF;
6684: --
6693: --
6694: OPEN c_find_parent_id(l_org_id,l_version_id);
6695: FETCH c_find_parent_id INTO l_org_id;
6696: IF c_find_parent_id%FOUND THEN
6697: hr_utility.set_location('searching at parent : '||l_org_id,70);
6698: CLOSE c_find_parent_id;
6699: OPEN csr_get_er_num(l_org_id);
6700: FETCH csr_get_er_num INTO l_old_er_num,l_new_er_num;
6701: IF csr_get_er_num%FOUND THEN
6722: --
6723: -- No parent found, so return 0
6724: --
6725: CLOSE c_find_parent_id;
6726: hr_utility.set_location('no parents found,returning 0',90);
6727: p_data_element_value := '';
6728: l_loop_again := 0;
6729: l_ret_val := 0;
6730: END IF;
6730: END IF;
6731: END LOOP;
6732: END IF;
6733:
6734: Hr_Utility.set_location('....Old ER Num : '||l_old_er_num,10);
6735: Hr_Utility.set_location('....New ER Num : '||l_new_er_num,15);
6736: Hr_Utility.set_location('...p_data_element_value '||p_data_element_value,20);
6737: Hr_Utility.set_location('...p_error_message '||p_error_message,25);
6738: Hr_Utility.set_location('...l_ret_val '||l_ret_val ,30);
6731: END LOOP;
6732: END IF;
6733:
6734: Hr_Utility.set_location('....Old ER Num : '||l_old_er_num,10);
6735: Hr_Utility.set_location('....New ER Num : '||l_new_er_num,15);
6736: Hr_Utility.set_location('...p_data_element_value '||p_data_element_value,20);
6737: Hr_Utility.set_location('...p_error_message '||p_error_message,25);
6738: Hr_Utility.set_location('...l_ret_val '||l_ret_val ,30);
6739: Hr_Utility.set_location(' Leaving: '||l_proc_name,50);
6732: END IF;
6733:
6734: Hr_Utility.set_location('....Old ER Num : '||l_old_er_num,10);
6735: Hr_Utility.set_location('....New ER Num : '||l_new_er_num,15);
6736: Hr_Utility.set_location('...p_data_element_value '||p_data_element_value,20);
6737: Hr_Utility.set_location('...p_error_message '||p_error_message,25);
6738: Hr_Utility.set_location('...l_ret_val '||l_ret_val ,30);
6739: Hr_Utility.set_location(' Leaving: '||l_proc_name,50);
6740:
6733:
6734: Hr_Utility.set_location('....Old ER Num : '||l_old_er_num,10);
6735: Hr_Utility.set_location('....New ER Num : '||l_new_er_num,15);
6736: Hr_Utility.set_location('...p_data_element_value '||p_data_element_value,20);
6737: Hr_Utility.set_location('...p_error_message '||p_error_message,25);
6738: Hr_Utility.set_location('...l_ret_val '||l_ret_val ,30);
6739: Hr_Utility.set_location(' Leaving: '||l_proc_name,50);
6740:
6741: RETURN l_ret_val;
6734: Hr_Utility.set_location('....Old ER Num : '||l_old_er_num,10);
6735: Hr_Utility.set_location('....New ER Num : '||l_new_er_num,15);
6736: Hr_Utility.set_location('...p_data_element_value '||p_data_element_value,20);
6737: Hr_Utility.set_location('...p_error_message '||p_error_message,25);
6738: Hr_Utility.set_location('...l_ret_val '||l_ret_val ,30);
6739: Hr_Utility.set_location(' Leaving: '||l_proc_name,50);
6740:
6741: RETURN l_ret_val;
6742:
6735: Hr_Utility.set_location('....New ER Num : '||l_new_er_num,15);
6736: Hr_Utility.set_location('...p_data_element_value '||p_data_element_value,20);
6737: Hr_Utility.set_location('...p_error_message '||p_error_message,25);
6738: Hr_Utility.set_location('...l_ret_val '||l_ret_val ,30);
6739: Hr_Utility.set_location(' Leaving: '||l_proc_name,50);
6740:
6741: RETURN l_ret_val;
6742:
6743: EXCEPTION
6742:
6743: EXCEPTION
6744: WHEN OTHERS THEN
6745: p_error_message :='SQL-ERRM :'||SQLERRM;
6746: Hr_Utility.set_location('..'||p_error_message,85);
6747: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6748: RETURN l_ret_val;
6749: END GET_ABP_ER_NUM;
6750:
6743: EXCEPTION
6744: WHEN OTHERS THEN
6745: p_error_message :='SQL-ERRM :'||SQLERRM;
6746: Hr_Utility.set_location('..'||p_error_message,85);
6747: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6748: RETURN l_ret_val;
6749: END GET_ABP_ER_NUM;
6750:
6751: -- =============================================================================
6773: l_ret_val NUMBER := 0;
6774:
6775:
6776: BEGIN
6777: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
6778:
6779: --
6780: -- get the values for old EE num
6781: --
6786: p_data_element_value := UPPER(NVL(l_old_ee_num,'000000000000000'));
6787:
6788: l_ret_val := 0;
6789:
6790: Hr_Utility.set_location(' p_data_element_value ' || p_data_element_value , 20);
6791: Hr_Utility.set_location('Leaving: '||l_proc_name, 50);
6792:
6793: RETURN l_ret_val;
6794:
6787:
6788: l_ret_val := 0;
6789:
6790: Hr_Utility.set_location(' p_data_element_value ' || p_data_element_value , 20);
6791: Hr_Utility.set_location('Leaving: '||l_proc_name, 50);
6792:
6793: RETURN l_ret_val;
6794:
6795: EXCEPTION
6795: EXCEPTION
6796:
6797: WHEN Others THEN
6798: p_error_message :='SQL-ERRM :'||SQLERRM;
6799: Hr_Utility.set_location('..'||p_error_message,85);
6800: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6801: RETURN -1;
6802:
6803: END GET_OLD_EE_NUM;
6796:
6797: WHEN Others THEN
6798: p_error_message :='SQL-ERRM :'||SQLERRM;
6799: Hr_Utility.set_location('..'||p_error_message,85);
6800: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6801: RETURN -1;
6802:
6803: END GET_OLD_EE_NUM;
6804:
6818: l_hire_dt DATE;
6819:
6820: BEGIN
6821:
6822: hr_utility.set_location('Entering: '||l_proc_name, 5);
6823:
6824: p_data_element_value := ' ';
6825:
6826: --
6834: ELSE
6835: p_data_element_value := 'W';
6836: END IF;
6837:
6838: hr_utility.set_location('p_data_element_value: '||p_data_element_value, 5);
6839: hr_utility.set_location('Leaving: '||l_proc_name, 5);
6840:
6841: RETURN 0 ;
6842:
6835: p_data_element_value := 'W';
6836: END IF;
6837:
6838: hr_utility.set_location('p_data_element_value: '||p_data_element_value, 5);
6839: hr_utility.set_location('Leaving: '||l_proc_name, 5);
6840:
6841: RETURN 0 ;
6842:
6843: EXCEPTION
6842:
6843: EXCEPTION
6844: WHEN OTHERS THEN
6845: p_error_message :='SQL-ERRM :'||SQLERRM;
6846: hr_utility.set_location('..'||p_error_message,85);
6847: hr_utility.set_location('Leaving: '||l_proc_name, 90);
6848: RETURN -1 ;
6849: END Get_Change_CD_Addr;
6850:
6843: EXCEPTION
6844: WHEN OTHERS THEN
6845: p_error_message :='SQL-ERRM :'||SQLERRM;
6846: hr_utility.set_location('..'||p_error_message,85);
6847: hr_utility.set_location('Leaving: '||l_proc_name, 90);
6848: RETURN -1 ;
6849: END Get_Change_CD_Addr;
6850:
6851: -- =============================================================================
6880: l_street per_addresses_v.region_1%TYPE;
6881: l_proc_name Varchar2(150) := g_proc_name ||'Get_Street';
6882:
6883: BEGIN
6884: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
6885:
6886: OPEN cur_get_street(g_person_id);
6887: FETCH cur_get_street INTO l_street;
6888: CLOSE cur_get_street;
6887: FETCH cur_get_street INTO l_street;
6888: CLOSE cur_get_street;
6889:
6890: p_data_element_value := Upper(l_street);
6891: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
6892: RETURN 0;
6893:
6894: EXCEPTION
6895: WHEN Others THEN
6893:
6894: EXCEPTION
6895: WHEN Others THEN
6896: p_error_message :='SQL-ERRM :'||SQLERRM;
6897: Hr_Utility.set_location('..'||p_error_message,85);
6898: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6899: RETURN -1;
6900: END Get_Street;
6901:
6894: EXCEPTION
6895: WHEN Others THEN
6896: p_error_message :='SQL-ERRM :'||SQLERRM;
6897: Hr_Utility.set_location('..'||p_error_message,85);
6898: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6899: RETURN -1;
6900: END Get_Street;
6901:
6902: -- =============================================================================
6932: l_ret_val Number := -1;
6933:
6934: BEGIN
6935:
6936: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
6937:
6938: OPEN cur_get_house_num(g_person_id);
6939: FETCH cur_get_house_num INTO l_house_num;
6940: CLOSE cur_get_house_num;
6941:
6942: p_data_element_value := Upper(l_house_num);
6943: l_ret_val :=0;
6944:
6945: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
6946: RETURN l_ret_val;
6947:
6948: EXCEPTION
6949: WHEN Others THEN
6947:
6948: EXCEPTION
6949: WHEN Others THEN
6950: p_error_message :='SQL-ERRM :'||SQLERRM;
6951: Hr_Utility.set_location('..'||p_error_message,85);
6952: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6953: RETURN l_ret_val;
6954: END Get_House_Num;
6955:
6948: EXCEPTION
6949: WHEN Others THEN
6950: p_error_message :='SQL-ERRM :'||SQLERRM;
6951: Hr_Utility.set_location('..'||p_error_message,85);
6952: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
6953: RETURN l_ret_val;
6954: END Get_House_Num;
6955:
6956: -- =============================================================================
6987: l_ret_val Number := -1;
6988:
6989: BEGIN
6990:
6991: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
6992:
6993: OPEN cur_get_addl_house_num(g_person_id);
6994: FETCH cur_get_addl_house_num INTO l_addl_house_num;
6995: CLOSE cur_get_addl_house_num;
6996:
6997: p_data_element_value := Upper(l_addl_house_num);
6998: l_ret_val :=0;
6999:
7000: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
7001: RETURN l_ret_val;
7002:
7003: EXCEPTION
7004: WHEN Others THEN
7002:
7003: EXCEPTION
7004: WHEN Others THEN
7005: p_error_message :='SQL-ERRM :'||SQLERRM;
7006: Hr_Utility.set_location('..'||p_error_message,85);
7007: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7008: RETURN l_ret_val;
7009: END Get_Addnl_House_Num;
7010:
7003: EXCEPTION
7004: WHEN Others THEN
7005: p_error_message :='SQL-ERRM :'||SQLERRM;
7006: Hr_Utility.set_location('..'||p_error_message,85);
7007: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7008: RETURN l_ret_val;
7009: END Get_Addnl_House_Num;
7010:
7011: -- =============================================================================
7036: l_proc_name Varchar2(150) := g_proc_name ||'Get_Postal_Code';
7037: l_ret_val Number := -1;
7038:
7039: BEGIN
7040: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
7041: OPEN cur_get_postal_code(g_person_id);
7042: FETCH cur_get_postal_code INTO l_postal_code;
7043: IF cur_get_postal_code%FOUND THEN
7044: CLOSE cur_get_postal_code;
7056: CLOSE cur_get_postal_code;
7057: p_data_element_value := '';
7058: END IF;
7059: l_ret_val :=0;
7060: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
7061: RETURN l_ret_val;
7062:
7063: EXCEPTION
7064: WHEN Others THEN
7062:
7063: EXCEPTION
7064: WHEN Others THEN
7065: p_error_message :='SQL-ERRM :'||SQLERRM;
7066: Hr_Utility.set_location('..'||p_error_message,85);
7067: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7068: RETURN l_ret_val;
7069: END Get_Postal_Code;
7070:
7063: EXCEPTION
7064: WHEN Others THEN
7065: p_error_message :='SQL-ERRM :'||SQLERRM;
7066: Hr_Utility.set_location('..'||p_error_message,85);
7067: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7068: RETURN l_ret_val;
7069: END Get_Postal_Code;
7070:
7071: -- =============================================================================
7114: l_proc_name Varchar2(150) := g_proc_name ||'Get_Postal_Code';
7115: l_ret_val Number := -1;
7116:
7117: BEGIN
7118: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
7119:
7120: OPEN cur_get_city(g_person_id);
7121: FETCH cur_get_city INTO l_city;
7122: CLOSE cur_get_city;
7140: END IF;
7141:
7142: l_ret_val :=0;
7143:
7144: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
7145: RETURN l_ret_val;
7146:
7147: EXCEPTION
7148: WHEN Others THEN
7146:
7147: EXCEPTION
7148: WHEN Others THEN
7149: p_error_message :='SQL-ERRM :'||SQLERRM;
7150: Hr_Utility.set_location('..'||p_error_message,85);
7151: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7152: RETURN l_ret_val;
7153: END Get_City;
7154:
7147: EXCEPTION
7148: WHEN Others THEN
7149: p_error_message :='SQL-ERRM :'||SQLERRM;
7150: Hr_Utility.set_location('..'||p_error_message,85);
7151: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7152: RETURN l_ret_val;
7153: END Get_City;
7154:
7155: -- =============================================================================
7176: l_proc_name Varchar2(150) := g_proc_name ||'Get_Foreign_Country';
7177: l_ret_val Number := 0;
7178:
7179: BEGIN
7180: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
7181: OPEN cur_get_foreign_coun(g_person_id);
7182: FETCH cur_get_foreign_coun INTO l_country;
7183: CLOSE cur_get_foreign_coun;
7184:
7183: CLOSE cur_get_foreign_coun;
7184:
7185: p_data_element_value := l_country;
7186: l_ret_val :=0;
7187: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
7188: RETURN l_ret_val;
7189:
7190: EXCEPTION
7191: WHEN Others THEN
7189:
7190: EXCEPTION
7191: WHEN Others THEN
7192: p_error_message :='SQL-ERRM :'||SQLERRM;
7193: Hr_Utility.set_location('..'||p_error_message,85);
7194: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7195: RETURN -1 ;
7196: END Get_Foreign_Country;
7197:
7190: EXCEPTION
7191: WHEN Others THEN
7192: p_error_message :='SQL-ERRM :'||SQLERRM;
7193: Hr_Utility.set_location('..'||p_error_message,85);
7194: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7195: RETURN -1 ;
7196: END Get_Foreign_Country;
7197:
7198: -- =============================================================================
7237: l_proc_name VARCHAR2(150) := g_proc_name ||'Get_Marital_Status';
7238: l_ret_val NUMBER := -1;
7239:
7240: BEGIN
7241: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
7242:
7243: OPEN cur_get_foreign_coun(g_person_id);
7244: FETCH cur_get_foreign_coun INTO l_native;
7245: CLOSE cur_get_foreign_coun;
7253: p_data_element_value := ' ';
7254: END IF;
7255:
7256: l_ret_val :=0;
7257: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
7258:
7259: RETURN l_ret_val;
7260:
7261: EXCEPTION
7260:
7261: EXCEPTION
7262: WHEN Others THEN
7263: p_error_message :='SQL-ERRM :'||SQLERRM;
7264: Hr_Utility.set_location('..'||p_error_message,85);
7265: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7266: RETURN l_ret_val;
7267: END Get_Marital_Status;
7268:
7261: EXCEPTION
7262: WHEN Others THEN
7263: p_error_message :='SQL-ERRM :'||SQLERRM;
7264: Hr_Utility.set_location('..'||p_error_message,85);
7265: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7266: RETURN l_ret_val;
7267: END Get_Marital_Status;
7268:
7269: -- =============================================================================
7304: l_dim_name VARCHAR2(100);
7305:
7306: BEGIN
7307:
7308: Hr_Utility.set_location(' Entering ' || l_proc_name,5);
7309: Hr_Utility.set_location(' p_assignment_id ' || p_assignment_id,6);
7310: Hr_Utility.set_location(' p_balance_name ' || p_balance_name,7);
7311: Hr_Utility.set_location(' p_effective_date ' || p_effective_date,7);
7312: Hr_Utility.set_location(' p_asg_act ' || p_asg_act,7);
7305:
7306: BEGIN
7307:
7308: Hr_Utility.set_location(' Entering ' || l_proc_name,5);
7309: Hr_Utility.set_location(' p_assignment_id ' || p_assignment_id,6);
7310: Hr_Utility.set_location(' p_balance_name ' || p_balance_name,7);
7311: Hr_Utility.set_location(' p_effective_date ' || p_effective_date,7);
7312: Hr_Utility.set_location(' p_asg_act ' || p_asg_act,7);
7313:
7306: BEGIN
7307:
7308: Hr_Utility.set_location(' Entering ' || l_proc_name,5);
7309: Hr_Utility.set_location(' p_assignment_id ' || p_assignment_id,6);
7310: Hr_Utility.set_location(' p_balance_name ' || p_balance_name,7);
7311: Hr_Utility.set_location(' p_effective_date ' || p_effective_date,7);
7312: Hr_Utility.set_location(' p_asg_act ' || p_asg_act,7);
7313:
7314: --
7307:
7308: Hr_Utility.set_location(' Entering ' || l_proc_name,5);
7309: Hr_Utility.set_location(' p_assignment_id ' || p_assignment_id,6);
7310: Hr_Utility.set_location(' p_balance_name ' || p_balance_name,7);
7311: Hr_Utility.set_location(' p_effective_date ' || p_effective_date,7);
7312: Hr_Utility.set_location(' p_asg_act ' || p_asg_act,7);
7313:
7314: --
7315: -- Fetch the overridden value if there is any override at the ASG EIT
7308: Hr_Utility.set_location(' Entering ' || l_proc_name,5);
7309: Hr_Utility.set_location(' p_assignment_id ' || p_assignment_id,6);
7310: Hr_Utility.set_location(' p_balance_name ' || p_balance_name,7);
7311: Hr_Utility.set_location(' p_effective_date ' || p_effective_date,7);
7312: Hr_Utility.set_location(' p_asg_act ' || p_asg_act,7);
7313:
7314: --
7315: -- Fetch the overridden value if there is any override at the ASG EIT
7316: --
7317: OPEN c_get_override_salary;
7318: FETCH c_get_override_salary INTO l_override_value,l_eff_dt;
7319: IF c_get_override_salary%FOUND THEN
7320: CLOSE c_get_override_salary;
7321: hr_utility.set_location(' Found Override at ASG Level ', 25);
7322: p_data_element_value := l_override_value;
7323: RETURN 0;
7324: ELSE
7325: CLOSE c_get_override_salary;
7330: --
7331: IF Chk_Asg_Late_Hire (p_assignment_id => p_assignment_id
7332: ,p_business_group_id => p_business_group_id) THEN
7333: l_dim_name := 'NL Assignment ABP Year To Date Dimension';
7334: hr_utility.set_location(' Asg is late hire ', 25);
7335: ELSE
7336: l_dim_name := 'Assignment Year To Date';
7337: hr_utility.set_location(' Asg is not a late hire ', 25);
7338: END IF;
7333: l_dim_name := 'NL Assignment ABP Year To Date Dimension';
7334: hr_utility.set_location(' Asg is late hire ', 25);
7335: ELSE
7336: l_dim_name := 'Assignment Year To Date';
7337: hr_utility.set_location(' Asg is not a late hire ', 25);
7338: END IF;
7339:
7340: OPEN csr_defined_bal(p_balance_name
7341: ,l_dim_name
7342: ,p_business_group_id);
7343: FETCH csr_defined_bal INTO l_balance_id;
7344: CLOSE csr_defined_bal;
7345:
7346: Hr_Utility.set_location(' l_balance_id ' || l_balance_id , 15);
7347:
7348: IF l_balance_id IS NOT NULL THEN
7349:
7350: IF p_asg_act <> - 1 THEN
7350: IF p_asg_act <> - 1 THEN
7351: l_balance_amount := Pay_Balance_Pkg.get_value
7352: (p_defined_balance_id => l_balance_id
7353: ,p_assignment_action_id => p_asg_act);
7354: Hr_Utility.set_location(' l_balance_amount ' || l_balance_amount , 25);
7355: l_balance_amount := NVL(l_balance_amount,0);
7356: p_data_element_value :=
7357: Fnd_Number.number_to_canonical(l_balance_amount);
7358: l_ret_val := 0;
7357: Fnd_Number.number_to_canonical(l_balance_amount);
7358: l_ret_val := 0;
7359: ELSIF p_asg_act = - 1 THEN
7360:
7361: Hr_Utility.set_location(' l_asg_action_id ' || l_asg_action_id , 20);
7362: Hr_Utility.set_location(' l_eff_dt ' || l_eff_dt , 22);
7363: OPEN csr_asg_act1 (
7364: c_assignment_id => p_assignment_id
7365: ,c_payroll_id => g_extract_params(p_business_group_id).payroll_id
7358: l_ret_val := 0;
7359: ELSIF p_asg_act = - 1 THEN
7360:
7361: Hr_Utility.set_location(' l_asg_action_id ' || l_asg_action_id , 20);
7362: Hr_Utility.set_location(' l_eff_dt ' || l_eff_dt , 22);
7363: OPEN csr_asg_act1 (
7364: c_assignment_id => p_assignment_id
7365: ,c_payroll_id => g_extract_params(p_business_group_id).payroll_id
7366: ,c_con_set_id => NULL
7372: IF l_asg_action_id IS NOT NULL THEN
7373: l_balance_amount := Pay_Balance_Pkg.get_value
7374: (p_defined_balance_id => l_balance_id
7375: ,p_assignment_action_id => l_asg_action_id);
7376: Hr_Utility.set_location(' l_balance_amount ' || l_balance_amount , 25);
7377: l_balance_amount := NVL(l_balance_amount,0);
7378: p_data_element_value :=
7379: Fnd_Number.number_to_canonical(l_balance_amount);
7380: l_ret_val := 0;
7382:
7383: END IF;
7384: END IF;
7385:
7386: Hr_Utility.set_location(' p_data_element_value ' || p_data_element_value , 30);
7387: Hr_Utility.set_location(' l_ret_val ' || l_ret_val , 40);
7388: Hr_Utility.set_location(' Leaving ' || l_proc_name , 50);
7389:
7390: RETURN l_ret_val;
7383: END IF;
7384: END IF;
7385:
7386: Hr_Utility.set_location(' p_data_element_value ' || p_data_element_value , 30);
7387: Hr_Utility.set_location(' l_ret_val ' || l_ret_val , 40);
7388: Hr_Utility.set_location(' Leaving ' || l_proc_name , 50);
7389:
7390: RETURN l_ret_val;
7391:
7384: END IF;
7385:
7386: Hr_Utility.set_location(' p_data_element_value ' || p_data_element_value , 30);
7387: Hr_Utility.set_location(' l_ret_val ' || l_ret_val , 40);
7388: Hr_Utility.set_location(' Leaving ' || l_proc_name , 50);
7389:
7390: RETURN l_ret_val;
7391:
7392: EXCEPTION WHEN Others THEN
7390: RETURN l_ret_val;
7391:
7392: EXCEPTION WHEN Others THEN
7393: p_error_message :='SQL-ERRM :'||SQLERRM;
7394: Hr_Utility.set_location('..'||p_error_message,85);
7395: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7396: RETURN l_ret_val;
7397:
7398: END Get_Pension_Salary;
7391:
7392: EXCEPTION WHEN Others THEN
7393: p_error_message :='SQL-ERRM :'||SQLERRM;
7394: Hr_Utility.set_location('..'||p_error_message,85);
7395: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7396: RETURN l_ret_val;
7397:
7398: END Get_Pension_Salary;
7399:
7412: j Number;
7413:
7414: BEGIN
7415:
7416: Hr_Utility.set_location(' Entering ' || l_proc_name , 10);
7417: IF p_record_number = 12 THEN
7418: IF l_rec_12_values.count > 0 THEN
7419: j := l_rec_12_values.FIRST;
7420: IF l_rec_12_values.EXISTS(j) THEN
7432: END IF;
7433: END IF;
7434: RETURN 0;
7435:
7436: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7437: EXCEPTION
7438: WHEN Others THEN
7439: p_error_message :='SQL-ERRM :'||SQLERRM;
7440: Hr_Utility.set_location('..'||p_error_message,85);
7436: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7437: EXCEPTION
7438: WHEN Others THEN
7439: p_error_message :='SQL-ERRM :'||SQLERRM;
7440: Hr_Utility.set_location('..'||p_error_message,85);
7441: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7442: RETURN -1 ;
7443: END Get_Contribution_Amount;
7444:
7437: EXCEPTION
7438: WHEN Others THEN
7439: p_error_message :='SQL-ERRM :'||SQLERRM;
7440: Hr_Utility.set_location('..'||p_error_message,85);
7441: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7442: RETURN -1 ;
7443: END Get_Contribution_Amount;
7444:
7445: -- =============================================================================
7458: l_proc_name Varchar2(150) := g_proc_name ||'Get_Sub_Cat_12';
7459: j Number;
7460:
7461: BEGIN
7462: Hr_Utility.set_location(' Entering ' || l_proc_name , 10);
7463: IF l_rec_12_values.count > 0 THEN
7464: j := l_rec_12_values.FIRST;
7465: p_data_element_value := lpad(l_rec_12_values(j).code,2,'0');
7466: END IF;
7466: END IF;
7467:
7468: RETURN 0;
7469:
7470: Hr_Utility.set_location(' Leaving ' || l_proc_name , 80);
7471:
7472: EXCEPTION
7473: WHEN Others THEN
7474: p_error_message :='SQL-ERRM :'||SQLERRM;
7471:
7472: EXCEPTION
7473: WHEN Others THEN
7474: p_error_message :='SQL-ERRM :'||SQLERRM;
7475: Hr_Utility.set_location('..'||p_error_message,85);
7476: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7477: RETURN -1;
7478: END Get_Sub_Cat_12;
7479:
7472: EXCEPTION
7473: WHEN Others THEN
7474: p_error_message :='SQL-ERRM :'||SQLERRM;
7475: Hr_Utility.set_location('..'||p_error_message,85);
7476: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7477: RETURN -1;
7478: END Get_Sub_Cat_12;
7479:
7480: -- =============================================================================
7527: l_pen_part_start_dt DATE;
7528:
7529: BEGIN
7530:
7531: Hr_Utility.set_location(' Entering ' || l_proc_name , 5);
7532: Hr_Utility.set_location(' p_assignment_id ' || p_assignment_id , 6);
7533:
7534: OPEN cur_get_yr(p_effective_date);
7535: FETCH cur_get_yr INTO l_start_date_yr;
7528:
7529: BEGIN
7530:
7531: Hr_Utility.set_location(' Entering ' || l_proc_name , 5);
7532: Hr_Utility.set_location(' p_assignment_id ' || p_assignment_id , 6);
7533:
7534: OPEN cur_get_yr(p_effective_date);
7535: FETCH cur_get_yr INTO l_start_date_yr;
7536: CLOSE cur_get_yr;
7543: FETCH c_get_override_start_date INTO l_pen_part_start_dt;
7544:
7545: IF c_get_override_start_date%FOUND THEN
7546: CLOSE c_get_override_start_date;
7547: Hr_Utility.set_location(' l_pen_part_start_dt ' || l_pen_part_start_dt , 10);
7548: Hr_Utility.set_location('l_start_date_yr'||l_start_date_yr , 40);
7549:
7550: IF (l_pen_part_start_dt IS NOT NULL AND l_start_date_yr IS NOT NULL) THEN
7551:
7544:
7545: IF c_get_override_start_date%FOUND THEN
7546: CLOSE c_get_override_start_date;
7547: Hr_Utility.set_location(' l_pen_part_start_dt ' || l_pen_part_start_dt , 10);
7548: Hr_Utility.set_location('l_start_date_yr'||l_start_date_yr , 40);
7549:
7550: IF (l_pen_part_start_dt IS NOT NULL AND l_start_date_yr IS NOT NULL) THEN
7551:
7552: IF ( l_pen_part_start_dt > l_start_date_yr ) THEN
7555: ELSE
7556: p_data_element_value := Ben_Ext_Fmt.apply_format_mask
7557: (l_start_date_yr,'YYYYMMDD');
7558: END IF;
7559: Hr_Utility.set_location('p_data_element_value'||p_data_element_value,50);
7560: l_ret_val := 0;
7561: END IF;
7562:
7563: ELSE
7575:
7576: END IF;
7577: END IF;
7578:
7579: Hr_Utility.set_location(' l_ret_val ' || l_ret_val , 60);
7580: Hr_Utility.set_location(' p_data_element_value'||p_data_element_value , 70);
7581: Hr_Utility.set_location(' Leaving: '||l_proc_name, 80);
7582:
7583: RETURN l_ret_val ;
7576: END IF;
7577: END IF;
7578:
7579: Hr_Utility.set_location(' l_ret_val ' || l_ret_val , 60);
7580: Hr_Utility.set_location(' p_data_element_value'||p_data_element_value , 70);
7581: Hr_Utility.set_location(' Leaving: '||l_proc_name, 80);
7582:
7583: RETURN l_ret_val ;
7584:
7577: END IF;
7578:
7579: Hr_Utility.set_location(' l_ret_val ' || l_ret_val , 60);
7580: Hr_Utility.set_location(' p_data_element_value'||p_data_element_value , 70);
7581: Hr_Utility.set_location(' Leaving: '||l_proc_name, 80);
7582:
7583: RETURN l_ret_val ;
7584:
7585: EXCEPTION
7584:
7585: EXCEPTION
7586: WHEN OTHERS THEN
7587: p_error_message :='SQL-ERRM :'||SQLERRM;
7588: Hr_Utility.set_location('..'||p_error_message,85);
7589: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7590: RETURN l_ret_val;
7591: END Get_Pension_Start_Year;
7592:
7585: EXCEPTION
7586: WHEN OTHERS THEN
7587: p_error_message :='SQL-ERRM :'||SQLERRM;
7588: Hr_Utility.set_location('..'||p_error_message,85);
7589: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7590: RETURN l_ret_val;
7591: END Get_Pension_Start_Year;
7592:
7593:
7604: j number;
7605:
7606: BEGIN
7607:
7608: Hr_Utility.set_location(' Entering ' || l_proc_name , 05);
7609: IF p_record_number = 9 THEN
7610: IF l_rec_09_values.count > 0 THEN
7611: j := l_rec_09_values.FIRST;
7612: IF l_rec_09_values.EXISTS(j) THEN
7635: 'YYYY');
7636: ELSE
7637: p_data_element_value := '0000';
7638: END IF;
7639: Hr_Utility.set_location(' Leaving ' || l_proc_name , 25);
7640:
7641: RETURN 0;
7642:
7643: EXCEPTION
7642:
7643: EXCEPTION
7644: WHEN Others THEN
7645: p_error_message :='SQL-ERRM :'||SQLERRM;
7646: Hr_Utility.set_location('..'||p_error_message,85);
7647: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7648: RETURN -1;
7649: END Get_Pension_Basis_Year;
7650:
7643: EXCEPTION
7644: WHEN Others THEN
7645: p_error_message :='SQL-ERRM :'||SQLERRM;
7646: Hr_Utility.set_location('..'||p_error_message,85);
7647: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7648: RETURN -1;
7649: END Get_Pension_Basis_Year;
7650:
7651: FUNCTION Get_Month_Contribution_Base
7661: j number;
7662:
7663: BEGIN
7664:
7665: Hr_Utility.set_location(' Entering ' || l_proc_name , 05);
7666: IF p_record_number = 9 THEN
7667: IF l_rec_09_values.count > 0 THEN
7668: j := l_rec_09_values.FIRST;
7669: IF l_rec_09_values.EXISTS(j) THEN
7694: 'MM');
7695: ELSE
7696: p_data_element_value := '00';
7697: END IF;
7698: Hr_Utility.set_location(' Leaving ' || l_proc_name , 25);
7699:
7700: RETURN 0;
7701:
7702: EXCEPTION
7701:
7702: EXCEPTION
7703: WHEN Others THEN
7704: p_error_message :='SQL-ERRM :'||SQLERRM;
7705: Hr_Utility.set_location('..'||p_error_message,85);
7706: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7707: RETURN -1;
7708:
7709: END Get_Month_Contribution_Base;
7702: EXCEPTION
7703: WHEN Others THEN
7704: p_error_message :='SQL-ERRM :'||SQLERRM;
7705: Hr_Utility.set_location('..'||p_error_message,85);
7706: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7707: RETURN -1;
7708:
7709: END Get_Month_Contribution_Base;
7710:
7721: j number;
7722:
7723: BEGIN
7724:
7725: Hr_Utility.set_location(' Entering ' || l_proc_name , 05);
7726: IF p_record_number = 12 THEN
7727: IF l_rec_12_values.count > 0 THEN
7728: j := l_rec_12_values.FIRST;
7729: IF l_rec_12_values.EXISTS(j) THEN
7751: END IF;
7752: END IF;
7753: END IF;
7754: END IF;
7755: Hr_Utility.set_location(' Leaving ' || l_proc_name , 25);
7756:
7757: RETURN 0;
7758:
7759: EXCEPTION
7758:
7759: EXCEPTION
7760: WHEN Others THEN
7761: p_error_message :='SQL-ERRM :'||SQLERRM;
7762: Hr_Utility.set_location('..'||p_error_message,85);
7763: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7764: RETURN -1;
7765: END Get_Year_Contribution_Amt;
7766:
7759: EXCEPTION
7760: WHEN Others THEN
7761: p_error_message :='SQL-ERRM :'||SQLERRM;
7762: Hr_Utility.set_location('..'||p_error_message,85);
7763: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7764: RETURN -1;
7765: END Get_Year_Contribution_Amt;
7766:
7767: FUNCTION Get_Month_Contribution_Amt
7777: j number;
7778:
7779: BEGIN
7780:
7781: Hr_Utility.set_location(' Entering ' || l_proc_name , 05);
7782: IF p_record_number = 12 THEN
7783: IF l_rec_12_values.count > 0 THEN
7784: j := l_rec_12_values.FIRST;
7785: IF l_rec_12_values.EXISTS(j) THEN
7809: l_rec_41_contrib_values.DELETE(j);
7810: END IF;
7811: END IF;
7812: END IF;
7813: Hr_Utility.set_location(' Leaving ' || l_proc_name , 25);
7814:
7815: RETURN 0;
7816:
7817: EXCEPTION
7816:
7817: EXCEPTION
7818: WHEN Others THEN
7819: p_error_message :='SQL-ERRM :'||SQLERRM;
7820: Hr_Utility.set_location('..'||p_error_message,85);
7821: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7822: RETURN -1;
7823:
7824: END Get_Month_Contribution_Amt;
7817: EXCEPTION
7818: WHEN Others THEN
7819: p_error_message :='SQL-ERRM :'||SQLERRM;
7820: Hr_Utility.set_location('..'||p_error_message,85);
7821: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
7822: RETURN -1;
7823:
7824: END Get_Month_Contribution_Amt;
7825:
7845: l_data_ent NUMBER := 0;
7846:
7847: BEGIN
7848:
7849: hr_utility.set_location('Entering...'||l_proc_name,10);
7850: --
7851: -- Check if the assignment is attached to a payroll
7852: -- Check if ABP Pensions is processed
7853: --
7861: -- for this assignment. If the details are not
7862: -- entered, this is a new hire employee and the
7863: -- record does not have to be displayed
7864: --
7865: hr_utility.set_location('....Checking old EE info entry',50);
7866:
7867: OPEN c_data_entered;
7868: FETCH c_data_entered INTO l_data_ent;
7869: IF c_data_entered%FOUND THEN
7867: OPEN c_data_entered;
7868: FETCH c_data_entered INTO l_data_ent;
7869: IF c_data_entered%FOUND THEN
7870: l_data_ent := 1;
7871: hr_utility.set_location('....c_data_entered %FOUND',60);
7872: ELSIF c_data_entered%NOTFOUND THEN
7873: hr_utility.set_location('....c_data_entered %NOTFOUND',70);
7874: l_data_ent := 0;
7875: END IF;
7869: IF c_data_entered%FOUND THEN
7870: l_data_ent := 1;
7871: hr_utility.set_location('....c_data_entered %FOUND',60);
7872: ELSIF c_data_entered%NOTFOUND THEN
7873: hr_utility.set_location('....c_data_entered %NOTFOUND',70);
7874: l_data_ent := 0;
7875: END IF;
7876: CLOSE c_data_entered;
7877:
7874: l_data_ent := 0;
7875: END IF;
7876: CLOSE c_data_entered;
7877:
7878: hr_utility.set_location('....After Checking old EE entry',80);
7879: hr_utility.set_location('....Value of l_data_ent is -- '||l_data_ent,90);
7880:
7881: IF NVL(g_extract_params(p_business_group_id).extract_rec_01,'N') = 'Y'
7882: AND l_data_ent = 1 THEN
7875: END IF;
7876: CLOSE c_data_entered;
7877:
7878: hr_utility.set_location('....After Checking old EE entry',80);
7879: hr_utility.set_location('....Value of l_data_ent is -- '||l_data_ent,90);
7880:
7881: IF NVL(g_extract_params(p_business_group_id).extract_rec_01,'N') = 'Y'
7882: AND l_data_ent = 1 THEN
7883: p_data_element_value := 'Y';
7884: ELSE
7885: p_data_element_value := 'N';
7886: END IF;
7887:
7888: hr_utility.set_location('....Value of p_data_element_value is '
7889: ||p_data_element_value,100);
7890: hr_utility.set_location('Leaving: '||l_proc_name,110);
7891:
7892: l_return_value := 0;
7886: END IF;
7887:
7888: hr_utility.set_location('....Value of p_data_element_value is '
7889: ||p_data_element_value,100);
7890: hr_utility.set_location('Leaving: '||l_proc_name,110);
7891:
7892: l_return_value := 0;
7893:
7894: RETURN l_return_value;
7896: EXCEPTION
7897: WHEN OTHERS THEN
7898: p_error_message :='SQL-ERRM :'||SQLERRM;
7899: p_data_element_value := 'N';
7900: hr_utility.set_location('..WHEN OTHERS EXCEPTION ',120);
7901: hr_utility.set_location('..'||p_error_message,130);
7902: hr_utility.set_location('Leaving: '||l_proc_name,140);
7903: RETURN l_return_value;
7904:
7897: WHEN OTHERS THEN
7898: p_error_message :='SQL-ERRM :'||SQLERRM;
7899: p_data_element_value := 'N';
7900: hr_utility.set_location('..WHEN OTHERS EXCEPTION ',120);
7901: hr_utility.set_location('..'||p_error_message,130);
7902: hr_utility.set_location('Leaving: '||l_proc_name,140);
7903: RETURN l_return_value;
7904:
7905: END Record01_Display_Criteria;
7898: p_error_message :='SQL-ERRM :'||SQLERRM;
7899: p_data_element_value := 'N';
7900: hr_utility.set_location('..WHEN OTHERS EXCEPTION ',120);
7901: hr_utility.set_location('..'||p_error_message,130);
7902: hr_utility.set_location('Leaving: '||l_proc_name,140);
7903: RETURN l_return_value;
7904:
7905: END Record01_Display_Criteria;
7906:
7993: l_rec_02_sent NUMBER;
7994:
7995: BEGIN
7996:
7997: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
7998: --
7999: -- Check if the assignment is attached to a payroll
8000: -- Check if ABP Pensions is processed for the asg
8001: --
8029: FETCH csr_chk_log INTO l_Chg_Evt_Exists;
8030:
8031: IF csr_chk_log%FOUND THEN
8032: p_data_element_value := 'Y';
8033: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
8034: CLOSE csr_chk_log;
8035: RETURN 0;
8036: ELSE
8037: p_data_element_value := 'N';
8087: ELSE
8088: p_data_element_value := 'N';
8089: END IF;
8090:
8091: hr_Utility.set_location('Leaving: '||l_proc_name, 5);
8092:
8093: l_return_value := 0;
8094: RETURN l_return_value;
8095:
8097:
8098: WHEN OTHERS THEN
8099: p_error_message :='SQL-ERRM :'||SQLERRM;
8100: p_data_element_value := 'N';
8101: Hr_Utility.set_location('..'||p_error_message,85);
8102: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
8103: RETURN l_return_value;
8104:
8105: END Record02_Display_Criteria;
8098: WHEN OTHERS THEN
8099: p_error_message :='SQL-ERRM :'||SQLERRM;
8100: p_data_element_value := 'N';
8101: Hr_Utility.set_location('..'||p_error_message,85);
8102: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
8103: RETURN l_return_value;
8104:
8105: END Record02_Display_Criteria;
8106:
8274:
8275: BEGIN
8276:
8277: IF g_debug THEN
8278: Hr_Utility.set_location('Entering: '||l_proc_name,10);
8279: Hr_Utility.set_location('... Checking if EE is a New Hire ',20);
8280: END IF;
8281: --
8282: -- Check if the assignment is attached to a payroll
8275: BEGIN
8276:
8277: IF g_debug THEN
8278: Hr_Utility.set_location('Entering: '||l_proc_name,10);
8279: Hr_Utility.set_location('... Checking if EE is a New Hire ',20);
8280: END IF;
8281: --
8282: -- Check if the assignment is attached to a payroll
8283: -- Check if ABP Pensions is processed
8295:
8296: IF l_new_hire = 1 THEN
8297: p_data_element_value := 'Y';
8298: IF g_debug THEN
8299: Hr_Utility.set_location('... EE is a New Hire ',30);
8300: END IF;
8301: RETURN 0;
8302: ELSE
8303: p_data_element_value := 'N';
8301: RETURN 0;
8302: ELSE
8303: p_data_element_value := 'N';
8304: IF g_debug THEN
8305: Hr_Utility.set_location('... EE is not a New Hire ',40);
8306: END IF;
8307: END IF;
8308:
8309: --
8309: --
8310: --Checking the ben event log for any foreign address changes
8311: --
8312: IF g_debug THEN
8313: Hr_Utility.set_location('... Checking for Foreign Address Changes ',50);
8314: END IF;
8315:
8316: OPEN c_non_nl_chg
8317: (c_person_id => g_person_id
8323:
8324: IF c_non_nl_chg%FOUND THEN
8325: p_data_element_value := 'Y';
8326: IF g_debug THEN
8327: Hr_Utility.set_location('...Foreign Address Changes Found',60);
8328: END IF;
8329: CLOSE c_non_nl_chg;
8330: RETURN 0;
8331: ELSE
8330: RETURN 0;
8331: ELSE
8332: p_data_element_value := 'N';
8333: IF g_debug THEN
8334: Hr_Utility.set_location('...Foreign Address Changes Not Found',70);
8335: END IF;
8336: CLOSE c_non_nl_chg;
8337: END IF;
8338:
8340: --
8341: --Checking the ben event log for any changes from Foreign Country to NL
8342: --
8343: IF g_debug THEN
8344: Hr_Utility.set_location('... Checking for Changes from a foreign Country to NL ',50);
8345: END IF;
8346:
8347: OPEN c_to_nl_chg
8348: (c_person_id => g_person_id
8354:
8355: IF c_to_nl_chg%FOUND THEN
8356: p_data_element_value := 'Y';
8357: IF g_debug THEN
8358: Hr_Utility.set_location('...EE Moved to NL',60);
8359: END IF;
8360: CLOSE c_to_nl_chg;
8361: RETURN 0;
8362: ELSE
8361: RETURN 0;
8362: ELSE
8363: p_data_element_value := 'N';
8364: IF g_debug THEN
8365: Hr_Utility.set_location('...EE Did not move to NL',70);
8366: END IF;
8367: CLOSE c_to_nl_chg;
8368: END IF;
8369:
8367: CLOSE c_to_nl_chg;
8368: END IF;
8369:
8370: IF g_debug THEN
8371: Hr_Utility.set_location('... Checking for Country Code Changes ',50);
8372: END IF;
8373:
8374: OPEN c_cntry_chg
8375: (c_person_id => g_person_id
8380: FETCH c_cntry_chg INTO l_chg_addr_id,l_cc_code;
8381:
8382: IF c_cntry_chg%FOUND THEN
8383: IF g_debug THEN
8384: Hr_Utility.set_location('...Country Code Changes Found',60);
8385: END IF;
8386: CLOSE c_cntry_chg;
8387: --
8388: -- Check if the change was made for the current address
8399: END IF;
8400: ELSE
8401: p_data_element_value := 'N';
8402: IF g_debug THEN
8403: Hr_Utility.set_location('...Country Code Changes Not Found',70);
8404: END IF;
8405: CLOSE c_cntry_chg;
8406: END IF;
8407:
8410: -- Marital status changes are to be reported only if the EE resides
8411: -- in a foreign country
8412: --
8413: IF g_debug THEN
8414: Hr_Utility.set_location('... Checking for Marital Status Changes ',90);
8415: END IF;
8416:
8417: OPEN cur_get_foreign_coun(g_person_id);
8418: FETCH cur_get_foreign_coun INTO l_foreign_country;
8418: FETCH cur_get_foreign_coun INTO l_foreign_country;
8419: CLOSE cur_get_foreign_coun;
8420:
8421: IF g_debug THEN
8422: Hr_Utility.set_location('...Value of l_foreign_country is ',80);
8423: END IF;
8424:
8425: OPEN csr_chk_log_com
8426: (c_person_id => g_person_id
8432:
8433: IF csr_chk_log_com%FOUND AND l_foreign_country = 'J' THEN
8434: p_data_element_value := 'Y';
8435: IF g_debug THEN
8436: Hr_Utility.set_location('...Marital Status Changes Found',100);
8437: Hr_Utility.set_location('...EE Resides in a Foreign Country',100);
8438: END IF;
8439: CLOSE csr_chk_log_com;
8440: RETURN 0;
8433: IF csr_chk_log_com%FOUND AND l_foreign_country = 'J' THEN
8434: p_data_element_value := 'Y';
8435: IF g_debug THEN
8436: Hr_Utility.set_location('...Marital Status Changes Found',100);
8437: Hr_Utility.set_location('...EE Resides in a Foreign Country',100);
8438: END IF;
8439: CLOSE csr_chk_log_com;
8440: RETURN 0;
8441: ELSE
8440: RETURN 0;
8441: ELSE
8442: p_data_element_value := 'N';
8443: IF g_debug THEN
8444: Hr_Utility.set_location('...Marital Status Changes Not Found',110);
8445: Hr_Utility.set_location('...Alternatively EE Resides in NL',110);
8446: END IF;
8447: CLOSE csr_chk_log_com;
8448: END IF;
8441: ELSE
8442: p_data_element_value := 'N';
8443: IF g_debug THEN
8444: Hr_Utility.set_location('...Marital Status Changes Not Found',110);
8445: Hr_Utility.set_location('...Alternatively EE Resides in NL',110);
8446: END IF;
8447: CLOSE csr_chk_log_com;
8448: END IF;
8449:
8461:
8462: IF l_chk_hire_dt_chg = 1 THEN
8463:
8464: IF g_debug THEN
8465: Hr_Utility.set_location('...EE is a late Hire ',120);
8466: END IF;
8467:
8468: l_ret_val_asg := Get_Asg_Seq_Num(p_assignment_id
8469: ,p_business_group_id
8475: IF c_rec_04_sent%NOTFOUND THEN
8476: CLOSE c_rec_04_sent ;
8477: p_data_element_value := 'Y';
8478: IF g_debug THEN
8479: Hr_Utility.set_location('...EE Record 04 never sent to ABP ',130);
8480: END IF;
8481: RETURN 0;
8482: ELSIF c_rec_04_sent%FOUND THEN
8483: CLOSE c_rec_04_sent ;
8481: RETURN 0;
8482: ELSIF c_rec_04_sent%FOUND THEN
8483: CLOSE c_rec_04_sent ;
8484: IF g_debug THEN
8485: Hr_Utility.set_location('...EE Record 04 sent to ABP earlier',140);
8486: END IF;
8487: p_data_element_value := 'N';
8488: END IF;
8489:
8488: END IF;
8489:
8490: ELSE
8491: IF g_debug THEN
8492: Hr_Utility.set_location('...EE is a not a late Hire ',150);
8493: END IF;
8494: p_data_element_value := 'N';
8495: END IF;
8496:
8494: p_data_element_value := 'N';
8495: END IF;
8496:
8497: IF g_debug THEN
8498: Hr_Utility.set_location('... Value of p_data_element_value is '
8499: ||p_data_element_value,160);
8500: Hr_Utility.set_location('Leaving: '||l_proc_name, 170);
8501: END IF;
8502:
8496:
8497: IF g_debug THEN
8498: Hr_Utility.set_location('... Value of p_data_element_value is '
8499: ||p_data_element_value,160);
8500: Hr_Utility.set_location('Leaving: '||l_proc_name, 170);
8501: END IF;
8502:
8503: l_return_value := 0;
8504:
8507: EXCEPTION
8508: WHEN OTHERS THEN
8509: p_error_message :='SQL-ERRM :'||SQLERRM;
8510: p_data_element_value := 'N';
8511: Hr_Utility.set_location('... WHEN OTHERS EXCEPTION',180);
8512: Hr_Utility.set_location('..'||p_error_message,190);
8513: Hr_Utility.set_location('Leaving: '||l_proc_name,200);
8514: RETURN l_return_value;
8515: END Record04_Display_Criteria;
8508: WHEN OTHERS THEN
8509: p_error_message :='SQL-ERRM :'||SQLERRM;
8510: p_data_element_value := 'N';
8511: Hr_Utility.set_location('... WHEN OTHERS EXCEPTION',180);
8512: Hr_Utility.set_location('..'||p_error_message,190);
8513: Hr_Utility.set_location('Leaving: '||l_proc_name,200);
8514: RETURN l_return_value;
8515: END Record04_Display_Criteria;
8516:
8509: p_error_message :='SQL-ERRM :'||SQLERRM;
8510: p_data_element_value := 'N';
8511: Hr_Utility.set_location('... WHEN OTHERS EXCEPTION',180);
8512: Hr_Utility.set_location('..'||p_error_message,190);
8513: Hr_Utility.set_location('Leaving: '||l_proc_name,200);
8514: RETURN l_return_value;
8515: END Record04_Display_Criteria;
8516:
8517: --============================================================================
8595: l_seq_num VARCHAR2(2);
8596:
8597: BEGIN
8598:
8599: Hr_Utility.set_location('Entering: '||l_proc_name,10);
8600:
8601: --
8602: -- Check if the assignment is attached to a payroll
8603: -- Check if ABP Pensions is processed
8616: p_data_element_value := 'N';
8617: RETURN 0;
8618: END IF;
8619:
8620: Hr_Utility.set_location('...Deriving def bal id ',20);
8621:
8622: OPEN csr_defined_bal('ABP Pension Salary'
8623: ,'Assignment Year To Date'
8624: ,p_business_group_id);
8624: ,p_business_group_id);
8625: FETCH csr_defined_bal INTO l_balance_id;
8626: CLOSE csr_defined_bal;
8627:
8628: Hr_Utility.set_location('... Value of def bal id is'||l_balance_id,30);
8629: Hr_Utility.set_location('...Deriving ass act id ',40);
8630:
8631: IF l_balance_id IS NOT NULL THEN
8632:
8625: FETCH csr_defined_bal INTO l_balance_id;
8626: CLOSE csr_defined_bal;
8627:
8628: Hr_Utility.set_location('... Value of def bal id is'||l_balance_id,30);
8629: Hr_Utility.set_location('...Deriving ass act id ',40);
8630:
8631: IF l_balance_id IS NOT NULL THEN
8632:
8633: OPEN csr_asg_act1 (
8636: ,c_con_set_id => NULL
8637: ,c_start_date => g_extract_params(p_business_group_id).extract_start_date
8638: ,c_end_date => g_extract_params(p_business_group_id).extract_end_date);
8639: FETCH csr_asg_act1 INTO l_asg_action_id;
8640: Hr_Utility.set_location('... Value of ass act id is'||l_asg_action_id,45);
8641: CLOSE csr_asg_act1;
8642:
8643: IF l_asg_action_id IS NOT NULL THEN
8644: Hr_Utility.set_location('...Deriving balance value ',50);
8640: Hr_Utility.set_location('... Value of ass act id is'||l_asg_action_id,45);
8641: CLOSE csr_asg_act1;
8642:
8643: IF l_asg_action_id IS NOT NULL THEN
8644: Hr_Utility.set_location('...Deriving balance value ',50);
8645: l_balance_amount := pay_balance_pkg.get_value
8646: (p_defined_balance_id => l_balance_id
8647: ,p_assignment_action_id => l_asg_action_id);
8648: Hr_Utility.set_location('...Value of l_balance_amount is:'
8644: Hr_Utility.set_location('...Deriving balance value ',50);
8645: l_balance_amount := pay_balance_pkg.get_value
8646: (p_defined_balance_id => l_balance_id
8647: ,p_assignment_action_id => l_asg_action_id);
8648: Hr_Utility.set_location('...Value of l_balance_amount is:'
8649: ||l_balance_amount, 25);
8650: l_balance_amount := NVL(l_balance_amount,0);
8651: END IF;
8652:
8651: END IF;
8652:
8653: END IF;
8654:
8655: Hr_Utility.set_location('...Checking of Ext is running for Jan ',60);
8656: --
8657: -- Check to see if the extract is being run for JAN,
8658: -- If it is JAN, we need to report the pension salary
8659: --
8661: FETCH c_get_month INTO l_month;
8662: CLOSE c_get_month;
8663:
8664: IF l_month = '01' AND NVL(l_balance_amount,0) <> 0 THEN
8665: Hr_Utility.set_location('...Ext is running for Jan ',70);
8666: p_data_element_value := 'Y';
8667: RETURN 0;
8668: ELSE
8669: Hr_Utility.set_location('...Ext is not running for Jan ',80);
8665: Hr_Utility.set_location('...Ext is running for Jan ',70);
8666: p_data_element_value := 'Y';
8667: RETURN 0;
8668: ELSE
8669: Hr_Utility.set_location('...Ext is not running for Jan ',80);
8670: p_data_element_value := 'N';
8671: END IF;
8672:
8673: --
8673: --
8674: -- Fetch the overridden value if there is any override changes in
8675: -- the ASG EIT
8676: --
8677: Hr_Utility.set_location('...Checking for ABP Pension Salary Override ',90);
8678:
8679: OPEN c_get_override_salary;
8680: FETCH c_get_override_salary INTO l_override_value;
8681: IF c_get_override_salary%FOUND THEN
8681: IF c_get_override_salary%FOUND THEN
8682: CLOSE c_get_override_salary;
8683: IF nvl(l_override_value,0) <> 0 THEN
8684: p_data_element_value := 'Y';
8685: Hr_Utility.set_location('...ABP Pension Salary Override Found ',100);
8686: RETURN 0;
8687: ELSE
8688: Hr_Utility.set_location('...ABP Pension Salary Override Not Found ',110);
8689: p_data_element_value := 'N';
8684: p_data_element_value := 'Y';
8685: Hr_Utility.set_location('...ABP Pension Salary Override Found ',100);
8686: RETURN 0;
8687: ELSE
8688: Hr_Utility.set_location('...ABP Pension Salary Override Not Found ',110);
8689: p_data_element_value := 'N';
8690: END IF;
8691: ELSE
8692: CLOSE c_get_override_salary;
8694:
8695: --
8696: -- Check if the EE assignment is a new hire and needs to be reported.
8697: --
8698: Hr_Utility.set_location('... Checking if EE is a New Hire ',20);
8699:
8700: l_new_hire := g_new_hire_asg;
8701: l_hire_dt := g_hire_date;
8702:
8701: l_hire_dt := g_hire_date;
8702:
8703: IF l_new_hire = 1 AND NVL(l_balance_amount,0) <> 0 THEN
8704: p_data_element_value := 'Y';
8705: Hr_Utility.set_location('... EE is a New Hire ',120);
8706: RETURN 0;
8707: ELSE
8708: p_data_element_value := 'N';
8709: Hr_Utility.set_location('... EE is not a New Hire ',130);
8705: Hr_Utility.set_location('... EE is a New Hire ',120);
8706: RETURN 0;
8707: ELSE
8708: p_data_element_value := 'N';
8709: Hr_Utility.set_location('... EE is not a New Hire ',130);
8710: END IF;
8711:
8712: l_ret_val_asg := Get_Asg_Seq_Num(p_assignment_id
8713: ,p_business_group_id
8720: ,l_seq_num);
8721: FETCH c_rec_08_sent INTO l_08_sent;
8722: IF c_rec_08_sent%NOTFOUND AND NVL(l_balance_amount,0) <> 0 THEN
8723: p_data_element_value := 'Y';
8724: Hr_Utility.set_location('... Data never sent ',120);
8725: CLOSE c_rec_08_sent;
8726: RETURN 0;
8727: ELSE
8728: CLOSE c_rec_08_sent;
8726: RETURN 0;
8727: ELSE
8728: CLOSE c_rec_08_sent;
8729: p_data_element_value := 'N';
8730: Hr_Utility.set_location('... Data Was sent ',130);
8731: END IF;
8732:
8733: hr_utility.set_location('Leaving: '||l_proc_name,140);
8734: l_return_value := 0;
8729: p_data_element_value := 'N';
8730: Hr_Utility.set_location('... Data Was sent ',130);
8731: END IF;
8732:
8733: hr_utility.set_location('Leaving: '||l_proc_name,140);
8734: l_return_value := 0;
8735:
8736: RETURN l_return_value;
8737:
8738: EXCEPTION
8739: WHEN OTHERS THEN
8740: p_error_message :='SQL-ERRM :'||SQLERRM;
8741: p_data_element_value := 'N';
8742: Hr_Utility.set_location('...WHEN OTHERS EXCEPTION',150);
8743: Hr_Utility.set_location('..'||p_error_message,160);
8744: Hr_Utility.set_location('Leaving: '||l_proc_name,170);
8745: RETURN l_return_value;
8746: END Record08_Display_Criteria;
8739: WHEN OTHERS THEN
8740: p_error_message :='SQL-ERRM :'||SQLERRM;
8741: p_data_element_value := 'N';
8742: Hr_Utility.set_location('...WHEN OTHERS EXCEPTION',150);
8743: Hr_Utility.set_location('..'||p_error_message,160);
8744: Hr_Utility.set_location('Leaving: '||l_proc_name,170);
8745: RETURN l_return_value;
8746: END Record08_Display_Criteria;
8747:
8740: p_error_message :='SQL-ERRM :'||SQLERRM;
8741: p_data_element_value := 'N';
8742: Hr_Utility.set_location('...WHEN OTHERS EXCEPTION',150);
8743: Hr_Utility.set_location('..'||p_error_message,160);
8744: Hr_Utility.set_location('Leaving: '||l_proc_name,170);
8745: RETURN l_return_value;
8746: END Record08_Display_Criteria;
8747:
8748: --=============================================================================
8759: l_proc_name VARCHAR2(150) := g_proc_name ||'Record09_Display_Criteria';
8760:
8761: BEGIN
8762:
8763: Hr_Utility.set_location('Entering: '||l_proc_name,10);
8764: --
8765: -- Derive the value of Record 09 display criteria based on the
8766: -- value set to the global variable in full profile criteria
8767: --
8770: ELSE
8771: p_data_element_value := 'N';
8772: END IF;
8773:
8774: Hr_Utility.set_location('Value of p_data_element_value is : '
8775: ||p_data_element_value,20);
8776: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
8777:
8778: RETURN 0;
8772: END IF;
8773:
8774: Hr_Utility.set_location('Value of p_data_element_value is : '
8775: ||p_data_element_value,20);
8776: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
8777:
8778: RETURN 0;
8779:
8780: END Record09_Display_Criteria;
8792:
8793: l_proc_name VARCHAR2(150) := g_proc_name ||'Record12_Display_Criteria';
8794:
8795: BEGIN
8796: Hr_Utility.set_location('Entering : '||l_proc_name,10);
8797: --
8798: -- Derive the value of Record 12 display criteria based on the
8799: -- value set to the global variable in full profile criteria
8800: --
8803: ELSE
8804: p_data_element_value := 'N';
8805: END IF;
8806:
8807: Hr_Utility.set_location('Value of p_data_element_value is: '
8808: ||p_data_element_value,20);
8809: Hr_Utility.set_location('Leaving: '||l_proc_name,30);
8810:
8811: RETURN 0;
8805: END IF;
8806:
8807: Hr_Utility.set_location('Value of p_data_element_value is: '
8808: ||p_data_element_value,20);
8809: Hr_Utility.set_location('Leaving: '||l_proc_name,30);
8810:
8811: RETURN 0;
8812:
8813: END Record12_Display_Criteria;
8896: l_proc_name VARCHAR2(150) := 'Record05_Display_Criteria';
8897:
8898: BEGIN
8899:
8900: Hr_Utility.set_location('Entering: '||l_proc_name, 10);
8901:
8902: --
8903: -- Always display record 05 as this causes issues with the
8904: -- secondary assignments. Unnecessary records are later deleted as part of
8906: --
8907:
8908: p_data_element_value := 'Y';
8909:
8910: Hr_Utility.set_location('... The data element value is : '
8911: ||p_data_element_value,20);
8912:
8913: Hr_Utility.set_location('Leaving: '||l_proc_name, 30);
8914:
8909:
8910: Hr_Utility.set_location('... The data element value is : '
8911: ||p_data_element_value,20);
8912:
8913: Hr_Utility.set_location('Leaving: '||l_proc_name, 30);
8914:
8915: l_return_value := 0;
8916:
8917: RETURN l_return_value;
8918:
8919: EXCEPTION
8920: WHEN OTHERS THEN
8921: p_error_message :='SQL-ERRM :'||SQLERRM;
8922: Hr_Utility.set_location('...WHEN OTHERS EXCEPTION',40);
8923: p_data_element_value := 'N';
8924: Hr_Utility.set_location('...'||p_error_message,50);
8925: Hr_Utility.set_location('Leaving: '||l_proc_name,60);
8926: l_return_value := 1;
8920: WHEN OTHERS THEN
8921: p_error_message :='SQL-ERRM :'||SQLERRM;
8922: Hr_Utility.set_location('...WHEN OTHERS EXCEPTION',40);
8923: p_data_element_value := 'N';
8924: Hr_Utility.set_location('...'||p_error_message,50);
8925: Hr_Utility.set_location('Leaving: '||l_proc_name,60);
8926: l_return_value := 1;
8927: RETURN l_return_value;
8928:
8921: p_error_message :='SQL-ERRM :'||SQLERRM;
8922: Hr_Utility.set_location('...WHEN OTHERS EXCEPTION',40);
8923: p_data_element_value := 'N';
8924: Hr_Utility.set_location('...'||p_error_message,50);
8925: Hr_Utility.set_location('Leaving: '||l_proc_name,60);
8926: l_return_value := 1;
8927: RETURN l_return_value;
8928:
8929: END Record05_Display_Criteria;
9091: l_pt Number;
9092: l_hired Number := 0;
9093:
9094: BEGIN
9095: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
9096: Hr_Utility.set_location('sub category : '||p_sub_cat,10);
9097:
9098: OPEN c_hire_dt;
9099: FETCH c_hire_dt INTO l_hire_date;
9092: l_hired Number := 0;
9093:
9094: BEGIN
9095: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
9096: Hr_Utility.set_location('sub category : '||p_sub_cat,10);
9097:
9098: OPEN c_hire_dt;
9099: FETCH c_hire_dt INTO l_hire_date;
9100: CLOSE c_hire_dt;
9106: OPEN c_asg_rows_exist;
9107: FETCH c_asg_rows_exist INTO l_asg_rows_exist;
9108: IF c_asg_rows_exist%FOUND THEN
9109: CLOSE c_asg_rows_exist;
9110: Hr_Utility.set_location('found rows at the assignment eit level',15);
9111: OPEN c_get_asg_rows;
9112: FETCH c_get_asg_rows INTO l_rows_exist;
9113: CLOSE c_get_asg_rows;
9114: ELSE
9153: l_loop_again := 1;
9154: WHILE (l_loop_again = 1)
9155:
9156: LOOP
9157: Hr_Utility.set_location('searching at org level : '||l_org_id,25);
9158: OPEN c_org_rows_exist(l_org_id);
9159: FETCH c_org_rows_exist INTO l_org_rows_exist;
9160: IF c_org_rows_exist%FOUND THEN
9161: CLOSE c_org_rows_exist;
9189: CLOSE c_run_results_exist;
9190: END IF;
9191: END IF;
9192: END IF;
9193: Hr_Utility.set_location('rows exist : '||l_rows_exist,30);
9194: IF l_rows_exist = 1 THEN
9195: IF p_sub_cat = 'IPAP' THEN
9196: p_data_element_value := 'Y';
9197: l_return_value := 0;
9211: ELSE
9212: p_data_element_value := 'N';
9213: l_return_value := 0;
9214: END IF;
9215: Hr_Utility.set_location('data element value : '||p_data_element_value,35);
9216: Hr_Utility.set_location('Leaving: '||l_proc_name, 40);
9217: RETURN l_return_value;
9218: EXCEPTION
9219: WHEN Others THEN
9212: p_data_element_value := 'N';
9213: l_return_value := 0;
9214: END IF;
9215: Hr_Utility.set_location('data element value : '||p_data_element_value,35);
9216: Hr_Utility.set_location('Leaving: '||l_proc_name, 40);
9217: RETURN l_return_value;
9218: EXCEPTION
9219: WHEN Others THEN
9220: p_error_message :='SQL-ERRM :'||SQLERRM;
9218: EXCEPTION
9219: WHEN Others THEN
9220: p_error_message :='SQL-ERRM :'||SQLERRM;
9221: p_data_element_value := 'N';
9222: Hr_Utility.set_location('..'||p_error_message,85);
9223: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
9224: l_return_value := 1;
9225: RETURN l_return_value;
9226: END Record30_40_Display_Criteria;
9219: WHEN Others THEN
9220: p_error_message :='SQL-ERRM :'||SQLERRM;
9221: p_data_element_value := 'N';
9222: Hr_Utility.set_location('..'||p_error_message,85);
9223: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
9224: l_return_value := 1;
9225: RETURN l_return_value;
9226: END Record30_40_Display_Criteria;
9227:
9241: l_return_value Number := 1;
9242: l_age Number;
9243:
9244: BEGIN
9245: Hr_Utility.set_location('Entering -------- : '||l_proc_name,10);
9246: IF p_record_number = 31 THEN
9247: IF l_rec_31_disp = 'Y' THEN
9248: p_data_element_value := 'Y';
9249: l_return_value := 0;
9283: EXCEPTION
9284: WHEN Others THEN
9285: p_error_message :='SQL-ERRM :'||SQLERRM;
9286: p_data_element_value := 'N';
9287: Hr_Utility.set_location('..'||p_error_message,85);
9288: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
9289: l_return_value := 1;
9290: RETURN l_return_value;
9291: END Record31_41_Display_Criteria;
9284: WHEN Others THEN
9285: p_error_message :='SQL-ERRM :'||SQLERRM;
9286: p_data_element_value := 'N';
9287: Hr_Utility.set_location('..'||p_error_message,85);
9288: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
9289: l_return_value := 1;
9290: RETURN l_return_value;
9291: END Record31_41_Display_Criteria;
9292:
9418: -- then return that org info id
9419: OPEN c_get_valid_org_info(l_org_id);
9420: FETCH c_get_valid_org_info INTO l_org_info_id;
9421: IF c_get_valid_org_info%FOUND THEN
9422: Hr_Utility.set_location('found row @ org info level'||l_org_id,20);
9423: l_loop_again := 0;
9424: CLOSE c_get_valid_org_info;
9425: -- fetch the participation end date from the org info row
9426: OPEN c_get_org_info(l_org_id);
9617: l_end_date Date;
9618:
9619:
9620: BEGIN
9621: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
9622: --check the index and the code and calculate the value accordingly
9623: Hr_Utility.set_location('value of g_index : '||g_index_fur,7);
9624: Hr_Utility.set_location('value of fetch code : '||p_fetch_code ,10);
9625: IF g_index_fur = 0 AND p_fetch_code = 'NEW_ST' THEN
9619:
9620: BEGIN
9621: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
9622: --check the index and the code and calculate the value accordingly
9623: Hr_Utility.set_location('value of g_index : '||g_index_fur,7);
9624: Hr_Utility.set_location('value of fetch code : '||p_fetch_code ,10);
9625: IF g_index_fur = 0 AND p_fetch_code = 'NEW_ST' THEN
9626: g_count_fur := 0;
9627:
9620: BEGIN
9621: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
9622: --check the index and the code and calculate the value accordingly
9623: Hr_Utility.set_location('value of g_index : '||g_index_fur,7);
9624: Hr_Utility.set_location('value of fetch code : '||p_fetch_code ,10);
9625: IF g_index_fur = 0 AND p_fetch_code = 'NEW_ST' THEN
9626: g_count_fur := 0;
9627:
9628: OPEN c_hire_dt;
9636: OPEN c_asg_rows_exist;
9637: FETCH c_asg_rows_exist INTO l_asg_rows_exist;
9638: IF c_asg_rows_exist%FOUND THEN
9639: CLOSE c_asg_rows_exist;
9640: Hr_Utility.set_location('found rows at the assignment eit level',15);
9641: --now fetch the rows from the log table
9642: FOR asg_rec IN c_get_asg_rows
9643: LOOP
9644:
9676:
9677: i := i + 1;
9678: END LOOP; -- FOR asg_rec IN c_get_asg_rows
9679: g_count_fur := i;
9680: Hr_Utility.set_location('count of rows : '||g_count_fur,20);
9681: ELSE
9682: CLOSE c_asg_rows_exist;
9683: --go up the org hierarchy to find the rows at some org eit level
9684: -- find the org the assignment is attached to
9720: l_loop_again := 1;
9721: WHILE (l_loop_again = 1)
9722:
9723: LOOP
9724: Hr_Utility.set_location('searching at org level : '||l_org_id,25);
9725: OPEN c_org_rows_exist(l_org_id);
9726: FETCH c_org_rows_exist INTO l_org_rows_exist;
9727: IF c_org_rows_exist%FOUND THEN
9728: CLOSE c_org_rows_exist;
9758: g_fur_dates(i).old_end := '';
9759: g_fur_dates(i).new_end := '';
9760: END IF;
9761: IF l_hired = 1 THEN
9762: Hr_Utility.set_location('hire date : '||l_hire_date,99);
9763: Hr_Utility.set_location('new date : '||g_fur_dates(i).new_start,100);
9764: Hr_Utility.set_location('greater date : '||Fnd_Date.date_to_canonical(Greatest(
9765: l_hire_date,Fnd_Date.canonical_to_date(g_fur_dates(i).new_start))),101);
9766: IF g_fur_dates(i).new_start IS NOT NULL THEN
9759: g_fur_dates(i).new_end := '';
9760: END IF;
9761: IF l_hired = 1 THEN
9762: Hr_Utility.set_location('hire date : '||l_hire_date,99);
9763: Hr_Utility.set_location('new date : '||g_fur_dates(i).new_start,100);
9764: Hr_Utility.set_location('greater date : '||Fnd_Date.date_to_canonical(Greatest(
9765: l_hire_date,Fnd_Date.canonical_to_date(g_fur_dates(i).new_start))),101);
9766: IF g_fur_dates(i).new_start IS NOT NULL THEN
9767: Hr_Utility.set_location('chking the new start date',102);
9760: END IF;
9761: IF l_hired = 1 THEN
9762: Hr_Utility.set_location('hire date : '||l_hire_date,99);
9763: Hr_Utility.set_location('new date : '||g_fur_dates(i).new_start,100);
9764: Hr_Utility.set_location('greater date : '||Fnd_Date.date_to_canonical(Greatest(
9765: l_hire_date,Fnd_Date.canonical_to_date(g_fur_dates(i).new_start))),101);
9766: IF g_fur_dates(i).new_start IS NOT NULL THEN
9767: Hr_Utility.set_location('chking the new start date',102);
9768: g_fur_dates(i).new_start := Fnd_Date.date_to_canonical(Greatest(
9763: Hr_Utility.set_location('new date : '||g_fur_dates(i).new_start,100);
9764: Hr_Utility.set_location('greater date : '||Fnd_Date.date_to_canonical(Greatest(
9765: l_hire_date,Fnd_Date.canonical_to_date(g_fur_dates(i).new_start))),101);
9766: IF g_fur_dates(i).new_start IS NOT NULL THEN
9767: Hr_Utility.set_location('chking the new start date',102);
9768: g_fur_dates(i).new_start := Fnd_Date.date_to_canonical(Greatest(
9769: l_hire_date,Fnd_Date.canonical_to_date(g_fur_dates(i).new_start)));
9770: Hr_Utility.set_location('new start date is : '||g_fur_dates(i).new_start,103);
9771: END IF;
9766: IF g_fur_dates(i).new_start IS NOT NULL THEN
9767: Hr_Utility.set_location('chking the new start date',102);
9768: g_fur_dates(i).new_start := Fnd_Date.date_to_canonical(Greatest(
9769: l_hire_date,Fnd_Date.canonical_to_date(g_fur_dates(i).new_start)));
9770: Hr_Utility.set_location('new start date is : '||g_fur_dates(i).new_start,103);
9771: END IF;
9772: IF g_fur_dates(i).old_start IS NOT NULL THEN
9773: g_fur_dates(i).old_start := Fnd_Date.date_to_canonical(Greatest(
9774: l_hire_date,Fnd_Date.canonical_to_date(g_fur_dates(i).old_start)));
9779: END IF;
9780: i := i + 1;
9781: END LOOP;
9782: g_count_fur := i;
9783: Hr_Utility.set_location('value for g count : '||g_count_fur,30);
9784: l_loop_again := 0;
9785: ELSE
9786: --search at the parent level next
9787: CLOSE c_org_rows_exist;
9831: END IF;
9832: END IF;
9833:
9834: IF g_count_fur > 0 THEN
9835: Hr_Utility.set_location('old st date : '||g_fur_dates(g_index_fur).old_start,40);
9836: Hr_Utility.set_location('new st date : '||g_fur_dates(g_index_fur).new_start,45);
9837: Hr_Utility.set_location('old ed date : '||g_fur_dates(g_index_fur).old_end,50);
9838: Hr_Utility.set_location('new ed date : '||g_fur_dates(g_index_fur).new_end,55);
9839: l_return_value := 0;
9832: END IF;
9833:
9834: IF g_count_fur > 0 THEN
9835: Hr_Utility.set_location('old st date : '||g_fur_dates(g_index_fur).old_start,40);
9836: Hr_Utility.set_location('new st date : '||g_fur_dates(g_index_fur).new_start,45);
9837: Hr_Utility.set_location('old ed date : '||g_fur_dates(g_index_fur).old_end,50);
9838: Hr_Utility.set_location('new ed date : '||g_fur_dates(g_index_fur).new_end,55);
9839: l_return_value := 0;
9840: --depending on the fetch code ,set the data element value
9833:
9834: IF g_count_fur > 0 THEN
9835: Hr_Utility.set_location('old st date : '||g_fur_dates(g_index_fur).old_start,40);
9836: Hr_Utility.set_location('new st date : '||g_fur_dates(g_index_fur).new_start,45);
9837: Hr_Utility.set_location('old ed date : '||g_fur_dates(g_index_fur).old_end,50);
9838: Hr_Utility.set_location('new ed date : '||g_fur_dates(g_index_fur).new_end,55);
9839: l_return_value := 0;
9840: --depending on the fetch code ,set the data element value
9841: IF p_fetch_code = 'NEW_ST' THEN
9834: IF g_count_fur > 0 THEN
9835: Hr_Utility.set_location('old st date : '||g_fur_dates(g_index_fur).old_start,40);
9836: Hr_Utility.set_location('new st date : '||g_fur_dates(g_index_fur).new_start,45);
9837: Hr_Utility.set_location('old ed date : '||g_fur_dates(g_index_fur).old_end,50);
9838: Hr_Utility.set_location('new ed date : '||g_fur_dates(g_index_fur).new_end,55);
9839: l_return_value := 0;
9840: --depending on the fetch code ,set the data element value
9841: IF p_fetch_code = 'NEW_ST' THEN
9842: p_data_element_value := g_fur_dates(g_index_fur).new_start;
9857: p_data_element_value := '';
9858: l_return_value := 0;
9859: END IF;
9860:
9861: Hr_Utility.set_location('p_data_element_value: '||p_data_element_value, 70);
9862: Hr_Utility.set_location('Leaving: '||l_proc_name, 80);
9863:
9864: l_return_value :=0;
9865: RETURN l_return_value;
9858: l_return_value := 0;
9859: END IF;
9860:
9861: Hr_Utility.set_location('p_data_element_value: '||p_data_element_value, 70);
9862: Hr_Utility.set_location('Leaving: '||l_proc_name, 80);
9863:
9864: l_return_value :=0;
9865: RETURN l_return_value;
9866: EXCEPTION
9865: RETURN l_return_value;
9866: EXCEPTION
9867: WHEN Others THEN
9868: p_error_message :='SQL-ERRM :'||SQLERRM;
9869: Hr_Utility.set_location('..'||p_error_message,85);
9870: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
9871: RETURN l_return_value;
9872: END get_fur_participation_dates;
9873:
9866: EXCEPTION
9867: WHEN Others THEN
9868: p_error_message :='SQL-ERRM :'||SQLERRM;
9869: Hr_Utility.set_location('..'||p_error_message,85);
9870: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
9871: RETURN l_return_value;
9872: END get_fur_participation_dates;
9873:
9874: --============================================================================
9981: fnd_date.date_to_canonical(hr_api.g_eot)));
9982:
9983:
9984: BEGIN
9985: Hr_Utility.set_location('Entering ------ : '||l_proc_name,10);
9986: --
9987: -- Check if the value being fetched is the current one(for the extract date range).
9988: --
9989: IF p_current = 'Y' THEN
9986: --
9987: -- Check if the value being fetched is the current one(for the extract date range).
9988: --
9989: IF p_current = 'Y' THEN
9990: Hr_Utility.set_location('... Current PPP Flag derived',15);
9991: OPEN c_ppp_asg1;
9992: FETCH c_ppp_asg1 INTO l_asg_exist;
9993: IF c_ppp_asg1%FOUND THEN
9994: Hr_Utility.set_location('... Current PPP Flag derived',16);
9990: Hr_Utility.set_location('... Current PPP Flag derived',15);
9991: OPEN c_ppp_asg1;
9992: FETCH c_ppp_asg1 INTO l_asg_exist;
9993: IF c_ppp_asg1%FOUND THEN
9994: Hr_Utility.set_location('... Current PPP Flag derived',16);
9995: l_ppp_flag := '1';
9996: ELSE
9997: OPEN c_rr_cur;
9998: FETCH c_rr_cur INTO l_rr_exist;
9997: OPEN c_rr_cur;
9998: FETCH c_rr_cur INTO l_rr_exist;
9999: IF c_rr_cur%FOUND THEN
10000: l_ppp_flag := '1';
10001: Hr_Utility.set_location('... RR exist value is 1',20);
10002: ELSE
10003: l_ppp_flag := '0';
10004: Hr_Utility.set_location('... RR do not exist value is 0',30);
10005: END IF;
10000: l_ppp_flag := '1';
10001: Hr_Utility.set_location('... RR exist value is 1',20);
10002: ELSE
10003: l_ppp_flag := '0';
10004: Hr_Utility.set_location('... RR do not exist value is 0',30);
10005: END IF;
10006: CLOSE c_rr_cur;
10007: END IF;
10008: CLOSE c_ppp_asg1;
10011: FOR ppp_org_rec IN c_ppp_org
10012: LOOP
10013: l_org_id := ppp_org_rec.organization_id;
10014: END LOOP;
10015: Hr_Utility.set_location('...Org Id for the Asg: '||l_org_id,20);
10016:
10017: p_data_element_value := l_ppp_flag;
10018: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 20);
10019: RETURN 0;
10014: END LOOP;
10015: Hr_Utility.set_location('...Org Id for the Asg: '||l_org_id,20);
10016:
10017: p_data_element_value := l_ppp_flag;
10018: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 20);
10019: RETURN 0;
10020:
10021: EXCEPTION
10022: WHEN Others THEN
10021: EXCEPTION
10022: WHEN Others THEN
10023: p_error_message :='SQL-ERRM :'||SQLERRM;
10024: p_data_element_value := ' ';
10025: Hr_Utility.set_location('..'||p_error_message,10);
10026: Hr_Utility.set_location('Leaving:-------- '||l_proc_name,20);
10027: RETURN -1;
10028:
10029: END Get_PPP_Kind;
10022: WHEN Others THEN
10023: p_error_message :='SQL-ERRM :'||SQLERRM;
10024: p_data_element_value := ' ';
10025: Hr_Utility.set_location('..'||p_error_message,10);
10026: Hr_Utility.set_location('Leaving:-------- '||l_proc_name,20);
10027: RETURN -1;
10028:
10029: END Get_PPP_Kind;
10030:
10178: fnd_date.date_to_canonical(hr_api.g_eot))));
10179:
10180: BEGIN
10181:
10182: Hr_Utility.set_location('Entering ------ : '||l_proc_name,5);
10183:
10184: FOR fpu_rec IN c_fpu_asg
10185: LOOP
10186: IF l_kind_of_contrib = 'G' THEN
10199: END IF;
10200: END LOOP;
10201: END IF;
10202:
10203: Hr_Utility.set_location('...Kind of FPU : '||l_kind_of_contrib,10);
10204:
10205: p_data_element_value := l_kind_of_contrib;
10206:
10207: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 20);
10203: Hr_Utility.set_location('...Kind of FPU : '||l_kind_of_contrib,10);
10204:
10205: p_data_element_value := l_kind_of_contrib;
10206:
10207: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 20);
10208:
10209: RETURN 0;
10210:
10211: EXCEPTION
10210:
10211: EXCEPTION
10212: WHEN OTHERS THEN
10213: p_error_message :='SQL-ERRM :'||SQLERRM;
10214: Hr_Utility.set_location('..'||p_error_message,15);
10215: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 20);
10216: RETURN -1;
10217:
10218: END Get_Fpu_Kind;
10211: EXCEPTION
10212: WHEN OTHERS THEN
10213: p_error_message :='SQL-ERRM :'||SQLERRM;
10214: Hr_Utility.set_location('..'||p_error_message,15);
10215: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 20);
10216: RETURN -1;
10217:
10218: END Get_Fpu_Kind;
10219:
10242: AND information_type = 'NL_ABP_RI';
10243:
10244: BEGIN
10245:
10246: Hr_Utility.set_location('Entering ------ : '||l_proc_name,5);
10247: OPEN c_get_contrib_kind;
10248: FETCH c_get_contrib_kind INTO l_kind_of_contrib;
10249: CLOSE c_get_contrib_kind;
10250: Hr_Utility.set_location('value of kind of opnp : '||l_kind_of_contrib,10);
10246: Hr_Utility.set_location('Entering ------ : '||l_proc_name,5);
10247: OPEN c_get_contrib_kind;
10248: FETCH c_get_contrib_kind INTO l_kind_of_contrib;
10249: CLOSE c_get_contrib_kind;
10250: Hr_Utility.set_location('value of kind of opnp : '||l_kind_of_contrib,10);
10251: p_data_element_value := l_kind_of_contrib;
10252: RETURN 0;
10253:
10254: EXCEPTION
10253:
10254: EXCEPTION
10255: WHEN Others THEN
10256: p_error_message :='SQL-ERRM :'||SQLERRM;
10257: Hr_Utility.set_location('..'||p_error_message,15);
10258: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 20);
10259: RETURN -1;
10260:
10261: END Get_Opnp_Kind;
10254: EXCEPTION
10255: WHEN Others THEN
10256: p_error_message :='SQL-ERRM :'||SQLERRM;
10257: Hr_Utility.set_location('..'||p_error_message,15);
10258: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 20);
10259: RETURN -1;
10260:
10261: END Get_Opnp_Kind;
10262:
10556: IF l_rec_09.count > 0 THEN
10557: FOR i IN l_rec_09.FIRST..l_rec_09.LAST
10558: LOOP
10559: l_rr_exists := 0;
10560: hr_utility.set_location('current element : '||l_rec_09(i).element_type_id,10);
10561: hr_utility.set_location('asg id : '||p_assignment_id,12);
10562: hr_utility.set_location('start date : ',14);
10563: hr_utility.set_location('end date : ',15);
10564: FOR act_rec IN csr_asg_act (
10557: FOR i IN l_rec_09.FIRST..l_rec_09.LAST
10558: LOOP
10559: l_rr_exists := 0;
10560: hr_utility.set_location('current element : '||l_rec_09(i).element_type_id,10);
10561: hr_utility.set_location('asg id : '||p_assignment_id,12);
10562: hr_utility.set_location('start date : ',14);
10563: hr_utility.set_location('end date : ',15);
10564: FOR act_rec IN csr_asg_act (
10565: c_assignment_id => p_assignment_id
10558: LOOP
10559: l_rr_exists := 0;
10560: hr_utility.set_location('current element : '||l_rec_09(i).element_type_id,10);
10561: hr_utility.set_location('asg id : '||p_assignment_id,12);
10562: hr_utility.set_location('start date : ',14);
10563: hr_utility.set_location('end date : ',15);
10564: FOR act_rec IN csr_asg_act (
10565: c_assignment_id => p_assignment_id
10566: ,c_payroll_id => g_extract_params(p_business_group_id).payroll_id
10559: l_rr_exists := 0;
10560: hr_utility.set_location('current element : '||l_rec_09(i).element_type_id,10);
10561: hr_utility.set_location('asg id : '||p_assignment_id,12);
10562: hr_utility.set_location('start date : ',14);
10563: hr_utility.set_location('end date : ',15);
10564: FOR act_rec IN csr_asg_act (
10565: c_assignment_id => p_assignment_id
10566: ,c_payroll_id => g_extract_params(p_business_group_id).payroll_id
10567: ,c_con_set_id => NULL
10576: -- Check if Run Results exist for this element/ass act
10577: IF chk_rr_exist (p_ass_act_id => act_rec.assignment_action_id
10578: ,p_element_type_id => l_rec_09(i).element_type_id ) THEN
10579: -- Call pay_balance_pkg
10580: hr_utility.set_location('run results exist for current period',40);
10581: IF l_rec_09(i).defined_bal_id <> -1 THEN
10582: l_rec_09_values(k).basis_amount :=
10583: Pay_Balance_Pkg.get_value
10584: (p_defined_balance_id => l_rec_09(i).defined_bal_id
10582: l_rec_09_values(k).basis_amount :=
10583: Pay_Balance_Pkg.get_value
10584: (p_defined_balance_id => l_rec_09(i).defined_bal_id
10585: ,p_assignment_action_id => act_rec.assignment_action_id);
10586: hr_utility.set_location('defined bal id used :'||l_rec_09(i).defined_bal_id,50);
10587: l_rec_09_disp := 'Y';
10588: l_rec_09_values(k).processed := 'N';
10589: l_rec_09_values(k).code := l_rec_09(i).code;
10590: l_rec_09_values(k).date_earned :=
10977: l_asg_term_dt DATE;
10978:
10979: BEGIN
10980:
10981: Hr_Utility.set_location('Entering:------'||l_proc_name, 2);
10982: Hr_Utility.set_location('....Value of assignment id : '||p_assignment_id,4);
10983: Hr_Utility.set_location('....Value of g_index : '||g_index_05,6);
10984: Hr_Utility.set_location('....Value of g_count : '||g_count_05,8);
10985: Hr_Utility.set_location('....Value of fetch code : '||p_fetch_code ,10);
10978:
10979: BEGIN
10980:
10981: Hr_Utility.set_location('Entering:------'||l_proc_name, 2);
10982: Hr_Utility.set_location('....Value of assignment id : '||p_assignment_id,4);
10983: Hr_Utility.set_location('....Value of g_index : '||g_index_05,6);
10984: Hr_Utility.set_location('....Value of g_count : '||g_count_05,8);
10985: Hr_Utility.set_location('....Value of fetch code : '||p_fetch_code ,10);
10986:
10979: BEGIN
10980:
10981: Hr_Utility.set_location('Entering:------'||l_proc_name, 2);
10982: Hr_Utility.set_location('....Value of assignment id : '||p_assignment_id,4);
10983: Hr_Utility.set_location('....Value of g_index : '||g_index_05,6);
10984: Hr_Utility.set_location('....Value of g_count : '||g_count_05,8);
10985: Hr_Utility.set_location('....Value of fetch code : '||p_fetch_code ,10);
10986:
10987: --
10980:
10981: Hr_Utility.set_location('Entering:------'||l_proc_name, 2);
10982: Hr_Utility.set_location('....Value of assignment id : '||p_assignment_id,4);
10983: Hr_Utility.set_location('....Value of g_index : '||g_index_05,6);
10984: Hr_Utility.set_location('....Value of g_count : '||g_count_05,8);
10985: Hr_Utility.set_location('....Value of fetch code : '||p_fetch_code ,10);
10986:
10987: --
10988: -- Derive the age of the employee
10981: Hr_Utility.set_location('Entering:------'||l_proc_name, 2);
10982: Hr_Utility.set_location('....Value of assignment id : '||p_assignment_id,4);
10983: Hr_Utility.set_location('....Value of g_index : '||g_index_05,6);
10984: Hr_Utility.set_location('....Value of g_count : '||g_count_05,8);
10985: Hr_Utility.set_location('....Value of fetch code : '||p_fetch_code ,10);
10986:
10987: --
10988: -- Derive the age of the employee
10989: --
10988: -- Derive the age of the employee
10989: --
10990: l_age := Get_Age(p_assignment_id,p_effective_date);
10991:
10992: Hr_Utility.set_location('....Value of l_age : '||l_age ,12);
10993:
10994: IF g_index_05 = 0
10995: AND p_fetch_code = 'NEW_ST'
10996: AND g_abp_processed_flag = 1 THEN
10994: IF g_index_05 = 0
10995: AND p_fetch_code = 'NEW_ST'
10996: AND g_abp_processed_flag = 1 THEN
10997:
10998: Hr_Utility.set_location('....Populating the PLSQL Table for the first time : ',12);
10999:
11000: g_count_05 := 0;
11001: l_rec_05_disp := 'N';
11002:
11013: l_value_num := fnd_number.canonical_to_number(l_value);
11014: l_value_num := l_value_num * 100;
11015: l_value := fnd_number.number_to_canonical(l_value_num);
11016:
11017: Hr_Utility.set_location('....Value of l_value : '||l_value ,14);
11018: Hr_Utility.set_location('....Value of l_kind : '||l_kind ,16);
11019:
11020: --
11021: -- Check if the EE assignment is a new hire and to be reported.
11014: l_value_num := l_value_num * 100;
11015: l_value := fnd_number.number_to_canonical(l_value_num);
11016:
11017: Hr_Utility.set_location('....Value of l_value : '||l_value ,14);
11018: Hr_Utility.set_location('....Value of l_kind : '||l_kind ,16);
11019:
11020: --
11021: -- Check if the EE assignment is a new hire and to be reported.
11022: --
11036:
11037: FETCH c_cur_ptp INTO l_ptp;
11038: IF c_cur_ptp%FOUND THEN
11039: l_ptp := l_ptp * 100;
11040: hr_utility.set_location('....Found PTP : '||l_ptp,28);
11041: ELSE
11042: l_ptp := 0;
11043: hr_utility.set_location('....Did not find PTP : '||l_ptp,28);
11044: END IF;
11039: l_ptp := l_ptp * 100;
11040: hr_utility.set_location('....Found PTP : '||l_ptp,28);
11041: ELSE
11042: l_ptp := 0;
11043: hr_utility.set_location('....Did not find PTP : '||l_ptp,28);
11044: END IF;
11045: CLOSE c_cur_ptp;
11046:
11047: -- 6501898 : For declarant new hires, check if PTP is entered in the current period
11087: --
11088: END IF;*/
11089: -- End of 6501898
11090:
11091: hr_utility.set_location('....Value of PTP is : '||l_ptp,28);
11092:
11093: END IF;
11094:
11095: Hr_Utility.set_location('....New hire flag is l_hired : '||l_hired ,18);
11091: hr_utility.set_location('....Value of PTP is : '||l_ptp,28);
11092:
11093: END IF;
11094:
11095: Hr_Utility.set_location('....New hire flag is l_hired : '||l_hired ,18);
11096:
11097: -- ==========================================================================
11098: -- BEGIN NEW HIRE PARTICIPATION REPORTING SECTION
11099: -- ==========================================================================
11240: -- Section 16 should contain the part time percentage.
11241: --
11242: IF g_retro_ptp_count > 0 THEN
11243:
11244: hr_utility.set_location('....Found retro entries for PTP elements: ',24);
11245: hr_utility.set_location('....Value of g_retro_ptp_count is : '||g_retro_ptp_count,22);
11246:
11247: FOR l_retro_ptp_index IN 1..g_retro_ptp_count
11248: LOOP
11241: --
11242: IF g_retro_ptp_count > 0 THEN
11243:
11244: hr_utility.set_location('....Found retro entries for PTP elements: ',24);
11245: hr_utility.set_location('....Value of g_retro_ptp_count is : '||g_retro_ptp_count,22);
11246:
11247: FOR l_retro_ptp_index IN 1..g_retro_ptp_count
11248: LOOP
11249: hr_utility.set_location('....Looping through retro PTP entries : '||i,24);
11245: hr_utility.set_location('....Value of g_retro_ptp_count is : '||g_retro_ptp_count,22);
11246:
11247: FOR l_retro_ptp_index IN 1..g_retro_ptp_count
11248: LOOP
11249: hr_utility.set_location('....Looping through retro PTP entries : '||i,24);
11250: g_rec05_rows(i).partn_kind := ' ';
11251: g_rec05_rows(i).partn_value := ' ';
11252: g_rec05_rows(i).end_reason := ' ';
11253: g_rec05_rows(i).ppp_kind := ' ';
11258: g_rec05_rows(i).new_start := NULL;
11259: g_rec05_rows(i).new_end := NULL;
11260: g_rec05_rows(i).dt_chg := fnd_date.date_to_canonical
11261: (l_rec_05_retro_ptp(l_retro_ptp_index).start_date);
11262: hr_utility.set_location('....Change date st : '||g_rec05_rows(i).dt_chg,24);
11263: IF l_rec_05_retro_ptp(l_retro_ptp_index).end_date >=
11264: trunc(g_extract_params(p_business_group_id).extract_end_date) THEN
11265: g_rec05_rows(i).eddt_chg := NULL;
11266: ELSE
11265: g_rec05_rows(i).eddt_chg := NULL;
11266: ELSE
11267: g_rec05_rows(i).eddt_chg := fnd_date.date_to_canonical(l_rec_05_retro_ptp(l_retro_ptp_index).end_date);
11268: END IF;
11269: hr_utility.set_location('....Change date End : '||g_rec05_rows(i).eddt_chg,24);
11270: g_rec05_rows(i).part_time_perc := l_rec_05_retro_ptp(l_retro_ptp_index).part_time_perc;
11271: hr_utility.set_location('....Changed PTP : '||g_rec05_rows(i).part_time_perc,24);
11272:
11273: i := i + 1;
11267: g_rec05_rows(i).eddt_chg := fnd_date.date_to_canonical(l_rec_05_retro_ptp(l_retro_ptp_index).end_date);
11268: END IF;
11269: hr_utility.set_location('....Change date End : '||g_rec05_rows(i).eddt_chg,24);
11270: g_rec05_rows(i).part_time_perc := l_rec_05_retro_ptp(l_retro_ptp_index).part_time_perc;
11271: hr_utility.set_location('....Changed PTP : '||g_rec05_rows(i).part_time_perc,24);
11272:
11273: i := i + 1;
11274:
11275: END LOOP;
11278: l_rec_05_retro_ptp.DELETE;
11279:
11280: END IF; -- Check if there are retro ptp chanegs to be reported
11281:
11282: hr_utility.set_location('....Completed Rec 05 Retro PTP Changes : ',24);
11283: -- ==========================================================================
11284: -- END RETRO CHANGE IN PART TIME PERCENTAGE SECTION
11285: -- ==========================================================================
11286:
11620:
11621: FOR hire_ptp_rec IN c_hire_ptp_chg (p_assignment_id) LOOP
11622:
11623: IF hire_ptp_rec.start_date > l_hire_date THEN
11624: hr_utility.set_location('....Start Date > Hire Date : ',24);
11625:
11626: IF hire_ptp_rec.ptp <> l_prior_ptp THEN
11627: hr_utility.set_location('....Inserting Rec 05 as PTP has changed : ',24);
11628: g_rec05_rows(i).partn_kind := ' ';
11623: IF hire_ptp_rec.start_date > l_hire_date THEN
11624: hr_utility.set_location('....Start Date > Hire Date : ',24);
11625:
11626: IF hire_ptp_rec.ptp <> l_prior_ptp THEN
11627: hr_utility.set_location('....Inserting Rec 05 as PTP has changed : ',24);
11628: g_rec05_rows(i).partn_kind := ' ';
11629: g_rec05_rows(i).partn_value := ' ';
11630: g_rec05_rows(i).end_reason := ' ';
11631: g_rec05_rows(i).ppp_kind := ' ';
11636: g_rec05_rows(i).new_start := NULL;
11637: g_rec05_rows(i).new_end := NULL;
11638: g_rec05_rows(i).dt_chg := fnd_date.date_to_canonical
11639: (hire_ptp_rec.start_date);
11640: hr_utility.set_location('....Start Date is : '||hire_ptp_rec.start_date,24);
11641: hr_utility.set_location('....End Date is : '||hire_ptp_rec.end_date,24);
11642:
11643: IF hire_ptp_rec.end_date >=
11644: trunc(g_extract_params(p_business_group_id).extract_end_date) THEN
11637: g_rec05_rows(i).new_end := NULL;
11638: g_rec05_rows(i).dt_chg := fnd_date.date_to_canonical
11639: (hire_ptp_rec.start_date);
11640: hr_utility.set_location('....Start Date is : '||hire_ptp_rec.start_date,24);
11641: hr_utility.set_location('....End Date is : '||hire_ptp_rec.end_date,24);
11642:
11643: IF hire_ptp_rec.end_date >=
11644: trunc(g_extract_params(p_business_group_id).extract_end_date) THEN
11645: g_rec05_rows(i).eddt_chg := NULL;
11647: g_rec05_rows(i).eddt_chg := fnd_date.date_to_canonical
11648: (hire_ptp_rec.end_date);
11649: END IF;
11650:
11651: hr_utility.set_location('....PTP is : '||hire_ptp_rec.ptp,24);
11652: g_rec05_rows(i).part_time_perc := hire_ptp_rec.ptp * 100;
11653: i := i + 1;
11654: g_count_05 := i;
11655: l_ptp_row_ins := 1;
11652: g_rec05_rows(i).part_time_perc := hire_ptp_rec.ptp * 100;
11653: i := i + 1;
11654: g_count_05 := i;
11655: l_ptp_row_ins := 1;
11656: hr_utility.set_location('....Value of i is : '||i,24);
11657: hr_utility.set_location('....Value of g_count_05 is : '||g_count_05,24);
11658:
11659: ELSIF hire_ptp_rec.ptp = l_prior_ptp AND l_ptp_row_ins = 1 THEN
11660: -- Assign the new end date to the prior row
11653: i := i + 1;
11654: g_count_05 := i;
11655: l_ptp_row_ins := 1;
11656: hr_utility.set_location('....Value of i is : '||i,24);
11657: hr_utility.set_location('....Value of g_count_05 is : '||g_count_05,24);
11658:
11659: ELSIF hire_ptp_rec.ptp = l_prior_ptp AND l_ptp_row_ins = 1 THEN
11660: -- Assign the new end date to the prior row
11661: hr_utility.set_location('....Inside the IF condition to update the end date: ',24);
11657: hr_utility.set_location('....Value of g_count_05 is : '||g_count_05,24);
11658:
11659: ELSIF hire_ptp_rec.ptp = l_prior_ptp AND l_ptp_row_ins = 1 THEN
11660: -- Assign the new end date to the prior row
11661: hr_utility.set_location('....Inside the IF condition to update the end date: ',24);
11662: hr_utility.set_location('....Ed Dt is : '||hire_ptp_rec.end_date,24);
11663:
11664: IF hire_ptp_rec.end_date >=
11665: trunc(g_extract_params(p_business_group_id).extract_end_date) THEN
11658:
11659: ELSIF hire_ptp_rec.ptp = l_prior_ptp AND l_ptp_row_ins = 1 THEN
11660: -- Assign the new end date to the prior row
11661: hr_utility.set_location('....Inside the IF condition to update the end date: ',24);
11662: hr_utility.set_location('....Ed Dt is : '||hire_ptp_rec.end_date,24);
11663:
11664: IF hire_ptp_rec.end_date >=
11665: trunc(g_extract_params(p_business_group_id).extract_end_date) THEN
11666: g_rec05_rows(i-1).eddt_chg := NULL;
11672: END IF;
11673:
11674: END IF;
11675: l_prior_ptp := hire_ptp_rec.ptp;
11676: hr_utility.set_location('....Value of l_prior_ptp is : '||l_prior_ptp,24);
11677:
11678: END LOOP;
11679:
11680: END IF; -- Check if the EE is a new hire
11687:
11688: IF g_count_05 > 0 THEN
11689:
11690: l_rec_05_disp := 'Y';
11691: Hr_Utility.set_location('----Old start date is : '||g_rec05_rows(g_index_05).old_start,88);
11692: Hr_Utility.set_location('----New start date is : '||g_rec05_rows(g_index_05).new_start,90);
11693: Hr_Utility.set_location('----Old end date is : '||g_rec05_rows(g_index_05).old_end,92);
11694: Hr_Utility.set_location('----New end date is : '||g_rec05_rows(g_index_05).new_end,94);
11695: Hr_Utility.set_location('----Kind of participation is : '||g_rec05_rows(g_index_05).partn_kind,96);
11688: IF g_count_05 > 0 THEN
11689:
11690: l_rec_05_disp := 'Y';
11691: Hr_Utility.set_location('----Old start date is : '||g_rec05_rows(g_index_05).old_start,88);
11692: Hr_Utility.set_location('----New start date is : '||g_rec05_rows(g_index_05).new_start,90);
11693: Hr_Utility.set_location('----Old end date is : '||g_rec05_rows(g_index_05).old_end,92);
11694: Hr_Utility.set_location('----New end date is : '||g_rec05_rows(g_index_05).new_end,94);
11695: Hr_Utility.set_location('----Kind of participation is : '||g_rec05_rows(g_index_05).partn_kind,96);
11696: Hr_Utility.set_location('----Value of participation is : '||g_rec05_rows(g_index_05).partn_value,98);
11689:
11690: l_rec_05_disp := 'Y';
11691: Hr_Utility.set_location('----Old start date is : '||g_rec05_rows(g_index_05).old_start,88);
11692: Hr_Utility.set_location('----New start date is : '||g_rec05_rows(g_index_05).new_start,90);
11693: Hr_Utility.set_location('----Old end date is : '||g_rec05_rows(g_index_05).old_end,92);
11694: Hr_Utility.set_location('----New end date is : '||g_rec05_rows(g_index_05).new_end,94);
11695: Hr_Utility.set_location('----Kind of participation is : '||g_rec05_rows(g_index_05).partn_kind,96);
11696: Hr_Utility.set_location('----Value of participation is : '||g_rec05_rows(g_index_05).partn_value,98);
11697: Hr_Utility.set_location('----Change start date is : '||g_rec05_rows(g_index_05).dt_chg,100);
11690: l_rec_05_disp := 'Y';
11691: Hr_Utility.set_location('----Old start date is : '||g_rec05_rows(g_index_05).old_start,88);
11692: Hr_Utility.set_location('----New start date is : '||g_rec05_rows(g_index_05).new_start,90);
11693: Hr_Utility.set_location('----Old end date is : '||g_rec05_rows(g_index_05).old_end,92);
11694: Hr_Utility.set_location('----New end date is : '||g_rec05_rows(g_index_05).new_end,94);
11695: Hr_Utility.set_location('----Kind of participation is : '||g_rec05_rows(g_index_05).partn_kind,96);
11696: Hr_Utility.set_location('----Value of participation is : '||g_rec05_rows(g_index_05).partn_value,98);
11697: Hr_Utility.set_location('----Change start date is : '||g_rec05_rows(g_index_05).dt_chg,100);
11698: Hr_Utility.set_location('----Change end date is : '||g_rec05_rows(g_index_05).eddt_chg,102);
11691: Hr_Utility.set_location('----Old start date is : '||g_rec05_rows(g_index_05).old_start,88);
11692: Hr_Utility.set_location('----New start date is : '||g_rec05_rows(g_index_05).new_start,90);
11693: Hr_Utility.set_location('----Old end date is : '||g_rec05_rows(g_index_05).old_end,92);
11694: Hr_Utility.set_location('----New end date is : '||g_rec05_rows(g_index_05).new_end,94);
11695: Hr_Utility.set_location('----Kind of participation is : '||g_rec05_rows(g_index_05).partn_kind,96);
11696: Hr_Utility.set_location('----Value of participation is : '||g_rec05_rows(g_index_05).partn_value,98);
11697: Hr_Utility.set_location('----Change start date is : '||g_rec05_rows(g_index_05).dt_chg,100);
11698: Hr_Utility.set_location('----Change end date is : '||g_rec05_rows(g_index_05).eddt_chg,102);
11699: Hr_Utility.set_location('----End reason is : '||g_rec05_rows(g_index_05).end_reason,104);
11692: Hr_Utility.set_location('----New start date is : '||g_rec05_rows(g_index_05).new_start,90);
11693: Hr_Utility.set_location('----Old end date is : '||g_rec05_rows(g_index_05).old_end,92);
11694: Hr_Utility.set_location('----New end date is : '||g_rec05_rows(g_index_05).new_end,94);
11695: Hr_Utility.set_location('----Kind of participation is : '||g_rec05_rows(g_index_05).partn_kind,96);
11696: Hr_Utility.set_location('----Value of participation is : '||g_rec05_rows(g_index_05).partn_value,98);
11697: Hr_Utility.set_location('----Change start date is : '||g_rec05_rows(g_index_05).dt_chg,100);
11698: Hr_Utility.set_location('----Change end date is : '||g_rec05_rows(g_index_05).eddt_chg,102);
11699: Hr_Utility.set_location('----End reason is : '||g_rec05_rows(g_index_05).end_reason,104);
11700: Hr_Utility.set_location('----Part Time Percent is : '||g_rec05_rows(g_index_05).part_time_perc,106);
11693: Hr_Utility.set_location('----Old end date is : '||g_rec05_rows(g_index_05).old_end,92);
11694: Hr_Utility.set_location('----New end date is : '||g_rec05_rows(g_index_05).new_end,94);
11695: Hr_Utility.set_location('----Kind of participation is : '||g_rec05_rows(g_index_05).partn_kind,96);
11696: Hr_Utility.set_location('----Value of participation is : '||g_rec05_rows(g_index_05).partn_value,98);
11697: Hr_Utility.set_location('----Change start date is : '||g_rec05_rows(g_index_05).dt_chg,100);
11698: Hr_Utility.set_location('----Change end date is : '||g_rec05_rows(g_index_05).eddt_chg,102);
11699: Hr_Utility.set_location('----End reason is : '||g_rec05_rows(g_index_05).end_reason,104);
11700: Hr_Utility.set_location('----Part Time Percent is : '||g_rec05_rows(g_index_05).part_time_perc,106);
11701:
11694: Hr_Utility.set_location('----New end date is : '||g_rec05_rows(g_index_05).new_end,94);
11695: Hr_Utility.set_location('----Kind of participation is : '||g_rec05_rows(g_index_05).partn_kind,96);
11696: Hr_Utility.set_location('----Value of participation is : '||g_rec05_rows(g_index_05).partn_value,98);
11697: Hr_Utility.set_location('----Change start date is : '||g_rec05_rows(g_index_05).dt_chg,100);
11698: Hr_Utility.set_location('----Change end date is : '||g_rec05_rows(g_index_05).eddt_chg,102);
11699: Hr_Utility.set_location('----End reason is : '||g_rec05_rows(g_index_05).end_reason,104);
11700: Hr_Utility.set_location('----Part Time Percent is : '||g_rec05_rows(g_index_05).part_time_perc,106);
11701:
11702: l_return_value := 0;
11695: Hr_Utility.set_location('----Kind of participation is : '||g_rec05_rows(g_index_05).partn_kind,96);
11696: Hr_Utility.set_location('----Value of participation is : '||g_rec05_rows(g_index_05).partn_value,98);
11697: Hr_Utility.set_location('----Change start date is : '||g_rec05_rows(g_index_05).dt_chg,100);
11698: Hr_Utility.set_location('----Change end date is : '||g_rec05_rows(g_index_05).eddt_chg,102);
11699: Hr_Utility.set_location('----End reason is : '||g_rec05_rows(g_index_05).end_reason,104);
11700: Hr_Utility.set_location('----Part Time Percent is : '||g_rec05_rows(g_index_05).part_time_perc,106);
11701:
11702: l_return_value := 0;
11703:
11696: Hr_Utility.set_location('----Value of participation is : '||g_rec05_rows(g_index_05).partn_value,98);
11697: Hr_Utility.set_location('----Change start date is : '||g_rec05_rows(g_index_05).dt_chg,100);
11698: Hr_Utility.set_location('----Change end date is : '||g_rec05_rows(g_index_05).eddt_chg,102);
11699: Hr_Utility.set_location('----End reason is : '||g_rec05_rows(g_index_05).end_reason,104);
11700: Hr_Utility.set_location('----Part Time Percent is : '||g_rec05_rows(g_index_05).part_time_perc,106);
11701:
11702: l_return_value := 0;
11703:
11704: --
11735: ELSIF p_fetch_code = 'P_KIND' THEN
11736: p_data_element_value := g_rec05_rows(g_index_05).partn_kind;
11737: ELSIF p_fetch_code = 'P_VALUE' THEN
11738: IF g_rec05_rows(g_index_05).partn_kind = 'WVP' THEN
11739: hr_utility.set_location('.... political leave',110);
11740: p_data_element_value := '0';
11741: ELSIF l_age >= 65 THEN
11742: hr_utility.set_location('....age => 65 ',110);
11743: IF g_rec05_rows(g_index_05).partn_value <> ' ' THEN
11738: IF g_rec05_rows(g_index_05).partn_kind = 'WVP' THEN
11739: hr_utility.set_location('.... political leave',110);
11740: p_data_element_value := '0';
11741: ELSIF l_age >= 65 THEN
11742: hr_utility.set_location('....age => 65 ',110);
11743: IF g_rec05_rows(g_index_05).partn_value <> ' ' THEN
11744: p_data_element_value := '0';
11745: ELSE
11746: p_data_element_value := ' ';
11746: p_data_element_value := ' ';
11747: END IF;
11748: ELSE
11749: p_data_element_value := g_rec05_rows(g_index_05).partn_value;
11750: hr_utility.set_location('....age < 65 and not on political leave',112);
11751: END IF;
11752: ELSIF p_fetch_code = 'DT_CHG' THEN
11753: p_data_element_value := g_rec05_rows(g_index_05).dt_chg;
11754: p_data_element_value := Ben_Ext_Fmt.apply_format_mask
11798: l_rec_05_disp := 'N';
11799: l_return_value := 0;
11800: END IF;
11801:
11802: Hr_Utility.set_location('....Final value of p_data_element_value is : '||p_data_element_value, 114);
11803: Hr_Utility.set_location('Leaving: '||l_proc_name, 116);
11804: Hr_Utility.set_location(' ', 118);
11805: l_return_value :=0;
11806:
11799: l_return_value := 0;
11800: END IF;
11801:
11802: Hr_Utility.set_location('....Final value of p_data_element_value is : '||p_data_element_value, 114);
11803: Hr_Utility.set_location('Leaving: '||l_proc_name, 116);
11804: Hr_Utility.set_location(' ', 118);
11805: l_return_value :=0;
11806:
11807: RETURN l_return_value;
11800: END IF;
11801:
11802: Hr_Utility.set_location('....Final value of p_data_element_value is : '||p_data_element_value, 114);
11803: Hr_Utility.set_location('Leaving: '||l_proc_name, 116);
11804: Hr_Utility.set_location(' ', 118);
11805: l_return_value :=0;
11806:
11807: RETURN l_return_value;
11808: EXCEPTION
11807: RETURN l_return_value;
11808: EXCEPTION
11809: WHEN Others THEN
11810: p_error_message :='SQL-ERRM :'||SQLERRM;
11811: Hr_Utility.set_location('..'||p_error_message,85);
11812: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
11813: RETURN l_return_value;
11814: END Get_Rec05_Participation;
11815:
11808: EXCEPTION
11809: WHEN Others THEN
11810: p_error_message :='SQL-ERRM :'||SQLERRM;
11811: Hr_Utility.set_location('..'||p_error_message,85);
11812: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
11813: RETURN l_return_value;
11814: END Get_Rec05_Participation;
11815:
11816: --============================================================================
11977: l_end_date Date;
11978:
11979:
11980: BEGIN
11981: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
11982: --check the index and the code and calculate the value accordingly
11983: Hr_Utility.set_location('value of g_index : '||g_index_ipap,7);
11984: Hr_Utility.set_location('value of fetch code : '||p_fetch_code ,10);
11985: IF g_index_ipap = 0 AND p_fetch_code = 'NEW_ST' THEN
11979:
11980: BEGIN
11981: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
11982: --check the index and the code and calculate the value accordingly
11983: Hr_Utility.set_location('value of g_index : '||g_index_ipap,7);
11984: Hr_Utility.set_location('value of fetch code : '||p_fetch_code ,10);
11985: IF g_index_ipap = 0 AND p_fetch_code = 'NEW_ST' THEN
11986: g_count_ipap := 0;
11987:
11980: BEGIN
11981: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
11982: --check the index and the code and calculate the value accordingly
11983: Hr_Utility.set_location('value of g_index : '||g_index_ipap,7);
11984: Hr_Utility.set_location('value of fetch code : '||p_fetch_code ,10);
11985: IF g_index_ipap = 0 AND p_fetch_code = 'NEW_ST' THEN
11986: g_count_ipap := 0;
11987:
11988: OPEN c_hire_dt;
11996: OPEN c_asg_rows_exist;
11997: FETCH c_asg_rows_exist INTO l_asg_rows_exist;
11998: IF c_asg_rows_exist%FOUND THEN
11999: CLOSE c_asg_rows_exist;
12000: Hr_Utility.set_location('found rows at the assignment eit level',15);
12001: --now fetch the rows from the log table
12002: FOR asg_rec IN c_get_asg_rows
12003: LOOP
12004: IF asg_rec.old_val1 IS NOT NULL THEN
12033: END IF;
12034: i := i + 1;
12035: END LOOP;
12036: g_count_ipap := i;
12037: Hr_Utility.set_location('count of rows : '||g_count_ipap,20);
12038: ELSE
12039: CLOSE c_asg_rows_exist;
12040: --go up the org hierarchy to find the rows at some org eit level
12041: -- find the org the assignment is attached to
12077: l_loop_again := 1;
12078: WHILE (l_loop_again = 1)
12079:
12080: LOOP
12081: Hr_Utility.set_location('searching at org level : '||l_org_id,25);
12082: OPEN c_org_rows_exist(l_org_id);
12083: FETCH c_org_rows_exist INTO l_org_rows_exist;
12084: IF c_org_rows_exist%FOUND THEN
12085: CLOSE c_org_rows_exist;
12115: g_ipap_dates(i).old_end := '';
12116: g_ipap_dates(i).new_end := '';
12117: END IF;
12118: IF l_hired = 1 THEN
12119: Hr_Utility.set_location('hire date : '||l_hire_date,99);
12120: Hr_Utility.set_location('new date : '||g_ipap_dates(i).new_start,100);
12121: Hr_Utility.set_location('greater date : '||Fnd_Date.date_to_canonical(Greatest(
12122: l_hire_date,Fnd_Date.canonical_to_date(g_ipap_dates(i).new_start))),101);
12123: IF g_ipap_dates(i).new_start IS NOT NULL THEN
12116: g_ipap_dates(i).new_end := '';
12117: END IF;
12118: IF l_hired = 1 THEN
12119: Hr_Utility.set_location('hire date : '||l_hire_date,99);
12120: Hr_Utility.set_location('new date : '||g_ipap_dates(i).new_start,100);
12121: Hr_Utility.set_location('greater date : '||Fnd_Date.date_to_canonical(Greatest(
12122: l_hire_date,Fnd_Date.canonical_to_date(g_ipap_dates(i).new_start))),101);
12123: IF g_ipap_dates(i).new_start IS NOT NULL THEN
12124: Hr_Utility.set_location('chking the new start date',102);
12117: END IF;
12118: IF l_hired = 1 THEN
12119: Hr_Utility.set_location('hire date : '||l_hire_date,99);
12120: Hr_Utility.set_location('new date : '||g_ipap_dates(i).new_start,100);
12121: Hr_Utility.set_location('greater date : '||Fnd_Date.date_to_canonical(Greatest(
12122: l_hire_date,Fnd_Date.canonical_to_date(g_ipap_dates(i).new_start))),101);
12123: IF g_ipap_dates(i).new_start IS NOT NULL THEN
12124: Hr_Utility.set_location('chking the new start date',102);
12125: g_ipap_dates(i).new_start := Fnd_Date.date_to_canonical(Greatest(
12120: Hr_Utility.set_location('new date : '||g_ipap_dates(i).new_start,100);
12121: Hr_Utility.set_location('greater date : '||Fnd_Date.date_to_canonical(Greatest(
12122: l_hire_date,Fnd_Date.canonical_to_date(g_ipap_dates(i).new_start))),101);
12123: IF g_ipap_dates(i).new_start IS NOT NULL THEN
12124: Hr_Utility.set_location('chking the new start date',102);
12125: g_ipap_dates(i).new_start := Fnd_Date.date_to_canonical(Greatest(
12126: l_hire_date,Fnd_Date.canonical_to_date(g_ipap_dates(i).new_start)));
12127: Hr_Utility.set_location('new start date is : '||g_ipap_dates(i).new_start,103);
12128: END IF;
12123: IF g_ipap_dates(i).new_start IS NOT NULL THEN
12124: Hr_Utility.set_location('chking the new start date',102);
12125: g_ipap_dates(i).new_start := Fnd_Date.date_to_canonical(Greatest(
12126: l_hire_date,Fnd_Date.canonical_to_date(g_ipap_dates(i).new_start)));
12127: Hr_Utility.set_location('new start date is : '||g_ipap_dates(i).new_start,103);
12128: END IF;
12129: IF g_ipap_dates(i).old_start IS NOT NULL THEN
12130: g_ipap_dates(i).old_start := Fnd_Date.date_to_canonical(Greatest(
12131: l_hire_date,Fnd_Date.canonical_to_date(g_ipap_dates(i).old_start)));
12137:
12138: i := i + 1;
12139: END LOOP;
12140: g_count_ipap := i;
12141: Hr_Utility.set_location('value for g count : '||g_count_ipap,30);
12142: l_loop_again := 0;
12143: ELSE
12144: --search at the parent level next
12145: CLOSE c_org_rows_exist;
12189: END IF;
12190: END IF;
12191:
12192: IF g_count_ipap > 0 THEN
12193: Hr_Utility.set_location('old st date : '||g_ipap_dates(g_index_ipap).old_start,40);
12194: Hr_Utility.set_location('new st date : '||g_ipap_dates(g_index_ipap).new_start,45);
12195: Hr_Utility.set_location('old ed date : '||g_ipap_dates(g_index_ipap).old_end,50);
12196: Hr_Utility.set_location('new ed date : '||g_ipap_dates(g_index_ipap).new_end,55);
12197: l_return_value := 0;
12190: END IF;
12191:
12192: IF g_count_ipap > 0 THEN
12193: Hr_Utility.set_location('old st date : '||g_ipap_dates(g_index_ipap).old_start,40);
12194: Hr_Utility.set_location('new st date : '||g_ipap_dates(g_index_ipap).new_start,45);
12195: Hr_Utility.set_location('old ed date : '||g_ipap_dates(g_index_ipap).old_end,50);
12196: Hr_Utility.set_location('new ed date : '||g_ipap_dates(g_index_ipap).new_end,55);
12197: l_return_value := 0;
12198: --depending on the fetch code ,set the data element value
12191:
12192: IF g_count_ipap > 0 THEN
12193: Hr_Utility.set_location('old st date : '||g_ipap_dates(g_index_ipap).old_start,40);
12194: Hr_Utility.set_location('new st date : '||g_ipap_dates(g_index_ipap).new_start,45);
12195: Hr_Utility.set_location('old ed date : '||g_ipap_dates(g_index_ipap).old_end,50);
12196: Hr_Utility.set_location('new ed date : '||g_ipap_dates(g_index_ipap).new_end,55);
12197: l_return_value := 0;
12198: --depending on the fetch code ,set the data element value
12199: IF p_fetch_code = 'NEW_ST' THEN
12192: IF g_count_ipap > 0 THEN
12193: Hr_Utility.set_location('old st date : '||g_ipap_dates(g_index_ipap).old_start,40);
12194: Hr_Utility.set_location('new st date : '||g_ipap_dates(g_index_ipap).new_start,45);
12195: Hr_Utility.set_location('old ed date : '||g_ipap_dates(g_index_ipap).old_end,50);
12196: Hr_Utility.set_location('new ed date : '||g_ipap_dates(g_index_ipap).new_end,55);
12197: l_return_value := 0;
12198: --depending on the fetch code ,set the data element value
12199: IF p_fetch_code = 'NEW_ST' THEN
12200: p_data_element_value := g_ipap_dates(g_index_ipap).new_start;
12215: p_data_element_value := '';
12216: l_return_value := 1;
12217: END IF;
12218:
12219: Hr_Utility.set_location('p_data_element_value: '||p_data_element_value, 70);
12220: Hr_Utility.set_location('Leaving: '||l_proc_name, 80);
12221:
12222: l_return_value :=0;
12223: RETURN l_return_value;
12216: l_return_value := 1;
12217: END IF;
12218:
12219: Hr_Utility.set_location('p_data_element_value: '||p_data_element_value, 70);
12220: Hr_Utility.set_location('Leaving: '||l_proc_name, 80);
12221:
12222: l_return_value :=0;
12223: RETURN l_return_value;
12224: EXCEPTION
12223: RETURN l_return_value;
12224: EXCEPTION
12225: WHEN Others THEN
12226: p_error_message :='SQL-ERRM :'||SQLERRM;
12227: Hr_Utility.set_location('..'||p_error_message,85);
12228: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
12229: RETURN l_return_value;
12230: END get_ipap_participation_dates;
12231:
12224: EXCEPTION
12225: WHEN Others THEN
12226: p_error_message :='SQL-ERRM :'||SQLERRM;
12227: Hr_Utility.set_location('..'||p_error_message,85);
12228: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
12229: RETURN l_return_value;
12230: END get_ipap_participation_dates;
12231:
12232: -- =============================================================================
12245: l_return_value Number :=0;
12246: l_data_element_value Varchar2(2);
12247:
12248: BEGIN
12249: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
12250: Hr_Utility.set_location('..p_record_num : '||p_record_num , 6);
12251: IF p_record_num = '01' THEN
12252: l_return_value := Record01_Display_Criteria
12253: (p_assignment_id => p_assignment_id
12246: l_data_element_value Varchar2(2);
12247:
12248: BEGIN
12249: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
12250: Hr_Utility.set_location('..p_record_num : '||p_record_num , 6);
12251: IF p_record_num = '01' THEN
12252: l_return_value := Record01_Display_Criteria
12253: (p_assignment_id => p_assignment_id
12254: ,p_business_group_id => p_business_group_id
12367:
12368: ELSE
12369: l_data_element_value := 'N';
12370: END IF;
12371: Hr_Utility.set_location('..l_data_element_value: '||l_data_element_value,45);
12372: Hr_Utility.set_location('Leaving: '||l_proc_name, 50);
12373: RETURN l_data_element_value;
12374: EXCEPTION
12375: WHEN Others THEN
12368: ELSE
12369: l_data_element_value := 'N';
12370: END IF;
12371: Hr_Utility.set_location('..l_data_element_value: '||l_data_element_value,45);
12372: Hr_Utility.set_location('Leaving: '||l_proc_name, 50);
12373: RETURN l_data_element_value;
12374: EXCEPTION
12375: WHEN Others THEN
12376: p_error_message :='SQL-ERRM :'||SQLERRM;
12373: RETURN l_data_element_value;
12374: EXCEPTION
12375: WHEN Others THEN
12376: p_error_message :='SQL-ERRM :'||SQLERRM;
12377: Hr_Utility.set_location('..'||p_error_message,85);
12378: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
12379: RETURN l_return_value;
12380:
12381: END Chk_If_Req_ToExtract;
12374: EXCEPTION
12375: WHEN Others THEN
12376: p_error_message :='SQL-ERRM :'||SQLERRM;
12377: Hr_Utility.set_location('..'||p_error_message,85);
12378: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
12379: RETURN l_return_value;
12380:
12381: END Chk_If_Req_ToExtract;
12382:
12446:
12447: EXCEPTION
12448: WHEN Others THEN
12449: p_error_message :='SQL-ERRM :'||SQLERRM;
12450: Hr_Utility.set_location('..'||p_error_message,85);
12451: RETURN l_return_value;
12452: END Process_Mult_Rec05;
12453:
12454: --=============================================================================
12525: l_seq_num VARCHAR2(2);
12526:
12527: BEGIN
12528:
12529: Hr_Utility.set_location(' Entering ' || l_proc_name , 10);
12530: --
12531: -- Create Record 08 for an EE assignment if the assignment
12532: -- is a late hire across years. For e.g. hired in 2006 but
12533: -- the first payroll is processed in 2007
12713: FETCH c_hire_dt_chg INTO l_old_date_can,l_new_date_can;
12714: IF c_hire_dt_chg%FOUND THEN
12715: l_old_hire_dt := to_nl_date(l_old_date_can,'DD-MM-RRRR');
12716: l_new_hire_dt := to_nl_date(l_new_date_can,'DD-MM-RRRR');
12717: Hr_Utility.set_location(' Change in hire date found ' || l_proc_name , 10);
12718:
12719: IF to_number(to_char(l_new_hire_dt,'YYYY'))
12720: < to_number(to_char(l_old_hire_dt,'YYYY')) THEN
12721: Hr_Utility.set_location(' Years are different ' || l_proc_name , 10);
12717: Hr_Utility.set_location(' Change in hire date found ' || l_proc_name , 10);
12718:
12719: IF to_number(to_char(l_new_hire_dt,'YYYY'))
12720: < to_number(to_char(l_old_hire_dt,'YYYY')) THEN
12721: Hr_Utility.set_location(' Years are different ' || l_proc_name , 10);
12722:
12723: OPEN or_pen_sal (l_new_hire_dt);
12724: FETCH or_pen_sal INTO l_or_pen_sal;
12725: IF or_pen_sal%FOUND THEN
12722:
12723: OPEN or_pen_sal (l_new_hire_dt);
12724: FETCH or_pen_sal INTO l_or_pen_sal;
12725: IF or_pen_sal%FOUND THEN
12726: Hr_Utility.set_location(' Pension sal found are diff ' || l_proc_name , 10);
12727: OPEN c_get_rcd_id(7);
12728: FETCH c_get_rcd_id INTO l_rcd_id;
12729: CLOSE c_get_rcd_id;
12730:
12809: END IF;
12810:
12811: CLOSE c_hire_dt_chg;
12812:
12813: Hr_Utility.set_location(' Leaving '||l_proc_name , 15);
12814:
12815: RETURN l_ret_val;
12816:
12817: EXCEPTION
12816:
12817: EXCEPTION
12818: WHEN Others THEN
12819: p_error_message :='SQL-ERRM :'||SQLERRM;
12820: Hr_Utility.set_location('..'||p_error_message,85);
12821: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
12822: RETURN -1;
12823: END Process_Mult_Rec08;
12824:
12817: EXCEPTION
12818: WHEN Others THEN
12819: p_error_message :='SQL-ERRM :'||SQLERRM;
12820: Hr_Utility.set_location('..'||p_error_message,85);
12821: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
12822: RETURN -1;
12823: END Process_Mult_Rec08;
12824:
12825: -- =============================================================================
12841: l_main_rec csr_rslt_dtl%ROWTYPE;
12842: l_new_rec csr_rslt_dtl%ROWTYPE;
12843:
12844: BEGIN
12845: Hr_Utility.set_location(' Entering ' || l_proc_name , 10);
12846:
12847: IF l_rec_09_values.Count > 0 THEN
12848:
12849: --Fetch the record id from the sequence number
12879: END IF;
12880: l_rec_09_disp := 'N';
12881: l_ret_val := 0;
12882:
12883: Hr_Utility.set_location(' Leaving '||l_proc_name , 15);
12884:
12885: RETURN l_ret_val;
12886: EXCEPTION
12887: WHEN Others THEN
12885: RETURN l_ret_val;
12886: EXCEPTION
12887: WHEN Others THEN
12888: p_error_message :='SQL-ERRM :'||SQLERRM;
12889: Hr_Utility.set_location('..'||p_error_message,85);
12890: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
12891: RETURN -1;
12892: END Process_Mult_Rec09;
12893:
12886: EXCEPTION
12887: WHEN Others THEN
12888: p_error_message :='SQL-ERRM :'||SQLERRM;
12889: Hr_Utility.set_location('..'||p_error_message,85);
12890: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
12891: RETURN -1;
12892: END Process_Mult_Rec09;
12893:
12894: -- =============================================================================
12913: l_new_rec csr_rslt_dtl%ROWTYPE;
12914:
12915: BEGIN
12916:
12917: Hr_Utility.set_location(' Entering ' || l_proc_name , 10);
12918: hr_utility.set_location('asg : '||p_assignment_id||'count : '||l_rec_12_values.Count,12);
12919:
12920: IF l_rec_12_values.Count > 0 THEN
12921: --fetch the record id from the sequence number
12914:
12915: BEGIN
12916:
12917: Hr_Utility.set_location(' Entering ' || l_proc_name , 10);
12918: hr_utility.set_location('asg : '||p_assignment_id||'count : '||l_rec_12_values.Count,12);
12919:
12920: IF l_rec_12_values.Count > 0 THEN
12921: --fetch the record id from the sequence number
12922: OPEN c_get_rcd_id(10);
12936: l_new_rec := l_main_rec;
12937: l_index := l_rec_12_values.LAST;
12938: FOR i IN 1..l_index
12939: LOOP
12940: hr_utility.set_location('counts : '||i||'----'||l_index,15);
12941: IF l_rec_12_values.EXISTS(i) THEN
12942: Process_Ext_Rslt_Dtl_Rec
12943: (p_assignment_id => p_assignment_id
12944: ,p_effective_date => p_effective_date
12952: END IF;
12953: l_rec_12_disp := 'N';
12954: l_ret_val := 0;
12955:
12956: Hr_Utility.set_location(' Leaving '||l_proc_name , 15);
12957:
12958: RETURN l_ret_val;
12959:
12960: EXCEPTION
12959:
12960: EXCEPTION
12961: WHEN Others THEN
12962: p_error_message :='SQL-ERRM :'||SQLERRM;
12963: Hr_Utility.set_location('..'||p_error_message,85);
12964: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
12965: RETURN l_ret_val;
12966: END Process_Mult_Rec12;
12967:
12960: EXCEPTION
12961: WHEN Others THEN
12962: p_error_message :='SQL-ERRM :'||SQLERRM;
12963: Hr_Utility.set_location('..'||p_error_message,85);
12964: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
12965: RETURN l_ret_val;
12966: END Process_Mult_Rec12;
12967:
12968: --============================================================================
12985: RETURN l_return_value;
12986: EXCEPTION
12987: WHEN Others THEN
12988: p_error_message :='SQL-ERRM :'||SQLERRM;
12989: Hr_Utility.set_location('..'||p_error_message,85);
12990: RETURN l_return_value;
12991: END Process_Mult_Rec20;
12992:
12993: ---------------------------------------------------------------------------
13007:
13008: EXCEPTION
13009: WHEN Others THEN
13010: p_error_message :='SQL-ERRM :'||SQLERRM;
13011: Hr_Utility.set_location('..'||p_error_message,85);
13012: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 15);
13013: RETURN -1;
13014: END Process_Mult_Rec21;
13015:
13008: EXCEPTION
13009: WHEN Others THEN
13010: p_error_message :='SQL-ERRM :'||SQLERRM;
13011: Hr_Utility.set_location('..'||p_error_message,85);
13012: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 15);
13013: RETURN -1;
13014: END Process_Mult_Rec21;
13015:
13016: ---------------------------------------------------------------------------
13024: l_return_value Number := 0;
13025: l_proc_name Varchar2(80) := 'Process_Mult_Rec22';
13026:
13027: BEGIN
13028: Hr_Utility.set_location('Entering: '||l_proc_name, 15);
13029: RETURN 0;
13030: Hr_Utility.set_location('Leaving: '||l_proc_name, 15);
13031:
13032: EXCEPTION
13026:
13027: BEGIN
13028: Hr_Utility.set_location('Entering: '||l_proc_name, 15);
13029: RETURN 0;
13030: Hr_Utility.set_location('Leaving: '||l_proc_name, 15);
13031:
13032: EXCEPTION
13033: WHEN Others THEN
13034: p_error_message :='SQL-ERRM :'||SQLERRM;
13031:
13032: EXCEPTION
13033: WHEN Others THEN
13034: p_error_message :='SQL-ERRM :'||SQLERRM;
13035: Hr_Utility.set_location('..'||p_error_message,85);
13036: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 15);
13037: RETURN -1;
13038: END Process_Mult_Rec22;
13039:
13032: EXCEPTION
13033: WHEN Others THEN
13034: p_error_message :='SQL-ERRM :'||SQLERRM;
13035: Hr_Utility.set_location('..'||p_error_message,85);
13036: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 15);
13037: RETURN -1;
13038: END Process_Mult_Rec22;
13039:
13040: --============================================================================
13092: RETURN l_return_value;
13093: EXCEPTION
13094: WHEN Others THEN
13095: p_error_message :='SQL-ERRM :'||SQLERRM;
13096: Hr_Utility.set_location('..'||p_error_message,85);
13097: -- hr_utility.set_location('Leaving: '||l_proc_name, 90);
13098: RETURN l_return_value;
13099: END Process_Mult_Rec30;
13100:
13093: EXCEPTION
13094: WHEN Others THEN
13095: p_error_message :='SQL-ERRM :'||SQLERRM;
13096: Hr_Utility.set_location('..'||p_error_message,85);
13097: -- hr_utility.set_location('Leaving: '||l_proc_name, 90);
13098: RETURN l_return_value;
13099: END Process_Mult_Rec30;
13100:
13101: --=============================================================================
13155: END IF;
13156: l_rec_31_disp := 'N';
13157: l_ret_val := 0;
13158:
13159: Hr_Utility.set_location(' Leaving '||l_proc_name , 15);
13160:
13161: RETURN l_ret_val;
13162:
13163: END Process_Mult_Rec31;
13226: RETURN l_return_value;
13227: EXCEPTION
13228: WHEN Others THEN
13229: p_error_message :='SQL-ERRM :'||SQLERRM;
13230: Hr_Utility.set_location('..'||p_error_message,85);
13231: -- hr_utility.set_location('Leaving: '||l_proc_name, 90);
13232: RETURN l_return_value;
13233: END Process_Mult_Rec40;
13234:
13227: EXCEPTION
13228: WHEN Others THEN
13229: p_error_message :='SQL-ERRM :'||SQLERRM;
13230: Hr_Utility.set_location('..'||p_error_message,85);
13231: -- hr_utility.set_location('Leaving: '||l_proc_name, 90);
13232: RETURN l_return_value;
13233: END Process_Mult_Rec40;
13234:
13235: --=============================================================================
13331: l_ret_val := 0;
13332:
13333: END IF;
13334:
13335: Hr_Utility.set_location(' Leaving '||l_proc_name , 15);
13336:
13337: RETURN l_ret_val;
13338:
13339: END Process_Mult_Rec41;
13378:
13379: BEGIN
13380:
13381: --find the defined balance id for the FUR Standard EE Contribution for the _ASG_PTD dimension
13382: Hr_Utility.set_location('Entering : '||l_proc,10);
13383: OPEN csr_defined_bal(c_balance_name => 'FUR Standard EE Contribution'
13384: ,c_dimension_name => 'Assignment Period To Date'
13385: ,c_business_group_id => p_business_group_id
13386: );
13386: );
13387: FETCH csr_defined_bal INTO l_defined_balance_id;
13388: IF csr_defined_bal%FOUND THEN
13389: CLOSE csr_defined_bal;
13390: Hr_Utility.set_location('found defined balance id : '||l_defined_balance_id,20);
13391: --Find the assignment action of the payroll run if any FUR Pensions has been processed and
13392: --if the date earned for that payroll run , is between the extract start and end dates
13393: OPEN c_run_results_exist;
13394: FETCH c_run_results_exist INTO l_asg_act_id;
13395: IF c_run_results_exist%FOUND THEN
13396: --assignment action id has been found, now find the value for the EE contribution
13397: --from the dimension _ASG_PTD
13398: CLOSE c_run_results_exist;
13399: Hr_Utility.set_location('found asg action id : '||l_asg_act_id,30);
13400: --from the assignment action id,and defined balance id fetched above , find the balance value
13401: p_data_element_value := Fnd_Number.number_to_canonical(
13402: Pay_Balance_Pkg.get_value(p_defined_balance_id => l_defined_balance_id
13403: ,p_assignment_action_id => l_asg_act_id
13401: p_data_element_value := Fnd_Number.number_to_canonical(
13402: Pay_Balance_Pkg.get_value(p_defined_balance_id => l_defined_balance_id
13403: ,p_assignment_action_id => l_asg_act_id
13404: ));
13405: Hr_Utility.set_location('found value for the contribution as : '||p_data_element_value,40);
13406: g_fur_contribution := Fnd_Number.canonical_to_number(p_data_element_value);
13407: RETURN 0;
13408: ELSE
13409: CLOSE c_run_results_exist;
13406: g_fur_contribution := Fnd_Number.canonical_to_number(p_data_element_value);
13407: RETURN 0;
13408: ELSE
13409: CLOSE c_run_results_exist;
13410: Hr_Utility.set_location('could not find the asg action id',50);
13411: p_data_element_value := '';
13412: p_error_message := 'Could not find a value for the Contribution amount towards FUR Pensions.';
13413: RETURN 1;
13414: END IF;
13413: RETURN 1;
13414: END IF;
13415: ELSE
13416: CLOSE csr_defined_bal;
13417: Hr_Utility.set_location('could not find the defined balance id',60);
13418: p_data_element_value := '';
13419: p_error_message := 'Could not find the defined balance id for the contribution balance.';
13420: RETURN 1;
13421: END IF;
13422:
13423: EXCEPTION
13424: WHEN Others THEN
13425: p_error_message :='SQL-ERRM :'||SQLERRM;
13426: Hr_Utility.set_location('..'||p_error_message,70);
13427: RETURN 1;
13428: END get_fur_contribution_amt;
13429:
13430: --============================================================================
13467:
13468:
13469: BEGIN
13470:
13471: Hr_Utility.set_location('sub category is : '||p_sub_cat,10);
13472: OPEN c_run_results_exist;
13473: FETCH c_run_results_exist INTO l_asg_act_id,l_scheme_prefix;
13474: IF c_run_results_exist%FOUND THEN
13475: CLOSE c_run_results_exist;
13473: FETCH c_run_results_exist INTO l_asg_act_id,l_scheme_prefix;
13474: IF c_run_results_exist%FOUND THEN
13475: CLOSE c_run_results_exist;
13476: --find the defined balance id for the Pension Basis balance for the _ASG_RUN dimension
13477: Hr_Utility.set_location('Entering : '||l_proc,10);
13478: Hr_Utility.set_location('asg act id : '||l_asg_act_id,15);
13479: Hr_Utility.set_location('scheme prefix : '||l_scheme_prefix,20);
13480: OPEN csr_defined_bal(c_balance_name => l_scheme_prefix||' Employee Pension Basis'
13481: ,c_dimension_name => 'Assignment Run'
13474: IF c_run_results_exist%FOUND THEN
13475: CLOSE c_run_results_exist;
13476: --find the defined balance id for the Pension Basis balance for the _ASG_RUN dimension
13477: Hr_Utility.set_location('Entering : '||l_proc,10);
13478: Hr_Utility.set_location('asg act id : '||l_asg_act_id,15);
13479: Hr_Utility.set_location('scheme prefix : '||l_scheme_prefix,20);
13480: OPEN csr_defined_bal(c_balance_name => l_scheme_prefix||' Employee Pension Basis'
13481: ,c_dimension_name => 'Assignment Run'
13482: ,c_business_group_id => p_business_group_id
13475: CLOSE c_run_results_exist;
13476: --find the defined balance id for the Pension Basis balance for the _ASG_RUN dimension
13477: Hr_Utility.set_location('Entering : '||l_proc,10);
13478: Hr_Utility.set_location('asg act id : '||l_asg_act_id,15);
13479: Hr_Utility.set_location('scheme prefix : '||l_scheme_prefix,20);
13480: OPEN csr_defined_bal(c_balance_name => l_scheme_prefix||' Employee Pension Basis'
13481: ,c_dimension_name => 'Assignment Run'
13482: ,c_business_group_id => p_business_group_id
13483: );
13483: );
13484: FETCH csr_defined_bal INTO l_defined_balance_id;
13485: IF csr_defined_bal%FOUND THEN
13486: CLOSE csr_defined_bal;
13487: Hr_Utility.set_location('found defined balance id : '||l_defined_balance_id,20);
13488: --from the assignment action id,and defined balance id fetched above , find the balance value
13489: p_data_element_value := Fnd_Number.number_to_canonical(
13490: Pay_Balance_Pkg.get_value(p_defined_balance_id => l_defined_balance_id
13491: ,p_assignment_action_id => l_asg_act_id
13489: p_data_element_value := Fnd_Number.number_to_canonical(
13490: Pay_Balance_Pkg.get_value(p_defined_balance_id => l_defined_balance_id
13491: ,p_assignment_action_id => l_asg_act_id
13492: ));
13493: Hr_Utility.set_location('found value for the contribution as : '||p_data_element_value,40);
13494: IF p_sub_cat = 'FUR_S' THEN
13495: g_fur_contribution := Fnd_Number.canonical_to_number(p_data_element_value);
13496: RETURN 0;
13497: ELSIF p_sub_cat = 'IPAP' THEN
13499: RETURN 0;
13500: END IF;
13501: ELSE
13502: CLOSE csr_defined_bal;
13503: Hr_Utility.set_location('could not find the defined balance id',60);
13504: p_data_element_value := '';
13505: p_error_message := 'Could not find the defined balance id for the contribution balance.';
13506: RETURN 1;
13507: END IF;
13506: RETURN 1;
13507: END IF;
13508: ELSE
13509: CLOSE c_run_results_exist;
13510: Hr_Utility.set_location('Employee does not contribute towards pensions ',65);
13511: p_data_element_value := '';
13512: p_error_message := 'Could not find run results.';
13513: RETURN 1;
13514: END IF;
13515:
13516: EXCEPTION
13517: WHEN Others THEN
13518: p_error_message :='SQL-ERRM :'||SQLERRM;
13519: Hr_Utility.set_location('..'||p_error_message,70);
13520: RETURN 1;
13521: END get_contribution_basis;
13522:
13523: -- =============================================================================
13538: j Number ;
13539:
13540: BEGIN
13541:
13542: Hr_Utility.set_location(' Entering : ' || l_proc_name , 10);
13543: IF p_record_number = 9 THEN
13544: IF l_rec_09_values.count > 0 THEN
13545: j := l_rec_09_values.FIRST;
13546: IF l_rec_09_values.EXISTS(j) THEN
13565: END IF;
13566: END IF;
13567: END IF;
13568:
13569: Hr_Utility.set_location(' Leaving : ' || l_proc_name , 80);
13570:
13571: RETURN 0 ;
13572:
13573: EXCEPTION
13572:
13573: EXCEPTION
13574: WHEN Others THEN
13575: p_error_message :='SQL-ERRM :'||SQLERRM;
13576: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
13577: RETURN -1 ;
13578: END Get_Basis_Amt;
13579:
13580: -- =============================================================================
13593: j Number ;
13594:
13595: BEGIN
13596:
13597: Hr_Utility.set_location(' Entering : ' || l_proc_name , 10);
13598: IF l_rec_09_values.count > 0 THEN
13599: j := l_rec_09_values.FIRST;
13600: IF l_rec_09_values.EXISTS(j) THEN
13601: p_data_element_value := l_rec_09_values(j).code;
13601: p_data_element_value := l_rec_09_values(j).code;
13602: END IF;
13603: END IF;
13604:
13605: Hr_Utility.set_location(' Leaving : ' || l_proc_name , 80);
13606:
13607: RETURN 0 ;
13608:
13609: EXCEPTION
13608:
13609: EXCEPTION
13610: WHEN Others THEN
13611: p_error_message :='SQL-ERRM :'||SQLERRM;
13612: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
13613: RETURN -1 ;
13614: END Get_Sub_Cat_09;
13615:
13616: -- =============================================================================
13630: j Number ;
13631:
13632: BEGIN
13633:
13634: Hr_Utility.set_location(' Entering : ' || l_proc_name , 10);
13635: IF p_record_number = 9 THEN
13636: IF l_rec_09_values.count > 0 THEN
13637: j := l_rec_09_values.FIRST;
13638: IF l_rec_09_values.EXISTS(j) THEN
13654: END IF;
13655: END IF;
13656: END IF;
13657:
13658: Hr_Utility.set_location(' Leaving : ' || l_proc_name , 80);
13659:
13660: RETURN 0 ;
13661:
13662: EXCEPTION
13661:
13662: EXCEPTION
13663: WHEN Others THEN
13664: p_error_message :='SQL-ERRM :'||SQLERRM;
13665: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
13666: RETURN -1 ;
13667: END Get_Basis_Amt_Code;
13668:
13669: -- =============================================================================
13683: j Number ;
13684:
13685: BEGIN
13686:
13687: Hr_Utility.set_location(' Entering : ' || l_proc_name , 10);
13688: IF p_record_number = 12 THEN
13689: IF l_rec_12_values.count > 0 THEN
13690: j := l_rec_12_values.FIRST;
13691: IF l_rec_12_values.EXISTS(j) THEN
13708: END IF;
13709: END IF;
13710: END IF;
13711:
13712: Hr_Utility.set_location(' Leaving : ' || l_proc_name , 80);
13713:
13714: RETURN 0 ;
13715:
13716: EXCEPTION
13715:
13716: EXCEPTION
13717: WHEN Others THEN
13718: p_error_message :='SQL-ERRM :'||SQLERRM;
13719: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
13720: RETURN -1 ;
13721: END Get_Contrib_Amt_Code;
13722:
13723:
13760:
13761: BEGIN
13762:
13763: --find the defined balance id for the IPAP Standard EE Contribution for the _ASG_PTD dimension
13764: Hr_Utility.set_location('Entering : '||l_proc,10);
13765: OPEN csr_defined_bal(c_balance_name => 'IPAP EE Contribution'
13766: ,c_dimension_name => 'Assignment Period To Date'
13767: ,c_business_group_id => p_business_group_id
13768: );
13768: );
13769: FETCH csr_defined_bal INTO l_defined_balance_id;
13770: IF csr_defined_bal%FOUND THEN
13771: CLOSE csr_defined_bal;
13772: Hr_Utility.set_location('found defined balance id : '||l_defined_balance_id,20);
13773: --Find the assignment action of the payroll run if any IPAP Pensions has been processed and
13774: --if the date earned for that payroll run , is between the extract start and end dates
13775: OPEN c_run_results_exist;
13776: FETCH c_run_results_exist INTO l_asg_act_id;
13777: IF c_run_results_exist%FOUND THEN
13778: --assignment action id has been found, now find the value for the EE contribution
13779: --from the dimension _ASG_PTD
13780: CLOSE c_run_results_exist;
13781: Hr_Utility.set_location('found asg action id : '||l_asg_act_id,30);
13782: --from the assignment action id,and defined balance id fetched above , find the balance value
13783: p_data_element_value := Fnd_Number.number_to_canonical(
13784: Pay_Balance_Pkg.get_value(p_defined_balance_id => l_defined_balance_id
13785: ,p_assignment_action_id => l_asg_act_id
13783: p_data_element_value := Fnd_Number.number_to_canonical(
13784: Pay_Balance_Pkg.get_value(p_defined_balance_id => l_defined_balance_id
13785: ,p_assignment_action_id => l_asg_act_id
13786: ));
13787: Hr_Utility.set_location('found value for the contribution as : '||p_data_element_value,40);
13788: g_ipap_contribution := Fnd_Number.canonical_to_number(p_data_element_value);
13789: RETURN 0;
13790: ELSE
13791: CLOSE c_run_results_exist;
13788: g_ipap_contribution := Fnd_Number.canonical_to_number(p_data_element_value);
13789: RETURN 0;
13790: ELSE
13791: CLOSE c_run_results_exist;
13792: Hr_Utility.set_location('could not find the asg action id',50);
13793: p_data_element_value := '';
13794: p_error_message := 'Could not find a value for the Contribution amount towards IPAP Pensions.';
13795: RETURN 1;
13796: END IF;
13795: RETURN 1;
13796: END IF;
13797: ELSE
13798: CLOSE csr_defined_bal;
13799: Hr_Utility.set_location('could not find the defined balance id',60);
13800: p_data_element_value := '';
13801: p_error_message := 'Could not find the defined balance id for the contribution balance.';
13802: RETURN 1;
13803: END IF;
13804:
13805: EXCEPTION
13806: WHEN Others THEN
13807: p_error_message :='SQL-ERRM :'||SQLERRM;
13808: Hr_Utility.set_location('..'||p_error_message,70);
13809: RETURN 1;
13810: END get_ipap_contribution_amt;
13811:
13812: --============================================================================
13825: l_proc_name Varchar2(30) := 'Get_Amt_Code';
13826:
13827: BEGIN
13828:
13829: Hr_Utility.set_location('Entering : -----------'||l_proc_name,5);
13830: IF p_sub_cat = 'FUR_S' THEN
13831: IF g_fur_contribution >= 0 THEN
13832: p_data_element_value := ' ';
13833: RETURN 0;
13847:
13848: EXCEPTION
13849: WHEN Others THEN
13850: p_error_message :='SQL-ERRM :'||SQLERRM;
13851: Hr_Utility.set_location('..'||p_error_message,10);
13852: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 15);
13853: RETURN -1;
13854:
13855: END Get_Amt_Code;
13848: EXCEPTION
13849: WHEN Others THEN
13850: p_error_message :='SQL-ERRM :'||SQLERRM;
13851: Hr_Utility.set_location('..'||p_error_message,10);
13852: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 15);
13853: RETURN -1;
13854:
13855: END Get_Amt_Code;
13856:
13873: SELECT To_Char(p_effective_date,'MM')
13874: FROM dual;
13875:
13876: BEGIN
13877: Hr_Utility.set_location('Entering:-------- '||l_proc_name, 5);
13878: OPEN c_get_amt_month;
13879: FETCH c_get_amt_month INTO l_month;
13880: CLOSE c_get_amt_month;
13881: Hr_Utility.set_location('month of amt is : '||l_month,7);
13877: Hr_Utility.set_location('Entering:-------- '||l_proc_name, 5);
13878: OPEN c_get_amt_month;
13879: FETCH c_get_amt_month INTO l_month;
13880: CLOSE c_get_amt_month;
13881: Hr_Utility.set_location('month of amt is : '||l_month,7);
13882: p_data_element_value := l_month;
13883: RETURN 0;
13884:
13885: EXCEPTION
13884:
13885: EXCEPTION
13886: WHEN Others THEN
13887: p_error_message :='SQL-ERRM :'||SQLERRM;
13888: Hr_Utility.set_location('..'||p_error_message,10);
13889: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 15);
13890: RETURN -1;
13891:
13892: END Get_Amt_Month;
13885: EXCEPTION
13886: WHEN Others THEN
13887: p_error_message :='SQL-ERRM :'||SQLERRM;
13888: Hr_Utility.set_location('..'||p_error_message,10);
13889: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 15);
13890: RETURN -1;
13891:
13892: END Get_Amt_Month;
13893:
13913: FROM dual;
13914:
13915: BEGIN
13916:
13917: hr_utility.set_location('Entering :------- '||l_proc_name,5);
13918:
13919: OPEN c_get_amt_year;
13920: FETCH c_get_amt_year INTO l_year;
13921: CLOSE c_get_amt_year;
13921: CLOSE c_get_amt_year;
13922:
13923: p_data_element_value := l_year;
13924:
13925: hr_utility.set_location('Year is :------- '||l_year,10);
13926: hr_utility.set_location('Leaving :------- '||l_proc_name,15);
13927:
13928: RETURN 0;
13929:
13922:
13923: p_data_element_value := l_year;
13924:
13925: hr_utility.set_location('Year is :------- '||l_year,10);
13926: hr_utility.set_location('Leaving :------- '||l_proc_name,15);
13927:
13928: RETURN 0;
13929:
13930: EXCEPTION
13929:
13930: EXCEPTION
13931: WHEN OTHERS THEN
13932: p_error_message :='SQL-ERRM :'||SQLERRM;
13933: hr_utility.set_location('..ERROR'||p_error_message,10);
13934: hr_utility.set_location('Leaving:-------- '||l_proc_name, 15);
13935: RETURN -1;
13936:
13937: END Get_Amt_Year;
13930: EXCEPTION
13931: WHEN OTHERS THEN
13932: p_error_message :='SQL-ERRM :'||SQLERRM;
13933: hr_utility.set_location('..ERROR'||p_error_message,10);
13934: hr_utility.set_location('Leaving:-------- '||l_proc_name, 15);
13935: RETURN -1;
13936:
13937: END Get_Amt_Year;
13938:
13961: AND information_type = 'NL_ABP_RI';
13962:
13963: BEGIN
13964:
13965: Hr_Utility.set_location('Entering ------ : '||l_proc_name,5);
13966: OPEN c_get_contrib_kind;
13967: FETCH c_get_contrib_kind INTO l_kind_of_contrib;
13968: IF c_get_contrib_kind%FOUND THEN
13969: CLOSE c_get_contrib_kind;
13971: CLOSE c_get_contrib_kind;
13972: l_kind_of_contrib := 'D';
13973: END IF;
13974:
13975: Hr_Utility.set_location('value of kind of contribution : '||l_kind_of_contrib,10);
13976: p_data_element_value := l_kind_of_contrib;
13977: g_fur_contrib_kind := l_kind_of_contrib;
13978: RETURN 0;
13979:
13979:
13980: EXCEPTION
13981: WHEN Others THEN
13982: p_error_message :='SQL-ERRM :'||SQLERRM;
13983: Hr_Utility.set_location('..'||p_error_message,15);
13984: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 20);
13985: RETURN -1;
13986:
13987: END Get_Fur_Contribution_Kind;
13980: EXCEPTION
13981: WHEN Others THEN
13982: p_error_message :='SQL-ERRM :'||SQLERRM;
13983: Hr_Utility.set_location('..'||p_error_message,15);
13984: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 20);
13985: RETURN -1;
13986:
13987: END Get_Fur_Contribution_Kind;
13988:
14000: l_proc_name Varchar2(30) := 'Get_Ins_Cd_Anw_Ipap';
14001: j number;
14002:
14003: BEGIN
14004: Hr_Utility.set_location('Entering : '||l_proc_name,10);
14005:
14006: j := l_rec_31_values.FIRST;
14007: IF l_rec_31_values.EXISTS(j) THEN
14008: p_data_element_value := l_rec_31_values(j).code;
14007: IF l_rec_31_values.EXISTS(j) THEN
14008: p_data_element_value := l_rec_31_values(j).code;
14009: g_ins_cd_anw_ipap := l_rec_31_values(j).code;
14010: END IF;
14011: Hr_Utility.set_location('Leaving : '||l_proc_name,20);
14012: RETURN 0;
14013:
14014: EXCEPTION
14015: WHEN Others THEN
14013:
14014: EXCEPTION
14015: WHEN Others THEN
14016: p_error_message :='SQL-ERRM :'||SQLERRM;
14017: Hr_Utility.set_location('..'||p_error_message,15);
14018: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 20);
14019: RETURN -1;
14020: END Get_Ins_Cd_Anw_Ipap;
14021:
14014: EXCEPTION
14015: WHEN Others THEN
14016: p_error_message :='SQL-ERRM :'||SQLERRM;
14017: Hr_Utility.set_location('..'||p_error_message,15);
14018: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 20);
14019: RETURN -1;
14020: END Get_Ins_Cd_Anw_Ipap;
14021:
14022: --============================================================================
14046: l_ipap_type Varchar2(2) := '01';
14047:
14048: BEGIN
14049:
14050: Hr_Utility.set_location('Entering : '||l_proc_name,10);
14051: OPEN c_get_ins_type;
14052: FETCH c_get_ins_type INTO l_anw_type,l_ipap_type;
14053: CLOSE c_get_ins_type;
14054: Hr_Utility.set_location('anw ins type : '||l_anw_type,15);
14050: Hr_Utility.set_location('Entering : '||l_proc_name,10);
14051: OPEN c_get_ins_type;
14052: FETCH c_get_ins_type INTO l_anw_type,l_ipap_type;
14053: CLOSE c_get_ins_type;
14054: Hr_Utility.set_location('anw ins type : '||l_anw_type,15);
14055: Hr_Utility.set_location('ipap ins type : '||l_ipap_type,17);
14056: Hr_Utility.set_location('ins cd : '||g_ins_cd_anw_ipap,19);
14057:
14058: IF g_ins_cd_anw_ipap = '01' THEN
14051: OPEN c_get_ins_type;
14052: FETCH c_get_ins_type INTO l_anw_type,l_ipap_type;
14053: CLOSE c_get_ins_type;
14054: Hr_Utility.set_location('anw ins type : '||l_anw_type,15);
14055: Hr_Utility.set_location('ipap ins type : '||l_ipap_type,17);
14056: Hr_Utility.set_location('ins cd : '||g_ins_cd_anw_ipap,19);
14057:
14058: IF g_ins_cd_anw_ipap = '01' THEN
14059: p_data_element_value := l_anw_type;
14052: FETCH c_get_ins_type INTO l_anw_type,l_ipap_type;
14053: CLOSE c_get_ins_type;
14054: Hr_Utility.set_location('anw ins type : '||l_anw_type,15);
14055: Hr_Utility.set_location('ipap ins type : '||l_ipap_type,17);
14056: Hr_Utility.set_location('ins cd : '||g_ins_cd_anw_ipap,19);
14057:
14058: IF g_ins_cd_anw_ipap = '01' THEN
14059: p_data_element_value := l_anw_type;
14060: ELSIF g_ins_cd_anw_ipap = '02' THEN
14061: p_data_element_value := l_ipap_type;
14062: END IF;
14063: RETURN 0;
14064:
14065: Hr_Utility.set_location('leaving --------------: '||l_proc_name,20);
14066:
14067: EXCEPTION
14068: WHEN Others THEN
14069: p_error_message :='SQL-ERRM :'||SQLERRM;
14066:
14067: EXCEPTION
14068: WHEN Others THEN
14069: p_error_message :='SQL-ERRM :'||SQLERRM;
14070: Hr_Utility.set_location('..'||p_error_message,15);
14071: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 20);
14072: RETURN -1;
14073:
14074: END Get_Ins_Typ_Anw_Ipap;
14067: EXCEPTION
14068: WHEN Others THEN
14069: p_error_message :='SQL-ERRM :'||SQLERRM;
14070: Hr_Utility.set_location('..'||p_error_message,15);
14071: Hr_Utility.set_location('Leaving:-------- '||l_proc_name, 20);
14072: RETURN -1;
14073:
14074: END Get_Ins_Typ_Anw_Ipap;
14075:
14140: l_proc_name Varchar2(150) := 'Get_Employment_Kind';
14141:
14142: BEGIN
14143:
14144: Hr_Utility.set_location('Entering : '||l_proc_name,10);
14145: --first fetch the employment code from the soft coding keyflex
14146: OPEN c_get_emp_code;
14147: FETCH c_get_emp_code INTO l_emp_code;
14148: IF c_get_emp_code%FOUND THEN
14146: OPEN c_get_emp_code;
14147: FETCH c_get_emp_code INTO l_emp_code;
14148: IF c_get_emp_code%FOUND THEN
14149: CLOSE c_get_emp_code;
14150: Hr_Utility.set_location('found the code as : '||l_emp_code,20);
14151: --now from the employment code,fetch the udt data for the value (as 1,2,3 etc)
14152: l_emp_kind := Hruserdt.get_table_value
14153: (p_bus_group_id => p_business_group_id
14154: ,p_table_name => 'NL_EMP_SUB_TYPE_CIB_KOA'
14157: ,p_effective_date => p_effective_date
14158: );
14159:
14160: IF l_emp_kind IS NOT NULL THEN
14161: Hr_Utility.set_location('employment kind is : '||l_emp_kind,30);
14162: p_data_element_value := l_emp_kind;
14163: ELSE
14164: p_data_element_value := '';
14165: END IF;
14166: ELSE
14167: CLOSE c_get_emp_code;
14168: p_data_element_value := '';
14169: END IF;
14170: Hr_Utility.set_location('data element value is : '||p_data_element_value,40);
14171: Hr_Utility.set_location('Leaving : '||l_proc_name,50);
14172: RETURN 0;
14173:
14174: EXCEPTION
14167: CLOSE c_get_emp_code;
14168: p_data_element_value := '';
14169: END IF;
14170: Hr_Utility.set_location('data element value is : '||p_data_element_value,40);
14171: Hr_Utility.set_location('Leaving : '||l_proc_name,50);
14172: RETURN 0;
14173:
14174: EXCEPTION
14175:
14178: RETURN 0;
14179:
14180: WHEN Others THEN
14181: p_error_message := SQLERRM;
14182: Hr_Utility.set_location('error message : '||SQLERRM,10);
14183: Hr_Utility.set_location('Leaving : '||l_proc_name,50);
14184: p_data_element_value := '';
14185: RETURN 1;
14186:
14179:
14180: WHEN Others THEN
14181: p_error_message := SQLERRM;
14182: Hr_Utility.set_location('error message : '||SQLERRM,10);
14183: Hr_Utility.set_location('Leaving : '||l_proc_name,50);
14184: p_data_element_value := '';
14185: RETURN 1;
14186:
14187: END Get_Employment_Kind;
14210:
14211:
14212: BEGIN
14213:
14214: Hr_Utility.set_location('Entering : '||l_proc_name,10);
14215:
14216: OPEN csr_get_dt(p_assignment_id);
14217: FETCH csr_get_dt INTO l_eff_dt;
14218: CLOSE csr_get_dt;
14220: p_data_element_value := Upper(nvl(TO_CHAR(l_eff_dt,'YYYYMMDD'),'00000000'));
14221:
14222: l_return_value := 0 ;
14223:
14224: Hr_Utility.set_location('l_return_value : '||l_return_value,30);
14225: Hr_Utility.set_location('p_data_element_value : '||p_data_element_value,40);
14226: Hr_Utility.set_location('Leaving : '||l_proc_name,50);
14227:
14228: RETURN l_return_value;
14221:
14222: l_return_value := 0 ;
14223:
14224: Hr_Utility.set_location('l_return_value : '||l_return_value,30);
14225: Hr_Utility.set_location('p_data_element_value : '||p_data_element_value,40);
14226: Hr_Utility.set_location('Leaving : '||l_proc_name,50);
14227:
14228: RETURN l_return_value;
14229:
14222: l_return_value := 0 ;
14223:
14224: Hr_Utility.set_location('l_return_value : '||l_return_value,30);
14225: Hr_Utility.set_location('p_data_element_value : '||p_data_element_value,40);
14226: Hr_Utility.set_location('Leaving : '||l_proc_name,50);
14227:
14228: RETURN l_return_value;
14229:
14230: END Get_Change_Date;
14249: l_employer_number Number;
14250: l_asg_seq_num Varchar2(2);
14251:
14252: BEGIN
14253: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
14254: -- Get the orgId for assigntment ID
14255: l_return_value := Get_ABP_ER_Num(p_assignment_id
14256: ,p_business_group_id
14257: ,p_effective_date
14265: IF g_primary_assig.EXISTS(p_assignment_id) THEN
14266: l_employee_number := substr(g_primary_assig(p_assignment_id).ee_num,2);
14267: END IF;
14268:
14269: Hr_Utility.set_location('l_employee_number: '||l_employee_number, 5);
14270: l_employer_number := Lpad(l_employer_number,9,0);
14271: l_employee_number := Lpad(l_employee_number,10,0);
14272: l_asg_seq_num := g_primary_assig(p_assignment_id).asg_seq_num;
14273: IF To_Number(Nvl(l_asg_seq_num,'1')) < 10 THEN
14278: l_employee_number ||
14279: l_asg_seq_num ||
14280: p_generator_record;
14281:
14282: Hr_Utility.set_location('p_data_element_value: '||p_data_element_value, 5);
14283: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
14284: l_return_value := 0;
14285:
14286: RETURN l_return_value;
14279: l_asg_seq_num ||
14280: p_generator_record;
14281:
14282: Hr_Utility.set_location('p_data_element_value: '||p_data_element_value, 5);
14283: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
14284: l_return_value := 0;
14285:
14286: RETURN l_return_value;
14287: EXCEPTION
14286: RETURN l_return_value;
14287: EXCEPTION
14288: WHEN Others THEN
14289: p_error_message :='SQL-ERRM :'||SQLERRM;
14290: Hr_Utility.set_location('..'||p_error_message,85);
14291: RETURN l_return_value;
14292: END Sort_Id_Generator;
14293:
14294: -- =============================================================================
14308: l_return_value Number := -1;
14309:
14310:
14311: BEGIN
14312: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
14313:
14314: -- rpinjala
14315: IF g_primary_assig.EXISTS(p_assignment_id) THEN
14316: p_data_element_value := g_primary_assig(p_assignment_id).organization_id;
14316: p_data_element_value := g_primary_assig(p_assignment_id).organization_id;
14317: END IF;
14318:
14319: l_return_value := 0;
14320: Hr_Utility.set_location('Leaving: '||l_proc_name, 5);
14321: RETURN l_return_value;
14322: EXCEPTION
14323: WHEN Others THEN
14324: p_error_message :='SQL-ERRM :'||SQLERRM;
14321: RETURN l_return_value;
14322: EXCEPTION
14323: WHEN Others THEN
14324: p_error_message :='SQL-ERRM :'||SQLERRM;
14325: Hr_Utility.set_location('..'||p_error_message,85);
14326: RETURN l_return_value;
14327: END Org_Id_DataElement;
14328:
14329: -- =============================================================================
14366: AND g_extract_params(p_business_group_id).extract_end_date
14367: BETWEEN effective_start_date AND effective_end_date ;
14368:
14369: BEGIN
14370: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
14371: i := p_business_group_id;
14372:
14373: FOR csr_rcd_rec IN csr_ext_rcd_id_hidden
14374: (c_rcd_type_cd => 'D')-- D=Detail, T=Total, H-Header
14374: (c_rcd_type_cd => 'D')-- D=Detail, T=Total, H-Header
14375: LOOP
14376: l_ext_rcd_id := csr_rcd_rec.ext_rcd_id;
14377:
14378: Hr_Utility.set_location('l_ext_rcd_id: '||l_ext_rcd_id, 5);
14379:
14380: --These are single processing reoords
14381: IF g_ext_rcds(l_ext_rcd_id).record_number IN
14382: ('01','02','04','05','08','09','12','20',
14456: END IF; -- IF l_return_value = 'Y'
14457: END IF;
14458: END LOOP;
14459:
14460: Hr_Utility.set_location('Leaving: '||l_proc_name, 80);
14461: END Create_Addl_Assignments;
14462:
14463: -- =============================================================================
14464: -- Process_Addl_Assigs: Process all the assigs in the PL/SQL table for the
14489: l_assignment_id per_all_assignments_f.assignment_id%TYPE;
14490: l_mutli_assig Varchar2(150);
14491: BEGIN
14492:
14493: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
14494:
14495: l_mutli_assig := Check_Addl_Assigs
14496: (p_assignment_id => p_assignment_id
14497: ,p_business_group_id => p_business_group_id
14508: -- created and re-calculate the person level based fast-formulas.
14509: l_assignment_id := g_primary_assig.FIRST;
14510: WHILE l_assignment_id IS NOT NULL
14511: LOOP
14512: Hr_Utility.set_location('..Checking for assignment : '||l_assignment_id, 7);
14513: IF g_primary_assig(l_assignment_id).person_id = l_person_id AND
14514: l_assignment_id <> p_assignment_id AND
14515: g_primary_assig(l_assignment_id).Assignment_Type = 'E' THEN
14516:
14513: IF g_primary_assig(l_assignment_id).person_id = l_person_id AND
14514: l_assignment_id <> p_assignment_id AND
14515: g_primary_assig(l_assignment_id).Assignment_Type = 'E' THEN
14516:
14517: Hr_Utility.set_location('..Valid Assignment : '||l_assignment_id, 8);
14518: Hr_Utility.set_location('..l_no_asg_action : '||l_no_asg_action, 8);
14519:
14520: l_rec_09_values.delete;
14521:
14514: l_assignment_id <> p_assignment_id AND
14515: g_primary_assig(l_assignment_id).Assignment_Type = 'E' THEN
14516:
14517: Hr_Utility.set_location('..Valid Assignment : '||l_assignment_id, 8);
14518: Hr_Utility.set_location('..l_no_asg_action : '||l_no_asg_action, 8);
14519:
14520: l_rec_09_values.delete;
14521:
14522: Populate_Record_Structures
14600: END IF;
14601: l_assignment_id := g_primary_assig.NEXT(l_assignment_id);
14602: END LOOP;
14603:
14604: Hr_Utility.set_location('Leaving: '||l_proc_name, 80);
14605: RETURN 0;
14606:
14607: EXCEPTION
14608: WHEN Others THEN
14606:
14607: EXCEPTION
14608: WHEN Others THEN
14609: p_error_message :='SQL-ERRM :'||SQLERRM;
14610: Hr_Utility.set_location('..'||p_error_message,85);
14611: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
14612: RETURN -1;
14613: END Process_Addl_Assigs;
14614:
14607: EXCEPTION
14608: WHEN Others THEN
14609: p_error_message :='SQL-ERRM :'||SQLERRM;
14610: Hr_Utility.set_location('..'||p_error_message,85);
14611: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
14612: RETURN -1;
14613: END Process_Addl_Assigs;
14614:
14615: FUNCTION Process_Retro_Hire
14629:
14630: EXCEPTION
14631: WHEN Others THEN
14632: p_error_message :='SQL-ERRM :'||SQLERRM;
14633: Hr_Utility.set_location('..'||p_error_message,85);
14634: RETURN -1;
14635: END Process_Retro_Hire;
14636:
14637: -- =============================================================================
14653: l_error_flag Boolean;
14654: l_ret_val Number := 0;
14655:
14656: BEGIN
14657: Hr_Utility.set_location('Entering: '||l_proc_name, 4);
14658:
14659: -- Process Multiple Records for Record 05
14660: BEGIN
14661: l_ret_val := Process_Mult_Rec05
14664: ,p_effective_date => p_effective_date
14665: ,p_error_message => p_error_message
14666: ,p_data_element_value => l_data_element_value);
14667: g_rec05_rows.delete;
14668: Hr_Utility.set_location('..Processed Multi Recds for 05 : '||l_proc_name, 5);
14669: EXCEPTION
14670: WHEN Others THEN
14671: Hr_Utility.set_location('..Error in Multi Recds for 05 : '||l_proc_name, 5);
14672: l_error_message := Substr('SQL-ERRM :'||SQLERRM,1,2000);
14667: g_rec05_rows.delete;
14668: Hr_Utility.set_location('..Processed Multi Recds for 05 : '||l_proc_name, 5);
14669: EXCEPTION
14670: WHEN Others THEN
14671: Hr_Utility.set_location('..Error in Multi Recds for 05 : '||l_proc_name, 5);
14672: l_error_message := Substr('SQL-ERRM :'||SQLERRM,1,2000);
14673: l_error_flag := TRUE;
14674: END;
14675: IF l_ret_val <> 0 THEN
14685: ,p_business_group_id => p_business_group_id
14686: ,p_effective_date => p_effective_date
14687: ,p_error_message => p_error_message
14688: ,p_data_element_value => l_data_element_value);
14689: Hr_Utility.set_location('..Processed Multi Recds for 08 : '||l_proc_name, 9);
14690: EXCEPTION
14691: WHEN Others THEN
14692: Hr_Utility.set_location('..Error in Multi Recds for 08 : '||l_proc_name, 9);
14693: l_error_message := Substr('SQL-ERRM :'||SQLERRM,1,2000);
14688: ,p_data_element_value => l_data_element_value);
14689: Hr_Utility.set_location('..Processed Multi Recds for 08 : '||l_proc_name, 9);
14690: EXCEPTION
14691: WHEN Others THEN
14692: Hr_Utility.set_location('..Error in Multi Recds for 08 : '||l_proc_name, 9);
14693: l_error_message := Substr('SQL-ERRM :'||SQLERRM,1,2000);
14694: l_error_flag := TRUE;
14695: END;
14696: IF l_ret_val <> 0 THEN
14708: ,p_error_message => p_error_message
14709: ,p_data_element_value => l_data_element_value);
14710: l_rec_09_values.delete;
14711:
14712: Hr_Utility.set_location('..Processed Multi Recds for 09 : '||l_proc_name, 9);
14713: EXCEPTION
14714: WHEN Others THEN
14715: Hr_Utility.set_location('..Error in Multi Recds for 09 : '||l_proc_name, 9);
14716: l_error_message := Substr('SQL-ERRM :'||SQLERRM,1,2000);
14711:
14712: Hr_Utility.set_location('..Processed Multi Recds for 09 : '||l_proc_name, 9);
14713: EXCEPTION
14714: WHEN Others THEN
14715: Hr_Utility.set_location('..Error in Multi Recds for 09 : '||l_proc_name, 9);
14716: l_error_message := Substr('SQL-ERRM :'||SQLERRM,1,2000);
14717: l_error_flag := TRUE;
14718: END;
14719: IF l_ret_val <> 0 THEN
14731: ,p_effective_date => p_effective_date
14732: ,p_error_message => p_error_message
14733: ,p_data_element_value => l_data_element_value);
14734: l_rec_12_values.delete;
14735: Hr_Utility.set_location('..Processed Multi Recds for 12 : '||l_proc_name, 12);
14736: EXCEPTION
14737: WHEN Others THEN
14738: Hr_Utility.set_location('..Error in Multi Recds for 12 : '||l_proc_name, 12);
14739: l_error_message := Substr('SQL-ERRM :'||SQLERRM,1,2000);
14734: l_rec_12_values.delete;
14735: Hr_Utility.set_location('..Processed Multi Recds for 12 : '||l_proc_name, 12);
14736: EXCEPTION
14737: WHEN Others THEN
14738: Hr_Utility.set_location('..Error in Multi Recds for 12 : '||l_proc_name, 12);
14739: l_error_message := Substr('SQL-ERRM :'||SQLERRM,1,2000);
14740: l_error_flag := TRUE;
14741: END;
14742: IF l_ret_val <> 0 THEN
14753: ,p_business_group_id => p_business_group_id
14754: ,p_effective_date => p_effective_date
14755: ,p_error_message => p_error_message
14756: ,p_data_element_value => l_data_element_value);
14757: Hr_Utility.set_location('..Processed Multi Recds for 30 : '||l_proc_name, 30);
14758: EXCEPTION
14759: WHEN Others THEN
14760: Hr_Utility.set_location('..Error in Multi Recds for 30 : '||l_proc_name, 30);
14761: l_error_message := Substr('SQL-ERRM :'||SQLERRM,1,2000);
14756: ,p_data_element_value => l_data_element_value);
14757: Hr_Utility.set_location('..Processed Multi Recds for 30 : '||l_proc_name, 30);
14758: EXCEPTION
14759: WHEN Others THEN
14760: Hr_Utility.set_location('..Error in Multi Recds for 30 : '||l_proc_name, 30);
14761: l_error_message := Substr('SQL-ERRM :'||SQLERRM,1,2000);
14762: l_error_flag := TRUE;
14763: END;
14764: IF l_ret_val <> 0 THEN
14775: ,p_business_group_id => p_business_group_id
14776: ,p_effective_date => p_effective_date
14777: ,p_error_message => p_error_message
14778: ,p_data_element_value => l_data_element_value);
14779: Hr_Utility.set_location('..Processed Multi Recds for 31 : '||l_proc_name, 31);
14780: EXCEPTION
14781: WHEN Others THEN
14782: Hr_Utility.set_location('..Error in Multi Recds for 31 : '||l_proc_name, 31);
14783: l_error_message := Substr('SQL-ERRM :'||SQLERRM,1,2000);
14778: ,p_data_element_value => l_data_element_value);
14779: Hr_Utility.set_location('..Processed Multi Recds for 31 : '||l_proc_name, 31);
14780: EXCEPTION
14781: WHEN Others THEN
14782: Hr_Utility.set_location('..Error in Multi Recds for 31 : '||l_proc_name, 31);
14783: l_error_message := Substr('SQL-ERRM :'||SQLERRM,1,2000);
14784: l_error_flag := TRUE;
14785: END;
14786: IF l_ret_val <> 0 THEN
14797: ,p_business_group_id => p_business_group_id
14798: ,p_effective_date => p_effective_date
14799: ,p_error_message => p_error_message
14800: ,p_data_element_value => l_data_element_value);
14801: Hr_Utility.set_location('..Processed Multi Recds for 40 : '||l_proc_name, 40);
14802: EXCEPTION
14803: WHEN Others THEN
14804: Hr_Utility.set_location('..Error in Multi Recds for 40 : '||l_proc_name, 40);
14805: l_error_message := Substr('SQL-ERRM :'||SQLERRM,1,2000);
14800: ,p_data_element_value => l_data_element_value);
14801: Hr_Utility.set_location('..Processed Multi Recds for 40 : '||l_proc_name, 40);
14802: EXCEPTION
14803: WHEN Others THEN
14804: Hr_Utility.set_location('..Error in Multi Recds for 40 : '||l_proc_name, 40);
14805: l_error_message := Substr('SQL-ERRM :'||SQLERRM,1,2000);
14806: l_error_flag := TRUE;
14807: END;
14808: IF l_ret_val <> 0 THEN
14819: ,p_business_group_id => p_business_group_id
14820: ,p_effective_date => p_effective_date
14821: ,p_error_message => p_error_message
14822: ,p_data_element_value => l_data_element_value);
14823: Hr_Utility.set_location('..Processed Multi Recds for 41 : '||l_proc_name, 41);
14824: EXCEPTION
14825: WHEN Others THEN
14826: Hr_Utility.set_location('..Error in Multi Recds for 41 : '||l_proc_name, 41);
14827: l_error_message := Substr('SQL-ERRM :'||SQLERRM,1,2000);
14822: ,p_data_element_value => l_data_element_value);
14823: Hr_Utility.set_location('..Processed Multi Recds for 41 : '||l_proc_name, 41);
14824: EXCEPTION
14825: WHEN Others THEN
14826: Hr_Utility.set_location('..Error in Multi Recds for 41 : '||l_proc_name, 41);
14827: l_error_message := Substr('SQL-ERRM :'||SQLERRM,1,2000);
14828: l_error_flag := TRUE;
14829: END;
14830: IF l_ret_val <> 0 THEN
14833: 'Assignment Id :'||p_assignment_id ;
14834: l_error_flag := TRUE;
14835: END IF;
14836:
14837: Hr_Utility.set_location('Leaving: '||l_proc_name, 80);
14838: IF l_error_flag THEN
14839: p_error_message := l_error_message;
14840: RETURN -1;
14841: ELSE
14844:
14845: EXCEPTION
14846: WHEN Others THEN
14847: p_error_message :='SQL-ERRM :'||SQLERRM;
14848: Hr_Utility.set_location('..'||p_error_message,85);
14849: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
14850: RETURN -1;
14851:
14852: END Process_Mult_Records;
14845: EXCEPTION
14846: WHEN Others THEN
14847: p_error_message :='SQL-ERRM :'||SQLERRM;
14848: Hr_Utility.set_location('..'||p_error_message,85);
14849: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
14850: RETURN -1;
14851:
14852: END Process_Mult_Records;
14853:
14872: BEGIN
14873:
14874: l_ret_val := 0;
14875:
14876: Hr_Utility.set_location(' Entering : ' || l_proc_name , 5);
14877: Hr_Utility.set_location(' p_assignment_id ' || p_assignment_id , 10);
14878: Hr_Utility.set_location(' p_bg_id is ' || p_business_group_id ,15);
14879: Hr_Utility.set_location(' p_date_earned ' || p_date_earned,20 );
14880: Hr_Utility.set_location(' p_data_ele_cd ' || p_data_element_cd ,25);
14873:
14874: l_ret_val := 0;
14875:
14876: Hr_Utility.set_location(' Entering : ' || l_proc_name , 5);
14877: Hr_Utility.set_location(' p_assignment_id ' || p_assignment_id , 10);
14878: Hr_Utility.set_location(' p_bg_id is ' || p_business_group_id ,15);
14879: Hr_Utility.set_location(' p_date_earned ' || p_date_earned,20 );
14880: Hr_Utility.set_location(' p_data_ele_cd ' || p_data_element_cd ,25);
14881: Hr_Utility.set_location(' g_person_id ' || g_person_id , 30);
14874: l_ret_val := 0;
14875:
14876: Hr_Utility.set_location(' Entering : ' || l_proc_name , 5);
14877: Hr_Utility.set_location(' p_assignment_id ' || p_assignment_id , 10);
14878: Hr_Utility.set_location(' p_bg_id is ' || p_business_group_id ,15);
14879: Hr_Utility.set_location(' p_date_earned ' || p_date_earned,20 );
14880: Hr_Utility.set_location(' p_data_ele_cd ' || p_data_element_cd ,25);
14881: Hr_Utility.set_location(' g_person_id ' || g_person_id , 30);
14882:
14875:
14876: Hr_Utility.set_location(' Entering : ' || l_proc_name , 5);
14877: Hr_Utility.set_location(' p_assignment_id ' || p_assignment_id , 10);
14878: Hr_Utility.set_location(' p_bg_id is ' || p_business_group_id ,15);
14879: Hr_Utility.set_location(' p_date_earned ' || p_date_earned,20 );
14880: Hr_Utility.set_location(' p_data_ele_cd ' || p_data_element_cd ,25);
14881: Hr_Utility.set_location(' g_person_id ' || g_person_id , 30);
14882:
14883: IF (p_data_element_cd = 'ABP_ER_NUM') THEN
14876: Hr_Utility.set_location(' Entering : ' || l_proc_name , 5);
14877: Hr_Utility.set_location(' p_assignment_id ' || p_assignment_id , 10);
14878: Hr_Utility.set_location(' p_bg_id is ' || p_business_group_id ,15);
14879: Hr_Utility.set_location(' p_date_earned ' || p_date_earned,20 );
14880: Hr_Utility.set_location(' p_data_ele_cd ' || p_data_element_cd ,25);
14881: Hr_Utility.set_location(' g_person_id ' || g_person_id , 30);
14882:
14883: IF (p_data_element_cd = 'ABP_ER_NUM') THEN
14884:
14877: Hr_Utility.set_location(' p_assignment_id ' || p_assignment_id , 10);
14878: Hr_Utility.set_location(' p_bg_id is ' || p_business_group_id ,15);
14879: Hr_Utility.set_location(' p_date_earned ' || p_date_earned,20 );
14880: Hr_Utility.set_location(' p_data_ele_cd ' || p_data_element_cd ,25);
14881: Hr_Utility.set_location(' g_person_id ' || g_person_id , 30);
14882:
14883: IF (p_data_element_cd = 'ABP_ER_NUM') THEN
14884:
14885: l_ret_val := Get_ABP_ER_Num(p_assignment_id
16072:
16073: EXCEPTION
16074: WHEN Others THEN
16075: p_error_message :='SQL-ERRM :'||SQLERRM;
16076: Hr_Utility.set_location('..'||p_error_message,85);
16077: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
16078: RETURN l_ret_val;
16079: END PQP_NL_GET_DATA_ELEMENT_VALUE;
16080:
16073: EXCEPTION
16074: WHEN Others THEN
16075: p_error_message :='SQL-ERRM :'||SQLERRM;
16076: Hr_Utility.set_location('..'||p_error_message,85);
16077: Hr_Utility.set_location('Leaving: '||l_proc_name, 90);
16078: RETURN l_ret_val;
16079: END PQP_NL_GET_DATA_ELEMENT_VALUE;
16080:
16081: -- ===============================================================================
16100: l_new_er_num VARCHAR(7) := '0';
16101:
16102: BEGIN
16103:
16104: hr_utility.set_location('Entering: '||l_proc_name, 5);
16105:
16106: OPEN csr_get_new_er_num(p_org_id,p_effective_date);
16107: FETCH csr_get_new_er_num INTO l_new_er_num;
16108: CLOSE csr_get_new_er_num;
16106: OPEN csr_get_new_er_num(p_org_id,p_effective_date);
16107: FETCH csr_get_new_er_num INTO l_new_er_num;
16108: CLOSE csr_get_new_er_num;
16109:
16110: hr_utility.set_location('Leaving: '||l_proc_name, 45);
16111:
16112: RETURN l_new_er_num;
16113:
16114: EXCEPTION
16112: RETURN l_new_er_num;
16113:
16114: EXCEPTION
16115: WHEN Others THEN
16116: hr_utility.set_location('Exception Others Raised at Get_Header_Information',40);
16117: hr_utility.set_location('Leaving: '||l_proc_name, 45);
16118: RETURN -1;
16119: END Get_Header_EMR_Number;
16120:
16113:
16114: EXCEPTION
16115: WHEN Others THEN
16116: hr_utility.set_location('Exception Others Raised at Get_Header_Information',40);
16117: hr_utility.set_location('Leaving: '||l_proc_name, 45);
16118: RETURN -1;
16119: END Get_Header_EMR_Number;
16120:
16121: -- ===============================================================================
16134:
16135: l_proc_name Varchar2(150) := g_proc_name ||'.Get_Header_Submit_Code';
16136: l_submit_code Varchar(4) := '';
16137: BEGIN
16138: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
16139:
16140: OPEN csr_get_submit_code;
16141: FETCH csr_get_submit_code INTO l_submit_code;
16142: CLOSE csr_get_submit_code;
16140: OPEN csr_get_submit_code;
16141: FETCH csr_get_submit_code INTO l_submit_code;
16142: CLOSE csr_get_submit_code;
16143:
16144: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16145: RETURN l_submit_code;
16146: EXCEPTION
16147: WHEN Others THEN
16148: Hr_Utility.set_location('Exception Others Raised at Get_Submitter_code',40);
16144: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16145: RETURN l_submit_code;
16146: EXCEPTION
16147: WHEN Others THEN
16148: Hr_Utility.set_location('Exception Others Raised at Get_Submitter_code',40);
16149: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16150: RETURN -1;
16151: END Get_Header_Submit_Code;
16152:
16145: RETURN l_submit_code;
16146: EXCEPTION
16147: WHEN Others THEN
16148: Hr_Utility.set_location('Exception Others Raised at Get_Submitter_code',40);
16149: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16150: RETURN -1;
16151: END Get_Header_Submit_Code;
16152:
16153: -- ===============================================================================
16163:
16164:
16165: BEGIN
16166:
16167: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
16168: IF p_header_type = 'HEADER_FILE_SUB_PERIOD' THEN
16169: l_return_value := To_Char(Fnd_Date.canonical_to_date(Fnd_Date.date_to_canonical(g_conc_prog_details(0).beginningdt)),'YYYYMM');
16170: ELSIF p_header_type = 'HEADER_SUB_IDEN' THEN
16171: l_return_value := g_conc_prog_details(0).orgname;
16179: END IF;
16180:
16181: END IF;
16182:
16183: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16184:
16185: RETURN l_return_value;
16186: EXCEPTION
16187: WHEN Others THEN
16185: RETURN l_return_value;
16186: EXCEPTION
16187: WHEN Others THEN
16188: p_error_message :='SQL-ERRM :'||SQLERRM;
16189: Hr_Utility.set_location('..Exception Others Raised at Get_Header_Information'||p_error_message,40);
16190: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16191: RETURN l_return_value;
16192: END Get_Header_Information;
16193:
16186: EXCEPTION
16187: WHEN Others THEN
16188: p_error_message :='SQL-ERRM :'||SQLERRM;
16189: Hr_Utility.set_location('..Exception Others Raised at Get_Header_Information'||p_error_message,40);
16190: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16191: RETURN l_return_value;
16192: END Get_Header_Information;
16193:
16194:
16207: l_sing_number Number := 0;
16208: l_temp Number;
16209:
16210: BEGIN
16211: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
16212: IF p_amount IS NOT NULL THEN
16213: OPEN csr_get_sign(p_amount);
16214: FETCH csr_get_sign INTO l_temp;
16215: CLOSE csr_get_sign;
16218: ELSE
16219: RETURN ' ';
16220: END IF;
16221: END IF;
16222: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16223: RETURN ' ';
16224: EXCEPTION
16225: WHEN Others THEN
16226: Hr_Utility.set_location('Exception Others Raised at Get_Header_Information',40);
16222: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16223: RETURN ' ';
16224: EXCEPTION
16225: WHEN Others THEN
16226: Hr_Utility.set_location('Exception Others Raised at Get_Header_Information',40);
16227: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16228: RETURN ' ';
16229: END Get_Trailer_Amount_Sign;
16230:
16223: RETURN ' ';
16224: EXCEPTION
16225: WHEN Others THEN
16226: Hr_Utility.set_location('Exception Others Raised at Get_Header_Information',40);
16227: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16228: RETURN ' ';
16229: END Get_Trailer_Amount_Sign;
16230:
16231: -- ===============================================================================
16249: l_record_count NUMBER := 0;
16250:
16251: BEGIN
16252:
16253: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
16254:
16255: OPEN csr_get_a_record_count(p_rcd_1,p_rcd_2,p_emr_id);
16256: FETCH csr_get_a_record_count INTO l_record_count;
16257: CLOSE csr_get_a_record_count;
16255: OPEN csr_get_a_record_count(p_rcd_1,p_rcd_2,p_emr_id);
16256: FETCH csr_get_a_record_count INTO l_record_count;
16257: CLOSE csr_get_a_record_count;
16258:
16259: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16260:
16261: RETURN l_record_count;
16262:
16263: EXCEPTION
16261: RETURN l_record_count;
16262:
16263: EXCEPTION
16264: WHEN OTHERS THEN
16265: Hr_Utility.set_location('Exception Others Raised at Get_Header_Information',40);
16266: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16267: RETURN -1;
16268: END Get_All_Records_Count;
16269:
16262:
16263: EXCEPTION
16264: WHEN OTHERS THEN
16265: Hr_Utility.set_location('Exception Others Raised at Get_Header_Information',40);
16266: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16267: RETURN -1;
16268: END Get_All_Records_Count;
16269:
16270: -- ===============================================================================
16289:
16290: l_proc_name Varchar2(150) := g_proc_name ||'.Get_Trailer_Record_Count';
16291: l_record_count Number := 0;
16292: BEGIN
16293: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
16294: OPEN csr_get_record_count(p_rcd_1,p_rcd_2,p_rcd_3,p_emr_id);
16295: FETCH csr_get_record_count INTO l_record_count;
16296: CLOSE csr_get_record_count;
16297: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16293: Hr_Utility.set_location('Entering: '||l_proc_name, 5);
16294: OPEN csr_get_record_count(p_rcd_1,p_rcd_2,p_rcd_3,p_emr_id);
16295: FETCH csr_get_record_count INTO l_record_count;
16296: CLOSE csr_get_record_count;
16297: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16298: RETURN l_record_count;
16299: EXCEPTION
16300: WHEN Others THEN
16301: Hr_Utility.set_location('Exception Others Raised at Get_Trailer_Record_Count',40);
16297: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16298: RETURN l_record_count;
16299: EXCEPTION
16300: WHEN Others THEN
16301: Hr_Utility.set_location('Exception Others Raised at Get_Trailer_Record_Count',40);
16302: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16303: RETURN -1;
16304: END Get_Trailer_Record_Count;
16305:
16298: RETURN l_record_count;
16299: EXCEPTION
16300: WHEN Others THEN
16301: Hr_Utility.set_location('Exception Others Raised at Get_Trailer_Record_Count',40);
16302: Hr_Utility.set_location('Leaving: '||l_proc_name, 45);
16303: RETURN -1;
16304: END Get_Trailer_Record_Count;
16305:
16306: -- ================================================================================
16450: l_employer_index Number := 0;
16451:
16452:
16453: BEGIN
16454: Hr_Utility.set_location('Entering :---------'||l_proc_name, 5);
16455: -- Delete all the hidden Records
16456: FOR csr_rcd_rec IN csr_ext_rcd_id
16457: (c_hide_flag => 'Y' -- N=No Y=Yes
16458: ,c_rcd_type_cd => 'D')-- D=Detail, T=Total, H-Header
16481: --the sort value
16482: FOR val IN csr_get_rslt1
16483: (c_ext_rslt_id => Ben_Ext_Thread.g_ext_rslt_id )
16484: LOOP
16485: hr_utility.set_location('val 26 : '||val.val_26,10);
16486: IF g_org_list.EXISTS(val.val_25) THEN
16487: IF NOT g_ord_details1.EXISTS(val.val_25) THEN
16488: hr_utility.set_location('l_org_index : '||l_org_index,20);
16489: hr_utility.set_location('org : '||val.val_25,30);
16484: LOOP
16485: hr_utility.set_location('val 26 : '||val.val_26,10);
16486: IF g_org_list.EXISTS(val.val_25) THEN
16487: IF NOT g_ord_details1.EXISTS(val.val_25) THEN
16488: hr_utility.set_location('l_org_index : '||l_org_index,20);
16489: hr_utility.set_location('org : '||val.val_25,30);
16490: g_ord_details(l_org_index).gre_org_id := val.val_25;
16491: g_ord_details1(to_number(val.val_25)).gre_org_id := val.val_25;
16492: l_org_index := l_org_index + 1;
16485: hr_utility.set_location('val 26 : '||val.val_26,10);
16486: IF g_org_list.EXISTS(val.val_25) THEN
16487: IF NOT g_ord_details1.EXISTS(val.val_25) THEN
16488: hr_utility.set_location('l_org_index : '||l_org_index,20);
16489: hr_utility.set_location('org : '||val.val_25,30);
16490: g_ord_details(l_org_index).gre_org_id := val.val_25;
16491: g_ord_details1(to_number(val.val_25)).gre_org_id := val.val_25;
16492: l_org_index := l_org_index + 1;
16493: END IF;
16591: -- loop through all employers
16592: l_employer_count:=g_employer_list.COUNT;
16593: l_employer_index:=g_employer_list.FIRST;
16594: l_er_index:=0;
16595: Hr_Utility.set_location('l_employer_count --'||l_employer_count,20);
16596: WHILE l_employer_index IS NOT NULL
16597: LOOP
16598: --l_count Keeps track of total number of trailor records added per group
16599: l_count:=0;
16599: l_count:=0;
16600:
16601: l_org_grp_index:=0;
16602: -- for all orgs in the groups
16603: Hr_Utility.set_location('Grp count '||g_org_grp_list_cnt(l_employer_index).org_grp_count ,23);
16604: FOR l_org_count IN 1..g_org_grp_list_cnt(l_employer_index).org_grp_count
16605: LOOP
16606:
16607: l_group_org_index:=l_er_index * 1000 + l_org_grp_index;
16604: FOR l_org_count IN 1..g_org_grp_list_cnt(l_employer_index).org_grp_count
16605: LOOP
16606:
16607: l_group_org_index:=l_er_index * 1000 + l_org_grp_index;
16608: Hr_Utility.set_location('Current Org Id:---------'||g_employer_child_list(l_group_org_index).gre_org_id, 25);
16609: -- Get all rows/persons for this orgid
16610: FOR val IN csr_get_rslt
16611: (c_org_id => g_employer_child_list(l_group_org_index).gre_org_id
16612: ,c_ext_rslt_id => Ben_Ext_Thread.g_ext_rslt_id )
16610: FOR val IN csr_get_rslt
16611: (c_org_id => g_employer_child_list(l_group_org_index).gre_org_id
16612: ,c_ext_rslt_id => Ben_Ext_Thread.g_ext_rslt_id )
16613: LOOP
16614: --Hr_Utility.set_location('val'||val.EXT_RSLT_DTL_ID ,26);
16615: -- Get the individual row using sortid key
16616: -- So we will get only one record related data per person
16617: FOR ind_dtl IN csr_rslt_dtl_sort
16618: (c_val_26 => val.val_26
16719: IF l_new_rec.ext_rcd_id = g_rcd_dtls(8).ext_rcd_id AND
16720: l_new_rec.val_01 = '08'
16721: THEN
16722: -- Calculating Pension Salary ABP USZO(seq05)
16723: Hr_Utility.set_location('inside 99 prcesssing' ,26);
16724: --Hr_Utility.set_location('val'||val.EXT_RSLT_DTL_ID,26);
16725: Hr_Utility.set_location('l_R99_Yearly_Amount :'||To_Number(l_new_rec.val_05),12);
16726: l_R99_Yearly_Amount := l_R99_Yearly_Amount+Nvl(To_Number(l_new_rec.val_05),0);
16727: END IF;
16720: l_new_rec.val_01 = '08'
16721: THEN
16722: -- Calculating Pension Salary ABP USZO(seq05)
16723: Hr_Utility.set_location('inside 99 prcesssing' ,26);
16724: --Hr_Utility.set_location('val'||val.EXT_RSLT_DTL_ID,26);
16725: Hr_Utility.set_location('l_R99_Yearly_Amount :'||To_Number(l_new_rec.val_05),12);
16726: l_R99_Yearly_Amount := l_R99_Yearly_Amount+Nvl(To_Number(l_new_rec.val_05),0);
16727: END IF;
16728: -- Record9
16721: THEN
16722: -- Calculating Pension Salary ABP USZO(seq05)
16723: Hr_Utility.set_location('inside 99 prcesssing' ,26);
16724: --Hr_Utility.set_location('val'||val.EXT_RSLT_DTL_ID,26);
16725: Hr_Utility.set_location('l_R99_Yearly_Amount :'||To_Number(l_new_rec.val_05),12);
16726: l_R99_Yearly_Amount := l_R99_Yearly_Amount+Nvl(To_Number(l_new_rec.val_05),0);
16727: END IF;
16728: -- Record9
16729: IF l_new_rec.ext_rcd_id = g_rcd_dtls(9).ext_rcd_id AND
16792: l_record97_count:=l_record97_count + Get_Trailer_Record_Count(g_rcd_dtls(12).ext_rcd_id
16793: ,NULL
16794: ,NULL
16795: ,g_employer_child_list(l_group_org_index).gre_org_id);
16796: Hr_Utility.set_location('l_record99_count --'||l_record99_count,20);
16797: Hr_Utility.set_location('g_employer_child_list(l_group_org_index).gre_org_id --'||g_employer_child_list(l_group_org_index).gre_org_id,20);
16798: l_record99_count:=l_record99_count + Get_All_Records_Count(g_rcd_dtls(0).ext_rcd_id
16799: ,g_rcd_dtls(99).ext_rcd_id
16800: ,g_employer_child_list(l_group_org_index).gre_org_id);
16793: ,NULL
16794: ,NULL
16795: ,g_employer_child_list(l_group_org_index).gre_org_id);
16796: Hr_Utility.set_location('l_record99_count --'||l_record99_count,20);
16797: Hr_Utility.set_location('g_employer_child_list(l_group_org_index).gre_org_id --'||g_employer_child_list(l_group_org_index).gre_org_id,20);
16798: l_record99_count:=l_record99_count + Get_All_Records_Count(g_rcd_dtls(0).ext_rcd_id
16799: ,g_rcd_dtls(99).ext_rcd_id
16800: ,g_employer_child_list(l_group_org_index).gre_org_id);
16801:
17004: AND business_group_id = p_business_group_id;
17005:
17006: END LOOP;
17007:
17008: Hr_Utility.set_location('Leaving :'||l_proc_name, 25);
17009: RETURN l_return_value;
17010:
17011: EXCEPTION
17012: WHEN Others THEN
17009: RETURN l_return_value;
17010:
17011: EXCEPTION
17012: WHEN Others THEN
17013: Hr_Utility.set_location('..Exception when others raised..', 20);
17014: Hr_Utility.set_location('Leaving :'||l_proc_name, 25);
17015: RETURN -1;
17016: END Sort_Post_Process;
17017:
17010:
17011: EXCEPTION
17012: WHEN Others THEN
17013: Hr_Utility.set_location('..Exception when others raised..', 20);
17014: Hr_Utility.set_location('Leaving :'||l_proc_name, 25);
17015: RETURN -1;
17016: END Sort_Post_Process;
17017:
17018: END Pqp_Nl_Pension_Extracts;