POs Created — technical specification
POs Created (app/po_rel.py)
Dave, 2026-09-06: "A report of POs created summary and detail" and "PO Report notification is on screen only" — hence no export, no email, no scheduled send.
GET /po/report— summary frompo_release, filtered oncreated_at::datebetween the range (default: last 30 days), optionalvendor(ilike) andmode(Manual/Auto). RO count iscount(distinct k.order_no)overro_po_linkjoined onqb_po_number = doc_number.GET /po/report/{release_id}/detail— the checkedpo_buy_linerows for that release, plus thero_po_linkrows carrying the same PO number.
Gotchas for whoever changes this
po_buy_linehasvendor_id, notvendor_name. The name lives onpo_release. The detail query filters onvendor_idwhen the release recorded a QB vendor id and falls back to every checked line on the list when it did not.base.htmldefines{% block body %}, notcontent. A template usingcontentrenders the chrome and silently drops the entire page body — it returns 200 and looks fine until you notice the table is missing. This cost a debugging cycle.po_release_list_vendor_uqallows one non-Failed release per vendor per buy list, so test rows must be deleted, not re-inserted.- Blank/inventory "Bought for" is expected, not a bug — inventory POs are never linked to an RO line (see
po_rel.release_manual).
QuickBooks deep links (added 2026-09-06)
im2.qb_po_url(qb_po_id) → https://app.qbo.intuit.com/app/purchaseorder?txnId=<id>, or None. QuickBooks opens a transaction by its internal id, never by the PO number, so a hand-keyed PO holding PENDING:<doc> has no link until the nightly sync matches it. Used by the POs Created list and detail, the RO line's PO Links, and the workbench supply drill-down (renderSupplyTable in base.html, which now receives qb_po_id). The link lands on the transaction if the user is already signed into QuickBooks; otherwise Intuit asks them to sign in and then opens it.
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.