AP Invoice — Tech
AP Invoice
apia — tech spec (Ver 2 · 2026-10-26)
- Code:
apia.py,templates/apia.html; menu tile + badge inmenu.html/im2.py; permissionapia_view(admin, level1, level2). - Tables (
ddl/apia.sql):apia(one row per vendor+invoice #; type 1–5, approvals ok/by/at for issues, vc, ap, exec; archive flag),apia_log(approve/unapprove audit). - Settings (Accounting group,
apia_*): thresholds, variance $/%, NPO Ven Cat minimum (Not Implemented), post frequency, AP/Exec/backup approvers (validated against activeapp_users), receipt follow-up days, stage-only. - Approve authority: AP = AP approver or backup; Exec = Exec approver or backup; Ven Cat = category approver (via
slack_roster) or backup; Issues = AP, Exec or backup. - Not yet built: intake from Slack, hourly check, QB posting.
- Ver 2 (2026-10-26):
apia.need_json{issues, ap, exec} written by intake/check from the evaluation flags; the screen shades an approval button amber when it is required and not yet given. Ven Cat is never flagged (NPO Ven Cat minimum not implemented). - Ver 3: Approvals group header underlined across the four approval columns.
- Ver 4 (2026-10-27): "Inv Date" column after Invoice # (MM/DD/YYYY from
extract_json.invoice_date; "—" if missing).
Ver 3 2026-10-27: apia.recv_override/_by/_at; POST /apia/{id}/recv-override (action apia_recv_override, admin only). Intake evaluate_data reads it and skips POI/PON receipt checks. Intake also matches BayWa-style vendor codes by qty + unit price (2%) and aliases PO 2873 -> 2973. PON receipt is also satisfied by full Received on matched PO lines.