The following lines contain the word 'select', 'insert', 'update' or 'delete':
l_select_flag VARCHAR2(1);
SELECT customer_id, customer_site_use_id
INTO l_customer_id, l_site_use_id
FROM ar_payment_schedules
WHERE payment_schedule_id = p_ps_id;
SELECT NVL(discount_grace_days, 0)
INTO l_grace_days
FROM hz_customer_profiles
WHERE cust_account_id = l_customer_id
AND site_use_id = l_site_use_id;
arp_util.debug('get_discount: ' || 'EXCEPTION: Error selecting discount_grace_days from site level customer profile ');
SELECT NVL(discount_grace_days, 0)
INTO l_grace_days
FROM hz_customer_profiles
WHERE cust_account_id = l_customer_id
AND site_use_id IS NULL;
l_select_flag := 'N' ; -- set to 'N' if select_flag is FALSE
l_select_flag,
l_mode,
l_error_code,
l_cash_receipt_id,
p_called_from, /*Bug 5223829*/
l_amt_in_dispute /*Bug 5223829*/
);
SELECT customer_id, customer_site_use_id
INTO l_customer_id, l_site_use_id
FROM ar_payment_schedules
WHERE payment_schedule_id = p_ps_id;
SELECT NVL(discount_grace_days, 0)
INTO l_grace_days
FROM hz_customer_profiles
WHERE cust_account_id = l_customer_id
AND site_use_id = l_site_use_id;
SELECT NVL(discount_grace_days, 0)
INTO l_grace_days
FROM hz_customer_profiles
WHERE cust_account_id = l_customer_id;
SELECT discount_date
INTO l_discount_date
FROM ar_trx_discounts_v
WHERE payment_schedule_id = p_ps_id;
select ps.customer_id,
ps.customer_site_use_id,
ps.term_id,
ps.terms_sequence_number,
ps.trx_date,
ps.amount_due_original,
ps.amount_due_remaining,
ps.invoice_currency_code,
ps.discount_taken_unearned,
ps.discount_taken_earned,
ps.exchange_rate,
ctt.allow_overapplication_flag,
tr.partial_discount_flag ,
tr.calc_discount_on_lines_flag,
ps.amount_line_items_original
into
l_customer_id,
l_bill_to_site_use_id,
l_term_id,
l_installment,
l_trx_date,
l_amount_due_original,
l_amount_due_remaining,
l_trx_currency_code,
l_discount_taken_unearned,
l_discount_taken_earned,
l_trx_exchange_rate,
l_allow_overappln_flag,
l_partial_discount_flag,
l_calc_disc_on_line,
l_amount_line_items_original
from ar_payment_schedules ps,
ra_cust_trx_types ctt,
ra_terms tr
where ps.payment_schedule_id = l_applied_payment_schedule_id
AND tr.term_id = ps.term_id
AND ps.cust_trx_type_id = ctt.cust_trx_type_id;