@flowselections/floriday-afhandeling-module 1.0.66 → 1.0.69
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.js +3 -3
- package/dist-lib/components/afhandeling/AutoSendStatus.js +1 -1
- package/dist-lib/components/afhandeling/CapacityWarning.d.ts +1 -1
- package/dist-lib/components/afhandeling/CapacityWarning.js +1 -1
- package/dist-lib/components/afhandeling/ControleLijstPrint.d.ts +2 -2
- package/dist-lib/components/afhandeling/ControleLijstPrint.js +2 -2
- package/dist-lib/components/afhandeling/ControlePage.js +6 -6
- package/dist-lib/components/afhandeling/DagDetailDialog.d.ts +1 -1
- package/dist-lib/components/afhandeling/DagDetailDialog.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/DagDetailDialog.js +60 -23
- package/dist-lib/components/afhandeling/LeveringenPage.js +5 -5
- package/dist-lib/components/afhandeling/NieuweVervoerderPage.js +1 -1
- package/dist-lib/components/afhandeling/NuVersturenButton.js +1 -1
- package/dist-lib/components/afhandeling/PickAgendaView.d.ts +1 -1
- package/dist-lib/components/afhandeling/PickAgendaView.js +5 -5
- package/dist-lib/components/afhandeling/PickingPage.js +1 -1
- package/dist-lib/components/afhandeling/PlanningAgendaPage.d.ts +1 -1
- package/dist-lib/components/afhandeling/PlanningAgendaPage.js +2 -2
- package/dist-lib/components/afhandeling/ServiceAreaSelect.js +1 -1
- package/dist-lib/components/afhandeling/SignupMailMoments.js +5 -3
- package/dist-lib/components/afhandeling/VervoerderBewerkenPage.js +1 -1
- package/dist-lib/components/afhandeling/VervoerderForm.js +6 -6
- package/dist-lib/components/afhandeling/VervoerdersPage.js +8 -8
- package/dist-lib/components/afhandeling/VerzetOrderDialog.js +7 -7
- package/dist-lib/components/afhandeling/WeekAgendaView.d.ts +2 -2
- package/dist-lib/components/afhandeling/WeekAgendaView.js +9 -9
- package/dist-lib/components/afhandeling/WerkplekWaarschuwing.d.ts +9 -9
- package/dist-lib/components/afhandeling/WerkplekWaarschuwing.js +1 -1
- package/dist-lib/components/pickstation/PakbonTemplate.d.ts +2 -2
- package/dist-lib/components/pickstation/PakbonTemplate.js +1 -1
- package/dist-lib/components/pickstation/printDocuments.d.ts +1 -1
- package/dist-lib/components/pickstation/printDocuments.js +1 -1
- package/dist-lib/components/settings/AfhandelingSettingsCard.js +4 -4
- package/dist-lib/components/settings/VervoerdersSettingsCard.js +2 -2
- package/dist-lib/hooks/useCapacityCheck.d.ts +1 -1
- package/dist-lib/hooks/useCapacityCheck.js +1 -1
- package/dist-lib/hooks/useCartIndex.js +2 -2
- package/dist-lib/hooks/useConsistencyCheck.js +1 -1
- package/dist-lib/hooks/useEngineBufferEvents.js +1 -1
- package/dist-lib/hooks/useEngineTasks.d.ts +1 -1
- package/dist-lib/hooks/useEngineTasks.js +2 -2
- package/dist-lib/hooks/useKnownOrders.js +4 -4
- package/dist-lib/hooks/useOrderBuffers.d.ts +2 -2
- package/dist-lib/hooks/useOrderBuffers.d.ts.map +1 -1
- package/dist-lib/hooks/useOrderBuffers.js +1 -1
- package/dist-lib/hooks/useOrderMeldingen.d.ts +1 -1
- package/dist-lib/hooks/useOrderMeldingen.d.ts.map +1 -1
- package/dist-lib/hooks/useOrderMeldingen.js +1 -1
- package/dist-lib/hooks/useOrderPickDates.js +3 -3
- package/dist-lib/hooks/useOrderPlanning.d.ts +3 -3
- package/dist-lib/hooks/useOrderPlanning.js +13 -13
- package/dist-lib/hooks/usePickAgenda.js +4 -4
- package/dist-lib/hooks/usePickMode.d.ts +3 -3
- package/dist-lib/hooks/usePickMode.js +1 -1
- package/dist-lib/index.d.ts +16 -16
- package/dist-lib/index.js +16 -16
- package/dist-lib/integrations/supabase/auth-middleware.d.ts +1 -1
- package/dist-lib/integrations/supabase/client.server.d.ts +1 -1
- package/dist-lib/integrations/supabase/client.server.js +1 -1
- package/dist-lib/integrations/supabase/moduleClient.d.ts +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +253 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/afhandelingSettings.functions.d.ts +2 -2
- package/dist-lib/lib/afhandelingSettings.functions.js +1 -1
- package/dist-lib/lib/agendaRange.js +1 -1
- package/dist-lib/lib/authGateway.server.js +2 -2
- package/dist-lib/lib/carrierMatch.server.js +1 -1
- package/dist-lib/lib/carrierPlanning.d.ts +1 -1
- package/dist-lib/lib/carrierPlanning.js +3 -3
- package/dist-lib/lib/carrierSignup.functions.d.ts +10 -4
- package/dist-lib/lib/carrierSignup.functions.d.ts.map +1 -1
- package/dist-lib/lib/carrierSignup.functions.js +2 -2
- package/dist-lib/lib/carriers.functions.d.ts +7 -7
- package/dist-lib/lib/carriers.functions.js +3 -3
- package/dist-lib/lib/cartAssignments.functions.d.ts +8 -8
- package/dist-lib/lib/cartAssignments.functions.js +1 -1
- package/dist-lib/lib/cartControl.functions.d.ts +11 -11
- package/dist-lib/lib/cartControl.functions.js +2 -2
- package/dist-lib/lib/cartMoveImpact.d.ts +1 -1
- package/dist-lib/lib/cartMoveImpact.js +1 -1
- package/dist-lib/lib/cartRescheduling.js +1 -1
- package/dist-lib/lib/deliveryNote.functions.d.ts +1 -1
- package/dist-lib/lib/deliveryNote.functions.js +2 -2
- package/dist-lib/lib/deliveryNotePrint.d.ts +33 -33
- package/dist-lib/lib/deliveryNotePrint.js +3 -3
- package/dist-lib/lib/engineLayouts.functions.d.ts +1 -1
- package/dist-lib/lib/engineLayouts.functions.js +1 -1
- package/dist-lib/lib/floriday.functions.d.ts +2 -2
- package/dist-lib/lib/floriday.functions.js +2 -2
- package/dist-lib/lib/floridayAutoProcess.js +2 -2
- package/dist-lib/lib/floridayFulfillmentSend.server.js +3 -3
- package/dist-lib/lib/floridayLoading.functions.d.ts +2 -2
- package/dist-lib/lib/floridayLoading.functions.js +3 -3
- package/dist-lib/lib/gatewayBase.server.js +1 -1
- package/dist-lib/lib/invalidatePlanning.js +1 -1
- package/dist-lib/lib/logisticsEngine/engine.js +1 -1
- package/dist-lib/lib/logisticsEngine/reschedule.js +2 -2
- package/dist-lib/lib/logisticsEngine/staffPlanning.js +1 -1
- package/dist-lib/lib/orderFulfilment.functions.d.ts +1 -1
- package/dist-lib/lib/orderFulfilment.functions.js +1 -1
- package/dist-lib/lib/pickDates.functions.d.ts +1 -1
- package/dist-lib/lib/pickDates.functions.js +2 -2
- package/dist-lib/lib/pickMode.js +1 -1
- package/dist-lib/lib/pickWorkdays.js +1 -1
- package/dist-lib/lib/pickstationOrders.server.d.ts +2 -2
- package/dist-lib/lib/pickstationOrders.server.js +4 -4
- package/dist-lib/lib/realtimeBus.js +1 -1
- package/dist-lib/lib/serverRoutes/autoSend.handler.js +3 -3
- package/dist-lib/lib/serverRoutes/index.d.ts +5 -5
- package/dist-lib/lib/serverRoutes/index.js +5 -5
- package/dist-lib/lib/serverRoutes/pickstationOrders.handler.js +1 -1
- package/dist-lib/lib/serverRoutes/pickstationPrint.handler.js +1 -1
- package/dist-lib/lib/serverRoutes/pickstationStatus.handler.js +1 -1
- package/dist-lib/lib/signupMailText.d.ts.map +1 -1
- package/dist-lib/lib/signupMailText.js +2 -0
- package/dist-lib/moduleDefinition.js +3 -3
- package/package.json +2 -2
|
@@ -3,9 +3,9 @@ import { useEffect, useState } from "react";
|
|
|
3
3
|
import { useQueryClient } from "@tanstack/react-query";
|
|
4
4
|
import { Badge, Button, toast } from "@flowselections/core";
|
|
5
5
|
import { CheckCircle2, Clock, Loader2, PlayCircle, RefreshCw, AlertTriangle } from "lucide-react";
|
|
6
|
-
import { autoProcessSalesOrder, fetchAutoProcessStatuses, } from "../../lib/floridayAutoProcess";
|
|
7
|
-
import { supabase } from "../../integrations/supabase/moduleClient";
|
|
8
|
-
import { replanToNextDeliveryMoment } from "../../lib/logisticsEngine/reschedule";
|
|
6
|
+
import { autoProcessSalesOrder, fetchAutoProcessStatuses, } from "../../lib/floridayAutoProcess.js";
|
|
7
|
+
import { supabase } from "../../integrations/supabase/moduleClient.js";
|
|
8
|
+
import { replanToNextDeliveryMoment } from "../../lib/logisticsEngine/reschedule.js";
|
|
9
9
|
const NL_DATE = new Intl.DateTimeFormat("nl-NL", { day: "2-digit", month: "short" });
|
|
10
10
|
function formatWaiting(date) {
|
|
11
11
|
const today = new Date();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery } from "@tanstack/react-query";
|
|
3
|
-
import { supabase } from "../../integrations/supabase/moduleClient";
|
|
3
|
+
import { supabase } from "../../integrations/supabase/moduleClient.js";
|
|
4
4
|
/** Tijdzone van de vestiging uit de Werktijden-instelling (alleen lezen); null = onbekend. */
|
|
5
5
|
export function useVestigingTijdzone() {
|
|
6
6
|
return useQuery({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CapacityDay } from "../../lib/logisticsEngine/capacity";
|
|
1
|
+
import { type CapacityDay } from "../../lib/logisticsEngine/capacity.js";
|
|
2
2
|
/**
|
|
3
3
|
* Waarschuwing bij te weinig pickcapaciteit. Alle cijfers komen letterlijk
|
|
4
4
|
* uit de Logistics Engine (logistics_capacity_day_check).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { AlertTriangle } from "lucide-react";
|
|
3
|
-
import { capacityWarningText } from "../../lib/logisticsEngine/capacity";
|
|
3
|
+
import { capacityWarningText } from "../../lib/logisticsEngine/capacity.js";
|
|
4
4
|
/**
|
|
5
5
|
* Waarschuwing bij te weinig pickcapaciteit. Alle cijfers komen letterlijk
|
|
6
6
|
* uit de Logistics Engine (logistics_capacity_day_check).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ControlCart } from "../../lib/cartControl.functions";
|
|
2
|
-
import { type PickstationLang } from "../../lib/pickstationI18n";
|
|
1
|
+
import type { ControlCart } from "../../lib/cartControl.functions.js";
|
|
2
|
+
import { type PickstationLang } from "../../lib/pickstationI18n.js";
|
|
3
3
|
/**
|
|
4
4
|
* Rendert de controlelijst als losstaande HTML-pagina (A4 portrait).
|
|
5
5
|
* De HTML gaat naar de printwachtrij van de Layout maker; er wordt
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { countryCode } from "../../lib/countries";
|
|
2
|
-
import { getPrintDict, PICKSTATION_LOCALE, } from "../../lib/pickstationI18n";
|
|
1
|
+
import { countryCode } from "../../lib/countries.js";
|
|
2
|
+
import { getPrintDict, PICKSTATION_LOCALE, } from "../../lib/pickstationI18n.js";
|
|
3
3
|
const DAY_ABBR_BY_LANG = {
|
|
4
4
|
nl: ["ZO", "MA", "DI", "WO", "DO", "VR", "ZA"],
|
|
5
5
|
en: ["SU", "MO", "TU", "WE", "TH", "FR", "SA"],
|
|
@@ -2,14 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { Button, Card, Checkbox, Dialog, DialogDescription, DialogTitle, Input, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Textarea, Badge, toast, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@flowselections/core";
|
|
4
4
|
import { Printer, CheckCircle2, AlertTriangle, History, ChevronLeft, ChevronRight, ScanLine } from "lucide-react";
|
|
5
|
-
import { ResponsiveDialogBody, ResponsiveDialogContent, ResponsiveDialogFooter, ResponsiveDialogHeader, } from "
|
|
5
|
+
import { ResponsiveDialogBody, ResponsiveDialogContent, ResponsiveDialogFooter, ResponsiveDialogHeader, } from "../../components/ui/responsive-dialog.js";
|
|
6
6
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
7
7
|
import { useServerFn } from "@tanstack/react-start";
|
|
8
|
-
import { getTodaysControlCarts, getControlRescheduleProposals, submitControlSession, listControlHistory, getControlSessionDetail, getControlDraft, listDeliveredToday, saveControlDraft, } from "../../lib/cartControl.functions";
|
|
9
|
-
import { ScanControleView } from "./ScanControleView";
|
|
10
|
-
import { renderControleLijstHtml } from "./ControleLijstPrint";
|
|
11
|
-
import { printHtmlDocument, printFoutMelding } from "../../lib/printing";
|
|
12
|
-
import { callServerFn } from "../../lib/serverFnError";
|
|
8
|
+
import { getTodaysControlCarts, getControlRescheduleProposals, submitControlSession, listControlHistory, getControlSessionDetail, getControlDraft, listDeliveredToday, saveControlDraft, } from "../../lib/cartControl.functions.js";
|
|
9
|
+
import { ScanControleView } from "./ScanControleView.js";
|
|
10
|
+
import { renderControleLijstHtml } from "./ControleLijstPrint.js";
|
|
11
|
+
import { printHtmlDocument, printFoutMelding } from "../../lib/printing.js";
|
|
12
|
+
import { callServerFn } from "../../lib/serverFnError.js";
|
|
13
13
|
function dayDiffFromToday(iso) {
|
|
14
14
|
const d = new Date(iso);
|
|
15
15
|
if (Number.isNaN(d.getTime()))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DagDetailDialog.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/DagDetailDialog.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"DagDetailDialog.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/DagDetailDialog.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AA+LjE,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,29 +1,59 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext, useState } from "react";
|
|
2
|
+
import { createContext, useContext, useMemo, useState } from "react";
|
|
3
3
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
4
|
import { useServerFn } from "@tanstack/react-start";
|
|
5
5
|
import { Badge, Checkbox, Button, Dialog, DialogTitle, DialogDescription, Input, Tabs, TabsContent, TabsList, TabsTrigger, toast, } from "@flowselections/core";
|
|
6
6
|
import { AlertTriangle, CalendarClock, CheckCircle2, ChevronDown, ChevronRight, Printer, Users } from "lucide-react";
|
|
7
|
-
import { useStickerMeldingen, useOrderArchived } from "../../hooks/useOrderMeldingen";
|
|
8
|
-
import { ResponsiveDialogBody, ResponsiveDialogContent, ResponsiveDialogFooter, ResponsiveDialogHeader, } from "
|
|
9
|
-
import { usePickAgenda } from "../../hooks/usePickAgenda";
|
|
10
|
-
import { useOrderBuffers, useBufferMembers } from "../../hooks/useOrderBuffers";
|
|
11
|
-
import { isSameDay } from "../../lib/pickDate";
|
|
12
|
-
import { isExcludedOrderStatus } from "../../lib/orderStatus";
|
|
13
|
-
import { getOrderLines, getDayCartContents, getOrderCartIds, getPakbonCartInfo, } from "../../lib/cartAssignments.functions";
|
|
14
|
-
import { printLayoutDocument, printPdfDocument, printFoutMelding } from "../../lib/printing";
|
|
15
|
-
import { NuVersturenButton } from "./NuVersturenButton";
|
|
16
|
-
import { AutoSendStatus } from "./AutoSendStatus";
|
|
17
|
-
import { SignupMailMoments } from "./SignupMailMoments";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
7
|
+
import { useStickerMeldingen, useOrderArchived } from "../../hooks/useOrderMeldingen.js";
|
|
8
|
+
import { ResponsiveDialogBody, ResponsiveDialogContent, ResponsiveDialogFooter, ResponsiveDialogHeader, } from "../../components/ui/responsive-dialog.js";
|
|
9
|
+
import { usePickAgenda } from "../../hooks/usePickAgenda.js";
|
|
10
|
+
import { useOrderBuffers, useBufferMembers } from "../../hooks/useOrderBuffers.js";
|
|
11
|
+
import { isSameDay } from "../../lib/pickDate.js";
|
|
12
|
+
import { isExcludedOrderStatus } from "../../lib/orderStatus.js";
|
|
13
|
+
import { getOrderLines, getDayCartContents, getOrderCartIds, getPakbonCartInfo, } from "../../lib/cartAssignments.functions.js";
|
|
14
|
+
import { printLayoutDocument, printPdfDocument, printFoutMelding } from "../../lib/printing.js";
|
|
15
|
+
import { NuVersturenButton } from "./NuVersturenButton.js";
|
|
16
|
+
import { AutoSendStatus } from "./AutoSendStatus.js";
|
|
17
|
+
import { SignupMailMoments } from "./SignupMailMoments.js";
|
|
18
|
+
import { getSignupOverview } from "../../lib/carrierSignup.functions.js";
|
|
19
|
+
import { useServerFn as useSignupServerFn } from "@tanstack/react-start";
|
|
20
|
+
import { useQuery as useSignupQuery } from "@tanstack/react-query";
|
|
21
|
+
const SignupFlagCtx = createContext(new Map());
|
|
22
|
+
function shiftDay(key, days) {
|
|
23
|
+
const d = new Date(`${key}T12:00:00Z`);
|
|
24
|
+
d.setUTCDate(d.getUTCDate() + days);
|
|
25
|
+
return d.toISOString().slice(0, 10);
|
|
26
|
+
}
|
|
27
|
+
function useSignupFlags(dayKey) {
|
|
28
|
+
const fetchOverview = useSignupServerFn(getSignupOverview);
|
|
29
|
+
const from = dayKey ? shiftDay(dayKey, -7) : null;
|
|
30
|
+
const to = dayKey ? shiftDay(dayKey, 7) : null;
|
|
31
|
+
const q = useSignupQuery({
|
|
32
|
+
queryKey: ["afhandeling", "signup-overview", from, to],
|
|
33
|
+
enabled: !!from && !!to,
|
|
34
|
+
queryFn: () => fetchOverview({ data: { from: from, to: to } }),
|
|
35
|
+
refetchInterval: 60000,
|
|
36
|
+
});
|
|
37
|
+
return useMemo(() => {
|
|
38
|
+
const m = new Map();
|
|
39
|
+
for (const g of q.data?.groups ?? []) {
|
|
40
|
+
for (const id of g.late_order_ids ?? [])
|
|
41
|
+
m.set(id, "late");
|
|
42
|
+
for (const p of g.pending_orders ?? [])
|
|
43
|
+
m.set(p.orderId, "pending");
|
|
44
|
+
}
|
|
45
|
+
return m;
|
|
46
|
+
}, [q.data]);
|
|
47
|
+
}
|
|
48
|
+
import { CapacityWarning } from "./CapacityWarning.js";
|
|
49
|
+
import { useCapacityCheck } from "../../hooks/useCapacityCheck.js";
|
|
50
|
+
import { toDayKey } from "../../lib/logisticsEngine/capacity.js";
|
|
51
|
+
import { VerzetOrderDialog } from "./VerzetOrderDialog.js";
|
|
52
|
+
import { markOrderShipped } from "../../lib/orderFulfilment.functions.js";
|
|
53
|
+
import { getDeliveryNotePdf } from "../../lib/deliveryNote.functions.js";
|
|
54
|
+
import { getShippingNoteLayout } from "../../lib/engineLayouts.functions.js";
|
|
55
|
+
import { setPickDay } from "../../lib/logisticsEngine/reschedule.js";
|
|
56
|
+
import { clearDayStaffPlan, computeCapacity, getDayStaffPlan, getEngineStaffDefaults, setDayStaffPlan, toDateKey, } from "../../lib/logisticsEngine/staffPlanning.js";
|
|
27
57
|
function voortgang(status) {
|
|
28
58
|
const s = (status ?? "").trim().toLowerCase();
|
|
29
59
|
if (["done", "completed", "afgerond", "afgehandeld", "shipped", "verzonden", "delivered", "geleverd", "afgeleverd", "checked", "gecontroleerd"].includes(s)) {
|
|
@@ -194,8 +224,9 @@ function DagDetailContent({ open, date, planned, onOpenChange, basis = "pick", h
|
|
|
194
224
|
}
|
|
195
225
|
}
|
|
196
226
|
// Tel karren op unieke kar-id (gedeelde bufferkar één keer); rijen zonder id tellen los.
|
|
227
|
+
const signupFlags = useSignupFlags(dayKey ?? null);
|
|
197
228
|
const uniekeKarren = new Set(cartRows.map((c) => c.cartId ?? `zonder-id:${c.key}`)).size;
|
|
198
|
-
return (_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 }), _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" }) })] }) }) }) }));
|
|
229
|
+
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 }), _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" }) })] }) }) }) }) }));
|
|
199
230
|
}
|
|
200
231
|
function BezettingCard({ date, cartsToday }) {
|
|
201
232
|
const queryClient = useQueryClient();
|
|
@@ -621,6 +652,12 @@ function EngineOrderRow({ order }) {
|
|
|
621
652
|
const vg = useVoortgang(order.ref, order.status);
|
|
622
653
|
return (_jsx("div", { className: "rounded-lg border bg-card px-4 py-3", children: _jsxs("div", { className: "grid grid-cols-2 gap-3 text-sm md:grid-cols-4", children: [_jsxs("div", { children: [_jsx("div", { className: "font-medium", children: order.ref }), _jsx("div", { className: "text-xs text-muted-foreground", children: "Alleen bekend in de planning" })] }), _jsxs("div", { children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "Karren vandaag" }), _jsx("div", { children: order.carts })] }), _jsxs("div", { children: [_jsx("div", { className: "text-xs text-muted-foreground", children: "Planten" }), _jsx("div", { children: order.plants })] }), _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [_jsx(StatusBadge, { vg: vg }), _jsx(AfhandelenButton, { orderRef: order.ref, done: vg.done })] })] }) }));
|
|
623
654
|
}
|
|
655
|
+
function SignupFlagLabel({ orderId }) {
|
|
656
|
+
const flag = useContext(SignupFlagCtx).get(orderId);
|
|
657
|
+
if (!flag)
|
|
658
|
+
return null;
|
|
659
|
+
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" }));
|
|
660
|
+
}
|
|
624
661
|
function OrderRow({ planned: p, cartsToday, engineStatus, }) {
|
|
625
662
|
const [open, setOpen] = useState(false);
|
|
626
663
|
const [printing, setPrinting] = useState(false);
|
|
@@ -662,7 +699,7 @@ function OrderRow({ planned: p, cartsToday, engineStatus, }) {
|
|
|
662
699
|
}
|
|
663
700
|
};
|
|
664
701
|
const highlighted = useContext(HighlightCtx) === p.order.id;
|
|
665
|
-
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("div", { className: "truncate text-xs text-muted-foreground", children: p.order.customerName })] }), _jsxs("div", { className: "text-xs text-muted-foreground", children: ["Type ", _jsx("span", { className: "text-foreground", children: p.order.deliveryType })] }), _jsxs("div", { className: "text-xs text-muted-foreground", children: ["Leverdatum", " ", _jsx("span", { className: "text-foreground", children: p.order.deliveryDate
|
|
702
|
+
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 })] }), _jsxs("div", { className: "text-xs text-muted-foreground", children: ["Type ", _jsx("span", { className: "text-foreground", children: p.order.deliveryType })] }), _jsxs("div", { className: "text-xs text-muted-foreground", children: ["Leverdatum", " ", _jsx("span", { className: "text-foreground", children: p.order.deliveryDate
|
|
666
703
|
? new Date(p.order.deliveryDate).toLocaleDateString("nl-NL")
|
|
667
704
|
: "—" })] })] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsxs(Badge, { variant: "secondary", children: [cartsToday, " ", cartsToday === 1 ? "kar" : "karren", " vandaag"] }), _jsx(StatusBadge, { vg: vg })] }), _jsx(StickerMeldingen, { orderId: p.order.id })] })] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2 border-t pt-3", children: [p.order.orderNumber && p.order.salesOrderId && !shipStateRow?.floridaySent ? _jsx(NuVersturenButton, { orderRef: p.order.orderNumber }) : null, p.order.salesOrderId ? _jsx(AutoSendStatus, { orderId: p.order.id, orderRef: p.order.orderNumber }) : null, _jsx(AfhandelenButton, { orderRef: p.order.orderNumber, done: vg.done }), _jsxs(Button, { size: "sm", variant: "outline", onClick: handlePrintAll, disabled: printing, title: "Alle documenten van deze bestelling afdrukken (pakbonnen per kar en de verzendbrief)", children: [_jsx(Printer, { className: "mr-1 h-3.5 w-3.5" }), printing ? "In de Printwachtrij…" : "Alle documenten afdrukken"] }), _jsxs(Button, { size: "sm", variant: "outline", onClick: (e) => {
|
|
668
705
|
e.stopPropagation();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useState } from "react";
|
|
3
3
|
import { Button } from "@flowselections/core";
|
|
4
|
-
import { WeekAgendaView } from "./WeekAgendaView";
|
|
5
|
-
import { DagDetailDialog } from "./DagDetailDialog";
|
|
6
|
-
import { useOrderPlanning } from "../../hooks/useOrderPlanning";
|
|
7
|
-
import { agendaRange, currentWeekStart } from "../../lib/agendaRange";
|
|
8
|
-
import { startOfWeek } from "../../lib/pickDate";
|
|
4
|
+
import { WeekAgendaView } from "./WeekAgendaView.js";
|
|
5
|
+
import { DagDetailDialog } from "./DagDetailDialog.js";
|
|
6
|
+
import { useOrderPlanning } from "../../hooks/useOrderPlanning.js";
|
|
7
|
+
import { agendaRange, currentWeekStart } from "../../lib/agendaRange.js";
|
|
8
|
+
import { startOfWeek } from "../../lib/pickDate.js";
|
|
9
9
|
/** Leest ?dag=JJJJ-MM-DD&order=<order_id> (link vanuit bv. Dashboards). */
|
|
10
10
|
function readLinkParams() {
|
|
11
11
|
const sp = new URLSearchParams(window.location.search);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { VervoerderForm } from "./VervoerderForm";
|
|
2
|
+
import { VervoerderForm } from "./VervoerderForm.js";
|
|
3
3
|
/** Aanmaakpagina: altijd een leeg formulier, nooit een bestaand id. */
|
|
4
4
|
export function NieuweVervoerderPage() {
|
|
5
5
|
return _jsx(VervoerderForm, { carrierId: null });
|
|
@@ -4,7 +4,7 @@ import { useServerFn } from "@tanstack/react-start";
|
|
|
4
4
|
import { useQueryClient } from "@tanstack/react-query";
|
|
5
5
|
import { Button, toast, AlertDialog, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from "@flowselections/core";
|
|
6
6
|
import { Send, Loader2, CheckCircle2, XCircle } from "lucide-react";
|
|
7
|
-
import { prepareFloridayLoading, sendFloridayLoading, } from "../../lib/floridayLoading.functions";
|
|
7
|
+
import { prepareFloridayLoading, sendFloridayLoading, } from "../../lib/floridayLoading.functions.js";
|
|
8
8
|
/** "Nu versturen": toont eerst een samenvatting met controles en vraagt bevestiging. */
|
|
9
9
|
const PICK_LABEL = {
|
|
10
10
|
geen_pickrij: "nog niet gepickt",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useState } from "react";
|
|
3
3
|
import { Button } from "@flowselections/core";
|
|
4
|
-
import { WeekAgendaView } from "./WeekAgendaView";
|
|
5
|
-
import { DagDetailDialog } from "./DagDetailDialog";
|
|
6
|
-
import { useVestigingTijdzone } from "./AutoSendStatus";
|
|
7
|
-
import { useOrderPlanning } from "../../hooks/useOrderPlanning";
|
|
8
|
-
import { agendaRange, currentWeekStart } from "../../lib/agendaRange";
|
|
4
|
+
import { WeekAgendaView } from "./WeekAgendaView.js";
|
|
5
|
+
import { DagDetailDialog } from "./DagDetailDialog.js";
|
|
6
|
+
import { useVestigingTijdzone } from "./AutoSendStatus.js";
|
|
7
|
+
import { useOrderPlanning } from "../../hooks/useOrderPlanning.js";
|
|
8
|
+
import { agendaRange, currentWeekStart } from "../../lib/agendaRange.js";
|
|
9
9
|
/** Toon hooguit dit aantal ordernummers per categorie; de rest telt als "meer". */
|
|
10
10
|
const MAX_REFS = 8;
|
|
11
11
|
function refsOf(items) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { PickAgendaView } from "./PickAgendaView";
|
|
2
|
+
import { PickAgendaView } from "./PickAgendaView.js";
|
|
3
3
|
export function PickingPage() {
|
|
4
4
|
return (_jsxs("main", { className: "flex h-full flex-col gap-6 overflow-hidden p-6", children: [_jsxs("div", { className: "shrink-0", children: [_jsx("h1", { className: "text-2xl font-semibold", children: "Pick Agenda" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Overzicht van alle orders die gepickt moeten worden." })] }), _jsx("div", { className: "min-h-0 flex-1", children: _jsx(PickAgendaView, {}) })] }));
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { WeekAgendaView } from "./WeekAgendaView";
|
|
3
|
-
import { useOrderPlanning } from "../../hooks/useOrderPlanning";
|
|
2
|
+
import { WeekAgendaView } from "./WeekAgendaView.js";
|
|
3
|
+
import { useOrderPlanning } from "../../hooks/useOrderPlanning.js";
|
|
4
4
|
export function PlanningAgendaPage({ title, description, mode }) {
|
|
5
5
|
const { planned, isLoading, error, warning } = useOrderPlanning();
|
|
6
6
|
return (_jsxs("main", { className: "p-6 space-y-6", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-semibold", children: title }), _jsx("p", { className: "text-sm text-muted-foreground", children: description })] }), error && (_jsx("div", { className: "rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive", children: error })), warning && !error && (_jsxs("div", { className: "rounded-md border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900", children: [warning, " De beschikbare orders blijven zichtbaar."] })), _jsx(WeekAgendaView, { planned: planned, mode: mode, isLoading: isLoading })] }));
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMemo, useState } from "react";
|
|
3
3
|
import { Popover, PopoverContent, PopoverTrigger, Badge, cn } from "@flowselections/core";
|
|
4
4
|
import { ChevronDown, Search, X, Check, Globe, MapPin, Building2 } from "lucide-react";
|
|
5
|
-
import { GEO_ITEMS, getGeoItem } from "../../lib/geo/euServiceAreas";
|
|
5
|
+
import { GEO_ITEMS, getGeoItem } from "../../lib/geo/euServiceAreas.js";
|
|
6
6
|
const LEVEL_META = {
|
|
7
7
|
country: { label: "Land", icon: Globe, tone: "bg-blue-100 text-blue-700" },
|
|
8
8
|
province: { label: "Provincie", icon: MapPin, tone: "bg-emerald-100 text-emerald-700" },
|
|
@@ -4,8 +4,8 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
|
4
4
|
import { useServerFn } from "@tanstack/react-start";
|
|
5
5
|
import { Button, Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, toast, } from "@flowselections/core";
|
|
6
6
|
import { Mail } from "lucide-react";
|
|
7
|
-
import { getSignupOverview, previewSignupMail, sendSignupMailNow, } from "../../lib/carrierSignup.functions";
|
|
8
|
-
import { fmtDayTime, fmtTime, signupReasonText } from "../../lib/signupMailText";
|
|
7
|
+
import { getSignupOverview, previewSignupMail, sendSignupMailNow, } from "../../lib/carrierSignup.functions.js";
|
|
8
|
+
import { fmtDayTime, fmtTime, signupReasonText } from "../../lib/signupMailText.js";
|
|
9
9
|
export function SignupMailMoments({ from, to, compact }) {
|
|
10
10
|
const fetchOverview = useServerFn(getSignupOverview);
|
|
11
11
|
const q = useQuery({
|
|
@@ -53,6 +53,8 @@ function MomentRow({ g, tz, compact, enabled, onPreview }) {
|
|
|
53
53
|
onSuccess: (r) => {
|
|
54
54
|
if (r.code === "sent")
|
|
55
55
|
toast.success("Aanmeldmail verstuurd");
|
|
56
|
+
else if (r.code === "waiting_for_carts")
|
|
57
|
+
toast.info("Even wachten: een order heeft nog geen karindeling");
|
|
56
58
|
else if (r.code === "already_sent")
|
|
57
59
|
toast.info("Deze stand is al verstuurd");
|
|
58
60
|
else
|
|
@@ -63,7 +65,7 @@ function MomentRow({ g, tz, compact, enabled, onPreview }) {
|
|
|
63
65
|
onError: (e) => toast.error(e instanceof Error ? e.message : "Versturen lukte niet"),
|
|
64
66
|
});
|
|
65
67
|
const upToDate = g.last?.fingerprint_match === true;
|
|
66
|
-
return (_jsxs("li", { className: "flex flex-wrap items-center justify-between gap-2 text-xs", children: [_jsx("span", { children: statusLine(g, tz, enabled) }), compact ? null : (_jsxs("span", { className: "flex gap-2", children: [_jsx(Button, { size: "sm", variant: "outline", onClick: onPreview, children: "Voorbeeld bekijken" }), _jsx(Button, { size: "sm", disabled: !enabled || upToDate || m.isPending, onClick: () => m.mutate(), children: m.isPending ? "Versturen…" : "Nu versturen" })] }))] }));
|
|
68
|
+
return (_jsxs("li", { className: "flex flex-wrap items-center justify-between gap-2 text-xs", children: [_jsxs("span", { className: "space-y-0.5", children: [_jsx("span", { className: "block", children: statusLine(g, tz, enabled) }), (g.pending_orders ?? []).map((p) => (_jsxs("span", { className: "block text-destructive", children: [p.orderNumber ?? "Een order", " heeft nog geen karindeling en is nog niet aangemeld", g.wait_until && new Date(g.wait_until).getTime() > Date.now() ? ` — de mail wacht tot ${fmtTime(g.wait_until, tz)}` : ""] }, p.orderId))), (g.late_order_ids ?? []).length > 0 ? (_jsxs("span", { className: "block text-destructive", children: ["Te laat aangemeld: ", (g.late_order_ids ?? []).length, " ", (g.late_order_ids ?? []).length === 1 ? "order" : "orders", " \u2014 de vervoerder wordt gevraagd te bevestigen"] })) : null] }), compact ? null : (_jsxs("span", { className: "flex gap-2", children: [_jsx(Button, { size: "sm", variant: "outline", onClick: onPreview, children: "Voorbeeld bekijken" }), _jsx(Button, { size: "sm", disabled: !enabled || upToDate || m.isPending, onClick: () => m.mutate(), children: m.isPending ? "Versturen…" : "Nu versturen" })] }))] }));
|
|
67
69
|
}
|
|
68
70
|
function PreviewDialog({ g, onClose }) {
|
|
69
71
|
const fetchPreview = useServerFn(previewSignupMail);
|
|
@@ -5,11 +5,11 @@ import { Truck, User, Mail, Phone, MapPin, Calendar, Clock, FileText, Globe, Plu
|
|
|
5
5
|
import { Link, useNavigate } from "@tanstack/react-router";
|
|
6
6
|
import { useServerFn } from "@tanstack/react-start";
|
|
7
7
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
8
|
-
import { getCarrier, upsertCarrier, } from "../../lib/carriers.functions";
|
|
9
|
-
import { DEFAULT_PICKUP_MOMENT } from "../../lib/planning";
|
|
10
|
-
import { COUNTRIES, countryName } from "../../lib/countries";
|
|
11
|
-
import { ServiceAreaSelect } from "./ServiceAreaSelect";
|
|
12
|
-
import { WeekdayPicker } from "./WeekdayPicker";
|
|
8
|
+
import { getCarrier, upsertCarrier, } from "../../lib/carriers.functions.js";
|
|
9
|
+
import { DEFAULT_PICKUP_MOMENT } from "../../lib/planning.js";
|
|
10
|
+
import { COUNTRIES, countryName } from "../../lib/countries.js";
|
|
11
|
+
import { ServiceAreaSelect } from "./ServiceAreaSelect.js";
|
|
12
|
+
import { WeekdayPicker } from "./WeekdayPicker.js";
|
|
13
13
|
const EMPTY = {
|
|
14
14
|
name: "",
|
|
15
15
|
contact_person: "",
|
|
@@ -141,7 +141,7 @@ export function VervoerderForm({ carrierId }) {
|
|
|
141
141
|
},
|
|
142
142
|
onSuccess: async () => {
|
|
143
143
|
toast.success(isEdit ? "Vervoerder bijgewerkt" : "Vervoerder aangemaakt");
|
|
144
|
-
const { invalidatePlanning } = await import("../../lib/invalidatePlanning");
|
|
144
|
+
const { invalidatePlanning } = await import("../../lib/invalidatePlanning.js");
|
|
145
145
|
await invalidatePlanning(queryClient);
|
|
146
146
|
if (carrierId)
|
|
147
147
|
queryClient.invalidateQueries({ queryKey: ["carrier", carrierId] });
|
|
@@ -2,15 +2,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { Button, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogDescription, AlertDialogTitle, toast, } from "@flowselections/core";
|
|
4
4
|
import { Plus, Pencil, Trash2, Truck, ArrowUp, ArrowDown } from "lucide-react";
|
|
5
|
-
import { ResponsiveAlertDialogBody, ResponsiveAlertDialogContent, ResponsiveAlertDialogFooter, ResponsiveAlertDialogHeader, } from "
|
|
5
|
+
import { ResponsiveAlertDialogBody, ResponsiveAlertDialogContent, ResponsiveAlertDialogFooter, ResponsiveAlertDialogHeader, } from "../../components/ui/responsive-dialog.js";
|
|
6
6
|
import { Link } from "@tanstack/react-router";
|
|
7
7
|
import { useServerFn } from "@tanstack/react-start";
|
|
8
8
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
9
|
-
import { toServerFnError } from "../../lib/serverFnError";
|
|
10
|
-
import { listCarriers, deleteCarrier, reorderCarriers } from "../../lib/carriers.functions";
|
|
11
|
-
import { carrierLeadDaysFromMoments } from "../../lib/carrierPlanning";
|
|
12
|
-
import { VervoerderForm } from "./VervoerderForm";
|
|
13
|
-
import { resolveCarrierId } from "./VervoerderBewerkenPage";
|
|
9
|
+
import { toServerFnError } from "../../lib/serverFnError.js";
|
|
10
|
+
import { listCarriers, deleteCarrier, reorderCarriers } from "../../lib/carriers.functions.js";
|
|
11
|
+
import { carrierLeadDaysFromMoments } from "../../lib/carrierPlanning.js";
|
|
12
|
+
import { VervoerderForm } from "./VervoerderForm.js";
|
|
13
|
+
import { resolveCarrierId } from "./VervoerderBewerkenPage.js";
|
|
14
14
|
/**
|
|
15
15
|
* Bewerken gebeurt via een searchparam (?id=<uuid>) i.p.v. een dynamisch
|
|
16
16
|
* URL-segment, zodat het ook werkt in hosts/shells die alleen statische
|
|
@@ -44,7 +44,7 @@ function VervoerdersLijst() {
|
|
|
44
44
|
mutationFn: (id) => removeCarrier({ data: { id } }),
|
|
45
45
|
onSuccess: async () => {
|
|
46
46
|
toast.success("Vervoerder verwijderd");
|
|
47
|
-
const { invalidatePlanning } = await import("../../lib/invalidatePlanning");
|
|
47
|
+
const { invalidatePlanning } = await import("../../lib/invalidatePlanning.js");
|
|
48
48
|
await invalidatePlanning(queryClient);
|
|
49
49
|
setDeletingId(null);
|
|
50
50
|
},
|
|
@@ -53,7 +53,7 @@ function VervoerdersLijst() {
|
|
|
53
53
|
const reorderMutation = useMutation({
|
|
54
54
|
mutationFn: (orderedIds) => reorder({ data: { orderedIds } }),
|
|
55
55
|
onSuccess: async () => {
|
|
56
|
-
const { invalidatePlanning } = await import("../../lib/invalidatePlanning");
|
|
56
|
+
const { invalidatePlanning } = await import("../../lib/invalidatePlanning.js");
|
|
57
57
|
await invalidatePlanning(queryClient);
|
|
58
58
|
},
|
|
59
59
|
onError: (err) => toast.error(err.message),
|
|
@@ -3,13 +3,13 @@ import { useEffect, useMemo, useState } from "react";
|
|
|
3
3
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
4
|
import { useServerFn } from "@tanstack/react-start";
|
|
5
5
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, Badge, Button, Dialog, DialogTitle, DialogDescription, Input, Label, Textarea, toast, } from "@flowselections/core";
|
|
6
|
-
import { ResponsiveDialogBody, ResponsiveDialogContent, ResponsiveDialogFooter, ResponsiveDialogHeader, } from "
|
|
7
|
-
import { applyReschedule, listRescheduleHistory, previewReschedule, getPickMoments, setPickDay, } from "../../lib/logisticsEngine/reschedule";
|
|
8
|
-
import { ENGINE_TASKS_KEY } from "../../hooks/useEngineTasks";
|
|
9
|
-
import { listCarriers } from "../../lib/carriers.functions";
|
|
10
|
-
import { normalizePickupMoments, selectCarrierForTarget } from "../../lib/carrierPlanning";
|
|
11
|
-
import { safeServerCall } from "../../lib/serverFnError";
|
|
12
|
-
import { amsterdamDay, formatAmsterdam } from "../../lib/timezone";
|
|
6
|
+
import { ResponsiveDialogBody, ResponsiveDialogContent, ResponsiveDialogFooter, ResponsiveDialogHeader, } from "../../components/ui/responsive-dialog.js";
|
|
7
|
+
import { applyReschedule, listRescheduleHistory, previewReschedule, getPickMoments, setPickDay, } from "../../lib/logisticsEngine/reschedule.js";
|
|
8
|
+
import { ENGINE_TASKS_KEY } from "../../hooks/useEngineTasks.js";
|
|
9
|
+
import { listCarriers } from "../../lib/carriers.functions.js";
|
|
10
|
+
import { normalizePickupMoments, selectCarrierForTarget } from "../../lib/carrierPlanning.js";
|
|
11
|
+
import { safeServerCall } from "../../lib/serverFnError.js";
|
|
12
|
+
import { amsterdamDay, formatAmsterdam } from "../../lib/timezone.js";
|
|
13
13
|
function fmtDateTime(v) {
|
|
14
14
|
if (!v)
|
|
15
15
|
return "—";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FloridayOrder } from "../../lib/floriday.functions";
|
|
2
|
-
import type { PlannedOrder } from "../../hooks/useOrderPlanning";
|
|
1
|
+
import type { FloridayOrder } from "../../lib/floriday.functions.js";
|
|
2
|
+
import type { PlannedOrder } from "../../hooks/useOrderPlanning.js";
|
|
3
3
|
export type WeekAgendaMode = "delivery" | "pickup" | "transport-register" | "pick";
|
|
4
4
|
export interface WeekAgendaViewProps {
|
|
5
5
|
planned: PlannedOrder[];
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { useQuery } from "@tanstack/react-query";
|
|
4
|
-
import { supabase } from "../../integrations/supabase/moduleClient";
|
|
5
|
-
import { isExcludedOrderStatus, normalizeOrderStatus } from "../../lib/orderStatus";
|
|
4
|
+
import { supabase } from "../../integrations/supabase/moduleClient.js";
|
|
5
|
+
import { isExcludedOrderStatus, normalizeOrderStatus } from "../../lib/orderStatus.js";
|
|
6
6
|
import { Button, Badge } from "@flowselections/core";
|
|
7
7
|
import { ChevronLeft, ChevronRight, Package, Truck, Sprout, Clock, CheckCircle2, Scale } from "lucide-react";
|
|
8
|
-
import { isSameDay, startOfWeek, addDays } from "../../lib/pickDate";
|
|
9
|
-
import { useCapacityCheck } from "../../hooks/useCapacityCheck";
|
|
10
|
-
import { usePickAgenda } from "../../hooks/usePickAgenda";
|
|
11
|
-
import { useConsistencyCheck } from "../../hooks/useConsistencyCheck";
|
|
12
|
-
import { CapacityWarning } from "./CapacityWarning";
|
|
13
|
-
import { SignupMailMoments } from "./SignupMailMoments";
|
|
14
|
-
import { toDayKey } from "../../lib/logisticsEngine/capacity";
|
|
8
|
+
import { isSameDay, startOfWeek, addDays } from "../../lib/pickDate.js";
|
|
9
|
+
import { useCapacityCheck } from "../../hooks/useCapacityCheck.js";
|
|
10
|
+
import { usePickAgenda } from "../../hooks/usePickAgenda.js";
|
|
11
|
+
import { useConsistencyCheck } from "../../hooks/useConsistencyCheck.js";
|
|
12
|
+
import { CapacityWarning } from "./CapacityWarning.js";
|
|
13
|
+
import { SignupMailMoments } from "./SignupMailMoments.js";
|
|
14
|
+
import { toDayKey } from "../../lib/logisticsEngine/capacity.js";
|
|
15
15
|
const SHIPPED = new Set(["verzonden", "gereed voor facturatie", "gefactureerd", "geleverd", "afgeleverd", "afgerond", "afgehandeld", "afgemeld", "shipped", "delivered", "completed", "invoiced"]);
|
|
16
16
|
/** Eén indeling per order. Floriday herkend op Floriday-id; afmeldstand uit de order. */
|
|
17
17
|
function classify(o, scanned) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/** Leest de ingestelde werkplek client-side (SSR-veilig). */
|
|
2
|
-
export declare function useWerkplek(): string | null;
|
|
3
|
-
/**
|
|
4
|
-
* Eén melding bovenaan een printscherm zolang er geen werkplek is ingesteld.
|
|
5
|
-
* Printknoppen zijn dan uitgeschakeld, zodat er geen fout per printactie komt.
|
|
6
|
-
*/
|
|
7
|
-
export declare function WerkplekWaarschuwing({ werkplek }: {
|
|
8
|
-
werkplek: string | null;
|
|
9
|
-
}): import("react").JSX.Element | null;
|
|
1
|
+
/** Leest de ingestelde werkplek client-side (SSR-veilig). */
|
|
2
|
+
export declare function useWerkplek(): string | null;
|
|
3
|
+
/**
|
|
4
|
+
* Eén melding bovenaan een printscherm zolang er geen werkplek is ingesteld.
|
|
5
|
+
* Printknoppen zijn dan uitgeschakeld, zodat er geen fout per printactie komt.
|
|
6
|
+
*/
|
|
7
|
+
export declare function WerkplekWaarschuwing({ werkplek }: {
|
|
8
|
+
werkplek: string | null;
|
|
9
|
+
}): import("react").JSX.Element | null;
|
|
10
10
|
//# sourceMappingURL=WerkplekWaarschuwing.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { AlertTriangle } from "lucide-react";
|
|
4
|
-
import { getWerkplek } from "../../lib/printing";
|
|
4
|
+
import { getWerkplek } from "../../lib/printing.js";
|
|
5
5
|
/** Leest de ingestelde werkplek client-side (SSR-veilig). */
|
|
6
6
|
export function useWerkplek() {
|
|
7
7
|
const [werkplek, setWerkplekState] = useState(null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PickstationOrder } from "../../lib/pickstationTypes";
|
|
2
|
-
import { type PickstationLang } from "../../lib/pickstationI18n";
|
|
1
|
+
import type { PickstationOrder } from "../../lib/pickstationTypes.js";
|
|
2
|
+
import { type PickstationLang } from "../../lib/pickstationI18n.js";
|
|
3
3
|
/** Returns a fully self-contained printable HTML document for one packing slip per cart. */
|
|
4
4
|
export declare function renderPakbonHtml(order: {
|
|
5
5
|
id: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getPrintDict, PICKSTATION_LOCALE, } from "../../lib/pickstationI18n";
|
|
1
|
+
import { getPrintDict, PICKSTATION_LOCALE, } from "../../lib/pickstationI18n.js";
|
|
2
2
|
/** Returns a fully self-contained printable HTML document for one packing slip per cart. */
|
|
3
3
|
export function renderPakbonHtml(order, lang = "nl") {
|
|
4
4
|
const t = getPrintDict(lang);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Dunne wrappers rond de centrale printlaag. De verborgen iframes zijn
|
|
2
2
|
// verwijderd: alles gaat via de printwachtrij van de Layout maker.
|
|
3
|
-
import { printHtmlDocument, printPdfDocument, } from "../../lib/printing";
|
|
3
|
+
import { printHtmlDocument, printPdfDocument, } from "../../lib/printing.js";
|
|
4
4
|
export async function printHtml(html, opties) {
|
|
5
5
|
await printHtmlDocument({ ...opties, html });
|
|
6
6
|
}
|
|
@@ -4,9 +4,9 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
|
4
4
|
import { useServerFn } from "@tanstack/react-start";
|
|
5
5
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Button, Input, Label, Switch, toast, } from "@flowselections/core";
|
|
6
6
|
import { CalendarClock, Mail } from "lucide-react";
|
|
7
|
-
import { getAfhandelingSettings, updateAfhandelingSettings, } from "../../lib/afhandelingSettings.functions";
|
|
8
|
-
import { getSignupCronStatus } from "../../lib/carrierSignup.functions";
|
|
9
|
-
import { fmtTime, signupReasonText } from "../../lib/signupMailText";
|
|
7
|
+
import { getAfhandelingSettings, updateAfhandelingSettings, } from "../../lib/afhandelingSettings.functions.js";
|
|
8
|
+
import { getSignupCronStatus } from "../../lib/carrierSignup.functions.js";
|
|
9
|
+
import { fmtTime, signupReasonText } from "../../lib/signupMailText.js";
|
|
10
10
|
export function AfhandelingSettingsCard() {
|
|
11
11
|
const qc = useQueryClient();
|
|
12
12
|
const fetchSettings = useServerFn(getAfhandelingSettings);
|
|
@@ -55,7 +55,7 @@ export function AfhandelingSettingsCard() {
|
|
|
55
55
|
},
|
|
56
56
|
}),
|
|
57
57
|
onSuccess: async () => {
|
|
58
|
-
const { invalidatePlanning } = await import("../../lib/invalidatePlanning");
|
|
58
|
+
const { invalidatePlanning } = await import("../../lib/invalidatePlanning.js");
|
|
59
59
|
await invalidatePlanning(qc);
|
|
60
60
|
try {
|
|
61
61
|
const st = await fetchCronStatus({ data: { sync: true } });
|