Purchasing and stock
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /how-yoprint-works/purchasing-and-stock.md. Index of every page and the rules for every call: /llms.txt. Guides and concepts in one file: /llms-full.txt. OpenAPI: /openapi.json.
A shop buys the blanks it prints on, such as tees and hats, from vendors with purchase orders, and keeps stock at its locations. In the web app this is Stock Control: Purchase Order, Needs Ordering, Inventory, stock takes, adjustments and transfers, and Vendors.
What a purchase order holds
Section titled “What a purchase order holds”- Vendor, a supplier the shop buys from, with its contacts
- Purchase order, with a status, an issue date and a due date
- Delivers to one of the shop’s locations (a warehouse in the API)
- Lines: your products, supplier catalog products, custom items or fees
- Receipts: what has arrived, line by line
- Linked sales orders: the orders it buys for
- Purchase order, with a status, an issue date and a due date
From an order’s needs to stock
Section titled “From an order’s needs to stock”When a sales order needs goods the shop doesn’t have, its lines show up in Needs Ordering. Each needed item then moves through four stages:
- Needs orderingA sales order needs goods the shop doesn’t have
- OrderedOn a purchase order to a vendor
- ReceivedArrived at the location
- AllocatedSet aside for the sales order
Goods can arrive in several deliveries. Each delivery is a receipt, and once every line (fees aside) has fully arrived, the purchase order moves to its end status, “Completed”, by itself. Every status change fires purchase_order.status_changed.
The purchase order statuses a new team starts with: Pending, then Awaiting approval, PO confirmed, Awaiting fulfillment and Partially fulfilled, then Completed.
Stock is kept per product, and per location (warehouse):
| Number | What it counts |
|---|---|
stock_on_hand |
What’s on the shelf, counted from every recorded movement |
stock_incoming |
What’s on open purchase orders and hasn’t arrived yet |
qty_need_ordering |
What sales orders need that hasn’t been ordered |
Stock changes only through recorded movements: a received delivery, a stock adjustment at one location, a stock transfer between locations, or a defect. A stock take is a count of the shelf that ends as an adjustment. Publishing a sales order holds stock for its lines, and lowering a quantity or deleting a line releases it.
