Oracle EBS AR Aging Report Query with Configurable Buckets
This generator writes a receivables aging query for Oracle E-Business Suite R12 with seven buckets you define, by customer account in functional currency, plus an open-item detail query in entered currency. It reads AR_PAYMENT_SCHEDULES_ALL, the table the standard aging reports start from.
Fill in
Query 1: aging by customer account (functional currency)
-- bucket_1: days past due <= 0 (current)
-- bucket_2: 0 < days <= 30 bucket_3: 30 < days <= 60
-- bucket_4: 60 < days <= 90 bucket_5: 90 < days <= 120
-- bucket_6: 120 < days <= 180 bucket_7: days > 180
WITH open_items AS (
SELECT ps.customer_id,
ps.class,
ps.acctd_amount_due_remaining AS amt,
TRUNC(TO_DATE('2026-10-22', 'YYYY-MM-DD')) - TRUNC(ps.due_date) AS days_past_due
FROM ar_payment_schedules_all ps
WHERE ps.org_id = 204
AND ps.status = 'OP'
AND ps.amount_due_remaining <> 0
AND ps.gl_date <= TO_DATE('2026-10-22', 'YYYY-MM-DD')
AND ps.customer_id IS NOT NULL
)
SELECT p.party_name,
ca.account_number,
SUM(o.amt) AS total_due,
SUM(CASE WHEN o.days_past_due <= 0 THEN o.amt ELSE 0 END) AS bucket_1,
SUM(CASE WHEN o.days_past_due > 0 AND o.days_past_due <= 30 THEN o.amt ELSE 0 END) AS bucket_2,
SUM(CASE WHEN o.days_past_due > 30 AND o.days_past_due <= 60 THEN o.amt ELSE 0 END) AS bucket_3,
SUM(CASE WHEN o.days_past_due > 60 AND o.days_past_due <= 90 THEN o.amt ELSE 0 END) AS bucket_4,
SUM(CASE WHEN o.days_past_due > 90 AND o.days_past_due <= 120 THEN o.amt ELSE 0 END) AS bucket_5,
SUM(CASE WHEN o.days_past_due > 120 AND o.days_past_due <= 180 THEN o.amt ELSE 0 END) AS bucket_6,
SUM(CASE WHEN o.days_past_due > 180 THEN o.amt ELSE 0 END) AS bucket_7,
SUM(CASE WHEN o.class = 'PMT' THEN o.amt ELSE 0 END) AS unapplied_receipts
FROM open_items o
JOIN hz_cust_accounts ca
ON ca.cust_account_id = o.customer_id
JOIN hz_parties p
ON p.party_id = ca.party_id
WHERE p.party_name LIKE '%'
GROUP BY p.party_name, ca.account_number
ORDER BY total_due DESC;Query 2: open-item detail in entered currency
SELECT p.party_name,
ca.account_number,
ps.class, -- INV, DM, CM, CB, DEP, GUAR, PMT, BR
ps.trx_number,
t.purchase_order,
ps.trx_date,
ps.due_date,
TRUNC(TO_DATE('2026-10-22', 'YYYY-MM-DD')) - TRUNC(ps.due_date) AS days_past_due,
ps.invoice_currency_code,
ps.amount_due_original,
ps.amount_due_remaining,
ps.exchange_rate,
ps.acctd_amount_due_remaining
FROM ar_payment_schedules_all ps
JOIN hz_cust_accounts ca
ON ca.cust_account_id = ps.customer_id
JOIN hz_parties p
ON p.party_id = ca.party_id
LEFT JOIN ra_customer_trx_all t
ON t.customer_trx_id = ps.customer_trx_id
WHERE ps.org_id = 204
AND ps.status = 'OP'
AND ps.amount_due_remaining <> 0
AND ps.gl_date <= TO_DATE('2026-10-22', 'YYYY-MM-DD')
AND p.party_name LIKE '%'
ORDER BY p.party_name, ps.due_date;This is an open-item aging from current balances. For an as-of date in the past it overstates or understates items that were open then but have since been applied or adjusted: a true historical aging must add back AR_RECEIVABLE_APPLICATIONS_ALL and AR_ADJUSTMENTS_ALL activity dated after the as-of date. Reconcile against the standard Aging - 7 Buckets - By Account Report for the same date.
Get a true as-of aging query
Need historical aging that ties to the standard report for past month-ends? Send your operating units and we scope the rollback query for your instance.
Optional. The tool and every export work without this. No spam.
How to use it
Enter the operating unit ORG_ID, the as-of date and six bucket boundaries. The defaults 0, 30, 60, 90, 120 and 180 give current, 1-30, 31-60, 61-90, 91-120, 121-180 and over 180 days past due, the same layout as the standard 7-bucket report. Restrict to a customer with a LIKE pattern or leave %. Run Query 1 for the summary a controller reviews, and Query 2 when a collector needs the transactions behind a bucket. Both run in SQL Developer as APPS; no multi-org context is needed because the _ALL table is filtered by ORG_ID directly.
- Days past due = as-of date minus due date, both truncated
- Negative days (not yet due) fall in bucket 1
- Functional amounts use ACCTD_AMOUNT_DUE_REMAINING
Where the numbers come from
Every invoice, debit memo, credit memo, chargeback, deposit and receipt has one or more payment schedule rows in AR_PAYMENT_SCHEDULES_ALL, one per installment. STATUS is OP while AMOUNT_DUE_REMAINING is not zero and CL once fully applied. CLASS tells you the document type: INV, DM, CM, CB, DEP, GUAR, PMT and BR. AMOUNT_DUE_REMAINING is in the transaction currency; ACCTD_AMOUNT_DUE_REMAINING is the stored functional amount, which avoids recalculating with EXCHANGE_RATE and handles rounding the way Receivables did. Customer comes from CUSTOMER_ID, which is HZ_CUST_ACCOUNTS.CUST_ACCOUNT_ID, with the name on HZ_PARTIES.
Worked example and reconciliation
An invoice due 15 August 2026 aged as of 22 October 2026 is 68 days past due and lands in bucket 4 (61-90). An open credit memo shows as a negative amount in the bucket of its due date, and an unapplied receipt shows as a negative PMT row in the bucket of its due date and in total_due, and is also broken out in the unapplied_receipts column so you can see how much cash is waiting to be applied. To reconcile, run the Aging - 7 Buckets - By Account Report for the same operating unit and date and compare totals by customer. Differences usually come from as-of dates in the past, on-account credits treated differently in the report options, or receipts in other operating units.
Limits and common mistakes
The query is exact for today and an approximation for a past date, because applications and adjustments posted after that date have already reduced AMOUNT_DUE_REMAINING. For month-end aging, run it on the first day of the next month before cash application, or build the rollback with AR_RECEIVABLE_APPLICATIONS_ALL and AR_ADJUSTMENTS_ALL. Do not join to RA_CUSTOMER_TRX_LINES_ALL in an aging: lines multiply rows and inflate totals. Bill-to site level aging needs CUSTOMER_SITE_USE_ID joined to HZ_CUST_SITE_USES_ALL. Disputed amounts sit in AMOUNT_IN_DISPUTE if you want a separate column.
Frequently Asked Questions
What is the AR aging query in Oracle Apps R12?
Select open rows from AR_PAYMENT_SCHEDULES_ALL (status OP, amount_due_remaining not zero) for the operating unit, compute as-of date minus due date, and sum the remaining amount into buckets with CASE expressions, grouped by customer account from HZ_CUST_ACCOUNTS and HZ_PARTIES. Query 1 above does this with seven configurable buckets.
Which standard report should my query match?
Aging - 7 Buckets - By Account Report in Receivables, run for the same operating unit, as-of date and bucket set. Use the same treatment of on-account credits and receipts as your report parameters. Differences on today's date usually point to filters; differences on past dates point to later applications.
What are the main AR tables in Oracle EBS?
RA_CUSTOMER_TRX_ALL and RA_CUSTOMER_TRX_LINES_ALL for transactions, RA_CUST_TRX_LINE_GL_DIST_ALL for accounting distributions, AR_PAYMENT_SCHEDULES_ALL for balances due, AR_CASH_RECEIPTS_ALL for receipts, AR_RECEIVABLE_APPLICATIONS_ALL for applications, AR_ADJUSTMENTS_ALL for adjustments, and HZ_CUST_ACCOUNTS with HZ_PARTIES for customers.
Why do unapplied receipts show as negative amounts?
A receipt has its own payment schedule row with class PMT, and its unapplied amount is stored as a negative AMOUNT_DUE_REMAINING. It reduces the customer's total due. Query 1 shows it separately so you can tell real overdue balances apart from cash that is simply not applied yet.
If you want collectors to ask which customers moved into the 61-90 bucket this week and get the answer from your own EBS instance on your servers, we can set that up.
Related Tools
Oracle EBS AR Aging Bad Debt Reserve Calculator
Apply loss rates to Oracle Receivables aging buckets to estimate the allowance for doubtful accounts and the reserve percentage.
OracleOracle EBS Customer and Supplier Tables Reference
Searchable list of the Trading Community Architecture customer tables and the supplier tables in Oracle EBS, with keys, join columns and where to confirm in the eTRM.
OracleOracle EBS Finance Tables Reference (GL, AP, AR, FA)
Lookup of the base tables behind General Ledger, Payables, Receivables, Fixed Assets, Subledger Accounting and Purchasing, with the columns you join on.
OracleOracle EBS GL Balances and Code Combination SQL Generator
Generates a trial balance query joining GL_BALANCES, GL_CODE_COMBINATIONS_KFV and GL_LEDGERS, a segment description query, and a PL/SQL CCID lookup.
More Oracle tools
See all- Oracle EBS Inventory Tables Reference
- Oracle EBS WIP Tables Reference
- Oracle EBS Cycle Count Workload Calculator
- Oracle EBS Discrete Manufacturing Go-Live Checklist
- Oracle EBS Inventory Accuracy Readiness Assessment
- Oracle EBS Concurrent Request Phase and Status Reference
- Oracle EBS Responsibility Design Worksheet
- Oracle EBS GL Period Close Checklist
- Oracle EBS AP Invoice Interface Template
Keep exploring
Free tools
- Oracle EBS AR Aging Bad Debt Reserve CalculatorApply loss rates to Oracle Receivables aging buckets to estimate the allowance for doubtful accounts and the reserve percentage.
- Inventory Aging Buckets SQL GeneratorBuild an inventory aging query with your own table and column names and bucket sizes, ready to paste into SQL Server style SQL.
- Oracle EBS Finance Tables Reference (GL, AP, AR, FA)Lookup of the base tables behind General Ledger, Payables, Receivables, Fixed Assets, Subledger Accounting and Purchasing, with the columns you join on.
ERP fixes and how-tos
- Oracle EBS Month-End Close Checklist: GL, AP, ARStep-by-step Oracle EBS month-end close order: finish sub-ledger transactions, close AP and AR periods, transfer to GL, reconcile, then close GL. Menu paths included.
- AutoInvoice import fails with invalid line/header exceptionsFix Oracle EBS Receivables AutoInvoice rejections: read the AutoInvoice Execution Report, query RA_INTERFACE_ERRORS_ALL against RA_INTERFACE_LINES_ALL, and correct the header or line-level setup causing the validation failure.
- Oracle EBS Query for a Vendor Extract ReportSQL for an Oracle EBS R12 supplier extract: AP_SUPPLIERS, AP_SUPPLIER_SITES_ALL, contacts and bank accounts via IBY tables, with joins and security notes.
Runs with your ERP
- Esker Order Management and Oracle E-Business SuiteHow Esker captures customer POs from email, fax and PDF and creates sales orders in Oracle EBS: integration, data flows, setup, pitfalls and a private AI layer.
- Cloud Inventory (DSI) with Oracle E-Business Suite: Mobile Barcode InventoryCloud Inventory, formerly DSI, adds offline mobile barcode inventory to Oracle E-Business Suite and JD Edwards. Data flows, setup steps, pitfalls and AI notes.
AI on your ERP
- AI for Oracle E-Business Suite Procure to Pay, From Requisition to PaymentAdd grounded AI to Oracle E-Business Suite procure to pay: requisitions, POs, receiving and Payables invoices, with on-prem models and read-only access.
- AI for Oracle E-Business Suite, Without Leaving On-PremHosting Oracle EBS 12.2 on-prem or in a private cloud? Add a private LLM over concurrent programs, interface tables and AP/PO data without moving to Fusion.
Integrations
- How to use ChatGPT with Oracle E-Business SuiteUsing ChatGPT with Oracle E-Business Suite: export vs live access, custom GPT actions over ISG REST, enterprise data controls and when to keep data on-prem.
- How to connect Claude to Oracle E-Business SuiteConnect Claude to Oracle E-Business Suite via MCP, the Anthropic API, AWS Bedrock or Vertex, and know when an on-prem open-weight model is the better fit.