sinfactura-types 1.10.430 → 1.10.432
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/purchaseReceipt.js +13 -0
- package/dist/cjs/supplier.js +4 -3
- package/dist/product.d.ts +6 -0
- package/dist/purchaseReceipt.d.ts +12 -3
- package/dist/purchaseReceipt.js +13 -0
- package/dist/report.d.ts +13 -0
- package/dist/supplier.d.ts +18 -4
- package/dist/supplier.js +4 -3
- package/package.json +1 -1
|
@@ -29,6 +29,14 @@ exports.PURCHASE_RECEIPT_MAX_LINES_DEPOSITOS = 32;
|
|
|
29
29
|
* or `cancelled`; only `sent` and `partially_received` accept a delivery.
|
|
30
30
|
* - `PURCHASE_ORDER_VERSION_CONFLICT` · 409 — the order changed between the read
|
|
31
31
|
* and the commit. Nothing moved; re-read and retry with the SAME `receiptKey`.
|
|
32
|
+
* - `PURCHASE_RECEIPT_TOO_MANY_LINES` · 400 — a store booking stock per depósito
|
|
33
|
+
* takes at most `PURCHASE_RECEIPT_MAX_LINES_DEPOSITOS` lines; `data.max` is it.
|
|
34
|
+
* - `WAREHOUSE_NOT_FOUND` · 404 / `WAREHOUSE_INACTIVE` · 409 — the named
|
|
35
|
+
* `warehouseId` (echoed in `data.warehouseId`) cannot receive stock.
|
|
36
|
+
* - `NO_PRIMARY_WAREHOUSE` · 409 — no depósito named and the store has no
|
|
37
|
+
* active primary one.
|
|
38
|
+
* - `INVENTORY_LEVEL_VERSION_CONFLICT` · 409 — a depósito level changed between
|
|
39
|
+
* the read and the commit. Nothing moved; retry.
|
|
32
40
|
* - `STOCK_INCOME_RACED` · 409 — the ledger-key retry budget ran out. Nothing moved.
|
|
33
41
|
* - `PRODUCT_NOT_FOUND` · 404 — a line's product no longer exists. Nothing moved.
|
|
34
42
|
* - `PURCHASE_RECEIPT_NOT_FOUND` · 404 — `mode=receipt` addressed nothing.
|
|
@@ -47,6 +55,11 @@ exports.PURCHASE_RECEIPT_ERROR_CODES = [
|
|
|
47
55
|
'PURCHASE_ORDER_LINE_NOT_FOUND',
|
|
48
56
|
'PURCHASE_ORDER_ILLEGAL_TRANSITION',
|
|
49
57
|
'PURCHASE_ORDER_VERSION_CONFLICT',
|
|
58
|
+
'PURCHASE_RECEIPT_TOO_MANY_LINES',
|
|
59
|
+
'WAREHOUSE_NOT_FOUND',
|
|
60
|
+
'WAREHOUSE_INACTIVE',
|
|
61
|
+
'NO_PRIMARY_WAREHOUSE',
|
|
62
|
+
'INVENTORY_LEVEL_VERSION_CONFLICT',
|
|
50
63
|
'STOCK_INCOME_RACED',
|
|
51
64
|
'PRODUCT_NOT_FOUND',
|
|
52
65
|
'PURCHASE_RECEIPT_NOT_FOUND',
|
package/dist/cjs/supplier.js
CHANGED
|
@@ -66,9 +66,10 @@ exports.MAX_SUPPLIER_PAYMENT_APPLICATIONS = 25;
|
|
|
66
66
|
* `mode: 'invoice'`).
|
|
67
67
|
*
|
|
68
68
|
* - `PAYMENT_OVERAPPLIED` · 400 — Σ `appliedTo` exceeds the movement's amount.
|
|
69
|
-
* - `PAYMENT_APPLICATION_INVALID` · 400 —
|
|
70
|
-
*
|
|
71
|
-
*
|
|
69
|
+
* - `PAYMENT_APPLICATION_INVALID` · 400 — a bill of another supplier, a credit
|
|
70
|
+
* note, a bill with no total, or a bill in another currency. `data.invoiceId`
|
|
71
|
+
* names the bill. (`appliedTo` on a debit is `VALIDATION_FAILED`, refused by
|
|
72
|
+
* the body schema before any read.)
|
|
72
73
|
* - `SUPPLIER_INVOICE_NOT_FOUND` · 404 — `data.invoiceId` names it.
|
|
73
74
|
* - `INVOICE_OVERPAID` · 409 — the slice exceeds what is still open on
|
|
74
75
|
* `data.invoiceId`; `data.remaining` is what is.
|
package/dist/product.d.ts
CHANGED
|
@@ -329,6 +329,12 @@ declare global {
|
|
|
329
329
|
supplierName?: string;
|
|
330
330
|
quantity: number;
|
|
331
331
|
cost: number;
|
|
332
|
+
/**
|
|
333
|
+
* Currency `cost` is in, on a row a multi-line purchase-order receipt
|
|
334
|
+
* wrote — the ORDER's currency, which may not be the product's. Absent
|
|
335
|
+
* on every other row; see `StockIncome.currency`.
|
|
336
|
+
*/
|
|
337
|
+
currency?: string;
|
|
332
338
|
}[];
|
|
333
339
|
/**
|
|
334
340
|
* ⚠️ **Two shapes, chosen by `statsWindow`, and this field declares only
|
|
@@ -78,8 +78,9 @@ declare global {
|
|
|
78
78
|
* The depósito the whole delivery was received into. Every `INCOME#` row
|
|
79
79
|
* the receipt wrote carries the same value.
|
|
80
80
|
*
|
|
81
|
-
* ⚠️ OPTIONAL PERMANENTLY.
|
|
82
|
-
* that moved only the
|
|
81
|
+
* ⚠️ OPTIONAL PERMANENTLY. Written by `mode: 'receive'` on a store running
|
|
82
|
+
* `stockAuthority: 'depositos'`; absent means a receipt that moved only the
|
|
83
|
+
* store total.
|
|
83
84
|
*/
|
|
84
85
|
warehouseId?: string;
|
|
85
86
|
/** Operator note. ⚠️ Never personal data — this row is not scrubbed and has no TTL. */
|
|
@@ -100,6 +101,14 @@ declare global {
|
|
|
100
101
|
* or `cancelled`; only `sent` and `partially_received` accept a delivery.
|
|
101
102
|
* - `PURCHASE_ORDER_VERSION_CONFLICT` · 409 — the order changed between the read
|
|
102
103
|
* and the commit. Nothing moved; re-read and retry with the SAME `receiptKey`.
|
|
104
|
+
* - `PURCHASE_RECEIPT_TOO_MANY_LINES` · 400 — a store booking stock per depósito
|
|
105
|
+
* takes at most `PURCHASE_RECEIPT_MAX_LINES_DEPOSITOS` lines; `data.max` is it.
|
|
106
|
+
* - `WAREHOUSE_NOT_FOUND` · 404 / `WAREHOUSE_INACTIVE` · 409 — the named
|
|
107
|
+
* `warehouseId` (echoed in `data.warehouseId`) cannot receive stock.
|
|
108
|
+
* - `NO_PRIMARY_WAREHOUSE` · 409 — no depósito named and the store has no
|
|
109
|
+
* active primary one.
|
|
110
|
+
* - `INVENTORY_LEVEL_VERSION_CONFLICT` · 409 — a depósito level changed between
|
|
111
|
+
* the read and the commit. Nothing moved; retry.
|
|
103
112
|
* - `STOCK_INCOME_RACED` · 409 — the ledger-key retry budget ran out. Nothing moved.
|
|
104
113
|
* - `PRODUCT_NOT_FOUND` · 404 — a line's product no longer exists. Nothing moved.
|
|
105
114
|
* - `PURCHASE_RECEIPT_NOT_FOUND` · 404 — `mode=receipt` addressed nothing.
|
|
@@ -111,6 +120,6 @@ declare global {
|
|
|
111
120
|
* ⚠️ Cross-cutting refusals are NOT repeated here — check `GATING_ERROR_CODES`
|
|
112
121
|
* as well.
|
|
113
122
|
*/
|
|
114
|
-
export declare const PURCHASE_RECEIPT_ERROR_CODES: readonly ["VALIDATION_FAILED", "ADMIN_REQUIRED", "PURCHASE_ORDER_NOT_FOUND", "PURCHASE_ORDER_LINE_NOT_FOUND", "PURCHASE_ORDER_ILLEGAL_TRANSITION", "PURCHASE_ORDER_VERSION_CONFLICT", "STOCK_INCOME_RACED", "PRODUCT_NOT_FOUND", "PURCHASE_RECEIPT_NOT_FOUND", "INVALID_CURSOR"];
|
|
123
|
+
export declare const PURCHASE_RECEIPT_ERROR_CODES: readonly ["VALIDATION_FAILED", "ADMIN_REQUIRED", "PURCHASE_ORDER_NOT_FOUND", "PURCHASE_ORDER_LINE_NOT_FOUND", "PURCHASE_ORDER_ILLEGAL_TRANSITION", "PURCHASE_ORDER_VERSION_CONFLICT", "PURCHASE_RECEIPT_TOO_MANY_LINES", "WAREHOUSE_NOT_FOUND", "WAREHOUSE_INACTIVE", "NO_PRIMARY_WAREHOUSE", "INVENTORY_LEVEL_VERSION_CONFLICT", "STOCK_INCOME_RACED", "PRODUCT_NOT_FOUND", "PURCHASE_RECEIPT_NOT_FOUND", "INVALID_CURSOR"];
|
|
115
124
|
export type PurchaseReceiptErrorCode = (typeof PURCHASE_RECEIPT_ERROR_CODES)[number];
|
|
116
125
|
export {};
|
package/dist/purchaseReceipt.js
CHANGED
|
@@ -26,6 +26,14 @@ export const PURCHASE_RECEIPT_MAX_LINES_DEPOSITOS = 32;
|
|
|
26
26
|
* or `cancelled`; only `sent` and `partially_received` accept a delivery.
|
|
27
27
|
* - `PURCHASE_ORDER_VERSION_CONFLICT` · 409 — the order changed between the read
|
|
28
28
|
* and the commit. Nothing moved; re-read and retry with the SAME `receiptKey`.
|
|
29
|
+
* - `PURCHASE_RECEIPT_TOO_MANY_LINES` · 400 — a store booking stock per depósito
|
|
30
|
+
* takes at most `PURCHASE_RECEIPT_MAX_LINES_DEPOSITOS` lines; `data.max` is it.
|
|
31
|
+
* - `WAREHOUSE_NOT_FOUND` · 404 / `WAREHOUSE_INACTIVE` · 409 — the named
|
|
32
|
+
* `warehouseId` (echoed in `data.warehouseId`) cannot receive stock.
|
|
33
|
+
* - `NO_PRIMARY_WAREHOUSE` · 409 — no depósito named and the store has no
|
|
34
|
+
* active primary one.
|
|
35
|
+
* - `INVENTORY_LEVEL_VERSION_CONFLICT` · 409 — a depósito level changed between
|
|
36
|
+
* the read and the commit. Nothing moved; retry.
|
|
29
37
|
* - `STOCK_INCOME_RACED` · 409 — the ledger-key retry budget ran out. Nothing moved.
|
|
30
38
|
* - `PRODUCT_NOT_FOUND` · 404 — a line's product no longer exists. Nothing moved.
|
|
31
39
|
* - `PURCHASE_RECEIPT_NOT_FOUND` · 404 — `mode=receipt` addressed nothing.
|
|
@@ -44,6 +52,11 @@ export const PURCHASE_RECEIPT_ERROR_CODES = [
|
|
|
44
52
|
'PURCHASE_ORDER_LINE_NOT_FOUND',
|
|
45
53
|
'PURCHASE_ORDER_ILLEGAL_TRANSITION',
|
|
46
54
|
'PURCHASE_ORDER_VERSION_CONFLICT',
|
|
55
|
+
'PURCHASE_RECEIPT_TOO_MANY_LINES',
|
|
56
|
+
'WAREHOUSE_NOT_FOUND',
|
|
57
|
+
'WAREHOUSE_INACTIVE',
|
|
58
|
+
'NO_PRIMARY_WAREHOUSE',
|
|
59
|
+
'INVENTORY_LEVEL_VERSION_CONFLICT',
|
|
47
60
|
'STOCK_INCOME_RACED',
|
|
48
61
|
'PRODUCT_NOT_FOUND',
|
|
49
62
|
'PURCHASE_RECEIPT_NOT_FOUND',
|
package/dist/report.d.ts
CHANGED
|
@@ -811,6 +811,19 @@ declare global {
|
|
|
811
811
|
* have dropped the very day the denomination moved.
|
|
812
812
|
*/
|
|
813
813
|
mixedCurrency: boolean;
|
|
814
|
+
/**
|
|
815
|
+
* `true` when `currency` is not the peso — and then every order denominated
|
|
816
|
+
* in anything else is valued at TODAY's display rate, not the one of its day.
|
|
817
|
+
*
|
|
818
|
+
* An order stamps its own rate INTO THE PESO (`currencyValue`), never into
|
|
819
|
+
* the display currency, so converting it here is `currencyValue ÷ the
|
|
820
|
+
* store's CURRENT display rate`. On a peso display that divisor is 1 and the
|
|
821
|
+
* figure is exactly historical; on any other display a cross-currency day
|
|
822
|
+
* moves when the store edits that rate. Nothing on the order records the
|
|
823
|
+
* display rate of the sale day, so the figure cannot be pinned — only
|
|
824
|
+
* disclosed. Store-level, so it is emitted on a truncated response too.
|
|
825
|
+
*/
|
|
826
|
+
liveDisplayRate: boolean;
|
|
814
827
|
/** Ascending by `date`, sparse. Absent when the read truncated. */
|
|
815
828
|
points?: ReportCogsSeriesPoint[];
|
|
816
829
|
/** Absent when the read truncated. */
|
package/dist/supplier.d.ts
CHANGED
|
@@ -198,7 +198,10 @@ declare global {
|
|
|
198
198
|
paidAmount?: number;
|
|
199
199
|
/**
|
|
200
200
|
* SERVER-OWNED, derived from `paidAmount` against `total`: `paid` at exactly
|
|
201
|
-
* `paidAmount == total` (2 dp). Stamped `open` on every new non-NC bill
|
|
201
|
+
* `paidAmount == total` (2 dp). Stamped `open` on every new non-NC bill —
|
|
202
|
+
* the operator's and a peso one the received-FCE poller discovers (a
|
|
203
|
+
* foreign-currency one only when an edit first gives it a currency) — and
|
|
204
|
+
* re-derived when an edit moves `type` across NC (dropped / stamped).
|
|
202
205
|
* ⚠️ Absent on bills written before payables existed: they are UNTRACKED,
|
|
203
206
|
* not open, and the aging report leaves them out until a payment is
|
|
204
207
|
* applied to them.
|
|
@@ -215,6 +218,16 @@ declare global {
|
|
|
215
218
|
* that order had at that moment.
|
|
216
219
|
*/
|
|
217
220
|
receiptIds?: string[];
|
|
221
|
+
/**
|
|
222
|
+
* SERVER-OWNED. `true` when the bill named no receipts, so `receiptIds` is
|
|
223
|
+
* the server's list and the match counts every unit the order received —
|
|
224
|
+
* its lines' `receivedQuantity`, including units booked through the
|
|
225
|
+
* single-line `POST /products` stock entry, which writes no receipt. An edit
|
|
226
|
+
* that moves none of the match's inputs keeps the verdict and these ids; one
|
|
227
|
+
* that moves an input and names none re-reads the order. Absent when the
|
|
228
|
+
* bill named its receipts, and on rows written before this existed.
|
|
229
|
+
*/
|
|
230
|
+
receiptIdsFromOrder?: boolean;
|
|
218
231
|
/**
|
|
219
232
|
* Header-level three-way match. SERVER-OWNED: every write recomputes it and
|
|
220
233
|
* a value in the body is ignored. Absent on rows written before the match
|
|
@@ -577,9 +590,10 @@ export declare const MAX_SUPPLIER_PAYMENT_APPLICATIONS = 25;
|
|
|
577
590
|
* `mode: 'invoice'`).
|
|
578
591
|
*
|
|
579
592
|
* - `PAYMENT_OVERAPPLIED` · 400 — Σ `appliedTo` exceeds the movement's amount.
|
|
580
|
-
* - `PAYMENT_APPLICATION_INVALID` · 400 —
|
|
581
|
-
*
|
|
582
|
-
*
|
|
593
|
+
* - `PAYMENT_APPLICATION_INVALID` · 400 — a bill of another supplier, a credit
|
|
594
|
+
* note, a bill with no total, or a bill in another currency. `data.invoiceId`
|
|
595
|
+
* names the bill. (`appliedTo` on a debit is `VALIDATION_FAILED`, refused by
|
|
596
|
+
* the body schema before any read.)
|
|
583
597
|
* - `SUPPLIER_INVOICE_NOT_FOUND` · 404 — `data.invoiceId` names it.
|
|
584
598
|
* - `INVOICE_OVERPAID` · 409 — the slice exceeds what is still open on
|
|
585
599
|
* `data.invoiceId`; `data.remaining` is what is.
|
package/dist/supplier.js
CHANGED
|
@@ -63,9 +63,10 @@ export const MAX_SUPPLIER_PAYMENT_APPLICATIONS = 25;
|
|
|
63
63
|
* `mode: 'invoice'`).
|
|
64
64
|
*
|
|
65
65
|
* - `PAYMENT_OVERAPPLIED` · 400 — Σ `appliedTo` exceeds the movement's amount.
|
|
66
|
-
* - `PAYMENT_APPLICATION_INVALID` · 400 —
|
|
67
|
-
*
|
|
68
|
-
*
|
|
66
|
+
* - `PAYMENT_APPLICATION_INVALID` · 400 — a bill of another supplier, a credit
|
|
67
|
+
* note, a bill with no total, or a bill in another currency. `data.invoiceId`
|
|
68
|
+
* names the bill. (`appliedTo` on a debit is `VALIDATION_FAILED`, refused by
|
|
69
|
+
* the body schema before any read.)
|
|
69
70
|
* - `SUPPLIER_INVOICE_NOT_FOUND` · 404 — `data.invoiceId` names it.
|
|
70
71
|
* - `INVOICE_OVERPAID` · 409 — the slice exceeds what is still open on
|
|
71
72
|
* `data.invoiceId`; `data.remaining` is what is.
|