Issue a quotation, billing note or receipt PDF (th + en) from a Sales & Billing deal
issue_sales_documentIssue a quotation, billing note or receipt PDF (th + en) from a Sales & Billing deal.
Ask the user for the customer's name, address and tax ID before issuing, and show the lines and VAT mode for approval; never invent them. kind quotation = whole deal; billing_note = one installment (give installment_key): it sets that installment's invoice_no and invoiced_at (marks it invoiced); receipt = a PAID installment only (after paid_at, else 409 installment_not_paid), not a tax invoice. BoardMark issues no tax invoices. revise_of re-issues the latest quotation or billing note as -R2. Numbers are automatic. Needs the company tax profile (else 409 seller_incomplete: tell a company admin). Both PDFs are attached to the deal; reply gives their paths.
Issue a quotation / billing note / receipt (D149). First ask the user for the customer's name, address and tax ID, and the lines and VAT mode — never invent them — and show them before issuing. A billing note marks the installment invoiced; a receipt only after the installment is paid; BoardMark issues no tax invoices (tell the user to use their accounting system for those). Numbers are automatic and permanent. The result lists the files (attachment_id, th + en): give them to get_download_url when the user wants the PDF. 409 seller_incomplete → a company admin must complete the tax profile in the web app.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | Kind of a sales document (spec D149): `quotation` (ใบเสนอราคา, one per deal), `billing_note` (ใบวางบิล, per installment), `receipt` (ใบเสร็จรับเงิน, per paid installment; never a tax invoice). Default number series QT / BN / RC; BoardMark issues no tax invoice. | |
| note | No | ||
| lines | Yes | ||
| reason | No | Spec D144: why you make this change (≤ 200 characters). Optional, but give it when you act as an agent account — it is shown in the agent's run log ("moved KJ-12 To Do → In Progress because <reason>"). board-mcp records it in `agent.run`; board-core / board-files accept it and ignore it (it never changes the file, the version or the history). | |
| note_en | No | ||
| payment | No | Receipt only: how the money was received. | |
| customer | Yes | The buyer printed on the document. Name is required when issuing (empty -> 400 `validation_failed`); the rest is optional. `*_en` empty -> the EN file uses the Thai text. | |
| vat_mode | Yes | VAT on a sales document (spec D149): `include` = prices already include 7 % VAT, `add` = 7 % is added to the subtotal, `none` = no VAT. The rate is fixed at 7 % this round. | |
| issue_key | Yes | Issue key `{PROJECT}-{n}`, e.g. `KJ-101`. | |
| revise_of | No | Sales document id (spec D149): `sdoc_` + ULID, owned by board-core. | |
| project_key | Yes | Project key, e.g. `KJ`. 2–10 chars, uppercase letters and digits, starts with a letter. | |
| valid_until | No | ||
| installment_key | No | Issue key `{PROJECT}-{n}`, e.g. `KJ-101`. |