1.2 KiB
1.2 KiB
stock
This document is auto-generated from the JSDoc comments in src/store by running npm run api-doc.
stock.adjust
Source: src/store/stock/adjust.js
Adjusts article stock manually by creating an implicit manifest of type "adjustment", allocating a number from the "adjustment" number scheme, and appending to the ledger.
Parameters
| Name | Type | Description |
|---|---|---|
googleAuthId |
number |
The id of the Google auth user. |
input |
object |
Adjustment payload. |
[input.sku] |
string |
Article SKU (if single-item adjustment). |
[input.warehouseId] |
number |
Warehouse ID (can also pass warehouse_id). |
[input.amount] |
number |
Signed adjustment amount (+ to add, - to remove). |
[input.text] |
string |
Optional adjustment reason/memo. |
[input.externalNumber] |
string |
Optional external reference. |
[input.date] |
`string | Date` |
[input.lines] |
Array<object> |
Optional array of items to adjust in one manifest. |
[tx] |
object |
Optional transaction to run within. |
Returns
Promise<{manifest: {id: number, number: string, type: string, date: string, createdAt: string}, lines: Array<object>, ledger: Array<object>}>