What-if checker
Answer yes or no for each question. "Enough" means stock ≥ the quantity the order needs. The matching rule lights up on the right.
The routing logic three ways: the rules with a what-if checker, the same steps as boolean conditions, and every combination in a full truth table.
Each rule in plain IF / THEN form. Rules are checked in order and the first one that matches decides the order. Use the checker to try your own situation.
Answer yes or no for each question. "Enough" means stock ≥ the quantity the order needs. The matching rule lights up on the right.
The routing logic as numbered steps. Each step has one clear condition made of AND / OR.
Checked in order. The first step whose condition is true decides the order. If it is false, go to the next step.
| Step | Route to | Condition (every line must be true) | Flag / note |
|---|---|---|---|
| 0a | Client's HUBinterim mode |
Interim mode is ON
AND Client has a HUB
AND HUB open jobs ≤ daily cap
|
Frame: the HUB's stock (only if > frame qty required for glazing), else the client sends their own frame (FRAME_OOS_CLIENT_FRAME_HUB). Lens: the HUB's stock, else DC's stock, else DC substitutes a lens and sends it to the HUB (LENS_OOS_SUBSTITUTE). DC is never used. |
| 0b | TOGinterim mode, HUB over cap |
Interim mode is ON
AND Client has a HUB
AND HUB open jobs > daily cap
AND The ordered lens is a TOG lens
AND TOG frame stock ≥ frame qty required for glazing
AND TOG open jobs ≤ daily cap
|
Better than waiting for the HUB. TOG makes its lenses on demand. No flag. |
| 0c | Client's HUBinterim mode, queued over cap |
Interim mode is ON
AND Client has a HUB
AND Step 0b did not apply
|
HUB_OVER_CAP: the order queues at the HUB (its open jobs go over the daily cap). Frame and lens as in step 0a. |
| 1 | DC |
DC frame stock ≥ frame qty required for glazing
AND DC open jobs ≤ daily cap
|
A lens never blocks DC. LENS_OOS_SUBSTITUTE if DC lens stock < lens qty required for glazing. |
| 2 | Client's HUBuses the HUB's lens · frame sent by the client, or the HUB's stock if it qualifies |
Client has a HUB
AND HUB open jobs ≤ daily cap
AND HUB lens stock ≥ lens qty required for glazing
|
The frame is never a condition. It comes from the HUB's stock (only if it is > frame qty required for glazing, so at least 1 frame stays), else the client sends their own frame (FRAME_OOS_CLIENT_FRAME_HUB). |
| 3 | TOG |
The ordered lens is a TOG lens
AND TOG frame stock ≥ frame qty required for glazing
AND TOG open jobs ≤ daily cap
|
TOG makes its lenses on demand. No flag. |
| 4 | Client's HUBlens sent from DC · frame sent by the client, or the HUB's stock if it qualifies |
Client has a HUB
AND HUB open jobs ≤ daily cap
|
The HUB has no lens stock ≥ lens qty required for glazing (else step 2 applied) and TOG could not take the order (step 3). The lens ships from DC if DC lens stock ≥ lens qty required for glazing, otherwise DC substitutes a lens and sends it (LENS_OOS_SUBSTITUTE). The frame is sourced as in step 2. |
| 5 | DCthe client sends their own frame |
DC frame stock < frame qty required for glazing
AND (
Client has no HUB
OR HUB open jobs > daily cap
)
|
FRAME_OOS_CLIENT_FRAME, plus LENS_OOS_SUBSTITUTE if DC lens stock < lens qty required for glazing. TOG's frame stock is not counted: if TOG could glaze the order, step 3 would have taken it. |
| 6 | DCoverflow |
None of the steps above applied
|
CAP_OVERFLOW, plus LENS_OOS_SUBSTITUTE if DC lens stock < lens qty required for glazing. The order waits and is re-run next morning. |
Every combination of the ten yes/no factors, with the step that decides it and where the order goes. Factors that cannot matter in a row (for example the HUB's stock when the client has no HUB) show "–", so each situation appears once.
✓ yes · ✗ no · – doesn't matter
Frame and Lens mean enough stock at that portal (stock ≥ the quantity the order needs). Within cap means open jobs ≤ max cap. At the HUB, Frame means stock > the quantity (at least 1 frame stays).