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