@burdenoff/microfe-movethewheels 2026.920.2 → 2026.921.1
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/components/CarbonFootprintPanel.js +1 -1
- package/dist/components/CustomerPicker.js +271 -0
- package/dist/components/DataTable.js +140 -139
- package/dist/components/DocumentsCard.js +14 -8
- package/dist/generated/wspace-types.d.ts +1043 -5
- package/dist/hooks/useAnalytics.js +21 -1
- package/dist/hooks/useCustomers.js +94 -78
- package/dist/hooks/useDebouncedValue.js +11 -0
- package/dist/hooks/useEntityDocuments.js +28 -18
- package/dist/hooks/useEpod.js +24 -17
- package/dist/hooks/useFleet.js +146 -125
- package/dist/hooks/useInventory.js +255 -186
- package/dist/hooks/useMultiModalShipments.js +35 -27
- package/dist/hooks/useOrders.js +73 -73
- package/dist/hooks/useRoutes.js +97 -75
- package/dist/hooks/useTracking.js +100 -88
- package/dist/movethewheels/components/CustomerPicker.d.ts +19 -0
- package/dist/movethewheels/components/DataTable.d.ts +5 -1
- package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
- package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
- package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
- package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
- package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
- package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
- package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
- package/dist/movethewheels/hooks/useOrders.d.ts +33 -5
- package/dist/movethewheels/hooks/useRoutes.d.ts +2 -1
- package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
- package/dist/movethewheels/types/index.d.ts +7 -5
- package/dist/movethewheels/utils/navigation.d.ts +14 -0
- package/dist/pages/CreateOrderPage.js +228 -217
- package/dist/pages/CustomerDetailsPage.js +220 -220
- package/dist/pages/CustomersPage.js +61 -54
- package/dist/pages/DeliveryCapturePage.js +131 -109
- package/dist/pages/DriversPage.js +100 -92
- package/dist/pages/InventoryPage.js +239 -236
- package/dist/pages/MultiModalShipmentPage.js +163 -130
- package/dist/pages/OrderDetailsPage.js +224 -208
- package/dist/pages/OrdersListPage.js +66 -60
- package/dist/pages/ProductDetailsPage.js +241 -200
- package/dist/pages/ProductsPage.js +59 -52
- package/dist/pages/RouteDetailsPage.js +343 -321
- package/dist/pages/RoutesPage.js +55 -48
- package/dist/pages/VehiclesPage.js +63 -56
- package/dist/pages/WarehousesPage.js +60 -53
- package/dist/utils/navigation.js +22 -1
- package/package.json +1 -1
- package/src/generated/wspace-types.ts +1188 -5
- package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
- package/src/movethewheels/components/CustomerPicker.tsx +321 -0
- package/src/movethewheels/components/DataTable.tsx +34 -18
- package/src/movethewheels/components/DocumentsCard.tsx +6 -1
- package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
- package/src/movethewheels/hooks/useAnalytics.ts +27 -0
- package/src/movethewheels/hooks/useCustomers.ts +64 -24
- package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
- package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
- package/src/movethewheels/hooks/useEpod.ts +14 -7
- package/src/movethewheels/hooks/useFleet.ts +58 -37
- package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
- package/src/movethewheels/hooks/useInventory.ts +211 -90
- package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
- package/src/movethewheels/hooks/useOrders.ts +13 -14
- package/src/movethewheels/hooks/useRoutes.ts +80 -23
- package/src/movethewheels/hooks/useTracking.ts +130 -98
- package/src/movethewheels/pages/CreateOrderPage.tsx +92 -31
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +15 -6
- package/src/movethewheels/pages/CustomersPage.tsx +11 -1
- package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
- package/src/movethewheels/pages/DriversPage.tsx +24 -12
- package/src/movethewheels/pages/InventoryPage.tsx +57 -32
- package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
- package/src/movethewheels/pages/OrderDetailsPage.tsx +17 -1
- package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
- package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
- package/src/movethewheels/pages/ProductsPage.tsx +11 -1
- package/src/movethewheels/pages/RouteDetailsPage.tsx +35 -5
- package/src/movethewheels/pages/RoutesPage.tsx +11 -1
- package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
- package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
- package/src/movethewheels/types/index.ts +7 -5
- package/src/movethewheels/utils/navigation.ts +32 -0
|
@@ -4,27 +4,28 @@ import { ArrowUpRight as n } from "../node_modules/lucide-react/dist/esm/icons/a
|
|
|
4
4
|
import { Boxes as r } from "../node_modules/lucide-react/dist/esm/icons/boxes.js";
|
|
5
5
|
import { ChevronRight as i } from "../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
|
|
6
6
|
import { CircleCheck as a } from "../node_modules/lucide-react/dist/esm/icons/circle-check.js";
|
|
7
|
-
import { History as
|
|
8
|
-
import { Lock as
|
|
9
|
-
import { Package as
|
|
10
|
-
import { Plus as
|
|
11
|
-
import { TriangleAlert as
|
|
12
|
-
import { Warehouse as
|
|
13
|
-
import { joinPath as
|
|
14
|
-
import { useMoveTheWheels as
|
|
15
|
-
import { useInventory as
|
|
16
|
-
import { Badge as
|
|
17
|
-
import { PageLayout as
|
|
18
|
-
import { MetricCard as
|
|
19
|
-
import { StatusBadge as
|
|
20
|
-
import { DataTable as
|
|
21
|
-
import { formatCurrency as
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
7
|
+
import { History as ee } from "../node_modules/lucide-react/dist/esm/icons/history.js";
|
|
8
|
+
import { Lock as te } from "../node_modules/lucide-react/dist/esm/icons/lock.js";
|
|
9
|
+
import { Package as o } from "../node_modules/lucide-react/dist/esm/icons/package.js";
|
|
10
|
+
import { Plus as s } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
11
|
+
import { TriangleAlert as c } from "../node_modules/lucide-react/dist/esm/icons/triangle-alert.js";
|
|
12
|
+
import { Warehouse as ne } from "../node_modules/lucide-react/dist/esm/icons/warehouse.js";
|
|
13
|
+
import { joinPath as re } from "../utils/navigation.js";
|
|
14
|
+
import { useMoveTheWheels as ie } from "../providers/MoveTheWheelsProvider.js";
|
|
15
|
+
import { useInventory as l, useInventoryStats as u, useInventoryTransactions as ae } from "../hooks/useInventory.js";
|
|
16
|
+
import { Badge as d, Button as f, Card as p, CardContent as m, CardHeader as oe, CardTitle as h, Progress as g } from "../components/ui.js";
|
|
17
|
+
import { PageLayout as _, PageSection as v } from "../components/PageLayout.js";
|
|
18
|
+
import { MetricCard as y, MetricCardSkeleton as b, MetricGrid as x } from "../components/MetricCard.js";
|
|
19
|
+
import { StatusBadge as se } from "../components/StatusBadge.js";
|
|
20
|
+
import { DataTable as ce } from "../components/DataTable.js";
|
|
21
|
+
import { formatCurrency as le, formatDate as ue } from "../utils/formatters.js";
|
|
22
|
+
import { useDebouncedValue as de } from "../hooks/useDebouncedValue.js";
|
|
23
|
+
import { useMemo as fe, useState as S } from "react";
|
|
24
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
25
|
+
import { useI18n as T } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
26
|
+
import { CTAOverflowMenu as E, EmphasisPanel as D, PagePurpose as O } from "@burdenoff/fe-libs/ui";
|
|
26
27
|
//#region src/movethewheels/pages/InventoryPage.tsx
|
|
27
|
-
var
|
|
28
|
+
var k = {
|
|
28
29
|
out_of_stock: {
|
|
29
30
|
bg: "bg-status-error-bg-subtle",
|
|
30
31
|
text: "text-status-error-text"
|
|
@@ -37,336 +38,338 @@ var P = {
|
|
|
37
38
|
bg: "bg-status-success-bg-subtle",
|
|
38
39
|
text: "text-status-success-text"
|
|
39
40
|
}
|
|
40
|
-
},
|
|
41
|
+
}, A = {
|
|
41
42
|
RECEIPT: "in",
|
|
42
43
|
RETURN: "in",
|
|
43
44
|
ISSUE: "out",
|
|
44
45
|
TRANSFER: "neutral",
|
|
45
46
|
ADJUSTMENT: "neutral"
|
|
46
|
-
},
|
|
47
|
+
}, j = {
|
|
47
48
|
RECEIPT: "Inbound",
|
|
48
49
|
RETURN: "Return",
|
|
49
50
|
ISSUE: "Outbound",
|
|
50
51
|
TRANSFER: "Transfer",
|
|
51
52
|
ADJUSTMENT: "Adjustment"
|
|
52
53
|
};
|
|
53
|
-
function
|
|
54
|
-
let { t:
|
|
55
|
-
let n =
|
|
54
|
+
function M() {
|
|
55
|
+
let { t: M } = T(), N = (e, t) => {
|
|
56
|
+
let n = M(e);
|
|
56
57
|
return n === e ? t : n;
|
|
57
|
-
}, { basePath:
|
|
58
|
+
}, { basePath: P, navigate: F } = ie(), [I, L] = S(""), [R, z] = S(0), [B, V] = S(10), { inventory: H, lowStockItems: U, products: W, warehouses: pe, totalItems: me, hasMore: he, isLoading: G, error: K, refetch: q } = l({
|
|
59
|
+
search: de(I),
|
|
60
|
+
limit: B,
|
|
61
|
+
offset: R * B
|
|
62
|
+
}), { stats: J } = u(), { transactions: Y, isLoading: ge, error: X } = ae({ limit: 8 }), Z = (e) => F?.(re(P, e)), Q = (e, t) => {
|
|
58
63
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), t());
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
available: n.availableQuantity,
|
|
72
|
-
reorderLevel: n.reorderLevel,
|
|
73
|
-
stockState: n.quantity === 0 ? "out_of_stock" : n.availableQuantity <= n.reorderLevel ? "low" : "in_stock"
|
|
74
|
-
};
|
|
75
|
-
});
|
|
76
|
-
}, [
|
|
77
|
-
V,
|
|
78
|
-
H,
|
|
79
|
-
U,
|
|
80
|
-
$
|
|
81
|
-
]), ce = [
|
|
64
|
+
}, $ = N("movethewheels.inventory.lowStock.unknownProduct", "Unknown Product"), _e = fe(() => H.map((e) => ({
|
|
65
|
+
id: e.id,
|
|
66
|
+
productId: e.productId,
|
|
67
|
+
productName: e.productName ?? $,
|
|
68
|
+
sku: e.productSku ?? "—",
|
|
69
|
+
warehouseName: e.warehouseName ?? "—",
|
|
70
|
+
onHand: e.quantity,
|
|
71
|
+
allocated: e.reservedQuantity,
|
|
72
|
+
available: e.availableQuantity,
|
|
73
|
+
reorderLevel: e.reorderLevel,
|
|
74
|
+
stockState: e.quantity === 0 ? "out_of_stock" : e.availableQuantity <= e.reorderLevel ? "low" : "in_stock"
|
|
75
|
+
})), [H, $]), ve = [
|
|
82
76
|
{
|
|
83
77
|
id: "product",
|
|
84
|
-
header:
|
|
78
|
+
header: N("movethewheels.inventory.stock.product", "Product"),
|
|
85
79
|
accessorKey: "productName",
|
|
86
80
|
sortable: !0,
|
|
87
|
-
cell: (e) => /* @__PURE__ */
|
|
81
|
+
cell: (e) => /* @__PURE__ */ C("span", {
|
|
88
82
|
className: "font-medium",
|
|
89
83
|
children: e.productName
|
|
90
84
|
})
|
|
91
85
|
},
|
|
92
86
|
{
|
|
93
87
|
id: "sku",
|
|
94
|
-
header:
|
|
88
|
+
header: N("movethewheels.inventory.stock.sku", "SKU"),
|
|
95
89
|
accessorKey: "sku",
|
|
96
90
|
sortable: !0,
|
|
97
|
-
cell: (e) => /* @__PURE__ */
|
|
91
|
+
cell: (e) => /* @__PURE__ */ C("span", {
|
|
98
92
|
className: "text-sm text-text-secondary",
|
|
99
93
|
children: e.sku
|
|
100
94
|
})
|
|
101
95
|
},
|
|
102
96
|
{
|
|
103
97
|
id: "warehouse",
|
|
104
|
-
header:
|
|
98
|
+
header: N("movethewheels.inventory.stock.warehouse", "Warehouse"),
|
|
105
99
|
accessorKey: "warehouseName",
|
|
106
100
|
sortable: !0
|
|
107
101
|
},
|
|
108
102
|
{
|
|
109
103
|
id: "onHand",
|
|
110
|
-
header:
|
|
104
|
+
header: N("movethewheels.inventory.stock.onHand", "On hand"),
|
|
111
105
|
accessorKey: "onHand",
|
|
112
106
|
sortable: !0,
|
|
113
|
-
cell: (e) => /* @__PURE__ */
|
|
107
|
+
cell: (e) => /* @__PURE__ */ C("span", {
|
|
114
108
|
className: "font-medium",
|
|
115
109
|
children: e.onHand.toLocaleString()
|
|
116
110
|
})
|
|
117
111
|
},
|
|
118
112
|
{
|
|
119
113
|
id: "allocated",
|
|
120
|
-
header:
|
|
114
|
+
header: N("movethewheels.inventory.stock.allocated", "Allocated"),
|
|
121
115
|
accessorKey: "allocated",
|
|
122
116
|
sortable: !0,
|
|
123
117
|
cell: (e) => e.allocated.toLocaleString()
|
|
124
118
|
},
|
|
125
119
|
{
|
|
126
120
|
id: "available",
|
|
127
|
-
header:
|
|
121
|
+
header: N("movethewheels.inventory.stock.available", "Available"),
|
|
128
122
|
accessorKey: "available",
|
|
129
123
|
sortable: !0,
|
|
130
|
-
cell: (e) => /* @__PURE__ */
|
|
124
|
+
cell: (e) => /* @__PURE__ */ C("span", {
|
|
131
125
|
className: "font-medium",
|
|
132
126
|
children: e.available.toLocaleString()
|
|
133
127
|
})
|
|
134
128
|
},
|
|
135
129
|
{
|
|
136
130
|
id: "reorderPoint",
|
|
137
|
-
header:
|
|
131
|
+
header: N("movethewheels.inventory.stock.reorderPoint", "Reorder point"),
|
|
138
132
|
accessorKey: "reorderLevel",
|
|
139
133
|
sortable: !0,
|
|
140
134
|
cell: (e) => e.reorderLevel > 0 ? e.reorderLevel.toLocaleString() : "—"
|
|
141
135
|
},
|
|
142
136
|
{
|
|
143
137
|
id: "state",
|
|
144
|
-
header:
|
|
145
|
-
cell: (e) => /* @__PURE__ */
|
|
146
|
-
status: e.stockState === "out_of_stock" ?
|
|
147
|
-
customColors:
|
|
138
|
+
header: N("movethewheels.inventory.stock.status", "Status"),
|
|
139
|
+
cell: (e) => /* @__PURE__ */ C(se, {
|
|
140
|
+
status: e.stockState === "out_of_stock" ? N("movethewheels.inventory.stock.outOfStock", "Out of stock") : e.stockState === "low" ? N("movethewheels.inventory.stock.low", "Low") : N("movethewheels.inventory.stock.inStock", "In stock"),
|
|
141
|
+
customColors: k[e.stockState],
|
|
148
142
|
size: "sm"
|
|
149
143
|
})
|
|
150
144
|
}
|
|
151
145
|
];
|
|
152
|
-
return /* @__PURE__ */
|
|
153
|
-
title:
|
|
154
|
-
subtitle:
|
|
155
|
-
icon: /* @__PURE__ */
|
|
156
|
-
headerActions: /* @__PURE__ */
|
|
146
|
+
return /* @__PURE__ */ w(_, {
|
|
147
|
+
title: N("movethewheels.inventory.title", "Inventory"),
|
|
148
|
+
subtitle: N("movethewheels.inventory.subtitle", "Manage your products and warehouses"),
|
|
149
|
+
icon: /* @__PURE__ */ C(o, { size: 24 }),
|
|
150
|
+
headerActions: /* @__PURE__ */ C(E, {
|
|
157
151
|
primary: {
|
|
158
|
-
label:
|
|
159
|
-
icon: /* @__PURE__ */
|
|
160
|
-
onSelect: () =>
|
|
152
|
+
label: N("movethewheels.inventory.actions.addProduct", "Add Product"),
|
|
153
|
+
icon: /* @__PURE__ */ C(s, { size: 16 }),
|
|
154
|
+
onSelect: () => Z("inventory/products/new")
|
|
161
155
|
},
|
|
162
156
|
actions: [{
|
|
163
|
-
label:
|
|
164
|
-
onSelect: () =>
|
|
157
|
+
label: N("movethewheels.inventory.actions.products", "Products"),
|
|
158
|
+
onSelect: () => Z("inventory/products")
|
|
165
159
|
}, {
|
|
166
|
-
label:
|
|
167
|
-
onSelect: () =>
|
|
160
|
+
label: N("movethewheels.inventory.actions.warehouses", "Warehouses"),
|
|
161
|
+
onSelect: () => Z("inventory/warehouses")
|
|
168
162
|
}]
|
|
169
163
|
}),
|
|
170
164
|
children: [
|
|
171
|
-
/* @__PURE__ */ O
|
|
172
|
-
icon: /* @__PURE__ */
|
|
173
|
-
children:
|
|
165
|
+
/* @__PURE__ */ C(O, {
|
|
166
|
+
icon: /* @__PURE__ */ C(o, { size: 18 }),
|
|
167
|
+
children: N("movethewheels.inventory.purpose", "A real-time view of what you have and where. Track on-hand, allocated and free-to-promise quantities across warehouses, follow every stock movement, catch low-stock items before they run out, and drill into products or warehouses to manage what you can promise on an order.")
|
|
174
168
|
}),
|
|
175
|
-
|
|
169
|
+
K && !G ? /* @__PURE__ */ C(p, {
|
|
176
170
|
className: "border-status-error-border",
|
|
177
|
-
children: /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ w(m, {
|
|
178
172
|
className: "p-6 text-center space-y-3",
|
|
179
173
|
children: [
|
|
180
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ C("p", {
|
|
181
175
|
className: "text-status-error-text font-medium",
|
|
182
|
-
children:
|
|
176
|
+
children: N("movethewheels.inventory.error.title", "Couldn't load inventory")
|
|
183
177
|
}),
|
|
184
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ C("p", {
|
|
185
179
|
className: "text-sm text-text-secondary",
|
|
186
|
-
children:
|
|
180
|
+
children: K.message
|
|
187
181
|
}),
|
|
188
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ C(f, {
|
|
189
183
|
variant: "outline",
|
|
190
|
-
onClick:
|
|
191
|
-
children:
|
|
184
|
+
onClick: q,
|
|
185
|
+
children: N("movethewheels.inventory.error.retry", "Retry")
|
|
192
186
|
})
|
|
193
187
|
]
|
|
194
188
|
})
|
|
195
|
-
}) :
|
|
189
|
+
}) : G ? /* @__PURE__ */ C(x, {
|
|
196
190
|
columns: 6,
|
|
197
|
-
children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */
|
|
198
|
-
}) : /* @__PURE__ */
|
|
191
|
+
children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ C(b, {}, t))
|
|
192
|
+
}) : /* @__PURE__ */ w(x, {
|
|
199
193
|
columns: 6,
|
|
200
194
|
children: [
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
label:
|
|
203
|
-
value:
|
|
204
|
-
icon: /* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ C(y, {
|
|
196
|
+
label: N("movethewheels.inventory.metrics.totalOnHand", "Total on-hand"),
|
|
197
|
+
value: J.totalOnHand.toLocaleString(),
|
|
198
|
+
icon: /* @__PURE__ */ C(r, { size: 20 }),
|
|
205
199
|
accent: "brand",
|
|
206
|
-
subtitle:
|
|
200
|
+
subtitle: N("movethewheels.inventory.metrics.onHandHint", "Units in the network")
|
|
207
201
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
label:
|
|
210
|
-
value:
|
|
211
|
-
icon: /* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ C(y, {
|
|
203
|
+
label: N("movethewheels.inventory.metrics.available", "Available"),
|
|
204
|
+
value: J.totalAvailable.toLocaleString(),
|
|
205
|
+
icon: /* @__PURE__ */ C(a, { size: 20 }),
|
|
212
206
|
accent: "success",
|
|
213
|
-
subtitle:
|
|
207
|
+
subtitle: N("movethewheels.inventory.metrics.availableHint", "Free to promise")
|
|
214
208
|
}),
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
-
label:
|
|
217
|
-
value:
|
|
218
|
-
icon: /* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ C(y, {
|
|
210
|
+
label: N("movethewheels.inventory.metrics.allocated", "Allocated"),
|
|
211
|
+
value: J.totalAllocated.toLocaleString(),
|
|
212
|
+
icon: /* @__PURE__ */ C(te, { size: 20 }),
|
|
219
213
|
accent: "blue",
|
|
220
|
-
subtitle:
|
|
214
|
+
subtitle: N("movethewheels.inventory.metrics.allocatedHint", "Committed to orders")
|
|
221
215
|
}),
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
label:
|
|
224
|
-
value:
|
|
225
|
-
icon: /* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ C(y, {
|
|
217
|
+
label: N("movethewheels.inventory.metrics.lowStock", "Low-stock items"),
|
|
218
|
+
value: J.lowStockCount.toLocaleString(),
|
|
219
|
+
icon: /* @__PURE__ */ C(c, { size: 20 }),
|
|
226
220
|
accent: "warning",
|
|
227
|
-
subtitle:
|
|
221
|
+
subtitle: N("movethewheels.inventory.metrics.lowStockHint", "At or under reorder point")
|
|
228
222
|
}),
|
|
229
|
-
/* @__PURE__ */
|
|
230
|
-
label:
|
|
231
|
-
value:
|
|
232
|
-
icon: /* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ C(y, {
|
|
224
|
+
label: N("movethewheels.inventory.metrics.totalProducts", "Catalog items"),
|
|
225
|
+
value: J.totalProducts.toLocaleString(),
|
|
226
|
+
icon: /* @__PURE__ */ C(o, { size: 20 }),
|
|
233
227
|
accent: "neutral",
|
|
234
|
-
onClick: () =>
|
|
228
|
+
onClick: () => Z("inventory/products")
|
|
235
229
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
label:
|
|
238
|
-
value:
|
|
239
|
-
icon: /* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ C(y, {
|
|
231
|
+
label: N("movethewheels.inventory.metrics.warehouses", "Warehouses"),
|
|
232
|
+
value: J.totalWarehouses.toLocaleString(),
|
|
233
|
+
icon: /* @__PURE__ */ C(ne, { size: 20 }),
|
|
240
234
|
accent: "neutral",
|
|
241
|
-
onClick: () =>
|
|
235
|
+
onClick: () => Z("inventory/warehouses")
|
|
242
236
|
})
|
|
243
237
|
]
|
|
244
238
|
}),
|
|
245
|
-
|
|
239
|
+
U.length > 0 && /* @__PURE__ */ w(D, {
|
|
246
240
|
className: "space-y-4",
|
|
247
|
-
children: [/* @__PURE__ */
|
|
241
|
+
children: [/* @__PURE__ */ w("h2", {
|
|
248
242
|
className: "flex items-center gap-2 text-base font-semibold text-status-warning-text",
|
|
249
243
|
children: [
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
|
|
244
|
+
/* @__PURE__ */ C(c, { size: 18 }),
|
|
245
|
+
N("movethewheels.inventory.lowStock.title", "Low Stock Alert"),
|
|
252
246
|
" (",
|
|
253
|
-
|
|
247
|
+
J.lowStockCount,
|
|
254
248
|
" ",
|
|
255
|
-
|
|
249
|
+
N("movethewheels.inventory.lowStock.items", "items"),
|
|
256
250
|
")"
|
|
257
251
|
]
|
|
258
|
-
}), /* @__PURE__ */
|
|
252
|
+
}), /* @__PURE__ */ C("div", { children: /* @__PURE__ */ C("div", {
|
|
259
253
|
className: "space-y-3",
|
|
260
|
-
children:
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
className: "
|
|
264
|
-
children:
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
254
|
+
children: U.map((e) => /* @__PURE__ */ w("div", {
|
|
255
|
+
className: "flex items-center justify-between p-3 bg-status-warning-bg/10 rounded-lg",
|
|
256
|
+
children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
257
|
+
className: "font-medium",
|
|
258
|
+
children: e.productName ?? N("movethewheels.inventory.lowStock.unknownProduct", "Unknown Product")
|
|
259
|
+
}), /* @__PURE__ */ w("p", {
|
|
260
|
+
className: "text-sm text-text-secondary",
|
|
261
|
+
children: [
|
|
262
|
+
N("movethewheels.inventory.lowStock.sku", "SKU:"),
|
|
263
|
+
" ",
|
|
264
|
+
e.productSku ?? "—"
|
|
265
|
+
]
|
|
266
|
+
})] }), /* @__PURE__ */ w("div", {
|
|
267
|
+
className: "text-right",
|
|
268
|
+
children: [/* @__PURE__ */ w("p", {
|
|
269
|
+
className: "font-medium text-status-warning-text",
|
|
270
|
+
children: [
|
|
271
|
+
e.availableQuantity,
|
|
272
|
+
" ",
|
|
273
|
+
N("movethewheels.inventory.lowStock.left", "left")
|
|
274
|
+
]
|
|
275
|
+
}), /* @__PURE__ */ w("p", {
|
|
268
276
|
className: "text-sm text-text-secondary",
|
|
269
277
|
children: [
|
|
270
|
-
|
|
278
|
+
N("movethewheels.inventory.lowStock.reorderAt", "Reorder at:"),
|
|
271
279
|
" ",
|
|
272
|
-
|
|
280
|
+
e.reorderLevel
|
|
273
281
|
]
|
|
274
|
-
})] }), /* @__PURE__ */ k("div", {
|
|
275
|
-
className: "text-right",
|
|
276
|
-
children: [/* @__PURE__ */ k("p", {
|
|
277
|
-
className: "font-medium text-status-warning-text",
|
|
278
|
-
children: [
|
|
279
|
-
e.availableQuantity,
|
|
280
|
-
" ",
|
|
281
|
-
R("movethewheels.inventory.lowStock.left", "left")
|
|
282
|
-
]
|
|
283
|
-
}), /* @__PURE__ */ k("p", {
|
|
284
|
-
className: "text-sm text-text-secondary",
|
|
285
|
-
children: [
|
|
286
|
-
R("movethewheels.inventory.lowStock.reorderAt", "Reorder at:"),
|
|
287
|
-
" ",
|
|
288
|
-
e.reorderLevel
|
|
289
|
-
]
|
|
290
|
-
})]
|
|
291
282
|
})]
|
|
292
|
-
}
|
|
293
|
-
})
|
|
283
|
+
})]
|
|
284
|
+
}, e.id))
|
|
294
285
|
}) })]
|
|
295
286
|
}),
|
|
296
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ w("div", {
|
|
297
288
|
className: "grid grid-cols-1 xl:grid-cols-3 gap-6",
|
|
298
|
-
children: [/* @__PURE__ */
|
|
289
|
+
children: [/* @__PURE__ */ C("div", {
|
|
299
290
|
className: "xl:col-span-2",
|
|
300
|
-
children: /* @__PURE__ */
|
|
301
|
-
title:
|
|
302
|
-
children: /* @__PURE__ */
|
|
303
|
-
columns:
|
|
304
|
-
data:
|
|
305
|
-
isLoading:
|
|
306
|
-
error:
|
|
307
|
-
onRetry:
|
|
291
|
+
children: /* @__PURE__ */ C(v, {
|
|
292
|
+
title: N("movethewheels.inventory.stock.title", "Stock position"),
|
|
293
|
+
children: /* @__PURE__ */ C(ce, {
|
|
294
|
+
columns: ve,
|
|
295
|
+
data: _e,
|
|
296
|
+
isLoading: G,
|
|
297
|
+
error: K,
|
|
298
|
+
onRetry: q,
|
|
308
299
|
searchable: !0,
|
|
309
|
-
searchPlaceholder:
|
|
300
|
+
searchPlaceholder: N("movethewheels.inventory.stock.search", "Search product, SKU or warehouse..."),
|
|
310
301
|
searchFields: [
|
|
311
302
|
"productName",
|
|
312
303
|
"sku",
|
|
313
304
|
"warehouseName"
|
|
314
305
|
],
|
|
315
|
-
|
|
306
|
+
searchQuery: I,
|
|
307
|
+
onSearchQueryChange: (e) => {
|
|
308
|
+
L(e), z(0);
|
|
309
|
+
},
|
|
310
|
+
pageIndex: R,
|
|
311
|
+
pageSize: B,
|
|
312
|
+
onPageChange: z,
|
|
313
|
+
onPageSizeChange: (e) => {
|
|
314
|
+
V(e), z(0);
|
|
315
|
+
},
|
|
316
|
+
totalItems: me,
|
|
317
|
+
hasNextPage: he,
|
|
318
|
+
onRowClick: (e) => Z(`inventory/products/${e.productId}`),
|
|
316
319
|
getRowId: (e) => e.id,
|
|
317
320
|
emptyIllustration: "empty-data",
|
|
318
|
-
emptyTitle:
|
|
319
|
-
emptyDescription:
|
|
321
|
+
emptyTitle: N("movethewheels.inventory.stock.emptyTitle", "No stock recorded yet"),
|
|
322
|
+
emptyDescription: N("movethewheels.inventory.stock.emptyDescription", "Stock lines appear here once a product is received into a warehouse.")
|
|
320
323
|
})
|
|
321
324
|
})
|
|
322
|
-
}), /* @__PURE__ */
|
|
325
|
+
}), /* @__PURE__ */ w(p, {
|
|
323
326
|
className: "h-fit",
|
|
324
|
-
children: [/* @__PURE__ */
|
|
327
|
+
children: [/* @__PURE__ */ C(oe, { children: /* @__PURE__ */ w(h, {
|
|
325
328
|
className: "flex items-center gap-2",
|
|
326
|
-
children: [/* @__PURE__ */
|
|
327
|
-
}) }), /* @__PURE__ */
|
|
329
|
+
children: [/* @__PURE__ */ C(ee, { size: 18 }), N("movethewheels.inventory.transactions.title", "Recent transactions")]
|
|
330
|
+
}) }), /* @__PURE__ */ C(m, {
|
|
328
331
|
className: "p-0",
|
|
329
|
-
children:
|
|
332
|
+
children: X ? /* @__PURE__ */ C("p", {
|
|
330
333
|
className: "p-6 text-sm text-status-error-text",
|
|
331
|
-
children:
|
|
332
|
-
}) :
|
|
334
|
+
children: X.message
|
|
335
|
+
}) : ge ? /* @__PURE__ */ C("p", {
|
|
333
336
|
className: "p-6 text-sm text-text-secondary",
|
|
334
|
-
children:
|
|
335
|
-
}) :
|
|
337
|
+
children: N("movethewheels.inventory.transactions.loading", "Loading movements…")
|
|
338
|
+
}) : Y.length === 0 ? /* @__PURE__ */ C("p", {
|
|
336
339
|
className: "p-6 text-sm text-text-secondary",
|
|
337
|
-
children:
|
|
338
|
-
}) : /* @__PURE__ */
|
|
340
|
+
children: N("movethewheels.inventory.transactions.empty", "No stock movements recorded yet. Receipts, issues and adjustments show up here as they happen.")
|
|
341
|
+
}) : /* @__PURE__ */ C("ul", {
|
|
339
342
|
className: "divide-y",
|
|
340
|
-
children:
|
|
341
|
-
let i =
|
|
342
|
-
return /* @__PURE__ */
|
|
343
|
+
children: Y.map((r) => {
|
|
344
|
+
let i = A[r.type], a = W.find((e) => e.id === r.productId)?.name ?? r.transactionNumber;
|
|
345
|
+
return /* @__PURE__ */ w("li", {
|
|
343
346
|
className: "flex items-start justify-between gap-3 p-4",
|
|
344
|
-
children: [/* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ w("div", {
|
|
345
348
|
className: "min-w-0",
|
|
346
349
|
children: [
|
|
347
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ w("p", {
|
|
348
351
|
className: "flex items-center gap-1.5 font-medium",
|
|
349
|
-
children: [i === "in" ? /* @__PURE__ */
|
|
352
|
+
children: [i === "in" ? /* @__PURE__ */ C(e, {
|
|
350
353
|
size: 14,
|
|
351
354
|
className: "text-status-success-text"
|
|
352
|
-
}) : i === "out" ? /* @__PURE__ */
|
|
355
|
+
}) : i === "out" ? /* @__PURE__ */ C(n, {
|
|
353
356
|
size: 14,
|
|
354
357
|
className: "text-status-warning-text"
|
|
355
|
-
}) : /* @__PURE__ */
|
|
358
|
+
}) : /* @__PURE__ */ C(t, {
|
|
356
359
|
size: 14,
|
|
357
360
|
className: "text-text-secondary"
|
|
358
|
-
}),
|
|
361
|
+
}), j[r.type]]
|
|
359
362
|
}),
|
|
360
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ C("p", {
|
|
361
364
|
className: "truncate text-sm text-text-secondary",
|
|
362
365
|
children: a
|
|
363
366
|
}),
|
|
364
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ C("p", {
|
|
365
368
|
className: "text-xs text-text-secondary",
|
|
366
|
-
children:
|
|
369
|
+
children: ue(r.createdAt, "short")
|
|
367
370
|
})
|
|
368
371
|
]
|
|
369
|
-
}), /* @__PURE__ */
|
|
372
|
+
}), /* @__PURE__ */ w("span", {
|
|
370
373
|
className: i === "in" ? "font-medium text-status-success-text" : i === "out" ? "font-medium text-status-warning-text" : "font-medium text-text-primary",
|
|
371
374
|
children: [i === "in" ? "+" : i === "out" ? "−" : "", Math.abs(r.quantity).toLocaleString()]
|
|
372
375
|
})]
|
|
@@ -376,54 +379,54 @@ function L() {
|
|
|
376
379
|
})]
|
|
377
380
|
})]
|
|
378
381
|
}),
|
|
379
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ w("div", {
|
|
380
383
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
381
|
-
children: [/* @__PURE__ */
|
|
382
|
-
title:
|
|
383
|
-
actions: /* @__PURE__ */
|
|
384
|
+
children: [/* @__PURE__ */ C(v, {
|
|
385
|
+
title: N("movethewheels.inventory.warehouses.title", "Warehouses"),
|
|
386
|
+
actions: /* @__PURE__ */ w(f, {
|
|
384
387
|
variant: "ghost",
|
|
385
388
|
size: "sm",
|
|
386
|
-
onClick: () =>
|
|
389
|
+
onClick: () => Z("inventory/warehouses"),
|
|
387
390
|
children: [
|
|
388
|
-
|
|
391
|
+
N("movethewheels.inventory.common.viewAll", "View all"),
|
|
389
392
|
" ",
|
|
390
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ C(i, { size: 16 })
|
|
391
394
|
]
|
|
392
395
|
}),
|
|
393
|
-
children: /* @__PURE__ */
|
|
396
|
+
children: /* @__PURE__ */ C(p, { children: /* @__PURE__ */ C(m, {
|
|
394
397
|
className: "p-0",
|
|
395
|
-
children: /* @__PURE__ */
|
|
398
|
+
children: /* @__PURE__ */ C("div", {
|
|
396
399
|
className: "divide-y",
|
|
397
|
-
children:
|
|
400
|
+
children: pe.map((e) => /* @__PURE__ */ C("div", {
|
|
398
401
|
role: "button",
|
|
399
402
|
tabIndex: 0,
|
|
400
403
|
"aria-label": `View warehouse ${e.name}`,
|
|
401
404
|
className: "p-4 hover:bg-bg-sunken/50 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
|
|
402
|
-
onClick: () =>
|
|
403
|
-
onKeyDown: (t) =>
|
|
404
|
-
children: /* @__PURE__ */
|
|
405
|
+
onClick: () => Z(`inventory/warehouses/${e.id}`),
|
|
406
|
+
onKeyDown: (t) => Q(t, () => Z(`inventory/warehouses/${e.id}`)),
|
|
407
|
+
children: /* @__PURE__ */ w("div", {
|
|
405
408
|
className: "flex items-center justify-between",
|
|
406
|
-
children: [/* @__PURE__ */
|
|
409
|
+
children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
407
410
|
className: "font-medium",
|
|
408
411
|
children: e.name
|
|
409
|
-
}), /* @__PURE__ */
|
|
412
|
+
}), /* @__PURE__ */ w("p", {
|
|
410
413
|
className: "text-sm text-text-secondary",
|
|
411
414
|
children: [
|
|
412
415
|
e.address.city,
|
|
413
416
|
", ",
|
|
414
417
|
e.address.state
|
|
415
418
|
]
|
|
416
|
-
})] }), /* @__PURE__ */
|
|
419
|
+
})] }), /* @__PURE__ */ w("div", {
|
|
417
420
|
className: "text-right",
|
|
418
|
-
children: [/* @__PURE__ */
|
|
421
|
+
children: [/* @__PURE__ */ C(d, {
|
|
419
422
|
variant: e.isActive ? "default" : "secondary",
|
|
420
|
-
children: e.isActive ?
|
|
421
|
-
}), /* @__PURE__ */
|
|
423
|
+
children: e.isActive ? N("movethewheels.inventory.warehouses.active", "Active") : N("movethewheels.inventory.warehouses.inactive", "Inactive")
|
|
424
|
+
}), /* @__PURE__ */ w("div", {
|
|
422
425
|
className: "mt-2",
|
|
423
|
-
children: [/* @__PURE__ */
|
|
426
|
+
children: [/* @__PURE__ */ C("p", {
|
|
424
427
|
className: "text-xs text-text-secondary",
|
|
425
|
-
children:
|
|
426
|
-
}), /* @__PURE__ */
|
|
428
|
+
children: N("movethewheels.inventory.warehouses.utilization", "Utilization")
|
|
429
|
+
}), /* @__PURE__ */ C(g, {
|
|
427
430
|
value: e.capacity.usedSpace / e.capacity.totalSpace * 100,
|
|
428
431
|
className: "w-24 h-2"
|
|
429
432
|
})]
|
|
@@ -433,43 +436,43 @@ function L() {
|
|
|
433
436
|
}, e.id))
|
|
434
437
|
})
|
|
435
438
|
}) })
|
|
436
|
-
}), /* @__PURE__ */
|
|
437
|
-
title:
|
|
438
|
-
actions: /* @__PURE__ */
|
|
439
|
+
}), /* @__PURE__ */ C(v, {
|
|
440
|
+
title: N("movethewheels.inventory.products.title", "Recent Products"),
|
|
441
|
+
actions: /* @__PURE__ */ w(f, {
|
|
439
442
|
variant: "ghost",
|
|
440
443
|
size: "sm",
|
|
441
|
-
onClick: () =>
|
|
444
|
+
onClick: () => Z("inventory/products"),
|
|
442
445
|
children: [
|
|
443
|
-
|
|
446
|
+
N("movethewheels.inventory.common.viewAll", "View all"),
|
|
444
447
|
" ",
|
|
445
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ C(i, { size: 16 })
|
|
446
449
|
]
|
|
447
450
|
}),
|
|
448
|
-
children: /* @__PURE__ */
|
|
451
|
+
children: /* @__PURE__ */ C(p, { children: /* @__PURE__ */ C(m, {
|
|
449
452
|
className: "p-0",
|
|
450
|
-
children: /* @__PURE__ */
|
|
453
|
+
children: /* @__PURE__ */ C("div", {
|
|
451
454
|
className: "divide-y",
|
|
452
|
-
children:
|
|
455
|
+
children: W.slice(0, 5).map((e) => /* @__PURE__ */ C("div", {
|
|
453
456
|
role: "button",
|
|
454
457
|
tabIndex: 0,
|
|
455
458
|
"aria-label": `View product ${e.name}`,
|
|
456
459
|
className: "p-4 hover:bg-bg-sunken/50 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
|
|
457
|
-
onClick: () =>
|
|
458
|
-
onKeyDown: (t) =>
|
|
459
|
-
children: /* @__PURE__ */
|
|
460
|
+
onClick: () => Z(`inventory/products/${e.id}`),
|
|
461
|
+
onKeyDown: (t) => Q(t, () => Z(`inventory/products/${e.id}`)),
|
|
462
|
+
children: /* @__PURE__ */ w("div", {
|
|
460
463
|
className: "flex items-center justify-between",
|
|
461
|
-
children: [/* @__PURE__ */
|
|
464
|
+
children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
462
465
|
className: "font-medium",
|
|
463
466
|
children: e.name
|
|
464
|
-
}), /* @__PURE__ */
|
|
467
|
+
}), /* @__PURE__ */ C("p", {
|
|
465
468
|
className: "text-sm text-text-secondary",
|
|
466
469
|
children: e.sku
|
|
467
|
-
})] }), /* @__PURE__ */
|
|
470
|
+
})] }), /* @__PURE__ */ w("div", {
|
|
468
471
|
className: "text-right",
|
|
469
|
-
children: [/* @__PURE__ */
|
|
472
|
+
children: [/* @__PURE__ */ C("p", {
|
|
470
473
|
className: "font-medium",
|
|
471
|
-
children:
|
|
472
|
-
}), /* @__PURE__ */
|
|
474
|
+
children: le(e.value)
|
|
475
|
+
}), /* @__PURE__ */ C(d, {
|
|
473
476
|
variant: "outline",
|
|
474
477
|
children: e.category
|
|
475
478
|
})]
|
|
@@ -484,4 +487,4 @@ function L() {
|
|
|
484
487
|
});
|
|
485
488
|
}
|
|
486
489
|
//#endregion
|
|
487
|
-
export {
|
|
490
|
+
export { M as default };
|