@burdenoff/microfe-proserviceworld 2026.1014.1 → 2026.1015.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/proserviceworld/hooks/useProServiceWorldApi.d.ts +8 -0
- package/dist/proserviceworld/hooks/useProServiceWorldApi.d.ts.map +1 -1
- package/dist/proserviceworld/hooks/useProServiceWorldApi.js +21 -13
- package/dist/proserviceworld/hooks/useProServiceWorldApi.js.map +1 -1
- package/dist/proserviceworld/pages/CompliancePage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/CompliancePage.js +136 -118
- package/dist/proserviceworld/pages/CompliancePage.js.map +1 -1
- package/dist/proserviceworld/pages/ConflictsPage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/ConflictsPage.js +87 -71
- package/dist/proserviceworld/pages/ConflictsPage.js.map +1 -1
- package/dist/proserviceworld/pages/DocumentsPage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/DocumentsPage.js +104 -86
- package/dist/proserviceworld/pages/DocumentsPage.js.map +1 -1
- package/dist/proserviceworld/pages/InvoicesPage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/InvoicesPage.js +122 -104
- package/dist/proserviceworld/pages/InvoicesPage.js.map +1 -1
- package/dist/proserviceworld/pages/TimePage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/TimePage.js +132 -114
- package/dist/proserviceworld/pages/TimePage.js.map +1 -1
- package/dist/proserviceworld/pages/TrustPage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/TrustPage.js +226 -207
- package/dist/proserviceworld/pages/TrustPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,55 +1,59 @@
|
|
|
1
1
|
import { useClients as e, useCreateTrustAccount as t, useCreateTrustTransfer as n, useReconcileTrustAccount as r, useRecordTrustDeposit as i, useRecordTrustWithdrawal as a, useTrustAccounts as o, useTrustClientBalance as s, useTrustTransactions as c } from "../hooks/useProServiceWorldApi.js";
|
|
2
2
|
import { cn as l } from "../utils/cn.js";
|
|
3
|
-
import { Banner as u, Empty as d, ErrorState as f, Field as p, LoadingBlock as m, MetricCard as h, Modal as g, NativeSelect as _, PageHeader as v, SectionCard as y, StatusPill as b, TableWrap as x, Td as S, TextArea as C, TextInput as w, Th as T, fmtDate as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { Banner as u, Empty as d, ErrorState as f, Field as p, LoadingBlock as m, MetricCard as h, Modal as g, NativeSelect as _, PageHeader as v, SectionCard as y, StatusPill as b, TableWrap as x, Td as S, TextArea as C, TextInput as w, Th as T, fmtDate as ee, fmtMoney as E } from "../components/ui.js";
|
|
4
|
+
import { useAnalytics as D } from "../hooks/useAnalytics.js";
|
|
5
|
+
import { useDeferredValue as O, useMemo as k, useState as A } from "react";
|
|
6
|
+
import { ArrowDownCircle as j, ArrowUpCircle as te, ClipboardCheck as M, Plus as N, Repeat as ne, Search as re, ShieldAlert as ie, Wallet as P } from "lucide-react";
|
|
7
|
+
import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
8
|
+
import { Button as R } from "@burdenoff/fe-libs/ui";
|
|
8
9
|
//#region src/proserviceworld/pages/TrustPage.tsx
|
|
9
|
-
var
|
|
10
|
-
let [t, n] =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
var z = () => {
|
|
11
|
+
let [t, n] = A(""), [r, i] = A(""), [a, p] = A(""), g = O(a), [C, z] = A(null), [W, G] = A(null), [K, ae] = A(null), { emitFact: oe } = D(), q = o(), J = e({ pagination: { limit: 100 } }), Y = k(() => new Map((J.data?.items ?? []).map((e) => [e.id, e.name])), [J.data]), X = t || q.data?.items[0]?.id || "", Z = c({
|
|
12
|
+
trustAccountId: X || void 0,
|
|
13
|
+
search: g.trim() || void 0
|
|
14
|
+
}), Q = s(X || void 0, r || void 0);
|
|
15
|
+
if (q.isLoading) return /* @__PURE__ */ I(m, {});
|
|
16
|
+
if (q.error) return /* @__PURE__ */ I(f, {
|
|
17
|
+
error: q.error,
|
|
18
|
+
onRetry: () => void q.refetch()
|
|
15
19
|
});
|
|
16
|
-
let
|
|
17
|
-
return /* @__PURE__ */
|
|
20
|
+
let $ = q.data?.items.find((e) => e.id === X);
|
|
21
|
+
return /* @__PURE__ */ L("div", {
|
|
18
22
|
className: "space-y-6",
|
|
19
23
|
children: [
|
|
20
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ I(v, {
|
|
21
25
|
title: "Trust Accounting",
|
|
22
26
|
subtitle: "IOLTA-style trust ledger — client funds held separately from the firm's operating money, reconciled against the bank statement.",
|
|
23
|
-
icon: /* @__PURE__ */
|
|
24
|
-
actions: /* @__PURE__ */
|
|
25
|
-
onClick: () =>
|
|
26
|
-
children: [/* @__PURE__ */
|
|
27
|
+
icon: /* @__PURE__ */ I(P, { className: "h-6 w-6" }),
|
|
28
|
+
actions: /* @__PURE__ */ L(R, {
|
|
29
|
+
onClick: () => z("account"),
|
|
30
|
+
children: [/* @__PURE__ */ I(N, { className: "mr-1.5 h-4 w-4" }), "New trust account"]
|
|
27
31
|
})
|
|
28
32
|
}),
|
|
29
|
-
|
|
30
|
-
tone:
|
|
31
|
-
onClose: () =>
|
|
32
|
-
children:
|
|
33
|
+
W && /* @__PURE__ */ I(u, {
|
|
34
|
+
tone: W.tone,
|
|
35
|
+
onClose: () => G(null),
|
|
36
|
+
children: W.text
|
|
33
37
|
}),
|
|
34
|
-
!
|
|
38
|
+
!q.data || q.data.items.length === 0 ? /* @__PURE__ */ I(d, {
|
|
35
39
|
title: "No trust accounts yet",
|
|
36
40
|
description: "Open a trust (IOLTA) account to start holding client funds separately from operating money.",
|
|
37
|
-
icon: /* @__PURE__ */
|
|
38
|
-
action: /* @__PURE__ */
|
|
39
|
-
onClick: () =>
|
|
40
|
-
children: [/* @__PURE__ */
|
|
41
|
+
icon: /* @__PURE__ */ I(P, { className: "h-8 w-8" }),
|
|
42
|
+
action: /* @__PURE__ */ L(R, {
|
|
43
|
+
onClick: () => z("account"),
|
|
44
|
+
children: [/* @__PURE__ */ I(N, { className: "mr-1.5 h-4 w-4" }), "New trust account"]
|
|
41
45
|
})
|
|
42
|
-
}) : /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
46
|
+
}) : /* @__PURE__ */ L(F, { children: [
|
|
47
|
+
/* @__PURE__ */ L("div", {
|
|
44
48
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
45
|
-
children: [/* @__PURE__ */
|
|
49
|
+
children: [/* @__PURE__ */ L("div", {
|
|
46
50
|
className: "flex flex-wrap items-center gap-2",
|
|
47
51
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
value:
|
|
52
|
+
/* @__PURE__ */ I(_, {
|
|
53
|
+
value: X,
|
|
50
54
|
onChange: (e) => n(e.target.value),
|
|
51
55
|
className: "sm:w-64",
|
|
52
|
-
children:
|
|
56
|
+
children: q.data.items.map((e) => /* @__PURE__ */ L("option", {
|
|
53
57
|
value: e.id,
|
|
54
58
|
children: [
|
|
55
59
|
e.name,
|
|
@@ -58,244 +62,259 @@ var V = () => {
|
|
|
58
62
|
]
|
|
59
63
|
}, e.id))
|
|
60
64
|
}),
|
|
61
|
-
|
|
62
|
-
/* @__PURE__ */
|
|
65
|
+
$ && /* @__PURE__ */ I(b, { status: $.status }),
|
|
66
|
+
/* @__PURE__ */ L(_, {
|
|
63
67
|
value: r,
|
|
64
68
|
onChange: (e) => i(e.target.value),
|
|
65
69
|
className: "sm:w-56",
|
|
66
|
-
children: [/* @__PURE__ */
|
|
70
|
+
children: [/* @__PURE__ */ I("option", {
|
|
67
71
|
value: "",
|
|
68
72
|
children: "All clients"
|
|
69
|
-
}),
|
|
73
|
+
}), J.data?.items.map((e) => /* @__PURE__ */ I("option", {
|
|
70
74
|
value: e.id,
|
|
71
75
|
children: e.name
|
|
72
76
|
}, e.id))]
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ L("div", {
|
|
79
|
+
className: "relative w-full sm:w-64",
|
|
80
|
+
children: [/* @__PURE__ */ I(re, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-tertiary" }), /* @__PURE__ */ I(w, {
|
|
81
|
+
placeholder: "Search ledger…",
|
|
82
|
+
value: a,
|
|
83
|
+
onChange: (e) => p(e.target.value),
|
|
84
|
+
onKeyDown: (e) => {
|
|
85
|
+
e.key === "Enter" && a.trim() && oe("psw.search.performed", {
|
|
86
|
+
entityType: "trust-transaction",
|
|
87
|
+
queryLength: a.trim().length
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
className: "pl-9"
|
|
91
|
+
})]
|
|
73
92
|
})
|
|
74
93
|
]
|
|
75
|
-
}), /* @__PURE__ */
|
|
94
|
+
}), /* @__PURE__ */ L("div", {
|
|
76
95
|
className: "flex flex-wrap gap-2",
|
|
77
96
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ L(R, {
|
|
79
98
|
variant: "outline",
|
|
80
99
|
size: "sm",
|
|
81
|
-
onClick: () =>
|
|
82
|
-
children: [/* @__PURE__ */
|
|
100
|
+
onClick: () => z("deposit"),
|
|
101
|
+
children: [/* @__PURE__ */ I(j, { className: "mr-1.5 h-4 w-4" }), "Deposit"]
|
|
83
102
|
}),
|
|
84
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ L(R, {
|
|
85
104
|
variant: "outline",
|
|
86
105
|
size: "sm",
|
|
87
|
-
onClick: () =>
|
|
88
|
-
children: [/* @__PURE__ */
|
|
106
|
+
onClick: () => z("withdrawal"),
|
|
107
|
+
children: [/* @__PURE__ */ I(te, { className: "mr-1.5 h-4 w-4" }), "Withdrawal"]
|
|
89
108
|
}),
|
|
90
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ L(R, {
|
|
91
110
|
variant: "outline",
|
|
92
111
|
size: "sm",
|
|
93
|
-
onClick: () =>
|
|
94
|
-
children: [/* @__PURE__ */
|
|
112
|
+
onClick: () => z("transfer"),
|
|
113
|
+
children: [/* @__PURE__ */ I(ne, { className: "mr-1.5 h-4 w-4" }), "Transfer to operating"]
|
|
95
114
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ L(R, {
|
|
97
116
|
variant: "outline",
|
|
98
117
|
size: "sm",
|
|
99
|
-
onClick: () =>
|
|
100
|
-
children: [/* @__PURE__ */
|
|
118
|
+
onClick: () => z("reconcile"),
|
|
119
|
+
children: [/* @__PURE__ */ I(M, { className: "mr-1.5 h-4 w-4" }), "Reconcile"]
|
|
101
120
|
})
|
|
102
121
|
]
|
|
103
122
|
})]
|
|
104
123
|
}),
|
|
105
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ L("div", {
|
|
106
125
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
|
|
107
126
|
children: [
|
|
108
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ I(h, {
|
|
109
128
|
label: "Trust accounts",
|
|
110
|
-
value:
|
|
111
|
-
icon: /* @__PURE__ */
|
|
129
|
+
value: q.data.totalCount,
|
|
130
|
+
icon: /* @__PURE__ */ I(P, { className: "h-4 w-4" })
|
|
112
131
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ I(h, {
|
|
114
133
|
label: "Currency",
|
|
115
|
-
value:
|
|
116
|
-
icon: /* @__PURE__ */
|
|
134
|
+
value: $?.currency ?? "—",
|
|
135
|
+
icon: /* @__PURE__ */ I(P, { className: "h-4 w-4" })
|
|
117
136
|
}),
|
|
118
|
-
r ? /* @__PURE__ */
|
|
119
|
-
label: `Balance — ${
|
|
120
|
-
value:
|
|
121
|
-
icon: /* @__PURE__ */
|
|
122
|
-
tone: (
|
|
123
|
-
}) : /* @__PURE__ */
|
|
137
|
+
r ? /* @__PURE__ */ I(h, {
|
|
138
|
+
label: `Balance — ${Y.get(r) ?? "client"}`,
|
|
139
|
+
value: Q.isLoading ? "…" : E(Q.data?.balance ?? 0, $?.currency),
|
|
140
|
+
icon: /* @__PURE__ */ I(P, { className: "h-4 w-4" }),
|
|
141
|
+
tone: (Q.data?.balance ?? 0) < 0 ? "danger" : "success"
|
|
142
|
+
}) : /* @__PURE__ */ I(h, {
|
|
124
143
|
label: "Ledger entries",
|
|
125
|
-
value:
|
|
126
|
-
icon: /* @__PURE__ */
|
|
144
|
+
value: Z.data?.totalCount ?? 0,
|
|
145
|
+
icon: /* @__PURE__ */ I(M, { className: "h-4 w-4" })
|
|
127
146
|
})
|
|
128
147
|
]
|
|
129
148
|
}),
|
|
130
|
-
|
|
149
|
+
K && /* @__PURE__ */ L(y, {
|
|
131
150
|
title: "Reconciliation result",
|
|
132
151
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ L("div", {
|
|
134
153
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-4",
|
|
135
154
|
children: [
|
|
136
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ I(h, {
|
|
137
156
|
label: "Book balance",
|
|
138
|
-
value:
|
|
139
|
-
icon: /* @__PURE__ */
|
|
157
|
+
value: E(K.bookBalance, $?.currency),
|
|
158
|
+
icon: /* @__PURE__ */ I(P, { className: "h-4 w-4" })
|
|
140
159
|
}),
|
|
141
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ I(h, {
|
|
142
161
|
label: "Statement balance",
|
|
143
|
-
value:
|
|
144
|
-
icon: /* @__PURE__ */
|
|
162
|
+
value: K.statementBalance == null ? "—" : E(K.statementBalance, $?.currency),
|
|
163
|
+
icon: /* @__PURE__ */ I(M, { className: "h-4 w-4" })
|
|
145
164
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ I(h, {
|
|
147
166
|
label: "Difference",
|
|
148
|
-
value:
|
|
149
|
-
tone:
|
|
150
|
-
icon:
|
|
167
|
+
value: K.difference == null ? "—" : E(K.difference, $?.currency),
|
|
168
|
+
tone: K.inBalance ? "success" : "danger",
|
|
169
|
+
icon: K.inBalance ? /* @__PURE__ */ I(M, { className: "h-4 w-4" }) : /* @__PURE__ */ I(ie, { className: "h-4 w-4" })
|
|
151
170
|
}),
|
|
152
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ I(h, {
|
|
153
172
|
label: "Reconciled entries",
|
|
154
|
-
value:
|
|
155
|
-
icon: /* @__PURE__ */
|
|
173
|
+
value: K.reconciledCount,
|
|
174
|
+
icon: /* @__PURE__ */ I(M, { className: "h-4 w-4" })
|
|
156
175
|
})
|
|
157
176
|
]
|
|
158
177
|
}),
|
|
159
|
-
!
|
|
178
|
+
!K.inBalance && /* @__PURE__ */ I("div", {
|
|
160
179
|
className: "mt-3",
|
|
161
|
-
children: /* @__PURE__ */
|
|
180
|
+
children: /* @__PURE__ */ I(u, {
|
|
162
181
|
tone: "danger",
|
|
163
182
|
children: "Out of balance — the bank statement does not match the book balance. Investigate before closing this reconciliation period."
|
|
164
183
|
})
|
|
165
184
|
}),
|
|
166
|
-
|
|
185
|
+
K.clientBalances.length > 0 && /* @__PURE__ */ I("div", {
|
|
167
186
|
className: "mt-3",
|
|
168
|
-
children: /* @__PURE__ */
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
/* @__PURE__ */
|
|
187
|
+
children: /* @__PURE__ */ L(x, { children: [/* @__PURE__ */ I("thead", { children: /* @__PURE__ */ L("tr", { children: [
|
|
188
|
+
/* @__PURE__ */ I(T, { children: "Client" }),
|
|
189
|
+
/* @__PURE__ */ I(T, { children: "Matter" }),
|
|
190
|
+
/* @__PURE__ */ I(T, {
|
|
172
191
|
className: "text-right",
|
|
173
192
|
children: "Balance"
|
|
174
193
|
})
|
|
175
|
-
] }) }), /* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
194
|
+
] }) }), /* @__PURE__ */ I("tbody", { children: K.clientBalances.map((e, t) => /* @__PURE__ */ L("tr", { children: [
|
|
195
|
+
/* @__PURE__ */ I(S, { children: Y.get(e.clientId) ?? e.clientId }),
|
|
196
|
+
/* @__PURE__ */ I(S, { children: e.matterId ?? "—" }),
|
|
197
|
+
/* @__PURE__ */ I(S, {
|
|
179
198
|
className: "text-right font-medium",
|
|
180
|
-
children:
|
|
199
|
+
children: E(e.balance, $?.currency)
|
|
181
200
|
})
|
|
182
201
|
] }, `${e.clientId}-${e.matterId ?? "none"}-${t}`)) })] })
|
|
183
202
|
})
|
|
184
203
|
]
|
|
185
204
|
}),
|
|
186
|
-
|
|
187
|
-
error:
|
|
188
|
-
onRetry: () => void
|
|
189
|
-
}) : !
|
|
205
|
+
Z.isLoading ? /* @__PURE__ */ I(m, {}) : Z.error ? /* @__PURE__ */ I(f, {
|
|
206
|
+
error: Z.error,
|
|
207
|
+
onRetry: () => void Z.refetch()
|
|
208
|
+
}) : !Z.data || Z.data.items.length === 0 ? /* @__PURE__ */ I(d, {
|
|
190
209
|
title: "No trust ledger entries yet",
|
|
191
|
-
icon: /* @__PURE__ */
|
|
192
|
-
}) : /* @__PURE__ */
|
|
210
|
+
icon: /* @__PURE__ */ I(P, { className: "h-8 w-8" })
|
|
211
|
+
}) : /* @__PURE__ */ I(y, {
|
|
193
212
|
title: "Trust ledger",
|
|
194
|
-
children: /* @__PURE__ */
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
-
/* @__PURE__ */
|
|
213
|
+
children: /* @__PURE__ */ L(x, { children: [/* @__PURE__ */ I("thead", { children: /* @__PURE__ */ L("tr", { children: [
|
|
214
|
+
/* @__PURE__ */ I(T, { children: "Date" }),
|
|
215
|
+
/* @__PURE__ */ I(T, { children: "Client" }),
|
|
216
|
+
/* @__PURE__ */ I(T, { children: "Type" }),
|
|
217
|
+
/* @__PURE__ */ I(T, {
|
|
199
218
|
className: "text-right",
|
|
200
219
|
children: "Amount"
|
|
201
220
|
}),
|
|
202
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ I(T, {
|
|
203
222
|
className: "text-right",
|
|
204
223
|
children: "Balance after"
|
|
205
224
|
}),
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
] }) }), /* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ I(T, { children: "Reference" }),
|
|
226
|
+
/* @__PURE__ */ I(T, { children: "Reconciled" })
|
|
227
|
+
] }) }), /* @__PURE__ */ I("tbody", { children: Z.data.items.map((e) => /* @__PURE__ */ L("tr", {
|
|
209
228
|
className: "transition-colors hover:bg-bg-sunken/60",
|
|
210
229
|
children: [
|
|
211
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ I(S, {
|
|
212
231
|
className: "whitespace-nowrap",
|
|
213
|
-
children:
|
|
232
|
+
children: ee(e.createdAt)
|
|
214
233
|
}),
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ I(S, { children: Y.get(e.clientId) ?? e.clientId }),
|
|
235
|
+
/* @__PURE__ */ I(S, { children: /* @__PURE__ */ I(b, { status: e.type }) }),
|
|
236
|
+
/* @__PURE__ */ I(S, {
|
|
218
237
|
className: l("text-right font-medium whitespace-nowrap", e.amount < 0 ? "text-status-error-text" : "text-status-success-text"),
|
|
219
|
-
children:
|
|
238
|
+
children: E(e.amount, $?.currency)
|
|
220
239
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ I(S, {
|
|
222
241
|
className: "text-right whitespace-nowrap",
|
|
223
|
-
children:
|
|
242
|
+
children: E(e.balanceAfter, $?.currency)
|
|
224
243
|
}),
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ I(S, { children: e.reference ?? "—" }),
|
|
245
|
+
/* @__PURE__ */ I(S, { children: e.reconciled ? /* @__PURE__ */ I(b, { status: "RECONCILED" }) : "—" })
|
|
227
246
|
]
|
|
228
247
|
}, e.id)) })] })
|
|
229
248
|
})
|
|
230
249
|
] }),
|
|
231
|
-
|
|
232
|
-
onClose: () =>
|
|
233
|
-
onSaved: (e) =>
|
|
250
|
+
C === "account" && /* @__PURE__ */ I(B, {
|
|
251
|
+
onClose: () => z(null),
|
|
252
|
+
onSaved: (e) => G({
|
|
234
253
|
tone: "success",
|
|
235
254
|
text: `${e} created.`
|
|
236
255
|
})
|
|
237
256
|
}),
|
|
238
|
-
|
|
257
|
+
C === "deposit" && X && /* @__PURE__ */ I(V, {
|
|
239
258
|
kind: "deposit",
|
|
240
|
-
trustAccountId:
|
|
241
|
-
currency:
|
|
242
|
-
onClose: () =>
|
|
243
|
-
onSaved: () =>
|
|
259
|
+
trustAccountId: X,
|
|
260
|
+
currency: $?.currency,
|
|
261
|
+
onClose: () => z(null),
|
|
262
|
+
onSaved: () => G({
|
|
244
263
|
tone: "success",
|
|
245
264
|
text: "Deposit recorded."
|
|
246
265
|
})
|
|
247
266
|
}),
|
|
248
|
-
|
|
267
|
+
C === "withdrawal" && X && /* @__PURE__ */ I(V, {
|
|
249
268
|
kind: "withdrawal",
|
|
250
|
-
trustAccountId:
|
|
251
|
-
currency:
|
|
252
|
-
onClose: () =>
|
|
253
|
-
onSaved: () =>
|
|
269
|
+
trustAccountId: X,
|
|
270
|
+
currency: $?.currency,
|
|
271
|
+
onClose: () => z(null),
|
|
272
|
+
onSaved: () => G({
|
|
254
273
|
tone: "success",
|
|
255
274
|
text: "Withdrawal recorded."
|
|
256
275
|
})
|
|
257
276
|
}),
|
|
258
|
-
|
|
259
|
-
trustAccountId:
|
|
260
|
-
currency:
|
|
261
|
-
onClose: () =>
|
|
262
|
-
onSaved: () =>
|
|
277
|
+
C === "transfer" && X && /* @__PURE__ */ I(H, {
|
|
278
|
+
trustAccountId: X,
|
|
279
|
+
currency: $?.currency,
|
|
280
|
+
onClose: () => z(null),
|
|
281
|
+
onSaved: () => G({
|
|
263
282
|
tone: "success",
|
|
264
283
|
text: "Transfer to operating recorded."
|
|
265
284
|
})
|
|
266
285
|
}),
|
|
267
|
-
|
|
268
|
-
trustAccountId:
|
|
269
|
-
onClose: () =>
|
|
286
|
+
C === "reconcile" && X && /* @__PURE__ */ I(U, {
|
|
287
|
+
trustAccountId: X,
|
|
288
|
+
onClose: () => z(null),
|
|
270
289
|
onSaved: (e) => {
|
|
271
|
-
|
|
290
|
+
ae(e), G({
|
|
272
291
|
tone: e.inBalance ? "success" : "danger",
|
|
273
|
-
text: e.inBalance ? `Reconciled — ${e.reconciledCount} entries, in balance.` : `Reconciled with a difference of ${
|
|
292
|
+
text: e.inBalance ? `Reconciled — ${e.reconciledCount} entries, in balance.` : `Reconciled with a difference of ${E(e.difference ?? 0, $?.currency)} — review before closing the period.`
|
|
274
293
|
});
|
|
275
294
|
}
|
|
276
295
|
})
|
|
277
296
|
]
|
|
278
297
|
});
|
|
279
|
-
},
|
|
280
|
-
let r = t(), [i, a] =
|
|
298
|
+
}, B = ({ onClose: e, onSaved: n }) => {
|
|
299
|
+
let r = t(), [i, a] = A({
|
|
281
300
|
name: "",
|
|
282
301
|
institutionName: "",
|
|
283
302
|
accountNumberLast4: "",
|
|
284
303
|
currency: "USD"
|
|
285
|
-
}), [o, s] =
|
|
304
|
+
}), [o, s] = A(null), c = (e) => (t) => a((n) => ({
|
|
286
305
|
...n,
|
|
287
306
|
[e]: t.target.value
|
|
288
307
|
}));
|
|
289
|
-
return /* @__PURE__ */
|
|
308
|
+
return /* @__PURE__ */ I(g, {
|
|
290
309
|
open: !0,
|
|
291
310
|
onClose: e,
|
|
292
311
|
title: "New trust account",
|
|
293
|
-
footer: /* @__PURE__ */
|
|
312
|
+
footer: /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(R, {
|
|
294
313
|
variant: "outline",
|
|
295
314
|
onClick: e,
|
|
296
315
|
disabled: r.isPending,
|
|
297
316
|
children: "Cancel"
|
|
298
|
-
}), /* @__PURE__ */ R
|
|
317
|
+
}), /* @__PURE__ */ I(R, {
|
|
299
318
|
onClick: () => {
|
|
300
319
|
if (s(null), !i.name.trim()) return s("Account name is required.");
|
|
301
320
|
r.mutate({
|
|
@@ -313,42 +332,42 @@ var V = () => {
|
|
|
313
332
|
disabled: r.isPending,
|
|
314
333
|
children: r.isPending ? "Creating…" : "Create account"
|
|
315
334
|
})] }),
|
|
316
|
-
children: /* @__PURE__ */
|
|
335
|
+
children: /* @__PURE__ */ L("div", {
|
|
317
336
|
className: "space-y-3",
|
|
318
337
|
children: [
|
|
319
|
-
o && /* @__PURE__ */
|
|
338
|
+
o && /* @__PURE__ */ I(u, {
|
|
320
339
|
tone: "danger",
|
|
321
340
|
children: o
|
|
322
341
|
}),
|
|
323
|
-
/* @__PURE__ */
|
|
342
|
+
/* @__PURE__ */ I(p, {
|
|
324
343
|
label: "Name",
|
|
325
344
|
required: !0,
|
|
326
|
-
children: /* @__PURE__ */
|
|
345
|
+
children: /* @__PURE__ */ I(w, {
|
|
327
346
|
value: i.name,
|
|
328
347
|
onChange: c("name"),
|
|
329
348
|
placeholder: "IOLTA Main"
|
|
330
349
|
})
|
|
331
350
|
}),
|
|
332
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ L("div", {
|
|
333
352
|
className: "grid grid-cols-2 gap-3",
|
|
334
|
-
children: [/* @__PURE__ */
|
|
353
|
+
children: [/* @__PURE__ */ I(p, {
|
|
335
354
|
label: "Institution (optional)",
|
|
336
|
-
children: /* @__PURE__ */
|
|
355
|
+
children: /* @__PURE__ */ I(w, {
|
|
337
356
|
value: i.institutionName,
|
|
338
357
|
onChange: c("institutionName")
|
|
339
358
|
})
|
|
340
|
-
}), /* @__PURE__ */
|
|
359
|
+
}), /* @__PURE__ */ I(p, {
|
|
341
360
|
label: "Currency",
|
|
342
|
-
children: /* @__PURE__ */
|
|
361
|
+
children: /* @__PURE__ */ I(w, {
|
|
343
362
|
value: i.currency,
|
|
344
363
|
onChange: c("currency"),
|
|
345
364
|
maxLength: 3
|
|
346
365
|
})
|
|
347
366
|
})]
|
|
348
367
|
}),
|
|
349
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ I(p, {
|
|
350
369
|
label: "Last 4 of account number (optional)",
|
|
351
|
-
children: /* @__PURE__ */
|
|
370
|
+
children: /* @__PURE__ */ I(w, {
|
|
352
371
|
value: i.accountNumberLast4,
|
|
353
372
|
onChange: c("accountNumberLast4"),
|
|
354
373
|
maxLength: 4
|
|
@@ -357,27 +376,27 @@ var V = () => {
|
|
|
357
376
|
]
|
|
358
377
|
})
|
|
359
378
|
});
|
|
360
|
-
},
|
|
361
|
-
let c = i(), l = a(), d = t === "deposit" ? c : l, f = e({ pagination: { limit: 100 } }), [m, h] =
|
|
379
|
+
}, V = ({ kind: t, trustAccountId: n, currency: r, onClose: o, onSaved: s }) => {
|
|
380
|
+
let c = i(), l = a(), d = t === "deposit" ? c : l, f = e({ pagination: { limit: 100 } }), [m, h] = A({
|
|
362
381
|
clientId: "",
|
|
363
382
|
matterId: "",
|
|
364
383
|
amount: "",
|
|
365
384
|
reference: "",
|
|
366
385
|
description: ""
|
|
367
|
-
}), [v, y] =
|
|
386
|
+
}), [v, y] = A(null), b = (e) => (t) => h((n) => ({
|
|
368
387
|
...n,
|
|
369
388
|
[e]: t.target.value
|
|
370
389
|
}));
|
|
371
|
-
return /* @__PURE__ */
|
|
390
|
+
return /* @__PURE__ */ I(g, {
|
|
372
391
|
open: !0,
|
|
373
392
|
onClose: o,
|
|
374
393
|
title: t === "deposit" ? "Record trust deposit" : "Record trust withdrawal",
|
|
375
|
-
footer: /* @__PURE__ */
|
|
394
|
+
footer: /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(R, {
|
|
376
395
|
variant: "outline",
|
|
377
396
|
onClick: o,
|
|
378
397
|
disabled: d.isPending,
|
|
379
398
|
children: "Cancel"
|
|
380
|
-
}), /* @__PURE__ */ R
|
|
399
|
+
}), /* @__PURE__ */ I(R, {
|
|
381
400
|
onClick: () => {
|
|
382
401
|
if (y(null), !m.clientId) return y("Select a client.");
|
|
383
402
|
let e = Number(m.amount);
|
|
@@ -399,60 +418,60 @@ var V = () => {
|
|
|
399
418
|
disabled: d.isPending,
|
|
400
419
|
children: d.isPending ? "Saving…" : t === "deposit" ? "Record deposit" : "Record withdrawal"
|
|
401
420
|
})] }),
|
|
402
|
-
children: /* @__PURE__ */
|
|
421
|
+
children: /* @__PURE__ */ L("div", {
|
|
403
422
|
className: "space-y-3",
|
|
404
423
|
children: [
|
|
405
|
-
v && /* @__PURE__ */
|
|
424
|
+
v && /* @__PURE__ */ I(u, {
|
|
406
425
|
tone: "danger",
|
|
407
426
|
children: v
|
|
408
427
|
}),
|
|
409
|
-
t === "withdrawal" && /* @__PURE__ */
|
|
428
|
+
t === "withdrawal" && /* @__PURE__ */ I(u, {
|
|
410
429
|
tone: "info",
|
|
411
430
|
children: "A withdrawal that would take this client’s trust balance below zero is rejected — trust funds are never allowed to go negative."
|
|
412
431
|
}),
|
|
413
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ I(p, {
|
|
414
433
|
label: "Client",
|
|
415
434
|
required: !0,
|
|
416
|
-
children: /* @__PURE__ */
|
|
435
|
+
children: /* @__PURE__ */ L(_, {
|
|
417
436
|
value: m.clientId,
|
|
418
437
|
onChange: b("clientId"),
|
|
419
|
-
children: [/* @__PURE__ */
|
|
438
|
+
children: [/* @__PURE__ */ I("option", {
|
|
420
439
|
value: "",
|
|
421
440
|
children: "Select…"
|
|
422
|
-
}), f.data?.items.map((e) => /* @__PURE__ */
|
|
441
|
+
}), f.data?.items.map((e) => /* @__PURE__ */ I("option", {
|
|
423
442
|
value: e.id,
|
|
424
443
|
children: e.name
|
|
425
444
|
}, e.id))]
|
|
426
445
|
})
|
|
427
446
|
}),
|
|
428
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ L("div", {
|
|
429
448
|
className: "grid grid-cols-2 gap-3",
|
|
430
|
-
children: [/* @__PURE__ */
|
|
449
|
+
children: [/* @__PURE__ */ I(p, {
|
|
431
450
|
label: "Amount",
|
|
432
451
|
required: !0,
|
|
433
|
-
children: /* @__PURE__ */
|
|
452
|
+
children: /* @__PURE__ */ I(w, {
|
|
434
453
|
type: "number",
|
|
435
454
|
min: "0.01",
|
|
436
455
|
step: "0.01",
|
|
437
456
|
value: m.amount,
|
|
438
457
|
onChange: b("amount")
|
|
439
458
|
})
|
|
440
|
-
}), /* @__PURE__ */
|
|
459
|
+
}), /* @__PURE__ */ I(p, {
|
|
441
460
|
label: "Reference (optional)",
|
|
442
|
-
children: /* @__PURE__ */
|
|
461
|
+
children: /* @__PURE__ */ I(w, {
|
|
443
462
|
value: m.reference,
|
|
444
463
|
onChange: b("reference"),
|
|
445
464
|
placeholder: "CHK-1042"
|
|
446
465
|
})
|
|
447
466
|
})]
|
|
448
467
|
}),
|
|
449
|
-
m.amount && /* @__PURE__ */
|
|
468
|
+
m.amount && /* @__PURE__ */ I("div", {
|
|
450
469
|
className: "rounded-lg bg-bg-sunken px-3 py-2 text-sm text-text-secondary",
|
|
451
|
-
children:
|
|
470
|
+
children: E(Number(m.amount) || 0, r)
|
|
452
471
|
}),
|
|
453
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ I(p, {
|
|
454
473
|
label: "Description (optional)",
|
|
455
|
-
children: /* @__PURE__ */
|
|
474
|
+
children: /* @__PURE__ */ I(C, {
|
|
456
475
|
value: m.description,
|
|
457
476
|
onChange: b("description")
|
|
458
477
|
})
|
|
@@ -460,25 +479,25 @@ var V = () => {
|
|
|
460
479
|
]
|
|
461
480
|
})
|
|
462
481
|
});
|
|
463
|
-
},
|
|
464
|
-
let a = n(), o = e({ pagination: { limit: 100 } }), [s, c] =
|
|
482
|
+
}, H = ({ trustAccountId: t, onClose: r, onSaved: i }) => {
|
|
483
|
+
let a = n(), o = e({ pagination: { limit: 100 } }), [s, c] = A({
|
|
465
484
|
clientId: "",
|
|
466
485
|
amount: "",
|
|
467
486
|
reason: ""
|
|
468
|
-
}), [l, d] =
|
|
487
|
+
}), [l, d] = A(null), f = (e) => (t) => c((n) => ({
|
|
469
488
|
...n,
|
|
470
489
|
[e]: t.target.value
|
|
471
490
|
}));
|
|
472
|
-
return /* @__PURE__ */
|
|
491
|
+
return /* @__PURE__ */ I(g, {
|
|
473
492
|
open: !0,
|
|
474
493
|
onClose: r,
|
|
475
494
|
title: "Transfer to operating",
|
|
476
|
-
footer: /* @__PURE__ */
|
|
495
|
+
footer: /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(R, {
|
|
477
496
|
variant: "outline",
|
|
478
497
|
onClick: r,
|
|
479
498
|
disabled: a.isPending,
|
|
480
499
|
children: "Cancel"
|
|
481
|
-
}), /* @__PURE__ */ R
|
|
500
|
+
}), /* @__PURE__ */ I(R, {
|
|
482
501
|
onClick: () => {
|
|
483
502
|
if (d(null), !s.clientId) return d("Select a client.");
|
|
484
503
|
let e = Number(s.amount);
|
|
@@ -498,36 +517,36 @@ var V = () => {
|
|
|
498
517
|
disabled: a.isPending,
|
|
499
518
|
children: a.isPending ? "Transferring…" : "Transfer"
|
|
500
519
|
})] }),
|
|
501
|
-
children: /* @__PURE__ */
|
|
520
|
+
children: /* @__PURE__ */ L("div", {
|
|
502
521
|
className: "space-y-3",
|
|
503
522
|
children: [
|
|
504
|
-
l && /* @__PURE__ */
|
|
523
|
+
l && /* @__PURE__ */ I(u, {
|
|
505
524
|
tone: "danger",
|
|
506
525
|
children: l
|
|
507
526
|
}),
|
|
508
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ I(u, {
|
|
509
528
|
tone: "info",
|
|
510
529
|
children: "Moves earned fees from this client’s trust ledger to the firm’s operating account. Rejected if it would take the client’s trust balance below zero."
|
|
511
530
|
}),
|
|
512
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ I(p, {
|
|
513
532
|
label: "Client",
|
|
514
533
|
required: !0,
|
|
515
|
-
children: /* @__PURE__ */
|
|
534
|
+
children: /* @__PURE__ */ L(_, {
|
|
516
535
|
value: s.clientId,
|
|
517
536
|
onChange: f("clientId"),
|
|
518
|
-
children: [/* @__PURE__ */
|
|
537
|
+
children: [/* @__PURE__ */ I("option", {
|
|
519
538
|
value: "",
|
|
520
539
|
children: "Select…"
|
|
521
|
-
}), o.data?.items.map((e) => /* @__PURE__ */
|
|
540
|
+
}), o.data?.items.map((e) => /* @__PURE__ */ I("option", {
|
|
522
541
|
value: e.id,
|
|
523
542
|
children: e.name
|
|
524
543
|
}, e.id))]
|
|
525
544
|
})
|
|
526
545
|
}),
|
|
527
|
-
/* @__PURE__ */
|
|
546
|
+
/* @__PURE__ */ I(p, {
|
|
528
547
|
label: "Amount",
|
|
529
548
|
required: !0,
|
|
530
|
-
children: /* @__PURE__ */
|
|
549
|
+
children: /* @__PURE__ */ I(w, {
|
|
531
550
|
type: "number",
|
|
532
551
|
min: "0.01",
|
|
533
552
|
step: "0.01",
|
|
@@ -535,9 +554,9 @@ var V = () => {
|
|
|
535
554
|
onChange: f("amount")
|
|
536
555
|
})
|
|
537
556
|
}),
|
|
538
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ I(p, {
|
|
539
558
|
label: "Reason (optional)",
|
|
540
|
-
children: /* @__PURE__ */
|
|
559
|
+
children: /* @__PURE__ */ I(C, {
|
|
541
560
|
value: s.reason,
|
|
542
561
|
onChange: f("reason"),
|
|
543
562
|
placeholder: "Invoice INV-2026-0001 paid from trust"
|
|
@@ -546,18 +565,18 @@ var V = () => {
|
|
|
546
565
|
]
|
|
547
566
|
})
|
|
548
567
|
});
|
|
549
|
-
},
|
|
550
|
-
let i = r(), [a, o] =
|
|
551
|
-
return /* @__PURE__ */
|
|
568
|
+
}, U = ({ trustAccountId: e, onClose: t, onSaved: n }) => {
|
|
569
|
+
let i = r(), [a, o] = A(""), [s, c] = A(null);
|
|
570
|
+
return /* @__PURE__ */ I(g, {
|
|
552
571
|
open: !0,
|
|
553
572
|
onClose: t,
|
|
554
573
|
title: "Reconcile trust account",
|
|
555
|
-
footer: /* @__PURE__ */
|
|
574
|
+
footer: /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(R, {
|
|
556
575
|
variant: "outline",
|
|
557
576
|
onClick: t,
|
|
558
577
|
disabled: i.isPending,
|
|
559
578
|
children: "Cancel"
|
|
560
|
-
}), /* @__PURE__ */ R
|
|
579
|
+
}), /* @__PURE__ */ I(R, {
|
|
561
580
|
onClick: () => {
|
|
562
581
|
c(null), i.mutate({
|
|
563
582
|
trustAccountId: e,
|
|
@@ -572,20 +591,20 @@ var V = () => {
|
|
|
572
591
|
disabled: i.isPending,
|
|
573
592
|
children: i.isPending ? "Reconciling…" : "Reconcile"
|
|
574
593
|
})] }),
|
|
575
|
-
children: /* @__PURE__ */
|
|
594
|
+
children: /* @__PURE__ */ L("div", {
|
|
576
595
|
className: "space-y-3",
|
|
577
596
|
children: [
|
|
578
|
-
s && /* @__PURE__ */
|
|
597
|
+
s && /* @__PURE__ */ I(u, {
|
|
579
598
|
tone: "danger",
|
|
580
599
|
children: s
|
|
581
600
|
}),
|
|
582
|
-
/* @__PURE__ */
|
|
601
|
+
/* @__PURE__ */ I(u, {
|
|
583
602
|
tone: "info",
|
|
584
603
|
children: "Computes the book balance and every client’s subsidiary-ledger balance as of now, compares it against the bank statement balance below, and marks every not-yet-reconciled entry as reconciled."
|
|
585
604
|
}),
|
|
586
|
-
/* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ I(p, {
|
|
587
606
|
label: "Bank statement balance (optional)",
|
|
588
|
-
children: /* @__PURE__ */
|
|
607
|
+
children: /* @__PURE__ */ I(w, {
|
|
589
608
|
type: "number",
|
|
590
609
|
step: "0.01",
|
|
591
610
|
value: a,
|
|
@@ -598,6 +617,6 @@ var V = () => {
|
|
|
598
617
|
});
|
|
599
618
|
};
|
|
600
619
|
//#endregion
|
|
601
|
-
export {
|
|
620
|
+
export { z as TrustPage };
|
|
602
621
|
|
|
603
622
|
//# sourceMappingURL=TrustPage.js.map
|