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: 412

    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: 446

  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: 463

 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: 478

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

		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: 636

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: 698

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: 737

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: 746

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 ;
Line: 793

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: 847

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;
Line: 976

								l_inputs.DELETE;
Line: 977

								l_outputs.DELETE;
Line: 1352

	--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: 1405

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

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: 1498

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

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

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

SELECT	task_number
FROM	pa_tasks
WHERE	task_id = l_task_id;
Line: 1518

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

					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: 1806

						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: 1999

	t_poeta_gl_hier_array.DELETE;
Line: 3076

	orig_ci.gl_code_combination_id.DELETE;
Line: 3077

	orig_ci.project_id.DELETE;
Line: 3078

	orig_ci.task_id.DELETE;
Line: 3079

	orig_ci.award_id.DELETE;
Line: 3080

	orig_ci.expenditure_organization_id.DELETE;
Line: 3081

	orig_ci.expenditure_type.DELETE;
Line: 3121

	r_enc_period.r_time_period_id.DELETE;
Line: 3122

	r_enc_period.r_period_start_date.DELETE;
Line: 3123

	r_enc_period.r_period_end_date.DELETE;
Line: 3124

	r_enc_period.r_asg_start_date.DELETE;
Line: 3125

	r_enc_period.r_asg_end_date.DELETE;
Line: 3126

	r_enc_period.r_process_flag.DELETE;
Line: 3127

	r_enc_period.r_period_ind.DELETE;
Line: 3128

	r_enc_period.r_schedule_percent.DELETE;
Line: 3129

	r_enc_period.r_encumbrance_amount.DELETE;
Line: 3130

	r_enc_period.r_period_amount.DELETE;
Line: 3131

	r_enc_period.r_reason_code.DELETE;
Line: 3153

 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: 3241

/*****	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: 3248

	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: 3284

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

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

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

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

END insert_into_enc_lines;
Line: 3354

	l_last_update_date		DATE 		DEFAULT SYSDATE;
Line: 3355

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

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

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: 3365

    /* 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: 3376

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

		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: 3403

/*	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: 3419

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

	enc_control_tab.r_time_period_id.delete;
Line: 3423

	enc_control_tab.r_enc_control_id.delete;
Line: 3424

	enc_control_tab.r_no_of_dr.delete;
Line: 3425

	enc_control_tab.r_no_of_cr.delete;
Line: 3426

	enc_control_tab.r_total_dr_amount.delete;
Line: 3427

	enc_control_tab.r_total_cr_amount.delete;
Line: 3428

	enc_control_tab.r_gl_dr_amount.delete;
Line: 3429

	enc_control_tab.r_gl_cr_amount.delete;
Line: 3430

	enc_control_tab.r_ogm_dr_amount.delete;
Line: 3431

	enc_control_tab.r_ogm_cr_amount.delete;
Line: 3432

	enc_control_tab.r_uom.delete;
Line: 3442

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

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: 3662

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

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

	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: 3782

	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: 3788

	t_enc_lines_array2.r_enc_element_type_id.delete;
Line: 3789

	t_enc_lines_array2.r_encumbrance_date.delete;
Line: 3790

	t_enc_lines_array2.r_dr_cr_flag.delete;
Line: 3791

	t_enc_lines_array2.r_encumbrance_amount.delete;
Line: 3792

	t_enc_lines_array2.r_enc_line_type.delete;
Line: 3793

	t_enc_lines_array2.r_schedule_line_id.delete;
Line: 3794

	t_enc_lines_array2.r_org_schedule_id.delete;
Line: 3795

	t_enc_lines_array2.r_default_org_account_id.delete;
Line: 3796

	t_enc_lines_array2.r_suspense_org_account_id.delete;
Line: 3797

	t_enc_lines_array2.r_element_account_id.delete;
Line: 3798

	t_enc_lines_array2.r_gl_project_flag.delete;
Line: 3799

	t_enc_lines_array2.r_person_id.delete;
Line: 3800

	t_enc_lines_array2.r_assignment_id.delete;
Line: 3801

	t_enc_lines_array2.r_award_id.delete;
Line: 3802

	t_enc_lines_array2.r_task_id.delete;
Line: 3803

	t_enc_lines_array2.r_expenditure_type.delete;
Line: 3804

	t_enc_lines_array2.r_expenditure_organization_id.delete;
Line: 3805

	t_enc_lines_array2.r_project_id.delete;
Line: 3806

	t_enc_lines_array2.r_gl_code_combination_id.delete;
Line: 3807

	t_enc_lines_array2.r_time_period_id.delete;
Line: 3808

	t_enc_lines_array2.r_default_reason_code.delete;
Line: 3809

	t_enc_lines_array2.r_suspense_reason_code.delete;
Line: 3810

	t_enc_lines_array2.r_enc_control_id.delete;
Line: 3811

	t_enc_lines_array2.r_change_flag.delete;
Line: 3812

	t_enc_lines_array2.r_enc_start_date.delete;
Line: 3813

	t_enc_lines_array2.r_enc_end_date.delete;
Line: 3814

	t_enc_lines_array2.r_attribute_category.delete;
Line: 3815

	t_enc_lines_array2.r_attribute1.delete;
Line: 3816

	t_enc_lines_array2.r_attribute2.delete;
Line: 3817

	t_enc_lines_array2.r_attribute3.delete;
Line: 3818

	t_enc_lines_array2.r_attribute4.delete;
Line: 3819

	t_enc_lines_array2.r_attribute5.delete;
Line: 3820

	t_enc_lines_array2.r_attribute6.delete;
Line: 3821

	t_enc_lines_array2.r_attribute7.delete;
Line: 3822

	t_enc_lines_array2.r_attribute8.delete;
Line: 3823

	t_enc_lines_array2.r_attribute9.delete;
Line: 3824

	t_enc_lines_array2.r_attribute10.delete;
Line: 3825

	t_enc_lines_array2.r_orig_gl_code_combination_id.delete;
Line: 3826

	t_enc_lines_array2.r_orig_project_id.delete;
Line: 3827

	t_enc_lines_array2.r_orig_award_id.delete;
Line: 3828

	t_enc_lines_array2.r_orig_task_id.delete;
Line: 3829

	t_enc_lines_array2.r_orig_expenditure_type.delete;
Line: 3830

	t_enc_lines_array2.r_orig_expenditure_org_id.delete;
Line: 3831

	t_enc_lines_array2.r_hierarchy_code.delete;
Line: 3838

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

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

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

END insert_enc_lines_from_arrays;
Line: 3887

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: 3905

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: 3925

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: 3936

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: 3954

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	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: 3972

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: 3984

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: 4017

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: 4029

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: 4313

	r_sch_rec.start_date.delete;
Line: 4314

	r_sch_rec.end_date.delete;
Line: 4315

	r_sch_rec.schedule_percent.delete;
Line: 4316

	r_enc_period.r_time_period_id.DELETE;
Line: 4317

	r_enc_period.r_period_start_date.DELETE;
Line: 4318

	r_enc_period.r_period_end_date.DELETE;
Line: 4319

	r_enc_period.r_asg_start_date.DELETE;
Line: 4320

	r_enc_period.r_asg_end_date.DELETE;
Line: 4321

	r_enc_period.r_process_flag.DELETE;
Line: 4322

	r_enc_period.r_period_ind.DELETE;
Line: 4323

	r_enc_period.r_schedule_percent.DELETE;
Line: 4324

	r_enc_period.r_encumbrance_amount.DELETE;
Line: 4325

	r_enc_period.r_period_amount.DELETE;
Line: 4326

	r_enc_period.r_reason_code.DELETE;
Line: 4327

	r_enc_period.r_effective_date.DELETE;
Line: 4370

	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: 4376

	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: 4389

	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: 4406

	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: 4418

	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: 4465

	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: 4483

	initial_dates.delete;
Line: 4484

	date_type.delete;
Line: 4485

	schedule_chunk.schedule_end_date.delete;
Line: 4486

	schedule_chunk.schedule_begin_date.delete;
Line: 4711

	r_sch_rec.start_date.delete;
Line: 4712

	r_sch_rec.end_date.delete;
Line: 4713

	r_sch_rec.schedule_percent.delete;
Line: 4714

	r_enc_period_tmp1.r_time_period_id.DELETE;
Line: 4715

	r_enc_period_tmp1.r_period_start_date.DELETE;
Line: 4716

	r_enc_period_tmp1.r_period_end_date.DELETE;
Line: 4717

	r_enc_period_tmp1.r_asg_start_date.DELETE;
Line: 4718

	r_enc_period_tmp1.r_asg_end_date.DELETE;
Line: 4719

	r_enc_period_tmp1.r_process_flag.DELETE;
Line: 4720

	r_enc_period_tmp1.r_period_ind.DELETE;
Line: 4721

	r_enc_period_tmp1.r_schedule_percent.DELETE;
Line: 4722

	r_enc_period_tmp1.r_encumbrance_amount.DELETE;
Line: 4723

	r_enc_period_tmp1.r_period_amount.DELETE;
Line: 4724

	r_enc_period_tmp1.r_reason_code.DELETE;
Line: 4725

	r_enc_period_tmp1.r_effective_date.DELETE;
Line: 4769

		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: 4775

		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: 4788

		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: 4805

		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: 4817

		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: 4864

	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: 4882

	initial_dates.delete;
Line: 4883

	date_type.delete;
Line: 4884

	schedule_chunk.schedule_end_date.delete;
Line: 4885

	schedule_chunk.schedule_begin_date.delete;
Line: 5112

	r_enc_period.r_time_period_id.DELETE;
Line: 5113

	r_enc_period.r_period_start_date.DELETE;
Line: 5114

	r_enc_period.r_period_end_date.DELETE;
Line: 5115

	r_enc_period.r_asg_start_date.DELETE;
Line: 5116

	r_enc_period.r_asg_end_date.DELETE;
Line: 5117

	r_enc_period.r_process_flag.DELETE;
Line: 5118

	r_enc_period.r_period_ind.DELETE;
Line: 5119

	r_enc_period.r_schedule_percent.DELETE;
Line: 5120

	r_enc_period.r_encumbrance_amount.DELETE;
Line: 5121

	r_enc_period.r_period_amount.DELETE;
Line: 5122

	r_enc_period.r_reason_code.DELETE;
Line: 5123

	r_enc_period.r_effective_date.DELETE;
Line: 5168

	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: 5174

	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: 5187

	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: 5204

	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: 5216

	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: 5263

	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: 5280

	initial_dates.delete;
Line: 5281

	date_type.delete;
Line: 5282

	schedule_chunk.schedule_end_date.delete;
Line: 5283

	schedule_chunk.schedule_begin_date.delete;
Line: 5508

	r_sch_rec.start_date.delete;
Line: 5509

	r_sch_rec.end_date.delete;
Line: 5510

	r_sch_rec.schedule_percent.delete;
Line: 5511

	r_enc_period_tmp1.r_time_period_id.DELETE;
Line: 5512

	r_enc_period_tmp1.r_period_start_date.DELETE;
Line: 5513

	r_enc_period_tmp1.r_period_end_date.DELETE;
Line: 5514

	r_enc_period_tmp1.r_asg_start_date.DELETE;
Line: 5515

	r_enc_period_tmp1.r_asg_end_date.DELETE;
Line: 5516

	r_enc_period_tmp1.r_process_flag.DELETE;
Line: 5517

	r_enc_period_tmp1.r_period_ind.DELETE;
Line: 5518

	r_enc_period_tmp1.r_schedule_percent.DELETE;
Line: 5519

	r_enc_period_tmp1.r_encumbrance_amount.DELETE;
Line: 5520

	r_enc_period_tmp1.r_period_amount.DELETE;
Line: 5521

	r_enc_period_tmp1.r_reason_code.DELETE;
Line: 5522

	r_enc_period_tmp1.r_effective_date.DELETE;
Line: 5794

		r_sch_rec.start_date.delete;
Line: 5795

		r_sch_rec.end_date.delete;
Line: 5796

		r_sch_rec.schedule_percent.delete;
Line: 5797

		r_enc_period.r_time_period_id.DELETE;
Line: 5798

		r_enc_period.r_period_start_date.DELETE;
Line: 5799

		r_enc_period.r_period_end_date.DELETE;
Line: 5800

		r_enc_period.r_asg_start_date.DELETE;
Line: 5801

		r_enc_period.r_asg_end_date.DELETE;
Line: 5802

		r_enc_period.r_process_flag.DELETE;
Line: 5803

		r_enc_period.r_period_ind.DELETE;
Line: 5804

		r_enc_period.r_schedule_percent.DELETE;
Line: 5805

		r_enc_period.r_encumbrance_amount.DELETE;
Line: 5806

		r_enc_period.r_period_amount.DELETE;
Line: 5807

		r_enc_period.r_reason_code.DELETE;
Line: 5808

		r_enc_period.r_effective_date.DELETE;
Line: 6085

	r_enc_period.r_time_period_id.DELETE;
Line: 6086

	r_enc_period.r_period_start_date.DELETE;
Line: 6087

	r_enc_period.r_period_end_date.DELETE;
Line: 6088

	r_enc_period.r_asg_start_date.DELETE;
Line: 6089

	r_enc_period.r_asg_end_date.DELETE;
Line: 6090

	r_enc_period.r_process_flag.DELETE;
Line: 6091

	r_enc_period.r_period_ind.DELETE;
Line: 6092

	r_enc_period.r_schedule_percent.DELETE;
Line: 6093

	r_enc_period.r_encumbrance_amount.DELETE;
Line: 6094

	r_enc_period.r_period_amount.DELETE;
Line: 6095

	r_enc_period.r_reason_code.DELETE;
Line: 6096

	r_enc_period.r_effective_date.DELETE;
Line: 6291

	r_enc_period_tmp1.r_time_period_id.DELETE;
Line: 6292

	r_enc_period_tmp1.r_period_start_date.DELETE;
Line: 6293

	r_enc_period_tmp1.r_period_end_date.DELETE;
Line: 6294

	r_enc_period_tmp1.r_asg_start_date.DELETE;
Line: 6295

	r_enc_period_tmp1.r_asg_end_date.DELETE;
Line: 6296

	r_enc_period_tmp1.r_process_flag.DELETE;
Line: 6297

	r_enc_period_tmp1.r_period_ind.DELETE;
Line: 6298

	r_enc_period_tmp1.r_schedule_percent.DELETE;
Line: 6299

	r_enc_period_tmp1.r_encumbrance_amount.DELETE;
Line: 6300

	r_enc_period_tmp1.r_period_amount.DELETE;
Line: 6301

	r_enc_period_tmp1.r_reason_code.DELETE;
Line: 6302

	r_enc_period_tmp1.r_effective_date.DELETE;
Line: 6367

l_last_update_date		DATE;
Line: 6368

l_last_updated_by		NUMBER;
Line: 6369

l_last_updated_login		NUMBER;
Line: 6373

NO_UPDATE_REC_FOUND		EXCEPTION;
Line: 6376

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

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: 6389

	l_last_update_date := SYSDATE;
Line: 6390

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

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

	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: 6445

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

	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: 6474

		RAISE NO_UPDATE_REC_FOUND;
Line: 6480

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

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: 6516

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

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: 6576

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: 6583

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	pepa.payroll_action_id = p_payroll_action_id
			AND	pepa.assignment_status <> 'B')*/;
Line: 6598

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: 6628

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: 6637

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	= 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;
Line: 6651

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

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: 6665

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: 6672

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

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: 6687

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: 6694

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: 6701

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

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

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: 6719

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: 6733

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: 6741

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: 6749

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: 6759

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: 6789

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

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

SELECT	task_number
FROM	pa_tasks
WHERE	task_id = p_task_id;
Line: 6804

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

	cel_warnings.start_date.DELETE;
Line: 6952

	cel_warnings.end_date.DELETE;
Line: 6953

	cel_warnings.warning_code.DELETE;
Line: 6954

	cel_warnings.project_id.DELETE;
Line: 6955

	cel_warnings.task_id.DELETE;
Line: 6956

	cel_warnings.award_id.DELETE;
Line: 6957

	cel_warnings.exp_org_id.DELETE;
Line: 6958

	cel_warnings.exp_type.DELETE;
Line: 6959

	cel_warnings.effective_date.DELETE;
Line: 6960

	cel_warnings.error_status.DELETE;
Line: 6961

	cel_warnings.percent.DELETE;
Line: 7069

			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: 7213

				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: 7224

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

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

				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((SELECT	MAX (ptp.end_date)--MAX(ppa.date_earned): Bug 5642002: Replaced earned date with period 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	= l_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),l_enc_begin_date)) );
Line: 7252

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

				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((SELECT	MAX (ptp.end_date)--MAX(ppa.date_earned): Bug 5642002: Replaced earned date with period 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	= l_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),l_enc_begin_date)) );
Line: 7275

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

		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: 7315

	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: 7327

	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: 7339

	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: 7351

	t_assignments.payroll_array.delete;
Line: 7352

	t_assignments.asg_array.delete;
Line: 7420

l_last_update_date		DATE;
Line: 7421

l_last_updated_by		NUMBER;
Line: 7438

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: 7445

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

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: 7458

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

	l_last_update_date := SYSDATE;
Line: 7465

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

			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: 7508

		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: 7518

		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: 7529

		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: 7545

		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: 7550

		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: 7552

		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: 7568

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

			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: 7579

		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: 7589

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

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

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

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

		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: 7607

		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: 7616

		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: 7624

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

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

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

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: 7801

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: 7808

l_delete_flag		CHAR(1);
Line: 7816

	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: 7825

		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: 7847

		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: 7887

	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: 7892

	l_enc_summary_line_id_tl.DELETE;
Line: 7910

			l_delete_flag := 'N';
Line: 7928

					l_delete_flag := 'Y';
Line: 7933

			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: 7984

			l_delete_flag := 'N';
Line: 8013

					l_delete_flag := 'Y';
Line: 8018

			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: 8068

	t_enc_lines_array.r_enc_element_type_id.DELETE;
Line: 8069

	t_enc_lines_array.r_encumbrance_date.DELETE;
Line: 8070

	t_enc_lines_array.r_dr_cr_flag.DELETE;
Line: 8071

	t_enc_lines_array.r_encumbrance_amount.DELETE;
Line: 8072

	t_enc_lines_array.r_enc_line_type.DELETE;
Line: 8073

	t_enc_lines_array.r_schedule_line_id.DELETE;
Line: 8074

	t_enc_lines_array.r_org_schedule_id.DELETE;
Line: 8075

	t_enc_lines_array.r_default_org_account_id.DELETE;
Line: 8076

	t_enc_lines_array.r_suspense_org_account_id.DELETE;
Line: 8077

	t_enc_lines_array.r_element_account_id.DELETE;
Line: 8078

	t_enc_lines_array.r_gl_project_flag.DELETE;
Line: 8079

	t_enc_lines_array.r_person_id.DELETE;
Line: 8080

	t_enc_lines_array.r_assignment_id.DELETE;
Line: 8081

	t_enc_lines_array.r_award_id.DELETE;
Line: 8082

	t_enc_lines_array.r_task_id.DELETE;
Line: 8083

	t_enc_lines_array.r_expenditure_type.DELETE;
Line: 8084

	t_enc_lines_array.r_expenditure_organization_id.DELETE;
Line: 8085

	t_enc_lines_array.r_project_id.DELETE;
Line: 8086

	t_enc_lines_array.r_gl_code_combination_id.DELETE;
Line: 8087

	t_enc_lines_array.r_time_period_id.DELETE;
Line: 8088

	t_enc_lines_array.r_default_reason_code.DELETE;
Line: 8089

	t_enc_lines_array.r_suspense_reason_code.DELETE;
Line: 8090

	t_enc_lines_array.r_enc_control_id.DELETE;
Line: 8091

	t_enc_lines_array.r_change_flag.DELETE;
Line: 8092

	t_enc_lines_array.r_enc_start_date.DELETE;
Line: 8093

	t_enc_lines_array.r_enc_end_date.DELETE;
Line: 8094

	t_enc_lines_array.r_attribute_category.DELETE;
Line: 8095

	t_enc_lines_array.r_attribute1.DELETE;
Line: 8096

	t_enc_lines_array.r_attribute2.DELETE;
Line: 8097

	t_enc_lines_array.r_attribute3.DELETE;
Line: 8098

	t_enc_lines_array.r_attribute4.DELETE;
Line: 8099

	t_enc_lines_array.r_attribute5.DELETE;
Line: 8100

	t_enc_lines_array.r_attribute6.DELETE;
Line: 8101

	t_enc_lines_array.r_attribute7.DELETE;
Line: 8102

	t_enc_lines_array.r_attribute8.DELETE;
Line: 8103

	t_enc_lines_array.r_attribute9.DELETE;
Line: 8104

	t_enc_lines_array.r_attribute10.DELETE;
Line: 8105

	t_enc_lines_array.r_orig_gl_code_combination_id.DELETE;
Line: 8106

	t_enc_lines_array.r_orig_project_id.DELETE;
Line: 8107

	t_enc_lines_array.r_orig_award_id.DELETE;
Line: 8108

	t_enc_lines_array.r_orig_task_id.DELETE;
Line: 8109

	t_enc_lines_array.r_orig_expenditure_type.DELETE;
Line: 8110

	t_enc_lines_array.r_orig_expenditure_org_id.DELETE;
Line: 8111

	t_enc_lines_array.r_hierarchy_code.DELETE;
Line: 8112

	t_enc_lines_array.r_hierarchy_start_date.DELETE;
Line: 8113

	t_enc_lines_array.r_hierarchy_end_date.DELETE;
Line: 8118

		--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: 8123

	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: 8144

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

l_last_updated_by	NUMBER(15);
Line: 8162

l_last_update_login	NUMBER(15);
Line: 8164

	l_last_updated_by := fnd_global.user_id;
Line: 8165

	l_last_update_login := fnd_global.login_id;
Line: 8167

	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: 8250

l_last_updated_by	NUMBER(15);
Line: 8251

l_last_update_login	NUMBER(15);
Line: 8254

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: 8342

	l_last_updated_by := fnd_global.user_id;
Line: 8343

	l_last_update_login := fnd_global.login_id;
Line: 8363

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

	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: 8405

		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: 8435

		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: 8500

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

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: 8521

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: 8529

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: 8542

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

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: 8557

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: 8565

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: 8572

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

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: 8591

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: 8599

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: 8637

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

		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;
Line: 8679

			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((SELECT 	/*+ use_nl(PTP) */ Max(ptp.end_date)
					FROM	pay_payroll_actions ppa,
						pay_assignment_actions paa,
						per_time_periods ptp
					WHERE	paa.assignment_id(+) = pa.assignment_id
					AND	ppa.payroll_action_id = paa.payroll_action_id (+)
					AND	ppa.business_group_id = pa.business_group_id
					AND	ppa.payroll_id = pa.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),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((SELECT 	/*+ use_nl(PTP) */ Max(ptp.end_date)
							FROM	pay_payroll_actions ppa,
								pay_assignment_actions paa,
								per_time_periods ptp
							WHERE	paa.assignment_id(+) = pesl.assignment_id
							AND	ppa.payroll_action_id = paa.payroll_action_id (+)
							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'
							and     ppa.date_earned between ptp.start_date and ptp.end_date
							and     ptp.payroll_id = ppa.payroll_id),l_enc_begin_date))
					AND	pesl.payroll_id = p_payroll_id);
Line: 8733

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

			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((SELECT 	/*+ use_nl(PTP) */ Max(ptp.end_date)
								   FROM	pay_payroll_actions ppa,
								        pay_assignment_actions paa,
								        per_time_periods ptp
								   WHERE paa.assignment_id(+) = pa.assignment_id
								   and ppa.payroll_action_id = paa.payroll_action_id (+)
								   and ppa.business_group_id = pa.business_group_id
								   AND	ppa.payroll_id	= pa.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),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: 8778

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

			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
			-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
			AND	pa.effective_end_date >= (NVL((SELECT 	/*+ use_nl(PTP) */ Max(ptp.end_date)
					FROM	pay_payroll_actions ppa,
						pay_assignment_actions paa,
						per_time_periods ptp
					WHERE	paa.assignment_id(+) = pa.assignment_id
					AND	ppa.payroll_action_id = paa.payroll_action_id (+)
					AND	ppa.business_group_id = pa.business_group_id
					AND	ppa.payroll_id = pa.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),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: 8822

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

			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 >= l_enc_begin_date
			-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
			AND	pa.effective_end_date >= (NVL((SELECT 	/*+ use_nl(PTP) */ Max(ptp.end_date)
					FROM	pay_payroll_actions ppa,
						pay_assignment_actions paa,
						per_time_periods ptp
					WHERE	paa.assignment_id(+) = pa.assignment_id
					AND	ppa.payroll_action_id = paa.payroll_action_id (+)
					AND	ppa.business_group_id = pa.business_group_id
					AND	ppa.payroll_id = pa.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),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')
					-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
					AND	pesl.effective_date > (NVL((SELECT 	/*+ use_nl(PTP) */ Max(ptp.end_date)
							FROM	pay_payroll_actions ppa,
								pay_assignment_actions paa,
								per_time_periods ptp
							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
							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'),l_enc_begin_date)) );
Line: 8873

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

			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((SELECT 	/*+ use_nl(PTP) */ Max(ptp.end_date)
								   FROM	pay_payroll_actions ppa,
									pay_assignment_actions paa,
									per_time_periods ptp
								   WHERE paa.assignment_id(+)= pa.assignment_id
								   and ppa.payroll_action_id = paa.payroll_action_id  (+)
								   and ppa.business_group_id = pa.business_group_id
								   AND ppa.payroll_id	= pa.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),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: 8910

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

			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
			-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
			AND	pa.effective_end_date >= (NVL((SELECT 	/*+ use_nl(PTP) */ Max(ptp.end_date)
					FROM	pay_payroll_actions ppa,
						pay_assignment_actions paa,
						per_time_periods ptp
					WHERE	paa.assignment_id(+) = pa.assignment_id
					AND	ppa.payroll_action_id = paa.payroll_action_id (+)
					AND	ppa.business_group_id = pa.business_group_id
					AND	ppa.payroll_id = pa.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),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: 8953

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

		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
			-- Bug 5642002: Replaced last Payroll Process date with last assignment Process date
		AND	pesl.effective_date <= (NVL((SELECT 	/*+ use_nl(PTP) */ Max(ptp.end_date)
				FROM	pay_payroll_actions ppa,
					pay_assignment_actions paa,
					per_time_periods ptp
				WHERE	paa.assignment_id(+) = pesl.assignment_id
				AND	ppa.payroll_action_id = paa.payroll_action_id (+)
				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'
				and 	ppa.date_earned between ptp.start_date and ptp.end_date
				and  	ptp.payroll_id = ppa.payroll_id),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	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((SELECT 	/*+ use_nl(PTP) */ Max(ptp.end_date)
						FROM	pay_payroll_actions ppa,
							pay_assignment_actions paa,
							per_time_periods ptp
						WHERE	paa.assignment_id(+) = pesl2.assignment_id
						AND	ppa.payroll_action_id = paa.payroll_action_id (+)
						AND	ppa.business_group_id = pesl2.business_group_id
						AND	ppa.payroll_id = pesl2.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),l_enc_begin_date))
				AND	pesl2.payroll_id = p_payroll_id);
Line: 9000

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

		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: 9011

		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: 9013

		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: 9024

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

		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	pesl.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: 9100

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

			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	pesl.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: 9167

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

			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	pesl.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: 9235

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

			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	pesl.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: 9303

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

			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	pesl.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: 9371

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

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: 9479

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: 9496

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

		DELETE	psp_enc_summary_lines
		WHERE	payroll_action_id = p_payroll_action_id;
Line: 9503

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

		DELETE	psp_enc_lines
		WHERE	payroll_action_id = p_payroll_action_id;
Line: 9507

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

		DELETE	psp_enc_controls
		WHERE	payroll_action_id = p_payroll_action_id;
Line: 9511

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

		DELETE	psp_report_errors
		WHERE	payroll_action_id = p_payroll_action_id;
Line: 9515

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

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

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

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

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

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

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

		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: 9543

		DELETE	psp_enc_changed_asg_history
		WHERE   payroll_action_id = p_payroll_action_id;
Line: 9562

			l_assignments_tmp.DELETE;
Line: 9576

			l_assignments_tmp.DELETE;
Line: 9590

			l_assignments_tmp.DELETE;
Line: 9604

			l_assignments_tmp.DELETE;
Line: 9614

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

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

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

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

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

			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: 9635

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

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

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

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

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

			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: 9652

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

			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: 9665

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

		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: 9678

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

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: 9741

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: 9780

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: 9827

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: 9868

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: 9892

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: 9929

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: 9968

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: 10005

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: 10168

		r_gsa.line_account_id.DELETE;
Line: 10169

		r_gsa.gl_code_combination_id.DELETE;
Line: 10170

		r_gsa.project_id.DELETE;
Line: 10171

		r_gsa.task_id.DELETE;
Line: 10172

		r_gsa.award_id.DELETE;
Line: 10173

		r_gsa.expenditure_type.DELETE;
Line: 10174

		r_gsa.expenditure_organization_id.DELETE;
Line: 10175

		r_gsa.start_date_active.DELETE;
Line: 10176

		r_gsa.end_date_active.DELETE;
Line: 10177

		r_gsa.poeta_start_date.DELETE;
Line: 10178

		r_gsa.poeta_end_date.DELETE;
Line: 10179

		r_gsa.percent.DELETE;
Line: 10180

		r_gsa.attribute_category.DELETE;
Line: 10181

		r_gsa.attribute1.DELETE;
Line: 10182

		r_gsa.attribute2.DELETE;
Line: 10183

		r_gsa.attribute3.DELETE;
Line: 10184

		r_gsa.attribute4.DELETE;
Line: 10185

		r_gsa.attribute5.DELETE;
Line: 10186

		r_gsa.attribute6.DELETE;
Line: 10187

		r_gsa.attribute7.DELETE;
Line: 10188

		r_gsa.attribute8.DELETE;
Line: 10189

		r_gsa.attribute9.DELETE;
Line: 10190

		r_gsa.attribute10.DELETE;
Line: 10191

		r_gsa.acct_type.DELETE;
Line: 10238

		r_gsa.line_account_id.DELETE;
Line: 10239

		r_gsa.gl_code_combination_id.DELETE;
Line: 10240

		r_gsa.project_id.DELETE;
Line: 10241

		r_gsa.task_id.DELETE;
Line: 10242

		r_gsa.award_id.DELETE;
Line: 10243

		r_gsa.expenditure_type.DELETE;
Line: 10244

		r_gsa.expenditure_organization_id.DELETE;
Line: 10245

		r_gsa.start_date_active.DELETE;
Line: 10246

		r_gsa.end_date_active.DELETE;
Line: 10247

		r_gsa.poeta_start_date.DELETE;
Line: 10248

		r_gsa.poeta_end_date.DELETE;
Line: 10249

		r_gsa.percent.DELETE;
Line: 10250

		r_gsa.attribute_category.DELETE;
Line: 10251

		r_gsa.attribute1.DELETE;
Line: 10252

		r_gsa.attribute2.DELETE;
Line: 10253

		r_gsa.attribute3.DELETE;
Line: 10254

		r_gsa.attribute4.DELETE;
Line: 10255

		r_gsa.attribute5.DELETE;
Line: 10256

		r_gsa.attribute6.DELETE;
Line: 10257

		r_gsa.attribute7.DELETE;
Line: 10258

		r_gsa.attribute8.DELETE;
Line: 10259

		r_gsa.attribute9.DELETE;
Line: 10260

		r_gsa.attribute10.DELETE;
Line: 10261

		r_gsa.acct_type.DELETE;
Line: 10308

		r_gsa.line_account_id.DELETE;
Line: 10309

		r_gsa.gl_code_combination_id.DELETE;
Line: 10310

		r_gsa.project_id.DELETE;
Line: 10311

		r_gsa.task_id.DELETE;
Line: 10312

		r_gsa.award_id.DELETE;
Line: 10313

		r_gsa.expenditure_type.DELETE;
Line: 10314

		r_gsa.expenditure_organization_id.DELETE;
Line: 10315

		r_gsa.start_date_active.DELETE;
Line: 10316

		r_gsa.end_date_active.DELETE;
Line: 10317

		r_gsa.poeta_start_date.DELETE;
Line: 10318

		r_gsa.poeta_end_date.DELETE;
Line: 10319

		r_gsa.percent.DELETE;
Line: 10320

		r_gsa.attribute_category.DELETE;
Line: 10321

		r_gsa.attribute1.DELETE;
Line: 10322

		r_gsa.attribute2.DELETE;
Line: 10323

		r_gsa.attribute3.DELETE;
Line: 10324

		r_gsa.attribute4.DELETE;
Line: 10325

		r_gsa.attribute5.DELETE;
Line: 10326

		r_gsa.attribute6.DELETE;
Line: 10327

		r_gsa.attribute7.DELETE;
Line: 10328

		r_gsa.attribute8.DELETE;
Line: 10329

		r_gsa.attribute9.DELETE;
Line: 10330

		r_gsa.attribute10.DELETE;
Line: 10331

		r_gsa.acct_type.DELETE;
Line: 10535

			r_sa_tmp.line_account_id.DELETE;
Line: 10536

			r_sa_tmp.gl_code_combination_id.DELETE;
Line: 10537

			r_sa_tmp.project_id.DELETE;
Line: 10538

			r_sa_tmp.task_id.DELETE;
Line: 10539

			r_sa_tmp.award_id.DELETE;
Line: 10540

			r_sa_tmp.expenditure_type.DELETE;
Line: 10541

			r_sa_tmp.expenditure_organization_id.DELETE;
Line: 10542

			r_sa_tmp.start_date_active.DELETE;
Line: 10543

			r_sa_tmp.end_date_active.DELETE;
Line: 10544

			r_sa_tmp.poeta_start_date.DELETE;
Line: 10545

			r_sa_tmp.poeta_end_date.DELETE;
Line: 10546

			r_sa_tmp.percent.DELETE;
Line: 10547

			r_sa_tmp.attribute_category.DELETE;
Line: 10548

			r_sa_tmp.attribute1.DELETE;
Line: 10549

			r_sa_tmp.attribute2.DELETE;
Line: 10550

			r_sa_tmp.attribute3.DELETE;
Line: 10551

			r_sa_tmp.attribute4.DELETE;
Line: 10552

			r_sa_tmp.attribute5.DELETE;
Line: 10553

			r_sa_tmp.attribute6.DELETE;
Line: 10554

			r_sa_tmp.attribute7.DELETE;
Line: 10555

			r_sa_tmp.attribute8.DELETE;
Line: 10556

			r_sa_tmp.attribute9.DELETE;
Line: 10557

			r_sa_tmp.attribute10.DELETE;
Line: 10558

			r_sa_tmp.acct_type.DELETE;
Line: 10563

	r_gsa.line_account_id.DELETE;
Line: 10564

	r_gsa.gl_code_combination_id.DELETE;
Line: 10565

	r_gsa.project_id.DELETE;
Line: 10566

	r_gsa.task_id.DELETE;
Line: 10567

	r_gsa.award_id.DELETE;
Line: 10568

	r_gsa.expenditure_type.DELETE;
Line: 10569

	r_gsa.expenditure_organization_id.DELETE;
Line: 10570

	r_gsa.start_date_active.DELETE;
Line: 10571

	r_gsa.end_date_active.DELETE;
Line: 10572

	r_gsa.poeta_start_date.DELETE;
Line: 10573

	r_gsa.poeta_end_date.DELETE;
Line: 10574

	r_gsa.percent.DELETE;
Line: 10575

	r_gsa.attribute_category.DELETE;
Line: 10576

	r_gsa.attribute1.DELETE;
Line: 10577

	r_gsa.attribute2.DELETE;
Line: 10578

	r_gsa.attribute3.DELETE;
Line: 10579

	r_gsa.attribute4.DELETE;
Line: 10580

	r_gsa.attribute5.DELETE;
Line: 10581

	r_gsa.attribute6.DELETE;
Line: 10582

	r_gsa.attribute7.DELETE;
Line: 10583

	r_gsa.attribute8.DELETE;
Line: 10584

	r_gsa.attribute9.DELETE;
Line: 10585

	r_gsa.attribute10.DELETE;
Line: 10586

	r_gsa.acct_type.DELETE;
Line: 11226

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: 11231

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

END	delete_previous_error_log;
Line: 11239

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: 11261

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: 11293

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

		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: 11369

		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: 11388

	t_enc_lines.element_type_id.DELETE;
Line: 11389

	t_enc_lines.hierarchy_code.DELETE;
Line: 11390

	t_enc_lines.gl_ccid.DELETE;
Line: 11391

	t_enc_lines.project_id.DELETE;
Line: 11392

	t_enc_lines.task_id.DELETE;
Line: 11393

	t_enc_lines.award_id.DELETE;
Line: 11394

	t_enc_lines.exp_org_id.DELETE;
Line: 11395

	t_enc_lines.exp_type.DELETE;
Line: 11396

	t_enc_lines.enc_start_date.DELETE;
Line: 11397

	t_enc_lines.enc_end_date.DELETE;
Line: 11399

	t_enc_nlines.element_type_id.DELETE;
Line: 11400

	t_enc_nlines.hierarchy_code.DELETE;
Line: 11401

	t_enc_nlines.gl_ccid.DELETE;
Line: 11402

	t_enc_nlines.project_id.DELETE;
Line: 11403

	t_enc_nlines.task_id.DELETE;
Line: 11404

	t_enc_nlines.award_id.DELETE;
Line: 11405

	t_enc_nlines.exp_org_id.DELETE;
Line: 11406

	t_enc_nlines.exp_type.DELETE;
Line: 11407

	t_enc_nlines.enc_start_date.DELETE;
Line: 11408

	t_enc_nlines.enc_end_date.DELETE;
Line: 11470

		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: 11485

		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: 11504

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

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

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

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

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

END update_hierarchy_dates;
Line: 11518

	r_sa.line_account_id.DELETE;
Line: 11519

	r_sa.gl_code_combination_id.DELETE;
Line: 11520

	r_sa.project_id.DELETE;
Line: 11521

	r_sa.task_id.DELETE;
Line: 11522

	r_sa.award_id.DELETE;
Line: 11523

	r_sa.expenditure_type.DELETE;
Line: 11524

	r_sa.expenditure_organization_id.DELETE;
Line: 11525

	r_sa.start_date_active.DELETE;
Line: 11526

	r_sa.end_date_active.DELETE;
Line: 11527

	r_sa.poeta_start_date.DELETE;
Line: 11528

	r_sa.poeta_end_date.DELETE;
Line: 11529

	r_sa.percent.DELETE;
Line: 11530

	r_sa.attribute_category.DELETE;
Line: 11531

	r_sa.attribute1.DELETE;
Line: 11532

	r_sa.attribute2.DELETE;
Line: 11533

	r_sa.attribute3.DELETE;
Line: 11534

	r_sa.attribute4.DELETE;
Line: 11535

	r_sa.attribute5.DELETE;
Line: 11536

	r_sa.attribute6.DELETE;
Line: 11537

	r_sa.attribute7.DELETE;
Line: 11538

	r_sa.attribute8.DELETE;
Line: 11539

	r_sa.attribute9.DELETE;
Line: 11540

	r_sa.attribute10.DELETE;
Line: 11541

	r_sa.acct_type.DELETE;
Line: 11543

	r_da.line_account_id.DELETE;
Line: 11544

	r_da.gl_code_combination_id.DELETE;
Line: 11545

	r_da.project_id.DELETE;
Line: 11546

	r_da.task_id.DELETE;
Line: 11547

	r_da.award_id.DELETE;
Line: 11548

	r_da.expenditure_type.DELETE;
Line: 11549

	r_da.expenditure_organization_id.DELETE;
Line: 11550

	r_da.start_date_active.DELETE;
Line: 11551

	r_da.end_date_active.DELETE;
Line: 11552

	r_da.poeta_start_date.DELETE;
Line: 11553

	r_da.poeta_end_date.DELETE;
Line: 11554

	r_da.percent.DELETE;
Line: 11555

	r_da.attribute_category.DELETE;
Line: 11556

	r_da.attribute1.DELETE;
Line: 11557

	r_da.attribute2.DELETE;
Line: 11558

	r_da.attribute3.DELETE;
Line: 11559

	r_da.attribute4.DELETE;
Line: 11560

	r_da.attribute5.DELETE;
Line: 11561

	r_da.attribute6.DELETE;
Line: 11562

	r_da.attribute7.DELETE;
Line: 11563

	r_da.attribute8.DELETE;
Line: 11564

	r_da.attribute9.DELETE;
Line: 11565

	r_da.attribute10.DELETE;
Line: 11566

	r_da.acct_type.DELETE;
Line: 11568

	r_odls.line_account_id.DELETE;
Line: 11569

	r_odls.gl_code_combination_id.DELETE;
Line: 11570

	r_odls.project_id.DELETE;
Line: 11571

	r_odls.task_id.DELETE;
Line: 11572

	r_odls.award_id.DELETE;
Line: 11573

	r_odls.expenditure_type.DELETE;
Line: 11574

	r_odls.expenditure_organization_id.DELETE;
Line: 11575

	r_odls.start_date_active.DELETE;
Line: 11576

	r_odls.end_date_active.DELETE;
Line: 11577

	r_odls.poeta_start_date.DELETE;
Line: 11578

	r_odls.poeta_end_date.DELETE;
Line: 11579

	r_odls.percent.DELETE;
Line: 11580

	r_odls.attribute_category.DELETE;
Line: 11581

	r_odls.attribute1.DELETE;
Line: 11582

	r_odls.attribute2.DELETE;
Line: 11583

	r_odls.attribute3.DELETE;
Line: 11584

	r_odls.attribute4.DELETE;
Line: 11585

	r_odls.attribute5.DELETE;
Line: 11586

	r_odls.attribute6.DELETE;
Line: 11587

	r_odls.attribute7.DELETE;
Line: 11588

	r_odls.attribute8.DELETE;
Line: 11589

	r_odls.attribute9.DELETE;
Line: 11590

	r_odls.attribute10.DELETE;
Line: 11591

	r_odls.acct_type.DELETE;
Line: 11593

	r_asg.line_account_id.DELETE;
Line: 11594

	r_asg.gl_code_combination_id.DELETE;
Line: 11595

	r_asg.project_id.DELETE;
Line: 11596

	r_asg.task_id.DELETE;
Line: 11597

	r_asg.award_id.DELETE;
Line: 11598

	r_asg.expenditure_type.DELETE;
Line: 11599

	r_asg.expenditure_organization_id.DELETE;
Line: 11600

	r_asg.start_date_active.DELETE;
Line: 11601

	r_asg.end_date_active.DELETE;
Line: 11602

	r_asg.poeta_start_date.DELETE;
Line: 11603

	r_asg.poeta_end_date.DELETE;
Line: 11604

	r_asg.percent.DELETE;
Line: 11605

	r_asg.attribute_category.DELETE;
Line: 11606

	r_asg.attribute1.DELETE;
Line: 11607

	r_asg.attribute2.DELETE;
Line: 11608

	r_asg.attribute3.DELETE;
Line: 11609

	r_asg.attribute4.DELETE;
Line: 11610

	r_asg.attribute5.DELETE;
Line: 11611

	r_asg.attribute6.DELETE;
Line: 11612

	r_asg.attribute7.DELETE;
Line: 11613

	r_asg.attribute8.DELETE;
Line: 11614

	r_asg.attribute9.DELETE;
Line: 11615

	r_asg.attribute10.DELETE;
Line: 11616

	r_asg.acct_type.DELETE;
Line: 11618

	r_ec.line_account_id.DELETE;
Line: 11619

	r_ec.gl_code_combination_id.DELETE;
Line: 11620

	r_ec.project_id.DELETE;
Line: 11621

	r_ec.task_id.DELETE;
Line: 11622

	r_ec.award_id.DELETE;
Line: 11623

	r_ec.expenditure_type.DELETE;
Line: 11624

	r_ec.expenditure_organization_id.DELETE;
Line: 11625

	r_ec.start_date_active.DELETE;
Line: 11626

	r_ec.end_date_active.DELETE;
Line: 11627

	r_ec.poeta_start_date.DELETE;
Line: 11628

	r_ec.poeta_end_date.DELETE;
Line: 11629

	r_ec.percent.DELETE;
Line: 11630

	r_ec.attribute_category.DELETE;
Line: 11631

	r_ec.attribute1.DELETE;
Line: 11632

	r_ec.attribute2.DELETE;
Line: 11633

	r_ec.attribute3.DELETE;
Line: 11634

	r_ec.attribute4.DELETE;
Line: 11635

	r_ec.attribute5.DELETE;
Line: 11636

	r_ec.attribute6.DELETE;
Line: 11637

	r_ec.attribute7.DELETE;
Line: 11638

	r_ec.attribute8.DELETE;
Line: 11639

	r_ec.attribute9.DELETE;
Line: 11640

	r_ec.attribute10.DELETE;
Line: 11641

	r_ec.acct_type.DELETE;
Line: 11643

	r_et.line_account_id.DELETE;
Line: 11644

	r_et.gl_code_combination_id.DELETE;
Line: 11645

	r_et.project_id.DELETE;
Line: 11646

	r_et.task_id.DELETE;
Line: 11647

	r_et.award_id.DELETE;
Line: 11648

	r_et.expenditure_type.DELETE;
Line: 11649

	r_et.expenditure_organization_id.DELETE;
Line: 11650

	r_et.start_date_active.DELETE;
Line: 11651

	r_et.end_date_active.DELETE;
Line: 11652

	r_et.poeta_start_date.DELETE;
Line: 11653

	r_et.poeta_end_date.DELETE;
Line: 11654

	r_et.percent.DELETE;
Line: 11655

	r_et.attribute_category.DELETE;
Line: 11656

	r_et.attribute1.DELETE;
Line: 11657

	r_et.attribute2.DELETE;
Line: 11658

	r_et.attribute3.DELETE;
Line: 11659

	r_et.attribute4.DELETE;
Line: 11660

	r_et.attribute5.DELETE;
Line: 11661

	r_et.attribute6.DELETE;
Line: 11662

	r_et.attribute7.DELETE;
Line: 11663

	r_et.attribute8.DELETE;
Line: 11664

	r_et.attribute9.DELETE;
Line: 11665

	r_et.attribute10.DELETE;
Line: 11666

	r_et.acct_type.DELETE;
Line: 11668

	r_gee.line_account_id.DELETE;
Line: 11669

	r_gee.gl_code_combination_id.DELETE;
Line: 11670

	r_gee.project_id.DELETE;
Line: 11671

	r_gee.task_id.DELETE;
Line: 11672

	r_gee.award_id.DELETE;
Line: 11673

	r_gee.expenditure_type.DELETE;
Line: 11674

	r_gee.expenditure_organization_id.DELETE;
Line: 11675

	r_gee.start_date_active.DELETE;
Line: 11676

	r_gee.end_date_active.DELETE;
Line: 11677

	r_gee.poeta_start_date.DELETE;
Line: 11678

	r_gee.poeta_end_date.DELETE;
Line: 11679

	r_gee.percent.DELETE;
Line: 11680

	r_gee.attribute_category.DELETE;
Line: 11681

	r_gee.attribute1.DELETE;
Line: 11682

	r_gee.attribute2.DELETE;
Line: 11683

	r_gee.attribute3.DELETE;
Line: 11684

	r_gee.attribute4.DELETE;
Line: 11685

	r_gee.attribute5.DELETE;
Line: 11686

	r_gee.attribute6.DELETE;
Line: 11687

	r_gee.attribute7.DELETE;
Line: 11688

	r_gee.attribute8.DELETE;
Line: 11689

	r_gee.attribute9.DELETE;
Line: 11690

	r_gee.attribute10.DELETE;
Line: 11691

	r_gee.acct_type.DELETE;