@burdenoff/microfe-movethewheels 2026.1016.2 → 2026.1016.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/README.md +10 -0
- package/dist/MoveTheWheelsRoot.js +5 -0
- package/dist/MoveTheWheelsRoutes.js +25 -21
- package/dist/components/ContainerEvidencePicker.js +55 -55
- package/dist/components/FleetAlertsPanel.js +2 -2
- package/dist/components/freight-cost/FreightCommercialEditor.js +217 -0
- package/dist/components/freight-cost/FreightCommercialFactEditor.js +217 -0
- package/dist/components/freight-cost/FreightCommercialHistory.js +115 -0
- package/dist/components/freight-cost/FreightDraftForm.js +106 -91
- package/dist/components/freight-cost/FreightHistory.js +42 -40
- package/dist/components/freight-invoice/InvoiceForm.js +366 -0
- package/dist/components/freight-invoice/InvoiceResults.js +240 -0
- package/dist/generated/consolidation-operations.d.ts +195 -265
- package/dist/generated/container-condition-operations.d.ts +124 -187
- package/dist/generated/container-operations.d.ts +59 -85
- package/dist/generated/empty-reuse-operations.d.ts +165 -271
- package/dist/generated/free-time-operations.d.ts +120 -184
- package/dist/generated/freight-cost-operations.d.ts +955 -165
- package/dist/generated/freight-invoice-operations.d.ts +1447 -0
- package/dist/generated/logistics-procedure-operations.d.ts +100 -156
- package/dist/generated/pending-pick-operations.d.ts +769 -1025
- package/dist/generated/shipment-status-authority-operations.d.ts +82 -103
- package/dist/generated/stock-binding-operations.d.ts +188 -260
- package/dist/generated/stock-observation-operations.d.ts +103 -138
- package/dist/generated/tracking-quality-operations.d.ts +27 -41
- package/dist/generated/trip-utilization-operations.d.ts +137 -185
- package/dist/generated/wspace-operations.d.ts +628 -2272
- package/dist/generated/wspace-types.d.ts +4 -23
- package/dist/hooks/useFreightRecoveryAction.js +20 -20
- package/dist/hooks/useInvoiceComparisonRecovery.js +118 -0
- package/dist/movethewheels/components/ContainerEvidencePicker.d.ts +2 -1
- package/dist/movethewheels/components/freight-cost/FreightCommercialEditor.d.ts +8 -0
- package/dist/movethewheels/components/freight-cost/FreightCommercialFactEditor.d.ts +8 -0
- package/dist/movethewheels/components/freight-cost/FreightCommercialHistory.d.ts +4 -0
- package/dist/movethewheels/components/freight-cost/FreightDraftForm.d.ts +4 -2
- package/dist/movethewheels/components/freight-cost/FreightHistory.d.ts +2 -2
- package/dist/movethewheels/components/freight-invoice/InvoiceForm.d.ts +19 -0
- package/dist/movethewheels/components/freight-invoice/InvoiceResults.d.ts +9 -0
- package/dist/movethewheels/hooks/useFleet.d.ts +1 -1
- package/dist/movethewheels/hooks/useFleetIntelligence.d.ts +1 -1
- package/dist/movethewheels/hooks/useInvoiceComparisonRecovery.d.ts +22 -0
- package/dist/movethewheels/hooks/useProcedureSelection.d.ts +1 -3
- package/dist/movethewheels/pages/FreightInvoicePage.d.ts +10 -0
- package/dist/movethewheels/utils/driverLicenseExpiry.d.ts +6 -0
- package/dist/movethewheels/utils/freightCommercial.d.ts +44 -0
- package/dist/movethewheels/utils/invoiceComparison.d.ts +32 -0
- package/dist/pages/DriverDetailsPage.js +306 -282
- package/dist/pages/FreightEstimatePage.js +97 -92
- package/dist/pages/FreightInvoicePage.js +346 -0
- package/dist/src/generated/consolidation-operations.js +3961 -503
- package/dist/src/generated/container-condition-operations.js +2968 -206
- package/dist/src/generated/container-operations.js +997 -99
- package/dist/src/generated/empty-reuse-operations.js +4811 -747
- package/dist/src/generated/free-time-operations.js +2824 -233
- package/dist/src/generated/freight-cost-operations.js +4852 -323
- package/dist/src/generated/freight-invoice-operations.js +4894 -0
- package/dist/src/generated/logistics-procedure-operations.js +2707 -360
- package/dist/src/generated/pending-pick-operations.js +8244 -1196
- package/dist/src/generated/shipment-status-authority-operations.js +1157 -84
- package/dist/src/generated/stock-binding-operations.js +2779 -173
- package/dist/src/generated/stock-observation-operations.js +1274 -91
- package/dist/src/generated/tracking-quality-operations.js +407 -42
- package/dist/src/generated/trip-utilization-operations.js +1765 -138
- package/dist/src/generated/wspace-operations.js +428 -706
- package/dist/utils/driverLicenseExpiry.js +14 -0
- package/dist/utils/freightAcknowledgement.js +6 -5
- package/dist/utils/freightCommercial.js +194 -0
- package/dist/utils/freightRecovery.js +22 -22
- package/dist/utils/invoiceComparison.js +272 -0
- package/package.json +30 -29
- package/src/generated/consolidation-operations.ts +60 -559
- package/src/generated/container-condition-operations.ts +63 -265
- package/src/generated/container-operations.ts +37 -132
- package/src/generated/empty-reuse-operations.ts +83 -824
- package/src/generated/free-time-operations.ts +55 -284
- package/src/generated/freight-cost-operations.ts +373 -349
- package/src/generated/freight-invoice-operations.ts +830 -0
- package/src/generated/logistics-procedure-operations.ts +60 -414
- package/src/generated/pending-pick-operations.ts +48 -1239
- package/src/generated/shipment-status-authority-operations.ts +33 -113
- package/src/generated/stock-binding-operations.ts +29 -198
- package/src/generated/stock-observation-operations.ts +24 -111
- package/src/generated/tracking-quality-operations.ts +19 -57
- package/src/generated/trip-utilization-operations.ts +32 -166
- package/src/generated/wspace-operations.ts +284 -2906
- package/src/generated/wspace-types.ts +2 -8
- package/src/movethewheels/MoveTheWheelsRoot.tsx +6 -0
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +2 -0
- package/src/movethewheels/components/ContainerEvidencePicker.tsx +12 -4
- package/src/movethewheels/components/FleetAlertsPanel.tsx +4 -2
- package/src/movethewheels/components/freight-cost/FreightCommercialEditor.tsx +236 -0
- package/src/movethewheels/components/freight-cost/FreightCommercialFactEditor.tsx +258 -0
- package/src/movethewheels/components/freight-cost/FreightCommercialHistory.tsx +90 -0
- package/src/movethewheels/components/freight-cost/FreightDraftForm.tsx +33 -4
- package/src/movethewheels/components/freight-cost/FreightHistory.tsx +4 -2
- package/src/movethewheels/components/freight-invoice/InvoiceForm.tsx +412 -0
- package/src/movethewheels/components/freight-invoice/InvoiceResults.tsx +162 -0
- package/src/movethewheels/hooks/useFleet.ts +1 -1
- package/src/movethewheels/hooks/useFleetIntelligence.ts +5 -1
- package/src/movethewheels/hooks/useFreightRecoveryAction.ts +2 -1
- package/src/movethewheels/hooks/useInvoiceComparisonRecovery.ts +227 -0
- package/src/movethewheels/pages/DriverDetailsPage.tsx +35 -9
- package/src/movethewheels/pages/FreightEstimatePage.tsx +15 -7
- package/src/movethewheels/pages/FreightInvoicePage.tsx +477 -0
- package/src/movethewheels/utils/driverLicenseExpiry.ts +25 -0
- package/src/movethewheels/utils/freightAcknowledgement.ts +3 -1
- package/src/movethewheels/utils/freightCommercial.ts +388 -0
- package/src/movethewheels/utils/freightRecovery.ts +6 -2
- package/src/movethewheels/utils/invoiceComparison.ts +520 -0
- package/src/operations/freight-cost/commercial.graphql +483 -0
- package/src/operations/freight-invoice/comparison.graphql +40 -0
- package/src/operations/wspace/freight-invoice-evidence.graphql +6 -0
- package/patches/braces@3.0.3.patch +0 -87
|
@@ -1,64 +1,66 @@
|
|
|
1
1
|
import { freightLabel as e, freightMoney as t } from "../../utils/freightDraft.js";
|
|
2
2
|
import { FreightTotals as n } from "./FreightTotals.js";
|
|
3
|
-
import {
|
|
3
|
+
import { FreightCommercialHistory as r } from "./FreightCommercialHistory.js";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
5
|
//#region src/movethewheels/components/freight-cost/FreightHistory.tsx
|
|
5
|
-
function
|
|
6
|
-
return /* @__PURE__ */
|
|
6
|
+
function o({ record: o }) {
|
|
7
|
+
return /* @__PURE__ */ a("article", {
|
|
7
8
|
className: "min-w-0 space-y-4 break-words rounded border p-4",
|
|
8
9
|
children: [
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
+
/* @__PURE__ */ a("h2", {
|
|
10
11
|
className: "text-lg font-semibold",
|
|
11
12
|
children: [
|
|
12
|
-
|
|
13
|
+
o.facts.title,
|
|
13
14
|
" — version ",
|
|
14
|
-
|
|
15
|
+
o.version
|
|
15
16
|
]
|
|
16
17
|
}),
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
|
|
18
|
+
/* @__PURE__ */ a("p", { children: [
|
|
19
|
+
o.shipmentCapture.shipmentNumber,
|
|
19
20
|
" / ",
|
|
20
|
-
|
|
21
|
+
o.shipmentCapture.primaryMode,
|
|
21
22
|
" — captured shipment context"
|
|
22
23
|
] }),
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
|
|
24
|
+
/* @__PURE__ */ a("p", { children: [
|
|
25
|
+
o.facts.kind === "QUOTE" ? "Reported quote" : "Estimate",
|
|
25
26
|
";",
|
|
26
27
|
" ",
|
|
27
|
-
e(
|
|
28
|
+
e(o.validityAtRead),
|
|
28
29
|
". This record does not accept a quote or confirm capacity."
|
|
29
30
|
] }),
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ i("p", { children: o.facts.commercialScope }),
|
|
32
|
+
/* @__PURE__ */ a("p", { children: [
|
|
32
33
|
"Source: ",
|
|
33
|
-
|
|
34
|
+
o.facts.sourceReference,
|
|
34
35
|
" / ",
|
|
35
|
-
|
|
36
|
+
o.facts.sourceRevision
|
|
36
37
|
] }),
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ a("p", { children: [
|
|
38
39
|
"Price at ",
|
|
39
|
-
|
|
40
|
+
o.facts.pricingAt,
|
|
40
41
|
"; recorded ",
|
|
41
|
-
|
|
42
|
+
o.recordedAt,
|
|
42
43
|
" by ",
|
|
43
|
-
|
|
44
|
+
o.createdBy,
|
|
44
45
|
" (",
|
|
45
|
-
e(
|
|
46
|
+
e(o.actorProvenance),
|
|
46
47
|
")."
|
|
47
48
|
] }),
|
|
48
|
-
/* @__PURE__ */ r
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
/* @__PURE__ */ i(r, { capture: o.commercialCapture }),
|
|
50
|
+
/* @__PURE__ */ i(n, {
|
|
51
|
+
value: o.totals,
|
|
52
|
+
currency: o.facts.reportingCurrency
|
|
51
53
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ a("details", { children: [/* @__PURE__ */ i("summary", {
|
|
53
55
|
className: "min-h-11 cursor-pointer font-medium",
|
|
54
56
|
children: "Cost facts and evidence recorded with this version"
|
|
55
|
-
}), /* @__PURE__ */
|
|
57
|
+
}), /* @__PURE__ */ a("div", {
|
|
56
58
|
className: "space-y-3",
|
|
57
59
|
children: [
|
|
58
|
-
|
|
60
|
+
o.facts.lines.map((n) => /* @__PURE__ */ a("div", {
|
|
59
61
|
className: "rounded border p-3",
|
|
60
62
|
children: [
|
|
61
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ a("h3", {
|
|
62
64
|
className: "font-medium",
|
|
63
65
|
children: [
|
|
64
66
|
n.description,
|
|
@@ -66,7 +68,7 @@ function a({ record: a }) {
|
|
|
66
68
|
e(n.category)
|
|
67
69
|
]
|
|
68
70
|
}),
|
|
69
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ a("p", { children: [
|
|
70
72
|
e(n.disposition),
|
|
71
73
|
"; payer ",
|
|
72
74
|
n.payerLabel ?? "Unknown",
|
|
@@ -74,7 +76,7 @@ function a({ record: a }) {
|
|
|
74
76
|
n.payerReference ?? "Unknown reference",
|
|
75
77
|
")."
|
|
76
78
|
] }),
|
|
77
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ a("p", { children: [
|
|
78
80
|
"Reported amount: ",
|
|
79
81
|
t(n.amountMinor, n.currency.minorUnitDigits),
|
|
80
82
|
" ",
|
|
@@ -91,7 +93,7 @@ function a({ record: a }) {
|
|
|
91
93
|
n.unitRateMajor ?? "Unknown",
|
|
92
94
|
"."
|
|
93
95
|
] }),
|
|
94
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ a("p", { children: [
|
|
95
97
|
"Source ",
|
|
96
98
|
n.sourceReference ?? "Unknown",
|
|
97
99
|
" /",
|
|
@@ -100,10 +102,10 @@ function a({ record: a }) {
|
|
|
100
102
|
n.inclusionParentLineId ? `; included in recorded line ${n.inclusionParentLineId}` : "",
|
|
101
103
|
"."
|
|
102
104
|
] }),
|
|
103
|
-
n.zeroReason && /* @__PURE__ */
|
|
105
|
+
n.zeroReason && /* @__PURE__ */ a("p", { children: ["Zero reason: ", n.zeroReason] })
|
|
104
106
|
]
|
|
105
107
|
}, n.id)),
|
|
106
|
-
|
|
108
|
+
o.facts.requirements.map((t) => /* @__PURE__ */ a("p", { children: [
|
|
107
109
|
e(t.category),
|
|
108
110
|
": ",
|
|
109
111
|
e(t.status),
|
|
@@ -116,17 +118,17 @@ function a({ record: a }) {
|
|
|
116
118
|
" ",
|
|
117
119
|
t.sourceRevision ?? "Unknown"
|
|
118
120
|
] }, t.category)),
|
|
119
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ a("p", { children: [
|
|
120
122
|
"Quote occurred ",
|
|
121
|
-
|
|
123
|
+
o.facts.quotedAt ?? "Unknown",
|
|
122
124
|
"; validity",
|
|
123
125
|
" ",
|
|
124
|
-
|
|
126
|
+
o.facts.validFrom ?? "Unknown",
|
|
125
127
|
" to ",
|
|
126
|
-
|
|
128
|
+
o.facts.validUntil ?? "Unknown",
|
|
127
129
|
"."
|
|
128
130
|
] }),
|
|
129
|
-
|
|
131
|
+
o.facts.fx.map((e) => /* @__PURE__ */ a("p", { children: [
|
|
130
132
|
"1 ",
|
|
131
133
|
e.fromCurrency.code,
|
|
132
134
|
" = ",
|
|
@@ -146,7 +148,7 @@ function a({ record: a }) {
|
|
|
146
148
|
"/",
|
|
147
149
|
e.sourceRevision
|
|
148
150
|
] }, e.fromCurrency.code)),
|
|
149
|
-
|
|
151
|
+
o.evidence.map((e) => /* @__PURE__ */ a("p", { children: [
|
|
150
152
|
"Recorded evidence: file ",
|
|
151
153
|
e.fileId,
|
|
152
154
|
", version ",
|
|
@@ -161,4 +163,4 @@ function a({ record: a }) {
|
|
|
161
163
|
});
|
|
162
164
|
}
|
|
163
165
|
//#endregion
|
|
164
|
-
export {
|
|
166
|
+
export { o as FreightHistory };
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { Button as e } from "../ui.js";
|
|
2
|
+
import { ContainerEvidencePicker as t } from "../ContainerEvidencePicker.js";
|
|
3
|
+
import { FreightCurrency as n, FreightSelect as r, FreightText as i } from "../freight-cost/FreightFields.js";
|
|
4
|
+
import { fixedFreightMinor as a, freightMoney as o } from "../../utils/freightDraft.js";
|
|
5
|
+
import { invoiceCanonical as s, invoiceFactsInput as c, matchesInvoicePreview as l } from "../../utils/invoiceComparison.js";
|
|
6
|
+
import { InvoiceResults as u } from "./InvoiceResults.js";
|
|
7
|
+
import { useEffect as d, useRef as f, useState as p } from "react";
|
|
8
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
9
|
+
//#region src/movethewheels/components/freight-invoice/InvoiceForm.tsx
|
|
10
|
+
function g() {
|
|
11
|
+
return {
|
|
12
|
+
schemaVersion: 1,
|
|
13
|
+
supplierReference: null,
|
|
14
|
+
supplierLabel: null,
|
|
15
|
+
invoiceReference: null,
|
|
16
|
+
sourceReference: "",
|
|
17
|
+
sourceRevision: "",
|
|
18
|
+
invoiceDate: null,
|
|
19
|
+
currency: {
|
|
20
|
+
code: "",
|
|
21
|
+
minorUnitDigits: 2
|
|
22
|
+
},
|
|
23
|
+
rows: [{
|
|
24
|
+
id: crypto.randomUUID(),
|
|
25
|
+
description: "",
|
|
26
|
+
estimateLineId: null,
|
|
27
|
+
currency: {
|
|
28
|
+
code: "",
|
|
29
|
+
minorUnitDigits: 2
|
|
30
|
+
},
|
|
31
|
+
payerReference: null,
|
|
32
|
+
payerLabel: null,
|
|
33
|
+
quantity: null,
|
|
34
|
+
unit: null,
|
|
35
|
+
unitRateMajor: null,
|
|
36
|
+
amountMinor: null,
|
|
37
|
+
zeroReason: null
|
|
38
|
+
}]
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function _(e) {
|
|
42
|
+
return {
|
|
43
|
+
id: e.id,
|
|
44
|
+
estimateReference: e.estimateReference,
|
|
45
|
+
version: e.version,
|
|
46
|
+
kind: e.facts.kind,
|
|
47
|
+
sourceReference: e.facts.sourceReference,
|
|
48
|
+
sourceRevision: e.facts.sourceRevision,
|
|
49
|
+
quotedAt: e.facts.quotedAt,
|
|
50
|
+
validFrom: e.facts.validFrom,
|
|
51
|
+
validUntil: e.facts.validUntil,
|
|
52
|
+
acceptance: "NOT_ESTABLISHED"
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function v({ estimate: v, previous: y, disabled: b, canRecord: x, onPreview: S, onSave: C }) {
|
|
56
|
+
let [w, T] = p(() => y ? structuredClone(y.facts) : g()), [E, D] = p([]), [O, k] = p(""), [A, j] = p(null), [M, N] = p(null), [P, F] = p(!1), I = f(null), L = f(!0), R = f(!1);
|
|
57
|
+
d(() => (L.current = !0, () => {
|
|
58
|
+
L.current = !1;
|
|
59
|
+
}), []);
|
|
60
|
+
let z = s({
|
|
61
|
+
facts: w,
|
|
62
|
+
evidence: E.map(({ fileId: e, versionId: t }) => ({
|
|
63
|
+
fileId: e,
|
|
64
|
+
versionId: t
|
|
65
|
+
})),
|
|
66
|
+
estimateId: v.id
|
|
67
|
+
}), B = A?.body === z ? A.value : null, V = (e) => T({
|
|
68
|
+
...w,
|
|
69
|
+
...e
|
|
70
|
+
}), H = (e, t) => V({ rows: w.rows.map((n) => n.id === e ? {
|
|
71
|
+
...n,
|
|
72
|
+
...t
|
|
73
|
+
} : n) }), U = async () => {
|
|
74
|
+
if (R.current || b || !I.current?.reportValidity()) return;
|
|
75
|
+
R.current = !0, F(!0), N(null);
|
|
76
|
+
let e = z;
|
|
77
|
+
try {
|
|
78
|
+
let t = c(w), n = await S({
|
|
79
|
+
shipmentId: v.shipmentId,
|
|
80
|
+
estimateVersionId: v.id,
|
|
81
|
+
facts: t,
|
|
82
|
+
evidence: E.map(({ fileId: e, versionId: t }) => ({
|
|
83
|
+
fileId: e,
|
|
84
|
+
versionId: t
|
|
85
|
+
}))
|
|
86
|
+
});
|
|
87
|
+
if (!l(n, t, _(v))) throw Error("The preview did not match these reported facts and exact estimate. Nothing was sent.");
|
|
88
|
+
L.current && j({
|
|
89
|
+
body: e,
|
|
90
|
+
value: n
|
|
91
|
+
});
|
|
92
|
+
} catch (e) {
|
|
93
|
+
L.current && N(e instanceof Error ? e.message : "Unable to preview the reported facts.");
|
|
94
|
+
} finally {
|
|
95
|
+
R.current = !1, L.current && F(!1);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
return /* @__PURE__ */ h("form", {
|
|
99
|
+
ref: I,
|
|
100
|
+
className: "min-w-0 space-y-5",
|
|
101
|
+
"aria-label": "Manual invoice comparison",
|
|
102
|
+
onSubmit: (e) => {
|
|
103
|
+
if (e.preventDefault(), !(!B || B.recordable !== !0 || b || !x || R.current)) {
|
|
104
|
+
N(null);
|
|
105
|
+
try {
|
|
106
|
+
let e = c(w);
|
|
107
|
+
C({
|
|
108
|
+
shipmentId: v.shipmentId,
|
|
109
|
+
estimateVersionId: v.id,
|
|
110
|
+
facts: e,
|
|
111
|
+
evidence: E.map(({ fileId: e, versionId: t }) => ({
|
|
112
|
+
fileId: e,
|
|
113
|
+
versionId: t
|
|
114
|
+
})),
|
|
115
|
+
expectedRevision: y?.revision ?? 0,
|
|
116
|
+
expectedPreviousComparisonId: y?.id ?? null,
|
|
117
|
+
correctionReason: y && O.trim() || null
|
|
118
|
+
}, _(v)).catch(() => N("The original request remains retained; inspect read-only recovery."));
|
|
119
|
+
} catch (e) {
|
|
120
|
+
N(e instanceof Error ? e.message : "Review the reported source fields. Nothing was sent.");
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ h("fieldset", {
|
|
126
|
+
disabled: b || P,
|
|
127
|
+
className: "min-w-0 space-y-5",
|
|
128
|
+
children: [
|
|
129
|
+
/* @__PURE__ */ m("legend", {
|
|
130
|
+
className: "text-lg font-semibold",
|
|
131
|
+
children: y ? "Append an immutable correction" : "Reported supplier invoice"
|
|
132
|
+
}),
|
|
133
|
+
/* @__PURE__ */ m("p", { children: "Blank means unknown, never zero. This is a manual comparison, not approval or payment. No FX, credits or split allocation." }),
|
|
134
|
+
/* @__PURE__ */ h("p", { children: [
|
|
135
|
+
"Exact pinned ",
|
|
136
|
+
v.facts.kind.toLowerCase(),
|
|
137
|
+
": ",
|
|
138
|
+
v.estimateReference,
|
|
139
|
+
" / version",
|
|
140
|
+
" ",
|
|
141
|
+
v.version,
|
|
142
|
+
"; ",
|
|
143
|
+
v.facts.title,
|
|
144
|
+
". Source validity: ",
|
|
145
|
+
v.validityAtRead,
|
|
146
|
+
". Acceptance is not established."
|
|
147
|
+
] }),
|
|
148
|
+
/* @__PURE__ */ h("div", {
|
|
149
|
+
className: "grid min-w-0 gap-3 md:grid-cols-2",
|
|
150
|
+
children: [
|
|
151
|
+
/* @__PURE__ */ m(i, {
|
|
152
|
+
label: "Supplier source reference",
|
|
153
|
+
value: w.supplierReference ?? "",
|
|
154
|
+
disabled: !!y,
|
|
155
|
+
onChange: (e) => V({ supplierReference: e })
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ m(i, {
|
|
158
|
+
label: "Supplier label",
|
|
159
|
+
value: w.supplierLabel ?? "",
|
|
160
|
+
onChange: (e) => V({ supplierLabel: e })
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ m(i, {
|
|
163
|
+
label: "Invoice reference",
|
|
164
|
+
value: w.invoiceReference ?? "",
|
|
165
|
+
disabled: !!y,
|
|
166
|
+
onChange: (e) => V({ invoiceReference: e })
|
|
167
|
+
}),
|
|
168
|
+
/* @__PURE__ */ m(i, {
|
|
169
|
+
label: "Invoice source reference",
|
|
170
|
+
value: w.sourceReference,
|
|
171
|
+
required: !0,
|
|
172
|
+
onChange: (e) => V({ sourceReference: e })
|
|
173
|
+
}),
|
|
174
|
+
/* @__PURE__ */ m(i, {
|
|
175
|
+
label: "Invoice source revision",
|
|
176
|
+
value: w.sourceRevision,
|
|
177
|
+
required: !0,
|
|
178
|
+
onChange: (e) => V({ sourceRevision: e })
|
|
179
|
+
}),
|
|
180
|
+
/* @__PURE__ */ m(i, {
|
|
181
|
+
label: "Invoice source date (optional)",
|
|
182
|
+
type: "date",
|
|
183
|
+
value: w.invoiceDate ?? "",
|
|
184
|
+
onChange: (e) => V({ invoiceDate: e || null })
|
|
185
|
+
})
|
|
186
|
+
]
|
|
187
|
+
}),
|
|
188
|
+
/* @__PURE__ */ m(n, {
|
|
189
|
+
label: "Invoice currency",
|
|
190
|
+
value: w.currency,
|
|
191
|
+
onChange: (e) => V({
|
|
192
|
+
currency: e,
|
|
193
|
+
rows: w.rows.map((t) => ({
|
|
194
|
+
...t,
|
|
195
|
+
currency: e,
|
|
196
|
+
amountMinor: null,
|
|
197
|
+
zeroReason: null
|
|
198
|
+
}))
|
|
199
|
+
})
|
|
200
|
+
}),
|
|
201
|
+
w.rows.map((t, n) => /* @__PURE__ */ h("fieldset", {
|
|
202
|
+
className: "min-w-0 space-y-3 rounded border p-3",
|
|
203
|
+
children: [
|
|
204
|
+
/* @__PURE__ */ h("legend", {
|
|
205
|
+
className: "font-semibold",
|
|
206
|
+
children: ["Reported row ", n + 1]
|
|
207
|
+
}),
|
|
208
|
+
/* @__PURE__ */ m(i, {
|
|
209
|
+
label: `Row ${n + 1} description`,
|
|
210
|
+
value: t.description,
|
|
211
|
+
required: !0,
|
|
212
|
+
onChange: (e) => H(t.id, { description: e })
|
|
213
|
+
}),
|
|
214
|
+
/* @__PURE__ */ h(r, {
|
|
215
|
+
label: `Row ${n + 1} exact estimate mapping`,
|
|
216
|
+
value: t.estimateLineId ?? "",
|
|
217
|
+
onChange: (e) => H(t.id, { estimateLineId: e || null }),
|
|
218
|
+
children: [/* @__PURE__ */ m("option", {
|
|
219
|
+
value: "",
|
|
220
|
+
children: "Unmatched invoice row"
|
|
221
|
+
}), v.facts.lines.map((e) => /* @__PURE__ */ h("option", {
|
|
222
|
+
value: e.id,
|
|
223
|
+
children: [
|
|
224
|
+
e.description,
|
|
225
|
+
" / ",
|
|
226
|
+
e.id,
|
|
227
|
+
" / ",
|
|
228
|
+
e.disposition
|
|
229
|
+
]
|
|
230
|
+
}, e.id))]
|
|
231
|
+
}),
|
|
232
|
+
/* @__PURE__ */ h("div", {
|
|
233
|
+
className: "grid min-w-0 gap-3 md:grid-cols-2",
|
|
234
|
+
children: [
|
|
235
|
+
/* @__PURE__ */ m(i, {
|
|
236
|
+
label: `Row ${n + 1} payer source reference`,
|
|
237
|
+
value: t.payerReference ?? "",
|
|
238
|
+
onChange: (e) => H(t.id, { payerReference: e })
|
|
239
|
+
}),
|
|
240
|
+
/* @__PURE__ */ m(i, {
|
|
241
|
+
label: `Row ${n + 1} payer label`,
|
|
242
|
+
value: t.payerLabel ?? "",
|
|
243
|
+
onChange: (e) => H(t.id, { payerLabel: e })
|
|
244
|
+
}),
|
|
245
|
+
/* @__PURE__ */ h("label", {
|
|
246
|
+
className: "block text-sm",
|
|
247
|
+
children: [
|
|
248
|
+
"Row ",
|
|
249
|
+
n + 1,
|
|
250
|
+
" supplied amount (",
|
|
251
|
+
t.currency.code || "declare currency",
|
|
252
|
+
")",
|
|
253
|
+
/* @__PURE__ */ m("input", {
|
|
254
|
+
className: "mt-1 min-h-11 w-full rounded border p-2",
|
|
255
|
+
"aria-label": `Row ${n + 1} supplied amount`,
|
|
256
|
+
inputMode: "decimal",
|
|
257
|
+
defaultValue: t.amountMinor == null ? "" : o(t.amountMinor, t.currency.minorUnitDigits),
|
|
258
|
+
onChange: (e) => {
|
|
259
|
+
try {
|
|
260
|
+
H(t.id, { amountMinor: a(e.target.value, t.currency.minorUnitDigits) }), e.target.setCustomValidity("");
|
|
261
|
+
} catch (n) {
|
|
262
|
+
H(t.id, { amountMinor: null }), e.target.setCustomValidity(n instanceof Error ? n.message : "Invalid sourced amount.");
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}, `${t.currency.code}:${t.currency.minorUnitDigits}`)
|
|
266
|
+
]
|
|
267
|
+
}),
|
|
268
|
+
/* @__PURE__ */ m(i, {
|
|
269
|
+
label: `Row ${n + 1} zero source reason`,
|
|
270
|
+
value: t.zeroReason ?? "",
|
|
271
|
+
onChange: (e) => H(t.id, { zeroReason: e })
|
|
272
|
+
}),
|
|
273
|
+
/* @__PURE__ */ m(i, {
|
|
274
|
+
label: `Row ${n + 1} supplied quantity`,
|
|
275
|
+
value: t.quantity ?? "",
|
|
276
|
+
onChange: (e) => H(t.id, { quantity: e })
|
|
277
|
+
}),
|
|
278
|
+
/* @__PURE__ */ m(i, {
|
|
279
|
+
label: `Row ${n + 1} explicit unit`,
|
|
280
|
+
value: t.unit ?? "",
|
|
281
|
+
onChange: (e) => H(t.id, { unit: e })
|
|
282
|
+
}),
|
|
283
|
+
/* @__PURE__ */ m(i, {
|
|
284
|
+
label: `Row ${n + 1} supplied unit rate`,
|
|
285
|
+
value: t.unitRateMajor ?? "",
|
|
286
|
+
onChange: (e) => H(t.id, { unitRateMajor: e })
|
|
287
|
+
})
|
|
288
|
+
]
|
|
289
|
+
}),
|
|
290
|
+
/* @__PURE__ */ h("p", { children: [
|
|
291
|
+
w.currency.code || "currency unknown",
|
|
292
|
+
" / decimal places",
|
|
293
|
+
" ",
|
|
294
|
+
w.currency.minorUnitDigits,
|
|
295
|
+
". Amount stays as supplied, not quantity × rate."
|
|
296
|
+
] }),
|
|
297
|
+
/* @__PURE__ */ h(e, {
|
|
298
|
+
type: "button",
|
|
299
|
+
variant: "outline",
|
|
300
|
+
disabled: w.rows.length === 1,
|
|
301
|
+
onClick: () => V({ rows: w.rows.filter((e) => e.id !== t.id) }),
|
|
302
|
+
children: ["Remove row ", n + 1]
|
|
303
|
+
})
|
|
304
|
+
]
|
|
305
|
+
}, t.id)),
|
|
306
|
+
/* @__PURE__ */ m(e, {
|
|
307
|
+
type: "button",
|
|
308
|
+
variant: "outline",
|
|
309
|
+
disabled: w.rows.length >= 100,
|
|
310
|
+
onClick: () => V({ rows: [...w.rows, {
|
|
311
|
+
id: crypto.randomUUID(),
|
|
312
|
+
description: "",
|
|
313
|
+
estimateLineId: null,
|
|
314
|
+
currency: { ...w.currency },
|
|
315
|
+
payerReference: null,
|
|
316
|
+
payerLabel: null,
|
|
317
|
+
quantity: null,
|
|
318
|
+
unit: null,
|
|
319
|
+
unitRateMajor: null,
|
|
320
|
+
amountMinor: null,
|
|
321
|
+
zeroReason: null
|
|
322
|
+
}] }),
|
|
323
|
+
children: "Add reported row"
|
|
324
|
+
}),
|
|
325
|
+
/* @__PURE__ */ m(t, {
|
|
326
|
+
currentOnly: !0,
|
|
327
|
+
value: E,
|
|
328
|
+
onChange: D,
|
|
329
|
+
description: "Choose current readable ACTIVE Files versions with an integrity fingerprint. The server rechecks eligibility when recording; no binary is uploaded here."
|
|
330
|
+
}),
|
|
331
|
+
y && /* @__PURE__ */ m(i, {
|
|
332
|
+
label: "Correction source reason",
|
|
333
|
+
value: O,
|
|
334
|
+
required: !1,
|
|
335
|
+
onChange: k
|
|
336
|
+
}),
|
|
337
|
+
/* @__PURE__ */ h("div", {
|
|
338
|
+
className: "flex flex-wrap gap-3",
|
|
339
|
+
children: [/* @__PURE__ */ m(e, {
|
|
340
|
+
type: "button",
|
|
341
|
+
variant: "outline",
|
|
342
|
+
onClick: () => void U(),
|
|
343
|
+
children: "Preview reported comparison"
|
|
344
|
+
}), /* @__PURE__ */ m(e, {
|
|
345
|
+
type: "submit",
|
|
346
|
+
disabled: !x || B?.recordable !== !0 || !E.length || !!y && !O.trim(),
|
|
347
|
+
children: "Record immutable comparison"
|
|
348
|
+
})]
|
|
349
|
+
})
|
|
350
|
+
]
|
|
351
|
+
}),
|
|
352
|
+
!x && /* @__PURE__ */ m("p", { children: "Shipment update permission is required to record; structural preview remains read-only." }),
|
|
353
|
+
P && /* @__PURE__ */ m("p", {
|
|
354
|
+
role: "status",
|
|
355
|
+
children: "Comparing the exact recorded facts…"
|
|
356
|
+
}),
|
|
357
|
+
M && /* @__PURE__ */ m("p", {
|
|
358
|
+
role: "alert",
|
|
359
|
+
children: M
|
|
360
|
+
}),
|
|
361
|
+
B && /* @__PURE__ */ m(u, { value: B })
|
|
362
|
+
]
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
//#endregion
|
|
366
|
+
export { v as InvoiceForm };
|