u
This commit is contained in:
@@ -84,3 +84,26 @@ Lists ledger entries for a given article SKU, optionally filtered by transaction
|
||||
const entries = await store.ledger.listBySku(googleAuthId, 'SKU-001', 'DELIVERY');
|
||||
// => [{ id, manifestarticle_id, warehouse_id, sku, transaction_type, amount, transaction_text, hash_version, prev_hash, created_at }]
|
||||
```
|
||||
|
||||
## `ledger.listHistory`
|
||||
|
||||
*Source: `src/store/ledger/listHistory.js`*
|
||||
|
||||
Lists ledger entries for the user's selected company across all articles, supporting pagination, date cutoff via seekMonths, and search.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `provider` | `import('../../providers/provider.js').Provider` | |
|
||||
|
||||
**Returns**
|
||||
|
||||
`(googleAuthId: number, opts?: {offset?: number, limit?: number, search?: string, seekMonths?: number}, tx?: object) => Promise<{ledger: Array<{id: number, date: string, sku: string|null, name: string|null, transaction_type: string, transaction_text: string, amount: number}>, total: number, unfilteredTotal: number, offset: number, limit: number}>`
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const res = await store.ledger.listHistory(googleAuthId, { offset: 0, limit: 50, search: 'kjh', seekMonths: -1 });
|
||||
// => { ledger: [...], total, unfilteredTotal, offset, limit }
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user