@flowselections/floriday-afhandeling-module 1.0.99 → 1.0.102
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/AutoProcessStatus.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/AutoProcessStatus.js +3 -2
- package/dist-lib/components/afhandeling/AutoSendStatus.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/AutoSendStatus.js +4 -5
- package/dist-lib/components/afhandeling/CapacityWarning.js +1 -1
- package/dist-lib/components/afhandeling/ControlePage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/ControlePage.js +66 -45
- package/dist-lib/components/afhandeling/DagDetailDialog.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/DagDetailDialog.js +33 -17
- package/dist-lib/components/afhandeling/LeveringenPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/LeveringenPage.js +115 -5
- package/dist-lib/components/afhandeling/NuVersturenButton.d.ts +1 -0
- package/dist-lib/components/afhandeling/NuVersturenButton.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/NuVersturenButton.js +3 -7
- package/dist-lib/components/afhandeling/PickAgendaView.d.ts +7 -1
- package/dist-lib/components/afhandeling/PickAgendaView.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/PickAgendaView.js +39 -22
- package/dist-lib/components/afhandeling/PickingPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/PickingPage.js +4 -2
- package/dist-lib/components/afhandeling/PlanningAgendaPage.d.ts +2 -0
- package/dist-lib/components/afhandeling/PlanningAgendaPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/PlanningAgendaPage.js +16 -2
- package/dist-lib/components/afhandeling/ScanControleView.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/ScanControleView.js +2 -1
- package/dist-lib/components/afhandeling/ServiceAreaSelect.js +2 -2
- package/dist-lib/components/afhandeling/VervoerdersPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/VervoerdersPage.js +116 -9
- package/dist-lib/components/afhandeling/VerzetOrderDialog.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/VerzetOrderDialog.js +2 -1
- package/dist-lib/components/afhandeling/WeekAgendaView.d.ts +21 -1
- package/dist-lib/components/afhandeling/WeekAgendaView.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/WeekAgendaView.js +39 -30
- package/dist-lib/components/fs-ui/DataTable.d.ts +45 -0
- package/dist-lib/components/fs-ui/DataTable.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/DataTable.js +39 -0
- package/dist-lib/components/fs-ui/EmptyState.d.ts +9 -0
- package/dist-lib/components/fs-ui/EmptyState.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/EmptyState.js +5 -0
- package/dist-lib/components/fs-ui/FilterChips.d.ts +19 -0
- package/dist-lib/components/fs-ui/FilterChips.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/FilterChips.js +12 -0
- package/dist-lib/components/fs-ui/FilterPanel.d.ts +19 -0
- package/dist-lib/components/fs-ui/FilterPanel.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/FilterPanel.js +14 -0
- package/dist-lib/components/fs-ui/HoverTip.d.ts +15 -0
- package/dist-lib/components/fs-ui/HoverTip.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/HoverTip.js +24 -0
- package/dist-lib/components/fs-ui/InlineAlert.d.ts +17 -0
- package/dist-lib/components/fs-ui/InlineAlert.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/InlineAlert.js +27 -0
- package/dist-lib/components/fs-ui/KpiRow.d.ts +6 -0
- package/dist-lib/components/fs-ui/KpiRow.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/KpiRow.js +5 -0
- package/dist-lib/components/fs-ui/KpiTile.d.ts +21 -0
- package/dist-lib/components/fs-ui/KpiTile.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/KpiTile.js +40 -0
- package/dist-lib/components/fs-ui/MobilePrimaryAction.d.ts +7 -0
- package/dist-lib/components/fs-ui/MobilePrimaryAction.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/MobilePrimaryAction.js +7 -0
- package/dist-lib/components/fs-ui/PageHeader.d.ts +15 -0
- package/dist-lib/components/fs-ui/PageHeader.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/PageHeader.js +9 -0
- package/dist-lib/components/fs-ui/PeriodPicker.d.ts +10 -0
- package/dist-lib/components/fs-ui/PeriodPicker.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/PeriodPicker.js +7 -0
- package/dist-lib/components/fs-ui/PillTabs.d.ts +17 -0
- package/dist-lib/components/fs-ui/PillTabs.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/PillTabs.js +28 -0
- package/dist-lib/components/fs-ui/SearchInput.d.ts +8 -0
- package/dist-lib/components/fs-ui/SearchInput.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/SearchInput.js +28 -0
- package/dist-lib/components/fs-ui/ShortcutHelp.d.ts +10 -0
- package/dist-lib/components/fs-ui/ShortcutHelp.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/ShortcutHelp.js +17 -0
- package/dist-lib/components/fs-ui/StatusIcon.d.ts +7 -0
- package/dist-lib/components/fs-ui/StatusIcon.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/StatusIcon.js +9 -0
- package/dist-lib/components/fs-ui/TableSkeleton.d.ts +6 -0
- package/dist-lib/components/fs-ui/TableSkeleton.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/TableSkeleton.js +6 -0
- package/dist-lib/components/fs-ui/Toolbar.d.ts +12 -0
- package/dist-lib/components/fs-ui/Toolbar.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/Toolbar.js +11 -0
- package/dist-lib/components/fs-ui/UpdatedAt.d.ts +11 -0
- package/dist-lib/components/fs-ui/UpdatedAt.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/UpdatedAt.js +14 -0
- package/dist-lib/components/fs-ui/useShortcuts.d.ts +12 -0
- package/dist-lib/components/fs-ui/useShortcuts.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/useShortcuts.js +36 -0
- package/dist-lib/components/settings/AutomatischVersturenCard.d.ts +6 -0
- package/dist-lib/components/settings/AutomatischVersturenCard.d.ts.map +1 -0
- package/dist-lib/components/settings/AutomatischVersturenCard.js +54 -0
- package/dist-lib/hooks/useOrderPlanning.d.ts +1 -0
- package/dist-lib/hooks/useOrderPlanning.d.ts.map +1 -1
- package/dist-lib/hooks/useOrderPlanning.js +2 -0
- package/dist-lib/integrations/supabase/types.d.ts +833 -1
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/cartControl.functions.js +1 -1
- package/dist-lib/lib/dateLabels.d.ts +9 -0
- package/dist-lib/lib/dateLabels.d.ts.map +1 -0
- package/dist-lib/lib/dateLabels.js +45 -0
- package/dist-lib/lib/floridayAutoProcess.js +2 -2
- package/dist-lib/lib/floridayLoading.functions.js +5 -5
- package/dist-lib/lib/labels.d.ts +80 -0
- package/dist-lib/lib/labels.d.ts.map +1 -0
- package/dist-lib/lib/labels.js +87 -0
- package/dist-lib/lib/labels.test.d.ts +2 -0
- package/dist-lib/lib/labels.test.d.ts.map +1 -0
- package/dist-lib/lib/labels.test.js +21 -0
- package/dist-lib/lib/signupMailText.js +1 -1
- package/dist-lib/moduleDefinition.d.ts.map +1 -1
- package/dist-lib/moduleDefinition.js +2 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoProcessStatus.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/AutoProcessStatus.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AutoProcessStatus.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/AutoProcessStatus.tsx"],"names":[],"mappings":"AAaA,UAAU,KAAK;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,oEAAoE;IACpE,eAAe,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC9B,+DAA+D;IAC/D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAeD,wBAAgB,iBAAiB,CAAC,EAChC,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,kBAAyB,EACzB,OAAe,GAChB,EAAE,KAAK,+BAuLP"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
+
import { fmtDay } from "../../lib/dateLabels.js";
|
|
3
4
|
import { useQueryClient } from "@tanstack/react-query";
|
|
4
5
|
import { Badge, Button, toast } from "@flowselections/core";
|
|
5
6
|
import { CheckCircle2, Clock, Loader2, PlayCircle, RefreshCw, AlertTriangle } from "lucide-react";
|
|
@@ -62,7 +63,7 @@ export function AutoProcessStatus({ salesOrderId, orderRef, autoProcessDate, all
|
|
|
62
63
|
}
|
|
63
64
|
else {
|
|
64
65
|
const d = res.moment
|
|
65
|
-
?
|
|
66
|
+
? fmtDay(res.moment.date)
|
|
66
67
|
: null;
|
|
67
68
|
toast.success(d
|
|
68
69
|
? `Ingepland op ${d}${res.moment?.time ? ` om ${res.moment.time}` : ""}`
|
|
@@ -99,7 +100,7 @@ export function AutoProcessStatus({ salesOrderId, orderRef, autoProcessDate, all
|
|
|
99
100
|
const reached = !autoProcessDate || now >= autoProcessDate;
|
|
100
101
|
let badge;
|
|
101
102
|
if (status === "done") {
|
|
102
|
-
badge = (_jsxs(Badge, { variant: "secondary", className: "gap-1 bg-
|
|
103
|
+
badge = (_jsxs(Badge, { variant: "secondary", className: "gap-1 bg-primary/10 text-primary", children: [_jsx(CheckCircle2, { className: "h-3 w-3" }), " Afleverbrief klaar"] }));
|
|
103
104
|
}
|
|
104
105
|
else if (status === "error") {
|
|
105
106
|
badge = (_jsxs(Badge, { variant: "destructive", className: "gap-1", children: [_jsx(AlertTriangle, { className: "h-3 w-3" }), " Fout \u2014 ", row?.error?.slice(0, 40) ?? "onbekend"] }));
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,sCAkDlG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery } from "@tanstack/react-query";
|
|
3
3
|
import { supabase } from "../../integrations/supabase/moduleClient.js";
|
|
4
4
|
/** Tijdzone van de vestiging uit de Werktijden-instelling (alleen lezen); null = onbekend. */
|
|
@@ -77,10 +77,9 @@ export function AutoSendStatus({ orderId, orderRef }) {
|
|
|
77
77
|
: "Automatisch versturen lukt nog niet. Je kunt op ‘Nu versturen’ drukken.";
|
|
78
78
|
tone = "text-destructive";
|
|
79
79
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
80
|
+
// De volledige stand van automatisch versturen staat bij Instellingen (alleen beheer);
|
|
81
|
+
// hier alleen "verstuurd" of één rustige regel bij een storing.
|
|
83
82
|
if (!tekst)
|
|
84
83
|
return null;
|
|
85
|
-
return (
|
|
84
|
+
return (_jsx("span", { className: `text-xs ${tone}`, children: tekst }));
|
|
86
85
|
}
|
|
@@ -8,5 +8,5 @@ import { capacityWarningText } from "../../lib/logisticsEngine/capacity.js";
|
|
|
8
8
|
export function CapacityWarning({ day, className = "", }) {
|
|
9
9
|
if (!day || day.shortageMinutes <= 0)
|
|
10
10
|
return null;
|
|
11
|
-
return (_jsxs("div", { role: "alert", className: `flex items-start gap-2 rounded-md border border-
|
|
11
|
+
return (_jsxs("div", { role: "alert", className: `flex items-start gap-2 rounded-md border border-border bg-warning-soft px-3 py-2 text-sm text-warning-soft-foreground ${className}`, children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0" }), _jsx("span", { children: capacityWarningText(day) })] }));
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlePage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/ControlePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlePage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/ControlePage.tsx"],"names":[],"mappings":"AAkKA,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CAAO,+BAw5BpE"}
|
|
@@ -2,8 +2,20 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useAfhandelingDefaults } from "../../hooks/useAfhandelingDefaults.js";
|
|
3
3
|
import { ophaalTekst } from "../../lib/pickupMoment.js";
|
|
4
4
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
-
import { Button, Card, Checkbox, Dialog, DialogDescription, DialogTitle, Input, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Textarea, Badge, toast,
|
|
6
|
-
import { Printer, CheckCircle2, AlertTriangle, History,
|
|
5
|
+
import { Button, Card, Checkbox, Dialog, DialogDescription, DialogTitle, Input, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Textarea, Badge, toast, } from "@flowselections/core";
|
|
6
|
+
import { Printer, CheckCircle2, AlertTriangle, History, ScanLine, Package } from "lucide-react";
|
|
7
|
+
import { PageHeader } from "../fs-ui/PageHeader.js";
|
|
8
|
+
import { InlineAlert, NoticeStack } from "../fs-ui/InlineAlert.js";
|
|
9
|
+
import { EmptyState } from "../fs-ui/EmptyState.js";
|
|
10
|
+
import { StatusIcon } from "../fs-ui/StatusIcon.js";
|
|
11
|
+
import { TableSkeleton } from "../fs-ui/TableSkeleton.js";
|
|
12
|
+
import { Cell2, Pagination } from "../fs-ui/DataTable.js";
|
|
13
|
+
import { fmtDay } from "../../lib/dateLabels.js";
|
|
14
|
+
import { CalendarDays, Truck } from "lucide-react";
|
|
15
|
+
import { UpdatedAt } from "../fs-ui/UpdatedAt.js";
|
|
16
|
+
import { PillTabs } from "../fs-ui/PillTabs.js";
|
|
17
|
+
import { KpiRow } from "../fs-ui/KpiRow.js";
|
|
18
|
+
import { KpiTile } from "../fs-ui/KpiTile.js";
|
|
7
19
|
import { ResponsiveDialogBody, ResponsiveDialogContent, ResponsiveDialogFooter, ResponsiveDialogHeader, } from "../ui/responsive-dialog.js";
|
|
8
20
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
9
21
|
import { useServerFn } from "@tanstack/react-start";
|
|
@@ -39,7 +51,7 @@ function relDayLabel(iso) {
|
|
|
39
51
|
return `over ${diff} dagen`;
|
|
40
52
|
if (diff < -1)
|
|
41
53
|
return `${Math.abs(diff)} dagen geleden`;
|
|
42
|
-
return d
|
|
54
|
+
return fmtDay(d);
|
|
43
55
|
}
|
|
44
56
|
function fmtDate(iso) {
|
|
45
57
|
if (!iso)
|
|
@@ -519,49 +531,58 @@ export function ControlePage({ onExit } = {}) {
|
|
|
519
531
|
const pendingNotReadyCount = pendingProposals.length + pendingBlocked.length;
|
|
520
532
|
const criticalTomorrowCount = pendingProposals.filter((p) => isTomorrowIso(p.pickupDate)).length +
|
|
521
533
|
pendingBlocked.filter((b) => isTomorrowIso(b.pickupDate)).length;
|
|
522
|
-
return (_jsxs("main", { className: "
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
}
|
|
539
|
-
toast.success("Controlelijst naar de printer gestuurd.");
|
|
534
|
+
return (_jsxs("main", { className: "flex w-full min-w-0 flex-col gap-4 overflow-x-clip p-4 pb-[calc(7rem+env(safe-area-inset-bottom))] sm:p-6 sm:pb-24", children: [_jsx(PageHeader, { title: "Controle", updatedAt: _jsx(UpdatedAt, { at: cartsQ.dataUpdatedAt || null, info: "Dagelijkse eindcontrole van de karren van vandaag." }), period: _jsxs("span", { className: "inline-flex h-10 items-center gap-2 rounded-md border border-border bg-card px-3 text-sm font-medium tabular-nums text-foreground sm:h-9", children: [_jsx(CalendarDays, { className: "h-4 w-4 text-muted-foreground", "aria-hidden": true }), fmtDay(new Date())] }), actions: _jsxs(_Fragment, { children: [_jsxs(Button, { variant: "outline", size: "sm", "aria-label": "Controlelijst afdrukken", className: "h-10 w-10 p-0 sm:h-9 sm:w-auto sm:px-3", disabled: printBezig || carts.length === 0, onClick: async () => {
|
|
535
|
+
setPrintBezig(true);
|
|
536
|
+
try {
|
|
537
|
+
const documentnaam = `CTRL-${new Date().toISOString().slice(0, 10)}`;
|
|
538
|
+
const res = await callServerFn(() => printControleLijstFn({
|
|
539
|
+
data: { payload: bouwControleLijstPayload(carts), documentnaam },
|
|
540
|
+
}), "printControleLijstViaLayout");
|
|
541
|
+
if (res.route === "fout")
|
|
542
|
+
throw new Error(res.melding);
|
|
543
|
+
if (res.route === "terugval") {
|
|
544
|
+
await printHtmlDocument({
|
|
545
|
+
documenttype: "controlelijst",
|
|
546
|
+
documentnaam,
|
|
547
|
+
html: renderControleLijstHtml(carts, "nl"),
|
|
548
|
+
papierformaat: "A4",
|
|
549
|
+
});
|
|
540
550
|
}
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
551
|
+
toast.success("Controlelijst naar de printer gestuurd.");
|
|
552
|
+
}
|
|
553
|
+
catch (err) {
|
|
554
|
+
toast.error(printFoutMelding(err));
|
|
555
|
+
}
|
|
556
|
+
finally {
|
|
557
|
+
setPrintBezig(false);
|
|
558
|
+
}
|
|
559
|
+
}, children: [_jsx(Printer, { className: "h-4 w-4 sm:mr-2" }), _jsx("span", { className: "hidden sm:inline", children: printBezig ? "Bezig met printen…" : "Controlelijst afdrukken" })] }), _jsxs(Button, { size: "sm", className: "hidden sm:inline-flex", onClick: runControl, disabled: submitM.isPending || proposalM.isPending || carts.length === 0 || tab !== "controle", children: [_jsx(CheckCircle2, { className: "mr-2 h-4 w-4" }), proposalM.isPending ? "Controleren…" : "Controle uitvoeren"] })] }) }), _jsx(NoticeStack, { children: [
|
|
560
|
+
cartsQ.isError ? (_jsx(InlineAlert, { tone: "error", title: "De karren konden niet worden opgehaald", action: _jsx(Button, { size: "sm", variant: "outline", onClick: () => void cartsQ.refetch(), children: "Opnieuw proberen" }), children: "Blijft dit gebeuren, vraag dan de beheerder." }, "e")) : null,
|
|
561
|
+
!cartsQ.isError && cartsQ.data && (cartsQ.data.warnings ?? []).length > 0 ? (_jsxs(InlineAlert, { tone: "warning", title: "Niet alle gegevens konden worden opgehaald", details: (cartsQ.data.warnings ?? []).map((w) => _jsx("p", { children: w }, w)), children: [(cartsQ.data.warnings ?? []).length, " ", (cartsQ.data.warnings ?? []).length === 1 ? "melding" : "meldingen"] }, "w")) : null,
|
|
562
|
+
] }), _jsxs(KpiRow, { children: [_jsx(KpiTile, { title: "Karren vandaag", icon: _jsx(Package, {}), loading: cartsQ.isLoading, value: stats.total, sub: "te controleren" }), _jsx(KpiTile, { title: "Geprint", icon: _jsx(Printer, {}), loading: cartsQ.isLoading, value: stats.printed, sub: "pakbon gemaakt" }), _jsx(KpiTile, { title: "Aangevinkt", icon: _jsx(CheckCircle2, {}), loading: cartsQ.isLoading, value: stats.checked, sub: "klaar voor controle" }), _jsx(KpiTile, { title: "Nog niet gereed", icon: _jsx(AlertTriangle, {}), loading: cartsQ.isLoading, value: Math.max(0, stats.total - stats.checked), tone: stats.total - stats.checked > 0 ? "warning" : "default", sub: "nog niet aangevinkt" })] }), _jsx(PillTabs, { ariaLabel: "Controle", value: tab, onChange: (v) => setTab(v), tabs: [
|
|
563
|
+
{ value: "controle", label: "Controle", icon: _jsx(CheckCircle2, {}), count: stats.total },
|
|
564
|
+
{ value: "scan", label: "Scancontrole", icon: _jsx(ScanLine, {}) },
|
|
565
|
+
{ value: "afgeleverd", label: "Afgeleverd", icon: _jsx(Truck, {}) },
|
|
566
|
+
{ value: "historie", label: "Historie", icon: _jsx(History, {}) },
|
|
567
|
+
] }), tab === "controle" && (_jsxs(_Fragment, { children: [cartsQ.isLoading ? (_jsx(TableSkeleton, { columns: 5, rows: 5 })) : !cartsQ.isError && carts.length === 0 ? (_jsx(EmptyState, { icon: _jsx(Package, { className: "h-7 w-7" }), title: "Geen karren", text: (cartsQ.data?.rpcCount ?? 0) > 0
|
|
568
|
+
? `De planning gaf ${cartsQ.data?.rpcCount} karren voor vandaag, maar geen daarvan hoort nog bij een openstaande bestelling.`
|
|
569
|
+
: "De planning heeft voor vandaag geen karren om te controleren." })) : carts.length > 0 ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "w-full min-w-0 overflow-clip rounded-xl border border-border bg-card shadow-sm", children: [_jsx("div", { className: "hidden max-h-[calc(100dvh-7rem)] overflow-auto md:block xl:max-h-none xl:overflow-visible", children: _jsxs("table", { className: "w-full min-w-[900px] table-fixed caption-bottom text-left text-sm [&_thead_th]:sticky [&_thead_th]:top-0 [&_thead_th]:z-10 [&_thead_th]:h-10 [&_thead_th]:bg-card [&_thead_th]:px-2 [&_thead_th]:text-[11px] [&_thead_th]:font-semibold [&_thead_th]:uppercase [&_thead_th]:tracking-wide [&_thead_th]:text-muted-foreground", children: [_jsxs("colgroup", { children: [_jsx("col", { style: { width: "44px" } }), _jsx("col", {}), _jsx("col", { style: { width: "160px" } }), _jsx("col", { style: { width: "240px" } }), _jsx("col", { style: { width: "140px" } })] }), _jsx("thead", { children: _jsxs("tr", { className: "border-b border-border", children: [_jsx("th", { className: "align-middle", children: _jsx(Checkbox, { "aria-label": "Alles op deze pagina selecteren", checked: pagedCarts.length > 0 &&
|
|
570
|
+
pagedCarts.every((c) => checked.has(controlCartKey(c)))
|
|
571
|
+
? true
|
|
572
|
+
: pagedCarts.some((c) => checked.has(controlCartKey(c)))
|
|
573
|
+
? "indeterminate"
|
|
574
|
+
: false, onCheckedChange: (v) => toggleAll(!!v) }) }), _jsx("th", { className: "align-middle", children: "Order" }), _jsx("th", { className: "align-middle", children: "Karnummer" }), _jsx("th", { className: "align-middle", children: "Gepland" }), _jsx("th", { className: "align-middle", children: "Pakbon" })] }) }), _jsx("tbody", { children: pagedCarts.map((c) => {
|
|
575
|
+
const k = controlCartKey(c);
|
|
576
|
+
const sel = checked.has(k);
|
|
577
|
+
const printed = c.printedToday ?? (c.printedCount ?? 0) > 0;
|
|
578
|
+
const late = !!c.originalPickDate && c.originalPickDate < c.pickDate;
|
|
579
|
+
return (_jsxs("tr", { style: { height: 60 }, className: "border-b border-border last:border-0 hover:bg-muted/50", children: [_jsxs("td", { className: "relative px-2 py-0 align-middle", children: [sel && _jsx("span", { "aria-hidden": true, className: "absolute inset-y-0 left-0 w-[3px] bg-primary" }), _jsx(Checkbox, { "aria-label": `Selecteer ${c.orderNumber || "kar"}`, checked: sel, onCheckedChange: (v) => toggle(k, !!v) })] }), _jsx("td", { className: "truncate px-2 py-0 align-middle", children: _jsx(Cell2, { main: c.orderNumber || "—", sub: `kar ${c.cartSeq} van ${c.cartTotal ?? c.cartSeq}` }) }), _jsx("td", { className: "truncate px-2 py-0 align-middle tabular-nums", children: c.cartNumber ?? "—" }), _jsx("td", { className: "truncate px-2 py-0 align-middle", children: _jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [late && _jsx(StatusIcon, { tone: "error", label: "Achterstand: oorspronkelijk eerder gepland" }), _jsx(Cell2, { main: c.originalPickDate ? fmtDay(c.originalPickDate) : "—", sub: c.pickupTime ? ophaalTekst(c) : undefined })] }) }), _jsx("td", { className: "truncate px-2 py-0 align-middle", children: _jsxs("span", { className: "inline-flex items-center gap-1.5", children: [_jsx(StatusIcon, { tone: printed ? "done" : "open", label: printed ? "Pakbon geprint" : "Pakbon nog niet geprint" }), _jsx("span", { className: "text-sm", children: printed ? "Geprint" : "Niet geprint" })] }) })] }, k));
|
|
580
|
+
}) })] }) }), _jsx("div", { className: "divide-y divide-border md:hidden", children: pagedCarts.map((c) => {
|
|
581
|
+
const k = controlCartKey(c);
|
|
582
|
+
const sel = checked.has(k);
|
|
583
|
+
const printed = c.printedToday ?? (c.printedCount ?? 0) > 0;
|
|
584
|
+
return (_jsxs("label", { className: "relative flex items-center gap-3 p-4", children: [sel && _jsx("span", { "aria-hidden": true, className: "absolute inset-y-0 left-0 w-[3px] bg-primary" }), _jsx(Checkbox, { checked: sel, onCheckedChange: (v) => toggle(k, !!v) }), _jsx("div", { className: "min-w-0 flex-1", children: _jsx(Cell2, { main: `${c.orderNumber || "—"} · kar ${c.cartNumber ?? "—"}`, sub: [c.originalPickDate ? fmtDay(c.originalPickDate) : null, c.pickupTime ? ophaalTekst(c) : null].filter(Boolean).join(" · ") }) }), _jsx(StatusIcon, { tone: printed ? "done" : "open", label: printed ? "Pakbon geprint" : "Pakbon nog niet geprint" })] }, k));
|
|
585
|
+
}) })] }), _jsx(Pagination, { page: currentPage, totalPages: pageCount, totalCount: carts.length, pageSize: pageSize, pageSizes: [10, 20, 50, 100], onPage: setPage, onPageSize: (n) => { setPageSize(n); setPage(1); } })] })) : null, _jsxs("div", { className: "max-w-xl", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("label", { className: "text-sm font-medium", children: "Opmerkingen bij deze controle" }), _jsx("span", { className: "text-xs text-muted-foreground", "aria-live": "polite", children: savingState === "saving"
|
|
565
586
|
? "Opslaan…"
|
|
566
587
|
: savingState === "saved"
|
|
567
588
|
? "Voortgang automatisch opgeslagen"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DagDetailDialog.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/DagDetailDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DagDetailDialog.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/DagDetailDialog.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAwMjE,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;IACtC,uFAAuF;IACvF,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAUD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,sCAG1D"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useContext, useMemo, useState } from "react";
|
|
3
|
+
import { label } from "../../lib/labels.js";
|
|
4
|
+
import { fmtDay, fmtDayTime } from "../../lib/dateLabels.js";
|
|
3
5
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
6
|
import { useServerFn } from "@tanstack/react-start";
|
|
5
|
-
import {
|
|
6
|
-
import { AlertTriangle, CalendarClock, CheckCircle2, ChevronDown, ChevronRight, Printer, Users } from "lucide-react";
|
|
7
|
+
import { Checkbox, Button, Dialog, DialogTitle, DialogDescription, Input, Tabs, TabsContent, TabsList, TabsTrigger, toast, } from "@flowselections/core";
|
|
8
|
+
import { AlertTriangle, CalendarClock, CheckCircle2, ChevronDown, ChevronRight, MoreVertical, Printer, Users } from "lucide-react";
|
|
9
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@flowselections/core";
|
|
7
10
|
import { useStickerMeldingen, useOrderArchived } from "../../hooks/useOrderMeldingen.js";
|
|
8
11
|
import { ResponsiveDialogBody, ResponsiveDialogContent, ResponsiveDialogFooter, ResponsiveDialogHeader, } from "../ui/responsive-dialog.js";
|
|
9
12
|
import { usePickAgenda } from "../../hooks/usePickAgenda.js";
|
|
@@ -16,6 +19,7 @@ import { getOrderLines, getDayCartContents, getOrderCartIds, getPakbonCartInfo,
|
|
|
16
19
|
import { printLayoutDocument, printPdfDocument, printFoutMelding, bewaakJobStatus, laadStatusFeed } from "../../lib/printing.js";
|
|
17
20
|
import { gedeeldeKarTekst } from "../../lib/extraPlaten.js";
|
|
18
21
|
import { NuVersturenButton } from "./NuVersturenButton.js";
|
|
22
|
+
import { StatusIcon } from "../fs-ui/StatusIcon.js";
|
|
19
23
|
import { AutoSendStatus } from "./AutoSendStatus.js";
|
|
20
24
|
import { SignupMailMoments } from "./SignupMailMoments.js";
|
|
21
25
|
import { getSignupOverview } from "../../lib/carrierSignup.functions.js";
|
|
@@ -103,7 +107,7 @@ function isCancelled(status) {
|
|
|
103
107
|
return s === "geannuleerd" || s === "cancelled" || s === "canceled";
|
|
104
108
|
}
|
|
105
109
|
function StatusBadge({ vg }) {
|
|
106
|
-
return (
|
|
110
|
+
return (_jsx("span", { className: "inline-flex flex-col items-start", children: _jsx(Badge, { variant: vg.variant, children: vg.label }) }));
|
|
107
111
|
}
|
|
108
112
|
function StickerMeldingen({ orderId }) {
|
|
109
113
|
const q = useStickerMeldingen(orderId);
|
|
@@ -251,7 +255,7 @@ function DagDetailContent({ open, date, planned, onOpenChange, basis = "pick", h
|
|
|
251
255
|
// Tel karren op unieke kar-id (gedeelde bufferkar één keer); rijen zonder id tellen los.
|
|
252
256
|
const signupFlags = useSignupFlags(dayKey ?? null);
|
|
253
257
|
const uniekeKarren = new Set(cartRows.map((c) => c.cartId ?? `zonder-id:${c.key}`)).size;
|
|
254
|
-
return (_jsx(SignupFlagCtx.Provider, { value: signupFlags, children: _jsx(HighlightCtx.Provider, { value: highlightOrderId ?? null, children: _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), " (", basis === "lever" ? "leverdag" : "pickdag", ")"] }), _jsxs(DialogDescription, { children: [basis === "lever" ? "Bestellingen die op deze dag worden geleverd. " : "Bestellingen die op deze dag worden gepickt. ", ordersOnDay.length, " ", ordersOnDay.length === 1 ? "bestelling" : "bestellingen", " \u00B7 ", uniekeKarren, " ", uniekeKarren === 1 ? "kar" : "karren", " \u00B7", " ", ordersOnDay.filter((o) => voortgang(o.status).done).length, " van ", ordersOnDay.length, " ", ordersOnDay.length === 1 ? "bestelling" : "bestellingen", " afgehandeld \u00B7 ", new Set(cartRows.filter((c) => voortgang(c.status).done).map((c) => c.cartId ?? `zonder-id:${c.key}`)).size, " van", " ", uniekeKarren, " ", uniekeKarren === 1 ? "kar" : "karren", " afgehandeld"] })] }), _jsxs(ResponsiveDialogBody, { children: [_jsx(DayCapacityWarning, { date: date }), engineDay.isError && (
|
|
258
|
+
return (_jsx(SignupFlagCtx.Provider, { value: signupFlags, children: _jsx(HighlightCtx.Provider, { value: highlightOrderId ?? null, children: _jsx(ShipStateCtx.Provider, { value: shipState, children: _jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(ResponsiveDialogContent, { size: "xl", className: "!left-auto !right-0 !top-0 !translate-x-0 !translate-y-0 h-[100dvh] !max-h-[100dvh] rounded-none border-y-0 border-r-0 shadow-lg sm:rounded-l-xl", style: { width: "min(64rem, 100vw)", maxWidth: "100vw" }, children: [_jsxs(ResponsiveDialogHeader, { children: [_jsxs(DialogTitle, { children: ["Dagdetails \u2014 ", NL_DATE.format(date), " (", basis === "lever" ? "leverdag" : "pickdag", ")"] }), _jsxs(DialogDescription, { children: [basis === "lever" ? "Bestellingen die op deze dag worden geleverd. " : "Bestellingen die op deze dag worden gepickt. ", ordersOnDay.length, " ", ordersOnDay.length === 1 ? "bestelling" : "bestellingen", " \u00B7 ", uniekeKarren, " ", uniekeKarren === 1 ? "kar" : "karren", " \u00B7", " ", ordersOnDay.filter((o) => voortgang(o.status).done).length, " van ", ordersOnDay.length, " ", ordersOnDay.length === 1 ? "bestelling" : "bestellingen", " afgehandeld \u00B7 ", new Set(cartRows.filter((c) => voortgang(c.status).done).map((c) => c.cartId ?? `zonder-id:${c.key}`)).size, " van", " ", uniekeKarren, " ", uniekeKarren === 1 ? "kar" : "karren", " afgehandeld"] })] }), _jsxs(ResponsiveDialogBody, { children: [_jsx(DayCapacityWarning, { date: date }), engineDay.isError && (_jsx("p", { className: "mb-2 text-xs text-destructive", children: "De orderlijst kon niet worden bijgewerkt; de lijst hieronder komt uit de planning. Probeer het later opnieuw." })), _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" }) })] }) }) }) }) }));
|
|
255
259
|
}
|
|
256
260
|
function BezettingCard({ date, cartsToday }) {
|
|
257
261
|
const queryClient = useQueryClient();
|
|
@@ -357,7 +361,7 @@ function isDubbeleAanvraag(err) {
|
|
|
357
361
|
}
|
|
358
362
|
function tijdLabel(iso) {
|
|
359
363
|
const d = new Date(iso);
|
|
360
|
-
return Number.isNaN(d.getTime()) ? iso : d
|
|
364
|
+
return Number.isNaN(d.getTime()) ? iso : fmtDayTime(d);
|
|
361
365
|
}
|
|
362
366
|
/** Na 60 s zonder voltooid: "printer reageert niet" met knop "Opnieuw" (als herprint). */
|
|
363
367
|
function bewaakPrint(jobId, naam, opnieuw) {
|
|
@@ -409,7 +413,7 @@ function meldPrintUitkomst(r) {
|
|
|
409
413
|
toast.error(`Er is niets in de Printwachtrij gezet. ${r.reasons[0] ?? ""}`.trim());
|
|
410
414
|
}
|
|
411
415
|
else if (r.failed > 0) {
|
|
412
|
-
toast.error(`${r.failed} document${r.failed === 1 ? "" : "en"} niet
|
|
416
|
+
toast.error(`${r.failed} document${r.failed === 1 ? "" : "en"} niet naar de printer gestuurd: ${r.reasons[0] ?? ""}`);
|
|
413
417
|
}
|
|
414
418
|
}
|
|
415
419
|
async function meldAchtergrond(r) {
|
|
@@ -638,11 +642,11 @@ function BufferGroup({ bufferId, orders: dayOrders }) {
|
|
|
638
642
|
}
|
|
639
643
|
}
|
|
640
644
|
if (ok > 0)
|
|
641
|
-
toast.success(`${ok} van ${refs.length} bestelling${refs.length === 1 ? "" : "en"} uit deze
|
|
645
|
+
toast.success(`${ok} van ${refs.length} bestelling${refs.length === 1 ? "" : "en"} uit deze gezamenlijke levering afgehandeld (verzonden).`);
|
|
642
646
|
if (failed.length > 0)
|
|
643
647
|
toast.error(`Niet afgehandeld: ${failed.join(" · ")}`);
|
|
644
648
|
if (ok === 0 && failed.length === 0)
|
|
645
|
-
toast.error("Er is niets afgehandeld:
|
|
649
|
+
toast.error("Er is niets afgehandeld: deze gezamenlijke levering heeft geen orders.");
|
|
646
650
|
for (const key of [
|
|
647
651
|
["logistics-pick-agenda"],
|
|
648
652
|
["engine"],
|
|
@@ -681,7 +685,10 @@ function BufferGroup({ bufferId, orders: dayOrders }) {
|
|
|
681
685
|
setPrinting(false);
|
|
682
686
|
}
|
|
683
687
|
};
|
|
684
|
-
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: "
|
|
688
|
+
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: "Gezamenlijke levering" }), _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 orders van deze gezamenlijke levering in \u00E9\u00E9n keer afhandelen", children: [_jsx(CheckCircle2, { className: "mr-1 h-3.5 w-3.5" }), alleAf ? "Afgehandeld" : busy ? "Bezig…" : "Hele levering afhandelen (verzonden)"] }), refs[0] && alleFloriday && !alleAf ? _jsx(NuVersturenButton, { orderRef: refs[0], label: "Belading versturen" }) : null, _jsx(DagActiesMenu, { label: "Meer acties voor deze gezamenlijke levering", items: [
|
|
689
|
+
{ label: printing ? "In de Printwachtrij…" : "Documenten afdrukken", icon: _jsx(Printer, { className: "mr-2 h-4 w-4" }), disabled: printing, onSelect: () => void printAlles() },
|
|
690
|
+
{ label: "Verzetten", icon: _jsx(CalendarClock, { className: "mr-2 h-4 w-4" }), onSelect: () => setVerzetOpen(true) },
|
|
691
|
+
] })] })] }), open && (_jsx("div", { className: "space-y-2 border-t border-primary/30 px-2 py-2", children: orders.map((o) => (_jsxs("div", { className: "space-y-1", children: [o.planned ? (_jsx(OrderRow, { planned: o.planned, cartsToday: o.carts, engineStatus: o.status })) : (_jsx(EngineOrderRow, { order: o })), _jsx(ZonderKarRegel, { order: o })] }, o.ref))) })), _jsx(BulkVerzetDialog, { open: verzetOpen, orders: verzetOrders, cartCount: carts, onOpenChange: setVerzetOpen, onDone: () => setVerzetOpen(false) })] }));
|
|
685
692
|
}
|
|
686
693
|
/** Bestelling die alleen de Engine kent; verdere ordergegevens ontbreken. */
|
|
687
694
|
/** Knop "Afhandelen (verzonden)" — zet de bestelling in de orderadministratie op Verzonden. */
|
|
@@ -734,7 +741,7 @@ function SignupFlagLabel({ orderId }) {
|
|
|
734
741
|
if (!flag)
|
|
735
742
|
return null;
|
|
736
743
|
if (flag === "floriday")
|
|
737
|
-
return _jsx("div", { className: "text-xs font-medium text-primary", children: "Afgehandeld
|
|
744
|
+
return _jsx("div", { className: "text-xs font-medium text-primary", children: "Afgehandeld (gekoppeld met Floriday)" });
|
|
738
745
|
return (_jsx("div", { className: "text-xs font-medium text-destructive", children: flag === "late" ? "Te laat aangemeld bij de vervoerder" : "Heeft nog geen karindeling en is nog niet aangemeld bij de vervoerder" }));
|
|
739
746
|
}
|
|
740
747
|
function OrderRow({ planned: p, cartsToday, engineStatus, }) {
|
|
@@ -778,12 +785,12 @@ function OrderRow({ planned: p, cartsToday, engineStatus, }) {
|
|
|
778
785
|
}
|
|
779
786
|
};
|
|
780
787
|
const highlighted = useContext(HighlightCtx) === p.order.id;
|
|
781
|
-
return (_jsxs("div", { className: `rounded-lg border bg-card ${highlighted ? "ring-2 ring-primary" : ""}`, ref: highlighted ? (el) => el?.scrollIntoView({ block: "center" }) : undefined, 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(SignupFlagLabel, { orderId: p.order.id }), _jsx("div", { className: "truncate text-xs text-muted-foreground", children: p.order.customerName })] }),
|
|
782
|
-
?
|
|
783
|
-
: "—" })] })] }), _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 }),
|
|
784
|
-
|
|
785
|
-
setVerzetOpen(true)
|
|
786
|
-
|
|
788
|
+
return (_jsxs("div", { className: `rounded-lg border bg-card ${highlighted ? "ring-2 ring-primary" : ""}`, ref: highlighted ? (el) => el?.scrollIntoView({ block: "center" }) : undefined, 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(SignupFlagLabel, { orderId: p.order.id }), _jsx("div", { className: "truncate text-xs text-muted-foreground", children: p.order.customerName })] }), _jsx("div", { className: "text-xs text-muted-foreground", children: _jsx("span", { className: "text-foreground", children: label("orderSource", p.order.deliveryType) }) }), _jsxs("div", { className: "text-xs text-muted-foreground", children: ["Leverdatum", " ", _jsx("span", { className: "text-foreground", children: p.order.deliveryDate
|
|
789
|
+
? fmtDay(p.order.deliveryDate)
|
|
790
|
+
: "—" })] })] }), _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 }), _jsx(DagActiesMenu, { label: `Meer acties voor ${p.order.orderNumber || "order"}`, items: [
|
|
791
|
+
{ label: printing ? "In de Printwachtrij…" : "Alle documenten afdrukken", icon: _jsx(Printer, { className: "mr-2 h-4 w-4" }), disabled: printing, onSelect: () => void handlePrintAll({ stopPropagation: () => { } }) },
|
|
792
|
+
{ label: "Verzetten", icon: _jsx(CalendarClock, { className: "mr-2 h-4 w-4" }), onSelect: () => setVerzetOpen(true) },
|
|
793
|
+
] })] })] }), _jsx(VerzetOrderDialog, { open: verzetOpen, orderRef: p.order.orderNumber, carrierTarget: {
|
|
787
794
|
carrierId: p.order.carrierId ?? null,
|
|
788
795
|
country: p.order.country ?? null,
|
|
789
796
|
province: p.order.province ?? null,
|
|
@@ -982,7 +989,7 @@ function KarRow({ cart: c, cartTotal, selected, onToggle, }) {
|
|
|
982
989
|
setBezig(null);
|
|
983
990
|
}
|
|
984
991
|
};
|
|
985
|
-
return (_jsxs("div", { className: `rounded-md border p-3 ${selected ? "border-primary bg-primary/5" : ""}`, children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx(Checkbox, { checked: selected, onCheckedChange: onToggle, className: "mt-1" }), _jsxs("div", { className: "grid flex-1 gap-3 lg:grid-cols-[1fr_1.4fr_1fr_auto] lg:items-center", children: [_jsx(Field, { label: "Karnummer", value: c.cartNumber }), _jsx(Field, { label: "Klant", value: c.customerName }), _jsx(Field, { label: "Bestelling", value: c.orderRef }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(Badge, { variant: voortgang(c.status).variant, children: voortgang(c.status).label }), c.coverageLabel && _jsx(Badge, { variant: "secondary", children: c.coverageLabel }), c.hasContent ? (_jsxs(_Fragment, { children: [c.shared && _jsx(Badge, { variant: "outline", children: "Gedeelde
|
|
992
|
+
return (_jsxs("div", { className: `rounded-md border p-3 ${selected ? "border-primary bg-primary/5" : ""}`, children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx(Checkbox, { checked: selected, onCheckedChange: onToggle, className: "mt-1" }), _jsxs("div", { className: "grid flex-1 gap-3 lg:grid-cols-[1fr_1.4fr_1fr_auto] lg:items-center", children: [_jsx(Field, { label: "Karnummer", value: c.cartNumber }), _jsx(Field, { label: "Klant", value: c.customerName }), _jsx(Field, { label: "Bestelling", value: c.orderRef }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(Badge, { variant: voortgang(c.status).variant, children: voortgang(c.status).label }), c.coverageLabel && _jsx(Badge, { variant: "secondary", children: c.coverageLabel }), c.hasContent ? (_jsxs(_Fragment, { children: [c.shared && _jsx(Badge, { variant: "outline", children: "Gedeelde kar" }), c.karTekst ? (_jsx(Badge, { variant: "outline", children: c.karTekst })) : (_jsxs(_Fragment, { children: [_jsxs(Badge, { variant: "outline", children: [c.layers ?? "—", c.maxLayers != null ? ` / ${c.maxLayers}` : "", " lagen"] }), _jsx(Badge, { variant: "outline", children: c.platen == null ? "DC (platen onbekend)" : `DC + ${c.platen} ${c.platen === 1 ? "plaat" : "platen"}` }), _jsxs(Badge, { variant: "outline", children: [c.occupancy ?? "—", "%"] })] })), _jsxs(Badge, { variant: "outline", children: [c.crates ?? "—", " fusten"] }), _jsxs(Badge, { variant: "outline", children: [c.plants ?? "—", " planten"] })] })) : (_jsx(Badge, { variant: "outline", className: "text-muted-foreground", children: c.contentLoading ? "Karinhoud laden…" : c.coverageLabel ? "Geen kar in deze indeling" : "Nog geen karindeling" })), _jsxs(Button, { size: "sm", variant: "outline", disabled: bezig !== null, onClick: printPakbon, title: `Pakbon van deze kar opnieuw printen. ${AUTOMATISCH_DOCUMENT_TEKST}`, children: [_jsx(Printer, { className: "mr-1 h-3.5 w-3.5" }), bezig === "pakbon" ? "Bezig…" : "Pakbon"] }), _jsxs(Button, { size: "sm", variant: "outline", disabled: bezig !== null, onClick: printVerzendbrief, title: `Verzenddocument van deze bestelling printen. ${AUTOMATISCH_DOCUMENT_TEKST}`, children: [_jsx(Printer, { className: "mr-1 h-3.5 w-3.5" }), bezig === "brief" ? "Bezig…" : "Verzendbrief"] }), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => setVerzetOpen(true), title: "Ophaaldag of ophaaltijd van de bestelling van deze kar wijzigen", children: [_jsx(CalendarClock, { className: "mr-1 h-3.5 w-3.5" }), "Verzetten"] })] })] })] }), _jsx(VerzetOrderDialog, { open: verzetOpen, orderRef: c.orderRef, carrierTarget: {
|
|
986
993
|
carrierId: c.order?.order.carrierId ?? null,
|
|
987
994
|
country: c.order?.order.country ?? null,
|
|
988
995
|
province: c.order?.order.province ?? null,
|
|
@@ -997,3 +1004,12 @@ function DayCapacityWarning({ date }) {
|
|
|
997
1004
|
const { byDate } = useCapacityCheck(key, key);
|
|
998
1005
|
return _jsx(CapacityWarning, { day: byDate.get(key), className: "mb-3" });
|
|
999
1006
|
}
|
|
1007
|
+
/** Rijmenu "…" in Dagdetails (zelfde opmaak als RowMenu in Verkooporders). */
|
|
1008
|
+
function DagActiesMenu({ label, items, }) {
|
|
1009
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { "aria-label": label, onClick: (e) => e.stopPropagation(), className: "inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: _jsx(MoreVertical, { className: "h-4 w-4" }) }), _jsx(DropdownMenuContent, { align: "end", onClick: (e) => e.stopPropagation(), children: items.map((it) => (_jsxs(DropdownMenuItem, { disabled: it.disabled, onClick: () => !it.disabled && it.onSelect(), children: [it.icon, it.label] }, it.label))) })] }));
|
|
1010
|
+
}
|
|
1011
|
+
/** Status als rustige tekst met klein StatusIcon (geen gekleurde pillen). */
|
|
1012
|
+
function Badge({ variant, children }) {
|
|
1013
|
+
const tone = variant === "default" ? "done" : variant === "destructive" ? "error" : variant === "outline" ? "open" : null;
|
|
1014
|
+
return (_jsxs("span", { className: "inline-flex items-center gap-1.5 text-xs text-muted-foreground", children: [tone ? _jsx(StatusIcon, { tone: tone, label: typeof children === "string" ? children : "Status" }) : null, _jsx("span", { className: "text-foreground", children: children })] }));
|
|
1015
|
+
}
|
|
@@ -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":"AA6CA,wBAAgB,cAAc,gCAsM7B"}
|