platform-types 1.10.833 → 1.10.834

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.
Files changed (2) hide show
  1. package/dist/return.d.ts +33 -3
  2. package/package.json +1 -1
package/dist/return.d.ts CHANGED
@@ -64,8 +64,15 @@ declare global {
64
64
  * - `unnumbered-factura` — a live factura entry carries no valid voucher
65
65
  * number (and is not `pending_cae`), or a live entry carries no
66
66
  * `invoiceType` at all and is counted as a factura, failing closed.
67
+ * - `freight-line-unmapped` — the return gives the freight back
68
+ * ({@link Return.freight}) and every factura line maps to a goods line,
69
+ * none to the order's freight line: the factura carries no freight line. A
70
+ * note without the freight would credit less than the return, so none is
71
+ * committed. A factura whose freight line differs from the order's (sku,
72
+ * name, quantity, unit or IVA) fails the whole line mapping instead, and
73
+ * answers `409 RETURN_LEDGER_BASIS_UNAVAILABLE`.
67
74
  */
68
- type ReturnCreditNoteUnallocatableCause = 'multiple-facturas' | 'missing-invoice-id' | 'unnumbered-factura';
75
+ type ReturnCreditNoteUnallocatableCause = 'multiple-facturas' | 'missing-invoice-id' | 'unnumbered-factura' | 'freight-line-unmapped';
69
76
  /**
70
77
  * `data` of `409 RETURN_CREDIT_NOTE_REQUIRED`: the request sent
71
78
  * `emitCreditNote: false` for a return whose `flow` requires the credit note
@@ -213,6 +220,18 @@ declare global {
213
220
  */
214
221
  warehouseId?: string;
215
222
  items: ReturnItem[];
223
+ /**
224
+ * The order's freight line, given back by the `purchase-withdrawal` return that exhausts the order's goods
225
+ * lines. Server-appended, never client-settable: a body naming the freight index is
226
+ * `400 RETURN_INVALID_SUBSET`. `total` is the freight line's charge (`freightLineTotal`, never discounted)
227
+ * in the order's currency, and it is part of {@link Return.total}. Not a {@link ReturnItem}: it restocks
228
+ * nothing and writes no `SALE#`, `INCOME#` or disposition. The credit note's subset is `items` plus this.
229
+ * Operator-only, like the rest of the row.
230
+ *
231
+ * ⚠️ OPTIONAL PERMANENTLY. Absent on every other return — every other flow, a withdrawal return that leaves
232
+ * goods behind, an order with no freight line or one charged at 0 — and on every row written before it existed.
233
+ */
234
+ freight?: ReturnFreight;
216
235
  /** Operator-only intake allocations. Absent on legacy returns means no recorded movement snapshot. */
217
236
  stockMovements?: ReturnStockMovement[];
218
237
  /**
@@ -254,8 +273,10 @@ declare global {
254
273
  /**
255
274
  * The commercial refund in the originating order's currency. Selected
256
275
  * units use the sale's per-unit rounding rule, capped at the remaining
257
- * recorded charge; the final units refund that charge less earlier
258
- * `ReturnSummary.total` amounts. Historical returns remain as recorded.
276
+ * recorded charge; the final units refund that charge, less its freight
277
+ * line, less earlier `ReturnSummary.total` amounts. Historical returns
278
+ * remain as recorded. The one exception keeps the freight: a return
279
+ * carrying {@link Return.freight} refunds it too.
259
280
  *
260
281
  * The ACCOUNT credit is a separate conversion into the customer ledger's
261
282
  * currency, and a credit note reverses its factura's fiscal economics in
@@ -639,6 +660,15 @@ declare global {
639
660
  * for the idempotency window and claims no second number.
640
661
  */
641
662
  type ReturnCreditNoteErrorCode = 'PARTIAL_NC_AFIP_DOWN' | 'NC_MULTI_FAC_UNSUPPORTED' | 'NC_EXCEEDS_FAC_TOTAL' | 'CBTE_ASOC_NOT_FOUND' | 'CBTE_ASOC_NOT_CREDITABLE' | 'CBTE_ASOC_AMBIGUOUS' | 'INVOICE_POINT_OF_SALE_CONFLICT' | 'INVOICE_POINT_OF_SALE_RESERVED' | 'INVOICE_MIXED_CURRENCY' | 'LINE_CURRENCY_NOT_INVOICEABLE' | 'LINE_IVA_TYPE_NOT_INVOICEABLE' | 'AFIP_LINE_FX_UNSTAMPED' | 'CUSTOMER_AFIP_SHAPE_INVALID' | 'AFIP_BNA_RATE_UNAVAILABLE' | 'PARTIAL_NC_INVALID_SUBSET' | 'PARTIAL_NC_REQUIRES_CBTE' | 'INVOICE_PERSIST_AFTER_CAE_FAILED' | 'NC_EMISSION_FAILED';
663
+ /** The freight a `purchase-withdrawal` return gives back — see {@link Return.freight}. */
664
+ interface ReturnFreight {
665
+ /** The freight line's index in `Order.items`. */
666
+ orderItemIndex: number;
667
+ /** The freight line's whole quantity. */
668
+ quantity: number;
669
+ /** The freight line's charge in the order's currency (`freightLineTotal`). */
670
+ total: number;
671
+ }
642
672
  interface ReturnItem {
643
673
  /**
644
674
  * Index of the line in the ORIGINATING `Order.items` array. Returns are
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.833",
3
+ "version": "1.10.834",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",