@burdenoff/microfe-movethewheels 2026.1031.3 → 2026.1031.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/MoveTheWheelsRoot.js +136 -127
- package/dist/MoveTheWheelsRoutes.js +140 -135
- package/dist/components/DocumentsCard.js +11 -11
- package/dist/components/ProofOfDeliveryCard.js +13 -13
- package/dist/components/ShipmentRiskDialog.js +24 -24
- package/dist/components/ShippingQuoteResults.js +46 -46
- package/dist/components/TrackingAlertList.js +17 -17
- package/dist/generated/tracking-quality-operations.d.ts +56 -0
- package/dist/hooks/useOrderDispatch.js +17 -17
- package/dist/movethewheels/pages/SettingsPage.d.ts +1 -0
- package/dist/movethewheels/providers/ModuleSettingsProvider.d.ts +17 -0
- package/dist/movethewheels/utils/formatters.d.ts +23 -3
- package/dist/movethewheels/utils/moduleSettings.d.ts +52 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/bell.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/rotate-ccw.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/settings.js +13 -0
- package/dist/pages/AnalyticsPage.js +27 -27
- package/dist/pages/CreateOrderPage.js +340 -317
- package/dist/pages/CustomerDetailsPage.js +246 -246
- package/dist/pages/CustomersPage.js +19 -19
- package/dist/pages/DashboardPage.js +24 -24
- package/dist/pages/DeliveryCapturePage.js +74 -74
- package/dist/pages/DriverDetailsPage.js +337 -337
- package/dist/pages/DriversPage.js +26 -26
- package/dist/pages/FinancePage.js +26 -26
- package/dist/pages/InventoryPage.js +28 -28
- package/dist/pages/LiveTrackingPage.js +108 -108
- package/dist/pages/MarketplacePage.js +44 -44
- package/dist/pages/OrderDetailsPage.js +306 -306
- package/dist/pages/OrdersListPage.js +27 -27
- package/dist/pages/ProductDetailsPage.js +89 -89
- package/dist/pages/ProductsPage.js +73 -73
- package/dist/pages/RouteDetailsPage.js +282 -285
- package/dist/pages/RoutesPage.js +78 -78
- package/dist/pages/SettingsPage.js +459 -0
- package/dist/pages/TrackingPage.js +41 -41
- package/dist/pages/VehicleDetailsPage.js +207 -207
- package/dist/pages/VehiclesPage.js +17 -16
- package/dist/pages/WarehouseDetailsPage.js +132 -132
- package/dist/providers/ModuleSettingsProvider.js +74 -0
- package/dist/utils/formatters.js +53 -26
- package/dist/utils/moduleSettings.js +132 -0
- package/package.json +3 -2
- package/src/generated/tracking-quality-operations.ts +62 -0
- package/src/movethewheels/MoveTheWheelsRoot.tsx +14 -3
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +9 -0
- package/src/movethewheels/pages/CreateOrderPage.tsx +38 -6
- package/src/movethewheels/pages/ProductsPage.tsx +2 -2
- package/src/movethewheels/pages/RouteDetailsPage.tsx +3 -6
- package/src/movethewheels/pages/RoutesPage.tsx +2 -2
- package/src/movethewheels/pages/SettingsPage.tsx +516 -0
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +4 -2
- package/src/movethewheels/pages/VehiclesPage.tsx +2 -1
- package/src/movethewheels/providers/ModuleSettingsProvider.tsx +133 -0
- package/src/movethewheels/utils/formatters.ts +69 -10
- package/src/movethewheels/utils/moduleSettings.ts +224 -0
|
@@ -9,36 +9,36 @@ import { Mail as re } from "../node_modules/lucide-react/dist/esm/icons/mail.js"
|
|
|
9
9
|
import { MapPin as i } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
|
|
10
10
|
import { Package as a } from "../node_modules/lucide-react/dist/esm/icons/package.js";
|
|
11
11
|
import { Phone as ie } from "../node_modules/lucide-react/dist/esm/icons/phone.js";
|
|
12
|
-
import { Printer as
|
|
13
|
-
import { Search as
|
|
14
|
-
import { SquarePen as
|
|
15
|
-
import { Truck as
|
|
16
|
-
import { UserCheck as
|
|
17
|
-
import { User as
|
|
18
|
-
import { joinPath as
|
|
19
|
-
import { useMoveTheWheels as
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import { DocumentsCard as
|
|
31
|
-
import { reuseRecoveryContextKey as
|
|
32
|
-
import { useDebouncedValue as
|
|
33
|
-
import { EntityCombobox as
|
|
34
|
-
import { useOrderDispatch as
|
|
35
|
-
import { ProofOfDeliveryCard as
|
|
36
|
-
import { useState as
|
|
37
|
-
import { useParams as
|
|
38
|
-
import { Fragment as
|
|
39
|
-
import { EmphasisPanel as
|
|
12
|
+
import { Printer as o } from "../node_modules/lucide-react/dist/esm/icons/printer.js";
|
|
13
|
+
import { Search as ae } from "../node_modules/lucide-react/dist/esm/icons/search.js";
|
|
14
|
+
import { SquarePen as s } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
|
|
15
|
+
import { Truck as oe } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
16
|
+
import { UserCheck as se } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
|
|
17
|
+
import { User as ce } from "../node_modules/lucide-react/dist/esm/icons/user.js";
|
|
18
|
+
import { joinPath as le } from "../utils/navigation.js";
|
|
19
|
+
import { useMoveTheWheels as c } from "../providers/MoveTheWheelsProvider.js";
|
|
20
|
+
import { isVehicleAssignable as l } from "../utils/orderVehicleHold.js";
|
|
21
|
+
import { formatAddress as u, formatCurrency as d, formatDate as f } from "../utils/formatters.js";
|
|
22
|
+
import { useTr as ue } from "../shared/hooks/useTr.js";
|
|
23
|
+
import { useOrder as de, useOrders as fe } from "../hooks/useOrders.js";
|
|
24
|
+
import { useDriver as pe, useDrivers as me, useVehicle as he, useVehicles as ge } from "../hooks/useFleet.js";
|
|
25
|
+
import { Badge as p, Button as m, Card as h, CardContent as g, CardHeader as _, CardTitle as v, Input as _e, Label as y, Separator as b, Table as ve, TableBody as ye, TableCell as x, TableHead as S, TableHeader as be, TableRow as xe } from "../components/ui.js";
|
|
26
|
+
import { ErrorState as Se, LoadingState as Ce, PageLayout as we } from "../components/PageLayout.js";
|
|
27
|
+
import { PaymentStatusBadge as Te, PriorityBadge as Ee, StatusBadge as De } from "../components/StatusBadge.js";
|
|
28
|
+
import { FormError as C } from "../components/FormError.js";
|
|
29
|
+
import { Notice as Oe } from "../components/Notice.js";
|
|
30
|
+
import { DocumentsCard as ke } from "../components/DocumentsCard.js";
|
|
31
|
+
import { reuseRecoveryContextKey as w, reuseRecoveryScope as T } from "../utils/reuseRecovery.js";
|
|
32
|
+
import { useDebouncedValue as Ae } from "../hooks/useDebouncedValue.js";
|
|
33
|
+
import { EntityCombobox as E } from "../components/EntityCombobox.js";
|
|
34
|
+
import { useOrderDispatch as je } from "../hooks/useOrderDispatch.js";
|
|
35
|
+
import { ProofOfDeliveryCard as Me } from "../components/ProofOfDeliveryCard.js";
|
|
36
|
+
import { useState as D } from "react";
|
|
37
|
+
import { useParams as Ne } from "react-router";
|
|
38
|
+
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
39
|
+
import { EmphasisPanel as Pe, NextSteps as Fe, PagePurpose as Ie } from "@burdenoff/fe-libs/ui";
|
|
40
40
|
//#region src/movethewheels/pages/OrderDetailsPage.tsx
|
|
41
|
-
var
|
|
41
|
+
var j = [
|
|
42
42
|
"pending",
|
|
43
43
|
"confirmed",
|
|
44
44
|
"assigned",
|
|
@@ -46,7 +46,7 @@ var k = [
|
|
|
46
46
|
"in_transit",
|
|
47
47
|
"out_for_delivery",
|
|
48
48
|
"delivered"
|
|
49
|
-
],
|
|
49
|
+
], Le = {
|
|
50
50
|
pending: "Pending",
|
|
51
51
|
confirmed: "Confirmed",
|
|
52
52
|
assigned: "Assigned",
|
|
@@ -57,355 +57,355 @@ var k = [
|
|
|
57
57
|
returned: "Returned",
|
|
58
58
|
cancelled: "Cancelled",
|
|
59
59
|
failed: "Failed"
|
|
60
|
-
},
|
|
60
|
+
}, Re = new Set([
|
|
61
61
|
"delivered",
|
|
62
62
|
"returned",
|
|
63
63
|
"cancelled",
|
|
64
64
|
"failed"
|
|
65
65
|
]);
|
|
66
|
-
function
|
|
67
|
-
let t =
|
|
68
|
-
return t === -1 || t >=
|
|
66
|
+
function ze(e) {
|
|
67
|
+
let t = j.indexOf(e);
|
|
68
|
+
return t === -1 || t >= j.length - 1 ? null : j[t + 1];
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
let e =
|
|
72
|
-
|
|
70
|
+
function M() {
|
|
71
|
+
let e = c(), { orderId: t } = Ne(), n = T(e.currentUser?.id, e.workspaceId, e.tenantId, e.apiGatewayUrl, e.workspaceToken), r = JSON.stringify([
|
|
72
|
+
w(n),
|
|
73
73
|
e.currentUser?.id,
|
|
74
74
|
e.workspaceId,
|
|
75
75
|
e.tenantId,
|
|
76
76
|
e.apiGatewayUrl,
|
|
77
77
|
t
|
|
78
78
|
]);
|
|
79
|
-
return /* @__PURE__ */
|
|
79
|
+
return /* @__PURE__ */ k(N, {
|
|
80
80
|
contextKey: r,
|
|
81
81
|
contextReady: n !== null
|
|
82
82
|
}, r);
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
let
|
|
84
|
+
function N({ contextKey: w, contextReady: T }) {
|
|
85
|
+
let j = ue(), { orderId: M } = Ne(), { basePath: N, navigate: P } = c(), { order: F, isLoading: I, error: L, refetch: Be } = de(M), { updateOrder: Ve, updateOrderStatus: He } = fe(), [Ue, We] = D(""), [Ge, Ke] = D(""), [qe, Je] = D(""), Ye = Ae(Ue), { vehicles: Xe, isLoading: R, isLoadingMore: Ze, hasMore: Qe, totalVehicles: $e, error: z, refetch: et, loadMore: tt } = ge({
|
|
86
86
|
limit: 20,
|
|
87
|
-
search:
|
|
88
|
-
}), { drivers:
|
|
87
|
+
search: Ye || void 0
|
|
88
|
+
}), { drivers: nt, isLoading: B, isLoadingMore: rt, hasMore: it, totalDrivers: at, error: V, refetch: ot, loadMore: st } = me({
|
|
89
89
|
limit: 20,
|
|
90
|
-
search:
|
|
91
|
-
}), { vehicle:
|
|
92
|
-
|
|
93
|
-
},
|
|
94
|
-
order:
|
|
95
|
-
contextKey:
|
|
96
|
-
ready:
|
|
97
|
-
assignmentReady: !!(
|
|
98
|
-
movementReady:
|
|
99
|
-
updateOrder:
|
|
100
|
-
updateOrderStatus:
|
|
101
|
-
refresh:
|
|
102
|
-
}),
|
|
103
|
-
|
|
90
|
+
search: Ye || void 0
|
|
91
|
+
}), { vehicle: H, isLoading: ct, error: lt, refetch: ut } = he(Ge || F?.vehicleId || void 0), { driver: U, isLoading: dt, error: ft, refetch: pt } = pe(qe || F?.driverId || void 0), mt = Xe.filter((e) => l(e.status) || e.id === F?.vehicleId), ht = nt.filter((e) => e.status === "available" || e.id === F?.driverId), { vehicle: W, isLoading: gt, error: _t, refetch: vt } = he(F?.vehicleId), G = !F?.vehicleId || !gt && !_t && W?.id === F.vehicleId, K = !!(F?.vehicleId && G && W && !l(W.status)), q = Ge || F?.vehicleId, J = qe || F?.driverId, Y = !q || !ct && !lt && H?.id === q, X = !J || !dt && !ft && U?.id === J, yt = !!(q && Y && H && !l(H.status)), bt = !!(F && !(F.vehicleId && F.driverId) && F.status === "confirmed"), xt = yt && (q !== F?.vehicleId || bt), St = () => {
|
|
92
|
+
Be(), ut(), vt(), pt(), et(), ot();
|
|
93
|
+
}, Z = je({
|
|
94
|
+
order: F,
|
|
95
|
+
contextKey: w,
|
|
96
|
+
ready: T && !I && !L && !!F,
|
|
97
|
+
assignmentReady: !!(q && J) && Y && X && !xt && !R && !B && !z && !V,
|
|
98
|
+
movementReady: G && !K,
|
|
99
|
+
updateOrder: Ve,
|
|
100
|
+
updateOrderStatus: He,
|
|
101
|
+
refresh: St
|
|
102
|
+
}), Ct = q !== F?.vehicleId || J !== F?.driverId, Q = Z.busy || Z.blocked || !T || I || !!L, wt = () => Z.assign(q ?? "", J ?? ""), Tt = (e) => Z.changeStatus(e), Et = H?.status === "maintenance" ? j("movethewheels.order.vehicleMaintenance", "Vehicle marked for maintenance. Choose another vehicle.") : H?.status === "decommissioned" ? j("movethewheels.order.vehicleDecommissioned", "Vehicle decommissioned. Choose another vehicle.") : j("movethewheels.order.vehicleInactive", "Vehicle marked inactive. Choose another vehicle."), $ = (e) => {
|
|
103
|
+
P && P(le(N, e));
|
|
104
104
|
};
|
|
105
|
-
return
|
|
106
|
-
title:
|
|
107
|
-
subtitle: `Created ${
|
|
108
|
-
icon: /* @__PURE__ */
|
|
109
|
-
headerActions: /* @__PURE__ */
|
|
105
|
+
return I && !F ? /* @__PURE__ */ k(Ce, { message: "Loading order details..." }) : F ? /* @__PURE__ */ A(we, {
|
|
106
|
+
title: F.orderNumber,
|
|
107
|
+
subtitle: `Created ${f(F.createdAt, "full")}`,
|
|
108
|
+
icon: /* @__PURE__ */ k(a, { size: 24 }),
|
|
109
|
+
headerActions: /* @__PURE__ */ A("div", {
|
|
110
110
|
className: "flex gap-2",
|
|
111
111
|
children: [
|
|
112
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ A(m, {
|
|
113
113
|
variant: "outline",
|
|
114
114
|
onClick: () => {
|
|
115
|
-
|
|
115
|
+
P && P(le(N, "orders"));
|
|
116
116
|
},
|
|
117
|
-
children: [/* @__PURE__ */
|
|
117
|
+
children: [/* @__PURE__ */ k(e, { size: 16 }), "Back"]
|
|
118
118
|
}),
|
|
119
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ A(m, {
|
|
120
120
|
variant: "outline",
|
|
121
121
|
onClick: () => window.print(),
|
|
122
|
-
children: [/* @__PURE__ */
|
|
122
|
+
children: [/* @__PURE__ */ k(o, { size: 16 }), "Print"]
|
|
123
123
|
}),
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
onClick: () => $(`orders/${
|
|
126
|
-
children: [/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ A(m, {
|
|
125
|
+
onClick: () => $(`orders/${M}/edit`),
|
|
126
|
+
children: [/* @__PURE__ */ k(s, { size: 16 }), "Edit"]
|
|
127
127
|
})
|
|
128
128
|
]
|
|
129
129
|
}),
|
|
130
|
-
headerContent: /* @__PURE__ */
|
|
130
|
+
headerContent: /* @__PURE__ */ A("div", {
|
|
131
131
|
className: "flex flex-wrap gap-2",
|
|
132
132
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
status:
|
|
133
|
+
/* @__PURE__ */ k(De, {
|
|
134
|
+
status: F.status,
|
|
135
135
|
type: "order"
|
|
136
136
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ k(Ee, { priority: F.priority }),
|
|
138
|
+
/* @__PURE__ */ k(Te, { status: F.pricing.paymentStatus })
|
|
139
139
|
]
|
|
140
140
|
}),
|
|
141
141
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
icon: /* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ k(Ie, {
|
|
143
|
+
icon: /* @__PURE__ */ k(a, { size: 18 }),
|
|
144
144
|
children: "Everything about this one delivery in a single place — who it's for, where it's going, what's inside, the running cost and the full status history. Use this page to review the order, hand it to a driver, print the docket, or jump into live tracking."
|
|
145
145
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ k(Fe, {
|
|
147
147
|
storageKey: "movethewheels-order-details",
|
|
148
148
|
steps: [
|
|
149
149
|
{
|
|
150
150
|
id: "track",
|
|
151
151
|
label: "Track this order live",
|
|
152
152
|
description: "See where the shipment is right now on the map.",
|
|
153
|
-
icon: /* @__PURE__ */
|
|
154
|
-
onClick: () => $(`tracking?order=${
|
|
153
|
+
icon: /* @__PURE__ */ k(i, { size: 16 }),
|
|
154
|
+
onClick: () => $(`tracking?order=${F.id}`)
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
id: "edit",
|
|
158
158
|
label: "Edit order details",
|
|
159
159
|
description: "Update items, addresses or instructions before dispatch.",
|
|
160
|
-
icon: /* @__PURE__ */
|
|
161
|
-
onClick: () => $(`orders/${
|
|
160
|
+
icon: /* @__PURE__ */ k(s, { size: 16 }),
|
|
161
|
+
onClick: () => $(`orders/${M}/edit`)
|
|
162
162
|
},
|
|
163
163
|
{
|
|
164
164
|
id: "print",
|
|
165
165
|
label: "Print the delivery docket",
|
|
166
166
|
description: "Generate a printable copy for the driver or warehouse.",
|
|
167
|
-
icon: /* @__PURE__ */
|
|
167
|
+
icon: /* @__PURE__ */ k(o, { size: 16 }),
|
|
168
168
|
onClick: () => window.print()
|
|
169
169
|
}
|
|
170
170
|
]
|
|
171
171
|
}),
|
|
172
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ A("div", {
|
|
173
173
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
174
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ A("div", {
|
|
175
175
|
className: "lg:col-span-2 space-y-6",
|
|
176
176
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ A(h, { children: [/* @__PURE__ */ k(_, { children: /* @__PURE__ */ A(v, {
|
|
178
178
|
className: "flex items-center gap-2",
|
|
179
|
-
children: [/* @__PURE__ */
|
|
180
|
-
}) }), /* @__PURE__ */
|
|
179
|
+
children: [/* @__PURE__ */ k(ce, { size: 18 }), "Customer Information"]
|
|
180
|
+
}) }), /* @__PURE__ */ k(g, { children: /* @__PURE__ */ A("div", {
|
|
181
181
|
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
182
|
-
children: [/* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */
|
|
182
|
+
children: [/* @__PURE__ */ A("div", { children: [
|
|
183
|
+
/* @__PURE__ */ k("h4", {
|
|
184
184
|
className: "font-medium mb-2",
|
|
185
|
-
children:
|
|
185
|
+
children: F.customerInfo.name
|
|
186
186
|
}),
|
|
187
|
-
|
|
187
|
+
F.customerInfo.company && /* @__PURE__ */ k("p", {
|
|
188
188
|
className: "text-sm text-text-secondary mb-2",
|
|
189
|
-
children:
|
|
189
|
+
children: F.customerInfo.company
|
|
190
190
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ A("div", {
|
|
192
192
|
className: "space-y-1 text-sm",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
193
|
+
children: [/* @__PURE__ */ A("p", {
|
|
194
194
|
className: "flex items-center gap-2",
|
|
195
|
-
children: [/* @__PURE__ */
|
|
195
|
+
children: [/* @__PURE__ */ k(re, {
|
|
196
196
|
size: 14,
|
|
197
197
|
className: "text-text-secondary"
|
|
198
|
-
}),
|
|
199
|
-
}), /* @__PURE__ */
|
|
198
|
+
}), F.customerInfo.email]
|
|
199
|
+
}), /* @__PURE__ */ A("p", {
|
|
200
200
|
className: "flex items-center gap-2",
|
|
201
|
-
children: [/* @__PURE__ */
|
|
201
|
+
children: [/* @__PURE__ */ k(ie, {
|
|
202
202
|
size: 14,
|
|
203
203
|
className: "text-text-secondary"
|
|
204
|
-
}),
|
|
204
|
+
}), F.customerInfo.phone]
|
|
205
205
|
})]
|
|
206
206
|
})
|
|
207
|
-
] }), /* @__PURE__ */
|
|
207
|
+
] }), /* @__PURE__ */ A("div", { children: [F.customerInfo.preferredDeliveryTime && /* @__PURE__ */ A("div", {
|
|
208
208
|
className: "mb-2",
|
|
209
|
-
children: [/* @__PURE__ */
|
|
209
|
+
children: [/* @__PURE__ */ k("p", {
|
|
210
210
|
className: "text-sm text-text-secondary",
|
|
211
211
|
children: "Preferred Delivery Time"
|
|
212
|
-
}), /* @__PURE__ */
|
|
212
|
+
}), /* @__PURE__ */ k("p", {
|
|
213
213
|
className: "text-sm",
|
|
214
|
-
children:
|
|
214
|
+
children: F.customerInfo.preferredDeliveryTime
|
|
215
215
|
})]
|
|
216
|
-
}),
|
|
216
|
+
}), F.customerInfo.deliveryInstructions && /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
|
|
217
217
|
className: "text-sm text-text-secondary",
|
|
218
218
|
children: "Delivery Instructions"
|
|
219
|
-
}), /* @__PURE__ */
|
|
219
|
+
}), /* @__PURE__ */ k("p", {
|
|
220
220
|
className: "text-sm",
|
|
221
|
-
children:
|
|
221
|
+
children: F.customerInfo.deliveryInstructions
|
|
222
222
|
})] })] })]
|
|
223
223
|
}) })] }),
|
|
224
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ A(h, { children: [/* @__PURE__ */ k(_, { children: /* @__PURE__ */ A(v, {
|
|
225
225
|
className: "flex items-center gap-2",
|
|
226
|
-
children: [/* @__PURE__ */
|
|
227
|
-
}) }), /* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ k(i, { size: 18 }), "Addresses"]
|
|
227
|
+
}) }), /* @__PURE__ */ k(g, { children: /* @__PURE__ */ A("div", {
|
|
228
228
|
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
229
|
-
children: [/* @__PURE__ */
|
|
230
|
-
/* @__PURE__ */
|
|
229
|
+
children: [/* @__PURE__ */ A("div", { children: [
|
|
230
|
+
/* @__PURE__ */ k("h4", {
|
|
231
231
|
className: "font-medium mb-2 flex items-center gap-2",
|
|
232
|
-
children: /* @__PURE__ */
|
|
232
|
+
children: /* @__PURE__ */ k(p, {
|
|
233
233
|
variant: "outline",
|
|
234
234
|
children: "Pickup"
|
|
235
235
|
})
|
|
236
236
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ k("p", {
|
|
238
238
|
className: "text-sm",
|
|
239
|
-
children:
|
|
239
|
+
children: u(F.pickupAddress)
|
|
240
240
|
}),
|
|
241
|
-
|
|
241
|
+
F.scheduledPickup && /* @__PURE__ */ A("p", {
|
|
242
242
|
className: "text-sm text-text-secondary mt-2",
|
|
243
|
-
children: ["Scheduled: ",
|
|
243
|
+
children: ["Scheduled: ", f(F.scheduledPickup, "full")]
|
|
244
244
|
}),
|
|
245
|
-
|
|
245
|
+
F.actualPickup && /* @__PURE__ */ A("p", {
|
|
246
246
|
className: "text-sm text-status-success-text mt-1",
|
|
247
247
|
children: [
|
|
248
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ k(n, {
|
|
249
249
|
size: 14,
|
|
250
250
|
className: "inline mr-1"
|
|
251
251
|
}),
|
|
252
252
|
"Picked up: ",
|
|
253
|
-
|
|
253
|
+
f(F.actualPickup, "full")
|
|
254
254
|
]
|
|
255
255
|
})
|
|
256
|
-
] }), /* @__PURE__ */
|
|
257
|
-
/* @__PURE__ */
|
|
256
|
+
] }), /* @__PURE__ */ A("div", { children: [
|
|
257
|
+
/* @__PURE__ */ k("h4", {
|
|
258
258
|
className: "font-medium mb-2 flex items-center gap-2",
|
|
259
|
-
children: /* @__PURE__ */
|
|
259
|
+
children: /* @__PURE__ */ k(p, {
|
|
260
260
|
variant: "outline",
|
|
261
261
|
children: "Delivery"
|
|
262
262
|
})
|
|
263
263
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ k("p", {
|
|
265
265
|
className: "text-sm",
|
|
266
|
-
children:
|
|
266
|
+
children: u(F.deliveryAddress)
|
|
267
267
|
}),
|
|
268
|
-
|
|
268
|
+
F.scheduledDelivery && /* @__PURE__ */ A("p", {
|
|
269
269
|
className: "text-sm text-text-secondary mt-2",
|
|
270
|
-
children: ["Scheduled: ",
|
|
270
|
+
children: ["Scheduled: ", f(F.scheduledDelivery, "full")]
|
|
271
271
|
}),
|
|
272
|
-
|
|
272
|
+
F.actualDelivery && /* @__PURE__ */ A("p", {
|
|
273
273
|
className: "text-sm text-status-success-text mt-1",
|
|
274
274
|
children: [
|
|
275
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ k(n, {
|
|
276
276
|
size: 14,
|
|
277
277
|
className: "inline mr-1"
|
|
278
278
|
}),
|
|
279
279
|
"Delivered: ",
|
|
280
|
-
|
|
280
|
+
f(F.actualDelivery, "full")
|
|
281
281
|
]
|
|
282
282
|
})
|
|
283
283
|
] })]
|
|
284
284
|
}) })] }),
|
|
285
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ A(h, { children: [/* @__PURE__ */ k(_, { children: /* @__PURE__ */ A(v, {
|
|
286
286
|
className: "flex items-center gap-2",
|
|
287
|
-
children: [/* @__PURE__ */
|
|
288
|
-
}) }), /* @__PURE__ */
|
|
287
|
+
children: [/* @__PURE__ */ k(oe, { size: 18 }), "Saved Route"]
|
|
288
|
+
}) }), /* @__PURE__ */ k(g, { children: F.route ? /* @__PURE__ */ A("div", {
|
|
289
289
|
className: "space-y-3",
|
|
290
|
-
children: [/* @__PURE__ */
|
|
290
|
+
children: [/* @__PURE__ */ A("div", {
|
|
291
291
|
className: "flex items-center justify-between gap-3",
|
|
292
|
-
children: [/* @__PURE__ */
|
|
292
|
+
children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
|
|
293
293
|
className: "font-medium",
|
|
294
|
-
children:
|
|
295
|
-
}), /* @__PURE__ */
|
|
294
|
+
children: F.route.name
|
|
295
|
+
}), /* @__PURE__ */ A("p", {
|
|
296
296
|
className: "text-sm text-text-secondary",
|
|
297
297
|
children: [
|
|
298
|
-
|
|
298
|
+
F.route.stops.length,
|
|
299
299
|
" stops ·",
|
|
300
300
|
" ",
|
|
301
|
-
|
|
301
|
+
F.route.status.replace("_", " ").toLowerCase()
|
|
302
302
|
]
|
|
303
|
-
})] }), /* @__PURE__ */
|
|
303
|
+
})] }), /* @__PURE__ */ k(p, {
|
|
304
304
|
variant: "outline",
|
|
305
305
|
children: "Reusable route"
|
|
306
306
|
})]
|
|
307
|
-
}), /* @__PURE__ */
|
|
307
|
+
}), /* @__PURE__ */ k("div", {
|
|
308
308
|
className: "space-y-2",
|
|
309
|
-
children:
|
|
309
|
+
children: F.route.stops.map((e, t) => /* @__PURE__ */ A("div", {
|
|
310
310
|
className: "flex items-start gap-2 text-sm",
|
|
311
|
-
children: [/* @__PURE__ */
|
|
311
|
+
children: [/* @__PURE__ */ A("span", {
|
|
312
312
|
className: "text-text-secondary",
|
|
313
313
|
children: [t + 1, "."]
|
|
314
|
-
}), /* @__PURE__ */
|
|
315
|
-
/* @__PURE__ */
|
|
314
|
+
}), /* @__PURE__ */ A("span", { children: [
|
|
315
|
+
/* @__PURE__ */ k("span", {
|
|
316
316
|
className: "font-medium capitalize",
|
|
317
317
|
children: e.type
|
|
318
318
|
}),
|
|
319
319
|
" ·",
|
|
320
320
|
" ",
|
|
321
|
-
|
|
321
|
+
u(e.address)
|
|
322
322
|
] })]
|
|
323
323
|
}, e.id))
|
|
324
324
|
})]
|
|
325
|
-
}) : /* @__PURE__ */
|
|
325
|
+
}) : /* @__PURE__ */ k("p", {
|
|
326
326
|
className: "text-sm text-text-secondary",
|
|
327
327
|
children: "No saved route was selected for this order."
|
|
328
328
|
}) })] }),
|
|
329
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ A(h, { children: [/* @__PURE__ */ k(_, { children: /* @__PURE__ */ A(v, {
|
|
330
330
|
className: "flex items-center gap-2",
|
|
331
331
|
children: [
|
|
332
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ k(a, { size: 18 }),
|
|
333
333
|
"Order Items (",
|
|
334
|
-
|
|
334
|
+
F.items.length,
|
|
335
335
|
")"
|
|
336
336
|
]
|
|
337
|
-
}) }), /* @__PURE__ */
|
|
337
|
+
}) }), /* @__PURE__ */ k(g, {
|
|
338
338
|
className: "p-0",
|
|
339
|
-
children: /* @__PURE__ */
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
/* @__PURE__ */
|
|
339
|
+
children: /* @__PURE__ */ A(ve, { children: [/* @__PURE__ */ k(be, { children: /* @__PURE__ */ A(xe, { children: [
|
|
340
|
+
/* @__PURE__ */ k(S, { children: "Item" }),
|
|
341
|
+
/* @__PURE__ */ k(S, { children: "SKU" }),
|
|
342
|
+
/* @__PURE__ */ k(S, {
|
|
343
343
|
className: "text-center",
|
|
344
344
|
children: "Qty"
|
|
345
345
|
}),
|
|
346
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ k(S, {
|
|
347
347
|
className: "text-right",
|
|
348
348
|
children: "Unit Price"
|
|
349
349
|
}),
|
|
350
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ k(S, {
|
|
351
351
|
className: "text-right",
|
|
352
352
|
children: "Total"
|
|
353
353
|
})
|
|
354
|
-
] }) }), /* @__PURE__ */
|
|
355
|
-
/* @__PURE__ */
|
|
354
|
+
] }) }), /* @__PURE__ */ k(ye, { children: F.items.map((e) => /* @__PURE__ */ A(xe, { children: [
|
|
355
|
+
/* @__PURE__ */ k(x, { children: /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
|
|
356
356
|
className: "font-medium",
|
|
357
357
|
children: e.name
|
|
358
|
-
}), e.description && /* @__PURE__ */
|
|
358
|
+
}), e.description && /* @__PURE__ */ k("p", {
|
|
359
359
|
className: "text-sm text-text-secondary",
|
|
360
360
|
children: e.description
|
|
361
361
|
})] }) }),
|
|
362
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ k(x, {
|
|
363
363
|
className: "font-mono text-sm",
|
|
364
364
|
children: e.sku
|
|
365
365
|
}),
|
|
366
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ k(x, {
|
|
367
367
|
className: "text-center",
|
|
368
368
|
children: e.quantity
|
|
369
369
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ k(x, {
|
|
371
371
|
className: "text-right",
|
|
372
|
-
children:
|
|
372
|
+
children: d(e.value)
|
|
373
373
|
}),
|
|
374
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ k(x, {
|
|
375
375
|
className: "text-right font-medium",
|
|
376
|
-
children:
|
|
376
|
+
children: d(e.value * e.quantity)
|
|
377
377
|
})
|
|
378
378
|
] }, e.id)) })] })
|
|
379
379
|
})] }),
|
|
380
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ A(h, { children: [/* @__PURE__ */ k(_, { children: /* @__PURE__ */ A(v, {
|
|
381
381
|
className: "flex items-center gap-2",
|
|
382
|
-
children: [/* @__PURE__ */
|
|
383
|
-
}) }), /* @__PURE__ */
|
|
382
|
+
children: [/* @__PURE__ */ k(ee, { size: 18 }), "Order Timeline"]
|
|
383
|
+
}) }), /* @__PURE__ */ k(g, { children: /* @__PURE__ */ k("div", {
|
|
384
384
|
className: "relative",
|
|
385
|
-
children:
|
|
385
|
+
children: F.timeline.map((e, t) => /* @__PURE__ */ A("div", {
|
|
386
386
|
className: "flex gap-4 pb-6 last:pb-0",
|
|
387
|
-
children: [/* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ A("div", {
|
|
388
388
|
className: "relative",
|
|
389
|
-
children: [/* @__PURE__ */
|
|
390
|
-
}), /* @__PURE__ */
|
|
389
|
+
children: [/* @__PURE__ */ k("div", { className: "w-3 h-3 rounded-full bg-action-primary-bg mt-1.5" }), t < F.timeline.length - 1 && /* @__PURE__ */ k("div", { className: "absolute top-4 left-1.5 w-px h-full -ml-px bg-border" })]
|
|
390
|
+
}), /* @__PURE__ */ A("div", {
|
|
391
391
|
className: "flex-1",
|
|
392
392
|
children: [
|
|
393
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ A("div", {
|
|
394
394
|
className: "flex items-center gap-2 mb-1",
|
|
395
|
-
children: [/* @__PURE__ */
|
|
395
|
+
children: [/* @__PURE__ */ k(De, {
|
|
396
396
|
status: e.status,
|
|
397
397
|
type: "order",
|
|
398
398
|
size: "sm"
|
|
399
|
-
}), /* @__PURE__ */
|
|
399
|
+
}), /* @__PURE__ */ k("span", {
|
|
400
400
|
className: "text-sm text-text-secondary",
|
|
401
|
-
children:
|
|
401
|
+
children: f(e.timestamp, "full")
|
|
402
402
|
})]
|
|
403
403
|
}),
|
|
404
|
-
e.notes && /* @__PURE__ */
|
|
404
|
+
e.notes && /* @__PURE__ */ k("p", {
|
|
405
405
|
className: "text-sm",
|
|
406
406
|
children: e.notes
|
|
407
407
|
}),
|
|
408
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ A("p", {
|
|
409
409
|
className: "text-xs text-text-secondary",
|
|
410
410
|
children: ["by ", e.performedBy]
|
|
411
411
|
})
|
|
@@ -414,279 +414,279 @@ function j({ contextKey: Me, contextReady: S }) {
|
|
|
414
414
|
}, t))
|
|
415
415
|
}) })] })
|
|
416
416
|
]
|
|
417
|
-
}), /* @__PURE__ */
|
|
417
|
+
}), /* @__PURE__ */ A("div", {
|
|
418
418
|
className: "space-y-6",
|
|
419
419
|
children: [
|
|
420
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ A(Pe, { children: [/* @__PURE__ */ A("h2", {
|
|
421
421
|
className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-4",
|
|
422
|
-
children: [/* @__PURE__ */
|
|
423
|
-
}), /* @__PURE__ */
|
|
422
|
+
children: [/* @__PURE__ */ k(te, { size: 18 }), "Order Summary"]
|
|
423
|
+
}), /* @__PURE__ */ A("div", {
|
|
424
424
|
className: "space-y-3",
|
|
425
425
|
children: [
|
|
426
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ A("div", {
|
|
427
427
|
className: "flex justify-between text-sm",
|
|
428
|
-
children: [/* @__PURE__ */
|
|
428
|
+
children: [/* @__PURE__ */ k("span", {
|
|
429
429
|
className: "text-text-secondary",
|
|
430
430
|
children: "Subtotal"
|
|
431
|
-
}), /* @__PURE__ */
|
|
431
|
+
}), /* @__PURE__ */ k("span", { children: d(F.pricing.subtotal) })]
|
|
432
432
|
}),
|
|
433
|
-
/* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ A("div", {
|
|
434
434
|
className: "flex justify-between text-sm",
|
|
435
|
-
children: [/* @__PURE__ */
|
|
435
|
+
children: [/* @__PURE__ */ k("span", {
|
|
436
436
|
className: "text-text-secondary",
|
|
437
437
|
children: "Delivery"
|
|
438
|
-
}), /* @__PURE__ */
|
|
438
|
+
}), /* @__PURE__ */ k("span", { children: d(F.pricing.fees.delivery) })]
|
|
439
439
|
}),
|
|
440
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ A("div", {
|
|
441
441
|
className: "flex justify-between text-sm",
|
|
442
|
-
children: [/* @__PURE__ */
|
|
442
|
+
children: [/* @__PURE__ */ k("span", {
|
|
443
443
|
className: "text-text-secondary",
|
|
444
444
|
children: "Handling"
|
|
445
|
-
}), /* @__PURE__ */
|
|
445
|
+
}), /* @__PURE__ */ k("span", { children: d(F.pricing.fees.handling) })]
|
|
446
446
|
}),
|
|
447
|
-
|
|
447
|
+
F.pricing.fees.insurance && /* @__PURE__ */ A("div", {
|
|
448
448
|
className: "flex justify-between text-sm",
|
|
449
|
-
children: [/* @__PURE__ */
|
|
449
|
+
children: [/* @__PURE__ */ k("span", {
|
|
450
450
|
className: "text-text-secondary",
|
|
451
451
|
children: "Insurance"
|
|
452
|
-
}), /* @__PURE__ */
|
|
452
|
+
}), /* @__PURE__ */ k("span", { children: d(F.pricing.fees.insurance) })]
|
|
453
453
|
}),
|
|
454
|
-
/* @__PURE__ */
|
|
454
|
+
/* @__PURE__ */ A("div", {
|
|
455
455
|
className: "flex justify-between text-sm",
|
|
456
|
-
children: [/* @__PURE__ */
|
|
456
|
+
children: [/* @__PURE__ */ k("span", {
|
|
457
457
|
className: "text-text-secondary",
|
|
458
458
|
children: "Taxes"
|
|
459
|
-
}), /* @__PURE__ */
|
|
459
|
+
}), /* @__PURE__ */ k("span", { children: d(F.pricing.taxes) })]
|
|
460
460
|
}),
|
|
461
|
-
/* @__PURE__ */
|
|
462
|
-
/* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ k(b, {}),
|
|
462
|
+
/* @__PURE__ */ A("div", {
|
|
463
463
|
className: "flex justify-between font-medium",
|
|
464
|
-
children: [/* @__PURE__ */
|
|
464
|
+
children: [/* @__PURE__ */ k("span", { children: "Total" }), /* @__PURE__ */ k("span", {
|
|
465
465
|
className: "text-lg",
|
|
466
|
-
children:
|
|
466
|
+
children: d(F.pricing.total)
|
|
467
467
|
})]
|
|
468
468
|
}),
|
|
469
|
-
/* @__PURE__ */
|
|
469
|
+
/* @__PURE__ */ A("div", {
|
|
470
470
|
className: "pt-2",
|
|
471
|
-
children: [/* @__PURE__ */
|
|
471
|
+
children: [/* @__PURE__ */ k("p", {
|
|
472
472
|
className: "text-sm text-text-secondary",
|
|
473
473
|
children: "Payment Method"
|
|
474
|
-
}), /* @__PURE__ */
|
|
474
|
+
}), /* @__PURE__ */ k("p", {
|
|
475
475
|
className: "text-sm capitalize",
|
|
476
|
-
children:
|
|
476
|
+
children: F.pricing.paymentMethod.replace("_", " ")
|
|
477
477
|
})]
|
|
478
478
|
})
|
|
479
479
|
]
|
|
480
480
|
})] }),
|
|
481
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ A(h, { children: [/* @__PURE__ */ k(_, { children: /* @__PURE__ */ A(v, {
|
|
482
482
|
className: "flex items-center gap-2",
|
|
483
|
-
children: [/* @__PURE__ */
|
|
484
|
-
}) }), /* @__PURE__ */
|
|
483
|
+
children: [/* @__PURE__ */ k(oe, { size: 18 }), "Assignment"]
|
|
484
|
+
}) }), /* @__PURE__ */ k(g, { children: /* @__PURE__ */ A("div", {
|
|
485
485
|
className: "space-y-4",
|
|
486
486
|
children: [
|
|
487
|
-
|
|
487
|
+
I && /* @__PURE__ */ k("p", {
|
|
488
488
|
role: "status",
|
|
489
489
|
className: "text-sm",
|
|
490
|
-
children:
|
|
490
|
+
children: j("movethewheels.order.refreshing", "Refreshing order details. Changes are unavailable.")
|
|
491
491
|
}),
|
|
492
|
-
|
|
493
|
-
|
|
492
|
+
L && /* @__PURE__ */ k(C, { message: j("movethewheels.order.refreshFailed", "Order details could not be refreshed. Existing values are read-only.") }),
|
|
493
|
+
Z.message && /* @__PURE__ */ k(Oe, {
|
|
494
494
|
variant: "info",
|
|
495
|
-
message:
|
|
495
|
+
message: Z.message
|
|
496
496
|
}),
|
|
497
|
-
|
|
497
|
+
Z.knownAssignment && /* @__PURE__ */ k("p", {
|
|
498
498
|
className: "text-sm break-words",
|
|
499
499
|
role: "status",
|
|
500
|
-
children:
|
|
501
|
-
vehicle:
|
|
502
|
-
driver:
|
|
500
|
+
children: j("movethewheels.order.knownAssignment", "Saved assignment: vehicle {{vehicle}}, driver {{driver}}.", {
|
|
501
|
+
vehicle: H?.id === Z.knownAssignment.vehicleId ? H.vehicleNumber : Z.knownAssignment.vehicleId,
|
|
502
|
+
driver: U?.id === Z.knownAssignment.driverId ? U.fullName : Z.knownAssignment.driverId
|
|
503
503
|
})
|
|
504
504
|
}),
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
(!
|
|
508
|
-
/* @__PURE__ */
|
|
505
|
+
Z.blocked && /* @__PURE__ */ k(C, { message: j("movethewheels.order.blocked", "An order write is unconfirmed. Refresh is read-only and will not unlock another write.") }),
|
|
506
|
+
yt && /* @__PURE__ */ k(C, { message: Et }),
|
|
507
|
+
(!Y || !X || !G || z || V) && /* @__PURE__ */ k(C, { message: j("movethewheels.order.unverifiedFleet", "Vehicle status could not be verified. Refresh before assigning or advancing.") }),
|
|
508
|
+
/* @__PURE__ */ k(m, {
|
|
509
509
|
variant: "outline",
|
|
510
|
-
onClick:
|
|
511
|
-
disabled:
|
|
512
|
-
children:
|
|
510
|
+
onClick: St,
|
|
511
|
+
disabled: Z.busy,
|
|
512
|
+
children: j("movethewheels.order.refreshAssignment", "Refresh assignment")
|
|
513
513
|
}),
|
|
514
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
|
|
515
515
|
className: "text-sm text-text-secondary",
|
|
516
516
|
children: "Tracking Number"
|
|
517
|
-
}), /* @__PURE__ */
|
|
517
|
+
}), /* @__PURE__ */ k("p", {
|
|
518
518
|
className: "text-sm font-mono",
|
|
519
|
-
children:
|
|
519
|
+
children: F.trackingNumber || "—"
|
|
520
520
|
})] }),
|
|
521
|
-
/* @__PURE__ */
|
|
522
|
-
/* @__PURE__ */
|
|
521
|
+
/* @__PURE__ */ k(b, {}),
|
|
522
|
+
/* @__PURE__ */ A("div", {
|
|
523
523
|
className: "space-y-3",
|
|
524
524
|
children: [
|
|
525
|
-
/* @__PURE__ */
|
|
525
|
+
/* @__PURE__ */ A("div", {
|
|
526
526
|
className: "space-y-1.5",
|
|
527
|
-
children: [/* @__PURE__ */
|
|
527
|
+
children: [/* @__PURE__ */ k(y, {
|
|
528
528
|
htmlFor: "assign-fleet-search",
|
|
529
529
|
children: "Search vehicles & drivers"
|
|
530
|
-
}), /* @__PURE__ */
|
|
530
|
+
}), /* @__PURE__ */ A("div", {
|
|
531
531
|
className: "relative",
|
|
532
|
-
children: [/* @__PURE__ */
|
|
532
|
+
children: [/* @__PURE__ */ k(ae, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ k(_e, {
|
|
533
533
|
id: "assign-fleet-search",
|
|
534
|
-
value:
|
|
535
|
-
disabled:
|
|
536
|
-
onChange: (e) =>
|
|
534
|
+
value: Ue,
|
|
535
|
+
disabled: Q,
|
|
536
|
+
onChange: (e) => We(e.target.value),
|
|
537
537
|
placeholder: "Vehicle number, driver name or employee ID",
|
|
538
538
|
className: "pl-9"
|
|
539
539
|
})]
|
|
540
540
|
})]
|
|
541
541
|
}),
|
|
542
|
-
/* @__PURE__ */
|
|
542
|
+
/* @__PURE__ */ A("div", {
|
|
543
543
|
className: "space-y-1.5",
|
|
544
|
-
children: [/* @__PURE__ */
|
|
544
|
+
children: [/* @__PURE__ */ k(y, {
|
|
545
545
|
htmlFor: "assign-vehicle",
|
|
546
546
|
children: "Vehicle"
|
|
547
|
-
}), /* @__PURE__ */
|
|
547
|
+
}), /* @__PURE__ */ k(E, {
|
|
548
548
|
id: "assign-vehicle",
|
|
549
|
-
disabled:
|
|
550
|
-
value:
|
|
551
|
-
onChange:
|
|
552
|
-
options:
|
|
553
|
-
loading:
|
|
549
|
+
disabled: Q,
|
|
550
|
+
value: q ?? "",
|
|
551
|
+
onChange: Ke,
|
|
552
|
+
options: mt,
|
|
553
|
+
loading: R,
|
|
554
554
|
getId: (e) => e.id,
|
|
555
555
|
getLabel: (e) => `${e.vehicleNumber} (${e.type})`,
|
|
556
|
-
renderOption: (e) => /* @__PURE__ */ O
|
|
556
|
+
renderOption: (e) => /* @__PURE__ */ A(O, { children: [
|
|
557
557
|
e.vehicleNumber,
|
|
558
558
|
" (",
|
|
559
559
|
e.type,
|
|
560
560
|
")"
|
|
561
561
|
] }),
|
|
562
|
-
selectedOption:
|
|
563
|
-
selectedLoading: !
|
|
564
|
-
hasMore:
|
|
565
|
-
totalCount:
|
|
566
|
-
onLoadMore:
|
|
567
|
-
loadingMore:
|
|
562
|
+
selectedOption: Y ? H : null,
|
|
563
|
+
selectedLoading: !Y,
|
|
564
|
+
hasMore: Qe,
|
|
565
|
+
totalCount: $e,
|
|
566
|
+
onLoadMore: tt,
|
|
567
|
+
loadingMore: Ze,
|
|
568
568
|
required: !0,
|
|
569
|
-
placeholder:
|
|
569
|
+
placeholder: F.vehicleId ? `Current: ${F.vehicleId}` : "Select a vehicle",
|
|
570
570
|
emptyText: "No available vehicles."
|
|
571
571
|
})]
|
|
572
572
|
}),
|
|
573
|
-
/* @__PURE__ */
|
|
573
|
+
/* @__PURE__ */ A("div", {
|
|
574
574
|
className: "space-y-1.5",
|
|
575
|
-
children: [/* @__PURE__ */
|
|
575
|
+
children: [/* @__PURE__ */ k(y, {
|
|
576
576
|
htmlFor: "assign-driver",
|
|
577
577
|
children: "Driver"
|
|
578
|
-
}), /* @__PURE__ */
|
|
578
|
+
}), /* @__PURE__ */ k(E, {
|
|
579
579
|
id: "assign-driver",
|
|
580
|
-
disabled:
|
|
581
|
-
value:
|
|
582
|
-
onChange:
|
|
583
|
-
options:
|
|
584
|
-
loading:
|
|
580
|
+
disabled: Q,
|
|
581
|
+
value: J ?? "",
|
|
582
|
+
onChange: Je,
|
|
583
|
+
options: ht,
|
|
584
|
+
loading: B,
|
|
585
585
|
getId: (e) => e.id,
|
|
586
586
|
getLabel: (e) => `${e.fullName} (${e.employeeId})`,
|
|
587
|
-
renderOption: (e) => /* @__PURE__ */ O
|
|
587
|
+
renderOption: (e) => /* @__PURE__ */ A(O, { children: [
|
|
588
588
|
e.fullName,
|
|
589
589
|
" (",
|
|
590
590
|
e.employeeId,
|
|
591
591
|
")"
|
|
592
592
|
] }),
|
|
593
|
-
selectedOption:
|
|
594
|
-
selectedLoading: !
|
|
595
|
-
hasMore:
|
|
596
|
-
totalCount:
|
|
597
|
-
onLoadMore:
|
|
598
|
-
loadingMore:
|
|
593
|
+
selectedOption: X ? U : null,
|
|
594
|
+
selectedLoading: !X,
|
|
595
|
+
hasMore: it,
|
|
596
|
+
totalCount: at,
|
|
597
|
+
onLoadMore: st,
|
|
598
|
+
loadingMore: rt,
|
|
599
599
|
required: !0,
|
|
600
|
-
placeholder:
|
|
600
|
+
placeholder: F.driverId ? `Current: ${F.driverId}` : "Select a driver",
|
|
601
601
|
emptyText: "No available drivers."
|
|
602
602
|
})]
|
|
603
603
|
}),
|
|
604
|
-
/* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ A(m, {
|
|
605
605
|
className: "w-full",
|
|
606
|
-
onClick:
|
|
607
|
-
disabled:
|
|
608
|
-
children: [/* @__PURE__ */
|
|
606
|
+
onClick: wt,
|
|
607
|
+
disabled: Q || !Ct || xt || !Y || !X || R || B || !!(z || V),
|
|
608
|
+
children: [/* @__PURE__ */ k(se, { size: 16 }), Z.busy ? "Assigning…" : "Assign driver & vehicle"]
|
|
609
609
|
})
|
|
610
610
|
]
|
|
611
611
|
}),
|
|
612
|
-
/* @__PURE__ */
|
|
613
|
-
/* @__PURE__ */
|
|
612
|
+
/* @__PURE__ */ k(b, {}),
|
|
613
|
+
/* @__PURE__ */ A("div", {
|
|
614
614
|
className: "space-y-2",
|
|
615
615
|
children: [
|
|
616
|
-
/* @__PURE__ */
|
|
616
|
+
/* @__PURE__ */ A("p", {
|
|
617
617
|
className: "text-sm text-text-secondary",
|
|
618
618
|
children: [
|
|
619
619
|
"Current status:",
|
|
620
620
|
" ",
|
|
621
|
-
/* @__PURE__ */
|
|
621
|
+
/* @__PURE__ */ k("span", {
|
|
622
622
|
className: "font-medium",
|
|
623
|
-
children:
|
|
623
|
+
children: Le[F.status]
|
|
624
624
|
})
|
|
625
625
|
]
|
|
626
626
|
}),
|
|
627
|
-
|
|
627
|
+
K && /* @__PURE__ */ k("p", {
|
|
628
628
|
className: "text-sm text-status-error-text",
|
|
629
629
|
role: "status",
|
|
630
|
-
children:
|
|
630
|
+
children: j("movethewheels.order.currentVehicleHeld", "The currently assigned vehicle is on hold. Save a replacement before advancing movement.")
|
|
631
631
|
}),
|
|
632
632
|
(() => {
|
|
633
|
-
let e =
|
|
633
|
+
let e = ze(F.status);
|
|
634
634
|
if (!e) return null;
|
|
635
|
-
let n = e === "assigned" && (!
|
|
636
|
-
return /* @__PURE__ */ O
|
|
635
|
+
let n = e === "assigned" && (!F.vehicleId || !F.driverId);
|
|
636
|
+
return /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ A(m, {
|
|
637
637
|
variant: "outline",
|
|
638
638
|
className: "w-full",
|
|
639
|
-
onClick: () =>
|
|
640
|
-
disabled:
|
|
639
|
+
onClick: () => Tt(e),
|
|
640
|
+
disabled: Q || n || [
|
|
641
641
|
"assigned",
|
|
642
642
|
"picked_up",
|
|
643
643
|
"in_transit",
|
|
644
644
|
"out_for_delivery"
|
|
645
|
-
].includes(e) && (!
|
|
646
|
-
children: [/* @__PURE__ */
|
|
647
|
-
}), n && /* @__PURE__ */
|
|
645
|
+
].includes(e) && (!G || K),
|
|
646
|
+
children: [/* @__PURE__ */ k(t, { size: 16 }), Z.busy ? "Updating…" : `Advance to ${Le[e]}`]
|
|
647
|
+
}), n && /* @__PURE__ */ k("p", {
|
|
648
648
|
className: "text-xs text-text-secondary",
|
|
649
649
|
children: "Assign both a compatible vehicle and driver before dispatching this order."
|
|
650
650
|
})] });
|
|
651
651
|
})(),
|
|
652
|
-
|
|
652
|
+
F.status !== "cancelled" && !Re.has(F.status) && /* @__PURE__ */ A(m, {
|
|
653
653
|
variant: "outline",
|
|
654
654
|
className: "w-full text-status-error-text",
|
|
655
|
-
onClick: () =>
|
|
656
|
-
disabled:
|
|
657
|
-
children: [/* @__PURE__ */
|
|
655
|
+
onClick: () => Tt("cancelled"),
|
|
656
|
+
disabled: Q,
|
|
657
|
+
children: [/* @__PURE__ */ k(r, { size: 16 }), "Cancel order"]
|
|
658
658
|
})
|
|
659
659
|
]
|
|
660
660
|
}),
|
|
661
|
-
/* @__PURE__ */
|
|
661
|
+
/* @__PURE__ */ A(m, {
|
|
662
662
|
variant: "outline",
|
|
663
663
|
className: "w-full",
|
|
664
|
-
onClick: () => $(`tracking?order=${
|
|
665
|
-
children: [/* @__PURE__ */
|
|
664
|
+
onClick: () => $(`tracking?order=${F.id}`),
|
|
665
|
+
children: [/* @__PURE__ */ k(i, { size: 16 }), "Track Order"]
|
|
666
666
|
})
|
|
667
667
|
]
|
|
668
668
|
}) })] }),
|
|
669
|
-
/* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ k(ke, {
|
|
670
670
|
entityType: "order",
|
|
671
|
-
entityId:
|
|
671
|
+
entityId: F.id
|
|
672
672
|
}),
|
|
673
|
-
/* @__PURE__ */
|
|
674
|
-
|
|
673
|
+
/* @__PURE__ */ k(Me, { deliveryJobId: F.id }),
|
|
674
|
+
F.specialInstructions && /* @__PURE__ */ A(h, { children: [/* @__PURE__ */ k(_, { children: /* @__PURE__ */ A(v, {
|
|
675
675
|
className: "flex items-center gap-2",
|
|
676
|
-
children: [/* @__PURE__ */
|
|
677
|
-
}) }), /* @__PURE__ */
|
|
676
|
+
children: [/* @__PURE__ */ k(ne, { size: 18 }), "Special Instructions"]
|
|
677
|
+
}) }), /* @__PURE__ */ k(g, { children: /* @__PURE__ */ k("p", {
|
|
678
678
|
className: "text-sm",
|
|
679
|
-
children:
|
|
679
|
+
children: F.specialInstructions
|
|
680
680
|
}) })] })
|
|
681
681
|
]
|
|
682
682
|
})]
|
|
683
683
|
})
|
|
684
684
|
]
|
|
685
|
-
}) : /* @__PURE__ */
|
|
686
|
-
title:
|
|
687
|
-
message:
|
|
688
|
-
onRetry:
|
|
685
|
+
}) : /* @__PURE__ */ k(Se, {
|
|
686
|
+
title: j("movethewheels.order.unavailable", "Order unavailable"),
|
|
687
|
+
message: j("movethewheels.order.loadUnavailable", "The requested order could not be loaded. Refresh before making changes."),
|
|
688
|
+
onRetry: Be
|
|
689
689
|
});
|
|
690
690
|
}
|
|
691
691
|
//#endregion
|
|
692
|
-
export {
|
|
692
|
+
export { M as default };
|