@mx-cartographer/experiences 7.0.3 → 7.0.5
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/CHANGELOG.md +8 -0
- package/dist/{ManageIncome-BtKRPjvO.mjs → ManageIncome-DT62iZim.mjs} +172 -174
- package/dist/RecurringSettings-D8XKxI2O.mjs +79 -0
- package/dist/{RecurringTransactionsStore-BKLD3OWo.mjs → RecurringTransactionsStore-D62XJtdL.mjs} +1 -1
- package/dist/RepeatingTransaction-BW4J-jeJ.mjs +291 -0
- package/dist/budgets/index.es.js +3 -3
- package/dist/cashflow/index.es.js +187 -186
- package/dist/common/index.es.js +3 -3
- package/dist/finstrong/index.es.js +1 -1
- package/dist/recurringtransactions/index.es.js +7 -7
- package/package.json +1 -1
- package/dist/RecurringSettings-Dqn4pjZ0.mjs +0 -81
- package/dist/RepeatingTransaction-BPWfaB3f.mjs +0 -282
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { jsxs as c, jsx as e, Fragment as
|
|
1
|
+
import { jsxs as c, jsx as e, Fragment as L } from "react/jsx-runtime";
|
|
2
2
|
import u from "react";
|
|
3
3
|
import { observer as A } from "mobx-react-lite";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import P from "@mui/material/Box";
|
|
5
|
+
import T from "@mui/material/Divider";
|
|
6
6
|
import K from "@mui/material/List";
|
|
7
|
-
import
|
|
7
|
+
import p from "@mui/material/Stack";
|
|
8
8
|
import re from "@mui/material/ListItem";
|
|
9
9
|
import ae from "@mui/material/ListItemAvatar";
|
|
10
10
|
import ie from "@mui/material/ListItemButton";
|
|
11
11
|
import se from "@mui/material/ListItemText";
|
|
12
|
-
import { MerchantLogo as
|
|
13
|
-
import { F as
|
|
12
|
+
import { MerchantLogo as Q, Text as x, H1 as ce, InstitutionLogo as le, P as U } from "@mxenabled/mxui";
|
|
13
|
+
import { F as d, S as N, D as Y, g as $, R as E, e as de } from "./RepeatingTransaction-BW4J-jeJ.mjs";
|
|
14
14
|
import { subDays as ue } from "date-fns/subDays";
|
|
15
|
-
import { startOfToday as
|
|
15
|
+
import { startOfToday as z } from "date-fns/startOfToday";
|
|
16
16
|
import { endOfMonth as _e } from "date-fns/endOfMonth";
|
|
17
|
-
import
|
|
18
|
-
import { Delete as me, Add as
|
|
19
|
-
import { T as
|
|
17
|
+
import H from "@mui/material/Button";
|
|
18
|
+
import { Delete as me, Add as ye, ReceiptLong as pe } from "@mxenabled/mx-icons";
|
|
19
|
+
import { T as X, a as he, u as ge, S as fe, b as Ce } from "./TransactionDetails-D4B9DSWo.mjs";
|
|
20
20
|
import { getDayOfYear as be } from "date-fns/getDayOfYear";
|
|
21
21
|
import { setDayOfYear as Se } from "date-fns/setDayOfYear";
|
|
22
22
|
import { AdapterDateFns as ve } from "@mui/x-date-pickers/AdapterDateFnsV3";
|
|
23
23
|
import { DatePicker as xe } from "@mui/x-date-pickers";
|
|
24
24
|
import { LocalizationProvider as we } from "@mui/x-date-pickers/LocalizationProvider";
|
|
25
|
-
import { u as w, h as M, e as F, a as Ae, f as
|
|
26
|
-
import { b as Ie, f as
|
|
25
|
+
import { u as w, h as M, e as F, a as Ae, f as Z, o as De } from "./hooks-02T565vf.mjs";
|
|
26
|
+
import { b as Ie, f as J } from "./NumberFormatting-CtWHhyBX.mjs";
|
|
27
27
|
import { D as O } from "./Drawer-kEE73B87.mjs";
|
|
28
|
-
import { A as
|
|
28
|
+
import { A as R } from "./WidgetContainer-BG-fdDOf.mjs";
|
|
29
29
|
import { f as Ee, D as Re, a as Te } from "./Dialog-CWW597AF.mjs";
|
|
30
30
|
import { formatISO as Le } from "date-fns/formatISO";
|
|
31
31
|
import { fromUnixTime as Oe } from "date-fns/fromUnixTime";
|
|
32
32
|
import { S as ke } from "./SearchBox-B2_zLv8-.mjs";
|
|
33
33
|
import { h as Ne } from "./DateUtil-BcuH7ErC.mjs";
|
|
34
|
-
import { b as
|
|
35
|
-
import { T as
|
|
36
|
-
const
|
|
34
|
+
import { b as B } from "./Category-CevNQ03n.mjs";
|
|
35
|
+
import { T as V } from "./Transaction-CyqrHmAA.mjs";
|
|
36
|
+
const ee = ({
|
|
37
37
|
frequency: n,
|
|
38
38
|
firstDay: t,
|
|
39
39
|
secondDay: r,
|
|
40
40
|
onFrequencyChange: a,
|
|
41
41
|
onFirstDayChange: s,
|
|
42
|
-
onSecondDayChange:
|
|
42
|
+
onSecondDayChange: l
|
|
43
43
|
}) => {
|
|
44
44
|
const { recurring: o } = w(), i = u.useMemo(
|
|
45
45
|
() => [
|
|
46
|
-
{ id:
|
|
47
|
-
{ id:
|
|
48
|
-
{ id:
|
|
49
|
-
{ id:
|
|
50
|
-
{ id:
|
|
51
|
-
{ id:
|
|
52
|
-
{ id:
|
|
53
|
-
{ id:
|
|
46
|
+
{ id: d.EveryWeek, label: o.frequency_every_week },
|
|
47
|
+
{ id: d.EveryOtherWeek, label: o.frequency_every_other_week },
|
|
48
|
+
{ id: d.TwiceAMonth, label: o.frequency_twice_a_month },
|
|
49
|
+
{ id: d.EveryMonth, label: o.frequency_every_month },
|
|
50
|
+
{ id: d.EveryOtherMonth, label: o.frequency_every_other_month },
|
|
51
|
+
{ id: d.EveryQuarter, label: o.frequency_every_quarter },
|
|
52
|
+
{ id: d.EveryOtherQuarter, label: o.frequency_every_other_quarter },
|
|
53
|
+
{ id: d.EveryYear, label: o.frequency_every_year }
|
|
54
54
|
],
|
|
55
55
|
[o]
|
|
56
56
|
), m = [
|
|
@@ -61,15 +61,15 @@ const V = ({
|
|
|
61
61
|
{ id: 4, label: o.weekday_thursday },
|
|
62
62
|
{ id: 5, label: o.weekday_friday },
|
|
63
63
|
{ id: 6, label: o.weekday_saturday }
|
|
64
|
-
], h = [...Array(31).keys()].map((
|
|
65
|
-
id:
|
|
66
|
-
label: Ie(
|
|
64
|
+
], h = [...Array(31).keys()].map((y) => ({
|
|
65
|
+
id: y + 1,
|
|
66
|
+
label: Ie(y + 1)
|
|
67
67
|
}));
|
|
68
68
|
h[30].label += ` (${o.last_day_of_month})`;
|
|
69
|
-
const C = h.slice(0, 15), v = h.slice(14), b = n ===
|
|
70
|
-
|
|
69
|
+
const C = h.slice(0, 15), v = h.slice(14), b = n === d.EveryWeek || n === d.EveryOtherWeek, g = n === d.TwiceAMonth || n === d.EveryMonth || n === d.EveryOtherMonth || n === d.EveryQuarter || n === d.EveryOtherQuarter, D = Se(z(), t), f = (y) => {
|
|
70
|
+
y && s(be(y));
|
|
71
71
|
};
|
|
72
|
-
return /* @__PURE__ */ c(
|
|
72
|
+
return /* @__PURE__ */ c(p, { gap: 24, sx: { m: 24 }, children: [
|
|
73
73
|
/* @__PURE__ */ e(
|
|
74
74
|
N,
|
|
75
75
|
{
|
|
@@ -88,53 +88,53 @@ const V = ({
|
|
|
88
88
|
value: t
|
|
89
89
|
}
|
|
90
90
|
),
|
|
91
|
-
|
|
91
|
+
g && /* @__PURE__ */ e(
|
|
92
92
|
N,
|
|
93
93
|
{
|
|
94
|
-
label: n ===
|
|
94
|
+
label: n === d.TwiceAMonth ? o.first_day_of_the_month : o.day_of_the_month,
|
|
95
95
|
onChange: s,
|
|
96
|
-
options: n ===
|
|
96
|
+
options: n === d.TwiceAMonth ? C : h,
|
|
97
97
|
value: t
|
|
98
98
|
}
|
|
99
99
|
),
|
|
100
|
-
n ===
|
|
100
|
+
n === d.TwiceAMonth && /* @__PURE__ */ e(
|
|
101
101
|
N,
|
|
102
102
|
{
|
|
103
103
|
label: o.second_day_of_the_month,
|
|
104
|
-
onChange:
|
|
104
|
+
onChange: l,
|
|
105
105
|
options: v,
|
|
106
106
|
value: r || 0
|
|
107
107
|
}
|
|
108
108
|
),
|
|
109
|
-
n ===
|
|
109
|
+
n === d.EveryYear && /* @__PURE__ */ e(we, { dateAdapter: ve, children: /* @__PURE__ */ e(
|
|
110
110
|
xe,
|
|
111
111
|
{
|
|
112
112
|
disablePast: !0,
|
|
113
113
|
label: o.next_payment_date,
|
|
114
|
-
onChange:
|
|
114
|
+
onChange: f,
|
|
115
115
|
value: D
|
|
116
116
|
}
|
|
117
117
|
) })
|
|
118
118
|
] });
|
|
119
119
|
}, Me = A(({ repeatingTransaction: n }) => {
|
|
120
|
-
const { recurring: t } = w(), { updateRepeatingTransaction: r } = M(), { onEvent: a } = F(), [s,
|
|
120
|
+
const { recurring: t } = w(), { updateRepeatingTransaction: r } = M(), { onEvent: a } = F(), [s, l] = u.useState(!1), [o, i] = u.useState(n.recurrence_type), [m, h] = u.useState(n.recurrence_day), [C, v] = u.useState(n.second_recurrence_day), b = async () => {
|
|
121
121
|
await r({
|
|
122
122
|
...n,
|
|
123
123
|
recurrence_type: o,
|
|
124
124
|
recurrence_day: m,
|
|
125
125
|
second_recurrence_day: C
|
|
126
|
-
}),
|
|
127
|
-
},
|
|
128
|
-
|
|
126
|
+
}), l(!1);
|
|
127
|
+
}, g = () => {
|
|
128
|
+
l(!0), a(R.RECURRING_TRANSACTIONS_DETAILS_CLICK_PAYMENT_SCHEDULE);
|
|
129
129
|
};
|
|
130
|
-
return /* @__PURE__ */ c(
|
|
130
|
+
return /* @__PURE__ */ c(L, { children: [
|
|
131
131
|
/* @__PURE__ */ e(
|
|
132
132
|
Y,
|
|
133
133
|
{
|
|
134
134
|
iconName: "sync",
|
|
135
135
|
label: t.activity_schedule,
|
|
136
|
-
onClick:
|
|
137
|
-
value: `${
|
|
136
|
+
onClick: g,
|
|
137
|
+
value: `${$(t, n, !0)}`
|
|
138
138
|
}
|
|
139
139
|
),
|
|
140
140
|
/* @__PURE__ */ e(
|
|
@@ -142,11 +142,11 @@ const V = ({
|
|
|
142
142
|
{
|
|
143
143
|
ariaLabelClose: t.close_drawer_aria,
|
|
144
144
|
isOpen: s,
|
|
145
|
-
onClose: () =>
|
|
145
|
+
onClose: () => l(!1),
|
|
146
146
|
onPrimaryAction: b,
|
|
147
147
|
title: t.payment_schedule,
|
|
148
148
|
children: /* @__PURE__ */ e(
|
|
149
|
-
|
|
149
|
+
ee,
|
|
150
150
|
{
|
|
151
151
|
firstDay: m,
|
|
152
152
|
frequency: o,
|
|
@@ -161,37 +161,37 @@ const V = ({
|
|
|
161
161
|
] });
|
|
162
162
|
}), Fe = A(
|
|
163
163
|
({ onDeleted: n, recurringTransaction: t }) => {
|
|
164
|
-
const { recurring: r } = w(), { selectedAccountGuids: a } = Ae(), { onEvent: s } = F(), { deleteRepeatingTransaction:
|
|
164
|
+
const { recurring: r } = w(), { selectedAccountGuids: a } = Ae(), { onEvent: s } = F(), { deleteRepeatingTransaction: l } = M(), { setFilter: o, transactions: i } = Z(), { amount: m, description: h, merchant_guid: C } = t, [v, b] = u.useState(!1), [g, D] = u.useState("");
|
|
165
165
|
u.useEffect(() => {
|
|
166
166
|
o({
|
|
167
167
|
accounts: a,
|
|
168
|
-
dateRange: { start: ue(
|
|
168
|
+
dateRange: { start: ue(z(), 90), end: _e(z()) },
|
|
169
169
|
custom: (_) => _.repeating_transaction_guid === t.guid
|
|
170
170
|
});
|
|
171
171
|
}, [t]);
|
|
172
|
-
const
|
|
173
|
-
() => i.find((_) => _.guid ===
|
|
174
|
-
[
|
|
175
|
-
),
|
|
176
|
-
await
|
|
172
|
+
const f = u.useMemo(
|
|
173
|
+
() => i.find((_) => _.guid === g),
|
|
174
|
+
[g, i]
|
|
175
|
+
), y = t.repeating_transaction_type === E.Income, k = async () => {
|
|
176
|
+
await l(t.guid), n();
|
|
177
177
|
}, G = () => {
|
|
178
|
-
b(!0), s(
|
|
178
|
+
b(!0), s(R.RECURRING_TRANSACTIONS_DETAILS_CLICK_DELETE);
|
|
179
179
|
};
|
|
180
|
-
return /* @__PURE__ */ c(
|
|
181
|
-
/* @__PURE__ */ c(
|
|
180
|
+
return /* @__PURE__ */ c(p, { bgcolor: "background.default", direction: "column", height: "100%", children: [
|
|
181
|
+
/* @__PURE__ */ c(p, { direction: "column", m: 24, children: [
|
|
182
182
|
/* @__PURE__ */ e(
|
|
183
|
-
|
|
183
|
+
Q,
|
|
184
184
|
{
|
|
185
|
-
categoryGuid:
|
|
185
|
+
categoryGuid: f?.category_guid || "",
|
|
186
186
|
merchantGuid: C,
|
|
187
187
|
size: 64,
|
|
188
188
|
sx: { mb: 12 }
|
|
189
189
|
}
|
|
190
190
|
),
|
|
191
191
|
/* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: h }),
|
|
192
|
-
/* @__PURE__ */ c(ce, { color:
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
/* @__PURE__ */ c(ce, { color: y ? "success.main" : "text.primary", sx: { my: 4 }, children: [
|
|
193
|
+
y ? "+" : "",
|
|
194
|
+
J(m, "0,0.00")
|
|
195
195
|
] }),
|
|
196
196
|
/* @__PURE__ */ e(x, { color: "text.secondary", variant: "body2", children: `${r.next_payment_date}: ${Ee(
|
|
197
197
|
t.predicted_occurs_on,
|
|
@@ -199,7 +199,7 @@ const V = ({
|
|
|
199
199
|
)}` })
|
|
200
200
|
] }),
|
|
201
201
|
/* @__PURE__ */ c(K, { sx: { bgcolor: "background.paper" }, children: [
|
|
202
|
-
t.account && /* @__PURE__ */ c(
|
|
202
|
+
t.account && /* @__PURE__ */ c(L, { children: [
|
|
203
203
|
/* @__PURE__ */ e(
|
|
204
204
|
Y,
|
|
205
205
|
{
|
|
@@ -208,56 +208,56 @@ const V = ({
|
|
|
208
208
|
value: t.account.institutionName || ""
|
|
209
209
|
}
|
|
210
210
|
),
|
|
211
|
-
/* @__PURE__ */ e(
|
|
211
|
+
/* @__PURE__ */ e(T, { variant: "inset" })
|
|
212
212
|
] }),
|
|
213
|
-
|
|
213
|
+
f?.category && /* @__PURE__ */ c(L, { children: [
|
|
214
214
|
/* @__PURE__ */ e(
|
|
215
215
|
Y,
|
|
216
216
|
{
|
|
217
217
|
iconName: "monetization_on",
|
|
218
218
|
label: r.category,
|
|
219
|
-
value:
|
|
219
|
+
value: f.category
|
|
220
220
|
}
|
|
221
221
|
),
|
|
222
|
-
/* @__PURE__ */ e(
|
|
222
|
+
/* @__PURE__ */ e(T, { variant: "inset" })
|
|
223
223
|
] }),
|
|
224
224
|
/* @__PURE__ */ e(Me, { repeatingTransaction: t }),
|
|
225
|
-
/* @__PURE__ */ e(
|
|
225
|
+
/* @__PURE__ */ e(T, {})
|
|
226
226
|
] }),
|
|
227
227
|
/* @__PURE__ */ e(
|
|
228
|
-
|
|
228
|
+
H,
|
|
229
229
|
{
|
|
230
230
|
color: "error",
|
|
231
231
|
onClick: G,
|
|
232
232
|
startIcon: /* @__PURE__ */ e(me, {}),
|
|
233
233
|
sx: { mx: 24, my: 16 },
|
|
234
234
|
variant: "text",
|
|
235
|
-
children:
|
|
235
|
+
children: y ? r.delete_income_title : r.delete_expense_title
|
|
236
236
|
}
|
|
237
237
|
),
|
|
238
238
|
/* @__PURE__ */ e(x, { bold: !0, sx: { ml: 24, mt: 16 }, variant: "Body", children: r.paid_transactions }),
|
|
239
|
-
/* @__PURE__ */ e(
|
|
239
|
+
/* @__PURE__ */ e(X, { height: "30dvh", onClick: D }),
|
|
240
240
|
/* @__PURE__ */ e(
|
|
241
241
|
O,
|
|
242
242
|
{
|
|
243
243
|
ariaLabelClose: r.close_drawer_aria,
|
|
244
|
-
isOpen: !!
|
|
244
|
+
isOpen: !!g && !!f,
|
|
245
245
|
onClose: () => D(""),
|
|
246
246
|
title: r.transaction_details_drawer_title,
|
|
247
|
-
children:
|
|
247
|
+
children: f && /* @__PURE__ */ e(he, { transaction: f })
|
|
248
248
|
}
|
|
249
249
|
),
|
|
250
250
|
/* @__PURE__ */ e(
|
|
251
251
|
Te,
|
|
252
252
|
{
|
|
253
253
|
copy: {
|
|
254
|
-
title:
|
|
254
|
+
title: y ? r.delete_income_title : r.delete_expense_title,
|
|
255
255
|
close_aria: r.close_drawer_aria
|
|
256
256
|
},
|
|
257
257
|
isOpen: v,
|
|
258
258
|
onClose: () => b(!1),
|
|
259
259
|
onPrimaryAction: k,
|
|
260
|
-
children: /* @__PURE__ */ e(x, { children:
|
|
260
|
+
children: /* @__PURE__ */ e(x, { children: y ? r.delete_income_description : r.delete_expense_description })
|
|
261
261
|
}
|
|
262
262
|
)
|
|
263
263
|
] });
|
|
@@ -265,27 +265,27 @@ const V = ({
|
|
|
265
265
|
), Ge = A(
|
|
266
266
|
({ onClick: n = () => {
|
|
267
267
|
}, repeatingTransaction: t }) => {
|
|
268
|
-
const { recurring: r } = w(), [a, s] = u.useState(!1),
|
|
268
|
+
const { recurring: r } = w(), [a, s] = u.useState(!1), l = u.useMemo(
|
|
269
269
|
() => t.transactions.length === 0 ? "" : t.transactions[0].category_guid || "",
|
|
270
270
|
[t]
|
|
271
|
-
), o = t.account?.institutionName || "", i = t.repeating_transaction_type ===
|
|
271
|
+
), o = t.account?.institutionName || "", i = t.repeating_transaction_type === E.Income, m = $(r, t, !0);
|
|
272
272
|
return /* @__PURE__ */ c(re, { disableGutters: !0, disablePadding: !0, children: [
|
|
273
273
|
/* @__PURE__ */ c(ie, { onClick: () => {
|
|
274
274
|
n(t), s(!0);
|
|
275
275
|
}, children: [
|
|
276
276
|
/* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(
|
|
277
|
-
|
|
277
|
+
Q,
|
|
278
278
|
{
|
|
279
|
-
categoryGuid:
|
|
279
|
+
categoryGuid: l,
|
|
280
280
|
merchantGuid: t.merchant_guid
|
|
281
281
|
}
|
|
282
282
|
) }),
|
|
283
|
-
/* @__PURE__ */ e(se, { children: /* @__PURE__ */ c(
|
|
284
|
-
/* @__PURE__ */ c(
|
|
283
|
+
/* @__PURE__ */ e(se, { children: /* @__PURE__ */ c(p, { direction: "row", gap: 4, sx: { justifyContent: "space-between" }, children: [
|
|
284
|
+
/* @__PURE__ */ c(p, { direction: "column", sx: { width: "50%" }, children: [
|
|
285
285
|
/* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: t.description }),
|
|
286
|
-
/* @__PURE__ */ c(
|
|
286
|
+
/* @__PURE__ */ c(p, { alignItems: "center", direction: "row", gap: 6, children: [
|
|
287
287
|
t.account?.institution_guid && /* @__PURE__ */ e(
|
|
288
|
-
|
|
288
|
+
le,
|
|
289
289
|
{
|
|
290
290
|
alt: o,
|
|
291
291
|
institutionGuid: t.account?.institution_guid,
|
|
@@ -295,7 +295,7 @@ const V = ({
|
|
|
295
295
|
/* @__PURE__ */ e(x, { variant: "caption", children: o })
|
|
296
296
|
] })
|
|
297
297
|
] }),
|
|
298
|
-
/* @__PURE__ */ c(
|
|
298
|
+
/* @__PURE__ */ c(p, { alignItems: "flex-end", sx: { width: "50%" }, children: [
|
|
299
299
|
/* @__PURE__ */ c(
|
|
300
300
|
x,
|
|
301
301
|
{
|
|
@@ -304,12 +304,12 @@ const V = ({
|
|
|
304
304
|
variant: "body1",
|
|
305
305
|
children: [
|
|
306
306
|
i ? "+" : "",
|
|
307
|
-
|
|
307
|
+
J(t.amount, "0,0.00")
|
|
308
308
|
]
|
|
309
309
|
}
|
|
310
310
|
),
|
|
311
311
|
/* @__PURE__ */ e(
|
|
312
|
-
|
|
312
|
+
p,
|
|
313
313
|
{
|
|
314
314
|
direction: "row",
|
|
315
315
|
sx: {
|
|
@@ -331,7 +331,7 @@ const V = ({
|
|
|
331
331
|
ariaLabelClose: r.close_drawer_aria,
|
|
332
332
|
isOpen: a,
|
|
333
333
|
onClose: () => s(!1),
|
|
334
|
-
title: t.repeating_transaction_type ===
|
|
334
|
+
title: t.repeating_transaction_type === E.Income ? r.income_details : r.expense_details,
|
|
335
335
|
children: /* @__PURE__ */ e(
|
|
336
336
|
Fe,
|
|
337
337
|
{
|
|
@@ -350,9 +350,9 @@ const V = ({
|
|
|
350
350
|
onSearch: r,
|
|
351
351
|
onSelected: a
|
|
352
352
|
}) => {
|
|
353
|
-
const { recurring: s } = w(), { searchValue:
|
|
354
|
-
return /* @__PURE__ */ c(
|
|
355
|
-
t && /* @__PURE__ */ e(
|
|
353
|
+
const { recurring: s } = w(), { searchValue: l, setSearchValue: o } = ge();
|
|
354
|
+
return /* @__PURE__ */ c(p, { sx: { bgcolor: n, gap: 16, pt: 8 }, children: [
|
|
355
|
+
t && /* @__PURE__ */ e(U, { sx: { mx: 24 }, children: t }),
|
|
356
356
|
/* @__PURE__ */ e(
|
|
357
357
|
ke,
|
|
358
358
|
{
|
|
@@ -362,36 +362,36 @@ const V = ({
|
|
|
362
362
|
o(i), r(i);
|
|
363
363
|
},
|
|
364
364
|
placeholder: s.select_transaction_search_placeholder,
|
|
365
|
-
searchValue:
|
|
365
|
+
searchValue: l
|
|
366
366
|
}
|
|
367
367
|
),
|
|
368
|
-
/* @__PURE__ */ e(
|
|
368
|
+
/* @__PURE__ */ e(X, { bgcolor: n, height: "auto", onClick: a, showLoader: !1 })
|
|
369
369
|
] });
|
|
370
370
|
}
|
|
371
|
-
),
|
|
371
|
+
), Ue = A(
|
|
372
372
|
({
|
|
373
373
|
bgcolor: n = "background.default",
|
|
374
374
|
firstDay: t,
|
|
375
375
|
secondDay: r,
|
|
376
376
|
frequency: a,
|
|
377
377
|
onFrequencyChange: s,
|
|
378
|
-
onFirstDayChange:
|
|
378
|
+
onFirstDayChange: l,
|
|
379
379
|
onSecondDayChange: o,
|
|
380
380
|
transaction: i
|
|
381
381
|
}) => {
|
|
382
382
|
const { recurring: m } = w();
|
|
383
|
-
return /* @__PURE__ */ c(
|
|
384
|
-
/* @__PURE__ */ c(
|
|
385
|
-
/* @__PURE__ */ e(
|
|
383
|
+
return /* @__PURE__ */ c(p, { bgcolor: n, gap: 24, height: "100%", children: [
|
|
384
|
+
/* @__PURE__ */ c(p, { children: [
|
|
385
|
+
/* @__PURE__ */ e(fe, { bgcolor: n, children: Ne(i.date) }),
|
|
386
386
|
/* @__PURE__ */ e(Ce, { transaction: i })
|
|
387
387
|
] }),
|
|
388
388
|
/* @__PURE__ */ e(x, { bold: !0, sx: { mx: 24 }, variant: "Body", children: m.payment_schedule }),
|
|
389
389
|
/* @__PURE__ */ e(
|
|
390
|
-
|
|
390
|
+
ee,
|
|
391
391
|
{
|
|
392
392
|
firstDay: t,
|
|
393
393
|
frequency: a,
|
|
394
|
-
onFirstDayChange:
|
|
394
|
+
onFirstDayChange: l,
|
|
395
395
|
onFrequencyChange: s,
|
|
396
396
|
onSecondDayChange: o,
|
|
397
397
|
secondDay: r
|
|
@@ -399,24 +399,24 @@ const V = ({
|
|
|
399
399
|
)
|
|
400
400
|
] });
|
|
401
401
|
}
|
|
402
|
-
),
|
|
402
|
+
), q = (n) => n.top_level_category_guid !== B.INCOME && n.transaction_type === V.DEBIT, Ye = (n, t) => q(n) ? n.payee?.toLowerCase().includes(t.toLowerCase()) || n.description.toLowerCase().includes(t.toLowerCase()) || n.feed_description.toLowerCase().includes(t.toLowerCase()) : !1, W = (n) => n.top_level_category_guid === B.INCOME || n.top_level_category_guid === B.TRANSFER && n.transaction_type === V.CREDIT, ze = (n, t) => W(n) ? n.payee?.toLowerCase().includes(t.toLowerCase()) || n.description?.toLowerCase().includes(t.toLowerCase()) || n.feed_description?.toLowerCase().includes(t.toLowerCase()) : !1, te = A(
|
|
403
403
|
({
|
|
404
404
|
isIncome: n = !1,
|
|
405
405
|
label: t,
|
|
406
406
|
onAddRecurringTransaction: r = () => null
|
|
407
407
|
}) => {
|
|
408
|
-
const { recurring: a } = w(), { filter: s, setFilter:
|
|
408
|
+
const { recurring: a } = w(), { filter: s, setFilter: l, transactions: o } = Z(), { addRepeatingTransaction: i } = M(), { user: m } = De(), [h, C] = u.useState(!1), [v, b] = u.useState(""), [g, D] = u.useState(d.EveryMonth), [f, y] = u.useState(1), [k, G] = u.useState(15), _ = u.useMemo(
|
|
409
409
|
() => o.find((S) => S.guid === v),
|
|
410
410
|
[v, o]
|
|
411
|
-
),
|
|
412
|
-
C(!0),
|
|
413
|
-
},
|
|
411
|
+
), ne = () => {
|
|
412
|
+
C(!0), l(n ? { ...s, custom: W } : { ...s, custom: q });
|
|
413
|
+
}, oe = async () => {
|
|
414
414
|
if (!_) {
|
|
415
|
-
|
|
415
|
+
j();
|
|
416
416
|
return;
|
|
417
417
|
}
|
|
418
418
|
r();
|
|
419
|
-
const S =
|
|
419
|
+
const S = de(g, Oe(_.date)), I = {
|
|
420
420
|
account_guid: _.account_guid,
|
|
421
421
|
amount: _.amount,
|
|
422
422
|
created_by: 0,
|
|
@@ -424,19 +424,19 @@ const V = ({
|
|
|
424
424
|
merchant_guid: _.merchant_guid,
|
|
425
425
|
description: _.payee || _.description || _.feed_description,
|
|
426
426
|
predicted_occurs_on: Le(S, { representation: "date" }),
|
|
427
|
-
recurrence_day:
|
|
428
|
-
recurrence_type:
|
|
429
|
-
repeating_transaction_type: n ?
|
|
427
|
+
recurrence_day: f,
|
|
428
|
+
recurrence_type: g,
|
|
429
|
+
repeating_transaction_type: n ? E.Income : E.Bill,
|
|
430
430
|
second_recurrence_day: k,
|
|
431
431
|
transaction_type: _.transaction_type,
|
|
432
432
|
user_guid: m.guid
|
|
433
433
|
};
|
|
434
|
-
await i(I, _),
|
|
435
|
-
},
|
|
434
|
+
await i(I, _), j();
|
|
435
|
+
}, j = () => {
|
|
436
436
|
b(""), C(!1);
|
|
437
437
|
};
|
|
438
|
-
return /* @__PURE__ */ c(
|
|
439
|
-
/* @__PURE__ */ e(
|
|
438
|
+
return /* @__PURE__ */ c(L, { children: [
|
|
439
|
+
/* @__PURE__ */ e(H, { onClick: ne, startIcon: /* @__PURE__ */ e(ye, { size: 24 }), variant: "contained", children: t }),
|
|
440
440
|
/* @__PURE__ */ e(
|
|
441
441
|
O,
|
|
442
442
|
{
|
|
@@ -449,9 +449,9 @@ const V = ({
|
|
|
449
449
|
{
|
|
450
450
|
description: n ? a.add_income_description : a.add_expense_description,
|
|
451
451
|
onSearch: (S) => {
|
|
452
|
-
|
|
452
|
+
l({
|
|
453
453
|
...s,
|
|
454
|
-
custom: (I) => n ? S ? ze(I, S) :
|
|
454
|
+
custom: (I) => n ? S ? ze(I, S) : W(I) : S ? Ye(I, S) : q(I)
|
|
455
455
|
});
|
|
456
456
|
},
|
|
457
457
|
onSelected: (S) => b(S)
|
|
@@ -465,14 +465,14 @@ const V = ({
|
|
|
465
465
|
ariaLabelClose: a.close_drawer_aria,
|
|
466
466
|
isOpen: !!v,
|
|
467
467
|
onClose: () => b(""),
|
|
468
|
-
onPrimaryAction:
|
|
468
|
+
onPrimaryAction: oe,
|
|
469
469
|
title: n ? a.income_details : a.expense_details,
|
|
470
470
|
children: _ && /* @__PURE__ */ e(
|
|
471
|
-
|
|
471
|
+
Ue,
|
|
472
472
|
{
|
|
473
|
-
firstDay:
|
|
474
|
-
frequency:
|
|
475
|
-
onFirstDayChange:
|
|
473
|
+
firstDay: f,
|
|
474
|
+
frequency: g,
|
|
475
|
+
onFirstDayChange: y,
|
|
476
476
|
onFrequencyChange: D,
|
|
477
477
|
onSecondDayChange: G,
|
|
478
478
|
secondDay: k,
|
|
@@ -485,19 +485,19 @@ const V = ({
|
|
|
485
485
|
}
|
|
486
486
|
), Be = A(
|
|
487
487
|
({ zeroStateFor: n }) => {
|
|
488
|
-
const { recurring: t } = w(), { onEvent: r } = F(), a = n === "income", s = a ? t.recurring_setting_zero_state_income_title : t.recurring_setting_zero_state_expenses_title,
|
|
489
|
-
return /* @__PURE__ */ c(
|
|
490
|
-
/* @__PURE__ */ e(
|
|
491
|
-
/* @__PURE__ */ e(
|
|
492
|
-
/* @__PURE__ */ e(
|
|
488
|
+
const { recurring: t } = w(), { onEvent: r } = F(), a = n === "income", s = a ? t.recurring_setting_zero_state_income_title : t.recurring_setting_zero_state_expenses_title, l = a ? t.recurring_setting_zero_state_income_description : t.recurring_setting_zero_state_expenses_description, o = a ? t.add_income : t.add_expense;
|
|
489
|
+
return /* @__PURE__ */ c(p, { sx: { alignItems: "center", p: 24, pt: 48 }, children: [
|
|
490
|
+
/* @__PURE__ */ e(pe, { size: 48 }),
|
|
491
|
+
/* @__PURE__ */ e(U, { sx: { my: 8, fontWeight: 600 }, variant: "body1", children: s }),
|
|
492
|
+
/* @__PURE__ */ e(U, { color: "text.secondary", sx: { mb: 32 }, variant: "subtitle2", children: l }),
|
|
493
493
|
/* @__PURE__ */ e(
|
|
494
|
-
|
|
494
|
+
te,
|
|
495
495
|
{
|
|
496
496
|
isIncome: a,
|
|
497
497
|
label: o,
|
|
498
498
|
onAddRecurringTransaction: () => {
|
|
499
499
|
r(
|
|
500
|
-
a ?
|
|
500
|
+
a ? R.RECURRING_TRANSACTIONS_CLICK_ADD_INCOME : R.RECURRING_ACTIVITY_CLICK_ADD_EXPENSE
|
|
501
501
|
);
|
|
502
502
|
}
|
|
503
503
|
}
|
|
@@ -506,69 +506,67 @@ const V = ({
|
|
|
506
506
|
}
|
|
507
507
|
), wt = A(({ forOverview: n = !1 }) => {
|
|
508
508
|
const { recurring: t } = w(), { repeatingTransactions: r } = M(), { onEvent: a } = F(), s = (i) => {
|
|
509
|
-
a(
|
|
509
|
+
a(R.RECURRING_TRANSACTIONS_CLICK_INCOME, {
|
|
510
510
|
repeating_transaction_guid: i.guid
|
|
511
511
|
});
|
|
512
|
-
},
|
|
513
|
-
a(
|
|
512
|
+
}, l = () => {
|
|
513
|
+
a(R.RECURRING_TRANSACTIONS_CLICK_ADD_INCOME);
|
|
514
514
|
}, o = r.filter(
|
|
515
|
-
(i) => i.repeating_transaction_type ===
|
|
515
|
+
(i) => i.repeating_transaction_type === E.Income && (i.transactions.length > 0 || i.recurrence_type === d.EveryYear)
|
|
516
516
|
);
|
|
517
|
-
return /* @__PURE__ */ e(
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
{
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
children: /* @__PURE__ */ e(K, { sx: { bgcolor: "background.paper" }, children: o.map((i, m) => /* @__PURE__ */ c(u.Fragment, { children: [
|
|
517
|
+
return /* @__PURE__ */ e(L, { children: o.length !== 0 ? /* @__PURE__ */ c(
|
|
518
|
+
p,
|
|
519
|
+
{
|
|
520
|
+
sx: {
|
|
521
|
+
justifyContent: "space-between",
|
|
522
|
+
height: n ? "calc(100% - 32px)" : "calc(100% - 57px)"
|
|
523
|
+
},
|
|
524
|
+
children: [
|
|
525
|
+
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(K, { sx: { bgcolor: "background.paper" }, children: o.map((i, m) => /* @__PURE__ */ c(u.Fragment, { children: [
|
|
526
526
|
/* @__PURE__ */ e(Ge, { onClick: s, repeatingTransaction: i }),
|
|
527
527
|
/* @__PURE__ */ e(
|
|
528
|
-
|
|
528
|
+
T,
|
|
529
529
|
{
|
|
530
530
|
variant: m < o.length - 1 ? "inset" : "fullWidth"
|
|
531
531
|
}
|
|
532
532
|
)
|
|
533
|
-
] }, i.guid)) })
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
)
|
|
562
|
-
] }) : /* @__PURE__ */ e(Be, { zeroStateFor: "income" }) });
|
|
533
|
+
] }, i.guid)) }) }),
|
|
534
|
+
/* @__PURE__ */ c(P, { children: [
|
|
535
|
+
/* @__PURE__ */ e(T, {}),
|
|
536
|
+
/* @__PURE__ */ e(
|
|
537
|
+
P,
|
|
538
|
+
{
|
|
539
|
+
sx: {
|
|
540
|
+
alignContent: "center",
|
|
541
|
+
bgcolor: "background.paper",
|
|
542
|
+
justifyContent: "flex-end",
|
|
543
|
+
px: 24,
|
|
544
|
+
py: 12,
|
|
545
|
+
textAlign: "right"
|
|
546
|
+
},
|
|
547
|
+
children: /* @__PURE__ */ e(
|
|
548
|
+
te,
|
|
549
|
+
{
|
|
550
|
+
isIncome: !0,
|
|
551
|
+
label: t.add_income,
|
|
552
|
+
onAddRecurringTransaction: l
|
|
553
|
+
}
|
|
554
|
+
)
|
|
555
|
+
}
|
|
556
|
+
)
|
|
557
|
+
] })
|
|
558
|
+
]
|
|
559
|
+
}
|
|
560
|
+
) : /* @__PURE__ */ e(Be, { zeroStateFor: "income" }) });
|
|
563
561
|
});
|
|
564
562
|
export {
|
|
565
|
-
|
|
563
|
+
te as A,
|
|
566
564
|
wt as M,
|
|
567
565
|
Ge as R,
|
|
568
566
|
Pe as S,
|
|
569
567
|
Be as a,
|
|
570
568
|
Fe as b,
|
|
571
|
-
|
|
572
|
-
|
|
569
|
+
Ue as c,
|
|
570
|
+
W as d,
|
|
573
571
|
ze as i
|
|
574
572
|
};
|