Purchase Orders — Create
What it is
The form that raises a new LPO on a supplier. You pick the supplier and the purchasing entity, type the lines, and press Save Draft LPO. It always creates the order as a draft — nothing is sent to the supplier from this screen.
Line items are on the left, the header and the totals on the right.
Who can open it
Any signed-in staff account that is active, subject to the same two gates as the
Purchase Orders list: an active account, and the ops.purchase-orders feature grant
while FEATURE_GRANULAR_RBAC is on. The owner bypasses the grant.
The save itself runs under your own database permissions — it writes to the tables directly from the browser rather than through an API route, so what you may create is exactly what your database permissions allow.
Before you start
Two things about this screen are worth knowing before you use it in anger.
The LPO number is allocated when you save, not before. The box reads "Allocated on save" and cannot be typed into. The number comes from the entity's LPO sequence, the same mechanism that numbers quotes and invoices, so it follows on from your last LPO.
Until 2026-08-23 the box was filled with LPO-<year>-<four random digits> when the page loaded, and
was editable. LPO numbers are unique across the whole system — not per entity, not per year — so a
collision failed the save with a raw database error about purchase_orders_po_number_key, and with
only 9,000 candidates a year that was a matter of when, not whether.
The save is atomic. The header and the lines are written in one database call, so a failure leaves nothing behind — no half-made order, and no consumed number. This screen now goes through the same path as an award from an RFQ comparison and an order raised by the assistant. Previously the header was written first and the lines second, and a failed line write left an empty LPO on the list for you to find and delete.
⚠️ A line with no description is thrown away without telling you. Rows are filtered on the description alone. A row where you filled in quantity and unit cost but left the description empty is dropped silently, and the saved total will be lower than the total this screen showed you.
Every control on the page
← (top left) returns to the Purchase Orders list. Nothing is saved.
Line Items panel:
| Control | What it does |
|---|---|
| + Add Row | Adds an empty line — quantity 1, unit EA, unit cost 0 |
| Description | Free text. A row without one is discarded on save |
| Qty | Number, minimum 0.001 |
| Unit | Free text, defaults to EA |
| Unit Cost | Number, minimum 0 |
| Line Total | Calculated, not editable — quantity times unit cost |
| × | Removes that row. Greyed out when only one row is left — the form always keeps at least one |
LPO Details panel:
| Control | What it does |
|---|---|
| Supplier * | Every supplier you can see, alphabetically, with the TRN in brackets where there is one. Defaults to the first alphabetically — check it before saving. If you have no suppliers at all it reads "No suppliers found. Add a supplier first." and there is nothing to pick |
| Purchasing Entity * | Defaults to the entity in the header switcher, and follows it if you change it there. You may override it here, which creates the order under a different company than the one you are viewing |
| LPO Number | Read-only, showing "Allocated on save". The entity's LPO sequence issues the real number when the order is written |
| Date | Defaults to today |
| Currency | AED, USD or INR only. No other currency can be chosen, and the supplier's own currency is not consulted |
| Delivery / Special Notes | Free text, carried onto the order |
Totals panel:
- Subtotal (N items) — counts every row on screen, including rows that will be discarded for having no description, so this count can be higher than what gets saved.
- LPO Total — the same figure. There is no tax, discount or freight on this screen.
- Save Draft LPO — creates the order and returns you to the list. Reads "Creating Draft..." while it works.
What it writes
Both writes go straight to the database from the browser, in this order:
purchase_orders— one row: supplier, entity, LPO number, date,statusofdraft, currency, the total, and the notes.po_items— one row per line that has a description: description, quantity, unit, unit cost and line total.
There is no activity-log entry and no notification. Nothing is emailed. The order appears on the
list as a draft, and it is the Purchase Orders list's ✉️ Email action that both
sends it and promotes it from draft to issued.
When it goes wrong
"Please fill out all required header fields." Supplier, entity or LPO number is empty.
"Please add at least one valid line item with a description." Every row is missing its description. Remember that rows are judged on the description only.
"Select an entity before saving this LPO." The Purchasing Entity box is empty. Pick one in the header switcher, or on this form.
The saved total is lower than the total shown here. One or more rows had no description and were dropped. Check the order on its detail screen and add the missing lines there.
"No suppliers found." There are no suppliers visible to you. Add one from Suppliers first.
Related screens
- Purchase Orders — the list, and where the order is emailed from.
- Purchase Order — the order once created.
- Edit Purchase Order — changing it afterwards.
- Suppliers — adding a supplier so it appears in the dropdown.