# TODO

## Done
- [x] Fix planning.php — locked MO scheduling & sequence issues — **DONE** (commits `b0b522a`, `ca81b29` — 2026-04-05)
- [x] Fix MO Timeline (mo_gantt.php) — bar start date now uses `date_start_planned` — **DONE** (commit `16b5781` — 2026-04-05)
- [x] Fix DT badge — duplicate badge per MO row on same day — **DONE** (commit `83efc2d` — 2026-04-05)
- [x] Shift-code in downtime tooltip — **DONE** (commit `f662e97` — 2026-04-05)
- [x] Planning Board mobile responsive — **DONE** (commits `bce8e02`, `ad2f75e` — 2026-04-05)
- [x] Planning Grid mobile responsive — sticky Job only, Info scrolls, auto Job width, footer/blank row fix — **DONE** (commit `b5d25ec` — 2026-04-05)
- [x] MO Timeline mobile responsive — gantt visible, sticky Workstation column, section headers sticky, now-line z-index — **DONE** (commits `f2b65ae`–`30c5ada` — 2026-04-05)
- [x] BUG-4: Buffer hardcoded → `getBufferForWorkstationId()` reads `changeover_minutes` from DB; hardcoded = fallback — **DONE** (commit `4b3d43d` — 2026-04-12)
- [x] C/O minutes shown in board MO tooltip — **DONE** (commit `5ae3804` — 2026-04-12)
- [x] `PLANNING_SHIFT_START_DEFAULT` global const — configurable in Setup → General; replaces all hardcoded `6` fallbacks in `planning.php`, `calc_engine.php`, `calc.php`, `admin/planning_setup.php` — **DONE** (commits `25a3bfc`, `2ecc7e4` — 2026-04-13)
- [x] Info Board: Daily Performance hides today before shift_start — **DONE** (commit `8dc7d2c` — 2026-04-12)
- [x] Info Board: DT and Planned week window anchored on `activeDateThru` (yesterday if shift not started) — aligns DT with Daily Performance — **DONE** (commit `b0b4ee2` — 2026-04-13)
- [x] Info Board: Planned hrs queries from today not Monday — **DONE** (commit `25a3bfc` — 2026-04-13)
- [x] `freezePastRows` cron: deletes stale past rows for MOs with `total_made=0` instead of freezing them — fixes frozen artefact race condition — **DONE** (commit `e9f6e98` — 2026-04-13)
- [x] Fix: `require_once workstation_helpers.php` moved to `PlanningTimelineService::__construct()` — **DONE** (commit `114acfd` — 2026-04-12)
- [x] Remove dead `getBufferForWorkstationType()` from helpers and class — **DONE** (commit `648eba1` — 2026-04-12)
- [x] `seed_test_data.php`: replace `strpos($ref,'FM')===0` with `getWorkstationTypeFromRef()` — **DONE** (commit `91511ed` — 2026-04-12)

## Open
- [ ] **DESIGN_baseline_delta → Option B** — `baseline_end_date` per MO extrafield; set once on first Calc, never overwritten; show baseline vs current end in tooltip (see `DESIGN_baseline_delta.md`)
- [ ] **DESIGN_board_ws_groups** — `board.php`, `mo_gantt_data.php`, `PlanningTimelineService` still use hardcoded prefix/LIKE; refactor to use `llx_planning_ws_group` managed groups (see `DESIGN_board_ws_groups.md`)
- [ ] BUG-5: Fallback `?: 'qty_per_hour_form'` in `schedule_save.php` and `planning.php` — should be `null` not `qty_per_hour_form` (see `DESIGN_buffer_changeover.md`)
- [ ] BUG-6: `ws_ref_label()` returns label instead of ref for orphaned WS in `board.php` (see `DESIGN_buffer_changeover.md`)
- [ ] Phase 6 — Material status badges (TIC/DEE/JW) per MO row in planning grid
- [ ] Phase 7 — Board integration with `llx_planning_schedule`
- [ ] Chemi / wet-process workstations — brak `qty_per_hour` (see `TODO_Bug.md`)
- [ ] DEFERRED: Daily Performance S/Q — scrap pending vs confirmed overstates quality (see `BUG_daily_performance_scrap.md`)
- [ ] DEFERRED: Planned remaining KPI — subtract today's actual output from today's planned (see `DESIGN_planned_remaining_kpi.md`)
