@flowselections/floriday-klanten-module 1.0.100 → 1.0.103
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/klanten/BulkStickerUploadDialog.d.ts.map +1 -1
- package/dist-lib/components/klanten/BulkStickerUploadDialog.js +28 -19
- package/dist-lib/components/klanten/CustomerArticleAliasDialog.d.ts +14 -0
- package/dist-lib/components/klanten/CustomerArticleAliasDialog.d.ts.map +1 -0
- package/dist-lib/components/klanten/CustomerArticleAliasDialog.js +47 -0
- package/dist-lib/components/klanten/CustomerAssortmentTab.d.ts +3 -1
- package/dist-lib/components/klanten/CustomerAssortmentTab.d.ts.map +1 -1
- package/dist-lib/components/klanten/CustomerAssortmentTab.js +23 -3
- package/dist-lib/components/klanten/CustomerLogisticsCard.d.ts +5 -0
- package/dist-lib/components/klanten/CustomerLogisticsCard.d.ts.map +1 -0
- package/dist-lib/components/klanten/CustomerLogisticsCard.js +92 -0
- package/dist-lib/components/klanten/KlantDetail.d.ts.map +1 -1
- package/dist-lib/components/klanten/KlantDetail.js +25 -3
- package/dist-lib/components/klanten/KlantenOverzicht.d.ts.map +1 -1
- package/dist-lib/components/klanten/KlantenOverzicht.js +26 -7
- package/dist-lib/index.d.ts +1 -0
- package/dist-lib/index.d.ts.map +1 -1
- package/dist-lib/index.js +1 -0
- package/dist-lib/integrations/supabase/types.d.ts +4196 -25
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/customer-archief.d.ts +25 -0
- package/dist-lib/lib/customer-archief.d.ts.map +1 -0
- package/dist-lib/lib/customer-archief.functions.d.ts +31 -0
- package/dist-lib/lib/customer-archief.functions.d.ts.map +1 -0
- package/dist-lib/lib/customer-archief.functions.js +35 -0
- package/dist-lib/lib/customer-archief.js +31 -0
- package/dist-lib/lib/customer-assortment.functions.d.ts +4 -0
- package/dist-lib/lib/customer-assortment.functions.d.ts.map +1 -1
- package/dist-lib/lib/customer-assortment.functions.js +7 -1
- package/dist-lib/lib/customer-schemas.d.ts +6 -1
- package/dist-lib/lib/customer-schemas.d.ts.map +1 -1
- package/dist-lib/lib/customer-schemas.js +2 -0
- package/dist-lib/lib/customers.functions.d.ts +2 -1
- package/dist-lib/lib/customers.functions.d.ts.map +1 -1
- package/dist-lib/lib/customers.functions.js +6 -2
- package/dist-lib/lib/klant-artikel-alias.d.ts +20 -0
- package/dist-lib/lib/klant-artikel-alias.d.ts.map +1 -0
- package/dist-lib/lib/klant-artikel-alias.functions.d.ts +50 -0
- package/dist-lib/lib/klant-artikel-alias.functions.d.ts.map +1 -0
- package/dist-lib/lib/klant-artikel-alias.functions.js +66 -0
- package/dist-lib/lib/klant-artikel-alias.js +48 -0
- package/dist-lib/lib/klanten-overzicht.d.ts +3 -1
- package/dist-lib/lib/klanten-overzicht.d.ts.map +1 -1
- package/dist-lib/lib/klanten-overzicht.js +6 -1
- package/dist-lib/lib/labels.d.ts +6 -0
- package/dist-lib/lib/labels.d.ts.map +1 -1
- package/dist-lib/lib/labels.js +2 -0
- package/dist-lib/lib/lijst-stand.d.ts +2 -0
- package/dist-lib/lib/lijst-stand.d.ts.map +1 -1
- package/dist-lib/lib/lijst-stand.js +4 -0
- package/dist-lib/lib/logistiek-uitzonderingen.functions.d.ts +61 -0
- package/dist-lib/lib/logistiek-uitzonderingen.functions.d.ts.map +1 -0
- package/dist-lib/lib/logistiek-uitzonderingen.functions.js +81 -0
- package/dist-lib/lib/sticker-filter.d.ts +9 -0
- package/dist-lib/lib/sticker-filter.d.ts.map +1 -0
- package/dist-lib/lib/sticker-filter.js +12 -0
- package/dist-lib/lib/voorraad-assortiment.d.ts +2 -0
- package/dist-lib/lib/voorraad-assortiment.d.ts.map +1 -1
- package/dist-lib/lib/voorraad-assortiment.js +2 -0
- package/package.json +1 -1
- package/schema/klanten.sql +177 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkStickerUploadDialog.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/BulkStickerUploadDialog.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"BulkStickerUploadDialog.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/BulkStickerUploadDialog.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAWxD,MAAM,MAAM,WAAW,GAAG;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,uFAAuF;IACvF,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,kEAAkE;AAClE,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAGpG;AAsDD,wBAAgB,uBAAuB,CAAC,EACtC,WAAW,EACX,QAAQ,EACR,MAAM,EACN,KAAK,EAAE,SAAqB,EAC5B,WAAmB,GACpB,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,+BAyhBA"}
|
|
@@ -10,6 +10,7 @@ import { friendlyError } from "../../lib/errors.js";
|
|
|
10
10
|
import { STICKER_AANVRAAG, inPorties, teVeelStickerBestanden } from "../../lib/sticker-porties.js";
|
|
11
11
|
import { SearchableSelect } from "./SearchableSelect.js";
|
|
12
12
|
import { renderPdfThumbnail } from "../../lib/pdf-thumbnail.js";
|
|
13
|
+
import { filterStickerRows, telStickerFilters } from "../../lib/sticker-filter.js";
|
|
13
14
|
const BUCKET = "customer-stickers";
|
|
14
15
|
const MAX_SIZE = 10 * 1024 * 1024;
|
|
15
16
|
const ACCEPT = ".pdf,.png,.jpg,.jpeg,.svg";
|
|
@@ -83,6 +84,9 @@ export function BulkStickerUploadDialog({ customerKey, products, onDone, soort:
|
|
|
83
84
|
count.set(r.tradeItemKey, (count.get(r.tradeItemKey) ?? 0) + 1);
|
|
84
85
|
return new Set([...count.entries()].filter(([, n]) => n > 1).map(([k]) => k));
|
|
85
86
|
}, [rows]);
|
|
87
|
+
const [filter, setFilter] = useState("alles");
|
|
88
|
+
const tellingen = useMemo(() => telStickerFilters(rows), [rows]);
|
|
89
|
+
const zichtbareRows = useMemo(() => filterStickerRows(rows, filter), [rows, filter]);
|
|
86
90
|
const reset = () => {
|
|
87
91
|
setRows((prev) => {
|
|
88
92
|
for (const x of prev)
|
|
@@ -277,23 +281,28 @@ export function BulkStickerUploadDialog({ customerKey, products, onDone, soort:
|
|
|
277
281
|
? `Bestanden uploaden… ${progress.done}/${progress.total}`
|
|
278
282
|
: progress.total > 1
|
|
279
283
|
? `Koppelen ${progress.done} van ${progress.total}…`
|
|
280
|
-
: "AI zoekt bij elke sticker het juiste product…"] })), (phase === "review" || phase === "saving") && (
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
284
|
+
: "AI zoekt bij elke sticker het juiste product…"] })), (phase === "review" || phase === "saving") && (_jsxs("div", { className: "min-h-0 flex-1 overflow-y-auto overflow-x-hidden", children: [_jsx("div", { className: "sticky top-0 z-10 flex flex-wrap gap-2 bg-background pb-3", role: "group", "aria-label": "Filter stickers", children: [
|
|
285
|
+
["alles", "Alles"],
|
|
286
|
+
["nog", "Nog koppelen"],
|
|
287
|
+
["gekoppeld", "Gekoppeld"],
|
|
288
|
+
].map(([k, label]) => (_jsxs(Button, { type: "button", size: "sm", variant: filter === k ? "default" : "outline", "aria-pressed": filter === k, onClick: () => setFilter(k), children: [label, " ", _jsxs("span", { className: "ml-1 tabular-nums", children: ["(", tellingen[k], ")"] })] }, k))) }), _jsx("ul", { className: "flex flex-col gap-3", children: zichtbareRows.map((r) => {
|
|
289
|
+
const product = r.tradeItemKey ? productByKey.get(r.tradeItemKey) : null;
|
|
290
|
+
const dup = r.tradeItemKey ? duplicates.has(r.tradeItemKey) : false;
|
|
291
|
+
const box = "flex h-[220px] w-[220px] shrink-0 items-center justify-center overflow-hidden rounded-md border bg-white";
|
|
292
|
+
return (_jsxs("li", { className: `flex min-w-0 flex-col gap-4 rounded-lg border p-4 md:flex-row ${r.tradeItemKey ? "" : "border-warning/60"}`, children: [r.thumbnail || r.localUrl ? (_jsx("button", { type: "button", className: `${box} cursor-zoom-in transition-shadow duration-150 ease-out hover:ring-2 hover:ring-primary/50 motion-reduce:transition-none`, title: r.thumbnail ? "Klik om te vergroten" : "Klik om de PDF te bekijken", onClick: () => setPreviewRow(r), children: r.thumbnail ? (_jsx("img", { src: r.thumbnail, alt: r.fileName, className: "h-full w-full object-contain" })) : (_jsx(FileText, { className: "h-10 w-10 text-muted-foreground" })) })) : (_jsx("div", { className: box, children: _jsx(FileText, { className: "h-10 w-10 text-muted-foreground" }) })), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [_jsx("div", { className: "line-clamp-2 break-words font-medium", title: r.fileName, children: r.fileName }), r.reason && (_jsx("div", { className: "line-clamp-2 break-words text-xs text-muted-foreground", title: r.reason, children: r.reason })), _jsxs("div", { className: "w-full min-w-0 max-w-[560px]", title: product ? product.name : undefined, children: [_jsx(SearchableSelect, { value: r.tradeItemKey ?? "", options: productOptions, placeholder: "Kies product\u2026", triggerClassName: "w-full min-w-0 max-w-full overflow-hidden", onValueChange: (v) => setRows((prev) => prev.map((x) => x.fileId === r.fileId
|
|
293
|
+
? {
|
|
294
|
+
...x,
|
|
295
|
+
tradeItemKey: v || null,
|
|
296
|
+
replaceExisting: v
|
|
297
|
+
? heeftStickerVanSoort(productByKey.get(v), soort)
|
|
298
|
+
: false,
|
|
299
|
+
}
|
|
300
|
+
: x)) }), dup && (_jsx("div", { className: "text-xs text-destructive mt-1", children: "Meerdere stickers voor dit product" }))] }), _jsxs("div", { className: "flex items-center gap-3", children: [r.tradeItemKey ? (_jsx(Badge, { variant: r.confidence >= 0.8
|
|
301
|
+
? "default"
|
|
302
|
+
: r.confidence >= 0.5
|
|
303
|
+
? "secondary"
|
|
304
|
+
: "outline", children: r.confidence >= 0.8 ? "Hoog" : r.confidence >= 0.5 ? "Middel" : "Laag" })) : (_jsx(Badge, { variant: "outline", children: "Geen match" })), heeftStickerVanSoort(product, soort) && (_jsxs("label", { className: "flex items-center gap-2 text-xs", children: [_jsx("input", { type: "checkbox", checked: r.replaceExisting, onChange: (e) => setRows((prev) => prev.map((x) => x.fileId === r.fileId
|
|
305
|
+
? { ...x, replaceExisting: e.target.checked }
|
|
306
|
+
: x)) }), "Vervangen"] })), _jsx(Button, { type: "button", variant: "ghost", size: "icon", className: "ml-auto", "aria-label": "Sticker verwijderen", onClick: () => setRows((prev) => prev.filter((x) => x.fileId !== r.fileId)), children: _jsx(Trash2, { className: "h-4 w-4" }) })] })] })] }, r.fileId));
|
|
307
|
+
}) }), zichtbareRows.length === 0 && (_jsx("p", { className: "p-6 text-center text-sm text-muted-foreground", children: "Geen stickers in deze selectie." }))] })), _jsxs(DialogFooter, { className: "gap-2 sm:justify-between", children: [_jsx("span", { className: "text-xs text-muted-foreground flex items-center gap-1.5", children: phase === "review" && (_jsxs(_Fragment, { children: [_jsx(Sparkles, { className: "h-3.5 w-3.5" }), rows.filter((r) => r.tradeItemKey).length, " van ", rows.length, " gekoppeld"] })) }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { type: "button", variant: "outline", disabled: busy, onClick: () => void close(true), children: "Annuleren" }), (phase === "review" || phase === "saving") && (_jsxs(Button, { type: "button", disabled: busy, onClick: () => void save(), children: [phase === "saving" && _jsx(Loader2, { className: "h-4 w-4 mr-1.5 animate-spin" }), "Bevestigen en opslaan"] }))] })] })] }) }), _jsx(Dialog, { open: previewRow !== null, onOpenChange: (v) => !v && setPreviewRow(null), children: _jsxs(DialogContent, { className: "max-w-5xl", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: previewRow?.fileName ?? "Sticker" }) }), !previewRow?.thumbnail && previewRow?.localUrl && (_jsx("iframe", { src: previewRow.localUrl, title: previewRow.fileName, className: "h-[70vh] w-full rounded border bg-white" })), previewRow?.thumbnail && (_jsx("div", { className: "flex items-center justify-center rounded border bg-white p-2", children: _jsx("img", { src: previewRow.thumbnail, alt: previewRow.fileName, className: "max-h-[70vh] w-auto max-w-full object-contain" }) }))] }) })] }));
|
|
299
308
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { KlantArtikelAlias } from "../../lib/klant-artikel-alias.js";
|
|
2
|
+
export type AliasArtikel = {
|
|
3
|
+
name: string;
|
|
4
|
+
code: string | null;
|
|
5
|
+
product_id: string;
|
|
6
|
+
product_ids: string[];
|
|
7
|
+
alias: KlantArtikelAlias | null;
|
|
8
|
+
};
|
|
9
|
+
export declare function CustomerArticleAliasDialog({ customerId, artikel, onOpenChange, }: {
|
|
10
|
+
customerId: string;
|
|
11
|
+
artikel: AliasArtikel | null;
|
|
12
|
+
onOpenChange: (open: boolean) => void;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=CustomerArticleAliasDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomerArticleAliasDialog.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/CustomerArticleAliasDialog.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACjC,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,EACzC,UAAU,EACV,OAAO,EACP,YAAY,GACb,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;IAC7B,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC,+BAkFA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
4
|
+
import { useServerFn } from "@tanstack/react-start";
|
|
5
|
+
import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Input, Label, } from "@flowselections/core";
|
|
6
|
+
import { toast } from "sonner";
|
|
7
|
+
import { deleteKlantArtikelAlias, saveKlantArtikelAlias } from "../../lib/klant-artikel-alias.functions.js";
|
|
8
|
+
import { friendlyError } from "../../lib/errors.js";
|
|
9
|
+
export function CustomerArticleAliasDialog({ customerId, artikel, onOpenChange, }) {
|
|
10
|
+
const qc = useQueryClient();
|
|
11
|
+
const save = useServerFn(saveKlantArtikelAlias);
|
|
12
|
+
const wis = useServerFn(deleteKlantArtikelAlias);
|
|
13
|
+
const [code, setCode] = useState("");
|
|
14
|
+
const [naam, setNaam] = useState("");
|
|
15
|
+
const [fout, setFout] = useState(null);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (artikel) {
|
|
18
|
+
setCode(artikel.alias?.customer_article_code ?? "");
|
|
19
|
+
setNaam(artikel.alias?.customer_article_name ?? "");
|
|
20
|
+
setFout(null);
|
|
21
|
+
}
|
|
22
|
+
}, [artikel]);
|
|
23
|
+
const klaar = () => {
|
|
24
|
+
qc.invalidateQueries({ queryKey: ["klant-artikel-aliases", customerId] });
|
|
25
|
+
onOpenChange(false);
|
|
26
|
+
};
|
|
27
|
+
const opslaan = useMutation({
|
|
28
|
+
mutationFn: () => save({ data: { customer_id: customerId, product_id: artikel.product_id, product_ids: artikel.product_ids, code: code || null, naam: naam || null } }),
|
|
29
|
+
onSuccess: (r) => {
|
|
30
|
+
if (!r.ok) {
|
|
31
|
+
setFout(r.fout);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
toast.success("Klantartikel opgeslagen");
|
|
35
|
+
klaar();
|
|
36
|
+
},
|
|
37
|
+
onError: (e) => { console.error(e); setFout(friendlyError(e, "Opslaan is niet gelukt")); },
|
|
38
|
+
});
|
|
39
|
+
const wissen = useMutation({
|
|
40
|
+
mutationFn: () => wis({ data: { customer_id: customerId, product_ids: artikel.product_ids } }),
|
|
41
|
+
onSuccess: () => { toast.success("Klantartikel gewist"); klaar(); },
|
|
42
|
+
onError: (e) => { console.error(e); setFout(friendlyError(e, "Wissen is niet gelukt")); },
|
|
43
|
+
});
|
|
44
|
+
const bezig = opslaan.isPending || wissen.isPending;
|
|
45
|
+
const alias = artikel?.alias ?? null;
|
|
46
|
+
return (_jsx(Dialog, { open: !!artikel, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { className: "sm:max-w-md", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Klantartikel" }), _jsxs(DialogDescription, { children: [artikel?.name, artikel?.code ? ` · ${artikel.code}` : ""] })] }), _jsxs("form", { className: "space-y-4", onSubmit: (e) => { e.preventDefault(); setFout(null); opslaan.mutate(); }, children: [_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "klantartikelcode", children: "Klantartikelcode" }), _jsx(Input, { id: "klantartikelcode", value: code, maxLength: 100, autoFocus: true, onChange: (e) => { setCode(e.target.value); setFout(null); } })] }), _jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "klantartikelnaam", children: "Klantartikelnaam" }), _jsx(Input, { id: "klantartikelnaam", value: naam, maxLength: 200, onChange: (e) => setNaam(e.target.value) })] }), alias?.source === "mailbox" && (_jsxs("p", { className: "text-xs text-muted-foreground", children: ["Geleerd uit de mailbox, ", alias.times_confirmed, " keer bevestigd"] })), fout && _jsx("p", { role: "alert", className: "text-sm text-destructive", children: fout }), _jsxs(DialogFooter, { className: "gap-2 sm:justify-between", children: [_jsx(Button, { type: "button", variant: "outline", disabled: bezig || !alias, onClick: () => wissen.mutate(), children: "Wissen" }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { type: "button", variant: "ghost", disabled: bezig, onClick: () => onOpenChange(false), children: "Annuleren" }), _jsx(Button, { type: "submit", disabled: bezig, children: opslaan.isPending ? "Opslaan…" : "Opslaan" })] })] })] })] }) }));
|
|
47
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export declare function CustomerAssortmentTab({ customerKey, organizationId, }: {
|
|
1
|
+
export declare function CustomerAssortmentTab({ customerKey, organizationId, customerId, }: {
|
|
2
2
|
customerKey: string;
|
|
3
3
|
organizationId?: string | null;
|
|
4
|
+
/** Optioneel: klant-id; nodig voor klantartikelcodes. */
|
|
5
|
+
customerId?: string | null;
|
|
4
6
|
}): import("react").JSX.Element;
|
|
5
7
|
//# sourceMappingURL=CustomerAssortmentTab.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomerAssortmentTab.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/CustomerAssortmentTab.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CustomerAssortmentTab.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/CustomerAssortmentTab.tsx"],"names":[],"mappings":"AA6BA,wBAAgB,qBAAqB,CAAC,EACpC,WAAW,EACX,cAAc,EACd,UAAU,GACX,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,+BAiaA"}
|
|
@@ -16,12 +16,15 @@ import { FloridayPriceImportDialog } from "./FloridayPriceImportDialog.js";
|
|
|
16
16
|
import { CustomerStickerCell } from "./CustomerStickerCell.js";
|
|
17
17
|
import { CustomerStickerFormatDialog } from "./CustomerStickerFormatDialog.js";
|
|
18
18
|
import { BulkStickerUploadDialog } from "./BulkStickerUploadDialog.js";
|
|
19
|
+
import { CustomerArticleAliasDialog } from "./CustomerArticleAliasDialog.js";
|
|
20
|
+
import { listKlantArtikelAliases } from "../../lib/klant-artikel-alias.functions.js";
|
|
21
|
+
import { kiesAlias } from "../../lib/klant-artikel-alias.js";
|
|
19
22
|
function money(value, currency) {
|
|
20
23
|
if (value == null)
|
|
21
24
|
return "—";
|
|
22
25
|
return formatMoney(value, currency);
|
|
23
26
|
}
|
|
24
|
-
export function CustomerAssortmentTab({ customerKey, organizationId, }) {
|
|
27
|
+
export function CustomerAssortmentTab({ customerKey, organizationId, customerId, }) {
|
|
25
28
|
const list = useServerFn(listCustomerAssortment);
|
|
26
29
|
const listStickers = useServerFn(listCustomerStickers);
|
|
27
30
|
const importStickers = useServerFn(importFloridayStickers);
|
|
@@ -30,6 +33,13 @@ export function CustomerAssortmentTab({ customerKey, organizationId, }) {
|
|
|
30
33
|
const [onlyPriced, setOnlyPriced] = useState(false);
|
|
31
34
|
const [onlyWithoutSticker, setOnlyWithoutSticker] = useState(false);
|
|
32
35
|
const [group, setGroup] = useState("own");
|
|
36
|
+
const listAliases = useServerFn(listKlantArtikelAliases);
|
|
37
|
+
const [aliasArtikel, setAliasArtikel] = useState(null);
|
|
38
|
+
const { data: aliases } = useQuery({
|
|
39
|
+
queryKey: ["klant-artikel-aliases", customerId],
|
|
40
|
+
queryFn: () => listAliases({ data: { customer_id: customerId } }),
|
|
41
|
+
enabled: !!customerId,
|
|
42
|
+
});
|
|
33
43
|
const { data, isLoading, error } = useQuery({
|
|
34
44
|
queryKey: ["customer-assortment", customerKey, organizationId ?? null],
|
|
35
45
|
queryFn: () => list({ data: { customerKey, organizationId: organizationId ?? null } }).then(decodeDeep),
|
|
@@ -148,11 +158,21 @@ export function CustomerAssortmentTab({ customerKey, organizationId, }) {
|
|
|
148
158
|
: defaultFormat
|
|
149
159
|
? `${defaultFormat.width_mm} × ${defaultFormat.height_mm} mm`
|
|
150
160
|
: null;
|
|
151
|
-
|
|
161
|
+
const alias = kiesAlias(aliases ?? [], i.product_ids ?? []);
|
|
162
|
+
return (_jsxs(TableRow, { className: customerId && i.product_id ? "cursor-pointer" : undefined, title: customerId && !i.product_id ? "Dit artikel staat nog niet in de voorraad" : undefined, onClick: (e) => {
|
|
163
|
+
if (!customerId || !i.product_id)
|
|
164
|
+
return;
|
|
165
|
+
if (e.target.closest("button, a, input, label, select, textarea, [role='dialog']"))
|
|
166
|
+
return;
|
|
167
|
+
setAliasArtikel({ name: i.name, code: i.supplier_article_code, product_id: i.product_id, product_ids: i.product_ids, alias });
|
|
168
|
+
}, children: [_jsx(TableCell, { children: i.image_url ? (_jsx("img", { src: i.image_url, alt: "", loading: "lazy", className: "h-10 w-10 rounded object-cover bg-muted" })) : (_jsx("div", { className: "h-10 w-10 rounded bg-muted flex items-center justify-center text-muted-foreground", children: _jsx(ImageOff, { className: "h-4 w-4" }) })) }), _jsxs(TableCell, { children: [_jsxs("div", { className: "font-medium flex items-center gap-2", children: [i.name, i.restricted && (_jsx(Badge, { variant: "secondary", title: "Alleen voor deze klant beschikbaar", children: "Exclusief" })), i.floriday_source_label && (_jsx(Badge, { variant: i.floriday_source === "contract" ? "default" : "secondary", children: i.floriday_source_label }))] }), _jsx("div", { className: "text-xs text-muted-foreground", children: [
|
|
152
169
|
i.supplier_article_code,
|
|
153
170
|
i.vbn_code ? `VBN ${i.vbn_code}` : null,
|
|
154
171
|
i.botanical_name,
|
|
155
172
|
i.country_of_origin,
|
|
173
|
+
alias?.customer_article_code ? `Klantcode: ${alias.customer_article_code}` : null,
|
|
174
|
+
alias?.customer_article_name ? `Klantnaam: ${alias.customer_article_name}` : null,
|
|
156
175
|
].filter(Boolean).join(" · ") || "—" })] }), hasOwnAssortment && (_jsx(TableCell, { children: i.in_assortment ? (_jsx(Badge, { children: "Eigen assortiment" })) : (_jsx("span", { className: "text-xs text-muted-foreground", children: "Overig" })) })), _jsxs(TableCell, { className: "text-sm text-muted-foreground", children: [_jsx("div", { children: i.packaging ?? "—" }), packing.length > 0 && (_jsx("div", { className: "text-xs", children: packing.join(" · ") }))] }), _jsx(TableCell, { className: "text-right whitespace-nowrap tabular-nums text-muted-foreground", children: money(i.base_price, i.currency) }), _jsxs(TableCell, { className: "text-right whitespace-nowrap tabular-nums", children: [_jsx("div", { className: "font-medium", children: money(i.price, i.currency) }), i.base_price_source && (_jsx("div", { className: "text-[10px] text-muted-foreground", children: i.base_price_source }))] }), _jsx(TableCell, { children: _jsxs("div", { className: "space-y-1", children: [_jsx(CustomerStickerCell, { customerKey: customerKey, tradeItemKey: i.key, sticker: sticker }), sticker ? (_jsxs("div", { className: "flex items-center gap-1.5 text-[10px] text-muted-foreground", children: [_jsx(Badge, { variant: sticker.source === "floriday" ? "default" : "secondary", children: sticker.source === "floriday" ? "Uit Floriday" : "Handmatig" }), fmt && _jsx("span", { children: fmt })] })) : _jsx("div", { className: "text-[10px] text-muted-foreground", children: "\u2014" })] }) }), _jsx(TableCell, { children: _jsx(CustomerStickerCell, { customerKey: customerKey, tradeItemKey: i.key, sticker: fustMap.get(i.key) ?? null, soort: "fust" }) })] }, i.key));
|
|
157
|
-
}) })] }) }) })
|
|
176
|
+
}) })] }) }) }), customerId && (_jsx(CustomerArticleAliasDialog, { customerId: customerId, artikel: aliasArtikel, onOpenChange: (o) => { if (!o)
|
|
177
|
+
setAliasArtikel(null); } }))] }));
|
|
158
178
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomerLogisticsCard.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/CustomerLogisticsCard.tsx"],"names":[],"mappings":"AA4BA,4FAA4F;AAC5F,wBAAgB,qBAAqB,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,+BAqM3E"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState } from "react";
|
|
3
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
|
+
import { useServerFn } from "@tanstack/react-start";
|
|
5
|
+
import { Button, Card, CardContent, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, toast, } from "@flowselections/core";
|
|
6
|
+
import { SearchableSelect } from "./SearchableSelect.js";
|
|
7
|
+
import { getLogistiekUitzonderingen, saveLogistiekUitzondering, } from "../../lib/logistiek-uitzonderingen.functions.js";
|
|
8
|
+
import { friendlyError } from "../../lib/errors.js";
|
|
9
|
+
const LEEG = { eigen_kar: null, vaste_ladingdrager_code: null, max_klanten_per_kar: null, label_per: null };
|
|
10
|
+
const STANDAARD = "__standaard__";
|
|
11
|
+
const KLANT = "__klant__";
|
|
12
|
+
/** Logistieke uitzonderingen per klant en per afleveradres. Leeg = de normale werkwijze. */
|
|
13
|
+
export function CustomerLogisticsCard({ customerId }) {
|
|
14
|
+
const qc = useQueryClient();
|
|
15
|
+
const getFn = useServerFn(getLogistiekUitzonderingen);
|
|
16
|
+
const saveFn = useServerFn(saveLogistiekUitzondering);
|
|
17
|
+
const q = useQuery({
|
|
18
|
+
queryKey: ["logistiek-uitzonderingen", customerId],
|
|
19
|
+
queryFn: () => getFn({ data: { customer_id: customerId } }),
|
|
20
|
+
});
|
|
21
|
+
const [niveau, setNiveau] = useState(KLANT);
|
|
22
|
+
const [w, setW] = useState(LEEG);
|
|
23
|
+
const [maxTekst, setMaxTekst] = useState("");
|
|
24
|
+
const opgeslagen = useMemo(() => {
|
|
25
|
+
const loc = niveau === KLANT ? null : niveau;
|
|
26
|
+
const r = q.data?.rijen.find((x) => (x.delivery_location_id ?? null) === loc);
|
|
27
|
+
return r
|
|
28
|
+
? { eigen_kar: r.eigen_kar, vaste_ladingdrager_code: r.vaste_ladingdrager_code, max_klanten_per_kar: r.max_klanten_per_kar, label_per: r.label_per }
|
|
29
|
+
: LEEG;
|
|
30
|
+
}, [q.data, niveau]);
|
|
31
|
+
const klant = useMemo(() => {
|
|
32
|
+
const r = q.data?.rijen.find((x) => x.delivery_location_id == null);
|
|
33
|
+
return r ?? LEEG;
|
|
34
|
+
}, [q.data]);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
setW(opgeslagen);
|
|
37
|
+
setMaxTekst(opgeslagen.max_klanten_per_kar != null ? String(opgeslagen.max_klanten_per_kar) : "");
|
|
38
|
+
}, [opgeslagen]);
|
|
39
|
+
const maxGeldig = maxTekst === "" || (/^\d+$/.test(maxTekst) && Number(maxTekst) >= 1 && Number(maxTekst) <= 99);
|
|
40
|
+
const huidig = { ...w, max_klanten_per_kar: maxTekst === "" || !maxGeldig ? null : Number(maxTekst) };
|
|
41
|
+
const dirty = JSON.stringify(huidig) !== JSON.stringify(opgeslagen);
|
|
42
|
+
const isAdres = niveau !== KLANT;
|
|
43
|
+
const save = useMutation({
|
|
44
|
+
mutationFn: (v) => saveFn({ data: { customer_id: customerId, delivery_location_id: isAdres ? niveau : null, ...v } }),
|
|
45
|
+
onSuccess: () => {
|
|
46
|
+
toast.success("Logistiek opgeslagen");
|
|
47
|
+
qc.invalidateQueries({ queryKey: ["logistiek-uitzonderingen", customerId] });
|
|
48
|
+
},
|
|
49
|
+
onError: (e) => {
|
|
50
|
+
console.error(e);
|
|
51
|
+
toast.error(friendlyError(e, "Opslaan is niet gelukt. Probeer het opnieuw."));
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
const ladingdragers = q.data?.ladingdragers ?? [];
|
|
55
|
+
const naamVan = (code) => ladingdragers.find((l) => l.code === code)?.name ?? code;
|
|
56
|
+
const erft = (v) => (isAdres && v == null ? " (zoals bij de klant)" : "");
|
|
57
|
+
const voorbeeld = (() => {
|
|
58
|
+
const eff = {
|
|
59
|
+
eigen_kar: huidig.eigen_kar ?? (isAdres ? klant.eigen_kar : null),
|
|
60
|
+
lad: huidig.vaste_ladingdrager_code ?? (isAdres ? klant.vaste_ladingdrager_code : null),
|
|
61
|
+
max: huidig.max_klanten_per_kar ?? (isAdres ? klant.max_klanten_per_kar : null),
|
|
62
|
+
label: huidig.label_per ?? (isAdres ? klant.label_per : null),
|
|
63
|
+
};
|
|
64
|
+
const zinnen = [];
|
|
65
|
+
if (eff.eigen_kar === true)
|
|
66
|
+
zinnen.push("Deze klant krijgt altijd een eigen kar en deelt die nooit met een andere klant.");
|
|
67
|
+
if (eff.eigen_kar === false)
|
|
68
|
+
zinnen.push("Deze klant mag een kar delen met andere klanten.");
|
|
69
|
+
if (eff.lad)
|
|
70
|
+
zinnen.push(`Orders gaan altijd op een ${naamVan(eff.lad)}.`);
|
|
71
|
+
if (eff.max != null && eff.eigen_kar !== true)
|
|
72
|
+
zinnen.push(`Staat deze klant op een kar, dan staan er hooguit ${eff.max} klanten op.`);
|
|
73
|
+
if (eff.label === "kar")
|
|
74
|
+
zinnen.push("Er komt één label per kar.");
|
|
75
|
+
if (eff.label === "order")
|
|
76
|
+
zinnen.push("Elke order krijgt een eigen label.");
|
|
77
|
+
return zinnen.length ? zinnen : ["Volgt de normale werkwijze."];
|
|
78
|
+
})();
|
|
79
|
+
return (_jsx(Card, { children: _jsxs(CardContent, { className: "pt-6 space-y-4", children: [_jsxs("div", { children: [_jsx("div", { className: "font-semibold", children: "Logistiek" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Uitzonderingen bij het indelen van karren. Laat je een keuze leeg, dan geldt de normale werkwijze." })] }), q.isLoading ? (_jsx("div", { className: "h-24 animate-pulse rounded-md bg-muted motion-reduce:animate-none" })) : q.isError ? (_jsx("p", { className: "text-sm text-destructive", children: "De logistieke instellingen konden niet worden geladen. Probeer het opnieuw." })) : (_jsxs(_Fragment, { children: [(q.data?.afleveradressen.length ?? 0) > 0 && (_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { children: "Geldt voor" }), _jsx(SearchableSelect, { value: niveau, onValueChange: setNiveau, options: [
|
|
80
|
+
{ value: KLANT, label: "De hele klant" },
|
|
81
|
+
...(q.data?.afleveradressen ?? []).map((a) => ({
|
|
82
|
+
value: a.id,
|
|
83
|
+
label: `Afleveradres: ${a.name ?? "Zonder naam"}${a.city ? `, ${a.city}` : ""}`,
|
|
84
|
+
})),
|
|
85
|
+
] }), isAdres && (_jsx("p", { className: "text-xs text-muted-foreground", children: "Lege keuzes nemen de instelling van de klant over." }))] })), _jsxs("div", { className: "grid gap-4 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { children: "Eigen kar" }), _jsxs(Select, { value: w.eigen_kar === null ? STANDAARD : w.eigen_kar ? "ja" : "nee", onValueChange: (v) => setW({ ...w, eigen_kar: v === STANDAARD ? null : v === "ja" }), children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsxs(SelectItem, { value: STANDAARD, children: ["Normale werkwijze", erft(null)] }), _jsx(SelectItem, { value: "ja", children: "Altijd een eigen kar" }), _jsx(SelectItem, { value: "nee", children: "Mag een kar delen" })] })] }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Bij een eigen kar deelt deze klant nooit een kar met een andere klant." })] }), _jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { children: "Vaste ladingdrager" }), q.data?.ladingdragersBeschikbaar ? (_jsx(SearchableSelect, { value: w.vaste_ladingdrager_code ?? STANDAARD, onValueChange: (v) => setW({ ...w, vaste_ladingdrager_code: v === STANDAARD ? null : v }), options: [
|
|
86
|
+
{ value: STANDAARD, label: `Normale werkwijze${erft(null)}` },
|
|
87
|
+
...ladingdragers.map((l) => ({ value: l.code, label: l.name || l.code })),
|
|
88
|
+
...(w.vaste_ladingdrager_code && !ladingdragers.some((l) => l.code === w.vaste_ladingdrager_code)
|
|
89
|
+
? [{ value: w.vaste_ladingdrager_code, label: `${w.vaste_ladingdrager_code} (niet meer actief)` }]
|
|
90
|
+
: []),
|
|
91
|
+
] })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: "De lijst met ladingdragers is nog niet beschikbaar." })), _jsx("p", { className: "text-xs text-muted-foreground", children: "Bijvoorbeeld: orders van deze klant gaan altijd op een stapelwagen." })] }), _jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "max-klanten", children: "Maximaal aantal klanten op een kar" }), _jsx(Input, { id: "max-klanten", inputMode: "numeric", className: "tabular-nums", placeholder: w.eigen_kar ? "Niet nodig bij eigen kar" : `Normale werkwijze${erft(null)}`, disabled: w.eigen_kar === true, value: w.eigen_kar === true ? "" : maxTekst, onChange: (e) => setMaxTekst(e.target.value.trim()) }), !maxGeldig ? (_jsx("p", { className: "text-xs text-destructive", children: "Vul een getal van 1 tot en met 99 in." })) : (_jsx("p", { className: "text-xs text-muted-foreground", children: "Staat deze klant op een kar, dan staan er niet meer klanten op dan dit aantal." }))] }), _jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { children: "Label" }), _jsxs(Select, { value: w.label_per ?? STANDAARD, onValueChange: (v) => setW({ ...w, label_per: v === STANDAARD ? null : v }), children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsxs(SelectItem, { value: STANDAARD, children: ["Normale werkwijze", erft(null)] }), _jsx(SelectItem, { value: "kar", children: "E\u00E9n label per kar" }), _jsx(SelectItem, { value: "order", children: "E\u00E9n label per order" })] })] }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Kies of er \u00E9\u00E9n label op de hele kar komt of op elke order." })] })] }), _jsx("div", { className: "rounded-md bg-muted/50 p-3 text-sm space-y-0.5", children: voorbeeld.map((z) => _jsx("p", { children: z }, z)) }), _jsxs("div", { className: "flex flex-wrap justify-end gap-2", children: [_jsx(Button, { variant: "outline", disabled: save.isPending || JSON.stringify(opgeslagen) === JSON.stringify(LEEG), onClick: () => save.mutate(LEEG), children: "Terug naar werkwijze" }), _jsx(Button, { disabled: !dirty || !maxGeldig || save.isPending, onClick: () => save.mutate(huidig), children: save.isPending ? "Opslaan..." : "Opslaan" })] })] }))] }) }));
|
|
92
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KlantDetail.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/KlantDetail.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KlantDetail.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/KlantDetail.tsx"],"names":[],"mappings":"AAoDA,wBAAgB,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,+BA0ajD"}
|
|
@@ -5,11 +5,13 @@ import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
|
5
5
|
import { useServerFn } from "@tanstack/react-start";
|
|
6
6
|
import { useEffect, useState } from "react";
|
|
7
7
|
import { Card, CardContent, CardHeader, CardTitle, Badge, Button, toast, Tabs, TabsContent, TabsList, TabsTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, } from "@flowselections/core";
|
|
8
|
-
import { Trash2, Mail, Phone, Power, Pencil, MoreHorizontal, } from "lucide-react";
|
|
8
|
+
import { Trash2, Mail, Phone, Power, Pencil, MoreHorizontal, Archive, ArchiveRestore, } from "lucide-react";
|
|
9
|
+
import { archiveerKlant, herstelKlant, listGearchiveerdeKlantIds } from "../../lib/customer-archief.functions.js";
|
|
9
10
|
import { getCustomer, deleteCustomer, updateCustomer } from "../../lib/customers.functions.js";
|
|
10
11
|
import { ProfileCard, BadgeList, EmptyState, ActivityItem, adaptLocalToProfile, } from "./KlantDetailLayout.js";
|
|
11
12
|
import { DeliveryLocationsTab } from "./DeliveryLocationsTab.js";
|
|
12
13
|
import { CustomerCarrierCard } from "./CustomerCarrierCard.js";
|
|
14
|
+
import { CustomerLogisticsCard } from "./CustomerLogisticsCard.js";
|
|
13
15
|
import { BackLink } from "./BackLink.js";
|
|
14
16
|
import { NoticeBar, TableSkeleton, EmptyState as FsEmptyState } from "../fs-ui/index.js";
|
|
15
17
|
import { UserX } from "lucide-react";
|
|
@@ -45,6 +47,26 @@ export function KlantDetail({ id }) {
|
|
|
45
47
|
const [tab, setTab] = useState("overview");
|
|
46
48
|
const [editOpen, setEditOpen] = useState(false);
|
|
47
49
|
const [confirm, setConfirm] = useState(null);
|
|
50
|
+
const [archiefVraag, setArchiefVraag] = useState(false);
|
|
51
|
+
const archiveer = useServerFn(archiveerKlant);
|
|
52
|
+
const herstel = useServerFn(herstelKlant);
|
|
53
|
+
const archiefIds = useServerFn(listGearchiveerdeKlantIds);
|
|
54
|
+
const { data: gearchiveerd = false } = useQuery({
|
|
55
|
+
queryKey: ["customer-archief", id],
|
|
56
|
+
queryFn: async () => (await archiefIds()).includes(id),
|
|
57
|
+
});
|
|
58
|
+
const archiefMut = useMutation({
|
|
59
|
+
mutationFn: async (naarArchief) => naarArchief ? archiveer({ data: { customerId: id } }) : herstel({ data: { customerId: id } }),
|
|
60
|
+
onSuccess: (_r, naarArchief) => {
|
|
61
|
+
toast.success(naarArchief ? "Klant gearchiveerd" : "Klant teruggezet");
|
|
62
|
+
qc.invalidateQueries({ queryKey: ["customer-archief", id] });
|
|
63
|
+
qc.invalidateQueries({ queryKey: ["customers-archief"] });
|
|
64
|
+
},
|
|
65
|
+
onError: (err) => {
|
|
66
|
+
console.error("[klanten] archief wijzigen mislukt", err);
|
|
67
|
+
toast.error(err instanceof Error ? err.message : "Dat is niet gelukt. Probeer het opnieuw.");
|
|
68
|
+
},
|
|
69
|
+
});
|
|
48
70
|
const { data, isLoading } = useQuery({
|
|
49
71
|
queryKey: ["customer", id],
|
|
50
72
|
queryFn: () => get({ data: { id } }).then(decodeDeep),
|
|
@@ -123,7 +145,7 @@ export function KlantDetail({ id }) {
|
|
|
123
145
|
text: _jsxs(_Fragment, { children: [_jsx("span", { className: "font-medium", children: "Factuuradres onvolledig." }), " ", _jsxs("span", { className: "text-muted-foreground", children: ["Ontbreekt: ", missingInvoice.join(", "), "."] })] }),
|
|
124
146
|
action: _jsx(Button, { variant: "outline", size: "sm", className: "h-8", onClick: () => setEditOpen(true), children: "Aanvullen" }),
|
|
125
147
|
},
|
|
126
|
-
] }), _jsx("div", { className: "flex items-center justify-end", children: _jsxs("div", { className: "flex gap-2 items-center", children: [_jsx(BlockedBadge, { blocked: c.blocked }), _jsx(SyncStatusChip, { customerId: id }), _jsx(FloridayDeeplinkButton, { organizationId: c.floriday_organization_id }), _jsxs(Button, { variant: "outline", size: "sm", onClick: () => setEditOpen(true), children: [_jsx(Pencil, { className: "h-4 w-4 mr-2" }), " Bewerken"] }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", size: "sm", children: [_jsx(MoreHorizontal, { className: "h-4 w-4 mr-2" }), " Meer"] }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsxs(DropdownMenuItem, { onSelect: () => setConfirm("active"), children: [_jsx(Power, { className: "h-4 w-4 mr-2" }), c.is_active ? "Op inactief zetten" : "Activeren"] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { className: "text-destructive", onSelect: () => setConfirm("delete"), children: [_jsx(Trash2, { className: "h-4 w-4 mr-2" }), " Verwijderen"] })] })] }), _jsx(AlertDialog, { open: confirm !== null, onOpenChange: (o) => !o && setConfirm(null), children: _jsxs(AlertDialogContent, { children: [confirm === "delete" ? (_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Klant verwijderen?" }), _jsxs(AlertDialogDescription, { children: [_jsx("strong", { children: c.company_name }), " wordt alleen hier verwijderd. In de boekhouding blijft de klant bestaan, en in Floriday verandert niets. Dit kun je niet ongedaan maken."] })] })) : c.is_active ? (_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Klant op inactief zetten?" }), _jsxs(AlertDialogDescription, { children: [_jsx("strong", { children: c.company_name }), " wordt hier inactief.", " ", linkedToTwinfield
|
|
148
|
+
] }), _jsx("div", { className: "flex items-center justify-end", children: _jsxs("div", { className: "flex gap-2 items-center", children: [gearchiveerd && (_jsxs(Badge, { variant: "secondary", className: "gap-1", children: [_jsx(Archive, { className: "h-3.5 w-3.5", "aria-hidden": true }), " Gearchiveerd"] })), _jsx(BlockedBadge, { blocked: c.blocked }), _jsx(SyncStatusChip, { customerId: id }), _jsx(FloridayDeeplinkButton, { organizationId: c.floriday_organization_id }), _jsxs(Button, { variant: "outline", size: "sm", onClick: () => setEditOpen(true), children: [_jsx(Pencil, { className: "h-4 w-4 mr-2" }), " Bewerken"] }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", size: "sm", children: [_jsx(MoreHorizontal, { className: "h-4 w-4 mr-2" }), " Meer"] }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsxs(DropdownMenuItem, { onSelect: () => setConfirm("active"), children: [_jsx(Power, { className: "h-4 w-4 mr-2" }), c.is_active ? "Op inactief zetten" : "Activeren"] }), gearchiveerd ? (_jsxs(DropdownMenuItem, { onSelect: () => archiefMut.mutate(false), children: [_jsx(ArchiveRestore, { className: "h-4 w-4 mr-2" }), " Terugzetten"] })) : (_jsxs(DropdownMenuItem, { onSelect: () => setArchiefVraag(true), children: [_jsx(Archive, { className: "h-4 w-4 mr-2" }), " Archiveren"] })), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { className: "text-destructive", onSelect: () => setConfirm("delete"), children: [_jsx(Trash2, { className: "h-4 w-4 mr-2" }), " Verwijderen"] })] })] }), _jsx(AlertDialog, { open: archiefVraag, onOpenChange: setArchiefVraag, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Klant archiveren?" }), _jsx(AlertDialogDescription, { children: "De klant verdwijnt uit keuzelijsten. Boekhouding, Floriday en orders veranderen niet." })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Annuleren" }), _jsx(AlertDialogAction, { onClick: () => { archiefMut.mutate(true); setArchiefVraag(false); }, children: "Archiveren" })] })] }) }), _jsx(AlertDialog, { open: confirm !== null, onOpenChange: (o) => !o && setConfirm(null), children: _jsxs(AlertDialogContent, { children: [confirm === "delete" ? (_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Klant verwijderen?" }), _jsxs(AlertDialogDescription, { children: [_jsx("strong", { children: c.company_name }), " wordt alleen hier verwijderd. In de boekhouding blijft de klant bestaan, en in Floriday verandert niets. Dit kun je niet ongedaan maken."] })] })) : c.is_active ? (_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Klant op inactief zetten?" }), _jsxs(AlertDialogDescription, { children: [_jsx("strong", { children: c.company_name }), " wordt hier inactief.", " ", linkedToTwinfield
|
|
127
149
|
? "In de boekhouding wordt de klant verborgen; de gegevens blijven daar bewaard."
|
|
128
150
|
: "Deze klant staat niet in de boekhouding, dus daar verandert niets.", " ", "In Floriday verandert niets. Je kunt de klant later weer activeren."] })] })) : (_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Klant activeren?" }), _jsxs(AlertDialogDescription, { children: [_jsx("strong", { children: c.company_name }), " wordt hier weer actief.", " ", linkedToTwinfield
|
|
129
151
|
? "In de boekhouding wordt de klant weer zichtbaar."
|
|
@@ -133,5 +155,5 @@ export function KlantDetail({ id }) {
|
|
|
133
155
|
else
|
|
134
156
|
toggleActive.mutate(!c.is_active);
|
|
135
157
|
setConfirm(null);
|
|
136
|
-
}, children: confirm === "delete" ? "Verwijderen" : c.is_active ? "Op inactief zetten" : "Activeren" })] })] }) })] }) }), _jsxs("div", { className: "grid gap-6 lg:grid-cols-[340px_1fr]", children: [_jsx(ProfileCard, { profile: adaptLocalToProfile(c, data.contacts), notes: noteData?.note ?? null, onSaveNotes: (n) => noteMut.mutate(n), isSaving: noteMut.isPending || noteLoading }), _jsxs("div", { className: "space-y-4 min-w-0", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-4", children: [keyData?.customerKey ? (_jsx(CustomerPriceGroupSelect, { customerKey: keyData.customerKey })) : null, priceGroups.length > 0 && (_jsxs("div", { className: "flex items-center gap-2 text-sm", children: [_jsx("span", { className: "text-muted-foreground", children: "Floriday-prijscategorie:" }), _jsx(PriceGroupBadges, { groups: priceGroups, max: priceGroups.length })] }))] }), _jsx(CustomerKpis, { customerId: id, twinfieldCode: c.twinfield_code ?? null, onSelect: setTab }), _jsxs(Tabs, { value: tab, onValueChange: setTab, children: [_jsxs(TabsList, { className: "flex h-auto flex-wrap gap-2 bg-transparent p-0 mb-4 [&>button]:h-9 [&>button]:rounded-lg [&>button]:border [&>button]:border-border [&>button]:bg-card [&>button]:px-3 [&>button]:text-sm [&>button]:transition-colors [&>button]:duration-150 [&>button:hover]:bg-muted [&>button[data-state=active]]:border-primary/40 [&>button[data-state=active]]:bg-primary/10 [&>button[data-state=active]]:shadow-none [&>button[data-state=active]]:font-medium", children: [_jsx(TabsTrigger, { value: "overview", children: "Overzicht" }), _jsx(TabsTrigger, { value: "dashboard", children: "Analyses" }), _jsxs(TabsTrigger, { value: "contacts", children: ["Contacten (", data.contacts.length, ")"] }), _jsxs(TabsTrigger, { value: "locations", children: ["Locaties (", data.delivery_locations.length, ")"] }), _jsx(TabsTrigger, { value: "assortment", children: "Assortiment" }), c.floriday_organization_id && (_jsx(TabsTrigger, { value: "floriday-assortment", children: "Aanbod via Floriday" })), _jsxs(TabsTrigger, { value: "orders", children: ["Bestellingen (", ordersData?.orders.length ?? 0, ")"] }), _jsx(TabsTrigger, { value: "trade", children: "Handel" }), _jsx(TabsTrigger, { value: "discounts", children: "Kortingen & prijzen" }), _jsx(TabsTrigger, { value: "activity", children: "Activiteit" })] }), _jsxs(TabsContent, { value: "overview", className: "space-y-4", children: [c.bio && (_jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx(CardTitle, { children: "Bio" }) }), _jsx(CardContent, { className: "text-sm whitespace-pre-wrap", children: c.bio })] })), (c.segments?.length || c.trade_forms?.length || c.markets?.length || c.product_groups?.length) ? (_jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx(CardTitle, { children: "Profiel" }) }), _jsxs(CardContent, { className: "grid gap-4 md:grid-cols-2", children: [_jsx(BadgeList, { label: "Segmenten", items: c.segments }), _jsx(BadgeList, { label: "Handelsvorm", items: c.trade_forms }), _jsx(BadgeList, { label: "Afzetmarkten", items: c.markets }), _jsx(BadgeList, { label: "Productgroepen", items: c.product_groups })] })] })) : null, (c.payment_methods?.length ?? 0) > 0 && (_jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx(CardTitle, { children: "Financi\u00EBle afhandeling" }) }), _jsx(CardContent, { children: _jsx(BadgeList, { label: "Betaalmethoden", items: c.payment_methods }) })] })), hasBillingInfo(c) && _jsx(FactureringKredietCard, { customer: c }), _jsx(CustomerCarrierCard, { customerId: id }), !hasBillingInfo(c) && !c.bio && !(c.segments?.length || c.trade_forms?.length || c.markets?.length || c.product_groups?.length) && !(c.payment_methods?.length) && (_jsx(EmptyState, { message: "Geen extra profielinformatie beschikbaar voor deze klant." }))] }), _jsx(TabsContent, { value: "contacts", children: data.contacts.length === 0 ? (_jsx(EmptyState, { message: c.floriday_organization_id ? "Geen contactpersonen beschikbaar. Floriday levert geen contactpersonen via de koppeling." : "Geen contactpersonen beschikbaar." })) : (_jsx("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-3", children: data.contacts.map((p) => (_jsx(Card, { children: _jsxs(CardContent, { className: "pt-6 space-y-2", children: [_jsx("div", { className: "font-semibold", children: p.full_name }), p.job_title && _jsx("div", { className: "text-sm text-muted-foreground", children: p.job_title }), p.phone && (_jsxs("a", { href: `tel:${p.phone}`, className: "text-sm flex items-center gap-2 hover:underline", children: [_jsx(Phone, { className: "h-3.5 w-3.5 text-muted-foreground" }), " ", p.phone] })), p.email && (_jsxs("a", { href: `mailto:${p.email}`, className: "text-sm flex items-center gap-2 hover:underline", children: [_jsx(Mail, { className: "h-3.5 w-3.5 text-muted-foreground" }), " ", p.email] })), p.is_active ? _jsx(Badge, { children: "Actief" }) : _jsx(Badge, { variant: "secondary", children: "Inactief" })] }) }, p.id))) })) }), _jsx(TabsContent, { value: "trade", children: c.floriday_organization_id ? (_jsx(FloridayTradeSettingsCard, { organizationId: c.floriday_organization_id })) : data.trade_settings.length === 0 ? (_jsx(EmptyState, { message: "Geen handelsinstellingen voor deze klant." })) : (_jsx(Card, { children: _jsx(CardContent, { className: "pt-6 space-y-2", children: data.trade_settings.map((s) => (_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Badge, { variant: s.is_active ? "default" : "secondary", children: s.is_active ? "Actief" : "Niet actief" }), _jsx("span", { className: "text-sm", children: s.setting_label })] }, s.id))) }) })) }), _jsx(TabsContent, { value: "locations", children: _jsxs("div", { className: "space-y-4", children: [_jsx(CustomerCarrierCard, { customerId: id }), _jsx(DeliveryLocationsTab, { customerId: id })] }) }), _jsx(TabsContent, { value: "dashboard", children: _jsx(CustomerAnalyticsTab, { customerId: id }) }), _jsx(TabsContent, { value: "assortment", children: keyData?.customerKey ? (_jsx(CustomerAssortmentTab, { customerKey: keyData.customerKey, organizationId: c.floriday_organization_id ?? null })) : (_jsx(EmptyState, { message: "Assortiment is beschikbaar zodra deze klant gekoppeld is." })) }), c.floriday_organization_id && (_jsx(TabsContent, { value: "floriday-assortment", children: _jsx(FloridayAssortmentTab, { organizationId: c.floriday_organization_id }) })), _jsx(TabsContent, { value: "orders", children: _jsx(CustomerOrdersTab, { orders: ordersData?.orders ?? [], deletedCount: ordersData?.deletedCount ?? 0, loading: ordersLoading, showFloridayNotice: !!c.floriday_organization_id }) }), _jsx(TabsContent, { value: "activity", children: _jsx(Card, { children: _jsxs(CardContent, { className: "pt-6 space-y-2", children: [data.floriday_synced_at && (_jsxs("div", { className: "flex items-center justify-between text-sm border-l-2 border-primary pl-3 py-1", children: [_jsxs("span", { children: ["Gekoppeld met ", _jsx("strong", { children: "Floriday" })] }), _jsx("span", { className: "text-xs text-muted-foreground", children: formatDateTime(data.floriday_synced_at) })] })), data.audit.length === 0 && !data.floriday_synced_at ? (_jsx("p", { className: "text-sm text-muted-foreground", children: "Nog geen activiteit voor deze klant." })) : (data.audit.map((a) => _jsx(ActivityItem, { entry: a }, a.id)))] }) }) }), _jsx(TabsContent, { value: "discounts", children: _jsx(LocalDiscountsTab, { customerId: id }) })] })] })] }), _jsx(KlantBewerkenDialog, { open: editOpen, onOpenChange: setEditOpen, customerId: id, onSaved: () => qc.invalidateQueries({ queryKey: ["customer", id] }) })] }));
|
|
158
|
+
}, children: confirm === "delete" ? "Verwijderen" : c.is_active ? "Op inactief zetten" : "Activeren" })] })] }) })] }) }), _jsxs("div", { className: "grid gap-6 lg:grid-cols-[340px_1fr]", children: [_jsx(ProfileCard, { profile: adaptLocalToProfile(c, data.contacts), notes: noteData?.note ?? null, onSaveNotes: (n) => noteMut.mutate(n), isSaving: noteMut.isPending || noteLoading }), _jsxs("div", { className: "space-y-4 min-w-0", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-4", children: [keyData?.customerKey ? (_jsx(CustomerPriceGroupSelect, { customerKey: keyData.customerKey })) : null, priceGroups.length > 0 && (_jsxs("div", { className: "flex items-center gap-2 text-sm", children: [_jsx("span", { className: "text-muted-foreground", children: "Floriday-prijscategorie:" }), _jsx(PriceGroupBadges, { groups: priceGroups, max: priceGroups.length })] }))] }), _jsx(CustomerKpis, { customerId: id, twinfieldCode: c.twinfield_code ?? null, onSelect: setTab }), _jsxs(Tabs, { value: tab, onValueChange: setTab, children: [_jsxs(TabsList, { className: "flex h-auto flex-wrap gap-2 bg-transparent p-0 mb-4 [&>button]:h-9 [&>button]:rounded-lg [&>button]:border [&>button]:border-border [&>button]:bg-card [&>button]:px-3 [&>button]:text-sm [&>button]:transition-colors [&>button]:duration-150 [&>button:hover]:bg-muted [&>button[data-state=active]]:border-primary/40 [&>button[data-state=active]]:bg-primary/10 [&>button[data-state=active]]:shadow-none [&>button[data-state=active]]:font-medium", children: [_jsx(TabsTrigger, { value: "overview", children: "Overzicht" }), _jsx(TabsTrigger, { value: "dashboard", children: "Analyses" }), _jsxs(TabsTrigger, { value: "contacts", children: ["Contacten (", data.contacts.length, ")"] }), _jsxs(TabsTrigger, { value: "locations", children: ["Locaties (", data.delivery_locations.length, ")"] }), _jsx(TabsTrigger, { value: "assortment", children: "Assortiment" }), c.floriday_organization_id && (_jsx(TabsTrigger, { value: "floriday-assortment", children: "Aanbod via Floriday" })), _jsxs(TabsTrigger, { value: "orders", children: ["Bestellingen (", ordersData?.orders.length ?? 0, ")"] }), _jsx(TabsTrigger, { value: "trade", children: "Handel" }), _jsx(TabsTrigger, { value: "discounts", children: "Kortingen & prijzen" }), _jsx(TabsTrigger, { value: "activity", children: "Activiteit" })] }), _jsxs(TabsContent, { value: "overview", className: "space-y-4", children: [c.bio && (_jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx(CardTitle, { children: "Bio" }) }), _jsx(CardContent, { className: "text-sm whitespace-pre-wrap", children: c.bio })] })), (c.segments?.length || c.trade_forms?.length || c.markets?.length || c.product_groups?.length) ? (_jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx(CardTitle, { children: "Profiel" }) }), _jsxs(CardContent, { className: "grid gap-4 md:grid-cols-2", children: [_jsx(BadgeList, { label: "Segmenten", items: c.segments }), _jsx(BadgeList, { label: "Handelsvorm", items: c.trade_forms }), _jsx(BadgeList, { label: "Afzetmarkten", items: c.markets }), _jsx(BadgeList, { label: "Productgroepen", items: c.product_groups })] })] })) : null, (c.payment_methods?.length ?? 0) > 0 && (_jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx(CardTitle, { children: "Financi\u00EBle afhandeling" }) }), _jsx(CardContent, { children: _jsx(BadgeList, { label: "Betaalmethoden", items: c.payment_methods }) })] })), hasBillingInfo(c) && _jsx(FactureringKredietCard, { customer: c }), _jsx(CustomerCarrierCard, { customerId: id }), _jsx(CustomerLogisticsCard, { customerId: id }), !hasBillingInfo(c) && !c.bio && !(c.segments?.length || c.trade_forms?.length || c.markets?.length || c.product_groups?.length) && !(c.payment_methods?.length) && (_jsx(EmptyState, { message: "Geen extra profielinformatie beschikbaar voor deze klant." }))] }), _jsx(TabsContent, { value: "contacts", children: data.contacts.length === 0 ? (_jsx(EmptyState, { message: c.floriday_organization_id ? "Geen contactpersonen beschikbaar. Floriday levert geen contactpersonen via de koppeling." : "Geen contactpersonen beschikbaar." })) : (_jsx("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-3", children: data.contacts.map((p) => (_jsx(Card, { children: _jsxs(CardContent, { className: "pt-6 space-y-2", children: [_jsx("div", { className: "font-semibold", children: p.full_name }), p.job_title && _jsx("div", { className: "text-sm text-muted-foreground", children: p.job_title }), p.phone && (_jsxs("a", { href: `tel:${p.phone}`, className: "text-sm flex items-center gap-2 hover:underline", children: [_jsx(Phone, { className: "h-3.5 w-3.5 text-muted-foreground" }), " ", p.phone] })), p.email && (_jsxs("a", { href: `mailto:${p.email}`, className: "text-sm flex items-center gap-2 hover:underline", children: [_jsx(Mail, { className: "h-3.5 w-3.5 text-muted-foreground" }), " ", p.email] })), p.is_active ? _jsx(Badge, { children: "Actief" }) : _jsx(Badge, { variant: "secondary", children: "Inactief" })] }) }, p.id))) })) }), _jsx(TabsContent, { value: "trade", children: c.floriday_organization_id ? (_jsx(FloridayTradeSettingsCard, { organizationId: c.floriday_organization_id })) : data.trade_settings.length === 0 ? (_jsx(EmptyState, { message: "Geen handelsinstellingen voor deze klant." })) : (_jsx(Card, { children: _jsx(CardContent, { className: "pt-6 space-y-2", children: data.trade_settings.map((s) => (_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Badge, { variant: s.is_active ? "default" : "secondary", children: s.is_active ? "Actief" : "Niet actief" }), _jsx("span", { className: "text-sm", children: s.setting_label })] }, s.id))) }) })) }), _jsx(TabsContent, { value: "locations", children: _jsxs("div", { className: "space-y-4", children: [_jsx(CustomerCarrierCard, { customerId: id }), _jsx(CustomerLogisticsCard, { customerId: id }), _jsx(DeliveryLocationsTab, { customerId: id })] }) }), _jsx(TabsContent, { value: "dashboard", children: _jsx(CustomerAnalyticsTab, { customerId: id }) }), _jsx(TabsContent, { value: "assortment", children: keyData?.customerKey ? (_jsx(CustomerAssortmentTab, { customerKey: keyData.customerKey, organizationId: c.floriday_organization_id ?? null, customerId: id })) : (_jsx(EmptyState, { message: "Assortiment is beschikbaar zodra deze klant gekoppeld is." })) }), c.floriday_organization_id && (_jsx(TabsContent, { value: "floriday-assortment", children: _jsx(FloridayAssortmentTab, { organizationId: c.floriday_organization_id }) })), _jsx(TabsContent, { value: "orders", children: _jsx(CustomerOrdersTab, { orders: ordersData?.orders ?? [], deletedCount: ordersData?.deletedCount ?? 0, loading: ordersLoading, showFloridayNotice: !!c.floriday_organization_id }) }), _jsx(TabsContent, { value: "activity", children: _jsx(Card, { children: _jsxs(CardContent, { className: "pt-6 space-y-2", children: [data.floriday_synced_at && (_jsxs("div", { className: "flex items-center justify-between text-sm border-l-2 border-primary pl-3 py-1", children: [_jsxs("span", { children: ["Gekoppeld met ", _jsx("strong", { children: "Floriday" })] }), _jsx("span", { className: "text-xs text-muted-foreground", children: formatDateTime(data.floriday_synced_at) })] })), data.audit.length === 0 && !data.floriday_synced_at ? (_jsx("p", { className: "text-sm text-muted-foreground", children: "Nog geen activiteit voor deze klant." })) : (data.audit.map((a) => _jsx(ActivityItem, { entry: a }, a.id)))] }) }) }), _jsx(TabsContent, { value: "discounts", children: _jsx(LocalDiscountsTab, { customerId: id }) })] })] })] }), _jsx(KlantBewerkenDialog, { open: editOpen, onOpenChange: setEditOpen, customerId: id, onSaved: () => qc.invalidateQueries({ queryKey: ["customer", id] }) })] }));
|
|
137
159
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KlantenOverzicht.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/KlantenOverzicht.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KlantenOverzicht.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/KlantenOverzicht.tsx"],"names":[],"mappings":"AAiFA,wBAAgB,gBAAgB,gCAg9B/B"}
|