get_ar_aging โ A/R Aging
Which customers owe money and how overdue โ open A/R invoices bucketed current / 1-30 / 31-60 / 60+ days.
This is a Named SQL Query (SAP
/SQLQueries) โ dynamic
aggregate SQL returning per-query rows, not a fixed Service Layer entity.AR aging report โ which customers owe money and how overdue are they. Returns each
open customer (A/R) invoice with its aging bucket โ current, 1-30, 31-60, or 60+
days overdue โ plus days overdue, due date, amount, and currency. Only open invoices
appear; a paid/closed invoice is not overdue.
Try these prompts
- “show me the AR aging”
- “who owes us money?”
- “which customers are more than 60 days overdue?”
- “AR aging for customer C001”
- “overdue receivables as of 2025-12-31”
ื ืกื ืื ืืขืืจืืช
- “ืืจืื ืื ืืช ืืืืืช ืืืงืืืืช”
- “ืื ืืืื ืื ื ืืกืฃ?”
- “ืืืื ืืงืืืืช ืืืืืืจ ืฉื ืืืชืจ ื-60 ืืื?”
- “ืื ืืฆื ืืืืืื ืืืืงืืืืช?”
- “ืืืื ืืืืืช ืคืชืืืื ืืฉ ื ืืื ืืกืืฃ ืืฉื ื?”
Arguments
| Arg | Required | Meaning |
|---|---|---|
card_code | optional | One customer, e.g. C001. Omit for all customers. |
as_of_date | optional | YYYY-MM-DD โ compute aging as of this date (e.g. period-end). Omit for today. |
Example result
Two accounts receivable over 60 days. C002 Beta Industries โ $1,250, 60+ days overdue. C001 Acme Corp โ $1,800, 60+ days overdue.
Result columns
| Column | Type | Meaning |
|---|---|---|
card_code | text | The customer’s SAP code. |
card_name | text | The customer’s name. |
doc_num | number | The A/R invoice’s document number. |
doc_date | date | When the invoice was posted. |
due_date | date | When payment falls due (empty when the invoice carries none). |
overdue_days | number | Days past due at the as-of date; negative while still current. |
bucket | text | The aging band this invoice falls in: current, 1-30, 31-60, or 60+. |
doc_total | number | The amount still owed on the invoice. |
currency | text | The invoice’s currency code (empty when unset). |
Charts
- bar: x=doc_num, y=doc_total, title=“Open value by document”
- bar: x=doc_num, y=overdue_days, title=“Days overdue by document”
Related
list_ar_invoicesโ a plain list of invoices (not aged).get_ap_agingโ the supplier (accounts payable) side.get_credit_exposureโ total exposure per customer vs their limit.