← Main Menu All manuals Operator Guide for this screen IM2

PO Rec Non-Inv — Technical Spec

PO Rec Non-Inv
Technical Spec Ver 1 Updated 2026-10-25 Matches the live screen

1. Files

app/po_rec.py (router /po/rec, mounted in im2.py after po_create), templates/po_rec_list.html, templates/po_rec_detail.html. Screen keys po_rec, po_rec_detail in screen_names (base.html). Action po_rec (admin/level1/level2). Menu card second row under Purchasing in menu.html.

2. Routes

GET /po/rec list · GET /po/rec/{qb_po_id} detail (re-reads the PO live) · POST /po/rec/save (multipart: data JSON + photos).

3. Data

No local copy of POs: QuickBooks PurchaseOrder where TxnDate >= 2025-01-01, POStatus=Open, cached 5 min in memory; inventory item ids cached 1 h. Non-inv = item line whose item is not Type Inventory, or an AccountBased line. Open qty = Qty − Received. Log table po_rec_log (ro DB, created on first save): token PK, PO, PS no, Bill id/doc, lines, status Pending/Created/Failed.

4. Save

Validates (IR+suffix, date, PO still Open, qty 0 < q ≤ open, ≥1 line, no existing Bill with same DocNumber+vendor), logs Pending, POSTs Bill (APAccountRef 588, each line LinkedTxn PurchaseOrder+TxnLineId, price = PO UnitPrice, customer/class copied from PO line, NotBillable, tax NON), marks Created. Photo, best effort after the bill: combined PDF uploaded as Attachable to Bill and PO; a ps_queue job is written with prev_slips preset (vendor folder matched via vendors.json, PS# = IR…) so scripts/ps_worker.py files it to Dropbox.

Phone version (Ver 2, 2026-10-25)

Same tile; phones (screen under 700px) open /po/rec/m automatically. List drops Order Date; detail drops the price column. Zero-price non-inv lines are still received at $1.00 behind the scenes. Add ?d=1 to /po/rec to force the full screen.