340: l_in_pay_plan := p_pay_plan;
341: l_in_personnel_office_id := p_personnel_office_id;
342: l_exists := FALSE;
343:
344: -- hr_utility.trace_on(null,'sundar');
345: -- Replacing the insert dml with a call to the dt_fndate.change_ses_date procedure .
346:
347: dt_fndate.change_ses_date (p_ses_date => TRUNC (SYSDATE),
348: p_commit => l_commit
349: );
350: -- The previous code did not perform a commit after writing to fnd_sessions
351: -- Hence not issuing a Commit based on the value of the l_commit out variable
352:
353: hr_utility.set_location('Before Check if Personnel Office ID is having group box',1234);
354: -- Bug 3649933. Check if Personnel Office ID is having group box
355: IF l_in_personnel_office_id IS NOT NULL THEN
356: FOR l_check_group_box IN c_check_group_box(l_in_personnel_office_id) LOOP
357: l_grp_box_id := l_check_group_box.groupbox_id;
385: --
386: EXIT WHEN per_assign_cursor%NOTFOUND;
387: -- Initialize the PA Request ID
388: l_pa_request_id := NULL;
389: hr_utility.set_location('After fetch Person ID: ' || l_person_id,1234);
390: --
391: -- Bug 3941877
392: l_in_pay_plan := p_pay_plan;
393: l_in_personnel_office_id := p_personnel_office_id;
399: )
400: )
401: THEN
402:
403: hr_utility.set_location('Checking POI',1234);
404:
405: FOR wgi_no_payplan_rec IN cur_wgi_no_payplan (l_grade_id)
406: LOOP
407: l_per_pay_plan := wgi_no_payplan_rec.pay_plan;
409:
410: IF check_pay_plan (l_per_pay_plan) THEN
411: -- If the assignment ID is not present then do not process this employee
412: --
413: hr_utility.set_location('Checking Pay plan',1234);
414: IF p_log_flag = 'Y'
415: THEN
416: create_ghr_errorlog (p_program_name => l_proc,
417: p_log_text => 'Fetched Full Name : '
501: raise l_from_asg_exception;
502: END;
503: -- For non-retained employees
504:
505: hr_utility.set_location('After fetching from assignments',1234);
506:
507: l_check_pay_plan := l_from_pay_plan;
508: l_check_step_or_rate := l_from_step_or_rate;
509: --- Sundar 3386203
557: p_from_pay_plan => l_check_pay_plan
558: )
559: )
560: THEN
561: hr_utility.set_location('After checkpayplanparm',1234);
562: hr_utility.set_location ('Pay Plan criteria satisfied ',
563: 1000
564: );
565:
558: )
559: )
560: THEN
561: hr_utility.set_location('After checkpayplanparm',1234);
562: hr_utility.set_location ('Pay Plan criteria satisfied ',
563: 1000
564: );
565:
566: IF p_log_flag = 'Y'
595: )
596: )
597: THEN*/
598: -- Set the tmp pay plan for checking purposes
599: hr_utility.set_location ('POI criteria satisfied ' || l_in_personnel_office_id,
600: 1000
601: );
602: -- Bug 3649933. Check if Personnel Office ID is having group box
603: IF l_in_personnel_office_id IS NOT NULL THEN
603: IF l_in_personnel_office_id IS NOT NULL THEN
604: FOR l_check_group_box IN c_check_group_box(l_in_personnel_office_id) LOOP
605: l_grp_box_id := l_check_group_box.groupbox_id;
606: END LOOP;
607: hr_utility.set_location ('l_grp_box_id ' || l_grp_box_id,
608: 1000);
609: IF l_grp_box_id IS NULL THEN
610: -- If No group box is assigned, then throw an error
611: l_errbuf := 'Group Box does not exist for this Personnel office id ' || l_in_personnel_office_id;
608: 1000);
609: IF l_grp_box_id IS NULL THEN
610: -- If No group box is assigned, then throw an error
611: l_errbuf := 'Group Box does not exist for this Personnel office id ' || l_in_personnel_office_id;
612: hr_utility.set_location ('Error buff set',1000);
613: RAISE l_no_groupbox_exception;
614: END IF;
615: END IF; -- If PO ID is not null
616: -- End Bug 3649933.
807: IF l_check_pay_plan IN ('GM','GR') THEN --Bug# 6603968
808: -- Bug#5482191 Process 893 for GM Employees after 07-JAN-2007
809: IF l_effective_date < to_date('07/01/2007','DD/MM/YYYY') THEN
810: l_first_noa_code := '891';
811: hr_utility.set_location ('WGI noa code 891 ', 1 );
812: ELSE
813: l_first_noa_code := '893';
814: END IF;
815: -- bug# 5725910 code commented as this is not necessary..891 should not be assigned to first noa code irrespective of the effective date.
840: END IF;
841:
842: --
843: -- Check in PA Reqest table if there is a NOA of this person is existing already
844: hr_utility.set_location ('Check in PA Reqest table if there is a NOA of this person ',
845: 1000
846: );
847:
848: IF (person_in_pa_requests (p_person_id => l_person_id,
929: IF (check_pay_plan (p_pay_plan => l_tmp_from_pay_plan
930: )
931: )
932: THEN -- 6th If for Check Pay Plan
933: hr_utility.set_location ( 'Pay Plan valid l_person_id'
934: || l_person_id,
935: 1000
936: );
937:
1163: COMMIT;
1164: --
1165: -- set the start wgi flag
1166: --
1167: hr_utility.set_location ( 'Create SF52 l_person_id'
1168: || l_person_id,
1169: 1000
1170: );
1171: l_start_wgi_wf_flag := 'Y';
1451: l_to_step_or_rate :=
1452: l_pay_calc_out_rec_type.out_step_or_rate;
1453: l_to_retention_allowance :=
1454: l_pay_calc_out_rec_type.retention_allowance;
1455: hr_utility.set_location ( 'retention_allowance = '
1456: || TO_CHAR (l_to_retention_allowance
1457: ),
1458: 10
1459: );
1456: || TO_CHAR (l_to_retention_allowance
1457: ),
1458: 10
1459: );
1460: hr_utility.set_location ( 'Supervisory Diff Amount = '
1461: || TO_CHAR (l_to_supervisory_differential
1462: ),
1463: 10
1464: );
1467: ------Other Pay new requirement
1468: l_new_retention_allowance := NULL;
1469: l_ret_calc_perc := 0;
1470:
1471: hr_utility.set_location('retention_allowance = ' || to_char(l_to_retention_allowance),10);
1472: hr_utility.set_location('Supervisory Diff Amount = ' || to_char(l_to_supervisory_differential),10);
1473:
1474: if l_to_retention_allowance is not null then
1475: if l_from_basic_pay <> l_to_basic_pay then
1468: l_new_retention_allowance := NULL;
1469: l_ret_calc_perc := 0;
1470:
1471: hr_utility.set_location('retention_allowance = ' || to_char(l_to_retention_allowance),10);
1472: hr_utility.set_location('Supervisory Diff Amount = ' || to_char(l_to_supervisory_differential),10);
1473:
1474: if l_to_retention_allowance is not null then
1475: if l_from_basic_pay <> l_to_basic_pay then
1476: if l_retention_allow_percentage is null then
1489: end if;
1490:
1491: l_to_retention_allowance := l_new_retention_allowance;
1492:
1493: hr_utility.set_location('retention_allowance = ' || to_char(l_to_retention_allowance),12);
1494: hr_utility.set_location('Supervisory Diff Amount = ' || to_char(l_to_supervisory_differential),12);
1495:
1496: l_to_other_pay_amount := nvl(l_to_au_overtime,0)
1497: + nvl(l_to_availability_pay,0)
1490:
1491: l_to_retention_allowance := l_new_retention_allowance;
1492:
1493: hr_utility.set_location('retention_allowance = ' || to_char(l_to_retention_allowance),12);
1494: hr_utility.set_location('Supervisory Diff Amount = ' || to_char(l_to_supervisory_differential),12);
1495:
1496: l_to_other_pay_amount := nvl(l_to_au_overtime,0)
1497: + nvl(l_to_availability_pay,0)
1498: + nvl(l_to_retention_allowance,0)
1923: RAISE l_max_step_exception;
1924: END IF; -- (IF checkIfMaxPayPlan)
1925: END IF; -- IF ( p_effective_date >= (l_wgi_pay_dat
1926: ELSE -- Add for Bug 3035967 fix.
1927: hr_utility.set_location('error in pay date',2500) ;
1928: IF l_wgi_due_date IS NOT NULL THEN
1929: -- Check if max step is reached. If it has, then ignore this employee
1930: IF (checkifmaxpayplan (p_from_pay_plan => l_from_pay_plan,
1931: p_from_step_or_rate => l_from_step_or_rate
1969: EXCEPTION
1970: -- Bug 3649933 To raise error when group box does not exist.
1971:
1972: WHEN l_no_groupbox_exception THEN
1973: hr_utility.set_location('error in group box',2500) ;
1974: create_ghr_errorlog (p_program_name => l_proc,
1975: p_log_text => 'ERROR encountered in processing Auto WGI for : '
1976: || l_full_name
1977: || ' ** Error Message ** : '
1984: p_log_date => SYSDATE
1985: );
1986: l_retcode := 1;
1987: WHEN l_from_asg_exception THEN
1988: hr_utility.set_location('error in fetch from asg',2500) ;
1989: create_ghr_errorlog (p_program_name => l_proc,
1990: p_log_text => 'ERROR encountered in processing Auto WGI for : '
1991: || l_full_name
1992: || ' ** Error Message ** : '
2005: );
2006:
2007: l_retcode := 1;
2008: WHEN l_retained_grade_exception THEN
2009: hr_utility.set_location('error in l_retained_grade_exception',2500) ;
2010: create_ghr_errorlog (p_program_name => l_proc,
2011: p_log_text => 'ERROR encountered in processing Auto WGI for : '
2012: || l_full_name
2013: || ' ** Error Message ** : '
2026: );
2027:
2028: l_retcode := 1;
2029: WHEN l_max_step_exception THEN
2030: hr_utility.set_location('error in l_retained_grade_exception',2500) ;
2031: create_ghr_errorlog (p_program_name => l_proc,
2032: p_log_text => 'ERROR encountered in processing Auto WGI for : '
2033: || l_full_name
2034: || ' Error Message :'
2050: THEN
2051: --bug# 5685874 reassigning l_errbuf to null so that buffer overflow does not occur.
2052: l_errbuf := NULL;
2053:
2054: hr_utility.set_location('error in OTHERS' || SQLCODE ,2500) ;
2055: create_ghr_errorlog (p_program_name => l_proc,
2056: p_log_text => 'ERROR encountered in processing Auto WGI for : '
2057: || l_full_name
2058: || ' ** Error Message ** : '
2124: END;
2125: END LOOP;
2126: p_retcode := l_retcode;
2127: p_errbuf := l_errbuf;
2128: -- hr_utility.trace_off;
2129: CLOSE per_assign_cursor;
2130: EXCEPTION
2131: -- Bug 3649933 To raise error when group box does not exist.
2132: WHEN l_no_groupbox_exception THEN