This commit is contained in:
seb
2026-10-18 20:29:51 +02:00
parent f6b0ff7483
commit 8cc7d0eb0b
15 changed files with 166 additions and 24 deletions

View File

@@ -16,18 +16,18 @@ Creates a new order for the user's selected company with its lines and records a
| `body` | `object` | The order input. |
| `body.number` | `string` | The order number. |
| `body.date` | `string` | The order date. |
| `[body.entityId]` | `number` | The id of the customer entity. |
| `body.entityId` | `number` | The id of the customer entity. |
| `[body.externalNumber]` | `string` | An external (customer) reference number. |
| `[body.lines]` | `Array<{sku?: string, name?: string, pu?: number, amount: number, net: number, rebate?: number, taxrate: number, comment?: string|null}>` | The order lines. |
| `[tx]` | `object` | Optional transaction to run within. |
**Returns**
`Promise<{id: number, number: string, type: string, entityId: number|null, externalNumber: string|null, date: string, lines: Array<{id: number, sku: string|null, name: string|null, pu: number, amount: number, net: number, rebate: number, taxrate: number, comment: string|null}>}>` — The created order.
`Promise<{id: number, number: string, type: string, entityId: number, externalNumber: string|null, date: string, lines: Array<{id: number, sku: string|null, name: string|null, pu: number, amount: number, net: number, rebate: number, taxrate: number, comment: string|null}>}>` — The created order.
**Throws**
`Error` — If the order is invalid.
`Error` — If the order is invalid, no entity is selected, or entity not found.
**Example**