The following lines contain the word 'select', 'insert', 'update' or 'delete':
Select 'x'
Into pl_dummy
from pa_draft_invoice_items dii
where draft_invoice_num = P_Draft_Invoice_Num
and project_id = P_Project_ID
-- and output_vat_tax_id is not null
and output_tax_classification_code is not null
and not exists ( select 'x'
from pa_output_tax_code_txn_v tax
where tax.tax_code = dii.output_tax_classification_code)
/* where P_Trx_Date >= start_date_active
and P_Trx_Date <= nvl(end_date_active,P_Trx_Date) */ /* commented for bug 5484859 */
-- and vat_tax_id = output_vat_tax_id)
and rownum = 1;
Select I.Invoice_Date, I.Inv_Currency_Code, P.Project_Currency_Code
Into Invoice_date, Inv_Currency_Code, Project_Currency_Code
From PA_Draft_Invoices I, PA_Projects P
WHERE P.Project_id = P_Project_ID
AND I.Project_id = P_Project_ID
AND Draft_Invoice_Num = P_Draft_Invoice_Num;
Select Sum(Item.Amount), Sum(Item.Inv_Amount)
Into Project_Amount, Invoice_Amount
From PA_Draft_Invoice_Items Item
Where Item.Project_ID = P_Project_ID
And Item.Draft_Invoice_Num = P_Draft_Invoice_Num
And Item.Invoice_Line_Type <> 'NET ZERO ADJUSTMENT';
Select decode(Orig.Canceled_Flag,'Y','CANCEL','CREDIT_MEMO')
Into Invoice_Class
From PA_Draft_Invoices Orig,
PA_Draft_Invoices Curr
Where Curr.Project_ID = P_Project_ID
AND Curr.Draft_Invoice_Num = P_Draft_Invoice_Num
AND Orig.Project_ID = Curr.Project_ID
AND Orig.Draft_Invoice_Num = Curr.Draft_Invoice_Num_Credited;
Select Name
/* Tax_Calculation_Flag Commented for bug 7348841 */
Into AR_Trx_Type
/* AR_Tax_Flag commented for bug 7348841 */
From RA_Cust_Trx_Types
Where Cust_Trx_Type_ID = P_AR_Trx_Type_ID
AND Type IN ('INV','CM')
AND Creation_Sign = 'A'
AND Start_Date <= P_Invoice_Date
AND NVL(End_Date, P_Invoice_Date+1) >= P_Invoice_Date
AND Rownum = 1;
Select Name
/* Tax_Calculation_Flag commented for bug 7348841 */
Into AR_Trx_Type
/* AR_Tax_Flag coomented for bug 7348841 */
From RA_Cust_Trx_Types
Where Cust_Trx_Type_ID = P_AR_Trx_Type_ID
AND Type IN ('INV','CM')
AND Accounting_Affect_Flag = 'Y'
AND Creation_Sign = 'A'
AND POST_TO_GL = 'Y'
AND Start_Date <= P_Invoice_Date
AND NVL(End_Date, P_Invoice_Date+1) >= P_Invoice_Date
AND Rownum = 1;
Select 'x'
Into l_dummy
From PA_Draft_Invoice_Items
Where Project_id = P_Project_Id
And Draft_Invoice_num = P_Draft_Inv_Num
AND output_tax_classification_code IS NULL
-- And Output_vat_tax_id is Null
AND draft_inv_line_num_credited is null /* For bug 2973011
And Invoice_Line_type <> 'NET ZERO ADJUSTMENT'
And rownum = 1;