Documente Academic
Documente Profesional
Documente Cultură
6
06/23/17-14:08:23 :: adapcctl.sh: starting OPMN if it is not running
select distinct
gl_date,REFERENCE,DUE_DATE,DESCRIPTION,Account_name,cust_account_num,Invoice_type,I
nvoice_number,AMOUNT_DUE_ORIGINAL,rec_app_allocated_amt,entered_currency,BALANCE
,unapplied,class
from
(
select
araa.gl_date gl_date,
rcta.CT_reference REFERENCE,
aps.due_date DUE_DATE,
RCTLA.DESCRIPTION DESCRIPTION,
(select c.account_name from APPS.hz_cust_accounts C,APPS.HZ_PARTIES D where 1 = 1
AND D.PARTY_ID = C.PARTY_ID AND C.CUST_ACCOUNT_ID = acra.pay_from_customer )
Account_name,
(select c.account_number from APPS.hz_cust_accounts C,APPS.HZ_PARTIES D where 1 = 1
AND D.PARTY_ID = C.PARTY_ID AND C.CUST_ACCOUNT_ID = acra.pay_from_customer)
cust_account_num,
(select name from RA_CUST_TRX_TYPES_ALL where cust_trx_type_id =
rcta.cust_trx_type_id) Invoice_type,
rcta.trx_number Invoice_number,
aps.AMOUNT_DUE_ORIGINAL AMOUNT_DUE_ORIGINAL,
nvl(araa.amount_applied_from,araa.amount_applied) rec_app_allocated_amt,
rcta.invoice_currency_code entered_currency,
aps.AMOUNT_DUE_REMAINING BALANCE,
( (select sum(rctla1.extended_amount)invv from RA_CUSTOMER_TRX_ALL rcta1,
RA_CUSTOMER_TRX_LINES_ALL rctla1 where rcta1.CUSTOMER_TRX_ID =
rctla1.CUSTOMER_TRX_ID
AND rcta1.CUSTOMER_TRX_ID = rcta.CUSTOMER_TRX_ID)-araa.amount_applied) unapplied,
aps.class
from
AR_CASH_RECEIPTS_ALL acra,
ar_payment_schedules_all aps,
AR_RECEIVABLE_APPLICATIONS_ALL araa,
--- ar_receipt_methods arm,
RA_CUSTOMER_TRX_ALL rcta,
RA_CUSTOMER_TRX_LINES_ALL RCTLA,
RA_BATCH_SOURCES_ALL rbsa
where acra.cash_receipt_id = araa.cash_receipt_id(+)
and rcta.CUSTOMER_TRX_ID = araa.APPLIED_CUSTOMER_TRX_ID
AND RCTLA.CUSTOMER_TRX_ID = RCTA.CUSTOMER_TRX_ID
--- AND arm.receipt_method_id = acra.receipt_method_id
and rcta.BATCH_SOURCE_ID = rbsa.BATCH_SOURCE_ID
and rcta.org_id = '101'
and aps.cash_receipt_id(+) =acra.cash_receipt_id
and aps.payment_schedule_id = araa.payment_schedule_id
order by ACRA.RECEIPT_DATE desc)
where ACCOUNT_name = q'[&1]'
and to_date(gl_date) <= to_date('&2','YYYY/MM/DD HH24:MI:SS')
order by gl_date;