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

ArgRequiredMeaning
card_codeoptionalOne customer, e.g. C001. Omit for all customers.
as_of_dateoptionalYYYY-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

ColumnTypeMeaning
card_codetextThe customer’s SAP code.
card_nametextThe customer’s name.
doc_numnumberThe A/R 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”
  • 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.