@layerfi/components 0.1.86 → 0.1.88-alpha
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/cjs/index.cjs +135 -44
- package/dist/esm/index.mjs +366 -275
- package/dist/index.d.ts +72 -76
- package/package.json +1 -1
package/dist/esm/index.mjs
CHANGED
|
@@ -61,7 +61,7 @@ import { useState as useState8 } from "react";
|
|
|
61
61
|
import { useReducer, useEffect as useEffect4 } from "react";
|
|
62
62
|
|
|
63
63
|
// package.json
|
|
64
|
-
var version = "0.1.
|
|
64
|
+
var version = "0.1.88-alpha";
|
|
65
65
|
|
|
66
66
|
// src/models/APIError.ts
|
|
67
67
|
var APIError = class _APIError extends Error {
|
|
@@ -247,7 +247,7 @@ var getBankTransactionsCsv = get((params) => {
|
|
|
247
247
|
return `/v1/businesses/${businessId}/reports/transactions/exports/csv?${startDate ? `start_date=${encodeURIComponent(startDate)}&` : ""}${endDate ? `end_date=${encodeURIComponent(endDate)}&` : ""}${month ? `month=${encodeURIComponent(month)}&` : ""}${year ? `year=${encodeURIComponent(year)}&` : ""}${categorized ? `categorized=${categorized}&` : ""}${category ? `category=${encodeURIComponent(category)}&` : ""}`;
|
|
248
248
|
});
|
|
249
249
|
var getBankTransactionMetadata = get(
|
|
250
|
-
({ businessId, bankTransactionId }) => `/v1/businesses/${businessId}/bank-transactions/${bankTransactionId}
|
|
250
|
+
({ businessId, bankTransactionId }) => `/v1/businesses/${businessId}/bank-transactions/${bankTransactionId}/metadata`
|
|
251
251
|
);
|
|
252
252
|
var updateBankTransactionMetadata = put(
|
|
253
253
|
({ businessId, bankTransactionId }) => `/v1/businesses/${businessId}/bank-transactions/${bankTransactionId}/metadata`
|
|
@@ -283,7 +283,10 @@ var uploadBankTransactionDocument = (baseUrl, accessToken) => ({
|
|
|
283
283
|
var getBusiness = get(({ businessId }) => `/v1/businesses/${businessId}`);
|
|
284
284
|
|
|
285
285
|
// src/api/layer/categories.ts
|
|
286
|
-
var getCategories = get(({ businessId }) =>
|
|
286
|
+
var getCategories = get(({ businessId, mode }) => {
|
|
287
|
+
const parameters = toDefinedSearchParameters({ mode });
|
|
288
|
+
return `/v1/businesses/${businessId}/categories?${parameters}`;
|
|
289
|
+
});
|
|
287
290
|
|
|
288
291
|
// src/api/layer/chart_of_accounts.ts
|
|
289
292
|
var getChartOfAccounts = get(
|
|
@@ -2639,7 +2642,7 @@ var LayerProvider = (_a) => {
|
|
|
2639
2642
|
};
|
|
2640
2643
|
|
|
2641
2644
|
// src/components/Onboarding/Onboarding.tsx
|
|
2642
|
-
import { useContext as
|
|
2645
|
+
import { useContext as useContext11, useEffect as useEffect7, useState as useState12 } from "react";
|
|
2643
2646
|
|
|
2644
2647
|
// src/contexts/LinkedAccountsContext/LinkedAccountsContext.ts
|
|
2645
2648
|
import { createContext as createContext8 } from "react";
|
|
@@ -2740,7 +2743,7 @@ var Header = forwardRef2(
|
|
|
2740
2743
|
Header.displayName = "Header";
|
|
2741
2744
|
|
|
2742
2745
|
// src/components/Onboarding/ConnectAccount.tsx
|
|
2743
|
-
import { useContext as
|
|
2746
|
+
import { useContext as useContext10, useMemo as useMemo6 } from "react";
|
|
2744
2747
|
|
|
2745
2748
|
// src/icons/Bell.tsx
|
|
2746
2749
|
import { jsx as jsx14, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
@@ -3173,7 +3176,7 @@ import {
|
|
|
3173
3176
|
} from "react";
|
|
3174
3177
|
|
|
3175
3178
|
// src/components/Tooltip/useTooltip.ts
|
|
3176
|
-
import
|
|
3179
|
+
import { useMemo as useMemo5, useState as useState9, createContext as createContext9, useContext as useContext9 } from "react";
|
|
3177
3180
|
import {
|
|
3178
3181
|
useFloating,
|
|
3179
3182
|
autoUpdate,
|
|
@@ -3187,9 +3190,9 @@ import {
|
|
|
3187
3190
|
useInteractions,
|
|
3188
3191
|
useTransitionStyles
|
|
3189
3192
|
} from "@floating-ui/react";
|
|
3190
|
-
var TooltipContext =
|
|
3193
|
+
var TooltipContext = createContext9(null);
|
|
3191
3194
|
var useTooltipContext = () => {
|
|
3192
|
-
const context =
|
|
3195
|
+
const context = useContext9(TooltipContext);
|
|
3193
3196
|
if (context == null) {
|
|
3194
3197
|
throw new Error("Tooltip components must be wrapped in <Tooltip />");
|
|
3195
3198
|
}
|
|
@@ -3242,7 +3245,7 @@ var useTooltip = ({
|
|
|
3242
3245
|
},
|
|
3243
3246
|
duration: 300
|
|
3244
3247
|
});
|
|
3245
|
-
return
|
|
3248
|
+
return useMemo5(
|
|
3246
3249
|
() => __spreadValues(__spreadValues({
|
|
3247
3250
|
open,
|
|
3248
3251
|
setOpen,
|
|
@@ -4462,11 +4465,11 @@ var ConnectAccount = ({
|
|
|
4462
4465
|
onboardingStep,
|
|
4463
4466
|
onTransactionsToReviewClick
|
|
4464
4467
|
}) => {
|
|
4465
|
-
const { addConnection } =
|
|
4468
|
+
const { addConnection } = useContext10(LinkedAccountsContext);
|
|
4466
4469
|
const { data, isLoading } = useBankTransactions({
|
|
4467
4470
|
scope: "review" /* review */
|
|
4468
4471
|
});
|
|
4469
|
-
const transactionsToReview =
|
|
4472
|
+
const transactionsToReview = useMemo6(
|
|
4470
4473
|
() => countTransactionsToReview({ transactions: data }),
|
|
4471
4474
|
[data, isLoading]
|
|
4472
4475
|
);
|
|
@@ -4562,7 +4565,7 @@ var OnboardingContent = ({
|
|
|
4562
4565
|
const [style, setStyle] = useState12(
|
|
4563
4566
|
onboardingStep ? EXPANDED_STYLE : COLLAPSED_STYLE
|
|
4564
4567
|
);
|
|
4565
|
-
const { data, loadingStatus } =
|
|
4568
|
+
const { data, loadingStatus } = useContext11(LinkedAccountsContext);
|
|
4566
4569
|
useEffect7(() => {
|
|
4567
4570
|
if (data && (data == null ? void 0 : data.length) === 0 && loadingStatus === "complete" && !onboardingStep) {
|
|
4568
4571
|
setOnboardingStep("connectAccount");
|
|
@@ -4592,7 +4595,7 @@ var OnboardingContent = ({
|
|
|
4592
4595
|
};
|
|
4593
4596
|
|
|
4594
4597
|
// src/components/LinkedAccounts/LinkedAccounts.tsx
|
|
4595
|
-
import { useContext as
|
|
4598
|
+
import { useContext as useContext15 } from "react";
|
|
4596
4599
|
|
|
4597
4600
|
// src/components/Loader/Loader.tsx
|
|
4598
4601
|
import { jsx as jsx53, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
@@ -4617,7 +4620,7 @@ var SmallLoader = ({ size = 28 }) => {
|
|
|
4617
4620
|
};
|
|
4618
4621
|
|
|
4619
4622
|
// src/components/LinkedAccounts/LinkedAccountsContent.tsx
|
|
4620
|
-
import { useContext as
|
|
4623
|
+
import { useContext as useContext13 } from "react";
|
|
4621
4624
|
|
|
4622
4625
|
// src/icons/PlusIcon.tsx
|
|
4623
4626
|
import { jsx as jsx55, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
@@ -4667,7 +4670,7 @@ var PlusIcon = (_a) => {
|
|
|
4667
4670
|
var PlusIcon_default = PlusIcon;
|
|
4668
4671
|
|
|
4669
4672
|
// src/components/LinkedAccounts/LinkedAccountItemThumb.tsx
|
|
4670
|
-
import { useContext as
|
|
4673
|
+
import { useContext as useContext12 } from "react";
|
|
4671
4674
|
|
|
4672
4675
|
// src/icons/MoreVertical.tsx
|
|
4673
4676
|
import { jsx as jsx56, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
@@ -5264,7 +5267,7 @@ var LinkedAccountItemThumb = ({
|
|
|
5264
5267
|
excludeAccount: excludeAccount2,
|
|
5265
5268
|
breakConnection,
|
|
5266
5269
|
setAccountsToAddOpeningBalanceInModal
|
|
5267
|
-
} =
|
|
5270
|
+
} = useContext12(LinkedAccountsContext);
|
|
5268
5271
|
const { environment } = useEnvironment();
|
|
5269
5272
|
let pillConfig;
|
|
5270
5273
|
if (accountNeedsUniquenessConfirmation(account)) {
|
|
@@ -5377,7 +5380,7 @@ import classNames23 from "classnames";
|
|
|
5377
5380
|
import { useState as useState14 } from "react";
|
|
5378
5381
|
|
|
5379
5382
|
// src/components/ui/Modal/Modal.tsx
|
|
5380
|
-
import { forwardRef as forwardRef4, useMemo as
|
|
5383
|
+
import { forwardRef as forwardRef4, useMemo as useMemo7 } from "react";
|
|
5381
5384
|
import {
|
|
5382
5385
|
Dialog as ReactAriaDialog,
|
|
5383
5386
|
Modal as ReactAriaModal,
|
|
@@ -5413,7 +5416,7 @@ var ModalOverlay = forwardRef4(
|
|
|
5413
5416
|
ModalOverlay.displayName = "ModalOverlay";
|
|
5414
5417
|
var MODAL_CLASS_NAME = "Layer__Modal";
|
|
5415
5418
|
var InternalModal = forwardRef4(({ children, size }, ref) => {
|
|
5416
|
-
const dataProperties =
|
|
5419
|
+
const dataProperties = useMemo7(() => toDataProperties({ size }), [size]);
|
|
5417
5420
|
return /* @__PURE__ */ jsx64(
|
|
5418
5421
|
ReactAriaModal,
|
|
5419
5422
|
__spreadProps(__spreadValues({}, dataProperties), {
|
|
@@ -5452,7 +5455,7 @@ import { forwardRef as forwardRef8 } from "react";
|
|
|
5452
5455
|
import { X } from "lucide-react";
|
|
5453
5456
|
|
|
5454
5457
|
// src/components/ui/Button/Button.tsx
|
|
5455
|
-
import { forwardRef as forwardRef5, useMemo as
|
|
5458
|
+
import { forwardRef as forwardRef5, useMemo as useMemo8 } from "react";
|
|
5456
5459
|
import { Button as ReactAriaButton } from "react-aria-components";
|
|
5457
5460
|
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
5458
5461
|
var BUTTON_CLASS_NAME = "Layer__UI__Button";
|
|
@@ -5468,7 +5471,7 @@ var Button2 = forwardRef5((_a, ref) => {
|
|
|
5468
5471
|
"variant",
|
|
5469
5472
|
"children"
|
|
5470
5473
|
]);
|
|
5471
|
-
const dataProperties =
|
|
5474
|
+
const dataProperties = useMemo8(() => toDataProperties({
|
|
5472
5475
|
icon,
|
|
5473
5476
|
size,
|
|
5474
5477
|
variant
|
|
@@ -5485,14 +5488,14 @@ var Button2 = forwardRef5((_a, ref) => {
|
|
|
5485
5488
|
Button2.displayName = "IconButton";
|
|
5486
5489
|
|
|
5487
5490
|
// src/components/ui/Typography/Heading.tsx
|
|
5488
|
-
import { useMemo as
|
|
5491
|
+
import { useMemo as useMemo9 } from "react";
|
|
5489
5492
|
import { forwardRef as forwardRef6 } from "react";
|
|
5490
5493
|
import { Heading as ReactAriaHeading } from "react-aria-components";
|
|
5491
5494
|
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
5492
5495
|
var HEADING_CLASS_NAME = "Layer__UI__Heading";
|
|
5493
5496
|
var Heading2 = forwardRef6((_a, ref) => {
|
|
5494
5497
|
var _b = _a, { size, pbe } = _b, restProps = __objRest(_b, ["size", "pbe"]);
|
|
5495
|
-
const dataProperties =
|
|
5498
|
+
const dataProperties = useMemo9(() => toDataProperties({ size, pbe }), [size, pbe]);
|
|
5496
5499
|
return /* @__PURE__ */ jsx66(
|
|
5497
5500
|
ReactAriaHeading,
|
|
5498
5501
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), {
|
|
@@ -5504,13 +5507,13 @@ var Heading2 = forwardRef6((_a, ref) => {
|
|
|
5504
5507
|
Heading2.displayName = "Heading";
|
|
5505
5508
|
|
|
5506
5509
|
// src/components/ui/Typography/Text.tsx
|
|
5507
|
-
import { forwardRef as forwardRef7, useMemo as
|
|
5510
|
+
import { forwardRef as forwardRef7, useMemo as useMemo10 } from "react";
|
|
5508
5511
|
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
5509
5512
|
var P_CLASS_NAME = "Layer__P";
|
|
5510
5513
|
var P = forwardRef7(
|
|
5511
5514
|
(_a, ref) => {
|
|
5512
5515
|
var _b = _a, { align, children, pbe, size } = _b, restProps = __objRest(_b, ["align", "children", "pbe", "size"]);
|
|
5513
|
-
const dataProperties =
|
|
5516
|
+
const dataProperties = useMemo10(() => toDataProperties({
|
|
5514
5517
|
align,
|
|
5515
5518
|
pbe,
|
|
5516
5519
|
size
|
|
@@ -5567,12 +5570,12 @@ function ModalActions({ children }) {
|
|
|
5567
5570
|
}
|
|
5568
5571
|
|
|
5569
5572
|
// src/components/ui/Stack/Stack.tsx
|
|
5570
|
-
import { useMemo as
|
|
5573
|
+
import { useMemo as useMemo11 } from "react";
|
|
5571
5574
|
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
5572
5575
|
var CLASS_NAME = "Layer__Stack";
|
|
5573
5576
|
function Stack(_a) {
|
|
5574
5577
|
var _b = _a, { align, children, direction, gap, justify } = _b, restProps = __objRest(_b, ["align", "children", "direction", "gap", "justify"]);
|
|
5575
|
-
const dataProperties =
|
|
5578
|
+
const dataProperties = useMemo11(
|
|
5576
5579
|
() => toDataProperties({ align, gap, justify, direction }),
|
|
5577
5580
|
[align, direction, gap, justify]
|
|
5578
5581
|
);
|
|
@@ -5604,7 +5607,7 @@ function ConditionalList({
|
|
|
5604
5607
|
|
|
5605
5608
|
// src/components/ui/Checkbox/Checkbox.tsx
|
|
5606
5609
|
import { Check } from "lucide-react";
|
|
5607
|
-
import { useMemo as
|
|
5610
|
+
import { useMemo as useMemo12 } from "react";
|
|
5608
5611
|
import { Checkbox as ReactAriaCheckbox } from "react-aria-components";
|
|
5609
5612
|
|
|
5610
5613
|
// src/components/utility/withRenderProp.tsx
|
|
@@ -5620,7 +5623,7 @@ import { Fragment as Fragment8, jsx as jsx71, jsxs as jsxs35 } from "react/jsx-r
|
|
|
5620
5623
|
var CLASS_NAME2 = "Layer__Checkbox";
|
|
5621
5624
|
function Checkbox(_a) {
|
|
5622
5625
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
5623
|
-
const dataProperties =
|
|
5626
|
+
const dataProperties = useMemo12(() => toDataProperties({
|
|
5624
5627
|
labeled: typeof children === "string" && children.length > 0
|
|
5625
5628
|
}), [children]);
|
|
5626
5629
|
return /* @__PURE__ */ jsx71(
|
|
@@ -5647,7 +5650,8 @@ function LinkedAccountToConfirm({
|
|
|
5647
5650
|
/* @__PURE__ */ jsxs36(VStack, { children: [
|
|
5648
5651
|
/* @__PURE__ */ jsx72(Heading2, { level: 3, size: "sm", children: account.external_account_name }),
|
|
5649
5652
|
/* @__PURE__ */ jsxs36(P, { slot: "mask", children: [
|
|
5650
|
-
"\u2022\u2022\u2022
|
|
5653
|
+
"\u2022\u2022\u2022",
|
|
5654
|
+
" ",
|
|
5651
5655
|
account.mask
|
|
5652
5656
|
] }),
|
|
5653
5657
|
/* @__PURE__ */ jsx72(P, { slot: "institution", children: account.institution.name })
|
|
@@ -5887,7 +5891,7 @@ var LinkedAccountsContent = ({
|
|
|
5887
5891
|
showUnlinkItem,
|
|
5888
5892
|
showBreakConnection
|
|
5889
5893
|
}) => {
|
|
5890
|
-
const { data, addConnection } =
|
|
5894
|
+
const { data, addConnection } = useContext13(LinkedAccountsContext);
|
|
5891
5895
|
const linkedAccountsNewAccountClassName = classNames23(
|
|
5892
5896
|
"Layer__linked-accounts__new-account",
|
|
5893
5897
|
asWidget && "--as-widget",
|
|
@@ -5928,7 +5932,7 @@ var LinkedAccountsContent = ({
|
|
|
5928
5932
|
};
|
|
5929
5933
|
|
|
5930
5934
|
// src/components/LinkedAccounts/OpeningBalanceModal/OpeningBalanceModal.tsx
|
|
5931
|
-
import { useContext as
|
|
5935
|
+
import { useContext as useContext14, useMemo as useMemo15, useState as useState16 } from "react";
|
|
5932
5936
|
|
|
5933
5937
|
// src/utils/business.ts
|
|
5934
5938
|
import { differenceInCalendarMonths, parseISO as parseISO2, startOfMonth as startOfMonth3 } from "date-fns";
|
|
@@ -5961,7 +5965,7 @@ var isDateAllowedToBrowse = (date, business) => {
|
|
|
5961
5965
|
};
|
|
5962
5966
|
|
|
5963
5967
|
// src/components/LinkedAccounts/AccountFormBox/AccountFormBox.tsx
|
|
5964
|
-
import { useMemo as
|
|
5968
|
+
import { useMemo as useMemo14 } from "react";
|
|
5965
5969
|
|
|
5966
5970
|
// src/components/Input/Input.tsx
|
|
5967
5971
|
import classNames24 from "classnames";
|
|
@@ -6361,7 +6365,7 @@ var AmountInput = (_a) => {
|
|
|
6361
6365
|
};
|
|
6362
6366
|
|
|
6363
6367
|
// src/components/DatePicker/DatePicker.tsx
|
|
6364
|
-
import { useMemo as
|
|
6368
|
+
import { useMemo as useMemo13, useRef as useRef7, useState as useState15 } from "react";
|
|
6365
6369
|
import * as RDP from "react-datepicker";
|
|
6366
6370
|
|
|
6367
6371
|
// src/icons/ChevronLeft.tsx
|
|
@@ -6512,7 +6516,7 @@ var DatePicker = (_a) => {
|
|
|
6512
6516
|
]);
|
|
6513
6517
|
const { ModeSelector } = slots != null ? slots : {};
|
|
6514
6518
|
const pickerRef = useRef7(null);
|
|
6515
|
-
const pickerMode =
|
|
6519
|
+
const pickerMode = useMemo13(() => {
|
|
6516
6520
|
var _a2;
|
|
6517
6521
|
if (!allowedModes) {
|
|
6518
6522
|
return displayMode;
|
|
@@ -6525,7 +6529,7 @@ var DatePicker = (_a) => {
|
|
|
6525
6529
|
}
|
|
6526
6530
|
return (_a2 = allowedModes[0]) != null ? _a2 : displayMode;
|
|
6527
6531
|
}, [displayMode, allowedModes]);
|
|
6528
|
-
const [firstDate, secondDate] =
|
|
6532
|
+
const [firstDate, secondDate] = useMemo13(() => {
|
|
6529
6533
|
if (selected instanceof Date) {
|
|
6530
6534
|
return [selected, null];
|
|
6531
6535
|
}
|
|
@@ -6610,7 +6614,7 @@ var DatePicker = (_a) => {
|
|
|
6610
6614
|
break;
|
|
6611
6615
|
}
|
|
6612
6616
|
};
|
|
6613
|
-
const isTodayOrAfter =
|
|
6617
|
+
const isTodayOrAfter = useMemo13(() => {
|
|
6614
6618
|
switch (displayMode) {
|
|
6615
6619
|
case "dayPicker":
|
|
6616
6620
|
return firstDate >= endOfDay2(/* @__PURE__ */ new Date()) || firstDate >= maxDate;
|
|
@@ -6778,7 +6782,7 @@ var AccountFormBox = ({
|
|
|
6778
6782
|
errors = []
|
|
6779
6783
|
}) => {
|
|
6780
6784
|
var _a, _b, _c, _d, _e;
|
|
6781
|
-
const dataProps =
|
|
6785
|
+
const dataProps = useMemo14(() => toDataProperties({
|
|
6782
6786
|
saved: isSaved,
|
|
6783
6787
|
confirmed: value.isConfirmed
|
|
6784
6788
|
}), [isSaved, value.isConfirmed]);
|
|
@@ -7044,7 +7048,7 @@ function LinkedAccountsOpeningBalanceModalContent({
|
|
|
7044
7048
|
openingDate: (_a2 = getActivationDate(business)) != null ? _a2 : startOfYear3(/* @__PURE__ */ new Date())
|
|
7045
7049
|
};
|
|
7046
7050
|
}));
|
|
7047
|
-
const formsDataToSave =
|
|
7051
|
+
const formsDataToSave = useMemo15(
|
|
7048
7052
|
() => ignoreAlreadySaved(formsData, results),
|
|
7049
7053
|
[formsData, results]
|
|
7050
7054
|
);
|
|
@@ -7111,7 +7115,7 @@ function OpeningBalanceModal({
|
|
|
7111
7115
|
const {
|
|
7112
7116
|
accountsToAddOpeningBalanceInModal,
|
|
7113
7117
|
setAccountsToAddOpeningBalanceInModal
|
|
7114
|
-
} =
|
|
7118
|
+
} = useContext14(LinkedAccountsContext);
|
|
7115
7119
|
const shouldShowModal = Boolean(accountsToAddOpeningBalanceInModal.length);
|
|
7116
7120
|
if (!shouldShowModal) {
|
|
7117
7121
|
return null;
|
|
@@ -7157,7 +7161,7 @@ var LinkedAccountsComponent = ({
|
|
|
7157
7161
|
error,
|
|
7158
7162
|
isValidating,
|
|
7159
7163
|
refetchAccounts
|
|
7160
|
-
} =
|
|
7164
|
+
} = useContext15(LinkedAccountsContext);
|
|
7161
7165
|
return /* @__PURE__ */ jsxs51(Container, { name: COMPONENT_NAME, elevated, children: [
|
|
7162
7166
|
/* @__PURE__ */ jsx90(Header, { className: "Layer__linked-accounts__header", children: /* @__PURE__ */ jsx90(
|
|
7163
7167
|
Heading,
|
|
@@ -7192,7 +7196,7 @@ var LinkedAccountsComponent = ({
|
|
|
7192
7196
|
};
|
|
7193
7197
|
|
|
7194
7198
|
// src/components/BankTransactions/BankTransactions.tsx
|
|
7195
|
-
import { useEffect as useEffect22, useMemo as
|
|
7199
|
+
import { useEffect as useEffect22, useMemo as useMemo20, useRef as useRef17, useState as useState34 } from "react";
|
|
7196
7200
|
|
|
7197
7201
|
// src/hooks/useElementSize/useElementSize.ts
|
|
7198
7202
|
import { useLayoutEffect as useLayoutEffect2, useRef as useRef8 } from "react";
|
|
@@ -7332,7 +7336,7 @@ var File = (_a) => {
|
|
|
7332
7336
|
var File_default = File;
|
|
7333
7337
|
|
|
7334
7338
|
// src/components/BankTransactionRow/BankTransactionRow.tsx
|
|
7335
|
-
import { useEffect as useEffect14, useMemo as
|
|
7339
|
+
import { useEffect as useEffect14, useMemo as useMemo16, useRef as useRef10, useState as useState23 } from "react";
|
|
7336
7340
|
|
|
7337
7341
|
// src/icons/Scissors.tsx
|
|
7338
7342
|
import { jsx as jsx92, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
@@ -7635,7 +7639,7 @@ var MinimizeTwo = (_a) => {
|
|
|
7635
7639
|
var MinimizeTwo_default = MinimizeTwo;
|
|
7636
7640
|
|
|
7637
7641
|
// src/components/CategorySelect/CategorySelectDrawer.tsx
|
|
7638
|
-
import { useContext as
|
|
7642
|
+
import { useContext as useContext16 } from "react";
|
|
7639
7643
|
|
|
7640
7644
|
// src/components/BankTransactionMobileList/BusinessCategories.tsx
|
|
7641
7645
|
import { useState as useState18 } from "react";
|
|
@@ -7662,7 +7666,7 @@ var ActionableList = ({
|
|
|
7662
7666
|
children: [
|
|
7663
7667
|
/* @__PURE__ */ jsxs56("div", { className: "Layer__actionable-list__content", children: [
|
|
7664
7668
|
/* @__PURE__ */ jsx97(Text, { size: "sm" /* sm */, children: x.label }),
|
|
7665
|
-
/*TODO: Replace 'See all categories' with something more generic*/
|
|
7669
|
+
/* TODO: Replace 'See all categories' with something more generic */
|
|
7666
7670
|
showDescriptions && x.description && x.label !== "See all categories" && /* @__PURE__ */ jsx97(
|
|
7667
7671
|
Text,
|
|
7668
7672
|
{
|
|
@@ -7804,7 +7808,7 @@ var CategorySelectDrawer = ({
|
|
|
7804
7808
|
showTooltips: _showTooltips
|
|
7805
7809
|
}) => {
|
|
7806
7810
|
var _a, _b;
|
|
7807
|
-
const { setContent, close } =
|
|
7811
|
+
const { setContent, close } = useContext16(DrawerContext);
|
|
7808
7812
|
const onDrawerCategorySelect = (value) => {
|
|
7809
7813
|
close();
|
|
7810
7814
|
onSelect(value);
|
|
@@ -8235,15 +8239,15 @@ var Trash_default = Trash;
|
|
|
8235
8239
|
import { forwardRef as forwardRef9, useImperativeHandle } from "react";
|
|
8236
8240
|
|
|
8237
8241
|
// src/contexts/ReceiptsContext/ReceiptsContext.ts
|
|
8238
|
-
import { createContext as
|
|
8239
|
-
var ReceiptsContext =
|
|
8242
|
+
import { createContext as createContext10, useContext as useContext17 } from "react";
|
|
8243
|
+
var ReceiptsContext = createContext10({
|
|
8240
8244
|
receiptUrls: [],
|
|
8241
8245
|
uploadReceipt: () => {
|
|
8242
8246
|
},
|
|
8243
8247
|
archiveDocument: () => {
|
|
8244
8248
|
}
|
|
8245
8249
|
});
|
|
8246
|
-
var useReceiptsContext = () =>
|
|
8250
|
+
var useReceiptsContext = () => useContext17(ReceiptsContext);
|
|
8247
8251
|
|
|
8248
8252
|
// src/hooks/useReceipts/useReceipts.ts
|
|
8249
8253
|
import { useEffect as useEffect10, useState as useState19 } from "react";
|
|
@@ -9778,7 +9782,7 @@ var BankTransactionRow = ({
|
|
|
9778
9782
|
initialLoad ? "initial-load" : "",
|
|
9779
9783
|
showComponent ? "show" : ""
|
|
9780
9784
|
);
|
|
9781
|
-
const showReceiptDataProperties =
|
|
9785
|
+
const showReceiptDataProperties = useMemo16(
|
|
9782
9786
|
() => toDataProperties({ "show-receipt-upload-column": showReceiptUploadColumn }),
|
|
9783
9787
|
[showReceiptUploadColumn]
|
|
9784
9788
|
);
|
|
@@ -10246,10 +10250,10 @@ var BankTransactionList = ({
|
|
|
10246
10250
|
};
|
|
10247
10251
|
|
|
10248
10252
|
// src/components/BankTransactionMobileList/BankTransactionMobileListItem.tsx
|
|
10249
|
-
import { useContext as
|
|
10253
|
+
import { useContext as useContext20, useEffect as useEffect21, useRef as useRef16, useState as useState32 } from "react";
|
|
10250
10254
|
|
|
10251
10255
|
// src/components/BankTransactionMobileList/BusinessForm.tsx
|
|
10252
|
-
import { useContext as
|
|
10256
|
+
import { useContext as useContext19, useEffect as useEffect17, useMemo as useMemo17, useRef as useRef12, useState as useState26 } from "react";
|
|
10253
10257
|
|
|
10254
10258
|
// src/icons/Paperclip.tsx
|
|
10255
10259
|
import { jsx as jsx120 } from "react/jsx-runtime";
|
|
@@ -10280,19 +10284,19 @@ var Paperclip_default = Paperclip;
|
|
|
10280
10284
|
|
|
10281
10285
|
// src/components/BankTransactionMobileList/useMemoText.tsx
|
|
10282
10286
|
import {
|
|
10283
|
-
createContext as
|
|
10284
|
-
useContext as
|
|
10287
|
+
createContext as createContext11,
|
|
10288
|
+
useContext as useContext18,
|
|
10285
10289
|
useEffect as useEffect16,
|
|
10286
10290
|
useState as useState25
|
|
10287
10291
|
} from "react";
|
|
10288
10292
|
import { jsx as jsx121 } from "react/jsx-runtime";
|
|
10289
|
-
var MemoTextContext =
|
|
10293
|
+
var MemoTextContext = createContext11({
|
|
10290
10294
|
memoText: void 0,
|
|
10291
10295
|
setMemoText: () => {
|
|
10292
10296
|
},
|
|
10293
10297
|
saveMemoText: () => Promise.resolve()
|
|
10294
10298
|
});
|
|
10295
|
-
var useMemoTextContext = () =>
|
|
10299
|
+
var useMemoTextContext = () => useContext18(MemoTextContext);
|
|
10296
10300
|
var useMemoText = ({ bankTransaction, isActive }) => {
|
|
10297
10301
|
const { businessId } = useLayerContext();
|
|
10298
10302
|
const { apiUrl } = useEnvironment();
|
|
@@ -10367,7 +10371,7 @@ var BusinessForm = ({
|
|
|
10367
10371
|
showDescriptions
|
|
10368
10372
|
}) => {
|
|
10369
10373
|
const receiptsRef = useRef12(null);
|
|
10370
|
-
const { setContent, close } =
|
|
10374
|
+
const { setContent, close } = useContext19(DrawerContext);
|
|
10371
10375
|
const { categorize: categorizeBankTransaction2, isLoading } = useBankTransactionsContext();
|
|
10372
10376
|
const [selectedCategory, setSelectedCategory] = useState26(
|
|
10373
10377
|
getAssignedValue(bankTransaction)
|
|
@@ -10379,7 +10383,7 @@ var BusinessForm = ({
|
|
|
10379
10383
|
setShowRetry(true);
|
|
10380
10384
|
}
|
|
10381
10385
|
}, [bankTransaction.error]);
|
|
10382
|
-
const options =
|
|
10386
|
+
const options = useMemo17(() => {
|
|
10383
10387
|
var _a;
|
|
10384
10388
|
const options2 = ((_a = bankTransaction == null ? void 0 : bankTransaction.categorization_flow) == null ? void 0 : _a.type) === "ASK_FROM_SUGGESTIONS" /* ASK_FROM_SUGGESTIONS */ ? bankTransaction.categorization_flow.suggestions.map(
|
|
10385
10389
|
(x) => mapCategoryToOption(x)
|
|
@@ -11178,7 +11182,7 @@ var BankTransactionMobileForms = ({
|
|
|
11178
11182
|
};
|
|
11179
11183
|
|
|
11180
11184
|
// src/components/BankTransactionMobileList/TransactionToOpenContext.ts
|
|
11181
|
-
import { createContext as
|
|
11185
|
+
import { createContext as createContext12, useState as useState31 } from "react";
|
|
11182
11186
|
var useTransactionToOpen = () => {
|
|
11183
11187
|
const [transactionIdToOpen, setTransactionIdToOpen] = useState31(void 0);
|
|
11184
11188
|
const clearTransactionIdToOpen = () => setTransactionIdToOpen(void 0);
|
|
@@ -11188,7 +11192,7 @@ var useTransactionToOpen = () => {
|
|
|
11188
11192
|
clearTransactionIdToOpen
|
|
11189
11193
|
};
|
|
11190
11194
|
};
|
|
11191
|
-
var TransactionToOpenContext =
|
|
11195
|
+
var TransactionToOpenContext = createContext12({
|
|
11192
11196
|
transactionIdToOpen: void 0,
|
|
11193
11197
|
setTransactionIdToOpen: () => void 0,
|
|
11194
11198
|
clearTransactionIdToOpen: () => void 0
|
|
@@ -11226,7 +11230,7 @@ var BankTransactionMobileListItem = ({
|
|
|
11226
11230
|
transactionIdToOpen,
|
|
11227
11231
|
setTransactionIdToOpen,
|
|
11228
11232
|
clearTransactionIdToOpen
|
|
11229
|
-
} =
|
|
11233
|
+
} = useContext20(TransactionToOpenContext);
|
|
11230
11234
|
const { shouldHideAfterCategorize } = useBankTransactionsContext();
|
|
11231
11235
|
const formRowRef = useElementSize(
|
|
11232
11236
|
(_a2, _b, { height: height2 }) => setHeight(height2)
|
|
@@ -11438,7 +11442,7 @@ var BankTransactionMobileList = ({
|
|
|
11438
11442
|
};
|
|
11439
11443
|
|
|
11440
11444
|
// src/components/BankTransactionsTable/BankTransactionsTable.tsx
|
|
11441
|
-
import { useMemo as
|
|
11445
|
+
import { useMemo as useMemo18 } from "react";
|
|
11442
11446
|
|
|
11443
11447
|
// src/components/SkeletonLoader/SkeletonLoader.tsx
|
|
11444
11448
|
import classNames47 from "classnames";
|
|
@@ -11470,7 +11474,7 @@ var SkeletonTableLoader = ({
|
|
|
11470
11474
|
{
|
|
11471
11475
|
colSpan: col.colSpan,
|
|
11472
11476
|
className: "Layer__skeleton-loader__row",
|
|
11473
|
-
children: col.colComponent ? col.colComponent : col.parts && col.parts > 1 ? /* @__PURE__ */ jsx131("span", { className: "Layer__skeleton-loader__row__group", children:
|
|
11477
|
+
children: col.colComponent ? col.colComponent : col.parts && col.parts > 1 ? /* @__PURE__ */ jsx131("span", { className: "Layer__skeleton-loader__row__group", children: Array(col.parts).map((_part, partIndex) => /* @__PURE__ */ jsx131(
|
|
11474
11478
|
SkeletonLoader,
|
|
11475
11479
|
{
|
|
11476
11480
|
width: "100%",
|
|
@@ -11612,7 +11616,7 @@ var BankTransactionsTable = ({
|
|
|
11612
11616
|
return ((_a2 = transaction.document_ids) == null ? void 0 : _a2.length) > 0;
|
|
11613
11617
|
}
|
|
11614
11618
|
))) != null ? _a : false;
|
|
11615
|
-
const showReceiptDataProperties =
|
|
11619
|
+
const showReceiptDataProperties = useMemo18(
|
|
11616
11620
|
() => toDataProperties({ "show-receipt-upload-column": showReceiptColumn }),
|
|
11617
11621
|
[showReceiptColumn]
|
|
11618
11622
|
);
|
|
@@ -11722,7 +11726,7 @@ var ErrorBoundary = class extends Component {
|
|
|
11722
11726
|
};
|
|
11723
11727
|
|
|
11724
11728
|
// src/hooks/usePagination/usePagination.ts
|
|
11725
|
-
import { useMemo as
|
|
11729
|
+
import { useMemo as useMemo19 } from "react";
|
|
11726
11730
|
var DOTS = "...";
|
|
11727
11731
|
var usePagination = ({
|
|
11728
11732
|
totalCount,
|
|
@@ -11730,7 +11734,7 @@ var usePagination = ({
|
|
|
11730
11734
|
siblingCount = 1,
|
|
11731
11735
|
currentPage
|
|
11732
11736
|
}) => {
|
|
11733
|
-
const paginationRange =
|
|
11737
|
+
const paginationRange = useMemo19(() => {
|
|
11734
11738
|
const totalPageCount = Math.ceil(totalCount / pageSize);
|
|
11735
11739
|
const totalPageNumbers = siblingCount + 5;
|
|
11736
11740
|
if (totalPageNumbers >= totalPageCount) {
|
|
@@ -12138,7 +12142,7 @@ var BankTransactionsContent = ({
|
|
|
12138
12142
|
removeAfterCategorize
|
|
12139
12143
|
} = useBankTransactionsContext();
|
|
12140
12144
|
const { data: linkedAccounts } = useLinkedAccounts();
|
|
12141
|
-
const isSyncing =
|
|
12145
|
+
const isSyncing = useMemo20(
|
|
12142
12146
|
() => Boolean(linkedAccounts == null ? void 0 : linkedAccounts.some((item) => item.is_syncing)),
|
|
12143
12147
|
[linkedAccounts]
|
|
12144
12148
|
);
|
|
@@ -12189,7 +12193,7 @@ var BankTransactionsContent = ({
|
|
|
12189
12193
|
return () => clearTimeout(timeoutLoad);
|
|
12190
12194
|
}
|
|
12191
12195
|
}, [loadingStatus]);
|
|
12192
|
-
const bankTransactions =
|
|
12196
|
+
const bankTransactions = useMemo20(() => {
|
|
12193
12197
|
if (monthlyView) {
|
|
12194
12198
|
return data;
|
|
12195
12199
|
}
|
|
@@ -12436,11 +12440,11 @@ var Quickbooks = () => {
|
|
|
12436
12440
|
};
|
|
12437
12441
|
|
|
12438
12442
|
// src/components/ProfitAndLoss/ProfitAndLoss.tsx
|
|
12439
|
-
import { createContext as
|
|
12443
|
+
import { createContext as createContext15 } from "react";
|
|
12440
12444
|
|
|
12441
12445
|
// src/contexts/ProfitAndLossComparisonContext/ProfitAndLossComparisonContext.tsx
|
|
12442
|
-
import { createContext as
|
|
12443
|
-
var PNLComparisonContext =
|
|
12446
|
+
import { createContext as createContext13 } from "react";
|
|
12447
|
+
var PNLComparisonContext = createContext13({
|
|
12444
12448
|
data: void 0,
|
|
12445
12449
|
isLoading: true,
|
|
12446
12450
|
isValidating: false,
|
|
@@ -12464,7 +12468,7 @@ var PNLComparisonContext = createContext12({
|
|
|
12464
12468
|
});
|
|
12465
12469
|
|
|
12466
12470
|
// src/hooks/useProfitAndLoss/useProfitAndLoss.tsx
|
|
12467
|
-
import { useCallback as useCallback4, useMemo as
|
|
12471
|
+
import { useCallback as useCallback4, useMemo as useMemo22, useState as useState37 } from "react";
|
|
12468
12472
|
|
|
12469
12473
|
// src/utils/profitAndLossUtils.ts
|
|
12470
12474
|
var doesLineItemQualifies = (item) => {
|
|
@@ -12520,7 +12524,7 @@ var applyShare = (items, total) => {
|
|
|
12520
12524
|
};
|
|
12521
12525
|
|
|
12522
12526
|
// src/hooks/useProfitAndLoss/useProfitAndLossLTM.tsx
|
|
12523
|
-
import { useEffect as useEffect24, useMemo as
|
|
12527
|
+
import { useEffect as useEffect24, useMemo as useMemo21, useState as useState36 } from "react";
|
|
12524
12528
|
import { startOfMonth as startOfMonth7, sub } from "date-fns";
|
|
12525
12529
|
import useSWR4 from "swr";
|
|
12526
12530
|
var buildDates = ({ currentDate }) => {
|
|
@@ -12551,7 +12555,7 @@ var useProfitAndLossLTM = ({ currentDate, tagFilter, reportingBasis } = {
|
|
|
12551
12555
|
const [date, setDate] = useState36(currentDate);
|
|
12552
12556
|
const [loaded, setLoaded] = useState36("initial");
|
|
12553
12557
|
const [data, setData] = useState36([]);
|
|
12554
|
-
const { startYear, startMonth, endYear, endMonth } =
|
|
12558
|
+
const { startYear, startMonth, endYear, endMonth } = useMemo21(() => {
|
|
12555
12559
|
return buildDates({ currentDate: date });
|
|
12556
12560
|
}, [date, businessId, tagFilter, reportingBasis]);
|
|
12557
12561
|
const queryKey = businessId && Boolean(startYear) && Boolean(startMonth) && Boolean(endYear) && Boolean(endMonth) && (auth == null ? void 0 : auth.access_token) && `profit-and-loss-summaries-${businessId}-${startYear.toString()}-${startMonth.toString()}-${tagFilter == null ? void 0 : tagFilter.key}-${(_a = tagFilter == null ? void 0 : tagFilter.values) == null ? void 0 : _a.join(
|
|
@@ -12743,7 +12747,7 @@ var useProfitAndLoss = ({
|
|
|
12743
12747
|
}) => {
|
|
12744
12748
|
const { start, end } = useGlobalDateRange();
|
|
12745
12749
|
const { setRange } = useGlobalDateRangeActions();
|
|
12746
|
-
const dateRange =
|
|
12750
|
+
const dateRange = useMemo22(() => ({ startDate: start, endDate: end }), [start, end]);
|
|
12747
12751
|
const changeDateRange = useCallback4(
|
|
12748
12752
|
({ startDate: start2, endDate: end2 }) => setRange({ start: start2, end: end2 }),
|
|
12749
12753
|
[setRange]
|
|
@@ -12779,7 +12783,7 @@ var useProfitAndLoss = ({
|
|
|
12779
12783
|
})
|
|
12780
12784
|
}));
|
|
12781
12785
|
};
|
|
12782
|
-
const { filteredDataRevenue, filteredTotalRevenue } =
|
|
12786
|
+
const { filteredDataRevenue, filteredTotalRevenue } = useMemo22(() => {
|
|
12783
12787
|
var _a;
|
|
12784
12788
|
if (!data) {
|
|
12785
12789
|
return { filteredDataRevenue: [], filteredTotalRevenue: void 0 };
|
|
@@ -12831,7 +12835,7 @@ var useProfitAndLoss = ({
|
|
|
12831
12835
|
const withShare = applyShare(sorted, total);
|
|
12832
12836
|
return { filteredDataRevenue: withShare, filteredTotalRevenue: total };
|
|
12833
12837
|
}, [data, start, filters, summaryData]);
|
|
12834
|
-
const { filteredDataExpenses, filteredTotalExpenses } =
|
|
12838
|
+
const { filteredDataExpenses, filteredTotalExpenses } = useMemo22(() => {
|
|
12835
12839
|
var _a;
|
|
12836
12840
|
if (!data) {
|
|
12837
12841
|
return { filteredDataExpenses: [], filteredTotalExpenses: void 0 };
|
|
@@ -13061,7 +13065,7 @@ function useProfitAndLossComparison({
|
|
|
13061
13065
|
}
|
|
13062
13066
|
|
|
13063
13067
|
// src/components/ProfitAndLossChart/ProfitAndLossChart.tsx
|
|
13064
|
-
import { useEffect as useEffect28, useMemo as
|
|
13068
|
+
import { useEffect as useEffect28, useMemo as useMemo23, useState as useState40 } from "react";
|
|
13065
13069
|
|
|
13066
13070
|
// src/icons/BarChart2.tsx
|
|
13067
13071
|
import { jsx as jsx143, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
@@ -13291,7 +13295,7 @@ var ProfitAndLossChart = ({
|
|
|
13291
13295
|
const { getColor, business } = useLayerContext();
|
|
13292
13296
|
const { start, end } = useGlobalDateRange();
|
|
13293
13297
|
const { setMonth } = useGlobalDateRangeActions();
|
|
13294
|
-
const dateRange =
|
|
13298
|
+
const dateRange = useMemo23(() => ({ startDate: start, endDate: end }), [start, end]);
|
|
13295
13299
|
const [localDateRange, setLocalDateRange] = useState40(dateRange);
|
|
13296
13300
|
const [customCursorSize, setCustomCursorSize] = useState40({
|
|
13297
13301
|
width: 0,
|
|
@@ -13303,7 +13307,7 @@ var ProfitAndLossChart = ({
|
|
|
13303
13307
|
start: startOfMonth10(sub2(Date.now(), { months: 11 })),
|
|
13304
13308
|
end: endOfMonth8(Date.now())
|
|
13305
13309
|
});
|
|
13306
|
-
const selectionMonth =
|
|
13310
|
+
const selectionMonth = useMemo23(
|
|
13307
13311
|
() => ({
|
|
13308
13312
|
year: localDateRange.startDate.getFullYear(),
|
|
13309
13313
|
month: localDateRange.startDate.getMonth()
|
|
@@ -13319,7 +13323,7 @@ var ProfitAndLossChart = ({
|
|
|
13319
13323
|
currentDate: startOfMonth10(Date.now()),
|
|
13320
13324
|
tagFilter
|
|
13321
13325
|
});
|
|
13322
|
-
const anyData =
|
|
13326
|
+
const anyData = useMemo23(() => {
|
|
13323
13327
|
return Boolean(
|
|
13324
13328
|
data == null ? void 0 : data.find(
|
|
13325
13329
|
(x) => x.income !== 0 || x.costOfGoodsSold !== 0 || x.grossProfit !== 0 || x.operatingExpenses !== 0 || x.profitBeforeTaxes !== 0 || x.taxes !== 0 || x.totalExpenses !== 0
|
|
@@ -13327,11 +13331,11 @@ var ProfitAndLossChart = ({
|
|
|
13327
13331
|
);
|
|
13328
13332
|
}, [data]);
|
|
13329
13333
|
const { data: linkedAccounts } = useLinkedAccounts();
|
|
13330
|
-
const isSyncing =
|
|
13334
|
+
const isSyncing = useMemo23(
|
|
13331
13335
|
() => Boolean(linkedAccounts == null ? void 0 : linkedAccounts.some((item) => item.is_syncing)),
|
|
13332
13336
|
[linkedAccounts]
|
|
13333
13337
|
);
|
|
13334
|
-
const loadingValue =
|
|
13338
|
+
const loadingValue = useMemo23(() => getLoadingValue(data), [data]);
|
|
13335
13339
|
useEffect28(() => {
|
|
13336
13340
|
if (loaded === "complete" && data) {
|
|
13337
13341
|
const foundCurrent = data.find(
|
|
@@ -13390,7 +13394,7 @@ var ProfitAndLossChart = ({
|
|
|
13390
13394
|
loading: (pnl == null ? void 0 : pnl.isLoading) ? loadingValue : 0,
|
|
13391
13395
|
loadingExpenses: (pnl == null ? void 0 : pnl.isLoading) ? -loadingValue : 0
|
|
13392
13396
|
});
|
|
13393
|
-
const theData =
|
|
13397
|
+
const theData = useMemo23(() => {
|
|
13394
13398
|
var _a;
|
|
13395
13399
|
if (loaded !== "complete" || loaded === "complete" && !anyData) {
|
|
13396
13400
|
const loadingData = [];
|
|
@@ -13924,7 +13928,7 @@ var ProfitAndLossChart = ({
|
|
|
13924
13928
|
};
|
|
13925
13929
|
|
|
13926
13930
|
// src/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions.tsx
|
|
13927
|
-
import { useContext as
|
|
13931
|
+
import { useContext as useContext21, useEffect as useEffect29, useState as useState41 } from "react";
|
|
13928
13932
|
import { jsx as jsx147, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
13929
13933
|
var selectStyles = {
|
|
13930
13934
|
valueContainer: (styles) => {
|
|
@@ -13944,8 +13948,8 @@ var ProfitAndLossCompareOptions = ({
|
|
|
13944
13948
|
refetch,
|
|
13945
13949
|
compareMonths,
|
|
13946
13950
|
compareOptions
|
|
13947
|
-
} =
|
|
13948
|
-
const { dateRange } =
|
|
13951
|
+
} = useContext21(ProfitAndLoss.ComparisonContext);
|
|
13952
|
+
const { dateRange } = useContext21(ProfitAndLoss.Context);
|
|
13949
13953
|
const [initialDone, setInitialDone] = useState41(false);
|
|
13950
13954
|
useEffect29(() => {
|
|
13951
13955
|
if (initialDone) {
|
|
@@ -14038,7 +14042,7 @@ var ProfitAndLossCompareOptions = ({
|
|
|
14038
14042
|
};
|
|
14039
14043
|
|
|
14040
14044
|
// src/components/ProfitAndLossDatePicker/ProfitAndLossDatePicker.tsx
|
|
14041
|
-
import { useCallback as useCallback6, useContext as
|
|
14045
|
+
import { useCallback as useCallback6, useContext as useContext22 } from "react";
|
|
14042
14046
|
|
|
14043
14047
|
// src/components/DatePicker/ModeSelector/DatePickerModeSelector.tsx
|
|
14044
14048
|
import { jsx as jsx148 } from "react/jsx-runtime";
|
|
@@ -14085,7 +14089,7 @@ function DatePickerModeSelector({
|
|
|
14085
14089
|
import { endOfMonth as endOfMonth9, startOfMonth as startOfMonth11 } from "date-fns";
|
|
14086
14090
|
|
|
14087
14091
|
// src/providers/GlobalDateStore/useGlobalDateRangePicker.ts
|
|
14088
|
-
import { useMemo as
|
|
14092
|
+
import { useMemo as useMemo24 } from "react";
|
|
14089
14093
|
|
|
14090
14094
|
// src/utils/array/getArrayWithAtLeastOneOrFallback.ts
|
|
14091
14095
|
function getArrayWithAtLeastOneOrFallback(list, fallback) {
|
|
@@ -14112,7 +14116,7 @@ function useGlobalDateRangePicker({
|
|
|
14112
14116
|
DEFAULT_ALLOWED_PICKER_MODES
|
|
14113
14117
|
);
|
|
14114
14118
|
const desiredRangeMode = allowedDateRangePickerModes.includes(rangeDisplayMode) ? rangeDisplayMode : allowedDateRangePickerModes[0];
|
|
14115
|
-
const { dateFormat, selected } =
|
|
14119
|
+
const { dateFormat, selected } = useMemo24(() => {
|
|
14116
14120
|
if (rangeDisplayMode === "monthPicker") {
|
|
14117
14121
|
return {
|
|
14118
14122
|
selected: start,
|
|
@@ -14132,7 +14136,7 @@ function useGlobalDateRangePicker({
|
|
|
14132
14136
|
end,
|
|
14133
14137
|
rangeDisplayMode
|
|
14134
14138
|
]);
|
|
14135
|
-
const { setSelected } =
|
|
14139
|
+
const { setSelected } = useMemo24(() => {
|
|
14136
14140
|
if (desiredRangeMode === "monthPicker") {
|
|
14137
14141
|
return {
|
|
14138
14142
|
setSelected: ({ start: start2 }) => {
|
|
@@ -14170,7 +14174,7 @@ var ProfitAndLossDatePicker = ({
|
|
|
14170
14174
|
defaultDatePickerMode
|
|
14171
14175
|
}) => {
|
|
14172
14176
|
const { business } = useLayerContext();
|
|
14173
|
-
const { refetch, compareMode, compareMonths } =
|
|
14177
|
+
const { refetch, compareMode, compareMonths } = useContext22(ProfitAndLoss.ComparisonContext);
|
|
14174
14178
|
const getComparisonData = useCallback6((date) => {
|
|
14175
14179
|
if (compareMode && compareMonths > 0) {
|
|
14176
14180
|
refetch({
|
|
@@ -14226,7 +14230,7 @@ var ProfitAndLossDatePicker = ({
|
|
|
14226
14230
|
};
|
|
14227
14231
|
|
|
14228
14232
|
// src/components/ProfitAndLossDetailedCharts/ProfitAndLossDetailedCharts.tsx
|
|
14229
|
-
import { useContext as
|
|
14233
|
+
import { useContext as useContext23, useState as useState42 } from "react";
|
|
14230
14234
|
|
|
14231
14235
|
// src/icons/X.tsx
|
|
14232
14236
|
import { jsx as jsx150, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
@@ -14267,7 +14271,7 @@ var X2 = (_a) => {
|
|
|
14267
14271
|
var X_default = X2;
|
|
14268
14272
|
|
|
14269
14273
|
// src/components/ProfitAndLossDetailedCharts/DetailedChart.tsx
|
|
14270
|
-
import { useMemo as
|
|
14274
|
+
import { useMemo as useMemo25 } from "react";
|
|
14271
14275
|
|
|
14272
14276
|
// src/config/charts.ts
|
|
14273
14277
|
var DEFAULT_CHART_COLOR_TYPE = [
|
|
@@ -14558,7 +14562,7 @@ var DetailedChart = ({
|
|
|
14558
14562
|
isLoading,
|
|
14559
14563
|
showDatePicker = true
|
|
14560
14564
|
}) => {
|
|
14561
|
-
const chartData =
|
|
14565
|
+
const chartData = useMemo25(() => {
|
|
14562
14566
|
if (!filteredData) {
|
|
14563
14567
|
return [];
|
|
14564
14568
|
}
|
|
@@ -14928,7 +14932,7 @@ var ProfitAndLossDetailedCharts = ({
|
|
|
14928
14932
|
sidebarScope,
|
|
14929
14933
|
setSidebarScope,
|
|
14930
14934
|
setFilterTypes
|
|
14931
|
-
} =
|
|
14935
|
+
} = useContext23(ProfitAndLoss.Context);
|
|
14932
14936
|
const theScope = scope ? scope : sidebarScope;
|
|
14933
14937
|
const data = theScope === "revenue" ? filteredDataRevenue : filteredDataExpenses;
|
|
14934
14938
|
const total = theScope === "revenue" ? filteredTotalRevenue : filteredTotalExpenses;
|
|
@@ -15001,7 +15005,7 @@ var ProfitAndLossDetailedCharts = ({
|
|
|
15001
15005
|
};
|
|
15002
15006
|
|
|
15003
15007
|
// src/components/ProfitAndLossDownloadButton/ProfitAndLossDownloadButton.tsx
|
|
15004
|
-
import { useContext as
|
|
15008
|
+
import { useContext as useContext24, useState as useState43 } from "react";
|
|
15005
15009
|
import { jsx as jsx156 } from "react/jsx-runtime";
|
|
15006
15010
|
var ProfitAndLossDownloadButton = ({
|
|
15007
15011
|
stringOverrides,
|
|
@@ -15009,8 +15013,8 @@ var ProfitAndLossDownloadButton = ({
|
|
|
15009
15013
|
moneyFormat,
|
|
15010
15014
|
view
|
|
15011
15015
|
}) => {
|
|
15012
|
-
const { dateRange, tagFilter } =
|
|
15013
|
-
const { getProfitAndLossComparisonCsv } =
|
|
15016
|
+
const { dateRange, tagFilter } = useContext24(ProfitAndLoss.Context);
|
|
15017
|
+
const { getProfitAndLossComparisonCsv } = useContext24(
|
|
15014
15018
|
ProfitAndLoss.ComparisonContext
|
|
15015
15019
|
);
|
|
15016
15020
|
const { businessId } = useLayerContext();
|
|
@@ -15063,7 +15067,7 @@ var ProfitAndLossDownloadButton = ({
|
|
|
15063
15067
|
};
|
|
15064
15068
|
|
|
15065
15069
|
// src/components/ProfitAndLossHeader/ProfitAndLossHeader.tsx
|
|
15066
|
-
import { useMemo as
|
|
15070
|
+
import { useMemo as useMemo26 } from "react";
|
|
15067
15071
|
|
|
15068
15072
|
// src/components/SyncingBadge/SyncingBadge.tsx
|
|
15069
15073
|
import { jsx as jsx157 } from "react/jsx-runtime";
|
|
@@ -15088,7 +15092,7 @@ var ProfitAndLossHeader = ({
|
|
|
15088
15092
|
withDatePicker
|
|
15089
15093
|
}) => {
|
|
15090
15094
|
const { data: linkedAccounts } = useLinkedAccounts();
|
|
15091
|
-
const isSyncing =
|
|
15095
|
+
const isSyncing = useMemo26(
|
|
15092
15096
|
() => Boolean(linkedAccounts == null ? void 0 : linkedAccounts.some((item) => item.is_syncing)),
|
|
15093
15097
|
[linkedAccounts]
|
|
15094
15098
|
);
|
|
@@ -15102,7 +15106,7 @@ var ProfitAndLossHeader = ({
|
|
|
15102
15106
|
};
|
|
15103
15107
|
|
|
15104
15108
|
// src/components/ProfitAndLossReport/ProfitAndLossReport.tsx
|
|
15105
|
-
import { useContext as
|
|
15109
|
+
import { useContext as useContext25 } from "react";
|
|
15106
15110
|
|
|
15107
15111
|
// src/components/Header/Header.tsx
|
|
15108
15112
|
import {
|
|
@@ -15263,7 +15267,7 @@ var ProfitAndLossReport = ({
|
|
|
15263
15267
|
view
|
|
15264
15268
|
}) => {
|
|
15265
15269
|
var _a, _b;
|
|
15266
|
-
const { sidebarScope } =
|
|
15270
|
+
const { sidebarScope } = useContext25(ProfitAndLoss.Context);
|
|
15267
15271
|
return /* @__PURE__ */ jsx165(
|
|
15268
15272
|
View,
|
|
15269
15273
|
{
|
|
@@ -15332,10 +15336,10 @@ var ProfitAndLossReport = ({
|
|
|
15332
15336
|
};
|
|
15333
15337
|
|
|
15334
15338
|
// src/components/ProfitAndLossSummaries/ProfitAndLossSummaries.tsx
|
|
15335
|
-
import { useContext as
|
|
15339
|
+
import { useContext as useContext26, useMemo as useMemo30 } from "react";
|
|
15336
15340
|
|
|
15337
15341
|
// src/components/ProfitAndLossSummaries/internal/ProfitAndLossSummariesList.tsx
|
|
15338
|
-
import { useMemo as
|
|
15342
|
+
import { useMemo as useMemo27 } from "react";
|
|
15339
15343
|
import { jsx as jsx166 } from "react/jsx-runtime";
|
|
15340
15344
|
var LIST_ITEM_CLASS_NAME = "Layer__ProfitAndLossSummariesListItem";
|
|
15341
15345
|
function ProfitAndLossSummariesListItem({
|
|
@@ -15343,7 +15347,7 @@ function ProfitAndLossSummariesListItem({
|
|
|
15343
15347
|
isActive,
|
|
15344
15348
|
onClick
|
|
15345
15349
|
}) {
|
|
15346
|
-
const dataProperties =
|
|
15350
|
+
const dataProperties = useMemo27(
|
|
15347
15351
|
() => toDataProperties({ active: isActive, clickable: !!onClick }),
|
|
15348
15352
|
[isActive]
|
|
15349
15353
|
);
|
|
@@ -15354,7 +15358,7 @@ function ProfitAndLossSummariesList({
|
|
|
15354
15358
|
children,
|
|
15355
15359
|
itemCount
|
|
15356
15360
|
}) {
|
|
15357
|
-
const dataProperties =
|
|
15361
|
+
const dataProperties = useMemo27(
|
|
15358
15362
|
() => toDataProperties({ ["column-count"]: itemCount }),
|
|
15359
15363
|
[itemCount]
|
|
15360
15364
|
);
|
|
@@ -15447,10 +15451,10 @@ function ProfitAndLossSummariesMiniChart({
|
|
|
15447
15451
|
}
|
|
15448
15452
|
|
|
15449
15453
|
// src/components/ProfitAndLossSummaries/internal/ProfitAndLossSummariesSummary.tsx
|
|
15450
|
-
import { useMemo as
|
|
15454
|
+
import { useMemo as useMemo29 } from "react";
|
|
15451
15455
|
|
|
15452
15456
|
// src/components/ProfitAndLossSummaries/internal/ProfitAndLossSummariesHeading.tsx
|
|
15453
|
-
import { useMemo as
|
|
15457
|
+
import { useMemo as useMemo28 } from "react";
|
|
15454
15458
|
import { jsx as jsx168 } from "react/jsx-runtime";
|
|
15455
15459
|
var HEADING_CLASS_NAME2 = "Layer__ProfitAndLossSummariesSummaryHeading";
|
|
15456
15460
|
function ProfitAndLossSummariesHeading({
|
|
@@ -15458,7 +15462,7 @@ function ProfitAndLossSummariesHeading({
|
|
|
15458
15462
|
children
|
|
15459
15463
|
}) {
|
|
15460
15464
|
const { size = "sm" } = variants != null ? variants : {};
|
|
15461
|
-
const labelDataProperties =
|
|
15465
|
+
const labelDataProperties = useMemo28(() => toDataProperties({ size }), [size]);
|
|
15462
15466
|
return /* @__PURE__ */ jsx168("h3", __spreadProps(__spreadValues({ className: HEADING_CLASS_NAME2 }, labelDataProperties), { children }));
|
|
15463
15467
|
}
|
|
15464
15468
|
|
|
@@ -15476,8 +15480,8 @@ function ProfitAndLossSummariesSummary({
|
|
|
15476
15480
|
}) {
|
|
15477
15481
|
const { Chart } = slots != null ? slots : {};
|
|
15478
15482
|
const { size = "sm" } = variants != null ? variants : {};
|
|
15479
|
-
const dataProperties =
|
|
15480
|
-
const amountDataProperties =
|
|
15483
|
+
const dataProperties = useMemo29(() => toDataProperties({ size }), [size]);
|
|
15484
|
+
const amountDataProperties = useMemo29(
|
|
15481
15485
|
() => toDataProperties({
|
|
15482
15486
|
positive: amount >= 0,
|
|
15483
15487
|
negative: amount < 0,
|
|
@@ -15510,9 +15514,9 @@ function Internal_ProfitAndLossSummaries({
|
|
|
15510
15514
|
isLoading,
|
|
15511
15515
|
setSidebarScope,
|
|
15512
15516
|
sidebarScope
|
|
15513
|
-
} =
|
|
15517
|
+
} = useContext26(ProfitAndLoss.Context);
|
|
15514
15518
|
const dataItem = Array.isArray(storedData) ? storedData[storedData.length - 1] : storedData;
|
|
15515
|
-
const { revenueChartData, expensesChartData } =
|
|
15519
|
+
const { revenueChartData, expensesChartData } = useMemo30(
|
|
15516
15520
|
() => ({
|
|
15517
15521
|
revenueChartData: toMiniChartData({ scope: "revenue", data: dataItem }),
|
|
15518
15522
|
expensesChartData: toMiniChartData({ scope: "expenses", data: dataItem })
|
|
@@ -15590,10 +15594,10 @@ function Internal_ProfitAndLossSummaries({
|
|
|
15590
15594
|
var ProfitAndLossSummaries = (props) => Internal_ProfitAndLossSummaries(props);
|
|
15591
15595
|
|
|
15592
15596
|
// src/components/ProfitAndLossTable/ProfitAndLossTableWithProvider.tsx
|
|
15593
|
-
import { useContext as
|
|
15597
|
+
import { useContext as useContext30 } from "react";
|
|
15594
15598
|
|
|
15595
15599
|
// src/contexts/TableContext/TableContext.tsx
|
|
15596
|
-
import { createContext as
|
|
15600
|
+
import { createContext as createContext14, useState as useState45 } from "react";
|
|
15597
15601
|
import { jsx as jsx171 } from "react/jsx-runtime";
|
|
15598
15602
|
var defaultValue = {
|
|
15599
15603
|
expandedRows: [],
|
|
@@ -15605,7 +15609,7 @@ var defaultValue = {
|
|
|
15605
15609
|
setExpandedAllRows: () => {
|
|
15606
15610
|
}
|
|
15607
15611
|
};
|
|
15608
|
-
var TableContext =
|
|
15612
|
+
var TableContext = createContext14(defaultValue);
|
|
15609
15613
|
var TableProvider = ({ children }) => {
|
|
15610
15614
|
const [expandedRows, setExpandedRowsState] = useState45([]);
|
|
15611
15615
|
const [expandedAllRows, setExpandedAllRows] = useState45(false);
|
|
@@ -15634,10 +15638,10 @@ var TableProvider = ({ children }) => {
|
|
|
15634
15638
|
};
|
|
15635
15639
|
|
|
15636
15640
|
// src/components/ProfitAndLossTable/ProfitAndLossCompareTable.tsx
|
|
15637
|
-
import
|
|
15641
|
+
import { Fragment as Fragment22, useContext as useContext28, useEffect as useEffect32 } from "react";
|
|
15638
15642
|
|
|
15639
15643
|
// src/hooks/useTableExpandRow/useTableExpandRow.tsx
|
|
15640
|
-
import { useContext as
|
|
15644
|
+
import { useContext as useContext27 } from "react";
|
|
15641
15645
|
var useTableExpandRow = () => {
|
|
15642
15646
|
const {
|
|
15643
15647
|
expandedAllRows,
|
|
@@ -15645,7 +15649,7 @@ var useTableExpandRow = () => {
|
|
|
15645
15649
|
expandAllRows,
|
|
15646
15650
|
expandedRows,
|
|
15647
15651
|
setExpandedRows
|
|
15648
|
-
} =
|
|
15652
|
+
} = useContext27(TableContext);
|
|
15649
15653
|
const toggleAllRows = () => {
|
|
15650
15654
|
if (expandedAllRows) {
|
|
15651
15655
|
setIsOpen([]);
|
|
@@ -15906,18 +15910,18 @@ var Table = ({
|
|
|
15906
15910
|
|
|
15907
15911
|
// src/components/ProfitAndLossTable/ProfitAndLossCompareTable.tsx
|
|
15908
15912
|
import classNames62 from "classnames";
|
|
15909
|
-
import { Fragment as
|
|
15913
|
+
import { Fragment as Fragment23, jsx as jsx177, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
15910
15914
|
var ProfitAndLossCompareTable = ({
|
|
15911
15915
|
stringOverrides
|
|
15912
15916
|
}) => {
|
|
15913
|
-
const { dateRange } =
|
|
15917
|
+
const { dateRange } = useContext28(ProfitAndLoss.Context);
|
|
15914
15918
|
const {
|
|
15915
15919
|
data: comparisonData,
|
|
15916
15920
|
isLoading,
|
|
15917
15921
|
compareMonths,
|
|
15918
15922
|
compareOptions,
|
|
15919
15923
|
refetch
|
|
15920
|
-
} =
|
|
15924
|
+
} = useContext28(ProfitAndLoss.ComparisonContext);
|
|
15921
15925
|
const { isOpen, setIsOpen } = useTableExpandRow();
|
|
15922
15926
|
useEffect32(() => {
|
|
15923
15927
|
setIsOpen(["income", "cost_of_goods_sold", "expenses"]);
|
|
@@ -15951,7 +15955,7 @@ var ProfitAndLossCompareTable = ({
|
|
|
15951
15955
|
}
|
|
15952
15956
|
});
|
|
15953
15957
|
if (rowData.length === 0) {
|
|
15954
|
-
return /* @__PURE__ */ jsx177(
|
|
15958
|
+
return /* @__PURE__ */ jsx177(Fragment23, {});
|
|
15955
15959
|
}
|
|
15956
15960
|
const mergedLineItems = mergeComparisonLineItemsAtDepth(
|
|
15957
15961
|
rowData
|
|
@@ -15960,7 +15964,7 @@ var ProfitAndLossCompareTable = ({
|
|
|
15960
15964
|
}
|
|
15961
15965
|
const expandable = (lineItem == null ? void 0 : lineItem.line_items) && lineItem.line_items.length > 0 ? true : false;
|
|
15962
15966
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
15963
|
-
return /* @__PURE__ */ jsxs110(
|
|
15967
|
+
return /* @__PURE__ */ jsxs110(Fragment22, { children: [
|
|
15964
15968
|
/* @__PURE__ */ jsxs110(
|
|
15965
15969
|
TableRow,
|
|
15966
15970
|
{
|
|
@@ -15994,7 +15998,7 @@ var ProfitAndLossCompareTable = ({
|
|
|
15994
15998
|
return /* @__PURE__ */ jsxs110(Table, { borderCollapse: "collapse", bottomSpacing: false, children: [
|
|
15995
15999
|
/* @__PURE__ */ jsx177(TableHead, { children: compareOptions && compareOptions.length > 1 && /* @__PURE__ */ jsxs110(TableRow, { rowKey: "", children: [
|
|
15996
16000
|
/* @__PURE__ */ jsx177(TableCell, { isHeaderCell: true }),
|
|
15997
|
-
compareOptions.map((option, i) => /* @__PURE__ */ jsxs110(
|
|
16001
|
+
compareOptions.map((option, i) => /* @__PURE__ */ jsxs110(Fragment22, { children: [
|
|
15998
16002
|
/* @__PURE__ */ jsx177(TableCell, { primary: true, isHeaderCell: true, children: option.displayName }, option + "-" + i),
|
|
15999
16003
|
compareMonths && Array.from({ length: compareMonths - 1 }, (_, index) => /* @__PURE__ */ jsx177(TableCell, { isHeaderCell: true }, option + "-" + index))
|
|
16000
16004
|
] }, option + "-" + i))
|
|
@@ -16002,10 +16006,10 @@ var ProfitAndLossCompareTable = ({
|
|
|
16002
16006
|
/* @__PURE__ */ jsxs110(TableBody, { children: [
|
|
16003
16007
|
compareMonths && /* @__PURE__ */ jsxs110(TableRow, { rowKey: "", children: [
|
|
16004
16008
|
/* @__PURE__ */ jsx177(TableCell, { isHeaderCell: true }),
|
|
16005
|
-
compareOptions && compareOptions.length > 0 ? compareOptions.map((option, i) => /* @__PURE__ */ jsx177(
|
|
16009
|
+
compareOptions && compareOptions.length > 0 ? compareOptions.map((option, i) => /* @__PURE__ */ jsx177(Fragment22, { children: generatComparisonMonths(
|
|
16006
16010
|
dateRange.startDate,
|
|
16007
16011
|
compareMonths
|
|
16008
|
-
).map((month, index) => /* @__PURE__ */ jsx177(TableCell, { isHeaderCell: true, children: month }, option + "-" + index)) }, option + "-" + i)) : /* @__PURE__ */ jsx177(
|
|
16012
|
+
).map((month, index) => /* @__PURE__ */ jsx177(TableCell, { isHeaderCell: true, children: month }, option + "-" + index)) }, option + "-" + i)) : /* @__PURE__ */ jsx177(Fragment22, { children: generatComparisonMonths(
|
|
16009
16013
|
dateRange.startDate,
|
|
16010
16014
|
compareMonths
|
|
16011
16015
|
).map((month, index) => /* @__PURE__ */ jsx177(TableCell, { isHeaderCell: true, children: month }, "total-" + index + "-cell")) }, "total-1")
|
|
@@ -16036,7 +16040,7 @@ var ProfitAndLossCompareTable = ({
|
|
|
16036
16040
|
};
|
|
16037
16041
|
|
|
16038
16042
|
// src/components/ProfitAndLossTable/ProfitAndLossTableComponent.tsx
|
|
16039
|
-
import
|
|
16043
|
+
import { Fragment as Fragment24, useContext as useContext29, useEffect as useEffect33 } from "react";
|
|
16040
16044
|
|
|
16041
16045
|
// src/icons/PieChart.tsx
|
|
16042
16046
|
import { jsx as jsx178, jsxs as jsxs111 } from "react/jsx-runtime";
|
|
@@ -16135,7 +16139,7 @@ var ProfitAndLossTableComponent = ({
|
|
|
16135
16139
|
data: actualData,
|
|
16136
16140
|
isLoading,
|
|
16137
16141
|
setSidebarScope
|
|
16138
|
-
} =
|
|
16142
|
+
} = useContext29(ProfitAndLoss.Context);
|
|
16139
16143
|
const { isOpen, setIsOpen } = useTableExpandRow();
|
|
16140
16144
|
useEffect33(() => {
|
|
16141
16145
|
setIsOpen(["income", "cost_of_goods_sold", "expenses"]);
|
|
@@ -16157,7 +16161,7 @@ var ProfitAndLossTableComponent = ({
|
|
|
16157
16161
|
const renderLineItem = (lineItem, depth, rowKey, rowIndex, scope, setSidebarScope2, variant) => {
|
|
16158
16162
|
const expandable = !!lineItem.line_items && lineItem.line_items.length > 0;
|
|
16159
16163
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
16160
|
-
return /* @__PURE__ */ jsxs112(
|
|
16164
|
+
return /* @__PURE__ */ jsxs112(Fragment24, { children: [
|
|
16161
16165
|
/* @__PURE__ */ jsxs112(
|
|
16162
16166
|
TableRow,
|
|
16163
16167
|
{
|
|
@@ -16267,22 +16271,22 @@ var ProfitAndLossTableComponent = ({
|
|
|
16267
16271
|
void 0,
|
|
16268
16272
|
"summation"
|
|
16269
16273
|
),
|
|
16270
|
-
data.personal_expenses ?
|
|
16271
|
-
data.other_outflows ?
|
|
16274
|
+
data.personal_expenses ? renderLineItem(data.personal_expenses, 0, "personal_expenses", 7) : null,
|
|
16275
|
+
data.other_outflows ? renderLineItem(data.other_outflows, 0, "other_outflows", 6) : null
|
|
16272
16276
|
] }) });
|
|
16273
16277
|
};
|
|
16274
16278
|
|
|
16275
16279
|
// src/components/ProfitAndLossTable/ProfitAndLossTableWithProvider.tsx
|
|
16276
16280
|
import { jsx as jsx180 } from "react/jsx-runtime";
|
|
16277
16281
|
var ProfitAndLossTableWithProvider = (props) => {
|
|
16278
|
-
const { compareMode } =
|
|
16282
|
+
const { compareMode } = useContext30(ProfitAndLoss.ComparisonContext);
|
|
16279
16283
|
return /* @__PURE__ */ jsx180(TableProvider, { children: compareMode ? /* @__PURE__ */ jsx180("div", { className: "Layer__compare__table__wrapper", children: /* @__PURE__ */ jsx180(ProfitAndLossCompareTable, __spreadValues({}, props)) }) : /* @__PURE__ */ jsx180(ProfitAndLossTableComponent, __spreadValues({}, props)) });
|
|
16280
16284
|
};
|
|
16281
16285
|
|
|
16282
16286
|
// src/components/ProfitAndLoss/ProfitAndLoss.tsx
|
|
16283
16287
|
import { endOfMonth as endOfMonth10, startOfMonth as startOfMonth12 } from "date-fns";
|
|
16284
16288
|
import { jsx as jsx181 } from "react/jsx-runtime";
|
|
16285
|
-
var PNLContext =
|
|
16289
|
+
var PNLContext = createContext15({
|
|
16286
16290
|
data: void 0,
|
|
16287
16291
|
filteredDataRevenue: [],
|
|
16288
16292
|
filteredTotalRevenue: void 0,
|
|
@@ -16335,8 +16339,8 @@ ProfitAndLoss.Report = ProfitAndLossReport;
|
|
|
16335
16339
|
ProfitAndLoss.DownloadButton = ProfitAndLossDownloadButton;
|
|
16336
16340
|
|
|
16337
16341
|
// src/contexts/BalanceSheetContext/BalanceSheetContext.tsx
|
|
16338
|
-
import { createContext as
|
|
16339
|
-
var BalanceSheetContext =
|
|
16342
|
+
import { createContext as createContext16 } from "react";
|
|
16343
|
+
var BalanceSheetContext = createContext16({
|
|
16340
16344
|
data: void 0,
|
|
16341
16345
|
isLoading: false,
|
|
16342
16346
|
error: void 0,
|
|
@@ -16454,7 +16458,7 @@ var BalanceSheetExpandAllButton = ({
|
|
|
16454
16458
|
};
|
|
16455
16459
|
|
|
16456
16460
|
// src/components/BalanceSheetTable/BalanceSheetTable.tsx
|
|
16457
|
-
import
|
|
16461
|
+
import { Fragment as Fragment25, useEffect as useEffect35 } from "react";
|
|
16458
16462
|
import { jsx as jsx184, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
16459
16463
|
var BalanceSheetTable = ({
|
|
16460
16464
|
data,
|
|
@@ -16478,7 +16482,7 @@ var BalanceSheetTable = ({
|
|
|
16478
16482
|
if (expandable) {
|
|
16479
16483
|
allRowKeys.push(rowKey);
|
|
16480
16484
|
}
|
|
16481
|
-
return /* @__PURE__ */ jsxs113(
|
|
16485
|
+
return /* @__PURE__ */ jsxs113(Fragment25, { children: [
|
|
16482
16486
|
/* @__PURE__ */ jsxs113(
|
|
16483
16487
|
TableRow,
|
|
16484
16488
|
{
|
|
@@ -16529,7 +16533,7 @@ var BalanceSheetTable = ({
|
|
|
16529
16533
|
/* @__PURE__ */ jsx184(TableCell, { isHeaderCell: true, children: (stringOverrides == null ? void 0 : stringOverrides.typeColumnHeader) || "Type" }),
|
|
16530
16534
|
/* @__PURE__ */ jsx184(TableCell, { isHeaderCell: true, align: "right" /* RIGHT */, children: (stringOverrides == null ? void 0 : stringOverrides.totalColumnHeader) || "Total" })
|
|
16531
16535
|
] }) }),
|
|
16532
|
-
/* @__PURE__ */ jsx184(TableBody, { children: config.map((row, idx) => /* @__PURE__ */ jsx184(
|
|
16536
|
+
/* @__PURE__ */ jsx184(TableBody, { children: config.map((row, idx) => /* @__PURE__ */ jsx184(Fragment25, { children: data[row.lineItem] && renderLineItem(
|
|
16533
16537
|
data[row.lineItem],
|
|
16534
16538
|
0,
|
|
16535
16539
|
row.lineItem,
|
|
@@ -16569,7 +16573,7 @@ function useInvisibleDownload() {
|
|
|
16569
16573
|
const invisibleDownloadRef = useRef22(null);
|
|
16570
16574
|
const triggerInvisibleDownload = useCallback7((options) => {
|
|
16571
16575
|
var _a;
|
|
16572
|
-
(_a = invisibleDownloadRef.current) == null ? void 0 : _a.trigger(options);
|
|
16576
|
+
void ((_a = invisibleDownloadRef.current) == null ? void 0 : _a.trigger(options));
|
|
16573
16577
|
}, []);
|
|
16574
16578
|
return { invisibleDownloadRef, triggerInvisibleDownload };
|
|
16575
16579
|
}
|
|
@@ -16645,7 +16649,7 @@ function useBalanceSheetDownload({
|
|
|
16645
16649
|
}
|
|
16646
16650
|
|
|
16647
16651
|
// src/components/BalanceSheet/download/BalanceSheetDownloadButton.tsx
|
|
16648
|
-
import { Fragment as
|
|
16652
|
+
import { Fragment as Fragment26, jsx as jsx186, jsxs as jsxs114 } from "react/jsx-runtime";
|
|
16649
16653
|
function BalanceSheetDownloadButton({
|
|
16650
16654
|
effectiveDate,
|
|
16651
16655
|
iconOnly
|
|
@@ -16655,7 +16659,7 @@ function BalanceSheetDownloadButton({
|
|
|
16655
16659
|
effectiveDate,
|
|
16656
16660
|
onSuccess: ({ presignedUrl }) => triggerInvisibleDownload({ url: presignedUrl })
|
|
16657
16661
|
});
|
|
16658
|
-
return /* @__PURE__ */ jsxs114(
|
|
16662
|
+
return /* @__PURE__ */ jsxs114(Fragment26, { children: [
|
|
16659
16663
|
/* @__PURE__ */ jsx186(
|
|
16660
16664
|
DownloadButton,
|
|
16661
16665
|
{
|
|
@@ -16746,8 +16750,8 @@ var BalanceSheetView = ({
|
|
|
16746
16750
|
};
|
|
16747
16751
|
|
|
16748
16752
|
// src/contexts/StatementOfCashContext/StatementOfCashFlowContext.tsx
|
|
16749
|
-
import { createContext as
|
|
16750
|
-
var StatementOfCashFlowContext =
|
|
16753
|
+
import { createContext as createContext17 } from "react";
|
|
16754
|
+
var StatementOfCashFlowContext = createContext17({
|
|
16751
16755
|
data: void 0,
|
|
16752
16756
|
isLoading: false,
|
|
16753
16757
|
error: void 0,
|
|
@@ -16796,7 +16800,7 @@ var useStatementOfCashFlow = (startDate = /* @__PURE__ */ new Date(), endDate =
|
|
|
16796
16800
|
};
|
|
16797
16801
|
|
|
16798
16802
|
// src/components/StatementOfCashFlowTable/StatementOfCashFlowTable.tsx
|
|
16799
|
-
import
|
|
16803
|
+
import { Fragment as Fragment27 } from "react";
|
|
16800
16804
|
import { jsx as jsx188, jsxs as jsxs116 } from "react/jsx-runtime";
|
|
16801
16805
|
var StatementOfCashFlowTable = ({
|
|
16802
16806
|
data,
|
|
@@ -16807,7 +16811,7 @@ var StatementOfCashFlowTable = ({
|
|
|
16807
16811
|
const renderLineItem = (lineItem, depth = 0, rowKey, rowIndex) => {
|
|
16808
16812
|
const expandable = !!lineItem.line_items && lineItem.line_items.length > 0;
|
|
16809
16813
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
16810
|
-
return /* @__PURE__ */ jsxs116(
|
|
16814
|
+
return /* @__PURE__ */ jsxs116(Fragment27, { children: [
|
|
16811
16815
|
/* @__PURE__ */ jsxs116(
|
|
16812
16816
|
TableRow,
|
|
16813
16817
|
{
|
|
@@ -16859,7 +16863,7 @@ var StatementOfCashFlowTable = ({
|
|
|
16859
16863
|
] }) }),
|
|
16860
16864
|
/* @__PURE__ */ jsx188(TableBody, { children: config.map((row, idx) => {
|
|
16861
16865
|
if (row.type === "line_item") {
|
|
16862
|
-
return /* @__PURE__ */ jsx188(
|
|
16866
|
+
return /* @__PURE__ */ jsx188(Fragment27, { children: data[row.lineItem] && renderLineItem(
|
|
16863
16867
|
data[row.lineItem],
|
|
16864
16868
|
0,
|
|
16865
16869
|
row.lineItem ? row.lineItem : "",
|
|
@@ -16978,7 +16982,7 @@ function useCashflowStatementDownload({
|
|
|
16978
16982
|
}
|
|
16979
16983
|
|
|
16980
16984
|
// src/components/StatementOfCashFlow/download/CashflowStatementDownloadButton.tsx
|
|
16981
|
-
import { Fragment as
|
|
16985
|
+
import { Fragment as Fragment28, jsx as jsx189, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
16982
16986
|
function CashflowStatementDownloadButton({
|
|
16983
16987
|
startDate,
|
|
16984
16988
|
endDate,
|
|
@@ -16990,7 +16994,7 @@ function CashflowStatementDownloadButton({
|
|
|
16990
16994
|
endDate,
|
|
16991
16995
|
onSuccess: ({ presignedUrl }) => triggerInvisibleDownload({ url: presignedUrl })
|
|
16992
16996
|
});
|
|
16993
|
-
return /* @__PURE__ */ jsxs117(
|
|
16997
|
+
return /* @__PURE__ */ jsxs117(Fragment28, { children: [
|
|
16994
16998
|
/* @__PURE__ */ jsx189(
|
|
16995
16999
|
DownloadButton,
|
|
16996
17000
|
{
|
|
@@ -17106,12 +17110,12 @@ var StatementOfCashFlowView = ({
|
|
|
17106
17110
|
};
|
|
17107
17111
|
|
|
17108
17112
|
// src/components/ChartOfAccounts/ChartOfAccounts.tsx
|
|
17109
|
-
import { useContext as
|
|
17113
|
+
import { useContext as useContext38 } from "react";
|
|
17110
17114
|
|
|
17111
17115
|
// src/contexts/ChartOfAccountsContext/ChartOfAccountsContext.tsx
|
|
17112
|
-
import { createContext as
|
|
17116
|
+
import { createContext as createContext18 } from "react";
|
|
17113
17117
|
import { endOfMonth as endOfMonth11, startOfMonth as startOfMonth13 } from "date-fns";
|
|
17114
|
-
var ChartOfAccountsContext =
|
|
17118
|
+
var ChartOfAccountsContext = createContext18(
|
|
17115
17119
|
{
|
|
17116
17120
|
data: void 0,
|
|
17117
17121
|
isLoading: false,
|
|
@@ -17142,8 +17146,8 @@ var ChartOfAccountsContext = createContext17(
|
|
|
17142
17146
|
);
|
|
17143
17147
|
|
|
17144
17148
|
// src/contexts/LedgerAccountsContext/LedgerAccountsContext.tsx
|
|
17145
|
-
import { createContext as
|
|
17146
|
-
var LedgerAccountsContext =
|
|
17149
|
+
import { createContext as createContext19 } from "react";
|
|
17150
|
+
var LedgerAccountsContext = createContext19({
|
|
17147
17151
|
data: void 0,
|
|
17148
17152
|
entryData: void 0,
|
|
17149
17153
|
isLoading: false,
|
|
@@ -17749,7 +17753,7 @@ var useLedgerAccounts = (showReversalEntries = false) => {
|
|
|
17749
17753
|
};
|
|
17750
17754
|
|
|
17751
17755
|
// src/components/ChartOfAccountsTable/ChartOfAccountsTableWithPanel.tsx
|
|
17752
|
-
import { useContext as
|
|
17756
|
+
import { useContext as useContext34, useState as useState50 } from "react";
|
|
17753
17757
|
|
|
17754
17758
|
// src/icons/Plus.tsx
|
|
17755
17759
|
import { jsx as jsx192, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
@@ -17790,11 +17794,11 @@ var Plus = (_a) => {
|
|
|
17790
17794
|
var Plus_default = Plus;
|
|
17791
17795
|
|
|
17792
17796
|
// src/components/ChartOfAccountsDatePicker/ChartOfAccountsDatePicker.tsx
|
|
17793
|
-
import { useContext as
|
|
17797
|
+
import { useContext as useContext31 } from "react";
|
|
17794
17798
|
import { endOfMonth as endOfMonth13, startOfMonth as startOfMonth15 } from "date-fns";
|
|
17795
17799
|
import { jsx as jsx193 } from "react/jsx-runtime";
|
|
17796
17800
|
var ChartOfAccountsDatePicker = () => {
|
|
17797
|
-
const { changeDateRange, dateRange } =
|
|
17801
|
+
const { changeDateRange, dateRange } = useContext31(ChartOfAccountsContext);
|
|
17798
17802
|
return /* @__PURE__ */ jsx193(
|
|
17799
17803
|
DatePicker,
|
|
17800
17804
|
{
|
|
@@ -17813,13 +17817,13 @@ var ChartOfAccountsDatePicker = () => {
|
|
|
17813
17817
|
};
|
|
17814
17818
|
|
|
17815
17819
|
// src/components/ChartOfAccountsForm/ChartOfAccountsForm.tsx
|
|
17816
|
-
import { useContext as
|
|
17820
|
+
import { useContext as useContext32, useMemo as useMemo32 } from "react";
|
|
17817
17821
|
|
|
17818
17822
|
// src/components/ChartOfAccountsForm/useParentOptions.ts
|
|
17819
|
-
import { useMemo as
|
|
17823
|
+
import { useMemo as useMemo31 } from "react";
|
|
17820
17824
|
var useParentOptions = (data) => {
|
|
17821
17825
|
var _a;
|
|
17822
|
-
return
|
|
17826
|
+
return useMemo31(
|
|
17823
17827
|
() => flattenAccounts((data == null ? void 0 : data.accounts) || []).sort((a, b) => (a == null ? void 0 : a.name) && (b == null ? void 0 : b.name) ? a.name.localeCompare(b.name) : 0).map((x) => {
|
|
17824
17828
|
return {
|
|
17825
17829
|
label: x.name,
|
|
@@ -17844,9 +17848,9 @@ var ChartOfAccountsForm = ({
|
|
|
17844
17848
|
submitForm,
|
|
17845
17849
|
sendingForm,
|
|
17846
17850
|
apiError
|
|
17847
|
-
} =
|
|
17851
|
+
} = useContext32(ChartOfAccountsContext);
|
|
17848
17852
|
const parentOptions = useParentOptions(data);
|
|
17849
|
-
const entry =
|
|
17853
|
+
const entry = useMemo32(() => {
|
|
17850
17854
|
if ((form == null ? void 0 : form.action) === "edit" && form.accountId) {
|
|
17851
17855
|
return flattenAccounts((data == null ? void 0 : data.accounts) || []).find(
|
|
17852
17856
|
(x) => x.id === form.accountId
|
|
@@ -18059,7 +18063,7 @@ var ChartOfAccountsSidebar = ({
|
|
|
18059
18063
|
};
|
|
18060
18064
|
|
|
18061
18065
|
// src/components/ChartOfAccountsTable/ChartOfAccountsTable.tsx
|
|
18062
|
-
import
|
|
18066
|
+
import { Fragment as Fragment29, useContext as useContext33, useEffect as useEffect39, useState as useState49 } from "react";
|
|
18063
18067
|
|
|
18064
18068
|
// src/icons/Edit2.tsx
|
|
18065
18069
|
import { jsx as jsx196 } from "react/jsx-runtime";
|
|
@@ -18119,8 +18123,8 @@ var ChartOfAccountsTableContent = ({
|
|
|
18119
18123
|
expandAll,
|
|
18120
18124
|
templateAccountsEditable
|
|
18121
18125
|
}) => {
|
|
18122
|
-
const { setAccountId } =
|
|
18123
|
-
const { editAccount } =
|
|
18126
|
+
const { setAccountId } = useContext33(LedgerAccountsContext);
|
|
18127
|
+
const { editAccount } = useContext33(ChartOfAccountsContext);
|
|
18124
18128
|
const { isOpen, setIsOpen } = useTableExpandRow();
|
|
18125
18129
|
const [accountsRowKeys, setAccountsRowKeys] = useState49([]);
|
|
18126
18130
|
useEffect39(() => {
|
|
@@ -18149,7 +18153,7 @@ var ChartOfAccountsTableContent = ({
|
|
|
18149
18153
|
var _a, _b;
|
|
18150
18154
|
const expandable = !!account.sub_accounts && account.sub_accounts.length > 0;
|
|
18151
18155
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
18152
|
-
return /* @__PURE__ */ jsxs121(
|
|
18156
|
+
return /* @__PURE__ */ jsxs121(Fragment29, { children: [
|
|
18153
18157
|
/* @__PURE__ */ jsxs121(
|
|
18154
18158
|
TableRow,
|
|
18155
18159
|
{
|
|
@@ -18281,7 +18285,7 @@ function useAccountBalancesDownload({
|
|
|
18281
18285
|
}
|
|
18282
18286
|
|
|
18283
18287
|
// src/components/ChartOfAccounts/download/AccountBalancesDownloadButton.tsx
|
|
18284
|
-
import { Fragment as
|
|
18288
|
+
import { Fragment as Fragment30, jsx as jsx198, jsxs as jsxs122 } from "react/jsx-runtime";
|
|
18285
18289
|
function AccountBalancesDownloadButton({
|
|
18286
18290
|
startCutoff,
|
|
18287
18291
|
endCutoff,
|
|
@@ -18293,7 +18297,7 @@ function AccountBalancesDownloadButton({
|
|
|
18293
18297
|
endCutoff,
|
|
18294
18298
|
onSuccess: ({ presignedUrl }) => triggerInvisibleDownload({ url: presignedUrl })
|
|
18295
18299
|
});
|
|
18296
|
-
return /* @__PURE__ */ jsxs122(
|
|
18300
|
+
return /* @__PURE__ */ jsxs122(Fragment30, { children: [
|
|
18297
18301
|
/* @__PURE__ */ jsx198(
|
|
18298
18302
|
DownloadButton,
|
|
18299
18303
|
{
|
|
@@ -18325,7 +18329,7 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
18325
18329
|
templateAccountsEditable
|
|
18326
18330
|
}) => {
|
|
18327
18331
|
var _a;
|
|
18328
|
-
const { data, isLoading, addAccount, error, isValidating, refetch, form } =
|
|
18332
|
+
const { data, isLoading, addAccount, error, isValidating, refetch, form } = useContext34(ChartOfAccountsContext);
|
|
18329
18333
|
const [expandAll, setExpandAll] = useState50();
|
|
18330
18334
|
const cumulativeIndex = 0;
|
|
18331
18335
|
const accountsLength = (_a = data == null ? void 0 : data.accounts.length) != null ? _a : 0;
|
|
@@ -18432,14 +18436,14 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
18432
18436
|
|
|
18433
18437
|
// src/components/LedgerAccount/LedgerAccountIndex.tsx
|
|
18434
18438
|
import {
|
|
18435
|
-
useContext as
|
|
18439
|
+
useContext as useContext37,
|
|
18436
18440
|
useEffect as useEffect41,
|
|
18437
|
-
useMemo as
|
|
18441
|
+
useMemo as useMemo34,
|
|
18438
18442
|
useState as useState52
|
|
18439
18443
|
} from "react";
|
|
18440
18444
|
|
|
18441
18445
|
// src/components/LedgerAccountEntryDetails/LedgerAccountEntryDetails.tsx
|
|
18442
|
-
import { useContext as
|
|
18446
|
+
import { useContext as useContext35, useMemo as useMemo33 } from "react";
|
|
18443
18447
|
|
|
18444
18448
|
// src/utils/journal.ts
|
|
18445
18449
|
var getAccountIdentifierPayload = (journalLineItem) => {
|
|
@@ -18548,7 +18552,7 @@ var DetailsListItem = ({
|
|
|
18548
18552
|
};
|
|
18549
18553
|
|
|
18550
18554
|
// src/components/LedgerAccountEntryDetails/LedgerAccountEntryDetails.tsx
|
|
18551
|
-
import { Fragment as
|
|
18555
|
+
import { Fragment as Fragment31, jsx as jsx204, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
18552
18556
|
var SourceDetailView = ({
|
|
18553
18557
|
source,
|
|
18554
18558
|
stringOverrides
|
|
@@ -18556,7 +18560,7 @@ var SourceDetailView = ({
|
|
|
18556
18560
|
switch (source.type) {
|
|
18557
18561
|
case "Transaction_Ledger_Entry_Source": {
|
|
18558
18562
|
const transactionSource = source;
|
|
18559
|
-
return /* @__PURE__ */ jsxs127(
|
|
18563
|
+
return /* @__PURE__ */ jsxs127(Fragment31, { children: [
|
|
18560
18564
|
/* @__PURE__ */ jsx204(
|
|
18561
18565
|
DetailsListItem,
|
|
18562
18566
|
{
|
|
@@ -18584,7 +18588,7 @@ var SourceDetailView = ({
|
|
|
18584
18588
|
}
|
|
18585
18589
|
case "Invoice_Ledger_Entry_Source": {
|
|
18586
18590
|
const invoiceSource = source;
|
|
18587
|
-
return /* @__PURE__ */ jsxs127(
|
|
18591
|
+
return /* @__PURE__ */ jsxs127(Fragment31, { children: [
|
|
18588
18592
|
/* @__PURE__ */ jsx204(
|
|
18589
18593
|
DetailsListItem,
|
|
18590
18594
|
{
|
|
@@ -18605,7 +18609,7 @@ var SourceDetailView = ({
|
|
|
18605
18609
|
}
|
|
18606
18610
|
case "Manual_Ledger_Entry_Source": {
|
|
18607
18611
|
const manualSource = source;
|
|
18608
|
-
return /* @__PURE__ */ jsxs127(
|
|
18612
|
+
return /* @__PURE__ */ jsxs127(Fragment31, { children: [
|
|
18609
18613
|
/* @__PURE__ */ jsx204(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.memoLabel) || "Memo", children: manualSource.memo }),
|
|
18610
18614
|
/* @__PURE__ */ jsx204(
|
|
18611
18615
|
DetailsListItem,
|
|
@@ -18618,7 +18622,7 @@ var SourceDetailView = ({
|
|
|
18618
18622
|
}
|
|
18619
18623
|
case "Invoice_Payment_Ledger_Entry_Source": {
|
|
18620
18624
|
const invoicePaymentSource = source;
|
|
18621
|
-
return /* @__PURE__ */ jsxs127(
|
|
18625
|
+
return /* @__PURE__ */ jsxs127(Fragment31, { children: [
|
|
18622
18626
|
/* @__PURE__ */ jsx204(
|
|
18623
18627
|
DetailsListItem,
|
|
18624
18628
|
{
|
|
@@ -18631,7 +18635,7 @@ var SourceDetailView = ({
|
|
|
18631
18635
|
}
|
|
18632
18636
|
case "Refund_Ledger_Entry_Source": {
|
|
18633
18637
|
const refundSource = source;
|
|
18634
|
-
return /* @__PURE__ */ jsxs127(
|
|
18638
|
+
return /* @__PURE__ */ jsxs127(Fragment31, { children: [
|
|
18635
18639
|
/* @__PURE__ */ jsx204(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount", children: `$${centsToDollars(refundSource.refunded_to_customer_amount)}` }),
|
|
18636
18640
|
/* @__PURE__ */ jsx204(
|
|
18637
18641
|
DetailsListItem,
|
|
@@ -18644,7 +18648,7 @@ var SourceDetailView = ({
|
|
|
18644
18648
|
}
|
|
18645
18649
|
case "Refund_Payment_Ledger_Entry_Source": {
|
|
18646
18650
|
const refundSource = source;
|
|
18647
|
-
return /* @__PURE__ */ jsxs127(
|
|
18651
|
+
return /* @__PURE__ */ jsxs127(Fragment31, { children: [
|
|
18648
18652
|
/* @__PURE__ */ jsx204(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount", children: `$${centsToDollars(refundSource.refunded_to_customer_amount)}` }),
|
|
18649
18653
|
/* @__PURE__ */ jsx204(
|
|
18650
18654
|
DetailsListItem,
|
|
@@ -18657,7 +18661,7 @@ var SourceDetailView = ({
|
|
|
18657
18661
|
}
|
|
18658
18662
|
case "Opening_Balance_Ledger_Entry_Source": {
|
|
18659
18663
|
const openingBalanceSource = source;
|
|
18660
|
-
return /* @__PURE__ */ jsx204(
|
|
18664
|
+
return /* @__PURE__ */ jsx204(Fragment31, { children: /* @__PURE__ */ jsx204(
|
|
18661
18665
|
DetailsListItem,
|
|
18662
18666
|
{
|
|
18663
18667
|
label: (stringOverrides == null ? void 0 : stringOverrides.accountNameLabel) || "Account name",
|
|
@@ -18667,7 +18671,7 @@ var SourceDetailView = ({
|
|
|
18667
18671
|
}
|
|
18668
18672
|
case "Payout_Ledger_Entry_Source": {
|
|
18669
18673
|
const payoutSource = source;
|
|
18670
|
-
return /* @__PURE__ */ jsxs127(
|
|
18674
|
+
return /* @__PURE__ */ jsxs127(Fragment31, { children: [
|
|
18671
18675
|
/* @__PURE__ */ jsx204(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount", children: `$${centsToDollars(payoutSource.paid_out_amount)}` }),
|
|
18672
18676
|
/* @__PURE__ */ jsx204(
|
|
18673
18677
|
DetailsListItem,
|
|
@@ -18686,8 +18690,8 @@ var LedgerAccountEntryDetails = ({
|
|
|
18686
18690
|
stringOverrides
|
|
18687
18691
|
}) => {
|
|
18688
18692
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
18689
|
-
const { entryData, isLoadingEntry, closeSelectedEntry, errorEntry } =
|
|
18690
|
-
const { totalDebit, totalCredit } =
|
|
18693
|
+
const { entryData, isLoadingEntry, closeSelectedEntry, errorEntry } = useContext35(LedgerAccountsContext);
|
|
18694
|
+
const { totalDebit, totalCredit } = useMemo33(() => {
|
|
18691
18695
|
var _a2;
|
|
18692
18696
|
let totalDebit2 = 0;
|
|
18693
18697
|
let totalCredit2 = 0;
|
|
@@ -18833,7 +18837,7 @@ var LedgerAccountEntryDetails = ({
|
|
|
18833
18837
|
};
|
|
18834
18838
|
|
|
18835
18839
|
// src/components/LedgerAccount/LedgerAccountRow.tsx
|
|
18836
|
-
import { useContext as
|
|
18840
|
+
import { useContext as useContext36, useEffect as useEffect40, useState as useState51 } from "react";
|
|
18837
18841
|
import classNames66 from "classnames";
|
|
18838
18842
|
import { parseISO as parseISO13, format as formatTime11 } from "date-fns";
|
|
18839
18843
|
import { jsx as jsx205, jsxs as jsxs128 } from "react/jsx-runtime";
|
|
@@ -18844,7 +18848,7 @@ var LedgerAccountRow = ({
|
|
|
18844
18848
|
view
|
|
18845
18849
|
}) => {
|
|
18846
18850
|
var _a, _b, _c, _d, _e, _f;
|
|
18847
|
-
const { selectedEntryId, setSelectedEntryId, closeSelectedEntry } =
|
|
18851
|
+
const { selectedEntryId, setSelectedEntryId, closeSelectedEntry } = useContext36(LedgerAccountsContext);
|
|
18848
18852
|
const [showComponent, setShowComponent] = useState51(false);
|
|
18849
18853
|
useEffect40(() => {
|
|
18850
18854
|
if (initialLoad) {
|
|
@@ -18982,7 +18986,7 @@ var LedgerAccountRow = ({
|
|
|
18982
18986
|
|
|
18983
18987
|
// src/components/LedgerAccount/LedgerAccountIndex.tsx
|
|
18984
18988
|
import classNames67 from "classnames";
|
|
18985
|
-
import { Fragment as
|
|
18989
|
+
import { Fragment as Fragment32, jsx as jsx206, jsxs as jsxs129 } from "react/jsx-runtime";
|
|
18986
18990
|
var LedgerAccount = ({
|
|
18987
18991
|
containerRef,
|
|
18988
18992
|
pageSize = 15,
|
|
@@ -18992,7 +18996,7 @@ var LedgerAccount = ({
|
|
|
18992
18996
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
18993
18997
|
const [currentPage, setCurrentPage] = useState52(1);
|
|
18994
18998
|
const [initialLoad, setInitialLoad] = useState52(true);
|
|
18995
|
-
const { data: accountData } =
|
|
18999
|
+
const { data: accountData } = useContext37(ChartOfAccountsContext);
|
|
18996
19000
|
const {
|
|
18997
19001
|
data: rawData,
|
|
18998
19002
|
error,
|
|
@@ -19003,7 +19007,7 @@ var LedgerAccount = ({
|
|
|
19003
19007
|
selectedEntryId,
|
|
19004
19008
|
closeSelectedEntry,
|
|
19005
19009
|
refetch
|
|
19006
|
-
} =
|
|
19010
|
+
} = useContext37(LedgerAccountsContext);
|
|
19007
19011
|
useEffect41(() => {
|
|
19008
19012
|
if (!isLoading) {
|
|
19009
19013
|
const timeoutLoad = setTimeout(() => {
|
|
@@ -19016,12 +19020,12 @@ var LedgerAccount = ({
|
|
|
19016
19020
|
"Layer__ledger-account__index",
|
|
19017
19021
|
accountId && "open"
|
|
19018
19022
|
);
|
|
19019
|
-
const account =
|
|
19023
|
+
const account = useMemo34(() => {
|
|
19020
19024
|
return flattenAccounts((accountData == null ? void 0 : accountData.accounts) || []).find(
|
|
19021
19025
|
(x) => x.id === accountId
|
|
19022
19026
|
);
|
|
19023
19027
|
}, [accountId]);
|
|
19024
|
-
const data =
|
|
19028
|
+
const data = useMemo34(() => {
|
|
19025
19029
|
var _a2;
|
|
19026
19030
|
const firstPageIndex = (currentPage - 1) * pageSize;
|
|
19027
19031
|
const lastPageIndex = firstPageIndex + pageSize;
|
|
@@ -19081,12 +19085,12 @@ var LedgerAccount = ({
|
|
|
19081
19085
|
/* @__PURE__ */ jsxs129("table", { className: "Layer__table Layer__table--hover-effect Layer__ledger-account-table", children: [
|
|
19082
19086
|
/* @__PURE__ */ jsx206("thead", { children: /* @__PURE__ */ jsxs129("tr", { children: [
|
|
19083
19087
|
view !== "desktop" && /* @__PURE__ */ jsx206("th", {}),
|
|
19084
|
-
view === "desktop" && /* @__PURE__ */ jsxs129(
|
|
19088
|
+
view === "desktop" && /* @__PURE__ */ jsxs129(Fragment32, { children: [
|
|
19085
19089
|
/* @__PURE__ */ jsx206("th", { className: "Layer__table-header", children: ((_b = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _b.dateColumnHeader) || "Date" }),
|
|
19086
19090
|
/* @__PURE__ */ jsx206("th", { className: "Layer__table-header", children: ((_c = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _c.journalIdColumnHeader) || "Journal id #" }),
|
|
19087
19091
|
/* @__PURE__ */ jsx206("th", { className: "Layer__table-header", children: ((_d = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _d.sourceColumnHeader) || "Source" })
|
|
19088
19092
|
] }),
|
|
19089
|
-
view !== "mobile" && /* @__PURE__ */ jsxs129(
|
|
19093
|
+
view !== "mobile" && /* @__PURE__ */ jsxs129(Fragment32, { children: [
|
|
19090
19094
|
/* @__PURE__ */ jsx206("th", { className: "Layer__table-header Layer__table-cell--amount", children: ((_e = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _e.debitColumnHeader) || "Debit" }),
|
|
19091
19095
|
/* @__PURE__ */ jsx206("th", { className: "Layer__table-header Layer__table-cell--amount", children: ((_f = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _f.creditColumnHeader) || "Credit" }),
|
|
19092
19096
|
/* @__PURE__ */ jsx206("th", { className: "Layer__table-header Layer__table-cell--amount", children: ((_g = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _g.runningBalanceColumnHeader) || "Running balance" })
|
|
@@ -19159,7 +19163,7 @@ var ChartOfAccountsContent = ({
|
|
|
19159
19163
|
templateAccountsEditable,
|
|
19160
19164
|
showAddAccountButton
|
|
19161
19165
|
}) => {
|
|
19162
|
-
const { accountId } =
|
|
19166
|
+
const { accountId } = useContext38(LedgerAccountsContext);
|
|
19163
19167
|
const { view, containerRef } = useElementViewSize();
|
|
19164
19168
|
return /* @__PURE__ */ jsx207(Container, { name: "chart-of-accounts", ref: containerRef, asWidget, children: accountId ? /* @__PURE__ */ jsx207(
|
|
19165
19169
|
LedgerAccount,
|
|
@@ -19184,8 +19188,8 @@ var ChartOfAccountsContent = ({
|
|
|
19184
19188
|
};
|
|
19185
19189
|
|
|
19186
19190
|
// src/contexts/JournalContext/JournalContext.tsx
|
|
19187
|
-
import { createContext as
|
|
19188
|
-
var JournalContext =
|
|
19191
|
+
import { createContext as createContext20 } from "react";
|
|
19192
|
+
var JournalContext = createContext20({
|
|
19189
19193
|
data: void 0,
|
|
19190
19194
|
isLoading: false,
|
|
19191
19195
|
error: void 0,
|
|
@@ -19488,13 +19492,13 @@ var useJournal = () => {
|
|
|
19488
19492
|
};
|
|
19489
19493
|
|
|
19490
19494
|
// src/components/JournalTable/JournalTableWithPanel.tsx
|
|
19491
|
-
import { useContext as
|
|
19495
|
+
import { useContext as useContext44, useMemo as useMemo37, useState as useState55 } from "react";
|
|
19492
19496
|
|
|
19493
19497
|
// src/components/JournalSidebar/JournalSidebar.tsx
|
|
19494
|
-
import { useContext as
|
|
19498
|
+
import { useContext as useContext42 } from "react";
|
|
19495
19499
|
|
|
19496
19500
|
// src/components/JournalEntryDetails/JournalEntryDetails.tsx
|
|
19497
|
-
import { useContext as
|
|
19501
|
+
import { useContext as useContext39, useMemo as useMemo35, useState as useState54 } from "react";
|
|
19498
19502
|
import { jsx as jsx208, jsxs as jsxs130 } from "react/jsx-runtime";
|
|
19499
19503
|
var JournalEntryDetails = () => {
|
|
19500
19504
|
var _a, _b, _c, _d;
|
|
@@ -19506,16 +19510,16 @@ var JournalEntryDetails = () => {
|
|
|
19506
19510
|
selectedEntryId,
|
|
19507
19511
|
reverseEntry,
|
|
19508
19512
|
refetch
|
|
19509
|
-
} =
|
|
19513
|
+
} = useContext39(JournalContext);
|
|
19510
19514
|
const [reverseEntryProcessing, setReverseEntryProcessing] = useState54(false);
|
|
19511
19515
|
const [reverseEntryError, setReverseEntryError] = useState54();
|
|
19512
|
-
const entry =
|
|
19516
|
+
const entry = useMemo35(() => {
|
|
19513
19517
|
if (selectedEntryId && data) {
|
|
19514
19518
|
return data.find((x) => x.id === selectedEntryId);
|
|
19515
19519
|
}
|
|
19516
19520
|
return;
|
|
19517
19521
|
}, [data, selectedEntryId]);
|
|
19518
|
-
const sortedLineItems =
|
|
19522
|
+
const sortedLineItems = useMemo35(
|
|
19519
19523
|
() => {
|
|
19520
19524
|
var _a2;
|
|
19521
19525
|
return (_a2 = entry == null ? void 0 : entry.line_items) == null ? void 0 : _a2.sort(
|
|
@@ -19693,11 +19697,60 @@ var JournalEntryDetails = () => {
|
|
|
19693
19697
|
};
|
|
19694
19698
|
|
|
19695
19699
|
// src/components/JournalForm/JournalForm.tsx
|
|
19696
|
-
import { useContext as
|
|
19700
|
+
import { useContext as useContext41 } from "react";
|
|
19697
19701
|
|
|
19698
19702
|
// src/components/JournalForm/JournalFormEntryLines.tsx
|
|
19699
|
-
import { useContext as
|
|
19700
|
-
|
|
19703
|
+
import { useContext as useContext40, useMemo as useMemo36 } from "react";
|
|
19704
|
+
|
|
19705
|
+
// src/hooks/categories/useAllCategories.ts
|
|
19706
|
+
import useSWR11 from "swr";
|
|
19707
|
+
function buildKey7({
|
|
19708
|
+
access_token: accessToken,
|
|
19709
|
+
apiUrl,
|
|
19710
|
+
businessId
|
|
19711
|
+
}) {
|
|
19712
|
+
if (accessToken && apiUrl) {
|
|
19713
|
+
return {
|
|
19714
|
+
accessToken,
|
|
19715
|
+
apiUrl,
|
|
19716
|
+
businessId,
|
|
19717
|
+
mode: "ALL",
|
|
19718
|
+
tags: ["#categories"]
|
|
19719
|
+
};
|
|
19720
|
+
}
|
|
19721
|
+
}
|
|
19722
|
+
function useAllCategories() {
|
|
19723
|
+
const { data: auth } = useAuth();
|
|
19724
|
+
const { businessId } = useLayerContext();
|
|
19725
|
+
return useSWR11(
|
|
19726
|
+
() => buildKey7(__spreadProps(__spreadValues({}, auth), {
|
|
19727
|
+
businessId
|
|
19728
|
+
})),
|
|
19729
|
+
({ accessToken, apiUrl, businessId: businessId2, mode }) => getCategories(
|
|
19730
|
+
apiUrl,
|
|
19731
|
+
accessToken,
|
|
19732
|
+
{
|
|
19733
|
+
params: {
|
|
19734
|
+
businessId: businessId2,
|
|
19735
|
+
mode
|
|
19736
|
+
}
|
|
19737
|
+
}
|
|
19738
|
+
)().then(({ data }) => data.categories)
|
|
19739
|
+
);
|
|
19740
|
+
}
|
|
19741
|
+
|
|
19742
|
+
// src/components/JournalForm/JournalFormEntryLines.tsx
|
|
19743
|
+
import { Fragment as Fragment33, jsx as jsx209, jsxs as jsxs131 } from "react/jsx-runtime";
|
|
19744
|
+
function recursiveFlattenCategories(accounts) {
|
|
19745
|
+
const flattenedResult = accounts.flatMap((a) => {
|
|
19746
|
+
var _a;
|
|
19747
|
+
return [
|
|
19748
|
+
a,
|
|
19749
|
+
recursiveFlattenCategories((_a = a.subCategories) != null ? _a : [])
|
|
19750
|
+
];
|
|
19751
|
+
}).flat();
|
|
19752
|
+
return flattenedResult;
|
|
19753
|
+
}
|
|
19701
19754
|
var JournalFormEntryLines = ({
|
|
19702
19755
|
entrylineItems,
|
|
19703
19756
|
addEntryLine,
|
|
@@ -19706,10 +19759,48 @@ var JournalFormEntryLines = ({
|
|
|
19706
19759
|
sendingForm,
|
|
19707
19760
|
config
|
|
19708
19761
|
}) => {
|
|
19709
|
-
const { data
|
|
19710
|
-
const { form } =
|
|
19711
|
-
const parentOptions =
|
|
19712
|
-
|
|
19762
|
+
const { data } = useAllCategories();
|
|
19763
|
+
const { form } = useContext40(JournalContext);
|
|
19764
|
+
const { flattenedCategories, parentOptions } = useMemo36(() => {
|
|
19765
|
+
const flattenedCategories2 = recursiveFlattenCategories(data != null ? data : []);
|
|
19766
|
+
const parentOptions2 = flattenedCategories2.sort((a, b) => a.display_name.localeCompare(b.display_name)).map(({ display_name, id }) => {
|
|
19767
|
+
return {
|
|
19768
|
+
label: display_name,
|
|
19769
|
+
value: id
|
|
19770
|
+
};
|
|
19771
|
+
});
|
|
19772
|
+
return { flattenedCategories: flattenedCategories2, parentOptions: parentOptions2 };
|
|
19773
|
+
}, [data]);
|
|
19774
|
+
const handleChangeParent = ({
|
|
19775
|
+
lineItemIndex,
|
|
19776
|
+
value
|
|
19777
|
+
}) => {
|
|
19778
|
+
var _a;
|
|
19779
|
+
const relevantCategory = flattenedCategories.find((x) => x.id === value.value);
|
|
19780
|
+
if (!relevantCategory) {
|
|
19781
|
+
return;
|
|
19782
|
+
}
|
|
19783
|
+
return changeFormData(
|
|
19784
|
+
"parent",
|
|
19785
|
+
value,
|
|
19786
|
+
lineItemIndex,
|
|
19787
|
+
[
|
|
19788
|
+
{
|
|
19789
|
+
id: relevantCategory.id,
|
|
19790
|
+
name: relevantCategory.display_name,
|
|
19791
|
+
stable_name: (_a = relevantCategory.stable_name) != null ? _a : "",
|
|
19792
|
+
account_type: {
|
|
19793
|
+
value: relevantCategory.id,
|
|
19794
|
+
display_name: relevantCategory.display_name
|
|
19795
|
+
},
|
|
19796
|
+
sub_accounts: [],
|
|
19797
|
+
balance: 0,
|
|
19798
|
+
normality: "DEBIT" /* DEBIT */
|
|
19799
|
+
}
|
|
19800
|
+
]
|
|
19801
|
+
);
|
|
19802
|
+
};
|
|
19803
|
+
return /* @__PURE__ */ jsx209(Fragment33, { children: ["DEBIT", "CREDIT"].map((direction, idx) => {
|
|
19713
19804
|
return /* @__PURE__ */ jsxs131(
|
|
19714
19805
|
"div",
|
|
19715
19806
|
{
|
|
@@ -19721,9 +19812,11 @@ var JournalFormEntryLines = ({
|
|
|
19721
19812
|
className: "Layer__journal__form__input-group__title",
|
|
19722
19813
|
size: "lg" /* lg */,
|
|
19723
19814
|
children: [
|
|
19724
|
-
"Add
|
|
19815
|
+
"Add",
|
|
19816
|
+
" ",
|
|
19725
19817
|
humanizeEnum(direction),
|
|
19726
|
-
"
|
|
19818
|
+
" ",
|
|
19819
|
+
"Account"
|
|
19727
19820
|
]
|
|
19728
19821
|
}
|
|
19729
19822
|
),
|
|
@@ -19778,12 +19871,10 @@ var JournalFormEntryLines = ({
|
|
|
19778
19871
|
value: item.account_identifier.id,
|
|
19779
19872
|
label: item.account_identifier.name
|
|
19780
19873
|
},
|
|
19781
|
-
onChange: (
|
|
19782
|
-
|
|
19783
|
-
|
|
19784
|
-
|
|
19785
|
-
accountsData == null ? void 0 : accountsData.accounts
|
|
19786
|
-
),
|
|
19874
|
+
onChange: (value) => handleChangeParent({
|
|
19875
|
+
lineItemIndex: idx2,
|
|
19876
|
+
value
|
|
19877
|
+
}),
|
|
19787
19878
|
isInvalid: Boolean(
|
|
19788
19879
|
(_d = form == null ? void 0 : form.errors) == null ? void 0 : _d.lineItems.find(
|
|
19789
19880
|
(x) => x.id === idx2 && x.field === "account"
|
|
@@ -19841,7 +19932,7 @@ var JournalForm = ({
|
|
|
19841
19932
|
changeFormData,
|
|
19842
19933
|
addEntryLine,
|
|
19843
19934
|
removeEntryLine
|
|
19844
|
-
} =
|
|
19935
|
+
} = useContext41(JournalContext);
|
|
19845
19936
|
return /* @__PURE__ */ jsxs132(
|
|
19846
19937
|
"form",
|
|
19847
19938
|
{
|
|
@@ -19989,7 +20080,7 @@ var JournalSidebar = ({
|
|
|
19989
20080
|
config,
|
|
19990
20081
|
stringOverrides
|
|
19991
20082
|
}) => {
|
|
19992
|
-
const { selectedEntryId } =
|
|
20083
|
+
const { selectedEntryId } = useContext42(JournalContext);
|
|
19993
20084
|
if (selectedEntryId !== "new") {
|
|
19994
20085
|
return /* @__PURE__ */ jsx211(JournalEntryDetails, {});
|
|
19995
20086
|
}
|
|
@@ -19997,7 +20088,7 @@ var JournalSidebar = ({
|
|
|
19997
20088
|
};
|
|
19998
20089
|
|
|
19999
20090
|
// src/components/JournalTable/JournalTable.tsx
|
|
20000
|
-
import
|
|
20091
|
+
import { Fragment as Fragment34, useContext as useContext43, useEffect as useEffect43 } from "react";
|
|
20001
20092
|
import { parseISO as parseISO14, format as formatTime12 } from "date-fns";
|
|
20002
20093
|
import { jsx as jsx212, jsxs as jsxs133 } from "react/jsx-runtime";
|
|
20003
20094
|
var accountName = (row) => {
|
|
@@ -20025,7 +20116,7 @@ var JournalTableContent = ({
|
|
|
20025
20116
|
data,
|
|
20026
20117
|
stringOverrides
|
|
20027
20118
|
}) => {
|
|
20028
|
-
const { selectedEntryId, setSelectedEntryId, closeSelectedEntry } =
|
|
20119
|
+
const { selectedEntryId, setSelectedEntryId, closeSelectedEntry } = useContext43(JournalContext);
|
|
20029
20120
|
const { isOpen, setIsOpen } = useTableExpandRow();
|
|
20030
20121
|
useEffect43(() => {
|
|
20031
20122
|
if (data.length > 0) {
|
|
@@ -20035,7 +20126,7 @@ var JournalTableContent = ({
|
|
|
20035
20126
|
const renderJournalRow = (row, index, rowKey, depth) => {
|
|
20036
20127
|
const expandable = !!row.line_items && row.line_items.length > 0;
|
|
20037
20128
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
20038
|
-
return /* @__PURE__ */ jsxs133(
|
|
20129
|
+
return /* @__PURE__ */ jsxs133(Fragment34, { children: [
|
|
20039
20130
|
/* @__PURE__ */ jsxs133(
|
|
20040
20131
|
TableRow,
|
|
20041
20132
|
{
|
|
@@ -20117,7 +20208,7 @@ var JournalTableContent = ({
|
|
|
20117
20208
|
|
|
20118
20209
|
// src/components/Journal/download/useJournalEntriesDownload.ts
|
|
20119
20210
|
import useSWRMutation6 from "swr/mutation";
|
|
20120
|
-
function
|
|
20211
|
+
function buildKey8({
|
|
20121
20212
|
access_token: accessToken,
|
|
20122
20213
|
apiUrl,
|
|
20123
20214
|
businessId,
|
|
@@ -20143,7 +20234,7 @@ function useJournalEntriesDownload({
|
|
|
20143
20234
|
const { data: auth } = useAuth();
|
|
20144
20235
|
const { businessId } = useLayerContext();
|
|
20145
20236
|
return useSWRMutation6(
|
|
20146
|
-
() =>
|
|
20237
|
+
() => buildKey8(__spreadProps(__spreadValues({}, auth), {
|
|
20147
20238
|
businessId,
|
|
20148
20239
|
startCutoff,
|
|
20149
20240
|
endCutoff
|
|
@@ -20171,7 +20262,7 @@ function useJournalEntriesDownload({
|
|
|
20171
20262
|
}
|
|
20172
20263
|
|
|
20173
20264
|
// src/components/Journal/download/JournalEntriesDownloadButton.tsx
|
|
20174
|
-
import { Fragment as
|
|
20265
|
+
import { Fragment as Fragment35, jsx as jsx213, jsxs as jsxs134 } from "react/jsx-runtime";
|
|
20175
20266
|
function JournalEntriesDownloadButton({
|
|
20176
20267
|
startCutoff,
|
|
20177
20268
|
endCutoff,
|
|
@@ -20183,7 +20274,7 @@ function JournalEntriesDownloadButton({
|
|
|
20183
20274
|
endCutoff,
|
|
20184
20275
|
onSuccess: ({ presignedUrl }) => triggerInvisibleDownload({ url: presignedUrl })
|
|
20185
20276
|
});
|
|
20186
|
-
return /* @__PURE__ */ jsxs134(
|
|
20277
|
+
return /* @__PURE__ */ jsxs134(Fragment35, { children: [
|
|
20187
20278
|
/* @__PURE__ */ jsx213(
|
|
20188
20279
|
DownloadButton,
|
|
20189
20280
|
{
|
|
@@ -20220,8 +20311,8 @@ var JournalTableWithPanel = ({
|
|
|
20220
20311
|
refetch,
|
|
20221
20312
|
selectedEntryId,
|
|
20222
20313
|
addEntry
|
|
20223
|
-
} =
|
|
20224
|
-
const data =
|
|
20314
|
+
} = useContext44(JournalContext);
|
|
20315
|
+
const data = useMemo37(() => {
|
|
20225
20316
|
var _a;
|
|
20226
20317
|
const firstPageIndex = (currentPage - 1) * pageSize;
|
|
20227
20318
|
const lastPageIndex = firstPageIndex + pageSize;
|
|
@@ -20351,17 +20442,17 @@ var JournalContent = ({
|
|
|
20351
20442
|
|
|
20352
20443
|
// src/components/Tasks/Tasks.tsx
|
|
20353
20444
|
import {
|
|
20354
|
-
createContext as
|
|
20355
|
-
useContext as
|
|
20445
|
+
createContext as createContext22,
|
|
20446
|
+
useContext as useContext49,
|
|
20356
20447
|
useEffect as useEffect46,
|
|
20357
|
-
useMemo as
|
|
20448
|
+
useMemo as useMemo43,
|
|
20358
20449
|
useState as useState59
|
|
20359
20450
|
} from "react";
|
|
20360
20451
|
|
|
20361
20452
|
// src/contexts/TasksContext/TasksContext.tsx
|
|
20362
|
-
import { createContext as
|
|
20453
|
+
import { createContext as createContext21 } from "react";
|
|
20363
20454
|
import { endOfYear as endOfYear4, startOfYear as startOfYear4 } from "date-fns";
|
|
20364
|
-
var TasksContext =
|
|
20455
|
+
var TasksContext = createContext21({
|
|
20365
20456
|
data: void 0,
|
|
20366
20457
|
isLoading: false,
|
|
20367
20458
|
loadedStatus: "initial",
|
|
@@ -20384,7 +20475,7 @@ var TasksContext = createContext20({
|
|
|
20384
20475
|
});
|
|
20385
20476
|
|
|
20386
20477
|
// src/hooks/useTasks/useTasks.tsx
|
|
20387
|
-
import { useEffect as useEffect44, useMemo as
|
|
20478
|
+
import { useEffect as useEffect44, useMemo as useMemo38, useState as useState56 } from "react";
|
|
20388
20479
|
|
|
20389
20480
|
// src/types/tasks.ts
|
|
20390
20481
|
var COMPLETED_TASK_TYPES = ["COMPLETED", "USER_MARKED_COMPLETED"];
|
|
@@ -20433,7 +20524,7 @@ var mockData = [
|
|
|
20433
20524
|
];
|
|
20434
20525
|
|
|
20435
20526
|
// src/hooks/useTasks/useTasks.tsx
|
|
20436
|
-
import
|
|
20527
|
+
import useSWR12 from "swr";
|
|
20437
20528
|
import { endOfYear as endOfYear5, formatISO as formatISO3, getMonth as getMonth2, getYear as getYear2, parseISO as parseISO15, startOfYear as startOfYear5 } from "date-fns";
|
|
20438
20529
|
var DEBUG_MODE = false;
|
|
20439
20530
|
var useTasks = ({
|
|
@@ -20450,7 +20541,7 @@ var useTasks = ({
|
|
|
20450
20541
|
});
|
|
20451
20542
|
const [currentDate, setCurrentDate] = useState56(/* @__PURE__ */ new Date());
|
|
20452
20543
|
const queryKey = businessId && (auth == null ? void 0 : auth.access_token) && `tasks-${businessId}-${dateRange.startDate}-${dateRange.endDate}`;
|
|
20453
|
-
const { data, isLoading, isValidating, error, mutate } =
|
|
20544
|
+
const { data, isLoading, isValidating, error, mutate } = useSWR12(
|
|
20454
20545
|
queryKey,
|
|
20455
20546
|
Layer.getTasks(apiUrl, auth == null ? void 0 : auth.access_token, {
|
|
20456
20547
|
params: {
|
|
@@ -20460,7 +20551,7 @@ var useTasks = ({
|
|
|
20460
20551
|
}
|
|
20461
20552
|
})
|
|
20462
20553
|
);
|
|
20463
|
-
const monthlyData =
|
|
20554
|
+
const monthlyData = useMemo38(() => {
|
|
20464
20555
|
if (data == null ? void 0 : data.data) {
|
|
20465
20556
|
const grouped = data.data.reduce((acc, task) => {
|
|
20466
20557
|
const effectiveDate = task.effective_date ? parseISO15(task.effective_date) : parseISO15(task.created_at);
|
|
@@ -20564,7 +20655,7 @@ var useTasks = ({
|
|
|
20564
20655
|
};
|
|
20565
20656
|
|
|
20566
20657
|
// src/components/TasksHeader/TasksHeader.tsx
|
|
20567
|
-
import { useContext as
|
|
20658
|
+
import { useContext as useContext45 } from "react";
|
|
20568
20659
|
|
|
20569
20660
|
// src/icons/ProgressIcon.tsx
|
|
20570
20661
|
import { jsx as jsx216, jsxs as jsxs136 } from "react/jsx-runtime";
|
|
@@ -20697,7 +20788,7 @@ var TasksHeader = ({
|
|
|
20697
20788
|
error,
|
|
20698
20789
|
dateRange,
|
|
20699
20790
|
setDateRange
|
|
20700
|
-
} =
|
|
20791
|
+
} = useContext45(TasksContext);
|
|
20701
20792
|
const { business } = useLayerContext();
|
|
20702
20793
|
const completedTasks = tasks == null ? void 0 : tasks.filter((task) => isComplete(task.status)).length;
|
|
20703
20794
|
const badgeVariant = completedTasks === (tasks == null ? void 0 : tasks.length) ? ICONS.done : ICONS.pending;
|
|
@@ -20743,7 +20834,7 @@ var TasksHeader = ({
|
|
|
20743
20834
|
};
|
|
20744
20835
|
|
|
20745
20836
|
// src/components/TasksList/TasksList.tsx
|
|
20746
|
-
import { useContext as
|
|
20837
|
+
import { useContext as useContext47, useMemo as useMemo40, useState as useState58 } from "react";
|
|
20747
20838
|
|
|
20748
20839
|
// src/icons/SmileIcon.tsx
|
|
20749
20840
|
import { jsx as jsx218, jsxs as jsxs138 } from "react/jsx-runtime";
|
|
@@ -20802,9 +20893,9 @@ var SmileIcon = (_a) => {
|
|
|
20802
20893
|
var SmileIcon_default = SmileIcon;
|
|
20803
20894
|
|
|
20804
20895
|
// src/components/TasksListItem/TasksListItem.tsx
|
|
20805
|
-
import { useContext as
|
|
20896
|
+
import { useContext as useContext46, useEffect as useEffect45, useMemo as useMemo39, useState as useState57 } from "react";
|
|
20806
20897
|
import classNames69 from "classnames";
|
|
20807
|
-
import { Fragment as
|
|
20898
|
+
import { Fragment as Fragment36, jsx as jsx219, jsxs as jsxs139 } from "react/jsx-runtime";
|
|
20808
20899
|
var TasksListItem = ({
|
|
20809
20900
|
task,
|
|
20810
20901
|
goToNextPageIfAllComplete,
|
|
@@ -20819,7 +20910,7 @@ var TasksListItem = ({
|
|
|
20819
20910
|
uploadDocumentsForTask,
|
|
20820
20911
|
deleteUploadsForTask,
|
|
20821
20912
|
updateDocUploadTaskDescription
|
|
20822
|
-
} =
|
|
20913
|
+
} = useContext46(TasksContext);
|
|
20823
20914
|
const taskBodyClassName = classNames69(
|
|
20824
20915
|
"Layer__tasks-list-item__body",
|
|
20825
20916
|
isOpen && "Layer__tasks-list-item__body--expanded",
|
|
@@ -20836,7 +20927,7 @@ var TasksListItem = ({
|
|
|
20836
20927
|
useEffect45(() => {
|
|
20837
20928
|
setIsOpen(defaultOpen);
|
|
20838
20929
|
}, [defaultOpen]);
|
|
20839
|
-
const uploadDocumentAction =
|
|
20930
|
+
const uploadDocumentAction = useMemo39(() => {
|
|
20840
20931
|
if (task.user_response_type === "UPLOAD_DOCUMENT") {
|
|
20841
20932
|
if (task.status === "TODO") {
|
|
20842
20933
|
if (!selectedFiles) {
|
|
@@ -20851,7 +20942,7 @@ var TasksListItem = ({
|
|
|
20851
20942
|
}
|
|
20852
20943
|
);
|
|
20853
20944
|
} else {
|
|
20854
|
-
return /* @__PURE__ */ jsxs139(
|
|
20945
|
+
return /* @__PURE__ */ jsxs139(Fragment36, { children: [
|
|
20855
20946
|
/* @__PURE__ */ jsx219(
|
|
20856
20947
|
Button,
|
|
20857
20948
|
{
|
|
@@ -20966,7 +21057,7 @@ var TasksListItem = ({
|
|
|
20966
21057
|
|
|
20967
21058
|
// src/components/TasksList/TasksList.tsx
|
|
20968
21059
|
import { endOfMonth as endOfMonth14, isAfter, isBefore, parseISO as parseISO16, startOfMonth as startOfMonth16 } from "date-fns";
|
|
20969
|
-
import { Fragment as
|
|
21060
|
+
import { Fragment as Fragment37, jsx as jsx220, jsxs as jsxs140 } from "react/jsx-runtime";
|
|
20970
21061
|
function paginateArray(array, chunkSize = 10) {
|
|
20971
21062
|
const result = [];
|
|
20972
21063
|
for (let i = 0; i < array.length; i += chunkSize) {
|
|
@@ -20984,8 +21075,8 @@ var TasksEmptyState = () => /* @__PURE__ */ jsxs140("div", { className: "Layer__
|
|
|
20984
21075
|
] })
|
|
20985
21076
|
] });
|
|
20986
21077
|
var TasksList = ({ pageSize = 10 }) => {
|
|
20987
|
-
const { data: rawData, error, currentDate } =
|
|
20988
|
-
const tasks =
|
|
21078
|
+
const { data: rawData, error, currentDate } = useContext47(TasksContext);
|
|
21079
|
+
const tasks = useMemo40(() => {
|
|
20989
21080
|
return rawData == null ? void 0 : rawData.filter((x) => {
|
|
20990
21081
|
const d = x.effective_date ? parseISO16(x.effective_date) : parseISO16(x.created_at);
|
|
20991
21082
|
return !isBefore(d, startOfMonth16(currentDate)) && !isAfter(d, endOfMonth14(currentDate));
|
|
@@ -20998,7 +21089,7 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
20998
21089
|
const [currentPage, setCurrentPage] = useState58(
|
|
20999
21090
|
firstPageWithIincompleteTasks === -1 ? 1 : firstPageWithIincompleteTasks + 1
|
|
21000
21091
|
);
|
|
21001
|
-
const sortedTasks =
|
|
21092
|
+
const sortedTasks = useMemo40(() => {
|
|
21002
21093
|
const firstPageIndex = (currentPage - 1) * pageSize;
|
|
21003
21094
|
const lastPageIndex = firstPageIndex + pageSize;
|
|
21004
21095
|
return tasks == null ? void 0 : tasks.sort((x) => isComplete(x.status) ? 1 : -1).slice(firstPageIndex, lastPageIndex);
|
|
@@ -21013,7 +21104,7 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
21013
21104
|
setCurrentPage(currentPage + 1);
|
|
21014
21105
|
}
|
|
21015
21106
|
};
|
|
21016
|
-
return /* @__PURE__ */ jsx220("div", { className: "Layer__tasks-list", children: sortedTasks && sortedTasks.length > 0 ? /* @__PURE__ */ jsxs140(
|
|
21107
|
+
return /* @__PURE__ */ jsx220("div", { className: "Layer__tasks-list", children: sortedTasks && sortedTasks.length > 0 ? /* @__PURE__ */ jsxs140(Fragment37, { children: [
|
|
21017
21108
|
sortedTasks.map((task, index) => /* @__PURE__ */ jsx220(
|
|
21018
21109
|
TasksListItem,
|
|
21019
21110
|
{
|
|
@@ -21032,18 +21123,18 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
21032
21123
|
onPageChange: (page) => setCurrentPage(page)
|
|
21033
21124
|
}
|
|
21034
21125
|
) })
|
|
21035
|
-
] }) : /* @__PURE__ */ jsx220(
|
|
21126
|
+
] }) : /* @__PURE__ */ jsx220(Fragment37, { children: error ? /* @__PURE__ */ jsx220(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." }) : /* @__PURE__ */ jsx220(TasksEmptyState, {}) }) });
|
|
21036
21127
|
};
|
|
21037
21128
|
|
|
21038
21129
|
// src/components/TasksPending/TasksPending.tsx
|
|
21039
|
-
import { useContext as
|
|
21130
|
+
import { useContext as useContext48, useMemo as useMemo41 } from "react";
|
|
21040
21131
|
import classNames70 from "classnames";
|
|
21041
21132
|
import { endOfMonth as endOfMonth15, format as format6, isAfter as isAfter2, isBefore as isBefore2, parseISO as parseISO17, startOfMonth as startOfMonth17 } from "date-fns";
|
|
21042
21133
|
import { Cell as Cell4, Pie as Pie3, PieChart as PieChart4 } from "recharts";
|
|
21043
21134
|
import { jsx as jsx221, jsxs as jsxs141 } from "react/jsx-runtime";
|
|
21044
21135
|
var TasksPending = () => {
|
|
21045
|
-
const { data: rawData, currentDate } =
|
|
21046
|
-
const data =
|
|
21136
|
+
const { data: rawData, currentDate } = useContext48(TasksContext);
|
|
21137
|
+
const data = useMemo41(() => {
|
|
21047
21138
|
return rawData == null ? void 0 : rawData.filter((x) => {
|
|
21048
21139
|
const d = x.effective_date ? parseISO17(x.effective_date) : parseISO17(x.created_at);
|
|
21049
21140
|
return !isBefore2(d, startOfMonth17(currentDate)) && !isAfter2(d, endOfMonth15(currentDate));
|
|
@@ -21105,7 +21196,7 @@ var TasksPending = () => {
|
|
|
21105
21196
|
};
|
|
21106
21197
|
|
|
21107
21198
|
// src/components/TasksMonthSelector/TasksMonthSelector.tsx
|
|
21108
|
-
import { useMemo as
|
|
21199
|
+
import { useMemo as useMemo42 } from "react";
|
|
21109
21200
|
import { endOfMonth as endOfMonth16, format as format7, getMonth as getMonth3, getYear as getYear4, isAfter as isAfter3, isBefore as isBefore3, set, startOfMonth as startOfMonth18 } from "date-fns";
|
|
21110
21201
|
|
|
21111
21202
|
// src/components/TasksMonthSelector/TaskMonthTile.tsx
|
|
@@ -21140,7 +21231,7 @@ var DEFAULT_TASK_DATA = {
|
|
|
21140
21231
|
var isCurrentMonth = (monthDate, currentDate) => getMonth3(currentDate) === getMonth3(monthDate) && getYear4(currentDate) === getYear4(monthDate);
|
|
21141
21232
|
var TasksMonthSelector = ({ tasks, year, currentDate, onClick }) => {
|
|
21142
21233
|
const { business } = useLayerContext();
|
|
21143
|
-
const minDate =
|
|
21234
|
+
const minDate = useMemo42(() => {
|
|
21144
21235
|
if (business) {
|
|
21145
21236
|
const date = getEarliestDateToBrowse(business);
|
|
21146
21237
|
if (date) {
|
|
@@ -21149,7 +21240,7 @@ var TasksMonthSelector = ({ tasks, year, currentDate, onClick }) => {
|
|
|
21149
21240
|
}
|
|
21150
21241
|
return;
|
|
21151
21242
|
}, [business]);
|
|
21152
|
-
const months =
|
|
21243
|
+
const months = useMemo42(() => {
|
|
21153
21244
|
return Array.from({ length: 12 }, (_, i) => {
|
|
21154
21245
|
var _a;
|
|
21155
21246
|
const startDate = set(
|
|
@@ -21190,8 +21281,8 @@ var TasksMonthSelector = ({ tasks, year, currentDate, onClick }) => {
|
|
|
21190
21281
|
// src/components/Tasks/Tasks.tsx
|
|
21191
21282
|
import classNames72 from "classnames";
|
|
21192
21283
|
import { endOfYear as endOfYear7, getYear as getYear5, startOfYear as startOfYear7 } from "date-fns";
|
|
21193
|
-
import { Fragment as
|
|
21194
|
-
var UseTasksContext =
|
|
21284
|
+
import { Fragment as Fragment38, jsx as jsx224, jsxs as jsxs143 } from "react/jsx-runtime";
|
|
21285
|
+
var UseTasksContext = createContext22({
|
|
21195
21286
|
data: void 0,
|
|
21196
21287
|
isLoading: void 0,
|
|
21197
21288
|
loadedStatus: "initial",
|
|
@@ -21252,8 +21343,8 @@ var TasksComponent = ({
|
|
|
21252
21343
|
currentDate,
|
|
21253
21344
|
setCurrentDate,
|
|
21254
21345
|
dateRange
|
|
21255
|
-
} =
|
|
21256
|
-
const allComplete =
|
|
21346
|
+
} = useContext49(TasksContext);
|
|
21347
|
+
const allComplete = useMemo43(() => {
|
|
21257
21348
|
if (!data) {
|
|
21258
21349
|
return void 0;
|
|
21259
21350
|
}
|
|
@@ -21287,7 +21378,7 @@ var TasksComponent = ({
|
|
|
21287
21378
|
"Layer__tasks__content",
|
|
21288
21379
|
!open && "Layer__tasks__content--collapsed"
|
|
21289
21380
|
),
|
|
21290
|
-
children: isLoading || !data ? /* @__PURE__ */ jsx224("div", { className: "Layer__tasks__loader-container", children: /* @__PURE__ */ jsx224(Loader2, {}) }) : /* @__PURE__ */ jsxs143(
|
|
21381
|
+
children: isLoading || !data ? /* @__PURE__ */ jsx224("div", { className: "Layer__tasks__loader-container", children: /* @__PURE__ */ jsx224(Loader2, {}) }) : /* @__PURE__ */ jsxs143(Fragment38, { children: [
|
|
21291
21382
|
/* @__PURE__ */ jsx224(
|
|
21292
21383
|
TasksMonthSelector,
|
|
21293
21384
|
{
|
|
@@ -21306,11 +21397,11 @@ var TasksComponent = ({
|
|
|
21306
21397
|
};
|
|
21307
21398
|
|
|
21308
21399
|
// src/components/PlatformOnboarding/LinkAccounts.tsx
|
|
21309
|
-
import { useContext as
|
|
21400
|
+
import { useContext as useContext50, useMemo as useMemo44 } from "react";
|
|
21310
21401
|
import { jsx as jsx225, jsxs as jsxs144 } from "react/jsx-runtime";
|
|
21311
21402
|
var LinkAccounts = (_a) => {
|
|
21312
21403
|
var _b = _a, { inBox } = _b, props = __objRest(_b, ["inBox"]);
|
|
21313
|
-
const content =
|
|
21404
|
+
const content = useMemo44(() => {
|
|
21314
21405
|
if (inBox) {
|
|
21315
21406
|
return /* @__PURE__ */ jsx225("div", { className: "Layer__link-accounts__box", children: /* @__PURE__ */ jsx225(LinkAccountsContent, __spreadValues({}, props)) });
|
|
21316
21407
|
}
|
|
@@ -21330,7 +21421,7 @@ var LinkAccountsContent = ({
|
|
|
21330
21421
|
onNext
|
|
21331
21422
|
}) => {
|
|
21332
21423
|
var _a;
|
|
21333
|
-
const { data, loadingStatus, error, refetchAccounts, addConnection } =
|
|
21424
|
+
const { data, loadingStatus, error, refetchAccounts, addConnection } = useContext50(LinkedAccountsContext);
|
|
21334
21425
|
return /* @__PURE__ */ jsxs144("div", { className: "Layer__link-accounts Layer__component", children: [
|
|
21335
21426
|
title && /* @__PURE__ */ jsx225(Heading, { size: "view" /* view */, children: title }),
|
|
21336
21427
|
data && data.length === 0 ? /* @__PURE__ */ jsxs144("div", { className: "Layer__link-accounts__data-status-container", children: [
|
|
@@ -21612,7 +21703,7 @@ var BookkeepingOverview = ({
|
|
|
21612
21703
|
import { useState as useState62 } from "react";
|
|
21613
21704
|
|
|
21614
21705
|
// src/views/AccountingOverview/internal/TransactionsToReview.tsx
|
|
21615
|
-
import { useContext as
|
|
21706
|
+
import { useContext as useContext51, useEffect as useEffect47, useState as useState61 } from "react";
|
|
21616
21707
|
|
|
21617
21708
|
// src/components/BadgeLoader/BadgeLoader.tsx
|
|
21618
21709
|
import { jsx as jsx230, jsxs as jsxs148 } from "react/jsx-runtime";
|
|
@@ -21634,7 +21725,7 @@ function TransactionsToReview({
|
|
|
21634
21725
|
variants
|
|
21635
21726
|
}) {
|
|
21636
21727
|
const { size = "sm" } = variants != null ? variants : {};
|
|
21637
|
-
const { dateRange: contextDateRange } =
|
|
21728
|
+
const { dateRange: contextDateRange } = useContext51(ProfitAndLoss.Context);
|
|
21638
21729
|
const dateRange = usePnlDateRange ? contextDateRange : void 0;
|
|
21639
21730
|
const [toReview, setToReview] = useState61(0);
|
|
21640
21731
|
const { data, loaded, error, refetch } = useProfitAndLossLTM({
|
|
@@ -21956,7 +22047,7 @@ var GeneralLedgerView = ({
|
|
|
21956
22047
|
// src/views/ProjectProfitability/ProjectProfitability.tsx
|
|
21957
22048
|
import { useState as useState64 } from "react";
|
|
21958
22049
|
import Select4 from "react-select";
|
|
21959
|
-
import { Fragment as
|
|
22050
|
+
import { Fragment as Fragment39, jsx as jsx235, jsxs as jsxs153 } from "react/jsx-runtime";
|
|
21960
22051
|
var ProjectProfitabilityView = ({
|
|
21961
22052
|
valueOptions,
|
|
21962
22053
|
showTitle,
|
|
@@ -22029,7 +22120,7 @@ var ProjectProfitabilityView = ({
|
|
|
22029
22120
|
}
|
|
22030
22121
|
)
|
|
22031
22122
|
] }),
|
|
22032
|
-
/* @__PURE__ */ jsx235(Container, { name: "project", children: /* @__PURE__ */ jsxs153(
|
|
22123
|
+
/* @__PURE__ */ jsx235(Container, { name: "project", children: /* @__PURE__ */ jsxs153(Fragment39, { children: [
|
|
22033
22124
|
activeTab === "overview" && /* @__PURE__ */ jsx235(
|
|
22034
22125
|
AccountingOverview,
|
|
22035
22126
|
{
|
|
@@ -22067,7 +22158,7 @@ var ProjectProfitabilityView = ({
|
|
|
22067
22158
|
|
|
22068
22159
|
// src/views/Reports/Reports.tsx
|
|
22069
22160
|
import { useState as useState65 } from "react";
|
|
22070
|
-
import { Fragment as
|
|
22161
|
+
import { Fragment as Fragment40, jsx as jsx236, jsxs as jsxs154 } from "react/jsx-runtime";
|
|
22071
22162
|
var getOptions = (enabledReports) => {
|
|
22072
22163
|
return [
|
|
22073
22164
|
enabledReports.includes("profitAndLoss") ? {
|
|
@@ -22138,7 +22229,7 @@ var ReportsPanel = ({
|
|
|
22138
22229
|
statementOfCashFlowConfig,
|
|
22139
22230
|
view
|
|
22140
22231
|
}) => {
|
|
22141
|
-
return /* @__PURE__ */ jsxs154(
|
|
22232
|
+
return /* @__PURE__ */ jsxs154(Fragment40, { children: [
|
|
22142
22233
|
openReport === "profitAndLoss" && /* @__PURE__ */ jsx236(
|
|
22143
22234
|
ProfitAndLoss.Report,
|
|
22144
22235
|
__spreadValues({
|
|
@@ -22159,8 +22250,8 @@ var ReportsPanel = ({
|
|
|
22159
22250
|
};
|
|
22160
22251
|
|
|
22161
22252
|
// src/components/ProfitAndLossView/ProfitAndLossView.tsx
|
|
22162
|
-
import { useContext as
|
|
22163
|
-
import { Fragment as
|
|
22253
|
+
import { useContext as useContext52, useRef as useRef23 } from "react";
|
|
22254
|
+
import { Fragment as Fragment41, jsx as jsx237, jsxs as jsxs155 } from "react/jsx-runtime";
|
|
22164
22255
|
var COMPONENT_NAME7 = "profit-and-loss";
|
|
22165
22256
|
var ProfitAndLossView = (props) => {
|
|
22166
22257
|
const containerRef = useRef23(null);
|
|
@@ -22174,7 +22265,7 @@ var ProfitAndLossPanel = (_a) => {
|
|
|
22174
22265
|
"containerRef",
|
|
22175
22266
|
"stringOverrides"
|
|
22176
22267
|
]);
|
|
22177
|
-
const { sidebarScope } =
|
|
22268
|
+
const { sidebarScope } = useContext52(ProfitAndLoss.Context);
|
|
22178
22269
|
return /* @__PURE__ */ jsxs155(
|
|
22179
22270
|
Panel,
|
|
22180
22271
|
{
|
|
@@ -22205,7 +22296,7 @@ var Components = ({
|
|
|
22205
22296
|
hideTable = false,
|
|
22206
22297
|
stringOverrides
|
|
22207
22298
|
}) => {
|
|
22208
|
-
const { error, isLoading, isValidating, refetch } =
|
|
22299
|
+
const { error, isLoading, isValidating, refetch } = useContext52(
|
|
22209
22300
|
ProfitAndLoss.Context
|
|
22210
22301
|
);
|
|
22211
22302
|
if (!isLoading && error) {
|
|
@@ -22220,7 +22311,7 @@ var Components = ({
|
|
|
22220
22311
|
}
|
|
22221
22312
|
) });
|
|
22222
22313
|
}
|
|
22223
|
-
return /* @__PURE__ */ jsxs155(
|
|
22314
|
+
return /* @__PURE__ */ jsxs155(Fragment41, { children: [
|
|
22224
22315
|
!hideChart && /* @__PURE__ */ jsxs155("div", { className: `Layer__${COMPONENT_NAME7}__chart_with_summaries`, children: [
|
|
22225
22316
|
/* @__PURE__ */ jsxs155(
|
|
22226
22317
|
"div",
|