ms_build_purchaseorder
Preview a purchase order: resolves supplier and product names to references, displays the order body and summary for verification before creation.
Instructions
PREVIEW a purchase order: resolve names to refs and show the EXACT body ms_create_purchaseorder would send (money already kopecks). Performs READS to resolve names; sends NO write. Inspect the body/summary before creating.
Args: agent: supplier counterparty name (поставщик) — required. organization: own legal entity; omit to auto-use the only one on the cabinet. store: warehouse name (optional). positions: list of {"product": name, "quantity": n, "price": rubles, optional "discount" %, "vat" %}. moment/name/description: optional fields. moment is "YYYY-MM-DD HH:MM:SS". Returns {"ok": true, "body", "resolved", "summary"} or an error envelope.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| agent | Yes | ||
| store | No | ||
| moment | No | ||
| positions | No | ||
| description | No | ||
| organization | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |