# Replenishment System

The Replenishment System automatically tracks which product categories on your sales floor need restocking by comparing what has been sold against what has been bought. It uses your floor plan layout to visualize urgency as a color-coded heatmap and provides tools for creating tasks, printing offsite pull lists, and configuring thresholds per category.

---

## Overview

The Replenishment module has three pages:

| Page | Purpose | Route |
|------|---------|-------|
| **Replenishment Report** | Visual heatmap and sortable table showing replenishment urgency per zone | `/admin/:typeNum/replenishment` |
| **Offsite Pull Report** | Printable list of backstock bins to pull from offsite storage | `/admin/:typeNum/replenishment/offsite-pull` |
| **Settings** | Configure score thresholds, operational parameters, and category overrides | `/admin/:typeNum/replenishment/settings` |

> **Permissions:** You need `uri_floor_plans` to view reports and `uri_floor_plans_manage` or `workbook_complete_tasks` to create tasks and modify settings.

---

## First-Time Setup

If you have not configured the replenishment system before, a **Setup Wizard** walks you through three steps:

### Step 1: Create a Floor Plan

Design your store layout with racks and zones using the floor plan editor. If you already have a floor plan, this step shows a green checkmark.

- Click `Open Designer` to create your floor plan
- See [Floor Plan Designer](/support/articles/floor-plan-designer) for detailed instructions

### Step 2: Assign Categories to Zones

Link your POS product categories to rack zones so the system knows what sells where on your floor.

- Click `Configure Assignments` to open the Layouts page
- Assign categories to each rack's zones/sockets
- This is required for the heatmap to have data

### Step 3: Configure Rack Capacity (Optional)

Set the number of rack units per rack type to improve score accuracy. The default is 2 units per rack, but you can customize this to reflect how much product each rack actually holds.

- Click `Configure Rack Types` to adjust capacities

> **Tip:** If your POS categories are not showing up, make sure your POS integration is connected and has synced subcategory data. Contact support if categories are missing.

---

## How the Score Works

The replenishment score determines how urgently a category needs restocking:

```
Score = (Items Sold - Items Bought) / Rack Units
```

| Factor | What It Means |
|--------|---------------|
| **Items Sold** | Number of items in this category sold during the window |
| **Items Bought** | Number of items in this category purchased (bought from customers) during the window |
| **Rack Units** | Floor space allocated to this category (from rack type configuration) |

A higher score means more items have left the floor than arrived, indicating a greater need to restock. Negative scores (more bought than sold) display as 0 since those categories are already being replenished naturally.

---

## Replenishment Report

The main report page combines a visual heatmap with a data table. Use the sidebar controls to switch between views and filter data.

### Sidebar Controls

**View Mode:** Toggle between `Heatmap` and `Table` views.

**Date Range:** Set the analysis window using the date inputs. Categories with replenishment tracking history use their last reset date as the starting point.

**Quick Presets:** Click a preset button to quickly set the date range:
- **7 Days** / **Default** / **14 Days** / **30 Days**

Click `Apply Filters` to refresh data with your selected options.

### Summary Statistics

Four stat cards in the sidebar show a quick overview:

| Card | Color | Meaning |
|------|-------|---------|
| **Critical** | Red | Zones needing immediate attention |
| **Urgent** | Orange | Zones that should be restocked soon |
| **Monitor** | Default | Zones beginning to deplete |
| **Adequate** | Green | Zones sufficiently stocked |

### Heatmap View

The heatmap overlays urgency data directly onto your floor plan diagram. Zones are colored on a gradient:

- **Green/No color** -- Adequate stock, no action needed
- **Yellow** -- Monitor level, keep an eye on it
- **Orange** -- Urgent, plan to restock
- **Red/Deep Red** -- Critical, restock immediately

Adequate zones are hidden from the heatmap to keep focus on zones that need action.

Click on any zone to open the **Zone Detail Modal**.

### Zone Detail Modal

Clicking a zone on the heatmap (or a row in the table) opens a detailed popup showing:

- **Replenishment Score** -- The zone's calculated score
- **Items Sold / Items Bought / Rack Units** -- The raw numbers behind the score
- **Urgency Level** -- Color-coded badge (Critical, Urgent, Monitor, Adequate)
- **Categories at this Zone** -- Breakdown table showing each category's individual sold/bought/units/score
- **Recommended Bin** -- The best backstock bin to pull from, including bin name, category, location, and age
- **Last Replenished** -- When this zone was last marked as replenished

From the modal footer:
- Click `Mark Replenished` to reset the tracking for this zone (resets the "last replenished" date)
- Click `Create Replenishment Task` to create a task for team members

### Table View

Switch to Table view for a ranked list of all categories sorted by score (highest urgency first).

**Table Columns:**

| Column | Description |
|--------|-------------|
| **Checkbox** | Select categories for batch task creation |
| **Category** | Category name and POS subcategory code |
| **Sold** | Items sold in the window |
| **Bought** | Items bought in the window |
| **Net Depl.** | Net depletion (sold minus bought) |
| **Rack Units** | Allocated floor space |
| **Score** | Replenishment score (color-coded badge) |
| **Recommended Bin** | Best backstock bin to pull |
| **Location** | Where the recommended bin is stored |
| **Actions** | Create Task or Mark Replenished buttons |

**Filtering Options:**
- **Show All Categories** toggle -- Include categories with adequate scores
- **Onsite Bins Only** toggle -- Filter to categories with onsite backstock
- **Min Score** filter -- Only show categories above a minimum score

**Batch Tasks:** Select multiple categories using checkboxes, then click `Create Tasks` to generate replenishment tasks for all selected items at once.

---

## Offsite Pull Report

When categories need restocking from offsite storage locations, the Offsite Pull Report provides a printable checklist organized by storage location.

### Accessing the Report

Click `Offsite Pull` in the Replenishment Report header bar, or navigate to `/admin/:typeNum/replenishment/offsite-pull`.

### Summary Bar

At the top, four statistics help you plan:

| Stat | Description |
|------|-------------|
| **Total Bins** | Number of offsite bins to pull |
| **Selected** | How many bins are currently selected for printing |
| **Est. Trips** | Estimated trips based on your "bins per trip" setting |
| **Locations** | Number of distinct storage locations involved |

### Location Groups

Bins are grouped by their storage location (e.g., "Storage Unit 111", "Storage Unit 112"). Each group shows:
- Location name and bin count
- A table with columns: Bin Name, Category, Age, and a checkbox for marking bins as "Pulled"

### Sorting and Selection

- **Sort by Location** (default) or **Sort by Category** using the radio buttons
- **Select All** / **Deselect All** using the header buttons
- Use the **location-level checkbox** to select/deselect all bins within a location

### Printing

1. Select the bins you want to include
2. Click `Print Selected`
3. The browser print dialog opens with a print-optimized layout:
   - Header/navigation hidden
   - Print-specific header with store name and date
   - Clean table format with empty checkboxes for manual tracking
   - Print footer with timestamp

> **Tip:** Set the "Bins Per Trip" value in Settings to match how many bins your team can realistically transport per trip. This improves the estimated trips calculation.

---

## Settings

Configure the replenishment system behavior at `/admin/:typeNum/replenishment/settings`.

### Feature Toggle

Use the **Enable Replenishment Tracking** switch to turn the entire feature on or off. When disabled, the report page is inaccessible and no scores are calculated.

### Score Thresholds

Configure the four urgency levels. Categories are colored based on which range their score falls into:

| Threshold | Default | Meaning |
|-----------|---------|---------|
| **Adequate** | 5 | Scores 0 to this value = Green |
| **Monitor** | 10 | Yellow zone |
| **Urgent** | 15 | Orange zone |
| **Critical** | 20 | Scores above this = Deep Red |

A visual preview bar shows your current threshold configuration with color-coded segments.

### Operational Settings

| Setting | Default | Description |
|---------|---------|-------------|
| **Bins Per Trip** | 10 | Used to calculate estimated trips in the offsite pull report |
| **Default Window** | 7 days | Rolling window for categories without replenishment history |

### Category-Specific Overrides

Override the default thresholds for specific categories that have different restocking needs:

1. Click `Add Override`
2. Select a category from the dropdown
3. Set custom Adequate, Monitor, Urgent, and Critical thresholds for that category
4. Click the trash icon to remove an override

This is useful for high-velocity categories that need lower thresholds (triggering alerts sooner) or slow-moving categories that can tolerate higher scores.

### Saving Settings

Click `Save Settings` to apply all changes. Use `Reset All Tracking` in the Quick Actions sidebar to mark all categories as replenished after a major restocking event.

---

## Reset Tracking

Two ways to reset replenishment tracking:

| Method | Scope | When to Use |
|--------|-------|-------------|
| **Mark Replenished** (per zone/category) | Single zone or category | After restocking a specific section |
| **Reset All** (from report header or settings) | All categories in the store | After a major restocking event or inventory reset |

Resetting tracking updates the "last replenished" date, which becomes the new start date for score calculations.

---

## Troubleshooting

### Heatmap shows no zones or "No Category Assignments"
- Categories must be assigned to rack zones in your floor plan layout. Go to `/admin/:typeNum/floor-plan/layouts` to set up assignments.

### All categories show as "Adequate"
- The date window may be too short to capture meaningful sales data. Try extending to 14 or 30 days.
- Check that your POS data is syncing. If no sales are being recorded, scores will remain at 0.

### Setup Wizard keeps appearing
- Complete all required steps: create a floor plan AND assign categories to zones. Both are required.
- The optional Step 3 (rack capacity) does not need to be completed.

### Offsite Pull Report is empty
- If all bins needing replenishment are onsite, the offsite report will show "No Offsite Bins Needed."
- Check that your backstock bins have correct location assignments (onsite vs. offsite) in the Backstock module.

### Score seems wrong for a specific category
- Verify the "Rack Units" value for the rack type is correct. An incorrect rack unit count will skew the score.
- Check if a category-specific threshold override exists in Settings that might be changing the urgency level.

---

## Related Articles

- [Floor Plan Designer](/support/articles/floor-plan-designer)
- [Floor Plan Reports](/support/articles/floor-plan-reports)
