@layerfi/components 0.1.36 → 0.1.37
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/.idea/codeStyles/Project.xml +61 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/layer-react.iml +9 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/dist/esm/index.js +635 -377
- package/dist/esm/index.js.map +4 -4
- package/dist/index.d.ts +50 -34
- package/dist/index.js +557 -299
- package/dist/index.js.map +4 -4
- package/dist/styles/index.css +77 -13
- package/dist/styles/index.css.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33,10 +33,12 @@ __export(src_exports, {
|
|
|
33
33
|
AccountingOverview: () => AccountingOverview,
|
|
34
34
|
BalanceSheet: () => BalanceSheet,
|
|
35
35
|
BankTransactions: () => BankTransactions,
|
|
36
|
+
BankTransactionsProvider: () => BankTransactionsProvider,
|
|
36
37
|
BankTransactionsWithLinkedAccounts: () => BankTransactionsWithLinkedAccounts,
|
|
37
38
|
BookkeepingOverview: () => BookkeepingOverview,
|
|
38
39
|
BookkeepingUpsellBar: () => BookkeepingUpsellBar,
|
|
39
40
|
ChartOfAccounts: () => ChartOfAccounts,
|
|
41
|
+
DisplayState: () => DisplayState,
|
|
40
42
|
GeneralLedgerView: () => GeneralLedgerView,
|
|
41
43
|
Journal: () => Journal,
|
|
42
44
|
LayerProvider: () => LayerProvider,
|
|
@@ -201,9 +203,11 @@ var getBalanceSheet = get(
|
|
|
201
203
|
var getBankTransactions = get(
|
|
202
204
|
({
|
|
203
205
|
businessId,
|
|
206
|
+
cursor,
|
|
207
|
+
categorized,
|
|
204
208
|
sortBy = "date",
|
|
205
209
|
sortOrder = "DESC"
|
|
206
|
-
}) => `/v1/businesses/${businessId}/bank-transactions?sort_by=${sortBy}&sort_order=${sortOrder}&limit=200`
|
|
210
|
+
}) => `/v1/businesses/${businessId}/bank-transactions?${cursor ? `cursor=${cursor}&` : ""}${categorized !== void 0 && categorized !== "" ? `categorized=${categorized}&` : ""}sort_by=${sortBy}&sort_order=${sortOrder}&limit=200`
|
|
207
211
|
);
|
|
208
212
|
var categorizeBankTransaction = put(
|
|
209
213
|
({ businessId, bankTransactionId }) => `/v1/businesses/${businessId}/bank-transactions/${bankTransactionId}/categorize`
|
|
@@ -667,6 +671,25 @@ var import_react11 = __toESM(require("react"));
|
|
|
667
671
|
|
|
668
672
|
// src/contexts/BankTransactionsContext/BankTransactionsContext.tsx
|
|
669
673
|
var import_react9 = require("react");
|
|
674
|
+
|
|
675
|
+
// src/types/bank_transactions.ts
|
|
676
|
+
var Direction = /* @__PURE__ */ ((Direction3) => {
|
|
677
|
+
Direction3["CREDIT"] = "CREDIT";
|
|
678
|
+
Direction3["DEBIT"] = "DEBIT";
|
|
679
|
+
return Direction3;
|
|
680
|
+
})(Direction || {});
|
|
681
|
+
var DisplayState = /* @__PURE__ */ ((DisplayState2) => {
|
|
682
|
+
DisplayState2["review"] = "review";
|
|
683
|
+
DisplayState2["categorized"] = "categorized";
|
|
684
|
+
return DisplayState2;
|
|
685
|
+
})(DisplayState || {});
|
|
686
|
+
|
|
687
|
+
// src/types/categories.ts
|
|
688
|
+
function hasSuggestions(categorization) {
|
|
689
|
+
return categorization.suggestions !== void 0 && categorization.suggestions.length > 0;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
// src/contexts/BankTransactionsContext/BankTransactionsContext.tsx
|
|
670
693
|
var BankTransactionsContext = (0, import_react9.createContext)({
|
|
671
694
|
data: void 0,
|
|
672
695
|
isLoading: false,
|
|
@@ -684,26 +707,18 @@ var BankTransactionsContext = (0, import_react9.createContext)({
|
|
|
684
707
|
pagination: void 0
|
|
685
708
|
},
|
|
686
709
|
updateOneLocal: () => void 0,
|
|
710
|
+
removeAfterCategorize: () => void 0,
|
|
687
711
|
activate: () => void 0,
|
|
688
|
-
display: "review" /* review
|
|
712
|
+
display: "review" /* review */,
|
|
713
|
+
fetchMore: () => {
|
|
714
|
+
},
|
|
715
|
+
hasMore: false
|
|
689
716
|
});
|
|
690
717
|
var useBankTransactionsContext = () => (0, import_react9.useContext)(BankTransactionsContext);
|
|
691
718
|
|
|
692
719
|
// src/hooks/useBankTransactions/useBankTransactions.tsx
|
|
693
720
|
var import_react10 = require("react");
|
|
694
721
|
|
|
695
|
-
// src/types/bank_transactions.ts
|
|
696
|
-
var Direction = /* @__PURE__ */ ((Direction3) => {
|
|
697
|
-
Direction3["CREDIT"] = "CREDIT";
|
|
698
|
-
Direction3["DEBIT"] = "DEBIT";
|
|
699
|
-
return Direction3;
|
|
700
|
-
})(Direction || {});
|
|
701
|
-
|
|
702
|
-
// src/types/categories.ts
|
|
703
|
-
function hasSuggestions(categorization) {
|
|
704
|
-
return categorization.suggestions !== void 0 && categorization.suggestions.length > 0;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
722
|
// src/components/BankTransactions/constants.ts
|
|
708
723
|
var CategorizedCategories = [
|
|
709
724
|
"CATEGORIZED" /* CATEGORIZED */,
|
|
@@ -724,7 +739,7 @@ var filterVisibility = (scope, bankTransaction) => {
|
|
|
724
739
|
const inReview = ReviewCategories.includes(
|
|
725
740
|
bankTransaction.categorization_status
|
|
726
741
|
);
|
|
727
|
-
return scope === "
|
|
742
|
+
return scope === "review" /* review */ && inReview || scope === "categorized" /* categorized */ && categorized;
|
|
728
743
|
};
|
|
729
744
|
var isCategorized = (bankTransaction) => CategorizedCategories.includes(bankTransaction.categorization_status);
|
|
730
745
|
|
|
@@ -773,7 +788,7 @@ var applyCategorizationStatusFilter = (data, filter) => {
|
|
|
773
788
|
return data;
|
|
774
789
|
}
|
|
775
790
|
return data?.filter(
|
|
776
|
-
(tx) => filterVisibility(filter, tx) || filter === "
|
|
791
|
+
(tx) => filterVisibility(filter, tx) || filter === "review" /* review */ && tx.recently_categorized || filter === "categorized" /* categorized */ && tx.recently_categorized
|
|
777
792
|
);
|
|
778
793
|
};
|
|
779
794
|
var appplyDateRangeFilter = (data, filter) => {
|
|
@@ -792,8 +807,8 @@ var appplyDateRangeFilter = (data, filter) => {
|
|
|
792
807
|
};
|
|
793
808
|
|
|
794
809
|
// src/hooks/useBankTransactions/useBankTransactions.tsx
|
|
795
|
-
var
|
|
796
|
-
var useBankTransactions = () => {
|
|
810
|
+
var import_infinite = __toESM(require("swr/infinite"));
|
|
811
|
+
var useBankTransactions = (params) => {
|
|
797
812
|
const {
|
|
798
813
|
auth,
|
|
799
814
|
businessId,
|
|
@@ -804,36 +819,82 @@ var useBankTransactions = () => {
|
|
|
804
819
|
syncTimestamps,
|
|
805
820
|
hasBeenTouched
|
|
806
821
|
} = useLayerContext();
|
|
807
|
-
const
|
|
808
|
-
const [filters, setTheFilters] = (0, import_react10.useState)(
|
|
809
|
-
|
|
822
|
+
const { scope = void 0 } = params ?? {};
|
|
823
|
+
const [filters, setTheFilters] = (0, import_react10.useState)(
|
|
824
|
+
scope ? { categorizationStatus: scope } : void 0
|
|
825
|
+
);
|
|
810
826
|
const display = (0, import_react10.useMemo)(() => {
|
|
811
|
-
if (filters?.categorizationStatus === "
|
|
827
|
+
if (filters?.categorizationStatus === "review" /* review */) {
|
|
812
828
|
return "review" /* review */;
|
|
813
829
|
}
|
|
814
830
|
return "categorized" /* categorized */;
|
|
815
831
|
}, [filters?.categorizationStatus]);
|
|
816
|
-
const
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
832
|
+
const [active, setActive] = (0, import_react10.useState)(false);
|
|
833
|
+
const [loadingStatus, setLoadingStatus] = (0, import_react10.useState)("initial");
|
|
834
|
+
const getKey = (_index, prevData) => {
|
|
835
|
+
if (!auth?.access_token || !active) {
|
|
836
|
+
return [false, void 0];
|
|
837
|
+
}
|
|
838
|
+
if (!prevData?.meta?.pagination?.cursor) {
|
|
839
|
+
return [
|
|
840
|
+
businessId && auth?.access_token && `bank-transactions${filters?.categorizationStatus ? `-scope-${filters?.categorizationStatus}` : ""}-${businessId}`,
|
|
841
|
+
void 0
|
|
842
|
+
];
|
|
843
|
+
}
|
|
844
|
+
return [
|
|
845
|
+
businessId && auth?.access_token && `bank-transactions${filters?.categorizationStatus ? `-scope-${filters?.categorizationStatus}` : ""}-${businessId}-${prevData.meta.pagination.cursor}`,
|
|
846
|
+
prevData.meta.pagination.cursor
|
|
847
|
+
];
|
|
848
|
+
};
|
|
822
849
|
const {
|
|
823
|
-
data:
|
|
850
|
+
data: rawResponseData,
|
|
824
851
|
isLoading,
|
|
825
852
|
isValidating,
|
|
826
853
|
error: responseError,
|
|
827
|
-
mutate
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
854
|
+
mutate,
|
|
855
|
+
size,
|
|
856
|
+
setSize
|
|
857
|
+
} = (0, import_infinite.default)(
|
|
858
|
+
getKey,
|
|
859
|
+
async ([query, nextCursor]) => {
|
|
860
|
+
if (auth?.access_token) {
|
|
861
|
+
return Layer.getBankTransactions(apiUrl, auth?.access_token, {
|
|
862
|
+
params: {
|
|
863
|
+
businessId,
|
|
864
|
+
cursor: nextCursor,
|
|
865
|
+
categorized: filters?.categorizationStatus ? filters?.categorizationStatus === "categorized" /* categorized */ ? "true" : "false" : ""
|
|
866
|
+
}
|
|
867
|
+
}).call(false);
|
|
868
|
+
}
|
|
869
|
+
return {};
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
initialSize: 1,
|
|
873
|
+
revalidateFirstPage: false
|
|
874
|
+
}
|
|
833
875
|
);
|
|
876
|
+
const data = (0, import_react10.useMemo)(() => {
|
|
877
|
+
if (rawResponseData && rawResponseData.length > 0) {
|
|
878
|
+
return rawResponseData?.map((x) => x?.data).flat().filter((x) => !!x);
|
|
879
|
+
}
|
|
880
|
+
return void 0;
|
|
881
|
+
}, [rawResponseData]);
|
|
882
|
+
const lastMetadata = (0, import_react10.useMemo)(() => {
|
|
883
|
+
if (rawResponseData && rawResponseData.length > 0) {
|
|
884
|
+
return rawResponseData[rawResponseData.length - 1].meta;
|
|
885
|
+
}
|
|
886
|
+
return void 0;
|
|
887
|
+
}, [rawResponseData]);
|
|
888
|
+
const hasMore = (0, import_react10.useMemo)(() => {
|
|
889
|
+
if (rawResponseData && rawResponseData.length > 0) {
|
|
890
|
+
const lastElement = rawResponseData[rawResponseData.length - 1];
|
|
891
|
+
return Boolean(lastElement.meta?.pagination?.cursor && lastElement.meta?.pagination?.has_more);
|
|
892
|
+
}
|
|
893
|
+
return false;
|
|
894
|
+
}, [rawResponseData]);
|
|
834
895
|
const accountsList = (0, import_react10.useMemo)(
|
|
835
|
-
() => collectAccounts(
|
|
836
|
-
[
|
|
896
|
+
() => data ? collectAccounts(data) : [],
|
|
897
|
+
[data]
|
|
837
898
|
);
|
|
838
899
|
(0, import_react10.useEffect)(() => {
|
|
839
900
|
if (isLoading && loadingStatus === "initial") {
|
|
@@ -854,13 +915,11 @@ var useBankTransactions = () => {
|
|
|
854
915
|
...value ?? {}
|
|
855
916
|
});
|
|
856
917
|
};
|
|
857
|
-
const {
|
|
858
|
-
data = void 0,
|
|
859
|
-
meta: metadata = {},
|
|
860
|
-
error = void 0
|
|
861
|
-
} = responseData || {};
|
|
862
918
|
const filteredData = (0, import_react10.useMemo)(() => {
|
|
863
919
|
let filtered = data;
|
|
920
|
+
if (!filtered) {
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
864
923
|
if (filters?.amount?.min || filters?.amount?.max) {
|
|
865
924
|
filtered = applyAmountFilter(filtered, filters.amount);
|
|
866
925
|
}
|
|
@@ -880,7 +939,7 @@ var useBankTransactions = () => {
|
|
|
880
939
|
filtered = appplyDateRangeFilter(filtered, filters?.dateRange);
|
|
881
940
|
}
|
|
882
941
|
return filtered;
|
|
883
|
-
}, [filters,
|
|
942
|
+
}, [filters, data]);
|
|
884
943
|
const categorize = (id, newCategory, notify) => {
|
|
885
944
|
const foundBT = data?.find((x) => x.business_id === businessId && x.id === id);
|
|
886
945
|
if (foundBT) {
|
|
@@ -953,14 +1012,31 @@ var useBankTransactions = () => {
|
|
|
953
1012
|
}).finally(() => touch("BANK_TRANSACTIONS" /* BANK_TRANSACTIONS */));
|
|
954
1013
|
};
|
|
955
1014
|
const updateOneLocal = (newBankTransaction) => {
|
|
956
|
-
const updatedData =
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
1015
|
+
const updatedData = rawResponseData?.map((page) => {
|
|
1016
|
+
return {
|
|
1017
|
+
...page,
|
|
1018
|
+
data: page.data?.map((bt) => bt.id === newBankTransaction.id ? newBankTransaction : bt)
|
|
1019
|
+
};
|
|
1020
|
+
});
|
|
1021
|
+
mutate(updatedData, { revalidate: false });
|
|
1022
|
+
};
|
|
1023
|
+
const removeAfterCategorize = (bankTransaction) => {
|
|
1024
|
+
const updatedData = rawResponseData?.map((page) => {
|
|
1025
|
+
return {
|
|
1026
|
+
...page,
|
|
1027
|
+
data: page.data?.filter((bt) => bt.id !== bankTransaction.id)
|
|
1028
|
+
};
|
|
1029
|
+
});
|
|
1030
|
+
mutate(updatedData, { revalidate: false });
|
|
960
1031
|
};
|
|
961
1032
|
const refetch = () => {
|
|
962
1033
|
mutate();
|
|
963
1034
|
};
|
|
1035
|
+
const fetchMore = () => {
|
|
1036
|
+
if (hasMore) {
|
|
1037
|
+
setSize(size + 1);
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
964
1040
|
(0, import_react10.useEffect)(() => {
|
|
965
1041
|
if (isLoading || isValidating) {
|
|
966
1042
|
read("BANK_TRANSACTIONS" /* BANK_TRANSACTIONS */);
|
|
@@ -973,20 +1049,23 @@ var useBankTransactions = () => {
|
|
|
973
1049
|
}, [syncTimestamps]);
|
|
974
1050
|
return {
|
|
975
1051
|
data: filteredData,
|
|
976
|
-
metadata,
|
|
1052
|
+
metadata: lastMetadata,
|
|
977
1053
|
loadingStatus,
|
|
978
1054
|
isLoading,
|
|
979
1055
|
isValidating,
|
|
980
1056
|
refetch,
|
|
981
|
-
error: responseError
|
|
1057
|
+
error: responseError,
|
|
982
1058
|
categorize,
|
|
983
1059
|
match,
|
|
984
1060
|
updateOneLocal,
|
|
1061
|
+
removeAfterCategorize,
|
|
985
1062
|
filters,
|
|
986
1063
|
setFilters,
|
|
987
1064
|
accountsList,
|
|
988
1065
|
activate,
|
|
989
|
-
display
|
|
1066
|
+
display,
|
|
1067
|
+
fetchMore,
|
|
1068
|
+
hasMore
|
|
990
1069
|
};
|
|
991
1070
|
};
|
|
992
1071
|
|
|
@@ -1239,7 +1318,7 @@ var hslToHex = (hsl) => {
|
|
|
1239
1318
|
|
|
1240
1319
|
// src/providers/LayerProvider/LayerProvider.tsx
|
|
1241
1320
|
var import_date_fns2 = require("date-fns");
|
|
1242
|
-
var
|
|
1321
|
+
var import_swr = __toESM(require("swr"));
|
|
1243
1322
|
var reducer = (state, action) => {
|
|
1244
1323
|
switch (action.type) {
|
|
1245
1324
|
case "LayerContext.setAuth" /* setAuth */:
|
|
@@ -1279,10 +1358,20 @@ var LayerEnvironment = {
|
|
|
1279
1358
|
scope: "https://api.layerfi.com/production",
|
|
1280
1359
|
apiUrl: "https://api.layerfi.com"
|
|
1281
1360
|
},
|
|
1361
|
+
sandbox: {
|
|
1362
|
+
url: "https://auth.layerfi.com/oauth2/token",
|
|
1363
|
+
scope: "https://sandbox.layerfi.com/sandbox",
|
|
1364
|
+
apiUrl: "https://sandbox.layerfi.com"
|
|
1365
|
+
},
|
|
1282
1366
|
staging: {
|
|
1283
1367
|
url: "https://auth.layerfi.com/oauth2/token",
|
|
1284
1368
|
scope: "https://sandbox.layerfi.com/sandbox",
|
|
1285
1369
|
apiUrl: "https://sandbox.layerfi.com"
|
|
1370
|
+
},
|
|
1371
|
+
internalStaging: {
|
|
1372
|
+
url: "https://auth.layerfi.com/oauth2/token",
|
|
1373
|
+
scope: "https://sandbox.layerfi.com/sandbox",
|
|
1374
|
+
apiUrl: "https://staging.layerfi.com"
|
|
1286
1375
|
}
|
|
1287
1376
|
};
|
|
1288
1377
|
var LayerProvider = ({
|
|
@@ -1324,7 +1413,7 @@ var LayerProvider = ({
|
|
|
1324
1413
|
toasts: []
|
|
1325
1414
|
});
|
|
1326
1415
|
const { touch, syncTimestamps, read, readTimestamps, hasBeenTouched } = useDataSync();
|
|
1327
|
-
const { data: auth } = appId !== void 0 && appSecret !== void 0 ? (0,
|
|
1416
|
+
const { data: auth } = appId !== void 0 && appSecret !== void 0 ? (0, import_swr.default)(
|
|
1328
1417
|
businessAccessToken === void 0 && appId !== void 0 && appSecret !== void 0 && (0, import_date_fns2.isBefore)(state.auth.expires_at, /* @__PURE__ */ new Date()) && "authenticate",
|
|
1329
1418
|
Layer.authenticate({
|
|
1330
1419
|
appId,
|
|
@@ -1359,7 +1448,7 @@ var LayerProvider = ({
|
|
|
1359
1448
|
});
|
|
1360
1449
|
}
|
|
1361
1450
|
}, [businessAccessToken, auth?.access_token]);
|
|
1362
|
-
(0,
|
|
1451
|
+
(0, import_swr.default)(
|
|
1363
1452
|
businessId && state.auth?.access_token && `categories-${businessId}`,
|
|
1364
1453
|
Layer.getCategories(apiUrl, state.auth?.access_token, {
|
|
1365
1454
|
params: { businessId }
|
|
@@ -1376,7 +1465,7 @@ var LayerProvider = ({
|
|
|
1376
1465
|
}
|
|
1377
1466
|
}
|
|
1378
1467
|
);
|
|
1379
|
-
(0,
|
|
1468
|
+
(0, import_swr.default)(
|
|
1380
1469
|
businessId && state?.auth?.access_token && `business-${businessId}`,
|
|
1381
1470
|
Layer.getBusiness(apiUrl, state?.auth?.access_token, {
|
|
1382
1471
|
params: { businessId }
|
|
@@ -1465,7 +1554,7 @@ var LayerProvider = ({
|
|
|
1465
1554
|
payload: { onboardingStep: value }
|
|
1466
1555
|
});
|
|
1467
1556
|
const drawerContextData = useDrawer();
|
|
1468
|
-
return /* @__PURE__ */ import_react12.default.createElement(
|
|
1557
|
+
return /* @__PURE__ */ import_react12.default.createElement(import_swr.SWRConfig, { value: defaultSWRConfig }, /* @__PURE__ */ import_react12.default.createElement(
|
|
1469
1558
|
LayerContext.Provider,
|
|
1470
1559
|
{
|
|
1471
1560
|
value: {
|
|
@@ -1632,7 +1721,7 @@ var LINKED_ACCOUNTS_MOCK_DATA = [
|
|
|
1632
1721
|
];
|
|
1633
1722
|
|
|
1634
1723
|
// src/hooks/useLinkedAccounts/useLinkedAccounts.ts
|
|
1635
|
-
var
|
|
1724
|
+
var import_swr2 = __toESM(require("swr"));
|
|
1636
1725
|
var DEBUG = true;
|
|
1637
1726
|
var USE_MOCK_RESPONSE_DATA = false;
|
|
1638
1727
|
var useLinkedAccounts = () => {
|
|
@@ -1656,7 +1745,7 @@ var useLinkedAccounts = () => {
|
|
|
1656
1745
|
isValidating,
|
|
1657
1746
|
error: responseError,
|
|
1658
1747
|
mutate
|
|
1659
|
-
} = (0,
|
|
1748
|
+
} = (0, import_swr2.default)(
|
|
1660
1749
|
businessId && auth?.access_token && `linked-accounts-${businessId}`,
|
|
1661
1750
|
Layer.getLinkedAccounts(apiUrl, auth?.access_token, {
|
|
1662
1751
|
params: { businessId }
|
|
@@ -2177,15 +2266,13 @@ var countTransactionsToReview = ({
|
|
|
2177
2266
|
};
|
|
2178
2267
|
return transactions.filter((tx) => {
|
|
2179
2268
|
try {
|
|
2180
|
-
return filterVisibility("
|
|
2269
|
+
return filterVisibility("review" /* review */, tx) && (0, import_date_fns3.isWithinInterval)((0, import_date_fns3.parseISO)(tx.date), dateRangeInterval);
|
|
2181
2270
|
} catch (_err) {
|
|
2182
2271
|
return false;
|
|
2183
2272
|
}
|
|
2184
2273
|
}).length;
|
|
2185
2274
|
}
|
|
2186
|
-
return transactions.filter(
|
|
2187
|
-
(tx) => filterVisibility("TO_REVIEW" /* TO_REVIEW */, tx)
|
|
2188
|
-
).length;
|
|
2275
|
+
return transactions.filter((tx) => filterVisibility("review" /* review */, tx)).length;
|
|
2189
2276
|
}
|
|
2190
2277
|
return 0;
|
|
2191
2278
|
};
|
|
@@ -3245,7 +3332,9 @@ var ConnectAccount = ({
|
|
|
3245
3332
|
onTransactionsToReviewClick
|
|
3246
3333
|
}) => {
|
|
3247
3334
|
const { addConnection } = (0, import_react38.useContext)(LinkedAccountsContext);
|
|
3248
|
-
const { data, isLoading } = useBankTransactions(
|
|
3335
|
+
const { data, isLoading } = useBankTransactions({
|
|
3336
|
+
scope: "review" /* review */
|
|
3337
|
+
});
|
|
3249
3338
|
const transactionsToReview = (0, import_react38.useMemo)(
|
|
3250
3339
|
() => countTransactionsToReview({ transactions: data }),
|
|
3251
3340
|
[data, isLoading]
|
|
@@ -3861,15 +3950,21 @@ var LinkedAccountThumb = ({
|
|
|
3861
3950
|
}) => {
|
|
3862
3951
|
const linkedAccountThumbClassName = (0, import_classnames19.default)(
|
|
3863
3952
|
"Layer__linked-account-thumb",
|
|
3864
|
-
asWidget && "--as-widget"
|
|
3953
|
+
asWidget && "--as-widget",
|
|
3954
|
+
account.is_syncing && "--is-syncing",
|
|
3955
|
+
account.is_syncing && "skeleton-loader"
|
|
3956
|
+
);
|
|
3957
|
+
const linkedAccountInfoClassName = (0, import_classnames19.default)(
|
|
3958
|
+
"topbar",
|
|
3959
|
+
account.is_syncing && "--is-syncing"
|
|
3865
3960
|
);
|
|
3866
3961
|
let bankBalance;
|
|
3867
3962
|
if (pillConfig) {
|
|
3868
3963
|
bankBalance = /* @__PURE__ */ import_react46.default.createElement(LinkedAccountPill, { text: pillConfig.text, config: pillConfig.config });
|
|
3869
3964
|
} else {
|
|
3870
|
-
bankBalance = /* @__PURE__ */ import_react46.default.createElement(Text, { as: "span", className: "account-balance" },
|
|
3965
|
+
bankBalance = /* @__PURE__ */ import_react46.default.createElement(Text, { as: "span", className: "account-balance" }, `${centsToDollars(account.latest_balance_timestamp?.balance)}`);
|
|
3871
3966
|
}
|
|
3872
|
-
return /* @__PURE__ */ import_react46.default.createElement("div", { className: linkedAccountThumbClassName }, /* @__PURE__ */ import_react46.default.createElement("div", { className:
|
|
3967
|
+
return /* @__PURE__ */ import_react46.default.createElement("div", { className: linkedAccountThumbClassName }, /* @__PURE__ */ import_react46.default.createElement("div", { className: linkedAccountInfoClassName }, /* @__PURE__ */ import_react46.default.createElement("div", { className: "topbar-details" }, /* @__PURE__ */ import_react46.default.createElement(Text, { as: "div", className: "account-name" }, account.external_account_name), !asWidget && account.mask && /* @__PURE__ */ import_react46.default.createElement(AccountNumber, { accountNumber: account.mask }), /* @__PURE__ */ import_react46.default.createElement(
|
|
3873
3968
|
Text,
|
|
3874
3969
|
{
|
|
3875
3970
|
as: "span",
|
|
@@ -3885,7 +3980,7 @@ var LinkedAccountThumb = ({
|
|
|
3885
3980
|
src: `data:image/png;base64,${account.institution.logo}`,
|
|
3886
3981
|
alt: account.institution?.name
|
|
3887
3982
|
}
|
|
3888
|
-
) : /* @__PURE__ */ import_react46.default.createElement(InstitutionIcon_default, null))), !asWidget && /* @__PURE__ */ import_react46.default.createElement("div", { className: "middlebar" }, /* @__PURE__ */ import_react46.default.createElement(
|
|
3983
|
+
) : /* @__PURE__ */ import_react46.default.createElement(InstitutionIcon_default, null))), account.is_syncing ? /* @__PURE__ */ import_react46.default.createElement("div", { className: "loadingbar" }, /* @__PURE__ */ import_react46.default.createElement("div", { className: "loading-text Layer__text--sm" }, /* @__PURE__ */ import_react46.default.createElement("div", null, "Syncing account data"), /* @__PURE__ */ import_react46.default.createElement("div", { className: "syncing-data-description" }, "This may take up to 5 minutes")), /* @__PURE__ */ import_react46.default.createElement("div", { className: "loading-wrapper" }, /* @__PURE__ */ import_react46.default.createElement(Loader_default, { size: 11, className: "Layer__anim--rotating" }))) : /* @__PURE__ */ import_react46.default.createElement(import_react46.default.Fragment, null, !asWidget && /* @__PURE__ */ import_react46.default.createElement("div", { className: "middlebar" }, /* @__PURE__ */ import_react46.default.createElement(
|
|
3889
3984
|
Text,
|
|
3890
3985
|
{
|
|
3891
3986
|
as: "span",
|
|
@@ -3901,7 +3996,7 @@ var LinkedAccountThumb = ({
|
|
|
3901
3996
|
size: "sm"
|
|
3902
3997
|
},
|
|
3903
3998
|
"Ledger balance"
|
|
3904
|
-
), /* @__PURE__ */ import_react46.default.createElement(Text, { as: "span", className: "account-balance" },
|
|
3999
|
+
), /* @__PURE__ */ import_react46.default.createElement(Text, { as: "span", className: "account-balance" }, `${centsToDollars(account.current_ledger_balance)}`))));
|
|
3905
4000
|
};
|
|
3906
4001
|
|
|
3907
4002
|
// src/components/LinkedAccounts/LinkedAccountsContent.tsx
|
|
@@ -5595,9 +5690,20 @@ var ExpandedBankTransactionRow = (0, import_react65.forwardRef)(
|
|
|
5595
5690
|
});
|
|
5596
5691
|
setSplitFormError(void 0);
|
|
5597
5692
|
};
|
|
5693
|
+
const sanitizeNumberInput = (input) => {
|
|
5694
|
+
let sanitized = input.replace(/[^0-9.]/g, "");
|
|
5695
|
+
let parts = sanitized.split(".");
|
|
5696
|
+
if (parts.length > 2) {
|
|
5697
|
+
sanitized = parts[0] + "." + parts.slice(1).join("");
|
|
5698
|
+
}
|
|
5699
|
+
if (parts.length === 2) {
|
|
5700
|
+
sanitized = parts[0] + "." + parts[1].slice(0, 2);
|
|
5701
|
+
}
|
|
5702
|
+
return sanitized;
|
|
5703
|
+
};
|
|
5598
5704
|
const updateAmounts = (rowNumber) => (event) => {
|
|
5599
|
-
const
|
|
5600
|
-
const
|
|
5705
|
+
const newDisplaying = sanitizeNumberInput(event.target.value);
|
|
5706
|
+
const newAmount = Number(newDisplaying);
|
|
5601
5707
|
const splitTotal = rowState.splits.reduce((sum, split, index) => {
|
|
5602
5708
|
const amount = index === 0 ? 0 : index === rowNumber ? newAmount : split.amount;
|
|
5603
5709
|
return sum + amount;
|
|
@@ -6034,7 +6140,6 @@ var BankTransactionRow = ({
|
|
|
6034
6140
|
}) => {
|
|
6035
6141
|
const expandedRowRef = (0, import_react67.useRef)(null);
|
|
6036
6142
|
const [showRetry, setShowRetry] = (0, import_react67.useState)(false);
|
|
6037
|
-
const [removed, setRemoved] = (0, import_react67.useState)(false);
|
|
6038
6143
|
const {
|
|
6039
6144
|
filters,
|
|
6040
6145
|
categorize: categorizeBankTransaction2,
|
|
@@ -6075,6 +6180,13 @@ var BankTransactionRow = ({
|
|
|
6075
6180
|
setShowRetry(true);
|
|
6076
6181
|
}
|
|
6077
6182
|
}, [bankTransaction.error]);
|
|
6183
|
+
(0, import_react67.useEffect)(() => {
|
|
6184
|
+
if (editable && bankTransaction.recently_categorized) {
|
|
6185
|
+
setTimeout(() => {
|
|
6186
|
+
removeTransaction(bankTransaction);
|
|
6187
|
+
}, 300);
|
|
6188
|
+
}
|
|
6189
|
+
}, [bankTransaction.recently_categorized]);
|
|
6078
6190
|
const save = async () => {
|
|
6079
6191
|
if (open && expandedRowRef?.current) {
|
|
6080
6192
|
expandedRowRef?.current?.save();
|
|
@@ -6097,9 +6209,6 @@ var BankTransactionRow = ({
|
|
|
6097
6209
|
});
|
|
6098
6210
|
setOpen(false);
|
|
6099
6211
|
};
|
|
6100
|
-
if (removed) {
|
|
6101
|
-
return null;
|
|
6102
|
-
}
|
|
6103
6212
|
const categorized = isCategorized(bankTransaction);
|
|
6104
6213
|
const className = "Layer__bank-transaction-row";
|
|
6105
6214
|
const openClassName = open ? `${className}--expanded` : "";
|
|
@@ -6110,178 +6219,160 @@ var BankTransactionRow = ({
|
|
|
6110
6219
|
initialLoad ? "initial-load" : "",
|
|
6111
6220
|
showComponent ? "show" : ""
|
|
6112
6221
|
);
|
|
6113
|
-
return /* @__PURE__ */ import_react67.default.createElement(import_react67.default.Fragment, null, /* @__PURE__ */ import_react67.default.createElement(
|
|
6114
|
-
"
|
|
6222
|
+
return /* @__PURE__ */ import_react67.default.createElement(import_react67.default.Fragment, null, /* @__PURE__ */ import_react67.default.createElement("tr", { className: rowClassName }, /* @__PURE__ */ import_react67.default.createElement(
|
|
6223
|
+
"td",
|
|
6115
6224
|
{
|
|
6116
|
-
className:
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6225
|
+
className: "Layer__table-cell Layer__bank-transaction-table__date-col",
|
|
6226
|
+
...openRow
|
|
6227
|
+
},
|
|
6228
|
+
/* @__PURE__ */ import_react67.default.createElement("span", { className: "Layer__table-cell-content" }, (0, import_date_fns8.format)((0, import_date_fns8.parseISO)(bankTransaction.date), dateFormat))
|
|
6229
|
+
), /* @__PURE__ */ import_react67.default.createElement(
|
|
6230
|
+
"td",
|
|
6231
|
+
{
|
|
6232
|
+
className: "Layer__table-cell Layer__bank-transactions__tx-col",
|
|
6233
|
+
...openRow
|
|
6234
|
+
},
|
|
6235
|
+
/* @__PURE__ */ import_react67.default.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ import_react67.default.createElement(
|
|
6236
|
+
Text,
|
|
6237
|
+
{
|
|
6238
|
+
as: "span",
|
|
6239
|
+
className: "Layer__bank-transactions__tx-text",
|
|
6240
|
+
withTooltip: "whenTruncated" /* whenTruncated */,
|
|
6241
|
+
tooltipOptions: {
|
|
6242
|
+
contentClassName: "Layer__bank-transactions__tx-tooltip"
|
|
6123
6243
|
}
|
|
6124
|
-
}
|
|
6244
|
+
},
|
|
6245
|
+
bankTransaction.counterparty_name ?? bankTransaction.description
|
|
6246
|
+
))
|
|
6247
|
+
), /* @__PURE__ */ import_react67.default.createElement(
|
|
6248
|
+
"td",
|
|
6249
|
+
{
|
|
6250
|
+
className: "Layer__table-cell Layer__bank-transactions__account-col",
|
|
6251
|
+
...openRow
|
|
6125
6252
|
},
|
|
6126
|
-
/* @__PURE__ */ import_react67.default.createElement(
|
|
6127
|
-
|
|
6253
|
+
/* @__PURE__ */ import_react67.default.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ import_react67.default.createElement(
|
|
6254
|
+
Text,
|
|
6128
6255
|
{
|
|
6129
|
-
|
|
6130
|
-
|
|
6256
|
+
as: "span",
|
|
6257
|
+
className: "Layer__bank-transactions__account-text",
|
|
6258
|
+
withTooltip: "whenTruncated" /* whenTruncated */
|
|
6131
6259
|
},
|
|
6132
|
-
|
|
6133
|
-
)
|
|
6260
|
+
bankTransaction.account_name ?? ""
|
|
6261
|
+
))
|
|
6262
|
+
), /* @__PURE__ */ import_react67.default.createElement(
|
|
6263
|
+
"td",
|
|
6264
|
+
{
|
|
6265
|
+
className: `Layer__table-cell Layer__table-cell__amount-col Layer__bank-transactions__amount-col Layer__table-cell--amount ${className}__table-cell--amount-${isCredit(bankTransaction) ? "credit" : "debit"}`,
|
|
6266
|
+
...openRow
|
|
6267
|
+
},
|
|
6268
|
+
/* @__PURE__ */ import_react67.default.createElement("span", { className: "Layer__table-cell-content" }, isCredit(bankTransaction) ? "+$" : " $", centsToDollars(bankTransaction.amount))
|
|
6269
|
+
), /* @__PURE__ */ import_react67.default.createElement(
|
|
6270
|
+
"td",
|
|
6271
|
+
{
|
|
6272
|
+
className: (0, import_classnames33.default)(
|
|
6273
|
+
"Layer__table-cell",
|
|
6274
|
+
"Layer__table-cell__category-col",
|
|
6275
|
+
`${className}__actions-cell`,
|
|
6276
|
+
`${className}__actions-cell--${open ? "open" : "close"}`
|
|
6277
|
+
)
|
|
6278
|
+
},
|
|
6134
6279
|
/* @__PURE__ */ import_react67.default.createElement(
|
|
6135
|
-
"
|
|
6280
|
+
"span",
|
|
6136
6281
|
{
|
|
6137
|
-
className:
|
|
6138
|
-
...openRow
|
|
6282
|
+
className: `${className}__actions-container Layer__table-cell-content`
|
|
6139
6283
|
},
|
|
6140
|
-
|
|
6141
|
-
|
|
6284
|
+
!categorized && !open ? /* @__PURE__ */ import_react67.default.createElement(
|
|
6285
|
+
CategorySelect,
|
|
6142
6286
|
{
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6287
|
+
bankTransaction,
|
|
6288
|
+
name: `category-${bankTransaction.id}`,
|
|
6289
|
+
value: selectedCategory,
|
|
6290
|
+
onChange: (category) => {
|
|
6291
|
+
setSelectedCategory(category);
|
|
6292
|
+
setShowRetry(false);
|
|
6293
|
+
},
|
|
6294
|
+
disabled: bankTransaction.processing
|
|
6295
|
+
}
|
|
6296
|
+
) : null,
|
|
6297
|
+
categorized && !open ? /* @__PURE__ */ import_react67.default.createElement(Text, { as: "span", className: `${className}__category-text` }, bankTransaction.categorization_status === "SPLIT" /* SPLIT */ && /* @__PURE__ */ import_react67.default.createElement(import_react67.default.Fragment, null, /* @__PURE__ */ import_react67.default.createElement(
|
|
6298
|
+
Badge,
|
|
6299
|
+
{
|
|
6300
|
+
icon: /* @__PURE__ */ import_react67.default.createElement(Scissors_default, { size: 11 }),
|
|
6301
|
+
tooltip: /* @__PURE__ */ import_react67.default.createElement(
|
|
6302
|
+
SplitTooltipDetails,
|
|
6303
|
+
{
|
|
6304
|
+
classNamePrefix: className,
|
|
6305
|
+
category: bankTransaction.category
|
|
6306
|
+
}
|
|
6307
|
+
)
|
|
6149
6308
|
},
|
|
6150
|
-
|
|
6151
|
-
))
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
},
|
|
6159
|
-
|
|
6309
|
+
"Split"
|
|
6310
|
+
), /* @__PURE__ */ import_react67.default.createElement("span", { className: `${className}__category-text__text` }, extractDescriptionForSplit(bankTransaction.category))), bankTransaction?.categorization_status === "MATCHED" /* MATCHED */ && bankTransaction?.match && /* @__PURE__ */ import_react67.default.createElement(import_react67.default.Fragment, null, /* @__PURE__ */ import_react67.default.createElement(
|
|
6311
|
+
MatchBadge,
|
|
6312
|
+
{
|
|
6313
|
+
classNamePrefix: className,
|
|
6314
|
+
bankTransaction,
|
|
6315
|
+
dateFormat
|
|
6316
|
+
}
|
|
6317
|
+
), /* @__PURE__ */ import_react67.default.createElement("span", { className: `${className}__category-text__text` }, `${(0, import_date_fns8.format)(
|
|
6318
|
+
(0, import_date_fns8.parseISO)(bankTransaction.match.bank_transaction.date),
|
|
6319
|
+
dateFormat
|
|
6320
|
+
)}, ${bankTransaction.match?.details?.description}`)), bankTransaction?.categorization_status !== "MATCHED" /* MATCHED */ && bankTransaction?.categorization_status !== "SPLIT" /* SPLIT */ && /* @__PURE__ */ import_react67.default.createElement("span", { className: `${className}__category-text__text` }, bankTransaction?.category?.display_name)) : null,
|
|
6321
|
+
!categorized && !open && showRetry ? /* @__PURE__ */ import_react67.default.createElement(
|
|
6322
|
+
RetryButton,
|
|
6323
|
+
{
|
|
6324
|
+
onClick: () => {
|
|
6325
|
+
if (!bankTransaction.processing) {
|
|
6326
|
+
save();
|
|
6327
|
+
}
|
|
6328
|
+
},
|
|
6329
|
+
className: "Layer__bank-transaction__retry-btn",
|
|
6330
|
+
processing: bankTransaction.processing,
|
|
6331
|
+
error: "Approval failed. Check connection and retry in few seconds."
|
|
6332
|
+
},
|
|
6333
|
+
"Retry"
|
|
6334
|
+
) : null,
|
|
6335
|
+
open && bankTransaction.error ? /* @__PURE__ */ import_react67.default.createElement(
|
|
6160
6336
|
Text,
|
|
6161
6337
|
{
|
|
6162
6338
|
as: "span",
|
|
6163
|
-
|
|
6164
|
-
|
|
6339
|
+
size: "md" /* md */,
|
|
6340
|
+
className: "Layer__unsaved-info"
|
|
6165
6341
|
},
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
{
|
|
6172
|
-
className: `Layer__table-cell Layer__table-cell__amount-col Layer__bank-transactions__amount-col Layer__table-cell--amount ${className}__table-cell--amount-${isCredit(bankTransaction) ? "credit" : "debit"}`,
|
|
6173
|
-
...openRow
|
|
6174
|
-
},
|
|
6175
|
-
/* @__PURE__ */ import_react67.default.createElement("span", { className: "Layer__table-cell-content" }, isCredit(bankTransaction) ? "+$" : " $", centsToDollars(bankTransaction.amount))
|
|
6176
|
-
),
|
|
6177
|
-
/* @__PURE__ */ import_react67.default.createElement(
|
|
6178
|
-
"td",
|
|
6179
|
-
{
|
|
6180
|
-
className: (0, import_classnames33.default)(
|
|
6181
|
-
"Layer__table-cell",
|
|
6182
|
-
"Layer__table-cell__category-col",
|
|
6183
|
-
`${className}__actions-cell`,
|
|
6184
|
-
`${className}__actions-cell--${open ? "open" : "close"}`
|
|
6185
|
-
)
|
|
6186
|
-
},
|
|
6187
|
-
/* @__PURE__ */ import_react67.default.createElement(
|
|
6188
|
-
"span",
|
|
6342
|
+
/* @__PURE__ */ import_react67.default.createElement("span", null, "Unsaved"),
|
|
6343
|
+
/* @__PURE__ */ import_react67.default.createElement(AlertCircle_default, { size: 12 })
|
|
6344
|
+
) : null,
|
|
6345
|
+
!categorized && (open || !open && !showRetry) || categorized && open ? /* @__PURE__ */ import_react67.default.createElement(
|
|
6346
|
+
SubmitButton,
|
|
6189
6347
|
{
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
{
|
|
6195
|
-
bankTransaction,
|
|
6196
|
-
name: `category-${bankTransaction.id}`,
|
|
6197
|
-
value: selectedCategory,
|
|
6198
|
-
onChange: (category) => {
|
|
6199
|
-
setSelectedCategory(category);
|
|
6200
|
-
setShowRetry(false);
|
|
6201
|
-
},
|
|
6202
|
-
disabled: bankTransaction.processing
|
|
6203
|
-
}
|
|
6204
|
-
) : null,
|
|
6205
|
-
categorized && !open ? /* @__PURE__ */ import_react67.default.createElement(Text, { as: "span", className: `${className}__category-text` }, bankTransaction.categorization_status === "SPLIT" /* SPLIT */ && /* @__PURE__ */ import_react67.default.createElement(import_react67.default.Fragment, null, /* @__PURE__ */ import_react67.default.createElement(
|
|
6206
|
-
Badge,
|
|
6207
|
-
{
|
|
6208
|
-
icon: /* @__PURE__ */ import_react67.default.createElement(Scissors_default, { size: 11 }),
|
|
6209
|
-
tooltip: /* @__PURE__ */ import_react67.default.createElement(
|
|
6210
|
-
SplitTooltipDetails,
|
|
6211
|
-
{
|
|
6212
|
-
classNamePrefix: className,
|
|
6213
|
-
category: bankTransaction.category
|
|
6214
|
-
}
|
|
6215
|
-
)
|
|
6216
|
-
},
|
|
6217
|
-
"Split"
|
|
6218
|
-
), /* @__PURE__ */ import_react67.default.createElement("span", { className: `${className}__category-text__text` }, extractDescriptionForSplit(bankTransaction.category))), bankTransaction?.categorization_status === "MATCHED" /* MATCHED */ && bankTransaction?.match && /* @__PURE__ */ import_react67.default.createElement(import_react67.default.Fragment, null, /* @__PURE__ */ import_react67.default.createElement(
|
|
6219
|
-
MatchBadge,
|
|
6220
|
-
{
|
|
6221
|
-
classNamePrefix: className,
|
|
6222
|
-
bankTransaction,
|
|
6223
|
-
dateFormat
|
|
6224
|
-
}
|
|
6225
|
-
), /* @__PURE__ */ import_react67.default.createElement("span", { className: `${className}__category-text__text` }, `${(0, import_date_fns8.format)(
|
|
6226
|
-
(0, import_date_fns8.parseISO)(bankTransaction.match.bank_transaction.date),
|
|
6227
|
-
dateFormat
|
|
6228
|
-
)}, ${bankTransaction.match?.details?.description}`)), bankTransaction?.categorization_status !== "MATCHED" /* MATCHED */ && bankTransaction?.categorization_status !== "SPLIT" /* SPLIT */ && /* @__PURE__ */ import_react67.default.createElement("span", { className: `${className}__category-text__text` }, bankTransaction?.category?.display_name)) : null,
|
|
6229
|
-
!categorized && !open && showRetry ? /* @__PURE__ */ import_react67.default.createElement(
|
|
6230
|
-
RetryButton,
|
|
6231
|
-
{
|
|
6232
|
-
onClick: () => {
|
|
6233
|
-
if (!bankTransaction.processing) {
|
|
6234
|
-
save();
|
|
6235
|
-
}
|
|
6236
|
-
},
|
|
6237
|
-
className: "Layer__bank-transaction__retry-btn",
|
|
6238
|
-
processing: bankTransaction.processing,
|
|
6239
|
-
error: "Approval failed. Check connection and retry in few seconds."
|
|
6240
|
-
},
|
|
6241
|
-
"Retry"
|
|
6242
|
-
) : null,
|
|
6243
|
-
open && bankTransaction.error ? /* @__PURE__ */ import_react67.default.createElement(
|
|
6244
|
-
Text,
|
|
6245
|
-
{
|
|
6246
|
-
as: "span",
|
|
6247
|
-
size: "md" /* md */,
|
|
6248
|
-
className: "Layer__unsaved-info"
|
|
6249
|
-
},
|
|
6250
|
-
/* @__PURE__ */ import_react67.default.createElement("span", null, "Unsaved"),
|
|
6251
|
-
/* @__PURE__ */ import_react67.default.createElement(AlertCircle_default, { size: 12 })
|
|
6252
|
-
) : null,
|
|
6253
|
-
!categorized && (open || !open && !showRetry) || categorized && open ? /* @__PURE__ */ import_react67.default.createElement(
|
|
6254
|
-
SubmitButton,
|
|
6255
|
-
{
|
|
6256
|
-
onClick: () => {
|
|
6257
|
-
if (!bankTransaction.processing) {
|
|
6258
|
-
save();
|
|
6259
|
-
}
|
|
6260
|
-
},
|
|
6261
|
-
className: "Layer__bank-transaction__submit-btn",
|
|
6262
|
-
processing: bankTransaction.processing,
|
|
6263
|
-
active: open,
|
|
6264
|
-
action: categorized ? "save" /* SAVE */ : "update" /* UPDATE */
|
|
6348
|
+
onClick: () => {
|
|
6349
|
+
if (!bankTransaction.processing) {
|
|
6350
|
+
save();
|
|
6351
|
+
}
|
|
6265
6352
|
},
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6353
|
+
className: "Layer__bank-transaction__submit-btn",
|
|
6354
|
+
processing: bankTransaction.processing,
|
|
6355
|
+
active: open,
|
|
6356
|
+
action: categorized ? "save" /* SAVE */ : "update" /* UPDATE */
|
|
6357
|
+
},
|
|
6358
|
+
categorized ? "Update" : "Approve"
|
|
6359
|
+
) : null,
|
|
6360
|
+
/* @__PURE__ */ import_react67.default.createElement(
|
|
6361
|
+
IconButton,
|
|
6362
|
+
{
|
|
6363
|
+
onClick: toggleOpen,
|
|
6364
|
+
className: "Layer__bank-transaction-row__expand-button",
|
|
6365
|
+
active: open,
|
|
6366
|
+
icon: /* @__PURE__ */ import_react67.default.createElement(
|
|
6367
|
+
ChevronDownFill_default,
|
|
6368
|
+
{
|
|
6369
|
+
className: `Layer__chevron ${open ? "Layer__chevron__up" : "Layer__chevron__down"}`
|
|
6370
|
+
}
|
|
6371
|
+
)
|
|
6372
|
+
}
|
|
6282
6373
|
)
|
|
6283
6374
|
)
|
|
6284
|
-
), /* @__PURE__ */ import_react67.default.createElement("tr", null, /* @__PURE__ */ import_react67.default.createElement("td", { colSpan: 5, className: "Layer__bank-transaction-row__expanded-td" }, /* @__PURE__ */ import_react67.default.createElement(
|
|
6375
|
+
)), /* @__PURE__ */ import_react67.default.createElement("tr", null, /* @__PURE__ */ import_react67.default.createElement("td", { colSpan: 5, className: "Layer__bank-transaction-row__expanded-td" }, /* @__PURE__ */ import_react67.default.createElement(
|
|
6285
6376
|
ExpandedBankTransactionRow,
|
|
6286
6377
|
{
|
|
6287
6378
|
ref: expandedRowRef,
|
|
@@ -6343,11 +6434,11 @@ var BankTransactionListItem = ({
|
|
|
6343
6434
|
editable,
|
|
6344
6435
|
showDescriptions,
|
|
6345
6436
|
showReceiptUploads,
|
|
6346
|
-
containerWidth
|
|
6437
|
+
containerWidth,
|
|
6438
|
+
removeTransaction
|
|
6347
6439
|
}) => {
|
|
6348
6440
|
const expandedRowRef = (0, import_react69.useRef)(null);
|
|
6349
6441
|
const [showRetry, setShowRetry] = (0, import_react69.useState)(false);
|
|
6350
|
-
const [removed, setRemoved] = (0, import_react69.useState)(false);
|
|
6351
6442
|
const { categorize: categorizeBankTransaction2, match: matchBankTransaction2 } = useBankTransactionsContext();
|
|
6352
6443
|
const [selectedCategory, setSelectedCategory] = (0, import_react69.useState)(
|
|
6353
6444
|
getDefaultSelectedCategory(bankTransaction)
|
|
@@ -6369,6 +6460,13 @@ var BankTransactionListItem = ({
|
|
|
6369
6460
|
setShowRetry(true);
|
|
6370
6461
|
}
|
|
6371
6462
|
}, [bankTransaction.error]);
|
|
6463
|
+
(0, import_react69.useEffect)(() => {
|
|
6464
|
+
if (editable && bankTransaction.recently_categorized) {
|
|
6465
|
+
setTimeout(() => {
|
|
6466
|
+
removeTransaction(bankTransaction);
|
|
6467
|
+
}, 300);
|
|
6468
|
+
}
|
|
6469
|
+
}, [bankTransaction.recently_categorized]);
|
|
6372
6470
|
const save = () => {
|
|
6373
6471
|
if (open && expandedRowRef?.current) {
|
|
6374
6472
|
expandedRowRef?.current?.save();
|
|
@@ -6386,9 +6484,6 @@ var BankTransactionListItem = ({
|
|
|
6386
6484
|
category: getCategorizePayload(selectedCategory)
|
|
6387
6485
|
});
|
|
6388
6486
|
};
|
|
6389
|
-
if (removed) {
|
|
6390
|
-
return null;
|
|
6391
|
-
}
|
|
6392
6487
|
const categorized = isCategorized(bankTransaction);
|
|
6393
6488
|
const className = "Layer__bank-transaction-list-item";
|
|
6394
6489
|
const openClassName = open ? `${className}--expanded` : "";
|
|
@@ -6587,7 +6682,15 @@ var BusinessForm = ({ bankTransaction }) => {
|
|
|
6587
6682
|
onClick: onCategorySelect,
|
|
6588
6683
|
selected: selectedCategory
|
|
6589
6684
|
}
|
|
6590
|
-
), options.length === 0 ? /* @__PURE__ */ import_react71.default.createElement(
|
|
6685
|
+
), options.length === 0 ? /* @__PURE__ */ import_react71.default.createElement(
|
|
6686
|
+
Button,
|
|
6687
|
+
{
|
|
6688
|
+
onClick: openDrawer,
|
|
6689
|
+
fullWidth: true,
|
|
6690
|
+
variant: "secondary" /* secondary */
|
|
6691
|
+
},
|
|
6692
|
+
"Select category"
|
|
6693
|
+
) : null, options.length > 0 ? /* @__PURE__ */ import_react71.default.createElement(
|
|
6591
6694
|
Button,
|
|
6592
6695
|
{
|
|
6593
6696
|
onClick: save,
|
|
@@ -7008,8 +7111,12 @@ var BankTransactionMobileListItem = ({
|
|
|
7008
7111
|
}, [transactionIdToOpen]);
|
|
7009
7112
|
(0, import_react78.useEffect)(() => {
|
|
7010
7113
|
if (!removeAnim && bankTransaction.recently_categorized) {
|
|
7011
|
-
|
|
7012
|
-
|
|
7114
|
+
if (editable) {
|
|
7115
|
+
setRemoveAnim(true);
|
|
7116
|
+
openNext();
|
|
7117
|
+
} else {
|
|
7118
|
+
close();
|
|
7119
|
+
}
|
|
7013
7120
|
}
|
|
7014
7121
|
}, [
|
|
7015
7122
|
bankTransaction.recently_categorized,
|
|
@@ -7036,6 +7143,13 @@ var BankTransactionMobileListItem = ({
|
|
|
7036
7143
|
setShowComponent(true);
|
|
7037
7144
|
}
|
|
7038
7145
|
}, []);
|
|
7146
|
+
(0, import_react78.useEffect)(() => {
|
|
7147
|
+
if (editable && bankTransaction.recently_categorized) {
|
|
7148
|
+
setTimeout(() => {
|
|
7149
|
+
removeTransaction(bankTransaction);
|
|
7150
|
+
}, 300);
|
|
7151
|
+
}
|
|
7152
|
+
}, [bankTransaction.recently_categorized]);
|
|
7039
7153
|
const onChangePurpose = (event) => setPurpose(event.target.value);
|
|
7040
7154
|
const categorized = isCategorized(bankTransaction);
|
|
7041
7155
|
const className = "Layer__bank-transaction-mobile-list-item";
|
|
@@ -7051,18 +7165,7 @@ var BankTransactionMobileListItem = ({
|
|
|
7051
7165
|
{
|
|
7052
7166
|
ref: itemRef,
|
|
7053
7167
|
className: rowClassName,
|
|
7054
|
-
"data-item": bankTransaction.id
|
|
7055
|
-
onTransitionEnd: ({ propertyName }) => {
|
|
7056
|
-
if (propertyName === "opacity") {
|
|
7057
|
-
close();
|
|
7058
|
-
if (editable) {
|
|
7059
|
-
setRemoveAnim(false);
|
|
7060
|
-
setTimeout(() => {
|
|
7061
|
-
removeTransaction(bankTransaction.id);
|
|
7062
|
-
}, 500);
|
|
7063
|
-
}
|
|
7064
|
-
}
|
|
7065
|
-
}
|
|
7168
|
+
"data-item": bankTransaction.id
|
|
7066
7169
|
},
|
|
7067
7170
|
/* @__PURE__ */ import_react78.default.createElement(
|
|
7068
7171
|
"span",
|
|
@@ -7081,7 +7184,7 @@ var BankTransactionMobileListItem = ({
|
|
|
7081
7184
|
centsToDollars(bankTransaction.amount)
|
|
7082
7185
|
), /* @__PURE__ */ import_react78.default.createElement("span", { className: `${className}__heading__date` }, (0, import_date_fns11.format)((0, import_date_fns11.parseISO)(bankTransaction.date), DATE_FORMAT2))))
|
|
7083
7186
|
),
|
|
7084
|
-
/* @__PURE__ */ import_react78.default.createElement("div", { className: `${className}__expanded-row`, style: { height } }, open && /* @__PURE__ */ import_react78.default.createElement(
|
|
7187
|
+
/* @__PURE__ */ import_react78.default.createElement("div", { className: `${className}__expanded-row`, style: { height: !open || removeAnim ? 0 : height } }, open && /* @__PURE__ */ import_react78.default.createElement(
|
|
7085
7188
|
"div",
|
|
7086
7189
|
{
|
|
7087
7190
|
className: `${className}__expanded-row__content`,
|
|
@@ -7307,7 +7410,9 @@ var Pagination = ({
|
|
|
7307
7410
|
totalCount,
|
|
7308
7411
|
siblingCount = 1,
|
|
7309
7412
|
currentPage,
|
|
7310
|
-
pageSize
|
|
7413
|
+
pageSize,
|
|
7414
|
+
hasMore,
|
|
7415
|
+
fetchMore
|
|
7311
7416
|
}) => {
|
|
7312
7417
|
const paginationRange = usePagination({
|
|
7313
7418
|
currentPage,
|
|
@@ -7356,12 +7461,23 @@ var Pagination = ({
|
|
|
7356
7461
|
onClick: () => {
|
|
7357
7462
|
if (typeof pageNumber === "number") {
|
|
7358
7463
|
onPageChange(pageNumber);
|
|
7464
|
+
if (pageNumber === lastPage && hasMore && fetchMore) {
|
|
7465
|
+
fetchMore();
|
|
7466
|
+
}
|
|
7359
7467
|
}
|
|
7360
7468
|
}
|
|
7361
7469
|
},
|
|
7362
7470
|
pageNumber
|
|
7363
7471
|
);
|
|
7364
|
-
}), /* @__PURE__ */ import_react84.default.createElement(
|
|
7472
|
+
}), hasMore && fetchMore ? /* @__PURE__ */ import_react84.default.createElement(
|
|
7473
|
+
"li",
|
|
7474
|
+
{
|
|
7475
|
+
key: `page-has-more`,
|
|
7476
|
+
className: "Layer__pagination-item Layer__pagination-arrow Layer__pagination-arrow--next",
|
|
7477
|
+
onClick: fetchMore
|
|
7478
|
+
},
|
|
7479
|
+
"..."
|
|
7480
|
+
) : null, /* @__PURE__ */ import_react84.default.createElement(
|
|
7365
7481
|
"li",
|
|
7366
7482
|
{
|
|
7367
7483
|
key: `page-last`,
|
|
@@ -7509,6 +7625,21 @@ var DatePickerOptions = ({
|
|
|
7509
7625
|
},
|
|
7510
7626
|
"This quarter"
|
|
7511
7627
|
);
|
|
7628
|
+
case "last-quarter":
|
|
7629
|
+
return /* @__PURE__ */ import_react85.default.createElement(
|
|
7630
|
+
TextButton,
|
|
7631
|
+
{
|
|
7632
|
+
key: option,
|
|
7633
|
+
onClick: () => {
|
|
7634
|
+
const lastQuarter = (0, import_date_fns13.subQuarters)(/* @__PURE__ */ new Date(), 1);
|
|
7635
|
+
setSelectedDate([
|
|
7636
|
+
(0, import_date_fns13.startOfQuarter)(lastQuarter),
|
|
7637
|
+
(0, import_date_fns13.endOfQuarter)(lastQuarter)
|
|
7638
|
+
]);
|
|
7639
|
+
}
|
|
7640
|
+
},
|
|
7641
|
+
"Last quarter"
|
|
7642
|
+
);
|
|
7512
7643
|
case "this-year":
|
|
7513
7644
|
return /* @__PURE__ */ import_react85.default.createElement(
|
|
7514
7645
|
TextButton,
|
|
@@ -7520,11 +7651,30 @@ var DatePickerOptions = ({
|
|
|
7520
7651
|
},
|
|
7521
7652
|
"This year"
|
|
7522
7653
|
);
|
|
7654
|
+
case "last-year":
|
|
7655
|
+
return /* @__PURE__ */ import_react85.default.createElement(
|
|
7656
|
+
TextButton,
|
|
7657
|
+
{
|
|
7658
|
+
key: option,
|
|
7659
|
+
onClick: () => {
|
|
7660
|
+
const lastYear = (0, import_date_fns13.subYears)(/* @__PURE__ */ new Date(), 1);
|
|
7661
|
+
setSelectedDate([(0, import_date_fns13.startOfYear)(lastYear), (0, import_date_fns13.endOfYear)(lastYear)]);
|
|
7662
|
+
}
|
|
7663
|
+
},
|
|
7664
|
+
"Last year"
|
|
7665
|
+
);
|
|
7523
7666
|
}
|
|
7524
7667
|
return /* @__PURE__ */ import_react85.default.createElement(import_react85.default.Fragment, null);
|
|
7525
7668
|
};
|
|
7526
7669
|
if (options.length === 0) {
|
|
7527
|
-
const allOptions = [
|
|
7670
|
+
const allOptions = [
|
|
7671
|
+
"this-month",
|
|
7672
|
+
"last-month",
|
|
7673
|
+
"this-quarter",
|
|
7674
|
+
"last-quarter",
|
|
7675
|
+
"this-year",
|
|
7676
|
+
"last-year"
|
|
7677
|
+
];
|
|
7528
7678
|
allOptions.forEach((option) => {
|
|
7529
7679
|
optionsComponents.push(getOptionComponent(option));
|
|
7530
7680
|
});
|
|
@@ -7541,6 +7691,20 @@ var DatePickerOptions = ({
|
|
|
7541
7691
|
|
|
7542
7692
|
// src/components/DatePicker/DatePicker.tsx
|
|
7543
7693
|
var import_classnames38 = __toESM(require("classnames"));
|
|
7694
|
+
var getDefaultRangeDate = (date, mode, selected) => {
|
|
7695
|
+
try {
|
|
7696
|
+
if (isRangeMode(mode) && selected) {
|
|
7697
|
+
if (date === "end") {
|
|
7698
|
+
return selected[1];
|
|
7699
|
+
}
|
|
7700
|
+
return selected[0];
|
|
7701
|
+
}
|
|
7702
|
+
return null;
|
|
7703
|
+
} catch (_err) {
|
|
7704
|
+
return null;
|
|
7705
|
+
}
|
|
7706
|
+
};
|
|
7707
|
+
var isRangeMode = (mode) => mode === "dayRangePicker" || mode === "monthRangePicker";
|
|
7544
7708
|
var DatePicker = ({
|
|
7545
7709
|
selected,
|
|
7546
7710
|
onChange,
|
|
@@ -7559,10 +7723,29 @@ var DatePicker = ({
|
|
|
7559
7723
|
}) => {
|
|
7560
7724
|
const [updatePickerDate, setPickerDate] = (0, import_react86.useState)(false);
|
|
7561
7725
|
const [selectedDates, setSelectedDates] = (0, import_react86.useState)(selected);
|
|
7726
|
+
const [startDate, setStartDate] = (0, import_react86.useState)(
|
|
7727
|
+
getDefaultRangeDate("start", mode, selected) ?? /* @__PURE__ */ new Date()
|
|
7728
|
+
);
|
|
7729
|
+
const [endDate, setEndDate] = (0, import_react86.useState)(
|
|
7730
|
+
getDefaultRangeDate("end", mode, selected)
|
|
7731
|
+
);
|
|
7562
7732
|
(0, import_react86.useEffect)(() => {
|
|
7563
|
-
|
|
7564
|
-
|
|
7565
|
-
|
|
7733
|
+
try {
|
|
7734
|
+
setPickerDate(true);
|
|
7735
|
+
if (!isRangeMode(mode) && selected !== selectedDates) {
|
|
7736
|
+
setSelectedDates(selected);
|
|
7737
|
+
return;
|
|
7738
|
+
}
|
|
7739
|
+
if (isRangeMode(mode) && Array.isArray(selected)) {
|
|
7740
|
+
if (startDate !== selected[0]) {
|
|
7741
|
+
setStartDate(selected[0]);
|
|
7742
|
+
}
|
|
7743
|
+
if (endDate !== selected[1]) {
|
|
7744
|
+
setEndDate(selected[1]);
|
|
7745
|
+
}
|
|
7746
|
+
}
|
|
7747
|
+
} catch (_err) {
|
|
7748
|
+
return;
|
|
7566
7749
|
}
|
|
7567
7750
|
}, [selected]);
|
|
7568
7751
|
(0, import_react86.useEffect)(() => {
|
|
@@ -7572,6 +7755,11 @@ var DatePicker = ({
|
|
|
7572
7755
|
setPickerDate(false);
|
|
7573
7756
|
}
|
|
7574
7757
|
}, [selectedDates]);
|
|
7758
|
+
(0, import_react86.useEffect)(() => {
|
|
7759
|
+
if (isRangeMode(mode)) {
|
|
7760
|
+
setSelectedDates([startDate, endDate]);
|
|
7761
|
+
}
|
|
7762
|
+
}, [startDate, endDate]);
|
|
7575
7763
|
const wrapperClassNames = (0, import_classnames38.default)(
|
|
7576
7764
|
"Layer__datepicker__wrapper",
|
|
7577
7765
|
mode === "timePicker" && "Layer__datepicker__time__wrapper"
|
|
@@ -7590,6 +7778,12 @@ var DatePicker = ({
|
|
|
7590
7778
|
popperClassName
|
|
7591
7779
|
);
|
|
7592
7780
|
const handleDateChange = (date) => {
|
|
7781
|
+
if (isRangeMode(mode)) {
|
|
7782
|
+
const [start, end] = date;
|
|
7783
|
+
setStartDate(start);
|
|
7784
|
+
setEndDate(end);
|
|
7785
|
+
return;
|
|
7786
|
+
}
|
|
7593
7787
|
setSelectedDates(date);
|
|
7594
7788
|
};
|
|
7595
7789
|
const isCurrentDate = () => {
|
|
@@ -7615,15 +7809,15 @@ var DatePicker = ({
|
|
|
7615
7809
|
import_react_datepicker.default,
|
|
7616
7810
|
{
|
|
7617
7811
|
wrapperClassName: datePickerWrapperClassNames,
|
|
7618
|
-
startDate: mode
|
|
7619
|
-
endDate: mode
|
|
7812
|
+
startDate: isRangeMode(mode) ? startDate : void 0,
|
|
7813
|
+
endDate: isRangeMode(mode) ? endDate : void 0,
|
|
7620
7814
|
selected: mode !== "dayRangePicker" && mode !== "monthRangePicker" ? selectedDates : void 0,
|
|
7621
7815
|
onChange: handleDateChange,
|
|
7622
7816
|
calendarClassName: calendarClassNames,
|
|
7623
7817
|
popperClassName: popperClassNames,
|
|
7624
7818
|
enableTabLoop: false,
|
|
7625
7819
|
popperPlacement: "bottom-start",
|
|
7626
|
-
selectsRange: mode
|
|
7820
|
+
selectsRange: isRangeMode(mode),
|
|
7627
7821
|
showMonthYearPicker: mode === "monthPicker" || mode === "monthRangePicker",
|
|
7628
7822
|
dateFormat,
|
|
7629
7823
|
renderDayContents: (day) => /* @__PURE__ */ import_react86.default.createElement("span", { className: "Layer__datepicker__day-contents" }, day),
|
|
@@ -7929,19 +8123,30 @@ var Inbox_default = Inbox;
|
|
|
7929
8123
|
// src/components/BankTransactions/DataStates.tsx
|
|
7930
8124
|
var DataStates = ({
|
|
7931
8125
|
bankTransactions,
|
|
8126
|
+
transactionsLoading,
|
|
7932
8127
|
isLoading,
|
|
7933
8128
|
isValidating,
|
|
7934
8129
|
error,
|
|
7935
8130
|
refetch,
|
|
7936
8131
|
editable
|
|
7937
8132
|
}) => {
|
|
8133
|
+
let title;
|
|
8134
|
+
let description;
|
|
8135
|
+
if (transactionsLoading) {
|
|
8136
|
+
title = "Data sync in progress";
|
|
8137
|
+
description = "Check back later to review your transactions";
|
|
8138
|
+
} else {
|
|
8139
|
+
title = editable ? "You are up to date with transactions!" : "You have no categorized transactions";
|
|
8140
|
+
description = editable ? "All uncategorized transaction will be displayed here" : "All transaction will be displayed here once reviewed";
|
|
8141
|
+
}
|
|
8142
|
+
const showRefreshButton = transactionsLoading || bankTransactions?.length;
|
|
7938
8143
|
return /* @__PURE__ */ import_react90.default.createElement(import_react90.default.Fragment, null, !isLoading && !error && (bankTransactions === void 0 || bankTransactions !== void 0 && bankTransactions.length === 0) ? /* @__PURE__ */ import_react90.default.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ import_react90.default.createElement(
|
|
7939
8144
|
DataState,
|
|
7940
8145
|
{
|
|
7941
|
-
status: "allDone" /* allDone */,
|
|
7942
|
-
title
|
|
7943
|
-
description
|
|
7944
|
-
onRefresh:
|
|
8146
|
+
status: transactionsLoading ? "info" /* info */ : "allDone" /* allDone */,
|
|
8147
|
+
title,
|
|
8148
|
+
description,
|
|
8149
|
+
onRefresh: showRefreshButton ? refetch : void 0,
|
|
7945
8150
|
isLoading: isValidating,
|
|
7946
8151
|
icon: !editable ? /* @__PURE__ */ import_react90.default.createElement(Inbox_default, null) : void 0
|
|
7947
8152
|
}
|
|
@@ -7951,7 +8156,7 @@ var DataStates = ({
|
|
|
7951
8156
|
status: "failed" /* failed */,
|
|
7952
8157
|
title: "Something went wrong",
|
|
7953
8158
|
description: "We couldn\u2019t load your data.",
|
|
7954
|
-
onRefresh:
|
|
8159
|
+
onRefresh: refetch,
|
|
7955
8160
|
isLoading: isValidating
|
|
7956
8161
|
}
|
|
7957
8162
|
)) : null);
|
|
@@ -7960,6 +8165,7 @@ var DataStates = ({
|
|
|
7960
8165
|
// src/components/BankTransactions/BankTransactions.tsx
|
|
7961
8166
|
var import_date_fns15 = require("date-fns");
|
|
7962
8167
|
var COMPONENT_NAME2 = "bank-transactions";
|
|
8168
|
+
var TEST_EMPTY_STATE = false;
|
|
7963
8169
|
var BankTransactions = ({
|
|
7964
8170
|
onError,
|
|
7965
8171
|
...props
|
|
@@ -7968,7 +8174,7 @@ var BankTransactions = ({
|
|
|
7968
8174
|
};
|
|
7969
8175
|
var BankTransactionsContent = ({
|
|
7970
8176
|
asWidget = false,
|
|
7971
|
-
pageSize =
|
|
8177
|
+
pageSize = 20,
|
|
7972
8178
|
categorizedOnly = false,
|
|
7973
8179
|
categorizeView = true,
|
|
7974
8180
|
showDescriptions = false,
|
|
@@ -7979,7 +8185,6 @@ var BankTransactionsContent = ({
|
|
|
7979
8185
|
hideHeader = false
|
|
7980
8186
|
}) => {
|
|
7981
8187
|
const [currentPage, setCurrentPage] = (0, import_react91.useState)(1);
|
|
7982
|
-
const [removedTxs, setRemovedTxs] = (0, import_react91.useState)([]);
|
|
7983
8188
|
const [initialLoad, setInitialLoad] = (0, import_react91.useState)(true);
|
|
7984
8189
|
const [dateRange, setDateRange] = (0, import_react91.useState)({
|
|
7985
8190
|
startDate: (0, import_date_fns15.startOfMonth)(/* @__PURE__ */ new Date()),
|
|
@@ -7995,9 +8200,12 @@ var BankTransactionsContent = ({
|
|
|
7995
8200
|
refetch,
|
|
7996
8201
|
setFilters,
|
|
7997
8202
|
filters,
|
|
7998
|
-
|
|
7999
|
-
|
|
8203
|
+
display,
|
|
8204
|
+
hasMore,
|
|
8205
|
+
fetchMore,
|
|
8206
|
+
removeAfterCategorize
|
|
8000
8207
|
} = useBankTransactionsContext();
|
|
8208
|
+
const { data: linkedAccounts } = useLinkedAccounts();
|
|
8001
8209
|
(0, import_react91.useEffect)(() => {
|
|
8002
8210
|
activate();
|
|
8003
8211
|
}, []);
|
|
@@ -8007,24 +8215,24 @@ var BankTransactionsContent = ({
|
|
|
8007
8215
|
setFilters({
|
|
8008
8216
|
...filters,
|
|
8009
8217
|
...inputFilters,
|
|
8010
|
-
categorizationStatus: "
|
|
8218
|
+
categorizationStatus: "review" /* review */
|
|
8011
8219
|
});
|
|
8012
8220
|
} else if (!filters?.categorizationStatus && categorizedOnly) {
|
|
8013
8221
|
setFilters({
|
|
8014
8222
|
...filters,
|
|
8015
8223
|
...inputFilters,
|
|
8016
|
-
categorizationStatus: "
|
|
8224
|
+
categorizationStatus: "categorized" /* categorized */
|
|
8017
8225
|
});
|
|
8018
8226
|
} else {
|
|
8019
8227
|
setFilters({ ...filters, ...inputFilters });
|
|
8020
8228
|
}
|
|
8021
8229
|
} else if (!filters?.categorizationStatus && categorizeView) {
|
|
8022
8230
|
setFilters({
|
|
8023
|
-
categorizationStatus: "
|
|
8231
|
+
categorizationStatus: "review" /* review */
|
|
8024
8232
|
});
|
|
8025
8233
|
} else if (!filters?.categorizationStatus && categorizedOnly) {
|
|
8026
8234
|
setFilters({
|
|
8027
|
-
categorizationStatus: "
|
|
8235
|
+
categorizationStatus: "categorized" /* categorized */
|
|
8028
8236
|
});
|
|
8029
8237
|
}
|
|
8030
8238
|
}, [inputFilters, categorizeView, categorizedOnly]);
|
|
@@ -8036,7 +8244,7 @@ var BankTransactionsContent = ({
|
|
|
8036
8244
|
return () => clearTimeout(timeoutLoad);
|
|
8037
8245
|
}
|
|
8038
8246
|
}, [loadingStatus]);
|
|
8039
|
-
const bankTransactions = (0, import_react91.useMemo)(() => {
|
|
8247
|
+
const bankTransactions = TEST_EMPTY_STATE ? [] : (0, import_react91.useMemo)(() => {
|
|
8040
8248
|
if (monthlyView) {
|
|
8041
8249
|
return data?.filter(
|
|
8042
8250
|
(x) => (0, import_date_fns15.parseISO)(x.date) >= dateRange.startDate && (0, import_date_fns15.parseISO)(x.date) <= dateRange.endDate
|
|
@@ -8045,10 +8253,10 @@ var BankTransactionsContent = ({
|
|
|
8045
8253
|
const firstPageIndex = (currentPage - 1) * pageSize;
|
|
8046
8254
|
const lastPageIndex = firstPageIndex + pageSize;
|
|
8047
8255
|
return data?.slice(firstPageIndex, lastPageIndex);
|
|
8048
|
-
}, [currentPage, data,
|
|
8256
|
+
}, [currentPage, data, dateRange]);
|
|
8049
8257
|
const onCategorizationDisplayChange = (event) => {
|
|
8050
8258
|
setFilters({
|
|
8051
|
-
categorizationStatus: event.target.value === "categorized" /* categorized */ ? "
|
|
8259
|
+
categorizationStatus: event.target.value === "categorized" /* categorized */ ? "categorized" /* categorized */ : "review" /* review */
|
|
8052
8260
|
});
|
|
8053
8261
|
setCurrentPage(1);
|
|
8054
8262
|
};
|
|
@@ -8057,11 +8265,7 @@ var BankTransactionsContent = ({
|
|
|
8057
8265
|
const [listView, setListView] = (0, import_react91.useState)(false);
|
|
8058
8266
|
const [containerWidth, setContainerWidth] = (0, import_react91.useState)(0);
|
|
8059
8267
|
const debounceContainerWidth = debounce(setContainerWidth, 500);
|
|
8060
|
-
const removeTransaction = (
|
|
8061
|
-
const newTxs = removedTxs.slice();
|
|
8062
|
-
newTxs.push(id);
|
|
8063
|
-
setRemovedTxs(newTxs);
|
|
8064
|
-
};
|
|
8268
|
+
const removeTransaction = (bankTransaction) => removeAfterCategorize(bankTransaction);
|
|
8065
8269
|
const containerRef = useElementSize((_el, _en, size) => {
|
|
8066
8270
|
if (size?.height && size?.height >= 90) {
|
|
8067
8271
|
const newShift = -Math.floor(size.height / 2) + 6;
|
|
@@ -8142,6 +8346,9 @@ var BankTransactionsContent = ({
|
|
|
8142
8346
|
{
|
|
8143
8347
|
bankTransactions,
|
|
8144
8348
|
isLoading,
|
|
8349
|
+
transactionsLoading: Boolean(
|
|
8350
|
+
linkedAccounts?.some((item) => item.is_syncing)
|
|
8351
|
+
),
|
|
8145
8352
|
isValidating,
|
|
8146
8353
|
error,
|
|
8147
8354
|
refetch,
|
|
@@ -8154,7 +8361,9 @@ var BankTransactionsContent = ({
|
|
|
8154
8361
|
currentPage,
|
|
8155
8362
|
totalCount: data?.length || 0,
|
|
8156
8363
|
pageSize,
|
|
8157
|
-
onPageChange: (page) => setCurrentPage(page)
|
|
8364
|
+
onPageChange: (page) => setCurrentPage(page),
|
|
8365
|
+
fetchMore,
|
|
8366
|
+
hasMore
|
|
8158
8367
|
}
|
|
8159
8368
|
))
|
|
8160
8369
|
);
|
|
@@ -8314,7 +8523,7 @@ var applyShare = (items, total) => {
|
|
|
8314
8523
|
// src/hooks/useProfitAndLoss/useProfitAndLossQuery.tsx
|
|
8315
8524
|
var import_react94 = require("react");
|
|
8316
8525
|
var import_date_fns16 = require("date-fns");
|
|
8317
|
-
var
|
|
8526
|
+
var import_swr3 = __toESM(require("swr"));
|
|
8318
8527
|
var useProfitAndLossQuery = ({
|
|
8319
8528
|
startDate,
|
|
8320
8529
|
endDate,
|
|
@@ -8331,7 +8540,7 @@ var useProfitAndLossQuery = ({
|
|
|
8331
8540
|
isValidating,
|
|
8332
8541
|
error: rawError,
|
|
8333
8542
|
mutate
|
|
8334
|
-
} = (0,
|
|
8543
|
+
} = (0, import_swr3.default)(
|
|
8335
8544
|
businessId && startDate && endDate && auth?.access_token && `profit-and-loss-${businessId}-${startDate.valueOf()}-${endDate.valueOf()}-${tagFilter?.key}-${tagFilter?.values?.join(
|
|
8336
8545
|
","
|
|
8337
8546
|
)}-${reportingBasis}`,
|
|
@@ -8524,7 +8733,7 @@ var import_react98 = __toESM(require("react"));
|
|
|
8524
8733
|
// src/hooks/useProfitAndLoss/useProfitAndLossLTM.tsx
|
|
8525
8734
|
var import_react96 = require("react");
|
|
8526
8735
|
var import_date_fns18 = require("date-fns");
|
|
8527
|
-
var
|
|
8736
|
+
var import_swr4 = __toESM(require("swr"));
|
|
8528
8737
|
var buildDates = ({ currentDate }) => {
|
|
8529
8738
|
return {
|
|
8530
8739
|
startYear: (0, import_date_fns18.startOfMonth)(currentDate).getFullYear() - 1,
|
|
@@ -8559,7 +8768,7 @@ var useProfitAndLossLTM = ({ currentDate, tagFilter, reportingBasis } = {
|
|
|
8559
8768
|
isValidating,
|
|
8560
8769
|
error,
|
|
8561
8770
|
mutate
|
|
8562
|
-
} = (0,
|
|
8771
|
+
} = (0, import_swr4.default)(
|
|
8563
8772
|
businessId && Boolean(startYear) && Boolean(startMonth) && Boolean(endYear) && Boolean(endMonth) && auth?.access_token && `profit-and-loss-summaries-${businessId}-${startYear.toString()}-${startMonth.toString()}-${tagFilter?.key}-${tagFilter?.values?.join(
|
|
8564
8773
|
","
|
|
8565
8774
|
)}-${reportingBasis}`,
|
|
@@ -8864,8 +9073,10 @@ var ProfitAndLossChart = () => {
|
|
|
8864
9073
|
name: getMonthName(pnl),
|
|
8865
9074
|
revenue: pnl?.income || 0,
|
|
8866
9075
|
revenueUncategorized: pnl?.uncategorizedInflows || 0,
|
|
8867
|
-
expenses: -
|
|
8868
|
-
expensesUncategorized: -
|
|
9076
|
+
expenses: -(pnl?.operatingExpenses || 0),
|
|
9077
|
+
expensesUncategorized: -(pnl?.uncategorizedOutflows || 0),
|
|
9078
|
+
operatingExpensesInverse: pnl?.operatingExpensesInverse || 0,
|
|
9079
|
+
uncategorizedOutflowsInverse: pnl?.uncategorizedOutflowsInverse || 0,
|
|
8869
9080
|
netProfit: pnl?.netProfit || 0,
|
|
8870
9081
|
selected: !!pnl && pnl.month === selectionMonth.month + 1 && pnl.year === selectionMonth.year,
|
|
8871
9082
|
year: pnl?.year,
|
|
@@ -8884,6 +9095,8 @@ var ProfitAndLossChart = () => {
|
|
|
8884
9095
|
name: (0, import_date_fns19.format)(currentDate, compactView ? "LLLLL" : "LLL"),
|
|
8885
9096
|
revenue: 0,
|
|
8886
9097
|
revenueUncategorized: 0,
|
|
9098
|
+
operatingExpensesInverse: 0,
|
|
9099
|
+
uncategorizedOutflowsInverse: 0,
|
|
8887
9100
|
expenses: 0,
|
|
8888
9101
|
expensesUncategorized: 0,
|
|
8889
9102
|
netProfit: 0,
|
|
@@ -8897,7 +9110,18 @@ var ProfitAndLossChart = () => {
|
|
|
8897
9110
|
}
|
|
8898
9111
|
return loadingData;
|
|
8899
9112
|
}
|
|
8900
|
-
return data?.
|
|
9113
|
+
return data?.map((x) => {
|
|
9114
|
+
if (x.operatingExpenses < 0 || x.uncategorizedOutflows < 0) {
|
|
9115
|
+
return {
|
|
9116
|
+
...x,
|
|
9117
|
+
operatingExpenses: x.operatingExpenses < 0 ? 0 : x.operatingExpenses,
|
|
9118
|
+
uncategorizedOutflows: x.uncategorizedOutflows < 0 ? 0 : x.uncategorizedOutflows,
|
|
9119
|
+
operatingExpensesInverse: x.operatingExpenses < 0 ? -x.operatingExpenses : 0,
|
|
9120
|
+
uncategorizedOutflowsInverse: x.uncategorizedOutflows < 0 ? -x.uncategorizedOutflows : 0
|
|
9121
|
+
};
|
|
9122
|
+
}
|
|
9123
|
+
return x;
|
|
9124
|
+
})?.filter(
|
|
8901
9125
|
(x) => (0, import_date_fns19.differenceInMonths)(
|
|
8902
9126
|
(0, import_date_fns19.startOfMonth)(new Date(x.year, x.month - 1, 1)),
|
|
8903
9127
|
chartWindow.start
|
|
@@ -9184,6 +9408,22 @@ var ProfitAndLossChart = () => {
|
|
|
9184
9408
|
stackId: "expenses"
|
|
9185
9409
|
}
|
|
9186
9410
|
),
|
|
9411
|
+
/* @__PURE__ */ import_react98.default.createElement(
|
|
9412
|
+
import_recharts.Bar,
|
|
9413
|
+
{
|
|
9414
|
+
dataKey: "operatingExpensesInverse",
|
|
9415
|
+
barSize,
|
|
9416
|
+
isAnimationActive: barAnimActive,
|
|
9417
|
+
animationDuration: 100,
|
|
9418
|
+
radius: [2, 2, 0, 0],
|
|
9419
|
+
className: "Layer__profit-and-loss-chart__bar--expenses",
|
|
9420
|
+
xAxisId: "revenue",
|
|
9421
|
+
stackId: "revenue"
|
|
9422
|
+
},
|
|
9423
|
+
theData?.map((entry) => {
|
|
9424
|
+
return /* @__PURE__ */ import_react98.default.createElement(import_recharts.Cell, { key: entry.name, fill: "url(#layer-bar-stripe-pattern-dark)" });
|
|
9425
|
+
})
|
|
9426
|
+
),
|
|
9187
9427
|
/* @__PURE__ */ import_react98.default.createElement(
|
|
9188
9428
|
import_recharts.Bar,
|
|
9189
9429
|
{
|
|
@@ -9219,6 +9459,22 @@ var ProfitAndLossChart = () => {
|
|
|
9219
9459
|
);
|
|
9220
9460
|
})
|
|
9221
9461
|
),
|
|
9462
|
+
/* @__PURE__ */ import_react98.default.createElement(
|
|
9463
|
+
import_recharts.Bar,
|
|
9464
|
+
{
|
|
9465
|
+
dataKey: "uncategorizedOutflowsInverse",
|
|
9466
|
+
barSize,
|
|
9467
|
+
isAnimationActive: barAnimActive,
|
|
9468
|
+
animationDuration: 100,
|
|
9469
|
+
radius: [2, 2, 0, 0],
|
|
9470
|
+
className: "Layer__profit-and-loss-chart__bar--expenses-uncategorized",
|
|
9471
|
+
xAxisId: "revenue",
|
|
9472
|
+
stackId: "revenue"
|
|
9473
|
+
},
|
|
9474
|
+
theData?.map((entry) => {
|
|
9475
|
+
return /* @__PURE__ */ import_react98.default.createElement(import_recharts.Cell, { key: entry.name, fill: "url(#layer-bar-stripe-pattern-dark)" });
|
|
9476
|
+
})
|
|
9477
|
+
),
|
|
9222
9478
|
/* @__PURE__ */ import_react98.default.createElement(
|
|
9223
9479
|
import_recharts.Bar,
|
|
9224
9480
|
{
|
|
@@ -10605,11 +10861,11 @@ var TableProvider = ({ children }) => {
|
|
|
10605
10861
|
// src/hooks/useBalanceSheet/useBalanceSheet.tsx
|
|
10606
10862
|
var import_react112 = require("react");
|
|
10607
10863
|
var import_date_fns23 = require("date-fns");
|
|
10608
|
-
var
|
|
10864
|
+
var import_swr5 = __toESM(require("swr"));
|
|
10609
10865
|
var useBalanceSheet = (date = /* @__PURE__ */ new Date()) => {
|
|
10610
10866
|
const { auth, businessId, apiUrl, read, syncTimestamps, hasBeenTouched } = useLayerContext();
|
|
10611
10867
|
const dateString = (0, import_date_fns23.format)((0, import_date_fns23.startOfDay)(date), "yyyy-MM-dd'T'HH:mm:ssXXX");
|
|
10612
|
-
const { data, isLoading, isValidating, error, mutate } = (0,
|
|
10868
|
+
const { data, isLoading, isValidating, error, mutate } = (0, import_swr5.default)(
|
|
10613
10869
|
businessId && dateString && auth?.access_token && `balance-sheet-${businessId}-${dateString}`,
|
|
10614
10870
|
Layer.getBalanceSheet(apiUrl, auth?.access_token, {
|
|
10615
10871
|
params: {
|
|
@@ -11054,7 +11310,7 @@ var StatementOfCashFlowContext = (0, import_react126.createContext)({
|
|
|
11054
11310
|
// src/hooks/useStatementOfCashFlow/useStatementOfCashFlow.tsx
|
|
11055
11311
|
var import_react127 = require("react");
|
|
11056
11312
|
var import_date_fns25 = require("date-fns");
|
|
11057
|
-
var
|
|
11313
|
+
var import_swr6 = __toESM(require("swr"));
|
|
11058
11314
|
var useStatementOfCashFlow = (startDate = /* @__PURE__ */ new Date(), endDate = /* @__PURE__ */ new Date()) => {
|
|
11059
11315
|
const { auth, businessId, apiUrl, read, syncTimestamps, hasBeenTouched } = useLayerContext();
|
|
11060
11316
|
const startDateString = (0, import_date_fns25.format)(
|
|
@@ -11062,7 +11318,7 @@ var useStatementOfCashFlow = (startDate = /* @__PURE__ */ new Date(), endDate =
|
|
|
11062
11318
|
"yyyy-MM-dd'T'HH:mm:ssXXX"
|
|
11063
11319
|
);
|
|
11064
11320
|
const endDateString = (0, import_date_fns25.format)((0, import_date_fns25.startOfDay)(endDate), "yyyy-MM-dd'T'HH:mm:ssXXX");
|
|
11065
|
-
const { data, isLoading, isValidating, error, mutate } = (0,
|
|
11321
|
+
const { data, isLoading, isValidating, error, mutate } = (0, import_swr6.default)(
|
|
11066
11322
|
businessId && startDateString && endDateString && auth?.access_token && `statement-of-cash-${businessId}-${startDateString}-${endDateString}`,
|
|
11067
11323
|
Layer.getStatementOfCashFlow(apiUrl, auth?.access_token, {
|
|
11068
11324
|
params: {
|
|
@@ -11503,7 +11759,7 @@ var LEDGER_ACCOUNT_SUBTYPES_FOR_TYPE = {
|
|
|
11503
11759
|
|
|
11504
11760
|
// src/hooks/useChartOfAccounts/useChartOfAccounts.tsx
|
|
11505
11761
|
var import_date_fns28 = require("date-fns");
|
|
11506
|
-
var
|
|
11762
|
+
var import_swr7 = __toESM(require("swr"));
|
|
11507
11763
|
var validate = (formData) => {
|
|
11508
11764
|
const errors = [];
|
|
11509
11765
|
const nameError = validateName(formData);
|
|
@@ -11604,7 +11860,7 @@ var useChartOfAccounts = ({ withDates, startDate: initialStartDate, endDate: ini
|
|
|
11604
11860
|
const [endDate, setEndDate] = (0, import_react132.useState)(
|
|
11605
11861
|
initialEndDate ?? (0, import_date_fns28.endOfMonth)(Date.now())
|
|
11606
11862
|
);
|
|
11607
|
-
const { data, isLoading, isValidating, error, mutate } = (0,
|
|
11863
|
+
const { data, isLoading, isValidating, error, mutate } = (0, import_swr7.default)(
|
|
11608
11864
|
businessId && auth?.access_token && `chart-of-accounts-${businessId}-${startDate?.valueOf()}-${endDate?.valueOf()}`,
|
|
11609
11865
|
Layer.getLedgerAccountBalances(apiUrl, auth?.access_token, {
|
|
11610
11866
|
params: {
|
|
@@ -11813,12 +12069,12 @@ var useChartOfAccounts = ({ withDates, startDate: initialStartDate, endDate: ini
|
|
|
11813
12069
|
|
|
11814
12070
|
// src/hooks/useLedgerAccounts/useLedgerAccounts.tsx
|
|
11815
12071
|
var import_react133 = require("react");
|
|
11816
|
-
var
|
|
12072
|
+
var import_swr8 = __toESM(require("swr"));
|
|
11817
12073
|
var useLedgerAccounts = () => {
|
|
11818
12074
|
const { auth, businessId, apiUrl, read, syncTimestamps, hasBeenTouched } = useLayerContext();
|
|
11819
12075
|
const [accountId, setAccountId] = (0, import_react133.useState)();
|
|
11820
12076
|
const [selectedEntryId, setSelectedEntryId] = (0, import_react133.useState)();
|
|
11821
|
-
const { data, isLoading, isValidating, error, mutate } = (0,
|
|
12077
|
+
const { data, isLoading, isValidating, error, mutate } = (0, import_swr8.default)(
|
|
11822
12078
|
businessId && accountId && auth?.access_token && `ledger-accounts-lines-${businessId}-${accountId}`,
|
|
11823
12079
|
Layer.getLedgerAccountsLines(apiUrl, auth?.access_token, {
|
|
11824
12080
|
params: { businessId, accountId }
|
|
@@ -11830,7 +12086,7 @@ var useLedgerAccounts = () => {
|
|
|
11830
12086
|
isLoading: isLoadingEntry,
|
|
11831
12087
|
isValidating: isValdiatingEntry,
|
|
11832
12088
|
error: errorEntry
|
|
11833
|
-
} = (0,
|
|
12089
|
+
} = (0, import_swr8.default)(
|
|
11834
12090
|
businessId && selectedEntryId && auth?.access_token && `ledger-accounts-entry-${businessId}-${selectedEntryId}}`,
|
|
11835
12091
|
Layer.getLedgerAccountsEntry(apiUrl, auth?.access_token, {
|
|
11836
12092
|
params: { businessId, entryId: selectedEntryId }
|
|
@@ -12920,7 +13176,7 @@ var getAccountIdentifierPayload = (journalLineItem) => {
|
|
|
12920
13176
|
};
|
|
12921
13177
|
|
|
12922
13178
|
// src/hooks/useJournal/useJournal.tsx
|
|
12923
|
-
var
|
|
13179
|
+
var import_swr9 = __toESM(require("swr"));
|
|
12924
13180
|
var useJournal = () => {
|
|
12925
13181
|
const {
|
|
12926
13182
|
auth,
|
|
@@ -12936,7 +13192,7 @@ var useJournal = () => {
|
|
|
12936
13192
|
const [addingEntry, setAddingEntry] = (0, import_react149.useState)(false);
|
|
12937
13193
|
const [sendingForm, setSendingForm] = (0, import_react149.useState)(false);
|
|
12938
13194
|
const [apiError, setApiError] = (0, import_react149.useState)(void 0);
|
|
12939
|
-
const { data, isLoading, isValidating, error, mutate } = (0,
|
|
13195
|
+
const { data, isLoading, isValidating, error, mutate } = (0, import_swr9.default)(
|
|
12940
13196
|
businessId && auth?.access_token && `journal-lines-${businessId}`,
|
|
12941
13197
|
Layer.getJournal(apiUrl, auth?.access_token, {
|
|
12942
13198
|
params: { businessId }
|
|
@@ -13835,11 +14091,11 @@ var TasksContext = (0, import_react157.createContext)({
|
|
|
13835
14091
|
|
|
13836
14092
|
// src/hooks/useTasks/useTasks.tsx
|
|
13837
14093
|
var import_react158 = require("react");
|
|
13838
|
-
var
|
|
14094
|
+
var import_swr10 = __toESM(require("swr"));
|
|
13839
14095
|
var useTasks = () => {
|
|
13840
14096
|
const [loadedStatus, setLoadedStatus] = (0, import_react158.useState)("initial");
|
|
13841
14097
|
const { auth, businessId, apiUrl, read, syncTimestamps, hasBeenTouched } = useLayerContext();
|
|
13842
|
-
const { data, isLoading, isValidating, error, mutate } = (0,
|
|
14098
|
+
const { data, isLoading, isValidating, error, mutate } = (0, import_swr10.default)(
|
|
13843
14099
|
businessId && auth?.access_token && `tasks-${businessId}`,
|
|
13844
14100
|
Layer.getTasks(apiUrl, auth?.access_token, {
|
|
13845
14101
|
params: { businessId }
|
|
@@ -14821,10 +15077,12 @@ var Components = ({
|
|
|
14821
15077
|
AccountingOverview,
|
|
14822
15078
|
BalanceSheet,
|
|
14823
15079
|
BankTransactions,
|
|
15080
|
+
BankTransactionsProvider,
|
|
14824
15081
|
BankTransactionsWithLinkedAccounts,
|
|
14825
15082
|
BookkeepingOverview,
|
|
14826
15083
|
BookkeepingUpsellBar,
|
|
14827
15084
|
ChartOfAccounts,
|
|
15085
|
+
DisplayState,
|
|
14828
15086
|
GeneralLedgerView,
|
|
14829
15087
|
Journal,
|
|
14830
15088
|
LayerProvider,
|