@flowselections/floriday-afhandeling-module 1.0.61 → 1.0.64
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/afhandeling/AutoSendStatus.d.ts +9 -2
- package/dist-lib/components/afhandeling/AutoSendStatus.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/AutoSendStatus.js +70 -6
- package/dist-lib/components/afhandeling/DagDetailDialog.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/DagDetailDialog.js +40 -24
- package/dist-lib/components/afhandeling/LeveringenPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/LeveringenPage.js +3 -1
- package/dist-lib/components/afhandeling/NuVersturenButton.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/NuVersturenButton.js +4 -4
- package/dist-lib/components/afhandeling/PickAgendaView.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/PickAgendaView.js +9 -7
- package/dist-lib/components/afhandeling/ScanControleView.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/ScanControleView.js +2 -2
- package/dist-lib/components/afhandeling/SignupMailMoments.d.ts +8 -0
- package/dist-lib/components/afhandeling/SignupMailMoments.d.ts.map +1 -0
- package/dist-lib/components/afhandeling/SignupMailMoments.js +72 -0
- package/dist-lib/components/afhandeling/VerzetOrderDialog.js +3 -3
- package/dist-lib/components/afhandeling/WeekAgendaView.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/WeekAgendaView.js +6 -2
- package/dist-lib/components/settings/AfhandelingSettingsCard.d.ts.map +1 -1
- package/dist-lib/components/settings/AfhandelingSettingsCard.js +47 -2
- package/dist-lib/hooks/useOrderPlanning.d.ts.map +1 -1
- package/dist-lib/hooks/useOrderPlanning.js +7 -6
- package/dist-lib/hooks/usePickAgenda.d.ts +4 -0
- package/dist-lib/hooks/usePickAgenda.d.ts.map +1 -1
- package/dist-lib/hooks/usePickAgenda.js +36 -5
- package/dist-lib/integrations/supabase/types.d.ts +335 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/carrierSignup.functions.d.ts +100 -0
- package/dist-lib/lib/carrierSignup.functions.d.ts.map +1 -0
- package/dist-lib/lib/carrierSignup.functions.js +117 -0
- package/dist-lib/lib/cartAssignments.functions.d.ts +4 -0
- package/dist-lib/lib/cartAssignments.functions.d.ts.map +1 -1
- package/dist-lib/lib/cartAssignments.functions.js +5 -1
- package/dist-lib/lib/floridayLoading.functions.d.ts +7 -0
- package/dist-lib/lib/floridayLoading.functions.d.ts.map +1 -1
- package/dist-lib/lib/floridayLoading.functions.js +11 -4
- package/dist-lib/lib/printing.js +1 -1
- package/dist-lib/lib/serverRoutes/autoSend.handler.d.ts +2 -1
- package/dist-lib/lib/serverRoutes/autoSend.handler.d.ts.map +1 -1
- package/dist-lib/lib/serverRoutes/autoSend.handler.js +26 -5
- package/dist-lib/lib/serverRoutes/dispatchCarrierSignups.handler.d.ts +1 -1
- package/dist-lib/lib/serverRoutes/dispatchCarrierSignups.handler.d.ts.map +1 -1
- package/dist-lib/lib/serverRoutes/dispatchCarrierSignups.handler.js +2 -325
- package/dist-lib/lib/serverRoutes/index.d.ts +1 -0
- package/dist-lib/lib/serverRoutes/index.d.ts.map +1 -1
- package/dist-lib/lib/serverRoutes/index.js +1 -0
- package/dist-lib/lib/signupMailText.d.ts +4 -0
- package/dist-lib/lib/signupMailText.d.ts.map +1 -0
- package/dist-lib/lib/signupMailText.js +35 -0
- package/package.json +12 -1
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export declare function
|
|
1
|
+
/** Tijdzone van de vestiging uit de Werktijden-instelling (alleen lezen); null = onbekend. */
|
|
2
|
+
export declare function useVestigingTijdzone(): import("@tanstack/react-query").UseQueryResult<string | null, Error>;
|
|
3
|
+
/**
|
|
4
|
+
* Melding over automatisch versturen in gewone taal. Is de order al gemeld bij
|
|
5
|
+
* Floriday (handmatig of automatisch), dan "Verstuurd om HH:MM". De letterlijke
|
|
6
|
+
* tekst van de planning staat onder "Details voor beheer".
|
|
7
|
+
*/
|
|
8
|
+
export declare function AutoSendStatus({ orderId, orderRef }: {
|
|
3
9
|
orderId: string;
|
|
10
|
+
orderRef?: string | null;
|
|
4
11
|
}): import("react").JSX.Element | null;
|
|
5
12
|
//# sourceMappingURL=AutoSendStatus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoSendStatus.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/AutoSendStatus.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AutoSendStatus.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/AutoSendStatus.tsx"],"names":[],"mappings":"AAWA,8FAA8F;AAC9F,wBAAgB,oBAAoB,yEAWnC;AAaD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,sCAwDlG"}
|
|
@@ -1,8 +1,40 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery } from "@tanstack/react-query";
|
|
3
3
|
import { supabase } from "../../integrations/supabase/moduleClient";
|
|
4
|
-
/**
|
|
5
|
-
export function
|
|
4
|
+
/** Tijdzone van de vestiging uit de Werktijden-instelling (alleen lezen); null = onbekend. */
|
|
5
|
+
export function useVestigingTijdzone() {
|
|
6
|
+
return useQuery({
|
|
7
|
+
queryKey: ["vestiging-tijdzone"],
|
|
8
|
+
staleTime: 10 * 60000,
|
|
9
|
+
retry: 1,
|
|
10
|
+
queryFn: async () => {
|
|
11
|
+
const { data, error } = await supabase.rpc("logistics_opening_timezone");
|
|
12
|
+
if (error)
|
|
13
|
+
throw new Error(error.message);
|
|
14
|
+
return typeof data === "string" && data ? data : null;
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function hhmm(iso, tz) {
|
|
19
|
+
if (!iso || !tz)
|
|
20
|
+
return null;
|
|
21
|
+
const d = new Date(iso);
|
|
22
|
+
if (Number.isNaN(d.getTime()))
|
|
23
|
+
return null;
|
|
24
|
+
try {
|
|
25
|
+
return d.toLocaleTimeString("nl-NL", { timeZone: tz, hour: "2-digit", minute: "2-digit" });
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Melding over automatisch versturen in gewone taal. Is de order al gemeld bij
|
|
33
|
+
* Floriday (handmatig of automatisch), dan "Verstuurd om HH:MM". De letterlijke
|
|
34
|
+
* tekst van de planning staat onder "Details voor beheer".
|
|
35
|
+
*/
|
|
36
|
+
export function AutoSendStatus({ orderId, orderRef }) {
|
|
37
|
+
const tz = useVestigingTijdzone();
|
|
6
38
|
const { data } = useQuery({
|
|
7
39
|
queryKey: ["auto-send-status", orderId],
|
|
8
40
|
queryFn: async () => {
|
|
@@ -15,8 +47,40 @@ export function AutoSendStatus({ orderId }) {
|
|
|
15
47
|
refetchInterval: 30000,
|
|
16
48
|
retry: 1,
|
|
17
49
|
});
|
|
18
|
-
|
|
50
|
+
// Eerste door Floriday geaccepteerde poging (handmatig of automatisch).
|
|
51
|
+
const sent = useQuery({
|
|
52
|
+
queryKey: ["auto-send-accepted", orderRef],
|
|
53
|
+
enabled: !!orderRef,
|
|
54
|
+
refetchInterval: 30000,
|
|
55
|
+
queryFn: async () => {
|
|
56
|
+
const { data, error } = await supabase
|
|
57
|
+
.from("floriday_loading_attempts").select("created_at")
|
|
58
|
+
.eq("step", "send").contains("order_refs", [orderRef]).in("code", ["created", "already_fulfilled"])
|
|
59
|
+
.order("created_at", { ascending: true }).limit(1);
|
|
60
|
+
if (error)
|
|
61
|
+
throw new Error(error.message);
|
|
62
|
+
return Array.isArray(data) && data[0]?.created_at ? String(data[0].created_at) : null;
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
const zone = tz.data ?? null;
|
|
66
|
+
const sentAt = sent.data ?? (data?.status === "verstuurd" ? data.verstuurdOm ?? null : null);
|
|
67
|
+
let tekst = null;
|
|
68
|
+
let tone = "text-muted-foreground";
|
|
69
|
+
if (sentAt) {
|
|
70
|
+
const t = hhmm(sentAt, zone);
|
|
71
|
+
tekst = t ? `Verstuurd om ${t}` : "Verstuurd";
|
|
72
|
+
}
|
|
73
|
+
else if (data?.status === "mislukt") {
|
|
74
|
+
const t = hhmm(data.volgendePoging, zone);
|
|
75
|
+
tekst = t
|
|
76
|
+
? `Automatisch versturen lukt nog niet. Nieuwe poging om ${t}. Je kunt ook op ‘Nu versturen’ drukken.`
|
|
77
|
+
: "Automatisch versturen lukt nog niet. Je kunt op ‘Nu versturen’ drukken.";
|
|
78
|
+
tone = "text-destructive";
|
|
79
|
+
}
|
|
80
|
+
else if (data?.status === "wachtend" || data?.status === "bezig") {
|
|
81
|
+
tekst = "Wordt automatisch verstuurd.";
|
|
82
|
+
}
|
|
83
|
+
if (!tekst)
|
|
19
84
|
return null;
|
|
20
|
-
|
|
21
|
-
return _jsx("span", { className: `text-xs ${tone}`, children: data.tekst });
|
|
85
|
+
return (_jsxs("span", { className: `text-xs ${tone}`, children: [tekst, data?.tekst && !sentAt ? (_jsxs("details", { className: "mt-1 text-[11px] text-muted-foreground", children: [_jsx("summary", { className: "cursor-pointer", children: "Details voor beheer" }), data.tekst] })) : null] }));
|
|
22
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DagDetailDialog.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/DagDetailDialog.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"DagDetailDialog.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/DagDetailDialog.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AA6JjE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAQD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,sCAG1D"}
|
|
@@ -13,6 +13,7 @@ import { getOrderLines, getDayCartContents, getOrderCartIds, getPakbonCartInfo,
|
|
|
13
13
|
import { printLayoutDocument, printPdfDocument, printFoutMelding } from "../../lib/printing";
|
|
14
14
|
import { NuVersturenButton } from "./NuVersturenButton";
|
|
15
15
|
import { AutoSendStatus } from "./AutoSendStatus";
|
|
16
|
+
import { SignupMailMoments } from "./SignupMailMoments";
|
|
16
17
|
import { CapacityWarning } from "./CapacityWarning";
|
|
17
18
|
import { useCapacityCheck } from "../../hooks/useCapacityCheck";
|
|
18
19
|
import { toDayKey } from "../../lib/logisticsEngine/capacity";
|
|
@@ -42,23 +43,23 @@ function useVoortgang(ref, status, opts = { floriday: null }) {
|
|
|
42
43
|
if (opts.cancelled)
|
|
43
44
|
return { label: "Geannuleerd", done: true, variant: "outline", bron: "Verkoop" };
|
|
44
45
|
if (opts.archived === true)
|
|
45
|
-
return { label: "Gearchiveerd", done: true, variant: "outline", bron: "
|
|
46
|
+
return { label: "Gearchiveerd", done: true, variant: "outline", bron: "planning" };
|
|
46
47
|
const archiefNote = opts.archived === null ? " · archiefstatus onbekend" : "";
|
|
47
48
|
if (opts.floriday !== false && st?.floridaySent)
|
|
48
|
-
return { label: "
|
|
49
|
+
return { label: "Gemeld bij Floriday", done: true, variant: "default", bron: "Floriday" + archiefNote };
|
|
49
50
|
if (st?.approvedAll) {
|
|
50
51
|
if (opts.floriday === false)
|
|
51
|
-
return { label: "Afgemeld", done: true, variant: "default", bron: "
|
|
52
|
+
return { label: "Afgemeld", done: true, variant: "default", bron: "scan" + archiefNote };
|
|
52
53
|
if (opts.floriday === true)
|
|
53
|
-
return { label: "Klaar voor verzending", done: false, variant: "secondary", bron: "
|
|
54
|
-
return { label: "Alle karren gescand", done: false, variant: "secondary", bron: "
|
|
54
|
+
return { label: "Klaar voor verzending", done: false, variant: "secondary", bron: "scan" + archiefNote };
|
|
55
|
+
return { label: "Alle karren gescand", done: false, variant: "secondary", bron: "scan" + archiefNote };
|
|
55
56
|
}
|
|
56
57
|
const v = voortgang(status);
|
|
57
58
|
if (v.done && opts.floriday === false)
|
|
58
|
-
return { ...v, label: "Afgemeld", bron: "
|
|
59
|
+
return { ...v, label: "Afgemeld", bron: "planning" + archiefNote };
|
|
59
60
|
if (v.done && opts.floriday === true && v.label === "Afgehandeld")
|
|
60
|
-
return { ...v, label: "Afgemeld (nog niet naar Floriday)", done: false, variant: "secondary", bron: "
|
|
61
|
-
return { ...v, bron: "
|
|
61
|
+
return { ...v, label: "Afgemeld (nog niet naar Floriday)", done: false, variant: "secondary", bron: "planning" + archiefNote };
|
|
62
|
+
return { ...v, bron: "planning" + archiefNote };
|
|
62
63
|
}
|
|
63
64
|
function isCancelled(status) {
|
|
64
65
|
const s = (status ?? "").trim().toLowerCase();
|
|
@@ -146,7 +147,7 @@ function DagDetailContent({ open, date, planned, onOpenChange, }) {
|
|
|
146
147
|
const shipState = new Map();
|
|
147
148
|
for (const o of contentsQuery.data?.orders ?? []) {
|
|
148
149
|
coverageByRef.set(refKey(o.orderRef), o.label);
|
|
149
|
-
shipState.set(refKey(o.orderRef), { approvedAll: o.approvedAll, floridaySent: o.floridaySent });
|
|
150
|
+
shipState.set(refKey(o.orderRef), { approvedAll: o.approvedAll, floridaySent: o.floridaySent, cartIds: o.cartIds ?? [], approvedCartIds: o.approvedCartIds ?? [] });
|
|
150
151
|
}
|
|
151
152
|
// Eén rij per kar die op deze dag valt (Engine-dekking is leidend, ook voor bufferkarren).
|
|
152
153
|
const cartRows = [];
|
|
@@ -178,7 +179,9 @@ function DagDetailContent({ open, date, planned, onOpenChange, }) {
|
|
|
178
179
|
});
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
|
-
|
|
182
|
+
// Tel karren op unieke kar-id (gedeelde bufferkar één keer); rijen zonder id tellen los.
|
|
183
|
+
const uniekeKarren = new Set(cartRows.map((c) => c.cartId ?? `zonder-id:${c.key}`)).size;
|
|
184
|
+
return (_jsx(ShipStateCtx.Provider, { value: shipState, children: _jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(ResponsiveDialogContent, { size: "xl", children: [_jsxs(ResponsiveDialogHeader, { children: [_jsxs(DialogTitle, { children: ["Dagdetails \u2014 ", NL_DATE.format(date)] }), _jsxs(DialogDescription, { children: [ordersOnDay.length, " bestellingen \u00B7 ", uniekeKarren, " ", uniekeKarren === 1 ? "kar" : "karren", " \u00B7", " ", ordersOnDay.filter((o) => voortgang(o.status).done).length, " van ", ordersOnDay.length, " ", "bestellingen afgehandeld \u00B7 ", new Set(cartRows.filter((c) => voortgang(c.status).done).map((c) => c.cartId ?? `zonder-id:${c.key}`)).size, " van", " ", uniekeKarren, " karren afgehandeld"] })] }), _jsxs(ResponsiveDialogBody, { children: [_jsx(DayCapacityWarning, { date: date }), _jsx(BezettingCard, { date: date, cartsToday: uniekeKarren }), _jsx(SignupMailMoments, { from: dayKey, to: dayKey }), _jsxs(Tabs, { defaultValue: "bestellingen", children: [_jsxs(TabsList, { children: [_jsxs(TabsTrigger, { value: "bestellingen", children: ["Bestellingen (", ordersOnDay.length, ")"] }), _jsxs(TabsTrigger, { value: "karren", children: ["Karren (", uniekeKarren, ")"] })] }), _jsx(TabsContent, { value: "bestellingen", className: "mt-4", children: _jsx(BestellingenTab, { orders: ordersOnDay, isLoading: agenda.isLoading }) }), _jsx(TabsContent, { value: "karren", className: "mt-4", children: _jsx(KarrenTab, { carts: cartRows }) })] })] }), _jsx(ResponsiveDialogFooter, { children: _jsx(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Sluiten" }) })] }) }) }));
|
|
182
185
|
}
|
|
183
186
|
function BezettingCard({ date, cartsToday }) {
|
|
184
187
|
const queryClient = useQueryClient();
|
|
@@ -241,7 +244,7 @@ function BezettingCard({ date, cartsToday }) {
|
|
|
241
244
|
await clearDayStaffPlan(date);
|
|
242
245
|
await queryClient.invalidateQueries({ queryKey: ["engine-staff-day", dateKey] });
|
|
243
246
|
setEditing(false);
|
|
244
|
-
toast.success("Terug naar
|
|
247
|
+
toast.success("Terug naar de standaardbezetting");
|
|
245
248
|
}
|
|
246
249
|
catch (err) {
|
|
247
250
|
toast.error(err instanceof Error ? err.message : "Herstellen mislukt");
|
|
@@ -250,7 +253,7 @@ function BezettingCard({ date, cartsToday }) {
|
|
|
250
253
|
setSaving(false);
|
|
251
254
|
}
|
|
252
255
|
};
|
|
253
|
-
return (_jsxs("div", { className: "mb-4 rounded-lg border bg-muted/30 p-4", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-6", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Users, { className: "h-4 w-4 text-muted-foreground" }), _jsxs("div", { children: [_jsx("div", { className: "text-lg font-bold leading-none", children: defaultsQuery.isLoading || dayQuery.isLoading ? "…" : (effStaff ?? "—") }), _jsxs("div", { className: "text-xs text-muted-foreground", children: ["medewerkers ", dayPlan ? "(aangepast voor deze dag)" : "(gemiddelde uit
|
|
256
|
+
return (_jsxs("div", { className: "mb-4 rounded-lg border bg-muted/30 p-4", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-6", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Users, { className: "h-4 w-4 text-muted-foreground" }), _jsxs("div", { children: [_jsx("div", { className: "text-lg font-bold leading-none", children: defaultsQuery.isLoading || dayQuery.isLoading ? "…" : (effStaff ?? "—") }), _jsxs("div", { className: "text-xs text-muted-foreground", children: ["medewerkers ", dayPlan ? "(aangepast voor deze dag)" : "(gemiddelde uit de planning)"] })] })] }), _jsxs("div", { children: [_jsxs("div", { className: "text-lg font-bold leading-none", children: [effFrom, "\u2013", effTo] }), _jsx("div", { className: "text-xs text-muted-foreground", children: "werktijden" })] }), capacity?.capacityCarts !== null && capacity !== null && (_jsxs("div", { children: [_jsxs("div", { className: "text-lg font-bold leading-none", children: [cartsToday, " / ", capacity.capacityCarts] }), _jsx("div", { className: "text-xs text-muted-foreground", children: "karren gepland / capaciteit" })] }))] }), !editing && (_jsx(Button, { size: "sm", variant: "outline", onClick: startEdit, children: "Bezetting aanpassen" }))] }), editing && (_jsxs("div", { className: "mt-4 flex flex-wrap items-end gap-3", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("label", { className: "text-xs text-muted-foreground", children: "Medewerkers" }), _jsx(Input, { type: "number", min: 0, step: 1, value: staff, onChange: (e) => setStaff(e.target.value), className: "w-28" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("label", { className: "text-xs text-muted-foreground", children: "Van" }), _jsx(Input, { type: "time", value: from, onChange: (e) => setFrom(e.target.value), className: "w-32" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("label", { className: "text-xs text-muted-foreground", children: "Tot" }), _jsx(Input, { type: "time", value: to, onChange: (e) => setTo(e.target.value), className: "w-32" })] }), _jsx(Button, { size: "sm", onClick: save, disabled: saving, children: saving ? "Opslaan…" : "Opslaan" }), dayPlan && (_jsx(Button, { size: "sm", variant: "ghost", onClick: reset, disabled: saving, children: "Standaard herstellen" })), _jsx(Button, { size: "sm", variant: "ghost", onClick: () => setEditing(false), disabled: saving, children: "Annuleren" })] }))] }));
|
|
254
257
|
}
|
|
255
258
|
function BestellingenTab({ orders, isLoading }) {
|
|
256
259
|
const { bufferFor } = useOrderBuffers(orders.map((o) => o.ref));
|
|
@@ -362,10 +365,10 @@ async function printDocumentenVoorOrder(p, fetchLines, fetchCarts, fetchDelivery
|
|
|
362
365
|
if (cartsRes.status === "fulfilled")
|
|
363
366
|
engineCarts = cartsRes.value.carts;
|
|
364
367
|
else
|
|
365
|
-
reasons.push(cartsRes.reason instanceof Error ? cartsRes.reason.message : "Karindeling
|
|
368
|
+
reasons.push(cartsRes.reason instanceof Error ? cartsRes.reason.message : "Karindeling niet opgehaald.");
|
|
366
369
|
if (engineCarts.length === 0) {
|
|
367
370
|
if (!reasons.length)
|
|
368
|
-
reasons.push(
|
|
371
|
+
reasons.push(`${p.order.orderNumber} is nog niet over karren verdeeld.`);
|
|
369
372
|
return { printed: 0, skipped: [], failed: 1, reasons, achtergrond: null };
|
|
370
373
|
}
|
|
371
374
|
let info;
|
|
@@ -395,7 +398,7 @@ async function printDocumentenVoorOrder(p, fetchLines, fetchCarts, fetchDelivery
|
|
|
395
398
|
const ci = infoById.get(engineCart.cartId);
|
|
396
399
|
if (!ci) {
|
|
397
400
|
failed++;
|
|
398
|
-
reasons.push(`Pakbon ${cartNumber}:
|
|
401
|
+
reasons.push(`Pakbon ${cartNumber} kan nog niet worden geprint: de kar is nog niet ingedeeld. Probeer het over een minuut opnieuw.`);
|
|
399
402
|
return;
|
|
400
403
|
}
|
|
401
404
|
const opdracht = (isHerprint) => printLayoutDocument({
|
|
@@ -441,7 +444,7 @@ async function printDocumentenVoorOrder(p, fetchLines, fetchCarts, fetchDelivery
|
|
|
441
444
|
else {
|
|
442
445
|
const { pdf } = await fetchDeliveryNote({ data: { orderRef: p.order.orderNumber } });
|
|
443
446
|
if (!pdf)
|
|
444
|
-
return { printed: 0, failed: 1, reasons: [`geen
|
|
447
|
+
return { printed: 0, failed: 1, reasons: [`Verzendbrief niet geprint: er is geen ontwerp ingesteld en Floriday heeft nog geen verzendbrief. Vraag kantoor het ontwerp in te stellen.`] };
|
|
445
448
|
jobId = await printPdfDocument({ documenttype: "afleverbrief", documentnaam: `AFL-${p.order.orderNumber}`, pdfBase64: pdf.base64, volgStatus: false });
|
|
446
449
|
}
|
|
447
450
|
return jobId ? { printed: 1, failed: 0, reasons: [] } : { printed: 0, failed: 1, reasons: ["de Printwachtrij gaf geen opdracht-id terug."] };
|
|
@@ -477,7 +480,19 @@ function BufferGroup({ bufferId, orders: dayOrders }) {
|
|
|
477
480
|
const fetchShippingNoteLayout = useServerFn(getShippingNoteLayout);
|
|
478
481
|
const fetchPakbonInfo = useServerFn(getPakbonCartInfo);
|
|
479
482
|
const shipState = useContext(ShipStateCtx);
|
|
480
|
-
|
|
483
|
+
// Tel op unieke kar-id: een gedeelde bufferkar telt één keer.
|
|
484
|
+
const bufCartIds = new Set();
|
|
485
|
+
const bufApproved = new Set();
|
|
486
|
+
for (const o of orders) {
|
|
487
|
+
const st = shipState.get(refKey(o.ref));
|
|
488
|
+
for (const id of st?.cartIds ?? [])
|
|
489
|
+
bufCartIds.add(id);
|
|
490
|
+
for (const id of st?.approvedCartIds ?? [])
|
|
491
|
+
bufApproved.add(id);
|
|
492
|
+
}
|
|
493
|
+
const carts = bufCartIds.size || orders.reduce((s, o) => s + (o.carts || 0), 0);
|
|
494
|
+
const scannedCount = [...bufCartIds].filter((id) => bufApproved.has(id)).length;
|
|
495
|
+
const bufferKlaar = bufCartIds.size > 0 && scannedCount === bufCartIds.size;
|
|
481
496
|
const klant = orders.find((o) => o.planned?.order.customerName)?.planned?.order.customerName ?? null;
|
|
482
497
|
const alleAf = orders.every((o) => shipState.get(refKey(o.ref))?.floridaySent === true);
|
|
483
498
|
const refs = orders.map((o) => o.ref).filter(Boolean);
|
|
@@ -549,7 +564,7 @@ function BufferGroup({ bufferId, orders: dayOrders }) {
|
|
|
549
564
|
setPrinting(false);
|
|
550
565
|
}
|
|
551
566
|
};
|
|
552
|
-
return (_jsxs("div", { className: "rounded-lg border border-primary/40 bg-primary/5", children: [_jsxs("div", { className: "flex flex-col gap-3 p-3", children: [_jsxs("button", { type: "button", onClick: () => setOpen((o) => !o), className: "-m-1 flex items-start gap-3 rounded-md p-1 text-left hover:bg-primary/10", children: [open ? (_jsx(ChevronDown, { className: "mt-1 h-4 w-4 shrink-0" })) : (_jsx(ChevronRight, { className: "mt-1 h-4 w-4 shrink-0" })), _jsxs("div", { className: "min-w-0 flex-1 space-y-2", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2 text-sm", children: [_jsx(Badge, { variant: "secondary", children: "Buffer" }), _jsxs("span", { className: "font-medium", children: [orders.length, " bestellingen samen"] }), klant ? _jsx("span", { className: "text-xs text-muted-foreground", children: klant }) : null] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsxs(Badge, { variant: "secondary", children: [carts, " ", carts === 1 ? "kar" : "karren", " vandaag"] }), _jsx(Badge, { variant: alleAf ? "default" : "outline", children: alleAf ? "
|
|
567
|
+
return (_jsxs("div", { className: "rounded-lg border border-primary/40 bg-primary/5", children: [_jsxs("div", { className: "flex flex-col gap-3 p-3", children: [_jsxs("button", { type: "button", onClick: () => setOpen((o) => !o), className: "-m-1 flex items-start gap-3 rounded-md p-1 text-left hover:bg-primary/10", children: [open ? (_jsx(ChevronDown, { className: "mt-1 h-4 w-4 shrink-0" })) : (_jsx(ChevronRight, { className: "mt-1 h-4 w-4 shrink-0" })), _jsxs("div", { className: "min-w-0 flex-1 space-y-2", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2 text-sm", children: [_jsx(Badge, { variant: "secondary", children: "Buffer" }), _jsxs("span", { className: "font-medium", children: [orders.length, " bestellingen samen"] }), klant ? _jsx("span", { className: "text-xs text-muted-foreground", children: klant }) : null] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsxs(Badge, { variant: "secondary", children: [carts, " ", carts === 1 ? "kar" : "karren", " vandaag"] }), bufCartIds.size > 0 && (_jsxs(Badge, { variant: bufferKlaar ? "default" : "outline", children: [scannedCount, " van ", bufCartIds.size, " ", bufCartIds.size === 1 ? "kar" : "karren", " gescand"] })), _jsx(Badge, { variant: alleAf ? "default" : "outline", children: alleAf ? "Gemeld bij Floriday" : (bufCartIds.size > 0 ? bufferKlaar : orders.every(engineKlaar)) ? "Klaar voor verzending" : orders.some(engineKlaar) ? "Deels gescand" : "Nog te picken" }), _jsx("span", { className: "text-xs text-muted-foreground", children: refs.join(", ") })] })] })] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2 border-t pt-3", children: [_jsxs(Button, { size: "sm", variant: "outline", onClick: afhandelen, disabled: busy || alleAf, title: "Alle bestellingen in deze buffer in \u00E9\u00E9n keer afhandelen", children: [_jsx(CheckCircle2, { className: "mr-1 h-3.5 w-3.5" }), alleAf ? "Afgehandeld" : busy ? "Bezig…" : "Buffer afhandelen (verzonden)"] }), refs[0] && alleFloriday && !alleAf ? _jsx(NuVersturenButton, { orderRef: refs[0], label: "Buffer naar Floriday versturen" }) : null, _jsxs(Button, { size: "sm", variant: "outline", onClick: printAlles, disabled: printing, title: "Alle pakbonnen van deze buffer afdrukken", children: [_jsx(Printer, { className: "mr-1 h-3.5 w-3.5" }), printing ? "In de Printwachtrij…" : "Documenten afdrukken"] }), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => setVerzetOpen(true), title: "Alle bestellingen van deze buffer verzetten", children: [_jsx(CalendarClock, { className: "mr-1 h-3.5 w-3.5" }), "Verzetten"] })] })] }), open && (_jsx("div", { className: "space-y-2 border-t border-primary/30 px-2 py-2", children: orders.map((o) => o.planned ? (_jsx(OrderRow, { planned: o.planned, cartsToday: o.carts, engineStatus: o.status }, o.ref)) : (_jsx(EngineOrderRow, { order: o }, o.ref))) })), _jsx(BulkVerzetDialog, { open: verzetOpen, orders: verzetOrders, cartCount: carts, onOpenChange: setVerzetOpen, onDone: () => setVerzetOpen(false) })] }));
|
|
553
568
|
}
|
|
554
569
|
/** Bestelling die alleen de Engine kent; verdere ordergegevens ontbreken. */
|
|
555
570
|
/** Knop "Afhandelen (verzonden)" — zet de bestelling in de orderadministratie op Verzonden. */
|
|
@@ -590,7 +605,7 @@ function AfhandelenButton({ orderRef, done }) {
|
|
|
590
605
|
}
|
|
591
606
|
function EngineOrderRow({ order }) {
|
|
592
607
|
const vg = useVoortgang(order.ref, order.status);
|
|
593
|
-
return (_jsx("div", { className: "rounded-lg border bg-card px-4 py-3", children: _jsxs("div", { className: "grid grid-cols-2 gap-3 text-sm md:grid-cols-4", children: [_jsxs("div", { children: [_jsx("div", { className: "font-medium", children: order.ref }), _jsx("div", { className: "text-xs text-muted-foreground", children: "Alleen bekend
|
|
608
|
+
return (_jsx("div", { className: "rounded-lg border bg-card px-4 py-3", children: _jsxs("div", { className: "grid grid-cols-2 gap-3 text-sm md:grid-cols-4", children: [_jsxs("div", { children: [_jsx("div", { className: "font-medium", children: order.ref }), _jsx("div", { className: "text-xs text-muted-foreground", children: "Alleen bekend in de planning" })] }), _jsxs("div", { children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "Karren vandaag" }), _jsx("div", { children: order.carts })] }), _jsxs("div", { children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "Planten" }), _jsx("div", { children: order.plants })] }), _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [_jsx(StatusBadge, { vg: vg }), _jsx(AfhandelenButton, { orderRef: order.ref, done: vg.done })] })] }) }));
|
|
594
609
|
}
|
|
595
610
|
function OrderRow({ planned: p, cartsToday, engineStatus, }) {
|
|
596
611
|
const [open, setOpen] = useState(false);
|
|
@@ -602,6 +617,7 @@ function OrderRow({ planned: p, cartsToday, engineStatus, }) {
|
|
|
602
617
|
const fetchDeliveryNote = useServerFn(getDeliveryNotePdf);
|
|
603
618
|
const fetchShippingNoteLayout = useServerFn(getShippingNoteLayout);
|
|
604
619
|
const archivedQ = useOrderArchived(p.order.id);
|
|
620
|
+
const shipStateRow = useContext(ShipStateCtx).get(refKey(p.order.orderNumber));
|
|
605
621
|
const fetchPakbonInfo = useServerFn(getPakbonCartInfo);
|
|
606
622
|
const vg = useVoortgang(p.order.orderNumber, engineStatus ?? p.order.status, {
|
|
607
623
|
floriday: !!p.order.salesOrderId,
|
|
@@ -633,7 +649,7 @@ function OrderRow({ planned: p, cartsToday, engineStatus, }) {
|
|
|
633
649
|
};
|
|
634
650
|
return (_jsxs("div", { className: "rounded-lg border bg-card", children: [_jsxs("div", { className: "flex flex-col gap-3 p-3", children: [_jsxs("button", { type: "button", onClick: () => setOpen((o) => !o), className: "-m-1 flex items-start gap-3 rounded-md p-1 text-left hover:bg-muted/50", children: [open ? (_jsx(ChevronDown, { className: "mt-1 h-4 w-4 shrink-0" })) : (_jsx(ChevronRight, { className: "mt-1 h-4 w-4 shrink-0" })), _jsxs("div", { className: "min-w-0 flex-1 space-y-2", children: [_jsxs("div", { className: "flex flex-wrap items-baseline gap-x-6 gap-y-1 text-sm", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "font-medium", children: p.order.orderNumber }), _jsx("div", { className: "truncate text-xs text-muted-foreground", children: p.order.customerName })] }), _jsxs("div", { className: "text-xs text-muted-foreground", children: ["Type ", _jsx("span", { className: "text-foreground", children: p.order.deliveryType })] }), _jsxs("div", { className: "text-xs text-muted-foreground", children: ["Leverdatum", " ", _jsx("span", { className: "text-foreground", children: p.order.deliveryDate
|
|
635
651
|
? new Date(p.order.deliveryDate).toLocaleDateString("nl-NL")
|
|
636
|
-
: "—" })] })] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsxs(Badge, { variant: "secondary", children: [cartsToday, " karren vandaag"] }), _jsx(StatusBadge, { vg: vg })] }), _jsx(StickerMeldingen, { orderId: p.order.id })] })] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2 border-t pt-3", children: [p.order.orderNumber && p.order.salesOrderId ? _jsx(NuVersturenButton, { orderRef: p.order.orderNumber }) : null, p.order.salesOrderId ? _jsx(AutoSendStatus, { orderId: p.order.id }) : null, _jsx(AfhandelenButton, { orderRef: p.order.orderNumber, done: vg.done }), _jsxs(Button, { size: "sm", variant: "outline", onClick: handlePrintAll, disabled: printing, title: "Alle documenten van deze bestelling afdrukken (pakbonnen per kar en de verzendbrief)", children: [_jsx(Printer, { className: "mr-1 h-3.5 w-3.5" }), printing ? "In de Printwachtrij…" : "Alle documenten afdrukken"] }), _jsxs(Button, { size: "sm", variant: "outline", onClick: (e) => {
|
|
652
|
+
: "—" })] })] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsxs(Badge, { variant: "secondary", children: [cartsToday, " ", cartsToday === 1 ? "kar" : "karren", " vandaag"] }), _jsx(StatusBadge, { vg: vg })] }), _jsx(StickerMeldingen, { orderId: p.order.id })] })] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2 border-t pt-3", children: [p.order.orderNumber && p.order.salesOrderId && !shipStateRow?.floridaySent ? _jsx(NuVersturenButton, { orderRef: p.order.orderNumber }) : null, p.order.salesOrderId ? _jsx(AutoSendStatus, { orderId: p.order.id, orderRef: p.order.orderNumber }) : null, _jsx(AfhandelenButton, { orderRef: p.order.orderNumber, done: vg.done }), _jsxs(Button, { size: "sm", variant: "outline", onClick: handlePrintAll, disabled: printing, title: "Alle documenten van deze bestelling afdrukken (pakbonnen per kar en de verzendbrief)", children: [_jsx(Printer, { className: "mr-1 h-3.5 w-3.5" }), printing ? "In de Printwachtrij…" : "Alle documenten afdrukken"] }), _jsxs(Button, { size: "sm", variant: "outline", onClick: (e) => {
|
|
637
653
|
e.stopPropagation();
|
|
638
654
|
setVerzetOpen(true);
|
|
639
655
|
}, title: "Ophaaldag of ophaaltijd van deze order wijzigen", children: [_jsx(CalendarClock, { className: "mr-1 h-3.5 w-3.5" }), "Verzetten"] })] })] }), _jsx(VerzetOrderDialog, { open: verzetOpen, orderRef: p.order.orderNumber, carrierTarget: {
|
|
@@ -670,7 +686,7 @@ function KarrenTab({ carts }) {
|
|
|
670
686
|
const toggleAll = () => setSelected(allSelected ? new Set() : new Set(carts.map((c) => c.key)));
|
|
671
687
|
const selectedCarts = carts.filter((c) => selected.has(c.key));
|
|
672
688
|
const selectedOrders = Array.from(new Map(selectedCarts.map((c) => [c.orderRef, { ref: c.orderRef, customerName: c.customerName }])).values());
|
|
673
|
-
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mb-3 text-xs text-muted-foreground", children: "De indeling komt uit de
|
|
689
|
+
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mb-3 text-xs text-muted-foreground", children: "De indeling komt uit de planning. Verzetten gebeurt per bestelling: alle karren van die bestelling schuiven mee." }), _jsxs("div", { className: "mb-3 flex flex-wrap items-center justify-between gap-3 rounded-md border bg-muted/30 px-3 py-2", children: [_jsxs("label", { className: "flex items-center gap-2 text-sm", children: [_jsx(Checkbox, { checked: allSelected, onCheckedChange: toggleAll }), _jsx("span", { children: selected.size > 0
|
|
674
690
|
? `${selected.size} kar${selected.size === 1 ? "" : "ren"} geselecteerd · ${selectedOrders.length} bestelling${selectedOrders.length === 1 ? "" : "en"}`
|
|
675
691
|
: "Alles selecteren" })] }), _jsxs("div", { className: "flex items-center gap-2", children: [selected.size > 0 && (_jsx(Button, { size: "sm", variant: "ghost", onClick: () => setSelected(new Set()), children: "Selectie wissen" })), _jsxs(Button, { size: "sm", disabled: selected.size === 0, onClick: () => setBulkOpen(true), children: [_jsx(CalendarClock, { className: "mr-1 h-3.5 w-3.5" }), "Geselecteerde verzetten"] })] })] }), _jsx("div", { className: "grid gap-3", children: carts.map((c) => (_jsx(KarRow, { cart: c, cartTotal: carts.filter((x) => x.orderRef === c.orderRef).length, selected: selected.has(c.key), onToggle: () => toggle(c.key) }, c.key))) }), _jsx(BulkVerzetDialog, { open: bulkOpen, orders: selectedOrders, cartCount: selected.size, onOpenChange: setBulkOpen, onDone: () => setSelected(new Set()) })] }));
|
|
676
692
|
}
|
|
@@ -738,10 +754,10 @@ function KarRow({ cart: c, cartTotal, selected, onToggle, }) {
|
|
|
738
754
|
}
|
|
739
755
|
}
|
|
740
756
|
if (!c.cartId)
|
|
741
|
-
throw new Error(`Pakbon ${c.cartNumber}
|
|
757
|
+
throw new Error(`Pakbon ${c.cartNumber} kan nog niet worden geprint: de kar is nog niet ingedeeld. Probeer het over een minuut opnieuw.`);
|
|
742
758
|
const [ci] = (await fetchPakbonInfo({ data: { cartIds: [c.cartId] } })).carts;
|
|
743
759
|
if (!ci)
|
|
744
|
-
throw new Error(`Pakbon ${c.cartNumber}:
|
|
760
|
+
throw new Error(`Pakbon ${c.cartNumber} kan nog niet worden geprint: de kar is nog niet ingedeeld. Probeer het over een minuut opnieuw.`);
|
|
745
761
|
const nr = String(c.cartIndex + 1).padStart(2, "0");
|
|
746
762
|
await printLayoutDocument({
|
|
747
763
|
documenttype: "pakbon",
|
|
@@ -807,7 +823,7 @@ function KarRow({ cart: c, cartTotal, selected, onToggle, }) {
|
|
|
807
823
|
// 2) Geen eigen layout ingesteld: dan de Floriday-brief, als die er is.
|
|
808
824
|
const { pdf } = await fetchDeliveryNote({ data: { orderRef: c.orderRef } });
|
|
809
825
|
if (!pdf) {
|
|
810
|
-
toast.error("
|
|
826
|
+
toast.error("Verzendbrief niet geprint: er is geen ontwerp ingesteld en Floriday heeft nog geen verzendbrief. Vraag kantoor het ontwerp in te stellen.");
|
|
811
827
|
return;
|
|
812
828
|
}
|
|
813
829
|
await printPdfDocument({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeveringenPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/LeveringenPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LeveringenPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/LeveringenPage.tsx"],"names":[],"mappings":"AAOA,wBAAgB,cAAc,gCAqC7B"}
|
|
@@ -2,11 +2,13 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMemo, useState } from "react";
|
|
3
3
|
import { Button } from "@flowselections/core";
|
|
4
4
|
import { WeekAgendaView } from "./WeekAgendaView";
|
|
5
|
+
import { DagDetailDialog } from "./DagDetailDialog";
|
|
5
6
|
import { useOrderPlanning } from "../../hooks/useOrderPlanning";
|
|
6
7
|
import { agendaRange, currentWeekStart } from "../../lib/agendaRange";
|
|
7
8
|
export function LeveringenPage() {
|
|
8
9
|
const [weekStart, setWeekStart] = useState(() => currentWeekStart());
|
|
9
10
|
const range = useMemo(() => agendaRange(weekStart), [weekStart]);
|
|
10
11
|
const { planned, nearestDeliveryDate, isLoading, error, warning, refetch } = useOrderPlanning(range);
|
|
11
|
-
|
|
12
|
+
const [dayDetailDate, setDayDetailDate] = useState(null);
|
|
13
|
+
return (_jsxs("main", { className: "p-6 space-y-6", children: [warning && !error && (_jsxs("div", { className: "rounded-md border border-amber-300 bg-amber-50 p-4 text-sm text-amber-900", children: [warning, " De beschikbare orders blijven zichtbaar."] })), error ? (_jsxs("div", { className: "rounded-md border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive", children: [error, _jsx(Button, { size: "sm", variant: "outline", className: "ml-3", onClick: () => refetch(), children: "Opnieuw proberen" })] })) : (_jsx(WeekAgendaView, { planned: planned, mode: "delivery", isLoading: isLoading, onWeekChange: setWeekStart, onDayClick: setDayDetailDate, jumpToDate: nearestDeliveryDate })), _jsx(DagDetailDialog, { open: !!dayDetailDate, date: dayDetailDate, planned: planned, onOpenChange: (o) => !o && setDayDetailDate(null) })] }));
|
|
12
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NuVersturenButton.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/NuVersturenButton.tsx"],"names":[],"mappings":"AAqBA,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,KAAsB,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,+
|
|
1
|
+
{"version":3,"file":"NuVersturenButton.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/NuVersturenButton.tsx"],"names":[],"mappings":"AAqBA,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,KAAsB,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,+BAiI3G"}
|
|
@@ -7,7 +7,7 @@ import { Send, Loader2, CheckCircle2, XCircle } from "lucide-react";
|
|
|
7
7
|
import { prepareFloridayLoading, sendFloridayLoading, } from "../../lib/floridayLoading.functions";
|
|
8
8
|
/** "Nu versturen": toont eerst een samenvatting met controles en vraagt bevestiging. */
|
|
9
9
|
const PICK_LABEL = {
|
|
10
|
-
geen_pickrij: "
|
|
10
|
+
geen_pickrij: "nog niet gepickt",
|
|
11
11
|
open: "nog te picken",
|
|
12
12
|
bezig: "wordt gepickt",
|
|
13
13
|
gepickt: "gepickt",
|
|
@@ -70,11 +70,11 @@ export function NuVersturenButton({ orderRef, label = "Nu versturen" }) {
|
|
|
70
70
|
setSending(false);
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Button, { size: "sm", variant: "outline", onClick: open, disabled: loading, children: [loading ? _jsx(Loader2, { className: "h-3 w-3 mr-1 animate-spin" }) : _jsx(Send, { className: "h-3 w-3 mr-1" }), label] }), _jsx(AlertDialog, { open: !!preview, onOpenChange: (o) => !o && !sending && setPreview(null), children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Belading naar Floriday versturen?" }), _jsx(AlertDialogDescription, { children: "
|
|
73
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Button, { size: "sm", variant: "outline", onClick: open, disabled: loading, children: [loading ? _jsx(Loader2, { className: "h-3 w-3 mr-1 animate-spin" }) : _jsx(Send, { className: "h-3 w-3 mr-1" }), label] }), _jsx(AlertDialog, { open: !!preview, onOpenChange: (o) => !o && !sending && setPreview(null), children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Belading naar Floriday versturen?" }), _jsx(AlertDialogDescription, { children: "Na versturen maakt Floriday de verzendbrief, vooraanmelding en fustafrekening. Dit kun je niet terugdraaien." })] }), preview && (_jsxs("div", { className: "space-y-2 text-sm", children: [_jsxs("div", { children: [_jsx("span", { className: "text-muted-foreground", children: "Orders:" }), " ", preview.orderRefs.join(", ")] }), _jsxs("div", { children: [_jsx("span", { className: "text-muted-foreground", children: "Leveringen:" }), " ", preview.shipments.length] }), _jsxs("div", { children: [_jsx("span", { className: "text-muted-foreground", children: "Karren:" }), " ", preview.cartCount, preview.carriers.some((c) => c.shared) ? " (waarvan gedeeld)" : ""] }), Array.isArray(preview.carriers) && preview.carriers.length > 0 && (_jsxs("div", { children: [_jsx("span", { className: "text-muted-foreground", children: "Karkenmerk naar Floriday:" }), " ", _jsx("span", { className: "font-mono", children: preview.carriers.map((c) => c.loadCarrierReference || "—").join(", ") })] })), _jsxs("div", { children: [_jsx("span", { className: "text-muted-foreground", children: "Regels:" }), " ", preview.lineCount] }), _jsx("ul", { className: "space-y-1", children: preview.orders.map((o) => (_jsxs("li", { className: "flex items-center gap-2", children: [o.controlled
|
|
74
74
|
? _jsx(CheckCircle2, { className: "h-3.5 w-3.5 text-primary" })
|
|
75
|
-
: _jsx(XCircle, { className: "h-3.5 w-3.5 text-destructive" }), _jsxs("span", { children: [o.orderRef, ": ", o.cartsControlled, " van ", o.cartsTotal, " karren goedgekeurd op de Scan-controle", o.controlled ? " — klaar voor verzending" : "", !o.controlled && o.pickStatus && o.pickStatus !== "geen_pickrij" ? ` · pickstatus: ${PICK_LABEL[o.pickStatus] ?? o.pickStatus}` : "", o.autoStatus ? ` · auto-verwerking: ${o.autoStatus}` : ""] })] }, o.orderRef))) }), preview.shipments.filter((sh) => sh.floridayStatus || preview.lastAttempts.some((a) => a.fulfillmentOrderId === sh.fulfillmentOrderId && (a.code === "created" || a.code === "already_fulfilled"))).map((sh) => (_jsxs("div", { className: "rounded border border-border p-2", children: ["
|
|
75
|
+
: _jsx(XCircle, { className: "h-3.5 w-3.5 text-destructive" }), _jsxs("span", { children: [o.orderRef, ": ", o.cartsControlled, " van ", o.cartsTotal, " karren goedgekeurd op de Scan-controle", o.controlled ? " — klaar voor verzending" : "", !o.controlled && o.pickStatus && o.pickStatus !== "geen_pickrij" ? ` · pickstatus: ${PICK_LABEL[o.pickStatus] ?? o.pickStatus}` : "", o.autoStatus ? ` · auto-verwerking: ${o.autoStatus}` : ""] })] }, o.orderRef))) }), preview.shipments.filter((sh) => sh.floridayStatus || preview.lastAttempts.some((a) => a.fulfillmentOrderId === sh.fulfillmentOrderId && (a.code === "created" || a.code === "already_fulfilled"))).map((sh) => (_jsxs("div", { className: "rounded border border-border p-2", children: ["Gemeld bij Floriday", sh.floridayStatus ? ` (Floriday: ${sh.floridayStatus})` : "", " \u00B7", " ", sh.deliveryNoteReady === true ? "verzendbrief klaar" : "verzendbrief wordt automatisch geprint"] }, sh.fulfillmentOrderId))), preview.lastAttempts.length > 0 && (_jsxs("div", { className: "rounded border border-border p-2", children: [_jsx("div", { className: "text-muted-foreground mb-1", children: "Laatste pogingen" }), preview.lastAttempts.slice(0, 4).map((a) => (_jsxs("div", { children: [new Date(a.createdAt).toLocaleString("nl-NL"), " \u00B7 versturen \u00B7 ", a.code === "created" || a.code === "already_fulfilled" ? "geaccepteerd" : (a.message ?? a.code)?.replace(/\s*\[[^\]]+\]$/, "")] }, a.createdAt + a.step)))] })), preview.blockers.length > 0 && (_jsx("ul", { className: "list-disc pl-5 text-destructive", children: preview.blockers.map((b) => {
|
|
76
76
|
// Begrijpelijke zin, technische code klein eronder.
|
|
77
77
|
const m = /^(.*?)\s*\[([^\]]+)\]$/s.exec(b);
|
|
78
78
|
return (_jsxs("li", { children: [m ? m[1] : b, m ? _jsx("div", { className: "text-xs text-muted-foreground", children: m[2] }) : null] }, b));
|
|
79
|
-
}) }))] })), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { disabled: sending, children: "Annuleren" }), _jsxs(Button, { onClick: doSend, disabled: !preview?.canSend || sending || sent, children: [sending ? _jsx(Loader2, { className: "h-3 w-3 mr-1 animate-spin" }) : null, sent ? "
|
|
79
|
+
}) }))] })), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { disabled: sending, children: "Annuleren" }), _jsxs(Button, { onClick: doSend, disabled: !preview?.canSend || sending || sent, children: [sending ? _jsx(Loader2, { className: "h-3 w-3 mr-1 animate-spin" }) : null, sent ? "Gemeld bij Floriday" : "Versturen"] })] })] }) })] }));
|
|
80
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickAgendaView.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/PickAgendaView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PickAgendaView.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/PickAgendaView.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;CAC/C;AA2BD,wBAAgB,cAAc,CAAC,EAAE,YAAY,EAAE,EAAE,mBAAmB,+BAyFnE"}
|
|
@@ -3,6 +3,7 @@ import { useMemo, useState } from "react";
|
|
|
3
3
|
import { Button } from "@flowselections/core";
|
|
4
4
|
import { WeekAgendaView } from "./WeekAgendaView";
|
|
5
5
|
import { DagDetailDialog } from "./DagDetailDialog";
|
|
6
|
+
import { useVestigingTijdzone } from "./AutoSendStatus";
|
|
6
7
|
import { useOrderPlanning } from "../../hooks/useOrderPlanning";
|
|
7
8
|
import { agendaRange, currentWeekStart } from "../../lib/agendaRange";
|
|
8
9
|
/** Toon hooguit dit aantal ordernummers per categorie; de rest telt als "meer". */
|
|
@@ -23,19 +24,20 @@ export function PickAgendaView({ onOrderClick }) {
|
|
|
23
24
|
const { planned, awaiting, tasksWithoutStart, nearestDeliveryDate, signalError, lastEngineRun, isLoading, error, warning, refetch, } = useOrderPlanning(range);
|
|
24
25
|
const awaitingCount = awaiting.length;
|
|
25
26
|
const anyIssue = awaitingCount + tasksWithoutStart.length > 0;
|
|
26
|
-
const
|
|
27
|
+
const vestigingTz = useVestigingTijdzone().data ?? null;
|
|
28
|
+
const lastRunLabel = lastEngineRun && vestigingTz
|
|
27
29
|
? new Date(lastEngineRun).toLocaleString("nl-NL", {
|
|
28
|
-
timeZone:
|
|
30
|
+
timeZone: vestigingTz,
|
|
29
31
|
dateStyle: "short",
|
|
30
32
|
timeStyle: "short",
|
|
31
33
|
})
|
|
32
34
|
: null;
|
|
33
35
|
const [dayDetailDate, setDayDetailDate] = useState(null);
|
|
34
|
-
return (_jsxs("div", { className: "flex h-full flex-col gap-6 overflow-hidden", children: [anyIssue && (_jsxs("div", { className: "shrink-0 space-y-1 rounded-md border border-sky-300 bg-sky-50 p-4 text-sm text-sky-900", children: [_jsx(CategoryLine, { items: awaiting, label: (n) => `${n} order${n === 1 ? "" : "s"}
|
|
35
|
-
? `Laatste indeling door de
|
|
36
|
-
: "Er is nog geen indeling
|
|
36
|
+
return (_jsxs("div", { className: "flex h-full flex-col gap-6 overflow-hidden", children: [anyIssue && (_jsxs("div", { className: "shrink-0 space-y-1 rounded-md border border-sky-300 bg-sky-50 p-4 text-sm text-sky-900", children: [_jsx(CategoryLine, { items: awaiting, label: (n) => `${n} order${n === 1 ? "" : "s"} ${n === 1 ? "is" : "zijn"} nog niet over karren verdeeld en ${n === 1 ? "staat" : "staan"} daarom nog niet in de agenda` }), _jsx(CategoryLine, { items: tasksWithoutStart, label: (n) => `${n} order${n === 1 ? " heeft" : "s hebben"} nog geen starttijd voor het picken. Controleer de werktijden` }), _jsxs("div", { className: "text-xs", children: [lastRunLabel
|
|
37
|
+
? `Laatste indeling door de planning: ${lastRunLabel}.`
|
|
38
|
+
: "Er is nog geen indeling bekend voor deze periode.", " ", awaitingCount === 0
|
|
37
39
|
? "Orders die buiten deze week zijn ingedeeld staan hier niet bij."
|
|
38
40
|
: signalError
|
|
39
|
-
?
|
|
40
|
-
: "
|
|
41
|
+
? signalError
|
|
42
|
+
: "De orders worden automatisch ingepland."] })] })), warning && !error && (_jsxs("div", { className: "shrink-0 rounded-md border border-amber-300 bg-amber-50 p-4 text-sm text-amber-900", children: [warning, " De beschikbare orders blijven zichtbaar."] })), error ? (_jsxs("div", { className: "shrink-0 rounded-md border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive", children: [error, _jsx(Button, { size: "sm", variant: "outline", className: "ml-3", onClick: () => refetch(), children: "Opnieuw proberen" })] })) : (_jsx("div", { className: "min-h-0 flex-1", children: _jsx(WeekAgendaView, { planned: planned, mode: "pick", isLoading: isLoading, onOrderClick: onOrderClick, onDayClick: setDayDetailDate, onWeekChange: setWeekStart, jumpToDate: nearestDeliveryDate }) })), _jsx(DagDetailDialog, { open: !!dayDetailDate, date: dayDetailDate, planned: planned, onOpenChange: (o) => !o && setDayDetailDate(null) })] }));
|
|
41
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScanControleView.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/ScanControleView.tsx"],"names":[],"mappings":"AA4FA,wBAAgB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ScanControleView.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/ScanControleView.tsx"],"names":[],"mappings":"AA4FA,wBAAgB,gBAAgB,gCAiV/B"}
|
|
@@ -101,7 +101,7 @@ export function ScanControleView() {
|
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
103
|
toast.success(res.isFloriday
|
|
104
|
-
? "Goedgekeurd — de Floriday-
|
|
104
|
+
? "Goedgekeurd — de Floriday-verzendbrief wordt geprint."
|
|
105
105
|
: "Goedgekeurd — de afleverbrief staat klaar op de printer.");
|
|
106
106
|
setLookup(null);
|
|
107
107
|
setBarcode("");
|
|
@@ -144,7 +144,7 @@ export function ScanControleView() {
|
|
|
144
144
|
return _jsx("div", { className: "text-sm text-muted-foreground", children: "Controlepost laden\u2026" });
|
|
145
145
|
}
|
|
146
146
|
if (!postKlaar) {
|
|
147
|
-
return (_jsx(Card, { className: "p-4 border-destructive/40 bg-destructive/10", children: _jsxs("div", { className: "flex items-start gap-2 text-destructive", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0" }), _jsxs("div", { className: "text-sm", children: [_jsx("div", { className: "font-medium", children: "Controlepost nog niet ingesteld" }),
|
|
147
|
+
return (_jsx(Card, { className: "p-4 border-destructive/40 bg-destructive/10", children: _jsxs("div", { className: "flex items-start gap-2 text-destructive", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0" }), _jsxs("div", { className: "text-sm", children: [_jsx("div", { className: "font-medium", children: "Controlepost nog niet ingesteld" }), _jsx("p", { children: "De karrencontrole is nog niet ingesteld (scanner en printer). Vraag kantoor dit te regelen." })] })] }) }));
|
|
148
148
|
}
|
|
149
149
|
const cart = lookup?.cart ?? null;
|
|
150
150
|
return (_jsxs("div", { className: "space-y-4", children: [_jsxs(Card, { className: "p-4 space-y-3", children: [_jsxs("form", { className: "flex gap-2", onSubmit: (e) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignupMailMoments.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/SignupMailMoments.tsx"],"names":[],"mappings":"AAqBA,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,sCAyC7D"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
|
+
import { useServerFn } from "@tanstack/react-start";
|
|
5
|
+
import { Button, Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, toast, } from "@flowselections/core";
|
|
6
|
+
import { Mail } from "lucide-react";
|
|
7
|
+
import { getSignupOverview, previewSignupMail, sendSignupMailNow, } from "../../lib/carrierSignup.functions";
|
|
8
|
+
import { fmtDayTime, fmtTime, signupReasonText } from "../../lib/signupMailText";
|
|
9
|
+
export function SignupMailMoments({ from, to, compact }) {
|
|
10
|
+
const fetchOverview = useServerFn(getSignupOverview);
|
|
11
|
+
const q = useQuery({
|
|
12
|
+
queryKey: ["afhandeling", "signup-overview", from, to],
|
|
13
|
+
queryFn: () => fetchOverview({ data: { from, to } }),
|
|
14
|
+
refetchInterval: 60000,
|
|
15
|
+
});
|
|
16
|
+
const [preview, setPreview] = useState(null);
|
|
17
|
+
if (q.isLoading)
|
|
18
|
+
return null;
|
|
19
|
+
if (q.isError) {
|
|
20
|
+
return _jsx("div", { className: "rounded-md border px-3 py-2 text-xs text-muted-foreground", children: "Aanmeldmail: stand onbekend." });
|
|
21
|
+
}
|
|
22
|
+
const ov = q.data;
|
|
23
|
+
if (!ov)
|
|
24
|
+
return null;
|
|
25
|
+
const tz = ov.timezone;
|
|
26
|
+
const reason = ov.ok ? (ov.enabled ? signupReasonText(ov.reason) : null) : signupReasonText(ov.reason);
|
|
27
|
+
const unassigned = ov.unassigned.length;
|
|
28
|
+
if (ov.groups.length === 0 && unassigned === 0 && !reason)
|
|
29
|
+
return null;
|
|
30
|
+
return (_jsxs("div", { className: "space-y-2 rounded-md border p-3", children: [_jsxs("div", { className: "flex items-center gap-2 text-sm font-medium", children: [_jsx(Mail, { className: "h-4 w-4 text-primary" }), " Aanmeldmail vervoerders"] }), !ov.enabled ? _jsx("p", { className: "text-xs text-muted-foreground", children: "De aanmeldmail staat uit." }) : null, reason && ov.enabled ? _jsx("p", { className: "text-xs text-destructive", children: reason }) : null, unassigned > 0 ? (_jsxs("p", { className: "text-xs text-destructive", children: [unassigned, " ", unassigned === 1 ? "order heeft" : "orders hebben", " geen vervoerder. Stel een standaardvervoerder in bij Vervoerders."] })) : null, _jsx("ul", { className: "space-y-1", children: ov.groups.map((g) => (_jsx(MomentRow, { g: g, tz: tz, compact: compact, enabled: ov.enabled, onPreview: () => setPreview(g) }, `${g.carrier_id}-${g.pickup_date}-${g.pickup_moment_key}`))) }), preview ? _jsx(PreviewDialog, { g: preview, onClose: () => setPreview(null) }) : null] }));
|
|
31
|
+
}
|
|
32
|
+
function statusLine(g, tz, enabled) {
|
|
33
|
+
const moment = compactMoment(g, tz);
|
|
34
|
+
if (g.last) {
|
|
35
|
+
const base = `Aanmeldmail verstuurd om ${fmtTime(g.last.sent_at, tz)} naar ${g.carrier_name} · ${g.last.cart_count} karren`;
|
|
36
|
+
return g.last.fingerprint_match ? `${moment} — ${base}` : `${moment} — ${base} · wijziging volgt: nu ${g.cart_count} karren`;
|
|
37
|
+
}
|
|
38
|
+
if (!enabled)
|
|
39
|
+
return `${moment} — ${g.carrier_name} · ${g.cart_count} karren`;
|
|
40
|
+
return `${moment} — Aanmeldmail volgt om ${fmtTime(g.send_at, tz)} naar ${g.carrier_name} · ${g.cart_count} karren`;
|
|
41
|
+
}
|
|
42
|
+
function compactMoment(g, tz) {
|
|
43
|
+
return `Ophalen ${fmtDayTime(g.pickup_at, tz)}`;
|
|
44
|
+
}
|
|
45
|
+
function MomentRow({ g, tz, compact, enabled, onPreview }) {
|
|
46
|
+
const qc = useQueryClient();
|
|
47
|
+
const send = useServerFn(sendSignupMailNow);
|
|
48
|
+
const m = useMutation({
|
|
49
|
+
mutationFn: () => send({ data: { carrierId: g.carrier_id, pickupDate: g.pickup_date, momentKey: g.pickup_moment_key } }),
|
|
50
|
+
onSuccess: (r) => {
|
|
51
|
+
if (r.code === "sent")
|
|
52
|
+
toast.success("Aanmeldmail verstuurd");
|
|
53
|
+
else if (r.code === "already_sent")
|
|
54
|
+
toast.info("Deze stand is al verstuurd");
|
|
55
|
+
else
|
|
56
|
+
toast.error(signupReasonText(r.code) ?? "Versturen lukte niet");
|
|
57
|
+
void qc.invalidateQueries({ queryKey: ["afhandeling", "signup-overview"] });
|
|
58
|
+
void qc.invalidateQueries({ queryKey: ["afhandeling", "signup-status"] });
|
|
59
|
+
},
|
|
60
|
+
onError: (e) => toast.error(e instanceof Error ? e.message : "Versturen lukte niet"),
|
|
61
|
+
});
|
|
62
|
+
const upToDate = g.last?.fingerprint_match === true;
|
|
63
|
+
return (_jsxs("li", { className: "flex flex-wrap items-center justify-between gap-2 text-xs", children: [_jsx("span", { children: statusLine(g, tz, enabled) }), compact ? null : (_jsxs("span", { className: "flex gap-2", children: [_jsx(Button, { size: "sm", variant: "outline", onClick: onPreview, children: "Voorbeeld bekijken" }), _jsx(Button, { size: "sm", disabled: !enabled || upToDate || m.isPending, onClick: () => m.mutate(), children: m.isPending ? "Versturen…" : "Nu versturen" })] }))] }));
|
|
64
|
+
}
|
|
65
|
+
function PreviewDialog({ g, onClose }) {
|
|
66
|
+
const fetchPreview = useServerFn(previewSignupMail);
|
|
67
|
+
const q = useQuery({
|
|
68
|
+
queryKey: ["afhandeling", "signup-preview", g.carrier_id, g.pickup_date, g.pickup_moment_key],
|
|
69
|
+
queryFn: () => fetchPreview({ data: { carrierId: g.carrier_id, pickupDate: g.pickup_date, momentKey: g.pickup_moment_key } }),
|
|
70
|
+
});
|
|
71
|
+
return (_jsx(Dialog, { open: true, onOpenChange: (o) => (!o ? onClose() : undefined), children: _jsxs(DialogContent, { className: "max-w-2xl", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Voorbeeld aanmeldmail" }), _jsxs(DialogDescription, { children: [q.data?.to ? _jsxs(_Fragment, { children: ["Gaat naar ", _jsx("strong", { children: q.data.to }), "."] }) : "Ontvanger wordt geladen…", q.data?.already_sent ? " Deze stand is al verstuurd." : null] })] }), q.isLoading ? _jsx("p", { className: "text-sm text-muted-foreground", children: "Laden\u2026" }) : null, q.data && !q.data.ok ? _jsx("p", { className: "text-sm text-destructive", children: signupReasonText(q.data.reason) }) : null, q.data?.ok ? (_jsxs("div", { className: "space-y-2", children: [_jsx("p", { className: "text-sm font-medium", children: q.data.subject }), _jsx("pre", { className: "max-h-[50vh] overflow-auto whitespace-pre-wrap rounded-md bg-muted p-3 text-xs", children: q.data.text })] })) : null] }) }));
|
|
72
|
+
}
|