Wednesday 20 July 2022

Query to find AR customer balance in oracle fusion

 SELECT
SUM(psa.amount_due_remaining) trx_balance,
psa.invoice_currency_code trx_currency,
cab.account_number billing_acct_num,
cab.account_name billing_account,
cas.account_number shipping_acct_num,
cas.account_name shipping_account
FROM
ra_customer_trx_all cta,
ar_payment_schedules_all psa,
hz_cust_accounts cab,
hz_cust_accounts cas
WHERE
psa.customer_trx_id = cta.customer_trx_id
AND cta.bill_to_customer_id = cab.cust_account_id
AND cta.ship_to_party_id = cas.party_id
AND cab.account_name = :billing_account_name
GROUP BY
psa.invoice_currency_code,
cab.account_number,
cab.account_name,
cas.account_number,
cas.account_name

No comments:

Post a Comment