@layerfi/components 0.1.26 → 0.1.27
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/esm/index.js +315 -274
- package/dist/esm/index.js.map +4 -4
- package/dist/index.d.ts +31 -9
- package/dist/index.js +296 -255
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -979,7 +979,29 @@ function hasSuggestions(categorization) {
|
|
|
979
979
|
return categorization.suggestions !== void 0;
|
|
980
980
|
}
|
|
981
981
|
|
|
982
|
+
// src/components/BankTransactions/constants.ts
|
|
983
|
+
var CategorizedCategories = [
|
|
984
|
+
"CATEGORIZED" /* CATEGORIZED */,
|
|
985
|
+
"JOURNALING" /* JOURNALING */,
|
|
986
|
+
"SPLIT" /* SPLIT */,
|
|
987
|
+
"MATCHED" /* MATCHED */
|
|
988
|
+
];
|
|
989
|
+
var ReviewCategories = [
|
|
990
|
+
"READY_FOR_INPUT" /* READY_FOR_INPUT */,
|
|
991
|
+
"LAYER_REVIEW" /* LAYER_REVIEW */
|
|
992
|
+
];
|
|
993
|
+
|
|
994
|
+
// src/components/BankTransactions/utils.ts
|
|
995
|
+
var filterVisibility = (display, bankTransaction) => {
|
|
996
|
+
const categorized = CategorizedCategories.includes(
|
|
997
|
+
bankTransaction.categorization_status
|
|
998
|
+
);
|
|
999
|
+
const inReview = ReviewCategories.includes(bankTransaction.categorization_status) && !bankTransaction.recently_categorized;
|
|
1000
|
+
return display === "review" /* review */ && inReview || display === "categorized" /* categorized */ && categorized;
|
|
1001
|
+
};
|
|
1002
|
+
|
|
982
1003
|
// src/utils/bankTransactions.ts
|
|
1004
|
+
var import_date_fns4 = require("date-fns");
|
|
983
1005
|
var hasMatch = (bankTransaction) => {
|
|
984
1006
|
return Boolean(
|
|
985
1007
|
bankTransaction?.suggested_matches && bankTransaction?.suggested_matches?.length > 0 || bankTransaction?.match
|
|
@@ -995,6 +1017,40 @@ var isAlreadyMatched = (bankTransaction) => {
|
|
|
995
1017
|
}
|
|
996
1018
|
return void 0;
|
|
997
1019
|
};
|
|
1020
|
+
var countTransactionsToReview = ({
|
|
1021
|
+
transactions,
|
|
1022
|
+
currentMonthOnly
|
|
1023
|
+
}) => {
|
|
1024
|
+
if (transactions && transactions.length > 0) {
|
|
1025
|
+
if (currentMonthOnly) {
|
|
1026
|
+
const currentMonth = {
|
|
1027
|
+
start: (0, import_date_fns4.startOfMonth)(/* @__PURE__ */ new Date()),
|
|
1028
|
+
end: (0, import_date_fns4.endOfMonth)(/* @__PURE__ */ new Date())
|
|
1029
|
+
};
|
|
1030
|
+
return transactions.filter((tx) => {
|
|
1031
|
+
try {
|
|
1032
|
+
return filterVisibility("review" /* review */, tx) && (0, import_date_fns4.isWithinInterval)((0, import_date_fns4.parseISO)(tx.date), currentMonth);
|
|
1033
|
+
} catch (_err) {
|
|
1034
|
+
return false;
|
|
1035
|
+
}
|
|
1036
|
+
}).length;
|
|
1037
|
+
}
|
|
1038
|
+
return transactions.filter((tx) => filterVisibility("review" /* review */, tx)).length;
|
|
1039
|
+
}
|
|
1040
|
+
return 0;
|
|
1041
|
+
};
|
|
1042
|
+
var getCategorizePayload = (category) => {
|
|
1043
|
+
if (category?.payload && "id" in category.payload && category.payload.id) {
|
|
1044
|
+
return {
|
|
1045
|
+
type: "AccountId",
|
|
1046
|
+
id: category.payload.id
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
return {
|
|
1050
|
+
type: "StableName",
|
|
1051
|
+
stable_name: category?.payload.stable_name || ""
|
|
1052
|
+
};
|
|
1053
|
+
};
|
|
998
1054
|
|
|
999
1055
|
// src/components/BankTransactionRow/BankTransactionRow.tsx
|
|
1000
1056
|
var import_react39 = __toESM(require("react"));
|
|
@@ -1893,7 +1949,7 @@ var MinimizeTwo_default = MinimizeTwo;
|
|
|
1893
1949
|
|
|
1894
1950
|
// src/components/CategorySelect/CategorySelect.tsx
|
|
1895
1951
|
var import_classnames9 = __toESM(require("classnames"));
|
|
1896
|
-
var
|
|
1952
|
+
var import_date_fns5 = require("date-fns");
|
|
1897
1953
|
var mapCategoryToOption = (category) => {
|
|
1898
1954
|
return {
|
|
1899
1955
|
type: "category" /* CATEGORY */,
|
|
@@ -1945,7 +2001,7 @@ var Option = (props) => {
|
|
|
1945
2001
|
...props,
|
|
1946
2002
|
className: `${props.className} Layer__select__option-content__match`
|
|
1947
2003
|
},
|
|
1948
|
-
/* @__PURE__ */ import_react21.default.createElement("div", { className: "Layer__select__option-content__match__main-row" }, /* @__PURE__ */ import_react21.default.createElement("span", { className: "Layer__select__option-content__match__date" }, props.data.payload.date && (0,
|
|
2004
|
+
/* @__PURE__ */ import_react21.default.createElement("div", { className: "Layer__select__option-content__match__main-row" }, /* @__PURE__ */ import_react21.default.createElement("span", { className: "Layer__select__option-content__match__date" }, props.data.payload.date && (0, import_date_fns5.format)((0, import_date_fns5.parseISO)(props.data.payload.date), DATE_FORMAT)), /* @__PURE__ */ import_react21.default.createElement("span", { className: "Layer__select__option-content__match__description" }, props.data.payload.display_name)),
|
|
1949
2005
|
/* @__PURE__ */ import_react21.default.createElement("div", { className: "Layer__select__option-content__match__amount-row" }, /* @__PURE__ */ import_react21.default.createElement("span", { className: "Layer__select__option-content__match__amount" }, "$", centsToDollars(props.data.payload.amount)))
|
|
1950
2006
|
);
|
|
1951
2007
|
}
|
|
@@ -2523,7 +2579,7 @@ var import_react32 = __toESM(require("react"));
|
|
|
2523
2579
|
|
|
2524
2580
|
// src/components/BankTransactionRow/MatchBadge.tsx
|
|
2525
2581
|
var import_react31 = __toESM(require("react"));
|
|
2526
|
-
var
|
|
2582
|
+
var import_date_fns6 = require("date-fns");
|
|
2527
2583
|
var MatchBadge = ({
|
|
2528
2584
|
bankTransaction,
|
|
2529
2585
|
classNamePrefix,
|
|
@@ -2536,7 +2592,7 @@ var MatchBadge = ({
|
|
|
2536
2592
|
Badge,
|
|
2537
2593
|
{
|
|
2538
2594
|
icon: /* @__PURE__ */ import_react31.default.createElement(MinimizeTwo_default, { size: 11 }),
|
|
2539
|
-
tooltip: /* @__PURE__ */ import_react31.default.createElement("span", { className: `${classNamePrefix}__match-tooltip` }, /* @__PURE__ */ import_react31.default.createElement("div", { className: `${classNamePrefix}__match-tooltip__date` }, (0,
|
|
2595
|
+
tooltip: /* @__PURE__ */ import_react31.default.createElement("span", { className: `${classNamePrefix}__match-tooltip` }, /* @__PURE__ */ import_react31.default.createElement("div", { className: `${classNamePrefix}__match-tooltip__date` }, (0, import_date_fns6.format)((0, import_date_fns6.parseISO)(date), dateFormat)), /* @__PURE__ */ import_react31.default.createElement("div", { className: `${classNamePrefix}__match-tooltip__description` }, bankTransaction.match?.details?.description ?? ""), /* @__PURE__ */ import_react31.default.createElement("div", { className: `${classNamePrefix}__match-tooltip__amount` }, "$", centsToDollars(amount)))
|
|
2540
2596
|
},
|
|
2541
2597
|
text
|
|
2542
2598
|
);
|
|
@@ -2546,7 +2602,7 @@ var MatchBadge = ({
|
|
|
2546
2602
|
|
|
2547
2603
|
// src/components/MatchForm/MatchForm.tsx
|
|
2548
2604
|
var import_classnames18 = __toESM(require("classnames"));
|
|
2549
|
-
var
|
|
2605
|
+
var import_date_fns7 = require("date-fns");
|
|
2550
2606
|
var MatchForm = ({
|
|
2551
2607
|
classNamePrefix,
|
|
2552
2608
|
bankTransaction,
|
|
@@ -2581,7 +2637,7 @@ var MatchForm = ({
|
|
|
2581
2637
|
{
|
|
2582
2638
|
className: `Layer__nowrap ${classNamePrefix}__match-table__date`
|
|
2583
2639
|
},
|
|
2584
|
-
/* @__PURE__ */ import_react32.default.createElement("span", null, (0,
|
|
2640
|
+
/* @__PURE__ */ import_react32.default.createElement("span", null, (0, import_date_fns7.format)((0, import_date_fns7.parseISO)(match.details.date), DATE_FORMAT)),
|
|
2585
2641
|
/* @__PURE__ */ import_react32.default.createElement("span", { className: "amount-next-to-date" }, "$", centsToDollars(match.details.amount))
|
|
2586
2642
|
),
|
|
2587
2643
|
/* @__PURE__ */ import_react32.default.createElement("div", { className: `${classNamePrefix}__match-table__desc` }, /* @__PURE__ */ import_react32.default.createElement(
|
|
@@ -2624,7 +2680,7 @@ var MatchForm = ({
|
|
|
2624
2680
|
// src/components/MatchForm/MatchFormMobile.tsx
|
|
2625
2681
|
var import_react33 = __toESM(require("react"));
|
|
2626
2682
|
var import_classnames19 = __toESM(require("classnames"));
|
|
2627
|
-
var
|
|
2683
|
+
var import_date_fns8 = require("date-fns");
|
|
2628
2684
|
var MatchFormMobile = ({
|
|
2629
2685
|
classNamePrefix,
|
|
2630
2686
|
bankTransaction,
|
|
@@ -2671,7 +2727,7 @@ var MatchFormMobile = ({
|
|
|
2671
2727
|
size: "sm" /* sm */,
|
|
2672
2728
|
as: "span"
|
|
2673
2729
|
},
|
|
2674
|
-
(0,
|
|
2730
|
+
(0, import_date_fns8.format)((0, import_date_fns8.parseISO)(match.details.date), MONTH_DAY_FORMAT)
|
|
2675
2731
|
))),
|
|
2676
2732
|
/* @__PURE__ */ import_react33.default.createElement("div", { className: `${classNamePrefix}__match-item__col-status` }, selectedMatchId && selectedMatchId === match.id ? /* @__PURE__ */ import_react33.default.createElement(
|
|
2677
2733
|
Check_default,
|
|
@@ -3142,16 +3198,13 @@ var ExpandedBankTransactionRow = (0, import_react37.forwardRef)(
|
|
|
3142
3198
|
}
|
|
3143
3199
|
await categorizeBankTransaction2(
|
|
3144
3200
|
bankTransaction.id,
|
|
3145
|
-
rowState.splits.length === 1 ? {
|
|
3201
|
+
rowState.splits.length === 1 && rowState?.splits[0].category ? {
|
|
3146
3202
|
type: "Category",
|
|
3147
|
-
category:
|
|
3148
|
-
type: "StableName",
|
|
3149
|
-
stable_name: rowState?.splits[0].category?.payload.stable_name
|
|
3150
|
-
}
|
|
3203
|
+
category: getCategorizePayload(rowState?.splits[0].category)
|
|
3151
3204
|
} : {
|
|
3152
3205
|
type: "Split",
|
|
3153
3206
|
entries: rowState.splits.map((split) => ({
|
|
3154
|
-
category: split.category
|
|
3207
|
+
category: split.category ? getCategorizePayload(split.category) : "",
|
|
3155
3208
|
amount: split.amount
|
|
3156
3209
|
}))
|
|
3157
3210
|
}
|
|
@@ -3403,7 +3456,7 @@ var SplitTooltipDetails = ({
|
|
|
3403
3456
|
|
|
3404
3457
|
// src/components/BankTransactionRow/BankTransactionRow.tsx
|
|
3405
3458
|
var import_classnames23 = __toESM(require("classnames"));
|
|
3406
|
-
var
|
|
3459
|
+
var import_date_fns9 = require("date-fns");
|
|
3407
3460
|
var extractDescriptionForSplit = (category) => {
|
|
3408
3461
|
if (!category.entries) {
|
|
3409
3462
|
return "";
|
|
@@ -3490,10 +3543,7 @@ var BankTransactionRow = ({
|
|
|
3490
3543
|
}
|
|
3491
3544
|
await categorizeBankTransaction2(bankTransaction.id, {
|
|
3492
3545
|
type: "Category",
|
|
3493
|
-
category:
|
|
3494
|
-
type: "StableName",
|
|
3495
|
-
stable_name: selectedCategory?.payload.stable_name || ""
|
|
3496
|
-
}
|
|
3546
|
+
category: getCategorizePayload(selectedCategory)
|
|
3497
3547
|
});
|
|
3498
3548
|
setOpen(false);
|
|
3499
3549
|
};
|
|
@@ -3528,7 +3578,7 @@ var BankTransactionRow = ({
|
|
|
3528
3578
|
className: "Layer__table-cell Layer__bank-transaction-table__date-col",
|
|
3529
3579
|
...openRow
|
|
3530
3580
|
},
|
|
3531
|
-
/* @__PURE__ */ import_react39.default.createElement("span", { className: "Layer__table-cell-content" }, (0,
|
|
3581
|
+
/* @__PURE__ */ import_react39.default.createElement("span", { className: "Layer__table-cell-content" }, (0, import_date_fns9.format)((0, import_date_fns9.parseISO)(bankTransaction.date), dateFormat))
|
|
3532
3582
|
),
|
|
3533
3583
|
/* @__PURE__ */ import_react39.default.createElement(
|
|
3534
3584
|
"td",
|
|
@@ -3621,8 +3671,8 @@ var BankTransactionRow = ({
|
|
|
3621
3671
|
bankTransaction,
|
|
3622
3672
|
dateFormat
|
|
3623
3673
|
}
|
|
3624
|
-
), /* @__PURE__ */ import_react39.default.createElement("span", { className: `${className}__category-text__text` }, `${(0,
|
|
3625
|
-
(0,
|
|
3674
|
+
), /* @__PURE__ */ import_react39.default.createElement("span", { className: `${className}__category-text__text` }, `${(0, import_date_fns9.format)(
|
|
3675
|
+
(0, import_date_fns9.parseISO)(bankTransaction.match.bank_transaction.date),
|
|
3626
3676
|
dateFormat
|
|
3627
3677
|
)}, ${bankTransaction.match?.details?.description}`)), bankTransaction?.categorization_status !== "MATCHED" /* MATCHED */ && bankTransaction?.categorization_status !== "SPLIT" /* SPLIT */ && /* @__PURE__ */ import_react39.default.createElement("span", { className: `${className}__category-text__text` }, bankTransaction?.category?.display_name)) : null,
|
|
3628
3678
|
editable && !open && showRetry ? /* @__PURE__ */ import_react39.default.createElement(
|
|
@@ -3697,7 +3747,7 @@ var BankTransactionRow = ({
|
|
|
3697
3747
|
|
|
3698
3748
|
// src/components/BankTransactionList/Assignment.tsx
|
|
3699
3749
|
var import_react40 = __toESM(require("react"));
|
|
3700
|
-
var
|
|
3750
|
+
var import_date_fns10 = require("date-fns");
|
|
3701
3751
|
var Assignment = ({ bankTransaction }) => {
|
|
3702
3752
|
if (bankTransaction.match && bankTransaction.categorization_status === "MATCHED" /* MATCHED */) {
|
|
3703
3753
|
return /* @__PURE__ */ import_react40.default.createElement(import_react40.default.Fragment, null, /* @__PURE__ */ import_react40.default.createElement(
|
|
@@ -3708,8 +3758,8 @@ var Assignment = ({ bankTransaction }) => {
|
|
|
3708
3758
|
dateFormat: DATE_FORMAT,
|
|
3709
3759
|
text: "Matched"
|
|
3710
3760
|
}
|
|
3711
|
-
), /* @__PURE__ */ import_react40.default.createElement(Text, { className: "Layer__bank-transaction-list-item__category-text__text" }, `${(0,
|
|
3712
|
-
(0,
|
|
3761
|
+
), /* @__PURE__ */ import_react40.default.createElement(Text, { className: "Layer__bank-transaction-list-item__category-text__text" }, `${(0, import_date_fns10.format)(
|
|
3762
|
+
(0, import_date_fns10.parseISO)(bankTransaction.match.bank_transaction.date),
|
|
3713
3763
|
DATE_FORMAT
|
|
3714
3764
|
)}, ${bankTransaction.match.bank_transaction.description}`));
|
|
3715
3765
|
}
|
|
@@ -3734,7 +3784,7 @@ var Assignment = ({ bankTransaction }) => {
|
|
|
3734
3784
|
|
|
3735
3785
|
// src/components/BankTransactionList/BankTransactionListItem.tsx
|
|
3736
3786
|
var import_classnames24 = __toESM(require("classnames"));
|
|
3737
|
-
var
|
|
3787
|
+
var import_date_fns11 = require("date-fns");
|
|
3738
3788
|
var BankTransactionListItem = ({
|
|
3739
3789
|
index = 0,
|
|
3740
3790
|
dateFormat,
|
|
@@ -3782,10 +3832,7 @@ var BankTransactionListItem = ({
|
|
|
3782
3832
|
}
|
|
3783
3833
|
categorizeBankTransaction2(bankTransaction.id, {
|
|
3784
3834
|
type: "Category",
|
|
3785
|
-
category:
|
|
3786
|
-
type: "StableName",
|
|
3787
|
-
stable_name: selectedCategory?.payload.stable_name || ""
|
|
3788
|
-
}
|
|
3835
|
+
category: getCategorizePayload(selectedCategory)
|
|
3789
3836
|
});
|
|
3790
3837
|
};
|
|
3791
3838
|
if (removed) {
|
|
@@ -3799,7 +3846,7 @@ var BankTransactionListItem = ({
|
|
|
3799
3846
|
open ? openClassName : "",
|
|
3800
3847
|
showComponent ? "show" : ""
|
|
3801
3848
|
);
|
|
3802
|
-
return /* @__PURE__ */ import_react41.default.createElement("li", { className: rowClassName }, /* @__PURE__ */ import_react41.default.createElement("span", { className: `${className}__heading` }, /* @__PURE__ */ import_react41.default.createElement("div", { className: `${className}__heading__main` }, /* @__PURE__ */ import_react41.default.createElement("span", { className: `${className}__heading-date` }, (0,
|
|
3849
|
+
return /* @__PURE__ */ import_react41.default.createElement("li", { className: rowClassName }, /* @__PURE__ */ import_react41.default.createElement("span", { className: `${className}__heading` }, /* @__PURE__ */ import_react41.default.createElement("div", { className: `${className}__heading__main` }, /* @__PURE__ */ import_react41.default.createElement("span", { className: `${className}__heading-date` }, (0, import_date_fns11.format)((0, import_date_fns11.parseISO)(bankTransaction.date), dateFormat)), /* @__PURE__ */ import_react41.default.createElement("span", { className: `${className}__heading-separator` }), /* @__PURE__ */ import_react41.default.createElement("span", { className: `${className}__heading-account-name` }, bankTransaction.account_name ?? "")), /* @__PURE__ */ import_react41.default.createElement(
|
|
3803
3850
|
"div",
|
|
3804
3851
|
{
|
|
3805
3852
|
onClick: toggleOpen,
|
|
@@ -4124,14 +4171,18 @@ var BusinessForm = ({ bankTransaction }) => {
|
|
|
4124
4171
|
if (!selectedCategory || !selectedCategory.value.payload) {
|
|
4125
4172
|
return;
|
|
4126
4173
|
}
|
|
4174
|
+
const payload = selectedCategory?.value?.payload?.id ? {
|
|
4175
|
+
type: "AccountId",
|
|
4176
|
+
id: selectedCategory.value.payload.id
|
|
4177
|
+
} : {
|
|
4178
|
+
type: "StableName",
|
|
4179
|
+
stable_name: selectedCategory.value.payload?.stable_name || ""
|
|
4180
|
+
};
|
|
4127
4181
|
categorizeBankTransaction2(
|
|
4128
4182
|
bankTransaction.id,
|
|
4129
4183
|
{
|
|
4130
4184
|
type: "Category",
|
|
4131
|
-
category:
|
|
4132
|
-
type: "StableName",
|
|
4133
|
-
stable_name: selectedCategory.value.payload.stable_name || ""
|
|
4134
|
-
}
|
|
4185
|
+
category: payload
|
|
4135
4186
|
},
|
|
4136
4187
|
true
|
|
4137
4188
|
);
|
|
@@ -4421,16 +4472,13 @@ var SplitForm = ({
|
|
|
4421
4472
|
}
|
|
4422
4473
|
await categorizeBankTransaction2(
|
|
4423
4474
|
bankTransaction.id,
|
|
4424
|
-
rowState.splits.length === 1 ? {
|
|
4475
|
+
rowState.splits.length === 1 && rowState?.splits[0].category ? {
|
|
4425
4476
|
type: "Category",
|
|
4426
|
-
category:
|
|
4427
|
-
type: "StableName",
|
|
4428
|
-
stable_name: rowState?.splits[0].category?.payload.stable_name
|
|
4429
|
-
}
|
|
4477
|
+
category: getCategorizePayload(rowState?.splits[0].category)
|
|
4430
4478
|
} : {
|
|
4431
4479
|
type: "Split",
|
|
4432
4480
|
entries: rowState.splits.map((split) => ({
|
|
4433
|
-
category: split.category
|
|
4481
|
+
category: split.category ? getCategorizePayload(split.category) : "",
|
|
4434
4482
|
amount: split.amount
|
|
4435
4483
|
}))
|
|
4436
4484
|
},
|
|
@@ -4565,7 +4613,7 @@ var TransactionToOpenContext = (0, import_react52.createContext)({
|
|
|
4565
4613
|
|
|
4566
4614
|
// src/components/BankTransactionMobileList/BankTransactionMobileListItem.tsx
|
|
4567
4615
|
var import_classnames27 = __toESM(require("classnames"));
|
|
4568
|
-
var
|
|
4616
|
+
var import_date_fns12 = require("date-fns");
|
|
4569
4617
|
var DATE_FORMAT2 = "LLL d";
|
|
4570
4618
|
var getAssignedValue2 = (bankTransaction) => {
|
|
4571
4619
|
if (bankTransaction.categorization_status === "SPLIT" /* SPLIT */) {
|
|
@@ -4691,7 +4739,7 @@ var BankTransactionMobileListItem = ({
|
|
|
4691
4739
|
},
|
|
4692
4740
|
isCredit(bankTransaction) ? "+$" : " $",
|
|
4693
4741
|
centsToDollars(bankTransaction.amount)
|
|
4694
|
-
), /* @__PURE__ */ import_react53.default.createElement("span", { className: `${className}__heading__date` }, (0,
|
|
4742
|
+
), /* @__PURE__ */ import_react53.default.createElement("span", { className: `${className}__heading__date` }, (0, import_date_fns12.format)((0, import_date_fns12.parseISO)(bankTransaction.date), DATE_FORMAT2))))
|
|
4695
4743
|
),
|
|
4696
4744
|
/* @__PURE__ */ import_react53.default.createElement("div", { className: `${className}__expanded-row`, style: { height } }, open && /* @__PURE__ */ import_react53.default.createElement(
|
|
4697
4745
|
"div",
|
|
@@ -5233,11 +5281,11 @@ var Pagination = ({
|
|
|
5233
5281
|
var import_react65 = __toESM(require("react"));
|
|
5234
5282
|
|
|
5235
5283
|
// src/utils/business.ts
|
|
5236
|
-
var
|
|
5284
|
+
var import_date_fns13 = require("date-fns");
|
|
5237
5285
|
var getActivationDate = (business) => {
|
|
5238
5286
|
try {
|
|
5239
5287
|
if (business && business.activation_at) {
|
|
5240
|
-
return (0,
|
|
5288
|
+
return (0, import_date_fns13.parseISO)(business.activation_at);
|
|
5241
5289
|
}
|
|
5242
5290
|
return;
|
|
5243
5291
|
} catch (_err) {
|
|
@@ -5247,7 +5295,7 @@ var getActivationDate = (business) => {
|
|
|
5247
5295
|
var getEarliestDateToBrowse = (business) => {
|
|
5248
5296
|
const activationDate = getActivationDate(business);
|
|
5249
5297
|
if (activationDate) {
|
|
5250
|
-
return (0,
|
|
5298
|
+
return (0, import_date_fns13.startOfMonth)(activationDate);
|
|
5251
5299
|
}
|
|
5252
5300
|
return;
|
|
5253
5301
|
};
|
|
@@ -5259,7 +5307,7 @@ var isDateAllowedToBrowse = (date, business) => {
|
|
|
5259
5307
|
if (!activationDate) {
|
|
5260
5308
|
return true;
|
|
5261
5309
|
}
|
|
5262
|
-
return (0,
|
|
5310
|
+
return (0, import_date_fns13.differenceInCalendarMonths)((0, import_date_fns13.startOfMonth)(date), activationDate) >= 0;
|
|
5263
5311
|
};
|
|
5264
5312
|
|
|
5265
5313
|
// src/components/DateMonthPicker/DateMonthPicker.tsx
|
|
@@ -5301,7 +5349,7 @@ function useSizeClass() {
|
|
|
5301
5349
|
|
|
5302
5350
|
// src/components/DateMonthPicker/DateMonthPicker.tsx
|
|
5303
5351
|
var import_classnames31 = __toESM(require("classnames"));
|
|
5304
|
-
var
|
|
5352
|
+
var import_date_fns14 = require("date-fns");
|
|
5305
5353
|
var DateMonthPicker = ({
|
|
5306
5354
|
dateRange,
|
|
5307
5355
|
changeDateRange,
|
|
@@ -5330,13 +5378,13 @@ var DateMonthPicker = ({
|
|
|
5330
5378
|
return;
|
|
5331
5379
|
setIsAnimating(true);
|
|
5332
5380
|
setNextOpacity(1);
|
|
5333
|
-
const newDate = (0,
|
|
5381
|
+
const newDate = (0, import_date_fns14.add)(localDate, { months: monthsToAdd });
|
|
5334
5382
|
if (monthsToAdd === -1) {
|
|
5335
5383
|
setCurrentOpacity(0);
|
|
5336
5384
|
}
|
|
5337
5385
|
changeDateRange({
|
|
5338
|
-
startDate: (0,
|
|
5339
|
-
endDate: (0,
|
|
5386
|
+
startDate: (0, import_date_fns14.startOfMonth)(newDate),
|
|
5387
|
+
endDate: (0, import_date_fns14.endOfMonth)(newDate)
|
|
5340
5388
|
});
|
|
5341
5389
|
const translateXValue = monthsToAdd > 0 ? "0%" : "66%";
|
|
5342
5390
|
setTransformStyle({
|
|
@@ -5354,18 +5402,18 @@ var DateMonthPicker = ({
|
|
|
5354
5402
|
setCurrentOpacity(1);
|
|
5355
5403
|
}, 300);
|
|
5356
5404
|
};
|
|
5357
|
-
const currentLabel = (0,
|
|
5358
|
-
const prevLabel = (0,
|
|
5359
|
-
const nextLabel = (0,
|
|
5360
|
-
const today = (0,
|
|
5405
|
+
const currentLabel = (0, import_date_fns14.format)(localDate, "LLLL, y");
|
|
5406
|
+
const prevLabel = (0, import_date_fns14.format)((0, import_date_fns14.add)(localDate, { months: -1 }), "LLLL, y");
|
|
5407
|
+
const nextLabel = (0, import_date_fns14.format)((0, import_date_fns14.add)(localDate, { months: 1 }), "LLLL, y");
|
|
5408
|
+
const today = (0, import_date_fns14.startOfMonth)(Date.now());
|
|
5361
5409
|
const isTodayOrAfter = Boolean(
|
|
5362
5410
|
localDate.getFullYear() === today.getFullYear() && localDate.getMonth() === today.getMonth()
|
|
5363
5411
|
);
|
|
5364
5412
|
const setCurrentDate = () => {
|
|
5365
5413
|
setLocalDate(today);
|
|
5366
5414
|
changeDateRange({
|
|
5367
|
-
startDate: (0,
|
|
5368
|
-
endDate: (0,
|
|
5415
|
+
startDate: (0, import_date_fns14.startOfMonth)(today),
|
|
5416
|
+
endDate: (0, import_date_fns14.endOfMonth)(today)
|
|
5369
5417
|
});
|
|
5370
5418
|
};
|
|
5371
5419
|
(0, import_react62.useEffect)(() => {
|
|
@@ -5567,18 +5615,6 @@ var Tabs = ({ name, options, selected, onChange }) => {
|
|
|
5567
5615
|
)), /* @__PURE__ */ import_react64.default.createElement("span", { className: "Layer__tabs__thumb", style: { ...thumbPos } }));
|
|
5568
5616
|
};
|
|
5569
5617
|
|
|
5570
|
-
// src/components/BankTransactions/constants.ts
|
|
5571
|
-
var CategorizedCategories = [
|
|
5572
|
-
"CATEGORIZED" /* CATEGORIZED */,
|
|
5573
|
-
"JOURNALING" /* JOURNALING */,
|
|
5574
|
-
"SPLIT" /* SPLIT */,
|
|
5575
|
-
"MATCHED" /* MATCHED */
|
|
5576
|
-
];
|
|
5577
|
-
var ReviewCategories = [
|
|
5578
|
-
"READY_FOR_INPUT" /* READY_FOR_INPUT */,
|
|
5579
|
-
"LAYER_REVIEW" /* LAYER_REVIEW */
|
|
5580
|
-
];
|
|
5581
|
-
|
|
5582
5618
|
// src/components/BankTransactions/BankTransactionsHeader.tsx
|
|
5583
5619
|
var import_classnames33 = __toESM(require("classnames"));
|
|
5584
5620
|
var DownloadButton = () => {
|
|
@@ -5801,17 +5837,8 @@ var DataStates = ({
|
|
|
5801
5837
|
)) : null);
|
|
5802
5838
|
};
|
|
5803
5839
|
|
|
5804
|
-
// src/components/BankTransactions/utils.ts
|
|
5805
|
-
var filterVisibility = (display, bankTransaction) => {
|
|
5806
|
-
const categorized = CategorizedCategories.includes(
|
|
5807
|
-
bankTransaction.categorization_status
|
|
5808
|
-
);
|
|
5809
|
-
const inReview = ReviewCategories.includes(bankTransaction.categorization_status) && !bankTransaction.recently_categorized;
|
|
5810
|
-
return display === "review" /* review */ && inReview || display === "categorized" /* categorized */ && categorized;
|
|
5811
|
-
};
|
|
5812
|
-
|
|
5813
5840
|
// src/components/BankTransactions/BankTransactions.tsx
|
|
5814
|
-
var
|
|
5841
|
+
var import_date_fns15 = require("date-fns");
|
|
5815
5842
|
var COMPONENT_NAME = "bank-transactions";
|
|
5816
5843
|
var BankTransactions = ({
|
|
5817
5844
|
asWidget = false,
|
|
@@ -5829,8 +5856,8 @@ var BankTransactions = ({
|
|
|
5829
5856
|
const [removedTxs, setRemovedTxs] = (0, import_react68.useState)([]);
|
|
5830
5857
|
const [initialLoad, setInitialLoad] = (0, import_react68.useState)(true);
|
|
5831
5858
|
const [dateRange, setDateRange] = (0, import_react68.useState)({
|
|
5832
|
-
startDate: (0,
|
|
5833
|
-
endDate: (0,
|
|
5859
|
+
startDate: (0, import_date_fns15.startOfMonth)(/* @__PURE__ */ new Date()),
|
|
5860
|
+
endDate: (0, import_date_fns15.endOfMonth)(/* @__PURE__ */ new Date())
|
|
5834
5861
|
});
|
|
5835
5862
|
const { data, isLoading, loadingStatus, error, isValidating, refetch } = useBankTransactions();
|
|
5836
5863
|
const bankTransactionsByFilter = data?.filter(
|
|
@@ -5847,7 +5874,7 @@ var BankTransactions = ({
|
|
|
5847
5874
|
const bankTransactions = (0, import_react68.useMemo)(() => {
|
|
5848
5875
|
if (monthlyView) {
|
|
5849
5876
|
return bankTransactionsByFilter?.filter(
|
|
5850
|
-
(x) => (0,
|
|
5877
|
+
(x) => (0, import_date_fns15.parseISO)(x.date) >= dateRange.startDate && (0, import_date_fns15.parseISO)(x.date) <= dateRange.endDate
|
|
5851
5878
|
);
|
|
5852
5879
|
}
|
|
5853
5880
|
const firstPageIndex = (currentPage - 1) * pageSize;
|
|
@@ -7111,7 +7138,7 @@ var applyShare = (items, total) => {
|
|
|
7111
7138
|
};
|
|
7112
7139
|
|
|
7113
7140
|
// src/hooks/useProfitAndLoss/useProfitAndLossQuery.tsx
|
|
7114
|
-
var
|
|
7141
|
+
var import_date_fns16 = require("date-fns");
|
|
7115
7142
|
var import_swr5 = __toESM(require("swr"));
|
|
7116
7143
|
var useProfitAndLossQuery = ({
|
|
7117
7144
|
startDate,
|
|
@@ -7119,8 +7146,8 @@ var useProfitAndLossQuery = ({
|
|
|
7119
7146
|
tagFilter,
|
|
7120
7147
|
reportingBasis
|
|
7121
7148
|
} = {
|
|
7122
|
-
startDate: (0,
|
|
7123
|
-
endDate: (0,
|
|
7149
|
+
startDate: (0, import_date_fns16.startOfMonth)(/* @__PURE__ */ new Date()),
|
|
7150
|
+
endDate: (0, import_date_fns16.endOfMonth)(/* @__PURE__ */ new Date())
|
|
7124
7151
|
}) => {
|
|
7125
7152
|
const { auth, businessId, apiUrl } = useLayerContext();
|
|
7126
7153
|
const {
|
|
@@ -7136,8 +7163,8 @@ var useProfitAndLossQuery = ({
|
|
|
7136
7163
|
Layer.getProfitAndLoss(apiUrl, auth?.access_token, {
|
|
7137
7164
|
params: {
|
|
7138
7165
|
businessId,
|
|
7139
|
-
startDate: (0,
|
|
7140
|
-
endDate: (0,
|
|
7166
|
+
startDate: (0, import_date_fns16.formatISO)(startDate.valueOf()),
|
|
7167
|
+
endDate: (0, import_date_fns16.formatISO)(endDate.valueOf()),
|
|
7141
7168
|
tagKey: tagFilter?.key,
|
|
7142
7169
|
tagValues: tagFilter?.values?.join(","),
|
|
7143
7170
|
reportingBasis
|
|
@@ -7159,21 +7186,21 @@ var useProfitAndLossQuery = ({
|
|
|
7159
7186
|
};
|
|
7160
7187
|
|
|
7161
7188
|
// src/hooks/useProfitAndLoss/useProfitAndLoss.tsx
|
|
7162
|
-
var
|
|
7189
|
+
var import_date_fns17 = require("date-fns");
|
|
7163
7190
|
var useProfitAndLoss = ({
|
|
7164
7191
|
startDate: initialStartDate,
|
|
7165
7192
|
endDate: initialEndDate,
|
|
7166
7193
|
tagFilter,
|
|
7167
7194
|
reportingBasis
|
|
7168
7195
|
} = {
|
|
7169
|
-
startDate: (0,
|
|
7170
|
-
endDate: (0,
|
|
7196
|
+
startDate: (0, import_date_fns17.startOfMonth)(/* @__PURE__ */ new Date()),
|
|
7197
|
+
endDate: (0, import_date_fns17.endOfMonth)(/* @__PURE__ */ new Date())
|
|
7171
7198
|
}) => {
|
|
7172
7199
|
const [startDate, setStartDate] = (0, import_react81.useState)(
|
|
7173
|
-
initialStartDate || (0,
|
|
7200
|
+
initialStartDate || (0, import_date_fns17.startOfMonth)(Date.now())
|
|
7174
7201
|
);
|
|
7175
7202
|
const [endDate, setEndDate] = (0, import_react81.useState)(
|
|
7176
|
-
initialEndDate || (0,
|
|
7203
|
+
initialEndDate || (0, import_date_fns17.endOfMonth)(Date.now())
|
|
7177
7204
|
);
|
|
7178
7205
|
const [filters, setFilters] = (0, import_react81.useState)({
|
|
7179
7206
|
expenses: void 0,
|
|
@@ -7311,14 +7338,14 @@ var import_react84 = __toESM(require("react"));
|
|
|
7311
7338
|
|
|
7312
7339
|
// src/hooks/useProfitAndLoss/useProfitAndLossLTM.tsx
|
|
7313
7340
|
var import_react82 = require("react");
|
|
7314
|
-
var
|
|
7341
|
+
var import_date_fns18 = require("date-fns");
|
|
7315
7342
|
var import_swr6 = __toESM(require("swr"));
|
|
7316
7343
|
var buildDates = ({ currentDate }) => {
|
|
7317
7344
|
return {
|
|
7318
|
-
startYear: (0,
|
|
7319
|
-
startMonth: (0,
|
|
7320
|
-
endYear: (0,
|
|
7321
|
-
endMonth: (0,
|
|
7345
|
+
startYear: (0, import_date_fns18.startOfMonth)(currentDate).getFullYear() - 1,
|
|
7346
|
+
startMonth: (0, import_date_fns18.startOfMonth)(currentDate).getMonth() + 1,
|
|
7347
|
+
endYear: (0, import_date_fns18.startOfMonth)(currentDate).getFullYear(),
|
|
7348
|
+
endMonth: (0, import_date_fns18.startOfMonth)(currentDate).getMonth() + 1
|
|
7322
7349
|
};
|
|
7323
7350
|
};
|
|
7324
7351
|
var buildMonthsArray = (startDate, endDate) => {
|
|
@@ -7366,7 +7393,7 @@ var useProfitAndLossLTM = ({ currentDate, tagFilter, reportingBasis } = {
|
|
|
7366
7393
|
);
|
|
7367
7394
|
(0, import_react82.useEffect)(() => {
|
|
7368
7395
|
const newData = data.slice();
|
|
7369
|
-
const newPeriod = buildMonthsArray((0,
|
|
7396
|
+
const newPeriod = buildMonthsArray((0, import_date_fns18.sub)(date, { years: 1 }), date);
|
|
7370
7397
|
if (newData && newPeriod) {
|
|
7371
7398
|
newPeriod.forEach((x) => {
|
|
7372
7399
|
if (!newData?.find(
|
|
@@ -7497,53 +7524,53 @@ var Indicator = ({
|
|
|
7497
7524
|
|
|
7498
7525
|
// src/components/ProfitAndLossChart/ProfitAndLossChart.tsx
|
|
7499
7526
|
var import_classnames38 = __toESM(require("classnames"));
|
|
7500
|
-
var
|
|
7527
|
+
var import_date_fns19 = require("date-fns");
|
|
7501
7528
|
var import_recharts = require("recharts");
|
|
7502
7529
|
var getChartWindow = ({
|
|
7503
7530
|
chartWindow,
|
|
7504
7531
|
currentYear,
|
|
7505
7532
|
currentMonth
|
|
7506
7533
|
}) => {
|
|
7507
|
-
const today = (0,
|
|
7508
|
-
const yearAgo = (0,
|
|
7509
|
-
const current = (0,
|
|
7510
|
-
if ((0,
|
|
7534
|
+
const today = (0, import_date_fns19.startOfMonth)(Date.now());
|
|
7535
|
+
const yearAgo = (0, import_date_fns19.sub)(today, { months: 11 });
|
|
7536
|
+
const current = (0, import_date_fns19.startOfMonth)(new Date(currentYear, currentMonth - 1, 1));
|
|
7537
|
+
if ((0, import_date_fns19.differenceInMonths)((0, import_date_fns19.startOfMonth)(chartWindow.start), current) < 0 && (0, import_date_fns19.differenceInMonths)((0, import_date_fns19.startOfMonth)(chartWindow.end), current) > 1) {
|
|
7511
7538
|
return chartWindow;
|
|
7512
7539
|
}
|
|
7513
|
-
if ((0,
|
|
7540
|
+
if ((0, import_date_fns19.differenceInMonths)((0, import_date_fns19.startOfMonth)(chartWindow.start), current) === 0) {
|
|
7514
7541
|
return {
|
|
7515
|
-
start: (0,
|
|
7516
|
-
end: (0,
|
|
7542
|
+
start: (0, import_date_fns19.startOfMonth)((0, import_date_fns19.sub)(current, { months: 1 })),
|
|
7543
|
+
end: (0, import_date_fns19.endOfMonth)((0, import_date_fns19.add)(current, { months: 11 }))
|
|
7517
7544
|
};
|
|
7518
7545
|
}
|
|
7519
|
-
if ((0,
|
|
7546
|
+
if ((0, import_date_fns19.differenceInMonths)((0, import_date_fns19.endOfMonth)(chartWindow.end), (0, import_date_fns19.endOfMonth)(current)) === 1 && (0, import_date_fns19.differenceInMonths)(today, current) >= 1) {
|
|
7520
7547
|
return {
|
|
7521
|
-
start: (0,
|
|
7522
|
-
end: (0,
|
|
7548
|
+
start: (0, import_date_fns19.startOfMonth)((0, import_date_fns19.sub)(current, { months: 10 })),
|
|
7549
|
+
end: (0, import_date_fns19.endOfMonth)((0, import_date_fns19.add)(current, { months: 2 }))
|
|
7523
7550
|
};
|
|
7524
7551
|
}
|
|
7525
|
-
if ((0,
|
|
7552
|
+
if ((0, import_date_fns19.differenceInMonths)(current, (0, import_date_fns19.startOfMonth)(chartWindow.end)) === 0 && (0, import_date_fns19.differenceInMonths)(current, (0, import_date_fns19.startOfMonth)(today)) > 0) {
|
|
7526
7553
|
return {
|
|
7527
|
-
start: (0,
|
|
7528
|
-
end: (0,
|
|
7554
|
+
start: (0, import_date_fns19.startOfMonth)((0, import_date_fns19.sub)(current, { months: 11 })),
|
|
7555
|
+
end: (0, import_date_fns19.endOfMonth)((0, import_date_fns19.add)(current, { months: 1 }))
|
|
7529
7556
|
};
|
|
7530
7557
|
}
|
|
7531
7558
|
if (current >= yearAgo) {
|
|
7532
7559
|
return {
|
|
7533
|
-
start: (0,
|
|
7534
|
-
end: (0,
|
|
7560
|
+
start: (0, import_date_fns19.startOfMonth)(yearAgo),
|
|
7561
|
+
end: (0, import_date_fns19.endOfMonth)(today)
|
|
7535
7562
|
};
|
|
7536
7563
|
}
|
|
7537
7564
|
if (Number(current) > Number(chartWindow.end)) {
|
|
7538
7565
|
return {
|
|
7539
|
-
start: (0,
|
|
7540
|
-
end: (0,
|
|
7566
|
+
start: (0, import_date_fns19.startOfMonth)((0, import_date_fns19.sub)(current, { months: 12 })),
|
|
7567
|
+
end: (0, import_date_fns19.endOfMonth)(current)
|
|
7541
7568
|
};
|
|
7542
7569
|
}
|
|
7543
|
-
if ((0,
|
|
7570
|
+
if ((0, import_date_fns19.differenceInMonths)(current, (0, import_date_fns19.startOfMonth)(chartWindow.start)) < 0) {
|
|
7544
7571
|
return {
|
|
7545
|
-
start: (0,
|
|
7546
|
-
end: (0,
|
|
7572
|
+
start: (0, import_date_fns19.startOfMonth)(current),
|
|
7573
|
+
end: (0, import_date_fns19.endOfMonth)((0, import_date_fns19.add)(current, { months: 11 }))
|
|
7547
7574
|
};
|
|
7548
7575
|
}
|
|
7549
7576
|
return chartWindow;
|
|
@@ -7577,8 +7604,8 @@ var ProfitAndLossChart = () => {
|
|
|
7577
7604
|
});
|
|
7578
7605
|
const [barAnimActive, setBarAnimActive] = (0, import_react84.useState)(true);
|
|
7579
7606
|
const [chartWindow, setChartWindow] = (0, import_react84.useState)({
|
|
7580
|
-
start: (0,
|
|
7581
|
-
end: (0,
|
|
7607
|
+
start: (0, import_date_fns19.startOfMonth)((0, import_date_fns19.sub)(Date.now(), { months: 11 })),
|
|
7608
|
+
end: (0, import_date_fns19.endOfMonth)(Date.now())
|
|
7582
7609
|
});
|
|
7583
7610
|
const selectionMonth = (0, import_react84.useMemo)(
|
|
7584
7611
|
() => ({
|
|
@@ -7593,25 +7620,25 @@ var ProfitAndLossChart = () => {
|
|
|
7593
7620
|
}
|
|
7594
7621
|
}, [dateRange]);
|
|
7595
7622
|
const { data, loaded, pullData } = useProfitAndLossLTM({
|
|
7596
|
-
currentDate: (0,
|
|
7623
|
+
currentDate: (0, import_date_fns19.startOfMonth)(Date.now())
|
|
7597
7624
|
});
|
|
7598
7625
|
const loadingValue = (0, import_react84.useMemo)(() => getLoadingValue(data), [data]);
|
|
7599
7626
|
(0, import_react84.useEffect)(() => {
|
|
7600
7627
|
if (loaded === "complete" && data) {
|
|
7601
7628
|
const foundCurrent = data.find(
|
|
7602
|
-
(x) => Number((0,
|
|
7629
|
+
(x) => Number((0, import_date_fns19.startOfMonth)(new Date(x.year, x.month - 1, 1))) >= Number(localDateRange.startDate) && Number((0, import_date_fns19.startOfMonth)(new Date(x.year, x.month - 1, 1))) < Number(localDateRange.endDate)
|
|
7603
7630
|
);
|
|
7604
7631
|
if (!foundCurrent) {
|
|
7605
|
-
const newDate = (0,
|
|
7632
|
+
const newDate = (0, import_date_fns19.startOfMonth)(localDateRange.startDate);
|
|
7606
7633
|
pullData(newDate);
|
|
7607
7634
|
return;
|
|
7608
7635
|
}
|
|
7609
7636
|
const foundBefore = data.find(
|
|
7610
|
-
(x) => Number((0,
|
|
7637
|
+
(x) => Number((0, import_date_fns19.startOfMonth)(new Date(x.year, x.month - 1, 1))) >= Number((0, import_date_fns19.sub)(localDateRange.startDate, { months: 1 })) && Number((0, import_date_fns19.startOfMonth)(new Date(x.year, x.month - 1, 1))) < Number((0, import_date_fns19.sub)(localDateRange.endDate, { months: 1 }))
|
|
7611
7638
|
);
|
|
7612
7639
|
if (!foundBefore) {
|
|
7613
|
-
const newDate = (0,
|
|
7614
|
-
(0,
|
|
7640
|
+
const newDate = (0, import_date_fns19.startOfMonth)(
|
|
7641
|
+
(0, import_date_fns19.sub)(localDateRange.startDate, { months: 1 })
|
|
7615
7642
|
);
|
|
7616
7643
|
pullData(newDate);
|
|
7617
7644
|
}
|
|
@@ -7634,7 +7661,7 @@ var ProfitAndLossChart = () => {
|
|
|
7634
7661
|
}, 2e3);
|
|
7635
7662
|
}
|
|
7636
7663
|
}, [loaded]);
|
|
7637
|
-
const getMonthName = (pnl) => pnl ? (0,
|
|
7664
|
+
const getMonthName = (pnl) => pnl ? (0, import_date_fns19.format)(
|
|
7638
7665
|
new Date(pnl.year, pnl.month - 1, 1),
|
|
7639
7666
|
compactView ? "LLLLL" : "LLL"
|
|
7640
7667
|
) : "";
|
|
@@ -7657,9 +7684,9 @@ var ProfitAndLossChart = () => {
|
|
|
7657
7684
|
const loadingData = [];
|
|
7658
7685
|
const today = Date.now();
|
|
7659
7686
|
for (let i = 11; i >= 0; i--) {
|
|
7660
|
-
const currentDate = (0,
|
|
7687
|
+
const currentDate = (0, import_date_fns19.sub)(today, { months: i });
|
|
7661
7688
|
loadingData.push({
|
|
7662
|
-
name: (0,
|
|
7689
|
+
name: (0, import_date_fns19.format)(currentDate, compactView ? "LLLLL" : "LLL"),
|
|
7663
7690
|
revenue: 0,
|
|
7664
7691
|
revenueUncategorized: 0,
|
|
7665
7692
|
expenses: 0,
|
|
@@ -7676,18 +7703,18 @@ var ProfitAndLossChart = () => {
|
|
|
7676
7703
|
return loadingData;
|
|
7677
7704
|
}
|
|
7678
7705
|
return data?.filter(
|
|
7679
|
-
(x) => (0,
|
|
7680
|
-
(0,
|
|
7706
|
+
(x) => (0, import_date_fns19.differenceInMonths)(
|
|
7707
|
+
(0, import_date_fns19.startOfMonth)(new Date(x.year, x.month - 1, 1)),
|
|
7681
7708
|
chartWindow.start
|
|
7682
|
-
) >= 0 && (0,
|
|
7683
|
-
(0,
|
|
7709
|
+
) >= 0 && (0, import_date_fns19.differenceInMonths)(
|
|
7710
|
+
(0, import_date_fns19.startOfMonth)(new Date(x.year, x.month - 1, 1)),
|
|
7684
7711
|
chartWindow.start
|
|
7685
|
-
) < 12 && (0,
|
|
7712
|
+
) < 12 && (0, import_date_fns19.differenceInMonths)(
|
|
7686
7713
|
chartWindow.end,
|
|
7687
|
-
(0,
|
|
7688
|
-
) >= 0 && (0,
|
|
7714
|
+
(0, import_date_fns19.startOfMonth)(new Date(x.year, x.month - 1, 1))
|
|
7715
|
+
) >= 0 && (0, import_date_fns19.differenceInMonths)(
|
|
7689
7716
|
chartWindow.end,
|
|
7690
|
-
(0,
|
|
7717
|
+
(0, import_date_fns19.startOfMonth)(new Date(x.year, x.month - 1, 1))
|
|
7691
7718
|
) <= 12
|
|
7692
7719
|
).map((x) => summarizePnL(x));
|
|
7693
7720
|
}, [selectionMonth, chartWindow, data, loaded, compactView]);
|
|
@@ -7701,7 +7728,7 @@ var ProfitAndLossChart = () => {
|
|
|
7701
7728
|
if (isMonthAllowed) {
|
|
7702
7729
|
changeDateRange({
|
|
7703
7730
|
startDate: new Date(year, month - 1, 1),
|
|
7704
|
-
endDate: (0,
|
|
7731
|
+
endDate: (0, import_date_fns19.endOfMonth)(new Date(year, month - 1, 1))
|
|
7705
7732
|
});
|
|
7706
7733
|
}
|
|
7707
7734
|
}
|
|
@@ -8704,7 +8731,7 @@ var Filters = ({
|
|
|
8704
8731
|
};
|
|
8705
8732
|
|
|
8706
8733
|
// src/components/ProfitAndLossDetailedCharts/ProfitAndLossDetailedCharts.tsx
|
|
8707
|
-
var
|
|
8734
|
+
var import_date_fns20 = require("date-fns");
|
|
8708
8735
|
var ProfitAndLossDetailedCharts = ({
|
|
8709
8736
|
scope,
|
|
8710
8737
|
hideClose = false,
|
|
@@ -8727,7 +8754,7 @@ var ProfitAndLossDetailedCharts = ({
|
|
|
8727
8754
|
const data = theScope === "revenue" ? filteredDataRevenue : filteredDataExpenses;
|
|
8728
8755
|
const total = theScope === "revenue" ? filteredTotalRevenue : filteredTotalExpenses;
|
|
8729
8756
|
const [hoveredItem, setHoveredItem] = (0, import_react89.useState)();
|
|
8730
|
-
return /* @__PURE__ */ import_react89.default.createElement("div", { className: "Layer__profit-and-loss-detailed-charts" }, /* @__PURE__ */ import_react89.default.createElement("header", { className: "Layer__profit-and-loss-detailed-charts__header" }, /* @__PURE__ */ import_react89.default.createElement("div", { className: "Layer__profit-and-loss-detailed-charts__head" }, /* @__PURE__ */ import_react89.default.createElement(Text, { size: "lg" /* lg */, weight: "bold" /* bold */, className: "title" }, humanizeTitle(theScope)), /* @__PURE__ */ import_react89.default.createElement(Text, { size: "sm" /* sm */, className: "date" }, (0,
|
|
8757
|
+
return /* @__PURE__ */ import_react89.default.createElement("div", { className: "Layer__profit-and-loss-detailed-charts" }, /* @__PURE__ */ import_react89.default.createElement("header", { className: "Layer__profit-and-loss-detailed-charts__header" }, /* @__PURE__ */ import_react89.default.createElement("div", { className: "Layer__profit-and-loss-detailed-charts__head" }, /* @__PURE__ */ import_react89.default.createElement(Text, { size: "lg" /* lg */, weight: "bold" /* bold */, className: "title" }, humanizeTitle(theScope)), /* @__PURE__ */ import_react89.default.createElement(Text, { size: "sm" /* sm */, className: "date" }, (0, import_date_fns20.format)(dateRange.startDate, "LLLL, y")), showDatePicker && /* @__PURE__ */ import_react89.default.createElement(ProfitAndLossDatePicker, null)), !hideClose && /* @__PURE__ */ import_react89.default.createElement(
|
|
8731
8758
|
Button,
|
|
8732
8759
|
{
|
|
8733
8760
|
rightIcon: /* @__PURE__ */ import_react89.default.createElement(X_default, null),
|
|
@@ -9243,7 +9270,7 @@ var ProfitAndLossTable = ({ lockExpanded, asContainer }) => {
|
|
|
9243
9270
|
};
|
|
9244
9271
|
|
|
9245
9272
|
// src/components/ProfitAndLoss/ProfitAndLoss.tsx
|
|
9246
|
-
var
|
|
9273
|
+
var import_date_fns21 = require("date-fns");
|
|
9247
9274
|
var PNLContext = (0, import_react95.createContext)({
|
|
9248
9275
|
data: void 0,
|
|
9249
9276
|
filteredDataRevenue: [],
|
|
@@ -9254,8 +9281,8 @@ var PNLContext = (0, import_react95.createContext)({
|
|
|
9254
9281
|
isValidating: false,
|
|
9255
9282
|
error: void 0,
|
|
9256
9283
|
dateRange: {
|
|
9257
|
-
startDate: (0,
|
|
9258
|
-
endDate: (0,
|
|
9284
|
+
startDate: (0, import_date_fns21.startOfMonth)(/* @__PURE__ */ new Date()),
|
|
9285
|
+
endDate: (0, import_date_fns21.endOfMonth)(/* @__PURE__ */ new Date())
|
|
9259
9286
|
},
|
|
9260
9287
|
changeDateRange: () => {
|
|
9261
9288
|
},
|
|
@@ -9394,7 +9421,7 @@ var import_react115 = __toESM(require("react"));
|
|
|
9394
9421
|
|
|
9395
9422
|
// src/contexts/ChartOfAccountsContext/ChartOfAccountsContext.tsx
|
|
9396
9423
|
var import_react98 = require("react");
|
|
9397
|
-
var
|
|
9424
|
+
var import_date_fns22 = require("date-fns");
|
|
9398
9425
|
var ChartOfAccountsContext = (0, import_react98.createContext)(
|
|
9399
9426
|
{
|
|
9400
9427
|
data: void 0,
|
|
@@ -9417,8 +9444,8 @@ var ChartOfAccountsContext = (0, import_react98.createContext)(
|
|
|
9417
9444
|
submitForm: () => {
|
|
9418
9445
|
},
|
|
9419
9446
|
dateRange: {
|
|
9420
|
-
startDate: (0,
|
|
9421
|
-
endDate: (0,
|
|
9447
|
+
startDate: (0, import_date_fns22.startOfMonth)(/* @__PURE__ */ new Date()),
|
|
9448
|
+
endDate: (0, import_date_fns22.endOfMonth)(/* @__PURE__ */ new Date())
|
|
9422
9449
|
},
|
|
9423
9450
|
changeDateRange: () => {
|
|
9424
9451
|
}
|
|
@@ -9653,7 +9680,7 @@ var LEDGER_ACCOUNT_SUBTYPES_FOR_TYPE = {
|
|
|
9653
9680
|
};
|
|
9654
9681
|
|
|
9655
9682
|
// src/hooks/useChartOfAccounts/useChartOfAccounts.tsx
|
|
9656
|
-
var
|
|
9683
|
+
var import_date_fns23 = require("date-fns");
|
|
9657
9684
|
var import_swr7 = __toESM(require("swr"));
|
|
9658
9685
|
var validate = (formData) => {
|
|
9659
9686
|
const errors = [];
|
|
@@ -9734,26 +9761,26 @@ var validateName = (formData) => {
|
|
|
9734
9761
|
var flattenAccounts = (accounts) => accounts.flatMap((a) => [a, flattenAccounts(a.sub_accounts || [])]).flat().filter((id) => id);
|
|
9735
9762
|
var useChartOfAccounts = ({ withDates, startDate: initialStartDate, endDate: initialEndDate } = {
|
|
9736
9763
|
withDates: false,
|
|
9737
|
-
startDate: (0,
|
|
9738
|
-
endDate: (0,
|
|
9764
|
+
startDate: (0, import_date_fns23.startOfMonth)(/* @__PURE__ */ new Date()),
|
|
9765
|
+
endDate: (0, import_date_fns23.endOfMonth)(/* @__PURE__ */ new Date())
|
|
9739
9766
|
}) => {
|
|
9740
9767
|
const { auth, businessId, apiUrl } = useLayerContext();
|
|
9741
9768
|
const [form, setForm] = (0, import_react100.useState)();
|
|
9742
9769
|
const [sendingForm, setSendingForm] = (0, import_react100.useState)(false);
|
|
9743
9770
|
const [apiError, setApiError] = (0, import_react100.useState)(void 0);
|
|
9744
9771
|
const [startDate, setStartDate] = (0, import_react100.useState)(
|
|
9745
|
-
initialStartDate ?? (0,
|
|
9772
|
+
initialStartDate ?? (0, import_date_fns23.startOfMonth)(Date.now())
|
|
9746
9773
|
);
|
|
9747
9774
|
const [endDate, setEndDate] = (0, import_react100.useState)(
|
|
9748
|
-
initialEndDate ?? (0,
|
|
9775
|
+
initialEndDate ?? (0, import_date_fns23.endOfMonth)(Date.now())
|
|
9749
9776
|
);
|
|
9750
9777
|
const { data, isLoading, isValidating, error, mutate } = (0, import_swr7.default)(
|
|
9751
9778
|
businessId && auth?.access_token && `chart-of-accounts-${businessId}-${startDate?.valueOf()}-${endDate?.valueOf()}`,
|
|
9752
9779
|
Layer.getLedgerAccountBalances(apiUrl, auth?.access_token, {
|
|
9753
9780
|
params: {
|
|
9754
9781
|
businessId,
|
|
9755
|
-
startDate: withDates && startDate ? (0,
|
|
9756
|
-
endDate: withDates && endDate ? (0,
|
|
9782
|
+
startDate: withDates && startDate ? (0, import_date_fns23.formatISO)(startDate.valueOf()) : void 0,
|
|
9783
|
+
endDate: withDates && endDate ? (0, import_date_fns23.formatISO)(endDate.valueOf()) : void 0
|
|
9757
9784
|
}
|
|
9758
9785
|
})
|
|
9759
9786
|
);
|
|
@@ -10507,7 +10534,7 @@ var Card = ({ children, className }) => {
|
|
|
10507
10534
|
|
|
10508
10535
|
// src/components/DateTime/DateTime.tsx
|
|
10509
10536
|
var import_react109 = __toESM(require("react"));
|
|
10510
|
-
var
|
|
10537
|
+
var import_date_fns24 = require("date-fns");
|
|
10511
10538
|
var DateTime = ({
|
|
10512
10539
|
value,
|
|
10513
10540
|
format: format7,
|
|
@@ -10517,10 +10544,10 @@ var DateTime = ({
|
|
|
10517
10544
|
onlyTime
|
|
10518
10545
|
}) => {
|
|
10519
10546
|
if (format7) {
|
|
10520
|
-
return /* @__PURE__ */ import_react109.default.createElement(Text, { className: "Layer__datetime" }, (0,
|
|
10547
|
+
return /* @__PURE__ */ import_react109.default.createElement(Text, { className: "Layer__datetime" }, (0, import_date_fns24.format)((0, import_date_fns24.parseISO)(value), format7));
|
|
10521
10548
|
}
|
|
10522
|
-
const date = (0,
|
|
10523
|
-
const time = (0,
|
|
10549
|
+
const date = (0, import_date_fns24.format)((0, import_date_fns24.parseISO)(value), dateFormat ?? DATE_FORMAT);
|
|
10550
|
+
const time = (0, import_date_fns24.format)((0, import_date_fns24.parseISO)(value), timeFormat ?? TIME_FORMAT);
|
|
10524
10551
|
return /* @__PURE__ */ import_react109.default.createElement(Text, { className: "Layer__datetime" }, !onlyTime && /* @__PURE__ */ import_react109.default.createElement(
|
|
10525
10552
|
Text,
|
|
10526
10553
|
{
|
|
@@ -10650,7 +10677,7 @@ var LedgerAccountEntryDetails = () => {
|
|
|
10650
10677
|
// src/components/LedgerAccount/LedgerAccountRow.tsx
|
|
10651
10678
|
var import_react113 = __toESM(require("react"));
|
|
10652
10679
|
var import_classnames47 = __toESM(require("classnames"));
|
|
10653
|
-
var
|
|
10680
|
+
var import_date_fns25 = require("date-fns");
|
|
10654
10681
|
var LedgerAccountRow = ({
|
|
10655
10682
|
row,
|
|
10656
10683
|
index,
|
|
@@ -10689,7 +10716,7 @@ var LedgerAccountRow = ({
|
|
|
10689
10716
|
}
|
|
10690
10717
|
}
|
|
10691
10718
|
},
|
|
10692
|
-
/* @__PURE__ */ import_react113.default.createElement("td", { className: "Layer__table-cell Layer__ledger-account-table__tablet-main-col" }, /* @__PURE__ */ import_react113.default.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ import_react113.default.createElement("div", { className: "Layer__ledger-account-table__tablet-main-col__date" }, /* @__PURE__ */ import_react113.default.createElement(Text, null, row.date && (0,
|
|
10719
|
+
/* @__PURE__ */ import_react113.default.createElement("td", { className: "Layer__table-cell Layer__ledger-account-table__tablet-main-col" }, /* @__PURE__ */ import_react113.default.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ import_react113.default.createElement("div", { className: "Layer__ledger-account-table__tablet-main-col__date" }, /* @__PURE__ */ import_react113.default.createElement(Text, null, row.date && (0, import_date_fns25.format)((0, import_date_fns25.parseISO)(row.date), DATE_FORMAT)), /* @__PURE__ */ import_react113.default.createElement(
|
|
10693
10720
|
Text,
|
|
10694
10721
|
{
|
|
10695
10722
|
weight: "normal" /* normal */,
|
|
@@ -10722,7 +10749,7 @@ var LedgerAccountRow = ({
|
|
|
10722
10749
|
}
|
|
10723
10750
|
}
|
|
10724
10751
|
},
|
|
10725
|
-
/* @__PURE__ */ import_react113.default.createElement("td", { className: "Layer__table-cell Layer__ledger-account-table__tablet-main-col" }, /* @__PURE__ */ import_react113.default.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ import_react113.default.createElement("div", { className: "Layer__ledger-account-table__tablet-main-col__date" }, /* @__PURE__ */ import_react113.default.createElement(Text, null, row.date && (0,
|
|
10752
|
+
/* @__PURE__ */ import_react113.default.createElement("td", { className: "Layer__table-cell Layer__ledger-account-table__tablet-main-col" }, /* @__PURE__ */ import_react113.default.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ import_react113.default.createElement("div", { className: "Layer__ledger-account-table__tablet-main-col__date" }, /* @__PURE__ */ import_react113.default.createElement(Text, null, row.date && (0, import_date_fns25.format)((0, import_date_fns25.parseISO)(row.date), DATE_FORMAT)), /* @__PURE__ */ import_react113.default.createElement(
|
|
10726
10753
|
Text,
|
|
10727
10754
|
{
|
|
10728
10755
|
weight: "normal" /* normal */,
|
|
@@ -10751,7 +10778,7 @@ var LedgerAccountRow = ({
|
|
|
10751
10778
|
}
|
|
10752
10779
|
}
|
|
10753
10780
|
},
|
|
10754
|
-
/* @__PURE__ */ import_react113.default.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ import_react113.default.createElement("span", { className: "Layer__table-cell-content" }, row.date && (0,
|
|
10781
|
+
/* @__PURE__ */ import_react113.default.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ import_react113.default.createElement("span", { className: "Layer__table-cell-content" }, row.date && (0, import_date_fns25.format)((0, import_date_fns25.parseISO)(row.date), DATE_FORMAT))),
|
|
10755
10782
|
/* @__PURE__ */ import_react113.default.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ import_react113.default.createElement("span", { className: "Layer__table-cell-content" }, row.entry_id.substring(0, 5))),
|
|
10756
10783
|
/* @__PURE__ */ import_react113.default.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ import_react113.default.createElement("span", { className: "Layer__table-cell-content" }, row.source?.display_description ?? "")),
|
|
10757
10784
|
/* @__PURE__ */ import_react113.default.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ import_react113.default.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "DEBIT" /* DEBIT */ && `$${centsToDollars(row?.amount || 0)}`)),
|
|
@@ -10985,7 +11012,7 @@ var useDrawer = () => {
|
|
|
10985
11012
|
};
|
|
10986
11013
|
|
|
10987
11014
|
// src/providers/LayerProvider/LayerProvider.tsx
|
|
10988
|
-
var
|
|
11015
|
+
var import_date_fns26 = require("date-fns");
|
|
10989
11016
|
var import_swr9 = __toESM(require("swr"));
|
|
10990
11017
|
var reducer = (state, action) => {
|
|
10991
11018
|
switch (action.type) {
|
|
@@ -11069,7 +11096,7 @@ var LayerProvider = ({
|
|
|
11069
11096
|
toasts: []
|
|
11070
11097
|
});
|
|
11071
11098
|
const { data: auth } = appId !== void 0 && appSecret !== void 0 ? (0, import_swr9.default)(
|
|
11072
|
-
businessAccessToken === void 0 && appId !== void 0 && appSecret !== void 0 && (0,
|
|
11099
|
+
businessAccessToken === void 0 && appId !== void 0 && appSecret !== void 0 && (0, import_date_fns26.isBefore)(state.auth.expires_at, /* @__PURE__ */ new Date()) && "authenticate",
|
|
11073
11100
|
Layer.authenticate({
|
|
11074
11101
|
appId,
|
|
11075
11102
|
appSecret,
|
|
@@ -11087,7 +11114,7 @@ var LayerProvider = ({
|
|
|
11087
11114
|
access_token: businessAccessToken,
|
|
11088
11115
|
token_type: "Bearer",
|
|
11089
11116
|
expires_in: 3600,
|
|
11090
|
-
expires_at: (0,
|
|
11117
|
+
expires_at: (0, import_date_fns26.add)(/* @__PURE__ */ new Date(), { seconds: 3600 })
|
|
11091
11118
|
}
|
|
11092
11119
|
}
|
|
11093
11120
|
});
|
|
@@ -11097,7 +11124,7 @@ var LayerProvider = ({
|
|
|
11097
11124
|
payload: {
|
|
11098
11125
|
auth: {
|
|
11099
11126
|
...auth,
|
|
11100
|
-
expires_at: (0,
|
|
11127
|
+
expires_at: (0, import_date_fns26.add)(/* @__PURE__ */ new Date(), { seconds: auth.expires_in })
|
|
11101
11128
|
}
|
|
11102
11129
|
}
|
|
11103
11130
|
});
|
|
@@ -11522,7 +11549,7 @@ var import_react128 = __toESM(require("react"));
|
|
|
11522
11549
|
// src/components/JournalRow/JournalRow.tsx
|
|
11523
11550
|
var import_react123 = __toESM(require("react"));
|
|
11524
11551
|
var import_classnames50 = __toESM(require("classnames"));
|
|
11525
|
-
var
|
|
11552
|
+
var import_date_fns27 = require("date-fns");
|
|
11526
11553
|
var INDENTATION2 = 24;
|
|
11527
11554
|
var EXPANDED_STYLE2 = {
|
|
11528
11555
|
height: "100%",
|
|
@@ -11635,7 +11662,7 @@ var JournalRow = ({
|
|
|
11635
11662
|
)
|
|
11636
11663
|
))),
|
|
11637
11664
|
/* @__PURE__ */ import_react123.default.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ import_react123.default.createElement("span", { className: "Layer__table-cell-content" }, row.id.substring(0, 5))),
|
|
11638
|
-
/* @__PURE__ */ import_react123.default.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ import_react123.default.createElement("span", { className: "Layer__table-cell-content" }, row.date && (0,
|
|
11665
|
+
/* @__PURE__ */ import_react123.default.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ import_react123.default.createElement("span", { className: "Layer__table-cell-content" }, row.date && (0, import_date_fns27.format)((0, import_date_fns27.parseISO)(row.date), DATE_FORMAT))),
|
|
11639
11666
|
/* @__PURE__ */ import_react123.default.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ import_react123.default.createElement("span", { className: "Layer__table-cell-content" }, humanizeEnum(row.entry_type))),
|
|
11640
11667
|
/* @__PURE__ */ import_react123.default.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ import_react123.default.createElement("span", { className: "Layer__table-cell-content" }, `(${row.line_items.length})`)),
|
|
11641
11668
|
/* @__PURE__ */ import_react123.default.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ import_react123.default.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, "$", centsToDollars(
|
|
@@ -12096,13 +12123,13 @@ var import_react133 = __toESM(require("react"));
|
|
|
12096
12123
|
// src/components/Onboarding/ConnectAccount.tsx
|
|
12097
12124
|
var import_react132 = __toESM(require("react"));
|
|
12098
12125
|
|
|
12099
|
-
// src/icons/
|
|
12126
|
+
// src/icons/Bell.tsx
|
|
12100
12127
|
var React137 = __toESM(require("react"));
|
|
12101
|
-
var
|
|
12128
|
+
var Bell = ({ size = 18, ...props }) => /* @__PURE__ */ React137.createElement(
|
|
12102
12129
|
"svg",
|
|
12103
12130
|
{
|
|
12104
12131
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12105
|
-
viewBox: "0 0
|
|
12132
|
+
viewBox: "0 0 18 18",
|
|
12106
12133
|
fill: "none",
|
|
12107
12134
|
...props,
|
|
12108
12135
|
width: size,
|
|
@@ -12111,13 +12138,46 @@ var CreditCard = ({ size = 12, ...props }) => /* @__PURE__ */ React137.createEle
|
|
|
12111
12138
|
/* @__PURE__ */ React137.createElement(
|
|
12112
12139
|
"path",
|
|
12113
12140
|
{
|
|
12114
|
-
d: "
|
|
12141
|
+
d: "M13.5 6C13.5 4.80653 13.0259 3.66193 12.182 2.81802C11.3381 1.97411 10.1935 1.5 9 1.5C7.80653 1.5 6.66193 1.97411 5.81802 2.81802C4.97411 3.66193 4.5 4.80653 4.5 6C4.5 11.25 2.25 12.75 2.25 12.75H15.75C15.75 12.75 13.5 11.25 13.5 6Z",
|
|
12115
12142
|
stroke: "currentColor",
|
|
12116
12143
|
strokeLinecap: "round",
|
|
12117
12144
|
strokeLinejoin: "round"
|
|
12118
12145
|
}
|
|
12119
12146
|
),
|
|
12120
12147
|
/* @__PURE__ */ React137.createElement(
|
|
12148
|
+
"path",
|
|
12149
|
+
{
|
|
12150
|
+
d: "M10.2975 15.75C10.1656 15.9773 9.97638 16.166 9.74867 16.2971C9.52096 16.4283 9.26278 16.4973 9 16.4973C8.73721 16.4973 8.47904 16.4283 8.25133 16.2971C8.02362 16.166 7.83436 15.9773 7.7025 15.75",
|
|
12151
|
+
stroke: "currentColor",
|
|
12152
|
+
strokeLinecap: "round",
|
|
12153
|
+
strokeLinejoin: "round"
|
|
12154
|
+
}
|
|
12155
|
+
)
|
|
12156
|
+
);
|
|
12157
|
+
var Bell_default = Bell;
|
|
12158
|
+
|
|
12159
|
+
// src/icons/CreditCard.tsx
|
|
12160
|
+
var React138 = __toESM(require("react"));
|
|
12161
|
+
var CreditCard = ({ size = 12, ...props }) => /* @__PURE__ */ React138.createElement(
|
|
12162
|
+
"svg",
|
|
12163
|
+
{
|
|
12164
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12165
|
+
viewBox: "0 0 12 12",
|
|
12166
|
+
fill: "none",
|
|
12167
|
+
...props,
|
|
12168
|
+
width: size,
|
|
12169
|
+
height: size
|
|
12170
|
+
},
|
|
12171
|
+
/* @__PURE__ */ React138.createElement(
|
|
12172
|
+
"path",
|
|
12173
|
+
{
|
|
12174
|
+
d: "M10.5 2H1.5C0.947715 2 0.5 2.44772 0.5 3V9C0.5 9.55228 0.947715 10 1.5 10H10.5C11.0523 10 11.5 9.55228 11.5 9V3C11.5 2.44772 11.0523 2 10.5 2Z",
|
|
12175
|
+
stroke: "currentColor",
|
|
12176
|
+
strokeLinecap: "round",
|
|
12177
|
+
strokeLinejoin: "round"
|
|
12178
|
+
}
|
|
12179
|
+
),
|
|
12180
|
+
/* @__PURE__ */ React138.createElement(
|
|
12121
12181
|
"path",
|
|
12122
12182
|
{
|
|
12123
12183
|
d: "M0.5 5H11.5",
|
|
@@ -12130,8 +12190,8 @@ var CreditCard = ({ size = 12, ...props }) => /* @__PURE__ */ React137.createEle
|
|
|
12130
12190
|
var CreditCard_default = CreditCard;
|
|
12131
12191
|
|
|
12132
12192
|
// src/icons/Folder.tsx
|
|
12133
|
-
var
|
|
12134
|
-
var Folder = ({ size = 12, ...props }) => /* @__PURE__ */
|
|
12193
|
+
var React139 = __toESM(require("react"));
|
|
12194
|
+
var Folder = ({ size = 12, ...props }) => /* @__PURE__ */ React139.createElement(
|
|
12135
12195
|
"svg",
|
|
12136
12196
|
{
|
|
12137
12197
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12141,7 +12201,7 @@ var Folder = ({ size = 12, ...props }) => /* @__PURE__ */ React138.createElement
|
|
|
12141
12201
|
width: size,
|
|
12142
12202
|
height: size
|
|
12143
12203
|
},
|
|
12144
|
-
/* @__PURE__ */
|
|
12204
|
+
/* @__PURE__ */ React139.createElement(
|
|
12145
12205
|
"path",
|
|
12146
12206
|
{
|
|
12147
12207
|
d: "M11 9.5C11 9.76522 10.8946 10.0196 10.7071 10.2071C10.5196 10.3946 10.2652 10.5 10 10.5H2C1.73478 10.5 1.48043 10.3946 1.29289 10.2071C1.10536 10.0196 1 9.76522 1 9.5V2.5C1 2.23478 1.10536 1.98043 1.29289 1.79289C1.48043 1.60536 1.73478 1.5 2 1.5H4.5L5.5 3H10C10.2652 3 10.5196 3.10536 10.7071 3.29289C10.8946 3.48043 11 3.73478 11 4V9.5Z",
|
|
@@ -12154,8 +12214,8 @@ var Folder = ({ size = 12, ...props }) => /* @__PURE__ */ React138.createElement
|
|
|
12154
12214
|
var Folder_default = Folder;
|
|
12155
12215
|
|
|
12156
12216
|
// src/icons/Link.tsx
|
|
12157
|
-
var
|
|
12158
|
-
var Link = ({ size = 18, ...props }) => /* @__PURE__ */
|
|
12217
|
+
var React140 = __toESM(require("react"));
|
|
12218
|
+
var Link = ({ size = 18, ...props }) => /* @__PURE__ */ React140.createElement(
|
|
12159
12219
|
"svg",
|
|
12160
12220
|
{
|
|
12161
12221
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12165,7 +12225,7 @@ var Link = ({ size = 18, ...props }) => /* @__PURE__ */ React139.createElement(
|
|
|
12165
12225
|
width: size,
|
|
12166
12226
|
height: size
|
|
12167
12227
|
},
|
|
12168
|
-
/* @__PURE__ */
|
|
12228
|
+
/* @__PURE__ */ React140.createElement(
|
|
12169
12229
|
"path",
|
|
12170
12230
|
{
|
|
12171
12231
|
d: "M7.5 9.75C7.82209 10.1806 8.23302 10.5369 8.70491 10.7947C9.17681 11.0525 9.69863 11.2058 10.235 11.2442C10.7713 11.2827 11.3097 11.2053 11.8135 11.0173C12.3173 10.8294 12.7748 10.5353 13.155 10.155L15.405 7.905C16.0881 7.19774 16.4661 6.25048 16.4575 5.26724C16.449 4.284 16.0546 3.34346 15.3593 2.64818C14.664 1.9529 13.7235 1.55851 12.7403 1.54997C11.757 1.54143 10.8098 1.9194 10.1025 2.6025L8.8125 3.885",
|
|
@@ -12174,7 +12234,7 @@ var Link = ({ size = 18, ...props }) => /* @__PURE__ */ React139.createElement(
|
|
|
12174
12234
|
strokeLinejoin: "round"
|
|
12175
12235
|
}
|
|
12176
12236
|
),
|
|
12177
|
-
/* @__PURE__ */
|
|
12237
|
+
/* @__PURE__ */ React140.createElement(
|
|
12178
12238
|
"path",
|
|
12179
12239
|
{
|
|
12180
12240
|
d: "M10.5 8.25C10.1779 7.8194 9.76698 7.46311 9.29508 7.2053C8.82319 6.94748 8.30137 6.79416 7.76501 6.75575C7.22865 6.71734 6.69031 6.79473 6.18649 6.98266C5.68267 7.1706 5.22516 7.4647 4.845 7.845L2.595 10.095C1.9119 10.8023 1.53393 11.7495 1.54247 12.7328C1.55101 13.716 1.9454 14.6565 2.64068 15.3518C3.33596 16.0471 4.2765 16.4415 5.25974 16.45C6.24298 16.4586 7.19024 16.0806 7.8975 15.3975L9.18 14.115",
|
|
@@ -12200,8 +12260,8 @@ var PlaidIcon = () => {
|
|
|
12200
12260
|
var PlaidIcon_default = PlaidIcon;
|
|
12201
12261
|
|
|
12202
12262
|
// src/icons/Sunrise.tsx
|
|
12203
|
-
var
|
|
12204
|
-
var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */
|
|
12263
|
+
var React142 = __toESM(require("react"));
|
|
12264
|
+
var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React142.createElement(
|
|
12205
12265
|
"svg",
|
|
12206
12266
|
{
|
|
12207
12267
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12211,7 +12271,7 @@ var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React141.createElemen
|
|
|
12211
12271
|
width: size,
|
|
12212
12272
|
height: size
|
|
12213
12273
|
},
|
|
12214
|
-
/* @__PURE__ */
|
|
12274
|
+
/* @__PURE__ */ React142.createElement(
|
|
12215
12275
|
"path",
|
|
12216
12276
|
{
|
|
12217
12277
|
d: "M8.5 9C8.5 8.33696 8.23661 7.70107 7.76777 7.23223C7.29893 6.76339 6.66304 6.5 6 6.5C5.33696 6.5 4.70107 6.76339 4.23223 7.23223C3.76339 7.70107 3.5 8.33696 3.5 9",
|
|
@@ -12220,7 +12280,7 @@ var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React141.createElemen
|
|
|
12220
12280
|
strokeLinejoin: "round"
|
|
12221
12281
|
}
|
|
12222
12282
|
),
|
|
12223
|
-
/* @__PURE__ */
|
|
12283
|
+
/* @__PURE__ */ React142.createElement(
|
|
12224
12284
|
"path",
|
|
12225
12285
|
{
|
|
12226
12286
|
d: "M6 3.3335V4.66683",
|
|
@@ -12229,7 +12289,7 @@ var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React141.createElemen
|
|
|
12229
12289
|
strokeLinejoin: "round"
|
|
12230
12290
|
}
|
|
12231
12291
|
),
|
|
12232
|
-
/* @__PURE__ */
|
|
12292
|
+
/* @__PURE__ */ React142.createElement(
|
|
12233
12293
|
"path",
|
|
12234
12294
|
{
|
|
12235
12295
|
d: "M2.11 5.10986L2.82 5.81986",
|
|
@@ -12238,7 +12298,7 @@ var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React141.createElemen
|
|
|
12238
12298
|
strokeLinejoin: "round"
|
|
12239
12299
|
}
|
|
12240
12300
|
),
|
|
12241
|
-
/* @__PURE__ */
|
|
12301
|
+
/* @__PURE__ */ React142.createElement(
|
|
12242
12302
|
"path",
|
|
12243
12303
|
{
|
|
12244
12304
|
d: "M0.5 9H1.5",
|
|
@@ -12247,7 +12307,7 @@ var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React141.createElemen
|
|
|
12247
12307
|
strokeLinejoin: "round"
|
|
12248
12308
|
}
|
|
12249
12309
|
),
|
|
12250
|
-
/* @__PURE__ */
|
|
12310
|
+
/* @__PURE__ */ React142.createElement(
|
|
12251
12311
|
"path",
|
|
12252
12312
|
{
|
|
12253
12313
|
d: "M10.5 9H11.5",
|
|
@@ -12256,7 +12316,7 @@ var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React141.createElemen
|
|
|
12256
12316
|
strokeLinejoin: "round"
|
|
12257
12317
|
}
|
|
12258
12318
|
),
|
|
12259
|
-
/* @__PURE__ */
|
|
12319
|
+
/* @__PURE__ */ React142.createElement(
|
|
12260
12320
|
"path",
|
|
12261
12321
|
{
|
|
12262
12322
|
d: "M9.17999 5.81986L9.88999 5.10986",
|
|
@@ -12265,7 +12325,7 @@ var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React141.createElemen
|
|
|
12265
12325
|
strokeLinejoin: "round"
|
|
12266
12326
|
}
|
|
12267
12327
|
),
|
|
12268
|
-
/* @__PURE__ */
|
|
12328
|
+
/* @__PURE__ */ React142.createElement(
|
|
12269
12329
|
"path",
|
|
12270
12330
|
{
|
|
12271
12331
|
d: "M11.5 11H0.5",
|
|
@@ -12327,16 +12387,15 @@ var ActionableRow = ({
|
|
|
12327
12387
|
// src/components/Onboarding/ConnectAccount.tsx
|
|
12328
12388
|
var ConnectAccount = ({
|
|
12329
12389
|
onboardingStep,
|
|
12330
|
-
onTransactionsToReviewClick
|
|
12390
|
+
onTransactionsToReviewClick,
|
|
12391
|
+
currentMonthOnly = true
|
|
12331
12392
|
}) => {
|
|
12332
12393
|
const { addConnection } = (0, import_react132.useContext)(LinkedAccountsContext);
|
|
12333
12394
|
const { data, isLoading } = useBankTransactions();
|
|
12334
|
-
const transactionsToReview = (0, import_react132.useMemo)(
|
|
12335
|
-
|
|
12336
|
-
|
|
12337
|
-
|
|
12338
|
-
return 0;
|
|
12339
|
-
}, [data, isLoading]);
|
|
12395
|
+
const transactionsToReview = (0, import_react132.useMemo)(
|
|
12396
|
+
() => countTransactionsToReview({ transactions: data, currentMonthOnly }),
|
|
12397
|
+
[data, isLoading]
|
|
12398
|
+
);
|
|
12340
12399
|
if (onboardingStep === "connectAccount") {
|
|
12341
12400
|
return /* @__PURE__ */ import_react132.default.createElement(import_react132.default.Fragment, null, /* @__PURE__ */ import_react132.default.createElement(
|
|
12342
12401
|
DataState,
|
|
@@ -12375,7 +12434,16 @@ var ConnectAccount = ({
|
|
|
12375
12434
|
ActionableRow,
|
|
12376
12435
|
{
|
|
12377
12436
|
icon: /* @__PURE__ */ import_react132.default.createElement(Folder_default, { size: 12 }),
|
|
12378
|
-
title: /* @__PURE__ */ import_react132.default.createElement(Text, null, "Categorise transactions", " ", /* @__PURE__ */ import_react132.default.createElement(
|
|
12437
|
+
title: /* @__PURE__ */ import_react132.default.createElement(Text, null, "Categorise transactions", " ", /* @__PURE__ */ import_react132.default.createElement(
|
|
12438
|
+
Badge,
|
|
12439
|
+
{
|
|
12440
|
+
variant: "warning" /* WARNING */,
|
|
12441
|
+
size: "small" /* SMALL */,
|
|
12442
|
+
icon: /* @__PURE__ */ import_react132.default.createElement(Bell_default, { size: 12 })
|
|
12443
|
+
},
|
|
12444
|
+
transactionsToReview,
|
|
12445
|
+
" pending"
|
|
12446
|
+
)),
|
|
12379
12447
|
description: "Once your data is on the platform categorize them in Bank Transactions tab",
|
|
12380
12448
|
onClick: () => onTransactionsToReviewClick()
|
|
12381
12449
|
}
|
|
@@ -12484,8 +12552,8 @@ var useTasks = () => {
|
|
|
12484
12552
|
var import_react135 = __toESM(require("react"));
|
|
12485
12553
|
|
|
12486
12554
|
// src/icons/ProgressIcon.tsx
|
|
12487
|
-
var
|
|
12488
|
-
var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */
|
|
12555
|
+
var React146 = __toESM(require("react"));
|
|
12556
|
+
var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React146.createElement(
|
|
12489
12557
|
"svg",
|
|
12490
12558
|
{
|
|
12491
12559
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12495,7 +12563,7 @@ var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React145.createE
|
|
|
12495
12563
|
width: size,
|
|
12496
12564
|
height: size
|
|
12497
12565
|
},
|
|
12498
|
-
/* @__PURE__ */
|
|
12566
|
+
/* @__PURE__ */ React146.createElement(
|
|
12499
12567
|
"path",
|
|
12500
12568
|
{
|
|
12501
12569
|
d: "M9 1.5V4.5",
|
|
@@ -12504,7 +12572,7 @@ var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React145.createE
|
|
|
12504
12572
|
strokeLinejoin: "round"
|
|
12505
12573
|
}
|
|
12506
12574
|
),
|
|
12507
|
-
/* @__PURE__ */
|
|
12575
|
+
/* @__PURE__ */ React146.createElement(
|
|
12508
12576
|
"path",
|
|
12509
12577
|
{
|
|
12510
12578
|
d: "M9 13.5V16.5",
|
|
@@ -12513,7 +12581,7 @@ var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React145.createE
|
|
|
12513
12581
|
strokeLinejoin: "round"
|
|
12514
12582
|
}
|
|
12515
12583
|
),
|
|
12516
|
-
/* @__PURE__ */
|
|
12584
|
+
/* @__PURE__ */ React146.createElement(
|
|
12517
12585
|
"path",
|
|
12518
12586
|
{
|
|
12519
12587
|
d: "M3.6975 3.6975L5.82 5.82",
|
|
@@ -12522,7 +12590,7 @@ var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React145.createE
|
|
|
12522
12590
|
strokeLinejoin: "round"
|
|
12523
12591
|
}
|
|
12524
12592
|
),
|
|
12525
|
-
/* @__PURE__ */
|
|
12593
|
+
/* @__PURE__ */ React146.createElement(
|
|
12526
12594
|
"path",
|
|
12527
12595
|
{
|
|
12528
12596
|
d: "M12.18 12.18L14.3025 14.3025",
|
|
@@ -12531,7 +12599,7 @@ var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React145.createE
|
|
|
12531
12599
|
strokeLinejoin: "round"
|
|
12532
12600
|
}
|
|
12533
12601
|
),
|
|
12534
|
-
/* @__PURE__ */
|
|
12602
|
+
/* @__PURE__ */ React146.createElement(
|
|
12535
12603
|
"path",
|
|
12536
12604
|
{
|
|
12537
12605
|
d: "M1.5 9H4.5",
|
|
@@ -12540,7 +12608,7 @@ var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React145.createE
|
|
|
12540
12608
|
strokeLinejoin: "round"
|
|
12541
12609
|
}
|
|
12542
12610
|
),
|
|
12543
|
-
/* @__PURE__ */
|
|
12611
|
+
/* @__PURE__ */ React146.createElement(
|
|
12544
12612
|
"path",
|
|
12545
12613
|
{
|
|
12546
12614
|
d: "M13.5 9H16.5",
|
|
@@ -12549,7 +12617,7 @@ var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React145.createE
|
|
|
12549
12617
|
strokeLinejoin: "round"
|
|
12550
12618
|
}
|
|
12551
12619
|
),
|
|
12552
|
-
/* @__PURE__ */
|
|
12620
|
+
/* @__PURE__ */ React146.createElement(
|
|
12553
12621
|
"path",
|
|
12554
12622
|
{
|
|
12555
12623
|
d: "M3.6975 14.3025L5.82 12.18",
|
|
@@ -12558,7 +12626,7 @@ var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React145.createE
|
|
|
12558
12626
|
strokeLinejoin: "round"
|
|
12559
12627
|
}
|
|
12560
12628
|
),
|
|
12561
|
-
/* @__PURE__ */
|
|
12629
|
+
/* @__PURE__ */ React146.createElement(
|
|
12562
12630
|
"path",
|
|
12563
12631
|
{
|
|
12564
12632
|
d: "M12.18 5.82L14.3025 3.6975",
|
|
@@ -12607,8 +12675,8 @@ var TasksHeader = () => {
|
|
|
12607
12675
|
var import_react137 = __toESM(require("react"));
|
|
12608
12676
|
|
|
12609
12677
|
// src/icons/SmileIcon.tsx
|
|
12610
|
-
var
|
|
12611
|
-
var SmileIcon = ({ size = 12, ...props }) => /* @__PURE__ */
|
|
12678
|
+
var React148 = __toESM(require("react"));
|
|
12679
|
+
var SmileIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React148.createElement(
|
|
12612
12680
|
"svg",
|
|
12613
12681
|
{
|
|
12614
12682
|
viewBox: "0 0 12 12",
|
|
@@ -12618,7 +12686,7 @@ var SmileIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React147.createElem
|
|
|
12618
12686
|
width: size,
|
|
12619
12687
|
height: size
|
|
12620
12688
|
},
|
|
12621
|
-
/* @__PURE__ */
|
|
12689
|
+
/* @__PURE__ */ React148.createElement(
|
|
12622
12690
|
"path",
|
|
12623
12691
|
{
|
|
12624
12692
|
d: "M6.5 11.5C9.26142 11.5 11.5 9.26142 11.5 6.5C11.5 3.73858 9.26142 1.5 6.5 1.5C3.73858 1.5 1.5 3.73858 1.5 6.5C1.5 9.26142 3.73858 11.5 6.5 11.5Z",
|
|
@@ -12627,7 +12695,7 @@ var SmileIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React147.createElem
|
|
|
12627
12695
|
strokeLinejoin: "round"
|
|
12628
12696
|
}
|
|
12629
12697
|
),
|
|
12630
|
-
/* @__PURE__ */
|
|
12698
|
+
/* @__PURE__ */ React148.createElement(
|
|
12631
12699
|
"path",
|
|
12632
12700
|
{
|
|
12633
12701
|
d: "M4.5 7.5C4.5 7.5 5.25 8.5 6.5 8.5C7.75 8.5 8.5 7.5 8.5 7.5",
|
|
@@ -12636,7 +12704,7 @@ var SmileIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React147.createElem
|
|
|
12636
12704
|
strokeLinejoin: "round"
|
|
12637
12705
|
}
|
|
12638
12706
|
),
|
|
12639
|
-
/* @__PURE__ */
|
|
12707
|
+
/* @__PURE__ */ React148.createElement(
|
|
12640
12708
|
"path",
|
|
12641
12709
|
{
|
|
12642
12710
|
d: "M5 5H5.005",
|
|
@@ -12645,7 +12713,7 @@ var SmileIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React147.createElem
|
|
|
12645
12713
|
strokeLinejoin: "round"
|
|
12646
12714
|
}
|
|
12647
12715
|
),
|
|
12648
|
-
/* @__PURE__ */
|
|
12716
|
+
/* @__PURE__ */ React148.createElement(
|
|
12649
12717
|
"path",
|
|
12650
12718
|
{
|
|
12651
12719
|
d: "M8 5H8.005",
|
|
@@ -12802,39 +12870,6 @@ var import_react145 = __toESM(require("react"));
|
|
|
12802
12870
|
// src/components/TransactionToReviewCard/TransactionToReviewCard.tsx
|
|
12803
12871
|
var import_react142 = __toESM(require("react"));
|
|
12804
12872
|
|
|
12805
|
-
// src/icons/Bell.tsx
|
|
12806
|
-
var React152 = __toESM(require("react"));
|
|
12807
|
-
var Bell = ({ size = 18, ...props }) => /* @__PURE__ */ React152.createElement(
|
|
12808
|
-
"svg",
|
|
12809
|
-
{
|
|
12810
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
12811
|
-
viewBox: "0 0 18 18",
|
|
12812
|
-
fill: "none",
|
|
12813
|
-
...props,
|
|
12814
|
-
width: size,
|
|
12815
|
-
height: size
|
|
12816
|
-
},
|
|
12817
|
-
/* @__PURE__ */ React152.createElement(
|
|
12818
|
-
"path",
|
|
12819
|
-
{
|
|
12820
|
-
d: "M13.5 6C13.5 4.80653 13.0259 3.66193 12.182 2.81802C11.3381 1.97411 10.1935 1.5 9 1.5C7.80653 1.5 6.66193 1.97411 5.81802 2.81802C4.97411 3.66193 4.5 4.80653 4.5 6C4.5 11.25 2.25 12.75 2.25 12.75H15.75C15.75 12.75 13.5 11.25 13.5 6Z",
|
|
12821
|
-
stroke: "currentColor",
|
|
12822
|
-
strokeLinecap: "round",
|
|
12823
|
-
strokeLinejoin: "round"
|
|
12824
|
-
}
|
|
12825
|
-
),
|
|
12826
|
-
/* @__PURE__ */ React152.createElement(
|
|
12827
|
-
"path",
|
|
12828
|
-
{
|
|
12829
|
-
d: "M10.2975 15.75C10.1656 15.9773 9.97638 16.166 9.74867 16.2971C9.52096 16.4283 9.26278 16.4973 9 16.4973C8.73721 16.4973 8.47904 16.4283 8.25133 16.2971C8.02362 16.166 7.83436 15.9773 7.7025 15.75",
|
|
12830
|
-
stroke: "currentColor",
|
|
12831
|
-
strokeLinecap: "round",
|
|
12832
|
-
strokeLinejoin: "round"
|
|
12833
|
-
}
|
|
12834
|
-
)
|
|
12835
|
-
);
|
|
12836
|
-
var Bell_default = Bell;
|
|
12837
|
-
|
|
12838
12873
|
// src/components/BadgeLoader/BadgeLoader.tsx
|
|
12839
12874
|
var import_react140 = __toESM(require("react"));
|
|
12840
12875
|
var BadgeLoader = ({ children }) => {
|
|
@@ -12861,7 +12896,8 @@ var NotificationCard = ({
|
|
|
12861
12896
|
|
|
12862
12897
|
// src/components/TransactionToReviewCard/TransactionToReviewCard.tsx
|
|
12863
12898
|
var TransactionToReviewCard = ({
|
|
12864
|
-
onClick
|
|
12899
|
+
onClick,
|
|
12900
|
+
currentMonthOnly = true
|
|
12865
12901
|
}) => {
|
|
12866
12902
|
const [loaded, setLoaded] = (0, import_react142.useState)("initiated");
|
|
12867
12903
|
const { data, isLoading, error, refetch } = useBankTransactions();
|
|
@@ -12879,12 +12915,10 @@ var TransactionToReviewCard = ({
|
|
|
12879
12915
|
return;
|
|
12880
12916
|
}
|
|
12881
12917
|
}, [isLoading]);
|
|
12882
|
-
const toReview = (0, import_react142.useMemo)(
|
|
12883
|
-
|
|
12884
|
-
|
|
12885
|
-
|
|
12886
|
-
return 0;
|
|
12887
|
-
}, [data, isLoading]);
|
|
12918
|
+
const toReview = (0, import_react142.useMemo)(
|
|
12919
|
+
() => countTransactionsToReview({ transactions: data, currentMonthOnly }),
|
|
12920
|
+
[data, isLoading]
|
|
12921
|
+
);
|
|
12888
12922
|
return /* @__PURE__ */ import_react142.default.createElement(
|
|
12889
12923
|
NotificationCard,
|
|
12890
12924
|
{
|
|
@@ -12952,7 +12986,12 @@ var AccountingOverview = ({
|
|
|
12952
12986
|
onTransactionsToReviewClick
|
|
12953
12987
|
}) => {
|
|
12954
12988
|
const [pnlToggle, setPnlToggle] = (0, import_react145.useState)("revenue");
|
|
12955
|
-
return /* @__PURE__ */ import_react145.default.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ import_react145.default.createElement(View3, { title, headerControls: /* @__PURE__ */ import_react145.default.createElement(ProfitAndLoss.DatePicker, null) }, enableOnboarding && /* @__PURE__ */ import_react145.default.createElement(
|
|
12989
|
+
return /* @__PURE__ */ import_react145.default.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ import_react145.default.createElement(View3, { title, headerControls: /* @__PURE__ */ import_react145.default.createElement(ProfitAndLoss.DatePicker, null) }, enableOnboarding && /* @__PURE__ */ import_react145.default.createElement(
|
|
12990
|
+
Onboarding,
|
|
12991
|
+
{
|
|
12992
|
+
onTransactionsToReviewClick
|
|
12993
|
+
}
|
|
12994
|
+
), /* @__PURE__ */ import_react145.default.createElement("div", { className: "Layer__accounting-overview__summaries-row" }, /* @__PURE__ */ import_react145.default.createElement(ProfitAndLoss.Summaries, { actionable: false }), /* @__PURE__ */ import_react145.default.createElement(TransactionToReviewCard, { onClick: onTransactionsToReviewClick })), /* @__PURE__ */ import_react145.default.createElement(
|
|
12956
12995
|
Container,
|
|
12957
12996
|
{
|
|
12958
12997
|
name: "accounting-overview-profit-and-loss",
|
|
@@ -13006,7 +13045,8 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
13006
13045
|
elevatedLinkedAccounts = true,
|
|
13007
13046
|
showLedgerBalance = true,
|
|
13008
13047
|
showDescriptions,
|
|
13009
|
-
showReceiptUploads
|
|
13048
|
+
showReceiptUploads,
|
|
13049
|
+
mobileComponent
|
|
13010
13050
|
}) => {
|
|
13011
13051
|
return /* @__PURE__ */ import_react146.default.createElement(View3, { title }, /* @__PURE__ */ import_react146.default.createElement(
|
|
13012
13052
|
LinkedAccounts,
|
|
@@ -13019,7 +13059,8 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
13019
13059
|
{
|
|
13020
13060
|
asWidget: true,
|
|
13021
13061
|
showDescriptions,
|
|
13022
|
-
showReceiptUploads
|
|
13062
|
+
showReceiptUploads,
|
|
13063
|
+
mobileComponent
|
|
13023
13064
|
}
|
|
13024
13065
|
));
|
|
13025
13066
|
};
|