The following lines contain the word 'select', 'insert', 'update' or 'delete':
select 'This is an Inter-Project Provider Project'
from dual
where exists ( select NULL
from pa_project_customers ppc
where ppc.project_id = p_project_id
and ppc.bill_another_project_flag = 'Y'
and ppc.receiver_task_id is not null
);
select 'This is an Inter-Project Receiver Project'
from dual
where exists ( select NULL
from pa_tasks pt
where pt.project_id = p_project_id
and pt.receive_project_invoice_flag = 'Y'
and exists ( select NULL
from pa_project_customers ppc
where ppc.receiver_task_id = pt.task_id )
);
select 'INTERCOMPANY INV NOT GENERATED'
from dual
where exists (
select ei.expenditure_item_id
from pa_expenditure_items_all ei,
pa_tasks t
where ei.task_id = t.task_id
and t.project_id = p_project_id
and ei.cc_cross_charge_code = 'I'
and ( p_active_flag <> 'A'
or ei.expenditure_item_date < p_txn_to_date )
/*
and not exists ( select null
from pa_draft_invoice_details_all di
where di.cc_project_id = p_project_id
and di.expenditure_item_id = ei.expenditure_item_id
)
*/
and ei.cc_ic_processed_code <> 'Y' /* Bug#2423804 changed the '=' to '<>' */
);
select 'IC INV NOT TIEDBACK SUCCESSFULLY'
from dual
where exists (
select null
from pa_expenditure_items_all ei,
pa_tasks t
where ei.task_id = t.task_id
and t.project_id = p_project_id
and ei.cc_cross_charge_code = 'I'
and ei.cc_ic_processed_code = 'Y'
and ei.cc_rejection_code is NULL
and ( p_active_flag <> 'A'
or ei.expenditure_item_date < p_txn_to_date )
and exists ( select null
from pa_draft_invoices_all di,
pa_draft_invoice_details_all did
where did.cc_project_id = p_project_id
and did.project_id = di.project_id
and di.draft_invoice_num = did.draft_invoice_num
and did.expenditure_item_id = ei.expenditure_item_id
and di.transfer_status_code <> 'A'
)
);
select 'IC INV NOT ACCEPTED IN AP'
from dual
where exists (
select null
from pa_expenditure_items_all ei,
pa_tasks t
where ei.task_id = t.task_id
and t.project_id = p_project_id
and ei.cc_cross_charge_code = 'I'
and ei.cc_ic_processed_code = 'Y'
and ei.cc_rejection_code is NULL
and ( p_active_flag <> 'A'
or ei.expenditure_item_date < p_txn_to_date )
and exists ( select null
from pa_draft_invoices_all di,
pa_draft_invoice_details_all did
where did.cc_project_id = p_project_id
and did.project_id = di.project_id
and did.expenditure_item_id = ei.expenditure_item_id
and di.draft_invoice_num = did.draft_invoice_num
and di.transfer_status_code = 'A'
and not exists ( select null
from ap_invoices_all ap
where ap.invoice_num = di.ra_invoice_number
)
)
);
select 'IP INV NOT TIEDBACK SUCCESSFULLY'
from dual
where exists (
select null
from pa_draft_invoices_all di,
pa_project_customers ppc,
pa_agreements_all pag
where di.project_id = p_project_id
and di.agreement_id = pag.agreement_id
and pag.customer_id = ppc.customer_id
and di.project_id = ppc.project_id
and ppc.bill_another_project_flag = 'Y'
and ppc.receiver_task_id IS NOT NULL
and di.transfer_status_code <> 'A'
);
select 'IP INV NOT ACCEPTED IN AP'
from dual
where exists (
select null
from pa_draft_invoices_all di,
pa_project_customers ppc,
pa_agreements_all pag
where di.project_id = p_project_id
and di.project_id = ppc.project_id
and di.agreement_id = pag.agreement_id
and pag.customer_id = ppc.customer_id
and ppc.bill_another_project_flag = 'Y'
and ppc.receiver_task_id IS NOT NULL
and di.transfer_status_code ='A'
and not exists ( select null
from ap_invoices_all ap
where ap.invoice_num = di.ra_invoice_number
)
);
select ppc.project_id
from pa_project_customers ppc
where ppc.bill_another_project_flag = 'Y'
and ppc.receiver_task_id is not null
and ppc.customer_bill_split <> 0 /* Bug#2429956 */
and ppc.receiver_task_id in ( select task_id
from pa_tasks pt
where pt.project_id = p_project_id);
select project_status_code
into l_project_status_code
from pa_projects_all
where project_id = c_prvdr_prj_rec.project_id;
if g_insert_errors_no_duplicate = 'N' then /* Bug#2431705 */
fnd_message.set_name('PA','PA_ARPR_PRVDR_NOT_PURGED');
g_insert_errors_no_duplicate := 'Y'; /* Bug# 2431705 */
if g_insert_errors_no_duplicate = 'N' then /* Bug# 2431705 */
fnd_message.set_name('PA','PA_ARPR_PRVDR_NOT_PURGED');
g_insert_errors_no_duplicate := 'Y'; /* Bug# 2431705 */