@burdenoff/microfe-healthybowl 2026.613.1 → 2026.614.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/healthybowl/pages/financial/TransactionsPage.js +307 -240
- package/dist/healthybowl/pages/financial/TransactionsPage.js.map +1 -1
- package/dist/healthybowl/pages/weather/WeatherAlertsPage.js +150 -64
- package/dist/healthybowl/pages/weather/WeatherAlertsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { cn as e, formatCurrency as t, formatDate as n } from "../../utils/helpers.js";
|
|
2
2
|
import { PageLayout as r } from "../../components/PageLayout.js";
|
|
3
3
|
import { StatCard as i } from "../../components/StatCard.js";
|
|
4
|
-
import { DataTable as
|
|
5
|
-
import { StatusBadge as
|
|
6
|
-
import { EmptyState as
|
|
7
|
-
import { ErrorState as
|
|
8
|
-
import { FilterBar as
|
|
9
|
-
import { ToastContainer as
|
|
10
|
-
import { LoadingSkeleton as
|
|
11
|
-
import { Modal as
|
|
4
|
+
import { DataTable as a } from "../../components/DataTable.js";
|
|
5
|
+
import { StatusBadge as o } from "../../components/StatusBadge.js";
|
|
6
|
+
import { EmptyState as ee } from "../../components/EmptyState.js";
|
|
7
|
+
import { ErrorState as te } from "../../components/ErrorState.js";
|
|
8
|
+
import { FilterBar as ne } from "../../components/FilterBar.js";
|
|
9
|
+
import { ToastContainer as s } from "../../components/Toast.js";
|
|
10
|
+
import { LoadingSkeleton as re } from "../../components/LoadingSkeleton.js";
|
|
11
|
+
import { Modal as c } from "../../components/Modal.js";
|
|
12
12
|
import "../../components/index.js";
|
|
13
|
-
import { useHealthyBowlData as
|
|
14
|
-
import { useToast as
|
|
15
|
-
import { useMemo as
|
|
16
|
-
import { useI18n as
|
|
17
|
-
import { Calendar as
|
|
18
|
-
import { Fragment as
|
|
13
|
+
import { useHealthyBowlData as ie } from "../../hooks/useHealthyBowlData.js";
|
|
14
|
+
import { useToast as l } from "../../hooks/useToast.js";
|
|
15
|
+
import { useMemo as u, useState as d } from "react";
|
|
16
|
+
import { useI18n as f } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
17
|
+
import { Calendar as p, DollarSign as m, Download as ae, Edit as oe, Hash as se, Plus as ce, Trash2 as le, TrendingDown as h, TrendingUp as g } from "lucide-react";
|
|
18
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
19
19
|
//#region src/healthybowl/pages/financial/TransactionsPage.tsx
|
|
20
|
-
var
|
|
20
|
+
var b = [
|
|
21
21
|
"crop_sales",
|
|
22
22
|
"livestock_sales",
|
|
23
23
|
"marketplace",
|
|
@@ -29,13 +29,13 @@ var C = [
|
|
|
29
29
|
"certification",
|
|
30
30
|
"equipment",
|
|
31
31
|
"other"
|
|
32
|
-
],
|
|
32
|
+
], ue = [
|
|
33
33
|
"Bank Transfer",
|
|
34
34
|
"Credit Card",
|
|
35
35
|
"Cash",
|
|
36
36
|
"Check",
|
|
37
37
|
"Payment Gateway"
|
|
38
|
-
],
|
|
38
|
+
], x = {
|
|
39
39
|
date: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
|
|
40
40
|
type: "income",
|
|
41
41
|
category: "crop_sales",
|
|
@@ -44,79 +44,128 @@ var C = [
|
|
|
44
44
|
status: "completed",
|
|
45
45
|
paymentMethod: "Bank Transfer",
|
|
46
46
|
reference: ""
|
|
47
|
-
},
|
|
48
|
-
let { t:
|
|
49
|
-
let t =
|
|
47
|
+
}, S = () => {
|
|
48
|
+
let { t: S } = f(), { transactions: C, createTransaction: w, updateTransaction: T, deleteTransaction: de, loading: fe, errors: pe } = ie(), { toasts: me, toast: E, dismiss: he } = l(), [D, O] = d(""), [k, A] = d("all"), [j, M] = d("all"), [N, P] = d("all"), [F, I] = d(!1), [L, R] = d(!1), [z, B] = d(null), [ge, V] = d(null), [H, U] = d(x), W = u(() => C.filter((e) => {
|
|
49
|
+
let t = D === "" || (e.description ?? "").toLowerCase().includes(D.toLowerCase()) || e.reference && (e.reference ?? "").toLowerCase().includes(D.toLowerCase()), n = k === "all" || e.type === k, r = j === "all" || e.category === j, i = N === "all" || e.status === N;
|
|
50
50
|
return t && n && r && i;
|
|
51
51
|
}), [
|
|
52
|
-
|
|
52
|
+
C,
|
|
53
|
+
D,
|
|
54
|
+
k,
|
|
53
55
|
j,
|
|
54
|
-
N
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
if (!
|
|
84
|
-
|
|
85
|
-
title:
|
|
86
|
-
description:
|
|
56
|
+
N
|
|
57
|
+
]), G = u(() => C.filter((e) => e.type === "income").reduce((e, t) => e + t.amount, 0), [C]), K = u(() => C.filter((e) => e.type === "expense").reduce((e, t) => e + t.amount, 0), [C]), _e = G - K, q = u(() => ({
|
|
58
|
+
income: S("healthybowl.financial.transactions.type.income", "Income"),
|
|
59
|
+
expense: S("healthybowl.financial.transactions.type.expense", "Expense")
|
|
60
|
+
}), [S]), J = u(() => ({
|
|
61
|
+
crop_sales: S("healthybowl.financial.transactions.category.cropSales", "Crop Sales"),
|
|
62
|
+
livestock_sales: S("healthybowl.financial.transactions.category.livestockSales", "Livestock Sales"),
|
|
63
|
+
marketplace: S("healthybowl.financial.transactions.category.marketplace", "Marketplace"),
|
|
64
|
+
seeds: S("healthybowl.financial.transactions.category.seeds", "Seeds"),
|
|
65
|
+
fertilizers: S("healthybowl.financial.transactions.category.fertilizers", "Fertilizers"),
|
|
66
|
+
labor: S("healthybowl.financial.transactions.category.labor", "Labor"),
|
|
67
|
+
irrigation: S("healthybowl.financial.transactions.category.irrigation", "Irrigation"),
|
|
68
|
+
pest_control: S("healthybowl.financial.transactions.category.pestControl", "Pest Control"),
|
|
69
|
+
certification: S("healthybowl.financial.transactions.category.certification", "Certification"),
|
|
70
|
+
equipment: S("healthybowl.financial.transactions.category.equipment", "Equipment"),
|
|
71
|
+
other: S("healthybowl.financial.transactions.category.other", "Other")
|
|
72
|
+
}), [S]), Y = u(() => ({
|
|
73
|
+
completed: S("healthybowl.financial.transactions.status.completed", "Completed"),
|
|
74
|
+
pending: S("healthybowl.financial.transactions.status.pending", "Pending"),
|
|
75
|
+
failed: S("healthybowl.financial.transactions.status.failed", "Failed")
|
|
76
|
+
}), [S]), ve = u(() => ({
|
|
77
|
+
"Bank Transfer": S("healthybowl.financial.transactions.paymentMethod.bankTransfer", "Bank Transfer"),
|
|
78
|
+
"Credit Card": S("healthybowl.financial.transactions.paymentMethod.creditCard", "Credit Card"),
|
|
79
|
+
Cash: S("healthybowl.financial.transactions.paymentMethod.cash", "Cash"),
|
|
80
|
+
Check: S("healthybowl.financial.transactions.paymentMethod.check", "Check"),
|
|
81
|
+
"Payment Gateway": S("healthybowl.financial.transactions.paymentMethod.paymentGateway", "Payment Gateway")
|
|
82
|
+
}), [S]), X = () => {
|
|
83
|
+
I(!1), B(null), U(x);
|
|
84
|
+
}, ye = async () => {
|
|
85
|
+
if (!H.description || !H.amount) {
|
|
86
|
+
E({
|
|
87
|
+
title: S("healthybowl.financial.transactions.toast.validation.title", "Validation Error"),
|
|
88
|
+
description: S("healthybowl.financial.transactions.toast.validation.description", "Please fill in all required fields"),
|
|
87
89
|
variant: "error"
|
|
88
90
|
});
|
|
89
91
|
return;
|
|
90
92
|
}
|
|
91
|
-
|
|
93
|
+
R(!0);
|
|
92
94
|
try {
|
|
93
|
-
await
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
95
|
+
z ? (await T({
|
|
96
|
+
id: z,
|
|
97
|
+
amount: Number(H.amount),
|
|
98
|
+
category: H.category,
|
|
99
|
+
date: H.date,
|
|
100
|
+
description: H.description,
|
|
101
|
+
status: H.status,
|
|
102
|
+
type: H.type,
|
|
103
|
+
paymentMethod: H.paymentMethod,
|
|
104
|
+
reference: H.reference
|
|
105
|
+
}), E({
|
|
106
|
+
title: S("healthybowl.financial.transactions.toast.updated.title", "Transaction Updated"),
|
|
107
|
+
description: S("healthybowl.financial.transactions.toast.updated.description", "{{type}} of {{amount}} updated", {
|
|
108
|
+
type: q[H.type],
|
|
109
|
+
amount: t(Number(H.amount))
|
|
107
110
|
}),
|
|
108
111
|
variant: "success"
|
|
109
|
-
})
|
|
112
|
+
})) : (await w({
|
|
113
|
+
amount: Number(H.amount),
|
|
114
|
+
category: H.category,
|
|
115
|
+
date: H.date,
|
|
116
|
+
description: H.description,
|
|
117
|
+
status: H.status,
|
|
118
|
+
type: H.type,
|
|
119
|
+
...H.paymentMethod ? { paymentMethod: H.paymentMethod } : {},
|
|
120
|
+
...H.reference ? { reference: H.reference } : {}
|
|
121
|
+
}), E({
|
|
122
|
+
title: S("healthybowl.financial.transactions.toast.added.title", "Transaction Added"),
|
|
123
|
+
description: S("healthybowl.financial.transactions.toast.added.description", "{{type}} of {{amount}} recorded", {
|
|
124
|
+
type: q[H.type],
|
|
125
|
+
amount: t(Number(H.amount))
|
|
126
|
+
}),
|
|
127
|
+
variant: "success"
|
|
128
|
+
})), X();
|
|
110
129
|
} catch (e) {
|
|
111
|
-
|
|
112
|
-
title:
|
|
113
|
-
description: String(e),
|
|
130
|
+
E({
|
|
131
|
+
title: z ? S("healthybowl.financial.transactions.toast.updateFailed.title", "Update failed") : S("healthybowl.financial.transactions.toast.createFailed.title", "Create failed"),
|
|
132
|
+
description: e instanceof Error ? e.message : String(e),
|
|
114
133
|
variant: "error"
|
|
115
134
|
});
|
|
116
135
|
} finally {
|
|
117
|
-
|
|
136
|
+
R(!1);
|
|
118
137
|
}
|
|
119
|
-
},
|
|
138
|
+
}, be = (e) => {
|
|
139
|
+
U({
|
|
140
|
+
date: e.date,
|
|
141
|
+
type: e.type,
|
|
142
|
+
category: e.category,
|
|
143
|
+
description: e.description ?? "",
|
|
144
|
+
amount: String(e.amount),
|
|
145
|
+
status: e.status,
|
|
146
|
+
paymentMethod: e.paymentMethod ?? "Bank Transfer",
|
|
147
|
+
reference: e.reference ?? ""
|
|
148
|
+
}), B(e.id), I(!0);
|
|
149
|
+
}, xe = async (e) => {
|
|
150
|
+
if (window.confirm(S("healthybowl.financial.transactions.deleteConfirm", "Delete this transaction ({{description}})? This cannot be undone.", { description: e.description ?? "" }))) {
|
|
151
|
+
V(e.id);
|
|
152
|
+
try {
|
|
153
|
+
await de(e.id), E({
|
|
154
|
+
title: S("healthybowl.financial.transactions.toast.deleted.title", "Transaction Deleted"),
|
|
155
|
+
description: e.description,
|
|
156
|
+
variant: "success"
|
|
157
|
+
});
|
|
158
|
+
} catch (e) {
|
|
159
|
+
E({
|
|
160
|
+
title: S("healthybowl.common.error", "Error"),
|
|
161
|
+
description: e instanceof Error ? e.message : S("healthybowl.financial.transactions.toast.deleteFailed", "Failed to delete transaction"),
|
|
162
|
+
variant: "error"
|
|
163
|
+
});
|
|
164
|
+
} finally {
|
|
165
|
+
V(null);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}, Se = () => {
|
|
120
169
|
let e = [[
|
|
121
170
|
"Date",
|
|
122
171
|
"Type",
|
|
@@ -126,7 +175,7 @@ var C = [
|
|
|
126
175
|
"Payment Method",
|
|
127
176
|
"Reference",
|
|
128
177
|
"Status"
|
|
129
|
-
], ...
|
|
178
|
+
], ...W.map((e) => [
|
|
130
179
|
e.date,
|
|
131
180
|
e.type,
|
|
132
181
|
e.category,
|
|
@@ -136,34 +185,34 @@ var C = [
|
|
|
136
185
|
e.reference ?? "",
|
|
137
186
|
e.status
|
|
138
187
|
])].map((e) => e.map((e) => `"${e}"`).join(",")).join("\n"), t = new Blob([e], { type: "text/csv" }), n = URL.createObjectURL(t), r = document.createElement("a");
|
|
139
|
-
r.href = n, r.download = "transactions.csv", r.click(), URL.revokeObjectURL(n),
|
|
140
|
-
title:
|
|
141
|
-
description:
|
|
188
|
+
r.href = n, r.download = "transactions.csv", r.click(), URL.revokeObjectURL(n), E({
|
|
189
|
+
title: S("healthybowl.financial.transactions.toast.exported.title", "Exported to CSV"),
|
|
190
|
+
description: S("healthybowl.financial.transactions.toast.exported.description", "{{count}} transactions exported", { count: W.length }),
|
|
142
191
|
variant: "success"
|
|
143
192
|
});
|
|
144
193
|
}, Z = (e, t) => {
|
|
145
|
-
|
|
194
|
+
U((n) => ({
|
|
146
195
|
...n,
|
|
147
196
|
[e]: t
|
|
148
197
|
}));
|
|
149
|
-
},
|
|
198
|
+
}, Ce = [
|
|
150
199
|
{
|
|
151
200
|
key: "date",
|
|
152
|
-
header:
|
|
153
|
-
render: (e) => /* @__PURE__ */
|
|
201
|
+
header: S("healthybowl.financial.transactions.table.headers.date", "Date"),
|
|
202
|
+
render: (e) => /* @__PURE__ */ y("span", {
|
|
154
203
|
className: "flex items-center gap-1.5 text-sm text-muted-foreground",
|
|
155
|
-
children: [/* @__PURE__ */
|
|
204
|
+
children: [/* @__PURE__ */ v(p, { className: "h-3 w-3" }), n(e.date)]
|
|
156
205
|
})
|
|
157
206
|
},
|
|
158
207
|
{
|
|
159
208
|
key: "type",
|
|
160
|
-
header:
|
|
209
|
+
header: S("healthybowl.financial.transactions.table.headers.type", "Type"),
|
|
161
210
|
render: (e) => {
|
|
162
211
|
let t = e.type === "income";
|
|
163
|
-
return /* @__PURE__ */
|
|
212
|
+
return /* @__PURE__ */ y("span", {
|
|
164
213
|
className: "flex items-center gap-1.5",
|
|
165
|
-
children: [t ? /* @__PURE__ */
|
|
166
|
-
label:
|
|
214
|
+
children: [t ? /* @__PURE__ */ v(g, { className: "h-3.5 w-3.5 text-success" }) : /* @__PURE__ */ v(h, { className: "h-3.5 w-3.5 text-destructive" }), /* @__PURE__ */ v(o, {
|
|
215
|
+
label: q[e.type],
|
|
167
216
|
variant: t ? "success" : "error"
|
|
168
217
|
})]
|
|
169
218
|
});
|
|
@@ -171,27 +220,27 @@ var C = [
|
|
|
171
220
|
},
|
|
172
221
|
{
|
|
173
222
|
key: "category",
|
|
174
|
-
header:
|
|
175
|
-
render: (e) => /* @__PURE__ */
|
|
223
|
+
header: S("healthybowl.financial.transactions.table.headers.category", "Category"),
|
|
224
|
+
render: (e) => /* @__PURE__ */ v("span", {
|
|
176
225
|
className: "text-sm capitalize text-foreground",
|
|
177
|
-
children: e.category ?
|
|
226
|
+
children: e.category ? J[e.category] : ""
|
|
178
227
|
})
|
|
179
228
|
},
|
|
180
229
|
{
|
|
181
230
|
key: "description",
|
|
182
|
-
header:
|
|
183
|
-
render: (e) => /* @__PURE__ */
|
|
231
|
+
header: S("healthybowl.financial.transactions.table.headers.description", "Description"),
|
|
232
|
+
render: (e) => /* @__PURE__ */ v("span", {
|
|
184
233
|
className: "text-sm text-foreground",
|
|
185
234
|
children: e.description
|
|
186
235
|
})
|
|
187
236
|
},
|
|
188
237
|
{
|
|
189
238
|
key: "amount",
|
|
190
|
-
header:
|
|
239
|
+
header: S("healthybowl.financial.transactions.table.headers.amount", "Amount"),
|
|
191
240
|
className: "text-right",
|
|
192
241
|
render: (n) => {
|
|
193
242
|
let r = n.type === "income";
|
|
194
|
-
return /* @__PURE__ */
|
|
243
|
+
return /* @__PURE__ */ y("span", {
|
|
195
244
|
className: e("text-sm font-semibold", r ? "text-success" : "text-destructive"),
|
|
196
245
|
children: [r ? "+" : "-", t(n.amount)]
|
|
197
246
|
});
|
|
@@ -199,274 +248,292 @@ var C = [
|
|
|
199
248
|
},
|
|
200
249
|
{
|
|
201
250
|
key: "paymentMethod",
|
|
202
|
-
header:
|
|
203
|
-
render: (e) => /* @__PURE__ */
|
|
251
|
+
header: S("healthybowl.financial.transactions.table.headers.payment", "Payment"),
|
|
252
|
+
render: (e) => /* @__PURE__ */ v("span", {
|
|
204
253
|
className: "text-xs text-muted-foreground",
|
|
205
254
|
children: e.paymentMethod
|
|
206
255
|
})
|
|
207
256
|
},
|
|
208
257
|
{
|
|
209
258
|
key: "reference",
|
|
210
|
-
header:
|
|
211
|
-
render: (e) => /* @__PURE__ */
|
|
259
|
+
header: S("healthybowl.financial.transactions.table.headers.reference", "Reference"),
|
|
260
|
+
render: (e) => /* @__PURE__ */ v("span", {
|
|
212
261
|
className: "text-xs font-mono text-muted-foreground",
|
|
213
262
|
children: e.reference || "-"
|
|
214
263
|
})
|
|
215
264
|
},
|
|
216
265
|
{
|
|
217
266
|
key: "status",
|
|
218
|
-
header:
|
|
219
|
-
render: (e) => /* @__PURE__ */
|
|
220
|
-
label:
|
|
267
|
+
header: S("healthybowl.financial.transactions.table.headers.status", "Status"),
|
|
268
|
+
render: (e) => /* @__PURE__ */ v(o, {
|
|
269
|
+
label: Y[e.status],
|
|
221
270
|
variant: e.status === "completed" ? "success" : e.status === "pending" ? "warning" : "error",
|
|
222
271
|
dot: !0
|
|
223
272
|
})
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
key: "actions",
|
|
276
|
+
header: S("healthybowl.financial.transactions.table.headers.actions", "Actions"),
|
|
277
|
+
className: "text-right",
|
|
278
|
+
render: (e) => /* @__PURE__ */ y("div", {
|
|
279
|
+
className: "flex items-center justify-end gap-1.5",
|
|
280
|
+
children: [/* @__PURE__ */ v("button", {
|
|
281
|
+
onClick: () => be(e),
|
|
282
|
+
className: "rounded-md p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
283
|
+
title: S("healthybowl.financial.transactions.actions.edit", "Edit Transaction"),
|
|
284
|
+
children: /* @__PURE__ */ v(oe, { className: "h-3.5 w-3.5" })
|
|
285
|
+
}), /* @__PURE__ */ v("button", {
|
|
286
|
+
onClick: () => xe(e),
|
|
287
|
+
disabled: ge === e.id,
|
|
288
|
+
className: "rounded-md p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-destructive disabled:opacity-50",
|
|
289
|
+
title: S("healthybowl.financial.transactions.actions.delete", "Delete Transaction"),
|
|
290
|
+
children: /* @__PURE__ */ v(le, { className: "h-3.5 w-3.5" })
|
|
291
|
+
})]
|
|
292
|
+
})
|
|
224
293
|
}
|
|
225
294
|
], Q = "h-9 rounded-md border border-border bg-background px-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring", $ = "h-9 w-full rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring";
|
|
226
|
-
return /* @__PURE__ */
|
|
227
|
-
title:
|
|
228
|
-
description:
|
|
229
|
-
actions: /* @__PURE__ */
|
|
295
|
+
return /* @__PURE__ */ y(r, {
|
|
296
|
+
title: S("healthybowl.financial.transactions.title", "Transactions"),
|
|
297
|
+
description: S("healthybowl.financial.transactions.description", "All income and expense records"),
|
|
298
|
+
actions: /* @__PURE__ */ y("div", {
|
|
230
299
|
className: "flex items-center gap-2",
|
|
231
|
-
children: [/* @__PURE__ */
|
|
232
|
-
onClick:
|
|
300
|
+
children: [/* @__PURE__ */ y("button", {
|
|
301
|
+
onClick: Se,
|
|
233
302
|
className: "flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-muted",
|
|
234
|
-
children: [/* @__PURE__ */
|
|
235
|
-
}), /* @__PURE__ */
|
|
236
|
-
onClick: () =>
|
|
303
|
+
children: [/* @__PURE__ */ v(ae, { className: "h-3.5 w-3.5" }), S("healthybowl.financial.transactions.actions.exportCsv", "Export CSV")]
|
|
304
|
+
}), /* @__PURE__ */ y("button", {
|
|
305
|
+
onClick: () => {
|
|
306
|
+
U(x), B(null), I(!0);
|
|
307
|
+
},
|
|
237
308
|
className: "flex items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs font-medium text-background transition-opacity hover:opacity-90",
|
|
238
|
-
children: [/* @__PURE__ */
|
|
309
|
+
children: [/* @__PURE__ */ v(ce, { className: "h-3.5 w-3.5" }), S("healthybowl.financial.transactions.actions.add", "Add Transaction")]
|
|
239
310
|
})]
|
|
240
311
|
}),
|
|
241
312
|
children: [
|
|
242
|
-
|
|
313
|
+
fe && C.length === 0 ? /* @__PURE__ */ v(re, {
|
|
243
314
|
variant: "table",
|
|
244
315
|
count: 6
|
|
245
|
-
}) :
|
|
246
|
-
icon: /* @__PURE__ */
|
|
247
|
-
title:
|
|
248
|
-
description:
|
|
249
|
-
}) : /* @__PURE__ */
|
|
250
|
-
/* @__PURE__ */
|
|
316
|
+
}) : C.length === 0 ? pe.financial ? /* @__PURE__ */ v(te, {}) : /* @__PURE__ */ v(ee, {
|
|
317
|
+
icon: /* @__PURE__ */ v(m, { className: "h-6 w-6" }),
|
|
318
|
+
title: S("healthybowl.financial.transactions.emptyState.title", "No transactions yet"),
|
|
319
|
+
description: S("healthybowl.financial.transactions.emptyState.description", "Income and expense records will appear here once they're added.")
|
|
320
|
+
}) : /* @__PURE__ */ y(_, { children: [
|
|
321
|
+
/* @__PURE__ */ y("div", {
|
|
251
322
|
className: "grid grid-cols-2 gap-4 lg:grid-cols-4",
|
|
252
323
|
children: [
|
|
253
|
-
/* @__PURE__ */
|
|
254
|
-
label:
|
|
255
|
-
value:
|
|
324
|
+
/* @__PURE__ */ v(i, {
|
|
325
|
+
label: S("healthybowl.financial.transactions.stats.totalIncome.label", "Total Income"),
|
|
326
|
+
value: G,
|
|
256
327
|
prefix: "$",
|
|
257
|
-
icon: /* @__PURE__ */
|
|
328
|
+
icon: /* @__PURE__ */ v(g, { className: "h-4 w-4" })
|
|
258
329
|
}),
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
label:
|
|
261
|
-
value:
|
|
330
|
+
/* @__PURE__ */ v(i, {
|
|
331
|
+
label: S("healthybowl.financial.transactions.stats.totalExpenses.label", "Total Expenses"),
|
|
332
|
+
value: K,
|
|
262
333
|
prefix: "$",
|
|
263
|
-
icon: /* @__PURE__ */
|
|
334
|
+
icon: /* @__PURE__ */ v(h, { className: "h-4 w-4" })
|
|
264
335
|
}),
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
label:
|
|
267
|
-
value:
|
|
336
|
+
/* @__PURE__ */ v(i, {
|
|
337
|
+
label: S("healthybowl.financial.transactions.stats.netAmount.label", "Net Amount"),
|
|
338
|
+
value: _e,
|
|
268
339
|
prefix: "$",
|
|
269
|
-
icon: /* @__PURE__ */
|
|
340
|
+
icon: /* @__PURE__ */ v(m, { className: "h-4 w-4" })
|
|
270
341
|
}),
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
-
label:
|
|
273
|
-
value:
|
|
274
|
-
icon: /* @__PURE__ */
|
|
342
|
+
/* @__PURE__ */ v(i, {
|
|
343
|
+
label: S("healthybowl.financial.transactions.stats.count.label", "Transaction Count"),
|
|
344
|
+
value: C.length,
|
|
345
|
+
icon: /* @__PURE__ */ v(se, { className: "h-4 w-4" })
|
|
275
346
|
})
|
|
276
347
|
]
|
|
277
348
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
-
searchValue:
|
|
280
|
-
onSearchChange:
|
|
281
|
-
searchPlaceholder:
|
|
282
|
-
filters: /* @__PURE__ */
|
|
283
|
-
/* @__PURE__ */
|
|
284
|
-
value:
|
|
285
|
-
onChange: (e) =>
|
|
349
|
+
/* @__PURE__ */ v(ne, {
|
|
350
|
+
searchValue: D,
|
|
351
|
+
onSearchChange: O,
|
|
352
|
+
searchPlaceholder: S("healthybowl.financial.transactions.filters.searchPlaceholder", "Search by description or reference..."),
|
|
353
|
+
filters: /* @__PURE__ */ y(_, { children: [
|
|
354
|
+
/* @__PURE__ */ y("select", {
|
|
355
|
+
value: k,
|
|
356
|
+
onChange: (e) => A(e.target.value),
|
|
286
357
|
className: Q,
|
|
287
358
|
children: [
|
|
288
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ v("option", {
|
|
289
360
|
value: "all",
|
|
290
|
-
children:
|
|
361
|
+
children: S("healthybowl.financial.transactions.filters.type.all", "All Types")
|
|
291
362
|
}),
|
|
292
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ v("option", {
|
|
293
364
|
value: "income",
|
|
294
|
-
children:
|
|
365
|
+
children: q.income
|
|
295
366
|
}),
|
|
296
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ v("option", {
|
|
297
368
|
value: "expense",
|
|
298
|
-
children:
|
|
369
|
+
children: q.expense
|
|
299
370
|
})
|
|
300
371
|
]
|
|
301
372
|
}),
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
value:
|
|
304
|
-
onChange: (e) =>
|
|
373
|
+
/* @__PURE__ */ y("select", {
|
|
374
|
+
value: j,
|
|
375
|
+
onChange: (e) => M(e.target.value),
|
|
305
376
|
className: Q,
|
|
306
|
-
children: [/* @__PURE__ */
|
|
377
|
+
children: [/* @__PURE__ */ v("option", {
|
|
307
378
|
value: "all",
|
|
308
|
-
children:
|
|
309
|
-
}),
|
|
379
|
+
children: S("healthybowl.financial.transactions.filters.category.all", "All Categories")
|
|
380
|
+
}), b.map((e) => /* @__PURE__ */ v("option", {
|
|
310
381
|
value: e,
|
|
311
|
-
children:
|
|
382
|
+
children: J[e]
|
|
312
383
|
}, e))]
|
|
313
384
|
}),
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
-
value:
|
|
316
|
-
onChange: (e) =>
|
|
385
|
+
/* @__PURE__ */ y("select", {
|
|
386
|
+
value: N,
|
|
387
|
+
onChange: (e) => P(e.target.value),
|
|
317
388
|
className: Q,
|
|
318
389
|
children: [
|
|
319
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ v("option", {
|
|
320
391
|
value: "all",
|
|
321
|
-
children:
|
|
392
|
+
children: S("healthybowl.financial.transactions.filters.status.all", "All Statuses")
|
|
322
393
|
}),
|
|
323
|
-
/* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ v("option", {
|
|
324
395
|
value: "completed",
|
|
325
|
-
children:
|
|
396
|
+
children: Y.completed
|
|
326
397
|
}),
|
|
327
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ v("option", {
|
|
328
399
|
value: "pending",
|
|
329
|
-
children:
|
|
400
|
+
children: Y.pending
|
|
330
401
|
}),
|
|
331
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ v("option", {
|
|
332
403
|
value: "failed",
|
|
333
|
-
children:
|
|
404
|
+
children: Y.failed
|
|
334
405
|
})
|
|
335
406
|
]
|
|
336
407
|
})
|
|
337
408
|
] })
|
|
338
409
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
-
columns:
|
|
341
|
-
data:
|
|
410
|
+
/* @__PURE__ */ v(a, {
|
|
411
|
+
columns: Ce,
|
|
412
|
+
data: W,
|
|
342
413
|
keyField: "id",
|
|
343
|
-
emptyMessage:
|
|
414
|
+
emptyMessage: S("healthybowl.financial.transactions.table.empty", "No transactions found.")
|
|
344
415
|
})
|
|
345
416
|
] }),
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
open:
|
|
348
|
-
onClose:
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
title: T("healthybowl.financial.transactions.modal.title", "Add Transaction"),
|
|
352
|
-
description: T("healthybowl.financial.transactions.modal.description", "Record a new income or expense"),
|
|
417
|
+
/* @__PURE__ */ v(c, {
|
|
418
|
+
open: F,
|
|
419
|
+
onClose: X,
|
|
420
|
+
title: z ? S("healthybowl.financial.transactions.modal.editTitle", "Edit Transaction") : S("healthybowl.financial.transactions.modal.title", "Add Transaction"),
|
|
421
|
+
description: z ? S("healthybowl.financial.transactions.modal.editDescription", "Update this income or expense record") : S("healthybowl.financial.transactions.modal.description", "Record a new income or expense"),
|
|
353
422
|
size: "lg",
|
|
354
|
-
footer: /* @__PURE__ */
|
|
355
|
-
onClick:
|
|
356
|
-
B(!1), W(w);
|
|
357
|
-
},
|
|
423
|
+
footer: /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("button", {
|
|
424
|
+
onClick: X,
|
|
358
425
|
className: "rounded-md border border-border px-4 py-2 text-sm font-medium text-foreground transition-colors hover:bg-muted",
|
|
359
|
-
children:
|
|
360
|
-
}), /* @__PURE__ */
|
|
361
|
-
onClick:
|
|
362
|
-
disabled:
|
|
426
|
+
children: S("healthybowl.common.cancel", "Cancel")
|
|
427
|
+
}), /* @__PURE__ */ v("button", {
|
|
428
|
+
onClick: ye,
|
|
429
|
+
disabled: L,
|
|
363
430
|
className: "rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background transition-opacity hover:opacity-90 disabled:opacity-60",
|
|
364
|
-
children:
|
|
431
|
+
children: L ? z ? S("healthybowl.financial.transactions.modal.updating", "Saving...") : S("healthybowl.financial.transactions.modal.submitting", "Adding...") : z ? S("healthybowl.financial.transactions.modal.update", "Save Changes") : S("healthybowl.financial.transactions.actions.add", "Add Transaction")
|
|
365
432
|
})] }),
|
|
366
|
-
children: /* @__PURE__ */
|
|
433
|
+
children: /* @__PURE__ */ y("div", {
|
|
367
434
|
className: "grid gap-4 sm:grid-cols-2",
|
|
368
435
|
children: [
|
|
369
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
370
437
|
className: "mb-1 block text-sm font-medium text-foreground",
|
|
371
|
-
children:
|
|
372
|
-
}), /* @__PURE__ */
|
|
438
|
+
children: S("healthybowl.financial.transactions.form.fields.date.label", "Date *")
|
|
439
|
+
}), /* @__PURE__ */ v("input", {
|
|
373
440
|
type: "date",
|
|
374
|
-
value:
|
|
441
|
+
value: H.date,
|
|
375
442
|
onChange: (e) => Z("date", e.target.value),
|
|
376
443
|
className: $
|
|
377
444
|
})] }),
|
|
378
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
379
446
|
className: "mb-1 block text-sm font-medium text-foreground",
|
|
380
|
-
children:
|
|
381
|
-
}), /* @__PURE__ */
|
|
382
|
-
value:
|
|
447
|
+
children: S("healthybowl.financial.transactions.form.fields.type.label", "Type *")
|
|
448
|
+
}), /* @__PURE__ */ y("select", {
|
|
449
|
+
value: H.type,
|
|
383
450
|
onChange: (e) => Z("type", e.target.value),
|
|
384
451
|
className: e($, "cursor-pointer"),
|
|
385
|
-
children: [/* @__PURE__ */
|
|
452
|
+
children: [/* @__PURE__ */ v("option", {
|
|
386
453
|
value: "income",
|
|
387
|
-
children:
|
|
388
|
-
}), /* @__PURE__ */
|
|
454
|
+
children: q.income
|
|
455
|
+
}), /* @__PURE__ */ v("option", {
|
|
389
456
|
value: "expense",
|
|
390
|
-
children:
|
|
457
|
+
children: q.expense
|
|
391
458
|
})]
|
|
392
459
|
})] }),
|
|
393
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
394
461
|
className: "mb-1 block text-sm font-medium text-foreground",
|
|
395
|
-
children:
|
|
396
|
-
}), /* @__PURE__ */
|
|
397
|
-
value:
|
|
462
|
+
children: S("healthybowl.financial.transactions.form.fields.category.label", "Category *")
|
|
463
|
+
}), /* @__PURE__ */ v("select", {
|
|
464
|
+
value: H.category,
|
|
398
465
|
onChange: (e) => Z("category", e.target.value),
|
|
399
466
|
className: e($, "cursor-pointer"),
|
|
400
|
-
children:
|
|
467
|
+
children: b.map((e) => /* @__PURE__ */ v("option", {
|
|
401
468
|
value: e,
|
|
402
|
-
children:
|
|
469
|
+
children: J[e]
|
|
403
470
|
}, e))
|
|
404
471
|
})] }),
|
|
405
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
406
473
|
className: "mb-1 block text-sm font-medium text-foreground",
|
|
407
|
-
children:
|
|
408
|
-
}), /* @__PURE__ */
|
|
474
|
+
children: S("healthybowl.financial.transactions.form.fields.amount.label", "Amount *")
|
|
475
|
+
}), /* @__PURE__ */ v("input", {
|
|
409
476
|
type: "number",
|
|
410
|
-
value:
|
|
477
|
+
value: H.amount,
|
|
411
478
|
onChange: (e) => Z("amount", e.target.value),
|
|
412
479
|
placeholder: "0.00",
|
|
413
480
|
className: $,
|
|
414
481
|
min: "0",
|
|
415
482
|
step: "0.01"
|
|
416
483
|
})] }),
|
|
417
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
418
485
|
className: "mb-1 block text-sm font-medium text-foreground",
|
|
419
|
-
children:
|
|
420
|
-
}), /* @__PURE__ */
|
|
421
|
-
value:
|
|
486
|
+
children: S("healthybowl.financial.transactions.form.fields.status.label", "Status *")
|
|
487
|
+
}), /* @__PURE__ */ y("select", {
|
|
488
|
+
value: H.status,
|
|
422
489
|
onChange: (e) => Z("status", e.target.value),
|
|
423
490
|
className: e($, "cursor-pointer"),
|
|
424
491
|
children: [
|
|
425
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ v("option", {
|
|
426
493
|
value: "completed",
|
|
427
|
-
children:
|
|
494
|
+
children: Y.completed
|
|
428
495
|
}),
|
|
429
|
-
/* @__PURE__ */
|
|
496
|
+
/* @__PURE__ */ v("option", {
|
|
430
497
|
value: "pending",
|
|
431
|
-
children:
|
|
498
|
+
children: Y.pending
|
|
432
499
|
}),
|
|
433
|
-
/* @__PURE__ */
|
|
500
|
+
/* @__PURE__ */ v("option", {
|
|
434
501
|
value: "failed",
|
|
435
|
-
children:
|
|
502
|
+
children: Y.failed
|
|
436
503
|
})
|
|
437
504
|
]
|
|
438
505
|
})] }),
|
|
439
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ y("div", {
|
|
440
507
|
className: "sm:col-span-2",
|
|
441
|
-
children: [/* @__PURE__ */
|
|
508
|
+
children: [/* @__PURE__ */ v("label", {
|
|
442
509
|
className: "mb-1 block text-sm font-medium text-foreground",
|
|
443
|
-
children:
|
|
444
|
-
}), /* @__PURE__ */
|
|
510
|
+
children: S("healthybowl.financial.transactions.form.fields.description.label", "Description *")
|
|
511
|
+
}), /* @__PURE__ */ v("input", {
|
|
445
512
|
type: "text",
|
|
446
|
-
value:
|
|
513
|
+
value: H.description,
|
|
447
514
|
onChange: (e) => Z("description", e.target.value),
|
|
448
|
-
placeholder:
|
|
515
|
+
placeholder: S("healthybowl.financial.transactions.form.fields.description.placeholder", "Transaction description"),
|
|
449
516
|
className: $
|
|
450
517
|
})]
|
|
451
518
|
}),
|
|
452
|
-
/* @__PURE__ */
|
|
519
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
453
520
|
className: "mb-1 block text-sm font-medium text-foreground",
|
|
454
|
-
children:
|
|
455
|
-
}), /* @__PURE__ */
|
|
456
|
-
value:
|
|
521
|
+
children: S("healthybowl.financial.transactions.form.fields.paymentMethod.label", "Payment Method")
|
|
522
|
+
}), /* @__PURE__ */ v("select", {
|
|
523
|
+
value: H.paymentMethod,
|
|
457
524
|
onChange: (e) => Z("paymentMethod", e.target.value),
|
|
458
525
|
className: e($, "cursor-pointer"),
|
|
459
|
-
children:
|
|
526
|
+
children: ue.map((e) => /* @__PURE__ */ v("option", {
|
|
460
527
|
value: e,
|
|
461
|
-
children:
|
|
528
|
+
children: ve[e] ?? e
|
|
462
529
|
}, e))
|
|
463
530
|
})] }),
|
|
464
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
465
532
|
className: "mb-1 block text-sm font-medium text-foreground",
|
|
466
|
-
children:
|
|
467
|
-
}), /* @__PURE__ */
|
|
533
|
+
children: S("healthybowl.financial.transactions.form.fields.reference.label", "Reference")
|
|
534
|
+
}), /* @__PURE__ */ v("input", {
|
|
468
535
|
type: "text",
|
|
469
|
-
value:
|
|
536
|
+
value: H.reference,
|
|
470
537
|
onChange: (e) => Z("reference", e.target.value),
|
|
471
538
|
placeholder: "INV-2025-XXX",
|
|
472
539
|
className: $
|
|
@@ -474,14 +541,14 @@ var C = [
|
|
|
474
541
|
]
|
|
475
542
|
})
|
|
476
543
|
}),
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
toasts:
|
|
479
|
-
onDismiss:
|
|
544
|
+
/* @__PURE__ */ v(s, {
|
|
545
|
+
toasts: me,
|
|
546
|
+
onDismiss: he
|
|
480
547
|
})
|
|
481
548
|
]
|
|
482
549
|
});
|
|
483
550
|
};
|
|
484
551
|
//#endregion
|
|
485
|
-
export {
|
|
552
|
+
export { S as TransactionsPage };
|
|
486
553
|
|
|
487
554
|
//# sourceMappingURL=TransactionsPage.js.map
|