get_ap_aging โ A/P Aging
Which suppliers we owe and how overdue โ open A/P 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.AP aging report โ which suppliers we owe and how overdue are we. Returns each open
supplier (A/P) invoice with its aging bucket โ current, 1-30, 31-60, or 60+ days
overdue โ plus days overdue, due date, amount, and currency. The payables mirror of
get_ar_aging. Only open invoices appear; a paid invoice is not overdue.
Try these prompts
- “show me the AP aging”
- “what do we owe suppliers?”
- “overdue supplier invoices”
- “AP aging for supplier V001”
- “payables as of 2025-12-31”
ื ืกื ืื ืืขืืจืืช
- “ืื ืื ืื ื ืืืืืื ืืกืคืงืื?”
- “ืืืื ืืฉืืื ืืืช ืกืคืง ืืืืืืจ?”
- “ืืฆื ืืช ืืืื ืืืืืช ืืกืคืงืื”
Arguments
| Arg | Required | Meaning |
|---|---|---|
card_code | optional | One supplier, e.g. V001. Omit for all suppliers. |
as_of_date | optional | YYYY-MM-DD โ compute aging as of this date (e.g. period-end). Omit for today. |
Example result
Two supplier invoices over 60 days. V001 Global Supply โ $3,400, 60+ days overdue. V002 Metro Parts โ $920, 31-60 days overdue.
Result columns
| Column | Type | Meaning |
|---|---|---|
card_code | text | The supplier’s SAP code. |
card_name | text | The supplier’s name. |
doc_num | number | The A/P 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
get_ar_agingโ the receivables (customer) side.list_ap_invoicesโ a plain list of supplier invoices (not aged).get_cash_flow_forecastโ expected incoming collections by week.