> ## Documentation Index
> Fetch the complete documentation index at: https://docs.decodahealth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Inventory Analytics

> What is on the shelf and what it cost, how long it has been sitting there, what your retail products earned, and every stock movement behind those numbers.

<Info>
  **Where to find it:** Go to **Analytics** and pick **Inventory Analytics** from the dashboard menu. The dashboard has four tabs: **Current Stock**, **Inventory Aging**, **Profitability**, and **Stock Ledger**.
</Info>

<Info>
  **Prerequisites:** These reports read from [Inventory](/modules/inventory). You need stock items with received shipments before they have anything to show, and items linked to stock before product profit figures can use your real purchase costs.
</Info>

Inventory Analytics answers four separate questions, one per tab. Pick the tab that matches what you're trying to find out:

| I want to know\...                                            | Use this tab    |
| ------------------------------------------------------------- | --------------- |
| How much stock do we have, and what is it worth?              | Current Stock   |
| What is sitting too long, expiring soon, or needs reordering? | Inventory Aging |
| Which retail products actually make money?                    | Profitability   |
| Why did this item's count change?                             | Stock Ledger    |

## Shared controls

The filters at the top carry across all four tabs, so you can set a location once and keep it while you move between reports.

* **Locations** — one clinic or several. Each row is one item at one clinic, so an item stocked at three clinics gives three rows.
* **Vendors** — narrow to the stock a particular supplier provides.
* **Categories** — picking a parent category automatically includes everything under it.
* **Search** — free-text match on the item name.
* **Date range** — only appears on Profitability and Stock Ledger, the two tabs that cover a period rather than a moment.
* **Stock Type** — retail goods, treatment consumables, or all stock. An item used both ways shows under either.

<Info>
  **Sorting and paging.** Click any column header to sort by it, and click again to flip the direction. Sorting covers every row that matches your filters, not just the page you're looking at — so "highest value first" really does start at the top of the whole list. Empty cells always sort to the bottom, whichever direction you pick. The totals under each table describe everything your filters match, so they don't change as you page through.
</Info>

## Current Stock

A snapshot of what is on the shelf right now, one row per item per clinic.

| Column            | What it means                                                                                                                                                                                                                                                            |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Item**          | The stock item, with a badge for retail or consumable and the most recent lot's SKU. Click through to the item.                                                                                                                                                          |
| **On Hand**       | How many units are left, in that item's own unit — units, syringes, bottles, vials. The **par** figure underneath is the reorder level you set on the item.                                                                                                              |
| **Avg Unit Cost** | What a unit of what's left cost you. This is a weighted average of the lots still on the shelf, not of everything you ever bought, so it moves as older cheap stock runs out. When nothing is left to average, the vendor's list price shows instead, marked **(list)**. |
| **Stock Value**   | On Hand × Avg Unit Cost — the money tied up in this item at this clinic.                                                                                                                                                                                                 |
| **Lots**          | How many separate shipments still have units left.                                                                                                                                                                                                                       |
| **Last Received** | When the newest shipment arrived.                                                                                                                                                                                                                                        |

Two switches change what you see:

* **Show items with nothing on hand** — off by default. Turn it on to see items you stock at this clinic but have run out of. This is the list to check before a vendor order.
* **Only below reorder level** — shows just the items under the par level you set, so you can go straight to what needs ordering.

<Info>
  **Why the value is lower than what you paid.** Stock Value counts only the units still on the shelf, each at the price of the shipment it came from. If you bought 100 units for $100 and 80 have been used, this shows $20, not \$100. That is the number your accountant wants for inventory on hand.
</Info>

## Inventory Aging

The same rows, but focused on risk: stock that is sitting too long, about to expire, or about to run out.

| Column                         | What it means                                                                                                                                                                           |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **0-30 / 31-60 / 61-90 / 90+** | How many of the units still on hand came from shipments received in each window. The **90+** column shows the money value underneath, because that is the figure worth acting on.       |
| **Used (90d)**                 | Net units consumed over the consumption window. Restocked or refunded units are subtracted, so a sale that was refunded the next day does not count as use.                             |
| **Days of Cover**              | How long the stock on hand lasts at the current rate of use. Empty when nothing moved in the window.                                                                                    |
| **On Order**                   | Units already on an open purchase order for this clinic.                                                                                                                                |
| **Suggested Order**            | How much to order: enough to cover your reorder level, or the lead time plus a month of use at the current rate — whichever is higher — minus what you have and what is already coming. |
| **Expiry**                     | A red badge for units already expired, an amber one for units expiring within 30 days, otherwise the earliest expiry date on the shelf.                                                 |

The four cards at the top summarize the risk in money: **Sitting over 90 days**, **Already expired**, **Expiring within 30 days**, and how many items need reordering.

Two controls shape the report:

* **Consumption window** — 30, 60, 90, 180, or 365 days. This drives the **Used** column, **Days of Cover**, and the **Suggested Order** figure. A short window reacts fast to a change in demand; a long one smooths out a quiet month.
* **Only items to reorder** — hides everything with nothing to order.

<Info>
  **Age and expiry are different problems.** A vial received last week can already be expired, and a vial from a year ago can be perfectly good. The age columns tell you what is not selling; the expiry column tells you what you are about to lose. Check both.
</Info>

## Profitability

What your products sold for and what they cost, one row per item per clinic, over the date range you pick.

By default this covers products, medications, and gift cards — the items that carry a cost of goods. Use the **Item Types** filter to add services or packages, or to narrow to one type.

### Choosing a cost basis

The **Cost basis** selector changes how the cost of goods, gross profit, and margin columns are calculated. The three answer different questions and they disagree whenever your purchase prices move — which is the point.

| Cost basis                    | What it uses                                                                       | When to use it                                              |
| ----------------------------- | ---------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| **Actual lot cost**           | What the exact shipments that left the shelf cost you.                             | Closing the books. This is what really happened.            |
| **Latest purchase price**     | The newest shipment's cost per unit, applied to everything sold.                   | Setting prices. This is what the next unit costs you today. |
| **Configured purchase price** | The cost you set on the item, or your vendor's price sheet when the item has none. | Planning and comparing against what you expected to pay.    |

<Info>
  **Watch the coverage note.** Actual lot cost can only see sales where the stock drawdown was recorded. If an item is not linked to stock, or was sold before the link existed, its cost reads as zero and its margin looks like 100%. The dashboard says what share of units it could actually cost — and warns you outright when that share drops below half. When you see that warning, either switch to another cost basis or link the item to its stock in [Inventory](/modules/inventory) so future sales draw down against a lot.
</Info>

The chart shows the ten best-selling items with the profit each one kept, so you can see at a glance where volume and margin disagree — the product that sells most is often not the one that earns most.

## Stock Ledger

Every movement that changed a count, newest first. This is the tab to open when a number on another report looks wrong.

| Column       | What it means                                                                                                                                                                        |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Type**     | What caused the movement — **Received**, **Retail sale**, **Service consumption**, **Manual drawdown**, **Restock**, **Transfer in/out**, **Lost in transit**, **Adjusted up/down**. |
| **Detail**   | The item sold or consumed, the lot number, a link to the invoice when there was one, and any note whoever made the change left.                                                      |
| **In / Out** | Units added or removed.                                                                                                                                                              |
| **Balance**  | What the count stood at after this movement, for this item at this clinic. The top row always matches what Current Stock shows.                                                      |
| **Cost**     | The money effect — positive when a shipment arrives, negative when stock leaves, priced at the lot it came from.                                                                     |

Use the **Transaction Types** filter to isolate one kind of movement — for example, only **Manual drawdown** to review count corrections, or only **Received** to check what arrived this month.

<Info>
  **"Unattributed" in the Location column.** A movement shows as unattributed when it is not tied to a specific shipment, which happens for stock history brought over from another system. Those rows have no clinic and no running balance, because there is no way to tell which shelf they came off. They still appear, so the movement count is honest — and they disappear if you filter to a location.
</Info>

## Tips

<Info>
  **Run Inventory Aging before every vendor order.** Switch on **Only items to reorder**, filter to one vendor, and the **Suggested Order** column is your order sheet — already net of anything on its way.
</Info>

<Info>
  **Check expiry monthly, not quarterly.** The **Expiring within 30 days** card is the window where you can still act — run a promotion, move stock between clinics, or plan around it. Once it is in **Already expired**, it is a write-off.
</Info>

<Info>
  **If Profitability and Current Stock disagree about cost, trust the lots.** Current Stock values what is left; Profitability's actual basis values what was sold. Both read lot costs, so a gap between them usually means some sales were not drawing down stock — check the coverage note on the Profitability tab.
</Info>
