@flowselections/floriday-verkoop-module 1.0.118 → 1.0.121
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/verkoop/CreateOrderPage.d.ts.map +1 -1
- package/dist-lib/components/verkoop/CreateOrderPage.js +39 -26
- package/dist-lib/components/verkoop/FloridayStageLine.d.ts.map +1 -1
- package/dist-lib/components/verkoop/FloridayStageLine.js +4 -2
- package/dist-lib/components/verkoop/SalesOrderDetailPage.d.ts.map +1 -1
- package/dist-lib/components/verkoop/SalesOrderDetailPage.js +9 -3
- package/dist-lib/components/verkoop/SearchableSelect.d.ts +2 -0
- package/dist-lib/components/verkoop/SearchableSelect.d.ts.map +1 -1
- package/dist-lib/components/verkoop/SearchableSelect.js +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +64 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/carrier-resolve.d.ts.map +1 -1
- package/dist-lib/lib/carrier-resolve.js +4 -1
- package/dist-lib/lib/create-order.functions.d.ts +1 -0
- package/dist-lib/lib/create-order.functions.d.ts.map +1 -1
- package/dist-lib/lib/create-order.functions.js +44 -29
- package/dist-lib/lib/floriday-write-mode.d.ts +2 -0
- package/dist-lib/lib/floriday-write-mode.d.ts.map +1 -0
- package/dist-lib/lib/floriday-write-mode.functions.d.ts +9 -0
- package/dist-lib/lib/floriday-write-mode.functions.d.ts.map +1 -0
- package/dist-lib/lib/floriday-write-mode.functions.js +17 -0
- package/dist-lib/lib/floriday-write-mode.js +11 -0
- package/dist-lib/lib/module-version.d.ts +1 -1
- package/dist-lib/lib/module-version.js +1 -1
- package/dist-lib/lib/order-cancel.server.d.ts.map +1 -1
- package/dist-lib/lib/order-cancel.server.js +11 -10
- package/dist-lib/lib/order-shipments.functions.d.ts.map +1 -1
- package/dist-lib/lib/order-shipments.functions.js +2 -1
- package/dist-lib/lib/plan-coverage.server.d.ts +9 -0
- package/dist-lib/lib/plan-coverage.server.d.ts.map +1 -1
- package/dist-lib/lib/plan-coverage.server.js +20 -0
- package/dist-lib/lib/salesorders-list.functions.d.ts.map +1 -1
- package/dist-lib/lib/salesorders-list.functions.js +6 -0
- package/dist-lib/lib/salesorders-list.server.d.ts.map +1 -1
- package/dist-lib/lib/salesorders-list.server.js +4 -0
- package/dist-lib/lib/salesorders-mapping.d.ts +4 -0
- package/dist-lib/lib/salesorders-mapping.d.ts.map +1 -1
- package/dist-lib/lib/salesorders.functions.d.ts.map +1 -1
- package/dist-lib/lib/salesorders.functions.js +6 -0
- package/dist-lib/lib/stock-errors.check.d.ts +2 -0
- package/dist-lib/lib/stock-errors.check.d.ts.map +1 -0
- package/dist-lib/lib/stock-errors.check.js +15 -0
- package/dist-lib/lib/stock-errors.d.ts +6 -0
- package/dist-lib/lib/stock-errors.d.ts.map +1 -0
- package/dist-lib/lib/stock-errors.js +15 -0
- package/dist-lib/lib/testronde-1119.check.d.ts +2 -0
- package/dist-lib/lib/testronde-1119.check.d.ts.map +1 -0
- package/dist-lib/lib/testronde-1119.check.js +20 -0
- package/dist-lib/lib/useFloridayWriteMode.d.ts +3 -0
- package/dist-lib/lib/useFloridayWriteMode.d.ts.map +1 -0
- package/dist-lib/lib/useFloridayWriteMode.js +15 -0
- package/dist-lib/lib/zero-price-write-mode.check.d.ts +2 -0
- package/dist-lib/lib/zero-price-write-mode.check.d.ts.map +1 -0
- package/dist-lib/lib/zero-price-write-mode.check.js +18 -0
- package/dist-lib/lib/zero-price.d.ts +9 -0
- package/dist-lib/lib/zero-price.d.ts.map +1 -0
- package/dist-lib/lib/zero-price.js +9 -0
- package/package.json +1 -1
- package/schema/verkoop.sql +14 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateOrderPage.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/CreateOrderPage.tsx"],"names":[],"mappings":"AAkGA,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"CreateOrderPage.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/CreateOrderPage.tsx"],"names":[],"mappings":"AAkGA,wBAAgB,eAAe,gCAoiC9B"}
|
|
@@ -332,6 +332,11 @@ export function CreateOrderPage() {
|
|
|
332
332
|
// Eén kenmerk per formulier: dubbel klikken of opnieuw proberen geeft
|
|
333
333
|
// dezelfde bestelling terug in plaats van een tweede.
|
|
334
334
|
const idempotencyKeyRef = useRef(null);
|
|
335
|
+
// Prijs € 0 moet je uitdrukkelijk bevestigen; vervalt zodra de regels wijzigen.
|
|
336
|
+
const zeroPriceOkRef = useRef(false);
|
|
337
|
+
const [zeroConfirmOpen, setZeroConfirmOpen] = useState(false);
|
|
338
|
+
useEffect(() => { zeroPriceOkRef.current = false; }, [lines]);
|
|
339
|
+
const zeroPriceCount = lines.filter((l) => l.product_id && !(Number(l.unit_price) > 0)).length;
|
|
335
340
|
const createMut = useMutation({
|
|
336
341
|
mutationFn: async (opts) => {
|
|
337
342
|
if (!customerId)
|
|
@@ -402,6 +407,7 @@ export function CreateOrderPage() {
|
|
|
402
407
|
ownTransport: !isReservation && ownTransport,
|
|
403
408
|
customerReference: customerReference.trim() ? customerReference.trim() : null,
|
|
404
409
|
acceptLateSignup,
|
|
410
|
+
confirmZeroPrice: zeroPriceOkRef.current,
|
|
405
411
|
deliveryDate: isReservation ? null : deliveryDate,
|
|
406
412
|
isReservation,
|
|
407
413
|
loadCarrierType,
|
|
@@ -461,6 +467,8 @@ export function CreateOrderPage() {
|
|
|
461
467
|
return (_jsxs("main", { className: "space-y-5 p-6", children: [_jsx("div", { children: _jsx(Button, { asChild: true, variant: "ghost", size: "sm", children: _jsxs(Link, { to: "/floriday-verkoop/verkooporders", children: [_jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), "Terug naar verkooporders"] }) }) }), loadErrors.length > 0 && (_jsx("div", { className: "rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive", children: loadErrors.map((m) => _jsx("div", { children: m }, m)) })), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Nieuwe Bestelling" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Doorloop de stappen: klant \u2192 afleverlocatie \u2192 afhaallocatie \u2192 vervoerder \u2192 leverdatum \u2192 producten." })] }), _jsxs(CardContent, { className: "space-y-5", children: [_jsxs("div", { className: "space-y-1", children: [_jsxs(Label, { className: "flex items-center gap-2", children: ["Klant ", _jsx("span", { className: "text-destructive", children: "*" })] }), _jsx(SearchableSelect, { value: customerId, placeholder: customersQ.isLoading ? "Laden..." : "Kies klant...", options: customers.map((c) => ({
|
|
462
468
|
value: c.id,
|
|
463
469
|
label: c.company_name ?? "Onbekend",
|
|
470
|
+
// Alleen zoeken op naam en klantcode, niet op e-mail.
|
|
471
|
+
search: c.twinfield_code ? String(c.twinfield_code) : null,
|
|
464
472
|
hint: c.source === "twinfield" && String(c.id).startsWith("twinfield:")
|
|
465
473
|
? `Twinfield ${c.twinfield_code}${c.email ? ` · ${c.email}` : ""}`
|
|
466
474
|
: (c.email ?? undefined),
|
|
@@ -485,7 +493,7 @@ export function CreateOrderPage() {
|
|
|
485
493
|
? `Vervoerder: ${carriers.find((c) => c.id === carrierId)?.name ?? "onbekend"} – handmatig gekozen`
|
|
486
494
|
: preview?.carrierId
|
|
487
495
|
? `Vervoerder: ${carriers.find((c) => c.id === preview.carrierId)?.name ?? "onbekend"} – voorgesteld door de Logistiek Engine; na aanmaken zie je de reden bij de order`
|
|
488
|
-
: "Vervoerder: nog onbekend – de Logistiek Engine kiest bij het aanmaken" }))] })), _jsxs("div", { className: "space-y-1", children: [_jsxs(Label, { className: "flex items-center gap-2", children: ["Leverdatum ", !isReservation && _jsx("span", { className: "text-destructive", children: "*" })] }), _jsx(Input, { type: "date", value: !isReservation && canPickDate ? deliveryDate : "", disabled: isReservation || !canPickDate, onChange: (e) => { setDeliveryDate(e.target.value || ""); setMomentKey(null); } }), _jsxs("label", { className: "mt-1 flex items-center gap-2 text-sm text-foreground", children: [_jsx("input", { type: "checkbox", checked: isReservation, onChange: (e) => setIsReservation(e.target.checked), className: "h-4 w-4 rounded border-input" }), "Reservering (nog geen vaste leverdatum)"] }), !isReservation && (_jsxs("label", { className: "flex items-center gap-2 text-sm text-foreground", children: [_jsx("input", { type: "checkbox", checked: ownTransport, onChange: (e) => { setOwnTransport(e.target.checked); setMomentKey(null); }, className: "h-4 w-4 rounded border-input" }), "Eigen vervoer / zelf afleveren (geen vervoerder)"] })), isReservation ? (_jsx("div", { className: "text-xs text-muted-foreground", children: "De bestelling wordt als reservering aangemaakt zonder leverdatumvalidatie." })) : !canPickDate ? (_jsx("div", { className: "text-xs text-muted-foreground", children: "Selecteer eerst klant, afleverlocatie en afhaallocatie." })) : !decision ? (_jsx("div", { className: "text-xs text-muted-foreground", children: "Ophaalmoment ophalen\u2026" })) : decision.kind === "blocked" ? (_jsx("div", { className: "text-xs text-destructive", children: decision.reason })) : decision.kind === "departed" ? (_jsxs("div", { className: "space-y-2 rounded-md border border-destructive/40 p-2 text-xs", children: [_jsx("div", { className: "text-destructive", children: decision.reason }), firstDateText(decision.firstDate, decision.next?.signupDeadline ?? null) && (_jsx("div", { className: "text-muted-foreground", children: firstDateText(decision.firstDate, decision.next?.signupDeadline ?? null) })), _jsxs("div", { className: "flex flex-wrap gap-2", children: [decision.firstDate && (_jsxs(Button, { type: "button", size: "sm", variant: "outline", onClick: () => { setDeliveryDate(decision.firstDate); setMomentKey(null); }, children: ["Gebruik ", fmtDate(decision.firstDate)] })), _jsx(Button, { type: "button", size: "sm", variant: "outline", onClick: () => { setOwnTransport(true); setMomentKey(null); }, children: "Eigen vervoer / zelf afleveren" })] })] })) : (_jsxs("div", { className: "space-y-2 text-xs", children: [!ownTransport && preview && preview.moments.length > 0 && (_jsx("select", { className: "h-9 w-full rounded-md border border-border bg-background px-2 text-sm text-foreground", value: momentKey ?? decision.momentKey ?? "", onChange: (e) => setMomentKey(e.target.value || null), "aria-label": "Ophaalmoment kiezen", children: preview.moments.map((m) => (_jsxs("option", { value: m.momentKey, disabled: !m.feasible, className: m.feasible ? "" : "text-muted-foreground", children: [momentLabel(m), m.feasible ? "" : " (niet haalbaar)"] }, m.momentKey))) })), decision.text && _jsx("div", { className: "text-foreground", children: decision.text }), decision.kind === "late" && (_jsxs("div", { className: "space-y-2 rounded-md border border-destructive/40 p-2", children: [_jsx("div", { className: "text-destructive", children: decision.reason }), (firstDateText(decision.firstDate, preview?.nextFeasibleMoment?.signupDeadline ?? null) ?? decision.firstReason) && (_jsx("div", { className: "text-muted-foreground", children: firstDateText(decision.firstDate, preview?.nextFeasibleMoment?.signupDeadline ?? null) ?? decision.firstReason })), _jsxs("div", { className: "flex flex-wrap gap-2", children: [decision.firstDate && (_jsxs(Button, { type: "button", size: "sm", variant: "outline", onClick: () => { setDeliveryDate(decision.firstDate); setMomentKey(null); }, children: ["Gebruik ", fmtDate(decision.firstDate)] })), _jsxs(Button, { type: "button", size: "sm", variant: "outline", disabled: createMut.isPending, onClick: () => setLateConfirmOpen(true), children: ["Toch aanmaken voor ", deliveryDate ? fmtDate(deliveryDate) : "de gekozen datum"] })] })] }))] }))] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { children: "Bestelregels" }), _jsxs("div", { className: "grid grid-cols-12 gap-2 text-xs text-muted-foreground px-1", children: [_jsx("div", { className: "col-span-3", children: "Product" }), _jsx("div", { className: "col-span-1 text-center", children: "Sticker" }), _jsx("div", { className: "col-span-3", children: "Belading" }), _jsx("div", { className: "col-span-2", children: "Fusten" }), _jsx("div", { className: "col-span-2", children: "Prijs" }), _jsx("div", { className: "col-span-1" })] }), lines.map((line, idx) => {
|
|
496
|
+
: "Vervoerder: nog onbekend – de Logistiek Engine kiest bij het aanmaken" }))] })), _jsxs("div", { className: "space-y-1", children: [_jsxs(Label, { className: "flex items-center gap-2", children: ["Leverdatum ", !isReservation && _jsx("span", { className: "text-destructive", children: "*" })] }), _jsx(Input, { type: "date", value: !isReservation && canPickDate ? deliveryDate : "", disabled: isReservation || !canPickDate, onChange: (e) => { setDeliveryDate(e.target.value || ""); setMomentKey(null); } }), _jsxs("label", { className: "mt-1 flex items-center gap-2 text-sm text-foreground", children: [_jsx("input", { type: "checkbox", checked: isReservation, onChange: (e) => setIsReservation(e.target.checked), className: "h-4 w-4 rounded border-input" }), "Reservering (nog geen vaste leverdatum)"] }), !isReservation && (_jsxs("label", { className: "flex items-center gap-2 text-sm text-foreground", children: [_jsx("input", { type: "checkbox", checked: ownTransport, onChange: (e) => { setOwnTransport(e.target.checked); setMomentKey(null); }, className: "h-4 w-4 rounded border-input" }), "Eigen vervoer / zelf afleveren (geen vervoerder)"] })), isReservation ? (_jsx("div", { className: "text-xs text-muted-foreground", children: "De bestelling wordt als reservering aangemaakt zonder leverdatumvalidatie." })) : !canPickDate ? (_jsx("div", { className: "text-xs text-muted-foreground", children: "Selecteer eerst klant, afleverlocatie en afhaallocatie." })) : !decision ? (_jsx("div", { className: "text-xs text-muted-foreground", children: "Ophaalmoment ophalen\u2026" })) : decision.kind === "blocked" ? (_jsx("div", { className: "text-xs text-destructive", children: decision.reason })) : decision.kind === "departed" ? (_jsxs("div", { className: "space-y-2 rounded-md border border-destructive/40 p-2 text-xs", children: [_jsx("div", { className: "text-destructive", children: decision.reason }), firstDateText(decision.firstDate, decision.next?.signupDeadline ?? null) && (_jsx("div", { className: "text-muted-foreground", children: firstDateText(decision.firstDate, decision.next?.signupDeadline ?? null) })), _jsxs("div", { className: "flex flex-wrap gap-2", children: [decision.firstDate && (_jsxs(Button, { type: "button", size: "sm", variant: "outline", onClick: () => { setDeliveryDate(decision.firstDate); setMomentKey(null); }, children: ["Gebruik ", fmtDate(decision.firstDate)] })), _jsx(Button, { type: "button", size: "sm", variant: "outline", onClick: () => { setOwnTransport(true); setMomentKey(null); }, children: "Eigen vervoer / zelf afleveren" })] })] })) : (_jsxs("div", { className: "space-y-2 text-xs", children: [!ownTransport && preview && preview.moments.length > 0 && (_jsx("select", { className: "h-9 w-full rounded-md border border-border bg-background px-2 text-sm text-foreground", value: momentKey ?? decision.momentKey ?? "", onChange: (e) => setMomentKey(e.target.value || null), "aria-label": "Ophaalmoment kiezen", children: preview.moments.map((m) => (_jsxs("option", { value: m.momentKey, disabled: !m.feasible, className: m.feasible ? "" : "text-muted-foreground", children: [momentLabel(m), m.feasible ? "" : " (niet haalbaar)"] }, m.momentKey))) })), decision.text && _jsx("div", { className: "text-foreground", children: decision.text }), decision.kind === "late" && (_jsxs("div", { className: "space-y-2 rounded-md border border-destructive/40 p-2", children: [_jsx("div", { className: "text-destructive", children: decision.reason }), (firstDateText(decision.firstDate, preview?.nextFeasibleMoment?.signupDeadline ?? null) ?? decision.firstReason) && (_jsx("div", { className: "text-muted-foreground", children: firstDateText(decision.firstDate, preview?.nextFeasibleMoment?.signupDeadline ?? null) ?? decision.firstReason })), _jsxs("div", { className: "flex flex-wrap gap-2", children: [decision.firstDate && (_jsxs(Button, { type: "button", size: "sm", variant: "outline", onClick: () => { setDeliveryDate(decision.firstDate); setMomentKey(null); }, children: ["Gebruik ", fmtDate(decision.firstDate)] })), _jsxs(Button, { type: "button", size: "sm", variant: "outline", disabled: createMut.isPending, onClick: () => setLateConfirmOpen(true), children: ["Toch aanmaken voor ", deliveryDate ? fmtDate(deliveryDate) : "de gekozen datum"] })] })] }))] }))] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { children: "Bestelregels" }), _jsxs("div", { className: "hidden lg:grid grid-cols-12 gap-2 text-xs text-muted-foreground px-1", children: [_jsx("div", { className: "col-span-3", children: "Product" }), _jsx("div", { className: "col-span-1 text-center", children: "Sticker" }), _jsx("div", { className: "col-span-3", children: "Belading" }), _jsx("div", { className: "col-span-2", children: "Fusten" }), _jsx("div", { className: "col-span-2", children: "Prijs" }), _jsx("div", { className: "col-span-1" })] }), lines.map((line, idx) => {
|
|
489
497
|
const product = line.product_id ? products.find((p) => p.id === line.product_id) : null;
|
|
490
498
|
const defaultBelading = completeBelading(product);
|
|
491
499
|
const effBelading = completeBelading(line.belading) ?? defaultBelading;
|
|
@@ -517,7 +525,7 @@ export function CreateOrderPage() {
|
|
|
517
525
|
const defaultKey = dbDefault
|
|
518
526
|
? beladingKey(dbDefault)
|
|
519
527
|
: defaultBelading ? beladingKey(defaultBelading) : null;
|
|
520
|
-
return (_jsxs("div", { className: "grid grid-cols-
|
|
528
|
+
return (_jsxs("div", { className: "grid grid-cols-2 gap-2 items-start rounded-md border p-2 lg:grid-cols-12 lg:border-0 lg:p-0", children: [_jsxs("div", { className: "col-span-2 lg:col-span-3", children: [_jsx("div", { className: "mb-1 text-xs text-muted-foreground lg:hidden", children: "Product" }), _jsx(SearchableSelect, { value: line.product_id, placeholder: "Kies product...", clearLabel: "\u2014 Handmatig \u2014", options: products.map((p) => {
|
|
521
529
|
const code = p.article_code ? `${p.article_code} · ` : "";
|
|
522
530
|
const label = p.in_stock
|
|
523
531
|
? `${code}${p.product}`
|
|
@@ -585,11 +593,11 @@ export function CreateOrderPage() {
|
|
|
585
593
|
} }), outOfStock && (_jsx("div", { className: "mt-1 text-xs text-amber-600", children: "Let op: dit product staat momenteel niet op voorraad." })), line.product_id && shortageByProduct.has(line.product_id) && (_jsx("div", { className: `mt-1 text-xs ${stockBlocked ? "text-destructive" : "text-amber-600"}`, children: (() => {
|
|
586
594
|
const s = shortageByProduct.get(line.product_id);
|
|
587
595
|
return `${s.product}: besteld ${s.wanted}, beschikbaar ${s.available}, tekort ${s.missing}`;
|
|
588
|
-
})() }))] }),
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
596
|
+
})() }))] }), _jsxs("div", { className: "col-span-2 flex h-10 items-center gap-2 lg:col-span-1 lg:justify-center", children: [_jsx("input", { type: "checkbox", className: "h-4 w-4 accent-primary", "aria-label": "Sticker nodig", title: "Sticker nodig", checked: line.needs_sticker === true, disabled: !line.product_id, onChange: (e) => {
|
|
597
|
+
const next = [...lines];
|
|
598
|
+
next[idx] = { ...next[idx], needs_sticker: e.target.checked, sticker_manual_for: line.product_id };
|
|
599
|
+
setLines(next);
|
|
600
|
+
} }), _jsx("span", { className: "text-sm lg:hidden", children: "Sticker nodig" })] }), _jsxs("div", { className: "col-span-2 lg:col-span-3", children: [_jsx("div", { className: "mb-1 text-xs text-muted-foreground lg:hidden", children: "Belading" }), _jsx(SearchableSelect, { value: effBelading ? beladingKey(effBelading) : null, placeholder: !line.product_id ? "Kies eerst product"
|
|
593
601
|
: loadingBeladingen ? "Beladingen laden..."
|
|
594
602
|
: noBeladingen ? "Geen belading beschikbaar"
|
|
595
603
|
: "Kies belading...", disabled: !line.product_id || loadingBeladingen || noBeladingen, allowClear: false, emptyLabel: "Geen belading gekoppeld aan dit product", options: Array.from(optionMap.entries()).map(([key, b]) => ({
|
|
@@ -615,29 +623,34 @@ export function CreateOrderPage() {
|
|
|
615
623
|
quantity: crates * b.plants_per_crate,
|
|
616
624
|
};
|
|
617
625
|
setLines(next);
|
|
618
|
-
} }), noBeladingen ? (_jsx("div", { className: "mt-1 text-xs text-amber-600", children: "Geen belading bekend voor dit product." })) : effBelading && (_jsxs("div", { className: "mt-1 text-xs text-muted-foreground", children: [plants ?? 0, " planten", beladingTypes(effBelading) ? ` · ${beladingTypes(effBelading)}` : "", defaultKey && beladingKey(effBelading) !== defaultKey ? " · afwijkend van standaard" : ""] }))] }),
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
}), lines.some((l) => l.product_id && !(Number(l.unit_price) > 0)) && (_jsxs("div", { className: "rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: ["
|
|
626
|
+
} }), noBeladingen ? (_jsx("div", { className: "mt-1 text-xs text-amber-600", children: "Geen belading bekend voor dit product." })) : effBelading && (_jsxs("div", { className: "mt-1 text-xs text-muted-foreground", children: [plants ?? 0, " planten", beladingTypes(effBelading) ? ` · ${beladingTypes(effBelading)}` : "", defaultKey && beladingKey(effBelading) !== defaultKey ? " · afwijkend van standaard" : ""] }))] }), _jsxs("label", { className: "col-span-1 lg:col-span-2", children: [_jsx("span", { className: "mb-1 block text-xs text-muted-foreground lg:hidden", children: "Fusten" }), _jsx(Input, { type: "number", min: 1, step: 1, inputMode: "numeric", onKeyDown: blockDecimal, value: cratesDisplay, disabled: ppc === null, onChange: (e) => {
|
|
627
|
+
if (ppc === null)
|
|
628
|
+
return;
|
|
629
|
+
const next = [...lines];
|
|
630
|
+
const raw = e.target.value.replace(/[.,]/g, "");
|
|
631
|
+
const cr = raw ? Math.max(1, Math.floor(Number(raw))) : null;
|
|
632
|
+
next[idx] = { ...next[idx], quantity: cr === null ? null : cr * ppc };
|
|
633
|
+
setLines(next);
|
|
634
|
+
}, placeholder: ppc === null ? "Belading onbekend" : "Fusten", title: ppc === null
|
|
635
|
+
? "Belading onbekend — kies eerst een belading"
|
|
636
|
+
: `${ppc} planten per fust` })] }), _jsxs("label", { className: "col-span-1 lg:col-span-2", children: [_jsx("span", { className: "mb-1 block text-xs text-muted-foreground lg:hidden", children: "Prijs" }), _jsx(Input, { type: "number", min: 0, step: "0.01", value: line.unit_price ?? "", onChange: (e) => {
|
|
637
|
+
const next = [...lines];
|
|
638
|
+
const v = e.target.value === "" ? null : Number(e.target.value);
|
|
639
|
+
next[idx] = { ...next[idx], unit_price: v };
|
|
640
|
+
setLines(next);
|
|
641
|
+
}, placeholder: "\u20AC prijs", "aria-invalid": !!line.product_id && !(Number(line.unit_price) > 0), title: !!line.product_id && !(Number(line.unit_price) > 0) ? "Prijs € 0" : undefined })] }), _jsx(Button, { variant: "ghost", size: "icon", className: "col-span-2 justify-self-end lg:col-span-1 lg:justify-self-auto", onClick: () => setLines(lines.filter((_, i) => i !== idx)), "aria-label": "Regel verwijderen", children: _jsx(Trash2, { className: "h-4 w-4" }) })] }, idx));
|
|
642
|
+
}), lines.some((l) => l.product_id && !(Number(l.unit_price) > 0)) && (_jsxs("div", { className: "rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: ["Prijs \u20AC 0: ", zeroPriceCount, " regel(s) zonder prijs. Er is geen prijs gevonden in prijsgroep of artikel. Vul de prijs in, of bevestig bij het aanmaken dat \u20AC 0 klopt."] })), _jsxs(Button, { variant: "outline", size: "sm", onClick: () => setLines([...lines, { product_id: null, product_name: "", quantity: null, unit: "stuks", unit_price: null, belading: null }]), children: [_jsx(Plus, { className: "h-3 w-3 mr-1" }), " Regel toevoegen"] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: "Referentie klant" }), _jsx(Input, { value: customerReference, maxLength: 100, onChange: (e) => setCustomerReference(e.target.value), placeholder: "Optioneel, bijvoorbeeld het bestelnummer van je klant" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: "Opmerkingen" }), _jsx(Textarea, { value: notes, onChange: (e) => setNotes(e.target.value), placeholder: "Optionele notities bij deze bestelling", rows: 3 })] }), stockCheck && stockCheck.shortages.length > 0 && (_jsxs("div", { className: `rounded-md border p-3 text-sm ${stockBlocked
|
|
635
643
|
? "border-destructive/40 bg-destructive/5 text-destructive"
|
|
636
644
|
: "border-amber-500/40 bg-amber-500/5 text-amber-700"}`, children: [_jsx("div", { className: "font-medium", children: stockBlocked
|
|
637
645
|
? "Bestelling geblokkeerd — onvoldoende voorraad"
|
|
638
|
-
: "Let op: tekorten (uitleveren zonder voorraad staat aan)" }), _jsx("ul", { className: "mt-1 space-y-0.5", children: stockCheck.shortages.map((s) => (_jsxs("li", { children: [s.product, ": besteld ", s.wanted, ", beschikbaar ", s.available, ", tekort ", s.missing] }, s.productId))) })] })), _jsxs("div", { className: "flex items-center justify-end gap-2 pt-2", children: [_jsx(Button, { variant: "outline", onClick: () => navigate({ to: "/floriday-verkoop/verkooporders" }), disabled: createMut.isPending, children: "Annuleren" }), _jsx(Button, { onClick: () =>
|
|
646
|
+
: "Let op: tekorten (uitleveren zonder voorraad staat aan)" }), _jsx("ul", { className: "mt-1 space-y-0.5", children: stockCheck.shortages.map((s) => (_jsxs("li", { children: [s.product, ": besteld ", s.wanted, ", beschikbaar ", s.available, ", tekort ", s.missing] }, s.productId))) })] })), _jsxs("div", { className: "flex items-center justify-end gap-2 pt-2", children: [_jsx(Button, { variant: "outline", onClick: () => navigate({ to: "/floriday-verkoop/verkooporders" }), disabled: createMut.isPending, children: "Annuleren" }), _jsx(Button, { onClick: () => {
|
|
647
|
+
if (zeroPriceCount > 0 && !zeroPriceOkRef.current)
|
|
648
|
+
setZeroConfirmOpen(true);
|
|
649
|
+
else
|
|
650
|
+
createMut.mutate(undefined);
|
|
651
|
+
}, disabled: createMut.isPending || stockBlocked || stockQ.isFetching, title: stockBlocked ? "Onvoldoende voorraad; deze order kan zo niet worden aangemaakt. Pas de aantallen aan." : undefined, children: createMut.isPending
|
|
639
652
|
? "Bezig..."
|
|
640
653
|
: stockQ.isFetching
|
|
641
654
|
? "Voorraad controleren..."
|
|
642
|
-
: "Bestelling Aanmaken" })] })] })] }), _jsx(ConfirmDialog, { open: lateConfirmOpen, onOpenChange: setLateConfirmOpen, title: "Toch aanmaken na de aanmeldtijd?", description: LATE_CONFIRM, confirmLabel: "Toch aanmaken", onConfirm: () => createMut.mutate({ lateConfirmed: true }) })] }));
|
|
655
|
+
: "Bestelling Aanmaken" })] })] })] }), _jsx(ConfirmDialog, { open: zeroConfirmOpen, onOpenChange: setZeroConfirmOpen, title: "Prijs \u20AC 0 bevestigen?", description: `${zeroPriceCount} regel(s) hebben prijs € 0. Deze regels worden zo gefactureerd. Weet je zeker dat dat klopt?`, confirmLabel: "Ja, prijs \u20AC 0 klopt", onConfirm: () => { zeroPriceOkRef.current = true; createMut.mutate(undefined); } }), _jsx(ConfirmDialog, { open: lateConfirmOpen, onOpenChange: setLateConfirmOpen, title: "Toch aanmaken na de aanmeldtijd?", description: LATE_CONFIRM, confirmLabel: "Toch aanmaken", onConfirm: () => createMut.mutate({ lateConfirmed: true }) })] }));
|
|
643
656
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloridayStageLine.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/FloridayStageLine.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA8D,KAAK,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC/H,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"FloridayStageLine.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/FloridayStageLine.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA8D,KAAK,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC/H,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,uFAAuF;AACvF,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,KAAK,EACL,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,UAAU,GACX,EAAE;IACD,MAAM,EAAE,qBAAqB,GAAG,IAAI,GAAG,SAAS,CAAC;IACjD,KAAK,EAAE,UAAU,GAAG,SAAS,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,sCA0CA;AAED,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,sCAOxE"}
|
|
@@ -2,16 +2,18 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { AlertTriangle } from "lucide-react";
|
|
3
3
|
import { Badge } from "@flowselections/core";
|
|
4
4
|
import { deviatesFromFloriday, floridayStageLabel, notReportedState } from "../../lib/floriday-status.js";
|
|
5
|
+
import { useFloridayReadOnlyReason } from "../../lib/useFloridayWriteMode.js";
|
|
5
6
|
/** Extra regel "Floriday: …" met een melding als de stand afwijkt. Alleen weergave. */
|
|
6
7
|
export function FloridayStageLine({ status, stage, floridayFulfilled, isFloriday, notReportedCount, bufferSize, }) {
|
|
7
8
|
const nr = isFloriday || status
|
|
8
9
|
? notReportedState(stage, status?.stage ?? null, !!floridayFulfilled)
|
|
9
10
|
: null;
|
|
10
11
|
const warn = nr === "waarschuwing" || nr === "waarschuwing_onbekend";
|
|
12
|
+
const readOnly = useFloridayReadOnlyReason(warn);
|
|
11
13
|
const bufferHint = bufferSize && bufferSize > 1 && notReportedCount
|
|
12
14
|
? ` (${notReportedCount} van ${bufferSize} nog niet afgemeld)`
|
|
13
15
|
: "";
|
|
14
|
-
const notReported = warn ? (
|
|
16
|
+
const notReported = warn ? (_jsxs("div", { className: "mt-1", children: [_jsxs(Badge, { variant: "outline", className: "border-amber-400/60 bg-amber-50 text-amber-800", children: [_jsx(AlertTriangle, { className: "mr-1 h-3 w-3" }), "Afgehandeld, nog niet gemeld bij Floriday", nr === "waarschuwing_onbekend" ? " (stand bij Floriday onbekend)" : "", bufferHint] }), readOnly && _jsxs("div", { className: "mt-1 text-xs text-muted-foreground", children: ["Oorzaak: ", readOnly] })] })) : nr === "al_afgehandeld" ? (_jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: "Al afgehandeld in Floriday" })) : null;
|
|
15
17
|
if (!status)
|
|
16
18
|
return notReported;
|
|
17
19
|
const unknown = status.stage === "onbekend";
|
|
@@ -21,5 +23,5 @@ export function FloridayStageLine({ status, stage, floridayFulfilled, isFloriday
|
|
|
21
23
|
export function MissingPriceBadge({ show }) {
|
|
22
24
|
if (!show)
|
|
23
25
|
return null;
|
|
24
|
-
return (_jsx(Badge, { variant: "outline", className: "border-destructive/40 text-destructive", children: "
|
|
26
|
+
return (_jsx(Badge, { variant: "outline", className: "border-destructive/40 text-destructive", children: "Prijs \u20AC 0" }));
|
|
25
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SalesOrderDetailPage.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/SalesOrderDetailPage.tsx"],"names":[],"mappings":"AAgGA,wBAAgB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"SalesOrderDetailPage.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/SalesOrderDetailPage.tsx"],"names":[],"mappings":"AAgGA,wBAAgB,oBAAoB,gCA4PnC"}
|
|
@@ -120,9 +120,15 @@ export function SalesOrderDetailPage() {
|
|
|
120
120
|
const isBuffer = bufferOrders.length > 1;
|
|
121
121
|
const totals = useMemo(() => {
|
|
122
122
|
const revenue = bufferOrders.reduce((s, o) => s + (o.revenue ?? 0), 0);
|
|
123
|
-
|
|
123
|
+
// Buffer: gedeelde karren tellen één keer; alleen het Engine-totaal telt.
|
|
124
|
+
const bufferTotal = bufferOrders.find((o) => typeof o.bufferCartCount === "number")?.bufferCartCount ?? null;
|
|
125
|
+
const karren = bufferOrders.length > 1
|
|
126
|
+
? bufferTotal
|
|
127
|
+
: (bufferOrders[0]?.karCount ?? 0);
|
|
124
128
|
const fusten = bufferOrders.reduce((s, o) => s + (o.fustCount ?? 0), 0);
|
|
125
|
-
const cartType =
|
|
129
|
+
const cartType = bufferOrders.length > 1
|
|
130
|
+
? (bufferOrders.find((o) => o.bufferCartTypeName)?.bufferCartTypeName ?? null)
|
|
131
|
+
: mergeTypeNames(bufferOrders.map((o) => o.cartTypeName));
|
|
126
132
|
const crateType = mergeTypeNames(bufferOrders.map((o) => o.crateTypeName));
|
|
127
133
|
return { revenue, karren, fusten, cartType, crateType };
|
|
128
134
|
}, [bufferOrders]);
|
|
@@ -130,7 +136,7 @@ export function SalesOrderDetailPage() {
|
|
|
130
136
|
const rawLocalId = isLocal && salesOrderId.startsWith("local:")
|
|
131
137
|
? salesOrderId.slice("local:".length)
|
|
132
138
|
: null;
|
|
133
|
-
return (_jsxs("main", { className: "space-y-5 p-6", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx(Button, { asChild: true, variant: "ghost", size: "sm", children: _jsxs(Link, { to: "/floriday-verkoop/verkooporders", children: [_jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), "Terug naar verkooporders"] }) }), rawLocalId && (_jsxs(Button, { variant: "outline", size: "sm", onClick: () => setEditOpen(true), children: [_jsx(Pencil, { className: "mr-2 h-4 w-4" }), "Bestelling bewerken"] }))] }), isLoading && (_jsx("div", { className: "rounded-lg border border-border bg-card p-8 text-sm text-muted-foreground", children: "Laden\u2026" })), error && (_jsx("div", { className: "rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive", children: error.message })), !isLoading && !error && !primary && (_jsx("div", { className: "rounded-lg border border-border bg-card p-8 text-sm text-muted-foreground", children: "Order niet gevonden." })), primary && isBuffer && (_jsxs("div", { className: "rounded-lg border border-primary/30 bg-primary/5 p-4", children: [_jsxs("div", { className: "mb-3 flex items-center gap-2", children: [_jsx(Layers, { className: "h-4 w-4 text-primary" }), _jsx("span", { className: "text-sm font-semibold text-foreground", children: "Orderbuffer" }), _jsxs(Badge, { variant: "outline", className: "border-primary/40 text-primary", children: [bufferOrders.length, " orders samengevoegd"] })] }), _jsxs("div", { className: "grid grid-cols-2 gap-3 text-sm md:grid-cols-4", children: [_jsxs("div", { children: [_jsx("div", { className: "text-muted-foreground", children: "Totale omzet" }), _jsx("div", { className: "font-semibold text-foreground", children: eur.format(totals.revenue) })] }), _jsxs("div", { children: [_jsx("div", { className: "text-muted-foreground", children: "Karren" }), _jsx("div", { className: "font-semibold text-foreground", children: formatLoadUnits(totals.karren, totals.cartType) })] }), _jsxs("div", { children: [_jsx("div", { className: "text-muted-foreground", children: "Fusten" }), _jsx("div", { className: "font-semibold text-foreground", children: formatLoadUnits(totals.fusten, totals.crateType) })] }), _jsxs("div", { children: [_jsx("div", { className: "text-muted-foreground", children: "Klant" }), _jsx("div", { className: "font-semibold text-foreground", children: primary.customer.name }), primary.customer.legalName && (_jsx("div", { className: "text-xs text-muted-foreground", children: primary.customer.legalName }))] })] }), _jsx(BufferAddresses, { orderId: primary.id }), _jsxs("div", { className: "mt-4 border-t border-primary/20 pt-3 text-sm", children: [_jsxs("div", { className: "mb-1 flex items-center gap-1.5 text-muted-foreground", children: [_jsx(Truck, { className: "h-3.5 w-3.5" }), _jsx("span", { children: "Vervoerder" })] }), _jsx(OrderCarrierPicker, { orderId: primary.id, applyToBuffer: true, locked: bufferOrders.every((o) => !!o.isReservation) }), _jsxs("div", { className: "mt-3 mb-1 flex items-center gap-1.5 text-muted-foreground", children: [_jsx(Clock, { className: "h-3.5 w-3.5" }), _jsx("span", { children: "Ophaalmoment" })] }), _jsx(OrderPickupMomentPicker, { orderId: primary.id, readOnly: true, compact: true })] }), _jsx("div", { className: "mt-3 flex flex-wrap gap-2", children: bufferOrders.map((o) => {
|
|
139
|
+
return (_jsxs("main", { className: "space-y-5 p-6", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx(Button, { asChild: true, variant: "ghost", size: "sm", children: _jsxs(Link, { to: "/floriday-verkoop/verkooporders", children: [_jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), "Terug naar verkooporders"] }) }), rawLocalId && (_jsxs(Button, { variant: "outline", size: "sm", onClick: () => setEditOpen(true), children: [_jsx(Pencil, { className: "mr-2 h-4 w-4" }), "Bestelling bewerken"] }))] }), isLoading && (_jsx("div", { className: "rounded-lg border border-border bg-card p-8 text-sm text-muted-foreground", children: "Laden\u2026" })), error && (_jsx("div", { className: "rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive", children: error.message })), !isLoading && !error && !primary && (_jsx("div", { className: "rounded-lg border border-border bg-card p-8 text-sm text-muted-foreground", children: "Order niet gevonden." })), primary && isBuffer && (_jsxs("div", { className: "rounded-lg border border-primary/30 bg-primary/5 p-4", children: [_jsxs("div", { className: "mb-3 flex items-center gap-2", children: [_jsx(Layers, { className: "h-4 w-4 text-primary" }), _jsx("span", { className: "text-sm font-semibold text-foreground", children: "Orderbuffer" }), _jsxs(Badge, { variant: "outline", className: "border-primary/40 text-primary", children: [bufferOrders.length, " orders samengevoegd"] })] }), _jsxs("div", { className: "grid grid-cols-2 gap-3 text-sm md:grid-cols-4", children: [_jsxs("div", { children: [_jsx("div", { className: "text-muted-foreground", children: "Totale omzet" }), _jsx("div", { className: "font-semibold text-foreground", children: eur.format(totals.revenue) })] }), _jsxs("div", { children: [_jsx("div", { className: "text-muted-foreground", children: "Karren" }), _jsx("div", { className: "font-semibold text-foreground", children: totals.karren == null ? "Karren onbekend" : formatLoadUnits(totals.karren, totals.cartType) })] }), _jsxs("div", { children: [_jsx("div", { className: "text-muted-foreground", children: "Fusten" }), _jsx("div", { className: "font-semibold text-foreground", children: formatLoadUnits(totals.fusten, totals.crateType) })] }), _jsxs("div", { children: [_jsx("div", { className: "text-muted-foreground", children: "Klant" }), _jsx("div", { className: "font-semibold text-foreground", children: primary.customer.name }), primary.customer.legalName && (_jsx("div", { className: "text-xs text-muted-foreground", children: primary.customer.legalName }))] })] }), _jsx(BufferAddresses, { orderId: primary.id }), _jsxs("div", { className: "mt-4 border-t border-primary/20 pt-3 text-sm", children: [_jsxs("div", { className: "mb-1 flex items-center gap-1.5 text-muted-foreground", children: [_jsx(Truck, { className: "h-3.5 w-3.5" }), _jsx("span", { children: "Vervoerder" })] }), _jsx(OrderCarrierPicker, { orderId: primary.id, applyToBuffer: true, locked: bufferOrders.every((o) => !!o.isReservation) }), _jsxs("div", { className: "mt-3 mb-1 flex items-center gap-1.5 text-muted-foreground", children: [_jsx(Clock, { className: "h-3.5 w-3.5" }), _jsx("span", { children: "Ophaalmoment" })] }), _jsx(OrderPickupMomentPicker, { orderId: primary.id, readOnly: true, compact: true })] }), _jsx("div", { className: "mt-3 flex flex-wrap gap-2", children: bufferOrders.map((o) => {
|
|
134
140
|
// Een Floriday-order hoort altijd een centraal ordernummer te
|
|
135
141
|
// hebben. Ontbreekt het, dan tonen we bewust géén chip: liever
|
|
136
142
|
// zichtbaar missend dan een verzonnen uuid-fragment.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchableSelect.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/SearchableSelect.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EAAE,OAAO,EAAE,WAAuB,EAAE,UAA6B,EACtE,UAAiB,EAAE,UAAiC,EACpD,QAAQ,EAAE,SAAS,EAAE,QAAgB,GACtC,EAAE,qBAAqB,+BAuFvB"}
|
|
1
|
+
{"version":3,"file":"SearchableSelect.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/SearchableSelect.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EAAE,OAAO,EAAE,WAAuB,EAAE,UAA6B,EACtE,UAAiB,EAAE,UAAiC,EACpD,QAAQ,EAAE,SAAS,EAAE,QAAgB,GACtC,EAAE,qBAAqB,+BAuFvB"}
|
|
@@ -12,7 +12,7 @@ export function SearchableSelect({ value, options, placeholder = "Kies...", empt
|
|
|
12
12
|
return options.slice(0, 200);
|
|
13
13
|
return options
|
|
14
14
|
.filter((o) => o.label.toLowerCase().includes(needle) ||
|
|
15
|
-
(o.hint ?? "").toLowerCase().includes(needle))
|
|
15
|
+
(o.search !== undefined ? (o.search ?? "") : (o.hint ?? "")).toLowerCase().includes(needle))
|
|
16
16
|
.slice(0, 200);
|
|
17
17
|
}, [options, q]);
|
|
18
18
|
return (_jsxs(Popover, { open: open, onOpenChange: (o) => { if (disabled)
|
|
@@ -17043,6 +17043,7 @@ export type Database = {
|
|
|
17043
17043
|
sort_order: number;
|
|
17044
17044
|
sticker_available: boolean;
|
|
17045
17045
|
sticker_cost: number | null;
|
|
17046
|
+
zero_price_confirmed: boolean;
|
|
17046
17047
|
};
|
|
17047
17048
|
Insert: {
|
|
17048
17049
|
available_stock?: number;
|
|
@@ -17062,6 +17063,7 @@ export type Database = {
|
|
|
17062
17063
|
sort_order?: number;
|
|
17063
17064
|
sticker_available?: boolean;
|
|
17064
17065
|
sticker_cost?: number | null;
|
|
17066
|
+
zero_price_confirmed?: boolean;
|
|
17065
17067
|
};
|
|
17066
17068
|
Update: {
|
|
17067
17069
|
available_stock?: number;
|
|
@@ -17081,6 +17083,7 @@ export type Database = {
|
|
|
17081
17083
|
sort_order?: number;
|
|
17082
17084
|
sticker_available?: boolean;
|
|
17083
17085
|
sticker_cost?: number | null;
|
|
17086
|
+
zero_price_confirmed?: boolean;
|
|
17084
17087
|
};
|
|
17085
17088
|
Relationships: [
|
|
17086
17089
|
{
|
|
@@ -17185,6 +17188,8 @@ export type Database = {
|
|
|
17185
17188
|
offer_orders: {
|
|
17186
17189
|
Row: {
|
|
17187
17190
|
campaign_id: string;
|
|
17191
|
+
carrier_warning: string | null;
|
|
17192
|
+
carrier_warning_at: string | null;
|
|
17188
17193
|
created_at: string;
|
|
17189
17194
|
customer_email: string;
|
|
17190
17195
|
customer_id: string | null;
|
|
@@ -17207,6 +17212,8 @@ export type Database = {
|
|
|
17207
17212
|
};
|
|
17208
17213
|
Insert: {
|
|
17209
17214
|
campaign_id: string;
|
|
17215
|
+
carrier_warning?: string | null;
|
|
17216
|
+
carrier_warning_at?: string | null;
|
|
17210
17217
|
created_at?: string;
|
|
17211
17218
|
customer_email: string;
|
|
17212
17219
|
customer_id?: string | null;
|
|
@@ -17229,6 +17236,8 @@ export type Database = {
|
|
|
17229
17236
|
};
|
|
17230
17237
|
Update: {
|
|
17231
17238
|
campaign_id?: string;
|
|
17239
|
+
carrier_warning?: string | null;
|
|
17240
|
+
carrier_warning_at?: string | null;
|
|
17232
17241
|
created_at?: string;
|
|
17233
17242
|
customer_email?: string;
|
|
17234
17243
|
customer_id?: string | null;
|
|
@@ -20627,6 +20636,7 @@ export type Database = {
|
|
|
20627
20636
|
render_html: string | null;
|
|
20628
20637
|
resultaat_pdf_base64: string | null;
|
|
20629
20638
|
status: Database["public"]["Enums"]["print_job_status"];
|
|
20639
|
+
uitwijk: Json | null;
|
|
20630
20640
|
updated_at: string;
|
|
20631
20641
|
verloopt_na_s: number | null;
|
|
20632
20642
|
verwerkingsfase: string;
|
|
@@ -20683,6 +20693,7 @@ export type Database = {
|
|
|
20683
20693
|
render_html?: string | null;
|
|
20684
20694
|
resultaat_pdf_base64?: string | null;
|
|
20685
20695
|
status?: Database["public"]["Enums"]["print_job_status"];
|
|
20696
|
+
uitwijk?: Json | null;
|
|
20686
20697
|
updated_at?: string;
|
|
20687
20698
|
verloopt_na_s?: number | null;
|
|
20688
20699
|
verwerkingsfase?: string;
|
|
@@ -20739,6 +20750,7 @@ export type Database = {
|
|
|
20739
20750
|
render_html?: string | null;
|
|
20740
20751
|
resultaat_pdf_base64?: string | null;
|
|
20741
20752
|
status?: Database["public"]["Enums"]["print_job_status"];
|
|
20753
|
+
uitwijk?: Json | null;
|
|
20742
20754
|
updated_at?: string;
|
|
20743
20755
|
verloopt_na_s?: number | null;
|
|
20744
20756
|
verwerkingsfase?: string;
|
|
@@ -30576,6 +30588,10 @@ export type Database = {
|
|
|
30576
30588
|
};
|
|
30577
30589
|
Returns: undefined;
|
|
30578
30590
|
};
|
|
30591
|
+
_scan_floriday_stand: {
|
|
30592
|
+
Args: never;
|
|
30593
|
+
Returns: Json;
|
|
30594
|
+
};
|
|
30579
30595
|
_scan_hash: {
|
|
30580
30596
|
Args: {
|
|
30581
30597
|
p: string;
|
|
@@ -31236,6 +31252,7 @@ export type Database = {
|
|
|
31236
31252
|
render_html: string | null;
|
|
31237
31253
|
resultaat_pdf_base64: string | null;
|
|
31238
31254
|
status: Database["public"]["Enums"]["print_job_status"];
|
|
31255
|
+
uitwijk: Json | null;
|
|
31239
31256
|
updated_at: string;
|
|
31240
31257
|
verloopt_na_s: number | null;
|
|
31241
31258
|
verwerkingsfase: string;
|
|
@@ -31434,6 +31451,7 @@ export type Database = {
|
|
|
31434
31451
|
render_html: string | null;
|
|
31435
31452
|
resultaat_pdf_base64: string | null;
|
|
31436
31453
|
status: Database["public"]["Enums"]["print_job_status"];
|
|
31454
|
+
uitwijk: Json | null;
|
|
31437
31455
|
updated_at: string;
|
|
31438
31456
|
verloopt_na_s: number | null;
|
|
31439
31457
|
verwerkingsfase: string;
|
|
@@ -31502,6 +31520,7 @@ export type Database = {
|
|
|
31502
31520
|
render_html: string | null;
|
|
31503
31521
|
resultaat_pdf_base64: string | null;
|
|
31504
31522
|
status: Database["public"]["Enums"]["print_job_status"];
|
|
31523
|
+
uitwijk: Json | null;
|
|
31505
31524
|
updated_at: string;
|
|
31506
31525
|
verloopt_na_s: number | null;
|
|
31507
31526
|
verwerkingsfase: string;
|
|
@@ -32071,6 +32090,30 @@ export type Database = {
|
|
|
32071
32090
|
};
|
|
32072
32091
|
Returns: boolean;
|
|
32073
32092
|
};
|
|
32093
|
+
floricode_load_carriers: {
|
|
32094
|
+
Args: never;
|
|
32095
|
+
Returns: {
|
|
32096
|
+
code: string;
|
|
32097
|
+
environment: string;
|
|
32098
|
+
height_mm: number;
|
|
32099
|
+
length_mm: number;
|
|
32100
|
+
name: string;
|
|
32101
|
+
width_mm: number;
|
|
32102
|
+
}[];
|
|
32103
|
+
};
|
|
32104
|
+
floricode_packaging_types: {
|
|
32105
|
+
Args: never;
|
|
32106
|
+
Returns: {
|
|
32107
|
+
code: string;
|
|
32108
|
+
expiry_date: string;
|
|
32109
|
+
height_mm: number;
|
|
32110
|
+
length_mm: number;
|
|
32111
|
+
name: string;
|
|
32112
|
+
packaging_type_id: string;
|
|
32113
|
+
packaging_type_name: string;
|
|
32114
|
+
width_mm: number;
|
|
32115
|
+
}[];
|
|
32116
|
+
};
|
|
32074
32117
|
floricode_sync_cron_schedule: {
|
|
32075
32118
|
Args: {
|
|
32076
32119
|
p_apikey: string;
|
|
@@ -33330,6 +33373,12 @@ export type Database = {
|
|
|
33330
33373
|
status: string;
|
|
33331
33374
|
}[];
|
|
33332
33375
|
};
|
|
33376
|
+
layout_rij_weergavenaam: {
|
|
33377
|
+
Args: {
|
|
33378
|
+
_rij: Json;
|
|
33379
|
+
};
|
|
33380
|
+
Returns: string;
|
|
33381
|
+
};
|
|
33333
33382
|
layout_standaard_overnemen: {
|
|
33334
33383
|
Args: {
|
|
33335
33384
|
_layout_id: string;
|
|
@@ -35475,6 +35524,14 @@ export type Database = {
|
|
|
35475
35524
|
Args: never;
|
|
35476
35525
|
Returns: Json;
|
|
35477
35526
|
};
|
|
35527
|
+
logistics_overload_check: {
|
|
35528
|
+
Args: never;
|
|
35529
|
+
Returns: {
|
|
35530
|
+
ok: boolean;
|
|
35531
|
+
onderdeel: string;
|
|
35532
|
+
toelichting: string;
|
|
35533
|
+
}[];
|
|
35534
|
+
};
|
|
35478
35535
|
logistics_own_sticker_count: {
|
|
35479
35536
|
Args: {
|
|
35480
35537
|
p_ppc_product: number;
|
|
@@ -38682,6 +38739,13 @@ export type Database = {
|
|
|
38682
38739
|
isSetofReturn: false;
|
|
38683
38740
|
};
|
|
38684
38741
|
};
|
|
38742
|
+
pick_resolve_scan_code: {
|
|
38743
|
+
Args: {
|
|
38744
|
+
p_code: string;
|
|
38745
|
+
p_device_key: string;
|
|
38746
|
+
};
|
|
38747
|
+
Returns: string;
|
|
38748
|
+
};
|
|
38685
38749
|
pick_restore_to_queue: {
|
|
38686
38750
|
Args: {
|
|
38687
38751
|
_queue_item_id: string;
|