---
name: evolution_po_sent_status
description: purchases.sent flag — how PO "sent" state is set (email/print/manual) and that it freezes a PO from requisition appends
metadata:
  node_type: memory
  type: project
  originSessionId: 05110c48-89a3-4204-835d-82abc52714da
---

`purchases.sent` (tinyint 0/1, added 2026-07-08 via `migrations/purchases_sent_flag.sql`, back-fills `sent=1` where `emailed>0`) is the PO's business "sent to supplier" state — **distinct from `purchases.emailed`** (which is only the Unix timestamp of the last email, still set in `print.php`).

Three ways it flips:
- **Email** a PO → auto-set server-side: `print.php` sets `emailed=time()` AND `sent=1` when `sendEmail` present.
- **Print** a PO → NOT auto-set; `purchaseadd.js` printerForm submit hook prompts "Mark this PO as SENT?" and posts to `app/ajax/setPurchaseSent.php`.
- **Manual toggle** → the `send` icon in the PO toolbar (`purchaseadd.inc`, `#poSentToggle`/`#poSentIcon`, green when sent) → `togglePurchaseSent()` → `app/ajax/setPurchaseSent.php` (gated admin || `mod_pur>=1`).

**Why it matters:** a sent PO is frozen — requisitions can no longer be appended. Enforced in `reqSave.php`: `fetchVendorPOs` lists only `status='1' AND sent='0'` POs; `createRequisitionPurchaseOrder` has a server-side backstop that refuses to append if the target PO's `sent=1` (req still created, just not attached). Ties into [[evolution_ajax_save_auth_gate]] and the Direct-to-Purchase requisition flow.
