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