@flowselections/floriday-verkoop-module 1.0.109 → 1.0.113
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 +37 -31
- package/dist-lib/components/verkoop/OrderCarrierPicker.d.ts +4 -4
- package/dist-lib/components/verkoop/OrderCarrierPicker.d.ts.map +1 -1
- package/dist-lib/components/verkoop/OrderCarrierPicker.js +26 -19
- package/dist-lib/components/verkoop/SalesOrdersTable.d.ts.map +1 -1
- package/dist-lib/components/verkoop/SalesOrdersTable.js +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +128 -6
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/carrier-resolve.check.d.ts +2 -0
- package/dist-lib/lib/carrier-resolve.check.d.ts.map +1 -0
- package/dist-lib/lib/carrier-resolve.check.js +38 -0
- package/dist-lib/lib/carrier-resolve.d.ts +27 -0
- package/dist-lib/lib/carrier-resolve.d.ts.map +1 -0
- package/dist-lib/lib/carrier-resolve.js +100 -0
- package/dist-lib/lib/carrier-resolve.server.d.ts +15 -0
- package/dist-lib/lib/carrier-resolve.server.d.ts.map +1 -0
- package/dist-lib/lib/carrier-resolve.server.js +32 -0
- package/dist-lib/lib/create-order.functions.d.ts +8 -0
- package/dist-lib/lib/create-order.functions.d.ts.map +1 -1
- package/dist-lib/lib/create-order.functions.js +62 -22
- package/dist-lib/lib/customer-stickers.check.js +4 -1
- package/dist-lib/lib/customer-stickers.d.ts +10 -0
- package/dist-lib/lib/customer-stickers.d.ts.map +1 -1
- package/dist-lib/lib/customer-stickers.js +6 -1
- package/dist-lib/lib/module-version.d.ts +1 -1
- package/dist-lib/lib/module-version.js +1 -1
- package/dist-lib/lib/order-carrier.functions.d.ts +10 -4
- package/dist-lib/lib/order-carrier.functions.d.ts.map +1 -1
- package/dist-lib/lib/order-carrier.functions.js +64 -40
- package/dist-lib/lib/salesorders-list.server.d.ts.map +1 -1
- package/dist-lib/lib/salesorders-list.server.js +24 -0
- package/dist-lib/lib/salesorders-mapping.d.ts +7 -0
- package/dist-lib/lib/salesorders-mapping.d.ts.map +1 -1
- package/package.json +1 -1
- package/schema/verkoop.sql +106 -0
|
@@ -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,gCAwgC9B"}
|
|
@@ -53,18 +53,11 @@ export function CreateOrderPage() {
|
|
|
53
53
|
const fetchCreate = useServerFn(createManualOrder);
|
|
54
54
|
const fetchStickerProducts = useServerFn(listCustomerStickerProducts);
|
|
55
55
|
const loadCarriersEngine = useAllowedLoadCarriers();
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return { items: [] };
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
const customersQ = useQuery({ queryKey: ["co-customers"], queryFn: () => safe(() => fetchCustomers()) });
|
|
65
|
-
const productsQ = useQuery({ queryKey: ["co-products"], queryFn: () => safe(() => fetchProducts()) });
|
|
66
|
-
const pickupQ = useQuery({ queryKey: ["co-pickup"], queryFn: () => safe(() => fetchPickupLocations()) });
|
|
67
|
-
const carriersQ = useQuery({ queryKey: ["co-carriers"], queryFn: () => safe(() => fetchCarriers()) });
|
|
56
|
+
// Fouten niet inslikken: elke query toont zijn fout boven het formulier.
|
|
57
|
+
const customersQ = useQuery({ queryKey: ["co-customers"], queryFn: () => fetchCustomers() });
|
|
58
|
+
const productsQ = useQuery({ queryKey: ["co-products"], queryFn: () => fetchProducts() });
|
|
59
|
+
const pickupQ = useQuery({ queryKey: ["co-pickup"], queryFn: () => fetchPickupLocations() });
|
|
60
|
+
const carriersQ = useQuery({ queryKey: ["co-carriers"], queryFn: () => fetchCarriers() });
|
|
68
61
|
const pickDaysQ = useQuery({
|
|
69
62
|
queryKey: ["co-pickdays"],
|
|
70
63
|
queryFn: async () => { try {
|
|
@@ -74,6 +67,14 @@ export function CreateOrderPage() {
|
|
|
74
67
|
return { pickDays: 0 };
|
|
75
68
|
} },
|
|
76
69
|
});
|
|
70
|
+
const loadErrors = [
|
|
71
|
+
["Klanten", customersQ.error],
|
|
72
|
+
["Producten", productsQ.error],
|
|
73
|
+
["Afhaallocaties", pickupQ.error],
|
|
74
|
+
["Vervoerders", carriersQ.error],
|
|
75
|
+
]
|
|
76
|
+
.filter(([, e]) => !!e)
|
|
77
|
+
.map(([label, e]) => `${label} konden niet worden geladen: ${e.message}`);
|
|
77
78
|
const customers = customersQ.data?.items ?? [];
|
|
78
79
|
const products = productsQ.data?.items ?? [];
|
|
79
80
|
const pickupLocations = pickupQ.data?.items ?? [];
|
|
@@ -230,17 +231,14 @@ export function CreateOrderPage() {
|
|
|
230
231
|
}
|
|
231
232
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
232
233
|
}, [customerId, deliveryLocQ.data]);
|
|
233
|
-
//
|
|
234
|
+
// Andere afleverlocatie: terug naar "Automatisch" (de Engine kiest op de locatie).
|
|
234
235
|
const lastLocRef = useRef(null);
|
|
235
236
|
useEffect(() => {
|
|
236
237
|
if (deliveryLocationId !== lastLocRef.current) {
|
|
237
238
|
lastLocRef.current = deliveryLocationId;
|
|
238
|
-
|
|
239
|
-
// Zonder standaardvervoerder kiest de Engine er een (voorbeeldversie).
|
|
240
|
-
setCarrierId(loc?.carrier_id ? loc.carrier_id : null);
|
|
239
|
+
setCarrierId(null);
|
|
241
240
|
}
|
|
242
|
-
|
|
243
|
-
}, [deliveryLocationId, deliveryLocations.length]);
|
|
241
|
+
}, [deliveryLocationId]);
|
|
244
242
|
// Eerst mogelijke leverdatum
|
|
245
243
|
useEffect(() => {
|
|
246
244
|
const allowed = loadCarriersEngine.allowed;
|
|
@@ -292,12 +290,7 @@ export function CreateOrderPage() {
|
|
|
292
290
|
setDeliveryDate(preview.firstFeasibleDeliveryDate);
|
|
293
291
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
294
292
|
}, [preview?.firstFeasibleDeliveryDate]);
|
|
295
|
-
// Geen vervoerder gekozen: de Engine kiest
|
|
296
|
-
useEffect(() => {
|
|
297
|
-
if (!carrierId && preview?.carrierId)
|
|
298
|
-
setCarrierId(preview.carrierId);
|
|
299
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
300
|
-
}, [preview?.carrierId]);
|
|
293
|
+
// Geen vervoerder gekozen = "Automatisch": de Engine kiest; niets overnemen.
|
|
301
294
|
// Andere vervoerder/locatie/datum: eigen momentkeuze vervalt als hij er niet meer is.
|
|
302
295
|
useEffect(() => {
|
|
303
296
|
if (momentKey && preview && !preview.moments.some((m) => m.momentKey === momentKey && m.feasible)) {
|
|
@@ -336,6 +329,9 @@ export function CreateOrderPage() {
|
|
|
336
329
|
if ([".", ",", "e", "E", "+", "-"].includes(e.key))
|
|
337
330
|
e.preventDefault();
|
|
338
331
|
};
|
|
332
|
+
// Eén kenmerk per formulier: dubbel klikken of opnieuw proberen geeft
|
|
333
|
+
// dezelfde bestelling terug in plaats van een tweede.
|
|
334
|
+
const idempotencyKeyRef = useRef(null);
|
|
339
335
|
const createMut = useMutation({
|
|
340
336
|
mutationFn: async (opts) => {
|
|
341
337
|
if (!customerId)
|
|
@@ -392,12 +388,16 @@ export function CreateOrderPage() {
|
|
|
392
388
|
].join("\n"));
|
|
393
389
|
}
|
|
394
390
|
const customer = customers.find((c) => c.id === customerId);
|
|
391
|
+
if (!idempotencyKeyRef.current)
|
|
392
|
+
idempotencyKeyRef.current = crypto.randomUUID();
|
|
395
393
|
const payload = {
|
|
394
|
+
idempotencyKey: idempotencyKeyRef.current,
|
|
396
395
|
customerId,
|
|
397
396
|
customerName: customer?.company_name ?? "Onbekende klant",
|
|
398
397
|
deliveryLocationId,
|
|
399
398
|
pickupLocationId,
|
|
400
|
-
|
|
399
|
+
// Alleen een handmatige keuze; "Automatisch" geeft niets mee.
|
|
400
|
+
carrierId: isReservation || ownTransport ? null : carrierId,
|
|
401
401
|
momentKey: isReservation || ownTransport ? null : momentKey,
|
|
402
402
|
ownTransport: !isReservation && ownTransport,
|
|
403
403
|
customerReference: customerReference.trim() ? customerReference.trim() : null,
|
|
@@ -433,6 +433,8 @@ export function CreateOrderPage() {
|
|
|
433
433
|
},
|
|
434
434
|
onSuccess: (res) => {
|
|
435
435
|
toast.success("Bestelling aangemaakt — karindeling is automatisch berekend");
|
|
436
|
+
if (res?.carrierAdminNotice)
|
|
437
|
+
toast.warning(`Voor beheer: ${res.carrierAdminNotice}`);
|
|
436
438
|
qc.invalidateQueries({ queryKey: ["floriday", "salesorders-cache"] });
|
|
437
439
|
if (res?.orderId) {
|
|
438
440
|
try {
|
|
@@ -456,7 +458,7 @@ export function CreateOrderPage() {
|
|
|
456
458
|
toast.error(msg ?? "De order is niet aangemaakt. Controleer de regels en probeer opnieuw.");
|
|
457
459
|
},
|
|
458
460
|
});
|
|
459
|
-
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"] }) }) }), _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) => ({
|
|
461
|
+
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) => ({
|
|
460
462
|
value: c.id,
|
|
461
463
|
label: c.company_name ?? "Onbekend",
|
|
462
464
|
hint: c.source === "twinfield" && String(c.id).startsWith("twinfield:")
|
|
@@ -474,12 +476,16 @@ export function CreateOrderPage() {
|
|
|
474
476
|
label: (l.name || addr || "Locatie") + (l.is_primary ? " ★" : ""),
|
|
475
477
|
hint: l.name && addr ? addr : undefined,
|
|
476
478
|
};
|
|
477
|
-
}), onChange: setDeliveryLocationId })] }), selectedLocation && (_jsxs("div", { className: "rounded-md border bg-muted/30 p-3 space-y-2", children: [_jsx("div", { className: "text-xs font-medium text-muted-foreground", children: "Adresgegevens" }), _jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsx(ReadOnlyField, { label: "Straat", value: selectedLocation.street }), _jsx(ReadOnlyField, { label: "Huisnummer", value: selectedLocation.house_number }), _jsx(ReadOnlyField, { label: "Postcode", value: selectedLocation.postal_code }), _jsx(ReadOnlyField, { label: "Plaats", value: selectedLocation.city }), _jsx(ReadOnlyField, { label: "Provincie", value: selectedLocation.province }), _jsx(ReadOnlyField, { label: "Land", value: selectedLocation.country })] })] })), _jsxs("div", { className: "space-y-1", children: [_jsxs(Label, { className: "flex items-center gap-2", children: ["Afhaallocatie / Tuin ", _jsx("span", { className: "text-destructive", children: "*" })] }), _jsx(SearchableSelect, { value: pickupLocationId, placeholder: pickupLocations.length ? "Kies eigen locatie..." : "Geen eigen locaties bekend", disabled: pickupLocations.length === 0, allowClear: false, options: pickupLocations.map((l) => ({ value: l.id, label: l.name })), onChange: setPickupLocationId }), _jsx("div", { className: "text-xs text-muted-foreground", children: "Eigen locatie (tuin) van waaruit de bestelling wordt geleverd of opgehaald." })] }), isReservation ? (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: "Vervoerder" }), _jsx("div", { className: "rounded-md border border-border bg-muted/40 px-3 py-2 text-sm text-muted-foreground", children: "Nog niet van toepassing \u2014 de vervoerder wordt pas gekozen bij het aanmaken van de verzending." })] })) : (_jsxs("div", { className: "space-y-1", children: [
|
|
479
|
+
}), onChange: setDeliveryLocationId })] }), selectedLocation && (_jsxs("div", { className: "rounded-md border bg-muted/30 p-3 space-y-2", children: [_jsx("div", { className: "text-xs font-medium text-muted-foreground", children: "Adresgegevens" }), _jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsx(ReadOnlyField, { label: "Straat", value: selectedLocation.street }), _jsx(ReadOnlyField, { label: "Huisnummer", value: selectedLocation.house_number }), _jsx(ReadOnlyField, { label: "Postcode", value: selectedLocation.postal_code }), _jsx(ReadOnlyField, { label: "Plaats", value: selectedLocation.city }), _jsx(ReadOnlyField, { label: "Provincie", value: selectedLocation.province }), _jsx(ReadOnlyField, { label: "Land", value: selectedLocation.country })] })] })), _jsxs("div", { className: "space-y-1", children: [_jsxs(Label, { className: "flex items-center gap-2", children: ["Afhaallocatie / Tuin ", _jsx("span", { className: "text-destructive", children: "*" })] }), _jsx(SearchableSelect, { value: pickupLocationId, placeholder: pickupLocations.length ? "Kies eigen locatie..." : "Geen eigen locaties bekend", disabled: pickupLocations.length === 0, allowClear: false, options: pickupLocations.map((l) => ({ value: l.id, label: l.name })), onChange: setPickupLocationId }), _jsx("div", { className: "text-xs text-muted-foreground", children: "Eigen locatie (tuin) van waaruit de bestelling wordt geleverd of opgehaald." })] }), isReservation ? (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: "Vervoerder" }), _jsx("div", { className: "rounded-md border border-border bg-muted/40 px-3 py-2 text-sm text-muted-foreground", children: "Nog niet van toepassing \u2014 de vervoerder wordt pas gekozen bij het aanmaken van de verzending." })] })) : (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: "Vervoerder" }), _jsx(SearchableSelect, { value: carrierId ?? "__auto__", placeholder: !customerId ? "Selecteer eerst een klant"
|
|
478
480
|
: !deliveryLocationId ? "Selecteer eerst een afleverlocatie"
|
|
479
|
-
: "
|
|
480
|
-
value:
|
|
481
|
-
|
|
482
|
-
|
|
481
|
+
: "Automatisch", disabled: !deliveryLocationId, allowClear: false, options: [
|
|
482
|
+
{ value: "__auto__", label: "Automatisch (Logistiek Engine kiest)" },
|
|
483
|
+
...carriers.map((c) => ({ value: c.id, label: c.name })),
|
|
484
|
+
], onChange: (v) => { setCarrierId(!v || v === "__auto__" ? null : v); setMomentKey(null); } }), deliveryLocationId && (_jsx("div", { className: "text-xs text-muted-foreground", children: carrierId
|
|
485
|
+
? `Vervoerder: ${carriers.find((c) => c.id === carrierId)?.name ?? "onbekend"} – handmatig gekozen`
|
|
486
|
+
: preview?.carrierId
|
|
487
|
+
? `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) => {
|
|
483
489
|
const product = line.product_id ? products.find((p) => p.id === line.product_id) : null;
|
|
484
490
|
const defaultBelading = completeBelading(product);
|
|
485
491
|
const effBelading = completeBelading(line.belading) ?? defaultBelading;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Toont
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Toont de vervoerder van een order met bron en reden (Logistiek Engine) en
|
|
3
|
+
* laat hem handmatig overschrijven of terugzetten naar automatisch.
|
|
4
|
+
* Met `applyToBuffer` geldt de keuze voor alle orders in de buffer; per order
|
|
5
|
+
* zie je wat gelukt is en wat niet.
|
|
6
6
|
*/
|
|
7
7
|
export declare function OrderCarrierPicker({ orderId, applyToBuffer, compact, locked, }: {
|
|
8
8
|
orderId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderCarrierPicker.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/OrderCarrierPicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OrderCarrierPicker.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/OrderCarrierPicker.tsx"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,aAAqB,EACrB,OAAe,EACf,MAAc,GACf,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,+BA0GA"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useState } from "react";
|
|
3
3
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
4
|
import { useServerFn } from "@tanstack/react-start";
|
|
5
5
|
import { Truck } from "lucide-react";
|
|
6
6
|
import { getOrderCarrier, setOrderCarrier } from "../../lib/order-carrier.functions.js";
|
|
7
|
+
import { carrierLine } from "../../lib/carrier-resolve.js";
|
|
8
|
+
const AUTO = "__auto__";
|
|
7
9
|
/**
|
|
8
|
-
* Toont
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* Toont de vervoerder van een order met bron en reden (Logistiek Engine) en
|
|
11
|
+
* laat hem handmatig overschrijven of terugzetten naar automatisch.
|
|
12
|
+
* Met `applyToBuffer` geldt de keuze voor alle orders in de buffer; per order
|
|
13
|
+
* zie je wat gelukt is en wat niet.
|
|
12
14
|
*/
|
|
13
15
|
export function OrderCarrierPicker({ orderId, applyToBuffer = false, compact = false, locked = false, }) {
|
|
14
16
|
const qc = useQueryClient();
|
|
@@ -16,37 +18,42 @@ export function OrderCarrierPicker({ orderId, applyToBuffer = false, compact = f
|
|
|
16
18
|
const saveCarrier = useServerFn(setOrderCarrier);
|
|
17
19
|
const [saving, setSaving] = useState(false);
|
|
18
20
|
const [error, setError] = useState(null);
|
|
19
|
-
const [
|
|
20
|
-
const
|
|
21
|
+
const [results, setResults] = useState(null);
|
|
22
|
+
const [notice, setNotice] = useState(null);
|
|
23
|
+
const q = useQuery({
|
|
21
24
|
queryKey: ["order-carrier", orderId],
|
|
22
25
|
queryFn: () => fetchCarrier({ data: { orderId } }),
|
|
23
26
|
staleTime: 30000,
|
|
27
|
+
enabled: !locked,
|
|
24
28
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
const
|
|
29
|
+
if (locked) {
|
|
30
|
+
return (_jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [!compact && _jsx(Truck, { className: "h-4 w-4" }), _jsx("span", { children: "Nog geen vervoerder \u2014 wordt gekozen bij het aanmaken van de verzending" })] }));
|
|
31
|
+
}
|
|
32
|
+
const resolved = q.data?.resolved ?? null;
|
|
33
|
+
const options = q.data?.options ?? [];
|
|
34
|
+
const isManual = resolved?.source === "handmatig";
|
|
35
|
+
const value = isManual && resolved?.carrierId ? resolved.carrierId : AUTO;
|
|
29
36
|
async function onChange(next) {
|
|
30
|
-
setValue(next);
|
|
31
37
|
setSaving(true);
|
|
32
38
|
setError(null);
|
|
39
|
+
setResults(null);
|
|
40
|
+
setNotice(null);
|
|
33
41
|
try {
|
|
34
|
-
await saveCarrier({
|
|
35
|
-
data: { orderId, carrierId: next ?
|
|
42
|
+
const res = await saveCarrier({
|
|
43
|
+
data: { orderId, carrierId: next === AUTO ? null : next, applyToBuffer },
|
|
36
44
|
});
|
|
45
|
+
setNotice(res.adminNotice);
|
|
46
|
+
if (!res.ok || res.results.length > 1)
|
|
47
|
+
setResults(res.results);
|
|
37
48
|
await qc.invalidateQueries({ queryKey: ["order-carrier"] });
|
|
38
49
|
await qc.invalidateQueries({ queryKey: ["sales-orders"] });
|
|
39
50
|
}
|
|
40
51
|
catch (e) {
|
|
41
52
|
setError(e?.message ?? "Opslaan mislukt");
|
|
42
|
-
setValue(data?.carrierId ?? "");
|
|
43
53
|
}
|
|
44
54
|
finally {
|
|
45
55
|
setSaving(false);
|
|
46
56
|
}
|
|
47
57
|
}
|
|
48
|
-
|
|
49
|
-
return (_jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [!compact && _jsx(Truck, { className: "h-4 w-4" }), _jsx("span", { children: "Nog geen vervoerder \u2014 wordt gekozen bij het aanmaken van de verzending" })] }));
|
|
50
|
-
}
|
|
51
|
-
return (_jsxs("div", { className: compact ? "" : "inline-flex flex-col gap-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [!compact && _jsx(Truck, { className: "h-4 w-4 text-muted-foreground" }), _jsxs("select", { className: "h-9 min-w-[12rem] rounded-md border border-border bg-background px-2 text-sm text-foreground disabled:opacity-60", value: value, disabled: saving, onChange: (e) => onChange(e.target.value), children: [_jsx("option", { value: "", children: "\u2014 Geen vervoerder \u2014" }), options.map((o) => (_jsx("option", { value: o.id, children: o.name }, o.id)))] }), saving && _jsx("span", { className: "text-xs text-muted-foreground", children: "Opslaan\u2026" })] }), applyToBuffer && (_jsx("span", { className: "text-xs text-muted-foreground", children: "Geldt voor alle orders in deze buffer" })), error && _jsx("span", { className: "text-xs text-destructive", children: error })] }));
|
|
58
|
+
return (_jsxs("div", { className: compact ? "space-y-1" : "inline-flex flex-col gap-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [!compact && _jsx(Truck, { className: "h-4 w-4 text-muted-foreground" }), _jsxs("select", { className: "h-9 min-w-[12rem] rounded-md border border-border bg-background px-2 text-sm text-foreground disabled:opacity-60", value: value, disabled: saving || q.isLoading || q.isError, onChange: (e) => onChange(e.target.value), children: [_jsx("option", { value: AUTO, children: "Automatisch (Logistiek Engine kiest)" }), options.map((o) => (_jsx("option", { value: o.id, children: o.name }, o.id)))] }), saving && _jsx("span", { className: "text-xs text-muted-foreground", children: "Opslaan\u2026" })] }), q.isError && (_jsx("span", { className: "text-xs text-destructive", children: q.error?.message ?? "Vervoerder kon niet worden geladen" })), resolved && (_jsxs("span", { className: `text-xs ${resolved.state === "ok" ? "text-muted-foreground" : "text-destructive"}`, children: [carrierLine(resolved), resolved.badge && (_jsx("span", { className: "ml-2 rounded border border-border bg-muted px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-muted-foreground", children: resolved.badge }))] })), resolved?.state === "geen" && (_jsx("a", { href: "/afhandeling/vervoerders", className: "text-xs text-primary underline", children: "Stel een vervoerder in bij Afhandeling \u2192 Vervoerders" })), resolved?.warning && _jsx("span", { className: "text-xs text-muted-foreground", children: resolved.warning }), (resolved?.adminNotice || notice) && (_jsxs("span", { className: "text-xs text-muted-foreground", children: ["Voor beheer: ", notice ?? resolved?.adminNotice] })), applyToBuffer && (_jsx("span", { className: "text-xs text-muted-foreground", children: "Geldt voor alle orders in deze buffer" })), results && (_jsx("ul", { className: "text-xs", children: results.map((r) => (_jsxs("li", { className: r.ok ? "text-muted-foreground" : "text-destructive", children: [r.orderNumber ?? r.orderId, ": ", r.ok ? "gelukt" : `niet gelukt – ${r.error}`] }, r.orderId))) })), error && _jsx("span", { className: "text-xs text-destructive", children: error })] }));
|
|
52
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SalesOrdersTable.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/SalesOrdersTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAsBjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAyGnE,6EAA6E;AAC7E,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAG1D;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,OAAO,EACP,aAAa,EACb,aAAa,EACb,WAAW,EACX,cAAc,EACd,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,EAAE;IACD,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC/C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAChD,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC7C,
|
|
1
|
+
{"version":3,"file":"SalesOrdersTable.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/SalesOrdersTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAsBjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAyGnE,6EAA6E;AAC7E,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAG1D;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,OAAO,EACP,aAAa,EACb,aAAa,EACb,WAAW,EACX,cAAc,EACd,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,EAAE;IACD,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC/C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAChD,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC7C,qBA2UA"}
|
|
@@ -106,7 +106,7 @@ export function SalesOrdersTable({ orders, loading, onSelectOrder, onDeleteOrder
|
|
|
106
106
|
.map((u) => `${u.name} (trade-item ${u.tradeItemId ?? "onbekend"})`)
|
|
107
107
|
.join("\n"), children: [_jsx(AlertTriangle, { className: "mt-0.5 h-3 w-3 shrink-0" }), _jsxs("span", { children: ["Floriday-artikel niet gekoppeld aan product:", " ", row.unlinkedProducts
|
|
108
108
|
.map((u) => `${u.name} (trade-item ${u.tradeItemId ?? "onbekend"})`)
|
|
109
|
-
.join(", ")] })] }))] }), _jsxs(TableCell, { children: [_jsx("div", { className: "font-medium text-foreground", children: row.karUnknown ? (_jsx("span", { className: "text-muted-foreground", children: "Karren onbekend" })) : row.engineCounts && row.karCount > 0 ? (_jsxs(_Fragment, { children: [formatLoadUnits(row.karCount, row.cartTypeName), row.karShared && isBuffer && (_jsx("span", { className: "ml-1 text-xs font-normal text-muted-foreground", children: "(gedeeld met gecombineerde order)" }))] })) : (_jsx("span", { className: "text-muted-foreground", children: "\u2014" })) }), _jsx(PlanCoverageBadge, { coverage: row.planCoverage }), _jsx(FloridayStageLine, { status: row.floridayStatus, stage: row.stage, floridayFulfilled: isBuffer ? !row.notReportedToFloriday : row.floridayFulfilled, isFloriday: !!row.notReportedToFloriday || (row.floridayIds?.length ?? 0) > 0, notReportedCount: row.notReportedCount, bufferSize: bufferSize })] }), _jsx(TableCell, { children: _jsx("div", { className: "font-medium text-foreground", children: formatLoadUnits(row.fustCount, row.crateTypeName) }) }), _jsx(TableCell, { className: "text-sm text-foreground", children: row.carrierName || _jsx("span", { className: "text-muted-foreground", children: "
|
|
109
|
+
.join(", ")] })] }))] }), _jsxs(TableCell, { children: [_jsx("div", { className: "font-medium text-foreground", children: row.karUnknown ? (_jsx("span", { className: "text-muted-foreground", children: "Karren onbekend" })) : row.engineCounts && row.karCount > 0 ? (_jsxs(_Fragment, { children: [formatLoadUnits(row.karCount, row.cartTypeName), row.karShared && isBuffer && (_jsx("span", { className: "ml-1 text-xs font-normal text-muted-foreground", children: "(gedeeld met gecombineerde order)" }))] })) : (_jsx("span", { className: "text-muted-foreground", children: "\u2014" })) }), _jsx(PlanCoverageBadge, { coverage: row.planCoverage }), _jsx(FloridayStageLine, { status: row.floridayStatus, stage: row.stage, floridayFulfilled: isBuffer ? !row.notReportedToFloriday : row.floridayFulfilled, isFloriday: !!row.notReportedToFloriday || (row.floridayIds?.length ?? 0) > 0, notReportedCount: row.notReportedCount, bufferSize: bufferSize })] }), _jsx(TableCell, { children: _jsx("div", { className: "font-medium text-foreground", children: formatLoadUnits(row.fustCount, row.crateTypeName) }) }), _jsx(TableCell, { className: "text-sm text-foreground", children: row.carrierState === "geen" ? (_jsx("a", { href: "/afhandeling/vervoerders", onClick: (e) => e.stopPropagation(), className: "text-xs text-destructive underline", title: row.carrierReason ?? undefined, children: "Geen vervoerder \u2013 stel in bij Afhandeling \u2192 Vervoerders" })) : (_jsxs("div", { title: row.carrierReason ?? undefined, children: [_jsx("div", { children: row.carrierName || _jsx("span", { className: "text-muted-foreground", children: "onbekend" }) }), (row.carrierSource || row.carrierBadge) && (_jsxs("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [row.carrierSource && _jsx("span", { children: row.carrierSource }), row.carrierBadge && (_jsx("span", { className: "rounded border border-border bg-muted px-1 text-[10px] uppercase tracking-wide", children: row.carrierBadge }))] }))] })) }), _jsx(TableCell, { children: _jsx(StatusTag, { order: row }) }), showRevenue && (_jsxs(TableCell, { className: "font-medium text-foreground", children: ["\u20AC ", Math.round(row.revenue ?? 0).toLocaleString("nl-NL")] })), _jsxs(TableCell, { children: [_jsx("div", { className: "text-sm text-foreground", children: ordered.date }), _jsx("div", { className: "text-xs text-muted-foreground", children: isBuffer
|
|
110
110
|
? `${bufferSize} orders`
|
|
111
111
|
: row.orderNumber || ordered.time })] }), _jsx(TableCell, { onClick: (e) => e.stopPropagation(), children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { className: "inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground", children: _jsx(MoreVertical, { className: "h-4 w-4" }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsx(DropdownMenuItem, { disabled: isBuffer || !row.isLocal, onClick: () => !isBuffer && row.isLocal && onEditOrder?.(row), title: isBuffer
|
|
112
112
|
? "Een gecombineerde order kun je niet in één keer bewerken."
|
|
@@ -24812,16 +24812,56 @@ export type Database = {
|
|
|
24812
24812
|
}
|
|
24813
24813
|
];
|
|
24814
24814
|
};
|
|
24815
|
+
twinfield_connection_label_log: {
|
|
24816
|
+
Row: {
|
|
24817
|
+
changed_at: string;
|
|
24818
|
+
changed_by: string | null;
|
|
24819
|
+
changed_by_role: string | null;
|
|
24820
|
+
connection_id: string;
|
|
24821
|
+
field: string;
|
|
24822
|
+
id: string;
|
|
24823
|
+
new_value: string | null;
|
|
24824
|
+
note: string | null;
|
|
24825
|
+
office_code: string | null;
|
|
24826
|
+
old_value: string | null;
|
|
24827
|
+
};
|
|
24828
|
+
Insert: {
|
|
24829
|
+
changed_at?: string;
|
|
24830
|
+
changed_by?: string | null;
|
|
24831
|
+
changed_by_role?: string | null;
|
|
24832
|
+
connection_id: string;
|
|
24833
|
+
field: string;
|
|
24834
|
+
id?: string;
|
|
24835
|
+
new_value?: string | null;
|
|
24836
|
+
note?: string | null;
|
|
24837
|
+
office_code?: string | null;
|
|
24838
|
+
old_value?: string | null;
|
|
24839
|
+
};
|
|
24840
|
+
Update: {
|
|
24841
|
+
changed_at?: string;
|
|
24842
|
+
changed_by?: string | null;
|
|
24843
|
+
changed_by_role?: string | null;
|
|
24844
|
+
connection_id?: string;
|
|
24845
|
+
field?: string;
|
|
24846
|
+
id?: string;
|
|
24847
|
+
new_value?: string | null;
|
|
24848
|
+
note?: string | null;
|
|
24849
|
+
office_code?: string | null;
|
|
24850
|
+
old_value?: string | null;
|
|
24851
|
+
};
|
|
24852
|
+
Relationships: [];
|
|
24853
|
+
};
|
|
24815
24854
|
twinfield_connections: {
|
|
24816
24855
|
Row: {
|
|
24817
24856
|
account_key: string | null;
|
|
24857
|
+
central_environment: string | null;
|
|
24818
24858
|
cluster_uri: string | null;
|
|
24819
24859
|
company_code: string | null;
|
|
24820
24860
|
company_name: string | null;
|
|
24821
24861
|
connected_at: string | null;
|
|
24822
24862
|
created_at: string;
|
|
24823
24863
|
disconnected_at: string | null;
|
|
24824
|
-
environment: string;
|
|
24864
|
+
environment: string | null;
|
|
24825
24865
|
granted_scopes: string[] | null;
|
|
24826
24866
|
id: string;
|
|
24827
24867
|
initial_sync_completed_at: string | null;
|
|
@@ -24830,8 +24870,12 @@ export type Database = {
|
|
|
24830
24870
|
initial_sync_started_at: string | null;
|
|
24831
24871
|
is_active: boolean;
|
|
24832
24872
|
label: string | null;
|
|
24873
|
+
label_set_at: string | null;
|
|
24874
|
+
label_set_by: string | null;
|
|
24875
|
+
label_source: string | null;
|
|
24833
24876
|
missing_scopes: string[] | null;
|
|
24834
24877
|
office_code: string | null;
|
|
24878
|
+
organisation_code: string | null;
|
|
24835
24879
|
redirect_uri: string | null;
|
|
24836
24880
|
scope_checked_at: string | null;
|
|
24837
24881
|
scope_state: string | null;
|
|
@@ -24845,13 +24889,14 @@ export type Database = {
|
|
|
24845
24889
|
};
|
|
24846
24890
|
Insert: {
|
|
24847
24891
|
account_key?: string | null;
|
|
24892
|
+
central_environment?: string | null;
|
|
24848
24893
|
cluster_uri?: string | null;
|
|
24849
24894
|
company_code?: string | null;
|
|
24850
24895
|
company_name?: string | null;
|
|
24851
24896
|
connected_at?: string | null;
|
|
24852
24897
|
created_at?: string;
|
|
24853
24898
|
disconnected_at?: string | null;
|
|
24854
|
-
environment
|
|
24899
|
+
environment?: string | null;
|
|
24855
24900
|
granted_scopes?: string[] | null;
|
|
24856
24901
|
id?: string;
|
|
24857
24902
|
initial_sync_completed_at?: string | null;
|
|
@@ -24860,8 +24905,12 @@ export type Database = {
|
|
|
24860
24905
|
initial_sync_started_at?: string | null;
|
|
24861
24906
|
is_active?: boolean;
|
|
24862
24907
|
label?: string | null;
|
|
24908
|
+
label_set_at?: string | null;
|
|
24909
|
+
label_set_by?: string | null;
|
|
24910
|
+
label_source?: string | null;
|
|
24863
24911
|
missing_scopes?: string[] | null;
|
|
24864
24912
|
office_code?: string | null;
|
|
24913
|
+
organisation_code?: string | null;
|
|
24865
24914
|
redirect_uri?: string | null;
|
|
24866
24915
|
scope_checked_at?: string | null;
|
|
24867
24916
|
scope_state?: string | null;
|
|
@@ -24875,13 +24924,14 @@ export type Database = {
|
|
|
24875
24924
|
};
|
|
24876
24925
|
Update: {
|
|
24877
24926
|
account_key?: string | null;
|
|
24927
|
+
central_environment?: string | null;
|
|
24878
24928
|
cluster_uri?: string | null;
|
|
24879
24929
|
company_code?: string | null;
|
|
24880
24930
|
company_name?: string | null;
|
|
24881
24931
|
connected_at?: string | null;
|
|
24882
24932
|
created_at?: string;
|
|
24883
24933
|
disconnected_at?: string | null;
|
|
24884
|
-
environment?: string;
|
|
24934
|
+
environment?: string | null;
|
|
24885
24935
|
granted_scopes?: string[] | null;
|
|
24886
24936
|
id?: string;
|
|
24887
24937
|
initial_sync_completed_at?: string | null;
|
|
@@ -24890,8 +24940,12 @@ export type Database = {
|
|
|
24890
24940
|
initial_sync_started_at?: string | null;
|
|
24891
24941
|
is_active?: boolean;
|
|
24892
24942
|
label?: string | null;
|
|
24943
|
+
label_set_at?: string | null;
|
|
24944
|
+
label_set_by?: string | null;
|
|
24945
|
+
label_source?: string | null;
|
|
24893
24946
|
missing_scopes?: string[] | null;
|
|
24894
24947
|
office_code?: string | null;
|
|
24948
|
+
organisation_code?: string | null;
|
|
24895
24949
|
redirect_uri?: string | null;
|
|
24896
24950
|
scope_checked_at?: string | null;
|
|
24897
24951
|
scope_state?: string | null;
|
|
@@ -25831,7 +25885,7 @@ export type Database = {
|
|
|
25831
25885
|
};
|
|
25832
25886
|
twinfield_settings: {
|
|
25833
25887
|
Row: {
|
|
25834
|
-
active_environment: string;
|
|
25888
|
+
active_environment: string | null;
|
|
25835
25889
|
cron_registered_at: string | null;
|
|
25836
25890
|
cron_registration_error: string | null;
|
|
25837
25891
|
cron_schedules: Json;
|
|
@@ -25841,7 +25895,7 @@ export type Database = {
|
|
|
25841
25895
|
updated_at: string;
|
|
25842
25896
|
};
|
|
25843
25897
|
Insert: {
|
|
25844
|
-
active_environment?: string;
|
|
25898
|
+
active_environment?: string | null;
|
|
25845
25899
|
cron_registered_at?: string | null;
|
|
25846
25900
|
cron_registration_error?: string | null;
|
|
25847
25901
|
cron_schedules?: Json;
|
|
@@ -25851,7 +25905,7 @@ export type Database = {
|
|
|
25851
25905
|
updated_at?: string;
|
|
25852
25906
|
};
|
|
25853
25907
|
Update: {
|
|
25854
|
-
active_environment?: string;
|
|
25908
|
+
active_environment?: string | null;
|
|
25855
25909
|
cron_registered_at?: string | null;
|
|
25856
25910
|
cron_registration_error?: string | null;
|
|
25857
25911
|
cron_schedules?: Json;
|
|
@@ -31052,6 +31106,14 @@ export type Database = {
|
|
|
31052
31106
|
Args: never;
|
|
31053
31107
|
Returns: Json;
|
|
31054
31108
|
};
|
|
31109
|
+
floriday_background_jobs_status: {
|
|
31110
|
+
Args: never;
|
|
31111
|
+
Returns: {
|
|
31112
|
+
active: boolean;
|
|
31113
|
+
jobname: string;
|
|
31114
|
+
schedule: string;
|
|
31115
|
+
}[];
|
|
31116
|
+
};
|
|
31055
31117
|
floriday_capture_stock_snapshot: {
|
|
31056
31118
|
Args: never;
|
|
31057
31119
|
Returns: number;
|
|
@@ -38266,6 +38328,15 @@ export type Database = {
|
|
|
38266
38328
|
};
|
|
38267
38329
|
Returns: boolean;
|
|
38268
38330
|
};
|
|
38331
|
+
twinfield_auth_install_check: {
|
|
38332
|
+
Args: never;
|
|
38333
|
+
Returns: {
|
|
38334
|
+
object_kind: string;
|
|
38335
|
+
object_name: string;
|
|
38336
|
+
present: boolean;
|
|
38337
|
+
schema_version: string;
|
|
38338
|
+
}[];
|
|
38339
|
+
};
|
|
38269
38340
|
twinfield_cancel_queue_item: {
|
|
38270
38341
|
Args: {
|
|
38271
38342
|
p_id: string;
|
|
@@ -38275,9 +38346,30 @@ export type Database = {
|
|
|
38275
38346
|
twinfield_connection_offices: {
|
|
38276
38347
|
Args: never;
|
|
38277
38348
|
Returns: {
|
|
38349
|
+
company_name: string;
|
|
38350
|
+
connection_id: string;
|
|
38351
|
+
environment: string;
|
|
38352
|
+
in_shell_omgeving: boolean;
|
|
38353
|
+
is_active: boolean;
|
|
38354
|
+
label_source: string;
|
|
38355
|
+
office_code: string;
|
|
38356
|
+
}[];
|
|
38357
|
+
};
|
|
38358
|
+
twinfield_connection_usage: {
|
|
38359
|
+
Args: never;
|
|
38360
|
+
Returns: {
|
|
38361
|
+
archived: boolean;
|
|
38362
|
+
company_name: string;
|
|
38363
|
+
connected_at: string;
|
|
38278
38364
|
connection_id: string;
|
|
38365
|
+
environment: string;
|
|
38366
|
+
gebruikt_door_facturatie: boolean;
|
|
38367
|
+
in_shell_omgeving: boolean;
|
|
38279
38368
|
is_active: boolean;
|
|
38369
|
+
label_source: string;
|
|
38370
|
+
leest: boolean;
|
|
38280
38371
|
office_code: string;
|
|
38372
|
+
user_id: string;
|
|
38281
38373
|
}[];
|
|
38282
38374
|
};
|
|
38283
38375
|
twinfield_cron_lock_acquire: {
|
|
@@ -38325,10 +38417,24 @@ export type Database = {
|
|
|
38325
38417
|
Args: never;
|
|
38326
38418
|
Returns: boolean;
|
|
38327
38419
|
};
|
|
38420
|
+
twinfield_mark_label_pending: {
|
|
38421
|
+
Args: {
|
|
38422
|
+
p_connection_id: string;
|
|
38423
|
+
};
|
|
38424
|
+
Returns: boolean;
|
|
38425
|
+
};
|
|
38328
38426
|
twinfield_prune_push_queue: {
|
|
38329
38427
|
Args: never;
|
|
38330
38428
|
Returns: number;
|
|
38331
38429
|
};
|
|
38430
|
+
twinfield_record_central_facts: {
|
|
38431
|
+
Args: {
|
|
38432
|
+
p_central_environment: string;
|
|
38433
|
+
p_connection_id: string;
|
|
38434
|
+
p_organisation_code: string;
|
|
38435
|
+
};
|
|
38436
|
+
Returns: Json;
|
|
38437
|
+
};
|
|
38332
38438
|
twinfield_register_cron: {
|
|
38333
38439
|
Args: {
|
|
38334
38440
|
apikey?: string;
|
|
@@ -38336,6 +38442,14 @@ export type Database = {
|
|
|
38336
38442
|
};
|
|
38337
38443
|
Returns: Json;
|
|
38338
38444
|
};
|
|
38445
|
+
twinfield_set_connection_label: {
|
|
38446
|
+
Args: {
|
|
38447
|
+
p_also_shell?: boolean;
|
|
38448
|
+
p_connection_id: string;
|
|
38449
|
+
p_environment: string;
|
|
38450
|
+
};
|
|
38451
|
+
Returns: Json;
|
|
38452
|
+
};
|
|
38339
38453
|
twinfield_set_write_enabled: {
|
|
38340
38454
|
Args: {
|
|
38341
38455
|
p_connection_id: string;
|
|
@@ -38917,6 +39031,14 @@ export type Database = {
|
|
|
38917
39031
|
};
|
|
38918
39032
|
Returns: Json;
|
|
38919
39033
|
};
|
|
39034
|
+
verkoop_insert_manual_order: {
|
|
39035
|
+
Args: {
|
|
39036
|
+
p_idempotency_key: string;
|
|
39037
|
+
p_items: Json;
|
|
39038
|
+
p_order: Json;
|
|
39039
|
+
};
|
|
39040
|
+
Returns: Json;
|
|
39041
|
+
};
|
|
38920
39042
|
verkoop_packing_drift_apply: {
|
|
38921
39043
|
Args: {
|
|
38922
39044
|
p_order_ids: string[];
|