Skip to content

Scenario A vs Scenario B

Classification rule

For each SKU across eligible warehouses:

MetricCalculation
Requiredfloor(sales velocity × DID ÷ pack size) per warehouse
Deficitmax(0, required − current stock packs)
Surplusmax(0, current stock packs − required)

Then:

  • Scenario A — total surplus ≥ total deficit → every deficit can be fully covered.
  • Scenario B — total surplus < total deficit → proportional rationing (default mode).

The run summary shows counts: A, B, and skip (balanced — no action).

Scenario A — full coverage

Supply order:

  1. Central warehouse (if set) — always first.
  2. Other warehouses — by configured priority, then surplus descending.

Matching allocates to highest deficit first until each deficit warehouse is filled.

Example: Deficit = 227 packs, Surplus = 2,239 packs → one transfer from Central Warehouse to IPD Block B covers the short branch completely.

Scenario B — proportional rationing

When the system cannot cover all deficits:

adjusted_deficit = floor(original_deficit × total_surplus ÷ total_deficit)

Each deficit warehouse gets a proportional slice of available surplus. Supply still follows priority order, but total moved may be far below total need.

Example: Deficit = 618 packs, Surplus = 45 packs → ~7% coverage. IPD Block B might receive 28 units instead of 390.

The run summary still creates transfers for what can move — pharmacists see the gap clearly at validation.

Pack rounding

StepRoundingRationale
Required packsFloorConservative — sub-pack demand accumulates
Stock packsCeilPartial packs still count as available
Transfer unitsExact multiplyOutput in units for STR creation