---
title: Attach a purchase order
order: 15
updated: 2026-07-12
---

# Attach a purchase order

When the customer confirms the deal by sending their **purchase order** (PO), you record it against the enquiry. Recording the PO moves the enquiry to *PoArrived* and unlocks *Convert to Sales Order* — the step that formalises the enquiry into a trackable order for dispatch and delivery. This page covers the *Attach PO* / *Edit PO* modal in full: every field, the file rules, exactly when the entry appears, how the PO card and document viewer behave, and everything the server re-checks behind the scenes.

> This is the **customer's** PO — the document *your* customer sends *you* to confirm an order. It is a different thing from the supplier-facing *Purchase Order* your firm issues to a vendor from Procurement (that one has its own numbering, template, and send flow). If you meant issuing a PO to a supplier, see [Create a purchase order](/docs/procurement/create-purchase-order) instead.

## Open the Attach / Edit PO modal

1. Open the enquiry from the *Enquiry Bank* (*View* in the row's Actions column).
2. Click the actions button (top-right, three-dots) and open the *Documents & Charges* group.
3. Choose the PO entry. Its label depends on whether a PO is already on record:
   - *Attach PO* (*Attach PO document*) — no PO recorded yet.
   - *Edit PO* (*Update PO details*) — a PO is already attached.

The entry only appears when **both** of these hold:

- You have the *Edit* enquiry permission, and
- the enquiry either already has a PO (*PoArrived*) **or** its status is exactly *Submitted* (a quotation has been sent).

So on a *Pending* enquiry — one whose quotation has never gone out — there is no *Attach PO* entry at all. Send the quotation first (see [Generate a quotation](/docs/enquiry-bank/generate-quotation)). The same rule is enforced independently on the server, so the entry being hidden is not the only line of defence.

The detail can also open in a stacked read-only modal from other screens (for example a linked enquiry opened from an order). In that embedded view the actions menu is hidden, so attach/edit PO is only reachable from the full enquiry page opened out of the *Enquiry Bank*.

## The Attach / Edit PO modal

The modal is titled *Attach Purchase Order* the first time and *Edit Purchase Order* afterwards. It has three inputs — *PO Number*, *PO Date*, and *PO Documents* — and behaves identically in the web app and the desktop app.

### PO Number

The customer's own PO reference, exactly as printed on their document (for example `PO-2024-001`, the placeholder shown in the field).

- **Required.** The field is marked required and saving is blocked until it is filled.
- Leading/trailing spaces are trimmed before saving, so `  PO-1  ` is stored as `PO-1`.
- The server independently rejects an empty PO number (`PO Number is required`), so a blank value can never slip through a forged request.
- There is no format or uniqueness rule — two enquiries may legitimately carry the same customer PO number, and the app does not deduplicate them.

### PO Date

The date printed on the customer's PO document (not the date you are recording it).

- **Required.** Pick it with the date field or the calendar popover; the calendar has a year picker for jumping back quickly.
- Stored as a timestamp. The server re-validates that it resolves to a valid positive timestamp (`PO Date must be a valid timestamp`) and refuses anything that does not.
- On the enquiry's *Purchase Order* card the date is shown in `dd Mon yyyy` form (for example `24 Apr 2026`).

### PO Documents

At least one document must be attached — this is **not** optional.

- The counter beside the *PO Documents* label shows how many files are currently staged (existing + new), and the label carries a `(min. 1 required)` hint.
- **Add files** by dragging them onto the drop zone or clicking it to browse. Multiple files at once are fine.
- **Size limit:** `50 MB` per file. A larger file is skipped with a toast (`Max size per file is 50 MB…`); the same `50 MB` ceiling is enforced again by the upload middleware on the server, which returns *File too large* if anything exceeds it.
- **Accepted types:** the drop zone hints *PDF, images, Word*. In practice the server does not restrict the file type — any file within the size limit is accepted — but PDFs, scans/photos, and Word documents are what this field is meant for.
- **Duplicate names** are blocked while staging: a file whose name already matches a staged or already-attached file is rejected with an *Already added* warning. (This is a name check only — a genuinely different file must be renamed if it happens to share a filename.)
- Remove any staged file with the *×* button on its row.

When you are **editing** an existing PO, the modal first loads the files already on record and lists them under *Already attached*; anything you add appears under *New files*. Removing an *Already attached* row drops that file from the PO on save. The server verifies that every "keep this file" id you send genuinely belongs to *this* enquiry's PO, so a forged id for someone else's file is rejected (`Document ID not found in this enquiry's PO`). It likewise checks that each newly uploaded file finished uploading (status `READY`) before accepting it.

Because at least one document is always required, you cannot save a PO down to zero files: if removing existing files would leave none and you add none, saving is blocked (*Attach at least one PO document.* on the client, and `At least one PO document must be attached.` on the server).

### Saving

The submit button reads *Attach PO* on a first attach and *Save Changes* when editing. While the upload runs, a progress overlay (*Uploading PO Documents…*) shows the percentage. On success you get *PO attached successfully.* or *PO updated successfully.* and the enquiry page refreshes.

Everything is sent in one request to the same endpoint whether you are attaching or editing. The server re-runs the full rule set (see below) on every save.

## What the server enforces

The UI hides and disables things, but the API assumes every request could be forged and re-checks all of it:

- **Permission.** You must hold the *Edit* enquiry permission, or the request is refused with a 403 (`You are not allowed to update this enquiry.`).
- **Status gate.** A **first** attach is allowed only when the enquiry status is exactly *Submitted* — i.e. the quotation has actually been sent. Once a PO exists, later edits are allowed only while the status is *PoArrived*. Any other status (*Pending*, *Regret*, *Lost*) is rejected (`Cannot attach PO: quotation must be sent first.` or `Cannot edit PO: enquiry status is "…".`). This is what stops someone back-filling a PO onto an enquiry whose quotation never went out.
- **Document ownership.** Every "keep" id must be an existing PO document of *this* enquiry; every new file must be a completed (`READY`) upload.
- **At least one document** must remain after the kept-plus-new set is assembled.

Only after all of that passes does the enquiry's PO record get written: `hasPoArrived` is set to `true`, the PO number and date are stored, the final document set is saved, and *Uploaded By* / the updated-at timestamp are stamped with **whoever saved this time**.

## What changes once a PO is attached

Saving the **first** PO transitions the enquiry:

- **Status → *PoArrived*.** The status chip on the enquiry changes, and the *Purchase Order* card fills in.
- **A notification fires** to the firm that a customer PO has arrived on this enquiry (naming it the customer). This fires only on the first attach, not on later document edits.
- ***Convert to Sales Order* unlocks.** The actions menu now offers *Convert to Sales Order* (needs the *Convert To Sales Order* permission). See [Sales orders](/docs/enquiry-bank/orders).
- **Dashboard sales metrics** that count arrived POs (PO value / PO count) now include this enquiry.
- **Editing the enquiry gets stricter.** A *PoArrived* enquiry can only be edited if you also hold the *Edit Already-Order-Arrived* permission, and editing one reverts it to pending on save while keeping the PO attached. See [View an enquiry](/docs/enquiry-bank/view-enquiry#edit--revise).

Editing an already-arrived PO (adding/removing documents or correcting the number/date) does **not** change the status again and does not re-fire the notification — it just updates the record.

## The Purchase Order card and document viewer

On the enquiry detail screen the *Purchase Order* card reads *No PO received yet.* until a PO is recorded. Once attached it shows:

- *PO Number* — the customer's reference.
- *PO Date* — formatted `dd Mon yyyy`.
- *Uploaded By* — the name of whoever last saved the PO. Note this is overwritten to the **editor** each time the PO is saved, so after an *Edit PO* it reflects the person who edited, not the original attacher.
- *Attachments* — a *View file* link (one document) or *View all (N)* (several). One document opens straight in the in-app file previewer; several open a *PO Documents* picker listing each file with its size and a *View* action.

Opening a file streams it through the API into a blob and shows it in the in-app viewer (works the same in web and desktop). The stream endpoint independently checks that you have the *View* permission and that the requested file actually belongs to this enquiry's PO — a forged file id for another record's document is refused — so document access can't be enumerated.

This card is also present, read-only, on the resulting **order** after conversion (see below) and on the enquiry when it is opened as an embedded read-only modal.

## After converting to a sales order

Once you choose *Convert to Sales Order* and confirm, the enquiry is formalised into an order and the **source enquiry is deleted** — the PO (number, date, and documents) carries forward onto the new order. See [Sales orders](/docs/enquiry-bank/orders) and [Convert to Sales Order](/docs/enquiry-bank/view-enquiry#convert-to-sales-order).

On the order, the *Purchase Order* card is **view-only**: you can view and download the PO documents, but there is no *Edit PO* action on an order. So correct the PO number, date, or documents *before* converting — while the record still lives on the enquiry.

## Common questions

### Why is there no *Attach PO* option on my enquiry?

The entry only shows when you have the *Edit* permission **and** the enquiry status is *Submitted* (quotation sent) or already *PoArrived*. On a *Pending* enquiry — quotation not yet sent — it is hidden. Send the quotation first. See [Generate a quotation](/docs/enquiry-bank/generate-quotation).

### Can I attach a PO without any documents?

No. At least one PO document is required — both the modal and the server refuse to save with zero files. The PO number and date are also both required. (This is a change from older behaviour where documents were optional.)

### What file types and sizes are allowed?

Each file may be up to `50 MB`; the drop zone is meant for PDFs, images/scans, and Word documents. The server does not hard-restrict the type, but there is no reason to attach anything other than the PO document(s). Files with a name that duplicates one already staged are skipped.

### How do I replace or remove a PO document?

Use *Edit PO*. Existing files appear under *Already attached* — remove the ones you don't want with the *×* and drag in replacements under *New files*, then *Save Changes*. You can never save the PO down to zero documents; at least one must remain.

### Does editing the PO change who "uploaded" it?

Yes. *Uploaded By* is stamped with whoever saves the PO, so after an *Edit PO* it shows the editor's name rather than the person who first attached it.

### Can I edit the customer PO after converting to a sales order?

No. Conversion deletes the source enquiry and copies the PO onto the order, where the *Purchase Order* card is view-only (documents can be viewed/downloaded but not changed). Make any corrections on the enquiry before converting.

### The status won't move to *PoArrived* — what's wrong?

A first PO attach requires the enquiry to be exactly *Submitted* (the quotation must have been sent). If the quotation hasn't gone out, or the enquiry is *Lost*/*Regret*, the server rejects the attach. Send the quotation (which sets the status to *Submitted*) and try again.

### Is this the same as the purchase order I send to a supplier?

No. This page is about recording the **customer's** PO on an enquiry. The supplier-facing PO your firm issues is created from Procurement and has its own numbering, template, and email flow — see [Create a purchase order](/docs/procurement/create-purchase-order) and the [Purchase order template](/docs/settings/document-templates#purchase-order-personalisation).
