@flowselections/floriday-verkoop-module 1.0.54 → 1.0.55
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/OrderKarindelingCard.d.ts.map +1 -1
- package/dist-lib/components/verkoop/OrderKarindelingCard.js +6 -3
- package/dist-lib/integrations/supabase/auth-middleware.d.ts +42 -0
- package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.d.ts +42 -0
- package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.server.d.ts +42 -0
- package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +42 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/cart-lock.functions.d.ts +42 -0
- package/dist-lib/lib/cart-lock.functions.d.ts.map +1 -1
- package/dist-lib/lib/cart-planning-settings.functions.d.ts +462 -0
- package/dist-lib/lib/cart-planning-settings.functions.d.ts.map +1 -1
- package/dist-lib/lib/cart-replan.functions.d.ts +128 -26
- package/dist-lib/lib/cart-replan.functions.d.ts.map +1 -1
- package/dist-lib/lib/cart-replan.functions.js +55 -32
- package/dist-lib/lib/create-order.functions.d.ts +714 -0
- package/dist-lib/lib/create-order.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-auto-fulfillment.functions.d.ts +126 -0
- package/dist-lib/lib/floriday-auto-fulfillment.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-logistic-labels.functions.d.ts +42 -0
- package/dist-lib/lib/floriday-logistic-labels.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-mirror.functions.d.ts +42 -0
- package/dist-lib/lib/floriday-mirror.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-public.functions.d.ts +294 -0
- package/dist-lib/lib/floriday-public.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-writes.functions.d.ts +210 -0
- package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -1
- package/dist-lib/lib/invoice-timing.functions.d.ts +168 -0
- package/dist-lib/lib/invoice-timing.functions.d.ts.map +1 -1
- package/dist-lib/lib/invoice-timing.functions.js +12 -6
- package/dist-lib/lib/load-carriers.functions.d.ts +42 -0
- package/dist-lib/lib/load-carriers.functions.d.ts.map +1 -1
- package/dist-lib/lib/logistics-engine.functions.d.ts +210 -0
- package/dist-lib/lib/logistics-engine.functions.d.ts.map +1 -1
- package/dist-lib/lib/logistics-engine.functions.js +10 -5
- package/dist-lib/lib/logistics-stock.functions.d.ts +84 -0
- package/dist-lib/lib/logistics-stock.functions.d.ts.map +1 -1
- package/dist-lib/lib/order-addresses.functions.d.ts +42 -0
- package/dist-lib/lib/order-addresses.functions.d.ts.map +1 -1
- package/dist-lib/lib/order-addresses.functions.js +15 -9
- package/dist-lib/lib/order-buffers.functions.d.ts +126 -0
- package/dist-lib/lib/order-buffers.functions.d.ts.map +1 -1
- package/dist-lib/lib/order-buffers.functions.js +10 -10
- package/dist-lib/lib/order-carrier.functions.d.ts +84 -0
- package/dist-lib/lib/order-carrier.functions.d.ts.map +1 -1
- package/dist-lib/lib/order-carrier.functions.js +20 -11
- package/dist-lib/lib/order-pickup.functions.d.ts +84 -0
- package/dist-lib/lib/order-pickup.functions.d.ts.map +1 -1
- package/dist-lib/lib/order-pickup.functions.js +20 -11
- package/dist-lib/lib/order-row.server.d.ts +24 -0
- package/dist-lib/lib/order-row.server.d.ts.map +1 -0
- package/dist-lib/lib/order-row.server.js +58 -0
- package/dist-lib/lib/order-shipments.functions.d.ts +168 -0
- package/dist-lib/lib/order-shipments.functions.d.ts.map +1 -1
- package/dist-lib/lib/order-shipments.functions.js +11 -6
- package/dist-lib/lib/salesorders-list.functions.d.ts +42 -0
- package/dist-lib/lib/salesorders-list.functions.d.ts.map +1 -1
- package/dist-lib/lib/salesorders.functions.d.ts +210 -0
- package/dist-lib/lib/salesorders.functions.d.ts.map +1 -1
- package/dist-lib/lib/stock-consumption-alerts.functions.d.ts +84 -0
- package/dist-lib/lib/stock-consumption-alerts.functions.d.ts.map +1 -1
- package/dist-lib/lib/tradeitems.functions.d.ts +42 -0
- package/dist-lib/lib/tradeitems.functions.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderKarindelingCard.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/OrderKarindelingCard.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AA4C/D,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,aAAa,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"OrderKarindelingCard.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/OrderKarindelingCard.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AA4C/D,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,aAAa,CAAA;CAAE,2CA8LvE"}
|
|
@@ -34,10 +34,11 @@ export function OrderKarindelingCard({ order }) {
|
|
|
34
34
|
const fetchCarts = useServerFn(listOrderCarts);
|
|
35
35
|
const queryClient = useQueryClient();
|
|
36
36
|
const queryKey = ["order-carts", orderId];
|
|
37
|
-
const { data, isLoading } = useQuery({
|
|
37
|
+
const { data, isLoading, error } = useQuery({
|
|
38
38
|
queryKey,
|
|
39
39
|
enabled: !!orderId,
|
|
40
40
|
staleTime: 15000,
|
|
41
|
+
retry: false,
|
|
41
42
|
queryFn: async () => fetchCarts({ data: { orderId: orderId } }),
|
|
42
43
|
});
|
|
43
44
|
// Realtime op de karren zelf — niet meer op products/order_items, want die
|
|
@@ -60,6 +61,8 @@ export function OrderKarindelingCard({ order }) {
|
|
|
60
61
|
const orders = data?.orders ?? [];
|
|
61
62
|
const lockedAt = data?.planLockedAt ?? null;
|
|
62
63
|
const blocked = data?.blocked ?? null;
|
|
64
|
+
// De DB-order-id (verschilt van de DTO-id bij Floriday-orders).
|
|
65
|
+
const dbOrderId = data?.orderId ?? null;
|
|
63
66
|
const orderNumberByItem = useMemo(() => {
|
|
64
67
|
const numberByOrder = new Map();
|
|
65
68
|
for (const o of orders)
|
|
@@ -80,11 +83,11 @@ export function OrderKarindelingCard({ order }) {
|
|
|
80
83
|
}, [carts]);
|
|
81
84
|
const lockedDate = lockedAt ? new Date(lockedAt).toLocaleString("nl-NL") : null;
|
|
82
85
|
const multiOrder = orders.length > 1;
|
|
83
|
-
return (_jsxs(Card, { children: [_jsxs(CardHeader, { className: "flex flex-row items-center justify-between", children: [_jsx(CardTitle, { className: "text-base", children: "Karindeling" }), _jsxs("div", { className: "flex items-center gap-2", children: [lockedAt && (_jsxs(Badge, { variant: "outline", className: "gap-1", children: [_jsx(Lock, { className: "h-3 w-3" }), "Vergrendeld \u2014 pakbon geprint ", lockedDate] })), multiOrder && (_jsxs(Badge, { variant: "outline", title: orders.map((o) => o.order_number ?? o.id).join(", "), children: ["Buffer \u00B7 ", orders.length, " orders"] })), _jsxs(Badge, { variant: "secondary", children: [carts.length, " kar(ren)", sourceLabel ? ` · bron: ${sourceLabel}` : ""] })] })] }), _jsx(CardContent, { children: isLoading ? (_jsx("p", { className: "text-sm text-muted-foreground", children: "Karindeling laden\u2026" })) : carts.length === 0 ? (_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Nog geen karindeling beschikbaar voor deze order." }), blocked && (blocked.explanation || blocked.reason) && (_jsxs("p", { className: "text-sm text-destructive", children: [blocked.explanation ?? blocked.reason, blocked.at ? ` (${new Date(blocked.at).toLocaleString("nl-NL")})` : ""] }))] })) : (_jsx("div", { className: "space-y-4", children: carts.map((c) => (_jsxs("div", { className: "rounded-md border border-border", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-border bg-muted/30 px-3 py-2 text-sm", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("span", { className: "font-mono font-medium", children: ["Kar ", c.cart_number] }), _jsxs(Badge, { variant: c.is_complete ? "default" : "secondary", className: "gap-1", children: [c.is_complete && _jsx(CheckCircle2, { className: "h-3 w-3" }), c.is_complete ? "Volledig" : "Deels"] }), c.order_id === null && multiOrder && (_jsx(Badge, { variant: "outline", children: "Gedeelde kar" })), c.carrier_type && (_jsxs(Badge, { variant: "outline", className: "font-mono text-[10px]", children: [c.carrier_type, c.max_layers ? ` · ${c.max_layers} lagen` : ""] }))] }), _jsxs("div", { className: "text-muted-foreground", children: [Number(c.total_layers_used ?? 0), " lagen \u00B7 benutting", " ", Math.round(Number(c.occupancy_pct ?? 0) * 10) / 10, "%"] })] }), _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Artikel" }), _jsx(TableHead, { className: "text-right", children: "Planten" }), _jsx(TableHead, { className: "text-right", children: "Fusten" }), _jsx(TableHead, { children: "Belading" }), _jsx(TableHead, { className: "text-right", children: "Laag-aandeel" })] }) }), _jsx(TableBody, { children: (c.order_cart_items ?? []).map((i) => {
|
|
86
|
+
return (_jsxs(Card, { children: [_jsxs(CardHeader, { className: "flex flex-row items-center justify-between", children: [_jsx(CardTitle, { className: "text-base", children: "Karindeling" }), _jsxs("div", { className: "flex items-center gap-2", children: [lockedAt && (_jsxs(Badge, { variant: "outline", className: "gap-1", children: [_jsx(Lock, { className: "h-3 w-3" }), "Vergrendeld \u2014 pakbon geprint ", lockedDate] })), multiOrder && (_jsxs(Badge, { variant: "outline", title: orders.map((o) => o.order_number ?? o.id).join(", "), children: ["Buffer \u00B7 ", orders.length, " orders"] })), !error && (_jsxs(Badge, { variant: "secondary", children: [carts.length, " kar(ren)", sourceLabel ? ` · bron: ${sourceLabel}` : ""] }))] })] }), _jsx(CardContent, { children: isLoading ? (_jsx("p", { className: "text-sm text-muted-foreground", children: "Karindeling laden\u2026" })) : error ? (_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium text-destructive", children: "Kon de karindeling niet laden." }), _jsx("p", { className: "text-sm text-muted-foreground", children: error.message })] })) : carts.length === 0 ? (_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Nog geen karindeling beschikbaar voor deze order." }), blocked && (blocked.explanation || blocked.reason) && (_jsxs("p", { className: "text-sm text-destructive", children: [blocked.explanation ?? blocked.reason, blocked.at ? ` (${new Date(blocked.at).toLocaleString("nl-NL")})` : ""] }))] })) : (_jsx("div", { className: "space-y-4", children: carts.map((c) => (_jsxs("div", { className: "rounded-md border border-border", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-border bg-muted/30 px-3 py-2 text-sm", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("span", { className: "font-mono font-medium", children: ["Kar ", c.cart_number] }), _jsxs(Badge, { variant: c.is_complete ? "default" : "secondary", className: "gap-1", children: [c.is_complete && _jsx(CheckCircle2, { className: "h-3 w-3" }), c.is_complete ? "Volledig" : "Deels"] }), c.order_id === null && multiOrder && (_jsx(Badge, { variant: "outline", children: "Gedeelde kar" })), c.carrier_type && (_jsxs(Badge, { variant: "outline", className: "font-mono text-[10px]", children: [c.carrier_type, c.max_layers ? ` · ${c.max_layers} lagen` : ""] }))] }), _jsxs("div", { className: "text-muted-foreground", children: [Number(c.total_layers_used ?? 0), " lagen \u00B7 benutting", " ", Math.round(Number(c.occupancy_pct ?? 0) * 10) / 10, "%"] })] }), _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Artikel" }), _jsx(TableHead, { className: "text-right", children: "Planten" }), _jsx(TableHead, { className: "text-right", children: "Fusten" }), _jsx(TableHead, { children: "Belading" }), _jsx(TableHead, { className: "text-right", children: "Laag-aandeel" })] }) }), _jsx(TableBody, { children: (c.order_cart_items ?? []).map((i) => {
|
|
84
87
|
const own = i.order_item_id
|
|
85
88
|
? orderNumberByItem.get(i.order_item_id)
|
|
86
89
|
: undefined;
|
|
87
90
|
const crates = Number(i.crates ?? 0);
|
|
88
|
-
return (_jsxs(TableRow, { children: [_jsx(TableCell, { children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { children: i.product_name ?? "—" }), multiOrder && own?.orderNumber && (_jsx(Badge, { variant: own.orderId ===
|
|
91
|
+
return (_jsxs(TableRow, { children: [_jsx(TableCell, { children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { children: i.product_name ?? "—" }), multiOrder && own?.orderNumber && (_jsx(Badge, { variant: own.orderId === dbOrderId ? "default" : "outline", className: "text-[10px]", children: own.orderNumber }))] }) }), _jsx(TableCell, { className: "text-right", children: crates * Number(i.plants_per_crate ?? 0) }), _jsx(TableCell, { className: "text-right", children: crates }), _jsx(TableCell, { className: "font-mono text-xs", children: belading(i) }), _jsxs(TableCell, { className: "text-right", children: [Math.round(Number(i.layer_share_pct ?? 0) * 10) / 10, "%"] })] }, i.id));
|
|
89
92
|
}) })] })] }, c.id))) })) })] }));
|
|
90
93
|
}
|
|
@@ -10736,6 +10736,24 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
10736
10736
|
};
|
|
10737
10737
|
Relationships: [];
|
|
10738
10738
|
};
|
|
10739
|
+
maps_job_lease: {
|
|
10740
|
+
Row: {
|
|
10741
|
+
job: string;
|
|
10742
|
+
locked_until: string;
|
|
10743
|
+
updated_at: string;
|
|
10744
|
+
};
|
|
10745
|
+
Insert: {
|
|
10746
|
+
job: string;
|
|
10747
|
+
locked_until?: string;
|
|
10748
|
+
updated_at?: string;
|
|
10749
|
+
};
|
|
10750
|
+
Update: {
|
|
10751
|
+
job?: string;
|
|
10752
|
+
locked_until?: string;
|
|
10753
|
+
updated_at?: string;
|
|
10754
|
+
};
|
|
10755
|
+
Relationships: [];
|
|
10756
|
+
};
|
|
10739
10757
|
maps_request_queue: {
|
|
10740
10758
|
Row: {
|
|
10741
10759
|
attempts: number;
|
|
@@ -13597,6 +13615,8 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
13597
13615
|
foutmelding: string | null;
|
|
13598
13616
|
gebruiker_id: string | null;
|
|
13599
13617
|
gebruiker_naam: string;
|
|
13618
|
+
gebruikte_bron: string | null;
|
|
13619
|
+
gebruikte_layout_id: string | null;
|
|
13600
13620
|
gestart_op: string | null;
|
|
13601
13621
|
herkomst: string | null;
|
|
13602
13622
|
id: string;
|
|
@@ -13627,6 +13647,8 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
13627
13647
|
foutmelding?: string | null;
|
|
13628
13648
|
gebruiker_id?: string | null;
|
|
13629
13649
|
gebruiker_naam?: string;
|
|
13650
|
+
gebruikte_bron?: string | null;
|
|
13651
|
+
gebruikte_layout_id?: string | null;
|
|
13630
13652
|
gestart_op?: string | null;
|
|
13631
13653
|
herkomst?: string | null;
|
|
13632
13654
|
id?: string;
|
|
@@ -13657,6 +13679,8 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
13657
13679
|
foutmelding?: string | null;
|
|
13658
13680
|
gebruiker_id?: string | null;
|
|
13659
13681
|
gebruiker_naam?: string;
|
|
13682
|
+
gebruikte_bron?: string | null;
|
|
13683
|
+
gebruikte_layout_id?: string | null;
|
|
13660
13684
|
gestart_op?: string | null;
|
|
13661
13685
|
herkomst?: string | null;
|
|
13662
13686
|
id?: string;
|
|
@@ -20326,6 +20350,8 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
20326
20350
|
foutmelding: string | null;
|
|
20327
20351
|
gebruiker_id: string | null;
|
|
20328
20352
|
gebruiker_naam: string;
|
|
20353
|
+
gebruikte_bron: string | null;
|
|
20354
|
+
gebruikte_layout_id: string | null;
|
|
20329
20355
|
gestart_op: string | null;
|
|
20330
20356
|
herkomst: string | null;
|
|
20331
20357
|
id: string;
|
|
@@ -20447,6 +20473,8 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
20447
20473
|
foutmelding: string | null;
|
|
20448
20474
|
gebruiker_id: string | null;
|
|
20449
20475
|
gebruiker_naam: string;
|
|
20476
|
+
gebruikte_bron: string | null;
|
|
20477
|
+
gebruikte_layout_id: string | null;
|
|
20450
20478
|
gestart_op: string | null;
|
|
20451
20479
|
herkomst: string | null;
|
|
20452
20480
|
id: string;
|
|
@@ -21503,6 +21531,12 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
21503
21531
|
};
|
|
21504
21532
|
Returns: string;
|
|
21505
21533
|
};
|
|
21534
|
+
logistics_document_type_map: {
|
|
21535
|
+
Args: {
|
|
21536
|
+
_document_code: string;
|
|
21537
|
+
};
|
|
21538
|
+
Returns: Database["public"]["Enums"]["doc_layout_type"][];
|
|
21539
|
+
};
|
|
21506
21540
|
logistics_emit_event: {
|
|
21507
21541
|
Args: {
|
|
21508
21542
|
p_event_type: string;
|
|
@@ -21966,6 +22000,14 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
|
|
|
21966
22000
|
};
|
|
21967
22001
|
Returns: string;
|
|
21968
22002
|
};
|
|
22003
|
+
maps_cron_token: {
|
|
22004
|
+
Args: never;
|
|
22005
|
+
Returns: string;
|
|
22006
|
+
};
|
|
22007
|
+
maps_kick_queue: {
|
|
22008
|
+
Args: never;
|
|
22009
|
+
Returns: undefined;
|
|
22010
|
+
};
|
|
21969
22011
|
mark_offer_clicked: {
|
|
21970
22012
|
Args: {
|
|
21971
22013
|
p_code: string;
|