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

ArgRequiredMeaning
card_codeoptionalOne supplier, e.g. V001. Omit for all suppliers.
as_of_dateoptionalYYYY-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

ColumnTypeMeaning
card_codetextThe supplier’s SAP code.
card_nametextThe supplier’s name.
doc_numnumberThe A/P invoice’s document number.
doc_datedateWhen the invoice was posted.
due_datedateWhen payment falls due (empty when the invoice carries none).
overdue_daysnumberDays past due at the as-of date; negative while still current.
buckettextThe aging band this invoice falls in: current, 1-30, 31-60, or 60+.
doc_totalnumberThe amount still owed on the invoice.
currencytextThe 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”
  • 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.