# Rule: Aged Receivables & Payables (collections / what's owed)

- **Receivables** = what customers owe you = debit balances on **Client** accounts (class 411). **Payables** = what you owe suppliers = credit balances on **Supplier** accounts (class 401).
- Use the **`aged_receivables`** and **`aged_payables`** tools. They do **FIFO open-item aging**: payments are applied to the oldest invoices first, and whatever is still open is bucketed by age — **0-30 / 31-60 / 61-90 / 90+ days** — from the as-of date.
- **as_of** defaults to the latest transaction date in the books (so aging is meaningful, not "everything is 90+ years old").
- Buckets are in **LBP**; each debtor/creditor also shows its **net USD** balance.

## DSO (Days Sales Outstanding)
- DSO = Receivables ÷ sales-per-day = how many days, on average, it takes to get paid. Lower is better; a **rising DSO over consecutive periods is an early cash-flow warning**.
- `aged_receivables` returns `dso_days` computed over the sales window up to as_of.

## What to flag to the owner
- **90+ bucket** = likely bad/at-risk debt → chase or provision.
- **AP > AR** = trade working-capital squeeze.
- **Concentration**: one customer = large share of AR (collection risk) or one supplier = large share of AP (dependency/negotiation leverage).
- Note: FIFO "open" total can differ slightly from the net account balance when a party has prepayments/advances (carried, not aged).
