Skip to content

Purchasing and stock

Open .md

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.

  • 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
A purchase order's totals are in thousandths when you read one (12500 is 12.50), and decimal strings in exports and reports.

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:

  1. Needs orderingA sales order needs goods the shop doesn’t have
  2. OrderedOn a purchase order to a vendor
  3. ReceivedArrived at the location
  4. AllocatedSet aside for the sales order
Each line tracks how many are needed, ordered, received and allocated.

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.