@burdenoff/microfe-theglobalfuel 2026.1107.2 → 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 +304 -180
- package/dist/theglobalfuel/components/AllocateProductionSheet.js.map +1 -1
- package/dist/theglobalfuel/components/AssignEntitlementDialog.d.ts +11 -0
- package/dist/theglobalfuel/components/AssignEntitlementDialog.d.ts.map +1 -0
- package/dist/theglobalfuel/components/AssignEntitlementDialog.js +117 -0
- package/dist/theglobalfuel/components/AssignEntitlementDialog.js.map +1 -0
- package/dist/theglobalfuel/components/ConfirmActionDialog.d.ts +17 -0
- package/dist/theglobalfuel/components/ConfirmActionDialog.d.ts.map +1 -0
- package/dist/theglobalfuel/components/ConfirmActionDialog.js +29 -0
- package/dist/theglobalfuel/components/ConfirmActionDialog.js.map +1 -0
- 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/InterestDeckSheet.d.ts +21 -0
- package/dist/theglobalfuel/components/InterestDeckSheet.d.ts.map +1 -0
- package/dist/theglobalfuel/components/InterestDeckSheet.js +287 -0
- package/dist/theglobalfuel/components/InterestDeckSheet.js.map +1 -0
- package/dist/theglobalfuel/components/StatusBadge.d.ts.map +1 -1
- package/dist/theglobalfuel/components/StatusBadge.js +7 -1
- package/dist/theglobalfuel/components/StatusBadge.js.map +1 -1
- 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 +38 -2
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts.map +1 -1
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js +265 -124
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js.map +1 -1
- package/dist/theglobalfuel/pages/production/AllocationsPanel.d.ts +8 -1
- package/dist/theglobalfuel/pages/production/AllocationsPanel.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/production/AllocationsPanel.js +288 -174
- package/dist/theglobalfuel/pages/production/AllocationsPanel.js.map +1 -1
- package/dist/theglobalfuel/pages/production/EntitlementsPanel.d.ts +14 -0
- package/dist/theglobalfuel/pages/production/EntitlementsPanel.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/production/EntitlementsPanel.js +205 -0
- package/dist/theglobalfuel/pages/production/EntitlementsPanel.js.map +1 -0
- package/dist/theglobalfuel/pages/production/InterestDecksPanel.d.ts +12 -0
- package/dist/theglobalfuel/pages/production/InterestDecksPanel.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/production/InterestDecksPanel.js +243 -0
- package/dist/theglobalfuel/pages/production/InterestDecksPanel.js.map +1 -0
- 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/pages/production/ProductionPage.d.ts +3 -0
- package/dist/theglobalfuel/pages/production/ProductionPage.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/production/ProductionPage.js +109 -95
- package/dist/theglobalfuel/pages/production/ProductionPage.js.map +1 -1
- package/dist/theglobalfuel/types/index.d.ts +141 -0
- package/dist/theglobalfuel/types/index.d.ts.map +1 -1
- package/dist/theglobalfuel/utils/allocationForm.d.ts +62 -5
- package/dist/theglobalfuel/utils/allocationForm.d.ts.map +1 -1
- package/dist/theglobalfuel/utils/allocationForm.js +150 -63
- 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/interestDeckForm.d.ts +64 -0
- package/dist/theglobalfuel/utils/interestDeckForm.d.ts.map +1 -0
- package/dist/theglobalfuel/utils/interestDeckForm.js +140 -0
- package/dist/theglobalfuel/utils/interestDeckForm.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,267 +1,391 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
|
-
import { formatDate as t,
|
|
3
|
-
import { useTheAllAssets 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
4
|
import { useNotify as ee } from "../hooks/useNotify.js";
|
|
5
5
|
import "../hooks/index.js";
|
|
6
|
-
import { buildAllocationInput as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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";
|
|
11
12
|
//#region src/theglobalfuel/components/AllocateProductionSheet.tsx
|
|
12
|
-
function
|
|
13
|
-
let
|
|
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(() => {
|
|
14
15
|
let e = /* @__PURE__ */ new Map();
|
|
15
|
-
for (let t of
|
|
16
|
+
for (let t of P) e.set(t.id, t.workingInterestPct);
|
|
16
17
|
return e;
|
|
17
|
-
}, [
|
|
18
|
-
|
|
19
|
-
let
|
|
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
|
+
workingInterestPct: t,
|
|
24
|
+
royaltyPct: 0,
|
|
25
|
+
overridingRoyaltyPct: 0,
|
|
26
|
+
source: "ASSET_DEFAULT"
|
|
27
|
+
};
|
|
28
|
+
let n = d(me, e, A.periodStart, A.periodEnd);
|
|
29
|
+
return n.kind === "deck" ? {
|
|
30
|
+
workingInterestPct: n.workingInterestPct,
|
|
31
|
+
royaltyPct: n.deck.royaltyPct,
|
|
32
|
+
overridingRoyaltyPct: n.deck.overridingRoyaltyPct,
|
|
33
|
+
source: "INTEREST_DECK",
|
|
34
|
+
effectiveFrom: n.deck.effectiveFrom
|
|
35
|
+
} : {
|
|
36
|
+
workingInterestPct: t,
|
|
37
|
+
royaltyPct: 0,
|
|
38
|
+
overridingRoyaltyPct: 0,
|
|
39
|
+
source: n.kind === "spans" ? "SPANS" : "ASSET_DEFAULT"
|
|
40
|
+
};
|
|
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 ? {
|
|
20
42
|
...n,
|
|
21
43
|
...t
|
|
22
|
-
} : n)),
|
|
23
|
-
if (!
|
|
24
|
-
let e =
|
|
25
|
-
productionRecordId:
|
|
26
|
-
method:
|
|
27
|
-
measuredVolume:
|
|
28
|
-
rows:
|
|
29
|
-
notes:
|
|
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
|
+
method: F,
|
|
49
|
+
measuredVolume: J,
|
|
50
|
+
rows: L,
|
|
51
|
+
notes: z,
|
|
52
|
+
shrinkage: V
|
|
30
53
|
});
|
|
31
54
|
if (!e.ok) {
|
|
32
|
-
|
|
55
|
+
W(e.error), j.error(e.error);
|
|
33
56
|
return;
|
|
34
57
|
}
|
|
35
|
-
|
|
58
|
+
W(null);
|
|
36
59
|
try {
|
|
37
|
-
await
|
|
60
|
+
await N.mutateAsync(e.input), j.success("Allocation drafted — approve it to lock the split"), $();
|
|
38
61
|
} catch (e) {
|
|
39
|
-
|
|
62
|
+
W(e instanceof Error ? e.message : "Failed to allocate production."), j.fromError(e);
|
|
40
63
|
}
|
|
41
|
-
},
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
open:
|
|
44
|
-
onOpenChange:
|
|
45
|
-
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, {
|
|
46
69
|
"data-testid": "allocate-production-sheet",
|
|
47
70
|
className: "md:max-w-3xl",
|
|
48
|
-
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", {
|
|
49
72
|
onSubmit: (e) => {
|
|
50
|
-
e.preventDefault(),
|
|
73
|
+
e.preventDefault(), ge();
|
|
51
74
|
},
|
|
52
|
-
children: [/* @__PURE__ */
|
|
75
|
+
children: [/* @__PURE__ */ h("div", {
|
|
53
76
|
className: "grid gap-4 py-2",
|
|
54
77
|
children: [
|
|
55
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ h("div", {
|
|
56
79
|
className: "grid gap-1.5",
|
|
57
80
|
children: [
|
|
58
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ m(v, {
|
|
59
82
|
htmlFor: "alMethod",
|
|
60
83
|
children: "Method"
|
|
61
84
|
}),
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
value:
|
|
64
|
-
onValueChange: (e) =>
|
|
65
|
-
children: [/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ h(S, {
|
|
86
|
+
value: F,
|
|
87
|
+
onValueChange: (e) => I(e),
|
|
88
|
+
children: [/* @__PURE__ */ m(T, {
|
|
66
89
|
id: "alMethod",
|
|
67
90
|
className: "h-11 md:h-10 md:w-72",
|
|
68
|
-
children: /* @__PURE__ */
|
|
69
|
-
}), /* @__PURE__ */
|
|
91
|
+
children: /* @__PURE__ */ m(E, {})
|
|
92
|
+
}), /* @__PURE__ */ h(C, { children: [/* @__PURE__ */ m(w, {
|
|
70
93
|
value: "MANUAL",
|
|
71
94
|
children: "Manual — enter each asset’s volume"
|
|
72
|
-
}), /* @__PURE__ */
|
|
95
|
+
}), /* @__PURE__ */ m(w, {
|
|
73
96
|
value: "PRO_RATA",
|
|
74
97
|
children: "Pro rata — split by factor"
|
|
75
98
|
})] })]
|
|
76
99
|
}),
|
|
77
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ m("p", {
|
|
78
101
|
className: "text-xs text-text-tertiary",
|
|
79
|
-
children:
|
|
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."
|
|
80
103
|
})
|
|
81
104
|
]
|
|
82
105
|
}),
|
|
83
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ h("div", {
|
|
84
107
|
className: "grid gap-3",
|
|
85
108
|
children: [
|
|
86
|
-
|
|
109
|
+
M.data?.truncated && /* @__PURE__ */ h("p", {
|
|
87
110
|
className: "text-xs text-status-warning-text",
|
|
88
111
|
children: [
|
|
89
112
|
"Showing the first ",
|
|
90
|
-
|
|
113
|
+
P.length,
|
|
91
114
|
" assets of this workspace."
|
|
92
115
|
]
|
|
93
116
|
}),
|
|
94
|
-
|
|
95
|
-
let
|
|
96
|
-
return /* @__PURE__ */
|
|
117
|
+
L.map((n, a) => {
|
|
118
|
+
let o = X.rows[a], s = q(n.assetId);
|
|
119
|
+
return /* @__PURE__ */ h("div", {
|
|
97
120
|
className: "grid gap-2 rounded-lg border border-border-seam p-3",
|
|
98
121
|
"data-testid": "allocation-row",
|
|
99
|
-
children: [
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ h("div", {
|
|
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]",
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ h("div", {
|
|
127
|
+
className: "grid gap-1",
|
|
128
|
+
children: [/* @__PURE__ */ m(v, {
|
|
129
|
+
htmlFor: `${n.key}-asset`,
|
|
130
|
+
className: "text-xs",
|
|
131
|
+
children: "Contributing asset"
|
|
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`,
|
|
137
|
+
className: "h-10",
|
|
138
|
+
children: /* @__PURE__ */ m(E, { placeholder: "Select an asset" })
|
|
139
|
+
}), /* @__PURE__ */ m(C, { children: P.map((e) => /* @__PURE__ */ m(w, {
|
|
140
|
+
value: e.id,
|
|
141
|
+
children: e.name
|
|
142
|
+
}, e.id)) })]
|
|
143
|
+
})]
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ h("div", {
|
|
146
|
+
className: "grid gap-1",
|
|
147
|
+
children: [/* @__PURE__ */ m(v, {
|
|
148
|
+
htmlFor: `${n.key}-amount`,
|
|
149
|
+
className: "text-xs",
|
|
150
|
+
children: _e
|
|
151
|
+
}), /* @__PURE__ */ m(_, {
|
|
152
|
+
id: `${n.key}-amount`,
|
|
153
|
+
type: "number",
|
|
154
|
+
inputMode: "decimal",
|
|
155
|
+
min: "0",
|
|
156
|
+
step: "any",
|
|
157
|
+
className: "h-10 tabular-nums",
|
|
158
|
+
value: n.amount,
|
|
159
|
+
onChange: (e) => Q(n.key, { amount: e.target.value })
|
|
160
|
+
})]
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ h("div", {
|
|
163
|
+
className: "grid gap-1",
|
|
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`,
|
|
184
|
+
className: "text-xs",
|
|
185
|
+
children: "Working interest %"
|
|
186
|
+
}), /* @__PURE__ */ m(_, {
|
|
187
|
+
id: `${n.key}-wi`,
|
|
188
|
+
type: "number",
|
|
189
|
+
inputMode: "decimal",
|
|
190
|
+
min: "0",
|
|
191
|
+
max: "100",
|
|
192
|
+
step: "any",
|
|
193
|
+
className: "h-10 tabular-nums",
|
|
194
|
+
placeholder: r(s.workingInterestPct),
|
|
195
|
+
value: n.workingInterestPct,
|
|
196
|
+
onChange: (e) => Q(n.key, { workingInterestPct: e.target.value })
|
|
197
|
+
})]
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ h("div", {
|
|
200
|
+
className: "grid gap-1",
|
|
201
|
+
children: [/* @__PURE__ */ m(v, {
|
|
202
|
+
htmlFor: `${n.key}-royalty`,
|
|
203
|
+
className: "text-xs",
|
|
204
|
+
children: "Royalty %"
|
|
205
|
+
}), /* @__PURE__ */ m(_, {
|
|
206
|
+
id: `${n.key}-royalty`,
|
|
207
|
+
type: "number",
|
|
208
|
+
inputMode: "decimal",
|
|
209
|
+
min: "0",
|
|
210
|
+
max: "100",
|
|
211
|
+
step: "any",
|
|
212
|
+
className: "h-10 tabular-nums",
|
|
213
|
+
placeholder: r(s.royaltyPct),
|
|
214
|
+
value: n.royaltyPct,
|
|
215
|
+
onChange: (e) => Q(n.key, { royaltyPct: e.target.value })
|
|
216
|
+
})]
|
|
217
|
+
}),
|
|
218
|
+
/* @__PURE__ */ h("div", {
|
|
219
|
+
className: "grid gap-1",
|
|
220
|
+
children: [/* @__PURE__ */ m(v, {
|
|
221
|
+
htmlFor: `${n.key}-orri`,
|
|
222
|
+
className: "text-xs",
|
|
223
|
+
children: "ORRI %"
|
|
224
|
+
}), /* @__PURE__ */ m(_, {
|
|
225
|
+
id: `${n.key}-orri`,
|
|
226
|
+
type: "number",
|
|
227
|
+
inputMode: "decimal",
|
|
228
|
+
min: "0",
|
|
229
|
+
max: "100",
|
|
230
|
+
step: "any",
|
|
231
|
+
className: "h-10 tabular-nums",
|
|
232
|
+
placeholder: r(s.overridingRoyaltyPct),
|
|
233
|
+
value: n.overridingRoyaltyPct,
|
|
234
|
+
onChange: (e) => Q(n.key, { overridingRoyaltyPct: e.target.value })
|
|
235
|
+
})]
|
|
236
|
+
}),
|
|
237
|
+
/* @__PURE__ */ m("div", {
|
|
238
|
+
className: "flex items-end",
|
|
239
|
+
children: /* @__PURE__ */ m(g, {
|
|
240
|
+
type: "button",
|
|
241
|
+
variant: "ghost",
|
|
242
|
+
size: "icon",
|
|
243
|
+
"aria-label": `Remove row ${a + 1}`,
|
|
244
|
+
disabled: L.length === 1,
|
|
245
|
+
onClick: () => he(n.key),
|
|
246
|
+
children: /* @__PURE__ */ m(oe, { className: "h-4 w-4" })
|
|
247
|
+
})
|
|
186
248
|
})
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
"
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
249
|
+
]
|
|
250
|
+
}),
|
|
251
|
+
n.assetId && /* @__PURE__ */ m("p", {
|
|
252
|
+
className: e("text-xs", o?.needsAllTerms ? "text-status-warning-text" : "text-text-tertiary"),
|
|
253
|
+
"data-testid": "allocation-row-terms",
|
|
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)" : ""}.`
|
|
255
|
+
}),
|
|
256
|
+
o && /* @__PURE__ */ h("p", {
|
|
257
|
+
className: "text-xs tabular-nums text-text-secondary",
|
|
258
|
+
children: [
|
|
259
|
+
"Gross ",
|
|
260
|
+
i(o.allocatedVolume, Y),
|
|
261
|
+
" (",
|
|
262
|
+
r(o.sharePct, { maximumFractionDigits: 2 }),
|
|
263
|
+
"%) · Net WI",
|
|
264
|
+
" ",
|
|
265
|
+
i(o.netWorkingInterestVolume, Y),
|
|
266
|
+
" · Royalty",
|
|
267
|
+
" ",
|
|
268
|
+
i(o.royaltyVolume, Y),
|
|
269
|
+
" · Net revenue",
|
|
270
|
+
" ",
|
|
271
|
+
i(o.netRevenueVolume, Y),
|
|
272
|
+
Z.shrinkageTotal > 0 && ` · Wellhead ${i(o.allocatedVolume + (Z.rowShrinkage[a] ?? 0), Y)}`
|
|
273
|
+
]
|
|
274
|
+
})
|
|
275
|
+
]
|
|
276
|
+
}, n.key);
|
|
208
277
|
}),
|
|
209
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ m("div", { children: /* @__PURE__ */ h(g, {
|
|
210
279
|
type: "button",
|
|
211
280
|
variant: "outline",
|
|
212
281
|
size: "sm",
|
|
213
|
-
onClick: () =>
|
|
214
|
-
children: [/* @__PURE__ */
|
|
282
|
+
onClick: () => R((e) => [...e, u()]),
|
|
283
|
+
children: [/* @__PURE__ */ m(ae, { className: "mr-1.5 h-4 w-4" }), " Add asset"]
|
|
215
284
|
}) })
|
|
216
285
|
]
|
|
217
286
|
}),
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
className:
|
|
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", {
|
|
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"),
|
|
220
331
|
"data-testid": "allocation-balance",
|
|
221
332
|
children: [
|
|
222
333
|
"Allocated ",
|
|
223
|
-
|
|
334
|
+
i(X.allocatedTotal, Y),
|
|
224
335
|
" of",
|
|
225
336
|
" ",
|
|
226
|
-
|
|
227
|
-
|
|
337
|
+
i(J, Y),
|
|
338
|
+
F === "MANUAL" && !X.balanced ? ` — ${i(Math.abs(X.difference), Y)} ${X.difference > 0 ? "left to allocate" : "over-allocated"}` : "",
|
|
228
339
|
" · ",
|
|
229
340
|
"Net revenue ",
|
|
230
|
-
|
|
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 })}`
|
|
231
355
|
]
|
|
232
356
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ h("div", {
|
|
234
358
|
className: "grid gap-1.5",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
359
|
+
children: [/* @__PURE__ */ m(v, {
|
|
236
360
|
htmlFor: "alNotes",
|
|
237
361
|
children: "Notes"
|
|
238
|
-
}), /* @__PURE__ */
|
|
362
|
+
}), /* @__PURE__ */ m(D, {
|
|
239
363
|
id: "alNotes",
|
|
240
364
|
rows: 2,
|
|
241
|
-
value:
|
|
242
|
-
onChange: (e) =>
|
|
365
|
+
value: z,
|
|
366
|
+
onChange: (e) => B(e.target.value),
|
|
243
367
|
placeholder: "Basis for the split (well tests, meter proving, agreements)."
|
|
244
368
|
})]
|
|
245
369
|
}),
|
|
246
|
-
|
|
370
|
+
U && /* @__PURE__ */ m("p", {
|
|
247
371
|
role: "alert",
|
|
248
372
|
className: "text-sm text-status-error-text",
|
|
249
|
-
children:
|
|
373
|
+
children: U
|
|
250
374
|
})
|
|
251
375
|
]
|
|
252
|
-
}), /* @__PURE__ */
|
|
376
|
+
}), /* @__PURE__ */ h(y, {
|
|
253
377
|
className: "max-md:flex-col-reverse max-md:gap-2",
|
|
254
|
-
children: [/* @__PURE__ */
|
|
378
|
+
children: [/* @__PURE__ */ m(g, {
|
|
255
379
|
type: "button",
|
|
256
380
|
variant: "outline",
|
|
257
381
|
className: "max-md:h-11",
|
|
258
382
|
onClick: $,
|
|
259
383
|
children: "Cancel"
|
|
260
|
-
}), /* @__PURE__ */
|
|
384
|
+
}), /* @__PURE__ */ m(g, {
|
|
261
385
|
type: "submit",
|
|
262
386
|
className: "max-md:h-11",
|
|
263
|
-
disabled:
|
|
264
|
-
children:
|
|
387
|
+
disabled: N.isPending,
|
|
388
|
+
children: N.isPending ? "Saving…" : "Save draft allocation"
|
|
265
389
|
})]
|
|
266
390
|
})]
|
|
267
391
|
})]
|
|
@@ -269,6 +393,6 @@ function k({ open: k, onOpenChange: A, record: j, measurementAssetName: M }) {
|
|
|
269
393
|
});
|
|
270
394
|
}
|
|
271
395
|
//#endregion
|
|
272
|
-
export {
|
|
396
|
+
export { O as AllocateProductionSheet };
|
|
273
397
|
|
|
274
398
|
//# sourceMappingURL=AllocateProductionSheet.js.map
|