@burdenoff/microfe-theglobalfuel 2026.1107.3 → 2026.1107.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/theglobalfuel/components/AllocateProductionSheet.d.ts.map +1 -1
- package/dist/theglobalfuel/components/AllocateProductionSheet.js +197 -122
- package/dist/theglobalfuel/components/AllocateProductionSheet.js.map +1 -1
- package/dist/theglobalfuel/components/CorrectAllocationSheet.d.ts +11 -0
- package/dist/theglobalfuel/components/CorrectAllocationSheet.d.ts.map +1 -0
- package/dist/theglobalfuel/components/CorrectAllocationSheet.js +235 -0
- package/dist/theglobalfuel/components/CorrectAllocationSheet.js.map +1 -0
- package/dist/theglobalfuel/components/UnitConversionsDialog.d.ts +18 -0
- package/dist/theglobalfuel/components/UnitConversionsDialog.d.ts.map +1 -0
- package/dist/theglobalfuel/components/UnitConversionsDialog.js +228 -0
- package/dist/theglobalfuel/components/UnitConversionsDialog.js.map +1 -0
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts +12 -2
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts.map +1 -1
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js +146 -109
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js.map +1 -1
- package/dist/theglobalfuel/pages/production/AllocationsPanel.d.ts +4 -0
- package/dist/theglobalfuel/pages/production/AllocationsPanel.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/production/AllocationsPanel.js +211 -138
- package/dist/theglobalfuel/pages/production/AllocationsPanel.js.map +1 -1
- package/dist/theglobalfuel/pages/production/NetPositionPanel.d.ts +5 -0
- package/dist/theglobalfuel/pages/production/NetPositionPanel.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/production/NetPositionPanel.js +174 -96
- package/dist/theglobalfuel/pages/production/NetPositionPanel.js.map +1 -1
- package/dist/theglobalfuel/types/index.d.ts +58 -0
- package/dist/theglobalfuel/types/index.d.ts.map +1 -1
- package/dist/theglobalfuel/utils/allocationForm.d.ts +32 -1
- package/dist/theglobalfuel/utils/allocationForm.d.ts.map +1 -1
- package/dist/theglobalfuel/utils/allocationForm.js +136 -67
- package/dist/theglobalfuel/utils/allocationForm.js.map +1 -1
- package/dist/theglobalfuel/utils/correctionForm.d.ts +48 -0
- package/dist/theglobalfuel/utils/correctionForm.d.ts.map +1 -0
- package/dist/theglobalfuel/utils/correctionForm.js +91 -0
- package/dist/theglobalfuel/utils/correctionForm.js.map +1 -0
- package/dist/theglobalfuel/utils/unitConversion.d.ts +20 -0
- package/dist/theglobalfuel/utils/unitConversion.d.ts.map +1 -0
- package/dist/theglobalfuel/utils/unitConversion.js +55 -0
- package/dist/theglobalfuel/utils/unitConversion.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AllocateProductionSheet.d.ts","sourceRoot":"","sources":["../../../src/theglobalfuel/components/AllocateProductionSheet.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"AllocateProductionSheet.d.ts","sourceRoot":"","sources":["../../../src/theglobalfuel/components/AllocateProductionSheet.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AA0CH,OAAO,KAAK,EAAuB,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEzE,UAAU,4BAA4B;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,kFAAkF;IAClF,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACnC,sDAAsD;IACtD,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,oBAAoB,GACrB,EAAE,4BAA4B,+BA6a9B"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
|
-
import { formatDate as t,
|
|
3
|
-
import { useTheAllAssets as
|
|
4
|
-
import { useNotify as
|
|
2
|
+
import { formatDate as t, formatEnumLabel as n, formatNumber as r, formatVolume as i } from "../utils/formatters.js";
|
|
3
|
+
import { useTheAllAssets as a, useTheAllInterestDecks as o, useTheCreateProductionAllocation as s } from "../hooks/useTheGlobalFuelApi.js";
|
|
4
|
+
import { useNotify as ee } from "../hooks/useNotify.js";
|
|
5
5
|
import "../hooks/index.js";
|
|
6
|
-
import { buildAllocationInput as
|
|
7
|
-
import { resolveDeckForPeriod as
|
|
8
|
-
import { useMemo as
|
|
9
|
-
import { Plus as
|
|
10
|
-
import { jsx as
|
|
11
|
-
import { Button as
|
|
6
|
+
import { SHRINKAGE_CATEGORIES as c, SHRINKAGE_LABELS as te, buildAllocationInput as ne, emptyShrinkage as l, newAllocationRow as u, previewAllocation as re, previewReconciliation as ie } from "../utils/allocationForm.js";
|
|
7
|
+
import { resolveDeckForPeriod as d } from "../utils/interestDeckForm.js";
|
|
8
|
+
import { useMemo as f, useState as p } from "react";
|
|
9
|
+
import { Plus as ae, Trash2 as oe } from "lucide-react";
|
|
10
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
11
|
+
import { Button as g, Input as _, Label as v, ResponsiveDialog as se, ResponsiveDialogContent as ce, ResponsiveDialogDescription as le, ResponsiveDialogFooter as y, ResponsiveDialogHeader as b, ResponsiveDialogTitle as x, Select as S, SelectContent as C, SelectItem as w, SelectTrigger as T, SelectValue as E, Textarea as D } from "@burdenoff/fe-libs/ui";
|
|
12
12
|
//#region src/theglobalfuel/components/AllocateProductionSheet.tsx
|
|
13
|
-
function
|
|
14
|
-
let j =
|
|
13
|
+
function O({ open: O, onOpenChange: k, record: A, measurementAssetName: ue }) {
|
|
14
|
+
let j = ee(), M = a({ enabled: O }), N = s(), P = f(() => [...M.data?.items ?? []].sort((e, t) => e.name.localeCompare(t.name)), [M.data]), de = f(() => {
|
|
15
15
|
let e = /* @__PURE__ */ new Map();
|
|
16
16
|
for (let t of P) e.set(t.id, t.workingInterestPct);
|
|
17
17
|
return e;
|
|
18
|
-
}, [P]), [F, I] =
|
|
19
|
-
|
|
20
|
-
let K =
|
|
21
|
-
let t =
|
|
22
|
-
if (!
|
|
18
|
+
}, [P]), [F, I] = p("MANUAL"), [L, R] = p(() => [u()]), [z, B] = p(""), [V, H] = p(l), [U, W] = p(null), G = O && A ? `open:${A.id}` : "closed", [fe, pe] = p(G);
|
|
19
|
+
G !== fe && (pe(G), O && A && (I("MANUAL"), R([u()]), B(""), H(l()), W(null)));
|
|
20
|
+
let K = o({ enabled: O }), me = f(() => K.data?.items ?? [], [K.data]), q = (e) => {
|
|
21
|
+
let t = de.get(e) ?? 100;
|
|
22
|
+
if (!A || !e) return {
|
|
23
23
|
workingInterestPct: t,
|
|
24
24
|
royaltyPct: 0,
|
|
25
25
|
overridingRoyaltyPct: 0,
|
|
26
26
|
source: "ASSET_DEFAULT"
|
|
27
27
|
};
|
|
28
|
-
let n =
|
|
28
|
+
let n = d(me, e, A.periodStart, A.periodEnd);
|
|
29
29
|
return n.kind === "deck" ? {
|
|
30
30
|
workingInterestPct: n.workingInterestPct,
|
|
31
31
|
royaltyPct: n.deck.royaltyPct,
|
|
@@ -38,74 +38,75 @@ function D({ open: D, onOpenChange: O, record: k, measurementAssetName: A }) {
|
|
|
38
38
|
overridingRoyaltyPct: 0,
|
|
39
39
|
source: n.kind === "spans" ? "SPANS" : "ASSET_DEFAULT"
|
|
40
40
|
};
|
|
41
|
-
}, J =
|
|
41
|
+
}, J = A?.volume ?? 0, Y = A?.unit ?? "BARRELS", X = re(F, J, L, q), Z = ie(F, J, L, X, V), Q = (e, t) => R((n) => n.map((n) => n.key === e ? {
|
|
42
42
|
...n,
|
|
43
43
|
...t
|
|
44
|
-
} : n)),
|
|
45
|
-
if (!
|
|
46
|
-
let e =
|
|
47
|
-
productionRecordId:
|
|
44
|
+
} : n)), he = (e) => R((t) => t.length > 1 ? t.filter((t) => t.key !== e) : t), $ = () => k(!1), ge = async () => {
|
|
45
|
+
if (!A) return;
|
|
46
|
+
let e = ne({
|
|
47
|
+
productionRecordId: A.id,
|
|
48
48
|
method: F,
|
|
49
49
|
measuredVolume: J,
|
|
50
50
|
rows: L,
|
|
51
|
-
notes: z
|
|
51
|
+
notes: z,
|
|
52
|
+
shrinkage: V
|
|
52
53
|
});
|
|
53
54
|
if (!e.ok) {
|
|
54
|
-
|
|
55
|
+
W(e.error), j.error(e.error);
|
|
55
56
|
return;
|
|
56
57
|
}
|
|
57
|
-
|
|
58
|
+
W(null);
|
|
58
59
|
try {
|
|
59
|
-
await N.mutateAsync(e.input), j.success("Allocation drafted — approve it to lock the split"),
|
|
60
|
+
await N.mutateAsync(e.input), j.success("Allocation drafted — approve it to lock the split"), $();
|
|
60
61
|
} catch (e) {
|
|
61
|
-
|
|
62
|
+
W(e instanceof Error ? e.message : "Failed to allocate production."), j.fromError(e);
|
|
62
63
|
}
|
|
63
|
-
},
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
open:
|
|
66
|
-
onOpenChange:
|
|
67
|
-
children: /* @__PURE__ */
|
|
64
|
+
}, _e = F === "PRO_RATA" ? "Factor" : "Volume";
|
|
65
|
+
return /* @__PURE__ */ m(se, {
|
|
66
|
+
open: O && !!A,
|
|
67
|
+
onOpenChange: k,
|
|
68
|
+
children: /* @__PURE__ */ h(ce, {
|
|
68
69
|
"data-testid": "allocate-production-sheet",
|
|
69
70
|
className: "md:max-w-3xl",
|
|
70
|
-
children: [/* @__PURE__ */
|
|
71
|
+
children: [/* @__PURE__ */ h(b, { children: [/* @__PURE__ */ m(x, { children: "Allocate production" }), /* @__PURE__ */ m(le, { children: A ? `${i(A.volume, A.unit)} measured at ${ue ?? "this asset"}, ${t(A.periodStart)} – ${t(A.periodEnd)}.` : "" })] }), /* @__PURE__ */ h("form", {
|
|
71
72
|
onSubmit: (e) => {
|
|
72
|
-
e.preventDefault(),
|
|
73
|
+
e.preventDefault(), ge();
|
|
73
74
|
},
|
|
74
|
-
children: [/* @__PURE__ */
|
|
75
|
+
children: [/* @__PURE__ */ h("div", {
|
|
75
76
|
className: "grid gap-4 py-2",
|
|
76
77
|
children: [
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ h("div", {
|
|
78
79
|
className: "grid gap-1.5",
|
|
79
80
|
children: [
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ m(v, {
|
|
81
82
|
htmlFor: "alMethod",
|
|
82
83
|
children: "Method"
|
|
83
84
|
}),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ h(S, {
|
|
85
86
|
value: F,
|
|
86
87
|
onValueChange: (e) => I(e),
|
|
87
|
-
children: [/* @__PURE__ */
|
|
88
|
+
children: [/* @__PURE__ */ m(T, {
|
|
88
89
|
id: "alMethod",
|
|
89
90
|
className: "h-11 md:h-10 md:w-72",
|
|
90
|
-
children: /* @__PURE__ */
|
|
91
|
-
}), /* @__PURE__ */
|
|
91
|
+
children: /* @__PURE__ */ m(E, {})
|
|
92
|
+
}), /* @__PURE__ */ h(C, { children: [/* @__PURE__ */ m(w, {
|
|
92
93
|
value: "MANUAL",
|
|
93
94
|
children: "Manual — enter each asset’s volume"
|
|
94
|
-
}), /* @__PURE__ */
|
|
95
|
+
}), /* @__PURE__ */ m(w, {
|
|
95
96
|
value: "PRO_RATA",
|
|
96
97
|
children: "Pro rata — split by factor"
|
|
97
98
|
})] })]
|
|
98
99
|
}),
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ m("p", {
|
|
100
101
|
className: "text-xs text-text-tertiary",
|
|
101
|
-
children: F === "PRO_RATA" ? "Factors can be well-test rates, theoretical volumes or metered shares. The measured volume is split in proportion." : "The volumes must add up to the measured volume."
|
|
102
|
+
children: F === "PRO_RATA" ? "Factors can be well-test rates, theoretical volumes or metered shares. The measured volume is split in proportion; leave a factor blank to split by the theoretical volume." : "The volumes must add up to the measured volume."
|
|
102
103
|
})
|
|
103
104
|
]
|
|
104
105
|
}),
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ h("div", {
|
|
106
107
|
className: "grid gap-3",
|
|
107
108
|
children: [
|
|
108
|
-
M.data?.truncated && /* @__PURE__ */
|
|
109
|
+
M.data?.truncated && /* @__PURE__ */ h("p", {
|
|
109
110
|
className: "text-xs text-status-warning-text",
|
|
110
111
|
children: [
|
|
111
112
|
"Showing the first ",
|
|
@@ -113,178 +114,252 @@ function D({ open: D, onOpenChange: O, record: k, measurementAssetName: A }) {
|
|
|
113
114
|
" assets of this workspace."
|
|
114
115
|
]
|
|
115
116
|
}),
|
|
116
|
-
L.map((
|
|
117
|
-
let o = X.rows[a], s = q(
|
|
118
|
-
return /* @__PURE__ */
|
|
117
|
+
L.map((n, a) => {
|
|
118
|
+
let o = X.rows[a], s = q(n.assetId);
|
|
119
|
+
return /* @__PURE__ */ h("div", {
|
|
119
120
|
className: "grid gap-2 rounded-lg border border-border-seam p-3",
|
|
120
121
|
"data-testid": "allocation-row",
|
|
121
122
|
children: [
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ h("div", {
|
|
123
124
|
className: "grid grid-cols-1 gap-2 md:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]",
|
|
124
125
|
children: [
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ h("div", {
|
|
126
127
|
className: "grid gap-1",
|
|
127
|
-
children: [/* @__PURE__ */
|
|
128
|
-
htmlFor: `${
|
|
128
|
+
children: [/* @__PURE__ */ m(v, {
|
|
129
|
+
htmlFor: `${n.key}-asset`,
|
|
129
130
|
className: "text-xs",
|
|
130
131
|
children: "Contributing asset"
|
|
131
|
-
}), /* @__PURE__ */
|
|
132
|
-
value:
|
|
133
|
-
onValueChange: (e) =>
|
|
134
|
-
children: [/* @__PURE__ */
|
|
135
|
-
id: `${
|
|
132
|
+
}), /* @__PURE__ */ h(S, {
|
|
133
|
+
value: n.assetId,
|
|
134
|
+
onValueChange: (e) => Q(n.key, { assetId: e }),
|
|
135
|
+
children: [/* @__PURE__ */ m(T, {
|
|
136
|
+
id: `${n.key}-asset`,
|
|
136
137
|
className: "h-10",
|
|
137
|
-
children: /* @__PURE__ */
|
|
138
|
-
}), /* @__PURE__ */
|
|
138
|
+
children: /* @__PURE__ */ m(E, { placeholder: "Select an asset" })
|
|
139
|
+
}), /* @__PURE__ */ m(C, { children: P.map((e) => /* @__PURE__ */ m(w, {
|
|
139
140
|
value: e.id,
|
|
140
141
|
children: e.name
|
|
141
142
|
}, e.id)) })]
|
|
142
143
|
})]
|
|
143
144
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ h("div", {
|
|
145
146
|
className: "grid gap-1",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
147
|
-
htmlFor: `${
|
|
147
|
+
children: [/* @__PURE__ */ m(v, {
|
|
148
|
+
htmlFor: `${n.key}-amount`,
|
|
148
149
|
className: "text-xs",
|
|
149
|
-
children:
|
|
150
|
-
}), /* @__PURE__ */
|
|
151
|
-
id: `${
|
|
150
|
+
children: _e
|
|
151
|
+
}), /* @__PURE__ */ m(_, {
|
|
152
|
+
id: `${n.key}-amount`,
|
|
152
153
|
type: "number",
|
|
153
154
|
inputMode: "decimal",
|
|
154
155
|
min: "0",
|
|
155
156
|
step: "any",
|
|
156
157
|
className: "h-10 tabular-nums",
|
|
157
|
-
value:
|
|
158
|
-
onChange: (e) =>
|
|
158
|
+
value: n.amount,
|
|
159
|
+
onChange: (e) => Q(n.key, { amount: e.target.value })
|
|
159
160
|
})]
|
|
160
161
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ h("div", {
|
|
162
163
|
className: "grid gap-1",
|
|
163
|
-
children: [/* @__PURE__ */
|
|
164
|
-
htmlFor: `${
|
|
164
|
+
children: [/* @__PURE__ */ m(v, {
|
|
165
|
+
htmlFor: `${n.key}-theoretical`,
|
|
166
|
+
className: "text-xs",
|
|
167
|
+
children: "Theoretical"
|
|
168
|
+
}), /* @__PURE__ */ m(_, {
|
|
169
|
+
id: `${n.key}-theoretical`,
|
|
170
|
+
type: "number",
|
|
171
|
+
inputMode: "decimal",
|
|
172
|
+
min: "0",
|
|
173
|
+
step: "any",
|
|
174
|
+
className: "h-10 tabular-nums",
|
|
175
|
+
placeholder: "Optional",
|
|
176
|
+
value: n.theoreticalVolume,
|
|
177
|
+
onChange: (e) => Q(n.key, { theoreticalVolume: e.target.value })
|
|
178
|
+
})]
|
|
179
|
+
}),
|
|
180
|
+
/* @__PURE__ */ h("div", {
|
|
181
|
+
className: "grid gap-1",
|
|
182
|
+
children: [/* @__PURE__ */ m(v, {
|
|
183
|
+
htmlFor: `${n.key}-wi`,
|
|
165
184
|
className: "text-xs",
|
|
166
185
|
children: "Working interest %"
|
|
167
|
-
}), /* @__PURE__ */
|
|
168
|
-
id: `${
|
|
186
|
+
}), /* @__PURE__ */ m(_, {
|
|
187
|
+
id: `${n.key}-wi`,
|
|
169
188
|
type: "number",
|
|
170
189
|
inputMode: "decimal",
|
|
171
190
|
min: "0",
|
|
172
191
|
max: "100",
|
|
173
192
|
step: "any",
|
|
174
193
|
className: "h-10 tabular-nums",
|
|
175
|
-
placeholder:
|
|
176
|
-
value:
|
|
177
|
-
onChange: (e) =>
|
|
194
|
+
placeholder: r(s.workingInterestPct),
|
|
195
|
+
value: n.workingInterestPct,
|
|
196
|
+
onChange: (e) => Q(n.key, { workingInterestPct: e.target.value })
|
|
178
197
|
})]
|
|
179
198
|
}),
|
|
180
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ h("div", {
|
|
181
200
|
className: "grid gap-1",
|
|
182
|
-
children: [/* @__PURE__ */
|
|
183
|
-
htmlFor: `${
|
|
201
|
+
children: [/* @__PURE__ */ m(v, {
|
|
202
|
+
htmlFor: `${n.key}-royalty`,
|
|
184
203
|
className: "text-xs",
|
|
185
204
|
children: "Royalty %"
|
|
186
|
-
}), /* @__PURE__ */
|
|
187
|
-
id: `${
|
|
205
|
+
}), /* @__PURE__ */ m(_, {
|
|
206
|
+
id: `${n.key}-royalty`,
|
|
188
207
|
type: "number",
|
|
189
208
|
inputMode: "decimal",
|
|
190
209
|
min: "0",
|
|
191
210
|
max: "100",
|
|
192
211
|
step: "any",
|
|
193
212
|
className: "h-10 tabular-nums",
|
|
194
|
-
placeholder:
|
|
195
|
-
value:
|
|
196
|
-
onChange: (e) =>
|
|
213
|
+
placeholder: r(s.royaltyPct),
|
|
214
|
+
value: n.royaltyPct,
|
|
215
|
+
onChange: (e) => Q(n.key, { royaltyPct: e.target.value })
|
|
197
216
|
})]
|
|
198
217
|
}),
|
|
199
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ h("div", {
|
|
200
219
|
className: "grid gap-1",
|
|
201
|
-
children: [/* @__PURE__ */
|
|
202
|
-
htmlFor: `${
|
|
220
|
+
children: [/* @__PURE__ */ m(v, {
|
|
221
|
+
htmlFor: `${n.key}-orri`,
|
|
203
222
|
className: "text-xs",
|
|
204
223
|
children: "ORRI %"
|
|
205
|
-
}), /* @__PURE__ */
|
|
206
|
-
id: `${
|
|
224
|
+
}), /* @__PURE__ */ m(_, {
|
|
225
|
+
id: `${n.key}-orri`,
|
|
207
226
|
type: "number",
|
|
208
227
|
inputMode: "decimal",
|
|
209
228
|
min: "0",
|
|
210
229
|
max: "100",
|
|
211
230
|
step: "any",
|
|
212
231
|
className: "h-10 tabular-nums",
|
|
213
|
-
placeholder:
|
|
214
|
-
value:
|
|
215
|
-
onChange: (e) =>
|
|
232
|
+
placeholder: r(s.overridingRoyaltyPct),
|
|
233
|
+
value: n.overridingRoyaltyPct,
|
|
234
|
+
onChange: (e) => Q(n.key, { overridingRoyaltyPct: e.target.value })
|
|
216
235
|
})]
|
|
217
236
|
}),
|
|
218
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ m("div", {
|
|
219
238
|
className: "flex items-end",
|
|
220
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ m(g, {
|
|
221
240
|
type: "button",
|
|
222
241
|
variant: "ghost",
|
|
223
242
|
size: "icon",
|
|
224
243
|
"aria-label": `Remove row ${a + 1}`,
|
|
225
244
|
disabled: L.length === 1,
|
|
226
|
-
onClick: () =>
|
|
227
|
-
children: /* @__PURE__ */
|
|
245
|
+
onClick: () => he(n.key),
|
|
246
|
+
children: /* @__PURE__ */ m(oe, { className: "h-4 w-4" })
|
|
228
247
|
})
|
|
229
248
|
})
|
|
230
249
|
]
|
|
231
250
|
}),
|
|
232
|
-
|
|
251
|
+
n.assetId && /* @__PURE__ */ m("p", {
|
|
233
252
|
className: e("text-xs", o?.needsAllTerms ? "text-status-warning-text" : "text-text-tertiary"),
|
|
234
253
|
"data-testid": "allocation-row-terms",
|
|
235
254
|
children: s.source === "INTEREST_DECK" ? `Terms from the interest deck effective ${t(s.effectiveFrom)}${o?.overridden ? " (with overrides)" : ""}.` : s.source === "SPANS" ? "Ownership changes inside this period — enter working interest, royalty and ORRI, or split the record at the change." : `No interest deck covers this period — using the asset's working interest${o?.overridden ? " (with overrides)" : ""}.`
|
|
236
255
|
}),
|
|
237
|
-
o && /* @__PURE__ */
|
|
256
|
+
o && /* @__PURE__ */ h("p", {
|
|
238
257
|
className: "text-xs tabular-nums text-text-secondary",
|
|
239
258
|
children: [
|
|
240
259
|
"Gross ",
|
|
241
|
-
|
|
260
|
+
i(o.allocatedVolume, Y),
|
|
242
261
|
" (",
|
|
243
|
-
|
|
262
|
+
r(o.sharePct, { maximumFractionDigits: 2 }),
|
|
244
263
|
"%) · Net WI",
|
|
245
264
|
" ",
|
|
246
|
-
|
|
265
|
+
i(o.netWorkingInterestVolume, Y),
|
|
247
266
|
" · Royalty",
|
|
248
267
|
" ",
|
|
249
|
-
|
|
268
|
+
i(o.royaltyVolume, Y),
|
|
250
269
|
" · Net revenue",
|
|
251
270
|
" ",
|
|
252
|
-
|
|
271
|
+
i(o.netRevenueVolume, Y),
|
|
272
|
+
Z.shrinkageTotal > 0 && ` · Wellhead ${i(o.allocatedVolume + (Z.rowShrinkage[a] ?? 0), Y)}`
|
|
253
273
|
]
|
|
254
274
|
})
|
|
255
275
|
]
|
|
256
|
-
},
|
|
276
|
+
}, n.key);
|
|
257
277
|
}),
|
|
258
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ m("div", { children: /* @__PURE__ */ h(g, {
|
|
259
279
|
type: "button",
|
|
260
280
|
variant: "outline",
|
|
261
281
|
size: "sm",
|
|
262
|
-
onClick: () => R((e) => [...e,
|
|
263
|
-
children: [/* @__PURE__ */
|
|
282
|
+
onClick: () => R((e) => [...e, u()]),
|
|
283
|
+
children: [/* @__PURE__ */ m(ae, { className: "mr-1.5 h-4 w-4" }), " Add asset"]
|
|
264
284
|
}) })
|
|
265
285
|
]
|
|
266
286
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ h("fieldset", {
|
|
288
|
+
className: "grid gap-2 rounded-lg border border-border-seam p-3",
|
|
289
|
+
children: [
|
|
290
|
+
/* @__PURE__ */ m("legend", {
|
|
291
|
+
className: "px-1 text-sm font-medium text-text-primary",
|
|
292
|
+
children: "Shrinkage before the meter"
|
|
293
|
+
}),
|
|
294
|
+
/* @__PURE__ */ h("p", {
|
|
295
|
+
className: "text-xs text-text-tertiary",
|
|
296
|
+
children: [
|
|
297
|
+
"Volumes produced at the wells that never reached the measurement point, in",
|
|
298
|
+
" ",
|
|
299
|
+
n(Y),
|
|
300
|
+
". They are shared across the assets by theoretical volume (or factor, or allocated volume)."
|
|
301
|
+
]
|
|
302
|
+
}),
|
|
303
|
+
/* @__PURE__ */ m("div", {
|
|
304
|
+
className: "grid grid-cols-2 gap-2 md:grid-cols-4",
|
|
305
|
+
children: c.map((e) => /* @__PURE__ */ h("div", {
|
|
306
|
+
className: "grid gap-1",
|
|
307
|
+
children: [/* @__PURE__ */ m(v, {
|
|
308
|
+
htmlFor: `shrink-${e}`,
|
|
309
|
+
className: "text-xs",
|
|
310
|
+
children: te[e]
|
|
311
|
+
}), /* @__PURE__ */ m(_, {
|
|
312
|
+
id: `shrink-${e}`,
|
|
313
|
+
type: "number",
|
|
314
|
+
inputMode: "decimal",
|
|
315
|
+
min: "0",
|
|
316
|
+
step: "any",
|
|
317
|
+
className: "h-10 tabular-nums",
|
|
318
|
+
placeholder: "0",
|
|
319
|
+
value: V[e],
|
|
320
|
+
onChange: (t) => H((n) => ({
|
|
321
|
+
...n,
|
|
322
|
+
[e]: t.target.value
|
|
323
|
+
}))
|
|
324
|
+
})]
|
|
325
|
+
}, e))
|
|
326
|
+
})
|
|
327
|
+
]
|
|
328
|
+
}),
|
|
329
|
+
/* @__PURE__ */ h("div", {
|
|
268
330
|
className: e("rounded-lg px-3 py-2 text-sm tabular-nums", X.balanced ? "bg-status-success-bg-subtle text-status-success-text" : "bg-status-warning-bg-subtle text-status-warning-text"),
|
|
269
331
|
"data-testid": "allocation-balance",
|
|
270
332
|
children: [
|
|
271
333
|
"Allocated ",
|
|
272
|
-
|
|
334
|
+
i(X.allocatedTotal, Y),
|
|
273
335
|
" of",
|
|
274
336
|
" ",
|
|
275
|
-
|
|
276
|
-
F === "MANUAL" && !X.balanced ? ` — ${
|
|
337
|
+
i(J, Y),
|
|
338
|
+
F === "MANUAL" && !X.balanced ? ` — ${i(Math.abs(X.difference), Y)} ${X.difference > 0 ? "left to allocate" : "over-allocated"}` : "",
|
|
277
339
|
" · ",
|
|
278
340
|
"Net revenue ",
|
|
279
|
-
|
|
341
|
+
i(X.netRevenueTotal, Y)
|
|
342
|
+
]
|
|
343
|
+
}),
|
|
344
|
+
(Z.shrinkageTotal > 0 || Z.theoreticalTotal !== null) && /* @__PURE__ */ h("p", {
|
|
345
|
+
className: "rounded-lg bg-bg-surface px-3 py-2 text-sm tabular-nums text-text-secondary",
|
|
346
|
+
"data-testid": "allocation-reconciliation",
|
|
347
|
+
children: [
|
|
348
|
+
"Shrinkage ",
|
|
349
|
+
i(Z.shrinkageTotal, Y),
|
|
350
|
+
" · Wellhead",
|
|
351
|
+
" ",
|
|
352
|
+
i(Z.wellheadVolume, Y),
|
|
353
|
+
Z.theoreticalTotal !== null && ` · Theoretical ${i(Z.theoreticalTotal, Y)}`,
|
|
354
|
+
Z.reconciliationFactor !== null && ` · Reconciliation factor ${r(Z.reconciliationFactor, { maximumFractionDigits: 4 })}`
|
|
280
355
|
]
|
|
281
356
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ h("div", {
|
|
283
358
|
className: "grid gap-1.5",
|
|
284
|
-
children: [/* @__PURE__ */
|
|
359
|
+
children: [/* @__PURE__ */ m(v, {
|
|
285
360
|
htmlFor: "alNotes",
|
|
286
361
|
children: "Notes"
|
|
287
|
-
}), /* @__PURE__ */
|
|
362
|
+
}), /* @__PURE__ */ m(D, {
|
|
288
363
|
id: "alNotes",
|
|
289
364
|
rows: 2,
|
|
290
365
|
value: z,
|
|
@@ -292,21 +367,21 @@ function D({ open: D, onOpenChange: O, record: k, measurementAssetName: A }) {
|
|
|
292
367
|
placeholder: "Basis for the split (well tests, meter proving, agreements)."
|
|
293
368
|
})]
|
|
294
369
|
}),
|
|
295
|
-
|
|
370
|
+
U && /* @__PURE__ */ m("p", {
|
|
296
371
|
role: "alert",
|
|
297
372
|
className: "text-sm text-status-error-text",
|
|
298
|
-
children:
|
|
373
|
+
children: U
|
|
299
374
|
})
|
|
300
375
|
]
|
|
301
|
-
}), /* @__PURE__ */
|
|
376
|
+
}), /* @__PURE__ */ h(y, {
|
|
302
377
|
className: "max-md:flex-col-reverse max-md:gap-2",
|
|
303
|
-
children: [/* @__PURE__ */
|
|
378
|
+
children: [/* @__PURE__ */ m(g, {
|
|
304
379
|
type: "button",
|
|
305
380
|
variant: "outline",
|
|
306
381
|
className: "max-md:h-11",
|
|
307
|
-
onClick:
|
|
382
|
+
onClick: $,
|
|
308
383
|
children: "Cancel"
|
|
309
|
-
}), /* @__PURE__ */
|
|
384
|
+
}), /* @__PURE__ */ m(g, {
|
|
310
385
|
type: "submit",
|
|
311
386
|
className: "max-md:h-11",
|
|
312
387
|
disabled: N.isPending,
|
|
@@ -318,6 +393,6 @@ function D({ open: D, onOpenChange: O, record: k, measurementAssetName: A }) {
|
|
|
318
393
|
});
|
|
319
394
|
}
|
|
320
395
|
//#endregion
|
|
321
|
-
export {
|
|
396
|
+
export { O as AllocateProductionSheet };
|
|
322
397
|
|
|
323
398
|
//# sourceMappingURL=AllocateProductionSheet.js.map
|