@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,12 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useAfhandelingDefaults } from "../../hooks/useAfhandelingDefaults.js";
|
|
3
|
-
import { useEffect, useMemo, useState } from "react";
|
|
3
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { useShortcuts } from "../fs-ui/useShortcuts.js";
|
|
5
|
+
import { ShortcutHelp } from "../fs-ui/ShortcutHelp.js";
|
|
4
6
|
import { Button } from "@flowselections/core";
|
|
7
|
+
import { CalendarDays, Package, ShoppingCart, AlertTriangle, Clock, CheckCircle2, Truck, List } from "lucide-react";
|
|
8
|
+
import { PageHeader } from "../fs-ui/PageHeader.js";
|
|
9
|
+
import { KpiRow } from "../fs-ui/KpiRow.js";
|
|
10
|
+
import { KpiTile } from "../fs-ui/KpiTile.js";
|
|
11
|
+
import { InlineAlert, NoticeStack } from "../fs-ui/InlineAlert.js";
|
|
12
|
+
import { PillTabs } from "../fs-ui/PillTabs.js";
|
|
13
|
+
import { PeriodPicker } from "../fs-ui/PeriodPicker.js";
|
|
14
|
+
import { UpdatedAt } from "../fs-ui/UpdatedAt.js";
|
|
15
|
+
import { isExcludedOrderStatus, isFulfilledOrderStatus } from "../../lib/orderStatus.js";
|
|
5
16
|
import { WeekAgendaView } from "./WeekAgendaView.js";
|
|
6
17
|
import { DagDetailDialog } from "./DagDetailDialog.js";
|
|
7
18
|
import { useOrderPlanning } from "../../hooks/useOrderPlanning.js";
|
|
8
19
|
import { agendaRange, currentWeekStart } from "../../lib/agendaRange.js";
|
|
9
|
-
import { startOfWeek } from "../../lib/pickDate.js";
|
|
20
|
+
import { addDays, startOfWeek } from "../../lib/pickDate.js";
|
|
21
|
+
import { weekLabel, fmtDay } from "../../lib/dateLabels.js";
|
|
22
|
+
import { Toolbar, FiltersButton } from "../fs-ui/Toolbar.js";
|
|
23
|
+
import { SearchInput } from "../fs-ui/SearchInput.js";
|
|
24
|
+
import { FilterChips } from "../fs-ui/FilterChips.js";
|
|
25
|
+
import { FilterPanel, FilterOptions } from "../fs-ui/FilterPanel.js";
|
|
26
|
+
import { DataTable, Cell2 } from "../fs-ui/DataTable.js";
|
|
27
|
+
import { StatusIcon } from "../fs-ui/StatusIcon.js";
|
|
28
|
+
import { EmptyState } from "../fs-ui/EmptyState.js";
|
|
29
|
+
import { TableSkeleton } from "../fs-ui/TableSkeleton.js";
|
|
30
|
+
import { label } from "../../lib/labels.js";
|
|
31
|
+
import { classify } from "./WeekAgendaView.js";
|
|
10
32
|
/** Leest ?dag=JJJJ-MM-DD&order=<order_id> (link vanuit bv. Dashboards). */
|
|
11
33
|
function readLinkParams() {
|
|
12
34
|
const sp = new URLSearchParams(window.location.search);
|
|
@@ -17,14 +39,26 @@ function readLinkParams() {
|
|
|
17
39
|
const orderId = order && /^[0-9a-f-]{36}$/i.test(order) ? order : null;
|
|
18
40
|
return { day: day && !Number.isNaN(day.getTime()) ? day : null, orderId };
|
|
19
41
|
}
|
|
42
|
+
const EMPTY_TOTALS = { leveringen: 0, verzendklaar: 0, voorbereiding: 0, totaalStuks: 0, afgehandeld: 0, nietAfgemeld: 0, karren: 0 };
|
|
20
43
|
export function LeveringenPage() {
|
|
21
44
|
useAfhandelingDefaults();
|
|
22
45
|
const [weekStart, setWeekStart] = useState(() => currentWeekStart());
|
|
23
46
|
const range = useMemo(() => agendaRange(weekStart), [weekStart]);
|
|
24
|
-
const { planned, nearestDeliveryDate, isLoading, error, warning, refetch } = useOrderPlanning(range);
|
|
47
|
+
const { planned, nearestDeliveryDate, isLoading, error, warning, refetch, dataUpdatedAt } = useOrderPlanning(range);
|
|
25
48
|
const [dayDetailDate, setDayDetailDate] = useState(null);
|
|
26
49
|
const [highlightOrderId, setHighlightOrderId] = useState(null);
|
|
27
50
|
const [linkDay, setLinkDay] = useState(null);
|
|
51
|
+
const [tab, setTab] = useState("alle");
|
|
52
|
+
const [totals, setTotals] = useState(EMPTY_TOTALS);
|
|
53
|
+
const onTotals = useCallback((t) => setTotals(t), []);
|
|
54
|
+
const [search, setSearch] = useState("");
|
|
55
|
+
const [filtersOpen, setFiltersOpen] = useState(false);
|
|
56
|
+
const [fLand, setFLand] = useState(null);
|
|
57
|
+
const [fPlan, setFPlan] = useState(null);
|
|
58
|
+
const [fBron, setFBron] = useState(null);
|
|
59
|
+
const [sel, setSel] = useState(null);
|
|
60
|
+
const [help, setHelp] = useState(false);
|
|
61
|
+
const searchRef = useRef(null);
|
|
28
62
|
useEffect(() => {
|
|
29
63
|
const { day, orderId } = readLinkParams();
|
|
30
64
|
if (day) {
|
|
@@ -34,5 +68,81 @@ export function LeveringenPage() {
|
|
|
34
68
|
setHighlightOrderId(orderId);
|
|
35
69
|
}
|
|
36
70
|
}, []);
|
|
37
|
-
|
|
71
|
+
const actief = planned.filter((p) => !isExcludedOrderStatus(p.order.status));
|
|
72
|
+
const karren = actief.reduce((n, p) => n + (p.order.cartCount ?? 0), 0);
|
|
73
|
+
const open = actief.filter((p) => !isFulfilledOrderStatus(p.order.status)).length;
|
|
74
|
+
const zonderPlanning = actief.filter((p) => p.state !== "planned").length;
|
|
75
|
+
const today = new Date();
|
|
76
|
+
const q = search.trim().toLowerCase();
|
|
77
|
+
const landen = Array.from(new Set(actief.map((p) => p.order.country).filter((c) => !!c))).sort();
|
|
78
|
+
const tabMatch = (b) => tab === "alle" ? true : tab === "afgehandeld" ? b === "afgehandeld" || b === "niet_afgemeld" : b === tab;
|
|
79
|
+
const rows = actief
|
|
80
|
+
.filter((p) => {
|
|
81
|
+
if (!tabMatch(classify(p.order, false)))
|
|
82
|
+
return false;
|
|
83
|
+
if (q && !`${p.order.orderNumber} ${p.order.customerName} ${p.order.city ?? ""}`.toLowerCase().includes(q))
|
|
84
|
+
return false;
|
|
85
|
+
if (fLand && p.order.country !== fLand)
|
|
86
|
+
return false;
|
|
87
|
+
if (fPlan && (fPlan === "ja") !== (p.state === "planned"))
|
|
88
|
+
return false;
|
|
89
|
+
if (fBron && p.order.deliveryType !== fBron)
|
|
90
|
+
return false;
|
|
91
|
+
return true;
|
|
92
|
+
})
|
|
93
|
+
.sort((a, b) => (a.order.deliveryDate ?? "").localeCompare(b.order.deliveryDate ?? "") || a.order.orderNumber.localeCompare(b.order.orderNumber));
|
|
94
|
+
const chips = [
|
|
95
|
+
fLand && { key: "land", label: fLand },
|
|
96
|
+
fPlan && { key: "plan", label: fPlan === "ja" ? "Gepland" : "Nog niet gepland" },
|
|
97
|
+
fBron && { key: "bron", label: label("orderSource", fBron) },
|
|
98
|
+
].filter(Boolean);
|
|
99
|
+
const clearFilters = () => { setFLand(null); setFPlan(null); setFBron(null); };
|
|
100
|
+
const openOrder = (p) => {
|
|
101
|
+
const d = p.planning?.deliveryDate ?? (p.order.deliveryDate ? new Date(p.order.deliveryDate) : null);
|
|
102
|
+
if (!d)
|
|
103
|
+
return;
|
|
104
|
+
setHighlightOrderId(p.order.id);
|
|
105
|
+
setDayDetailDate(d);
|
|
106
|
+
};
|
|
107
|
+
const tone = (b) => (b === "afgehandeld" ? "done" : b === "verzendklaar" ? "done" : b === "niet_afgemeld" ? "busy" : "open");
|
|
108
|
+
useShortcuts({
|
|
109
|
+
onSearch: () => searchRef.current?.focus(),
|
|
110
|
+
onNext: () => setSel((i) => Math.min((i ?? -1) + 1, rows.length - 1)),
|
|
111
|
+
onPrev: () => setSel((i) => Math.max((i ?? 1) - 1, 0)),
|
|
112
|
+
onOpen: () => { const p = sel != null ? rows[sel] : null; if (p)
|
|
113
|
+
openOrder(p); },
|
|
114
|
+
onHelp: () => setHelp(true),
|
|
115
|
+
onEscape: () => { if (dayDetailDate)
|
|
116
|
+
return; if (search)
|
|
117
|
+
setSearch("");
|
|
118
|
+
else
|
|
119
|
+
setSel(null); },
|
|
120
|
+
});
|
|
121
|
+
const columns = [
|
|
122
|
+
{ key: "order", header: "Order", width: undefined, cell: (p) => _jsx(Cell2, { main: p.order.orderNumber || "Order", sub: p.order.customerName }) },
|
|
123
|
+
{ key: "dag", header: "Leverdag", width: 140, cell: (p) => _jsx("span", { className: "tabular-nums", children: fmtDay(p.planning?.deliveryDate ?? p.order.deliveryDate) }) },
|
|
124
|
+
{ key: "status", header: "Status", width: 220, cell: (p) => { const b = classify(p.order, false); return _jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [_jsx(StatusIcon, { tone: tone(b), label: label("orderBucket", b) }), _jsx("span", { className: "truncate", children: label("orderBucket", b) })] }); } },
|
|
125
|
+
{ key: "karren", header: "Karren", width: 100, cell: (p) => _jsx("span", { className: "tabular-nums", children: p.order.cartCount ?? "—" }) },
|
|
126
|
+
{ key: "stuks", header: "Stuks", width: 110, cell: (p) => _jsx("span", { className: "tabular-nums", children: p.order.plantCount != null ? `${p.order.plantCount.toLocaleString("nl-NL")} stuks` : "—" }) },
|
|
127
|
+
{ key: "plaats", header: "Plaats", width: 180, cell: (p) => _jsx(Cell2, { main: p.order.city || "—", sub: p.order.country || undefined }) },
|
|
128
|
+
{ key: "plan", header: "Planning", width: 150, cell: (p) => p.state === "planned" ? _jsx("span", { className: "text-muted-foreground", children: "Gepland" }) : _jsxs("span", { className: "flex items-center gap-2", children: [_jsx(StatusIcon, { tone: "busy", label: "Wacht op karindeling" }), "Nog niet gepland"] }) },
|
|
129
|
+
];
|
|
130
|
+
const thisWeek = currentWeekStart();
|
|
131
|
+
const isCurrent = startOfWeek(weekStart).getTime() === startOfWeek(thisWeek).getTime();
|
|
132
|
+
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: "Leveringen", updatedAt: _jsx(UpdatedAt, { at: dataUpdatedAt, info: "Planning van de orders per leverdag. Klik op een dag voor de details." }), period: _jsx(PeriodPicker, { label: weekLabel(weekStart), onPrev: () => setWeekStart((w) => addDays(w, -7)), onNext: () => setWeekStart((w) => addDays(w, 7)), onToday: () => setWeekStart(currentWeekStart()), todayLabel: "Deze week", isCurrent: isCurrent }) }), _jsx(NoticeStack, { children: [
|
|
133
|
+
error ? (_jsx(InlineAlert, { tone: "error", title: "De planning kon niet worden geladen", action: _jsx(Button, { size: "sm", variant: "outline", onClick: () => refetch(), children: "Opnieuw proberen" }), children: error }, "err")) : null,
|
|
134
|
+
warning && !error ? (_jsxs(InlineAlert, { tone: "warning", children: [warning, " De beschikbare orders blijven zichtbaar."] }, "warn")) : null,
|
|
135
|
+
totals.nietAfgemeld > 0 ? (_jsx(InlineAlert, { tone: "warning", title: `${totals.nietAfgemeld} afgehandeld, nog niet gemeld bij Floriday`, children: "Open de dag om de belading te versturen." }, "fl")) : null,
|
|
136
|
+
] }), _jsxs(KpiRow, { children: [_jsx(KpiTile, { title: "Orders deze week", icon: _jsx(ShoppingCart, {}), loading: isLoading, value: actief.length, sub: `${totals.totaalStuks.toLocaleString("nl-NL")} stuks` }), _jsx(KpiTile, { title: "Karren", icon: _jsx(Package, {}), loading: isLoading, value: karren, sub: "volgens de orders" }), _jsx(KpiTile, { title: "Nog af te handelen", icon: _jsx(CalendarDays, {}), loading: isLoading, value: open, sub: "klik voor vandaag", onClick: () => { setHighlightOrderId(null); setDayDetailDate(today); } }), _jsx(KpiTile, { title: "Nog niet gepland", icon: _jsx(AlertTriangle, {}), loading: isLoading, value: zonderPlanning, tone: zonderPlanning ? "warning" : "default", sub: zonderPlanning ? "wacht op karindeling" : "alles ingepland" })] }), _jsx(PillTabs, { ariaLabel: "Status", value: tab, onChange: setTab, tabs: [
|
|
137
|
+
{ value: "alle", label: "Alle", icon: _jsx(List, {}), count: totals.leveringen },
|
|
138
|
+
{ value: "voorbereiding", label: "In voorbereiding", icon: _jsx(Clock, {}), count: totals.voorbereiding },
|
|
139
|
+
{ value: "verzendklaar", label: "Verzendklaar", icon: _jsx(Truck, {}), count: totals.verzendklaar },
|
|
140
|
+
{ value: "afgehandeld", label: "Afgehandeld", icon: _jsx(CheckCircle2, {}), count: totals.afgehandeld },
|
|
141
|
+
] }), !error && (_jsx(WeekAgendaView, { planned: planned, mode: "delivery", isLoading: isLoading, weekStart: weekStart, onJump: setWeekStart, statusFilter: tab, onTotals: onTotals, onDayClick: (d) => { setHighlightOrderId(null); setDayDetailDate(d); }, jumpToDate: linkDay ?? nearestDeliveryDate })), _jsxs(Toolbar, { children: [_jsx(SearchInput, { ref: searchRef, value: search, onChange: (v) => { setSearch(v); setSel(null); }, placeholder: "Zoek order, klant of plaats" }), _jsx(FiltersButton, { count: chips.length, onClick: () => setFiltersOpen(true) }), _jsx(FilterChips, { chips: chips, onRemove: (k) => { if (k === "land")
|
|
142
|
+
setFLand(null); if (k === "plan")
|
|
143
|
+
setFPlan(null); if (k === "bron")
|
|
144
|
+
setFBron(null); }, onClearAll: clearFilters })] }), _jsxs(FilterPanel, { open: filtersOpen, onOpenChange: setFiltersOpen, onClear: chips.length ? clearFilters : undefined, children: [_jsx(FilterOptions, { title: "Planning", value: fPlan, options: [{ value: "ja", label: "Gepland" }, { value: "nee", label: "Nog niet gepland" }], onChange: setFPlan }), landen.length > 1 && _jsx(FilterOptions, { title: "Land", value: fLand, options: landen.map((l) => ({ value: l, label: l })), onChange: setFLand }), actief.some((p) => p.order.deliveryType === "Floriday") && (_jsx(FilterOptions, { title: "Herkomst", value: fBron, options: [{ value: "Mailbox", label: label("orderSource", "Mailbox") }, { value: "Floriday", label: label("orderSource", "Floriday") }], onChange: setFBron }))] }), isLoading ? (_jsx(TableSkeleton, { columns: 7, rows: 6 })) : !error && (_jsx(DataTable, { ariaLabel: "Orders deze week", columns: columns, rows: rows, rowKey: (p) => p.order.id, selectedIndex: sel, onRowClick: (p, i) => { setSel(i); openOrder(p); }, mobileCard: (p) => {
|
|
145
|
+
const b = classify(p.order, false);
|
|
146
|
+
return (_jsxs("div", { className: "flex min-w-0 items-start justify-between gap-3", children: [_jsx(Cell2, { main: p.order.orderNumber || "Order", sub: `${p.order.customerName} · ${fmtDay(p.planning?.deliveryDate ?? p.order.deliveryDate)}` }), _jsxs("span", { className: "flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground", children: [_jsx(StatusIcon, { tone: tone(b), label: label("orderBucket", b) }), p.order.cartCount ?? 0, " karren"] })] }));
|
|
147
|
+
}, empty: _jsx(EmptyState, { icon: _jsx(ShoppingCart, { className: "h-7 w-7" }), title: actief.length ? "Geen orders gevonden" : "Geen orders deze week", text: actief.length ? "Pas je zoekopdracht of filters aan." : "Kies een andere week met de pijlen bovenaan.", action: actief.length ? _jsx(Button, { variant: "outline", onClick: () => { setSearch(""); clearFilters(); setTab("alle"); }, children: "Alles wissen" }) : undefined }) })), _jsx(ShortcutHelp, { open: help, onOpenChange: setHelp }), _jsx(DagDetailDialog, { open: !!dayDetailDate, date: dayDetailDate, planned: planned, basis: "lever", highlightOrderId: highlightOrderId, onOpenChange: (o) => !o && setDayDetailDate(null) })] }));
|
|
38
148
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NuVersturenButton.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/NuVersturenButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NuVersturenButton.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/NuVersturenButton.tsx"],"names":[],"mappings":"AAgBA,wFAAwF;AAExF,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,KAAsB,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,+BAuI3G"}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
+
import { fmtDayTime } from "../../lib/dateLabels.js";
|
|
3
4
|
import { useServerFn } from "@tanstack/react-start";
|
|
4
5
|
import { useQueryClient } from "@tanstack/react-query";
|
|
5
6
|
import { Button, toast, AlertDialog, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from "@flowselections/core";
|
|
6
7
|
import { Send, Loader2, CheckCircle2, XCircle } from "lucide-react";
|
|
7
8
|
import { prepareFloridayLoading, sendFloridayLoading, } from "../../lib/floridayLoading.functions.js";
|
|
8
9
|
import { platenTekst } from "../../lib/extraPlaten.js";
|
|
10
|
+
import { label as labelFor } from "../../lib/labels.js";
|
|
9
11
|
/** "Nu versturen": toont eerst een samenvatting met controles en vraagt bevestiging. */
|
|
10
|
-
const PICK_LABEL = {
|
|
11
|
-
geen_pickrij: "nog niet gepickt",
|
|
12
|
-
open: "nog te picken",
|
|
13
|
-
bezig: "wordt gepickt",
|
|
14
|
-
gepickt: "gepickt",
|
|
15
|
-
};
|
|
16
12
|
export function NuVersturenButton({ orderRef, label = "Nu versturen" }) {
|
|
17
13
|
const prepare = useServerFn(prepareFloridayLoading);
|
|
18
14
|
const send = useServerFn(sendFloridayLoading);
|
|
@@ -73,7 +69,7 @@ export function NuVersturenButton({ orderRef, label = "Nu versturen" }) {
|
|
|
73
69
|
};
|
|
74
70
|
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("ul", { className: "mt-1 space-y-0.5", children: preview.carriers.map((c, i) => (_jsxs("li", { children: [_jsx("span", { className: "font-mono", children: c.loadCarrierReference || "—" }), " \u00B7 ", c.karTekst ?? platenTekst(c.additionalLayers)] }, (c.loadCarrierReference || "") + i))) })] })), _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
|
|
75
71
|
? _jsx(CheckCircle2, { className: "h-3.5 w-3.5 text-primary" })
|
|
76
|
-
: _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" ? ` ·
|
|
72
|
+
: _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" ? ` · ${labelFor("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: [fmtDayTime(a.createdAt), " \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) => {
|
|
77
73
|
// Begrijpelijke zin, technische code klein eronder.
|
|
78
74
|
const m = /^(.*?)\s*\[([^\]]+)\]$/s.exec(b);
|
|
79
75
|
return (_jsxs("li", { children: [m ? m[1] : b, m ? _jsx("div", { className: "text-xs text-muted-foreground", children: m[2] }) : null] }, b));
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
1
2
|
import type { FloridayOrder } from "../../lib/floriday.functions.js";
|
|
2
3
|
export interface PickAgendaViewProps {
|
|
3
4
|
onOrderClick?: (order: FloridayOrder) => void;
|
|
5
|
+
/** Laat de pagina de kop tekenen met de periodekiezer en "Bijgewerkt". */
|
|
6
|
+
header?: (p: {
|
|
7
|
+
updatedAt: number | null;
|
|
8
|
+
period: ReactNode;
|
|
9
|
+
}) => ReactNode;
|
|
4
10
|
}
|
|
5
|
-
export declare function PickAgendaView({ onOrderClick }: PickAgendaViewProps): import("react").JSX.Element;
|
|
11
|
+
export declare function PickAgendaView({ onOrderClick, header }: PickAgendaViewProps): import("react").JSX.Element;
|
|
6
12
|
//# sourceMappingURL=PickAgendaView.d.ts.map
|
|
@@ -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":"AAAA,OAAO,EAAkC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAgBvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,0EAA0E;IAC1E,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,MAAM,EAAE,SAAS,CAAA;KAAE,KAAK,SAAS,CAAC;CAC5E;AAUD,wBAAgB,cAAc,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,mBAAmB,+BA+G3E"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import { jsxs as _jsxs,
|
|
2
|
-
import { useMemo, useState } from "react";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo, useState } from "react";
|
|
3
|
+
import { fmtDayTime } from "../../lib/dateLabels.js";
|
|
4
|
+
import { AlertTriangle, CheckCircle2, Clock, List, Package, ShoppingCart, Truck } from "lucide-react";
|
|
5
|
+
import { KpiRow } from "../fs-ui/KpiRow.js";
|
|
6
|
+
import { KpiTile } from "../fs-ui/KpiTile.js";
|
|
7
|
+
import { InlineAlert, NoticeStack } from "../fs-ui/InlineAlert.js";
|
|
8
|
+
import { PillTabs } from "../fs-ui/PillTabs.js";
|
|
9
|
+
import { PeriodPicker } from "../fs-ui/PeriodPicker.js";
|
|
10
|
+
import { weekLabel } from "../../lib/dateLabels.js";
|
|
11
|
+
import { addDays, startOfWeek } from "../../lib/pickDate.js";
|
|
3
12
|
import { Button } from "@flowselections/core";
|
|
4
13
|
import { WeekAgendaView } from "./WeekAgendaView.js";
|
|
5
14
|
import { DagDetailDialog } from "./DagDetailDialog.js";
|
|
@@ -12,32 +21,40 @@ function refsOf(items) {
|
|
|
12
21
|
const all = items.map((p) => p.order.orderNumber || p.order.id).filter(Boolean);
|
|
13
22
|
return { shown: all.slice(0, MAX_REFS), total: all.length };
|
|
14
23
|
}
|
|
15
|
-
function
|
|
16
|
-
const { shown, total } = refsOf(items);
|
|
17
|
-
if (!total)
|
|
18
|
-
return null;
|
|
19
|
-
return (_jsxs("div", { children: [label(total), ": ", shown.join(", "), total > shown.length ? ` en ${total - shown.length} meer` : "", "."] }));
|
|
20
|
-
}
|
|
21
|
-
export function PickAgendaView({ onOrderClick }) {
|
|
24
|
+
export function PickAgendaView({ onOrderClick, header }) {
|
|
22
25
|
const [weekStart, setWeekStart] = useState(() => currentWeekStart());
|
|
23
26
|
const range = useMemo(() => agendaRange(weekStart), [weekStart]);
|
|
24
|
-
const { planned, awaiting, tasksWithoutStart, nearestDeliveryDate, signalError, lastEngineRun, isLoading, error, warning, refetch, } = useOrderPlanning(range);
|
|
27
|
+
const { planned, awaiting, tasksWithoutStart, nearestDeliveryDate, signalError, lastEngineRun, isLoading, error, warning, refetch, dataUpdatedAt, } = useOrderPlanning(range);
|
|
25
28
|
const awaitingCount = awaiting.length;
|
|
26
29
|
const anyIssue = awaitingCount + tasksWithoutStart.length > 0;
|
|
27
30
|
const vestigingTz = useVestigingTijdzone().data ?? null;
|
|
28
31
|
const lastRunLabel = lastEngineRun && vestigingTz
|
|
29
|
-
? new Date(
|
|
30
|
-
timeZone: vestigingTz,
|
|
31
|
-
dateStyle: "short",
|
|
32
|
-
timeStyle: "short",
|
|
33
|
-
})
|
|
32
|
+
? fmtDayTime(lastEngineRun, new Date(), vestigingTz)
|
|
34
33
|
: null;
|
|
35
34
|
const [dayDetailDate, setDayDetailDate] = useState(null);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
const [tab, setTab] = useState("alle");
|
|
36
|
+
const [totals, setTotals] = useState({ leveringen: 0, verzendklaar: 0, voorbereiding: 0, totaalStuks: 0, afgehandeld: 0, nietAfgemeld: 0, karren: 0 });
|
|
37
|
+
const onTotals = useCallback((t) => setTotals(t), []);
|
|
38
|
+
const isCurrent = startOfWeek(weekStart).getTime() === startOfWeek(currentWeekStart()).getTime();
|
|
39
|
+
const refsText = (items) => {
|
|
40
|
+
const { shown, total } = refsOf(items);
|
|
41
|
+
return shown.join(", ") + (total > shown.length ? ` en ${total - shown.length} meer` : "");
|
|
42
|
+
};
|
|
43
|
+
const lastRunText = lastRunLabel ? `Laatste indeling door de planning: ${lastRunLabel}.` : "Er is nog geen indeling bekend voor deze periode.";
|
|
44
|
+
const notices = [
|
|
45
|
+
error ? (_jsx(InlineAlert, { tone: "error", title: "De pickagenda kon niet worden geladen", action: _jsx(Button, { size: "sm", variant: "outline", onClick: () => refetch(), children: "Opnieuw proberen" }), children: error }, "err")) : null,
|
|
46
|
+
warning && !error ? _jsxs(InlineAlert, { tone: "warning", children: [warning, " De beschikbare orders blijven zichtbaar."] }, "warn") : null,
|
|
47
|
+
awaitingCount > 0 ? (_jsx(InlineAlert, { tone: "info", title: `${awaitingCount} ${awaitingCount === 1 ? "order wacht" : "orders wachten"} op karindeling`, details: _jsxs(_Fragment, { children: [refsText(awaiting), ". ", lastRunText, " ", signalError ?? "De orders worden automatisch ingepland."] }), children: "Nog niet in de agenda." }, "aw")) : null,
|
|
48
|
+
tasksWithoutStart.length > 0 ? (_jsx(InlineAlert, { tone: "warning", title: `${tasksWithoutStart.length} zonder starttijd`, details: _jsxs(_Fragment, { children: [refsText(tasksWithoutStart), ". ", lastRunText] }), children: "Controleer de werktijden." }, "ts")) : null,
|
|
49
|
+
];
|
|
50
|
+
void anyIssue;
|
|
51
|
+
return (_jsxs("div", { className: "flex flex-col gap-4", children: [header?.({
|
|
52
|
+
updatedAt: dataUpdatedAt ?? null,
|
|
53
|
+
period: (_jsx(PeriodPicker, { label: weekLabel(weekStart), onPrev: () => setWeekStart((w) => addDays(w, -7)), onNext: () => setWeekStart((w) => addDays(w, 7)), onToday: () => setWeekStart(currentWeekStart()), todayLabel: "Deze week", isCurrent: isCurrent })),
|
|
54
|
+
}), _jsx(NoticeStack, { children: notices }), _jsxs(KpiRow, { children: [_jsx(KpiTile, { title: "Te picken", icon: _jsx(ShoppingCart, {}), loading: isLoading, value: totals.leveringen, sub: `${totals.totaalStuks.toLocaleString("nl-NL")} stuks` }), _jsx(KpiTile, { title: "Karren", icon: _jsx(Package, {}), loading: isLoading, value: totals.karren, sub: "in de getoonde week" }), _jsx(KpiTile, { title: "Afgehandeld", icon: _jsx(CheckCircle2, {}), loading: isLoading, value: totals.afgehandeld, sub: `van ${totals.leveringen} orders` }), _jsx(KpiTile, { title: "Nog niet ingedeeld", icon: _jsx(AlertTriangle, {}), loading: isLoading, value: awaitingCount, tone: awaitingCount ? "warning" : "default", sub: awaitingCount ? "wacht op karindeling" : "alles ingedeeld" })] }), _jsx(PillTabs, { ariaLabel: "Status", value: tab, onChange: setTab, tabs: [
|
|
55
|
+
{ value: "alle", label: "Alle", icon: _jsx(List, {}), count: totals.leveringen },
|
|
56
|
+
{ value: "voorbereiding", label: "In voorbereiding", icon: _jsx(Clock, {}), count: totals.voorbereiding },
|
|
57
|
+
{ value: "verzendklaar", label: "Verzendklaar", icon: _jsx(Truck, {}), count: totals.verzendklaar },
|
|
58
|
+
{ value: "afgehandeld", label: "Afgehandeld", icon: _jsx(CheckCircle2, {}), count: totals.afgehandeld },
|
|
59
|
+
] }), !error && (_jsx(WeekAgendaView, { planned: planned, mode: "pick", isLoading: isLoading, onOrderClick: onOrderClick, onDayClick: setDayDetailDate, weekStart: weekStart, onJump: setWeekStart, statusFilter: tab, onTotals: onTotals, jumpToDate: nearestDeliveryDate })), _jsx(DagDetailDialog, { open: !!dayDetailDate, date: dayDetailDate, planned: planned, onOpenChange: (o) => !o && setDayDetailDate(null) })] }));
|
|
43
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickingPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/PickingPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PickingPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/PickingPage.tsx"],"names":[],"mappings":"AAKA,wBAAgB,WAAW,gCAe1B"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { PageHeader } from "../fs-ui/PageHeader.js";
|
|
3
|
+
import { UpdatedAt } from "../fs-ui/UpdatedAt.js";
|
|
2
4
|
import { useAfhandelingDefaults } from "../../hooks/useAfhandelingDefaults.js";
|
|
3
5
|
import { PickAgendaView } from "./PickAgendaView.js";
|
|
4
6
|
export function PickingPage() {
|
|
5
7
|
useAfhandelingDefaults();
|
|
6
|
-
return (
|
|
8
|
+
return (_jsx("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(PickAgendaView, { header: ({ updatedAt, period }) => (_jsx(PageHeader, { title: "Picken", updatedAt: _jsx(UpdatedAt, { at: updatedAt, info: "Overzicht van alle orders die gepickt moeten worden." }), period: period })) }) }));
|
|
7
9
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type WeekAgendaMode } from "./WeekAgendaView.js";
|
|
2
2
|
interface Props {
|
|
3
3
|
title: string;
|
|
4
|
+
/** Wordt in de infoballon bij "Bijgewerkt" getoond. */
|
|
4
5
|
description: string;
|
|
5
6
|
mode: WeekAgendaMode;
|
|
6
7
|
}
|
|
8
|
+
/** Planning: geen 4 zinvolle cijfers, dus geen KPI-rij (vaste regel: geen verzonnen tegels). */
|
|
7
9
|
export declare function PlanningAgendaPage({ title, description, mode }: Props): import("react").JSX.Element;
|
|
8
10
|
export {};
|
|
9
11
|
//# sourceMappingURL=PlanningAgendaPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanningAgendaPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/PlanningAgendaPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlanningAgendaPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/PlanningAgendaPage.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMvE,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,gGAAgG;AAChG,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,KAAK,+BA8BrE"}
|
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { PageHeader } from "../fs-ui/PageHeader.js";
|
|
4
|
+
import { InlineAlert, NoticeStack } from "../fs-ui/InlineAlert.js";
|
|
5
|
+
import { UpdatedAt } from "../fs-ui/UpdatedAt.js";
|
|
6
|
+
import { PeriodPicker } from "../fs-ui/PeriodPicker.js";
|
|
2
7
|
import { useAfhandelingDefaults } from "../../hooks/useAfhandelingDefaults.js";
|
|
3
8
|
import { WeekAgendaView } from "./WeekAgendaView.js";
|
|
4
9
|
import { useOrderPlanning } from "../../hooks/useOrderPlanning.js";
|
|
10
|
+
import { currentWeekStart } from "../../lib/agendaRange.js";
|
|
11
|
+
import { addDays, startOfWeek } from "../../lib/pickDate.js";
|
|
12
|
+
import { weekLabel } from "../../lib/dateLabels.js";
|
|
13
|
+
/** Planning: geen 4 zinvolle cijfers, dus geen KPI-rij (vaste regel: geen verzonnen tegels). */
|
|
5
14
|
export function PlanningAgendaPage({ title, description, mode }) {
|
|
6
15
|
useAfhandelingDefaults();
|
|
7
|
-
const
|
|
8
|
-
|
|
16
|
+
const [weekStart, setWeekStart] = useState(() => currentWeekStart());
|
|
17
|
+
const { planned, isLoading, error, warning, dataUpdatedAt } = useOrderPlanning();
|
|
18
|
+
const isCurrent = startOfWeek(weekStart).getTime() === startOfWeek(currentWeekStart()).getTime();
|
|
19
|
+
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: title, updatedAt: _jsx(UpdatedAt, { at: dataUpdatedAt, info: description }), period: _jsx(PeriodPicker, { label: weekLabel(weekStart), onPrev: () => setWeekStart((w) => addDays(w, -7)), onNext: () => setWeekStart((w) => addDays(w, 7)), onToday: () => setWeekStart(currentWeekStart()), todayLabel: "Deze week", isCurrent: isCurrent }) }), _jsx(NoticeStack, { children: [
|
|
20
|
+
error ? _jsx(InlineAlert, { tone: "error", children: error }, "e") : null,
|
|
21
|
+
warning && !error ? _jsxs(InlineAlert, { tone: "warning", children: [warning, " De beschikbare orders blijven zichtbaar."] }, "w") : null,
|
|
22
|
+
] }), _jsx(WeekAgendaView, { planned: planned, mode: mode, isLoading: isLoading, weekStart: weekStart, onJump: setWeekStart })] }));
|
|
9
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScanControleView.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/ScanControleView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScanControleView.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/ScanControleView.tsx"],"names":[],"mappings":"AA+FA,wBAAgB,gBAAgB,gCAkX/B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { label } from "../../lib/labels.js";
|
|
3
4
|
import { supabase } from "../../integrations/supabase/moduleClient.js";
|
|
4
5
|
import { Button, Badge, Card, Input, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, toast, } from "@flowselections/core";
|
|
5
6
|
import { AlertTriangle, CheckCircle2, RefreshCw, ScanLine } from "lucide-react";
|
|
@@ -181,5 +182,5 @@ export function ScanControleView() {
|
|
|
181
182
|
setLookup(null);
|
|
182
183
|
setBarcode("");
|
|
183
184
|
inputRef.current?.focus();
|
|
184
|
-
}, children: "Annuleren" })] })] }))] }), _jsxs("div", { className: "flex flex-wrap gap-3", children: [_jsxs(Card, { className: "p-3", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "Gescand vandaag" }), _jsx("div", { className: "text-2xl font-semibold", children: stats.totaal })] }), _jsxs(Card, { className: "p-3", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "Geprint" }), _jsx("div", { className: "text-2xl font-semibold", children: stats.geprint })] }), _jsxs(Card, { className: "p-3", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "In behandeling" }), _jsx("div", { className: "text-2xl font-semibold", children: stats.wacht })] }), _jsxs(Card, { className: "p-3", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "Mislukt" }), _jsx("div", { className: "text-2xl font-semibold", children: stats.mislukt })] })] }), _jsx(Card, { className: "p-0 overflow-hidden", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Ordernummer" }), _jsx(TableHead, { children: "Soort" }), _jsx(TableHead, { children: "Status" }), _jsx(TableHead, { children: "Melding" }), _jsx(TableHead, { children: "Bijgewerkt" }), _jsx(TableHead, {})] }) }), _jsx(TableBody, { children: overviewQ.isLoading ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 6, className: "text-sm text-muted-foreground", children: "Laden\u2026" }) })) : rows.length === 0 ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 6, className: "text-sm text-muted-foreground", children: "Vandaag nog niets gescand." }) })) : (rows.map((r) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: r.orderNumber ?? "—" }), _jsx(TableCell, { children: r.isFloriday ? "FO" : "Eigen" }), _jsx(TableCell, { children: _jsx(Badge, { variant: statusVariant(r.status), children: r.status }) }), _jsx(TableCell, { className: "text-sm text-muted-foreground", children: r.error ?? "—" }), _jsx(TableCell, { children: tijd(r.updatedAt) }), _jsx(TableCell, { className: "text-right", children: r.status === "mislukt" && (_jsxs(Button, { size: "sm", variant: "outline", disabled: retryM.isPending, onClick: () => retryM.mutate(r.id), children: [_jsx(RefreshCw, { className: "h-4 w-4 mr-2" }), "Opnieuw proberen"] })) })] }, r.id)))) })] }) })] }));
|
|
185
|
+
}, children: "Annuleren" })] })] }))] }), _jsxs("div", { className: "flex flex-wrap gap-3", children: [_jsxs(Card, { className: "p-3", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "Gescand vandaag" }), _jsx("div", { className: "text-2xl font-semibold", children: stats.totaal })] }), _jsxs(Card, { className: "p-3", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "Geprint" }), _jsx("div", { className: "text-2xl font-semibold", children: stats.geprint })] }), _jsxs(Card, { className: "p-3", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "In behandeling" }), _jsx("div", { className: "text-2xl font-semibold", children: stats.wacht })] }), _jsxs(Card, { className: "p-3", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "Mislukt" }), _jsx("div", { className: "text-2xl font-semibold", children: stats.mislukt })] })] }), _jsx(Card, { className: "p-0 overflow-hidden", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Ordernummer" }), _jsx(TableHead, { children: "Soort" }), _jsx(TableHead, { children: "Status" }), _jsx(TableHead, { children: "Melding" }), _jsx(TableHead, { children: "Bijgewerkt" }), _jsx(TableHead, {})] }) }), _jsx(TableBody, { children: overviewQ.isLoading ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 6, className: "text-sm text-muted-foreground", children: "Laden\u2026" }) })) : rows.length === 0 ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 6, className: "text-sm text-muted-foreground", children: "Vandaag nog niets gescand." }) })) : (rows.map((r) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: r.orderNumber ?? "—" }), _jsx(TableCell, { children: r.isFloriday ? "FO" : "Eigen" }), _jsx(TableCell, { children: _jsx(Badge, { variant: statusVariant(r.status), children: label("scanStatus", r.status) }) }), _jsx(TableCell, { className: "text-sm text-muted-foreground", children: r.error ?? "—" }), _jsx(TableCell, { children: tijd(r.updatedAt) }), _jsx(TableCell, { className: "text-right", children: r.status === "mislukt" && (_jsxs(Button, { size: "sm", variant: "outline", disabled: retryM.isPending, onClick: () => retryM.mutate(r.id), children: [_jsx(RefreshCw, { className: "h-4 w-4 mr-2" }), "Opnieuw proberen"] })) })] }, r.id)))) })] }) })] }));
|
|
185
186
|
}
|
|
@@ -4,9 +4,9 @@ import { Popover, PopoverContent, PopoverTrigger, Badge, cn } from "@flowselecti
|
|
|
4
4
|
import { ChevronDown, Search, X, Check, Globe, MapPin, Building2 } from "lucide-react";
|
|
5
5
|
import { GEO_ITEMS, getGeoItem } from "../../lib/geo/euServiceAreas.js";
|
|
6
6
|
const LEVEL_META = {
|
|
7
|
-
country: { label: "Land", icon: Globe, tone: "bg-
|
|
7
|
+
country: { label: "Land", icon: Globe, tone: "bg-primary/10 text-primary" },
|
|
8
8
|
province: { label: "Provincie", icon: MapPin, tone: "bg-emerald-100 text-emerald-700" },
|
|
9
|
-
city: { label: "Plaats", icon: Building2, tone: "bg-
|
|
9
|
+
city: { label: "Plaats", icon: Building2, tone: "bg-warning-soft text-warning-soft-foreground" },
|
|
10
10
|
};
|
|
11
11
|
function isSelected(value, item) {
|
|
12
12
|
if (item.level === "country")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VervoerdersPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/VervoerdersPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VervoerdersPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/VervoerdersPage.tsx"],"names":[],"mappings":"AAkDA;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,KAAK,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;CAAO,+BAM3G"}
|