The following lines contain the word 'select', 'insert', 'update' or 'delete':
select max(due_date)
into due_date
from ar_payment_schedules;
/*SRW.MESSAGE('2','After Selecting Due Date');*/null;
select to_char(gl.chart_of_accounts_id)
into P_CHART_OF_ACCOUNTS_ID
from gl_sets_of_books gl, ar_system_parameters p
where gl.set_of_books_id = p.set_of_books_id;
/*SRW.MESSAGE('3','After Selecting Chart of Accounts Id');*/null;
select currency_code
into P_CURRENCY
from gl_sets_of_books gl, ar_system_parameters ar
where ar.set_of_books_id = gl.set_of_books_id;
/*SRW.MESSAGE('4','After Selecting Currency Code');*/null;
select precision
into P_PRECISION
from fnd_currencies
where currency_code = P_CURRENCY;
/*SRW.MESSAGE('5','After Selecting Precision');*/null;
select minimum_accountable_unit
into P_MIN_ACCOUNTABLE_UNIT
from fnd_currencies
where currency_code = P_CURRENCY;
/*SRW.MESSAGE('6','After Selecting Minimum Accountable Unit');*/null;
select gl.name, gl.set_of_books_id, ar.org_id
into P_NAME, P_SET_OF_BOOKS_ID,acc_org_id
from gl_sets_of_books gl, ar_system_parameters ar
where gl.set_of_books_id = ar.set_of_books_id;
/*SRW.MESSAGE('7','After Selecting Set Of Books Id, Company Name');*/null;
select end_date
into P_END_DATE
from gl_period_statuses gl
where gl.set_of_books_id = P_SET_OF_BOOKS_ID and gl.application_id = 222
and gl.period_name = P_REVALUATION_PERIOD;
select min(start_date)
into acc_start_date
from gl_period_statuses gl
where gl.set_of_books_id = P_SET_OF_BOOKS_ID
and gl.application_id=222;
select decode(tr.EOP_RATE, 0,0, 1/tr.EOP_RATE) into eop_rate
from gl_translation_rates tr
where tr.set_of_books_id = P_SET_OF_BOOKS_ID
and tr.to_currency_code = C_CURR
and upper(tr.period_name) = upper(P_REVALUATION_PERIOD)
and tr.actual_flag = 'A';
select sum(nvl(app.amount_applied,0) + nvl(app.earned_discount_taken,0) + nvl(app.unearned_discount_taken,0))
into receipt
from ar_receivable_applications app
where app.applied_payment_schedule_id = C_PAY_ID
and app.status = 'APP'
and app.gl_date <= P_END_DATE
and app.application_type='CASH'
and not exists (
select 'reversed'
from ar_cash_receipt_history crh
where app.cash_receipt_id = crh.cash_receipt_id
and crh.status = 'REVERSED'
and crh.gl_date <= P_END_DATE);
select sum(nvl(app.amount_applied,0) + nvl(app.earned_discount_taken,0) + nvl(app.unearned_discount_taken,0))
into receipt
from ar_receivable_applications app
where app.applied_payment_schedule_id = C_PAY_ID
and app.status = 'APP'
and app.gl_date <= P_END_DATE
and app.application_type='CASH'
and exists
( select 'Cleared Receipt'
from ar_cash_receipt_history_all crh
where crh.cash_receipt_id = app.cash_receipt_id
and crh.status = 'CLEARED'
and crh.gl_date <= P_END_DATE
and nvl(crh.reversal_gl_date,P_END_DATE+1) > P_END_DATE) ;
select sum(amount)
into adjust
from ar_adjustments adj
where adj.payment_schedule_id = C_PAY_ID
and adj.gl_date <= P_END_DATE
and adj.status = 'A';
select sum(nvl(app.amount_applied,0))
into cm
from ar_receivable_applications app
where app.gl_date <= P_END_DATE
and app.status ='APP'
and app.application_type = 'CM'
and app.applied_payment_schedule_id = C_PAY_ID ;
select sum(amount)
into adjust
from ar_adjustments adj
where adj.payment_schedule_id = C_PAY_ID
and adj.gl_date > P_REVALUATION_DATE
and adj.status = 'APP';
' ( select ''receipt clear after p_end_date'' ' ||
' from ar_receivable_applications_all app ' ||
' ,ar_cash_receipt_history_all crh ' ||
' where trx.customer_trx_id = app.applied_customer_Trx_id ' ||
' and app.cash_receipt_id = crh.cash_receipt_id' ||
' and crh.status <> ''CLEARED'' ' ||
--(orig st)' and crh.gl_date <= :P_END_DATE' ||
' and crh.gl_date <= :LP_END_DATE' ||
--(orig st) ' and nvl(crh.reversal_gl_date, :P_END_DATE +1 ) > :P_END_DATE ) ) ' ;
select sum(nvl(app.amount_applied,0))
into cm
from ar_receivable_applications app
where app.gl_date <= P_END_DATE
and app.status ='APP'
and app.application_type = 'CM'
and app.payment_schedule_id = C_PAY_ID ;
SELECT displayed_field
INTO l_return_var
FROM ap_lookup_codes
WHERE lookup_type = 'APXINREV_RATE_TYPE'
AND lookup_code = P_RATE_TYPE_LOOKUP;
SELECT user_conversion_type
INTO l_return_var
FROM gl_daily_conversion_types
WHERE conversion_type = p_daily_rate_type;
select meaning
into return_value
from fnd_lookups
where lookup_type = 'YES_NO'
and lookup_code = P_POSTED;
select meaning
into return_value
from fnd_lookups
where lookup_type = 'YES_NO'
and lookup_code = P_CLEARED;