The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT SUM(DECODE(prof_amt.overall_credit_limit, NULL, NULL,
gl_currency_api.convert_amount_sql(prof_amt.currency_code,g_base_currency_code,
sysdate, cm_opt.default_exchange_rate_type, prof_amt.overall_credit_limit)))
INTO l_credit_limit
FROM hz_customer_profiles prof, hz_cust_profile_amts prof_amt,
ar_cmgt_setup_options cm_opt
WHERE prof.party_id = p_party_id
AND prof.site_use_id IS NULL
AND prof.status = 'A'
AND prof.cust_account_profile_id = prof_amt.cust_account_profile_id
AND prof_amt.cust_account_id = prof.cust_account_id
AND prof.cust_account_id = -1
AND prof_amt.site_use_id IS NULL;
SELECT SUM(DECODE(prof_amt.overall_credit_limit, NULL, NULL,
gl_currency_api.convert_amount_sql(prof_amt.currency_code, g_base_currency_code,
sysdate, cm_opt.default_exchange_rate_type, prof_amt.overall_credit_limit)))
INTO l_credit_limit
FROM hz_customer_profiles prof, hz_cust_profile_amts prof_amt,
ar_cmgt_setup_options cm_opt
WHERE prof.cust_account_id = p_cust_account_id
AND prof.site_use_id IS NULL
AND prof.status = 'A'
AND prof.cust_account_profile_id = prof_amt.cust_account_profile_id
AND prof_amt.cust_account_id = p_cust_account_id
AND prof_amt.site_use_id IS NULL;
SELECT SUM(DECODE(prof_amt.overall_credit_limit, NULL, NULL,
gl_currency_api.convert_amount_sql(prof_amt.currency_code, g_base_currency_code,
sysdate, cm_opt.default_exchange_rate_type, prof_amt.overall_credit_limit)))
INTO l_credit_limit
FROM hz_customer_profiles prof, hz_cust_profile_amts prof_amt,
ar_cmgt_setup_options cm_opt
WHERE prof.site_use_id = p_customer_site_use_id
AND prof.status = 'A'
AND prof.cust_account_profile_id = prof_amt.cust_account_profile_id
AND prof_amt.site_use_id = p_customer_site_use_id;
SELECT sum
(
(
IEX_COLL_IND.GET_APPS_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) -
IEX_COLL_IND.GET_ADJ_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) +
nvl(ps.acctd_amount_due_remaining, 0)
) *
(ps.due_date - ps.trx_date)
) /
sum (
IEX_COLL_IND.GET_APPS_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) -
IEX_COLL_IND.GET_ADJ_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) +
nvl(ps.acctd_amount_due_remaining, 0)
)
INTO l_wtd_days_terms
FROM ar_payment_schedules ps, hz_cust_accounts ca
WHERE ps.gl_date between TRUNC(add_months(sysdate, -12)) and TRUNC(sysdate)
AND ps.class in ('INV','DEP','DM','CB')
AND ps.payment_schedule_id <> -1
AND ps.customer_id = ca.cust_account_id
AND ca.party_id = p_party_id;
SELECT sum
(
(
IEX_COLL_IND.GET_APPS_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) -
IEX_COLL_IND.GET_ADJ_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) +
nvl(ps.acctd_amount_due_remaining, 0)
) *
(ps.due_date - ps.trx_date)
) /
sum (
IEX_COLL_IND.GET_APPS_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) -
IEX_COLL_IND.GET_ADJ_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) +
nvl(ps.acctd_amount_due_remaining, 0)
)
INTO l_wtd_days_terms
FROM ar_payment_schedules ps
WHERE ps.gl_date between TRUNC(add_months(sysdate, -12)) and TRUNC(sysdate)
AND ps.class in ('INV','DEP','DM','CB')
AND ps.payment_schedule_id <> -1
AND ps.customer_id = p_cust_account_id;
SELECT sum
(
(
IEX_COLL_IND.GET_APPS_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) -
IEX_COLL_IND.GET_ADJ_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) +
nvl(ps.acctd_amount_due_remaining, 0)
) *
(ps.due_date - ps.trx_date)
) /
sum (
IEX_COLL_IND.GET_APPS_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) -
IEX_COLL_IND.GET_ADJ_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) +
nvl(ps.acctd_amount_due_remaining, 0)
)
INTO l_wtd_days_terms
FROM ar_payment_schedules ps
WHERE ps.gl_date between TRUNC(add_months(sysdate, -12)) and TRUNC(sysdate)
AND ps.class in ('INV','DEP','DM','CB')
AND ps.payment_schedule_id <> -1
AND ps.customer_site_use_id = p_customer_site_use_id;
SELECT sum
(
(
IEX_COLL_IND.GET_APPS_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) -
IEX_COLL_IND.GET_ADJ_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) +
nvl(ps.acctd_amount_due_remaining, 0)
) *
(TRUNC(sysdate) - ps.due_date)
) /
sum (
IEX_COLL_IND.GET_APPS_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) -
IEX_COLL_IND.GET_ADJ_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) +
nvl(ps.acctd_amount_due_remaining, 0)
)
INTO l_wtd_days_late
FROM ar_payment_schedules ps, hz_cust_accounts ca
WHERE ps.gl_date between TRUNC(add_months(sysdate, -12)) and TRUNC(sysdate)
AND ps.class in ('INV','DEP','DM','CB')
AND ps.status = 'OP'
AND ps.payment_schedule_id <> -1
AND ps.customer_id = ca.cust_account_id
AND ca.party_id = p_party_id;
SELECT sum
(
(
IEX_COLL_IND.GET_APPS_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) -
IEX_COLL_IND.GET_ADJ_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) +
nvl(ps.acctd_amount_due_remaining, 0)
) *
(TRUNC(sysdate) - ps.due_date)
) /
sum (
IEX_COLL_IND.GET_APPS_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) -
IEX_COLL_IND.GET_ADJ_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) +
nvl(ps.acctd_amount_due_remaining, 0)
)
INTO l_wtd_days_late
FROM ar_payment_schedules ps
WHERE ps.gl_date between TRUNC(add_months(sysdate, -12)) and TRUNC(sysdate)
AND ps.class in ('INV','DEP','DM','CB')
AND ps.status = 'OP'
AND ps.payment_schedule_id <> -1
AND ps.customer_id = p_cust_account_id;
SELECT sum
(
(
IEX_COLL_IND.GET_APPS_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) -
IEX_COLL_IND.GET_ADJ_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) +
nvl(ps.acctd_amount_due_remaining, 0)
) *
(TRUNC(sysdate) - ps.due_date)
) /
sum (
IEX_COLL_IND.GET_APPS_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) -
IEX_COLL_IND.GET_ADJ_TOTAL(ps.payment_schedule_id, TRUNC(sysdate)) +
nvl(ps.acctd_amount_due_remaining, 0)
)
INTO l_wtd_days_late
FROM ar_payment_schedules ps
WHERE ps.gl_date between TRUNC(add_months(sysdate, -12)) and TRUNC(sysdate)
AND ps.class in ('INV','DEP','DM','CB')
AND ps.status = 'OP'
AND ps.payment_schedule_id <> -1
AND ps.customer_site_use_id = p_customer_site_use_id;
SELECT SUM(arpcurr.functional_amount(
ps.amount_due_original,
g_base_currency_code,
nvl(ps.exchange_rate,1),
g_base_precision,
g_base_min_acc_unit) +
IEX_COLL_IND.GET_ADJ_FOR_TOT_REC(ps.payment_schedule_id,p_end_date))
INTO l_tot_rec
FROM ar_payment_schedules ps,
hz_cust_accounts ca
WHERE ps.class in ('INV', 'DM', 'CB', 'DEP' )
AND ps.payment_schedule_id <> -1
AND ps.gl_date BETWEEN l_temp_start AND p_end_date
AND ps.customer_id = ca.cust_account_id
AND ca.party_id = p_party_id;
SELECT SUM(arpcurr.functional_amount(
ps.amount_due_original,
g_base_currency_code,
nvl(ps.exchange_rate,1),
g_base_precision,
g_base_min_acc_unit) +
IEX_COLL_IND.GET_ADJ_FOR_TOT_REC(ps.payment_schedule_id,p_end_date))
INTO l_tot_rec
FROM ar_payment_schedules ps
WHERE ps.class in ('INV', 'DM', 'CB', 'DEP' )
AND ps.payment_schedule_id <> -1
AND ps.gl_date BETWEEN l_temp_start AND p_end_date
AND ps.customer_id = p_cust_account_id;
SELECT SUM(arpcurr.functional_amount(
ps.amount_due_original,
g_base_currency_code,
nvl(ps.exchange_rate,1),
g_base_precision,
g_base_min_acc_unit) +
IEX_COLL_IND.GET_ADJ_FOR_TOT_REC(ps.payment_schedule_id,p_end_date))
INTO l_tot_rec
FROM ar_payment_schedules ps
WHERE ps.class in ('INV', 'DM', 'CB', 'DEP' )
AND ps.payment_schedule_id <> -1
AND ps.gl_date BETWEEN l_temp_start AND p_end_date
AND ps.customer_site_use_id = p_customer_site_use_id;
select gll.currency_code, c.precision, c.minimum_accountable_unit
INTO g_base_currency_code,g_base_precision,g_base_min_acc_unit
from ar_system_parameters sp,
gl_ledgers_public_v gll,
fnd_currencies c
where
gll.ledger_id = sp.set_of_books_id
and gll.currency_code = c.currency_code;
iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.main selection - Exception = ' ||SQLERRM);