ms_build_document
Preview any role document by resolving counterparty and product names to references, and see the exact body that would be sent. Read-only preview.
Instructions
PREVIEW any role document: resolve names to refs and show the EXACT body ms_create_document would send (money already kopecks). READS only; no write.
Args: doc_type: one of demand | supply | purchaseorder | invoiceout | invoicein | salesreturn | purchasereturn. agent: counterparty name — supplier for supply/invoicein/purchasereturn/ purchaseorder, customer for demand/invoiceout/salesreturn. organization: own legal entity; omit to auto-use the only one on the cabinet. store: warehouse name. supply/demand move stock, so a store is expected; optional for the others. positions: list of {"product": name, "quantity": n, "price": rubles, optional "discount" %, "vat" %}. moment/name/description: optional. moment is "YYYY-MM-DD HH:MM:SS". Returns {"ok": true, "doc_type", "body", "resolved", "summary"} or an error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| agent | Yes | ||
| store | No | ||
| moment | No | ||
| doc_type | Yes | ||
| positions | No | ||
| description | No | ||
| organization | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |