AR Invoices with Outstanding balance.
select rctt.name Invoice_type,
gcc.concatenated_segments accounting_string,
rcgl.gl_date,
aps.amount_due_remaining,
rct.trx_number,
gcc.segment1 bu_company,
NULL description,
rct.trx_date,
aps.due_date,
rct.bill_to_customer_id,
hca.account_number,
hcsu.location site_location
--hcsu.site_use_id
--hcsu.orig_system_reference
FROM RA_CUSTOMER_TRX_ALL rct,
ar_receivable_applications_all ara,
ar_cash_receipts_all acr,
ar_payment_schedules_All aps,
ra_customer_trx_lines_all rctl,
RA_CUST_TRX_LINE_GL_DIST_ALL rcgl,
ra_Cust_trx_types_All rctt,
gl_code_combinations_kfv gcc,
hz_cust_accounts hca,
hz_cust_site_uses_all hcsu
where ara.applied_customer_trx_id = rct.customer_trx_id
and ara.cash_receipt_id = acr.cash_receipt_id
and aps.customer_trx_id = rct.customer_Trx_id
and rctl.customer_Trx_id = rct.customer_trx_id
and rcgl.customer_trx_line_id = rctl.customer_Trx_line_id
and rct.cust_trx_type_id = rctt.cust_Trx_type_id
and rcgl.code_combination_id = gcc.code_combination_id
and rct.bill_to_customer_id = hca.cust_account_id
and rct.bill_to_site_use_id = hcsu.site_use_id
and rcgl.account_class = 'REV'
-- and display = 'Y'
--and rct.trx_number ='NTP00602283'
and aps.amount_due_remaining > 0;
No comments:
Post a Comment