DBA Data[Home] [Help]

APPS.PSP_ENC_CREATE_LINES SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 32

  PROCEDURE insert_into_enc_lines(
			L_ENC_ELEMENT_TYPE_ID 		IN 	NUMBER,
			L_ENCUMBRANCE_DATE 		IN 	DATE,
			L_DR_CR_FLAG 			IN 	VARCHAR2,
			L_ENCUMBRANCE_AMOUNT 		IN 	NUMBER,
			L_ENC_LINE_TYPE 		IN 	VARCHAR2,
 			L_SCHEDULE_LINE_ID 		IN 	NUMBER,
			L_ORG_SCHEDULE_ID		IN 	NUMBER,
			L_DEFAULT_ORG_ACCOUNT_ID 	IN 	NUMBER,
        		L_SUSPENSE_ORG_ACCOUNT_ID 	IN 	NUMBER,
			L_ELEMENT_ACCOUNT_ID 		IN 	NUMBER,
        		L_GL_PROJECT_FLAG 		IN 	VARCHAR2,
			L_PERSON_ID 			IN 	NUMBER,
			L_ASSIGNMENT_ID 		IN 	NUMBER,
			L_AWARD_ID 			IN 	NUMBER,
			L_TASK_ID 			IN 	NUMBER,
			L_EXPENDITURE_TYPE 		IN 	VARCHAR2,
			L_EXPENDITURE_ORGANIZATION_ID 	IN 	NUMBER,
			L_PROJECT_ID 			IN	NUMBER,
			L_GL_CODE_COMBINATION_ID 	IN 	NUMBER,
			L_TIME_PERIOD_ID 		IN 	NUMBER,
			L_PAYROLL_ID 			IN 	NUMBER,
			l_business_group_id		IN	NUMBER,
			L_SET_OF_BOOKS_ID 		IN 	NUMBER,
			L_SUSPENSE_REASON_CODE		IN 	VARCHAR2,
        		L_DEFAULT_REASON_CODE 		IN 	VARCHAR2,
                        L_CHANGE_FLAG                   IN      VARCHAR2,
			L_ENC_START_DATE		IN	DATE,	--Added the new parameter
			L_ENC_END_DATE			IN	DATE,	--Added the new parameter
			p_attribute_category		IN	VARCHAR2,		-- Introduced DFF parameters for bug fix 2908859
			p_attribute1			IN	VARCHAR2,
			p_attribute2			IN	VARCHAR2,
			p_attribute3			IN	VARCHAR2,
			p_attribute4			IN	VARCHAR2,
			p_attribute5			IN	VARCHAR2,
			p_attribute6			IN	VARCHAR2,
			p_attribute7			IN	VARCHAR2,
			p_attribute8			IN	VARCHAR2,
			p_attribute9			IN	VARCHAR2,
			p_attribute10			IN	VARCHAR2,
			p_orig_gl_code_combination_id	IN	NUMBER,
			p_orig_project_id		IN	NUMBER,
			p_orig_task_id			IN	NUMBER,
			p_orig_award_id			IN	NUMBER,
			p_orig_expenditure_org_id	IN	NUMBER,
			p_orig_expenditure_type		IN	VARCHAR2,
			p_hierarchy_code		IN	VARCHAR2,
			p_return_status 		OUT NOCOPY 	VARCHAR2);
Line: 113

 Procedure insert_enc_lines_from_arrays(
 			p_payroll_id		IN	NUMBER,
 			p_business_group_id	IN	NUMBER,
 			p_set_of_books_id	IN	NUMBER,
 			p_enc_line_type		IN	VARCHAR2,
 			p_return_status		OUT NOCOPY	VARCHAR2);
Line: 176

PROCEDURE	delete_previous_error_log(p_assignment_id	IN	NUMBER,
								p_payroll_id	IN	NUMBER,
								p_payroll_action_id	IN	NUMBER);
Line: 180

PROCEDURE update_hierarchy_dates (p_assignment_id	IN	NUMBER,
					p_payroll_id		IN	NUMBER,
					p_payroll_action_id	IN	NUMBER,
					p_return_status		OUT NOCOPY	VARCHAR2);
Line: 422

				  process and this is used in the insert statement of PSP_ENC_CHANGED_ASSIGNMENTS.
				  For this we have created a temp table PSP_ASG_END_DATES in order
				  to hold assignment information until the CUEL process completes.

				  Before this process was introduced the cursor query of
				  ORACLE_PAYROLL_ASG_END_DATE (ORACLE PAYROLL CURSOR) is used in all the
				  insert statements and the query executes for every assignment multiple
				  times which is the actual cause for this performance issue. So instead
				  of executing the query multiple times for the same assignment we have
				  introduced the CACHING MECHANISM.

				  In this mechanism the query executes only once for an assignment and stores
				  the assignment information in the temp table and once again if the same
				  assignment is used for querying the data then the process picks up the
				  data from the temp table.

				  Similarly for OTHER PAYROLL we have introduced the same mechanism
				  with the help of NON_ORACLE_ASG_END_DATE (OTHER PAYROLL CURSOR).

				  And the variable g_payroll_mode helps to choose the cursors respectively
				  basing on the type of payroll which they have used.

				  2)
				  GET_PAYROLL_PAY_END_DATE function is introduced to avoid using the
				  same query of the cursor PAYROLL_PAY_END_DATE_CUR multiple times.
				  For this we have used a normal variable.


*************************************************************************************** */

function get_asg_pay_end_date(p_payroll_mode IN VARCHAR,
						p_payroll_action_id IN NUMBER,
						p_assignmnet_id IN NUMBER,
						p_business_group_id IN NUMBER,
						p_payroll_id IN NUMBER
						) return date IS

PRAGMA AUTONOMOUS_TRANSACTION;
Line: 462

SELECT 	/*+ use_nl(PTP)
								INDEX(ptp PER_TIME_PERIODS_N50)
								INDEX(paa PAY_ASSIGNMENT_ACTIONS_N4)*/
					Max(ptp.end_date)
FROM	pay_payroll_actions ppa,
	pay_assignment_actions paa,
	per_time_periods ptp
WHERE	paa.assignment_id = p_assignmnet_id
AND	ppa.payroll_action_id = paa.payroll_action_id
AND	ppa.business_group_id = p_business_group_id
AND	ppa.payroll_id = p_payroll_id
AND	ppa.action_type	IN ( 'R','Q')
AND	paa.action_status = 'C'
and 	ppa.date_earned between ptp.start_date and ptp.end_date
and ptp.payroll_id = ppa.payroll_id;
Line: 480

SELECT  /*+ use_nl(PTP)
								INDEX(ptp PER_TIME_PERIODS_N50)
								INDEX(paa PAY_ASSIGNMENT_ACTIONS_N4)*/
        max (ptp.end_date)
FROM    pay_payroll_actions ppa
      , pay_assignment_actions paa
      , per_time_periods ptp
WHERE   paa.assignment_id (+) = p_assignmnet_id
AND     ppa.payroll_action_id = paa.payroll_action_id (+)
AND     ppa.business_group_id = p_business_group_id
AND     ppa.payroll_id = p_payroll_id
AND     ppa.action_type IN ('R', 'Q')
AND     paa.action_status (+) = 'C'
AND     ppa.date_earned
        BETWEEN ptp.start_date
        AND     ptp.end_date
AND     ptp.payroll_id = ppa.payroll_id;
Line: 499

select assignment_id,asg_end_date
from psp_asg_end_dates
where assignment_id = p_assignmnet_id
and payroll_id = p_payroll_id
and bg_grp_id = p_business_group_id
and payroll_action_id = p_payroll_action_id;
Line: 519

	--	fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) ||' fnd ::: If --- > assignment_id details is inserted in the table '||p_assignmnet_id);
Line: 520

	--	hr_utility.trace(' hr:::If --- > assignment_id details is inserted in the table '||p_assignmnet_id);
Line: 539

		insert into psp_asg_end_dates (PAYROLL_ACTION_ID ,ASSIGNMENT_ID  ,PAYROLL_ID ,BG_GRP_ID  ,ASG_END_DATE ) --jnerella 26/07/2012
			 values(p_payroll_action_id,p_assignmnet_id,p_payroll_id,p_business_group_id,l_asgn_end_date);
Line: 541

	--	fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) ||' fnd:::If table --- > insert '||sql%rowcount);
Line: 542

	--	hr_utility.trace(' hr:::If table --- > insert '||sql%rowcount);
Line: 565

SELECT  /*+ INDEX(ptp PER_TIME_PERIODS_N50)*/
        max (ptp.end_date)
FROM    pay_payroll_actions ppa
       ,pay_assignment_actions paa
       ,per_time_periods ptp
WHERE   ppa.payroll_action_id = paa.payroll_action_id (+)
AND     ppa.payroll_id = p_payroll_id
AND     ppa.action_type IN ('R','Q')
AND     nvl (paa.action_status,ppa.action_status) = 'C'
AND     ppa.date_earned BETWEEN ptp.start_date AND     ptp.end_date
AND     ptp.payroll_id = ppa.payroll_id;
Line: 612

    SELECT paf.assignment_number,
     ppf.employee_number
     FROM
     per_assignments_f paf,per_people_f ppf
     WHERE paf.assignment_id =p_assignment_id
     AND   paf.person_id =ppf.person_id
     AND   p_effective_date between paf.effective_start_date and paf.effective_end_date
     AND   p_effective_date between ppf.effective_start_date and ppf.effective_end_date;
Line: 646

  SELECT peed.period_end_date,
  	 peed.enc_end_date_id,
	NVL(peed.prev_enc_end_date, fnd_date.canonical_to_date('4712/12/31')) prev_enc_end_date
  FROM   psp_enc_end_dates peed
  WHERE
--- removed sysdate check for  Bug fix 2597666
    peed.business_group_id = p_business_group_id
  AND    peed.set_of_books_id   = p_set_of_books_id
  AND	 peed.default_org_flag  = 'Y';
Line: 663

 SELECT COUNT(1)
 FROM	psp_enc_end_dates peed
 WHERE
-- removed sysdate check for Bug Fix 2597666
peed.business_group_id = p_business_group_id
 AND	peed.set_of_books_id   = p_set_of_books_id
 AND	peed.default_org_flag= 'Y';
Line: 678

  	-- moved the select to Cursor
	OPEN c_cnt_default_org;
Line: 702

		UPDATE	psp_enc_end_dates peed
		SET	peed.prev_enc_end_date = p_enc_org_end_date
		WHERE	peed.enc_end_date_id   = l_enc_end_date_id;
Line: 838

SELECT	time_period_id,
	SUM(period_amount)
FROM	(SELECT ((MAX(fnd_number.canonical_to_number(NVL(peev.screen_entry_value, 0))) *
			SUM(psp_general.business_days(	GREATEST(ptp.start_date, paf.effective_start_date, peev.effective_start_date),
							LEAST(ptp.end_date, paf.effective_end_date, peev.effective_end_date),p_assignment_id)) ) /
			DECODE(psp_general.business_days(MAX(ptp.start_date), MAX(ptp.end_date),p_assignment_id), 0, 1,
					psp_general.business_days(MAX(ptp.start_date), MAX(ptp.end_date),p_assignment_id)) ) period_amount,
		ptp.time_period_id
	FROM	pay_element_entry_values_f peev,
		pay_input_values_f piv,
		pay_element_entries_f pee,
		pay_element_links_f pel,
		pay_element_types_f pet,
		psp_enc_elements peel,
		per_assignments_f paf,
		per_assignment_status_types past,
		per_time_periods ptp
	WHERE	peev.element_entry_id		=	pee.element_entry_id
	AND	peev.effective_start_date	<=	paf.effective_end_date
	AND	peev.effective_end_date		>=	paf.effective_start_date
	AND	pel.element_link_id		=	pee.element_link_id
	AND	pel.element_type_id		=	p_element_type_id
	AND	pel.effective_start_date	<=	paf.effective_end_date
	AND	pel.effective_end_date		>=	paf.effective_start_date
	AND	pet.effective_start_date	<=	paf.effective_end_date
	AND	pet.effective_end_date		>=	paf.effective_start_date
	AND	pee.assignment_id		=	p_assignment_id
	AND	pee.effective_start_date	<=	paf.effective_end_date
	AND	pee.effective_end_date		>=	paf.effective_start_date
	AND	peev.input_value_id		=	piv.input_value_id
	AND	piv.input_value_id		=	peel.input_value_id
	AND	pet.element_type_id		=	p_element_type_id
	AND	piv.effective_start_date	<=	paf.effective_end_date
	AND	piv.effective_end_date		>=	paf.effective_start_date
	AND	piv.effective_start_date	<=	peev.effective_end_date
	AND	piv.effective_end_date		>=	peev.effective_start_date
	AND	pee.effective_start_date	<=	peev.effective_end_date
	AND	pee.effective_end_date		>=	peev.effective_start_date
	AND	ptp.start_date			<=	paf.effective_end_date
	AND	ptp.end_date			>=	paf.effective_start_date
	AND	pel.effective_start_date	<=	pee.effective_end_date
	AND	pel.effective_end_date		>=	pee.effective_start_date
	AND	pet.effective_start_date	<=	pel.effective_end_date
	AND	pet.effective_end_date		>=	pel.effective_start_date
	AND	paf.assignment_id		=	p_assignment_id
	AND	paf.effective_start_date	<=	l_max_end_date
	AND	paf.effective_end_date		>=	l_min_start_date
	AND	past.assignment_status_type_id	=	paf.assignment_status_type_id
	AND	past.per_system_status		=	'ACTIVE_ASSIGN'
	AND	pel.business_group_id		=	p_business_group_id
	AND	peel.business_group_id		=	p_business_group_id
	AND	peel.set_of_books_id		=	p_set_of_books_id
	AND	ptp.payroll_id			=	p_payroll_id
	AND	ptp.time_period_id		>=	r_enc_period.r_time_period_id(1)
        AND     SUBSTR(piv.uom, 1, 1)		=	g_uom
	GROUP BY ptp.time_period_id,
		peev.effective_start_date,
		peev.effective_end_date)
GROUP BY time_period_id;
Line: 900

SELECT	ppp.change_date,
	ppp.proposed_salary_n proposed_salary,
	NVL(ppb.pay_basis, ' ') pay_basis,
	ppb.pay_annualization_factor,
	paf.effective_start_date,
	paf.effective_end_date
FROM	per_pay_proposals ppp,
	pay_input_values_f piv,
	per_pay_bases ppb,
	per_all_assignments_f paf,
	per_assignment_status_types past
WHERE	paf.assignment_id =p_assignment_id
AND	(	ppp.change_date BETWEEN paf.effective_start_date AND paf.effective_end_date
	OR	ppp.change_date =	(SELECT	MAX(ppp1.change_date)
					FROM	per_pay_proposals ppp1
					WHERE	ppp1.assignment_id = p_assignment_id
					AND	ppp1.approved = 'Y'
					AND	ppp1.change_date <= paf.effective_start_date))
AND	paf.pay_basis_id = ppb.pay_basis_id
AND	ppp.assignment_id = p_assignment_id
AND     past.assignment_status_type_id = paf.assignment_status_type_id
AND	past.per_system_status = 'ACTIVE_ASSIGN'
AND	piv.element_type_id +0 = p_element_type_id
AND	ppp.approved = 'Y'
AND	((ppp.change_date >= (SELECT	NVL(MAX(ppp1.change_date), l_min_start_date)
				FROM	per_pay_proposals ppp1
				WHERE	ppp1.assignment_id = p_assignment_id
				AND	ppp1.approved = 'Y'
				AND	ppp1.change_date <= l_min_start_date))
AND	(ppp.change_date <=	(SELECT	NVL(MIN(ppp1.change_date), l_max_end_date + 1)
					FROM	per_pay_proposals ppp1
					WHERE	ppp1.assignment_id = p_assignment_id
					AND	ppp1.approved = 'Y'
					AND	ppp1.change_date >= l_max_end_date)))
AND	ppb.input_value_id = piv.input_value_id
AND	ppp.change_date BETWEEN piv.effective_start_date AND piv.effective_end_date
ORDER BY paf.effective_end_date DESC, ppp.change_date DESC;
Line: 939

SELECT	number_per_fiscal_year
FROM	per_time_period_types ptpt
WHERE	period_type = (SELECT	ppf.period_type
			FROM	pay_payrolls_f ppf
			WHERE	ppf.payroll_id = p_payroll_id
/* Added for Bug 3869766 */
			AND	rownum = 1);
Line: 948

SELECT	DISTINCT GREATEST(paf.effective_start_date, peev.effective_start_date) element_start_date,
	LEAST(paf.effective_end_date, peev.effective_end_date) element_end_date,
	fnd_number.canonical_to_number(NVL(peev.screen_entry_value, 0)) pay_amount
FROM	pay_element_entry_values_f peev,
	pay_input_values_f piv,
	pay_element_entries_f pee,
	pay_element_links_f pel,
	pay_element_types_f pet,
	psp_enc_elements peel,
	per_assignments_f paf,
	per_assignment_status_types past
WHERE	peev.element_entry_id		=	pee.element_entry_id
AND	peev.effective_start_date	<=	paf.effective_end_date
AND	peev.effective_end_date		>=	paf.effective_start_date
AND	pel.element_link_id		=	pee.element_link_id
AND	pel.element_type_id		=	p_element_type_id
AND	pel.effective_start_date	<=	paf.effective_end_date
AND	pel.effective_end_date		>=	paf.effective_start_date
AND	pet.effective_start_date	<=	paf.effective_end_date
AND	pet.effective_end_date		>=	paf.effective_start_date
AND	pee.assignment_id		=	p_assignment_id
AND	pee.effective_start_date	<=	paf.effective_end_date
AND	pee.effective_end_date		>=	paf.effective_start_date
AND	peev.input_value_id		=	piv.input_value_id
AND	piv.input_value_id		=	peel.input_value_id
AND	pet.element_type_id		=	p_element_type_id
AND	piv.effective_start_date	<=	paf.effective_end_date
AND	piv.effective_end_date		>=	paf.effective_start_date
AND	piv.effective_start_date	<=	peev.effective_end_date
AND	piv.effective_end_date		>=	peev.effective_start_date
AND	pee.effective_start_date	<=	peev.effective_end_date
AND	pee.effective_end_date		>=	peev.effective_start_date
AND	pel.effective_start_date	<=	pee.effective_end_date
AND	pel.effective_end_date		>=	pee.effective_start_date
AND	pet.effective_start_date	<=	pel.effective_end_date
AND	pet.effective_end_date		>=	pel.effective_start_date
AND	paf.assignment_id		=	p_assignment_id
AND	paf.effective_start_date	<=	l_max_end_date
AND	paf.effective_end_date		>=	l_min_start_date
AND     past.assignment_status_type_id	=	paf.assignment_status_type_id
AND	past.per_system_status		=	'ACTIVE_ASSIGN'
AND	SUBSTR(piv.uom, 1, 1)		=	g_uom
AND	pel.business_group_id		=	p_business_group_id
AND	peel.business_group_id		=	p_business_group_id
AND	peel.set_of_books_id		=	p_set_of_books_id
ORDER BY element_start_date,element_end_date; 				-- Added for bug 12724506
Line: 996

SELECT	NVL(input_value_id, -1),
		formula_id
FROM	psp_enc_elements pee
WHERE	element_type_id = p_element_type_id
AND	(	formula_id IS NOT NULL
	OR	EXISTS	(SELECT	1
			FROM	pay_input_values_f piv
			WHERE	piv.input_value_id = pee.input_value_id
			AND	SUBSTR(piv.uom, 1, 1) = g_uom));
Line: 1050

SELECT	GREATEST(pee.effective_start_date, paf.effective_start_date, ff.effective_start_date) start_date,
	LEAST(pee.effective_end_date, paf.effective_end_date, ff.effective_end_date) end_date
FROM	ff_formulas_f ff,
	per_assignments_f paf,
	pay_element_entries_f pee
WHERE	formula_id = l_formula_id
AND	paf.assignment_id = p_assignment_id
AND	pee.assignment_id = p_assignment_id
AND	pee.element_type_id = p_element_type_id
AND	paf.effective_start_date <= l_max_end_date
AND	paf.effective_end_date >= l_min_start_date
AND	pee.effective_start_date <= l_max_end_date
AND	pee.effective_end_date >= l_min_start_date
AND	ff.effective_start_date <= l_max_end_date
AND	ff.effective_end_date >= l_min_start_date
AND	paf.effective_start_date <= pee.effective_end_date
AND	paf.effective_end_date >= pee.effective_start_date
AND	paf.effective_start_date <= ff.effective_end_date
AND	paf.effective_end_date >= ff.effective_start_date
AND	pee.effective_start_date <= ff.effective_end_date
AND	pee.effective_end_date >= ff.effective_start_date
ORDER BY start_date,end_date;				-- Added for bug 12724506
Line: 1186

								l_inputs.DELETE;
Line: 1187

								l_outputs.DELETE;
Line: 1567

	--When called in Update/Quick Update Mode periods between last payroll run date and max. encumbered date
	  for that assignment are considered.
       --All the  active assignment chunks are Bulk Collected inot r_enc_period RECORD.
--> Next, go through a loop (for each record of r_enc_period) to calculate the encumbrance amount for each active assignment chunk within a period
	in the payroll.
	--> For each active assignment chunk, calculate the daily rate (from Encumbrance amount and business days)
	--> Then, go through a loop to find the schedule for that assignment chunk by going through the schedule
		hierarchy.
		--> Once the schedule has been determined, then create encumbrance lines
	--> Exit out of the First Loop when the assignment start date > Enumbrance End date Calculated within each
	    Hierarchy for each CI. For GL Encumrbance End date = Org. Default End Date for POETA it is computed
	    thorugh procedure Obtain_Enc_Poeta_Enc_date.
--> Close First Loop


***********************************************************************************/

PROCEDURE create_lines(	p_assignment_id 	IN NUMBER,
			p_payroll_id 		IN NUMBER,
		        p_element_type_id 	IN NUMBER,
			p_last_paid_date 	IN DATE,
			p_return_status		OUT NOCOPY VARCHAR2) IS
CURSOR	enc_period_cur IS
SELECT  ptp.time_period_id,
	ptp.start_date,
	ptp.end_date,
	GREATEST(ptp.start_date, paf.effective_start_date),
	LEAST(ptp.end_date, paf.effective_end_date),
	DECODE(g_Eff_Date_Value,	1, ptp.end_date,
					2, ptp.start_date,
					3, ptp.regular_payment_date,
					4, ptp.default_dd_date,
					5, ptp.cut_off_date) effective_date,
	'Y',
	0,
	NULL
FROM	per_time_periods ptp,
	per_all_assignments_f paf,
	per_assignment_status_types past
WHERE	ptp.payroll_id = p_payroll_id
AND 	paf.assignment_id = p_assignment_id
AND	ptp.start_date <= paf.effective_end_date
AND	ptp.end_date >= paf.effective_start_date
AND	past.assignment_status_type_id = paf.assignment_status_type_id
AND	past.per_system_status = 'ACTIVE_ASSIGN'
AND	paf.payroll_id=p_payroll_id
AND	ptp.start_date >= p_last_paid_date
AND	paf.effective_start_date <= g_enc_org_end_date
AND	(g_actual_term_date IS NULL OR ptp.start_date <= g_actual_term_date)
AND	(g_pateo_end_date IS NULL OR ptp.start_date <= g_pateo_end_date)
ORDER BY 1, 4;
Line: 1620

SELECT	paf.person_id
FROM	per_all_assignments_f paf
WHERE   paf.assignment_id =p_assignment_id
AND	ROWNUM=1;
Line: 1705

SELECT	organization_id
FROM	per_all_assignments_f
WHERE	assignment_id = p_assignment_id
AND		payroll_id = p_payroll_id
AND		effective_end_date >= l_asg_start_date
AND		ROWNUM = 1;
Line: 1713

SELECT	name
FROM	hr_organization_units
WHERE	organization_id = l_organization_id;
Line: 1718

SELECT	SEGMENT1
FROM	pa_projects_all
WHERE	project_id = l_project_id;
Line: 1723

SELECT	award_number
FROM	gms_awards_all
WHERE	award_id = l_award_id;
Line: 1728

SELECT	task_number
FROM	pa_tasks_expend_v  -- Bug : 16391366 (20/03/2013)
WHERE	task_id = l_task_id;
Line: 1733

SELECT	name
FROM	hr_organization_units
WHERE	organization_id = l_expenditure_org_id;
Line: 1833

					insert_into_enc_lines(
						p_element_type_id,
						l_effective_date,
						g_dr_cr_flag ,
						ROUND(l_dist_amount, g_precision),
						g_enc_line_type,
						l_schedule_line_id,
						l_org_schedule_id,
						l_default_account_id,
						l_suspense_account_id,
						l_element_account_id,
						l_gl_project_flag,
						l_person_id,
						p_assignment_id,
						l_award_id,
						l_task_id,
						l_expenditure_type,
						l_expenditure_org_id,
						l_project_id,
						l_gl_code_combination_id,
						r_enc_period.r_time_period_id(p_chunk_pointer),
						p_payroll_id,
						g_business_group_id,
						g_set_of_books_id,
						l_sa_reason_code,
						l_da_reason_code,
						'N',
						t_poeta_gl_hier_array(i).r_enc_start_date,
						t_poeta_gl_hier_array(i).r_enc_end_date,
						l_attribute_category,
						l_attribute1,
						l_attribute2,
						l_attribute3,
						l_attribute4,
						l_attribute5,
						l_attribute6,
						l_attribute7,
						l_attribute8,
						l_attribute9,
						l_attribute10,
						l_orig_gl_code_combination_id,
						l_orig_project_id,
						l_orig_task_id,
						l_orig_award_id,
						l_orig_expenditure_org_id,
						l_orig_expenditure_type,
						l_process_flag,
						l_return_status);
Line: 2031

						insert_into_enc_lines
							(p_element_type_id,
							l_effective_date,
							g_dr_cr_flag,
							ROUND(l_dist_amount,g_precision),
							g_enc_line_type,
							l_schedule_line_id,
							l_org_schedule_id,
							l_default_account_id,
							l_suspense_account_id,
							l_element_account_id,
							l_gl_project_flag,
							l_person_id,
							p_assignment_id,
							l_award_id,
							l_task_id,
							l_expenditure_type,
							l_expenditure_org_id,
							l_project_id,
							l_gl_code_combination_id,
							r_enc_period.r_time_period_id(p_chunk_pointer),
							p_payroll_id,
							g_business_group_id,
							g_set_of_books_id,
							l_sa_reason_code,
							l_da_reason_code,
							'N',
							t_poeta_gl_hier_array(i).r_enc_start_date,
							t_poeta_gl_hier_array(i).r_enc_end_date,
							l_attribute_category,
							l_attribute1,
							l_attribute2,
							l_attribute3,
							l_attribute4,
							l_attribute5,
							l_attribute6,
							l_attribute7,
							l_attribute8,
							l_attribute9,
							l_attribute10,
							l_orig_gl_code_combination_id,
							l_orig_project_id,
							l_orig_task_id,
							l_orig_award_id,
							l_orig_expenditure_org_id,
							l_orig_expenditure_type,
							l_process_flag,
							l_return_status);
Line: 2229

	t_poeta_gl_hier_array.DELETE;
Line: 3306

	orig_ci.gl_code_combination_id.DELETE;
Line: 3307

	orig_ci.project_id.DELETE;
Line: 3308

	orig_ci.task_id.DELETE;
Line: 3309

	orig_ci.award_id.DELETE;
Line: 3310

	orig_ci.expenditure_organization_id.DELETE;
Line: 3311

	orig_ci.expenditure_type.DELETE;
Line: 3351

	r_enc_period.r_time_period_id.DELETE;
Line: 3352

	r_enc_period.r_period_start_date.DELETE;
Line: 3353

	r_enc_period.r_period_end_date.DELETE;
Line: 3354

	r_enc_period.r_asg_start_date.DELETE;
Line: 3355

	r_enc_period.r_asg_end_date.DELETE;
Line: 3356

	r_enc_period.r_process_flag.DELETE;
Line: 3357

	r_enc_period.r_period_ind.DELETE;
Line: 3358

	r_enc_period.r_schedule_percent.DELETE;
Line: 3359

	r_enc_period.r_encumbrance_amount.DELETE;
Line: 3360

	r_enc_period.r_period_amount.DELETE;
Line: 3361

	r_enc_period.r_reason_code.DELETE;
Line: 3384

 PROCEDURE insert_into_enc_lines(
 		L_ENC_ELEMENT_TYPE_ID		IN	NUMBER,
		L_ENCUMBRANCE_DATE		IN	DATE,
		L_DR_CR_FLAG			IN 	VARCHAR2,
 		L_ENCUMBRANCE_AMOUNT		IN	NUMBER,
 		L_ENC_LINE_TYPE			IN	VARCHAR2,
 		L_SCHEDULE_LINE_ID		IN	NUMBER,
 		L_ORG_SCHEDULE_ID		IN	NUMBER,
		L_DEFAULT_ORG_ACCOUNT_ID	IN	NUMBER,
            	L_SUSPENSE_ORG_ACCOUNT_ID	IN	NUMBER,
 		L_ELEMENT_ACCOUNT_ID		IN	NUMBER,
            	L_GL_PROJECT_FLAG		IN	VARCHAR2,
		L_PERSON_ID			IN 	NUMBER,
		L_ASSIGNMENT_ID			IN	NUMBER,
		L_AWARD_ID			IN 	NUMBER,
		L_TASK_ID			IN 	NUMBER,
		L_EXPENDITURE_TYPE		IN	VARCHAR2,
		L_EXPENDITURE_ORGANIZATION_ID	IN	NUMBER,
		L_PROJECT_ID			IN	NUMBER,
		L_GL_CODE_COMBINATION_ID	IN	NUMBER,
		L_TIME_PERIOD_ID		IN	NUMBER,
		L_PAYROLL_ID			IN	NUMBER,
		L_BUSINESS_GROUP_ID		IN	NUMBER,
		L_SET_OF_BOOKS_ID		IN	NUMBER,
  		L_SUSPENSE_REASON_CODE		IN	VARCHAR2,
            	L_DEFAULT_REASON_CODE		IN	VARCHAR2,
                L_CHANGE_FLAG                   IN      VARCHAR2,
                L_ENC_START_DATE		IN	DATE,
                L_ENC_END_DATE			IN	DATE,
		p_attribute_category		IN	VARCHAR2,		-- Introduced DFF parameters for bug fix 2908859
		p_attribute1			IN	VARCHAR2,
		p_attribute2			IN	VARCHAR2,
		p_attribute3			IN	VARCHAR2,
		p_attribute4			IN	VARCHAR2,
		p_attribute5			IN	VARCHAR2,
		p_attribute6			IN	VARCHAR2,
		p_attribute7			IN	VARCHAR2,
		p_attribute8			IN	VARCHAR2,
		p_attribute9			IN	VARCHAR2,
		p_attribute10			IN	VARCHAR2,
		p_orig_gl_code_combination_id	IN	NUMBER,
		p_orig_project_id		IN	NUMBER,
		p_orig_task_id			IN	NUMBER,
		p_orig_award_id			IN	NUMBER,
		p_orig_expenditure_org_id	IN	NUMBER,
		p_orig_expenditure_type		IN	VARCHAR2,
		p_hierarchy_code		IN	VARCHAR2,
            	p_return_status              	OUT NOCOPY     VARCHAR2) IS
	l_enc_line_id 		NUMBER;
Line: 3472

/*****	Commented the following for Create and Update multi thread enh.
		   -- Get a number for enc control id
     		 BEGIN
			SELECT psp_enc_controls_s.nextval
			INTO   l_enc_control_id
			FROM   DUAL;
Line: 3479

	End of comment for Create and Update multi thread enh.	*****/
			enc_control_tab.r_enc_control_id(l_rec_no) := l_enc_control_id;
Line: 3515

	-- Insert into enc lines record
	t_enc_lines_array.r_enc_element_type_id(g_enc_lines_counter)		:= l_enc_element_type_id;
Line: 3562

END IF;  /* skip inserting lines of zero dollars */
Line: 3568

			g_error_message := 'INSERT_INTO_ENC_LINES: ' || SQLERRM;
Line: 3570

		fnd_msg_pub.add_exc_msg('PSP_ENC_LINES','INSERT_INTO_ENC_LINES');
Line: 3572

END insert_into_enc_lines;
Line: 3586

	l_last_update_date		DATE 		DEFAULT SYSDATE;
Line: 3587

	l_last_updated_by		NUMBER 		DEFAULT NVL(FND_GLOBAL.USER_ID, -1);
Line: 3588

	l_last_updated_login		NUMBER		DEFAULT	NVL(FND_GLOBAL.LOGIN_ID, -1);
Line: 3590

SELECT	enc_control_id
FROM	psp_enc_controls
WHERE	payroll_action_id = p_payroll_action_id
AND	payroll_id = p_payroll_id
AND	time_period_id = p_time_period_id
AND	uom = g_uom;
Line: 3597

    /* Added IF conditon below for Restart update/Quick Update  Encumbrance Lines Enh. */
--     IF g_enc_line_type IN ('U','Q') THEN
        l_action_code := 'IC';
Line: 3608

		SELECT	psp_enc_controls_s.NEXTVAL INTO p_enc_control_id FROM DUAL;
Line: 3610

		INSERT INTO PSP_ENC_CONTROLS
			(time_period_id,			enc_control_id,
			number_of_dr,				number_of_cr,
			total_dr_amount,			total_cr_amount,
			gl_dr_amount,				gl_cr_amount,
			ogm_dr_amount,				ogm_cr_amount,
			payroll_id,				set_of_books_id,
			encumbrance_date,			action_code,
			last_update_date,			last_updated_by,
			creation_date,				created_by,
			last_update_login,			batch_name,
			business_group_id,			action_type,
			payroll_action_id,			uom)
		VALUES	(p_time_period_id,		p_enc_control_id,
				0,						0,
				0,						0,
				0,						0,
				0,						0,
				p_payroll_id,			p_set_of_books_id,
				l_last_update_date,		l_action_code,
				l_last_update_date,		l_last_updated_by,
				l_last_update_date,		l_last_updated_by,
				l_last_updated_login,	l_batch_name,
				p_business_group_id,	'U',
		        p_payroll_action_id,		g_uom);
Line: 3635

/*	Commented for Create and Update multi thread enh.
		VALUES	(enc_control_tab.R_TIME_PERIOD_ID(i),	enc_control_tab.R_ENC_CONTROL_ID(i),
			enc_control_tab.R_NO_OF_DR(i),		enc_control_tab.R_NO_OF_CR(i),
			round(enc_control_tab.R_TOTAL_DR_AMOUNT(i),g_precision),-- intoduced Rounding for Bug 2916848 Ilo Ehnc.
			round(enc_control_tab.R_TOTAL_CR_AMOUNT(i),g_precision),-- intoduced Rounding for Bug 2916848 Ilo Ehnc.
			round(enc_control_tab.R_GL_DR_AMOUNT(i),g_precision),-- intoduced Rounding for Bug 2916848 Ilo Ehnc.
			round(enc_control_tab.R_GL_CR_AMOUNT(i),g_precision),-- intoduced Rounding for Bug 2916848 Ilo Ehnc.
			round(enc_control_tab.R_OGM_DR_AMOUNT(i),g_precision),-- intoduced Rounding for Bug 2916848 Ilo Ehnc.
			round(enc_control_tab.R_OGM_CR_AMOUNT(i),g_precision),-- intoduced Rounding for Bug 2916848 Ilo Ehnc.
			p_payroll_id,				p_set_of_books_id,
			l_last_update_date,			l_action_code,
			l_last_update_date,			l_last_updated_by,
			l_last_update_date,			l_last_updated_by,
			l_last_updated_login,			l_batch_name,
			p_business_group_id,			g_enc_line_type,
	        p_payroll_action_id);
Line: 3651

	End of comment for Create and Update Multi thread enh.	*****/
	END IF;
Line: 3654

	enc_control_tab.r_time_period_id.delete;
Line: 3655

	enc_control_tab.r_enc_control_id.delete;
Line: 3656

	enc_control_tab.r_no_of_dr.delete;
Line: 3657

	enc_control_tab.r_no_of_cr.delete;
Line: 3658

	enc_control_tab.r_total_dr_amount.delete;
Line: 3659

	enc_control_tab.r_total_cr_amount.delete;
Line: 3660

	enc_control_tab.r_gl_dr_amount.delete;
Line: 3661

	enc_control_tab.r_gl_cr_amount.delete;
Line: 3662

	enc_control_tab.r_ogm_dr_amount.delete;
Line: 3663

	enc_control_tab.r_ogm_cr_amount.delete;
Line: 3664

	enc_control_tab.r_uom.delete;
Line: 3675

		fnd_message.set_name('PSP','PSP_ENC_INSERT_CONTROLS');
Line: 3883

Purpose: To insert into psp_enc_lines from Array. This procedure has been introduced to bulk insert
	 into psp_enc_lines from the record of collection t_enc_lines_array.
         Introduced as part of Enhnacement Enc Redesign : Bug 2259310.
Who		When 		What
lveerubh	08-MAR-2002	Created the procedure
********************************************************************************************************************************/
 PROCEDURE 	insert_enc_lines_from_arrays( 	p_payroll_id		 IN	NUMBER,
						p_business_group_id	 IN	NUMBER,
						p_set_of_books_id	 IN  	NUMBER,
						p_enc_line_type		 IN	VARCHAR2,
						p_return_status		 OUT NOCOPY	VARCHAR2)
IS
l_last_update_date		DATE 	DEFAULT SYSDATE;
Line: 3896

l_last_updated_by		NUMBER  DEFAULT NVL(FND_GLOBAL.USER_ID, -1);
Line: 3897

l_last_update_login		NUMBER 	DEFAULT NVL(FND_GLOBAL.LOGIN_ID, -1);
Line: 3900

	insert into psp_enc_lines
	(
	enc_element_type_id,
	enc_line_id,
	business_group_id,
	encumbrance_date,
	dr_cr_flag,
	encumbrance_amount,
	enc_line_type,
	schedule_line_id,
	org_schedule_id,
	default_org_account_id,
	suspense_org_account_id,
	element_account_id,
	gl_project_flag,
	person_id,
	assignment_id,
	award_id,
	task_id,
	expenditure_type,
	expenditure_organization_id,
	project_id,
	gl_code_combination_id,
	time_period_id,
	payroll_id,
	set_of_books_id,
	default_reason_code,
	suspense_reason_code,
	status_code,
	enc_control_id,
	change_flag,
	enc_start_date,
	enc_end_date,
	last_update_date,
	last_updated_by,
	last_update_login,
	created_by,
	creation_date,
	attribute_category,			-- Introduced DFF columns for bug fix 2908859
	attribute1,
	attribute2,
	attribute3,
	attribute4,
	attribute5,
	attribute6,
	attribute7,
	attribute8,
	attribute9,
	attribute10,
	payroll_action_id,
	orig_gl_code_combination_id,
	orig_project_id,
	orig_task_id,
	orig_award_id,
	orig_expenditure_org_id,
	orig_expenditure_type,
	hierarchy_code
	)
	values (
	t_enc_lines_array2.r_enc_element_type_id(i)
	,PSP_ENC_LINES_S.NEXTVAL
	,p_business_group_id
	, t_enc_lines_array2.r_encumbrance_date(i)
	, t_enc_lines_array2.r_dr_cr_flag(i)
	,round( t_enc_lines_array2.r_encumbrance_amount(i),g_precision) -- introduced rounding for BUg 2916848 Ilo Ehnc.
	, t_enc_lines_array2.r_enc_line_type(i)
	, t_enc_lines_array2.r_schedule_line_id(i)
	, t_enc_lines_array2.r_org_schedule_id(i)
	, t_enc_lines_array2.r_default_org_account_id(i)
	, t_enc_lines_array2.r_suspense_org_account_id(i)
	, t_enc_lines_array2.r_element_account_id(i)
	, t_enc_lines_array2.r_gl_project_flag(i)
	, t_enc_lines_array2.r_person_id(i)
	, t_enc_lines_array2.r_assignment_id(i)
	, t_enc_lines_array2.r_award_id(i)
	, t_enc_lines_array2.r_task_id(i)
	, t_enc_lines_array2.r_expenditure_type(i)
	, t_enc_lines_array2.r_expenditure_organization_id(i)
	, t_enc_lines_array2.r_project_id(i)
	, t_enc_lines_array2.r_gl_code_combination_id(i)
	, t_enc_lines_array2.r_time_period_id(i)
	, p_payroll_id
	, p_set_of_books_id
	, t_enc_lines_array2.r_default_reason_code(i)
	, t_enc_lines_array2.r_suspense_reason_code(i)
	, p_enc_line_type    --status_code
	, t_enc_lines_array2.r_enc_control_id(i)
	, t_enc_lines_array2.r_change_flag(i)
	, t_enc_lines_array2.r_enc_start_date(i)
	, t_enc_lines_array2.r_enc_end_date(i)
	, l_last_update_date
	, l_last_updated_by
	, l_last_update_login
	, l_last_updated_by
	, l_last_update_date
	, DECODE(t_enc_lines_array2.r_attribute_category(i), 'NULL_VALUE', NULL, t_enc_lines_array2.r_attribute_category(i))
	, DECODE(t_enc_lines_array2.r_attribute1(i), 'NULL_VALUE', NULL, t_enc_lines_array2.r_attribute1(i))
	, DECODE(t_enc_lines_array2.r_attribute2(i), 'NULL_VALUE', NULL, t_enc_lines_array2.r_attribute2(i))
	, DECODE(t_enc_lines_array2.r_attribute3(i), 'NULL_VALUE', NULL, t_enc_lines_array2.r_attribute3(i))
	, DECODE(t_enc_lines_array2.r_attribute4(i), 'NULL_VALUE', NULL, t_enc_lines_array2.r_attribute4(i))
	, DECODE(t_enc_lines_array2.r_attribute5(i), 'NULL_VALUE', NULL, t_enc_lines_array2.r_attribute5(i))
	, DECODE(t_enc_lines_array2.r_attribute6(i), 'NULL_VALUE', NULL, t_enc_lines_array2.r_attribute6(i))
	, DECODE(t_enc_lines_array2.r_attribute7(i), 'NULL_VALUE', NULL, t_enc_lines_array2.r_attribute7(i))
	, DECODE(t_enc_lines_array2.r_attribute8(i), 'NULL_VALUE', NULL, t_enc_lines_array2.r_attribute8(i))
	, DECODE(t_enc_lines_array2.r_attribute9(i), 'NULL_VALUE', NULL, t_enc_lines_array2.r_attribute9(i))
	, DECODE(t_enc_lines_array2.r_attribute10(i), 'NULL_VALUE', NULL, t_enc_lines_array2.r_attribute10(i))
	, g_payroll_action_id
	, t_enc_lines_array2.r_orig_gl_code_combination_id(i)
	, t_enc_lines_array2.r_orig_project_id(i)
	, t_enc_lines_array2.r_orig_task_id(i)
	, t_enc_lines_array2.r_orig_award_id(i)
	, t_enc_lines_array2.r_orig_expenditure_org_id(i)
	, t_enc_lines_array2.r_orig_expenditure_type(i)
	, t_enc_lines_array2.r_hierarchy_code(i)
	);
Line: 4016

	DELETE	psp_enc_lines
	WHERE	payroll_id = p_payroll_id
	AND	business_group_id = p_business_group_id
	AND	set_of_books_id = p_set_of_books_id
	AND	encumbrance_amount = 0;
Line: 4022

	t_enc_lines_array2.r_enc_element_type_id.delete;
Line: 4023

	t_enc_lines_array2.r_encumbrance_date.delete;
Line: 4024

	t_enc_lines_array2.r_dr_cr_flag.delete;
Line: 4025

	t_enc_lines_array2.r_encumbrance_amount.delete;
Line: 4026

	t_enc_lines_array2.r_enc_line_type.delete;
Line: 4027

	t_enc_lines_array2.r_schedule_line_id.delete;
Line: 4028

	t_enc_lines_array2.r_org_schedule_id.delete;
Line: 4029

	t_enc_lines_array2.r_default_org_account_id.delete;
Line: 4030

	t_enc_lines_array2.r_suspense_org_account_id.delete;
Line: 4031

	t_enc_lines_array2.r_element_account_id.delete;
Line: 4032

	t_enc_lines_array2.r_gl_project_flag.delete;
Line: 4033

	t_enc_lines_array2.r_person_id.delete;
Line: 4034

	t_enc_lines_array2.r_assignment_id.delete;
Line: 4035

	t_enc_lines_array2.r_award_id.delete;
Line: 4036

	t_enc_lines_array2.r_task_id.delete;
Line: 4037

	t_enc_lines_array2.r_expenditure_type.delete;
Line: 4038

	t_enc_lines_array2.r_expenditure_organization_id.delete;
Line: 4039

	t_enc_lines_array2.r_project_id.delete;
Line: 4040

	t_enc_lines_array2.r_gl_code_combination_id.delete;
Line: 4041

	t_enc_lines_array2.r_time_period_id.delete;
Line: 4042

	t_enc_lines_array2.r_default_reason_code.delete;
Line: 4043

	t_enc_lines_array2.r_suspense_reason_code.delete;
Line: 4044

	t_enc_lines_array2.r_enc_control_id.delete;
Line: 4045

	t_enc_lines_array2.r_change_flag.delete;
Line: 4046

	t_enc_lines_array2.r_enc_start_date.delete;
Line: 4047

	t_enc_lines_array2.r_enc_end_date.delete;
Line: 4048

	t_enc_lines_array2.r_attribute_category.delete;
Line: 4049

	t_enc_lines_array2.r_attribute1.delete;
Line: 4050

	t_enc_lines_array2.r_attribute2.delete;
Line: 4051

	t_enc_lines_array2.r_attribute3.delete;
Line: 4052

	t_enc_lines_array2.r_attribute4.delete;
Line: 4053

	t_enc_lines_array2.r_attribute5.delete;
Line: 4054

	t_enc_lines_array2.r_attribute6.delete;
Line: 4055

	t_enc_lines_array2.r_attribute7.delete;
Line: 4056

	t_enc_lines_array2.r_attribute8.delete;
Line: 4057

	t_enc_lines_array2.r_attribute9.delete;
Line: 4058

	t_enc_lines_array2.r_attribute10.delete;
Line: 4059

	t_enc_lines_array2.r_orig_gl_code_combination_id.delete;
Line: 4060

	t_enc_lines_array2.r_orig_project_id.delete;
Line: 4061

	t_enc_lines_array2.r_orig_award_id.delete;
Line: 4062

	t_enc_lines_array2.r_orig_task_id.delete;
Line: 4063

	t_enc_lines_array2.r_orig_expenditure_type.delete;
Line: 4064

	t_enc_lines_array2.r_orig_expenditure_org_id.delete;
Line: 4065

	t_enc_lines_array2.r_hierarchy_code.delete;
Line: 4073

		g_error_message := 'INSERT_ENC_LINES_FROM_ARRAYS: ' || SQLERRM;
Line: 4075

        g_error_api_path := SUBSTR(' INSERT_ENC_LINES_FROM_ARRAYS:'||g_error_api_path,1,230);
Line: 4076

        fnd_msg_pub.add_exc_msg('PSP_ENC_CREATE_LINES', ' INSERT_ENC_LINES_FROM_ARRAYS');
Line: 4078

END insert_enc_lines_from_arrays;
Line: 4122

SELECT	GREATEST(l_min_start_date, start_date_active) start_date_active,
	LEAST(l_max_end_date, end_date_active)	 end_date_active,
	SUM(percent) schedule_percent
FROM	psp_element_type_accounts
WHERE	business_group_id = p_business_group_id
AND	set_of_books_id = p_set_of_books_id
AND	element_type_id = p_element_type_id
AND	(	gl_code_combination_id IS NOT NULL
	OR	award_id IS NOT NULL)
AND	start_date_active <= l_max_end_date
AND	end_date_active >= l_min_start_date
GROUP BY GREATEST(l_min_start_date, start_date_active),
	LEAST(l_max_end_date, end_date_active)
ORDER BY start_date_active;
Line: 4140

SELECT  GREATEST(l_min_start_date, paf.effective_start_date, schedule_begin_date) schedule_begin_date,
        LEAST(l_max_end_date, paf.effective_end_date, schedule_end_date) schedule_end_date,
	SUM(schedule_percent) schedule_percent
FROM	per_assignments_f paf,
	psp_default_labor_schedules pdls
WHERE	paf.assignment_id = p_assignment_id
AND	l_min_start_date <= paf.effective_end_date
AND	l_max_end_date >= paf.effective_start_date
AND	paf.organization_id = pdls.organization_id
AND	pdls.business_group_id = p_business_group_id
AND	pdls.set_of_books_id = p_set_of_books_id
AND	(	gl_code_combination_id IS NOT NULL
	OR	award_id IS NOT NULL)
AND	schedule_begin_date <= l_max_end_date
AND	schedule_end_date >= l_min_start_date
GROUP BY  GREATEST(l_min_start_date, paf.effective_start_date, schedule_begin_date),
        LEAST(l_max_end_date, paf.effective_end_date, schedule_end_date)
ORDER BY 1;
Line: 4160

SELECT	psh.schedule_hierarchy_id
FROM	psp_schedule_hierarchy psh
WHERE	psh.business_group_id = p_business_group_id
AND	psh.set_of_books_id = p_set_of_books_id
AND	psh.scheduling_types_code = p_scheduling_types_code
AND	(	(p_scheduling_types_code = 'ET' AND psh.element_type_id = p_element_type_id)
	OR	(p_scheduling_types_code = 'A'))
AND	psh.assignment_id = p_assignment_id;
Line: 4171

SELECT	DISTINCT schedule_hierarchy_id
FROM	psp_schedule_hierarchy psh,
	psp_element_groups peg,
	psp_group_element_list pgel
WHERE	psh.business_group_id = p_business_group_id
AND	psh.set_of_books_id = p_set_of_books_id
AND	peg.business_group_id = p_business_group_id
AND	peg.set_of_books_id = p_set_of_books_id
AND	psh.scheduling_types_code = 'EG'
AND	psh.element_group_id = peg.element_group_id
AND	peg.end_date_active >= r_enc_period.r_period_start_date(1)
AND	peg.start_date_active <= r_enc_period.r_period_end_date(l_period_count)
AND	pgel.element_type_id = p_element_type_id
AND	psh.assignment_id = p_assignment_id;
Line: 4189

SELECT	schedule_hierarchy_id
FROM	psp_schedule_hierarchy psh
WHERE	EXISTS	(SELECT	1
		FROM	psp_element_groups peg,
			psp_group_element_list pgel
		WHERE	peg.business_group_id = p_business_group_id
		AND	peg.set_of_books_id = p_set_of_books_id
		AND	peg.end_date_active >= r_enc_period.r_period_start_date(1)
		AND	peg.start_date_active <= r_enc_period.r_period_end_date(l_period_count)
		AND	peg.element_group_id = psh.element_group_id
		AND peg.element_group_id = pgel.element_group_id   -- Added for Bug 10113387
		AND	pgel.element_type_id = p_element_type_id)
AND	psh.business_group_id = p_business_group_id
AND	psh.set_of_books_id = p_set_of_books_id
AND	psh.scheduling_types_code = 'EG'
AND	psh.assignment_id = p_assignment_id;
Line: 4208

SELECT	GREATEST(l_min_start_date, period_start_date) period_start_date,
	LEAST(l_max_end_date, period_end_date) period_end_date,
	SUM(period_schedule_percent) schedule_percent
FROM	psp_matrix_driver pmd
WHERE	run_id = l_run_id
AND	period_start_date <= l_max_end_date
AND	period_end_date >= l_min_start_date
GROUP BY GREATEST(l_min_start_date, period_start_date),
	LEAST(l_max_end_date, period_end_date)
ORDER BY 1;
Line: 4220

SELECT	GREATEST(l_min_start_date, peg.start_date_active, period_start_date) period_start_date,
	LEAST(l_max_end_date, peg.end_date_active, period_end_date) period_end_date,
	SUM(period_schedule_percent) schedule_percent
FROM	psp_matrix_driver pmd,
	psp_schedule_lines psl,
	psp_schedule_hierarchy psh,
	psp_element_groups peg
WHERE	run_id = l_run_id
AND	psl.schedule_line_id = pmd.schedule_line_id
AND	psl.schedule_hierarchy_id = psh.schedule_hierarchy_id
AND	psh.element_group_id = peg.element_group_id
AND	peg.start_date_active <= l_max_end_date
AND	peg.end_date_active >= l_min_start_date
AND	period_start_date <= l_max_end_date
AND	period_end_date >= l_min_start_date
AND	(	gl_code_combination_id IS NOT NULL
	OR	award_id IS NOT NULL)
GROUP BY GREATEST(l_min_start_date, peg.start_date_active, period_start_date),
	LEAST(l_max_end_date, peg.end_date_active, period_end_date)
ORDER BY 1;
Line: 4253

SELECT	schedule_line_id l_id,
	schedule_begin_date sbd,
	schedule_end_date sed,
	schedule_percent sp
FROM	psp_schedule_lines
WHERE	schedule_hierarchy_id = schedule_hierarchy_id
AND	(	gl_code_combination_id IS NOT NULL
	OR	award_id IS NOT NULL)
AND	schedule_end_date >= l_min_start_date
AND	schedule_begin_date <= l_max_end_date;
Line: 4265

SELECT	schedule_begin_date dat , 'B'
FROM	psp_schedule_lines
WHERE	schedule_hierarchy_id = p_schedule_hierarchy_id
AND	(	gl_code_combination_id IS NOT NULL
	OR	award_id IS NOT NULL)
AND	schedule_end_date >= l_min_start_date
AND	schedule_begin_date <= l_max_end_date
UNION
SELECT	schedule_end_date dat , 'E'
FROM	psp_schedule_lines
WHERE	schedule_hierarchy_id = p_schedule_hierarchy_id
AND	(	gl_code_combination_id IS NOT NULL
	OR	award_id IS NOT NULL)
AND	schedule_end_date >= l_min_start_date
AND	schedule_begin_date <= l_max_end_date
ORDER BY        1, 2 ;
Line: 4549

	r_sch_rec.start_date.delete;
Line: 4550

	r_sch_rec.end_date.delete;
Line: 4551

	r_sch_rec.schedule_percent.delete;
Line: 4552

	r_enc_period.r_time_period_id.DELETE;
Line: 4553

	r_enc_period.r_period_start_date.DELETE;
Line: 4554

	r_enc_period.r_period_end_date.DELETE;
Line: 4555

	r_enc_period.r_asg_start_date.DELETE;
Line: 4556

	r_enc_period.r_asg_end_date.DELETE;
Line: 4557

	r_enc_period.r_process_flag.DELETE;
Line: 4558

	r_enc_period.r_period_ind.DELETE;
Line: 4559

	r_enc_period.r_schedule_percent.DELETE;
Line: 4560

	r_enc_period.r_encumbrance_amount.DELETE;
Line: 4561

	r_enc_period.r_period_amount.DELETE;
Line: 4562

	r_enc_period.r_reason_code.DELETE;
Line: 4563

	r_enc_period.r_effective_date.DELETE;
Line: 4606

	DELETE	psp_matrix_driver
	WHERE	run_id = l_run_id
	AND	(period_start_date > l_max_end_date
		OR period_end_date < l_min_start_date
		OR period_schedule_percent = 0);
Line: 4612

	UPDATE	psp_matrix_driver pmd
	SET	period_end_date = period_end_date - 1
	WHERE	run_id = l_run_id
	AND	period_start_date < period_end_date
	AND	period_start_date = (SELECT	MIN(psl1.schedule_begin_date)
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id)
	AND	EXISTS (SELECT	1
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_line_id <> pmd.schedule_line_id
			AND	psl1.schedule_begin_date = pmd.period_end_date
			AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id);
Line: 4625

	UPDATE	psp_matrix_driver pmd
	SET	period_end_date = period_end_date - 1
	WHERE	run_id = l_run_id
	AND	period_start_date < period_end_date
	AND	NOT (NOT EXISTS	(SELECT	1
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_line_id <> pmd.schedule_line_id
			AND	psl1.schedule_begin_date = pmd.period_end_date
			AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id)
	AND	EXISTS	(SELECT	1
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_end_date = pmd.period_end_date
			AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id))
	AND	period_start_date <> (SELECT	MIN(psl1.schedule_begin_date)
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id);
Line: 4642

	UPDATE	psp_matrix_driver pmd
	SET	period_start_date = period_start_date + 1
	WHERE	run_id = l_run_id
	AND	period_start_date < period_end_date
	AND	NOT EXISTS	(SELECT	1
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_begin_date = pmd.period_start_date
			AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id)
	AND	period_start_date <> (SELECT	MIN(psl1.schedule_begin_date)
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id);
Line: 4654

	UPDATE	psp_matrix_driver pmd
	SET	period_start_date = period_start_date + 1
	WHERE	run_id = l_run_id
	AND	period_start_date < period_end_date
	AND	EXISTS	(SELECT	1
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_begin_date = pmd.period_start_date
			AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id)
	AND	EXISTS	(SELECT	1
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_line_id <> pmd.schedule_line_id
			AND	psl1.schedule_end_date = pmd.period_start_date
			AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id)
	AND	period_start_date <> (SELECT	MIN(psl1.schedule_begin_date)
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id);
Line: 4701

	INSERT INTO psp_matrix_driver
		(RUN_ID,					SCHEDULE_LINE_ID,
		PERIOD_START_DATE,
		PERIOD_END_DATE,
		PERIOD_SCHEDULE_PERCENT)
	SELECT 	l_run_id,	schedule_line_id,
		GREATEST(l_min_start_date, schedule_chunk.schedule_begin_date(rowno)),
		LEAST(l_max_end_date, schedule_chunk.schedule_end_date(rowno)),
		schedule_percent
	FROM	psp_schedule_lines psl
	WHERE	schedule_hierarchy_id = l_schedule_hierarchy_id
	AND	schedule_end_date >= l_min_start_date
	AND	schedule_begin_date <= l_max_end_date
	AND	(	gl_code_combination_id IS NOT NULL
		OR	award_id IS NOT NULL)
	AND	psl.schedule_begin_date <= schedule_chunk.schedule_end_date(rowno)
	AND	psl.schedule_end_date >= schedule_chunk.schedule_begin_date(rowno);
Line: 4719

	initial_dates.delete;
Line: 4720

	date_type.delete;
Line: 4721

	schedule_chunk.schedule_end_date.delete;
Line: 4722

	schedule_chunk.schedule_begin_date.delete;
Line: 4947

	r_sch_rec.start_date.delete;
Line: 4948

	r_sch_rec.end_date.delete;
Line: 4949

	r_sch_rec.schedule_percent.delete;
Line: 4950

	r_enc_period_tmp1.r_time_period_id.DELETE;
Line: 4951

	r_enc_period_tmp1.r_period_start_date.DELETE;
Line: 4952

	r_enc_period_tmp1.r_period_end_date.DELETE;
Line: 4953

	r_enc_period_tmp1.r_asg_start_date.DELETE;
Line: 4954

	r_enc_period_tmp1.r_asg_end_date.DELETE;
Line: 4955

	r_enc_period_tmp1.r_process_flag.DELETE;
Line: 4956

	r_enc_period_tmp1.r_period_ind.DELETE;
Line: 4957

	r_enc_period_tmp1.r_schedule_percent.DELETE;
Line: 4958

	r_enc_period_tmp1.r_encumbrance_amount.DELETE;
Line: 4959

	r_enc_period_tmp1.r_period_amount.DELETE;
Line: 4960

	r_enc_period_tmp1.r_reason_code.DELETE;
Line: 4961

	r_enc_period_tmp1.r_effective_date.DELETE;
Line: 5005

		DELETE	psp_matrix_driver
		WHERE	run_id = l_run_id
		AND	(period_start_date > l_max_end_date
			OR period_end_date < l_min_start_date
			OR period_schedule_percent = 0);
Line: 5011

		UPDATE	psp_matrix_driver pmd
		SET	period_end_date = period_end_date - 1
		WHERE	run_id = l_run_id
		AND	period_start_date < period_end_date
		AND	period_start_date = (SELECT	MIN(psl1.schedule_begin_date)
				FROM	psp_schedule_lines psl1
				WHERE	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id)
		AND	EXISTS (SELECT	1
				FROM	psp_schedule_lines psl1
				WHERE	psl1.schedule_line_id <> pmd.schedule_line_id
				AND	psl1.schedule_begin_date = pmd.period_end_date
				AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id);
Line: 5024

		UPDATE	psp_matrix_driver pmd
		SET	period_end_date = period_end_date - 1
		WHERE	run_id = l_run_id
		AND	period_start_date < period_end_date
		AND	NOT (NOT EXISTS	(SELECT	1
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_line_id <> pmd.schedule_line_id
			AND	psl1.schedule_begin_date = pmd.period_end_date
			AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id)
		AND	EXISTS	(SELECT	1
				FROM	psp_schedule_lines psl1
				WHERE	psl1.schedule_end_date = pmd.period_end_date
				AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id))
		AND	period_start_date <> (SELECT	MIN(psl1.schedule_begin_date)
				FROM	psp_schedule_lines psl1
				WHERE	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id);
Line: 5041

		UPDATE	psp_matrix_driver pmd
		SET	period_start_date = period_start_date + 1
		WHERE	run_id = l_run_id
		AND	period_start_date < period_end_date
		AND	NOT EXISTS	(SELECT	1
				FROM	psp_schedule_lines psl1
				WHERE	psl1.schedule_begin_date = pmd.period_start_date
				AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id)
		AND	period_start_date <> (SELECT	MIN(psl1.schedule_begin_date)
				FROM	psp_schedule_lines psl1
				WHERE	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id);
Line: 5053

		UPDATE	psp_matrix_driver pmd
		SET	period_start_date = period_start_date + 1
		WHERE	run_id = l_run_id
		AND	period_start_date < period_end_date
		AND	EXISTS	(SELECT	1
				FROM	psp_schedule_lines psl1
				WHERE	psl1.schedule_begin_date = pmd.period_start_date
				AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id)
		AND	EXISTS	(SELECT	1
				FROM	psp_schedule_lines psl1
				WHERE	psl1.schedule_line_id <> pmd.schedule_line_id
				AND	psl1.schedule_end_date = pmd.period_start_date
				AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id)
		AND	period_start_date <> (SELECT	MIN(psl1.schedule_begin_date)
				FROM	psp_schedule_lines psl1
				WHERE	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id);
Line: 5100

	INSERT INTO psp_matrix_driver
		(RUN_ID,					SCHEDULE_LINE_ID,
		PERIOD_START_DATE,
		PERIOD_END_DATE,
		PERIOD_SCHEDULE_PERCENT)
	SELECT 	l_run_id,	schedule_line_id,
		GREATEST(l_min_start_date, schedule_chunk.schedule_begin_date(rowno)),
		LEAST(l_max_end_date, schedule_chunk.schedule_end_date(rowno)),
		schedule_percent
	FROM	psp_schedule_lines psl
	WHERE	schedule_hierarchy_id = l_schedule_hierarchy_id
	AND	schedule_end_date >= l_min_start_date
	AND	schedule_begin_date <= l_max_end_date
	AND	(	gl_code_combination_id IS NOT NULL
		OR	award_id IS NOT NULL)
	AND	psl.schedule_begin_date <= schedule_chunk.schedule_end_date(rowno)
	AND	psl.schedule_end_date >= schedule_chunk.schedule_begin_date(rowno);
Line: 5118

	initial_dates.delete;
Line: 5119

	date_type.delete;
Line: 5120

	schedule_chunk.schedule_end_date.delete;
Line: 5121

	schedule_chunk.schedule_begin_date.delete;
Line: 5348

	r_enc_period.r_time_period_id.DELETE;
Line: 5349

	r_enc_period.r_period_start_date.DELETE;
Line: 5350

	r_enc_period.r_period_end_date.DELETE;
Line: 5351

	r_enc_period.r_asg_start_date.DELETE;
Line: 5352

	r_enc_period.r_asg_end_date.DELETE;
Line: 5353

	r_enc_period.r_process_flag.DELETE;
Line: 5354

	r_enc_period.r_period_ind.DELETE;
Line: 5355

	r_enc_period.r_schedule_percent.DELETE;
Line: 5356

	r_enc_period.r_encumbrance_amount.DELETE;
Line: 5357

	r_enc_period.r_period_amount.DELETE;
Line: 5358

	r_enc_period.r_reason_code.DELETE;
Line: 5359

	r_enc_period.r_effective_date.DELETE;
Line: 5404

	DELETE	psp_matrix_driver
	WHERE	run_id = l_run_id
	AND	(period_start_date > l_max_end_date
		OR period_end_date < l_min_start_date
		OR period_schedule_percent = 0);
Line: 5410

	UPDATE	psp_matrix_driver pmd
	SET	period_end_date = period_end_date - 1
	WHERE	run_id = l_run_id
	AND	period_start_date < period_end_date
	AND	period_start_date = (SELECT	MIN(psl1.schedule_begin_date)
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id)
	AND	EXISTS (SELECT	1
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_line_id <> pmd.schedule_line_id
			AND	psl1.schedule_begin_date = pmd.period_end_date
			AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id);
Line: 5423

	UPDATE	psp_matrix_driver pmd
	SET	period_end_date = period_end_date - 1
	WHERE	run_id = l_run_id
	AND	period_start_date < period_end_date
	AND	NOT (NOT EXISTS	(SELECT	1
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_line_id <> pmd.schedule_line_id
			AND	psl1.schedule_begin_date = pmd.period_end_date
			AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id)
	AND	EXISTS	(SELECT	1
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_end_date = pmd.period_end_date
			AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id))
	AND	period_start_date <> (SELECT	MIN(psl1.schedule_begin_date)
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id);
Line: 5440

	UPDATE	psp_matrix_driver pmd
	SET	period_start_date = period_start_date + 1
	WHERE	run_id = l_run_id
	AND	period_start_date < period_end_date
	AND	NOT EXISTS	(SELECT	1
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_begin_date = pmd.period_start_date
			AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id)
	AND	period_start_date <> (SELECT	MIN(psl1.schedule_begin_date)
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id);
Line: 5452

	UPDATE	psp_matrix_driver pmd
	SET	period_start_date = period_start_date + 1
	WHERE	run_id = l_run_id
	AND	period_start_date < period_end_date
	AND	EXISTS	(SELECT	1
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_begin_date = pmd.period_start_date
			AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id)
	AND	EXISTS	(SELECT	1
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_line_id <> pmd.schedule_line_id
			AND	psl1.schedule_end_date = pmd.period_start_date
			AND	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id)
	AND	period_start_date <> (SELECT	MIN(psl1.schedule_begin_date)
			FROM	psp_schedule_lines psl1
			WHERE	psl1.schedule_hierarchy_id = l_schedule_hierarchy_id);
Line: 5499

	INSERT INTO psp_matrix_driver
		(RUN_ID,					SCHEDULE_LINE_ID,
		PERIOD_START_DATE,			PERIOD_END_DATE,
		PERIOD_SCHEDULE_PERCENT)
	SELECT 	l_run_id,	schedule_line_id,
		GREATEST(l_min_start_date, schedule_chunk.schedule_begin_date(rowno)),
		LEAST(l_max_end_date, schedule_chunk.schedule_end_date(rowno)),
		schedule_percent
	FROM	psp_schedule_lines psl
	WHERE	schedule_hierarchy_id = l_schedule_hierarchy_id
	AND	schedule_end_date >= l_min_start_date
	AND	schedule_begin_date <= l_max_end_date
	AND	(	gl_code_combination_id IS NOT NULL
		OR	award_id IS NOT NULL)
	AND	psl.schedule_begin_date <= schedule_chunk.schedule_end_date(rowno)
	AND	psl.schedule_end_date >= schedule_chunk.schedule_begin_date(rowno);
Line: 5516

	initial_dates.delete;
Line: 5517

	date_type.delete;
Line: 5518

	schedule_chunk.schedule_end_date.delete;
Line: 5519

	schedule_chunk.schedule_begin_date.delete;
Line: 5744

	r_sch_rec.start_date.delete;
Line: 5745

	r_sch_rec.end_date.delete;
Line: 5746

	r_sch_rec.schedule_percent.delete;
Line: 5747

	r_enc_period_tmp1.r_time_period_id.DELETE;
Line: 5748

	r_enc_period_tmp1.r_period_start_date.DELETE;
Line: 5749

	r_enc_period_tmp1.r_period_end_date.DELETE;
Line: 5750

	r_enc_period_tmp1.r_asg_start_date.DELETE;
Line: 5751

	r_enc_period_tmp1.r_asg_end_date.DELETE;
Line: 5752

	r_enc_period_tmp1.r_process_flag.DELETE;
Line: 5753

	r_enc_period_tmp1.r_period_ind.DELETE;
Line: 5754

	r_enc_period_tmp1.r_schedule_percent.DELETE;
Line: 5755

	r_enc_period_tmp1.r_encumbrance_amount.DELETE;
Line: 5756

	r_enc_period_tmp1.r_period_amount.DELETE;
Line: 5757

	r_enc_period_tmp1.r_reason_code.DELETE;
Line: 5758

	r_enc_period_tmp1.r_effective_date.DELETE;
Line: 6030

		r_sch_rec.start_date.delete;
Line: 6031

		r_sch_rec.end_date.delete;
Line: 6032

		r_sch_rec.schedule_percent.delete;
Line: 6033

		r_enc_period.r_time_period_id.DELETE;
Line: 6034

		r_enc_period.r_period_start_date.DELETE;
Line: 6035

		r_enc_period.r_period_end_date.DELETE;
Line: 6036

		r_enc_period.r_asg_start_date.DELETE;
Line: 6037

		r_enc_period.r_asg_end_date.DELETE;
Line: 6038

		r_enc_period.r_process_flag.DELETE;
Line: 6039

		r_enc_period.r_period_ind.DELETE;
Line: 6040

		r_enc_period.r_schedule_percent.DELETE;
Line: 6041

		r_enc_period.r_encumbrance_amount.DELETE;
Line: 6042

		r_enc_period.r_period_amount.DELETE;
Line: 6043

		r_enc_period.r_reason_code.DELETE;
Line: 6044

		r_enc_period.r_effective_date.DELETE;
Line: 6321

	r_enc_period.r_time_period_id.DELETE;
Line: 6322

	r_enc_period.r_period_start_date.DELETE;
Line: 6323

	r_enc_period.r_period_end_date.DELETE;
Line: 6324

	r_enc_period.r_asg_start_date.DELETE;
Line: 6325

	r_enc_period.r_asg_end_date.DELETE;
Line: 6326

	r_enc_period.r_process_flag.DELETE;
Line: 6327

	r_enc_period.r_period_ind.DELETE;
Line: 6328

	r_enc_period.r_schedule_percent.DELETE;
Line: 6329

	r_enc_period.r_encumbrance_amount.DELETE;
Line: 6330

	r_enc_period.r_period_amount.DELETE;
Line: 6331

	r_enc_period.r_reason_code.DELETE;
Line: 6332

	r_enc_period.r_effective_date.DELETE;
Line: 6527

	r_enc_period_tmp1.r_time_period_id.DELETE;
Line: 6528

	r_enc_period_tmp1.r_period_start_date.DELETE;
Line: 6529

	r_enc_period_tmp1.r_period_end_date.DELETE;
Line: 6530

	r_enc_period_tmp1.r_asg_start_date.DELETE;
Line: 6531

	r_enc_period_tmp1.r_asg_end_date.DELETE;
Line: 6532

	r_enc_period_tmp1.r_process_flag.DELETE;
Line: 6533

	r_enc_period_tmp1.r_period_ind.DELETE;
Line: 6534

	r_enc_period_tmp1.r_schedule_percent.DELETE;
Line: 6535

	r_enc_period_tmp1.r_encumbrance_amount.DELETE;
Line: 6536

	r_enc_period_tmp1.r_period_amount.DELETE;
Line: 6537

	r_enc_period_tmp1.r_reason_code.DELETE;
Line: 6538

	r_enc_period_tmp1.r_effective_date.DELETE;
Line: 6623

l_last_update_date		DATE;
Line: 6624

l_last_updated_by		NUMBER;
Line: 6625

l_last_updated_login		NUMBER;
Line: 6629

NO_UPDATE_REC_FOUND		EXCEPTION;
Line: 6632

SELECT	fnd_number.canonical_to_number(NVL(argument11, -1)),
	argument12
FROM	fnd_concurrent_requests
WHERE	request_id = l_request_id;
Line: 6638

SELECT	pep.payroll_id
FROM	psp_enc_payrolls pep
WHERE	pep.business_group_id = l_business_group_id
AND		pep.set_of_books_id   = l_set_of_books_id;
Line: 6645

	l_last_update_date := SYSDATE;
Line: 6646

	l_last_updated_by := NVL(FND_GLOBAL.USER_ID, -1);
Line: 6647

	l_last_updated_login := NVL(FND_GLOBAL.LOGIN_ID, -1);
Line: 6667

	INSERT INTO psp_enc_processes
		(request_id,		process_code,		payroll_action_id,
		process_status,		process_phase,		business_group_id,
		set_of_books_id,	creation_date,		created_by,
		last_update_date,	last_updated_by,	last_update_login)
	VALUES
		(l_request_id,		l_process_code,		pactid,
		'I',			NULL,			l_business_group_id,
		l_set_of_books_id,	l_last_update_date,	l_last_updated_by,
		l_last_update_date,	l_last_updated_by,	l_last_updated_login);
Line: 6701

	sqlstr := 'SELECT DISTINCT assignment_id FROM psp_enc_changed_assignments WHERE ';
Line: 6708

	INSERT INTO psp_enc_process_assignments
		(payroll_action_id,		assignment_id,		payroll_id,
		assignment_status,		creation_date,		created_by,
		last_update_date,		last_updated_by,	last_update_login)
	SELECT	DISTINCT pactid,		assignment_id,		payroll_id,
		'I',				l_last_update_date,	l_last_updated_by,
		l_last_update_date,		l_last_updated_by,	l_last_updated_login
	FROM	psp_enc_changed_assignments
	WHERE	payroll_action_id = pactid;
Line: 6730

		RAISE NO_UPDATE_REC_FOUND;
Line: 6736

	WHEN NO_UPDATE_REC_FOUND THEN
		psp_message_s.print_error (p_mode => FND_FILE.LOG, p_print_header => FND_API.G_FALSE);
Line: 6752

SELECT  DISTINCT assignment_id
FROM	psp_enc_changed_assignments
WHERE	assignment_id BETWEEN start_asg AND end_asg
AND	payroll_action_id = p_pactid;
Line: 6773

		SELECT pay_assignment_actions_s.NEXTVAL INTO l_asg_action_id FROM DUAL;
Line: 6825

SELECT	fnd_number.canonical_to_number(NVL(argument11, -1)),
	argument12
FROM	fnd_concurrent_requests fcr,
	psp_enc_processes pep
WHERE	pep.payroll_action_id = p_payroll_action_id
AND	fcr.request_id = pep.request_id;
Line: 6833

SELECT	MIN(object_id),
	MAX(object_id)
FROM	pay_temp_object_actions
WHERE	payroll_action_id = p_payroll_action_id
AND		chunk_number = p_chunk_number;
Line: 6840

SELECT	DISTINCT payroll_id,
	assignment_id,
	change_date
FROM	psp_enc_changed_assignments peca
WHERE	assignment_id BETWEEN l_min_asg_id AND l_max_asg_id
AND	(	(l_process_mode = 'TERMINATE' AND change_type = 'TR')
	OR	(l_process_mode = 'REGULAR' AND change_type <> 'TR'))
AND	payroll_id = NVL(l_payroll_id, payroll_id)
AND NOT EXISTS(
	SELECT  1
	FROM    psp_enc_process_assignments pepa
	WHERE   pepa.assignment_id = peca.assignment_id
	AND     assignment_status IN ('S','L')
	AND 	   payroll_id = l_payroll_id
)
-- Added the above condition for the bug 13036705
/*AND	NOT EXISTS	(SELECT	1
			FROM	psp_enc_process_assignments pepa
			WHERE	pepa.assignment_id = peca.assignment_id
			AND	pepa.payroll_action_id = p_payroll_action_id
			AND	pepa.assignment_status <> 'B')*/;
Line: 6864

SELECT	DISTINCT
	pet.element_type_id,
	pc.costing_debit_or_credit
FROM 	PAY_ELEMENT_ENTRIES_F pee,
	PAY_ELEMENT_LINKS_F pel,
	PAY_ELEMENT_TYPES_F pet,
	PER_ASSIGNMENTS_F pa,
        PAY_ELEMENT_CLASSIFICATIONS pc
WHERE	pee.assignment_id 	= p_assignment_id
AND	pa.assignment_id 	= p_assignment_id
AND	pee.effective_end_date >= pa.effective_start_date
AND	pee.effective_start_date <= pa.effective_end_date
AND	pee.element_link_id = pel.element_link_id
AND	pel.effective_end_date >= pa.effective_start_date
AND	pel.effective_start_date <= pa.effective_end_date
AND	pee.entry_type = 'E'
AND	pel.element_type_id = pet.element_type_id
AND	pet.effective_end_date >= pa.effective_start_date
AND	pet.effective_start_date <=pa.effective_end_date
AND	pel.business_group_id = l_business_group_id
AND	pet.element_type_id IN ( SELECT element_type_id
				 FROM   psp_enc_elements
				 WHERE  business_group_id = l_business_group_id
			 	 AND    set_of_books_id = l_set_of_books_id)
AND	pet.classification_id = pc.classification_id
ORDER BY pet.element_type_id;
Line: 6894

SELECT	COUNT(1),
	NVL(MAX(pelh.encumbrance_date),p_enc_begin_date)
FROM	psp_enc_lines_history pelh
WHERE	pelh.assignment_id		= l_assignment_id
AND	pelh.enc_element_type_id	= p_element_type_id
AND	pelh.payroll_id			= l_payroll_id;
Line: 6907

SELECT 	/*+ INDEX(ppa PAY_PAYROLL_ACTIONS_N51)
	INDEX(ptp PER_TIME_PERIODS_N50)	*/
        Max(ptp.end_date)
FROM	pay_payroll_actions ppa,
        pay_assignment_actions paa,
        per_time_periods ptp
WHERE 	ppa.payroll_action_id = paa.payroll_action_id (+)
AND     ppa.business_group_id 	= l_business_group_id
AND			ppa.payroll_id	= l_payroll_id
AND     NVL(paa.assignment_id, p_assignment_id) = p_assignment_id
AND   	ppa.action_type	IN ( 'R','Q')
AND			NVL(paa.action_status, ppa.action_status) = 'C'
and     ppa.date_earned between ptp.start_date and ptp.end_date
and     ptp.payroll_id = ppa.payroll_id
-- AND 		ppa.time_period_id = ptp.time_period_id		-- Commented for the Bug 12647364
;
Line: 6928

SELECT	MIN(ptp.start_date)
FROM	per_time_periods ptp
WHERE	ptp.payroll_id	= l_payroll_id;
Line: 6933

SELECT  NVL(parameter_value,1)
FROM  psp_enc_setup_options peso
WHERE peso.setup_parameter 	='EFFECTIVE_DATE'
AND   peso.business_group_id  = l_business_group_id
AND   peso.set_of_books_id 	= l_set_of_books_id;
Line: 6942

SELECT	COUNT(1), NVL(MAX(pel.encumbrance_date),p_enc_begin_date)
FROM	psp_enc_lines pel
WHERE	pel.enc_element_type_id	= p_element_type_id
AND		pel.assignment_id		= p_assignment_id
AND		pel.payroll_id			= l_payroll_id;
Line: 6949

SELECT	request_id
FROM	pay_payroll_actions
WHERE	payroll_action_id = p_payroll_action_id;
Line: 6954

SELECT	assignment_number,
	person_id,
	organization_id
FROM	per_all_assignments_f
WHERE	assignment_id = l_assignment_id
AND	payroll_id = l_payroll_id
AND	effective_end_date >= p_effective_date
AND	ROWNUM = 1;
Line: 6964

SELECT	payroll_name
FROM	pay_all_payrolls_f
WHERE	payroll_id = l_payroll_id
AND	business_group_id = g_business_group_id
AND	gl_set_of_books_id = g_set_of_books_id;
Line: 6971

SELECT	full_name
FROM	per_all_people_f
WHERE	person_id = l_person_id
AND	effective_end_date >= p_effective_date
AND	ROWNUM = 1;
Line: 6978

SELECT	name
FROM	hr_organization_units
WHERE	organization_id = l_organization_id;
Line: 6983

SELECT	element_name
FROM	pay_element_types_f
WHERE	element_type_id = l_element_type_id
AND	ROWNUM = 1;
Line: 6989

SELECT	pcv_information2 employee_hours
FROM	pqp_configuration_values
WHERE	pcv_information_category = 'PSP_IMPORT_EMPLOYEE_HOURS'
AND	legislation_code IS NULL
AND	NVL(business_group_id, l_business_group_id) = l_business_group_id;
Line: 6996

SELECT	pcv_information1 global_element_autopop,
	pcv_information2 element_type_autopop,
	pcv_information3 element_class_autopop,
	pcv_information4 assignment_autopop,
	pcv_information5 default_schedule_autopop,
	pcv_information6 default_account_autopop,
	pcv_information7 suspense_account
FROM	pqp_configuration_values
WHERE	pcv_information_category = 'PSP_ENABLE_AUTOPOPULATION'
AND	legislation_code IS NULL
AND	NVL(business_group_id, l_business_group_id) = l_business_group_id
ORDER BY business_group_id;
Line: 7010

SELECT	COUNT(1)
FROM	psp_enc_changed_assignments
WHERE	assignment_id = l_assignment_id
AND	payroll_id = l_payroll_id
AND	payroll_action_id = p_payroll_action_id
AND	change_type  <> 'LQ';
Line: 7018

SELECT	COUNT(1)
FROM	psp_enc_changed_assignments
WHERE	assignment_id = l_assignment_id
AND	payroll_id = l_payroll_id
AND	payroll_action_id = p_payroll_action_id
AND	change_type  = 'ZZ';
Line: 7026

SELECT	COUNT(1)
FROM	psp_enc_elements pee
WHERE	element_type_id = p_element_type_id
AND	(	formula_id IS NOT NULL
	OR	EXISTS	(SELECT	1
			FROM	pay_input_values_f piv
			WHERE	piv.input_value_id = pee.input_value_id
			AND	SUBSTR(piv.uom, 1, 1) <> 'H'));
Line: 7036

SELECT	COUNT(1)
FROM	psp_enc_elements pee
WHERE	element_type_id = p_element_type_id
AND	(	formula_id IS NOT NULL
	OR	EXISTS	(SELECT	1
			FROM	pay_input_values_f piv
			WHERE	piv.input_value_id = pee.input_value_id
			AND	SUBSTR(piv.uom, 1, 1) = 'H'));
Line: 7066

SELECT	SEGMENT1
FROM	pa_projects_all
WHERE	project_id = p_project_id;
Line: 7071

SELECT	award_number
FROM	gms_awards_all
WHERE	award_id = p_award_id;
Line: 7076

SELECT	task_number
FROM	pa_tasks_expend_v  -- Bug : 16391366  (20/03/2013)
WHERE	task_id = p_task_id;
Line: 7081

SELECT	name
FROM	hr_organization_units
WHERE	organization_id = p_expenditure_org_id;
Line: 7228

	cel_warnings.start_date.DELETE;
Line: 7229

	cel_warnings.end_date.DELETE;
Line: 7230

	cel_warnings.warning_code.DELETE;
Line: 7231

	cel_warnings.project_id.DELETE;
Line: 7232

	cel_warnings.task_id.DELETE;
Line: 7233

	cel_warnings.award_id.DELETE;
Line: 7234

	cel_warnings.exp_org_id.DELETE;
Line: 7235

	cel_warnings.exp_type.DELETE;
Line: 7236

	cel_warnings.effective_date.DELETE;
Line: 7237

	cel_warnings.error_status.DELETE;
Line: 7238

	cel_warnings.percent.DELETE;
Line: 7336

			select count(*)
			into l_asg_sl_count
			from psp_enc_process_assignments
			where assignment_id = 	t_assignments.asg_array(k)
			and assignment_status  in ('S','L');
Line: 7366

			delete_previous_error_log(p_assignment_id	=>	l_assignment_id,
					p_payroll_id		=>	l_payroll_id,
					p_payroll_action_id	=>	p_payroll_action_id);
Line: 7538

				UPDATE	psp_enc_lines_history pelh
				SET	change_flag = 'N'
				WHERE	assignment_id = l_assignment_id
				AND	payroll_id = l_payroll_id
				AND	change_flag = 'U'
				AND	EXISTS	(SELECT	1
						FROM	psp_enc_summary_lines pesl
						WHERE	pesl.assignment_id = l_assignment_id
						AND	pesl.payroll_id = l_payroll_id
						AND	status_code = 'A'
						AND	pesl.enc_summary_line_id = pelh.enc_summary_line_id);
Line: 7549

				hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '	Updated lines to be liquidated');
Line: 7550

				DELETE	psp_enc_changed_assignments
				WHERE	assignment_id = l_assignment_id
				AND	payroll_id = l_payroll_id
				AND	change_type = 'ZZ';
Line: 7555

				UPDATE	psp_enc_lines_history pelh
				SET	change_flag = 'N'
				WHERE	assignment_id = l_assignment_id
				AND	payroll_id = l_payroll_id
				AND	change_flag = 'U'
				AND	EXISTS	(SELECT	1
						FROM	psp_enc_summary_lines pesl
						WHERE	pesl.assignment_id = l_assignment_id
						AND	pesl.payroll_id = l_payroll_id
						AND	status_code = 'A'
						AND	pesl.enc_summary_line_id = pelh.enc_summary_line_id
						AND	pesl.effective_date <= (NVL((get_payroll_pay_end_date(l_payroll_id)
										   -- and ptp.time_period_id = ppa.time_period_id  -- Added for 11661463	-- Commented for the Bug 12647364
											),l_enc_begin_date)) );
Line: 7570

				hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '	Updated lines to be liquidated by regular liquidation');
Line: 7571

				UPDATE	psp_enc_lines_history pelh
				SET	change_flag = 'U'
				WHERE	assignment_id = l_assignment_id
				AND	payroll_id = l_payroll_id
				AND	change_flag = 'N'
				AND	EXISTS	(SELECT	1
						FROM	psp_enc_summary_lines pesl
						WHERE	pesl.assignment_id = l_assignment_id
						AND	pesl.payroll_id = l_payroll_id
						AND	status_code = 'A'
						AND	pesl.enc_summary_line_id = pelh.enc_summary_line_id
						AND	pesl.effective_date > (NVL((get_payroll_pay_end_date(l_payroll_id)
											   -- and ptp.time_period_id = ppa.time_period_id  -- Added for 11661463     -- Commented for the Bug 12647364
											),l_enc_begin_date)) );
Line: 7586

				hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '	Updated lines not to be liquidated by regular liquidation');
Line: 7615

		update_hierarchy_dates	(p_payroll_action_id	=>	p_payroll_action_id,
							p_payroll_id		=> l_payroll_id,
							p_assignment_id		=> l_assignment_id,
							p_return_status		=> l_return_status);
Line: 7626

	UPDATE	psp_enc_process_assignments pepa
	SET	assignment_status = 'B'
	WHERE	pepa.payroll_action_id = p_payroll_action_id
	AND	pepa.assignment_id = t_assignments.asg_array(recno)
	AND	pepa.payroll_id = t_assignments.payroll_array(recno)
	AND	NOT EXISTS	(SELECT	1
				FROM	psp_enc_summary_lines pesl
				WHERE	pesl.payroll_action_id = p_payroll_action_id
				AND	pesl.assignment_id = t_assignments.asg_array(recno)
				AND	pesl.payroll_id = t_assignments.payroll_array(recno));
Line: 7638

	UPDATE	psp_enc_process_assignments pepa
	SET	assignment_status = 'S'
	WHERE	pepa.payroll_action_id = p_payroll_action_id
	AND	pepa.assignment_id = t_assignments.asg_array(recno)
	AND	pepa.payroll_id = t_assignments.payroll_array(recno)
	AND	EXISTS	(SELECT	1
			FROM	psp_enc_summary_lines pesl
			WHERE	pesl.payroll_action_id = p_payroll_action_id
			AND	pesl.assignment_id = t_assignments.asg_array(recno)
			AND	pesl.payroll_id = t_assignments.payroll_array(recno));
Line: 7650

	UPDATE	psp_enc_process_assignments pepa
	SET	assignment_status = 'L'
	WHERE	pepa.payroll_action_id = p_payroll_action_id
	AND	pepa.assignment_id = t_assignments.asg_array(recno)
	AND	pepa.payroll_id = t_assignments.payroll_array(recno)
	AND	EXISTS	(SELECT	1
			FROM	psp_enc_summary_lines pesl
			WHERE	pesl.payroll_action_id = p_payroll_action_id
			AND	pesl.superceded_line_id IS NOT NULL
			AND	pesl.assignment_id = t_assignments.asg_array(recno)
			AND	pesl.payroll_id = t_assignments.payroll_array(recno));
Line: 7662

	t_assignments.payroll_array.delete;
Line: 7663

	t_assignments.asg_array.delete;
Line: 7732

l_last_update_date		DATE;
Line: 7733

l_last_updated_by		NUMBER;
Line: 7750

SELECT	argument12
FROM	fnd_concurrent_requests fcr,
	psp_enc_processes pep
WHERE	pep.payroll_action_id = p_payroll_action_id
AND	fcr.request_id = pep.request_id;
Line: 7757

SELECT	process_phase
FROM	psp_enc_processes
WHERE	payroll_action_id = p_payroll_action_id
AND	process_code = 'ST';
Line: 7763

SELECT  COUNT(1)
FROM	psp_report_errors
WHERE	payroll_action_id = p_payroll_action_id
AND	request_id >= l_request_id
AND	message_level = 'E';
Line: 7770

SELECT	COUNT(1)
FROM	psp_enc_summary_lines
WHERE	payroll_action_id = p_payroll_action_id
AND	status_code = 'N';
Line: 7776

	l_last_update_date := SYSDATE;
Line: 7777

	l_last_updated_by:= NVL(FND_GLOBAL.USER_ID, -1);
Line: 7795

			fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Create and Update Encumbrance process has errors. Please review the Run Results Report for more details.');
Line: 7820

		UPDATE	psp_enc_process_assignments pepa
		SET	assignment_status = 'B'
		WHERE	payroll_action_id = p_payroll_action_id
		AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.payroll_action_id = p_payroll_action_id
					AND	pesl.assignment_id = pepa.assignment_id
					AND	pesl.payroll_id = pepa.payroll_id
					AND	pesl.status_code = 'N');
Line: 7830

		UPDATE	psp_enc_process_assignments pepa
		SET	assignment_status = 'S'
		WHERE	payroll_action_id = p_payroll_action_id
		AND	EXISTS	(SELECT	1
				FROM	psp_enc_summary_lines pesl
				WHERE	pesl.payroll_action_id = p_payroll_action_id
				AND	pesl.assignment_id = pepa.assignment_id
				AND	pesl.payroll_id = pepa.payroll_id
				AND	pesl.status_code = 'N'
				AND	pesl.superceded_line_id IS NULL);
Line: 7841

		UPDATE	psp_enc_process_assignments pepa
		SET	assignment_status = 'L'
		WHERE	payroll_action_id = p_payroll_action_id
		AND	EXISTS	(SELECT	1
				FROM	psp_enc_summary_lines pesl
				WHERE	pesl.payroll_action_id = p_payroll_action_id
				AND	pesl.assignment_id = pepa.assignment_id
				AND	pesl.payroll_id = pepa.payroll_id
				AND	pesl.status_code = 'N'
				AND	pesl.superceded_line_id IS NOT NULL);
Line: 7857

		DELETE  FROM psp_enc_controls pec
		WHERE   pec.payroll_action_id = p_payroll_action_id
		AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_lines pel
					WHERE	pel.enc_control_id = pec.enc_control_id);
Line: 7862

		fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Deleted lines in psp_enc_controls which doesnt have a line in psp_enc_lines');
Line: 7864

		UPDATE	psp_enc_controls pec
		SET		(action_code,
				number_of_dr,				number_of_cr,
				total_dr_amount,			total_cr_amount,
				gl_dr_amount,				gl_cr_amount,
				ogm_dr_amount,				ogm_cr_amount) =
				(SELECT	'N',
					SUM(fnd_number.canonical_to_number(DECODE(pel.dr_cr_flag, 'D', 1, 0))), SUM(fnd_number.canonical_to_number(DECODE(pel.dr_cr_flag, 'C', 1, 0))),
					SUM(fnd_number.canonical_to_number(DECODE(pel.dr_cr_flag, 'D', pel.encumbrance_amount, 0))), SUM(fnd_number.canonical_to_number(DECODE(pel.dr_cr_flag, 'C', pel.encumbrance_amount, 0))),
					SUM(fnd_number.canonical_to_number(DECODE(pel.gl_project_flag, 'G', DECODE(pel.dr_cr_flag, 'D', pel.encumbrance_amount, 0), 0))),
					SUM(fnd_number.canonical_to_number(DECODE(pel.gl_project_flag, 'G', DECODE(pel.dr_cr_flag, 'C', pel.encumbrance_amount, 0), 0))),
					SUM(fnd_number.canonical_to_number(DECODE(pel.gl_project_flag, 'P', DECODE(pel.dr_cr_flag, 'D', pel.encumbrance_amount, 0), 0))),
					SUM(fnd_number.canonical_to_number(DECODE(pel.gl_project_flag, 'P', DECODE(pel.dr_cr_flag, 'C', pel.encumbrance_amount, 0), 0)))
				FROM	psp_enc_lines pel
				WHERE	pel.enc_control_id = pec.enc_control_id)
		WHERE	payroll_action_id = p_payroll_action_id;
Line: 7880

		fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Updated summary columns in psp_enc_controls');
Line: 7883

			UPDATE	psp_enc_changed_assignments peca
			SET	payroll_action_id = p_payroll_action_id
			WHERE	EXISTS	(SELECT	1
					FROM	psp_enc_changed_assignments peca2
					WHERE	peca2.assignment_id = peca.assignment_id
					AND	peca2.change_type = 'TR');
Line: 7891

		INSERT INTO     psp_enc_changed_asg_history
				(request_id, assignment_id, payroll_id, change_type, processing_module, created_by,
				creation_date, processed_flag, reference_id, action_type, payroll_action_id, change_date)
		SELECT	l_request_id, peca.assignment_id, peca.payroll_id, peca.change_type,
				'U', l_last_updated_by, l_last_update_date, NULL, NVL(peca.reference_id, 0),
				NVL(peca.action_type, 'U'), p_payroll_action_id, change_date
		FROM	psp_enc_changed_assignments peca
		WHERE   payroll_action_id = p_payroll_action_id;
Line: 7901

		DELETE	psp_enc_changed_assignments peca
		WHERE	peca.payroll_action_id = p_payroll_action_id;
Line: 7903

		fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Deleted processed change assignment records in psp_enc_change_assignments');
Line: 7905

		UPDATE	psp_enc_processes
		SET	process_status = 'P'
		WHERE	payroll_action_id = p_payroll_action_id;
Line: 7908

		fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Updated process_status in psp_enc_processes');
Line: 7910

		UPDATE	psp_enc_processes
		SET	process_status = 'B',
			process_phase = 'no_summarize_transfer'
		WHERE	payroll_action_id = p_payroll_action_id
		AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.payroll_action_id = p_payroll_action_id
					AND		pesl.status_code = 'N');
Line: 7919

		UPDATE	psp_enc_processes
		SET		process_phase = 'summarize_transfer'
		WHERE	payroll_action_id = p_payroll_action_id
		AND	EXISTS	(SELECT	1
				FROM	psp_enc_summary_lines pesl
				WHERE	pesl.payroll_action_id = p_payroll_action_id
				AND		pesl.status_code = 'N'
				AND		pesl.superceded_line_id IS NULL);
Line: 7928

		UPDATE	psp_enc_processes
		SET	process_phase = 'liquidate'
		WHERE	payroll_action_id = p_payroll_action_id
		AND	EXISTS	(SELECT	1
				FROM	psp_enc_summary_lines pesl
				WHERE	pesl.payroll_action_id = p_payroll_action_id
				AND		pesl.status_code = 'N'
				AND		pesl.superceded_line_id is NOT NULL);
Line: 7936

		fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Updated process_phase in psp_enc_processes');
Line: 7961

	-- 13566809 The delete statement deletes all the assignment information
--          from temp table before the CUEL process completes.

	DELETE FROM psp_asg_end_dates
	WHERE payroll_action_id = p_payroll_action_id;
Line: 7995

			UPDATE	psp_enc_processes
			SET	process_phase = 'deinit_st'
			WHERE	payroll_action_id = p_payroll_action_id
			AND	process_code = 'ST';
Line: 7999

			fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Updated process_phase in psp_enc_processes');
Line: 8084

SELECT	DISTINCT pelh.time_period_id ,
	pelh.encumbrance_date ,
	pelh.dr_cr_flag,
	pelh.encumbrance_amount ,
	pelh.gl_project_flag,
	pelh.enc_element_type_id,
	NVL(pelh.schedule_line_id,-99) ,
	NVL(pelh.org_schedule_id, -99) ,
	NVL(pelh.default_org_account_id, -99),
	NVL(pelh.suspense_org_account_id, -99),
	NVL(pelh.element_account_id, -99) ,
	NVL(pelh.project_id, -99),
	NVL(pelh.task_id, -99) ,
	NVL(pelh.award_id, -99),
	NVL(pelh.expenditure_type, '-99') ,
	NVL(pelh.expenditure_organization_id, -99) ,
	NVL(pelh.gl_code_combination_id, -99),
	NVL(pelh.attribute_category,'NULL_VALUE'),
	NVL(pelh.attribute1, 'NULL_VALUE'),
	NVL(pelh.attribute2, 'NULL_VALUE'),
	NVL(pelh.attribute3, 'NULL_VALUE'),
	NVL(pelh.attribute4, 'NULL_VALUE'),
	NVL(pelh.attribute5, 'NULL_VALUE'),
	NVL(pelh.attribute6, 'NULL_VALUE'),
	NVL(pelh.attribute7, 'NULL_VALUE'),
	NVL(pelh.attribute8, 'NULL_VALUE'),
	NVL(pelh.attribute9, 'NULL_VALUE'),
	NVL(pelh.attribute10, 'NULL_VALUE'),
	NVL(pelh.default_reason_code, 'NULL'),
	NVL(pelh.suspense_reason_code, 'NULL'),
	hierarchy_code
FROM	psp_enc_lines_history pelh
WHERE	pelh.change_flag = 'U'
AND	payroll_id = p_payroll_id
AND	assignment_id = p_assignment_id;
Line: 8121

SELECT	DISTINCT enc_summary_line_id
FROM	psp_enc_lines_history
WHERE	change_flag = 'N'
AND	payroll_id = p_payroll_id
AND	assignment_id = p_assignment_id;
Line: 8128

l_delete_flag		CHAR(1);
Line: 8136

	UPDATE	psp_enc_lines_history
	SET	change_flag = 'N'
	WHERE	assignment_id = p_assignment_id
	AND	payroll_id = p_payroll_id
	AND	change_flag = 'U'
	AND	status_code = 'A';
Line: 8145

		UPDATE	psp_enc_lines_history pelh
		SET	change_flag='U'
		WHERE	time_period_id = t_enc_lines_array.r_time_period_id(recno)
		AND	change_flag = 'N'
		AND	pelh.encumbrance_date = t_enc_lines_array.r_encumbrance_date(recno)
		AND	pelh.enc_element_type_id = t_enc_lines_array.r_enc_element_type_id(recno)
		AND	pelh.dr_cr_flag = t_enc_lines_array.r_dr_cr_flag(recno)
		AND	pelh.encumbrance_amount = ROUND( t_enc_lines_array.r_encumbrance_amount(recno),g_precision)
		AND	pelh.gl_project_flag = t_enc_lines_array.r_gl_project_flag(recno)
		AND	pelh.hierarchy_code = t_enc_lines_array.r_hierarchy_code(recno)
		AND	NVL(pelh.project_id, -99) = NVL(t_enc_lines_array.r_project_id(recno), -99)
		AND	NVL(pelh.task_id, -99) = NVL(t_enc_lines_array.r_task_id(recno), -99)
		AND	NVL(pelh.award_id, -99) = NVL(t_enc_lines_array.r_award_id(recno), -99)
		AND	NVL(pelh.expenditure_type, '-99') = NVL(t_enc_lines_array.r_expenditure_type(recno), '-99')
		AND	NVL(pelh.expenditure_organization_id, -99) = NVL(t_enc_lines_array.r_expenditure_organization_id(recno), -99)
		AND	NVL(pelh.gl_code_combination_id, -99) = NVL(t_enc_lines_array.r_gl_code_combination_id(recno), -99)
		AND	NVL(suspense_reason_code, 'NULL') = NVL(t_enc_lines_array.r_suspense_reason_code(recno), 'NULL')
		AND	NVL(default_reason_code, 'NULL') = NVL(t_enc_lines_array.r_default_reason_code(recno), 'NULL')
		AND	pelh.assignment_id = p_assignment_id
		AND	pelh.payroll_id = p_payroll_id;
Line: 8167

		UPDATE	psp_enc_lines_history pelh
		SET	change_flag='U'
		WHERE	time_period_id = t_enc_lines_array.r_time_period_id(recno)
		AND	change_flag = 'N'
		AND	pelh.encumbrance_date = t_enc_lines_array.r_encumbrance_date(recno)
		AND	pelh.enc_element_type_id = t_enc_lines_array.r_enc_element_type_id(recno)
		AND	pelh.dr_cr_flag = t_enc_lines_array.r_dr_cr_flag(recno)
		AND	pelh.encumbrance_amount = ROUND( t_enc_lines_array.r_encumbrance_amount(recno),g_precision)
		AND	pelh.gl_project_flag = t_enc_lines_array.r_gl_project_flag(recno)
		AND	pelh.hierarchy_code = t_enc_lines_array.r_hierarchy_code(recno)
		AND	NVL(pelh.project_id, -99) = NVL(t_enc_lines_array.r_project_id(recno), -99)
		AND	NVL(pelh.task_id, -99) = NVL(t_enc_lines_array.r_task_id(recno), -99)
		AND	NVL(pelh.award_id, -99) = NVL(t_enc_lines_array.r_award_id(recno), -99)
		AND	NVL(pelh.expenditure_type, '-99') = NVL(t_enc_lines_array.r_expenditure_type(recno), '-99')
		AND	NVL(pelh.expenditure_organization_id, -99) = NVL(t_enc_lines_array.r_expenditure_organization_id(recno), -99)
		AND	NVL(pelh.gl_code_combination_id, -99) = NVL(t_enc_lines_array.r_gl_code_combination_id(recno), -99)
		AND	NVL(suspense_reason_code, 'NULL') = NVL(t_enc_lines_array.r_suspense_reason_code(recno), 'NULL')
		AND	NVL(default_reason_code, 'NULL') = NVL(t_enc_lines_array.r_default_reason_code(recno), 'NULL')
		AND	pelh.assignment_id = p_assignment_id
		AND	pelh.payroll_id = p_payroll_id
		AND	NVL(pelh.attribute_category, 'NULL_VALUE') = t_enc_lines_array.r_attribute_category(recno)
		AND	NVL(pelh.attribute1, 'NULL_VALUE') = t_enc_lines_array.r_attribute1(recno)
		AND	NVL(pelh.attribute2, 'NULL_VALUE') = t_enc_lines_array.r_attribute2(recno)
		AND	NVL(pelh.attribute3, 'NULL_VALUE') = t_enc_lines_array.r_attribute3(recno)
		AND	NVL(pelh.attribute4, 'NULL_VALUE') = t_enc_lines_array.r_attribute4(recno)
		AND	NVL(pelh.attribute5, 'NULL_VALUE') = t_enc_lines_array.r_attribute5(recno)
		AND	NVL(pelh.attribute6, 'NULL_VALUE') = t_enc_lines_array.r_attribute6(recno)
		AND	NVL(pelh.attribute7, 'NULL_VALUE') = t_enc_lines_array.r_attribute7(recno)
		AND	NVL(pelh.attribute8, 'NULL_VALUE') = t_enc_lines_array.r_attribute8(recno)
		AND	NVL(pelh.attribute9, 'NULL_VALUE') = t_enc_lines_array.r_attribute9(recno)
		AND	NVL(pelh.attribute10, 'NULL_VALUE') = t_enc_lines_array.r_attribute10(recno);
Line: 8207

	UPDATE	psp_enc_lines_history pelh
	SET	change_flag='N'
	WHERE	enc_summary_line_id = l_enc_summary_line_id_tl(recno)
	AND	change_flag='U';
Line: 8212

	l_enc_summary_line_id_tl.DELETE;
Line: 8230

			l_delete_flag := 'N';
Line: 8248

					l_delete_flag := 'Y';
Line: 8253

			IF (l_delete_flag = 'N') THEN
				t_enc_lines_array2.r_enc_element_type_id(l_enc_lines_no) := t_enc_lines_array.r_enc_element_type_id(recno1);
Line: 8304

			l_delete_flag := 'N';
Line: 8333

					l_delete_flag := 'Y';
Line: 8338

			IF (l_delete_flag = 'N') THEN
				t_enc_lines_array2.r_enc_element_type_id(l_enc_lines_no) := t_enc_lines_array.r_enc_element_type_id(recno1);
Line: 8388

	t_enc_lines_array.r_enc_element_type_id.DELETE;
Line: 8389

	t_enc_lines_array.r_encumbrance_date.DELETE;
Line: 8390

	t_enc_lines_array.r_dr_cr_flag.DELETE;
Line: 8391

	t_enc_lines_array.r_encumbrance_amount.DELETE;
Line: 8392

	t_enc_lines_array.r_enc_line_type.DELETE;
Line: 8393

	t_enc_lines_array.r_schedule_line_id.DELETE;
Line: 8394

	t_enc_lines_array.r_org_schedule_id.DELETE;
Line: 8395

	t_enc_lines_array.r_default_org_account_id.DELETE;
Line: 8396

	t_enc_lines_array.r_suspense_org_account_id.DELETE;
Line: 8397

	t_enc_lines_array.r_element_account_id.DELETE;
Line: 8398

	t_enc_lines_array.r_gl_project_flag.DELETE;
Line: 8399

	t_enc_lines_array.r_person_id.DELETE;
Line: 8400

	t_enc_lines_array.r_assignment_id.DELETE;
Line: 8401

	t_enc_lines_array.r_award_id.DELETE;
Line: 8402

	t_enc_lines_array.r_task_id.DELETE;
Line: 8403

	t_enc_lines_array.r_expenditure_type.DELETE;
Line: 8404

	t_enc_lines_array.r_expenditure_organization_id.DELETE;
Line: 8405

	t_enc_lines_array.r_project_id.DELETE;
Line: 8406

	t_enc_lines_array.r_gl_code_combination_id.DELETE;
Line: 8407

	t_enc_lines_array.r_time_period_id.DELETE;
Line: 8408

	t_enc_lines_array.r_default_reason_code.DELETE;
Line: 8409

	t_enc_lines_array.r_suspense_reason_code.DELETE;
Line: 8410

	t_enc_lines_array.r_enc_control_id.DELETE;
Line: 8411

	t_enc_lines_array.r_change_flag.DELETE;
Line: 8412

	t_enc_lines_array.r_enc_start_date.DELETE;
Line: 8413

	t_enc_lines_array.r_enc_end_date.DELETE;
Line: 8414

	t_enc_lines_array.r_attribute_category.DELETE;
Line: 8415

	t_enc_lines_array.r_attribute1.DELETE;
Line: 8416

	t_enc_lines_array.r_attribute2.DELETE;
Line: 8417

	t_enc_lines_array.r_attribute3.DELETE;
Line: 8418

	t_enc_lines_array.r_attribute4.DELETE;
Line: 8419

	t_enc_lines_array.r_attribute5.DELETE;
Line: 8420

	t_enc_lines_array.r_attribute6.DELETE;
Line: 8421

	t_enc_lines_array.r_attribute7.DELETE;
Line: 8422

	t_enc_lines_array.r_attribute8.DELETE;
Line: 8423

	t_enc_lines_array.r_attribute9.DELETE;
Line: 8424

	t_enc_lines_array.r_attribute10.DELETE;
Line: 8425

	t_enc_lines_array.r_orig_gl_code_combination_id.DELETE;
Line: 8426

	t_enc_lines_array.r_orig_project_id.DELETE;
Line: 8427

	t_enc_lines_array.r_orig_award_id.DELETE;
Line: 8428

	t_enc_lines_array.r_orig_task_id.DELETE;
Line: 8429

	t_enc_lines_array.r_orig_expenditure_type.DELETE;
Line: 8430

	t_enc_lines_array.r_orig_expenditure_org_id.DELETE;
Line: 8431

	t_enc_lines_array.r_hierarchy_code.DELETE;
Line: 8432

	t_enc_lines_array.r_hierarchy_start_date.DELETE;
Line: 8433

	t_enc_lines_array.r_hierarchy_end_date.DELETE;
Line: 8438

		--delete_previous_error_log(p_assignment_id	=>	p_assignment_id,
				--p_payroll_id		=>	p_payroll_id,
				--p_payroll_action_id	=>	g_payroll_action_id);
Line: 8443

	insert_enc_lines_from_arrays	(p_payroll_id		=>	p_payroll_id,
					p_business_group_id	=>	p_business_group_id,
					p_set_of_books_id	=>	p_set_of_books_id,
					p_enc_line_type		=>	'U',
					p_return_status		=>	l_return_status);
Line: 8465

		fnd_msg_pub.add_exc_msg('PSP_ENC_UPDATE_LINES', 'VERIFY_CHANGES');
Line: 8482

l_last_updated_by	NUMBER(15);
Line: 8483

l_last_update_login	NUMBER(15);
Line: 8485

	l_last_updated_by := fnd_global.user_id;
Line: 8486

	l_last_update_login := fnd_global.login_id;
Line: 8488

	INSERT INTO psp_enc_summary_lines
		(enc_summary_line_id,	business_group_id,		set_of_books_id,
		enc_control_id,			time_period_id,			person_id,
		assignment_id,			effective_date,			gl_code_combination_id,
		project_id,				task_id,				award_id,
		expenditure_organization_id,	expenditure_type,
		summary_amount,			dr_cr_flag,			status_code,
		payroll_id,			gl_project_flag,		superceded_line_id,
		attribute_category,		attribute1,			attribute2,
		attribute3,			attribute4,			attribute5,
		attribute6,			attribute7,			attribute8,
		attribute9,			attribute10,			payroll_action_id,
		proposed_termination_date,	last_update_date,		last_updated_by,
		last_update_login,		created_by,			creation_date,
		update_flag,			org_id)
	SELECT	psp_enc_summary_lines_s.NEXTVAL,
		p_business_group_id,
		p_set_of_books_id,
		pesl.enc_control_id,
		pesl.time_period_id,
		pesl.person_id,
		pesl.assignment_id,
		pesl.effective_date,
		pesl.gl_code_combination_id,
		pesl.project_id,
		pesl.task_id,
		pesl.award_id,
		pesl.expenditure_organization_id,
		pesl.expenditure_type,
		DECODE(pesl.gl_project_flag, 'G', pesl.summary_amount, -pesl.summary_amount),
		DECODE(pesl.dr_cr_flag, 'C', 'D', 'D', 'C') dr_cr_flag,
		'N',
		pesl.payroll_id,
		pesl.gl_project_flag,
		pesl.enc_summary_line_id,
		DECODE(g_dff_grouping_option, 'Y', pesl.attribute_category, NULL) attribute_category,
		DECODE(g_dff_grouping_option, 'Y', pesl.attribute1, NULL) attribute1,
		DECODE(g_dff_grouping_option, 'Y', pesl.attribute2, NULL) attribute2,
		DECODE(g_dff_grouping_option, 'Y', pesl.attribute3, NULL) attribute3,
		DECODE(g_dff_grouping_option, 'Y', pesl.attribute4, NULL) attribute4,
		DECODE(g_dff_grouping_option, 'Y', pesl.attribute5, NULL) attribute5,
		DECODE(g_dff_grouping_option, 'Y', pesl.attribute6, NULL) attribute6,
		DECODE(g_dff_grouping_option, 'Y', pesl.attribute7, NULL) attribute7,
		DECODE(g_dff_grouping_option, 'Y', pesl.attribute8, NULL) attribute8,
		DECODE(g_dff_grouping_option, 'Y', pesl.attribute9, NULL) attribute9,
		DECODE(g_dff_grouping_option, 'Y', pesl.attribute10, NULL) attribute10,
		p_payroll_action_id,
		g_actual_term_date,
		SYSDATE,
		l_last_updated_by,
		l_last_update_login,
		l_last_updated_by,
		SYSDATE,
		DECODE(SIGN(TRUNC(effective_date)-TRUNC(p_enc_begin_date)), 1, 'U', 'L'),
		pesl.org_id
	FROM	psp_enc_summary_lines pesl
	WHERE	pesl.assignment_id = p_assignment_id
	AND	pesl.payroll_id = p_payroll_id
	AND	pesl.status_code = 'A'
	AND	pesl.enc_summary_line_id IN	(SELECT	pelh.enc_summary_line_id
			FROM	psp_enc_lines_history pelh
			WHERE	pelh.change_flag  = 'N'
			AND	pelh.assignment_id = p_assignment_id
			AND	pelh.payroll_id = p_payroll_id);
Line: 8572

l_last_updated_by	NUMBER(15);
Line: 8573

l_last_update_login	NUMBER(15);
Line: 8576

SELECT	pel.enc_control_id,
		pel.time_period_id,
		pel.person_id,
		pel.encumbrance_date,
		pel.gl_code_combination_id,
		pel.project_id,
		pel.task_id,
		pel.award_id,
		pel.expenditure_type,
		pel.expenditure_organization_id,
		SUM(pel.encumbrance_amount),
		pel.dr_cr_flag,
		pel.gl_project_flag,
		DECODE(g_dff_grouping_option, 'Y', pel.attribute_category, NULL) attribute_category,
		DECODE(g_dff_grouping_option, 'Y', pel.attribute1, NULL) attribute1,
		DECODE(g_dff_grouping_option, 'Y', pel.attribute2, NULL) attribute2,
		DECODE(g_dff_grouping_option, 'Y', pel.attribute3, NULL) attribute3,
		DECODE(g_dff_grouping_option, 'Y', pel.attribute4, NULL) attribute4,
		DECODE(g_dff_grouping_option, 'Y', pel.attribute5, NULL) attribute5,
		DECODE(g_dff_grouping_option, 'Y', pel.attribute6, NULL) attribute6,
		DECODE(g_dff_grouping_option, 'Y', pel.attribute7, NULL) attribute7,
		DECODE(g_dff_grouping_option, 'Y', pel.attribute8, NULL) attribute8,
		DECODE(g_dff_grouping_option, 'Y', pel.attribute9, NULL) attribute9,
		DECODE(g_dff_grouping_option, 'Y', pel.attribute10, NULL) attribute10,
		pa.org_id
   	FROM	PSP_ENC_LINES pel,
		PSP_ORGANIZATION_ACCOUNTS pos,
		pa_projects_all pa
   	WHERE 	pel.ENCUMBRANCE_AMOUNT <> 0
	AND	pel.assignment_id = p_assignment_id
	AND	pel.payroll_id = p_payroll_id
   	AND	pel.suspense_org_account_id = pos.organization_account_id(+)
	AND	pa.project_id (+) = pel.project_id
	AND	pel.payroll_action_id = p_payroll_action_id
	GROUP BY	pel.enc_control_id,
		pel.time_period_id,
		pel.person_id,
		pel.encumbrance_date,
		pel.gl_code_combination_id,
		pel.project_id,
		pel.task_id,
		pel.award_id,
		pel.expenditure_type,
		pel.expenditure_organization_id,
		pel.dr_cr_flag,
		pel.gl_project_flag,
		DECODE(g_dff_grouping_option, 'Y', pel.attribute_category, NULL),
		DECODE(g_dff_grouping_option, 'Y', pel.attribute1, NULL),
		DECODE(g_dff_grouping_option, 'Y', pel.attribute2, NULL),
		DECODE(g_dff_grouping_option, 'Y', pel.attribute3, NULL),
		DECODE(g_dff_grouping_option, 'Y', pel.attribute4, NULL),
		DECODE(g_dff_grouping_option, 'Y', pel.attribute5, NULL),
		DECODE(g_dff_grouping_option, 'Y', pel.attribute6, NULL),
		DECODE(g_dff_grouping_option, 'Y', pel.attribute7, NULL),
		DECODE(g_dff_grouping_option, 'Y', pel.attribute8, NULL),
		DECODE(g_dff_grouping_option, 'Y', pel.attribute9, NULL),
		DECODE(g_dff_grouping_option, 'Y', pel.attribute10, NULL),
		pa.org_id;
Line: 8664

	l_last_updated_by := fnd_global.user_id;
Line: 8665

	l_last_update_login := fnd_global.login_id;
Line: 8685

		SELECT psp_enc_summary_lines_s.NEXTVAL INTO t_sum_lines.enc_summary_line_id(recno) FROM DUAL;
Line: 8689

	INSERT INTO psp_enc_summary_lines
		(enc_summary_line_id,			business_group_id,		enc_control_id,
		time_period_id,					person_id,				assignment_id,
		effective_date,					set_of_books_id,		gl_code_combination_id,
		project_id,						task_id,				award_id,
		expenditure_organization_id,	expenditure_type,		summary_amount,
		dr_cr_flag,						status_code,			payroll_id,
		gl_project_flag,
		attribute_category,				attribute1,				attribute2,
		attribute3,						attribute4,				attribute5,
		attribute6,						attribute7,				attribute8,
		attribute9,						attribute10,			payroll_action_id,
		proposed_termination_date,		last_update_date,		last_updated_by,
		last_update_login,				created_by,				creation_date,
		org_id)
	VALUES	(t_sum_lines.enc_summary_line_id(recno),	p_business_group_id,
		t_sum_lines.enc_control_id(recno),				t_sum_lines.time_period_id(recno),
		t_sum_lines.person_id(recno),					p_assignment_id,
		t_sum_lines.effective_date(recno),				p_set_of_books_id,
		t_sum_lines.gl_code_combination_id(recno),		t_sum_lines.project_id(recno),
		t_sum_lines.task_id(recno),						t_sum_lines.award_id(recno),
		t_sum_lines.expenditure_organization_id(recno),	t_sum_lines.expenditure_type(recno),
		t_sum_lines.summary_amount(recno),				t_sum_lines.dr_cr_flag(recno),
		'N',		p_payroll_id,						t_sum_lines.gl_project_flag(recno),
		t_sum_lines.attribute_category(recno),			t_sum_lines.attribute1(recno),
		t_sum_lines.attribute2(recno),					t_sum_lines.attribute3(recno),
		t_sum_lines.attribute4(recno),					t_sum_lines.attribute5(recno),
		t_sum_lines.attribute6(recno),					t_sum_lines.attribute7(recno),
		t_sum_lines.attribute8(recno),					t_sum_lines.attribute9(recno),
		t_sum_lines.attribute10(recno),					p_payroll_action_id,
		g_actual_term_date,								SYSDATE,
		l_last_updated_by,								l_last_update_login,
		l_last_updated_by,								SYSDATE,
		t_sum_lines.org_id(recno));
Line: 8727

		UPDATE	psp_enc_lines pel
		SET		enc_summary_line_id =	t_sum_lines.enc_summary_line_id(recno)
		WHERE	payroll_action_id = p_payroll_action_id
		AND		pel.assignment_id = p_assignment_id
		AND		pel.payroll_id = p_payroll_id
		AND		pel.enc_control_id = t_sum_lines.enc_control_id(recno)
		AND		pel.time_period_id = t_sum_lines.time_period_id(recno)
		AND		pel.person_id = t_sum_lines.person_id(recno)
		AND		pel.encumbrance_date = t_sum_lines.effective_date(recno)
		AND		NVL(pel.gl_code_combination_id, -99) = NVL(t_sum_lines.gl_code_combination_id(recno), -99)
		AND		NVL(pel.project_id, -99) = NVL(t_sum_lines.project_id(recno), -99)
		AND		NVL(pel.task_id, -99) = NVL(t_sum_lines.task_id(recno), -99)
		AND		NVL(pel.award_id, -99) = NVL(t_sum_lines.award_id(recno), -99)
		AND		NVL(pel.expenditure_type, 'NULL') = NVL(t_sum_lines.expenditure_type(recno), 'NULL')
		AND		NVL(pel.expenditure_organization_id, -99) = NVL(t_sum_lines.expenditure_organization_id(recno), -99)
		AND		pel.dr_cr_flag = t_sum_lines.dr_cr_flag(recno)
		AND		pel.gl_project_flag = t_sum_lines.gl_project_flag(recno)
		AND		NVL(pel.attribute_category, 'NULL') = NVL(t_sum_lines.attribute_category(recno), 'NULL')
		AND		NVL(pel.attribute1, 'NULL') = NVL(t_sum_lines.attribute1(recno), 'NULL')
		AND		NVL(pel.attribute2, 'NULL') = NVL(t_sum_lines.attribute2(recno), 'NULL')
		AND		NVL(pel.attribute3, 'NULL') = NVL(t_sum_lines.attribute3(recno), 'NULL')
		AND		NVL(pel.attribute4, 'NULL') = NVL(t_sum_lines.attribute4(recno), 'NULL')
		AND		NVL(pel.attribute5, 'NULL') = NVL(t_sum_lines.attribute5(recno), 'NULL')
		AND		NVL(pel.attribute6, 'NULL') = NVL(t_sum_lines.attribute6(recno), 'NULL')
		AND		NVL(pel.attribute7, 'NULL') = NVL(t_sum_lines.attribute7(recno), 'NULL')
		AND		NVL(pel.attribute8, 'NULL') = NVL(t_sum_lines.attribute8(recno), 'NULL')
		AND		NVL(pel.attribute9, 'NULL') = NVL(t_sum_lines.attribute9(recno), 'NULL')
		AND		NVL(pel.attribute10, 'NULL') = NVL(t_sum_lines.attribute10(recno), 'NULL');
Line: 8757

		UPDATE	psp_enc_lines pel
		SET		enc_summary_line_id =	t_sum_lines.enc_summary_line_id(recno)
		WHERE	payroll_action_id = p_payroll_action_id
		AND		pel.assignment_id = p_assignment_id
		AND		pel.payroll_id = p_payroll_id
		AND		pel.enc_control_id = t_sum_lines.enc_control_id(recno)
		AND		pel.time_period_id = t_sum_lines.time_period_id(recno)
		AND		pel.person_id = t_sum_lines.person_id(recno)
		AND		pel.encumbrance_date = t_sum_lines.effective_date(recno)
		AND		NVL(pel.gl_code_combination_id, -99) = NVL(t_sum_lines.gl_code_combination_id(recno), -99)
		AND		NVL(pel.project_id, -99) = NVL(t_sum_lines.project_id(recno), -99)
		AND		NVL(pel.task_id, -99) = NVL(t_sum_lines.task_id(recno), -99)
		AND		NVL(pel.award_id, -99) = NVL(t_sum_lines.award_id(recno), -99)
		AND		NVL(pel.expenditure_type, 'NULL') = NVL(t_sum_lines.expenditure_type(recno), 'NULL')
		AND		NVL(pel.expenditure_organization_id, -99) = NVL(t_sum_lines.expenditure_organization_id(recno), -99)
		AND		pel.dr_cr_flag = t_sum_lines.dr_cr_flag(recno)
		AND		pel.gl_project_flag = t_sum_lines.gl_project_flag(recno);
Line: 8824

SELECT	COUNT(1)
FROM	psp_enc_controls
WHERE	ROWNUM = 1;
Line: 8829

SELECT	fnd_number.canonical_to_number(NVL(argument13, '-1')),
	fnd_date.canonical_to_date(NVL(argument14, fnd_date.date_to_canonical(TRUNC(SYSDATE)))),
	fnd_number.canonical_to_number(NVL(argument15, '-1')),
	fnd_date.canonical_to_date(NVL(argument16, fnd_date.date_to_canonical(TRUNC(SYSDATE)))),
	fnd_number.canonical_to_number(NVL(argument17, '-1')),
	fnd_date.canonical_to_date(NVL(argument18, fnd_date.date_to_canonical(TRUNC(SYSDATE)))),
	fnd_number.canonical_to_number(NVL(argument19, '-1')),
	fnd_date.canonical_to_date(NVL(argument20, fnd_date.date_to_canonical(TRUNC(SYSDATE)))),
	fnd_number.canonical_to_number(NVL(argument21, '-1')),
	fnd_date.canonical_to_date(NVL(argument22, fnd_date.date_to_canonical(TRUNC(SYSDATE))))
FROM	psp_enc_processes pep,
	fnd_concurrent_requests fcr
WHERE	pep.payroll_action_id = p_payroll_action_id
AND	fcr.request_id = pep.request_id;
Line: 8845

SELECT	pep.inc_exc_flag
FROM	psp_enc_payrolls pep
WHERE	pep.payroll_id        = p_payroll_id
AND	pep.business_group_id = l_business_group_id
AND	pep.set_of_books_id   = l_set_of_books_id;
Line: 8853

SELECT 	/*+ use_nl(PTP) */ Max(ptp.end_date)
FROM	pay_payroll_actions ppa,
        pay_assignment_actions paa,
        per_time_periods ptp
WHERE 	ppa.payroll_action_id = paa.payroll_action_id (+)
AND     ppa.business_group_id = l_business_group_id
AND	ppa.payroll_id = p_payroll_id
AND   	ppa.action_type	IN ( 'R','Q')
AND	NVL(paa.action_status, ppa.action_status) = 'C'
and     ppa.date_earned between ptp.start_date and ptp.end_date
and     ptp.payroll_id = ppa.payroll_id;
Line: 8866

SELECT	MIN(ptp.start_date)
FROM	per_time_periods ptp
WHERE	ptp.payroll_id= p_payroll_id;
Line: 8871

SELECT	assignment_number,
	person_id,
	organization_id
FROM	per_all_assignments_f
WHERE	assignment_id = l_assignment_id
AND	payroll_id = NVL(l_payroll_id, p_payroll_id)
AND	effective_end_date >= p_start_date
AND	ROWNUM = 1;
Line: 8881

SELECT	payroll_name
FROM	pay_all_payrolls_f
WHERE	payroll_id = p_payroll_id
AND	business_group_id = g_business_group_id
AND	gl_set_of_books_id = g_set_of_books_id
AND	ROWNUM = 1;
Line: 8889

SELECT	full_name
FROM	per_all_people_f
WHERE	person_id = l_person_id
AND	effective_end_date >= p_start_date
AND	ROWNUM = 1;
Line: 8896

SELECT	name
FROM	hr_organization_units
WHERE	organization_id = l_organization_id;
Line: 8901

SELECT	pep.request_id || ': ' || fcpt.user_concurrent_program_name
FROM	psp_enc_processes pep,
	fnd_concurrent_requests fcr,
	fnd_concurrent_programs_tl fcpt
WHERE	EXISTS	(SELECT	1
		FROM	psp_enc_summary_lines pesl
		WHERE	pesl.payroll_action_id = pep.payroll_action_id
		AND	pesl.payroll_action_id = l_payroll_action_id)
AND	fcr.request_id = pep.request_id
AND	fcpt.concurrent_program_id = fcr.concurrent_program_id
AND	fcpt.language = USERENV('LANG')
ORDER BY DECODE(pep.process_code, 'LET', 1, 'ST', 2, 3);
Line: 8915

SELECT	DISTINCT assignment_id,
	payroll_id,
	payroll_action_id
FROM	psp_enc_summary_lines pesl
WHERE	pesl.person_id = p_person_id
AND	pesl.status_code = 'N';
Line: 8923

SELECT	pepa.assignment_id,
	pepa.payroll_action_id
FROM	psp_enc_process_assignments pepa
WHERE	pepa.payroll_id = p_payroll_id
AND	pepa.assignment_status NOT IN ('B', 'P');
Line: 8937

SELECT  /*+INDEX(peca PSP_ENC_CHANGED_ASSIGNMENTS_N3)

                 */
        peca.assignment_id
FROM    psp_enc_changed_assignments peca
WHERE payroll_action_id = p_payroll_action_id
AND   payroll_id = p_payroll_id
AND   request_id = l_request_id
AND     assignment_id IN
        (
        SELECT  /*+ ORDERED
               INDEX(pep PSP_ENC_PAYROLLS_N1)
                INDEX(pepa PSP_ENC_PAYROLL_ASSIGNMENTS_N1)
                  */
                pepa.assignment_id
        FROM    psp_enc_payrolls pep
               ,psp_enc_payroll_assignments pepa
        WHERE   pep.payroll_id = p_payroll_id
        AND     pep.inc_exc_flag = 'Y'
        AND     pep.enc_payroll_id = pepa.enc_payroll_id
        AND     pep.business_group_id = p_business_group_id
        UNION
        SELECT  /*+ORDERED
                   NO_USE_MERGE(paaf) */
                DISTINCT
                paaf.assignment_id
        FROM    psp_enc_payrolls pep
               ,per_all_assignments_f paaf
        WHERE   pep.inc_exc_flag = 'N'
        AND     pep.payroll_id = paaf.payroll_id
        AND     pep.payroll_id = p_payroll_id
        AND     pep.business_group_id = p_business_group_id
        AND     paaf.assignment_type = 'E'
        AND     NOT EXISTS
                (
                SELECT  pepa.assignment_id
                FROM    psp_enc_payroll_assignments pepa
                WHERE   pepa.business_group_id = p_business_group_id
                AND     pepa.assignment_id = paaf.assignment_id
                )
        );
Line: 9014

		IF (l_new_cust = 0 AND psp_general.start_capturing_updates(l_business_group_id) = 'N') THEN
			l_pre_process_mode := 'F';
Line: 9048

		select prev_enc_end_date into l_prev_enc_end_date
		 from PSP_ENC_END_DATES_V
		 where business_group_id = l_business_group_id
		 and set_of_books_id = l_set_of_books_id
		and default_org_flag='Y';
Line: 9069

			INSERT INTO psp_enc_changed_assignments
				(request_id, payroll_id, assignment_id, change_type, payroll_action_id)
			SELECT	DISTINCT l_request_id, p_payroll_id, pa.assignment_id, 'CR', p_payroll_action_id
			FROM	per_assignments_f pa
			WHERE	pa.payroll_id = p_payroll_id
			AND	pa.assignment_type = 'E'
			AND	pa.business_group_id = l_business_group_id
			-- AND	pa.effective_end_date >= l_enc_begin_date
			-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
					AND	pa.effective_end_date >= (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pa.assignment_id,pa.business_group_id,pa.payroll_id)  --13566809
					-- AND ptp.time_period_id = ppa.time_period_id  -- Added for bug 9862281   -- Commented for the Bug 12647364
					),l_enc_begin_date))
			AND	NOT EXISTS	(SELECT	pepa.assignment_id
					FROM	psp_enc_payroll_assignments pepa,
						psp_enc_payrolls pep
					WHERE	pepa.enc_payroll_id = pep.enc_payroll_id
					AND	pepa.business_group_id = l_business_group_id
					AND	pepa.set_of_books_id = l_set_of_books_id
					AND	pepa.business_group_id = pep.business_group_id
					AND	pepa.set_of_books_id = pep.set_of_books_id
					AND	pep.payroll_id = p_payroll_id
					AND	pepa.assignment_id = pa.assignment_id)
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_changed_assignments peca
					WHERE	peca.assignment_id = pa.assignment_id
					AND	peca.payroll_id = p_payroll_id)
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.assignment_id = pa.assignment_id
					AND	pesl.status_code IN ('A', 'N')
					-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
							AND	pesl.effective_date > (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pesl.assignment_id,pesl.business_group_id,pesl.payroll_id)  --13566809
					        --  AND ptp.time_period_id = ppa.time_period_id  -- Added for bug 9862281   -- Commented for the Bug 12647364
					    ),l_enc_begin_date))
					AND	pesl.payroll_id = p_payroll_id);
Line: 9105

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '10-A	Inserted ' || SQL%ROWCOUNT || ' assignments into psp_enc_changed_assignments');
Line: 9110

			INSERT INTO psp_enc_changed_assignments
				(request_id, payroll_id, assignment_id, change_type, payroll_action_id)
			SELECT	DISTINCT l_request_id, p_payroll_id, pa.assignment_id, 'CR', p_payroll_action_id
			FROM	per_assignments_f pa
			WHERE	pa.payroll_id = p_payroll_id
			AND	pa.assignment_type = 'E'
			AND	pa.business_group_id = l_business_group_id
						AND	pa.effective_end_date >= (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pa.assignment_id,pa.business_group_id,pa.payroll_id)  --13566809
					               -- AND ptp.time_period_id = ppa.time_period_id  -- Added for bug 9862281   -- Commented for the Bug 12647364
					         ),l_enc_begin_date))
			AND	NOT EXISTS	(SELECT	pepa.assignment_id
					FROM	psp_enc_payroll_assignments pepa,
						psp_enc_payrolls pep
					WHERE	pepa.enc_payroll_id = pep.enc_payroll_id
					AND	pepa.business_group_id = l_business_group_id
					AND	pepa.set_of_books_id = l_set_of_books_id
					AND	pepa.business_group_id = pep.business_group_id
					AND	pepa.set_of_books_id = pep.set_of_books_id
					AND	pep.payroll_id = p_payroll_id
					AND	pepa.assignment_id = pa.assignment_id)
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_changed_assignments peca
					WHERE	peca.assignment_id = pa.assignment_id
					AND	peca.payroll_id = p_payroll_id)
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.assignment_id = pa.assignment_id
					AND	pesl.status_code IN ('A', 'N')
					AND	pesl.effective_date > l_prev_enc_end_date
					AND	pesl.payroll_id = p_payroll_id);
Line: 9141

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '10-B	Inserted ' || SQL%ROWCOUNT || ' assignments into psp_enc_changed_assignments');
Line: 9143

			INSERT INTO psp_enc_changed_assignments
				(request_id, payroll_id, assignment_id, change_type, payroll_action_id)
			SELECT	DISTINCT l_request_id, p_payroll_id, pa.assignment_id, 'ZZ', p_payroll_action_id
			FROM	per_assignments_f pa
			WHERE	pa.payroll_id = p_payroll_id
			AND	pa.assignment_type = 'E'
			AND	pa.business_group_id = l_business_group_id
		--	AND	pa.effective_end_date >= l_enc_begin_date      -- Commenting this in the fix 12769510 as it is found to be commented in 11i code
			-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
						AND	pa.effective_end_date >= (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pa.assignment_id,pa.business_group_id,pa.payroll_id)  --13566809
					-- AND ptp.time_period_id = ppa.time_period_id -- Added for bug 9862281	   -- Commented for the Bug 12647364
					),l_enc_begin_date))
			AND	EXISTS	(SELECT	pepa.assignment_id
					FROM	psp_enc_payroll_assignments pepa,
						psp_enc_payrolls pep
					WHERE	pepa.enc_payroll_id = pep.enc_payroll_id
					AND	pepa.business_group_id = l_business_group_id
					AND	pepa.set_of_books_id = l_set_of_books_id
					AND	pepa.business_group_id = pep.business_group_id
					AND	pepa.set_of_books_id = pep.set_of_books_id
					AND	pep.payroll_id = p_payroll_id
					AND	pepa.assignment_id = pa.assignment_id)
			AND	EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.assignment_id = pa.assignment_id
					AND	pesl.status_code  = 'A'
					AND	pesl.payroll_id = p_payroll_id)
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.assignment_id = pa.assignment_id
					AND	pesl.status_code = 'N'
					AND	pesl.payroll_id = p_payroll_id);
Line: 9176

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '20	Inserted ' || SQL%ROWCOUNT || ' assignments into psp_enc_changed_assignments');
Line: 9180

			INSERT INTO psp_enc_changed_assignments
				(request_id, payroll_id, assignment_id, change_type, payroll_action_id)
			SELECT /*+
       index(Pepa PSP_ENC_PAYROLL_ASSIGNMENTS_N1)
       index(PA PER_ASSIGNMENTS_F_PK)
       INDEX(pep PSP_ENC_PAYROLLS_N1) */
				DISTINCT l_request_id, p_payroll_id, pa.assignment_id, 'CR', p_payroll_action_id
			FROM   psp_enc_payrolls pep,
       psp_enc_payroll_assignments pepa,
       per_assignments_f pa
			WHERE	pa.payroll_id          = p_payroll_id
			AND	pepa.business_group_id  = l_business_group_id
			AND	pepa.set_of_books_id    = l_set_of_books_id
			AND	pepa.assignment_id      = pa.assignment_id
		--	AND	pa.effective_end_date >= l_enc_begin_date        -- Commenting this in the fix 12769510 as it is found to be commented in 11i code
			-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
							AND	pa.effective_end_date >= (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pa.assignment_id,pa.business_group_id,pa.payroll_id)  --13566809
					-- AND ptp.time_period_id = ppa.time_period_id  -- Added for bug 9862281   -- Commented for the Bug 12647364
					),l_enc_begin_date))
			AND	pep.payroll_id          = p_payroll_id
			AND	pep.enc_payroll_id      = pepa.enc_payroll_id
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_changed_assignments peca
					WHERE	peca.assignment_id = pepa.assignment_id
					AND	peca.payroll_id = p_payroll_id)
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.assignment_id = pa.assignment_id
					AND pesl.payroll_id = pa.payroll_id   -- Added for bug 9862281
					AND	pesl.status_code IN ('A', 'N')
					-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
									AND	pesl.effective_date > (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pesl.assignment_id,pesl.business_group_id,pesl.payroll_id)  --13566809
									),l_enc_begin_date)) );
Line: 9216

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '30-A	Inserted ' || SQL%ROWCOUNT || ' assignments into psp_enc_changed_assignments');
Line: 9219

			INSERT INTO psp_enc_changed_assignments
				(request_id, payroll_id, assignment_id, change_type, payroll_action_id)
			SELECT	DISTINCT l_request_id, p_payroll_id, pa.assignment_id, 'CR', p_payroll_action_id
			FROM	psp_enc_payroll_assignments pepa,
				psp_enc_payrolls pep,
				per_assignments_f pa
			WHERE	pa.payroll_id	= p_payroll_id
			AND	pepa.business_group_id = l_business_group_id
			AND	pepa.set_of_books_id	= l_set_of_books_id
			AND	pepa.assignment_id	= pa.assignment_id
							AND	pa.effective_end_date >= (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pa.assignment_id,pa.business_group_id,pa.payroll_id) --13566809
									 -- AND ptp.time_period_id = ppa.time_period_id  -- Added for bug 9862281   -- Commented for the Bug 12647364
									 ),l_enc_begin_date))
			AND	pep.payroll_id	= p_payroll_id
			AND	pep.enc_payroll_id	= pepa.enc_payroll_id
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_changed_assignments peca
					WHERE	peca.assignment_id = pepa.assignment_id
					AND	peca.payroll_id = p_payroll_id)
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.assignment_id = pa.assignment_id
					AND	pesl.status_code IN ('A', 'N')
					AND	pesl.effective_date > l_prev_enc_end_date);
Line: 9244

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '30-B	Inserted ' || SQL%ROWCOUNT || ' assignments into psp_enc_changed_assignments');
Line: 9246

			INSERT INTO psp_enc_changed_assignments
				(request_id, payroll_id, assignment_id, change_type, payroll_action_id)
			SELECT	DISTINCT l_request_id, p_payroll_id, pa.assignment_id, 'ZZ', p_payroll_action_id
			FROM	per_assignments_f pa
			WHERE	pa.payroll_id = p_payroll_id
			AND	pa.assignment_type = 'E'
			AND	pa.business_group_id = l_business_group_id
		--	AND	pa.effective_end_date >= l_enc_begin_date		-- Commenting this in the fix 12769510 as it is found to be commented in 11i code
			-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
						AND	pa.effective_end_date >= (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pa.assignment_id,pa.business_group_id,pa.payroll_id) --13566809
					-- AND ptp.time_period_id = ppa.time_period_id  -- Added for bug 9862281   -- Commented for the Bug 12647364
					),l_enc_begin_date))
			AND	NOT EXISTS	(SELECT	pepa.assignment_id
					FROM	psp_enc_payroll_assignments pepa,
						psp_enc_payrolls pep
					WHERE	pepa.enc_payroll_id = pep.enc_payroll_id
					AND	pepa.business_group_id = l_business_group_id
					AND	pepa.set_of_books_id = l_set_of_books_id
					AND	pepa.business_group_id = pep.business_group_id
					AND	pepa.set_of_books_id = pep.set_of_books_id
					AND	pep.payroll_id = p_payroll_id
					AND	pepa.assignment_id = pa.assignment_id)
			AND	EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.assignment_id = pa.assignment_id
					AND	pesl.status_code  = 'A'
					AND	pesl.payroll_id = p_payroll_id)
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.assignment_id = pa.assignment_id
					AND	pesl.status_code = 'N'
					AND	pesl.payroll_id = p_payroll_id);
Line: 9278

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '40	Inserted ' || SQL%ROWCOUNT || ' assignments into psp_enc_changed_assignments');
Line: 9281

		INSERT INTO psp_enc_changed_assignments
			(request_id, payroll_id, assignment_id, change_type, payroll_action_id)
		SELECT	DISTINCT l_request_id, p_payroll_id, assignment_id, 'LQ', p_payroll_action_id
		FROM	psp_enc_summary_lines pesl
		WHERE	payroll_id = p_payroll_id
		AND	business_group_id = l_business_group_id
		AND	status_code = 'A'
	--	AND	effective_date <= l_enc_begin_date       -- Commenting this in the fix 12769510 as it is found to be commented in 11i code
			-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
		AND	pesl.effective_date <= (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pesl.assignment_id,pesl.business_group_id,pesl.payroll_id)    --13566809
				-- AND ptp.time_period_id = ppa.time_period_id  -- Added for bug 9862281    -- Commented for the Bug 12647364
				),l_enc_begin_date))
		AND	NOT EXISTS	(SELECT	1
				FROM	psp_enc_changed_assignments peca
				WHERE	peca.assignment_id = pesl.assignment_id
					AND	peca.payroll_id = p_payroll_id)
		AND	NOT EXISTS	(SELECT	/*+INDEX(pesl2 PSP_ENC_SUMMARY_LINES_N6)*/ 1
				FROM	psp_enc_summary_lines pesl2
				WHERE	pesl2.assignment_id = pesl.assignment_id
				AND	pesl2.status_code = 'N'
					-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
				AND	pesl2.effective_date <= (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pesl2.assignment_id,pesl2.business_group_id,pesl2.payroll_id)   --13566809
					  -- AND ptp.time_period_id = ppa.time_period_id  -- Added for bug 9862281     -- Commented for the Bug 12647364
					  ),l_enc_begin_date))
				AND	pesl2.payroll_id = p_payroll_id);
Line: 9306

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '50	Inserted ' || SQL%ROWCOUNT || ' assignments into psp_enc_changed_assignments');
Line: 9315

			INSERT INTO psp_enc_changed_assignments
				(request_id, payroll_id, assignment_id, change_type, payroll_action_id)
			SELECT	DISTINCT l_request_id, p_payroll_id, pa.assignment_id, 'CR', p_payroll_action_id
			FROM	per_assignments_f pa
			WHERE	pa.payroll_id = p_payroll_id
			AND	pa.assignment_type = 'E'
			AND	pa.business_group_id = l_business_group_id
			-- AND	pa.effective_end_date >= l_enc_begin_date
			-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
			AND	pa.effective_end_date >= (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pa.assignment_id,pa.business_group_id,pa.payroll_id)    --13566809
					-- AND ptp.time_period_id = ppa.time_period_id  -- Added for bug 9862281   -- Commented for the Bug 12647364
					),l_enc_begin_date))
			AND	NOT EXISTS	(SELECT	pepa.assignment_id
					FROM	psp_enc_payroll_assignments pepa,
						psp_enc_payrolls pep
					WHERE	pepa.enc_payroll_id = pep.enc_payroll_id
					AND	pepa.business_group_id = l_business_group_id
					AND	pepa.set_of_books_id = l_set_of_books_id
					AND	pepa.business_group_id = pep.business_group_id
					AND	pepa.set_of_books_id = pep.set_of_books_id
					AND	pep.payroll_id = p_payroll_id
					AND	pepa.assignment_id = pa.assignment_id)
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_changed_assignments peca
					WHERE	peca.assignment_id = pa.assignment_id
					AND	peca.payroll_id = p_payroll_id)
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.assignment_id = pa.assignment_id
					AND	pesl.status_code IN ('A', 'N')
					-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
					AND	pesl.effective_date > (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pesl.assignment_id,pesl.business_group_id,pesl.payroll_id) --13566809
					        --  AND ptp.time_period_id = ppa.time_period_id  -- Added for bug 9862281   -- Commented for the Bug 12647364
					    ),l_enc_begin_date))  --13566809
					AND	pesl.payroll_id = p_payroll_id);
Line: 9351

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '10-A	Inserted ' || SQL%ROWCOUNT || ' assignments into psp_enc_changed_assignments');
Line: 9355

			INSERT INTO psp_enc_changed_assignments
				(request_id, payroll_id, assignment_id, change_type, payroll_action_id)
			SELECT	DISTINCT l_request_id, p_payroll_id, pa.assignment_id, 'CR', p_payroll_action_id
			FROM	per_assignments_f pa
			WHERE	pa.payroll_id = p_payroll_id
			AND	pa.assignment_type = 'E'
			AND	pa.business_group_id = l_business_group_id
			AND	pa.effective_end_date >= (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pa.assignment_id,pa.business_group_id,pa.payroll_id)   --13566809
					               -- AND ptp.time_period_id = ppa.time_period_id  -- Added for bug 9862281   -- Commented for the Bug 12647364
					         ),l_enc_begin_date))
			AND	NOT EXISTS	(SELECT	pepa.assignment_id
					FROM	psp_enc_payroll_assignments pepa,
						psp_enc_payrolls pep
					WHERE	pepa.enc_payroll_id = pep.enc_payroll_id
					AND	pepa.business_group_id = l_business_group_id
					AND	pepa.set_of_books_id = l_set_of_books_id
					AND	pepa.business_group_id = pep.business_group_id
					AND	pepa.set_of_books_id = pep.set_of_books_id
					AND	pep.payroll_id = p_payroll_id
					AND	pepa.assignment_id = pa.assignment_id)
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_changed_assignments peca
					WHERE	peca.assignment_id = pa.assignment_id
					AND	peca.payroll_id = p_payroll_id)
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.assignment_id = pa.assignment_id
					AND	pesl.status_code IN ('A', 'N')
					AND	pesl.effective_date > l_prev_enc_end_date
					AND	pesl.payroll_id = p_payroll_id);
Line: 9386

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '10-B	Inserted ' || SQL%ROWCOUNT || ' assignments into psp_enc_changed_assignments');
Line: 9388

			INSERT INTO psp_enc_changed_assignments
				(request_id, payroll_id, assignment_id, change_type, payroll_action_id)
			SELECT	DISTINCT l_request_id, p_payroll_id, pa.assignment_id, 'ZZ', p_payroll_action_id
			FROM	per_assignments_f pa
			WHERE	pa.payroll_id = p_payroll_id
			AND	pa.assignment_type = 'E'
			AND	pa.business_group_id = l_business_group_id
		--	AND	pa.effective_end_date >= l_enc_begin_date      -- Commenting this in the fix 12769510 as it is found to be commented in 11i code
			-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
			AND	pa.effective_end_date >= (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pa.assignment_id,pa.business_group_id,pa.payroll_id)   --13566809
					-- AND ptp.time_period_id = ppa.time_period_id -- Added for bug 9862281	   -- Commented for the Bug 12647364
					),l_enc_begin_date))
			AND	EXISTS	(SELECT	pepa.assignment_id
					FROM	psp_enc_payroll_assignments pepa,
						psp_enc_payrolls pep
					WHERE	pepa.enc_payroll_id = pep.enc_payroll_id
					AND	pepa.business_group_id = l_business_group_id
					AND	pepa.set_of_books_id = l_set_of_books_id
					AND	pepa.business_group_id = pep.business_group_id
					AND	pepa.set_of_books_id = pep.set_of_books_id
					AND	pep.payroll_id = p_payroll_id
					AND	pepa.assignment_id = pa.assignment_id)
			AND	EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.assignment_id = pa.assignment_id
					AND	pesl.status_code  = 'A'
					AND	pesl.payroll_id = p_payroll_id)
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.assignment_id = pa.assignment_id
					AND	pesl.status_code = 'N'
					AND	pesl.payroll_id = p_payroll_id);
Line: 9421

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '20	Inserted ' || SQL%ROWCOUNT || ' assignments into psp_enc_changed_assignments');
Line: 9425

			INSERT INTO psp_enc_changed_assignments
				(request_id, payroll_id, assignment_id, change_type, payroll_action_id)
			SELECT /*+
       index(Pepa PSP_ENC_PAYROLL_ASSIGNMENTS_N1)
       index(PA PER_ASSIGNMENTS_F_PK)
       INDEX(pep PSP_ENC_PAYROLLS_N1) */
				DISTINCT l_request_id, p_payroll_id, pa.assignment_id, 'CR', p_payroll_action_id
			FROM   psp_enc_payrolls pep,
       psp_enc_payroll_assignments pepa,
       per_assignments_f pa
			WHERE	pa.payroll_id          = p_payroll_id
			AND	pepa.business_group_id  = l_business_group_id
			AND	pepa.set_of_books_id    = l_set_of_books_id
			AND	pepa.assignment_id      = pa.assignment_id
		--	AND	pa.effective_end_date >= l_enc_begin_date        -- Commenting this in the fix 12769510 as it is found to be commented in 11i code
			-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
			AND	pa.effective_end_date >= (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pa.assignment_id,pa.business_group_id,pa.payroll_id)    --13566809
					-- AND ptp.time_period_id = ppa.time_period_id  -- Added for bug 9862281   -- Commented for the Bug 12647364
					),l_enc_begin_date))
			AND	pep.payroll_id          = p_payroll_id
			AND	pep.enc_payroll_id      = pepa.enc_payroll_id
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_changed_assignments peca
					WHERE	peca.assignment_id = pepa.assignment_id
					AND	peca.payroll_id = p_payroll_id)
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.assignment_id = pa.assignment_id
					AND pesl.payroll_id = pa.payroll_id   -- Added for bug 9862281
					AND	pesl.status_code IN ('A', 'N')
					-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
										AND	pesl.effective_date > (NVL((SELECT 	/*+
												INDEX(ppa PAY_PAYROLL_ACTIONS_N51)
												INDEX(ptp PER_TIME_PERIODS_N50)
												INDEX(paa PAY_ASSIGNMENT_ACTIONS_N4)   */
										Max(ptp.end_date)
							FROM 	pay_payroll_actions ppa,
                      						per_time_periods ptp,
                      						pay_assignment_actions paa
							WHERE	paa.assignment_id(+) = pesl.assignment_id
							AND	ppa.payroll_action_id = paa.payroll_action_id (+)
							-- AND	ppa.time_period_id = ptp.time_period_id    -- Commented for the Bug 12647364
							AND	ppa.business_group_id = pesl.business_group_id
							AND	ppa.payroll_id = pesl.payroll_id
							AND	ppa.action_type	IN ( 'R','Q')
							AND	paa.action_status = 'C' -- Bug: 12769510 -- added the following two conditions as
																	-- they are existing in 11i code and are related to the fix 6122540
							and ppa.date_earned between ptp.start_date and ptp.end_date
							and ptp.payroll_id = ppa.payroll_id),l_enc_begin_date)) );
Line: 9477

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '30-A	Inserted ' || SQL%ROWCOUNT || ' assignments into psp_enc_changed_assignments');
Line: 9480

			INSERT INTO psp_enc_changed_assignments
				(request_id, payroll_id, assignment_id, change_type, payroll_action_id)
			SELECT	DISTINCT l_request_id, p_payroll_id, pa.assignment_id, 'CR', p_payroll_action_id
			FROM	psp_enc_payroll_assignments pepa,
				psp_enc_payrolls pep,
				per_assignments_f pa
			WHERE	pa.payroll_id	= p_payroll_id
			AND	pepa.business_group_id = l_business_group_id
			AND	pepa.set_of_books_id	= l_set_of_books_id
			AND	pepa.assignment_id	= pa.assignment_id
			AND	pa.effective_end_date >= (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pa.assignment_id,pa.business_group_id,pa.payroll_id)   --13566809
									 -- AND ptp.time_period_id = ppa.time_period_id  -- Added for bug 9862281   -- Commented for the Bug 12647364
									 ),l_enc_begin_date))
			AND	pep.payroll_id	= p_payroll_id
			AND	pep.enc_payroll_id	= pepa.enc_payroll_id
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_changed_assignments peca
					WHERE	peca.assignment_id = pepa.assignment_id
					AND	peca.payroll_id = p_payroll_id)
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.assignment_id = pa.assignment_id
					AND	pesl.status_code IN ('A', 'N')
					AND	pesl.effective_date > l_prev_enc_end_date);
Line: 9505

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '30-B	Inserted ' || SQL%ROWCOUNT || ' assignments into psp_enc_changed_assignments');
Line: 9507

			INSERT INTO psp_enc_changed_assignments
				(request_id, payroll_id, assignment_id, change_type, payroll_action_id)
			SELECT	DISTINCT l_request_id, p_payroll_id, pa.assignment_id, 'ZZ', p_payroll_action_id
			FROM	per_assignments_f pa
			WHERE	pa.payroll_id = p_payroll_id
			AND	pa.assignment_type = 'E'
			AND	pa.business_group_id = l_business_group_id
		--	AND	pa.effective_end_date >= l_enc_begin_date		-- Commenting this in the fix 12769510 as it is found to be commented in 11i code
			-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
			AND	pa.effective_end_date >= (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pa.assignment_id,pa.business_group_id,pa.payroll_id)   --13566809
					-- AND ptp.time_period_id = ppa.time_period_id  -- Added for bug 9862281   -- Commented for the Bug 12647364
					),l_enc_begin_date))
			AND	NOT EXISTS	(SELECT	pepa.assignment_id
					FROM	psp_enc_payroll_assignments pepa,
						psp_enc_payrolls pep
					WHERE	pepa.enc_payroll_id = pep.enc_payroll_id
					AND	pepa.business_group_id = l_business_group_id
					AND	pepa.set_of_books_id = l_set_of_books_id
					AND	pepa.business_group_id = pep.business_group_id
					AND	pepa.set_of_books_id = pep.set_of_books_id
					AND	pep.payroll_id = p_payroll_id
					AND	pepa.assignment_id = pa.assignment_id)
			AND	EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.assignment_id = pa.assignment_id
					AND	pesl.status_code  = 'A'
					AND	pesl.payroll_id = p_payroll_id)
			AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl
					WHERE	pesl.assignment_id = pa.assignment_id
					AND	pesl.status_code = 'N'
					AND	pesl.payroll_id = p_payroll_id);
Line: 9539

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '40	Inserted ' || SQL%ROWCOUNT || ' assignments into psp_enc_changed_assignments');
Line: 9542

		INSERT INTO psp_enc_changed_assignments
			(request_id, payroll_id, assignment_id, change_type, payroll_action_id)
		SELECT	DISTINCT l_request_id, p_payroll_id, assignment_id, 'LQ', p_payroll_action_id
		FROM	psp_enc_summary_lines pesl
		WHERE	payroll_id = p_payroll_id
		AND	business_group_id = l_business_group_id
		AND	status_code = 'A'
	--	AND	effective_date <= l_enc_begin_date       -- Commenting this in the fix 12769510 as it is found to be commented in 11i code
			-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
		AND	pesl.effective_date <= (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pesl.assignment_id,pesl.business_group_id,pesl.payroll_id)  --13566809
				-- AND ptp.time_period_id = ppa.time_period_id  -- Added for bug 9862281    -- Commented for the Bug 12647364
				),l_enc_begin_date))
		AND	NOT EXISTS	(SELECT	1
				FROM	psp_enc_changed_assignments peca
				WHERE	peca.assignment_id = pesl.assignment_id
					AND	peca.payroll_id = p_payroll_id)
		AND	NOT EXISTS	(SELECT	/*+INDEX(pesl2 PSP_ENC_SUMMARY_LINES_N6)*/ 1
				FROM	psp_enc_summary_lines pesl2
				WHERE	pesl2.assignment_id = pesl.assignment_id
				AND	pesl2.status_code = 'N'
					-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
				AND	pesl2.effective_date <= (NVL((get_asg_pay_end_date(g_payroll_mode,p_payroll_action_id,pesl2.assignment_id,pesl2.business_group_id,pesl2.payroll_id)--13566809
					  -- AND ptp.time_period_id = ppa.time_period_id  -- Added for bug 9862281     -- Commented for the Bug 12647364
					  ),l_enc_begin_date))
				AND	pesl2.payroll_id = p_payroll_id);
Line: 9567

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '50	Inserted ' || SQL%ROWCOUNT || ' assignments into psp_enc_changed_assignments');
Line: 9571

		UPDATE	psp_enc_changed_assignments peca
		SET	payroll_action_id = p_payroll_action_id
		WHERE	payroll_action_id IS NULL
		AND	payroll_id = NVL(p_payroll_id, payroll_id)
		AND	NOT EXISTS	(SELECT	1
				FROM	psp_enc_process_assignments pepa
				WHERE	pepa.assignment_id = peca.assignment_id
				AND	pepa.assignment_status NOT IN ('B', 'P')
				AND	pepa.payroll_id = peca.payroll_id);
Line: 9580

		hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '	Marked ' || SQL%ROWCOUNT || ' assignments in psp_enc_changed_assignments to be processed by this Create and Update process');
Line: 9583

		DELETE FROM psp_enc_changed_assignments
		WHERE payroll_action_id = p_payroll_action_id
		AND   payroll_id = p_payroll_id
		AND   request_id = l_request_id
		and assignment_id IN(SELECT assignment_id from PSP_ENC_PAYROLL_ASSIGNMENT_V
			     	     WHERE payroll_id = p_payroll_id
			     	     AND exclude = 'Y'
			     	     MINUS
			     	     SELECT ASSIGNMENT_ID FROM psp_enc_changed_asg_history
			     	     WHERE payroll_id = p_payroll_id);
Line: 9607

            SELECT /*+ FIRST_ROWS(1) */ 1
            INTO   l_asg_exists
            FROM   psp_enc_changed_asg_history
            WHERE  assignment_id = asg_id_tab(rec_i)
						AND    payroll_id = p_payroll_id
            AND ROWNUM < 2;
Line: 9616

									DELETE FROM psp_enc_changed_assignments
									WHERE payroll_action_id = p_payroll_action_id
									AND   payroll_id = p_payroll_id
									AND   request_id = l_request_id
									and   assignment_id = asg_id_tab(rec_i);
Line: 9621

              fnd_file.put_line(fnd_file.log,fnd_date.date_to_canonical(SYSDATE) || ' Deleted asg ' ||asg_id_tab(rec_i));
Line: 9628

		hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '	Deleted new excluded assignments in psp_enc_changed_assignments not to be processed by this Create and Update process');
Line: 9706

		INSERT INTO PSP_ENC_CHANGED_ASSIGNMENTS
			(request_id, assignment_id, payroll_id, change_type, payroll_action_id, change_date)
		SELECT	DISTINCT l_request_id,
			pesl.assignment_id,
			pesl.payroll_id,
			'TR',
			p_payroll_action_id,
			l_termination_date1
		FROM	psp_enc_summary_lines pesl
		WHERE	pesl.person_id = l_person_id1
		AND	pesl.effective_date >= l_termination_date1
		AND	(	gl_code_combination_id IS NOT NULL
			OR	award_id IS NOT NULL)
		AND	pesl.status_code = 'A'
		AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines pesl2
					WHERE	pesl2.person_id = l_person_id1
				AND	pesl2.status_code = 'N');
Line: 9724

		hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '	Inserted termination assignments into psp_enc_changed_assignments ' || SQL%ROWCOUNT);
Line: 9774

			INSERT INTO PSP_ENC_CHANGED_ASSIGNMENTS
				(request_id, assignment_id, payroll_id, change_type, payroll_action_id, change_date)
			SELECT	DISTINCT l_request_id,
				pesl.assignment_id,
				pesl.payroll_id,
				'TR',
				p_payroll_action_id,
				l_termination_date2
			FROM	psp_enc_summary_lines pesl
			WHERE	pesl.person_id = l_person_id2
			AND	pesl.effective_date >= l_termination_date2
			AND	(	gl_code_combination_id IS NOT NULL
				OR	award_id IS NOT NULL)
			AND	pesl.status_code = 'A'
			AND	NOT EXISTS	(SELECT	1
						FROM	psp_enc_summary_lines pesl2
						WHERE	pesl2.person_id = l_person_id2
						AND	pesl2.status_code = 'N');
Line: 9792

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '	Inserted termination assignments into psp_enc_changed_assignments ' || SQL%ROWCOUNT);
Line: 9843

			INSERT INTO PSP_ENC_CHANGED_ASSIGNMENTS
				(request_id, assignment_id, payroll_id, change_type, payroll_action_id, change_date)
			SELECT	DISTINCT l_request_id,
				pesl.assignment_id,
				pesl.payroll_id,
				'TR',
				p_payroll_action_id,
				l_termination_date3
			FROM	psp_enc_summary_lines pesl
			WHERE	pesl.person_id = l_person_id3
			AND	pesl.effective_date >= l_termination_date3
			AND	(	gl_code_combination_id IS NOT NULL
				OR	award_id IS NOT NULL)
			AND	pesl.status_code = 'A'
			AND	NOT EXISTS	(SELECT	1
						FROM	psp_enc_summary_lines pesl2
						WHERE	pesl2.person_id = l_person_id3
						AND	pesl2.status_code = 'N');
Line: 9861

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '	Inserted termination assignments into psp_enc_changed_assignments ' || SQL%ROWCOUNT);
Line: 9912

			INSERT INTO PSP_ENC_CHANGED_ASSIGNMENTS
				(request_id, assignment_id, payroll_id, change_type, payroll_action_id, change_date)
			SELECT	DISTINCT l_request_id,
				pesl.assignment_id,
				pesl.payroll_id,
				'TR',
				p_payroll_action_id,
				l_termination_date4
			FROM	psp_enc_summary_lines pesl
			WHERE	pesl.person_id = l_person_id4
			AND	pesl.effective_date >= l_termination_date4
			AND	(	gl_code_combination_id IS NOT NULL
				OR	award_id IS NOT NULL)
			AND	pesl.status_code = 'A'
			AND	NOT EXISTS	(SELECT	1
						FROM	psp_enc_summary_lines pesl2
						WHERE	pesl2.person_id = l_person_id4
						AND	pesl2.status_code = 'N');
Line: 9930

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '	Inserted termination assignments into psp_enc_changed_assignments ' || SQL%ROWCOUNT);
Line: 9981

			INSERT INTO PSP_ENC_CHANGED_ASSIGNMENTS
				(request_id, assignment_id, payroll_id, change_type, payroll_action_id, change_date)
			SELECT	DISTINCT l_request_id,
				pesl.assignment_id,
				pesl.payroll_id,
				'TR',
				p_payroll_action_id,
				l_termination_date5
			FROM	psp_enc_summary_lines pesl
			WHERE	pesl.person_id = l_person_id5
			AND	pesl.effective_date >= l_termination_date5
			AND	(	gl_code_combination_id IS NOT NULL
				OR	award_id IS NOT NULL)
			AND	pesl.status_code = 'A'
			AND	NOT EXISTS	(SELECT	1
						FROM	psp_enc_summary_lines pesl2
						WHERE	pesl2.person_id = l_person_id5
						AND	pesl2.status_code = 'N');
Line: 9999

			hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '	Inserted termination assignments into psp_enc_changed_assignments ' || SQL%ROWCOUNT);
Line: 10098

SELECT	DISTINCT pepa.assignment_id
FROM	psp_enc_process_assignments pepa,
	per_all_assignments_f paf
WHERE	pepa.payroll_action_id = p_payroll_action_id
AND	paf.person_id = p_person_id
AND	paf.assignment_id = pepa.assignment_id
AND	(	p_assignment_id IS NULL
	OR	pepa.assignment_id = p_assignment_id);
Line: 10108

SELECT	superceded_line_id
FROM	psp_enc_summary_lines pesl
WHERE	pesl.payroll_action_id = p_payroll_action_id
AND	pesl.superceded_line_id IS NOT NULL
AND	assignment_id = p_assignment_id;
Line: 10125

		UPDATE	psp_enc_lines_history
		SET	change_flag = 'N'
		WHERE	enc_summary_line_id = t_superceded_lines.enc_summary_line_id(recno);
Line: 10130

		DELETE	psp_enc_summary_lines
		WHERE	payroll_action_id = p_payroll_action_id;
Line: 10132

		fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Deleted respective lines in psp_enc_summary_lines');
Line: 10134

		DELETE	psp_enc_lines
		WHERE	payroll_action_id = p_payroll_action_id;
Line: 10136

		fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Deleted respective lines in psp_enc_lines');
Line: 10138

		DELETE	psp_enc_controls
		WHERE	payroll_action_id = p_payroll_action_id;
Line: 10140

		fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Deleted respective lines in psp_enc_controls');
Line: 10142

		DELETE	psp_report_errors
		WHERE	payroll_action_id = p_payroll_action_id;
Line: 10144

		fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Deleted respective lines in psp_report_errors');
Line: 10146

		UPDATE	psp_enc_processes
		SET	process_status = 'B',
			process_phase = 'rollback'
		WHERE	payroll_action_id = p_payroll_action_id;
Line: 10150

		fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Updated process status to ''Rollback'' in psp_enc_processes');
Line: 10152

		UPDATE	psp_enc_process_assignments
		SET	assignment_status = 'B'
		WHERE	payroll_action_id = p_payroll_action_id;
Line: 10155

		fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Updated process status to ''Rollback'' in psp_enc_process_assignments');
Line: 10157

		UPDATE	psp_enc_changed_assignments
		SET	payroll_action_id = NULL
		WHERE	payroll_action_id = p_payroll_action_id;
Line: 10160

		fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Updated payroll_action_id in psp_enc_changed_assignments');
Line: 10162

		INSERT INTO psp_enc_changed_assignments
			(request_id, assignment_id, payroll_id, change_type,
			processed_flag, reference_id, action_type, change_date)
		SELECT	l_request_id, pecah.assignment_id, pecah.payroll_id, pecah.change_type,
			NULL, NVL(pecah.reference_id, 0), pecah.action_type, change_date
		FROM	psp_enc_changed_asg_history pecah
		WHERE   payroll_action_id = p_payroll_action_id
		AND	action_type NOT IN ('CR', 'LQ', 'TR');
Line: 10172

		DELETE	psp_enc_changed_asg_history
		WHERE   payroll_action_id = p_payroll_action_id;
Line: 10191

			l_assignments_tmp.DELETE;
Line: 10205

			l_assignments_tmp.DELETE;
Line: 10219

			l_assignments_tmp.DELETE;
Line: 10233

			l_assignments_tmp.DELETE;
Line: 10243

			UPDATE	psp_enc_lines_history
			SET	change_flag = 'N'
			WHERE	enc_summary_line_id = t_superceded_lines.enc_summary_line_id(recno);
Line: 10248

			DELETE	psp_enc_summary_lines
			WHERE	payroll_action_id = p_payroll_action_id
			AND	assignment_id = l_assignments(recno);
Line: 10251

			fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Deleted respective lines in psp_enc_summary_lines');
Line: 10253

			DELETE	psp_enc_lines
			WHERE	payroll_action_id = p_payroll_action_id
			AND	assignment_id = l_assignments(recno);
Line: 10256

			fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Deleted respective lines in psp_enc_lines');
Line: 10258

			DELETE	psp_enc_controls pec
			WHERE	payroll_action_id = p_payroll_action_id
			AND	NOT EXISTS	(SELECT	1
						FROM	psp_enc_lines pel
						WHERE	payroll_action_id = p_payroll_action_id
						AND	pel.enc_control_id = pec.enc_control_id);
Line: 10264

			fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Deleted respective lines in psp_enc_controls');
Line: 10266

			DELETE	psp_report_errors
			WHERE	payroll_action_id = p_payroll_action_id
			AND	source_id = l_assignments(recno);
Line: 10269

			fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Deleted respective lines in psp_report_errors');
Line: 10271

			UPDATE	psp_enc_process_assignments
			SET	assignment_status = 'B'
			WHERE	payroll_action_id = p_payroll_action_id
			AND	assignment_id = l_assignments(recno);
Line: 10275

			fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Updated assignment status to ''Rollback'' in psp_enc_process_assignments');
Line: 10277

			UPDATE	psp_enc_changed_assignments
			SET	payroll_action_id = NULL
			WHERE	payroll_action_id = p_payroll_action_id
			AND	assignment_id = l_assignments(recno);
Line: 10281

			fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Updated payroll_action_id in psp_enc_changed_assignments');
Line: 10283

			INSERT INTO     psp_enc_changed_assignments
				(request_id, assignment_id, payroll_id, change_type,
				processed_flag, reference_id, action_type, change_date)
			SELECT	l_request_id, pecah.assignment_id, pecah.payroll_id, pecah.change_type,
				NULL, NVL(pecah.reference_id, 0), pecah.action_type, change_date
			FROM	psp_enc_changed_asg_history pecah
			WHERE   payroll_action_id = p_payroll_action_id
			AND	assignment_id = l_assignments(recno)
			AND	action_type NOT IN ('CR', 'LQ', 'TR');
Line: 10294

			DELETE	psp_enc_changed_asg_history
			WHERE   payroll_action_id = p_payroll_action_id
			AND	assignment_id = l_assignments(recno);
Line: 10300

		UPDATE	psp_enc_processes
		SET	process_status = 'B',
			process_phase = 'rollback'
		WHERE	payroll_action_id = p_payroll_action_id
		AND	NOT EXISTS	(SELECT	1
					FROM	psp_enc_summary_lines
					WHERE	payroll_action_id = p_payroll_action_id);
Line: 10307

		fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Updated process status to ''Rollback'' in psp_enc_processes');
Line: 10336

SELECT	peta.element_account_id,
	peta.gl_code_combination_id,
	peta.project_id,
	peta.task_id,
	peta.award_id,
	peta.expenditure_type,
	peta.expenditure_organization_id,
	peta.start_date_active,
	peta.end_date_active,
	peta.poeta_start_date,
	peta.poeta_end_date,
	peta.percent,
	DECODE(g_dff_grouping_option, 'Y', peta.attribute_category, NULL),
	DECODE(g_dff_grouping_option, 'Y', peta.attribute1, NULL),
	DECODE(g_dff_grouping_option, 'Y', peta.attribute2, NULL),
	DECODE(g_dff_grouping_option, 'Y', peta.attribute3, NULL),
	DECODE(g_dff_grouping_option, 'Y', peta.attribute4, NULL),
	DECODE(g_dff_grouping_option, 'Y', peta.attribute5, NULL),
	DECODE(g_dff_grouping_option, 'Y', peta.attribute6, NULL),
	DECODE(g_dff_grouping_option, 'Y', peta.attribute7, NULL),
	DECODE(g_dff_grouping_option, 'Y', peta.attribute8, NULL),
	DECODE(g_dff_grouping_option, 'Y', peta.attribute9, NULL),
	DECODE(g_dff_grouping_option, 'Y', peta.attribute10, NULL),
	DECODE(peta.expenditure_type, NULL, 'N', 'E') acct_type
FROM	psp_element_type_accounts peta
WHERE	peta.element_type_id   = p_element_type_id
AND	peta.business_group_id = p_business_group_id
AND	peta.set_of_books_id   = p_set_of_books_id
AND	(	peta.gl_code_combination_id  IS NOT NULL
	OR	peta.award_id IS NOT NULL)
AND	peta.end_date_active >= l_min_start_date
AND	peta.start_date_active <= g_enc_org_end_date
ORDER BY peta.start_date_active, peta.end_date_active;
Line: 10371

SELECT	psl.schedule_line_id,
	psl.gl_code_combination_id,
	psl.project_id,
	psl.task_id,
	psl.award_id,
	psl.expenditure_type,
	psl.expenditure_organization_id,
	psl.schedule_begin_date,
	psl.schedule_end_date,
	psl.poeta_start_date,
	psl.poeta_end_date,
	psl.schedule_percent,
	DECODE(g_dff_grouping_option, 'Y', psl.attribute_category, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute1, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute2, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute3, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute4, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute5, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute6, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute7, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute8, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute9, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute10, NULL),
	DECODE(psl.expenditure_type, NULL, 'N', 'E') acct_type
FROM	psp_schedule_hierarchy psh,
	psp_schedule_lines  psl
WHERE	psh.assignment_id = p_assignment_id
AND	psh.element_type_id = p_element_type_id
AND	psh.business_group_id = p_business_group_id
AND	psh.set_of_books_id = p_set_of_books_id
AND	psh.schedule_hierarchy_id = psl.schedule_hierarchy_id
AND	(	psl.gl_code_combination_id IS NOT NULL
	OR	psl.award_id IS NOT NULL )
AND	psl.schedule_begin_date <= g_enc_org_end_date
AND	psl.schedule_end_date >= l_min_start_date
AND	psl.default_flag IS NULL
ORDER BY psl.schedule_begin_date, psl.schedule_end_date;
Line: 10410

SELECT	psl.schedule_line_id,
        psl.gl_code_combination_id,
        psl.project_id,
        psl.task_id,
        psl.award_id,
        psl.expenditure_type,
        psl.expenditure_organization_id,
	psl.schedule_begin_date,
	psl.schedule_end_date,
	psl.poeta_start_date,
	psl.poeta_end_date,
	psl.schedule_percent,
	DECODE(g_dff_grouping_option, 'Y', psl.attribute_category, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute1, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute2, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute3, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute4, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute5, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute6, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute7, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute8, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute9, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute10, NULL),
	DECODE(psl.expenditure_type, NULL, 'N', 'E') acct_type
FROM	psp_element_types      pet,
	psp_group_element_list pgel,
	psp_schedule_hierarchy psh,
	psp_schedule_lines    psl
WHERE	pet.element_type_id = p_element_type_id
AND	pet.business_group_id = p_business_group_id
AND	pet.set_of_books_id = p_set_of_books_id
AND	pet.start_date_active <= g_enc_org_end_date
AND	pet.end_date_active >= l_min_start_date
AND	pet.element_type_id = pgel.element_type_id
AND	psh.business_group_id = p_business_group_id
AND	psh.set_of_books_id = p_set_of_books_id
AND	pgel.element_group_id = psh.element_group_id
AND	psh.assignment_id = p_assignment_id
AND	psh.schedule_hierarchy_id = psl.schedule_hierarchy_id
AND	(	psl.gl_code_combination_id  IS NOT NULL
  	  OR	psl.award_id IS NOT NULL)
AND    psl.schedule_begin_date <= pet.end_date_active
AND    psl.schedule_end_date >= pet.start_date_active
AND    psl.default_flag IS NULL
ORDER BY psl.schedule_begin_date, psl.schedule_end_date;
Line: 10457

SELECT	psl.schedule_line_id,
        psl.gl_code_combination_id,
        psl.project_id,
        psl.task_id,
        psl.award_id,
        psl.expenditure_type,
        psl.expenditure_organization_id,
	psl.schedule_begin_date,
	psl.schedule_end_date,
	psl.poeta_start_date,
	psl.poeta_end_date,
	psl.schedule_percent,
	DECODE(g_dff_grouping_option, 'Y', psl.attribute_category, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute1, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute2, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute3, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute4, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute5, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute6, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute7, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute8, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute9, NULL),
	DECODE(g_dff_grouping_option, 'Y', psl.attribute10, NULL),
	DECODE(psl.expenditure_type, NULL, 'N', 'E') acct_type
FROM	psp_schedule_hierarchy psh,
	psp_schedule_lines     psl
WHERE	psh.scheduling_types_code = 'A'
AND	psh.element_group_id IS NULL
AND	psh.element_type_id IS NULL
AND	psh.assignment_id = p_assignment_id
AND	psh.business_group_id = p_business_group_id
AND	psh.set_of_books_id   = p_set_of_books_id
AND	psh.schedule_hierarchy_id = psl.schedule_hierarchy_id
AND	(	psl.gl_code_combination_id IS NOT NULL
	OR	psl.award_id IS NOT NULL)
AND	psl.schedule_begin_date <= g_enc_org_end_date
AND	psl.schedule_end_date   >= l_min_start_date
AND	psl.default_flag IS NULL
ORDER BY psl.schedule_begin_date, psl.schedule_end_date;
Line: 10498

SELECT	organization_id,
	effective_start_date,
	NVL(LEAD(effective_start_date - 1) OVER (ORDER BY effective_end_date), LEAST(l_max_end_date, effective_end_date))
FROM	per_assignments_f paf
WHERE	assignment_id = p_assignment_id
AND	payroll_id = p_payroll_id
AND	effective_start_date <= LEAST(l_max_end_date, g_enc_org_end_date)
ANd	effective_end_date >= l_min_start_date
AND	effective_start_date =	(SELECT	MIN(paf2.effective_start_date)
				FROM	per_assignments_f paf2
				WHERE	paf2.assignment_id = p_assignment_id
				AND	paf2.payroll_id = paf.payroll_id
				AND	paf2.organization_id = paf.organization_id
				AND	paf2.effective_start_date >= paf.effective_start_date);
Line: 10522

SELECT	pdls.org_schedule_id,
	pdls.gl_code_combination_id,
	pdls.project_id,
	pdls.task_id,
	pdls.award_id,
	pdls.expenditure_type,
	pdls.expenditure_organization_id,
	GREATEST(pdls.schedule_begin_date, p_org_start_date),
	LEAST(pdls.schedule_end_date, p_org_end_date),
	pdls.poeta_start_date,
	pdls.poeta_end_date,
	pdls.schedule_percent,
	DECODE(g_dff_grouping_option, 'Y', pdls.attribute_category, NULL),
	DECODE(g_dff_grouping_option, 'Y', pdls.attribute1, NULL),
	DECODE(g_dff_grouping_option, 'Y', pdls.attribute2, NULL),
	DECODE(g_dff_grouping_option, 'Y', pdls.attribute3, NULL),
	DECODE(g_dff_grouping_option, 'Y', pdls.attribute4, NULL),
	DECODE(g_dff_grouping_option, 'Y', pdls.attribute5, NULL),
	DECODE(g_dff_grouping_option, 'Y', pdls.attribute6, NULL),
	DECODE(g_dff_grouping_option, 'Y', pdls.attribute7, NULL),
	DECODE(g_dff_grouping_option, 'Y', pdls.attribute8, NULL),
	DECODE(g_dff_grouping_option, 'Y', pdls.attribute9, NULL),
	DECODE(g_dff_grouping_option, 'Y', pdls.attribute10, NULL),
	DECODE(pdls.expenditure_type, NULL, 'N', 'E') acct_type
FROM	psp_default_labor_schedules pdls
WHERE	pdls.business_group_id = p_business_group_id
AND	pdls.set_of_books_id = p_set_of_books_id
AND	pdls.organization_id = p_organization_id
AND	(	pdls.gl_code_combination_id IS NOT NULL
	OR	pdls.award_id IS NOT NULL)
AND	pdls.schedule_begin_date <= p_org_end_date
AND	pdls.schedule_end_date >= p_org_start_date
ORDER BY GREATEST(pdls.schedule_begin_date, p_org_start_date), LEAST(pdls.schedule_end_date, p_org_end_date);
Line: 10559

SELECT	poa.organization_account_id,
	poa.gl_code_combination_id,
	poa.project_id,
	poa.task_id,
	poa.award_id,
	poa.expenditure_type,
	poa.expenditure_organization_id,
	GREATEST(poa.start_date_active, p_org_start_date),
	LEAST(poa.end_date_active, p_org_end_date),
	poa.poeta_start_date,
	poa.poeta_end_date,
	100 percent,
	DECODE(g_dff_grouping_option, 'Y', poa.attribute_category, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute1, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute2, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute3, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute4, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute5, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute6, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute7, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute8, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute9, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute10, NULL),
	DECODE(poa.expenditure_type, NULL, 'N', 'E') acct_type
FROM	psp_organization_accounts poa
WHERE	poa.organization_id = p_organization_id
AND	poa.business_group_id = p_business_group_id
AND	poa.set_of_books_id = p_set_of_books_id
AND	poa.account_type_code = 'D'
AND	poa.start_date_active <= p_org_end_date
AND	poa.end_date_active  >= p_org_start_date
AND	(	poa.gl_code_combination_id IS NOT NULL
	OR	poa.award_id IS NOT NULL)
ORDER BY GREATEST(poa.start_date_active, p_org_start_date), LEAST(poa.end_date_active, p_org_end_date);
Line: 10598

SELECT	poa.organization_account_id,
	poa.gl_code_combination_id,
	poa.project_id,
	poa.task_id,
	poa.award_id,
	poa.expenditure_type,
	poa.expenditure_organization_id,
	GREATEST(poa.start_date_active, p_org_start_date),
	LEAST(poa.end_date_active, p_org_end_date),
	poa.poeta_start_date,
	poa.poeta_end_date,
	100 percent,
	DECODE(g_dff_grouping_option, 'Y', poa.attribute_category, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute1, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute2, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute3, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute4, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute5, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute6, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute7, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute8, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute9, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute10, NULL),
	DECODE(poa.expenditure_type, NULL, 'N', 'E') acct_type
FROM	psp_organization_accounts poa
WHERE	poa.organization_id = p_organization_id
AND	poa.business_group_id = p_business_group_id
AND	poa.set_of_books_id = p_set_of_books_id
AND	poa.account_type_code = 'S'
AND	poa.start_date_active <= p_org_end_date
AND	poa.end_date_active  >= p_org_start_date
AND	(	poa.gl_code_combination_id IS NOT NULL
	OR	poa.award_id IS NOT NULL)
ORDER BY GREATEST(poa.start_date_active, p_org_start_date), LEAST(poa.end_date_active, p_org_end_date);
Line: 10635

SELECT	poa.organization_account_id,
	poa.gl_code_combination_id,
	poa.project_id,
	poa.task_id,
	poa.award_id,
	poa.expenditure_type,
	poa.expenditure_organization_id,
	poa.start_date_active,
	poa.end_date_active,
	poa.poeta_start_date,
	poa.poeta_end_date,
	100 percent,
	DECODE(g_dff_grouping_option, 'Y', poa.attribute_category, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute1, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute2, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute3, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute4, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute5, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute6, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute7, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute8, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute9, NULL),
	DECODE(g_dff_grouping_option, 'Y', poa.attribute10, NULL),
	DECODE(poa.expenditure_type, NULL, 'N', 'E') acct_type
FROM	psp_organization_accounts poa
WHERE	poa.business_group_id = p_business_group_id
AND	poa.set_of_books_id = p_set_of_books_id
AND	poa.account_type_code = 'G'
AND	poa.start_date_active <= g_enc_org_end_date
AND	poa.end_date_active  >= l_min_start_date
AND	(	poa.gl_code_combination_id IS NOT NULL
	OR	poa.award_id IS NOT NULL)
ORDER BY poa.start_date_active, poa.end_date_active;
Line: 10798

		r_gsa.line_account_id.DELETE;
Line: 10799

		r_gsa.gl_code_combination_id.DELETE;
Line: 10800

		r_gsa.project_id.DELETE;
Line: 10801

		r_gsa.task_id.DELETE;
Line: 10802

		r_gsa.award_id.DELETE;
Line: 10803

		r_gsa.expenditure_type.DELETE;
Line: 10804

		r_gsa.expenditure_organization_id.DELETE;
Line: 10805

		r_gsa.start_date_active.DELETE;
Line: 10806

		r_gsa.end_date_active.DELETE;
Line: 10807

		r_gsa.poeta_start_date.DELETE;
Line: 10808

		r_gsa.poeta_end_date.DELETE;
Line: 10809

		r_gsa.percent.DELETE;
Line: 10810

		r_gsa.attribute_category.DELETE;
Line: 10811

		r_gsa.attribute1.DELETE;
Line: 10812

		r_gsa.attribute2.DELETE;
Line: 10813

		r_gsa.attribute3.DELETE;
Line: 10814

		r_gsa.attribute4.DELETE;
Line: 10815

		r_gsa.attribute5.DELETE;
Line: 10816

		r_gsa.attribute6.DELETE;
Line: 10817

		r_gsa.attribute7.DELETE;
Line: 10818

		r_gsa.attribute8.DELETE;
Line: 10819

		r_gsa.attribute9.DELETE;
Line: 10820

		r_gsa.attribute10.DELETE;
Line: 10821

		r_gsa.acct_type.DELETE;
Line: 10868

		r_gsa.line_account_id.DELETE;
Line: 10869

		r_gsa.gl_code_combination_id.DELETE;
Line: 10870

		r_gsa.project_id.DELETE;
Line: 10871

		r_gsa.task_id.DELETE;
Line: 10872

		r_gsa.award_id.DELETE;
Line: 10873

		r_gsa.expenditure_type.DELETE;
Line: 10874

		r_gsa.expenditure_organization_id.DELETE;
Line: 10875

		r_gsa.start_date_active.DELETE;
Line: 10876

		r_gsa.end_date_active.DELETE;
Line: 10877

		r_gsa.poeta_start_date.DELETE;
Line: 10878

		r_gsa.poeta_end_date.DELETE;
Line: 10879

		r_gsa.percent.DELETE;
Line: 10880

		r_gsa.attribute_category.DELETE;
Line: 10881

		r_gsa.attribute1.DELETE;
Line: 10882

		r_gsa.attribute2.DELETE;
Line: 10883

		r_gsa.attribute3.DELETE;
Line: 10884

		r_gsa.attribute4.DELETE;
Line: 10885

		r_gsa.attribute5.DELETE;
Line: 10886

		r_gsa.attribute6.DELETE;
Line: 10887

		r_gsa.attribute7.DELETE;
Line: 10888

		r_gsa.attribute8.DELETE;
Line: 10889

		r_gsa.attribute9.DELETE;
Line: 10890

		r_gsa.attribute10.DELETE;
Line: 10891

		r_gsa.acct_type.DELETE;
Line: 10938

		r_gsa.line_account_id.DELETE;
Line: 10939

		r_gsa.gl_code_combination_id.DELETE;
Line: 10940

		r_gsa.project_id.DELETE;
Line: 10941

		r_gsa.task_id.DELETE;
Line: 10942

		r_gsa.award_id.DELETE;
Line: 10943

		r_gsa.expenditure_type.DELETE;
Line: 10944

		r_gsa.expenditure_organization_id.DELETE;
Line: 10945

		r_gsa.start_date_active.DELETE;
Line: 10946

		r_gsa.end_date_active.DELETE;
Line: 10947

		r_gsa.poeta_start_date.DELETE;
Line: 10948

		r_gsa.poeta_end_date.DELETE;
Line: 10949

		r_gsa.percent.DELETE;
Line: 10950

		r_gsa.attribute_category.DELETE;
Line: 10951

		r_gsa.attribute1.DELETE;
Line: 10952

		r_gsa.attribute2.DELETE;
Line: 10953

		r_gsa.attribute3.DELETE;
Line: 10954

		r_gsa.attribute4.DELETE;
Line: 10955

		r_gsa.attribute5.DELETE;
Line: 10956

		r_gsa.attribute6.DELETE;
Line: 10957

		r_gsa.attribute7.DELETE;
Line: 10958

		r_gsa.attribute8.DELETE;
Line: 10959

		r_gsa.attribute9.DELETE;
Line: 10960

		r_gsa.attribute10.DELETE;
Line: 10961

		r_gsa.acct_type.DELETE;
Line: 11165

			r_sa_tmp.line_account_id.DELETE;
Line: 11166

			r_sa_tmp.gl_code_combination_id.DELETE;
Line: 11167

			r_sa_tmp.project_id.DELETE;
Line: 11168

			r_sa_tmp.task_id.DELETE;
Line: 11169

			r_sa_tmp.award_id.DELETE;
Line: 11170

			r_sa_tmp.expenditure_type.DELETE;
Line: 11171

			r_sa_tmp.expenditure_organization_id.DELETE;
Line: 11172

			r_sa_tmp.start_date_active.DELETE;
Line: 11173

			r_sa_tmp.end_date_active.DELETE;
Line: 11174

			r_sa_tmp.poeta_start_date.DELETE;
Line: 11175

			r_sa_tmp.poeta_end_date.DELETE;
Line: 11176

			r_sa_tmp.percent.DELETE;
Line: 11177

			r_sa_tmp.attribute_category.DELETE;
Line: 11178

			r_sa_tmp.attribute1.DELETE;
Line: 11179

			r_sa_tmp.attribute2.DELETE;
Line: 11180

			r_sa_tmp.attribute3.DELETE;
Line: 11181

			r_sa_tmp.attribute4.DELETE;
Line: 11182

			r_sa_tmp.attribute5.DELETE;
Line: 11183

			r_sa_tmp.attribute6.DELETE;
Line: 11184

			r_sa_tmp.attribute7.DELETE;
Line: 11185

			r_sa_tmp.attribute8.DELETE;
Line: 11186

			r_sa_tmp.attribute9.DELETE;
Line: 11187

			r_sa_tmp.attribute10.DELETE;
Line: 11188

			r_sa_tmp.acct_type.DELETE;
Line: 11193

	r_gsa.line_account_id.DELETE;
Line: 11194

	r_gsa.gl_code_combination_id.DELETE;
Line: 11195

	r_gsa.project_id.DELETE;
Line: 11196

	r_gsa.task_id.DELETE;
Line: 11197

	r_gsa.award_id.DELETE;
Line: 11198

	r_gsa.expenditure_type.DELETE;
Line: 11199

	r_gsa.expenditure_organization_id.DELETE;
Line: 11200

	r_gsa.start_date_active.DELETE;
Line: 11201

	r_gsa.end_date_active.DELETE;
Line: 11202

	r_gsa.poeta_start_date.DELETE;
Line: 11203

	r_gsa.poeta_end_date.DELETE;
Line: 11204

	r_gsa.percent.DELETE;
Line: 11205

	r_gsa.attribute_category.DELETE;
Line: 11206

	r_gsa.attribute1.DELETE;
Line: 11207

	r_gsa.attribute2.DELETE;
Line: 11208

	r_gsa.attribute3.DELETE;
Line: 11209

	r_gsa.attribute4.DELETE;
Line: 11210

	r_gsa.attribute5.DELETE;
Line: 11211

	r_gsa.attribute6.DELETE;
Line: 11212

	r_gsa.attribute7.DELETE;
Line: 11213

	r_gsa.attribute8.DELETE;
Line: 11214

	r_gsa.attribute9.DELETE;
Line: 11215

	r_gsa.attribute10.DELETE;
Line: 11216

	r_gsa.acct_type.DELETE;
Line: 11857

PROCEDURE	delete_previous_error_log(p_assignment_id	IN	NUMBER,
					  p_payroll_id	IN	NUMBER,
					  p_payroll_action_id	IN	NUMBER) IS
PRAGMA	AUTONOMOUS_TRANSACTION;
Line: 11862

	DELETE	psp_report_errors
	WHERE	source_id = p_assignment_id
	AND		value1 = p_payroll_id
	AND		payroll_action_id = p_payroll_action_id;
Line: 11868

END	delete_previous_error_log;
Line: 11870

PROCEDURE update_hierarchy_dates (p_assignment_id	IN	NUMBER,
					p_payroll_id		IN	NUMBER,
					p_payroll_action_id	IN	NUMBER,
					p_return_status		OUT NOCOPY	VARCHAR2) IS
CURSOR	hierarchy_dates_cur IS
SELECT	DISTINCT enc_element_type_id,
	hierarchy_code,
	NVL(gl_code_combination_id, -99),
	NVL(project_id, -99),
	NVL(task_id, -99),
	NVL(award_id, -99),
	NVL(expenditure_organization_id, -99),
	NVL(expenditure_type, '-99'),
	enc_start_date,
	enc_end_date
FROM	psp_enc_lines
WHERE	payroll_action_id = p_payroll_action_id
AND	assignment_id = p_assignment_id
AND	payroll_id = p_payroll_id
ORDER BY 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
Line: 11892

SELECT	DISTINCT enc_element_type_id,
	hierarchy_code,
	NVL(gl_code_combination_id, -99),
	NVL(project_id, -99),
	NVL(task_id, -99),
	NVL(award_id, -99),
	NVL(expenditure_organization_id, -99),
	NVL(expenditure_type, '-99'),
	enc_start_date,
	enc_end_date
FROM	psp_enc_lines_history
WHERE	assignment_id = p_assignment_id
AND	payroll_id = p_payroll_id
AND	change_flag = 'N'
ORDER BY 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
Line: 11924

	hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '	Entering UPDATE_HIERARCHY_DATES');
Line: 11985

		UPDATE	psp_enc_lines
		SET	hierarchy_start_date = t_enc_nlines.enc_start_date(recno),
			hierarchy_end_date = t_enc_nlines.enc_end_date(recno)
		WHERE	payroll_action_id = p_payroll_action_id
		AND	assignment_id = p_assignment_id
		AND	payroll_id = p_payroll_id
		AND	enc_element_type_id = t_enc_nlines.element_type_id(recno)
		AND	hierarchy_code = t_enc_nlines.hierarchy_code(recno)
		AND	gl_code_combination_id IS NOT NULL
		AND	t_enc_nlines.gl_ccid(recno) IS NOT NULL
		AND	gl_code_combination_id = t_enc_nlines.gl_ccid(recno)
		AND	enc_start_date <= t_enc_nlines.enc_end_date(recno)
		AND	enc_end_date >= t_enc_nlines.enc_start_date(recno);
Line: 12000

		UPDATE	psp_enc_lines
		SET	hierarchy_start_date = t_enc_nlines.enc_start_date(recno),
			hierarchy_end_date = t_enc_nlines.enc_end_date(recno)
		WHERE	payroll_action_id = p_payroll_action_id
		AND	assignment_id = p_assignment_id
		AND	payroll_id = p_payroll_id
		AND	enc_element_type_id = t_enc_nlines.element_type_id(recno)
		AND	hierarchy_code = t_enc_nlines.hierarchy_code(recno)
		AND	award_id IS NOT NULL
		AND	t_enc_nlines.award_id(recno) IS NOT NULL
		AND	project_id = t_enc_nlines.project_id(recno)
		AND	task_id = t_enc_nlines.task_id(recno)
		AND	award_id = t_enc_nlines.award_id(recno)
		AND	expenditure_organization_id = t_enc_nlines.exp_org_id(recno)
		AND	expenditure_type = t_enc_nlines.exp_type(recno)
		AND	enc_start_date <= t_enc_nlines.enc_end_date(recno)
		AND	enc_end_date >= t_enc_nlines.enc_start_date(recno);
Line: 12019

	t_enc_lines.element_type_id.DELETE;
Line: 12020

	t_enc_lines.hierarchy_code.DELETE;
Line: 12021

	t_enc_lines.gl_ccid.DELETE;
Line: 12022

	t_enc_lines.project_id.DELETE;
Line: 12023

	t_enc_lines.task_id.DELETE;
Line: 12024

	t_enc_lines.award_id.DELETE;
Line: 12025

	t_enc_lines.exp_org_id.DELETE;
Line: 12026

	t_enc_lines.exp_type.DELETE;
Line: 12027

	t_enc_lines.enc_start_date.DELETE;
Line: 12028

	t_enc_lines.enc_end_date.DELETE;
Line: 12030

	t_enc_nlines.element_type_id.DELETE;
Line: 12031

	t_enc_nlines.hierarchy_code.DELETE;
Line: 12032

	t_enc_nlines.gl_ccid.DELETE;
Line: 12033

	t_enc_nlines.project_id.DELETE;
Line: 12034

	t_enc_nlines.task_id.DELETE;
Line: 12035

	t_enc_nlines.award_id.DELETE;
Line: 12036

	t_enc_nlines.exp_org_id.DELETE;
Line: 12037

	t_enc_nlines.exp_type.DELETE;
Line: 12038

	t_enc_nlines.enc_start_date.DELETE;
Line: 12039

	t_enc_nlines.enc_end_date.DELETE;
Line: 12101

		UPDATE	psp_enc_lines_history
		SET	hierarchy_start_date = t_enc_nlines.enc_start_date(recno),
			hierarchy_end_date = t_enc_nlines.enc_end_date(recno)
		WHERE	assignment_id = p_assignment_id
		AND	payroll_id = p_payroll_id
		AND	change_flag = 'N'
		AND	enc_element_type_id = t_enc_nlines.element_type_id(recno)
		AND	hierarchy_code = t_enc_nlines.hierarchy_code(recno)
		AND	gl_code_combination_id IS NOT NULL
		AND	t_enc_nlines.gl_ccid(recno) IS NOT NULL
		AND	gl_code_combination_id = t_enc_nlines.gl_ccid(recno)
		AND	enc_start_date <= t_enc_nlines.enc_end_date(recno)
		AND	enc_end_date >= t_enc_nlines.enc_start_date(recno);
Line: 12116

		UPDATE	psp_enc_lines_history
		SET	hierarchy_start_date = t_enc_nlines.enc_start_date(recno),
			hierarchy_end_date = t_enc_nlines.enc_end_date(recno)
		WHERE	assignment_id = p_assignment_id
		AND	payroll_id = p_payroll_id
		AND	change_flag = 'N'
		AND	enc_element_type_id = t_enc_nlines.element_type_id(recno)
		AND	hierarchy_code = t_enc_nlines.hierarchy_code(recno)
		AND	award_id IS NOT NULL
		AND	t_enc_nlines.award_id(recno) IS NOT NULL
		AND	project_id = t_enc_nlines.project_id(recno)
		AND	task_id = t_enc_nlines.task_id(recno)
		AND	award_id = t_enc_nlines.award_id(recno)
		AND	expenditure_organization_id = t_enc_nlines.exp_org_id(recno)
		AND	expenditure_type = t_enc_nlines.exp_type(recno)
		AND	enc_start_date <= t_enc_nlines.enc_end_date(recno)
		AND	enc_end_date >= t_enc_nlines.enc_start_date(recno);
Line: 12135

	hr_utility.trace(fnd_date.date_to_canonical(SYSDATE) || '	Leaving UPDATE_HIERARCHY_DATES');
Line: 12140

			g_error_message := 'UPDATE_HIERARCHY_DATES: ' || SQLERRM;
Line: 12142

        g_error_api_path := SUBSTR(' UPDATE_HIERARCHY_DATES:'||g_error_api_path,1,230);
Line: 12143

        fnd_msg_pub.add_exc_msg('PSP_ENC_CREATE_LINES', ' UPDATE_HIERARCHY_DATES');
Line: 12145

		fnd_file.put_line(fnd_file.log, fnd_date.date_to_canonical(SYSDATE) || '	Leaving UPDATE_HIERARCHY_DATES');
Line: 12146

END update_hierarchy_dates;
Line: 12150

	r_sa.line_account_id.DELETE;
Line: 12151

	r_sa.gl_code_combination_id.DELETE;
Line: 12152

	r_sa.project_id.DELETE;
Line: 12153

	r_sa.task_id.DELETE;
Line: 12154

	r_sa.award_id.DELETE;
Line: 12155

	r_sa.expenditure_type.DELETE;
Line: 12156

	r_sa.expenditure_organization_id.DELETE;
Line: 12157

	r_sa.start_date_active.DELETE;
Line: 12158

	r_sa.end_date_active.DELETE;
Line: 12159

	r_sa.poeta_start_date.DELETE;
Line: 12160

	r_sa.poeta_end_date.DELETE;
Line: 12161

	r_sa.percent.DELETE;
Line: 12162

	r_sa.attribute_category.DELETE;
Line: 12163

	r_sa.attribute1.DELETE;
Line: 12164

	r_sa.attribute2.DELETE;
Line: 12165

	r_sa.attribute3.DELETE;
Line: 12166

	r_sa.attribute4.DELETE;
Line: 12167

	r_sa.attribute5.DELETE;
Line: 12168

	r_sa.attribute6.DELETE;
Line: 12169

	r_sa.attribute7.DELETE;
Line: 12170

	r_sa.attribute8.DELETE;
Line: 12171

	r_sa.attribute9.DELETE;
Line: 12172

	r_sa.attribute10.DELETE;
Line: 12173

	r_sa.acct_type.DELETE;
Line: 12175

	r_da.line_account_id.DELETE;
Line: 12176

	r_da.gl_code_combination_id.DELETE;
Line: 12177

	r_da.project_id.DELETE;
Line: 12178

	r_da.task_id.DELETE;
Line: 12179

	r_da.award_id.DELETE;
Line: 12180

	r_da.expenditure_type.DELETE;
Line: 12181

	r_da.expenditure_organization_id.DELETE;
Line: 12182

	r_da.start_date_active.DELETE;
Line: 12183

	r_da.end_date_active.DELETE;
Line: 12184

	r_da.poeta_start_date.DELETE;
Line: 12185

	r_da.poeta_end_date.DELETE;
Line: 12186

	r_da.percent.DELETE;
Line: 12187

	r_da.attribute_category.DELETE;
Line: 12188

	r_da.attribute1.DELETE;
Line: 12189

	r_da.attribute2.DELETE;
Line: 12190

	r_da.attribute3.DELETE;
Line: 12191

	r_da.attribute4.DELETE;
Line: 12192

	r_da.attribute5.DELETE;
Line: 12193

	r_da.attribute6.DELETE;
Line: 12194

	r_da.attribute7.DELETE;
Line: 12195

	r_da.attribute8.DELETE;
Line: 12196

	r_da.attribute9.DELETE;
Line: 12197

	r_da.attribute10.DELETE;
Line: 12198

	r_da.acct_type.DELETE;
Line: 12200

	r_odls.line_account_id.DELETE;
Line: 12201

	r_odls.gl_code_combination_id.DELETE;
Line: 12202

	r_odls.project_id.DELETE;
Line: 12203

	r_odls.task_id.DELETE;
Line: 12204

	r_odls.award_id.DELETE;
Line: 12205

	r_odls.expenditure_type.DELETE;
Line: 12206

	r_odls.expenditure_organization_id.DELETE;
Line: 12207

	r_odls.start_date_active.DELETE;
Line: 12208

	r_odls.end_date_active.DELETE;
Line: 12209

	r_odls.poeta_start_date.DELETE;
Line: 12210

	r_odls.poeta_end_date.DELETE;
Line: 12211

	r_odls.percent.DELETE;
Line: 12212

	r_odls.attribute_category.DELETE;
Line: 12213

	r_odls.attribute1.DELETE;
Line: 12214

	r_odls.attribute2.DELETE;
Line: 12215

	r_odls.attribute3.DELETE;
Line: 12216

	r_odls.attribute4.DELETE;
Line: 12217

	r_odls.attribute5.DELETE;
Line: 12218

	r_odls.attribute6.DELETE;
Line: 12219

	r_odls.attribute7.DELETE;
Line: 12220

	r_odls.attribute8.DELETE;
Line: 12221

	r_odls.attribute9.DELETE;
Line: 12222

	r_odls.attribute10.DELETE;
Line: 12223

	r_odls.acct_type.DELETE;
Line: 12225

	r_asg.line_account_id.DELETE;
Line: 12226

	r_asg.gl_code_combination_id.DELETE;
Line: 12227

	r_asg.project_id.DELETE;
Line: 12228

	r_asg.task_id.DELETE;
Line: 12229

	r_asg.award_id.DELETE;
Line: 12230

	r_asg.expenditure_type.DELETE;
Line: 12231

	r_asg.expenditure_organization_id.DELETE;
Line: 12232

	r_asg.start_date_active.DELETE;
Line: 12233

	r_asg.end_date_active.DELETE;
Line: 12234

	r_asg.poeta_start_date.DELETE;
Line: 12235

	r_asg.poeta_end_date.DELETE;
Line: 12236

	r_asg.percent.DELETE;
Line: 12237

	r_asg.attribute_category.DELETE;
Line: 12238

	r_asg.attribute1.DELETE;
Line: 12239

	r_asg.attribute2.DELETE;
Line: 12240

	r_asg.attribute3.DELETE;
Line: 12241

	r_asg.attribute4.DELETE;
Line: 12242

	r_asg.attribute5.DELETE;
Line: 12243

	r_asg.attribute6.DELETE;
Line: 12244

	r_asg.attribute7.DELETE;
Line: 12245

	r_asg.attribute8.DELETE;
Line: 12246

	r_asg.attribute9.DELETE;
Line: 12247

	r_asg.attribute10.DELETE;
Line: 12248

	r_asg.acct_type.DELETE;
Line: 12250

	r_ec.line_account_id.DELETE;
Line: 12251

	r_ec.gl_code_combination_id.DELETE;
Line: 12252

	r_ec.project_id.DELETE;
Line: 12253

	r_ec.task_id.DELETE;
Line: 12254

	r_ec.award_id.DELETE;
Line: 12255

	r_ec.expenditure_type.DELETE;
Line: 12256

	r_ec.expenditure_organization_id.DELETE;
Line: 12257

	r_ec.start_date_active.DELETE;
Line: 12258

	r_ec.end_date_active.DELETE;
Line: 12259

	r_ec.poeta_start_date.DELETE;
Line: 12260

	r_ec.poeta_end_date.DELETE;
Line: 12261

	r_ec.percent.DELETE;
Line: 12262

	r_ec.attribute_category.DELETE;
Line: 12263

	r_ec.attribute1.DELETE;
Line: 12264

	r_ec.attribute2.DELETE;
Line: 12265

	r_ec.attribute3.DELETE;
Line: 12266

	r_ec.attribute4.DELETE;
Line: 12267

	r_ec.attribute5.DELETE;
Line: 12268

	r_ec.attribute6.DELETE;
Line: 12269

	r_ec.attribute7.DELETE;
Line: 12270

	r_ec.attribute8.DELETE;
Line: 12271

	r_ec.attribute9.DELETE;
Line: 12272

	r_ec.attribute10.DELETE;
Line: 12273

	r_ec.acct_type.DELETE;
Line: 12275

	r_et.line_account_id.DELETE;
Line: 12276

	r_et.gl_code_combination_id.DELETE;
Line: 12277

	r_et.project_id.DELETE;
Line: 12278

	r_et.task_id.DELETE;
Line: 12279

	r_et.award_id.DELETE;
Line: 12280

	r_et.expenditure_type.DELETE;
Line: 12281

	r_et.expenditure_organization_id.DELETE;
Line: 12282

	r_et.start_date_active.DELETE;
Line: 12283

	r_et.end_date_active.DELETE;
Line: 12284

	r_et.poeta_start_date.DELETE;
Line: 12285

	r_et.poeta_end_date.DELETE;
Line: 12286

	r_et.percent.DELETE;
Line: 12287

	r_et.attribute_category.DELETE;
Line: 12288

	r_et.attribute1.DELETE;
Line: 12289

	r_et.attribute2.DELETE;
Line: 12290

	r_et.attribute3.DELETE;
Line: 12291

	r_et.attribute4.DELETE;
Line: 12292

	r_et.attribute5.DELETE;
Line: 12293

	r_et.attribute6.DELETE;
Line: 12294

	r_et.attribute7.DELETE;
Line: 12295

	r_et.attribute8.DELETE;
Line: 12296

	r_et.attribute9.DELETE;
Line: 12297

	r_et.attribute10.DELETE;
Line: 12298

	r_et.acct_type.DELETE;
Line: 12300

	r_gee.line_account_id.DELETE;
Line: 12301

	r_gee.gl_code_combination_id.DELETE;
Line: 12302

	r_gee.project_id.DELETE;
Line: 12303

	r_gee.task_id.DELETE;
Line: 12304

	r_gee.award_id.DELETE;
Line: 12305

	r_gee.expenditure_type.DELETE;
Line: 12306

	r_gee.expenditure_organization_id.DELETE;
Line: 12307

	r_gee.start_date_active.DELETE;
Line: 12308

	r_gee.end_date_active.DELETE;
Line: 12309

	r_gee.poeta_start_date.DELETE;
Line: 12310

	r_gee.poeta_end_date.DELETE;
Line: 12311

	r_gee.percent.DELETE;
Line: 12312

	r_gee.attribute_category.DELETE;
Line: 12313

	r_gee.attribute1.DELETE;
Line: 12314

	r_gee.attribute2.DELETE;
Line: 12315

	r_gee.attribute3.DELETE;
Line: 12316

	r_gee.attribute4.DELETE;
Line: 12317

	r_gee.attribute5.DELETE;
Line: 12318

	r_gee.attribute6.DELETE;
Line: 12319

	r_gee.attribute7.DELETE;
Line: 12320

	r_gee.attribute8.DELETE;
Line: 12321

	r_gee.attribute9.DELETE;
Line: 12322

	r_gee.attribute10.DELETE;
Line: 12323

	r_gee.acct_type.DELETE;