@flowselections/floriday-voorraad 1.0.53 → 1.0.55
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/ArtikelWizard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ArtikelWizard.js +2 -1
- package/dist-lib/components/voorraad/InventoryStatusBadge.d.ts.map +1 -1
- package/dist-lib/components/voorraad/InventoryStatusBadge.js +1 -1
- package/dist-lib/components/voorraad/ProductStructureCard.d.ts +8 -0
- package/dist-lib/components/voorraad/ProductStructureCard.d.ts.map +1 -0
- package/dist-lib/components/voorraad/ProductStructureCard.js +145 -0
- package/dist-lib/components/voorraad/StockPushMonitor.d.ts.map +1 -1
- package/dist-lib/components/voorraad/StockPushMonitor.js +8 -0
- package/dist-lib/components/voorraad/VoorraadTable.d.ts.map +1 -1
- package/dist-lib/components/voorraad/VoorraadTable.js +5 -1
- package/dist-lib/hooks/useInventorySettings.d.ts +1 -0
- package/dist-lib/hooks/useInventorySettings.d.ts.map +1 -1
- package/dist-lib/hooks/useInventorySettings.js +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +400 -1
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/base-supply-reader.server.d.ts +11 -0
- package/dist-lib/lib/base-supply-reader.server.d.ts.map +1 -1
- package/dist-lib/lib/base-supply-reader.server.js +51 -0
- package/dist-lib/lib/product-types.d.ts +14 -0
- package/dist-lib/lib/product-types.d.ts.map +1 -0
- package/dist-lib/lib/product-types.js +54 -0
- package/dist-lib/lib/stock-modes.d.ts.map +1 -1
- package/dist-lib/lib/stock-modes.js +6 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArtikelWizard.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/ArtikelWizard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ArtikelWizard.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/ArtikelWizard.tsx"],"names":[],"mappings":"AA6MA,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EAAE,cAAc,EACvB,WAAW,EACX,SAAS,EACT,WAAW,GACZ,GAAE;IACD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACjB,+BAorEL"}
|
|
@@ -37,6 +37,7 @@ import { PriceStatusBadge } from "../../components/voorraad/PriceStatusBadge";
|
|
|
37
37
|
import { OrderHistoryCard } from "../../components/voorraad/OrderHistoryCard";
|
|
38
38
|
import { StockMutationHistoryCard } from "../../components/voorraad/StockMutationHistoryCard";
|
|
39
39
|
import { ArtikelCompositionCard } from "../../components/voorraad/ArtikelCompositionCard";
|
|
40
|
+
import { ProductStructureCard, FloridayStockReasonLine } from "../../components/voorraad/ProductStructureCard";
|
|
40
41
|
import { StepSamenstelling } from "../../components/voorraad/StepSamenstelling";
|
|
41
42
|
import { FloridayInfoCard } from "../../components/voorraad/FloridayInfoCard";
|
|
42
43
|
import { stockKeyFor } from "../../hooks/useTradeItemStock";
|
|
@@ -1702,7 +1703,7 @@ export function ArtikelWizard({ draftId: initialDraftId, tradeItemId, productId,
|
|
|
1702
1703
|
setDeleteOpen(o);
|
|
1703
1704
|
if (!o)
|
|
1704
1705
|
setDeleteAck(false);
|
|
1705
|
-
}, children: [_jsx(AlertDialogTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "sm", className: "text-destructive hover:text-destructive", children: [_jsx(Trash2, { className: "mr-2 h-4 w-4" }), "Verwijderen"] }) }), _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Product verwijderen?" }), _jsx(AlertDialogDescription, { asChild: true, children: _jsxs("div", { className: "space-y-3 text-sm", children: [_jsxs("div", { children: ["Je staat op het punt om ", _jsx("strong", { children: data.name || "dit artikel" }), data.articleCode ? _jsxs(_Fragment, { children: [" (artikelnummer ", _jsx("code", { children: data.articleCode }), ")"] }) : null, " ", "lokaal uit de voorraad te verwijderen."] }), _jsxs("div", { className: "rounded-md border p-3 bg-muted/40 space-y-1", children: [_jsxs("div", { children: ["Huidige voorraad: ", _jsx("strong", { children: productMeta.physicalStock }), " stuks"] }), _jsxs("div", { children: ["Floriday-koppeling:", " ", productMeta.floridayActive || productMeta.floridayTradeItemId ? (_jsx("span", { className: "text-emerald-700 font-medium", children: "actief" })) : (_jsx("span", { className: "text-muted-foreground", children: "geen" }))] })] }), (productMeta.floridayActive || productMeta.floridayTradeItemId) && (_jsxs("div", { className: "rounded-md border border-amber-300 bg-amber-50 p-3 text-amber-900", children: [_jsx("strong", { children: "Let op:" }), " dit artikel is gekoppeld met Floriday. Als je alleen de lokale kant verwijdert, blijft het artikel op Floriday bestaan en verschijnt het bij de volgende sync weer terug in de lijst. Trek het artikel daarna zelf in via het Floriday-portaal als je het echt weg wilt."] })), productMeta.physicalStock > 0 && (_jsxs("div", { className: "rounded-md border border-rose-300 bg-rose-50 p-3 text-rose-900", children: ["Er staat nog voorraad (", productMeta.physicalStock, " stuks) op dit product. Deze voorraad wordt \u00F3\u00F3k verwijderd en kan niet automatisch worden hersteld."] })), _jsxs("label", { className: "flex items-start gap-2 pt-1", children: [_jsx(Checkbox, { checked: deleteAck, onCheckedChange: (v) => setDeleteAck(Boolean(v)) }), _jsx("span", { children: "Ik weet zeker dat ik dit product wil verwijderen en begrijp de gevolgen." })] })] }) })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Annuleren" }), _jsx(AlertDialogAction, { disabled: !deleteAck, onClick: handleDeleteDraft, className: "bg-destructive text-destructive-foreground hover:bg-destructive/90", children: "Definitief verwijderen" })] })] })] }))] }), isEditing && (data.name || data.vbnName) && (_jsxs("div", { className: "space-y-1", children: [_jsx("div", { className: "text-xs uppercase tracking-wide text-muted-foreground", children: "Artikel" }), _jsxs("div", { className: "flex items-center gap-3 flex-wrap", children: [_jsx("h1", { className: "text-2xl font-semibold leading-tight", children: data.name || data.vbnName }), (isEditingPublished || draftFloridayId) ? (syncState === "saving" ? (_jsxs("span", { className: "inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground", children: [_jsx(Loader2, { className: "h-3 w-3 animate-spin" }), " Synchroniseren\u2026"] })) : syncState === "saved" ? (_jsxs("span", { className: "inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full bg-emerald-100 text-emerald-700", children: [_jsx(Check, { className: "h-3 w-3" }), " Gesynchroniseerd"] })) : syncState === "error" ? (_jsx("span", { className: "inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full bg-red-100 text-red-700", title: syncError ?? undefined, children: "Sync mislukt \u2014 klik Opslaan om opnieuw te proberen" })) : null) : (_jsx("span", { className: "inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground", children: "Nog niet gepubliceerd naar Floriday" })), _jsx(PriceStatusBadge, { tradeItemId: tradeItemId ?? draftFloridayId ?? null, offerForSale: data.offerForSale })] }), data.name && data.vbnName && data.name !== data.vbnName && (_jsx("div", { className: "text-sm text-muted-foreground", children: data.vbnName }))] })), pendingSync && (_jsxs(Card, { className: "p-4 border-amber-300 bg-amber-50 text-amber-900 space-y-2", children: [_jsx("div", { className: "font-medium text-sm", children: "Je wijzigingen zijn opgeslagen, maar nog niet doorgegeven aan Floriday" }), _jsxs("div", { className: "text-xs", children: ["Alles wat je hier hebt ingevuld blijft bewaard in dit systeem. Zodra het doorgeven lukt, verdwijnt deze melding vanzelf.", pendingSync.error ? ` Reden: ${pendingSync.error}` : ""] }), _jsx(Button, { type: "button", variant: "outline", size: "sm", disabled: retryingSync, onClick: retrySync, children: retryingSync ? (_jsxs(_Fragment, { children: [_jsx(Loader2, { className: "h-3 w-3 animate-spin mr-1" }), " Bezig\u2026"] })) : ("Opnieuw proberen") })] })), isEditing && (_jsx(Card, { className: "p-4 bg-muted/30 flex items-center gap-3 text-sm", children: isEditingPublished ? (_jsxs(_Fragment, { children: [_jsx("img", { src: floridayLogo, alt: "Floriday", className: "h-6 w-6 shrink-0" }), _jsxs("div", { className: "flex-1", children: [_jsx("div", { className: "font-medium", children: "Gepubliceerd artikel bewerken" }), _jsx("div", { className: "text-xs text-muted-foreground", children: "Wijzigingen worden direct naar Floriday verstuurd. Je kunt vrij tussen alle secties navigeren." })] }), _jsxs(Button, { onClick: () => void submit(), disabled: submitting || invalidStepCount > 0, children: [submitting ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(Check, { className: "mr-2 h-4 w-4" })), "Wijzigingen opslaan"] })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex-1", children: [_jsx("div", { className: "font-medium", children: "Lokaal artikel bewerken" }), _jsx("div", { className: "text-xs text-muted-foreground", children: "Niet gepubliceerd. Je kunt vrij tussen alle secties navigeren." })] }), _jsxs(Button, { onClick: () => void submit(), disabled: submitting || invalidStepCount > 0, children: [submitting ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(Check, { className: "mr-2 h-4 w-4" })), publishToFloriday ? "Publiceren naar Floriday" : "Wijzigingen opslaan"] })] })) })), isEditing && (_jsxs(_Fragment, { children: [_jsx(ArtikelCompositionCard, { productId: linkedProductId ?? productId ?? null, floridayId: tradeItemId ?? draftFloridayId ?? null }), _jsx(FloridayInfoCard, { floridayTradeItemId: tradeItemId ?? draftFloridayId ?? null, local: {
|
|
1706
|
+
}, children: [_jsx(AlertDialogTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "sm", className: "text-destructive hover:text-destructive", children: [_jsx(Trash2, { className: "mr-2 h-4 w-4" }), "Verwijderen"] }) }), _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Product verwijderen?" }), _jsx(AlertDialogDescription, { asChild: true, children: _jsxs("div", { className: "space-y-3 text-sm", children: [_jsxs("div", { children: ["Je staat op het punt om ", _jsx("strong", { children: data.name || "dit artikel" }), data.articleCode ? _jsxs(_Fragment, { children: [" (artikelnummer ", _jsx("code", { children: data.articleCode }), ")"] }) : null, " ", "lokaal uit de voorraad te verwijderen."] }), _jsxs("div", { className: "rounded-md border p-3 bg-muted/40 space-y-1", children: [_jsxs("div", { children: ["Huidige voorraad: ", _jsx("strong", { children: productMeta.physicalStock }), " stuks"] }), _jsxs("div", { children: ["Floriday-koppeling:", " ", productMeta.floridayActive || productMeta.floridayTradeItemId ? (_jsx("span", { className: "text-emerald-700 font-medium", children: "actief" })) : (_jsx("span", { className: "text-muted-foreground", children: "geen" }))] })] }), (productMeta.floridayActive || productMeta.floridayTradeItemId) && (_jsxs("div", { className: "rounded-md border border-amber-300 bg-amber-50 p-3 text-amber-900", children: [_jsx("strong", { children: "Let op:" }), " dit artikel is gekoppeld met Floriday. Als je alleen de lokale kant verwijdert, blijft het artikel op Floriday bestaan en verschijnt het bij de volgende sync weer terug in de lijst. Trek het artikel daarna zelf in via het Floriday-portaal als je het echt weg wilt."] })), productMeta.physicalStock > 0 && (_jsxs("div", { className: "rounded-md border border-rose-300 bg-rose-50 p-3 text-rose-900", children: ["Er staat nog voorraad (", productMeta.physicalStock, " stuks) op dit product. Deze voorraad wordt \u00F3\u00F3k verwijderd en kan niet automatisch worden hersteld."] })), _jsxs("label", { className: "flex items-start gap-2 pt-1", children: [_jsx(Checkbox, { checked: deleteAck, onCheckedChange: (v) => setDeleteAck(Boolean(v)) }), _jsx("span", { children: "Ik weet zeker dat ik dit product wil verwijderen en begrijp de gevolgen." })] })] }) })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Annuleren" }), _jsx(AlertDialogAction, { disabled: !deleteAck, onClick: handleDeleteDraft, className: "bg-destructive text-destructive-foreground hover:bg-destructive/90", children: "Definitief verwijderen" })] })] })] }))] }), isEditing && (data.name || data.vbnName) && (_jsxs("div", { className: "space-y-1", children: [_jsx("div", { className: "text-xs uppercase tracking-wide text-muted-foreground", children: "Artikel" }), _jsxs("div", { className: "flex items-center gap-3 flex-wrap", children: [_jsx("h1", { className: "text-2xl font-semibold leading-tight", children: data.name || data.vbnName }), (isEditingPublished || draftFloridayId) ? (syncState === "saving" ? (_jsxs("span", { className: "inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground", children: [_jsx(Loader2, { className: "h-3 w-3 animate-spin" }), " Synchroniseren\u2026"] })) : syncState === "saved" ? (_jsxs("span", { className: "inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full bg-emerald-100 text-emerald-700", children: [_jsx(Check, { className: "h-3 w-3" }), " Gesynchroniseerd"] })) : syncState === "error" ? (_jsx("span", { className: "inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full bg-red-100 text-red-700", title: syncError ?? undefined, children: "Sync mislukt \u2014 klik Opslaan om opnieuw te proberen" })) : null) : (_jsx("span", { className: "inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground", children: "Nog niet gepubliceerd naar Floriday" })), _jsx(PriceStatusBadge, { tradeItemId: tradeItemId ?? draftFloridayId ?? null, offerForSale: data.offerForSale })] }), data.name && data.vbnName && data.name !== data.vbnName && (_jsx("div", { className: "text-sm text-muted-foreground", children: data.vbnName }))] })), pendingSync && (_jsxs(Card, { className: "p-4 border-amber-300 bg-amber-50 text-amber-900 space-y-2", children: [_jsx("div", { className: "font-medium text-sm", children: "Je wijzigingen zijn opgeslagen, maar nog niet doorgegeven aan Floriday" }), _jsxs("div", { className: "text-xs", children: ["Alles wat je hier hebt ingevuld blijft bewaard in dit systeem. Zodra het doorgeven lukt, verdwijnt deze melding vanzelf.", pendingSync.error ? ` Reden: ${pendingSync.error}` : ""] }), _jsx(FloridayStockReasonLine, { productId: linkedProductId ?? productId ?? null }), _jsx(Button, { type: "button", variant: "outline", size: "sm", disabled: retryingSync, onClick: retrySync, children: retryingSync ? (_jsxs(_Fragment, { children: [_jsx(Loader2, { className: "h-3 w-3 animate-spin mr-1" }), " Bezig\u2026"] })) : ("Opnieuw proberen") })] })), isEditing && (_jsx(Card, { className: "p-4 bg-muted/30 flex items-center gap-3 text-sm", children: isEditingPublished ? (_jsxs(_Fragment, { children: [_jsx("img", { src: floridayLogo, alt: "Floriday", className: "h-6 w-6 shrink-0" }), _jsxs("div", { className: "flex-1", children: [_jsx("div", { className: "font-medium", children: "Gepubliceerd artikel bewerken" }), _jsx("div", { className: "text-xs text-muted-foreground", children: "Wijzigingen worden direct naar Floriday verstuurd. Je kunt vrij tussen alle secties navigeren." })] }), _jsxs(Button, { onClick: () => void submit(), disabled: submitting || invalidStepCount > 0, children: [submitting ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(Check, { className: "mr-2 h-4 w-4" })), "Wijzigingen opslaan"] })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex-1", children: [_jsx("div", { className: "font-medium", children: "Lokaal artikel bewerken" }), _jsx("div", { className: "text-xs text-muted-foreground", children: "Niet gepubliceerd. Je kunt vrij tussen alle secties navigeren." })] }), _jsxs(Button, { onClick: () => void submit(), disabled: submitting || invalidStepCount > 0, children: [submitting ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(Check, { className: "mr-2 h-4 w-4" })), publishToFloriday ? "Publiceren naar Floriday" : "Wijzigingen opslaan"] })] })) })), isEditing && (_jsxs(_Fragment, { children: [_jsx(ProductStructureCard, { productId: linkedProductId ?? productId ?? null }), _jsx(ArtikelCompositionCard, { productId: linkedProductId ?? productId ?? null, floridayId: tradeItemId ?? draftFloridayId ?? null }), _jsx(FloridayInfoCard, { floridayTradeItemId: tradeItemId ?? draftFloridayId ?? null, local: {
|
|
1706
1707
|
name: data.name || data.vbnName,
|
|
1707
1708
|
articleNumber: data.articleCode,
|
|
1708
1709
|
gtin: data.gtin,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InventoryStatusBadge.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/InventoryStatusBadge.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,WAAW,EAAwC,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,CAAC;AAiCvB,wBAAgB,oBAAoB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,gBAAgB,GAAG,SAAS,CAAA;CAAE,+
|
|
1
|
+
{"version":3,"file":"InventoryStatusBadge.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/InventoryStatusBadge.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,WAAW,EAAwC,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,CAAC;AAiCvB,wBAAgB,oBAAoB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,gBAAgB,GAAG,SAAS,CAAA;CAAE,+BAuC1F"}
|
|
@@ -43,5 +43,5 @@ export function InventoryStatusBadge({ setting }) {
|
|
|
43
43
|
? `${dot.title}: ${ACTION_REASON_LABELS[setting.action_reason] ?? setting.action_reason}`
|
|
44
44
|
: setting.last_sync_error
|
|
45
45
|
? `${dot.title}: ${setting.last_sync_error}`
|
|
46
|
-
: dot.title, "aria-label": dot.title }), _jsx("span", { className: "tabular-nums text-xs text-muted-foreground", children: setting.desired_quantity ?? 0 })] }));
|
|
46
|
+
: dot.title, "aria-label": dot.title }), _jsx("span", { className: "tabular-nums text-xs text-muted-foreground", children: setting.desired_quantity ?? 0 }), setting.last_sync_error?.startsWith("Geen voorkeursmagazijn") && (_jsx("span", { className: "rounded bg-destructive/15 px-1.5 py-0.5 text-xs text-destructive", title: setting.last_sync_error, children: "Geen magazijn \u2014 kies er een op de Connectie-pagina" }))] }));
|
|
47
47
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function ProductStructureCard({ productId }: {
|
|
2
|
+
productId: string | null;
|
|
3
|
+
}): import("react").JSX.Element | null;
|
|
4
|
+
/** Eén regel met de echte reden waarom de voorraad (nog) niet in Floriday staat. */
|
|
5
|
+
export declare function FloridayStockReasonLine({ productId }: {
|
|
6
|
+
productId: string | null;
|
|
7
|
+
}): import("react").JSX.Element | null;
|
|
8
|
+
//# sourceMappingURL=ProductStructureCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProductStructureCard.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/ProductStructureCard.tsx"],"names":[],"mappings":"AAiDA,wBAAgB,oBAAoB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,sCAoQ/E;AAED,oFAAoF;AACpF,wBAAgB,uBAAuB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,sCAkClF"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Overzicht per producttype op de artikelpagina. Alle totalen komen uit de
|
|
4
|
+
* gedeelde databasefunctie `get_product_structure_totals`; hier wordt niets
|
|
5
|
+
* zelf opgeteld.
|
|
6
|
+
*/
|
|
7
|
+
import { useEffect, useState } from "react";
|
|
8
|
+
import { Link } from "@tanstack/react-router";
|
|
9
|
+
import { Badge, Card, CardContent, CardDescription, CardHeader, CardTitle } from "@flowselections/core";
|
|
10
|
+
import { Info, Loader2 } from "lucide-react";
|
|
11
|
+
import { supabase } from "../../integrations/supabase/client";
|
|
12
|
+
import { PRODUCT_TYPE_CLASSES, PRODUCT_TYPE_HELP, PRODUCT_TYPE_LABELS, floridayPendingReason, toStructureType, } from "../../lib/product-types";
|
|
13
|
+
import { ACTION_REASON_LABELS, publishedLabel } from "../../lib/stock-modes";
|
|
14
|
+
export function ProductStructureCard({ productId }) {
|
|
15
|
+
const [loading, setLoading] = useState(true);
|
|
16
|
+
const [totals, setTotals] = useState(null);
|
|
17
|
+
const [setting, setSetting] = useState(null);
|
|
18
|
+
const [queue, setQueue] = useState(null);
|
|
19
|
+
const [names, setNames] = useState(new Map());
|
|
20
|
+
const [groupHeads, setGroupHeads] = useState([]);
|
|
21
|
+
const [error, setError] = useState(null);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (!productId)
|
|
24
|
+
return;
|
|
25
|
+
let cancelled = false;
|
|
26
|
+
(async () => {
|
|
27
|
+
setLoading(true);
|
|
28
|
+
const [tRes, sRes, qRes] = await Promise.all([
|
|
29
|
+
supabase.rpc("get_product_structure_totals", { p_product_id: productId }),
|
|
30
|
+
supabase
|
|
31
|
+
.from("floriday_inventory_settings")
|
|
32
|
+
.select("desired_quantity, packing_size, action_reason")
|
|
33
|
+
.eq("product_id", productId)
|
|
34
|
+
.limit(1)
|
|
35
|
+
.maybeSingle(),
|
|
36
|
+
supabase
|
|
37
|
+
.from("floriday_continuous_stock_queue")
|
|
38
|
+
.select("status, skip_reason, last_error")
|
|
39
|
+
.eq("product_id", productId)
|
|
40
|
+
.neq("status", "superseded")
|
|
41
|
+
.order("created_at", { ascending: false })
|
|
42
|
+
.limit(1)
|
|
43
|
+
.maybeSingle(),
|
|
44
|
+
]);
|
|
45
|
+
if (cancelled)
|
|
46
|
+
return;
|
|
47
|
+
if (tRes.error) {
|
|
48
|
+
setError(tRes.error.message);
|
|
49
|
+
setLoading(false);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const t = (tRes.data ?? null);
|
|
53
|
+
setTotals(t);
|
|
54
|
+
setSetting(sRes.data ?? null);
|
|
55
|
+
setQueue(qRes.data ?? null);
|
|
56
|
+
const ids = new Set();
|
|
57
|
+
t?.parts?.forEach((p) => p.product_id && ids.add(p.product_id));
|
|
58
|
+
t?.component_of_sets?.forEach((id) => ids.add(id));
|
|
59
|
+
if (t?.limiting_product_id)
|
|
60
|
+
ids.add(t.limiting_product_id);
|
|
61
|
+
const nm = new Map();
|
|
62
|
+
if (ids.size) {
|
|
63
|
+
const { data } = await supabase.from("products").select("id, product").in("id", [...ids]);
|
|
64
|
+
(data ?? []).forEach((p) => nm.set(String(p.id), String(p.product ?? p.id)));
|
|
65
|
+
}
|
|
66
|
+
const heads = [];
|
|
67
|
+
if (t?.member_of_groups?.length) {
|
|
68
|
+
const { data } = await supabase
|
|
69
|
+
.from("product_groups")
|
|
70
|
+
.select("id, name, head_product_id")
|
|
71
|
+
.in("id", t.member_of_groups);
|
|
72
|
+
(data ?? []).forEach((g) => heads.push({ id: String(g.id), name: String(g.name), headId: g.head_product_id ?? null }));
|
|
73
|
+
}
|
|
74
|
+
if (cancelled)
|
|
75
|
+
return;
|
|
76
|
+
setNames(nm);
|
|
77
|
+
setGroupHeads(heads);
|
|
78
|
+
setError(null);
|
|
79
|
+
setLoading(false);
|
|
80
|
+
})();
|
|
81
|
+
return () => {
|
|
82
|
+
cancelled = true;
|
|
83
|
+
};
|
|
84
|
+
}, [productId]);
|
|
85
|
+
if (!productId)
|
|
86
|
+
return null;
|
|
87
|
+
if (loading) {
|
|
88
|
+
return (_jsx(Card, { children: _jsxs(CardContent, { className: "flex items-center gap-2 py-4 text-sm text-muted-foreground", children: [_jsx(Loader2, { className: "h-4 w-4 animate-spin" }), " Producttype laden\u2026"] }) }));
|
|
89
|
+
}
|
|
90
|
+
if (error) {
|
|
91
|
+
return (_jsx(Card, { children: _jsxs(CardContent, { className: "py-4 text-sm text-destructive", children: ["Producttype kon niet worden geladen: ", error] }) }));
|
|
92
|
+
}
|
|
93
|
+
const type = toStructureType(totals?.type);
|
|
94
|
+
const name = (id) => (id ? names.get(id) ?? id.slice(0, 8) : "—");
|
|
95
|
+
const parts = [...(totals?.parts ?? [])].sort((a, b) => (a.sort_order ?? 0) - (b.sort_order ?? 0));
|
|
96
|
+
const desired = setting?.desired_quantity ?? 0;
|
|
97
|
+
const reason = floridayPendingReason({
|
|
98
|
+
actionReason: setting?.action_reason,
|
|
99
|
+
lastQueueStatus: queue?.status,
|
|
100
|
+
lastSkipReason: queue?.skip_reason,
|
|
101
|
+
lastError: queue?.last_error,
|
|
102
|
+
});
|
|
103
|
+
const structureReason = totals?.reason ? ACTION_REASON_LABELS[totals.reason] ?? totals.reason : null;
|
|
104
|
+
return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [_jsx(CardTitle, { children: "Producttype" }), _jsx(Badge, { className: PRODUCT_TYPE_CLASSES[type], title: PRODUCT_TYPE_HELP[type], children: PRODUCT_TYPE_LABELS[type] }), _jsx("span", { title: PRODUCT_TYPE_HELP[type], "aria-label": PRODUCT_TYPE_HELP[type], children: _jsx(Info, { className: "h-4 w-4 text-muted-foreground" }) })] }), _jsx(CardDescription, { children: PRODUCT_TYPE_HELP[type] })] }), _jsxs(CardContent, { className: "space-y-3 text-sm", children: [structureReason && (_jsxs("div", { className: "rounded border border-destructive/30 bg-destructive/10 px-3 py-2 text-destructive", children: ["Actie nodig: ", structureReason] })), type === "GROUP" && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "font-medium", children: [publishedLabel(desired, setting?.packing_size), " \u00B7 som van ", parts.length, " ", parts.length === 1 ? "lid" : "leden", " (", totals?.sum_members ?? 0, " beschikbaar)"] }), _jsx("p", { className: "text-muted-foreground", children: "De leden staan niet los in Floriday; alleen deze groep wordt gepubliceerd. Volgorde = voorraadprioriteit (te wijzigen in de kaart Productgroep hieronder)." }), _jsxs("details", { className: "rounded border", children: [_jsxs("summary", { className: "cursor-pointer px-3 py-2", children: ["Leden tonen (", parts.length, ")"] }), _jsxs("table", { className: "w-full text-xs", children: [_jsx("thead", { className: "text-left text-muted-foreground", children: _jsxs("tr", { children: [_jsx("th", { className: "p-2", children: "#" }), _jsx("th", { className: "p-2", children: "Lid" }), _jsx("th", { className: "p-2 text-right", children: "Voorraad" }), _jsx("th", { className: "p-2 text-right", children: "Gereserveerd" }), _jsx("th", { className: "p-2 text-right", children: "Beschikbaar" })] }) }), _jsx("tbody", { children: parts.map((p, i) => (_jsxs("tr", { className: "border-t", children: [_jsx("td", { className: "p-2", children: i + 1 }), _jsxs("td", { className: "p-2", children: [p.product_id ? (_jsx(Link, { to: "/voorraad/$id", params: { id: p.product_id }, className: "underline", children: name(p.product_id) })) : ("—"), p.reason && _jsxs("span", { className: "ml-1 text-destructive", children: ["(", ACTION_REASON_LABELS[p.reason] ?? p.reason, ")"] })] }), _jsx("td", { className: "p-2 text-right tabular-nums", children: p.physical ?? 0 }), _jsx("td", { className: "p-2 text-right tabular-nums", children: p.reserved ?? 0 }), _jsx("td", { className: "p-2 text-right tabular-nums", children: p.available ?? 0 })] }, p.product_id ?? i))) })] })] })] })), type === "SET" && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "font-medium", children: ["Berekend: ", totals?.computed ?? 0, " sets", totals?.limiting_product_id && (_jsxs(_Fragment, { children: [" ", "\u00B7 beperkt door: ", name(totals.limiting_product_id), ", ", totals?.computed ?? 0, " sets"] }))] }), _jsx("div", { className: "rounded border border-amber-300 bg-amber-50 px-3 py-2 text-amber-900", children: "Deze set gaat nog niet naar Floriday (\"geen aanbod\") totdat de Logistieke engine bij een bestelling de onderdelen reserveert en afboekt." }), _jsxs("table", { className: "w-full text-xs", children: [_jsx("thead", { className: "text-left text-muted-foreground", children: _jsxs("tr", { children: [_jsx("th", { className: "p-2", children: "Onderdeel" }), _jsx("th", { className: "p-2 text-right", children: "Per set" }), _jsx("th", { className: "p-2 text-right", children: "Beschikbaar" }), _jsx("th", { className: "p-2 text-right", children: "Genoeg voor" })] }) }), _jsx("tbody", { children: parts.map((p, i) => {
|
|
105
|
+
const limiting = p.product_id && p.product_id === totals?.limiting_product_id;
|
|
106
|
+
return (_jsxs("tr", { className: `border-t ${limiting ? "font-medium" : ""}`, children: [_jsxs("td", { className: "p-2", children: [p.product_id ? (_jsx(Link, { to: "/voorraad/$id", params: { id: p.product_id }, className: "underline", children: name(p.product_id) })) : ("—"), limiting && _jsx("span", { className: "ml-1 text-amber-700", children: "(bepaalt het maximum)" })] }), _jsx("td", { className: "p-2 text-right tabular-nums", children: p.quantity ?? 1 }), _jsx("td", { className: "p-2 text-right tabular-nums", children: p.available ?? 0 }), _jsxs("td", { className: "p-2 text-right tabular-nums", children: [p.possible ?? 0, " sets"] })] }, (p.product_id ?? "") + i));
|
|
107
|
+
}) })] }), _jsx("p", { className: "text-muted-foreground", children: "De onderdelen blijven ook los te koop in Floriday." })] })), groupHeads.length > 0 && (_jsx("div", { className: "rounded border px-3 py-2", children: groupHeads.map((g) => (_jsxs("div", { children: ["Lid van groep", " ", g.headId ? (_jsx(Link, { to: "/voorraad/$id", params: { id: g.headId }, className: "underline font-medium", children: g.name })) : (_jsx("span", { className: "font-medium", children: g.name })), " ", "\u2014 staat niet los in Floriday; de groep wordt gepubliceerd."] }, g.id))) })), (totals?.component_of_sets?.length ?? 0) > 0 && (_jsxs("div", { className: "rounded border px-3 py-2", children: ["Onderdeel van:", " ", totals.component_of_sets.map((id, i) => (_jsxs("span", { children: [i > 0 && ", ", _jsx(Link, { to: "/voorraad/$id", params: { id }, className: "underline", children: name(id) })] }, id))), ". Een verkoop van dit artikel verlaagt ook de berekende stand van die sets."] })), _jsxs("div", { className: "text-xs text-muted-foreground", children: ["Floriday: ", reason ?? "doorgegeven"] })] })] }));
|
|
108
|
+
}
|
|
109
|
+
/** Eén regel met de echte reden waarom de voorraad (nog) niet in Floriday staat. */
|
|
110
|
+
export function FloridayStockReasonLine({ productId }) {
|
|
111
|
+
const [text, setText] = useState(null);
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
if (!productId)
|
|
114
|
+
return;
|
|
115
|
+
let cancelled = false;
|
|
116
|
+
(async () => {
|
|
117
|
+
const [sRes, qRes] = await Promise.all([
|
|
118
|
+
supabase.from("floriday_inventory_settings").select("action_reason").eq("product_id", productId).limit(1).maybeSingle(),
|
|
119
|
+
supabase
|
|
120
|
+
.from("floriday_continuous_stock_queue")
|
|
121
|
+
.select("status, skip_reason, last_error")
|
|
122
|
+
.eq("product_id", productId)
|
|
123
|
+
.neq("status", "superseded")
|
|
124
|
+
.order("created_at", { ascending: false })
|
|
125
|
+
.limit(1)
|
|
126
|
+
.maybeSingle(),
|
|
127
|
+
]);
|
|
128
|
+
if (cancelled)
|
|
129
|
+
return;
|
|
130
|
+
const q = qRes.data;
|
|
131
|
+
setText(floridayPendingReason({
|
|
132
|
+
actionReason: sRes.data?.action_reason ?? null,
|
|
133
|
+
lastQueueStatus: q?.status,
|
|
134
|
+
lastSkipReason: q?.skip_reason,
|
|
135
|
+
lastError: q?.last_error,
|
|
136
|
+
}));
|
|
137
|
+
})();
|
|
138
|
+
return () => {
|
|
139
|
+
cancelled = true;
|
|
140
|
+
};
|
|
141
|
+
}, [productId]);
|
|
142
|
+
if (!text)
|
|
143
|
+
return null;
|
|
144
|
+
return _jsxs("div", { className: "text-xs", children: ["Voorraad in Floriday: ", text] });
|
|
145
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StockPushMonitor.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/StockPushMonitor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StockPushMonitor.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/StockPushMonitor.tsx"],"names":[],"mappings":"AA4NA,wBAAgB,gBAAgB,CAAC,EAAE,YAAY,EAAE,EAAE;IAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,+BA2MjF"}
|
|
@@ -28,6 +28,7 @@ const STATUS_LABEL = {
|
|
|
28
28
|
dead_letter: "Definitief mislukt",
|
|
29
29
|
superseded: "Vervangen",
|
|
30
30
|
skipped_no_price: "Prijs ontbreekt, nog niet verzonden",
|
|
31
|
+
skipped_no_warehouse: "Geen magazijn, niet verzonden",
|
|
31
32
|
};
|
|
32
33
|
function toneClass(tone) {
|
|
33
34
|
if (tone === "ok")
|
|
@@ -93,6 +94,13 @@ function displayStatus(job) {
|
|
|
93
94
|
}
|
|
94
95
|
return { label: "Bezig", tone: "warn" };
|
|
95
96
|
}
|
|
97
|
+
if (job.status === "skipped_no_warehouse") {
|
|
98
|
+
return {
|
|
99
|
+
label: "Geen magazijn, niet verzonden",
|
|
100
|
+
tone: "error",
|
|
101
|
+
hint: job.skipReason ?? "Geen voorkeursmagazijn voor deze koppeling; kies er een op de Connectie-pagina",
|
|
102
|
+
};
|
|
103
|
+
}
|
|
96
104
|
if (job.status === "skipped_no_price") {
|
|
97
105
|
return {
|
|
98
106
|
label: "Prijs ontbreekt, nog niet verzonden",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoorraadTable.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/VoorraadTable.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAI3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"VoorraadTable.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/VoorraadTable.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAI3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAkBzE,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,+BAiOA"}
|
|
@@ -5,6 +5,7 @@ import { Badge, Button, Checkbox } from "@flowselections/core";
|
|
|
5
5
|
import { useVoorraadCustomFields } from "../../hooks/useVoorraadCustomFields";
|
|
6
6
|
import { formatCustomValue } from "../../lib/voorraad-custom-fields";
|
|
7
7
|
import { InventoryStatusBadge } from "./InventoryStatusBadge";
|
|
8
|
+
import { PRODUCT_TYPE_CLASSES, PRODUCT_TYPE_HELP, PRODUCT_TYPE_LABELS, toStructureType } from "../../lib/product-types";
|
|
8
9
|
const columns = [
|
|
9
10
|
{ key: "quantity", label: "Liggend" },
|
|
10
11
|
{ key: "minQuantity", label: "Minimum" },
|
|
@@ -60,6 +61,9 @@ export function VoorraadTable({ items, loading, settingsByKey, selected, onToggl
|
|
|
60
61
|
: "Niet online in Floriday", title: floriday
|
|
61
62
|
? "Online in Floriday"
|
|
62
63
|
: "Niet online in Floriday", className: "inline-flex items-center gap-1.5 rounded-full border border-border bg-background px-2 py-0.5 text-[11px] font-medium leading-none text-muted-foreground", children: [_jsx("span", { className: "h-1.5 w-1.5 rounded-full " +
|
|
63
|
-
(floriday ? "bg-emerald-500" : "bg-red-500"), "aria-hidden": true }), _jsx("span", { children: "Floriday" })] })] }), Boolean(customValue(item, "floriday_sync")?.dirty) && (_jsx("div", { className: "mt-1 inline-flex items-center rounded-full bg-amber-100 px-2 py-0.5 text-[11px] font-medium leading-none text-amber-800", title: "Opgeslagen in dit systeem, wacht nog op doorgifte naar Floriday", children: "Wacht op Floriday" })), low && (_jsx("div", { className: "text-xs text-destructive", children: "onder minimumvoorraad" }))] }), _jsx("td", { className: "p-3", onClick: (e) => e.stopPropagation(), children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(InventoryStatusBadge, { setting: setting }), settingProductId && onOpenSettings && (_jsx(Button, { variant: "ghost", size: "sm", className: "h-7 w-7 p-0", onClick: () => onOpenSettings(settingProductId), "aria-label": `Voorraadsturing van ${item.name}`, children: _jsx(Settings2, { className: "h-4 w-4" }) }))] }) }), _jsx("td", { className: "p-3", children:
|
|
64
|
+
(floriday ? "bg-emerald-500" : "bg-red-500"), "aria-hidden": true }), _jsx("span", { children: "Floriday" })] })] }), Boolean(customValue(item, "floriday_sync")?.dirty) && (_jsx("div", { className: "mt-1 inline-flex items-center rounded-full bg-amber-100 px-2 py-0.5 text-[11px] font-medium leading-none text-amber-800", title: "Opgeslagen in dit systeem, wacht nog op doorgifte naar Floriday", children: "Wacht op Floriday" })), low && (_jsx("div", { className: "text-xs text-destructive", children: "onder minimumvoorraad" }))] }), _jsx("td", { className: "p-3", onClick: (e) => e.stopPropagation(), children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(InventoryStatusBadge, { setting: setting }), settingProductId && onOpenSettings && (_jsx(Button, { variant: "ghost", size: "sm", className: "h-7 w-7 p-0", onClick: () => onOpenSettings(settingProductId), "aria-label": `Voorraadsturing van ${item.name}`, children: _jsx(Settings2, { className: "h-4 w-4" }) }))] }) }), _jsx("td", { className: "p-3", children: (() => {
|
|
65
|
+
const t = toStructureType(setting?.product_type, item.itemType);
|
|
66
|
+
return (_jsxs("div", { className: "flex flex-col items-start gap-1", children: [_jsx(Badge, { variant: t === "NORMAL" ? "secondary" : undefined, className: PRODUCT_TYPE_CLASSES[t], title: PRODUCT_TYPE_HELP[t], children: PRODUCT_TYPE_LABELS[t] }), setting?.action_reason === "GROUP_MEMBER_OFF" && (_jsx("span", { className: "text-[11px] text-muted-foreground", title: "Dit artikel is lid van een actieve productgroep; alleen de groep staat in Floriday.", children: "Lid van groep \u00B7 niet los in Floriday" })), setting?.action_reason === "SET_AWAITS_LOGISTICS" && (_jsx("span", { className: "text-[11px] text-amber-700", title: "Berekend uit de onderdelen; nog niet naar Floriday tot de Logistieke engine onderdelen reserveert.", children: "Berekend \u00B7 nog niet in Floriday" }))] }));
|
|
67
|
+
})() }), _jsx("td", { className: "p-3 font-mono text-xs", children: item.articleNumber || "—" }), columns.map((c) => (_jsx("td", { className: "p-3 text-right tabular-nums text-muted-foreground", children: Number(item[c.key] ?? 0) }, c.key))), extraColumns.map((f) => (_jsx("td", { className: "p-3 text-muted-foreground whitespace-nowrap", children: formatCustomValue(customValue(item, f.field_key)) }, f.id)))] }, item.id));
|
|
64
68
|
}) })] }) }));
|
|
65
69
|
}
|
|
@@ -21,6 +21,7 @@ export type InventorySetting = {
|
|
|
21
21
|
last_confirmed_at: string | null;
|
|
22
22
|
action_reason: string | null;
|
|
23
23
|
packing_size: number | null;
|
|
24
|
+
product_type: string | null;
|
|
24
25
|
};
|
|
25
26
|
export declare function useInventorySettings(connectionId: string | null): {
|
|
26
27
|
rows: InventorySetting[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInventorySettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useInventorySettings.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,UAAU,EAAE,SAAS,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AAKF,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;;;;;;EA0D/D"}
|
|
1
|
+
{"version":3,"file":"useInventorySettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useInventorySettings.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,UAAU,EAAE,SAAS,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AAKF,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;;;;;;EA0D/D"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { useCallback, useEffect, useState } from "react";
|
|
7
7
|
import { supabase } from "../integrations/supabase/client";
|
|
8
|
-
const SELECT = "id, connection_id, product_id, floriday_trade_item_id, stock_mode, buffer_quantity, maximum_quantity, fixed_quantity, manual_quantity, desired_quantity, desired_availability, remote_quantity, remote_available, remote_checked_at, sync_status, last_sync_error, last_published_at, last_confirmed_at, action_reason, packing_size";
|
|
8
|
+
const SELECT = "id, connection_id, product_id, floriday_trade_item_id, stock_mode, buffer_quantity, maximum_quantity, fixed_quantity, manual_quantity, desired_quantity, desired_availability, remote_quantity, remote_available, remote_checked_at, sync_status, last_sync_error, last_published_at, last_confirmed_at, action_reason, packing_size, product_type";
|
|
9
9
|
export function useInventorySettings(connectionId) {
|
|
10
10
|
const [rows, setRows] = useState([]);
|
|
11
11
|
const [loading, setLoading] = useState(false);
|