@flowselections/floriday-voorraad 1.0.125 → 1.0.127
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-lib/components/voorraad/StockSyncStatus.d.ts.map +1 -1
- package/dist-lib/components/voorraad/StockSyncStatus.js +1 -1
- package/dist-lib/components/voorraad/VoorraadTable.d.ts.map +1 -1
- package/dist-lib/components/voorraad/VoorraadTable.js +1 -1
- package/dist-lib/hooks/useLocalTradeItems.d.ts.map +1 -1
- package/dist-lib/hooks/useLocalTradeItems.js +3 -1
- package/dist-lib/hooks/useStockSyncHealth.d.ts +7 -2
- package/dist-lib/hooks/useStockSyncHealth.d.ts.map +1 -1
- package/dist-lib/hooks/useStockSyncHealth.js +28 -5
- package/dist-lib/integrations/supabase/types.d.ts +208 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/voorraad-page-head.d.ts +19 -0
- package/dist-lib/lib/voorraad-page-head.d.ts.map +1 -0
- package/dist-lib/lib/voorraad-page-head.js +11 -0
- package/package.json +1 -1
- package/sql/floriday-voorraad-schema.sql +175 -85
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StockSyncStatus.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/StockSyncStatus.tsx"],"names":[],"mappings":"AAeA,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"StockSyncStatus.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/StockSyncStatus.tsx"],"names":[],"mappings":"AAeA,wBAAgB,eAAe,uCA8H9B"}
|
|
@@ -44,5 +44,5 @@ export function StockSyncStatus() {
|
|
|
44
44
|
if (stalePending > 0) {
|
|
45
45
|
parts.push(`${stalePending} wacht${stalePending === 1 ? "" : "en"} langer dan 10 minuten`);
|
|
46
46
|
}
|
|
47
|
-
return (_jsxs("div", { className: "flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-800", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0" }), _jsxs("div", { className: "flex-1 space-y-0.5", children: [parts.length > 0 && (_jsxs("div", { children: [_jsx("span", { className: "font-medium", children: "Voorraadsync naar Floriday: " }), parts.join(" · "), " (laatste 24 uur), voor ", articleCount, " artikel", articleCount === 1 ? "" : "en", ".", oldestPendingAt && (_jsxs("span", { className: "opacity-80", children: [" ", "Oudste wachtende regel: ", new Date(oldestPendingAt).toLocaleString("nl-NL"), "."] }))] })), cause && (_jsxs("div", { children: [_jsx("span", { className: "font-medium", children: "Oorzaak: " }), cause] })), blockedCount > 0 && (_jsxs("div", { className: "space-y-0.5", children: [_jsxs("div", { children: [_jsx("span", { className: "font-medium", children: "Wacht op Floriday \u2013 verpakkingsverschil: " }), blockedCount, " artikel", blockedCount === 1 ? "" : "en", " tegengehouden."] }), _jsxs("ul", { className: "list-disc pl-5 text-xs", children: [blocked.map((b) => (_jsx("li", { children: _jsx(Link, { to: "/voorraad/$id", params: { id: b.productId }, className: "underline hover:no-underline", children: gateBlockedText({ name: b.name, code: b.code }) }) }, b.productId))), data.blockedWithoutProduct > 0 && (_jsxs("li", { children: [data.blockedWithoutProduct, " Floriday-artikel", data.blockedWithoutProduct === 1 ? "" : "en", " zonder lokaal artikel"] }))] })] })), topReason && (_jsxs("div", { children: [_jsx("span", { className: "font-medium", children: "Meest voorkomende reden: " }), topReason, "."] })), noPriceCount > 0 && (_jsxs("div", { className: "opacity-90", children: [noPriceCount, " van deze artikelen ", noPriceCount === 1 ? "heeft" : "hebben", " nog geen prijs in het weekaanbod; het aantal wordt dan zonder prijs doorgezet."] }))] }), failed > 0 && (_jsxs("button", { type: "button", className: "inline-flex shrink-0 items-center rounded-md border border-amber-500/40 bg-amber-500/10 px-2 py-1 text-xs font-medium text-amber-900 hover:bg-amber-500/20 disabled:opacity-50", disabled: mutation.isPending, onClick: () => mutation.mutate(), children: [_jsx(RotateCw, { className: `mr-1 h-3.5 w-3.5 ${mutation.isPending ? "animate-spin" : ""}` }), "Opnieuw proberen"] }))] }));
|
|
47
|
+
return (_jsxs("div", { className: "flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-800", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0" }), _jsxs("div", { className: "flex-1 space-y-0.5", children: [parts.length > 0 && (_jsxs("div", { children: [_jsx("span", { className: "font-medium", children: "Voorraadsync naar Floriday: " }), parts.join(" · "), " (laatste 24 uur), voor ", articleCount, " artikel", articleCount === 1 ? "" : "en", ".", oldestPendingAt && (_jsxs("span", { className: "opacity-80", children: [" ", "Oudste wachtende regel: ", new Date(oldestPendingAt).toLocaleString("nl-NL"), "."] }))] })), cause && (_jsxs("div", { children: [_jsx("span", { className: "font-medium", children: "Oorzaak: " }), cause] })), blockedCount > 0 && (_jsxs("div", { className: "space-y-0.5", children: [_jsxs("div", { children: [_jsx("span", { className: "font-medium", children: "Wacht op Floriday \u2013 verpakkingsverschil: " }), blockedCount, " artikel", blockedCount === 1 ? "" : "en", " tegengehouden."] }), _jsxs("ul", { className: "list-disc pl-5 text-xs", children: [blocked.map((b) => (_jsx("li", { children: _jsx(Link, { to: "/voorraad/$id", params: { id: b.productId }, className: "underline hover:no-underline", children: gateBlockedText({ name: b.name, code: b.code }) }) }, b.productId))), data.blockedWithoutProduct > 0 && (_jsxs("li", { children: [data.blockedWithoutProduct, " Floriday-artikel", data.blockedWithoutProduct === 1 ? "" : "en", " zonder lokaal artikel"] }))] }), data.blockedOther.length > 0 && (_jsxs("div", { className: "mt-1", children: [_jsx("span", { className: "font-medium", children: "Ook tegengehouden (geen artikel): " }), data.blockedOther.map((o) => `${o.kind}: ${o.ref ?? "onbekend"}`).join(" · ")] }))] })), topReason && (_jsxs("div", { children: [_jsx("span", { className: "font-medium", children: "Meest voorkomende reden: " }), topReason, "."] })), noPriceCount > 0 && (_jsxs("div", { className: "opacity-90", children: [noPriceCount, " van deze artikelen ", noPriceCount === 1 ? "heeft" : "hebben", " nog geen prijs in het weekaanbod; het aantal wordt dan zonder prijs doorgezet."] }))] }), failed > 0 && (_jsxs("button", { type: "button", className: "inline-flex shrink-0 items-center rounded-md border border-amber-500/40 bg-amber-500/10 px-2 py-1 text-xs font-medium text-amber-900 hover:bg-amber-500/20 disabled:opacity-50", disabled: mutation.isPending, onClick: () => mutation.mutate(), children: [_jsx(RotateCw, { className: `mr-1 h-3.5 w-3.5 ${mutation.isPending ? "animate-spin" : ""}` }), "Opnieuw proberen"] }))] }));
|
|
48
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoorraadTable.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/VoorraadTable.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAI3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAgFzE,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAE3D;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,OAAO,EACP,aAAa,EACb,QAAQ,EACR,cAAc,EACd,WAAW,EACX,cAAc,GACf,EAAE;IACD,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC9C,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C,+
|
|
1
|
+
{"version":3,"file":"VoorraadTable.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/VoorraadTable.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAI3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAgFzE,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAE3D;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,OAAO,EACP,aAAa,EACb,QAAQ,EACR,cAAc,EACd,WAAW,EACX,cAAc,GACf,EAAE;IACD,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC9C,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C,+BAoUA"}
|
|
@@ -155,7 +155,7 @@ export function VoorraadTable({ items, loading, settingsByKey, selected, onToggl
|
|
|
155
155
|
open();
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
: undefined, "aria-label": clickable ? `Bewerk ${item.name}` : undefined, children: [onToggleSelect && (_jsx("td", { className: "p-3", onClick: (e) => e.stopPropagation(), children: _jsx(Checkbox, { checked: settingProductId ? selected?.has(settingProductId) : false, disabled: !settingProductId, onCheckedChange: () => settingProductId && onToggleSelect(settingProductId), "aria-label": `Selecteer ${item.name}` }) })), _jsx("td", { className: "p-2", children: thumbUrl ? (_jsx("img", { src: thumbUrl, alt: item.name, className: "h-10 w-10 rounded object-cover", loading: "lazy" })) : (_jsx("div", { className: "h-10 w-10 rounded bg-muted flex items-center justify-center", children: _jsx(Package, { className: "h-4 w-4 text-muted-foreground" }) })) }), _jsxs("td", { className: "p-3", children: [_jsxs("div", { className: "flex flex-col items-start gap-1", children: [_jsx("span", { className: "font-medium text-foreground", children: item.name }), item.productId && incompletePacking.has(item.productId) && (
|
|
158
|
+
: undefined, "aria-label": clickable ? `Bewerk ${item.name}` : undefined, children: [onToggleSelect && (_jsx("td", { className: "p-3", onClick: (e) => e.stopPropagation(), children: _jsx(Checkbox, { checked: settingProductId ? selected?.has(settingProductId) : false, disabled: !settingProductId, onCheckedChange: () => settingProductId && onToggleSelect(settingProductId), "aria-label": `Selecteer ${item.name}` }) })), _jsx("td", { className: "p-2", children: thumbUrl ? (_jsx("img", { src: thumbUrl, alt: item.name, className: "h-10 w-10 rounded object-cover", loading: "lazy" })) : (_jsx("div", { className: "h-10 w-10 rounded bg-muted flex items-center justify-center", children: _jsx(Package, { className: "h-4 w-4 text-muted-foreground" }) })) }), _jsxs("td", { className: "p-3", children: [_jsxs("div", { className: "flex flex-col items-start gap-1", children: [_jsx("span", { className: "font-medium text-foreground", children: item.name }), item.productId && incompletePacking.has(item.productId) && (_jsxs("span", { className: "text-[11px] font-medium text-destructive", children: [PACKING_INCOMPLETE_TEXT, item.linkError && _jsx("span", { className: "block", children: item.linkError })] })), _jsxs("div", { role: "status", "aria-label": floriday
|
|
159
159
|
? "Online in Floriday"
|
|
160
160
|
: "Niet online in Floriday", title: floriday
|
|
161
161
|
? "Online in Floriday"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocalTradeItems.d.ts","sourceRoot":"","sources":["../../src/hooks/useLocalTradeItems.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAwB,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGvG;;;;;GAKG;AA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AAC,IAAI,CAAC,CAqBf;AAGD;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBhF;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGpE"}
|
|
@@ -41,7 +41,9 @@ function productToTradeItem(row) {
|
|
|
41
41
|
published: Boolean(floridayId),
|
|
42
42
|
linkStatus: floridayId ? "published" : "linked",
|
|
43
43
|
missingFields: [],
|
|
44
|
-
linkError:
|
|
44
|
+
linkError: cf.voorraad_packing_link?.ok === false
|
|
45
|
+
? String(cf.voorraad_packing_link.melding ?? "Hoofdverpakking niet overgenomen")
|
|
46
|
+
: null,
|
|
45
47
|
lastSyncAt: null,
|
|
46
48
|
floridayId,
|
|
47
49
|
packingConfigurations,
|
|
@@ -13,8 +13,13 @@ export interface StockSyncHealth {
|
|
|
13
13
|
blocked: BlockedArticle[];
|
|
14
14
|
/** Tegengehouden artikelen zonder bekend lokaal artikel. */
|
|
15
15
|
blockedWithoutProduct: number;
|
|
16
|
-
/** Bron van de telling: Floriday-auth of (oude bron) de wachtrij. */
|
|
17
|
-
blockedSource: "floriday-auth" | "wachtrij";
|
|
16
|
+
/** Bron van de telling: Floriday-auth (v2 of v1) of (oude bron) de wachtrij. */
|
|
17
|
+
blockedSource: "floriday-auth-v2" | "floriday-auth" | "wachtrij";
|
|
18
|
+
/** v2: tegengehouden bronnen die geen artikel zijn (bv. verkooporder), met source_ref. */
|
|
19
|
+
blockedOther: {
|
|
20
|
+
kind: string;
|
|
21
|
+
ref: string | null;
|
|
22
|
+
}[];
|
|
18
23
|
}
|
|
19
24
|
export interface BlockedArticle {
|
|
20
25
|
productId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStockSyncHealth.d.ts","sourceRoot":"","sources":["../../src/hooks/useStockSyncHealth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AAC;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAS3E;AAED,wBAAgB,kBAAkB,2EA2KjC"}
|
|
@@ -92,16 +92,38 @@ export function useStockSyncHealth() {
|
|
|
92
92
|
const ctxRow = Array.isArray(ctx) ? ctx[0] : ctx;
|
|
93
93
|
const connectionId = ctxRow?.connection_id ?? null;
|
|
94
94
|
let viaAuth = false;
|
|
95
|
+
const blockedOther = [];
|
|
95
96
|
if (connectionId) {
|
|
96
|
-
|
|
97
|
+
// v2 (source_kind/source_ref/source_paths) alleen als die bestaat; anders v1.
|
|
98
|
+
let { data: items, error: itemsErr } = await supabase.rpc("floriday_packing_blocked_items_v2", {
|
|
97
99
|
p_connection_id: connectionId,
|
|
98
100
|
});
|
|
101
|
+
let isV2 = !itemsErr;
|
|
102
|
+
if (itemsErr && isMissingFunctionError(itemsErr)) {
|
|
103
|
+
({ data: items, error: itemsErr } = await supabase.rpc("floriday_packing_blocked_items", {
|
|
104
|
+
p_connection_id: connectionId,
|
|
105
|
+
}));
|
|
106
|
+
isV2 = false;
|
|
107
|
+
}
|
|
99
108
|
if (!itemsErr) {
|
|
100
109
|
viaAuth = true;
|
|
101
|
-
blockedSource = "floriday-auth";
|
|
102
|
-
//
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
blockedSource = isV2 ? "floriday-auth-v2" : "floriday-auth";
|
|
111
|
+
// Match uitsluitend op trade_item_id; alleen lezen. In v2 telt alleen source_kind='artikel'.
|
|
112
|
+
let all = (items ?? []);
|
|
113
|
+
if (isV2) {
|
|
114
|
+
const seenOther = new Set();
|
|
115
|
+
for (const r of all) {
|
|
116
|
+
if (r?.source_kind === "artikel")
|
|
117
|
+
continue;
|
|
118
|
+
const key = `${r?.source_kind}|${r?.source_ref}`;
|
|
119
|
+
if (seenOther.has(key))
|
|
120
|
+
continue;
|
|
121
|
+
seenOther.add(key);
|
|
122
|
+
blockedOther.push({ kind: String(r?.source_kind ?? "onbekend"), ref: r?.source_ref ?? null });
|
|
123
|
+
}
|
|
124
|
+
all = all.filter((r) => r?.source_kind === "artikel");
|
|
125
|
+
}
|
|
126
|
+
const rows = all.filter((r) => r?.trade_item_id);
|
|
105
127
|
const tradeIds = Array.from(new Set(rows.map((r) => String(r.trade_item_id))));
|
|
106
128
|
const prodByTrade = new Map();
|
|
107
129
|
if (tradeIds.length) {
|
|
@@ -161,6 +183,7 @@ export function useStockSyncHealth() {
|
|
|
161
183
|
blocked,
|
|
162
184
|
blockedWithoutProduct: gateNoProduct,
|
|
163
185
|
blockedSource,
|
|
186
|
+
blockedOther,
|
|
164
187
|
};
|
|
165
188
|
},
|
|
166
189
|
});
|
|
@@ -26298,6 +26298,72 @@ export type Database = {
|
|
|
26298
26298
|
}
|
|
26299
26299
|
];
|
|
26300
26300
|
};
|
|
26301
|
+
twinfield_invoice_mail_queue: {
|
|
26302
|
+
Row: {
|
|
26303
|
+
attempts: number;
|
|
26304
|
+
cc_addresses: string[];
|
|
26305
|
+
connection_id: string;
|
|
26306
|
+
created_at: string;
|
|
26307
|
+
group_key: string;
|
|
26308
|
+
id: string;
|
|
26309
|
+
invoice_number: string;
|
|
26310
|
+
last_error: string | null;
|
|
26311
|
+
mailbox_connection_id: string | null;
|
|
26312
|
+
next_attempt_at: string;
|
|
26313
|
+
purpose: string;
|
|
26314
|
+
sent_at: string | null;
|
|
26315
|
+
status: string;
|
|
26316
|
+
subject: string;
|
|
26317
|
+
test_mode: boolean;
|
|
26318
|
+
text_body: string;
|
|
26319
|
+
to_addresses: string[];
|
|
26320
|
+
updated_at: string;
|
|
26321
|
+
user_id: string;
|
|
26322
|
+
};
|
|
26323
|
+
Insert: {
|
|
26324
|
+
attempts?: number;
|
|
26325
|
+
cc_addresses?: string[];
|
|
26326
|
+
connection_id: string;
|
|
26327
|
+
created_at?: string;
|
|
26328
|
+
group_key: string;
|
|
26329
|
+
id?: string;
|
|
26330
|
+
invoice_number: string;
|
|
26331
|
+
last_error?: string | null;
|
|
26332
|
+
mailbox_connection_id?: string | null;
|
|
26333
|
+
next_attempt_at?: string;
|
|
26334
|
+
purpose: string;
|
|
26335
|
+
sent_at?: string | null;
|
|
26336
|
+
status?: string;
|
|
26337
|
+
subject: string;
|
|
26338
|
+
test_mode?: boolean;
|
|
26339
|
+
text_body: string;
|
|
26340
|
+
to_addresses: string[];
|
|
26341
|
+
updated_at?: string;
|
|
26342
|
+
user_id: string;
|
|
26343
|
+
};
|
|
26344
|
+
Update: {
|
|
26345
|
+
attempts?: number;
|
|
26346
|
+
cc_addresses?: string[];
|
|
26347
|
+
connection_id?: string;
|
|
26348
|
+
created_at?: string;
|
|
26349
|
+
group_key?: string;
|
|
26350
|
+
id?: string;
|
|
26351
|
+
invoice_number?: string;
|
|
26352
|
+
last_error?: string | null;
|
|
26353
|
+
mailbox_connection_id?: string | null;
|
|
26354
|
+
next_attempt_at?: string;
|
|
26355
|
+
purpose?: string;
|
|
26356
|
+
sent_at?: string | null;
|
|
26357
|
+
status?: string;
|
|
26358
|
+
subject?: string;
|
|
26359
|
+
test_mode?: boolean;
|
|
26360
|
+
text_body?: string;
|
|
26361
|
+
to_addresses?: string[];
|
|
26362
|
+
updated_at?: string;
|
|
26363
|
+
user_id?: string;
|
|
26364
|
+
};
|
|
26365
|
+
Relationships: [];
|
|
26366
|
+
};
|
|
26301
26367
|
twinfield_invoice_pdf_cache: {
|
|
26302
26368
|
Row: {
|
|
26303
26369
|
connection_id: string;
|
|
@@ -33090,6 +33156,26 @@ export type Database = {
|
|
|
33090
33156
|
trade_item_id: string;
|
|
33091
33157
|
}[];
|
|
33092
33158
|
};
|
|
33159
|
+
floriday_packing_blocked_items_v2: {
|
|
33160
|
+
Args: {
|
|
33161
|
+
p_connection_id: string;
|
|
33162
|
+
};
|
|
33163
|
+
Returns: {
|
|
33164
|
+
article_code: string;
|
|
33165
|
+
article_name: string;
|
|
33166
|
+
blocked_attempts: number;
|
|
33167
|
+
blocked_by: string;
|
|
33168
|
+
details: string;
|
|
33169
|
+
last_blocked_at: string;
|
|
33170
|
+
mismatch_id: string;
|
|
33171
|
+
reason: string;
|
|
33172
|
+
since: string;
|
|
33173
|
+
source_kind: string;
|
|
33174
|
+
source_paths: string[];
|
|
33175
|
+
source_ref: string;
|
|
33176
|
+
trade_item_id: string;
|
|
33177
|
+
}[];
|
|
33178
|
+
};
|
|
33093
33179
|
floriday_publish_horizon_weeks: {
|
|
33094
33180
|
Args: never;
|
|
33095
33181
|
Returns: number;
|
|
@@ -35090,6 +35176,12 @@ export type Database = {
|
|
|
35090
35176
|
};
|
|
35091
35177
|
Returns: Json;
|
|
35092
35178
|
};
|
|
35179
|
+
logistics_cart_plan_status_slim: {
|
|
35180
|
+
Args: {
|
|
35181
|
+
p_ref: string;
|
|
35182
|
+
};
|
|
35183
|
+
Returns: Json;
|
|
35184
|
+
};
|
|
35093
35185
|
logistics_cart_platen_verrijk: {
|
|
35094
35186
|
Args: {
|
|
35095
35187
|
p_cart: Json;
|
|
@@ -35211,6 +35303,18 @@ export type Database = {
|
|
|
35211
35303
|
};
|
|
35212
35304
|
Returns: boolean;
|
|
35213
35305
|
};
|
|
35306
|
+
logistics_cart_verouderd_core: {
|
|
35307
|
+
Args: {
|
|
35308
|
+
p_cart_id: string;
|
|
35309
|
+
};
|
|
35310
|
+
Returns: Json;
|
|
35311
|
+
};
|
|
35312
|
+
logistics_cart_vulgraad_core: {
|
|
35313
|
+
Args: {
|
|
35314
|
+
p_cart_id: string;
|
|
35315
|
+
};
|
|
35316
|
+
Returns: number;
|
|
35317
|
+
};
|
|
35214
35318
|
logistics_cart_wait_until: {
|
|
35215
35319
|
Args: {
|
|
35216
35320
|
p_cart_id: string;
|
|
@@ -36165,6 +36269,22 @@ export type Database = {
|
|
|
36165
36269
|
uitleg: string;
|
|
36166
36270
|
}[];
|
|
36167
36271
|
};
|
|
36272
|
+
logistics_install_check_208: {
|
|
36273
|
+
Args: never;
|
|
36274
|
+
Returns: {
|
|
36275
|
+
ok: boolean;
|
|
36276
|
+
punt: string;
|
|
36277
|
+
uitleg: string;
|
|
36278
|
+
}[];
|
|
36279
|
+
};
|
|
36280
|
+
logistics_install_check_210: {
|
|
36281
|
+
Args: never;
|
|
36282
|
+
Returns: {
|
|
36283
|
+
ok: boolean;
|
|
36284
|
+
punt: string;
|
|
36285
|
+
uitleg: string;
|
|
36286
|
+
}[];
|
|
36287
|
+
};
|
|
36168
36288
|
logistics_is_beheer: {
|
|
36169
36289
|
Args: never;
|
|
36170
36290
|
Returns: boolean;
|
|
@@ -36203,6 +36323,21 @@ export type Database = {
|
|
|
36203
36323
|
};
|
|
36204
36324
|
Returns: Json;
|
|
36205
36325
|
};
|
|
36326
|
+
logistics_kar_blokkade_vul: {
|
|
36327
|
+
Args: {
|
|
36328
|
+
p_kar: string;
|
|
36329
|
+
p_vul: number;
|
|
36330
|
+
};
|
|
36331
|
+
Returns: Json;
|
|
36332
|
+
};
|
|
36333
|
+
logistics_kar_tekst: {
|
|
36334
|
+
Args: {
|
|
36335
|
+
p_carrier_code: string;
|
|
36336
|
+
p_lagen: number;
|
|
36337
|
+
p_pct: number;
|
|
36338
|
+
};
|
|
36339
|
+
Returns: string;
|
|
36340
|
+
};
|
|
36206
36341
|
logistics_key_product: {
|
|
36207
36342
|
Args: {
|
|
36208
36343
|
p_key: string;
|
|
@@ -36240,6 +36375,20 @@ export type Database = {
|
|
|
36240
36375
|
Args: never;
|
|
36241
36376
|
Returns: Json;
|
|
36242
36377
|
};
|
|
36378
|
+
logistics_laag_tolerantie: {
|
|
36379
|
+
Args: never;
|
|
36380
|
+
Returns: number;
|
|
36381
|
+
};
|
|
36382
|
+
logistics_laag_tolerantie_tekst: {
|
|
36383
|
+
Args: {
|
|
36384
|
+
p_fl: number;
|
|
36385
|
+
p_fw: number;
|
|
36386
|
+
p_ll: number;
|
|
36387
|
+
p_lw: number;
|
|
36388
|
+
p_n: number;
|
|
36389
|
+
};
|
|
36390
|
+
Returns: string;
|
|
36391
|
+
};
|
|
36243
36392
|
logistics_ladingdrager_referentie: {
|
|
36244
36393
|
Args: never;
|
|
36245
36394
|
Returns: {
|
|
@@ -36249,6 +36398,12 @@ export type Database = {
|
|
|
36249
36398
|
lengte_cm: number;
|
|
36250
36399
|
}[];
|
|
36251
36400
|
};
|
|
36401
|
+
logistics_ladingdrager_resolve: {
|
|
36402
|
+
Args: {
|
|
36403
|
+
p_code: string;
|
|
36404
|
+
};
|
|
36405
|
+
Returns: Json;
|
|
36406
|
+
};
|
|
36252
36407
|
logistics_ladingdrager_tekst: {
|
|
36253
36408
|
Args: {
|
|
36254
36409
|
p_carrier_code: string;
|
|
@@ -36324,6 +36479,22 @@ export type Database = {
|
|
|
36324
36479
|
};
|
|
36325
36480
|
Returns: number;
|
|
36326
36481
|
};
|
|
36482
|
+
logistics_max_fusten_per_laag_alle: {
|
|
36483
|
+
Args: {
|
|
36484
|
+
p_fust_b: number;
|
|
36485
|
+
p_fust_l: number;
|
|
36486
|
+
};
|
|
36487
|
+
Returns: number;
|
|
36488
|
+
};
|
|
36489
|
+
logistics_max_fusten_per_laag_strikt: {
|
|
36490
|
+
Args: {
|
|
36491
|
+
p_fl: number;
|
|
36492
|
+
p_fw: number;
|
|
36493
|
+
p_ll: number;
|
|
36494
|
+
p_lw: number;
|
|
36495
|
+
};
|
|
36496
|
+
Returns: number;
|
|
36497
|
+
};
|
|
36327
36498
|
logistics_merge_decision: {
|
|
36328
36499
|
Args: {
|
|
36329
36500
|
p_lines: Json;
|
|
@@ -37026,6 +37197,12 @@ export type Database = {
|
|
|
37026
37197
|
Args: never;
|
|
37027
37198
|
Returns: boolean;
|
|
37028
37199
|
};
|
|
37200
|
+
logistics_pick_cart_breakdown_fast: {
|
|
37201
|
+
Args: {
|
|
37202
|
+
_order_id: string;
|
|
37203
|
+
};
|
|
37204
|
+
Returns: Json;
|
|
37205
|
+
};
|
|
37029
37206
|
logistics_pick_email_purpose: {
|
|
37030
37207
|
Args: never;
|
|
37031
37208
|
Returns: string;
|
|
@@ -37422,6 +37599,12 @@ export type Database = {
|
|
|
37422
37599
|
};
|
|
37423
37600
|
Returns: Json;
|
|
37424
37601
|
};
|
|
37602
|
+
logistics_product_hoofdverpakking: {
|
|
37603
|
+
Args: {
|
|
37604
|
+
p_product_id: string;
|
|
37605
|
+
};
|
|
37606
|
+
Returns: Json;
|
|
37607
|
+
};
|
|
37425
37608
|
logistics_product_maten: {
|
|
37426
37609
|
Args: {
|
|
37427
37610
|
p_product_ids: string[];
|
|
@@ -43818,6 +44001,18 @@ export type Database = {
|
|
|
43818
44001
|
};
|
|
43819
44002
|
Returns: Json;
|
|
43820
44003
|
};
|
|
44004
|
+
voorraad_correctie_1126: {
|
|
44005
|
+
Args: {
|
|
44006
|
+
p_uitvoeren?: boolean;
|
|
44007
|
+
};
|
|
44008
|
+
Returns: Json;
|
|
44009
|
+
};
|
|
44010
|
+
voorraad_correctie_1127: {
|
|
44011
|
+
Args: {
|
|
44012
|
+
p_uitvoeren?: boolean;
|
|
44013
|
+
};
|
|
44014
|
+
Returns: Json;
|
|
44015
|
+
};
|
|
43821
44016
|
voorraad_correctie_status: {
|
|
43822
44017
|
Args: {
|
|
43823
44018
|
p_correctie?: string;
|
|
@@ -43908,6 +44103,19 @@ export type Database = {
|
|
|
43908
44103
|
};
|
|
43909
44104
|
Returns: boolean;
|
|
43910
44105
|
};
|
|
44106
|
+
voorraad_packing_from_floriday: {
|
|
44107
|
+
Args: {
|
|
44108
|
+
p_product_id: string;
|
|
44109
|
+
p_uitvoeren: boolean;
|
|
44110
|
+
};
|
|
44111
|
+
Returns: Json;
|
|
44112
|
+
};
|
|
44113
|
+
voorraad_packing_missing: {
|
|
44114
|
+
Args: {
|
|
44115
|
+
p_packing: Json;
|
|
44116
|
+
};
|
|
44117
|
+
Returns: string[];
|
|
44118
|
+
};
|
|
43911
44119
|
voorraad_production_enabled: {
|
|
43912
44120
|
Args: never;
|
|
43913
44121
|
Returns: boolean;
|