@burdenoff/microfe-theglobalfuel 2026.804.2 → 2026.827.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/stories/MetricsCard.stories.d.ts +2 -0
- package/dist/stories/MetricsCard.stories.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/analytics/AnalyticsPage.d.ts +5 -0
- package/dist/theglobalfuel/pages/analytics/AnalyticsPage.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/analytics/AnalyticsPage.js +426 -138
- package/dist/theglobalfuel/pages/analytics/AnalyticsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js +403 -299
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js.map +1 -1
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts +4 -3
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.js +310 -254
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.js.map +1 -1
- package/dist/theglobalfuel/pages/production/ProductionPage.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/production/ProductionPage.js +29 -0
- package/dist/theglobalfuel/pages/production/ProductionPage.js.map +1 -1
- package/dist/theglobalfuel/utils/pageContext.d.ts.map +1 -1
- package/dist/theglobalfuel/utils/pageContext.js +2 -0
- package/dist/theglobalfuel/utils/pageContext.js.map +1 -1
- package/package.json +2 -2
|
@@ -5,41 +5,43 @@ import { formatDate as r, formatEnumLabel as i, formatMoney as ee, formatUnit as
|
|
|
5
5
|
import { StatusBadge as c } from "../../components/StatusBadge.js";
|
|
6
6
|
import { MiniBar as te } from "../../components/MiniBar.js";
|
|
7
7
|
import { DataTable as ne } from "../../components/DataTable.js";
|
|
8
|
-
import { ErrorView as
|
|
9
|
-
import { EmptyState as
|
|
8
|
+
import { ErrorView as l, LoadingView as u, Section as re } from "../../components/StateViews.js";
|
|
9
|
+
import { EmptyState as ie } from "../../components/EmptyState.js";
|
|
10
10
|
import "../../context/index.js";
|
|
11
|
-
import { useTheContract as
|
|
12
|
-
import { useCursorPager as
|
|
13
|
-
import { useNotify as
|
|
14
|
-
import { useThePageView as
|
|
15
|
-
import { useTheNativeControls as
|
|
11
|
+
import { useTheContract as ae, useTheDeliverShipment as oe, useTheScheduleShipment as se, useTheShipments as ce, useTheTransitionContract as le, useTheUpdateContract as ue } from "../../hooks/useTheGlobalFuelApi.js";
|
|
12
|
+
import { useCursorPager as de } from "../../hooks/useCursorPager.js";
|
|
13
|
+
import { useNotify as fe } from "../../hooks/useNotify.js";
|
|
14
|
+
import { useThePageView as pe } from "../../hooks/useThePageView.js";
|
|
15
|
+
import { useTheNativeControls as me } from "../../hooks/useTheNativeControls.js";
|
|
16
16
|
import "../../hooks/index.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
17
|
+
import { toCsv as he } from "../../utils/csv.js";
|
|
18
|
+
import { downloadTextFile as ge, slugify as _e } from "../../utils/provenance.js";
|
|
19
|
+
import { CONTRACT_TRANSITIONS as ve, nextStatuses as ye } from "../../utils/transitions.js";
|
|
20
|
+
import { Tabs as be } from "../../components/Tabs.js";
|
|
21
|
+
import { Pagination as xe } from "../../components/Pagination.js";
|
|
22
|
+
import { EvidenceUpload as Se } from "../../components/EvidenceUpload.js";
|
|
23
|
+
import { FileLink as Ce } from "../../components/FileLink.js";
|
|
24
|
+
import { TheDiscussion as we } from "../../components/TheDiscussion.js";
|
|
25
|
+
import { TheTags as Te } from "../../components/TheTags.js";
|
|
26
|
+
import { useState as d } from "react";
|
|
27
|
+
import { ArrowLeft as Ee, Building2 as De, Calendar as Oe, CheckCircle2 as ke, Coins as Ae, Download as je, FileSignature as Me, Gauge as Ne, MapPin as Pe, MessageSquare as Fe, Package as Ie, Pencil as Le, Plus as Re, Ship as ze, Tag as Be } from "lucide-react";
|
|
28
|
+
import { useParams as Ve } from "react-router";
|
|
27
29
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
28
|
-
import { Button as h, GlassCard as
|
|
30
|
+
import { Button as h, GlassCard as He, Input as g, Label as _, ResponsiveDialog as v, ResponsiveDialogContent as y, ResponsiveDialogDescription as b, ResponsiveDialogFooter as x, ResponsiveDialogHeader as S, ResponsiveDialogTitle as C, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O, Textarea as k } from "@burdenoff/fe-libs/ui";
|
|
29
31
|
//#region src/theglobalfuel/pages/contracts/ContractDetailPage.tsx
|
|
30
|
-
var
|
|
32
|
+
var Ue = [
|
|
31
33
|
"FIXED",
|
|
32
34
|
"INDEX_LINKED",
|
|
33
35
|
"FORMULA",
|
|
34
36
|
"SPOT"
|
|
35
|
-
],
|
|
37
|
+
], We = [
|
|
36
38
|
"PIPELINE",
|
|
37
39
|
"TANKER",
|
|
38
40
|
"VESSEL_BULK",
|
|
39
41
|
"RAIL",
|
|
40
42
|
"TRUCK",
|
|
41
43
|
"GRID"
|
|
42
|
-
],
|
|
44
|
+
], Ge = [
|
|
43
45
|
"BARRELS",
|
|
44
46
|
"CUBIC_METERS",
|
|
45
47
|
"TONNES",
|
|
@@ -47,14 +49,15 @@ var Re = [
|
|
|
47
49
|
"MWH",
|
|
48
50
|
"GJ",
|
|
49
51
|
"MCF"
|
|
50
|
-
],
|
|
52
|
+
], Ke = new Set([
|
|
51
53
|
"SCHEDULED",
|
|
52
54
|
"LOADING",
|
|
53
55
|
"IN_TRANSIT"
|
|
54
|
-
]),
|
|
56
|
+
]), A = 25, qe = (e) => Math.max(0, Math.min(100, e)), j = (e) => e ? e.slice(0, 10) : "", M = (e) => ({
|
|
55
57
|
reference: "",
|
|
56
58
|
mode: "VESSEL_BULK",
|
|
57
59
|
carrier: "",
|
|
60
|
+
trackingId: "",
|
|
58
61
|
origin: "",
|
|
59
62
|
destination: "",
|
|
60
63
|
volume: "",
|
|
@@ -63,31 +66,31 @@ var Re = [
|
|
|
63
66
|
notes: ""
|
|
64
67
|
});
|
|
65
68
|
function N() {
|
|
66
|
-
let { id: N } =
|
|
67
|
-
|
|
68
|
-
let { haptic:
|
|
69
|
-
limit:
|
|
70
|
-
offset:
|
|
71
|
-
}), [
|
|
72
|
-
if (
|
|
69
|
+
let { id: N } = Ve(), { navigateTo: P } = e(), F = fe();
|
|
70
|
+
pe("contract-detail");
|
|
71
|
+
let { haptic: Je } = me(), { data: I, isLoading: Ye, isError: L, refetch: Xe } = ae(N), R = ue(), Ze = le(), z = se(), B = oe(), V = de(), H = ce(N, void 0, {
|
|
72
|
+
limit: A,
|
|
73
|
+
offset: V.page * A
|
|
74
|
+
}), [U, Qe] = d("shipments"), [$e, W] = d(!1), [G, K] = d(null), [et, q] = d(!1), [J, Y] = d(M("BARRELS")), [tt, X] = d(null), [Z, Q] = d(null);
|
|
75
|
+
if (Ye) return /* @__PURE__ */ p(t, {
|
|
73
76
|
title: "Contract",
|
|
74
77
|
dataTour: "theglobalfuel-contract-detail-page",
|
|
75
|
-
children: /* @__PURE__ */ p(
|
|
78
|
+
children: /* @__PURE__ */ p(u, {})
|
|
76
79
|
});
|
|
77
|
-
if (
|
|
80
|
+
if (L || !I) return /* @__PURE__ */ p(t, {
|
|
78
81
|
title: "Contract",
|
|
79
82
|
dataTour: "theglobalfuel-contract-detail-page",
|
|
80
83
|
actions: /* @__PURE__ */ m(h, {
|
|
81
84
|
variant: "ghost",
|
|
82
85
|
onClick: () => P("contracts"),
|
|
83
|
-
children: [/* @__PURE__ */ p(
|
|
86
|
+
children: [/* @__PURE__ */ p(Ee, { className: "mr-1.5 h-4 w-4" }), " Back"]
|
|
84
87
|
}),
|
|
85
|
-
children:
|
|
88
|
+
children: L ? /* @__PURE__ */ p(l, {
|
|
86
89
|
message: "This contract could not be loaded.",
|
|
87
|
-
onRetry: () =>
|
|
88
|
-
}) : /* @__PURE__ */ p(
|
|
90
|
+
onRetry: () => Xe()
|
|
91
|
+
}) : /* @__PURE__ */ p(ie, {
|
|
89
92
|
illustration: "empty-search",
|
|
90
|
-
icon: /* @__PURE__ */ p(
|
|
93
|
+
icon: /* @__PURE__ */ p(Me, { className: "h-10 w-10" }),
|
|
91
94
|
title: "Contract not found",
|
|
92
95
|
description: "This contract may have been removed or you may not have access to it.",
|
|
93
96
|
action: /* @__PURE__ */ p(h, {
|
|
@@ -96,8 +99,8 @@ function N() {
|
|
|
96
99
|
})
|
|
97
100
|
})
|
|
98
101
|
});
|
|
99
|
-
let
|
|
100
|
-
|
|
102
|
+
let $ = H.data?.items ?? [], nt = I.contractedVolume > 0 ? qe(I.deliveredVolume / I.contractedVolume * 100) : 0, rt = ye(ve, I.status), it = () => {
|
|
103
|
+
K({
|
|
101
104
|
counterparty: I.counterparty,
|
|
102
105
|
pricingBasis: I.pricingBasis,
|
|
103
106
|
pricePerUnit: I.pricePerUnit ? String(I.pricePerUnit) : "",
|
|
@@ -106,86 +109,139 @@ function N() {
|
|
|
106
109
|
contractedVolume: I.contractedVolume ? String(I.contractedVolume) : "",
|
|
107
110
|
unit: I.unit,
|
|
108
111
|
deliveryLocation: I.deliveryLocation ?? "",
|
|
109
|
-
startDate:
|
|
110
|
-
endDate:
|
|
112
|
+
startDate: j(I.startDate),
|
|
113
|
+
endDate: j(I.endDate),
|
|
111
114
|
notes: I.notes ?? ""
|
|
112
|
-
}),
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
e !== I.status && (
|
|
115
|
+
}), Q(null), W(!0);
|
|
116
|
+
}, at = () => {
|
|
117
|
+
Je("light"), Y(M(I.unit)), X(null), Q(null), q(!0);
|
|
118
|
+
}, ot = (e) => {
|
|
119
|
+
e !== I.status && (Q(null), Ze.mutate({
|
|
117
120
|
id: I.id,
|
|
118
121
|
status: e
|
|
119
122
|
}, {
|
|
120
123
|
onSuccess: () => F.success("Contract status updated"),
|
|
121
124
|
onError: (e) => {
|
|
122
|
-
|
|
125
|
+
Q(e instanceof Error ? e.message : "Failed to update contract status."), F.fromError(e);
|
|
123
126
|
}
|
|
124
127
|
}));
|
|
125
|
-
},
|
|
126
|
-
if (
|
|
127
|
-
if (!
|
|
128
|
-
|
|
128
|
+
}, st = async () => {
|
|
129
|
+
if (G) {
|
|
130
|
+
if (!G.counterparty.trim()) {
|
|
131
|
+
Q("Counterparty is required.");
|
|
129
132
|
return;
|
|
130
133
|
}
|
|
131
|
-
|
|
134
|
+
Q(null);
|
|
132
135
|
try {
|
|
133
|
-
await
|
|
136
|
+
await R.mutateAsync({
|
|
134
137
|
id: I.id,
|
|
135
138
|
input: {
|
|
136
|
-
counterparty:
|
|
137
|
-
pricingBasis:
|
|
138
|
-
pricePerUnit:
|
|
139
|
-
priceIndex:
|
|
140
|
-
currency:
|
|
141
|
-
contractedVolume:
|
|
142
|
-
unit:
|
|
143
|
-
deliveryLocation:
|
|
144
|
-
startDate: s(
|
|
145
|
-
endDate: s(
|
|
146
|
-
notes:
|
|
139
|
+
counterparty: G.counterparty.trim(),
|
|
140
|
+
pricingBasis: G.pricingBasis,
|
|
141
|
+
pricePerUnit: G.pricePerUnit ? Number(G.pricePerUnit) : null,
|
|
142
|
+
priceIndex: G.priceIndex.trim() || null,
|
|
143
|
+
currency: G.currency.trim().toUpperCase() || "USD",
|
|
144
|
+
contractedVolume: G.contractedVolume ? Number(G.contractedVolume) : null,
|
|
145
|
+
unit: G.unit,
|
|
146
|
+
deliveryLocation: G.deliveryLocation.trim() || null,
|
|
147
|
+
startDate: s(G.startDate) ?? null,
|
|
148
|
+
endDate: s(G.endDate) ?? null,
|
|
149
|
+
notes: G.notes.trim() || null
|
|
147
150
|
}
|
|
148
|
-
}), F.success("Contract updated"),
|
|
151
|
+
}), F.success("Contract updated"), W(!1);
|
|
149
152
|
} catch (e) {
|
|
150
|
-
|
|
153
|
+
Q(e instanceof Error ? e.message : "Failed to update contract."), F.fromError(e);
|
|
151
154
|
}
|
|
152
155
|
}
|
|
153
|
-
},
|
|
154
|
-
if (!
|
|
155
|
-
|
|
156
|
+
}, ct = async () => {
|
|
157
|
+
if (!J.reference.trim()) {
|
|
158
|
+
Q("Shipment reference is required.");
|
|
156
159
|
return;
|
|
157
160
|
}
|
|
158
|
-
let e = Number(
|
|
159
|
-
if (!
|
|
160
|
-
|
|
161
|
+
let e = Number(J.volume);
|
|
162
|
+
if (!J.volume || Number.isNaN(e) || e <= 0) {
|
|
163
|
+
Q("Enter a volume greater than zero."), F.error("Enter a volume greater than zero.");
|
|
161
164
|
return;
|
|
162
165
|
}
|
|
163
|
-
|
|
166
|
+
Q(null);
|
|
164
167
|
try {
|
|
165
|
-
await
|
|
168
|
+
await z.mutateAsync({
|
|
166
169
|
contractId: I.id,
|
|
167
|
-
reference:
|
|
168
|
-
mode:
|
|
169
|
-
carrier:
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
reference: J.reference.trim(),
|
|
171
|
+
mode: J.mode,
|
|
172
|
+
carrier: J.carrier.trim() || null,
|
|
173
|
+
trackingId: J.trackingId.trim() || null,
|
|
174
|
+
origin: J.origin.trim() || null,
|
|
175
|
+
destination: J.destination.trim() || null,
|
|
172
176
|
volume: e,
|
|
173
|
-
unit:
|
|
174
|
-
scheduledAt: s(
|
|
175
|
-
documentFileId:
|
|
176
|
-
notes:
|
|
177
|
-
}), F.success("Shipment scheduled"),
|
|
177
|
+
unit: J.unit,
|
|
178
|
+
scheduledAt: s(J.scheduledAt) ?? null,
|
|
179
|
+
documentFileId: tt?.fileId ?? null,
|
|
180
|
+
notes: J.notes.trim() || null
|
|
181
|
+
}), F.success("Shipment scheduled"), q(!1);
|
|
178
182
|
} catch (e) {
|
|
179
|
-
|
|
183
|
+
Q(e instanceof Error ? e.message : "Failed to schedule shipment."), F.fromError(e);
|
|
180
184
|
}
|
|
181
|
-
},
|
|
182
|
-
|
|
185
|
+
}, lt = (e) => {
|
|
186
|
+
Q(null), B.mutate(e, {
|
|
183
187
|
onSuccess: () => F.success("Shipment delivered"),
|
|
184
188
|
onError: (e) => {
|
|
185
|
-
|
|
189
|
+
Q(e instanceof Error ? e.message : "Failed to mark shipment delivered."), F.fromError(e);
|
|
186
190
|
}
|
|
187
191
|
});
|
|
188
|
-
},
|
|
192
|
+
}, ut = () => {
|
|
193
|
+
let e = he([
|
|
194
|
+
{
|
|
195
|
+
header: "Reference",
|
|
196
|
+
value: (e) => e.reference
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
header: "Mode",
|
|
200
|
+
value: (e) => i(e.mode)
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
header: "Status",
|
|
204
|
+
value: (e) => i(e.status)
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
header: "Carrier",
|
|
208
|
+
value: (e) => e.carrier ?? ""
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
header: "Tracking ID",
|
|
212
|
+
value: (e) => e.trackingId ?? ""
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
header: "Origin",
|
|
216
|
+
value: (e) => e.origin ?? ""
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
header: "Destination",
|
|
220
|
+
value: (e) => e.destination ?? ""
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
header: "Volume",
|
|
224
|
+
value: (e) => e.volume
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
header: "Unit",
|
|
228
|
+
value: (e) => e.unit
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
header: "Scheduled",
|
|
232
|
+
value: (e) => e.scheduledAt ?? ""
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
header: "Departed",
|
|
236
|
+
value: (e) => e.departedAt ?? ""
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
header: "Delivered",
|
|
240
|
+
value: (e) => e.deliveredAt ?? ""
|
|
241
|
+
}
|
|
242
|
+
], $);
|
|
243
|
+
ge(`${_e(I.reference)}-shipments.csv`, "text/csv", e) ? F.success("Shipments exported") : F.error("This browser can't download the export.");
|
|
244
|
+
}, dt = [
|
|
189
245
|
{
|
|
190
246
|
key: "reference",
|
|
191
247
|
header: "Shipment",
|
|
@@ -211,6 +267,18 @@ function N() {
|
|
|
211
267
|
children: e.carrier ?? "—"
|
|
212
268
|
})
|
|
213
269
|
},
|
|
270
|
+
{
|
|
271
|
+
key: "trackingId",
|
|
272
|
+
header: "Tracking ID",
|
|
273
|
+
hideOnMobile: !0,
|
|
274
|
+
render: (e) => e.trackingId ? /* @__PURE__ */ p("span", {
|
|
275
|
+
className: "truncate font-mono text-xs text-text-secondary",
|
|
276
|
+
children: e.trackingId
|
|
277
|
+
}) : /* @__PURE__ */ p("span", {
|
|
278
|
+
className: "text-text-tertiary",
|
|
279
|
+
children: "—"
|
|
280
|
+
})
|
|
281
|
+
},
|
|
214
282
|
{
|
|
215
283
|
key: "route",
|
|
216
284
|
header: "Route",
|
|
@@ -244,18 +312,28 @@ function N() {
|
|
|
244
312
|
},
|
|
245
313
|
{
|
|
246
314
|
key: "schedule",
|
|
247
|
-
header: "
|
|
315
|
+
header: "Schedule",
|
|
248
316
|
hideOnMobile: !0,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
317
|
+
sortValue: (e) => e.scheduledAt ?? "",
|
|
318
|
+
render: (e) => /* @__PURE__ */ m("div", {
|
|
319
|
+
className: "min-w-0",
|
|
320
|
+
children: [/* @__PURE__ */ p("p", {
|
|
321
|
+
className: "text-text-tertiary",
|
|
322
|
+
children: r(e.scheduledAt)
|
|
323
|
+
}), e.deliveredAt ? /* @__PURE__ */ m("p", {
|
|
324
|
+
className: "text-xs text-status-success-text",
|
|
325
|
+
children: ["Delivered ", r(e.deliveredAt)]
|
|
326
|
+
}) : e.departedAt ? /* @__PURE__ */ m("p", {
|
|
327
|
+
className: "text-xs text-text-secondary",
|
|
328
|
+
children: ["Departed ", r(e.departedAt)]
|
|
329
|
+
}) : null]
|
|
252
330
|
})
|
|
253
331
|
},
|
|
254
332
|
{
|
|
255
333
|
key: "document",
|
|
256
334
|
header: "Document",
|
|
257
335
|
hideOnMobile: !0,
|
|
258
|
-
render: (e) => e.document?.id ? /* @__PURE__ */ p(
|
|
336
|
+
render: (e) => e.document?.id ? /* @__PURE__ */ p(Ce, { fileId: e.document.id }) : /* @__PURE__ */ p("span", {
|
|
259
337
|
className: "text-text-tertiary",
|
|
260
338
|
children: "—"
|
|
261
339
|
})
|
|
@@ -264,64 +342,64 @@ function N() {
|
|
|
264
342
|
key: "action",
|
|
265
343
|
header: "",
|
|
266
344
|
align: "right",
|
|
267
|
-
render: (e) =>
|
|
345
|
+
render: (e) => Ke.has(e.status) ? /* @__PURE__ */ m(h, {
|
|
268
346
|
size: "sm",
|
|
269
347
|
variant: "outline",
|
|
270
|
-
onClick: () =>
|
|
271
|
-
disabled:
|
|
272
|
-
children: [/* @__PURE__ */ p(
|
|
348
|
+
onClick: () => lt(e.id),
|
|
349
|
+
disabled: B.isPending,
|
|
350
|
+
children: [/* @__PURE__ */ p(ke, { className: "mr-1.5 h-4 w-4" }), " Mark delivered"]
|
|
273
351
|
}) : null
|
|
274
352
|
}
|
|
275
|
-
],
|
|
353
|
+
], ft = [
|
|
276
354
|
{
|
|
277
355
|
value: "shipments",
|
|
278
356
|
label: "Shipments",
|
|
279
|
-
icon: /* @__PURE__ */ p(
|
|
280
|
-
count:
|
|
357
|
+
icon: /* @__PURE__ */ p(ze, { className: "h-4 w-4" }),
|
|
358
|
+
count: $.length
|
|
281
359
|
},
|
|
282
360
|
{
|
|
283
361
|
value: "tags",
|
|
284
362
|
label: "Tags",
|
|
285
|
-
icon: /* @__PURE__ */ p(
|
|
363
|
+
icon: /* @__PURE__ */ p(Be, { className: "h-4 w-4" })
|
|
286
364
|
},
|
|
287
365
|
{
|
|
288
366
|
value: "discussion",
|
|
289
367
|
label: "Discussion",
|
|
290
|
-
icon: /* @__PURE__ */ p(
|
|
368
|
+
icon: /* @__PURE__ */ p(Fe, { className: "h-4 w-4" })
|
|
291
369
|
}
|
|
292
|
-
],
|
|
370
|
+
], pt = I.startDate || I.endDate ? `${r(I.startDate)} – ${r(I.endDate)}` : "—";
|
|
293
371
|
return /* @__PURE__ */ m(t, {
|
|
294
372
|
title: I.reference,
|
|
295
373
|
description: `${I.counterparty} · ${i(I.commodity)}`,
|
|
296
374
|
dataTour: "theglobalfuel-contract-detail-page",
|
|
297
375
|
actions: /* @__PURE__ */ m(f, { children: [
|
|
298
376
|
/* @__PURE__ */ p(c, { status: I.status }),
|
|
299
|
-
/* @__PURE__ */ m(
|
|
377
|
+
/* @__PURE__ */ m(w, {
|
|
300
378
|
value: I.status,
|
|
301
|
-
onValueChange: (e) =>
|
|
302
|
-
disabled:
|
|
303
|
-
children: [/* @__PURE__ */ p(
|
|
379
|
+
onValueChange: (e) => ot(e),
|
|
380
|
+
disabled: rt.length === 0,
|
|
381
|
+
children: [/* @__PURE__ */ p(D, {
|
|
304
382
|
className: "h-9 w-40",
|
|
305
383
|
"aria-label": "Change contract status",
|
|
306
|
-
children: /* @__PURE__ */ p(
|
|
307
|
-
}), /* @__PURE__ */ m(
|
|
384
|
+
children: /* @__PURE__ */ p(O, {})
|
|
385
|
+
}), /* @__PURE__ */ m(T, { children: [/* @__PURE__ */ p(E, {
|
|
308
386
|
value: I.status,
|
|
309
387
|
disabled: !0,
|
|
310
388
|
children: i(I.status)
|
|
311
|
-
}),
|
|
389
|
+
}), rt.map((e) => /* @__PURE__ */ p(E, {
|
|
312
390
|
value: e,
|
|
313
391
|
children: i(e)
|
|
314
392
|
}, e))] })]
|
|
315
393
|
}),
|
|
316
394
|
/* @__PURE__ */ m(h, {
|
|
317
395
|
variant: "outline",
|
|
318
|
-
onClick:
|
|
319
|
-
children: [/* @__PURE__ */ p(
|
|
396
|
+
onClick: it,
|
|
397
|
+
children: [/* @__PURE__ */ p(Le, { className: "mr-1.5 h-4 w-4" }), " Edit"]
|
|
320
398
|
}),
|
|
321
399
|
/* @__PURE__ */ m(h, {
|
|
322
400
|
variant: "ghost",
|
|
323
401
|
onClick: () => P("contracts"),
|
|
324
|
-
children: [/* @__PURE__ */ p(
|
|
402
|
+
children: [/* @__PURE__ */ p(Ee, { className: "mr-1.5 h-4 w-4" }), " Back"]
|
|
325
403
|
})
|
|
326
404
|
] }),
|
|
327
405
|
children: [
|
|
@@ -329,41 +407,41 @@ function N() {
|
|
|
329
407
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
330
408
|
children: [
|
|
331
409
|
/* @__PURE__ */ p(n, {
|
|
332
|
-
icon: /* @__PURE__ */ p(
|
|
410
|
+
icon: /* @__PURE__ */ p(De, { className: "h-5 w-5" }),
|
|
333
411
|
value: I.counterparty,
|
|
334
412
|
label: "Counterparty",
|
|
335
413
|
featured: !0
|
|
336
414
|
}),
|
|
337
415
|
/* @__PURE__ */ p(n, {
|
|
338
|
-
icon: /* @__PURE__ */ p(
|
|
416
|
+
icon: /* @__PURE__ */ p(Ie, { className: "h-5 w-5" }),
|
|
339
417
|
value: i(I.commodity),
|
|
340
418
|
label: "Commodity & side",
|
|
341
419
|
footer: /* @__PURE__ */ p(c, { status: I.side })
|
|
342
420
|
}),
|
|
343
421
|
/* @__PURE__ */ p(n, {
|
|
344
|
-
icon: /* @__PURE__ */ p(
|
|
422
|
+
icon: /* @__PURE__ */ p(Ae, { className: "h-5 w-5" }),
|
|
345
423
|
value: ee(I.pricePerUnit, I.currency),
|
|
346
424
|
label: `Price per ${a(I.unit)}`,
|
|
347
425
|
footer: /* @__PURE__ */ p(c, { status: I.pricingBasis })
|
|
348
426
|
}),
|
|
349
427
|
/* @__PURE__ */ p(n, {
|
|
350
|
-
icon: /* @__PURE__ */ p(
|
|
428
|
+
icon: /* @__PURE__ */ p(Ne, { className: "h-5 w-5" }),
|
|
351
429
|
value: o(I.deliveredVolume, I.unit),
|
|
352
430
|
label: `of ${o(I.contractedVolume, I.unit)} delivered`,
|
|
353
431
|
footer: /* @__PURE__ */ m("div", {
|
|
354
432
|
className: "space-y-2",
|
|
355
433
|
children: [/* @__PURE__ */ p(te, {
|
|
356
|
-
value:
|
|
434
|
+
value: nt,
|
|
357
435
|
barClassName: "bg-[var(--color-status-success-text)]"
|
|
358
436
|
}), /* @__PURE__ */ m("p", {
|
|
359
437
|
className: "text-xs tabular-nums text-text-tertiary",
|
|
360
|
-
children: [Math.round(
|
|
438
|
+
children: [Math.round(nt), "% fulfilled"]
|
|
361
439
|
})]
|
|
362
440
|
})
|
|
363
441
|
})
|
|
364
442
|
]
|
|
365
443
|
}),
|
|
366
|
-
/* @__PURE__ */ m(
|
|
444
|
+
/* @__PURE__ */ m(He, {
|
|
367
445
|
treatment: "glass",
|
|
368
446
|
className: "mt-4 p-6",
|
|
369
447
|
children: [/* @__PURE__ */ m("dl", {
|
|
@@ -395,7 +473,7 @@ function N() {
|
|
|
395
473
|
children: "Delivery location"
|
|
396
474
|
}), /* @__PURE__ */ p("dd", {
|
|
397
475
|
className: "mt-0.5 flex items-center gap-1.5 text-sm text-text-primary",
|
|
398
|
-
children: I.deliveryLocation ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(
|
|
476
|
+
children: I.deliveryLocation ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Pe, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary" }), I.deliveryLocation] }) : "—"
|
|
399
477
|
})] }),
|
|
400
478
|
/* @__PURE__ */ m("div", {
|
|
401
479
|
className: "col-span-2",
|
|
@@ -404,7 +482,7 @@ function N() {
|
|
|
404
482
|
children: "Term"
|
|
405
483
|
}), /* @__PURE__ */ m("dd", {
|
|
406
484
|
className: "mt-0.5 flex items-center gap-1.5 text-sm text-text-primary tabular-nums",
|
|
407
|
-
children: [/* @__PURE__ */ p(
|
|
485
|
+
children: [/* @__PURE__ */ p(Oe, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary" }), pt]
|
|
408
486
|
})]
|
|
409
487
|
}),
|
|
410
488
|
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
|
|
@@ -427,84 +505,93 @@ function N() {
|
|
|
427
505
|
children: I.notes
|
|
428
506
|
})]
|
|
429
507
|
}),
|
|
430
|
-
|
|
508
|
+
Z && /* @__PURE__ */ p("p", {
|
|
431
509
|
className: "mt-4 text-sm text-status-error-text",
|
|
432
|
-
children:
|
|
510
|
+
children: Z
|
|
433
511
|
}),
|
|
434
512
|
/* @__PURE__ */ p("div", {
|
|
435
513
|
className: "mt-6",
|
|
436
|
-
children: /* @__PURE__ */ p(
|
|
437
|
-
items:
|
|
438
|
-
value:
|
|
439
|
-
onChange:
|
|
514
|
+
children: /* @__PURE__ */ p(be, {
|
|
515
|
+
items: ft,
|
|
516
|
+
value: U,
|
|
517
|
+
onChange: Qe
|
|
440
518
|
})
|
|
441
519
|
}),
|
|
442
|
-
|
|
520
|
+
U === "shipments" && /* @__PURE__ */ p("div", {
|
|
443
521
|
className: "mt-6",
|
|
444
|
-
children: /* @__PURE__ */ p(
|
|
522
|
+
children: /* @__PURE__ */ p(re, {
|
|
445
523
|
title: "Shipments",
|
|
446
524
|
description: "Physical movements delivering against this contract's volume.",
|
|
447
|
-
action: /* @__PURE__ */ m(
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
525
|
+
action: /* @__PURE__ */ m("div", {
|
|
526
|
+
className: "flex items-center gap-2",
|
|
527
|
+
children: [/* @__PURE__ */ m(h, {
|
|
528
|
+
size: "sm",
|
|
529
|
+
variant: "outline",
|
|
530
|
+
onClick: ut,
|
|
531
|
+
disabled: $.length === 0,
|
|
532
|
+
children: [/* @__PURE__ */ p(je, { className: "mr-1.5 h-4 w-4" }), " Export"]
|
|
533
|
+
}), /* @__PURE__ */ m(h, {
|
|
534
|
+
size: "sm",
|
|
535
|
+
onClick: at,
|
|
536
|
+
children: [/* @__PURE__ */ p(Re, { className: "mr-1.5 h-4 w-4" }), " Schedule shipment"]
|
|
537
|
+
})]
|
|
451
538
|
}),
|
|
452
|
-
children:
|
|
539
|
+
children: H.isLoading ? /* @__PURE__ */ p(u, { label: "Loading shipments…" }) : H.isError ? /* @__PURE__ */ p(l, {
|
|
453
540
|
message: "Couldn't load shipments.",
|
|
454
|
-
onRetry: () =>
|
|
455
|
-
}) :
|
|
541
|
+
onRetry: () => H.refetch()
|
|
542
|
+
}) : $.length === 0 ? /* @__PURE__ */ p(ie, {
|
|
456
543
|
illustration: "empty-data",
|
|
457
|
-
icon: /* @__PURE__ */ p(
|
|
544
|
+
icon: /* @__PURE__ */ p(ze, { className: "h-10 w-10" }),
|
|
458
545
|
title: "No shipments scheduled",
|
|
459
546
|
description: "Schedule a shipment to start delivering against this contract.",
|
|
460
547
|
action: /* @__PURE__ */ m(h, {
|
|
461
|
-
onClick:
|
|
462
|
-
children: [/* @__PURE__ */ p(
|
|
548
|
+
onClick: at,
|
|
549
|
+
children: [/* @__PURE__ */ p(Re, { className: "mr-1.5 h-4 w-4" }), " Schedule shipment"]
|
|
463
550
|
})
|
|
464
551
|
}) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(ne, {
|
|
465
|
-
columns:
|
|
466
|
-
rows:
|
|
552
|
+
columns: dt,
|
|
553
|
+
rows: $,
|
|
467
554
|
rowKey: (e) => e.id
|
|
468
|
-
}), /* @__PURE__ */ p(
|
|
469
|
-
page:
|
|
470
|
-
pageSize:
|
|
471
|
-
itemCount:
|
|
472
|
-
hasMore:
|
|
473
|
-
onPageChange:
|
|
555
|
+
}), /* @__PURE__ */ p(xe, {
|
|
556
|
+
page: V.page,
|
|
557
|
+
pageSize: A,
|
|
558
|
+
itemCount: $.length,
|
|
559
|
+
hasMore: H.data?.pageInfo?.hasMore ?? !1,
|
|
560
|
+
onPageChange: V.onPageChange
|
|
474
561
|
})] })
|
|
475
562
|
})
|
|
476
563
|
}),
|
|
477
|
-
|
|
564
|
+
U === "tags" && /* @__PURE__ */ p("div", {
|
|
478
565
|
className: "mt-6",
|
|
479
|
-
children: /* @__PURE__ */ p(
|
|
566
|
+
children: /* @__PURE__ */ p(He, {
|
|
480
567
|
treatment: "glass",
|
|
481
568
|
className: "p-6",
|
|
482
|
-
children: /* @__PURE__ */ p(
|
|
569
|
+
children: /* @__PURE__ */ p(Te, {
|
|
483
570
|
entityType: "theglobalfuel-contract",
|
|
484
571
|
entityId: I.id
|
|
485
572
|
})
|
|
486
573
|
})
|
|
487
574
|
}),
|
|
488
|
-
|
|
575
|
+
U === "discussion" && /* @__PURE__ */ p("div", {
|
|
489
576
|
className: "mt-6",
|
|
490
|
-
children: /* @__PURE__ */ p(
|
|
577
|
+
children: /* @__PURE__ */ p(we, {
|
|
491
578
|
entityType: "theglobalfuel-contract",
|
|
492
579
|
entityId: I.id,
|
|
493
580
|
description: "Coordinate negotiation, delivery and settlement with your team."
|
|
494
581
|
})
|
|
495
582
|
}),
|
|
496
|
-
/* @__PURE__ */ p(
|
|
497
|
-
open:
|
|
583
|
+
/* @__PURE__ */ p(v, {
|
|
584
|
+
open: et,
|
|
498
585
|
onOpenChange: (e) => {
|
|
499
|
-
|
|
586
|
+
q(e), e || (Y(M(I.unit)), X(null), Q(null));
|
|
500
587
|
},
|
|
501
|
-
children: /* @__PURE__ */ m(
|
|
588
|
+
children: /* @__PURE__ */ m(y, { children: [/* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(C, { children: "Schedule shipment" }), /* @__PURE__ */ m(b, { children: [
|
|
502
589
|
"Log a physical movement delivering against ",
|
|
503
590
|
I.reference,
|
|
504
591
|
"."
|
|
505
592
|
] })] }), /* @__PURE__ */ m("form", {
|
|
506
593
|
onSubmit: (e) => {
|
|
507
|
-
e.preventDefault(),
|
|
594
|
+
e.preventDefault(), ct();
|
|
508
595
|
},
|
|
509
596
|
children: [/* @__PURE__ */ m("div", {
|
|
510
597
|
className: "grid gap-4 py-2",
|
|
@@ -513,33 +600,33 @@ function N() {
|
|
|
513
600
|
className: "grid gap-2 sm:grid-cols-2",
|
|
514
601
|
children: [/* @__PURE__ */ m("div", {
|
|
515
602
|
className: "grid gap-1.5",
|
|
516
|
-
children: [/* @__PURE__ */ p(
|
|
603
|
+
children: [/* @__PURE__ */ p(_, {
|
|
517
604
|
htmlFor: "shipReference",
|
|
518
605
|
children: "Reference *"
|
|
519
|
-
}), /* @__PURE__ */ p(
|
|
606
|
+
}), /* @__PURE__ */ p(g, {
|
|
520
607
|
id: "shipReference",
|
|
521
|
-
value:
|
|
522
|
-
onChange: (e) =>
|
|
523
|
-
...
|
|
608
|
+
value: J.reference,
|
|
609
|
+
onChange: (e) => Y({
|
|
610
|
+
...J,
|
|
524
611
|
reference: e.target.value
|
|
525
612
|
}),
|
|
526
613
|
placeholder: "SHP-2026-0031"
|
|
527
614
|
})]
|
|
528
615
|
}), /* @__PURE__ */ m("div", {
|
|
529
616
|
className: "grid gap-1.5",
|
|
530
|
-
children: [/* @__PURE__ */ p(
|
|
617
|
+
children: [/* @__PURE__ */ p(_, {
|
|
531
618
|
htmlFor: "shipMode",
|
|
532
619
|
children: "Mode"
|
|
533
|
-
}), /* @__PURE__ */ m(
|
|
534
|
-
value:
|
|
535
|
-
onValueChange: (e) =>
|
|
536
|
-
...
|
|
620
|
+
}), /* @__PURE__ */ m(w, {
|
|
621
|
+
value: J.mode,
|
|
622
|
+
onValueChange: (e) => Y({
|
|
623
|
+
...J,
|
|
537
624
|
mode: e
|
|
538
625
|
}),
|
|
539
|
-
children: [/* @__PURE__ */ p(
|
|
626
|
+
children: [/* @__PURE__ */ p(D, {
|
|
540
627
|
id: "shipMode",
|
|
541
|
-
children: /* @__PURE__ */ p(
|
|
542
|
-
}), /* @__PURE__ */ p(
|
|
628
|
+
children: /* @__PURE__ */ p(O, {})
|
|
629
|
+
}), /* @__PURE__ */ p(T, { children: We.map((e) => /* @__PURE__ */ p(E, {
|
|
543
630
|
value: e,
|
|
544
631
|
children: i(e)
|
|
545
632
|
}, e)) })]
|
|
@@ -547,46 +634,63 @@ function N() {
|
|
|
547
634
|
})]
|
|
548
635
|
}),
|
|
549
636
|
/* @__PURE__ */ m("div", {
|
|
550
|
-
className: "grid gap-
|
|
551
|
-
children: [/* @__PURE__ */
|
|
552
|
-
|
|
553
|
-
children:
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
637
|
+
className: "grid gap-2 sm:grid-cols-2",
|
|
638
|
+
children: [/* @__PURE__ */ m("div", {
|
|
639
|
+
className: "grid gap-1.5",
|
|
640
|
+
children: [/* @__PURE__ */ p(_, {
|
|
641
|
+
htmlFor: "shipCarrier",
|
|
642
|
+
children: "Carrier"
|
|
643
|
+
}), /* @__PURE__ */ p(g, {
|
|
644
|
+
id: "shipCarrier",
|
|
645
|
+
value: J.carrier,
|
|
646
|
+
onChange: (e) => Y({
|
|
647
|
+
...J,
|
|
648
|
+
carrier: e.target.value
|
|
649
|
+
}),
|
|
650
|
+
placeholder: "Maersk Tankers"
|
|
651
|
+
})]
|
|
652
|
+
}), /* @__PURE__ */ m("div", {
|
|
653
|
+
className: "grid gap-1.5",
|
|
654
|
+
children: [/* @__PURE__ */ p(_, {
|
|
655
|
+
htmlFor: "shipTracking",
|
|
656
|
+
children: "Tracking ID"
|
|
657
|
+
}), /* @__PURE__ */ p(g, {
|
|
658
|
+
id: "shipTracking",
|
|
659
|
+
value: J.trackingId,
|
|
660
|
+
onChange: (e) => Y({
|
|
661
|
+
...J,
|
|
662
|
+
trackingId: e.target.value
|
|
663
|
+
}),
|
|
664
|
+
placeholder: "Waybill / B-L number"
|
|
665
|
+
})]
|
|
562
666
|
})]
|
|
563
667
|
}),
|
|
564
668
|
/* @__PURE__ */ m("div", {
|
|
565
669
|
className: "grid gap-2 sm:grid-cols-2",
|
|
566
670
|
children: [/* @__PURE__ */ m("div", {
|
|
567
671
|
className: "grid gap-1.5",
|
|
568
|
-
children: [/* @__PURE__ */ p(
|
|
672
|
+
children: [/* @__PURE__ */ p(_, {
|
|
569
673
|
htmlFor: "shipOrigin",
|
|
570
674
|
children: "Origin"
|
|
571
|
-
}), /* @__PURE__ */ p(
|
|
675
|
+
}), /* @__PURE__ */ p(g, {
|
|
572
676
|
id: "shipOrigin",
|
|
573
|
-
value:
|
|
574
|
-
onChange: (e) =>
|
|
575
|
-
...
|
|
677
|
+
value: J.origin,
|
|
678
|
+
onChange: (e) => Y({
|
|
679
|
+
...J,
|
|
576
680
|
origin: e.target.value
|
|
577
681
|
}),
|
|
578
682
|
placeholder: "Ras Tanura"
|
|
579
683
|
})]
|
|
580
684
|
}), /* @__PURE__ */ m("div", {
|
|
581
685
|
className: "grid gap-1.5",
|
|
582
|
-
children: [/* @__PURE__ */ p(
|
|
686
|
+
children: [/* @__PURE__ */ p(_, {
|
|
583
687
|
htmlFor: "shipDestination",
|
|
584
688
|
children: "Destination"
|
|
585
|
-
}), /* @__PURE__ */ p(
|
|
689
|
+
}), /* @__PURE__ */ p(g, {
|
|
586
690
|
id: "shipDestination",
|
|
587
|
-
value:
|
|
588
|
-
onChange: (e) =>
|
|
589
|
-
...
|
|
691
|
+
value: J.destination,
|
|
692
|
+
onChange: (e) => Y({
|
|
693
|
+
...J,
|
|
590
694
|
destination: e.target.value
|
|
591
695
|
}),
|
|
592
696
|
placeholder: "Rotterdam"
|
|
@@ -598,17 +702,17 @@ function N() {
|
|
|
598
702
|
children: [
|
|
599
703
|
/* @__PURE__ */ m("div", {
|
|
600
704
|
className: "grid gap-1.5",
|
|
601
|
-
children: [/* @__PURE__ */ p(
|
|
705
|
+
children: [/* @__PURE__ */ p(_, {
|
|
602
706
|
htmlFor: "shipVolume",
|
|
603
707
|
children: "Volume *"
|
|
604
|
-
}), /* @__PURE__ */ p(
|
|
708
|
+
}), /* @__PURE__ */ p(g, {
|
|
605
709
|
id: "shipVolume",
|
|
606
710
|
type: "number",
|
|
607
711
|
min: "0",
|
|
608
712
|
step: "any",
|
|
609
|
-
value:
|
|
610
|
-
onChange: (e) =>
|
|
611
|
-
...
|
|
713
|
+
value: J.volume,
|
|
714
|
+
onChange: (e) => Y({
|
|
715
|
+
...J,
|
|
612
716
|
volume: e.target.value
|
|
613
717
|
}),
|
|
614
718
|
placeholder: "50000"
|
|
@@ -616,19 +720,19 @@ function N() {
|
|
|
616
720
|
}),
|
|
617
721
|
/* @__PURE__ */ m("div", {
|
|
618
722
|
className: "grid gap-1.5",
|
|
619
|
-
children: [/* @__PURE__ */ p(
|
|
723
|
+
children: [/* @__PURE__ */ p(_, {
|
|
620
724
|
htmlFor: "shipUnit",
|
|
621
725
|
children: "Unit"
|
|
622
|
-
}), /* @__PURE__ */ m(
|
|
623
|
-
value:
|
|
624
|
-
onValueChange: (e) =>
|
|
625
|
-
...
|
|
726
|
+
}), /* @__PURE__ */ m(w, {
|
|
727
|
+
value: J.unit,
|
|
728
|
+
onValueChange: (e) => Y({
|
|
729
|
+
...J,
|
|
626
730
|
unit: e
|
|
627
731
|
}),
|
|
628
|
-
children: [/* @__PURE__ */ p(
|
|
732
|
+
children: [/* @__PURE__ */ p(D, {
|
|
629
733
|
id: "shipUnit",
|
|
630
|
-
children: /* @__PURE__ */ p(
|
|
631
|
-
}), /* @__PURE__ */ p(
|
|
734
|
+
children: /* @__PURE__ */ p(O, {})
|
|
735
|
+
}), /* @__PURE__ */ p(T, { children: Ge.map((e) => /* @__PURE__ */ p(E, {
|
|
632
736
|
value: e,
|
|
633
737
|
children: a(e)
|
|
634
738
|
}, e)) })]
|
|
@@ -636,88 +740,88 @@ function N() {
|
|
|
636
740
|
}),
|
|
637
741
|
/* @__PURE__ */ m("div", {
|
|
638
742
|
className: "grid gap-1.5",
|
|
639
|
-
children: [/* @__PURE__ */ p(
|
|
743
|
+
children: [/* @__PURE__ */ p(_, {
|
|
640
744
|
htmlFor: "shipScheduled",
|
|
641
745
|
children: "Scheduled at"
|
|
642
|
-
}), /* @__PURE__ */ p(
|
|
746
|
+
}), /* @__PURE__ */ p(g, {
|
|
643
747
|
id: "shipScheduled",
|
|
644
748
|
type: "date",
|
|
645
|
-
value:
|
|
646
|
-
onChange: (e) =>
|
|
647
|
-
...
|
|
749
|
+
value: J.scheduledAt,
|
|
750
|
+
onChange: (e) => Y({
|
|
751
|
+
...J,
|
|
648
752
|
scheduledAt: e.target.value
|
|
649
753
|
})
|
|
650
754
|
})]
|
|
651
755
|
})
|
|
652
756
|
]
|
|
653
757
|
}),
|
|
654
|
-
/* @__PURE__ */ p(
|
|
758
|
+
/* @__PURE__ */ p(Se, {
|
|
655
759
|
id: "ship-doc",
|
|
656
760
|
label: "Bill of lading / document",
|
|
657
|
-
value:
|
|
658
|
-
onChange:
|
|
761
|
+
value: tt,
|
|
762
|
+
onChange: X,
|
|
659
763
|
accept: "image/*,application/pdf",
|
|
660
764
|
hint: "Attach the bill of lading or shipping document (PDF or image)."
|
|
661
765
|
}),
|
|
662
766
|
/* @__PURE__ */ m("div", {
|
|
663
767
|
className: "grid gap-1.5",
|
|
664
|
-
children: [/* @__PURE__ */ p(
|
|
768
|
+
children: [/* @__PURE__ */ p(_, {
|
|
665
769
|
htmlFor: "shipNotes",
|
|
666
770
|
children: "Notes"
|
|
667
|
-
}), /* @__PURE__ */ p(
|
|
771
|
+
}), /* @__PURE__ */ p(k, {
|
|
668
772
|
id: "shipNotes",
|
|
669
773
|
rows: 2,
|
|
670
|
-
value:
|
|
671
|
-
onChange: (e) =>
|
|
672
|
-
...
|
|
774
|
+
value: J.notes,
|
|
775
|
+
onChange: (e) => Y({
|
|
776
|
+
...J,
|
|
673
777
|
notes: e.target.value
|
|
674
778
|
}),
|
|
675
779
|
placeholder: "Optional context about this shipment."
|
|
676
780
|
})]
|
|
677
781
|
}),
|
|
678
|
-
|
|
782
|
+
Z && /* @__PURE__ */ p("p", {
|
|
679
783
|
className: "text-sm text-status-error-text",
|
|
680
|
-
children:
|
|
784
|
+
children: Z
|
|
681
785
|
})
|
|
682
786
|
]
|
|
683
|
-
}), /* @__PURE__ */ m(
|
|
787
|
+
}), /* @__PURE__ */ m(x, { children: [/* @__PURE__ */ p(h, {
|
|
684
788
|
type: "button",
|
|
685
789
|
variant: "outline",
|
|
686
790
|
onClick: () => {
|
|
687
|
-
|
|
791
|
+
q(!1), Y(M(I.unit)), X(null), Q(null);
|
|
688
792
|
},
|
|
689
793
|
children: "Cancel"
|
|
690
794
|
}), /* @__PURE__ */ p(h, {
|
|
691
795
|
type: "submit",
|
|
692
|
-
disabled:
|
|
693
|
-
children:
|
|
796
|
+
disabled: z.isPending,
|
|
797
|
+
children: z.isPending ? "Scheduling…" : "Schedule shipment"
|
|
694
798
|
})] })]
|
|
695
799
|
})] })
|
|
696
800
|
}),
|
|
697
|
-
/* @__PURE__ */ p(
|
|
698
|
-
open:
|
|
699
|
-
onOpenChange:
|
|
700
|
-
children: /* @__PURE__ */ m(
|
|
801
|
+
/* @__PURE__ */ p(v, {
|
|
802
|
+
open: $e,
|
|
803
|
+
onOpenChange: W,
|
|
804
|
+
children: /* @__PURE__ */ m(y, { children: [/* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(C, { children: "Edit contract" }), /* @__PURE__ */ m(b, { children: [
|
|
701
805
|
"Update the commercial terms of ",
|
|
702
806
|
I.reference,
|
|
703
807
|
"."
|
|
704
808
|
] })] }), /* @__PURE__ */ m("form", {
|
|
705
809
|
onSubmit: (e) => {
|
|
706
|
-
e.preventDefault(),
|
|
810
|
+
e.preventDefault(), st();
|
|
707
811
|
},
|
|
708
|
-
children: [
|
|
812
|
+
children: [G && /* @__PURE__ */ m("div", {
|
|
709
813
|
className: "grid gap-4 py-2",
|
|
710
814
|
children: [
|
|
711
815
|
/* @__PURE__ */ m("div", {
|
|
712
816
|
className: "grid gap-1.5",
|
|
713
|
-
children: [/* @__PURE__ */ p(
|
|
817
|
+
children: [/* @__PURE__ */ p(_, {
|
|
714
818
|
htmlFor: "editCounterparty",
|
|
715
819
|
children: "Counterparty *"
|
|
716
|
-
}), /* @__PURE__ */ p(
|
|
820
|
+
}), /* @__PURE__ */ p(g, {
|
|
717
821
|
id: "editCounterparty",
|
|
718
|
-
value:
|
|
719
|
-
onChange: (e) =>
|
|
720
|
-
...
|
|
822
|
+
value: G.counterparty,
|
|
823
|
+
onChange: (e) => K({
|
|
824
|
+
...G,
|
|
721
825
|
counterparty: e.target.value
|
|
722
826
|
}),
|
|
723
827
|
placeholder: "Vitol S.A."
|
|
@@ -727,33 +831,33 @@ function N() {
|
|
|
727
831
|
className: "grid gap-2 sm:grid-cols-2",
|
|
728
832
|
children: [/* @__PURE__ */ m("div", {
|
|
729
833
|
className: "grid gap-1.5",
|
|
730
|
-
children: [/* @__PURE__ */ p(
|
|
834
|
+
children: [/* @__PURE__ */ p(_, {
|
|
731
835
|
htmlFor: "editPricingBasis",
|
|
732
836
|
children: "Pricing basis"
|
|
733
|
-
}), /* @__PURE__ */ m(
|
|
734
|
-
value:
|
|
735
|
-
onValueChange: (e) =>
|
|
736
|
-
...
|
|
837
|
+
}), /* @__PURE__ */ m(w, {
|
|
838
|
+
value: G.pricingBasis,
|
|
839
|
+
onValueChange: (e) => K({
|
|
840
|
+
...G,
|
|
737
841
|
pricingBasis: e
|
|
738
842
|
}),
|
|
739
|
-
children: [/* @__PURE__ */ p(
|
|
843
|
+
children: [/* @__PURE__ */ p(D, {
|
|
740
844
|
id: "editPricingBasis",
|
|
741
|
-
children: /* @__PURE__ */ p(
|
|
742
|
-
}), /* @__PURE__ */ p(
|
|
845
|
+
children: /* @__PURE__ */ p(O, {})
|
|
846
|
+
}), /* @__PURE__ */ p(T, { children: Ue.map((e) => /* @__PURE__ */ p(E, {
|
|
743
847
|
value: e,
|
|
744
848
|
children: i(e)
|
|
745
849
|
}, e)) })]
|
|
746
850
|
})]
|
|
747
851
|
}), /* @__PURE__ */ m("div", {
|
|
748
852
|
className: "grid gap-1.5",
|
|
749
|
-
children: [/* @__PURE__ */ p(
|
|
853
|
+
children: [/* @__PURE__ */ p(_, {
|
|
750
854
|
htmlFor: "editPriceIndex",
|
|
751
855
|
children: "Price index"
|
|
752
|
-
}), /* @__PURE__ */ p(
|
|
856
|
+
}), /* @__PURE__ */ p(g, {
|
|
753
857
|
id: "editPriceIndex",
|
|
754
|
-
value:
|
|
755
|
-
onChange: (e) =>
|
|
756
|
-
...
|
|
858
|
+
value: G.priceIndex,
|
|
859
|
+
onChange: (e) => K({
|
|
860
|
+
...G,
|
|
757
861
|
priceIndex: e.target.value
|
|
758
862
|
}),
|
|
759
863
|
placeholder: "Brent, TTF, Henry Hub"
|
|
@@ -765,17 +869,17 @@ function N() {
|
|
|
765
869
|
children: [
|
|
766
870
|
/* @__PURE__ */ m("div", {
|
|
767
871
|
className: "grid gap-1.5",
|
|
768
|
-
children: [/* @__PURE__ */ p(
|
|
872
|
+
children: [/* @__PURE__ */ p(_, {
|
|
769
873
|
htmlFor: "editPrice",
|
|
770
874
|
children: "Price / unit"
|
|
771
|
-
}), /* @__PURE__ */ p(
|
|
875
|
+
}), /* @__PURE__ */ p(g, {
|
|
772
876
|
id: "editPrice",
|
|
773
877
|
type: "number",
|
|
774
878
|
min: "0",
|
|
775
879
|
step: "any",
|
|
776
|
-
value:
|
|
777
|
-
onChange: (e) =>
|
|
778
|
-
...
|
|
880
|
+
value: G.pricePerUnit,
|
|
881
|
+
onChange: (e) => K({
|
|
882
|
+
...G,
|
|
779
883
|
pricePerUnit: e.target.value
|
|
780
884
|
}),
|
|
781
885
|
placeholder: "82.50"
|
|
@@ -783,14 +887,14 @@ function N() {
|
|
|
783
887
|
}),
|
|
784
888
|
/* @__PURE__ */ m("div", {
|
|
785
889
|
className: "grid gap-1.5",
|
|
786
|
-
children: [/* @__PURE__ */ p(
|
|
890
|
+
children: [/* @__PURE__ */ p(_, {
|
|
787
891
|
htmlFor: "editCurrency",
|
|
788
892
|
children: "Currency"
|
|
789
|
-
}), /* @__PURE__ */ p(
|
|
893
|
+
}), /* @__PURE__ */ p(g, {
|
|
790
894
|
id: "editCurrency",
|
|
791
|
-
value:
|
|
792
|
-
onChange: (e) =>
|
|
793
|
-
...
|
|
895
|
+
value: G.currency,
|
|
896
|
+
onChange: (e) => K({
|
|
897
|
+
...G,
|
|
794
898
|
currency: e.target.value
|
|
795
899
|
}),
|
|
796
900
|
placeholder: "USD"
|
|
@@ -798,19 +902,19 @@ function N() {
|
|
|
798
902
|
}),
|
|
799
903
|
/* @__PURE__ */ m("div", {
|
|
800
904
|
className: "grid gap-1.5",
|
|
801
|
-
children: [/* @__PURE__ */ p(
|
|
905
|
+
children: [/* @__PURE__ */ p(_, {
|
|
802
906
|
htmlFor: "editUnit",
|
|
803
907
|
children: "Unit"
|
|
804
|
-
}), /* @__PURE__ */ m(
|
|
805
|
-
value:
|
|
806
|
-
onValueChange: (e) =>
|
|
807
|
-
...
|
|
908
|
+
}), /* @__PURE__ */ m(w, {
|
|
909
|
+
value: G.unit,
|
|
910
|
+
onValueChange: (e) => K({
|
|
911
|
+
...G,
|
|
808
912
|
unit: e
|
|
809
913
|
}),
|
|
810
|
-
children: [/* @__PURE__ */ p(
|
|
914
|
+
children: [/* @__PURE__ */ p(D, {
|
|
811
915
|
id: "editUnit",
|
|
812
|
-
children: /* @__PURE__ */ p(
|
|
813
|
-
}), /* @__PURE__ */ p(
|
|
916
|
+
children: /* @__PURE__ */ p(O, {})
|
|
917
|
+
}), /* @__PURE__ */ p(T, { children: Ge.map((e) => /* @__PURE__ */ p(E, {
|
|
814
918
|
value: e,
|
|
815
919
|
children: a(e)
|
|
816
920
|
}, e)) })]
|
|
@@ -822,31 +926,31 @@ function N() {
|
|
|
822
926
|
className: "grid gap-2 sm:grid-cols-2",
|
|
823
927
|
children: [/* @__PURE__ */ m("div", {
|
|
824
928
|
className: "grid gap-1.5",
|
|
825
|
-
children: [/* @__PURE__ */ p(
|
|
929
|
+
children: [/* @__PURE__ */ p(_, {
|
|
826
930
|
htmlFor: "editVolume",
|
|
827
931
|
children: "Contracted volume"
|
|
828
|
-
}), /* @__PURE__ */ p(
|
|
932
|
+
}), /* @__PURE__ */ p(g, {
|
|
829
933
|
id: "editVolume",
|
|
830
934
|
type: "number",
|
|
831
935
|
min: "0",
|
|
832
936
|
step: "any",
|
|
833
|
-
value:
|
|
834
|
-
onChange: (e) =>
|
|
835
|
-
...
|
|
937
|
+
value: G.contractedVolume,
|
|
938
|
+
onChange: (e) => K({
|
|
939
|
+
...G,
|
|
836
940
|
contractedVolume: e.target.value
|
|
837
941
|
}),
|
|
838
942
|
placeholder: "500000"
|
|
839
943
|
})]
|
|
840
944
|
}), /* @__PURE__ */ m("div", {
|
|
841
945
|
className: "grid gap-1.5",
|
|
842
|
-
children: [/* @__PURE__ */ p(
|
|
946
|
+
children: [/* @__PURE__ */ p(_, {
|
|
843
947
|
htmlFor: "editLocation",
|
|
844
948
|
children: "Delivery location"
|
|
845
|
-
}), /* @__PURE__ */ p(
|
|
949
|
+
}), /* @__PURE__ */ p(g, {
|
|
846
950
|
id: "editLocation",
|
|
847
|
-
value:
|
|
848
|
-
onChange: (e) =>
|
|
849
|
-
...
|
|
951
|
+
value: G.deliveryLocation,
|
|
952
|
+
onChange: (e) => K({
|
|
953
|
+
...G,
|
|
850
954
|
deliveryLocation: e.target.value
|
|
851
955
|
}),
|
|
852
956
|
placeholder: "Rotterdam"
|
|
@@ -857,29 +961,29 @@ function N() {
|
|
|
857
961
|
className: "grid gap-2 sm:grid-cols-2",
|
|
858
962
|
children: [/* @__PURE__ */ m("div", {
|
|
859
963
|
className: "grid gap-1.5",
|
|
860
|
-
children: [/* @__PURE__ */ p(
|
|
964
|
+
children: [/* @__PURE__ */ p(_, {
|
|
861
965
|
htmlFor: "editStart",
|
|
862
966
|
children: "Start date"
|
|
863
|
-
}), /* @__PURE__ */ p(
|
|
967
|
+
}), /* @__PURE__ */ p(g, {
|
|
864
968
|
id: "editStart",
|
|
865
969
|
type: "date",
|
|
866
|
-
value:
|
|
867
|
-
onChange: (e) =>
|
|
868
|
-
...
|
|
970
|
+
value: G.startDate,
|
|
971
|
+
onChange: (e) => K({
|
|
972
|
+
...G,
|
|
869
973
|
startDate: e.target.value
|
|
870
974
|
})
|
|
871
975
|
})]
|
|
872
976
|
}), /* @__PURE__ */ m("div", {
|
|
873
977
|
className: "grid gap-1.5",
|
|
874
|
-
children: [/* @__PURE__ */ p(
|
|
978
|
+
children: [/* @__PURE__ */ p(_, {
|
|
875
979
|
htmlFor: "editEnd",
|
|
876
980
|
children: "End date"
|
|
877
|
-
}), /* @__PURE__ */ p(
|
|
981
|
+
}), /* @__PURE__ */ p(g, {
|
|
878
982
|
id: "editEnd",
|
|
879
983
|
type: "date",
|
|
880
|
-
value:
|
|
881
|
-
onChange: (e) =>
|
|
882
|
-
...
|
|
984
|
+
value: G.endDate,
|
|
985
|
+
onChange: (e) => K({
|
|
986
|
+
...G,
|
|
883
987
|
endDate: e.target.value
|
|
884
988
|
})
|
|
885
989
|
})]
|
|
@@ -887,34 +991,34 @@ function N() {
|
|
|
887
991
|
}),
|
|
888
992
|
/* @__PURE__ */ m("div", {
|
|
889
993
|
className: "grid gap-1.5",
|
|
890
|
-
children: [/* @__PURE__ */ p(
|
|
994
|
+
children: [/* @__PURE__ */ p(_, {
|
|
891
995
|
htmlFor: "editNotes",
|
|
892
996
|
children: "Notes"
|
|
893
|
-
}), /* @__PURE__ */ p(
|
|
997
|
+
}), /* @__PURE__ */ p(k, {
|
|
894
998
|
id: "editNotes",
|
|
895
999
|
rows: 2,
|
|
896
|
-
value:
|
|
897
|
-
onChange: (e) =>
|
|
898
|
-
...
|
|
1000
|
+
value: G.notes,
|
|
1001
|
+
onChange: (e) => K({
|
|
1002
|
+
...G,
|
|
899
1003
|
notes: e.target.value
|
|
900
1004
|
}),
|
|
901
1005
|
placeholder: "Optional context about this contract."
|
|
902
1006
|
})]
|
|
903
1007
|
}),
|
|
904
|
-
|
|
1008
|
+
Z && /* @__PURE__ */ p("p", {
|
|
905
1009
|
className: "text-sm text-status-error-text",
|
|
906
|
-
children:
|
|
1010
|
+
children: Z
|
|
907
1011
|
})
|
|
908
1012
|
]
|
|
909
|
-
}), /* @__PURE__ */ m(
|
|
1013
|
+
}), /* @__PURE__ */ m(x, { children: [/* @__PURE__ */ p(h, {
|
|
910
1014
|
type: "button",
|
|
911
1015
|
variant: "outline",
|
|
912
|
-
onClick: () =>
|
|
1016
|
+
onClick: () => W(!1),
|
|
913
1017
|
children: "Cancel"
|
|
914
1018
|
}), /* @__PURE__ */ p(h, {
|
|
915
1019
|
type: "submit",
|
|
916
|
-
disabled:
|
|
917
|
-
children:
|
|
1020
|
+
disabled: R.isPending,
|
|
1021
|
+
children: R.isPending ? "Saving…" : "Save changes"
|
|
918
1022
|
})] })]
|
|
919
1023
|
})] })
|
|
920
1024
|
})
|