# Supplier terms and cash cycle: methodology

Everything below is built with live formulas in the results workbook. The Python script mirrors the same rules to write the memo and the JSON summary.

## Inputs

| Tab | One row per | Used for |
|---|---|---|
| Supplier_Terms | supplier | Deposit %, balance timing, stated lead time, proposed terms |
| SKU_Master | SKU | Supplier, landed cost, units sold in the last 90 days, units on hand, units on open POs |
| PO_History (optional) | PO | Measured lead time per supplier (PO date to date received) |
| Brand_Profile | question | Cost of money, default terms and lead time, days from sale to cash, the cycle they can fund, which asks to rank |
| Assumptions | setting | Size of the standard asks, overstock threshold, PO count needed, lead time flag |

**Balance timing** is counted from the day goods arrive: negative = paid before arrival (e.g. due at shipment with 35 days in transit = -35), positive = paid after (net 30 = 30). A 100% deposit makes balance timing irrelevant.

## Per supplier

1. **Lead time used (weeks)**
   - Median of (date received - PO date) / 7 over received POs, when PO_History has at least *min POs* (default 3) for the supplier
   - otherwise the stated lead time on Supplier_Terms
   - otherwise the typical lead time from the Brand_Profile
   - Flag when measured and stated differ by more than *lead gap* (default 25%) of the stated figure.
2. **Average dollar paid (days after arrival)** = - deposit % x lead time x 7 + (1 - deposit %) x balance days
   - Example: 50% deposit, 17.6-week lead time, balance 35 days before arrival: -0.5 x 123 - 0.5 x 35 = -79 days.
3. **Cost of goods sold per day** = sum over its SKUs of (units sold last 90 days / 90) x landed cost.
4. **Days of inventory** = stock at cost / cost of goods sold per day, over SKUs that are not overstocked.
5. **Cash cycle (days)** = days of inventory + days from sale to cash - average dollar paid (days after arrival).
6. **Cash out before stock arrives ($)** = cost of goods sold per day x (- average dollar paid). In a steady state where you buy at the rate you sell, this is the cash sitting with the supplier, on average, for goods not yet on hand. Negative = the supplier is financing you.
7. **Share of cash out before arrival** = the supplier's positive figure / the sum of all positive figures.
8. **Deposits already paid on open POs** = sum over its SKUs of units on open POs x landed cost x deposit %.
9. **Over the cash cycle you can fund?** = cash cycle > the Brand_Profile limit.

Suppliers on SKU_Master but not on Supplier_Terms, and SKUs with no supplier, use the default terms from the Brand_Profile.

## Per SKU

- Units sold per day = units sold last 90 days / 90; cost of goods per day = that x landed cost
- Days of inventory = units on hand / units sold per day
- **Overstocked** = no sales in 90 days, or days of inventory above the overstock threshold (default 180). Kept in stock and terms totals, left out of days of inventory and the cash cycle.
- Days paid before the unit sells = days of inventory - average dollar paid (supplier's figure)
- Cash cycle = days of inventory + days from sale to cash - average dollar paid

## Asks (Negotiation_Targets)

For each supplier with sales:
- **Your proposed terms**, if any proposed deposit or balance is entered (a blank proposed field keeps today's value)
- **Deposit lower** by the standard step (default 20 points, not below 0%), if the deposit is above 0% and the brand said deposit asks are realistic
- **Balance later** by the standard step (default 30 days), if the deposit is below 100% and the brand said balance asks are realistic
- A standard ask identical to the proposed terms is dropped.

For each ask:
- Days of cash gained = average dollar paid after the change - before (lead time unchanged)
- **Cash freed (one-time)** = cost of goods sold per day x days gained
- **Yearly financing saved** = cash freed x cost of money
- Rank = position by cash freed among asks that free cash

Asks on the same supplier are alternatives: don't add them.

## Brand totals (Summary)

- Days of inventory = stock at cost / cost of goods per day, over SKUs not overstocked
- Average dollar paid = weighted by each supplier's cost of goods per day
- Cash cycle = days of inventory + days from sale to cash - average dollar paid
- Cash out before stock arrives = sum over suppliers (signed)

## What the numbers assume

- Purchases run at the last 90 days' sales rate. Building stock for a season or running it down changes the real cash out.
- Lead time is from PO to sellable stock. Port or invoice dates in PO_History distort it.
- Early-pay discounts, letters of credit, currency and freight payment timing are not modeled.
- No industry benchmarks are used. Compare suppliers with each other.

## Glossary

- **Deposit**: share of the PO paid when it's placed.
- **Balance**: the rest, paid at shipment, on arrival, or on net terms after arrival.
- **Lead time**: PO placed to stock on hand and sellable.
- **Cash cycle**: days from paying the supplier to having the sale's cash in the bank.
- **Days of inventory**: how long today's stock lasts at the current sales rate.
- **Cost of goods sold per day**: landed cost of what you sell in a day; in a steady state, what you buy in a day.
