@sixtyninecommerce/admin 0.10.0 → 0.12.0
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/README.md +5772 -118
- package/dist/auth/index.d.ts +7 -1
- package/dist/auth/index.js +8 -1
- package/dist/catalog/assets.d.ts +120 -8
- package/dist/catalog/assets.js +98 -12
- package/dist/catalog/collections.d.ts +279 -14
- package/dist/catalog/collections.js +246 -15
- package/dist/catalog/documents.d.ts +142 -0
- package/dist/catalog/documents.js +114 -0
- package/dist/catalog/index.d.ts +54 -6
- package/dist/catalog/index.js +10 -1
- package/dist/catalog/metadata.d.ts +244 -0
- package/dist/catalog/metadata.js +220 -0
- package/dist/catalog/products.d.ts +159 -19
- package/dist/catalog/products.js +88 -13
- package/dist/catalog/properties.d.ts +140 -14
- package/dist/catalog/properties.js +65 -1
- package/dist/catalog/recommendations.d.ts +288 -0
- package/dist/catalog/recommendations.js +237 -0
- package/dist/catalog/reviews.d.ts +381 -0
- package/dist/catalog/reviews.js +325 -0
- package/dist/catalog/types.d.ts +17 -1
- package/dist/catalog/types.js +10 -0
- package/dist/catalog/variant-find.d.ts +136 -0
- package/dist/catalog/variant-find.js +239 -0
- package/dist/catalog/variants.d.ts +293 -26
- package/dist/catalog/variants.js +164 -7
- package/dist/catalog/visibility.d.ts +38 -7
- package/dist/catalog/visibility.js +19 -1
- package/dist/client.d.ts +121 -9
- package/dist/client.js +53 -14
- package/dist/content/assets.d.ts +285 -0
- package/dist/content/assets.js +181 -0
- package/dist/content/forms.d.ts +332 -1
- package/dist/content/forms.js +140 -4
- package/dist/content/items.d.ts +292 -0
- package/dist/content/items.js +170 -0
- package/dist/content/menus.d.ts +254 -0
- package/dist/content/menus.js +70 -0
- package/dist/content/strings.d.ts +137 -0
- package/dist/content/strings.js +82 -0
- package/dist/content/types.d.ts +282 -0
- package/dist/content/types.js +100 -0
- package/dist/customers/age-verification.d.ts +66 -0
- package/dist/customers/age-verification.js +79 -0
- package/dist/customers/credit.d.ts +263 -0
- package/dist/customers/credit.js +244 -0
- package/dist/customers/delivery-preferences.d.ts +120 -0
- package/dist/customers/delivery-preferences.js +97 -0
- package/dist/customers/delivery-terms.d.ts +44 -0
- package/dist/customers/delivery-terms.js +32 -0
- package/dist/customers/groups.d.ts +207 -0
- package/dist/customers/groups.js +438 -0
- package/dist/customers/index.d.ts +462 -37
- package/dist/customers/index.js +317 -40
- package/dist/customers/invitation-status.d.ts +57 -0
- package/dist/customers/invitation-status.js +21 -0
- package/dist/customers/notes.d.ts +67 -0
- package/dist/customers/notes.js +51 -0
- package/dist/customers/notification-recipients.d.ts +97 -0
- package/dist/customers/notification-recipients.js +84 -0
- package/dist/customers/saved-lists.d.ts +42 -0
- package/dist/customers/saved-lists.js +61 -0
- package/dist/customers/vat.d.ts +83 -0
- package/dist/customers/vat.js +46 -0
- package/dist/customers/wire.d.ts +20 -0
- package/dist/customers/wire.js +35 -0
- package/dist/documents/ar.d.ts +307 -0
- package/dist/documents/ar.js +254 -0
- package/dist/documents/emails.d.ts +150 -0
- package/dist/documents/emails.js +220 -0
- package/dist/documents/index.d.ts +744 -21
- package/dist/documents/index.js +438 -24
- package/dist/documents/pdf.d.ts +2 -0
- package/dist/documents/pdf.js +11 -0
- package/dist/fulfillments/create.d.ts +167 -0
- package/dist/fulfillments/create.js +216 -0
- package/dist/fulfillments/index.d.ts +163 -11
- package/dist/fulfillments/index.js +135 -6
- package/dist/fulfillments/payment-policy.d.ts +64 -0
- package/dist/fulfillments/payment-policy.js +140 -0
- package/dist/fulfillments/warehouse.d.ts +724 -0
- package/dist/fulfillments/warehouse.js +914 -0
- package/dist/geo/index.d.ts +119 -0
- package/dist/geo/index.js +107 -0
- package/dist/index.d.ts +147 -39
- package/dist/index.js +51 -12
- package/dist/integrations/afas-actions.d.ts +234 -0
- package/dist/integrations/afas-actions.js +310 -0
- package/dist/integrations/afas-types.d.ts +483 -0
- package/dist/integrations/afas-types.js +5 -0
- package/dist/integrations/afas.d.ts +234 -0
- package/dist/integrations/afas.js +290 -0
- package/dist/integrations/connections.d.ts +103 -0
- package/dist/integrations/connections.js +55 -0
- package/dist/integrations/esp.d.ts +313 -0
- package/dist/integrations/esp.js +169 -0
- package/dist/integrations/exact-online-types.d.ts +965 -0
- package/dist/integrations/exact-online-types.js +6 -0
- package/dist/integrations/exact-online.d.ts +784 -0
- package/dist/integrations/exact-online.js +1089 -0
- package/dist/integrations/index.d.ts +44 -3
- package/dist/integrations/index.js +23 -3
- package/dist/integrations/pipeline-discoveries.d.ts +65 -0
- package/dist/integrations/pipeline-discoveries.js +65 -0
- package/dist/integrations/pipeline-keys.d.ts +13 -0
- package/dist/integrations/pipeline-keys.js +22 -0
- package/dist/integrations/pipeline-runs.d.ts +119 -0
- package/dist/integrations/pipeline-runs.js +87 -0
- package/dist/integrations/pipelines.d.ts +87 -15
- package/dist/integrations/pipelines.js +41 -22
- package/dist/integrations/price-import.d.ts +223 -0
- package/dist/integrations/price-import.js +124 -0
- package/dist/integrations/types.d.ts +367 -3
- package/dist/integrations/types.js +4 -3
- package/dist/locations/index.d.ts +66 -0
- package/dist/locations/index.js +31 -0
- package/dist/meta/index.d.ts +172 -0
- package/dist/metafields/index.d.ts +8 -1
- package/dist/metafields/index.js +10 -0
- package/dist/orders/cancel-with-money.d.ts +237 -0
- package/dist/orders/cancel-with-money.js +155 -0
- package/dist/orders/commit-edit.d.ts +23 -1
- package/dist/orders/commit-edit.js +19 -2
- package/dist/orders/deposit-policy.d.ts +3 -1
- package/dist/orders/drafts.d.ts +800 -0
- package/dist/orders/drafts.js +771 -0
- package/dist/orders/fields.d.ts +245 -0
- package/dist/orders/fields.js +188 -0
- package/dist/orders/get.d.ts +29 -19
- package/dist/orders/get.js +17 -8
- package/dist/orders/index.d.ts +66 -15
- package/dist/orders/index.js +25 -2
- package/dist/orders/lifecycle.d.ts +128 -0
- package/dist/orders/lifecycle.js +158 -0
- package/dist/orders/line-price-preview.d.ts +7 -2
- package/dist/orders/list.d.ts +243 -0
- package/dist/orders/list.js +487 -0
- package/dist/orders/manual-discounts.d.ts +13 -5
- package/dist/orders/manual-pricing.d.ts +5 -0
- package/dist/orders/money-view.d.ts +149 -0
- package/dist/orders/money-view.js +99 -0
- package/dist/orders/order-entry.d.ts +20 -7
- package/dist/orders/plan-edit.d.ts +34 -2
- package/dist/orders/plan-edit.js +112 -11
- package/dist/orders/settings.d.ts +201 -0
- package/dist/orders/settings.js +325 -0
- package/dist/orders/status.d.ts +159 -13
- package/dist/orders/status.js +21 -0
- package/dist/orders/surcharges.d.ts +20 -1
- package/dist/orders/surcharges.js +37 -11
- package/dist/payments/account-credit.d.ts +46 -0
- package/dist/payments/account-credit.js +42 -0
- package/dist/payments/ar.d.ts +292 -0
- package/dist/payments/ar.js +223 -0
- package/dist/payments/connected-account.d.ts +47 -0
- package/dist/payments/connected-account.js +61 -0
- package/dist/payments/credit-noted-fields.d.ts +19 -0
- package/dist/payments/credit-noted-fields.js +69 -0
- package/dist/payments/customer-consent.d.ts +30 -0
- package/dist/payments/customer-consent.js +49 -0
- package/dist/payments/index.d.ts +340 -19
- package/dist/payments/index.js +151 -1
- package/dist/payments/methods.d.ts +303 -8
- package/dist/payments/methods.js +337 -7
- package/dist/payments/mollie-methods.d.ts +159 -0
- package/dist/payments/mollie-methods.js +141 -0
- package/dist/payments/payment-links.d.ts +180 -0
- package/dist/payments/payment-links.js +97 -0
- package/dist/payments/provider-keys.d.ts +150 -0
- package/dist/payments/provider-keys.js +118 -0
- package/dist/payments/providers.d.ts +86 -11
- package/dist/payments/providers.js +29 -0
- package/dist/payments/requests.d.ts +147 -0
- package/dist/payments/requests.js +93 -0
- package/dist/payments/store-credit-fields.d.ts +15 -0
- package/dist/payments/store-credit-fields.js +51 -0
- package/dist/pickups/index.d.ts +106 -0
- package/dist/pickups/index.js +108 -0
- package/dist/platform/channels.d.ts +132 -0
- package/dist/platform/channels.js +128 -0
- package/dist/platform/email-gateways.d.ts +165 -0
- package/dist/platform/email-gateways.js +78 -0
- package/dist/platform/geo.d.ts +123 -0
- package/dist/platform/geo.js +144 -0
- package/dist/platform/tax.d.ts +162 -0
- package/dist/platform/tax.js +169 -0
- package/dist/pos/anomalies.d.ts +158 -0
- package/dist/pos/anomalies.js +64 -0
- package/dist/pos/assisted-selling.d.ts +79 -0
- package/dist/pos/assisted-selling.js +38 -0
- package/dist/pos/exchanges.d.ts +108 -0
- package/dist/pos/exchanges.js +22 -0
- package/dist/pos/gift-cards.d.ts +135 -0
- package/dist/pos/gift-cards.js +47 -0
- package/dist/pos/index.d.ts +2370 -58
- package/dist/pos/index.js +854 -7
- package/dist/pos/no-receipt.d.ts +94 -0
- package/dist/pos/no-receipt.js +25 -0
- package/dist/pos/offline-sales.d.ts +228 -0
- package/dist/pos/offline-sales.js +170 -0
- package/dist/pos/pay-by-link.d.ts +143 -0
- package/dist/pos/pay-by-link.js +57 -0
- package/dist/pos/quick-keys.d.ts +103 -0
- package/dist/pos/quick-keys.js +45 -0
- package/dist/pos/reports.d.ts +360 -0
- package/dist/pos/reports.js +62 -0
- package/dist/pos/returns.d.ts +244 -0
- package/dist/pos/returns.js +83 -0
- package/dist/pricing/bulk-coupons.d.ts +139 -0
- package/dist/pricing/bulk-coupons.js +112 -0
- package/dist/pricing/index.d.ts +174 -4
- package/dist/pricing/index.js +174 -1
- package/dist/pricing/price-lists.d.ts +606 -0
- package/dist/pricing/price-lists.js +600 -0
- package/dist/purchasing/alerts.d.ts +104 -0
- package/dist/purchasing/alerts.js +88 -0
- package/dist/purchasing/backorders.d.ts +61 -0
- package/dist/purchasing/backorders.js +92 -0
- package/dist/purchasing/cost.d.ts +110 -0
- package/dist/purchasing/cost.js +86 -0
- package/dist/purchasing/index.d.ts +54 -0
- package/dist/purchasing/index.js +24 -0
- package/dist/purchasing/links.d.ts +263 -0
- package/dist/purchasing/links.js +192 -0
- package/dist/purchasing/purchase-orders.d.ts +551 -0
- package/dist/purchasing/purchase-orders.js +491 -0
- package/dist/purchasing/receipts.d.ts +396 -0
- package/dist/purchasing/receipts.js +287 -0
- package/dist/purchasing/replenishment.d.ts +281 -0
- package/dist/purchasing/replenishment.js +240 -0
- package/dist/purchasing/returns.d.ts +273 -0
- package/dist/purchasing/returns.js +229 -0
- package/dist/purchasing/settings.d.ts +152 -0
- package/dist/purchasing/settings.js +181 -0
- package/dist/purchasing/suppliers.d.ts +476 -0
- package/dist/purchasing/suppliers.js +438 -0
- package/dist/quotes/index.d.ts +518 -0
- package/dist/quotes/index.js +439 -0
- package/dist/reports/index.d.ts +71 -8
- package/dist/reports/index.js +74 -11
- package/dist/returns/index.d.ts +675 -21
- package/dist/returns/index.js +756 -11
- package/dist/search/index.d.ts +76 -1
- package/dist/search/index.js +63 -0
- package/dist/seo/config.d.ts +128 -0
- package/dist/seo/config.js +95 -0
- package/dist/seo/redirects.d.ts +125 -0
- package/dist/seo/redirects.js +60 -1
- package/dist/seo/settings.d.ts +147 -0
- package/dist/seo/settings.js +209 -0
- package/dist/shipping/definitions.d.ts +29 -0
- package/dist/shipping/definitions.js +47 -0
- package/dist/shipping/fulfillment-profiles.d.ts +174 -0
- package/dist/shipping/fulfillment-profiles.js +104 -0
- package/dist/shipping/hendriks.d.ts +97 -0
- package/dist/shipping/hendriks.js +50 -0
- package/dist/shipping/index.d.ts +54 -0
- package/dist/shipping/index.js +27 -0
- package/dist/shipping/methods.d.ts +205 -0
- package/dist/shipping/methods.js +240 -0
- package/dist/shipping/myparcel.d.ts +668 -0
- package/dist/shipping/myparcel.js +466 -0
- package/dist/shipping/parcel-count-suggestion.d.ts +2 -0
- package/dist/shipping/parcel-rule.d.ts +6 -5
- package/dist/shipping/parcel-rule.js +21 -23
- package/dist/shipping/rate-tables.d.ts +324 -0
- package/dist/shipping/rate-tables.js +390 -0
- package/dist/shipping/ship-to-countries.d.ts +75 -0
- package/dist/shipping/ship-to-countries.js +47 -0
- package/dist/stock/by-location.d.ts +86 -0
- package/dist/stock/by-location.js +94 -0
- package/dist/stock/index.d.ts +18 -4
- package/dist/stock/index.js +7 -0
- package/dist/stock/locations.d.ts +144 -0
- package/dist/stock/locations.js +168 -0
- package/dist/stock/settings.d.ts +106 -0
- package/dist/stock/settings.js +103 -0
- package/dist/stock/transfers.d.ts +386 -52
- package/dist/stock/transfers.js +222 -17
- package/dist/stored-value/index.d.ts +312 -11
- package/dist/stored-value/index.js +223 -4
- package/dist/subscriptions/index.d.ts +682 -0
- package/dist/subscriptions/index.js +815 -0
- package/dist/tax/display-policy.d.ts +105 -0
- package/dist/tax/display-policy.js +84 -0
- package/dist/tax/index.d.ts +79 -1
- package/dist/tax/index.js +52 -0
- package/dist/tenant/email-style.d.ts +102 -0
- package/dist/tenant/email-style.js +72 -0
- package/dist/tenant/email-templates.d.ts +287 -0
- package/dist/tenant/email-templates.js +271 -0
- package/dist/tenant/notifications.d.ts +23 -17
- package/dist/tenant/settings-sources.d.ts +1 -1
- package/dist/tenant/time-zone.d.ts +17 -0
- package/dist/tenant/time-zone.js +11 -0
- package/dist/types.d.ts +50 -3
- package/dist/users/index.d.ts +3 -0
- package/dist/users/index.js +2 -0
- package/dist/users/warehouses.d.ts +50 -0
- package/dist/users/warehouses.js +51 -0
- package/package.json +2 -2
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { type Page, type Transport } from '@sixtyninecommerce/core';
|
|
2
|
+
import type { Call, ListOptions } from '../types.js';
|
|
3
|
+
import type { PurchaseOrderLocation, PurchaseOrderSupplier } from './purchase-orders.js';
|
|
4
|
+
/** A receipt, or the reversal that takes goods of one back. A string on the wire. */
|
|
5
|
+
export type GoodsReceiptKind = 'receipt' | 'reversal' | (string & {});
|
|
6
|
+
/** One lot of a receipt line: captured for traceability; stock is not tracked per lot. */
|
|
7
|
+
export interface GoodsReceiptTraceability {
|
|
8
|
+
lot: string | null;
|
|
9
|
+
/** `YYYY-MM-DD`. */
|
|
10
|
+
expiresOn: string | null;
|
|
11
|
+
serials: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* One line of a goods receipt: what arrived for one purchase order line, in base (stock) units
|
|
15
|
+
* (purchase-orders spec §7.1, §8.6). Costs are decimal strings of minor units with six decimals,
|
|
16
|
+
* the exchange rate one with eight: parse them with a decimal library, not `Number`.
|
|
17
|
+
*/
|
|
18
|
+
export interface GoodsReceiptLine {
|
|
19
|
+
id: string;
|
|
20
|
+
goodsReceiptId: string;
|
|
21
|
+
purchaseOrderId: string;
|
|
22
|
+
/** The purchase order's number. */
|
|
23
|
+
purchaseOrderCode: string;
|
|
24
|
+
purchaseOrderLineId: string;
|
|
25
|
+
/** On a reversal line, the receipt line it takes goods back from. */
|
|
26
|
+
reversesLineId: string | null;
|
|
27
|
+
productVariantId: string;
|
|
28
|
+
/** The purchase order line's snapshots. */
|
|
29
|
+
sku: string;
|
|
30
|
+
name: string;
|
|
31
|
+
supplierSku: string | null;
|
|
32
|
+
purchaseUnitLabel: string | null;
|
|
33
|
+
purchaseUnitFactor: number;
|
|
34
|
+
/** Base units that entered stock (on a reversal line: that left it again). */
|
|
35
|
+
acceptedBaseQuantity: number;
|
|
36
|
+
/** Base units refused at the door: no stock moved; they stay open on the order line. */
|
|
37
|
+
rejectedBaseQuantity: number;
|
|
38
|
+
rejectReason: string | null;
|
|
39
|
+
overReceiptReason: string | null;
|
|
40
|
+
/**
|
|
41
|
+
* What the supplier's no-backorders rule cancelled of the order line's remainder; on a
|
|
42
|
+
* reversal line, minus what it gave back. 0 otherwise.
|
|
43
|
+
*/
|
|
44
|
+
cancelledBaseQuantity: number;
|
|
45
|
+
/** On a receipt line, what reversals took back of it so far; 0 on a reversal line. */
|
|
46
|
+
reversedBaseQuantity: number;
|
|
47
|
+
/**
|
|
48
|
+
* On a receipt line, what supplier returns from stock (not cancelled, drafts included) take of
|
|
49
|
+
* its accepted units; a reversal can no longer take those back. 0 on a reversal line.
|
|
50
|
+
*/
|
|
51
|
+
returnedBaseQuantity: number;
|
|
52
|
+
/** On a receipt line, what supplier returns of refused goods take of its rejected units. */
|
|
53
|
+
returnedRejectedBaseQuantity: number;
|
|
54
|
+
/** The purchase order's currency (what the supplier is paid in). */
|
|
55
|
+
supplierCurrencyCode: string;
|
|
56
|
+
unitCostSupplierCurrency: string;
|
|
57
|
+
/** Units of the purchasing currency per unit of `supplierCurrencyCode`. */
|
|
58
|
+
fxRate: string;
|
|
59
|
+
/** `platform` (the synced rate of the receipt day, or up to 7 days earlier) or `override`. */
|
|
60
|
+
fxRateSource: 'platform' | 'override' | (string & {});
|
|
61
|
+
/** The platform rate's own date (ISO-8601); null for an override or the purchasing currency. */
|
|
62
|
+
fxRateDate: string | null;
|
|
63
|
+
/** Per base unit, minor units of the receipt's `currencyCode`. */
|
|
64
|
+
unitCostEntityCurrency: string;
|
|
65
|
+
/** What the weighted average took in per base unit, minor units of `currencyCode`. */
|
|
66
|
+
landedUnitCost: string;
|
|
67
|
+
traceability: GoodsReceiptTraceability[];
|
|
68
|
+
stockMovementId: string | null;
|
|
69
|
+
externalLineId: string | null;
|
|
70
|
+
/** ISO-8601 UTC. */
|
|
71
|
+
createdAt: string;
|
|
72
|
+
}
|
|
73
|
+
/** A goods receipt that refers to another (a reversal of it). */
|
|
74
|
+
export interface GoodsReceiptReference {
|
|
75
|
+
id: string;
|
|
76
|
+
code: string;
|
|
77
|
+
/** ISO-8601 UTC. */
|
|
78
|
+
createdAt: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* A goods receipt of the active store's PURCHASING SCOPE (purchase-orders spec §7.1, §8.6, §8.7):
|
|
82
|
+
* the goods one supplier delivered at one stock location against lines of its sent purchase
|
|
83
|
+
* orders, or (`kind: 'reversal'`) the counter-document taking goods of an earlier receipt back.
|
|
84
|
+
* Immutable: every correction is another document.
|
|
85
|
+
*/
|
|
86
|
+
export interface GoodsReceipt {
|
|
87
|
+
id: string;
|
|
88
|
+
/** The legal entity's id, or `sandbox:<channelId>` for a sandbox store. */
|
|
89
|
+
scopeId: string;
|
|
90
|
+
legalEntityId: string | null;
|
|
91
|
+
/** The store that posted it. */
|
|
92
|
+
originChannelId: string;
|
|
93
|
+
/** The goods-receipt number (a reversal takes the next one of the same series). */
|
|
94
|
+
code: string;
|
|
95
|
+
kind: GoodsReceiptKind;
|
|
96
|
+
reversesReceiptId: string | null;
|
|
97
|
+
reversesReceiptCode: string | null;
|
|
98
|
+
supplierId: string;
|
|
99
|
+
supplier: PurchaseOrderSupplier | null;
|
|
100
|
+
stockLocationId: string;
|
|
101
|
+
stockLocation: PurchaseOrderLocation | null;
|
|
102
|
+
/** The day the goods arrived (`YYYY-MM-DD`) in the location's time zone. */
|
|
103
|
+
receivedOn: string;
|
|
104
|
+
/** ISO-8601 UTC. */
|
|
105
|
+
receivedAt: string;
|
|
106
|
+
/** The purchasing currency the lines' entity-currency costs are in. */
|
|
107
|
+
currencyCode: string;
|
|
108
|
+
supplierDeliveryRef: string | null;
|
|
109
|
+
/** Why a reversal takes the goods back. */
|
|
110
|
+
reason: string | null;
|
|
111
|
+
managedBy: string | null;
|
|
112
|
+
externalId: string | null;
|
|
113
|
+
externalNumber: string | null;
|
|
114
|
+
/** Who received: a credential's staff reference, else `<kind>:<id>` of the caller. */
|
|
115
|
+
actorRef: string | null;
|
|
116
|
+
createdByRef: string | null;
|
|
117
|
+
/** Its reversals, oldest first; empty on a reversal. */
|
|
118
|
+
reversals: GoodsReceiptReference[];
|
|
119
|
+
lines: GoodsReceiptLine[];
|
|
120
|
+
/** ISO-8601 UTC. */
|
|
121
|
+
createdAt: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* A line of a SENT purchase order the active store can receive at one of its stock locations,
|
|
125
|
+
* with the keys a scan resolves (spec §8.6.1: supplier barcode → supplier SKU → GTIN → SKU) and
|
|
126
|
+
* what it may still accept within its over-receipt tolerance (§8.6.2). Quantities in base units.
|
|
127
|
+
*/
|
|
128
|
+
export interface ReceivablePurchaseOrderLine {
|
|
129
|
+
purchaseOrderId: string;
|
|
130
|
+
purchaseOrderCode: string;
|
|
131
|
+
purchaseOrderLineId: string;
|
|
132
|
+
position: number;
|
|
133
|
+
supplierId: string;
|
|
134
|
+
supplier: PurchaseOrderSupplier;
|
|
135
|
+
stockLocationId: string;
|
|
136
|
+
productVariantId: string;
|
|
137
|
+
sku: string;
|
|
138
|
+
name: string;
|
|
139
|
+
supplierSku: string | null;
|
|
140
|
+
supplierBarcode: string | null;
|
|
141
|
+
gtin: string | null;
|
|
142
|
+
purchaseUnitLabel: string | null;
|
|
143
|
+
purchaseUnitFactor: number;
|
|
144
|
+
orderedBaseQuantity: number;
|
|
145
|
+
cancelledBaseQuantity: number;
|
|
146
|
+
receivedBaseQuantity: number;
|
|
147
|
+
returnedForReplacementBaseQuantity: number;
|
|
148
|
+
/** ordered − cancelled − received + returned for replacement; below 0 is over-received. */
|
|
149
|
+
remainingBaseQuantity: number;
|
|
150
|
+
/** The over-receipt allowance in base units. */
|
|
151
|
+
toleranceBaseQuantity: number;
|
|
152
|
+
/** What the line may still accept without `ReceiveOverTolerance`. */
|
|
153
|
+
maxAcceptedBaseQuantity: number;
|
|
154
|
+
confirmedBaseQuantity: number | null;
|
|
155
|
+
/** `YYYY-MM-DD`: the confirmed day, else the requested one. */
|
|
156
|
+
expectedOn: string | null;
|
|
157
|
+
}
|
|
158
|
+
export interface GoodsReceiptListOptions extends ListOptions {
|
|
159
|
+
/** Receipts with a line of this purchase order. */
|
|
160
|
+
purchaseOrderId?: string;
|
|
161
|
+
supplierId?: string;
|
|
162
|
+
stockLocationId?: string;
|
|
163
|
+
kind?: 'receipt' | 'reversal';
|
|
164
|
+
/** Matches the number or the supplier's delivery reference, case-insensitively, as typed. */
|
|
165
|
+
term?: string;
|
|
166
|
+
}
|
|
167
|
+
export interface ReceivablePurchaseOrderLinesOptions extends Call {
|
|
168
|
+
supplierId?: string;
|
|
169
|
+
/** A stock location of the active store; every one of its locations when left out. */
|
|
170
|
+
stockLocationId?: string;
|
|
171
|
+
purchaseOrderId?: string;
|
|
172
|
+
}
|
|
173
|
+
export interface GoodsReceiptTraceabilityInput {
|
|
174
|
+
lot?: string | null;
|
|
175
|
+
/** `YYYY-MM-DD`. */
|
|
176
|
+
expiresOn?: string | null;
|
|
177
|
+
serials?: string[] | null;
|
|
178
|
+
}
|
|
179
|
+
export interface PostGoodsReceiptLineInput {
|
|
180
|
+
purchaseOrderLineId: string;
|
|
181
|
+
/** Base units that enter stock; 0 when everything was refused. */
|
|
182
|
+
acceptedBaseQuantity: number;
|
|
183
|
+
/** Base units refused at the door. */
|
|
184
|
+
rejectedBaseQuantity?: number;
|
|
185
|
+
/** Required with a rejected quantity. */
|
|
186
|
+
rejectReason?: string;
|
|
187
|
+
/** Required, with `ReceiveOverTolerance`, when the line accepts more than its tolerance. */
|
|
188
|
+
overReceiptReason?: string;
|
|
189
|
+
traceability?: GoodsReceiptTraceabilityInput[];
|
|
190
|
+
}
|
|
191
|
+
export interface PostGoodsReceiptInput {
|
|
192
|
+
/** The lines' supplier; named, it must be theirs. */
|
|
193
|
+
supplierId?: string;
|
|
194
|
+
/** Where the lines' orders deliver to; named, it must be theirs. */
|
|
195
|
+
stockLocationId?: string;
|
|
196
|
+
/** `YYYY-MM-DD` in the location's time zone; today when left out. */
|
|
197
|
+
receivedOn?: string;
|
|
198
|
+
supplierDeliveryRef?: string;
|
|
199
|
+
/** Rates stated instead of the platform's (needs `ManageInventoryCost`). */
|
|
200
|
+
fxRates?: Array<{
|
|
201
|
+
currencyCode: string;
|
|
202
|
+
rate: string;
|
|
203
|
+
}>;
|
|
204
|
+
lines: PostGoodsReceiptLineInput[];
|
|
205
|
+
}
|
|
206
|
+
export interface ReverseGoodsReceiptInput {
|
|
207
|
+
goodsReceiptId: string;
|
|
208
|
+
/** Why the receipt was wrong. */
|
|
209
|
+
reason: string;
|
|
210
|
+
/** Left out: every line, all it still holds. */
|
|
211
|
+
lines?: Array<{
|
|
212
|
+
goodsReceiptLineId: string;
|
|
213
|
+
baseQuantity: number;
|
|
214
|
+
}>;
|
|
215
|
+
}
|
|
216
|
+
/** A receipt write must carry its idempotency key (spec §8.6.1, §10.1). */
|
|
217
|
+
export type GoodsReceiptKeyedCall = Call & {
|
|
218
|
+
idempotencyKey: string;
|
|
219
|
+
};
|
|
220
|
+
/** What a landed charge paid for. A string on the wire. */
|
|
221
|
+
export type LandedChargeKind = 'freight' | 'duty' | 'fee' | 'other' | (string & {});
|
|
222
|
+
/** How a landed charge is spread over a receipt's lines. A string on the wire. */
|
|
223
|
+
export type LandedChargeAllocationBasis = 'value' | 'quantity' | 'weight' | (string & {});
|
|
224
|
+
/** One receipt line's share of a landed charge, frozen when the charge was applied. */
|
|
225
|
+
export interface LandedChargeAllocation {
|
|
226
|
+
goodsReceiptLineId: string;
|
|
227
|
+
productVariantId: string;
|
|
228
|
+
/** The base units the line still held of the receipt (accepted less reversed) when applied. */
|
|
229
|
+
baseQuantity: number;
|
|
230
|
+
/** Its value in minor units (by value), its base units (quantity) or its grams (weight). */
|
|
231
|
+
basis: string;
|
|
232
|
+
/** The line's share, minor units of the receipt's `currencyCode` (six decimals). */
|
|
233
|
+
amount: string;
|
|
234
|
+
/** What the line's `landedUnitCost` rose by, per base unit. */
|
|
235
|
+
unitCostDelta: string;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* A landed charge (purchase-orders spec §8.10.4): freight, duty or a fee paid to get a receipt's
|
|
239
|
+
* goods in, spread over its accepted lines and taken into their weighted average cost. Never
|
|
240
|
+
* deleted: a removed one keeps `removedAt` and its reason.
|
|
241
|
+
*/
|
|
242
|
+
export interface LandedCharge {
|
|
243
|
+
id: string;
|
|
244
|
+
/** The posted receipt it is allocated over. */
|
|
245
|
+
goodsReceiptId: string | null;
|
|
246
|
+
/** The purchase order a charge entered on an order belongs to; null for a receipt's own. */
|
|
247
|
+
purchaseOrderId: string | null;
|
|
248
|
+
kind: LandedChargeKind;
|
|
249
|
+
label: string | null;
|
|
250
|
+
payeeSupplierId: string | null;
|
|
251
|
+
payeeSupplier: PurchaseOrderSupplier | null;
|
|
252
|
+
/** Who billed it, as free text (a forwarder that is no supplier). */
|
|
253
|
+
payeeName: string | null;
|
|
254
|
+
/** What the payee billed in. */
|
|
255
|
+
currencyCode: string;
|
|
256
|
+
/** Whole minor units of `currencyCode`. */
|
|
257
|
+
amount: number;
|
|
258
|
+
allocation: LandedChargeAllocationBasis;
|
|
259
|
+
/** `YYYY-MM-DD` in the legal entity's time zone. */
|
|
260
|
+
incurredOn: string;
|
|
261
|
+
/** Units of the purchasing currency per unit of `currencyCode` (eight decimals). */
|
|
262
|
+
fxRate: string;
|
|
263
|
+
/** `platform` (the synced rate of `incurredOn`, or up to 7 days earlier) or `override`. */
|
|
264
|
+
fxRateSource: 'platform' | 'override' | (string & {});
|
|
265
|
+
/** ISO-8601; null for an override or a charge in the purchasing currency. */
|
|
266
|
+
fxRateDate: string | null;
|
|
267
|
+
/** The amount in minor units of the receipt's `currencyCode` (six decimals). */
|
|
268
|
+
amountEntityCurrency: string;
|
|
269
|
+
allocations: LandedChargeAllocation[];
|
|
270
|
+
/** ISO-8601 UTC. */
|
|
271
|
+
appliedAt: string | null;
|
|
272
|
+
/** ISO-8601 UTC; null while the charge stands. */
|
|
273
|
+
removedAt: string | null;
|
|
274
|
+
removeReason: string | null;
|
|
275
|
+
removedByRef: string | null;
|
|
276
|
+
createdByRef: string | null;
|
|
277
|
+
/** ISO-8601 UTC. */
|
|
278
|
+
createdAt: string;
|
|
279
|
+
}
|
|
280
|
+
/** A goods receipt with its landed charges, as `get` and the charge writes answer it. */
|
|
281
|
+
export interface GoodsReceiptDetail extends GoodsReceipt {
|
|
282
|
+
/** Oldest first, removed ones included (`removedAt` set); empty on a reversal. */
|
|
283
|
+
charges: LandedCharge[];
|
|
284
|
+
}
|
|
285
|
+
export interface AddGoodsReceiptChargeInput {
|
|
286
|
+
/** A posted receipt (not a reversal). */
|
|
287
|
+
goodsReceiptId: string;
|
|
288
|
+
kind: 'freight' | 'duty' | 'fee' | 'other';
|
|
289
|
+
label?: string;
|
|
290
|
+
/** A supplier of the legal entity that billed it; or `payeeName`, never both. */
|
|
291
|
+
payeeSupplierId?: string;
|
|
292
|
+
payeeName?: string;
|
|
293
|
+
/** What the payee billed in; the receipt's (purchasing) currency when left out. */
|
|
294
|
+
currencyCode?: string;
|
|
295
|
+
/** Whole minor units of `currencyCode`, above 0. */
|
|
296
|
+
amount: number;
|
|
297
|
+
/** `value` when left out. */
|
|
298
|
+
allocation?: 'value' | 'quantity' | 'weight';
|
|
299
|
+
/** `YYYY-MM-DD` in the legal entity's time zone; today when left out. */
|
|
300
|
+
incurredOn?: string;
|
|
301
|
+
/** A rate stated instead of the platform's (a charge in another currency only). */
|
|
302
|
+
fxRate?: string;
|
|
303
|
+
}
|
|
304
|
+
export interface RemoveGoodsReceiptChargeInput {
|
|
305
|
+
chargeId: string;
|
|
306
|
+
/** Why the charge comes off. */
|
|
307
|
+
reason: string;
|
|
308
|
+
}
|
|
309
|
+
export declare const GOODS_RECEIPT_LINE_FIELDS = "\n id\n goodsReceiptId\n purchaseOrderId\n purchaseOrderCode\n purchaseOrderLineId\n reversesLineId\n productVariantId\n sku\n name\n supplierSku\n purchaseUnitLabel\n purchaseUnitFactor\n acceptedBaseQuantity\n rejectedBaseQuantity\n rejectReason\n overReceiptReason\n cancelledBaseQuantity\n reversedBaseQuantity\n returnedBaseQuantity\n returnedRejectedBaseQuantity\n supplierCurrencyCode\n unitCostSupplierCurrency\n fxRate\n fxRateSource\n fxRateDate\n unitCostEntityCurrency\n landedUnitCost\n traceability { lot expiresOn serials }\n stockMovementId\n externalLineId\n createdAt\n";
|
|
310
|
+
export declare const GOODS_RECEIPT_FIELDS = "\n id\n scopeId\n legalEntityId\n originChannelId\n code\n kind\n reversesReceiptId\n reversesReceiptCode\n supplierId\n supplier { id code name status }\n stockLocationId\n stockLocation { id name }\n receivedOn\n receivedAt\n currencyCode\n supplierDeliveryRef\n reason\n managedBy\n externalId\n externalNumber\n actorRef\n createdByRef\n reversals { id code createdAt }\n lines { \n id\n goodsReceiptId\n purchaseOrderId\n purchaseOrderCode\n purchaseOrderLineId\n reversesLineId\n productVariantId\n sku\n name\n supplierSku\n purchaseUnitLabel\n purchaseUnitFactor\n acceptedBaseQuantity\n rejectedBaseQuantity\n rejectReason\n overReceiptReason\n cancelledBaseQuantity\n reversedBaseQuantity\n returnedBaseQuantity\n returnedRejectedBaseQuantity\n supplierCurrencyCode\n unitCostSupplierCurrency\n fxRate\n fxRateSource\n fxRateDate\n unitCostEntityCurrency\n landedUnitCost\n traceability { lot expiresOn serials }\n stockMovementId\n externalLineId\n createdAt\n }\n createdAt\n";
|
|
311
|
+
export declare const LANDED_CHARGE_FIELDS = "\n id\n goodsReceiptId\n purchaseOrderId\n kind\n label\n payeeSupplierId\n payeeSupplier { id code name status }\n payeeName\n currencyCode\n amount\n allocation\n incurredOn\n fxRate\n fxRateSource\n fxRateDate\n amountEntityCurrency\n allocations { goodsReceiptLineId productVariantId baseQuantity basis amount unitCostDelta }\n appliedAt\n removedAt\n removeReason\n removedByRef\n createdByRef\n createdAt\n";
|
|
312
|
+
/** A receipt with its landed charges: `get` and the charge writes. */
|
|
313
|
+
export declare const GOODS_RECEIPT_DETAIL_FIELDS = "\n \n id\n scopeId\n legalEntityId\n originChannelId\n code\n kind\n reversesReceiptId\n reversesReceiptCode\n supplierId\n supplier { id code name status }\n stockLocationId\n stockLocation { id name }\n receivedOn\n receivedAt\n currencyCode\n supplierDeliveryRef\n reason\n managedBy\n externalId\n externalNumber\n actorRef\n createdByRef\n reversals { id code createdAt }\n lines { \n id\n goodsReceiptId\n purchaseOrderId\n purchaseOrderCode\n purchaseOrderLineId\n reversesLineId\n productVariantId\n sku\n name\n supplierSku\n purchaseUnitLabel\n purchaseUnitFactor\n acceptedBaseQuantity\n rejectedBaseQuantity\n rejectReason\n overReceiptReason\n cancelledBaseQuantity\n reversedBaseQuantity\n returnedBaseQuantity\n returnedRejectedBaseQuantity\n supplierCurrencyCode\n unitCostSupplierCurrency\n fxRate\n fxRateSource\n fxRateDate\n unitCostEntityCurrency\n landedUnitCost\n traceability { lot expiresOn serials }\n stockMovementId\n externalLineId\n createdAt\n }\n createdAt\n\n charges { \n id\n goodsReceiptId\n purchaseOrderId\n kind\n label\n payeeSupplierId\n payeeSupplier { id code name status }\n payeeName\n currencyCode\n amount\n allocation\n incurredOn\n fxRate\n fxRateSource\n fxRateDate\n amountEntityCurrency\n allocations { goodsReceiptLineId productVariantId baseQuantity basis amount unitCostDelta }\n appliedAt\n removedAt\n removeReason\n removedByRef\n createdByRef\n createdAt\n }\n";
|
|
314
|
+
export declare const RECEIVABLE_LINE_FIELDS = "\n purchaseOrderId\n purchaseOrderCode\n purchaseOrderLineId\n position\n supplierId\n supplier { id code name status }\n stockLocationId\n productVariantId\n sku\n name\n supplierSku\n supplierBarcode\n gtin\n purchaseUnitLabel\n purchaseUnitFactor\n orderedBaseQuantity\n cancelledBaseQuantity\n receivedBaseQuantity\n returnedForReplacementBaseQuantity\n remainingBaseQuantity\n toleranceBaseQuantity\n maxAcceptedBaseQuantity\n confirmedBaseQuantity\n expectedOn\n";
|
|
315
|
+
export declare const GOODS_RECEIPTS_QUERY = "\n query GoodsReceipts($options: GoodsReceiptListOptions) {\n goodsReceipts(options: $options) {\n items { \n id\n scopeId\n legalEntityId\n originChannelId\n code\n kind\n reversesReceiptId\n reversesReceiptCode\n supplierId\n supplier { id code name status }\n stockLocationId\n stockLocation { id name }\n receivedOn\n receivedAt\n currencyCode\n supplierDeliveryRef\n reason\n managedBy\n externalId\n externalNumber\n actorRef\n createdByRef\n reversals { id code createdAt }\n lines { \n id\n goodsReceiptId\n purchaseOrderId\n purchaseOrderCode\n purchaseOrderLineId\n reversesLineId\n productVariantId\n sku\n name\n supplierSku\n purchaseUnitLabel\n purchaseUnitFactor\n acceptedBaseQuantity\n rejectedBaseQuantity\n rejectReason\n overReceiptReason\n cancelledBaseQuantity\n reversedBaseQuantity\n returnedBaseQuantity\n returnedRejectedBaseQuantity\n supplierCurrencyCode\n unitCostSupplierCurrency\n fxRate\n fxRateSource\n fxRateDate\n unitCostEntityCurrency\n landedUnitCost\n traceability { lot expiresOn serials }\n stockMovementId\n externalLineId\n createdAt\n }\n createdAt\n }\n totalItems\n }\n }\n";
|
|
316
|
+
export declare const GOODS_RECEIPT_QUERY = "\n query GoodsReceipt($id: ID!) {\n goodsReceipt(id: $id) { \n \n id\n scopeId\n legalEntityId\n originChannelId\n code\n kind\n reversesReceiptId\n reversesReceiptCode\n supplierId\n supplier { id code name status }\n stockLocationId\n stockLocation { id name }\n receivedOn\n receivedAt\n currencyCode\n supplierDeliveryRef\n reason\n managedBy\n externalId\n externalNumber\n actorRef\n createdByRef\n reversals { id code createdAt }\n lines { \n id\n goodsReceiptId\n purchaseOrderId\n purchaseOrderCode\n purchaseOrderLineId\n reversesLineId\n productVariantId\n sku\n name\n supplierSku\n purchaseUnitLabel\n purchaseUnitFactor\n acceptedBaseQuantity\n rejectedBaseQuantity\n rejectReason\n overReceiptReason\n cancelledBaseQuantity\n reversedBaseQuantity\n returnedBaseQuantity\n returnedRejectedBaseQuantity\n supplierCurrencyCode\n unitCostSupplierCurrency\n fxRate\n fxRateSource\n fxRateDate\n unitCostEntityCurrency\n landedUnitCost\n traceability { lot expiresOn serials }\n stockMovementId\n externalLineId\n createdAt\n }\n createdAt\n\n charges { \n id\n goodsReceiptId\n purchaseOrderId\n kind\n label\n payeeSupplierId\n payeeSupplier { id code name status }\n payeeName\n currencyCode\n amount\n allocation\n incurredOn\n fxRate\n fxRateSource\n fxRateDate\n amountEntityCurrency\n allocations { goodsReceiptLineId productVariantId baseQuantity basis amount unitCostDelta }\n appliedAt\n removedAt\n removeReason\n removedByRef\n createdByRef\n createdAt\n }\n }\n }\n";
|
|
317
|
+
export declare const RECEIVABLE_PURCHASE_ORDER_LINES_QUERY = "\n query ReceivablePurchaseOrderLines($options: ReceivablePurchaseOrderLinesOptions) {\n receivablePurchaseOrderLines(options: $options) { \n purchaseOrderId\n purchaseOrderCode\n purchaseOrderLineId\n position\n supplierId\n supplier { id code name status }\n stockLocationId\n productVariantId\n sku\n name\n supplierSku\n supplierBarcode\n gtin\n purchaseUnitLabel\n purchaseUnitFactor\n orderedBaseQuantity\n cancelledBaseQuantity\n receivedBaseQuantity\n returnedForReplacementBaseQuantity\n remainingBaseQuantity\n toleranceBaseQuantity\n maxAcceptedBaseQuantity\n confirmedBaseQuantity\n expectedOn\n }\n }\n";
|
|
318
|
+
export declare const POST_GOODS_RECEIPT_MUTATION = "\n mutation PostGoodsReceipt($input: PostGoodsReceiptInput!, $idempotencyKey: String!) {\n postGoodsReceipt(input: $input, idempotencyKey: $idempotencyKey) { \n id\n scopeId\n legalEntityId\n originChannelId\n code\n kind\n reversesReceiptId\n reversesReceiptCode\n supplierId\n supplier { id code name status }\n stockLocationId\n stockLocation { id name }\n receivedOn\n receivedAt\n currencyCode\n supplierDeliveryRef\n reason\n managedBy\n externalId\n externalNumber\n actorRef\n createdByRef\n reversals { id code createdAt }\n lines { \n id\n goodsReceiptId\n purchaseOrderId\n purchaseOrderCode\n purchaseOrderLineId\n reversesLineId\n productVariantId\n sku\n name\n supplierSku\n purchaseUnitLabel\n purchaseUnitFactor\n acceptedBaseQuantity\n rejectedBaseQuantity\n rejectReason\n overReceiptReason\n cancelledBaseQuantity\n reversedBaseQuantity\n returnedBaseQuantity\n returnedRejectedBaseQuantity\n supplierCurrencyCode\n unitCostSupplierCurrency\n fxRate\n fxRateSource\n fxRateDate\n unitCostEntityCurrency\n landedUnitCost\n traceability { lot expiresOn serials }\n stockMovementId\n externalLineId\n createdAt\n }\n createdAt\n }\n }\n";
|
|
319
|
+
export declare const REVERSE_GOODS_RECEIPT_MUTATION = "\n mutation ReverseGoodsReceipt($input: ReverseGoodsReceiptInput!, $idempotencyKey: String!) {\n reverseGoodsReceipt(input: $input, idempotencyKey: $idempotencyKey) {\n \n id\n scopeId\n legalEntityId\n originChannelId\n code\n kind\n reversesReceiptId\n reversesReceiptCode\n supplierId\n supplier { id code name status }\n stockLocationId\n stockLocation { id name }\n receivedOn\n receivedAt\n currencyCode\n supplierDeliveryRef\n reason\n managedBy\n externalId\n externalNumber\n actorRef\n createdByRef\n reversals { id code createdAt }\n lines { \n id\n goodsReceiptId\n purchaseOrderId\n purchaseOrderCode\n purchaseOrderLineId\n reversesLineId\n productVariantId\n sku\n name\n supplierSku\n purchaseUnitLabel\n purchaseUnitFactor\n acceptedBaseQuantity\n rejectedBaseQuantity\n rejectReason\n overReceiptReason\n cancelledBaseQuantity\n reversedBaseQuantity\n returnedBaseQuantity\n returnedRejectedBaseQuantity\n supplierCurrencyCode\n unitCostSupplierCurrency\n fxRate\n fxRateSource\n fxRateDate\n unitCostEntityCurrency\n landedUnitCost\n traceability { lot expiresOn serials }\n stockMovementId\n externalLineId\n createdAt\n }\n createdAt\n\n }\n }\n";
|
|
320
|
+
export declare const ADD_GOODS_RECEIPT_CHARGE_MUTATION = "\n mutation AddGoodsReceiptCharge($input: AddGoodsReceiptChargeInput!, $idempotencyKey: String) {\n addGoodsReceiptCharge(input: $input, idempotencyKey: $idempotencyKey) {\n \n \n id\n scopeId\n legalEntityId\n originChannelId\n code\n kind\n reversesReceiptId\n reversesReceiptCode\n supplierId\n supplier { id code name status }\n stockLocationId\n stockLocation { id name }\n receivedOn\n receivedAt\n currencyCode\n supplierDeliveryRef\n reason\n managedBy\n externalId\n externalNumber\n actorRef\n createdByRef\n reversals { id code createdAt }\n lines { \n id\n goodsReceiptId\n purchaseOrderId\n purchaseOrderCode\n purchaseOrderLineId\n reversesLineId\n productVariantId\n sku\n name\n supplierSku\n purchaseUnitLabel\n purchaseUnitFactor\n acceptedBaseQuantity\n rejectedBaseQuantity\n rejectReason\n overReceiptReason\n cancelledBaseQuantity\n reversedBaseQuantity\n returnedBaseQuantity\n returnedRejectedBaseQuantity\n supplierCurrencyCode\n unitCostSupplierCurrency\n fxRate\n fxRateSource\n fxRateDate\n unitCostEntityCurrency\n landedUnitCost\n traceability { lot expiresOn serials }\n stockMovementId\n externalLineId\n createdAt\n }\n createdAt\n\n charges { \n id\n goodsReceiptId\n purchaseOrderId\n kind\n label\n payeeSupplierId\n payeeSupplier { id code name status }\n payeeName\n currencyCode\n amount\n allocation\n incurredOn\n fxRate\n fxRateSource\n fxRateDate\n amountEntityCurrency\n allocations { goodsReceiptLineId productVariantId baseQuantity basis amount unitCostDelta }\n appliedAt\n removedAt\n removeReason\n removedByRef\n createdByRef\n createdAt\n }\n\n }\n }\n";
|
|
321
|
+
export declare const REMOVE_GOODS_RECEIPT_CHARGE_MUTATION = "\n mutation RemoveGoodsReceiptCharge(\n $input: RemoveGoodsReceiptChargeInput!\n $idempotencyKey: String\n ) {\n removeGoodsReceiptCharge(input: $input, idempotencyKey: $idempotencyKey) {\n \n \n id\n scopeId\n legalEntityId\n originChannelId\n code\n kind\n reversesReceiptId\n reversesReceiptCode\n supplierId\n supplier { id code name status }\n stockLocationId\n stockLocation { id name }\n receivedOn\n receivedAt\n currencyCode\n supplierDeliveryRef\n reason\n managedBy\n externalId\n externalNumber\n actorRef\n createdByRef\n reversals { id code createdAt }\n lines { \n id\n goodsReceiptId\n purchaseOrderId\n purchaseOrderCode\n purchaseOrderLineId\n reversesLineId\n productVariantId\n sku\n name\n supplierSku\n purchaseUnitLabel\n purchaseUnitFactor\n acceptedBaseQuantity\n rejectedBaseQuantity\n rejectReason\n overReceiptReason\n cancelledBaseQuantity\n reversedBaseQuantity\n returnedBaseQuantity\n returnedRejectedBaseQuantity\n supplierCurrencyCode\n unitCostSupplierCurrency\n fxRate\n fxRateSource\n fxRateDate\n unitCostEntityCurrency\n landedUnitCost\n traceability { lot expiresOn serials }\n stockMovementId\n externalLineId\n createdAt\n }\n createdAt\n\n charges { \n id\n goodsReceiptId\n purchaseOrderId\n kind\n label\n payeeSupplierId\n payeeSupplier { id code name status }\n payeeName\n currencyCode\n amount\n allocation\n incurredOn\n fxRate\n fxRateSource\n fxRateDate\n amountEntityCurrency\n allocations { goodsReceiptLineId productVariantId baseQuantity basis amount unitCostDelta }\n appliedAt\n removedAt\n removeReason\n removedByRef\n createdByRef\n createdAt\n }\n\n }\n }\n";
|
|
322
|
+
/**
|
|
323
|
+
* `admin.purchasing.receipts` (purchase-orders spec §10.1): receiving goods against the legal
|
|
324
|
+
* entity's sent purchase orders, and the receipts it posted. Every method needs the Purchasing
|
|
325
|
+
* plugin on the store and purchasing switched on for its legal entity (`PURCHASING_NOT_ENABLED`,
|
|
326
|
+
* 422; `PLUGIN_ACCESS_DENIED`, 403, for an ordinary caller). Reads need `ReadPurchaseOrder` or
|
|
327
|
+
* `ReceivePurchaseOrder`; `post` and `reverse` need `ReceivePurchaseOrder` on EVERY store of the
|
|
328
|
+
* legal entity (`SHARED_SELLER_NOT_ALLOWED`, 403) and REQUIRE an idempotency key: a retried
|
|
329
|
+
* receipt answers the first one, it never books the stock twice.
|
|
330
|
+
*/
|
|
331
|
+
export interface PurchasingReceiptsModule {
|
|
332
|
+
/** The scope's receipts and reversals, newest first. */
|
|
333
|
+
list(options?: GoodsReceiptListOptions): Promise<Page<GoodsReceipt>>;
|
|
334
|
+
/** One receipt, with its landed `charges`; null when none has that id in the scope. */
|
|
335
|
+
get(id: string, call?: Call): Promise<GoodsReceiptDetail | null>;
|
|
336
|
+
/**
|
|
337
|
+
* The lines of the scope's sent purchase orders delivering to a stock location of the active
|
|
338
|
+
* store (by order number and position, at most 1000): what the receiving screen and an
|
|
339
|
+
* integration can receive now, received-in-full lines included. Refusal:
|
|
340
|
+
* `LOCATION_NOT_IN_CHANNEL` (422) for a location of another store.
|
|
341
|
+
*/
|
|
342
|
+
receivable(options?: ReceivablePurchaseOrderLinesOptions): Promise<ReceivablePurchaseOrderLine[]>;
|
|
343
|
+
/**
|
|
344
|
+
* Receives goods against lines of sent purchase orders of ONE supplier at ONE stock location
|
|
345
|
+
* (spec §8.6): accepted units enter stock (reason `purchase_receipt`), the weighted average
|
|
346
|
+
* cost takes them in, the lines' received quantities grow, an order with nothing more to come
|
|
347
|
+
* closes, and incoming stock follows. Refusals: `RECEIPT_EXCEEDS_TOLERANCE` (422; `details`
|
|
348
|
+
* per line with `maxAcceptedBaseQuantity`: accepting more needs `ReceiveOverTolerance` and an
|
|
349
|
+
* `overReceiptReason`), `FX_RATE_UNAVAILABLE` (422, retry once the day's rate synced; the key
|
|
350
|
+
* is released), `FX_RATE_OVERRIDE_NOT_ALLOWED` (403), `FIELD_GROUP_LOCKED` (an app owns a
|
|
351
|
+
* variant's stock), `PURCHASE_ORDER_INVALID_TRANSITION` (422, an order not sent),
|
|
352
|
+
* `PURCHASE_ORDER_LINE_NOT_FOUND` (404), `LOCATION_NOT_IN_CHANNEL`, `LOCATION_NOT_ALLOWED`
|
|
353
|
+
* (403, a credential's or staff member's locations), `LOCATION_NOT_OWNED_BY_ENTITY`,
|
|
354
|
+
* `GOODS_RECEIPT_INVALID` (400).
|
|
355
|
+
*/
|
|
356
|
+
post(input: PostGoodsReceiptInput, call: GoodsReceiptKeyedCall): Promise<GoodsReceipt>;
|
|
357
|
+
/**
|
|
358
|
+
* Reverses a receipt, whole or per line (spec §8.7): the goods leave stock again, the cost goes
|
|
359
|
+
* back at each line's original landed cost, and a closed order reopens when quantity is open
|
|
360
|
+
* again. For mistakes; goods going back to the supplier are a return. Refusals:
|
|
361
|
+
* `GOODS_RECEIPT_NOT_FOUND` (404), `RECEIPT_ALREADY_REVERSED` (422; `details` per line with
|
|
362
|
+
* `reversibleBaseQuantity`), `STOCK_WOULD_GO_NEGATIVE` (422: move or recount stock first),
|
|
363
|
+
* `FIELD_GROUP_LOCKED`, `LOCATION_NOT_ALLOWED` (403), `GOODS_RECEIPT_INVALID` (400).
|
|
364
|
+
*/
|
|
365
|
+
reverse(input: ReverseGoodsReceiptInput, call: GoodsReceiptKeyedCall): Promise<GoodsReceipt>;
|
|
366
|
+
/** Landed charges on posted receipts (freight, duty, fees): `add` and `remove`. */
|
|
367
|
+
charges: GoodsReceiptChargesModule;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* `admin.purchasing.receipts.charges` (purchase-orders spec §8.10.4, §10.1): landed charges on a
|
|
371
|
+
* posted receipt. Both need `ManageInventoryCost` on EVERY store of the legal entity
|
|
372
|
+
* (`SHARED_SELLER_NOT_ALLOWED`, 403) and take an optional idempotency key: a repeat under the key
|
|
373
|
+
* answers the first call and charges once. Both answer the receipt with its `charges` and the
|
|
374
|
+
* lines' new `landedUnitCost`.
|
|
375
|
+
*/
|
|
376
|
+
export interface GoodsReceiptChargesModule {
|
|
377
|
+
/**
|
|
378
|
+
* Adds a charge: converted into the purchasing currency at the platform rate of `incurredOn`
|
|
379
|
+
* (or `fxRate`), allocated over the lines' units still held by value, quantity or weight; the
|
|
380
|
+
* share on units still on hand revalues the weighted average cost, the share on units sold since
|
|
381
|
+
* is recorded as unabsorbed, and each line's landed unit cost rises by its share. Refusals:
|
|
382
|
+
* `GOODS_RECEIPT_NOT_FOUND` (404), `LANDED_CHARGE_INVALID` (400), `LANDED_CHARGE_WEIGHT_MISSING`
|
|
383
|
+
* (422; `details` per variant), `LANDED_CHARGE_NOTHING_TO_ALLOCATE` (422),
|
|
384
|
+
* `FX_RATE_UNAVAILABLE` (422, retry once the rates synced), `SUPPLIER_NOT_FOUND` (404),
|
|
385
|
+
* `MANAGED_BY_PROVIDER` (422).
|
|
386
|
+
*/
|
|
387
|
+
add(input: AddGoodsReceiptChargeInput, call?: Call): Promise<GoodsReceiptDetail>;
|
|
388
|
+
/**
|
|
389
|
+
* Removes a charge: the share still on the lines' units comes back out of the average (units
|
|
390
|
+
* sold since keep theirs), the lines' landed cost drops by what it added, and the charge keeps
|
|
391
|
+
* `removedAt` and the reason. Refusals: `LANDED_CHARGE_NOT_FOUND` (404),
|
|
392
|
+
* `LANDED_CHARGE_ALREADY_REMOVED` (422), `LANDED_CHARGE_INVALID` (400).
|
|
393
|
+
*/
|
|
394
|
+
remove(input: RemoveGoodsReceiptChargeInput, call?: Call): Promise<GoodsReceiptDetail>;
|
|
395
|
+
}
|
|
396
|
+
export declare function createPurchasingReceiptsModule(transport: Transport): PurchasingReceiptsModule;
|