Issues to Resolve — Summary
Issues to Resolve — Summary — Technical Spec
app/ro.py. /ro/issues now serves the summary (query_issues_summary() + ro_issues_summary.html); the pre-Ver-3 flat list moved verbatim to /ro/issues/all (same issues_screen() function, renamed, same template).
Routes
| Route | Behaviour |
|---|---|
GET /ro/issues | Summary: one row per order_no with count(*) filter (where status='Open') > 0 in ro_issue, joined to ro_header for job/type/source, plus a held_lines count from ro_detail.line_status='HOLD'. Plus one aggregate row for order_no IS NULL issues, labeled Unattached. |
GET /ro/issues/all | The original flat list, unchanged behaviour, status/issue_type/search filters intact. |
GET /ro/issues/unattached | Flat list (ro_issues.html) filtered to order_no IS NULL. |
GET /ro/issues/{order_no} | Flat list filtered to one RO — what a summary row links to. |
query_issues() gained order_no and unattached filter kwargs; both are mutually exclusive by construction (no caller passes both).
ro_issues.html gained an optional back_url/back_label (renders a tile-nav back link to the summary) and title_suffix (renders next to the "Issues to Resolve" heading, e.g. " — RO 700123" or " — Unattached"); both default to nothing on /ro/issues/all (that page reads exactly as it did before Ver 3).
Summary rows are ordered oldest_issue_at asc. The Unattached aggregate row renders first, highlighted, and links to /ro/issues/unattached. Screen key ro_issues_summary; the banner reads RO Import Issues to Resolve (same title as /ro/issues/all's ro_issues key). [Ver 2, 2026-09-06]
ISSUE_TYPES (the filter chips on the flat list): SKU not in QB, no qty, unmatched job, duplicate line, header only, unmatched NONINV refresh, unlinked QB PO. ISSUE_STATUSES: Open / Resolved / Ignored / All.
Hold clearing (ro.sync_line_hold) [Ver 2, 2026-09-06]
Added 2026-09-05 (Dave: "the hold was not clearing"). Every Resolve/Ignore write goes through apply_issue_action(), which calls sync_line_hold(cur, line_key, operator): when a line has no Open ro_issue left, ro_detail.line_status is set back to NULL and a ro_audit row (action='hold_clear', note "last open issue on the line was closed") is written. Cancelled / Closed Short statuses are deliberately left alone — they are human intent, not issue-driven.
Not built here
The Screen C summary itself is read-only navigation; Resolve/Ignore behaviour lives entirely on the flat-list routes (POST /ro/issues/{issue_id}/action, POST /ro/issues/bulk), gated by _ro_write() (the ro_write action key — admin/level1 by default).
Shared table sort (2026-09-07)
Column sorting is one implementation in templates/base.html (Dave, 2026-09-07: "all screens that have tables like this need sorts on the appropriate columns"). A table opts in with class="sorttable"; every thead th becomes sortable except those with class="nosort"/class="toggle", an empty heading, or a checkbox in the heading. Client-side only, over the rows already rendered. Details: tech/table_sorting.md.