@burdenoff/microfe-assethandler 2026.1111.1 → 2026.1111.2
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/assethandler/components/FinanceRegisterExportDialog.d.ts +6 -0
- package/dist/assethandler/components/FinanceRegisterExportDialog.js +189 -0
- package/dist/assethandler/components/FinanceRegisterExportDialog.js.map +1 -0
- package/dist/assethandler/pages/FinanceFinanceHubPage.js +146 -208
- package/dist/assethandler/pages/FinanceFinanceHubPage.js.map +1 -1
- package/dist/assethandler/utils/financeExport.d.ts +32 -0
- package/dist/assethandler/utils/financeExport.js +85 -0
- package/dist/assethandler/utils/financeExport.js.map +1 -0
- package/dist/generated/wspace-operations.d.ts +144 -0
- package/dist/generated/wspace-operations.js +301 -0
- package/dist/generated/wspace-operations.js.map +1 -0
- package/package.json +1 -1
|
@@ -9,16 +9,16 @@ import { ProgressMeter as s } from "../components/charts/ProgressMeter.js";
|
|
|
9
9
|
import { Pagination as c, usePagination as l } from "../components/Pagination.js";
|
|
10
10
|
import { StatTile as u } from "../components/StatTile.js";
|
|
11
11
|
import { ChartCard as d } from "../components/ChartCard.js";
|
|
12
|
-
import {
|
|
12
|
+
import { FinanceRegisterExportDialog as f } from "../components/FinanceRegisterExportDialog.js";
|
|
13
13
|
import "../components/index.js";
|
|
14
14
|
import { useMemo as p, useState as m } from "react";
|
|
15
15
|
import { BarChart3 as h, Check as g, DollarSign as _, Download as v, Loader2 as y, PieChart as b, Receipt as x, Search as S, TrendingDown as ee, Wallet as te, X as C } from "lucide-react";
|
|
16
16
|
import { gql as w } from "@apollo/client";
|
|
17
17
|
import { useMutation as T } from "@apollo/client/react";
|
|
18
18
|
import { Fragment as ne, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
19
|
-
import { Button as O, CTAOverflowMenu as re, GlassCard as k, GradientText as ie, IllustratedEmptyState as ae, Input as A, Label as j, NextSteps as oe, PagePurpose as se, ResponsiveDialog as M, ResponsiveDialogContent as N, ResponsiveDialogDescription as P, ResponsiveDialogFooter as F, ResponsiveDialogHeader as I, ResponsiveDialogTitle as
|
|
19
|
+
import { Button as O, CTAOverflowMenu as re, GlassCard as k, GradientText as ie, IllustratedEmptyState as ae, Input as A, Label as j, NextSteps as oe, PagePurpose as se, ResponsiveDialog as M, ResponsiveDialogContent as N, ResponsiveDialogDescription as P, ResponsiveDialogFooter as F, ResponsiveDialogHeader as I, ResponsiveDialogTitle as L, Select as R, SelectContent as z, SelectItem as B, SelectTrigger as V, SelectValue as H, Tabs as ce, TabsContent as le, TabsList as ue, TabsTrigger as de, Textarea as fe } from "@burdenoff/fe-libs/ui";
|
|
20
20
|
// src/assethandler/pages/FinanceFinanceHubPage.tsx
|
|
21
|
-
var
|
|
21
|
+
var pe = w`
|
|
22
22
|
mutation AssetHandlerCreateTransaction($input: CreateAssetTransactionInput!) {
|
|
23
23
|
createTransaction(input: $input) {
|
|
24
24
|
id
|
|
@@ -32,69 +32,69 @@ var H = w`
|
|
|
32
32
|
name
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
`,
|
|
35
|
+
`, he = w`
|
|
36
36
|
mutation AssetHandlerCreateInvoice($input: AssetHandlerCreateInvoiceInput!) {
|
|
37
37
|
createInvoice(input: $input) {
|
|
38
38
|
id
|
|
39
39
|
number
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
`,
|
|
42
|
+
`, ge = w`
|
|
43
43
|
mutation AssetHandlerHubApproveTransaction($id: ID!) {
|
|
44
44
|
approveTransaction(id: $id) {
|
|
45
45
|
id
|
|
46
46
|
status
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
`,
|
|
49
|
+
`, _e = w`
|
|
50
50
|
mutation AssetHandlerHubRejectTransaction($id: ID!, $reason: String) {
|
|
51
51
|
rejectTransaction(id: $id, reason: $reason) {
|
|
52
52
|
id
|
|
53
53
|
status
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
`,
|
|
56
|
+
`, ve = [
|
|
57
57
|
"PURCHASE",
|
|
58
58
|
"LEASE",
|
|
59
59
|
"DISPOSAL",
|
|
60
60
|
"TRANSFER",
|
|
61
61
|
"MAINTENANCE"
|
|
62
|
-
],
|
|
62
|
+
], ye = [
|
|
63
63
|
"PENDING",
|
|
64
64
|
"APPROVED",
|
|
65
65
|
"COMPLETED",
|
|
66
66
|
"REJECTED"
|
|
67
|
-
],
|
|
67
|
+
], be = [
|
|
68
68
|
"ON_TRACK",
|
|
69
69
|
"OVER_BUDGET",
|
|
70
70
|
"UNDER_BUDGET"
|
|
71
|
-
],
|
|
71
|
+
], xe = [
|
|
72
72
|
"DRAFT",
|
|
73
73
|
"SENT",
|
|
74
74
|
"PAID",
|
|
75
75
|
"OVERDUE",
|
|
76
76
|
"CANCELLED"
|
|
77
|
-
],
|
|
77
|
+
], U = (e) => e.toLowerCase().replace(/_/g, " ").replace(/^\w/, (e) => e.toUpperCase()), W = {
|
|
78
78
|
success: "bg-status-success-subtle text-status-success-text",
|
|
79
79
|
warning: "bg-status-warning-subtle text-status-warning-text",
|
|
80
80
|
error: "bg-status-error-subtle text-status-error-text",
|
|
81
81
|
info: "bg-status-info-subtle text-status-info-text",
|
|
82
82
|
neutral: "bg-bg-sunken text-text-secondary"
|
|
83
83
|
};
|
|
84
|
-
function
|
|
84
|
+
function G({ tone: e, children: t }) {
|
|
85
85
|
return /* @__PURE__ */ E("span", {
|
|
86
|
-
className: i("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium capitalize",
|
|
86
|
+
className: i("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium capitalize", W[e]),
|
|
87
87
|
children: t
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
var
|
|
90
|
+
var Se = (e) => e === "approved" || e === "completed" ? "success" : e === "rejected" ? "error" : e === "pending" ? "warning" : "neutral", Ce = (e) => e === "purchase" || e === "lease" ? "info" : e === "disposal" ? "error" : e === "maintenance" ? "warning" : "neutral", we = (e) => e === "over_budget" ? "error" : e === "under_budget" ? "success" : "info", Te = (e) => e === "paid" ? "success" : e === "overdue" ? "error" : e === "sent" ? "warning" : "neutral", K = (e) => {
|
|
91
91
|
let t = new Date(e);
|
|
92
92
|
return Number.isNaN(t.getTime()) ? e : t.toLocaleDateString();
|
|
93
93
|
};
|
|
94
|
-
function
|
|
94
|
+
function Ee({ open: t, onOpenChange: n }) {
|
|
95
95
|
let [i, a] = m("PURCHASE"), [o, s] = m("PENDING"), [c, l] = m(""), { currency: u } = e(), [d, f] = m(u), [p, h] = m(""), [g, _] = m(""), [v, b] = m(""), [x, S] = m(""), ee = () => {
|
|
96
96
|
a("PURCHASE"), s("PENDING"), l(""), f(u), h(""), _(""), b(""), S("");
|
|
97
|
-
}, [te, { loading: C }] = T(
|
|
97
|
+
}, [te, { loading: C }] = T(pe, {
|
|
98
98
|
refetchQueries: ["AssetHandlerBootstrap"],
|
|
99
99
|
onCompleted: (e) => {
|
|
100
100
|
r.success("Transaction created", `${e.createTransaction.description} was recorded.`), ee(), n(!1);
|
|
@@ -105,7 +105,7 @@ function Te({ open: t, onOpenChange: n }) {
|
|
|
105
105
|
open: t,
|
|
106
106
|
onOpenChange: n,
|
|
107
107
|
children: /* @__PURE__ */ D(N, { children: [
|
|
108
|
-
/* @__PURE__ */ D(I, { children: [/* @__PURE__ */ E(
|
|
108
|
+
/* @__PURE__ */ D(I, { children: [/* @__PURE__ */ E(L, { children: "New Transaction" }), /* @__PURE__ */ E(P, { children: "Record a workspace financial movement for the asset estate." })] }),
|
|
109
109
|
/* @__PURE__ */ D("div", {
|
|
110
110
|
className: "space-y-4",
|
|
111
111
|
children: [
|
|
@@ -113,22 +113,22 @@ function Te({ open: t, onOpenChange: n }) {
|
|
|
113
113
|
className: "grid gap-4 md:grid-cols-2",
|
|
114
114
|
children: [/* @__PURE__ */ D("div", {
|
|
115
115
|
className: "space-y-2",
|
|
116
|
-
children: [/* @__PURE__ */ E(j, { children: "Type" }), /* @__PURE__ */ D(
|
|
116
|
+
children: [/* @__PURE__ */ E(j, { children: "Type" }), /* @__PURE__ */ D(R, {
|
|
117
117
|
value: i,
|
|
118
118
|
onValueChange: (e) => a(e),
|
|
119
|
-
children: [/* @__PURE__ */ E(
|
|
119
|
+
children: [/* @__PURE__ */ E(V, { children: /* @__PURE__ */ E(H, {}) }), /* @__PURE__ */ E(z, { children: ve.map((e) => /* @__PURE__ */ E(B, {
|
|
120
120
|
value: e,
|
|
121
|
-
children:
|
|
121
|
+
children: U(e)
|
|
122
122
|
}, e)) })]
|
|
123
123
|
})]
|
|
124
124
|
}), /* @__PURE__ */ D("div", {
|
|
125
125
|
className: "space-y-2",
|
|
126
|
-
children: [/* @__PURE__ */ E(j, { children: "Status" }), /* @__PURE__ */ D(
|
|
126
|
+
children: [/* @__PURE__ */ E(j, { children: "Status" }), /* @__PURE__ */ D(R, {
|
|
127
127
|
value: o,
|
|
128
128
|
onValueChange: (e) => s(e),
|
|
129
|
-
children: [/* @__PURE__ */ E(
|
|
129
|
+
children: [/* @__PURE__ */ E(V, { children: /* @__PURE__ */ E(H, {}) }), /* @__PURE__ */ E(z, { children: ye.map((e) => /* @__PURE__ */ E(B, {
|
|
130
130
|
value: e,
|
|
131
|
-
children:
|
|
131
|
+
children: U(e)
|
|
132
132
|
}, e)) })]
|
|
133
133
|
})]
|
|
134
134
|
})]
|
|
@@ -161,7 +161,7 @@ function Te({ open: t, onOpenChange: n }) {
|
|
|
161
161
|
}),
|
|
162
162
|
/* @__PURE__ */ D("div", {
|
|
163
163
|
className: "space-y-2",
|
|
164
|
-
children: [/* @__PURE__ */ E(j, { children: "Description *" }), /* @__PURE__ */ E(
|
|
164
|
+
children: [/* @__PURE__ */ E(j, { children: "Description *" }), /* @__PURE__ */ E(fe, {
|
|
165
165
|
placeholder: "What is this transaction for?",
|
|
166
166
|
value: g,
|
|
167
167
|
onChange: (e) => _(e.target.value),
|
|
@@ -211,7 +211,7 @@ function Te({ open: t, onOpenChange: n }) {
|
|
|
211
211
|
] })
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function De({ open: e, onOpenChange: t }) {
|
|
215
215
|
let [n, i] = m(""), [a, o] = m(""), [s, c] = m(""), [l, u] = m(""), [d, f] = m(""), [p, h] = m("0"), [g, _] = m("ON_TRACK"), v = () => {
|
|
216
216
|
i(""), o(""), c(""), u(""), f(""), h("0"), _("ON_TRACK");
|
|
217
217
|
}, [b, { loading: x }] = T(me, {
|
|
@@ -225,7 +225,7 @@ function Ee({ open: e, onOpenChange: t }) {
|
|
|
225
225
|
open: e,
|
|
226
226
|
onOpenChange: t,
|
|
227
227
|
children: /* @__PURE__ */ D(N, { children: [
|
|
228
|
-
/* @__PURE__ */ D(I, { children: [/* @__PURE__ */ E(
|
|
228
|
+
/* @__PURE__ */ D(I, { children: [/* @__PURE__ */ E(L, { children: "New Budget" }), /* @__PURE__ */ E(P, { children: "Set an allocation to track departmental asset spend." })] }),
|
|
229
229
|
/* @__PURE__ */ D("div", {
|
|
230
230
|
className: "space-y-4",
|
|
231
231
|
children: [
|
|
@@ -264,12 +264,12 @@ function Ee({ open: e, onOpenChange: t }) {
|
|
|
264
264
|
})]
|
|
265
265
|
}), /* @__PURE__ */ D("div", {
|
|
266
266
|
className: "space-y-2",
|
|
267
|
-
children: [/* @__PURE__ */ E(j, { children: "Status" }), /* @__PURE__ */ D(
|
|
267
|
+
children: [/* @__PURE__ */ E(j, { children: "Status" }), /* @__PURE__ */ D(R, {
|
|
268
268
|
value: g,
|
|
269
269
|
onValueChange: (e) => _(e),
|
|
270
|
-
children: [/* @__PURE__ */ E(
|
|
270
|
+
children: [/* @__PURE__ */ E(V, { children: /* @__PURE__ */ E(H, {}) }), /* @__PURE__ */ E(z, { children: be.map((e) => /* @__PURE__ */ E(B, {
|
|
271
271
|
value: e,
|
|
272
|
-
children:
|
|
272
|
+
children: U(e)
|
|
273
273
|
}, e)) })]
|
|
274
274
|
})]
|
|
275
275
|
})]
|
|
@@ -319,10 +319,10 @@ function Ee({ open: e, onOpenChange: t }) {
|
|
|
319
319
|
] })
|
|
320
320
|
});
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function Oe({ open: t, onOpenChange: n }) {
|
|
323
323
|
let [i, a] = m(""), [o, s] = m(""), [c, l] = m(""), { currency: u } = e(), [d, f] = m(u), [p, h] = m(""), [g, _] = m(""), [v, b] = m(""), [x, S] = m("DRAFT"), ee = () => {
|
|
324
324
|
a(""), s(""), l(""), f(u), h(""), _(""), b(""), S("DRAFT");
|
|
325
|
-
}, [te, { loading: C }] = T(
|
|
325
|
+
}, [te, { loading: C }] = T(he, {
|
|
326
326
|
refetchQueries: ["AssetHandlerBootstrap"],
|
|
327
327
|
onCompleted: (e) => {
|
|
328
328
|
r.success("Invoice created", `Invoice ${e.createInvoice.number} was added.`), ee(), n(!1);
|
|
@@ -333,7 +333,7 @@ function De({ open: t, onOpenChange: n }) {
|
|
|
333
333
|
open: t,
|
|
334
334
|
onOpenChange: n,
|
|
335
335
|
children: /* @__PURE__ */ D(N, { children: [
|
|
336
|
-
/* @__PURE__ */ D(I, { children: [/* @__PURE__ */ E(
|
|
336
|
+
/* @__PURE__ */ D(I, { children: [/* @__PURE__ */ E(L, { children: "New Invoice" }), /* @__PURE__ */ E(P, { children: "Log a workspace vendor invoice for an asset purchase or service." })] }),
|
|
337
337
|
/* @__PURE__ */ D("div", {
|
|
338
338
|
className: "space-y-4",
|
|
339
339
|
children: [
|
|
@@ -400,12 +400,12 @@ function De({ open: t, onOpenChange: n }) {
|
|
|
400
400
|
})]
|
|
401
401
|
}), /* @__PURE__ */ D("div", {
|
|
402
402
|
className: "space-y-2",
|
|
403
|
-
children: [/* @__PURE__ */ E(j, { children: "Status" }), /* @__PURE__ */ D(
|
|
403
|
+
children: [/* @__PURE__ */ E(j, { children: "Status" }), /* @__PURE__ */ D(R, {
|
|
404
404
|
value: x,
|
|
405
405
|
onValueChange: (e) => S(e),
|
|
406
|
-
children: [/* @__PURE__ */ E(
|
|
406
|
+
children: [/* @__PURE__ */ E(V, { children: /* @__PURE__ */ E(H, {}) }), /* @__PURE__ */ E(z, { children: xe.map((e) => /* @__PURE__ */ E(B, {
|
|
407
407
|
value: e,
|
|
408
|
-
children:
|
|
408
|
+
children: U(e)
|
|
409
409
|
}, e)) })]
|
|
410
410
|
})]
|
|
411
411
|
})]
|
|
@@ -437,7 +437,7 @@ function De({ open: t, onOpenChange: n }) {
|
|
|
437
437
|
] })
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function ke({ txn: e, actingId: t, onApprove: n, onReject: r }) {
|
|
441
441
|
if (e.status !== "pending") return null;
|
|
442
442
|
let i = t === e.id;
|
|
443
443
|
return /* @__PURE__ */ D("div", {
|
|
@@ -463,7 +463,7 @@ function Oe({ txn: e, actingId: t, onApprove: n, onReject: r }) {
|
|
|
463
463
|
})]
|
|
464
464
|
});
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function Ae() {
|
|
467
467
|
let { currency: g, compact: y } = e(), C = (e, t) => {
|
|
468
468
|
try {
|
|
469
469
|
return new Intl.NumberFormat(void 0, {
|
|
@@ -474,7 +474,7 @@ function ke() {
|
|
|
474
474
|
} catch {
|
|
475
475
|
return `${t || g} ${e.toLocaleString()}`;
|
|
476
476
|
}
|
|
477
|
-
}, w = t(), { transactions: O, budgets: j, invoices: M } = n(), [N, P] = m(!1), [F, I] = m(!1), [
|
|
477
|
+
}, w = t(), { transactions: O, budgets: j, invoices: M } = n(), [N, P] = m(!1), [F, I] = m(!1), [L, fe] = m(!1), [pe, me] = m(!1), [he, be] = m("transactions"), [W, Ae] = m("all"), [q, je] = m("all"), [J, Me] = m(""), [Y, Ne] = m("all"), [X, Pe] = m(""), [Fe, Z] = m(null), Ie = O.filter((e) => e.amount > 0).reduce((e, t) => e + t.amount, 0), Le = O.filter((e) => e.status === "pending"), Re = j.filter((e) => e.status === "over_budget"), ze = M.filter((e) => e.status === "overdue"), Be = j.reduce((e, t) => e + t.allocated, 0), Ve = j.reduce((e, t) => e + t.spent, 0), He = M.filter((e) => e.status !== "paid" && e.status !== "cancelled").reduce((e, t) => e + t.amount, 0), Ue = M.filter((e) => e.status !== "paid" && e.status !== "cancelled").length, We = p(() => {
|
|
478
478
|
let e = /* @__PURE__ */ new Map();
|
|
479
479
|
for (let t of j) {
|
|
480
480
|
let n = t.department || "Unassigned", r = e.get(n) ?? {
|
|
@@ -487,35 +487,35 @@ function ke() {
|
|
|
487
487
|
department: e,
|
|
488
488
|
...t
|
|
489
489
|
})).sort((e, t) => t.allocated - e.allocated);
|
|
490
|
-
}, [j]),
|
|
490
|
+
}, [j]), Ge = p(() => {
|
|
491
491
|
let e = /* @__PURE__ */ new Map();
|
|
492
492
|
for (let t of O) t.amount > 0 && e.set(t.category, (e.get(t.category) ?? 0) + t.amount);
|
|
493
493
|
return Array.from(e, ([e, t]) => ({
|
|
494
|
-
name:
|
|
494
|
+
name: U(e),
|
|
495
495
|
value: t
|
|
496
496
|
})).sort((e, t) => t.value - e.value);
|
|
497
|
-
}, [O]),
|
|
497
|
+
}, [O]), Ke = We.length > 0 || Ge.length > 0, qe = p(() => {
|
|
498
498
|
let e = J.trim().toLowerCase();
|
|
499
|
-
return O.filter((t) => !(
|
|
499
|
+
return O.filter((t) => !(W !== "all" && t.status !== W || q !== "all" && t.type !== q || e && !`${t.description} ${t.department} ${t.vendor ?? ""} ${t.id}`.toLowerCase().includes(e)));
|
|
500
500
|
}, [
|
|
501
501
|
O,
|
|
502
|
-
|
|
503
|
-
|
|
502
|
+
W,
|
|
503
|
+
q,
|
|
504
504
|
J
|
|
505
|
-
]),
|
|
505
|
+
]), Je = p(() => {
|
|
506
506
|
let e = X.trim().toLowerCase();
|
|
507
507
|
return M.filter((t) => !(Y !== "all" && t.status !== Y || e && !`${t.number} ${t.vendor}`.toLowerCase().includes(e)));
|
|
508
508
|
}, [
|
|
509
509
|
M,
|
|
510
510
|
Y,
|
|
511
511
|
X
|
|
512
|
-
]), Q = l(
|
|
512
|
+
]), Q = l(qe, {
|
|
513
513
|
pageSize: 10,
|
|
514
|
-
resetKey: `${
|
|
515
|
-
}), $ = l(
|
|
514
|
+
resetKey: `${W}|${q}|${J}`
|
|
515
|
+
}), $ = l(Je, {
|
|
516
516
|
pageSize: 10,
|
|
517
517
|
resetKey: `${Y}|${X}`
|
|
518
|
-
}), [
|
|
518
|
+
}), [Ye] = T(ge, {
|
|
519
519
|
refetchQueries: ["AssetHandlerBootstrap"],
|
|
520
520
|
onCompleted: () => {
|
|
521
521
|
r.success("Transaction approved", "The transaction has been approved."), Z(null);
|
|
@@ -523,7 +523,7 @@ function ke() {
|
|
|
523
523
|
onError: (e) => {
|
|
524
524
|
r.error("Could not approve transaction", e.message), Z(null);
|
|
525
525
|
}
|
|
526
|
-
}), [
|
|
526
|
+
}), [Xe] = T(_e, {
|
|
527
527
|
refetchQueries: ["AssetHandlerBootstrap"],
|
|
528
528
|
onCompleted: () => {
|
|
529
529
|
r.success("Transaction rejected", "The transaction has been rejected."), Z(null);
|
|
@@ -531,10 +531,10 @@ function ke() {
|
|
|
531
531
|
onError: (e) => {
|
|
532
532
|
r.error("Could not reject transaction", e.message), Z(null);
|
|
533
533
|
}
|
|
534
|
-
}),
|
|
535
|
-
Z(e),
|
|
536
|
-
},
|
|
537
|
-
Z(e),
|
|
534
|
+
}), Ze = (e) => {
|
|
535
|
+
Z(e), Ye({ variables: { id: e } });
|
|
536
|
+
}, Qe = (e) => {
|
|
537
|
+
Z(e), Xe({ variables: {
|
|
538
538
|
id: e,
|
|
539
539
|
reason: null
|
|
540
540
|
} });
|
|
@@ -562,94 +562,32 @@ function ke() {
|
|
|
562
562
|
},
|
|
563
563
|
{
|
|
564
564
|
label: "New Invoice",
|
|
565
|
-
onSelect: () =>
|
|
565
|
+
onSelect: () => fe(!0)
|
|
566
566
|
},
|
|
567
567
|
{
|
|
568
568
|
label: "Export",
|
|
569
|
-
onSelect: () =>
|
|
570
|
-
let e = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
571
|
-
if (H === "budgets") {
|
|
572
|
-
if (j.length === 0) {
|
|
573
|
-
r.warning("Nothing to export", "There are no budgets to export yet.");
|
|
574
|
-
return;
|
|
575
|
-
}
|
|
576
|
-
f(`budgets-${e}`, [
|
|
577
|
-
"Name",
|
|
578
|
-
"Department",
|
|
579
|
-
"Category",
|
|
580
|
-
"Period",
|
|
581
|
-
"Allocated",
|
|
582
|
-
"Spent",
|
|
583
|
-
"Remaining",
|
|
584
|
-
"Status"
|
|
585
|
-
], j.map((e) => [
|
|
586
|
-
e.name,
|
|
587
|
-
e.department,
|
|
588
|
-
e.category,
|
|
589
|
-
e.period,
|
|
590
|
-
e.allocated,
|
|
591
|
-
e.spent,
|
|
592
|
-
e.remaining,
|
|
593
|
-
e.status
|
|
594
|
-
]));
|
|
595
|
-
} else if (H === "invoices") {
|
|
596
|
-
if (M.length === 0) {
|
|
597
|
-
r.warning("Nothing to export", "There are no invoices to export yet.");
|
|
598
|
-
return;
|
|
599
|
-
}
|
|
600
|
-
f(`invoices-${e}`, [
|
|
601
|
-
"Invoice #",
|
|
602
|
-
"Vendor",
|
|
603
|
-
"Amount",
|
|
604
|
-
"Currency",
|
|
605
|
-
"Issue Date",
|
|
606
|
-
"Due Date",
|
|
607
|
-
"Status"
|
|
608
|
-
], M.map((e) => [
|
|
609
|
-
e.number,
|
|
610
|
-
e.vendor,
|
|
611
|
-
e.amount,
|
|
612
|
-
e.currency,
|
|
613
|
-
e.issueDate,
|
|
614
|
-
e.dueDate,
|
|
615
|
-
e.status
|
|
616
|
-
]));
|
|
617
|
-
} else O.length === 0 ? r.warning("Nothing to export", "There are no transactions to export yet.") : f(`transactions-${e}`, [
|
|
618
|
-
"ID",
|
|
619
|
-
"Type",
|
|
620
|
-
"Description",
|
|
621
|
-
"Department",
|
|
622
|
-
"Amount",
|
|
623
|
-
"Currency",
|
|
624
|
-
"Status",
|
|
625
|
-
"Date"
|
|
626
|
-
], O.map((e) => [
|
|
627
|
-
e.id,
|
|
628
|
-
e.type,
|
|
629
|
-
e.description,
|
|
630
|
-
e.department,
|
|
631
|
-
e.amount,
|
|
632
|
-
e.currency,
|
|
633
|
-
e.status,
|
|
634
|
-
e.date
|
|
635
|
-
]));
|
|
636
|
-
},
|
|
569
|
+
onSelect: () => me(!0),
|
|
637
570
|
icon: /* @__PURE__ */ E(v, { className: "h-4 w-4" })
|
|
638
571
|
}
|
|
639
572
|
]
|
|
640
573
|
})]
|
|
641
574
|
}),
|
|
642
|
-
/* @__PURE__ */ E(
|
|
575
|
+
/* @__PURE__ */ E(Ee, {
|
|
643
576
|
open: N,
|
|
644
577
|
onOpenChange: P
|
|
645
578
|
}),
|
|
646
|
-
/* @__PURE__ */ E(
|
|
579
|
+
/* @__PURE__ */ E(De, {
|
|
647
580
|
open: F,
|
|
648
581
|
onOpenChange: I
|
|
649
582
|
}),
|
|
650
|
-
/* @__PURE__ */ E(
|
|
651
|
-
open:
|
|
652
|
-
onOpenChange:
|
|
583
|
+
/* @__PURE__ */ E(Oe, {
|
|
584
|
+
open: L,
|
|
585
|
+
onOpenChange: fe
|
|
586
|
+
}),
|
|
587
|
+
/* @__PURE__ */ E(f, {
|
|
588
|
+
open: pe,
|
|
589
|
+
onOpenChange: me,
|
|
590
|
+
register: he
|
|
653
591
|
}),
|
|
654
592
|
/* @__PURE__ */ E(se, { children: "The workspace money view for your asset estate: record transactions, maintain departmental budget totals, and stay on top of vendor invoices. Transactions do not automatically update budgets, and these records are not yet allocated to an individual asset." }),
|
|
655
593
|
/* @__PURE__ */ E(oe, {
|
|
@@ -680,47 +618,47 @@ function ke() {
|
|
|
680
618
|
children: [
|
|
681
619
|
/* @__PURE__ */ E(u, {
|
|
682
620
|
label: "Total Spend",
|
|
683
|
-
value:
|
|
621
|
+
value: Ie,
|
|
684
622
|
format: (e) => C(e),
|
|
685
623
|
icon: _,
|
|
686
624
|
hero: !0,
|
|
687
|
-
delta: `${
|
|
625
|
+
delta: `${Le.length} pending`,
|
|
688
626
|
deltaTone: "neutral"
|
|
689
627
|
}),
|
|
690
628
|
/* @__PURE__ */ E(u, {
|
|
691
629
|
label: "Budget Allocated",
|
|
692
|
-
value:
|
|
630
|
+
value: Be,
|
|
693
631
|
format: (e) => C(e),
|
|
694
632
|
icon: te
|
|
695
633
|
}),
|
|
696
634
|
/* @__PURE__ */ E(u, {
|
|
697
635
|
label: "Budget Spent",
|
|
698
|
-
value:
|
|
636
|
+
value: Ve,
|
|
699
637
|
format: (e) => C(e),
|
|
700
638
|
icon: ee,
|
|
701
|
-
delta:
|
|
639
|
+
delta: Re.length > 0 ? `${Re.length} over` : void 0,
|
|
702
640
|
deltaTone: "negative",
|
|
703
|
-
deltaDirection:
|
|
641
|
+
deltaDirection: Re.length > 0 ? "up" : "neutral"
|
|
704
642
|
}),
|
|
705
643
|
/* @__PURE__ */ E(u, {
|
|
706
644
|
label: "Invoices Outstanding",
|
|
707
|
-
value:
|
|
645
|
+
value: He,
|
|
708
646
|
format: (e) => C(e),
|
|
709
647
|
icon: x,
|
|
710
|
-
delta:
|
|
711
|
-
deltaTone:
|
|
648
|
+
delta: ze.length > 0 ? `${ze.length} overdue` : Ue > 0 ? `${Ue} open` : void 0,
|
|
649
|
+
deltaTone: ze.length > 0 ? "negative" : "neutral",
|
|
712
650
|
deltaDirection: "neutral"
|
|
713
651
|
})
|
|
714
652
|
]
|
|
715
653
|
}),
|
|
716
|
-
|
|
654
|
+
Ke ? /* @__PURE__ */ D("div", {
|
|
717
655
|
className: "grid gap-4 lg:grid-cols-2",
|
|
718
|
-
children: [
|
|
656
|
+
children: [We.length > 0 ? /* @__PURE__ */ E(d, {
|
|
719
657
|
title: "Budget vs spend",
|
|
720
658
|
subtitle: "Allocated against actual spend by department",
|
|
721
659
|
icon: h,
|
|
722
660
|
children: /* @__PURE__ */ E(a, {
|
|
723
|
-
data:
|
|
661
|
+
data: We,
|
|
724
662
|
xKey: "department",
|
|
725
663
|
series: [{
|
|
726
664
|
key: "allocated",
|
|
@@ -733,40 +671,40 @@ function ke() {
|
|
|
733
671
|
valueFormat: y,
|
|
734
672
|
ariaLabel: "Budget allocated versus spent by department"
|
|
735
673
|
})
|
|
736
|
-
}) : null,
|
|
674
|
+
}) : null, Ge.length > 0 ? /* @__PURE__ */ E(d, {
|
|
737
675
|
title: "Spend by category",
|
|
738
676
|
subtitle: "Recorded transaction spend, grouped by category",
|
|
739
677
|
icon: b,
|
|
740
678
|
children: /* @__PURE__ */ E(o, {
|
|
741
|
-
data:
|
|
679
|
+
data: Ge,
|
|
742
680
|
centerLabel: "Total spend",
|
|
743
|
-
centerValue:
|
|
681
|
+
centerValue: Ie,
|
|
744
682
|
valueFormat: (e) => C(e),
|
|
745
683
|
height: 260,
|
|
746
684
|
ariaLabel: "Transaction spend by category"
|
|
747
685
|
})
|
|
748
686
|
}) : null]
|
|
749
687
|
}) : null,
|
|
750
|
-
/* @__PURE__ */ D(
|
|
751
|
-
value:
|
|
752
|
-
onValueChange: (e) =>
|
|
688
|
+
/* @__PURE__ */ D(ce, {
|
|
689
|
+
value: he,
|
|
690
|
+
onValueChange: (e) => be(e),
|
|
753
691
|
className: "space-y-4",
|
|
754
692
|
children: [
|
|
755
|
-
/* @__PURE__ */ D(
|
|
756
|
-
/* @__PURE__ */ E(
|
|
693
|
+
/* @__PURE__ */ D(ue, { children: [
|
|
694
|
+
/* @__PURE__ */ E(de, {
|
|
757
695
|
value: "transactions",
|
|
758
696
|
children: "Transactions"
|
|
759
697
|
}),
|
|
760
|
-
/* @__PURE__ */ E(
|
|
698
|
+
/* @__PURE__ */ E(de, {
|
|
761
699
|
value: "budgets",
|
|
762
700
|
children: "Budgets"
|
|
763
701
|
}),
|
|
764
|
-
/* @__PURE__ */ E(
|
|
702
|
+
/* @__PURE__ */ E(de, {
|
|
765
703
|
value: "invoices",
|
|
766
704
|
children: "Invoices"
|
|
767
705
|
})
|
|
768
706
|
] }),
|
|
769
|
-
/* @__PURE__ */ E(
|
|
707
|
+
/* @__PURE__ */ E(le, {
|
|
770
708
|
value: "transactions",
|
|
771
709
|
className: "space-y-4",
|
|
772
710
|
children: O.length === 0 ? /* @__PURE__ */ E(ae, {
|
|
@@ -780,41 +718,41 @@ function ke() {
|
|
|
780
718
|
className: "relative flex-1",
|
|
781
719
|
children: [/* @__PURE__ */ E(S, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-muted" }), /* @__PURE__ */ E(A, {
|
|
782
720
|
value: J,
|
|
783
|
-
onChange: (e) =>
|
|
721
|
+
onChange: (e) => Me(e.target.value),
|
|
784
722
|
placeholder: "Search description, vendor or department",
|
|
785
723
|
className: "pl-9"
|
|
786
724
|
})]
|
|
787
725
|
}),
|
|
788
|
-
/* @__PURE__ */ D(
|
|
789
|
-
value:
|
|
790
|
-
onValueChange:
|
|
791
|
-
children: [/* @__PURE__ */ E(
|
|
726
|
+
/* @__PURE__ */ D(R, {
|
|
727
|
+
value: W,
|
|
728
|
+
onValueChange: Ae,
|
|
729
|
+
children: [/* @__PURE__ */ E(V, {
|
|
792
730
|
className: "w-full sm:w-40",
|
|
793
|
-
children: /* @__PURE__ */ E(
|
|
794
|
-
}), /* @__PURE__ */ D(
|
|
731
|
+
children: /* @__PURE__ */ E(H, { placeholder: "Status" })
|
|
732
|
+
}), /* @__PURE__ */ D(z, { children: [/* @__PURE__ */ E(B, {
|
|
795
733
|
value: "all",
|
|
796
734
|
children: "All statuses"
|
|
797
|
-
}),
|
|
735
|
+
}), ye.map((e) => /* @__PURE__ */ E(B, {
|
|
798
736
|
value: e.toLowerCase(),
|
|
799
|
-
children:
|
|
737
|
+
children: U(e)
|
|
800
738
|
}, e))] })]
|
|
801
739
|
}),
|
|
802
|
-
/* @__PURE__ */ D(
|
|
803
|
-
value:
|
|
804
|
-
onValueChange:
|
|
805
|
-
children: [/* @__PURE__ */ E(
|
|
740
|
+
/* @__PURE__ */ D(R, {
|
|
741
|
+
value: q,
|
|
742
|
+
onValueChange: je,
|
|
743
|
+
children: [/* @__PURE__ */ E(V, {
|
|
806
744
|
className: "w-full sm:w-40",
|
|
807
|
-
children: /* @__PURE__ */ E(
|
|
808
|
-
}), /* @__PURE__ */ D(
|
|
745
|
+
children: /* @__PURE__ */ E(H, { placeholder: "Type" })
|
|
746
|
+
}), /* @__PURE__ */ D(z, { children: [/* @__PURE__ */ E(B, {
|
|
809
747
|
value: "all",
|
|
810
748
|
children: "All types"
|
|
811
|
-
}),
|
|
749
|
+
}), ve.map((e) => /* @__PURE__ */ E(B, {
|
|
812
750
|
value: e.toLowerCase(),
|
|
813
|
-
children:
|
|
751
|
+
children: U(e)
|
|
814
752
|
}, e))] })]
|
|
815
753
|
})
|
|
816
754
|
]
|
|
817
|
-
}),
|
|
755
|
+
}), qe.length === 0 ? /* @__PURE__ */ E(k, {
|
|
818
756
|
treatment: "glass",
|
|
819
757
|
className: "border-border-seam",
|
|
820
758
|
children: /* @__PURE__ */ E("p", {
|
|
@@ -867,8 +805,8 @@ function ke() {
|
|
|
867
805
|
children: [
|
|
868
806
|
/* @__PURE__ */ E("td", {
|
|
869
807
|
className: "p-3",
|
|
870
|
-
children: /* @__PURE__ */ E(
|
|
871
|
-
tone:
|
|
808
|
+
children: /* @__PURE__ */ E(G, {
|
|
809
|
+
tone: Ce(e.type),
|
|
872
810
|
children: e.type
|
|
873
811
|
})
|
|
874
812
|
}),
|
|
@@ -887,24 +825,24 @@ function ke() {
|
|
|
887
825
|
}),
|
|
888
826
|
/* @__PURE__ */ E("td", {
|
|
889
827
|
className: "p-3",
|
|
890
|
-
children: /* @__PURE__ */ E(
|
|
891
|
-
tone:
|
|
828
|
+
children: /* @__PURE__ */ E(G, {
|
|
829
|
+
tone: Se(e.status),
|
|
892
830
|
children: e.status
|
|
893
831
|
})
|
|
894
832
|
}),
|
|
895
833
|
/* @__PURE__ */ E("td", {
|
|
896
834
|
className: "p-3 text-xs text-text-secondary",
|
|
897
|
-
children:
|
|
835
|
+
children: K(e.date)
|
|
898
836
|
}),
|
|
899
837
|
/* @__PURE__ */ E("td", {
|
|
900
838
|
className: "p-3",
|
|
901
839
|
children: /* @__PURE__ */ E("div", {
|
|
902
840
|
className: "flex justify-end",
|
|
903
|
-
children: /* @__PURE__ */ E(
|
|
841
|
+
children: /* @__PURE__ */ E(ke, {
|
|
904
842
|
txn: e,
|
|
905
|
-
actingId:
|
|
906
|
-
onApprove:
|
|
907
|
-
onReject:
|
|
843
|
+
actingId: Fe,
|
|
844
|
+
onApprove: Ze,
|
|
845
|
+
onReject: Qe
|
|
908
846
|
})
|
|
909
847
|
})
|
|
910
848
|
})
|
|
@@ -932,12 +870,12 @@ function ke() {
|
|
|
932
870
|
/* @__PURE__ */ D("div", {
|
|
933
871
|
className: "mt-2 flex flex-wrap items-center gap-2",
|
|
934
872
|
children: [
|
|
935
|
-
/* @__PURE__ */ E(
|
|
936
|
-
tone:
|
|
873
|
+
/* @__PURE__ */ E(G, {
|
|
874
|
+
tone: Ce(e.type),
|
|
937
875
|
children: e.type
|
|
938
876
|
}),
|
|
939
|
-
/* @__PURE__ */ E(
|
|
940
|
-
tone:
|
|
877
|
+
/* @__PURE__ */ E(G, {
|
|
878
|
+
tone: Se(e.status),
|
|
941
879
|
children: e.status
|
|
942
880
|
}),
|
|
943
881
|
/* @__PURE__ */ D("span", {
|
|
@@ -945,18 +883,18 @@ function ke() {
|
|
|
945
883
|
children: [
|
|
946
884
|
e.department,
|
|
947
885
|
" · ",
|
|
948
|
-
|
|
886
|
+
K(e.date)
|
|
949
887
|
]
|
|
950
888
|
})
|
|
951
889
|
]
|
|
952
890
|
}),
|
|
953
891
|
e.status === "pending" ? /* @__PURE__ */ E("div", {
|
|
954
892
|
className: "mt-3",
|
|
955
|
-
children: /* @__PURE__ */ E(
|
|
893
|
+
children: /* @__PURE__ */ E(ke, {
|
|
956
894
|
txn: e,
|
|
957
|
-
actingId:
|
|
958
|
-
onApprove:
|
|
959
|
-
onReject:
|
|
895
|
+
actingId: Fe,
|
|
896
|
+
onApprove: Ze,
|
|
897
|
+
onReject: Qe
|
|
960
898
|
})
|
|
961
899
|
}) : null
|
|
962
900
|
]
|
|
@@ -980,7 +918,7 @@ function ke() {
|
|
|
980
918
|
]
|
|
981
919
|
})] })
|
|
982
920
|
}),
|
|
983
|
-
/* @__PURE__ */ E(
|
|
921
|
+
/* @__PURE__ */ E(le, {
|
|
984
922
|
value: "budgets",
|
|
985
923
|
className: "space-y-4",
|
|
986
924
|
children: j.length === 0 ? /* @__PURE__ */ E(ae, {
|
|
@@ -1015,8 +953,8 @@ function ke() {
|
|
|
1015
953
|
e.period
|
|
1016
954
|
]
|
|
1017
955
|
})]
|
|
1018
|
-
}), /* @__PURE__ */ E(
|
|
1019
|
-
tone:
|
|
956
|
+
}), /* @__PURE__ */ E(G, {
|
|
957
|
+
tone: we(e.status),
|
|
1020
958
|
children: e.status.replace(/_/g, " ")
|
|
1021
959
|
})]
|
|
1022
960
|
}), /* @__PURE__ */ D("div", {
|
|
@@ -1058,7 +996,7 @@ function ke() {
|
|
|
1058
996
|
}, e.id))
|
|
1059
997
|
})
|
|
1060
998
|
}),
|
|
1061
|
-
/* @__PURE__ */ E(
|
|
999
|
+
/* @__PURE__ */ E(le, {
|
|
1062
1000
|
value: "invoices",
|
|
1063
1001
|
className: "space-y-4",
|
|
1064
1002
|
children: M.length === 0 ? /* @__PURE__ */ E(ae, {
|
|
@@ -1071,25 +1009,25 @@ function ke() {
|
|
|
1071
1009
|
className: "relative flex-1",
|
|
1072
1010
|
children: [/* @__PURE__ */ E(S, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-muted" }), /* @__PURE__ */ E(A, {
|
|
1073
1011
|
value: X,
|
|
1074
|
-
onChange: (e) =>
|
|
1012
|
+
onChange: (e) => Pe(e.target.value),
|
|
1075
1013
|
placeholder: "Search invoice number or vendor",
|
|
1076
1014
|
className: "pl-9"
|
|
1077
1015
|
})]
|
|
1078
|
-
}), /* @__PURE__ */ D(
|
|
1016
|
+
}), /* @__PURE__ */ D(R, {
|
|
1079
1017
|
value: Y,
|
|
1080
|
-
onValueChange:
|
|
1081
|
-
children: [/* @__PURE__ */ E(
|
|
1018
|
+
onValueChange: Ne,
|
|
1019
|
+
children: [/* @__PURE__ */ E(V, {
|
|
1082
1020
|
className: "w-full sm:w-40",
|
|
1083
|
-
children: /* @__PURE__ */ E(
|
|
1084
|
-
}), /* @__PURE__ */ D(
|
|
1021
|
+
children: /* @__PURE__ */ E(H, { placeholder: "Status" })
|
|
1022
|
+
}), /* @__PURE__ */ D(z, { children: [/* @__PURE__ */ E(B, {
|
|
1085
1023
|
value: "all",
|
|
1086
1024
|
children: "All statuses"
|
|
1087
|
-
}),
|
|
1025
|
+
}), xe.map((e) => /* @__PURE__ */ E(B, {
|
|
1088
1026
|
value: e.toLowerCase(),
|
|
1089
|
-
children:
|
|
1027
|
+
children: U(e)
|
|
1090
1028
|
}, e))] })]
|
|
1091
1029
|
})]
|
|
1092
|
-
}),
|
|
1030
|
+
}), Je.length === 0 ? /* @__PURE__ */ E(k, {
|
|
1093
1031
|
treatment: "glass",
|
|
1094
1032
|
className: "border-border-seam",
|
|
1095
1033
|
children: /* @__PURE__ */ E("p", {
|
|
@@ -1150,16 +1088,16 @@ function ke() {
|
|
|
1150
1088
|
}),
|
|
1151
1089
|
/* @__PURE__ */ E("td", {
|
|
1152
1090
|
className: "p-3 text-xs text-text-secondary",
|
|
1153
|
-
children:
|
|
1091
|
+
children: K(e.issueDate)
|
|
1154
1092
|
}),
|
|
1155
1093
|
/* @__PURE__ */ E("td", {
|
|
1156
1094
|
className: "p-3 text-xs text-text-secondary",
|
|
1157
|
-
children:
|
|
1095
|
+
children: K(e.dueDate)
|
|
1158
1096
|
}),
|
|
1159
1097
|
/* @__PURE__ */ E("td", {
|
|
1160
1098
|
className: "p-3",
|
|
1161
|
-
children: /* @__PURE__ */ E(
|
|
1162
|
-
tone:
|
|
1099
|
+
children: /* @__PURE__ */ E(G, {
|
|
1100
|
+
tone: Te(e.status),
|
|
1163
1101
|
children: e.status
|
|
1164
1102
|
})
|
|
1165
1103
|
})
|
|
@@ -1190,12 +1128,12 @@ function ke() {
|
|
|
1190
1128
|
})]
|
|
1191
1129
|
}), /* @__PURE__ */ D("div", {
|
|
1192
1130
|
className: "mt-2 flex flex-wrap items-center gap-2",
|
|
1193
|
-
children: [/* @__PURE__ */ E(
|
|
1194
|
-
tone:
|
|
1131
|
+
children: [/* @__PURE__ */ E(G, {
|
|
1132
|
+
tone: Te(e.status),
|
|
1195
1133
|
children: e.status
|
|
1196
1134
|
}), /* @__PURE__ */ D("span", {
|
|
1197
1135
|
className: "text-xs text-text-secondary",
|
|
1198
|
-
children: ["Due ",
|
|
1136
|
+
children: ["Due ", K(e.dueDate)]
|
|
1199
1137
|
})]
|
|
1200
1138
|
})]
|
|
1201
1139
|
}, e.id))
|
|
@@ -1223,6 +1161,6 @@ function ke() {
|
|
|
1223
1161
|
]
|
|
1224
1162
|
});
|
|
1225
1163
|
}
|
|
1226
|
-
export {
|
|
1164
|
+
export { pe as CREATE_TRANSACTION_MUTATION, Ae as FinanceFinanceHubPage };
|
|
1227
1165
|
|
|
1228
1166
|
//# sourceMappingURL=FinanceFinanceHubPage.js.map
|