@layerfi/components 0.1.80 → 0.1.81
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 +801 -552
- package/dist/esm/index.mjs +743 -494
- package/dist/esm/index.mjs.map +7 -0
- package/dist/index.css +30 -20
- package/dist/index.css.map +7 -0
- package/dist/index.d.ts +145 -30
- package/package.json +1 -1
package/dist/esm/index.mjs
CHANGED
|
@@ -57,7 +57,7 @@ import React9, { useState as useState7 } from "react";
|
|
|
57
57
|
import React8, { useReducer, useEffect as useEffect4 } from "react";
|
|
58
58
|
|
|
59
59
|
// package.json
|
|
60
|
-
var version = "0.1.
|
|
60
|
+
var version = "0.1.81";
|
|
61
61
|
|
|
62
62
|
// src/models/APIError.ts
|
|
63
63
|
var APIError = class _APIError extends Error {
|
|
@@ -177,12 +177,42 @@ var tryToReadErrorsFromResponse = (res) => __async(void 0, null, function* () {
|
|
|
177
177
|
}
|
|
178
178
|
});
|
|
179
179
|
|
|
180
|
+
// src/utils/request/toDefinedSearchParameters.ts
|
|
181
|
+
function toSnakeCase(input) {
|
|
182
|
+
var _a;
|
|
183
|
+
const segments = (_a = input.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)) != null ? _a : [];
|
|
184
|
+
return segments.map((segment) => segment.toLowerCase()).join("_");
|
|
185
|
+
}
|
|
186
|
+
function toDefinedSearchParameters(input) {
|
|
187
|
+
const definedParameters = Object.fromEntries(
|
|
188
|
+
Object.entries(input).map(([key, value]) => {
|
|
189
|
+
if (value === null || value === void 0) {
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
if (value instanceof Date) {
|
|
193
|
+
return [key, value.toISOString()];
|
|
194
|
+
}
|
|
195
|
+
if (typeof value !== "string") {
|
|
196
|
+
return [key, String(value)];
|
|
197
|
+
}
|
|
198
|
+
return [key, value];
|
|
199
|
+
}).filter((entry) => entry !== null).map(([key, value]) => [toSnakeCase(key), value])
|
|
200
|
+
);
|
|
201
|
+
return new URLSearchParams(definedParameters);
|
|
202
|
+
}
|
|
203
|
+
|
|
180
204
|
// src/api/layer/balance_sheet.ts
|
|
181
205
|
var getBalanceSheet = get(
|
|
182
206
|
({ businessId, effectiveDate }) => `/v1/businesses/${businessId}/reports/balance-sheet?effective_date=${encodeURIComponent(
|
|
183
207
|
effectiveDate
|
|
184
208
|
)}`
|
|
185
209
|
);
|
|
210
|
+
var getBalanceSheetCSV = get(
|
|
211
|
+
({ businessId, effectiveDate }) => {
|
|
212
|
+
const parameters = toDefinedSearchParameters({ effectiveDate });
|
|
213
|
+
return `/v1/businesses/${businessId}/reports/balance-sheet/exports/csv?${parameters}`;
|
|
214
|
+
}
|
|
215
|
+
);
|
|
186
216
|
|
|
187
217
|
// src/api/layer/bankTransactions.ts
|
|
188
218
|
var getBankTransactions = get(
|
|
@@ -215,10 +245,10 @@ var updateBankTransactionMetadata = put(
|
|
|
215
245
|
({ businessId, bankTransactionId }) => `/v1/businesses/${businessId}/bank-transactions/${bankTransactionId}/metadata`
|
|
216
246
|
);
|
|
217
247
|
var listBankTransactionDocuments = get(
|
|
218
|
-
({ businessId, bankTransactionId }) => `/v1/businesses/${businessId}/bank-transactions/${bankTransactionId}/documents?content_disposition=
|
|
248
|
+
({ businessId, bankTransactionId }) => `/v1/businesses/${businessId}/bank-transactions/${bankTransactionId}/documents?content_disposition=ATTACHMENT`
|
|
219
249
|
);
|
|
220
250
|
var getBankTransactionDocument = get(
|
|
221
|
-
({ businessId, bankTransactionId, documentId }) => `/v1/businesses/${businessId}/bank-transactions/${bankTransactionId}/documents/${documentId}?content_disposition=
|
|
251
|
+
({ businessId, bankTransactionId, documentId }) => `/v1/businesses/${businessId}/bank-transactions/${bankTransactionId}/documents/${documentId}?content_disposition=ATTACHMENT`
|
|
222
252
|
);
|
|
223
253
|
var archiveBankTransactionDocument = post(
|
|
224
254
|
({ businessId, bankTransactionId, documentId }) => `/v1/businesses/${businessId}/bank-transactions/${bankTransactionId}/documents/${documentId}/archive`
|
|
@@ -359,6 +389,12 @@ var getStatementOfCashFlow = get(
|
|
|
359
389
|
startDate
|
|
360
390
|
)}&end_date=${encodeURIComponent(endDate)}`
|
|
361
391
|
);
|
|
392
|
+
var getCashflowStatementCSV = get(
|
|
393
|
+
({ businessId, startDate, endDate }) => {
|
|
394
|
+
const parameters = toDefinedSearchParameters({ startDate, endDate });
|
|
395
|
+
return `/v1/businesses/${businessId}/reports/cashflow-statement/exports/csv?${parameters}`;
|
|
396
|
+
}
|
|
397
|
+
);
|
|
362
398
|
|
|
363
399
|
// src/api/layer/tasks.ts
|
|
364
400
|
var getTasks = get(
|
|
@@ -5086,15 +5122,18 @@ import useSWRMutation from "swr/mutation";
|
|
|
5086
5122
|
|
|
5087
5123
|
// src/components/ui/Stack/Stack.tsx
|
|
5088
5124
|
import React69, { useMemo as useMemo9 } from "react";
|
|
5089
|
-
var CLASS_NAME = "
|
|
5090
|
-
function
|
|
5091
|
-
var _b = _a, { align, children, gap, justify } = _b, restProps = __objRest(_b, ["align", "children", "gap", "justify"]);
|
|
5125
|
+
var CLASS_NAME = "Layer__Stack";
|
|
5126
|
+
function Stack(_a) {
|
|
5127
|
+
var _b = _a, { align, children, direction, gap, justify } = _b, restProps = __objRest(_b, ["align", "children", "direction", "gap", "justify"]);
|
|
5092
5128
|
const dataProperties = useMemo9(
|
|
5093
|
-
() => toDataProperties({ align, gap, justify }),
|
|
5094
|
-
[align, gap, justify]
|
|
5129
|
+
() => toDataProperties({ align, gap, justify, direction }),
|
|
5130
|
+
[align, direction, gap, justify]
|
|
5095
5131
|
);
|
|
5096
5132
|
return /* @__PURE__ */ React69.createElement("div", __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: CLASS_NAME }), children);
|
|
5097
5133
|
}
|
|
5134
|
+
function VStack(props) {
|
|
5135
|
+
return /* @__PURE__ */ React69.createElement(Stack, __spreadProps(__spreadValues({}, props), { direction: "column" }));
|
|
5136
|
+
}
|
|
5098
5137
|
|
|
5099
5138
|
// src/components/utility/ConditionalList.tsx
|
|
5100
5139
|
import React70 from "react";
|
|
@@ -8648,6 +8687,7 @@ import classNames39 from "classnames";
|
|
|
8648
8687
|
var BusinessForm = ({
|
|
8649
8688
|
bankTransaction,
|
|
8650
8689
|
showTooltips,
|
|
8690
|
+
showCategorization,
|
|
8651
8691
|
showReceiptUploads,
|
|
8652
8692
|
showDescriptions
|
|
8653
8693
|
}) => {
|
|
@@ -8738,7 +8778,7 @@ var BusinessForm = ({
|
|
|
8738
8778
|
true
|
|
8739
8779
|
);
|
|
8740
8780
|
};
|
|
8741
|
-
return /* @__PURE__ */ React116.createElement("div", { className: "Layer__bank-transaction-mobile-list-item__business-form" }, /* @__PURE__ */ React116.createElement(
|
|
8781
|
+
return /* @__PURE__ */ React116.createElement("div", { className: "Layer__bank-transaction-mobile-list-item__business-form" }, showCategorization ? /* @__PURE__ */ React116.createElement(
|
|
8742
8782
|
ActionableList,
|
|
8743
8783
|
{
|
|
8744
8784
|
options,
|
|
@@ -8746,7 +8786,7 @@ var BusinessForm = ({
|
|
|
8746
8786
|
selectedId: selectedCategory == null ? void 0 : selectedCategory.id,
|
|
8747
8787
|
showDescriptions: showTooltips
|
|
8748
8788
|
}
|
|
8749
|
-
), showDescriptions && /* @__PURE__ */ React116.createElement(
|
|
8789
|
+
) : null, showDescriptions && /* @__PURE__ */ React116.createElement(
|
|
8750
8790
|
InputGroup,
|
|
8751
8791
|
{
|
|
8752
8792
|
className: "Layer__bank-transaction-mobile-list-item__description",
|
|
@@ -9050,6 +9090,7 @@ import classNames42 from "classnames";
|
|
|
9050
9090
|
var SplitForm = ({
|
|
9051
9091
|
bankTransaction,
|
|
9052
9092
|
showTooltips,
|
|
9093
|
+
showCategorization,
|
|
9053
9094
|
showReceiptUploads,
|
|
9054
9095
|
showDescriptions
|
|
9055
9096
|
}) => {
|
|
@@ -9189,7 +9230,7 @@ var SplitForm = ({
|
|
|
9189
9230
|
true
|
|
9190
9231
|
);
|
|
9191
9232
|
});
|
|
9192
|
-
return /* @__PURE__ */ React119.createElement("div", null, /* @__PURE__ */ React119.createElement(Text, { weight: "bold" /* bold */, size: "sm" /* sm */ }, "Split transaction"), /* @__PURE__ */ React119.createElement("div", { className: "Layer__bank-transactions__table-cell__header" }, /* @__PURE__ */ React119.createElement(Text, { size: "sm" /* sm */ }, "Category"), /* @__PURE__ */ React119.createElement(Text, { size: "sm" /* sm */ }, "Amount")), /* @__PURE__ */ React119.createElement("div", { className: "Layer__bank-transactions__splits-inputs" }, rowState.splits.map((split, index) => /* @__PURE__ */ React119.createElement(
|
|
9233
|
+
return /* @__PURE__ */ React119.createElement("div", null, showCategorization ? /* @__PURE__ */ React119.createElement(React119.Fragment, null, /* @__PURE__ */ React119.createElement(Text, { weight: "bold" /* bold */, size: "sm" /* sm */ }, "Split transaction"), /* @__PURE__ */ React119.createElement("div", { className: "Layer__bank-transactions__table-cell__header" }, /* @__PURE__ */ React119.createElement(Text, { size: "sm" /* sm */ }, "Category"), /* @__PURE__ */ React119.createElement(Text, { size: "sm" /* sm */ }, "Amount")), /* @__PURE__ */ React119.createElement("div", { className: "Layer__bank-transactions__splits-inputs" }, rowState.splits.map((split, index) => /* @__PURE__ */ React119.createElement(
|
|
9193
9234
|
"div",
|
|
9194
9235
|
{
|
|
9195
9236
|
className: "Layer__bank-transactions__table-cell--split-entry",
|
|
@@ -9245,7 +9286,7 @@ var SplitForm = ({
|
|
|
9245
9286
|
className: "Layer__add-new-split"
|
|
9246
9287
|
},
|
|
9247
9288
|
"Add new split"
|
|
9248
|
-
)), showDescriptions && /* @__PURE__ */ React119.createElement(
|
|
9289
|
+
))) : null, showDescriptions && /* @__PURE__ */ React119.createElement(
|
|
9249
9290
|
InputGroup,
|
|
9250
9291
|
{
|
|
9251
9292
|
className: "Layer__bank-transaction-mobile-list-item__description",
|
|
@@ -9338,6 +9379,7 @@ var BankTransactionMobileForms = ({
|
|
|
9338
9379
|
purpose,
|
|
9339
9380
|
bankTransaction,
|
|
9340
9381
|
showTooltips,
|
|
9382
|
+
showCategorization,
|
|
9341
9383
|
showReceiptUploads,
|
|
9342
9384
|
showDescriptions,
|
|
9343
9385
|
isOpen
|
|
@@ -9349,6 +9391,7 @@ var BankTransactionMobileForms = ({
|
|
|
9349
9391
|
BusinessForm,
|
|
9350
9392
|
{
|
|
9351
9393
|
bankTransaction,
|
|
9394
|
+
showCategorization,
|
|
9352
9395
|
showTooltips,
|
|
9353
9396
|
showReceiptUploads,
|
|
9354
9397
|
showDescriptions
|
|
@@ -9528,7 +9571,7 @@ var BankTransactionMobileListItem = ({
|
|
|
9528
9571
|
isCredit(bankTransaction) ? "+$" : " $",
|
|
9529
9572
|
centsToDollars(bankTransaction.amount)
|
|
9530
9573
|
), /* @__PURE__ */ React122.createElement("span", { className: `${className}__heading__date` }, formatTime9(parseISO10(bankTransaction.date), DATE_FORMAT2))))
|
|
9531
|
-
),
|
|
9574
|
+
), /* @__PURE__ */ React122.createElement(
|
|
9532
9575
|
"div",
|
|
9533
9576
|
{
|
|
9534
9577
|
className: `${className}__expanded-row`,
|
|
@@ -9540,7 +9583,7 @@ var BankTransactionMobileListItem = ({
|
|
|
9540
9583
|
className: `${className}__expanded-row__content`,
|
|
9541
9584
|
ref: formRowRef
|
|
9542
9585
|
},
|
|
9543
|
-
/* @__PURE__ */ React122.createElement("div", { className: `${className}__toggle-row` }, /* @__PURE__ */ React122.createElement(
|
|
9586
|
+
categorizationEnabled(mode) ? /* @__PURE__ */ React122.createElement("div", { className: `${className}__toggle-row` }, /* @__PURE__ */ React122.createElement(
|
|
9544
9587
|
Toggle,
|
|
9545
9588
|
{
|
|
9546
9589
|
name: `purpose-${bankTransaction.id}`,
|
|
@@ -9549,31 +9592,29 @@ var BankTransactionMobileListItem = ({
|
|
|
9549
9592
|
{
|
|
9550
9593
|
value: "business",
|
|
9551
9594
|
label: "Business",
|
|
9552
|
-
style: { minWidth: 84 }
|
|
9553
|
-
disabled: !categorizationEnabled(mode)
|
|
9595
|
+
style: { minWidth: 84 }
|
|
9554
9596
|
},
|
|
9555
9597
|
{
|
|
9556
9598
|
value: "personal",
|
|
9557
9599
|
label: "Personal",
|
|
9558
|
-
style: { minWidth: 84 }
|
|
9559
|
-
disabled: !categorizationEnabled(mode)
|
|
9600
|
+
style: { minWidth: 84 }
|
|
9560
9601
|
},
|
|
9561
9602
|
{
|
|
9562
9603
|
value: "more",
|
|
9563
9604
|
label: "More",
|
|
9564
|
-
style: { minWidth: 84 }
|
|
9565
|
-
disabled: !categorizationEnabled(mode)
|
|
9605
|
+
style: { minWidth: 84 }
|
|
9566
9606
|
}
|
|
9567
9607
|
],
|
|
9568
9608
|
selected: purpose,
|
|
9569
9609
|
onChange: onChangePurpose
|
|
9570
9610
|
}
|
|
9571
|
-
), /* @__PURE__ */ React122.createElement(CloseButton, { onClick: () => close() })),
|
|
9611
|
+
), /* @__PURE__ */ React122.createElement(CloseButton, { onClick: () => close() })) : null,
|
|
9572
9612
|
/* @__PURE__ */ React122.createElement(
|
|
9573
9613
|
BankTransactionMobileForms,
|
|
9574
9614
|
{
|
|
9575
9615
|
purpose,
|
|
9576
9616
|
bankTransaction,
|
|
9617
|
+
showCategorization: categorizationEnabled(mode),
|
|
9577
9618
|
showTooltips,
|
|
9578
9619
|
showReceiptUploads,
|
|
9579
9620
|
showDescriptions,
|
|
@@ -9581,7 +9622,7 @@ var BankTransactionMobileListItem = ({
|
|
|
9581
9622
|
}
|
|
9582
9623
|
)
|
|
9583
9624
|
)
|
|
9584
|
-
)
|
|
9625
|
+
));
|
|
9585
9626
|
};
|
|
9586
9627
|
|
|
9587
9628
|
// src/components/BankTransactionMobileList/BankTransactionMobileList.tsx
|
|
@@ -14651,7 +14692,7 @@ ProfitAndLoss.Report = ProfitAndLossReport;
|
|
|
14651
14692
|
ProfitAndLoss.DownloadButton = ProfitAndLossDownloadButton;
|
|
14652
14693
|
|
|
14653
14694
|
// src/components/BalanceSheet/BalanceSheet.tsx
|
|
14654
|
-
import
|
|
14695
|
+
import React184, { useEffect as useEffect37, useState as useState46 } from "react";
|
|
14655
14696
|
|
|
14656
14697
|
// src/contexts/BalanceSheetContext/BalanceSheetContext.tsx
|
|
14657
14698
|
import { createContext as createContext14 } from "react";
|
|
@@ -14699,13 +14740,13 @@ var useBalanceSheet = (date = /* @__PURE__ */ new Date()) => {
|
|
|
14699
14740
|
};
|
|
14700
14741
|
|
|
14701
14742
|
// src/hooks/useElementViewSize/useElementViewSize.tsx
|
|
14702
|
-
import {
|
|
14703
|
-
var useElementViewSize = (
|
|
14704
|
-
const
|
|
14743
|
+
import { useLayoutEffect as useLayoutEffect3, useRef as useRef21, useState as useState45 } from "react";
|
|
14744
|
+
var useElementViewSize = () => {
|
|
14745
|
+
const containerRef = useRef21(null);
|
|
14705
14746
|
const [view, setView] = useState45("desktop");
|
|
14706
14747
|
const resizeTimeout = useRef21(null);
|
|
14707
14748
|
useLayoutEffect3(() => {
|
|
14708
|
-
const element =
|
|
14749
|
+
const element = containerRef == null ? void 0 : containerRef.current;
|
|
14709
14750
|
if (!element) {
|
|
14710
14751
|
return;
|
|
14711
14752
|
}
|
|
@@ -14733,11 +14774,8 @@ var useElementViewSize = (callback) => {
|
|
|
14733
14774
|
clearTimeout(resizeTimeout.current);
|
|
14734
14775
|
}
|
|
14735
14776
|
};
|
|
14736
|
-
}, [
|
|
14737
|
-
|
|
14738
|
-
callback(view);
|
|
14739
|
-
}, [view, callback]);
|
|
14740
|
-
return ref;
|
|
14777
|
+
}, [containerRef, view]);
|
|
14778
|
+
return { view, containerRef };
|
|
14741
14779
|
};
|
|
14742
14780
|
|
|
14743
14781
|
// src/components/BalanceSheetDatePicker/BalanceSheetDatePicker.tsx
|
|
@@ -14773,7 +14811,7 @@ var BalanceSheetExpandAllButton = ({
|
|
|
14773
14811
|
};
|
|
14774
14812
|
|
|
14775
14813
|
// src/components/BalanceSheetTable/BalanceSheetTable.tsx
|
|
14776
|
-
import React181, { useEffect as
|
|
14814
|
+
import React181, { useEffect as useEffect36 } from "react";
|
|
14777
14815
|
var BalanceSheetTable = ({
|
|
14778
14816
|
data,
|
|
14779
14817
|
config,
|
|
@@ -14781,12 +14819,12 @@ var BalanceSheetTable = ({
|
|
|
14781
14819
|
}) => {
|
|
14782
14820
|
const { isOpen, setIsOpen, expandedAllRows } = useTableExpandRow();
|
|
14783
14821
|
const allRowKeys = [];
|
|
14784
|
-
|
|
14822
|
+
useEffect36(() => {
|
|
14785
14823
|
if (expandedAllRows) {
|
|
14786
14824
|
setIsOpen(allRowKeys, true);
|
|
14787
14825
|
}
|
|
14788
14826
|
}, [expandedAllRows]);
|
|
14789
|
-
|
|
14827
|
+
useEffect36(() => {
|
|
14790
14828
|
setIsOpen(["assets"]);
|
|
14791
14829
|
}, []);
|
|
14792
14830
|
const renderLineItem = (lineItem, depth = 0, rowKey, rowIndex) => {
|
|
@@ -14858,10 +14896,131 @@ var BALANCE_SHEET_ROWS = [
|
|
|
14858
14896
|
|
|
14859
14897
|
// src/components/BalanceSheet/BalanceSheet.tsx
|
|
14860
14898
|
import { format as format5, parse, startOfDay as startOfDay2 } from "date-fns";
|
|
14899
|
+
|
|
14900
|
+
// src/components/BalanceSheet/download/BalanceSheetDownloadButton.tsx
|
|
14901
|
+
import React183 from "react";
|
|
14902
|
+
|
|
14903
|
+
// src/components/utility/InvisibleDownload.tsx
|
|
14904
|
+
import React182, { forwardRef as forwardRef13, useCallback as useCallback5, useImperativeHandle as useImperativeHandle3, useRef as useRef22 } from "react";
|
|
14905
|
+
|
|
14906
|
+
// src/utils/delay/runDelayed.ts
|
|
14907
|
+
var DEFAULT_DELAY_MS = 50;
|
|
14908
|
+
function runDelayedSync(block, delayMs = DEFAULT_DELAY_MS) {
|
|
14909
|
+
return new Promise(
|
|
14910
|
+
(resolve) => setTimeout(() => resolve(block()), delayMs)
|
|
14911
|
+
);
|
|
14912
|
+
}
|
|
14913
|
+
|
|
14914
|
+
// src/components/utility/InvisibleDownload.tsx
|
|
14915
|
+
function useInvisibleDownload() {
|
|
14916
|
+
const invisibleDownloadRef = useRef22(null);
|
|
14917
|
+
const triggerInvisibleDownload = useCallback5((options) => {
|
|
14918
|
+
var _a;
|
|
14919
|
+
(_a = invisibleDownloadRef.current) == null ? void 0 : _a.trigger(options);
|
|
14920
|
+
}, []);
|
|
14921
|
+
return { invisibleDownloadRef, triggerInvisibleDownload };
|
|
14922
|
+
}
|
|
14923
|
+
var CLASS_NAME6 = "Layer__InvisibleDownload";
|
|
14924
|
+
var InvisibleDownload = forwardRef13((_props, ref) => {
|
|
14925
|
+
const internalRef = useRef22(null);
|
|
14926
|
+
useImperativeHandle3(ref, () => ({
|
|
14927
|
+
trigger: (_0) => __async(void 0, [_0], function* ({ url }) {
|
|
14928
|
+
var _a;
|
|
14929
|
+
(_a = internalRef.current) == null ? void 0 : _a.setAttribute("href", url);
|
|
14930
|
+
return runDelayedSync(() => {
|
|
14931
|
+
var _a2;
|
|
14932
|
+
return (_a2 = internalRef.current) == null ? void 0 : _a2.click();
|
|
14933
|
+
});
|
|
14934
|
+
})
|
|
14935
|
+
}));
|
|
14936
|
+
const handleContainClick = useCallback5((event) => {
|
|
14937
|
+
event.stopPropagation();
|
|
14938
|
+
}, []);
|
|
14939
|
+
return /* @__PURE__ */ React182.createElement("a", { download: true, className: CLASS_NAME6, ref: internalRef, onClick: handleContainClick });
|
|
14940
|
+
});
|
|
14941
|
+
InvisibleDownload.displayName = "InvisibleDownload";
|
|
14942
|
+
var InvisibleDownload_default = InvisibleDownload;
|
|
14943
|
+
|
|
14944
|
+
// src/components/BalanceSheet/download/useBalanceSheetDownload.ts
|
|
14945
|
+
import useSWRMutation2 from "swr/mutation";
|
|
14946
|
+
function buildKey2({
|
|
14947
|
+
access_token: accessToken,
|
|
14948
|
+
apiUrl,
|
|
14949
|
+
businessId,
|
|
14950
|
+
effectiveDate
|
|
14951
|
+
}) {
|
|
14952
|
+
if (accessToken && apiUrl) {
|
|
14953
|
+
return {
|
|
14954
|
+
accessToken,
|
|
14955
|
+
apiUrl,
|
|
14956
|
+
businessId,
|
|
14957
|
+
effectiveDate,
|
|
14958
|
+
tags: ["#balance-sheet", "#exports", "#csv"]
|
|
14959
|
+
};
|
|
14960
|
+
}
|
|
14961
|
+
}
|
|
14962
|
+
function useBalanceSheetDownload({
|
|
14963
|
+
effectiveDate,
|
|
14964
|
+
onSuccess
|
|
14965
|
+
}) {
|
|
14966
|
+
const { data: auth } = useAuth();
|
|
14967
|
+
const { businessId } = useLayerContext();
|
|
14968
|
+
return useSWRMutation2(
|
|
14969
|
+
() => buildKey2(__spreadProps(__spreadValues({}, auth), {
|
|
14970
|
+
businessId,
|
|
14971
|
+
effectiveDate
|
|
14972
|
+
})),
|
|
14973
|
+
({ accessToken, apiUrl, businessId: businessId2, effectiveDate: effectiveDate2 }) => getBalanceSheetCSV(
|
|
14974
|
+
apiUrl,
|
|
14975
|
+
accessToken,
|
|
14976
|
+
{
|
|
14977
|
+
params: {
|
|
14978
|
+
businessId: businessId2,
|
|
14979
|
+
effectiveDate: effectiveDate2.toISOString()
|
|
14980
|
+
}
|
|
14981
|
+
}
|
|
14982
|
+
)().then(({ data }) => {
|
|
14983
|
+
if (onSuccess) {
|
|
14984
|
+
return onSuccess(data);
|
|
14985
|
+
}
|
|
14986
|
+
}),
|
|
14987
|
+
{
|
|
14988
|
+
revalidate: false,
|
|
14989
|
+
throwOnError: false
|
|
14990
|
+
}
|
|
14991
|
+
);
|
|
14992
|
+
}
|
|
14993
|
+
|
|
14994
|
+
// src/components/BalanceSheet/download/BalanceSheetDownloadButton.tsx
|
|
14995
|
+
function BalanceSheetDownloadButton({
|
|
14996
|
+
effectiveDate,
|
|
14997
|
+
iconOnly
|
|
14998
|
+
}) {
|
|
14999
|
+
const { invisibleDownloadRef, triggerInvisibleDownload } = useInvisibleDownload();
|
|
15000
|
+
const { trigger, isMutating, error } = useBalanceSheetDownload({
|
|
15001
|
+
effectiveDate,
|
|
15002
|
+
onSuccess: ({ presignedUrl }) => triggerInvisibleDownload({ url: presignedUrl })
|
|
15003
|
+
});
|
|
15004
|
+
return /* @__PURE__ */ React183.createElement(React183.Fragment, null, /* @__PURE__ */ React183.createElement(
|
|
15005
|
+
DownloadButton,
|
|
15006
|
+
{
|
|
15007
|
+
iconOnly,
|
|
15008
|
+
onClick: () => {
|
|
15009
|
+
trigger();
|
|
15010
|
+
},
|
|
15011
|
+
isDownloading: isMutating,
|
|
15012
|
+
requestFailed: Boolean(error),
|
|
15013
|
+
text: "Download",
|
|
15014
|
+
retryText: "Retry"
|
|
15015
|
+
}
|
|
15016
|
+
), /* @__PURE__ */ React183.createElement(InvisibleDownload_default, { ref: invisibleDownloadRef }));
|
|
15017
|
+
}
|
|
15018
|
+
|
|
15019
|
+
// src/components/BalanceSheet/BalanceSheet.tsx
|
|
14861
15020
|
var COMPONENT_NAME3 = "balance-sheet";
|
|
14862
15021
|
var BalanceSheet = (props) => {
|
|
14863
15022
|
const balanceSheetContextData = useBalanceSheet(props.effectiveDate);
|
|
14864
|
-
return /* @__PURE__ */
|
|
15023
|
+
return /* @__PURE__ */ React184.createElement(BalanceSheetContext.Provider, { value: balanceSheetContextData }, /* @__PURE__ */ React184.createElement(
|
|
14865
15024
|
BalanceSheetView,
|
|
14866
15025
|
__spreadValues({
|
|
14867
15026
|
asWidget: props.asWidget,
|
|
@@ -14876,11 +15035,8 @@ var BalanceSheetView = ({
|
|
|
14876
15035
|
}) => {
|
|
14877
15036
|
const [effectiveDate, setEffectiveDate] = useState46(startOfDay2(/* @__PURE__ */ new Date()));
|
|
14878
15037
|
const { data, isLoading, refetch } = useBalanceSheet(effectiveDate);
|
|
14879
|
-
const
|
|
14880
|
-
|
|
14881
|
-
(newView) => setView(newView)
|
|
14882
|
-
);
|
|
14883
|
-
useEffect38(() => {
|
|
15038
|
+
const { view, containerRef } = useElementViewSize();
|
|
15039
|
+
useEffect37(() => {
|
|
14884
15040
|
const d1 = effectiveDate && format5(startOfDay2(effectiveDate), "yyyy-MM-dd'T'HH:mm:ssXXX");
|
|
14885
15041
|
const d2 = (data == null ? void 0 : data.effective_date) && format5(
|
|
14886
15042
|
startOfDay2(
|
|
@@ -14893,20 +15049,20 @@ var BalanceSheetView = ({
|
|
|
14893
15049
|
}
|
|
14894
15050
|
}, [effectiveDate]);
|
|
14895
15051
|
if (asWidget) {
|
|
14896
|
-
return /* @__PURE__ */
|
|
15052
|
+
return /* @__PURE__ */ React184.createElement(TableProvider, null, /* @__PURE__ */ React184.createElement(Container, { name: COMPONENT_NAME3, asWidget: true }, /* @__PURE__ */ React184.createElement(
|
|
14897
15053
|
View,
|
|
14898
15054
|
{
|
|
14899
15055
|
type: "panel",
|
|
14900
15056
|
ref: containerRef,
|
|
14901
|
-
header: /* @__PURE__ */
|
|
15057
|
+
header: /* @__PURE__ */ React184.createElement(Header2, null, /* @__PURE__ */ React184.createElement(HeaderRow, null, /* @__PURE__ */ React184.createElement(HeaderCol, null, /* @__PURE__ */ React184.createElement(
|
|
14902
15058
|
BalanceSheetDatePicker,
|
|
14903
15059
|
{
|
|
14904
15060
|
effectiveDate,
|
|
14905
15061
|
setEffectiveDate
|
|
14906
15062
|
}
|
|
14907
|
-
)), withExpandAllButton && /* @__PURE__ */
|
|
15063
|
+
)), withExpandAllButton && /* @__PURE__ */ React184.createElement(HeaderCol, null, /* @__PURE__ */ React184.createElement(BalanceSheetExpandAllButton, { view }))))
|
|
14908
15064
|
},
|
|
14909
|
-
!data || isLoading ? /* @__PURE__ */
|
|
15065
|
+
!data || isLoading ? /* @__PURE__ */ React184.createElement("div", { className: `Layer__${COMPONENT_NAME3}__loader-container` }, /* @__PURE__ */ React184.createElement(Loader2, null)) : /* @__PURE__ */ React184.createElement(
|
|
14910
15066
|
BalanceSheetTable,
|
|
14911
15067
|
{
|
|
14912
15068
|
data,
|
|
@@ -14916,20 +15072,26 @@ var BalanceSheetView = ({
|
|
|
14916
15072
|
)
|
|
14917
15073
|
)));
|
|
14918
15074
|
}
|
|
14919
|
-
return /* @__PURE__ */
|
|
15075
|
+
return /* @__PURE__ */ React184.createElement(TableProvider, null, /* @__PURE__ */ React184.createElement(
|
|
14920
15076
|
View,
|
|
14921
15077
|
{
|
|
14922
15078
|
type: "panel",
|
|
14923
15079
|
ref: containerRef,
|
|
14924
|
-
header: /* @__PURE__ */
|
|
15080
|
+
header: /* @__PURE__ */ React184.createElement(Header2, null, /* @__PURE__ */ React184.createElement(HeaderRow, null, /* @__PURE__ */ React184.createElement(HeaderCol, null, /* @__PURE__ */ React184.createElement(
|
|
14925
15081
|
BalanceSheetDatePicker,
|
|
14926
15082
|
{
|
|
14927
15083
|
effectiveDate,
|
|
14928
15084
|
setEffectiveDate
|
|
14929
15085
|
}
|
|
14930
|
-
)),
|
|
15086
|
+
)), /* @__PURE__ */ React184.createElement(HeaderCol, null, withExpandAllButton && /* @__PURE__ */ React184.createElement(BalanceSheetExpandAllButton, { view }), /* @__PURE__ */ React184.createElement(
|
|
15087
|
+
BalanceSheetDownloadButton,
|
|
15088
|
+
{
|
|
15089
|
+
effectiveDate,
|
|
15090
|
+
iconOnly: view === "mobile"
|
|
15091
|
+
}
|
|
15092
|
+
))))
|
|
14931
15093
|
},
|
|
14932
|
-
!data || isLoading ? /* @__PURE__ */
|
|
15094
|
+
!data || isLoading ? /* @__PURE__ */ React184.createElement("div", { className: `Layer__${COMPONENT_NAME3}__loader-container` }, /* @__PURE__ */ React184.createElement(Loader2, null)) : /* @__PURE__ */ React184.createElement(
|
|
14933
15095
|
BalanceSheetTable,
|
|
14934
15096
|
{
|
|
14935
15097
|
data,
|
|
@@ -14941,7 +15103,7 @@ var BalanceSheetView = ({
|
|
|
14941
15103
|
};
|
|
14942
15104
|
|
|
14943
15105
|
// src/components/StatementOfCashFlow/StatementOfCashFlow.tsx
|
|
14944
|
-
import
|
|
15106
|
+
import React187, { useState as useState47 } from "react";
|
|
14945
15107
|
|
|
14946
15108
|
// src/contexts/StatementOfCashContext/StatementOfCashFlowContext.tsx
|
|
14947
15109
|
import { createContext as createContext15 } from "react";
|
|
@@ -14954,7 +15116,7 @@ var StatementOfCashFlowContext = createContext15({
|
|
|
14954
15116
|
});
|
|
14955
15117
|
|
|
14956
15118
|
// src/hooks/useStatementOfCashFlow/useStatementOfCashFlow.tsx
|
|
14957
|
-
import { useEffect as
|
|
15119
|
+
import { useEffect as useEffect38 } from "react";
|
|
14958
15120
|
import { format as format6, startOfDay as startOfDay3 } from "date-fns";
|
|
14959
15121
|
import useSWR7 from "swr";
|
|
14960
15122
|
var useStatementOfCashFlow = (startDate = /* @__PURE__ */ new Date(), endDate = /* @__PURE__ */ new Date()) => {
|
|
@@ -14980,12 +15142,12 @@ var useStatementOfCashFlow = (startDate = /* @__PURE__ */ new Date(), endDate =
|
|
|
14980
15142
|
const refetch = () => {
|
|
14981
15143
|
mutate();
|
|
14982
15144
|
};
|
|
14983
|
-
|
|
15145
|
+
useEffect38(() => {
|
|
14984
15146
|
if (queryKey && (isLoading || isValidating)) {
|
|
14985
15147
|
read("STATEMENT_OF_CASH_FLOWS" /* STATEMENT_OF_CASH_FLOWS */, queryKey);
|
|
14986
15148
|
}
|
|
14987
15149
|
}, [isLoading, isValidating]);
|
|
14988
|
-
|
|
15150
|
+
useEffect38(() => {
|
|
14989
15151
|
if (queryKey && hasBeenTouched(queryKey)) {
|
|
14990
15152
|
refetch();
|
|
14991
15153
|
}
|
|
@@ -14994,7 +15156,7 @@ var useStatementOfCashFlow = (startDate = /* @__PURE__ */ new Date(), endDate =
|
|
|
14994
15156
|
};
|
|
14995
15157
|
|
|
14996
15158
|
// src/components/StatementOfCashFlowTable/StatementOfCashFlowTable.tsx
|
|
14997
|
-
import
|
|
15159
|
+
import React185 from "react";
|
|
14998
15160
|
var StatementOfCashFlowTable = ({
|
|
14999
15161
|
data,
|
|
15000
15162
|
config,
|
|
@@ -15004,7 +15166,7 @@ var StatementOfCashFlowTable = ({
|
|
|
15004
15166
|
const renderLineItem = (lineItem, depth = 0, rowKey, rowIndex) => {
|
|
15005
15167
|
const expandable = !!lineItem.line_items && lineItem.line_items.length > 0;
|
|
15006
15168
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
15007
|
-
return /* @__PURE__ */
|
|
15169
|
+
return /* @__PURE__ */ React185.createElement(React185.Fragment, { key: rowKey + "-" + rowIndex }, /* @__PURE__ */ React185.createElement(
|
|
15008
15170
|
TableRow,
|
|
15009
15171
|
{
|
|
15010
15172
|
rowKey: rowKey + "-" + rowIndex,
|
|
@@ -15013,8 +15175,8 @@ var StatementOfCashFlowTable = ({
|
|
|
15013
15175
|
handleExpand: () => setIsOpen(rowKey),
|
|
15014
15176
|
depth
|
|
15015
15177
|
},
|
|
15016
|
-
/* @__PURE__ */
|
|
15017
|
-
/* @__PURE__ */
|
|
15178
|
+
/* @__PURE__ */ React185.createElement(TableCell, { withExpandIcon: expandable, primary: expandable }, lineItem.display_name),
|
|
15179
|
+
/* @__PURE__ */ React185.createElement(
|
|
15018
15180
|
TableCell,
|
|
15019
15181
|
{
|
|
15020
15182
|
isCurrency: !expandable || expandable && !expanded,
|
|
@@ -15030,35 +15192,35 @@ var StatementOfCashFlowTable = ({
|
|
|
15030
15192
|
rowKey + ":" + subItem.name,
|
|
15031
15193
|
subIdx
|
|
15032
15194
|
)
|
|
15033
|
-
), expanded && expandable && /* @__PURE__ */
|
|
15195
|
+
), expanded && expandable && /* @__PURE__ */ React185.createElement(
|
|
15034
15196
|
TableRow,
|
|
15035
15197
|
{
|
|
15036
15198
|
rowKey: rowKey + "-" + rowIndex + "--summation",
|
|
15037
15199
|
depth: depth + 1,
|
|
15038
15200
|
variant: "summation"
|
|
15039
15201
|
},
|
|
15040
|
-
/* @__PURE__ */
|
|
15041
|
-
/* @__PURE__ */
|
|
15202
|
+
/* @__PURE__ */ React185.createElement(TableCell, { primary: true }, `Total of ${lineItem.display_name}`),
|
|
15203
|
+
/* @__PURE__ */ React185.createElement(TableCell, { primary: true, isCurrency: true, align: "right" /* RIGHT */ }, lineItem.value)
|
|
15042
15204
|
));
|
|
15043
15205
|
};
|
|
15044
|
-
return /* @__PURE__ */
|
|
15206
|
+
return /* @__PURE__ */ React185.createElement(Table, { borderCollapse: "collapse" }, /* @__PURE__ */ React185.createElement(TableHead, null, /* @__PURE__ */ React185.createElement(TableRow, { rowKey: "soc-flow-head-row", isHeadRow: true }, /* @__PURE__ */ React185.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.typeColumnHeader) || "Type"), /* @__PURE__ */ React185.createElement(TableCell, { isHeaderCell: true, align: "right" /* RIGHT */ }, (stringOverrides == null ? void 0 : stringOverrides.totalColumnHeader) || "Total"))), /* @__PURE__ */ React185.createElement(TableBody, null, config.map((row, idx) => {
|
|
15045
15207
|
if (row.type === "line_item") {
|
|
15046
|
-
return /* @__PURE__ */
|
|
15208
|
+
return /* @__PURE__ */ React185.createElement(React185.Fragment, { key: row.lineItem }, data[row.lineItem] && renderLineItem(
|
|
15047
15209
|
data[row.lineItem],
|
|
15048
15210
|
0,
|
|
15049
15211
|
row.lineItem ? row.lineItem : "",
|
|
15050
15212
|
idx
|
|
15051
15213
|
));
|
|
15052
15214
|
} else {
|
|
15053
|
-
return /* @__PURE__ */
|
|
15215
|
+
return /* @__PURE__ */ React185.createElement(
|
|
15054
15216
|
TableRow,
|
|
15055
15217
|
{
|
|
15056
15218
|
key: row.name + "-" + idx,
|
|
15057
15219
|
rowKey: row.name + "-" + idx,
|
|
15058
15220
|
variant: "default"
|
|
15059
15221
|
},
|
|
15060
|
-
/* @__PURE__ */
|
|
15061
|
-
/* @__PURE__ */
|
|
15222
|
+
/* @__PURE__ */ React185.createElement(TableCell, { primary: true }, row.displayName),
|
|
15223
|
+
/* @__PURE__ */ React185.createElement(TableCell, { primary: true, isCurrency: true, align: "right" /* RIGHT */ }, row.lineItem)
|
|
15062
15224
|
);
|
|
15063
15225
|
}
|
|
15064
15226
|
})));
|
|
@@ -15105,10 +15267,97 @@ var STATEMENT_OF_CASH_FLOW_ROWS = [
|
|
|
15105
15267
|
|
|
15106
15268
|
// src/components/StatementOfCashFlow/StatementOfCashFlow.tsx
|
|
15107
15269
|
import { endOfMonth as endOfMonth10, startOfDay as startOfDay4, startOfMonth as startOfMonth13, subWeeks } from "date-fns";
|
|
15270
|
+
|
|
15271
|
+
// src/components/StatementOfCashFlow/download/CashflowStatementDownloadButton.tsx
|
|
15272
|
+
import React186 from "react";
|
|
15273
|
+
|
|
15274
|
+
// src/components/StatementOfCashFlow/download/useCashflowStatementDownload.ts
|
|
15275
|
+
import useSWRMutation3 from "swr/mutation";
|
|
15276
|
+
function buildKey3({
|
|
15277
|
+
access_token: accessToken,
|
|
15278
|
+
apiUrl,
|
|
15279
|
+
businessId,
|
|
15280
|
+
startDate,
|
|
15281
|
+
endDate
|
|
15282
|
+
}) {
|
|
15283
|
+
if (accessToken && apiUrl) {
|
|
15284
|
+
return {
|
|
15285
|
+
accessToken,
|
|
15286
|
+
apiUrl,
|
|
15287
|
+
businessId,
|
|
15288
|
+
startDate,
|
|
15289
|
+
endDate,
|
|
15290
|
+
tags: ["#cashflow-statement", "#exports", "#csv"]
|
|
15291
|
+
};
|
|
15292
|
+
}
|
|
15293
|
+
}
|
|
15294
|
+
function useCashflowStatementDownload({
|
|
15295
|
+
startDate,
|
|
15296
|
+
endDate,
|
|
15297
|
+
onSuccess
|
|
15298
|
+
}) {
|
|
15299
|
+
const { data: auth } = useAuth();
|
|
15300
|
+
const { businessId } = useLayerContext();
|
|
15301
|
+
return useSWRMutation3(
|
|
15302
|
+
() => buildKey3(__spreadProps(__spreadValues({}, auth), {
|
|
15303
|
+
businessId,
|
|
15304
|
+
startDate,
|
|
15305
|
+
endDate
|
|
15306
|
+
})),
|
|
15307
|
+
({ accessToken, apiUrl, businessId: businessId2, startDate: startDate2, endDate: endDate2 }) => getCashflowStatementCSV(
|
|
15308
|
+
apiUrl,
|
|
15309
|
+
accessToken,
|
|
15310
|
+
{
|
|
15311
|
+
params: {
|
|
15312
|
+
businessId: businessId2,
|
|
15313
|
+
startDate: startDate2.toISOString(),
|
|
15314
|
+
endDate: endDate2.toISOString()
|
|
15315
|
+
}
|
|
15316
|
+
}
|
|
15317
|
+
)().then(({ data }) => {
|
|
15318
|
+
if (onSuccess) {
|
|
15319
|
+
return onSuccess(data);
|
|
15320
|
+
}
|
|
15321
|
+
}),
|
|
15322
|
+
{
|
|
15323
|
+
revalidate: false,
|
|
15324
|
+
throwOnError: false
|
|
15325
|
+
}
|
|
15326
|
+
);
|
|
15327
|
+
}
|
|
15328
|
+
|
|
15329
|
+
// src/components/StatementOfCashFlow/download/CashflowStatementDownloadButton.tsx
|
|
15330
|
+
function CashflowStatementDownloadButton({
|
|
15331
|
+
startDate,
|
|
15332
|
+
endDate,
|
|
15333
|
+
iconOnly
|
|
15334
|
+
}) {
|
|
15335
|
+
const { invisibleDownloadRef, triggerInvisibleDownload } = useInvisibleDownload();
|
|
15336
|
+
const { trigger, isMutating, error } = useCashflowStatementDownload({
|
|
15337
|
+
startDate,
|
|
15338
|
+
endDate,
|
|
15339
|
+
onSuccess: ({ presignedUrl }) => triggerInvisibleDownload({ url: presignedUrl })
|
|
15340
|
+
});
|
|
15341
|
+
return /* @__PURE__ */ React186.createElement(React186.Fragment, null, /* @__PURE__ */ React186.createElement(
|
|
15342
|
+
DownloadButton,
|
|
15343
|
+
{
|
|
15344
|
+
iconOnly,
|
|
15345
|
+
onClick: () => {
|
|
15346
|
+
trigger();
|
|
15347
|
+
},
|
|
15348
|
+
isDownloading: isMutating,
|
|
15349
|
+
requestFailed: Boolean(error),
|
|
15350
|
+
text: "Download",
|
|
15351
|
+
retryText: "Retry"
|
|
15352
|
+
}
|
|
15353
|
+
), /* @__PURE__ */ React186.createElement(InvisibleDownload_default, { ref: invisibleDownloadRef }));
|
|
15354
|
+
}
|
|
15355
|
+
|
|
15356
|
+
// src/components/StatementOfCashFlow/StatementOfCashFlow.tsx
|
|
15108
15357
|
var COMPONENT_NAME4 = "statement-of-cash-flow";
|
|
15109
15358
|
var StatementOfCashFlow = (props) => {
|
|
15110
15359
|
const cashContextData = useStatementOfCashFlow();
|
|
15111
|
-
return /* @__PURE__ */
|
|
15360
|
+
return /* @__PURE__ */ React187.createElement(StatementOfCashFlowContext.Provider, { value: cashContextData }, /* @__PURE__ */ React187.createElement(StatementOfCashFlowView, __spreadValues({}, props)));
|
|
15112
15361
|
};
|
|
15113
15362
|
var StatementOfCashFlowView = ({
|
|
15114
15363
|
stringOverrides,
|
|
@@ -15125,6 +15374,7 @@ var StatementOfCashFlowView = ({
|
|
|
15125
15374
|
startDate,
|
|
15126
15375
|
endDate
|
|
15127
15376
|
);
|
|
15377
|
+
const { view, containerRef } = useElementViewSize();
|
|
15128
15378
|
const [datePickerMode, setDatePickerMode] = useState47(
|
|
15129
15379
|
deprecated_datePickerMode != null ? deprecated_datePickerMode : defaultDatePickerMode
|
|
15130
15380
|
);
|
|
@@ -15139,7 +15389,7 @@ var StatementOfCashFlowView = ({
|
|
|
15139
15389
|
refetch();
|
|
15140
15390
|
}
|
|
15141
15391
|
};
|
|
15142
|
-
const datePicker = datePickerMode === "monthPicker" ? /* @__PURE__ */
|
|
15392
|
+
const datePicker = datePickerMode === "monthPicker" ? /* @__PURE__ */ React187.createElement(
|
|
15143
15393
|
DatePicker,
|
|
15144
15394
|
{
|
|
15145
15395
|
selected: startDate,
|
|
@@ -15157,7 +15407,7 @@ var StatementOfCashFlowView = ({
|
|
|
15157
15407
|
ModeSelector: DatePickerModeSelector
|
|
15158
15408
|
}
|
|
15159
15409
|
}
|
|
15160
|
-
) : /* @__PURE__ */
|
|
15410
|
+
) : /* @__PURE__ */ React187.createElement(
|
|
15161
15411
|
DatePicker,
|
|
15162
15412
|
{
|
|
15163
15413
|
selected: [startDate, endDate],
|
|
@@ -15172,13 +15422,21 @@ var StatementOfCashFlowView = ({
|
|
|
15172
15422
|
}
|
|
15173
15423
|
}
|
|
15174
15424
|
);
|
|
15175
|
-
return /* @__PURE__ */
|
|
15425
|
+
return /* @__PURE__ */ React187.createElement(TableProvider, null, /* @__PURE__ */ React187.createElement(
|
|
15176
15426
|
View,
|
|
15177
15427
|
{
|
|
15178
15428
|
type: "panel",
|
|
15179
|
-
|
|
15429
|
+
ref: containerRef,
|
|
15430
|
+
header: /* @__PURE__ */ React187.createElement(Header2, null, /* @__PURE__ */ React187.createElement(HeaderRow, null, /* @__PURE__ */ React187.createElement(HeaderCol, null, datePicker), /* @__PURE__ */ React187.createElement(HeaderCol, null, /* @__PURE__ */ React187.createElement(
|
|
15431
|
+
CashflowStatementDownloadButton,
|
|
15432
|
+
{
|
|
15433
|
+
startDate,
|
|
15434
|
+
endDate,
|
|
15435
|
+
iconOnly: view === "mobile"
|
|
15436
|
+
}
|
|
15437
|
+
))))
|
|
15180
15438
|
},
|
|
15181
|
-
!data || isLoading ? /* @__PURE__ */
|
|
15439
|
+
!data || isLoading ? /* @__PURE__ */ React187.createElement("div", { className: `Layer__${COMPONENT_NAME4}__loader-container` }, /* @__PURE__ */ React187.createElement(Loader2, null)) : /* @__PURE__ */ React187.createElement(
|
|
15182
15440
|
StatementOfCashFlowTable,
|
|
15183
15441
|
{
|
|
15184
15442
|
data,
|
|
@@ -15190,7 +15448,7 @@ var StatementOfCashFlowView = ({
|
|
|
15190
15448
|
};
|
|
15191
15449
|
|
|
15192
15450
|
// src/components/ChartOfAccounts/ChartOfAccounts.tsx
|
|
15193
|
-
import
|
|
15451
|
+
import React202, { useContext as useContext36 } from "react";
|
|
15194
15452
|
|
|
15195
15453
|
// src/contexts/ChartOfAccountsContext/ChartOfAccountsContext.tsx
|
|
15196
15454
|
import { createContext as createContext16 } from "react";
|
|
@@ -15249,7 +15507,7 @@ var LedgerAccountsContext = createContext17({
|
|
|
15249
15507
|
});
|
|
15250
15508
|
|
|
15251
15509
|
// src/hooks/useChartOfAccounts/useChartOfAccounts.tsx
|
|
15252
|
-
import { useEffect as
|
|
15510
|
+
import { useEffect as useEffect39, useState as useState48 } from "react";
|
|
15253
15511
|
|
|
15254
15512
|
// src/components/ChartOfAccountsForm/constants.ts
|
|
15255
15513
|
var LEDGER_ACCOUNT_TYPES = [
|
|
@@ -15737,12 +15995,12 @@ var useChartOfAccounts = ({ withDates, startDate: initialStartDate, endDate: ini
|
|
|
15737
15995
|
newEndDate && setEndDate(newEndDate);
|
|
15738
15996
|
};
|
|
15739
15997
|
const refetch = () => mutate();
|
|
15740
|
-
|
|
15998
|
+
useEffect39(() => {
|
|
15741
15999
|
if (queryKey && (isLoading || isValidating)) {
|
|
15742
16000
|
read("CHART_OF_ACCOUNTS" /* CHART_OF_ACCOUNTS */, queryKey);
|
|
15743
16001
|
}
|
|
15744
16002
|
}, [isLoading, isValidating]);
|
|
15745
|
-
|
|
16003
|
+
useEffect39(() => {
|
|
15746
16004
|
if (queryKey && hasBeenTouched(queryKey)) {
|
|
15747
16005
|
refetch();
|
|
15748
16006
|
}
|
|
@@ -15768,7 +16026,7 @@ var useChartOfAccounts = ({ withDates, startDate: initialStartDate, endDate: ini
|
|
|
15768
16026
|
};
|
|
15769
16027
|
|
|
15770
16028
|
// src/hooks/useLedgerAccounts/useLedgerAccounts.tsx
|
|
15771
|
-
import { useEffect as
|
|
16029
|
+
import { useEffect as useEffect40, useState as useState49 } from "react";
|
|
15772
16030
|
import useSWR9 from "swr";
|
|
15773
16031
|
var useLedgerAccounts = (showReversalEntries = false) => {
|
|
15774
16032
|
const { businessId, read, syncTimestamps, hasBeenTouched } = useLayerContext();
|
|
@@ -15804,12 +16062,12 @@ var useLedgerAccounts = (showReversalEntries = false) => {
|
|
|
15804
16062
|
setSelectedEntryId(void 0);
|
|
15805
16063
|
mutateEntryData();
|
|
15806
16064
|
};
|
|
15807
|
-
|
|
16065
|
+
useEffect40(() => {
|
|
15808
16066
|
if (queryKey && (isLoading || isValidating)) {
|
|
15809
16067
|
read("LEDGER_ACCOUNTS" /* LEDGER_ACCOUNTS */, queryKey);
|
|
15810
16068
|
}
|
|
15811
16069
|
}, [isLoading, isValidating]);
|
|
15812
|
-
|
|
16070
|
+
useEffect40(() => {
|
|
15813
16071
|
if (queryKey && hasBeenTouched(queryKey)) {
|
|
15814
16072
|
refetch();
|
|
15815
16073
|
}
|
|
@@ -15833,13 +16091,13 @@ var useLedgerAccounts = (showReversalEntries = false) => {
|
|
|
15833
16091
|
};
|
|
15834
16092
|
|
|
15835
16093
|
// src/components/ChartOfAccountsTable/ChartOfAccountsTableWithPanel.tsx
|
|
15836
|
-
import
|
|
16094
|
+
import React194, { useContext as useContext32, useState as useState51 } from "react";
|
|
15837
16095
|
|
|
15838
16096
|
// src/icons/Plus.tsx
|
|
15839
|
-
import * as
|
|
16097
|
+
import * as React188 from "react";
|
|
15840
16098
|
var Plus = (_a) => {
|
|
15841
16099
|
var _b = _a, { size = 14 } = _b, props = __objRest(_b, ["size"]);
|
|
15842
|
-
return /* @__PURE__ */
|
|
16100
|
+
return /* @__PURE__ */ React188.createElement(
|
|
15843
16101
|
"svg",
|
|
15844
16102
|
__spreadProps(__spreadValues({
|
|
15845
16103
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -15849,7 +16107,7 @@ var Plus = (_a) => {
|
|
|
15849
16107
|
width: size,
|
|
15850
16108
|
height: size
|
|
15851
16109
|
}),
|
|
15852
|
-
/* @__PURE__ */
|
|
16110
|
+
/* @__PURE__ */ React188.createElement(
|
|
15853
16111
|
"path",
|
|
15854
16112
|
{
|
|
15855
16113
|
d: "M7 2.91602V11.0827",
|
|
@@ -15858,7 +16116,7 @@ var Plus = (_a) => {
|
|
|
15858
16116
|
strokeLinejoin: "round"
|
|
15859
16117
|
}
|
|
15860
16118
|
),
|
|
15861
|
-
/* @__PURE__ */
|
|
16119
|
+
/* @__PURE__ */ React188.createElement(
|
|
15862
16120
|
"path",
|
|
15863
16121
|
{
|
|
15864
16122
|
d: "M2.91669 7H11.0834",
|
|
@@ -15872,11 +16130,11 @@ var Plus = (_a) => {
|
|
|
15872
16130
|
var Plus_default = Plus;
|
|
15873
16131
|
|
|
15874
16132
|
// src/components/ChartOfAccountsDatePicker/ChartOfAccountsDatePicker.tsx
|
|
15875
|
-
import
|
|
16133
|
+
import React189, { useContext as useContext29 } from "react";
|
|
15876
16134
|
import { endOfMonth as endOfMonth13, startOfMonth as startOfMonth16 } from "date-fns";
|
|
15877
16135
|
var ChartOfAccountsDatePicker = () => {
|
|
15878
16136
|
const { changeDateRange, dateRange } = useContext29(ChartOfAccountsContext);
|
|
15879
|
-
return /* @__PURE__ */
|
|
16137
|
+
return /* @__PURE__ */ React189.createElement(
|
|
15880
16138
|
DatePicker,
|
|
15881
16139
|
{
|
|
15882
16140
|
mode: "monthPicker",
|
|
@@ -15894,10 +16152,10 @@ var ChartOfAccountsDatePicker = () => {
|
|
|
15894
16152
|
};
|
|
15895
16153
|
|
|
15896
16154
|
// src/components/ChartOfAccountsSidebar/ChartOfAccountsSidebar.tsx
|
|
15897
|
-
import
|
|
16155
|
+
import React191 from "react";
|
|
15898
16156
|
|
|
15899
16157
|
// src/components/ChartOfAccountsForm/ChartOfAccountsForm.tsx
|
|
15900
|
-
import
|
|
16158
|
+
import React190, { useContext as useContext30, useMemo as useMemo25 } from "react";
|
|
15901
16159
|
|
|
15902
16160
|
// src/components/ChartOfAccountsForm/useParentOptions.ts
|
|
15903
16161
|
import { useMemo as useMemo24 } from "react";
|
|
@@ -15940,7 +16198,7 @@ var ChartOfAccountsForm = ({
|
|
|
15940
16198
|
if (!form) {
|
|
15941
16199
|
return null;
|
|
15942
16200
|
}
|
|
15943
|
-
return /* @__PURE__ */
|
|
16201
|
+
return /* @__PURE__ */ React190.createElement(
|
|
15944
16202
|
"form",
|
|
15945
16203
|
{
|
|
15946
16204
|
className: "Layer__form",
|
|
@@ -15949,7 +16207,7 @@ var ChartOfAccountsForm = ({
|
|
|
15949
16207
|
submitForm();
|
|
15950
16208
|
}
|
|
15951
16209
|
},
|
|
15952
|
-
/* @__PURE__ */
|
|
16210
|
+
/* @__PURE__ */ React190.createElement(Header2, { className: "Layer__chart-of-accounts__sidebar__header" }, /* @__PURE__ */ React190.createElement(HeaderRow, null, /* @__PURE__ */ React190.createElement(HeaderCol, null, /* @__PURE__ */ React190.createElement(Heading, { size: "secondary" /* secondary */, className: "title" }, (form == null ? void 0 : form.action) === "edit" ? (stringOverrides == null ? void 0 : stringOverrides.editModeHeader) || "Edit Account" : (stringOverrides == null ? void 0 : stringOverrides.createModeHeader) || "Add New Account")), /* @__PURE__ */ React190.createElement(HeaderCol, { className: "actions" }, /* @__PURE__ */ React190.createElement(
|
|
15953
16211
|
Button,
|
|
15954
16212
|
{
|
|
15955
16213
|
type: "button",
|
|
@@ -15958,7 +16216,7 @@ var ChartOfAccountsForm = ({
|
|
|
15958
16216
|
disabled: sendingForm
|
|
15959
16217
|
},
|
|
15960
16218
|
(stringOverrides == null ? void 0 : stringOverrides.cancelButton) || "Cancel"
|
|
15961
|
-
), apiError && /* @__PURE__ */
|
|
16219
|
+
), apiError && /* @__PURE__ */ React190.createElement(
|
|
15962
16220
|
RetryButton,
|
|
15963
16221
|
{
|
|
15964
16222
|
type: "submit",
|
|
@@ -15967,7 +16225,7 @@ var ChartOfAccountsForm = ({
|
|
|
15967
16225
|
disabled: sendingForm
|
|
15968
16226
|
},
|
|
15969
16227
|
(stringOverrides == null ? void 0 : stringOverrides.retryButton) || "Retry"
|
|
15970
|
-
), !apiError && /* @__PURE__ */
|
|
16228
|
+
), !apiError && /* @__PURE__ */ React190.createElement(
|
|
15971
16229
|
SubmitButton,
|
|
15972
16230
|
{
|
|
15973
16231
|
type: "submit",
|
|
@@ -15977,7 +16235,7 @@ var ChartOfAccountsForm = ({
|
|
|
15977
16235
|
},
|
|
15978
16236
|
(stringOverrides == null ? void 0 : stringOverrides.saveButton) || "Save"
|
|
15979
16237
|
)))),
|
|
15980
|
-
apiError && /* @__PURE__ */
|
|
16238
|
+
apiError && /* @__PURE__ */ React190.createElement(
|
|
15981
16239
|
Text,
|
|
15982
16240
|
{
|
|
15983
16241
|
size: "sm" /* sm */,
|
|
@@ -15985,15 +16243,15 @@ var ChartOfAccountsForm = ({
|
|
|
15985
16243
|
},
|
|
15986
16244
|
apiError
|
|
15987
16245
|
),
|
|
15988
|
-
entry && /* @__PURE__ */
|
|
15989
|
-
/* @__PURE__ */
|
|
16246
|
+
entry && /* @__PURE__ */ React190.createElement("div", { className: "Layer__chart-of-accounts__form-edit-entry" }, /* @__PURE__ */ React190.createElement(Text, { weight: "bold" /* bold */ }, entry.name), /* @__PURE__ */ React190.createElement(Text, { weight: "bold" /* bold */ }, "$", centsToDollars(entry.balance || 0))),
|
|
16247
|
+
/* @__PURE__ */ React190.createElement("div", { className: "Layer__chart-of-accounts__form" }, /* @__PURE__ */ React190.createElement(
|
|
15990
16248
|
InputGroup,
|
|
15991
16249
|
{
|
|
15992
16250
|
name: "parent",
|
|
15993
16251
|
label: (stringOverrides == null ? void 0 : stringOverrides.parentLabel) || "Parent",
|
|
15994
16252
|
inline: true
|
|
15995
16253
|
},
|
|
15996
|
-
/* @__PURE__ */
|
|
16254
|
+
/* @__PURE__ */ React190.createElement(
|
|
15997
16255
|
Select2,
|
|
15998
16256
|
{
|
|
15999
16257
|
options: parentOptions,
|
|
@@ -16002,14 +16260,14 @@ var ChartOfAccountsForm = ({
|
|
|
16002
16260
|
disabled: sendingForm
|
|
16003
16261
|
}
|
|
16004
16262
|
)
|
|
16005
|
-
), /* @__PURE__ */
|
|
16263
|
+
), /* @__PURE__ */ React190.createElement(
|
|
16006
16264
|
InputGroup,
|
|
16007
16265
|
{
|
|
16008
16266
|
name: "name",
|
|
16009
16267
|
label: (stringOverrides == null ? void 0 : stringOverrides.nameLabel) || "Name",
|
|
16010
16268
|
inline: true
|
|
16011
16269
|
},
|
|
16012
|
-
/* @__PURE__ */
|
|
16270
|
+
/* @__PURE__ */ React190.createElement(
|
|
16013
16271
|
Input,
|
|
16014
16272
|
{
|
|
16015
16273
|
name: "name",
|
|
@@ -16021,14 +16279,14 @@ var ChartOfAccountsForm = ({
|
|
|
16021
16279
|
onChange: (e) => changeFormData("name", e.target.value)
|
|
16022
16280
|
}
|
|
16023
16281
|
)
|
|
16024
|
-
), /* @__PURE__ */
|
|
16282
|
+
), /* @__PURE__ */ React190.createElement(
|
|
16025
16283
|
InputGroup,
|
|
16026
16284
|
{
|
|
16027
16285
|
name: "type",
|
|
16028
16286
|
label: (stringOverrides == null ? void 0 : stringOverrides.typeLabel) || "Type",
|
|
16029
16287
|
inline: true
|
|
16030
16288
|
},
|
|
16031
|
-
/* @__PURE__ */
|
|
16289
|
+
/* @__PURE__ */ React190.createElement(
|
|
16032
16290
|
Select2,
|
|
16033
16291
|
{
|
|
16034
16292
|
options: LEDGER_ACCOUNT_TYPES,
|
|
@@ -16039,14 +16297,14 @@ var ChartOfAccountsForm = ({
|
|
|
16039
16297
|
disabled: sendingForm || form.action === "edit" || form.data.parent !== void 0
|
|
16040
16298
|
}
|
|
16041
16299
|
)
|
|
16042
|
-
), /* @__PURE__ */
|
|
16300
|
+
), /* @__PURE__ */ React190.createElement(
|
|
16043
16301
|
InputGroup,
|
|
16044
16302
|
{
|
|
16045
16303
|
name: "subType",
|
|
16046
16304
|
label: (stringOverrides == null ? void 0 : stringOverrides.subTypeLabel) || "Sub-Type",
|
|
16047
16305
|
inline: true
|
|
16048
16306
|
},
|
|
16049
|
-
/* @__PURE__ */
|
|
16307
|
+
/* @__PURE__ */ React190.createElement(
|
|
16050
16308
|
Select2,
|
|
16051
16309
|
{
|
|
16052
16310
|
options: ((_g = form == null ? void 0 : form.data.type) == null ? void 0 : _g.value) !== void 0 ? LEDGER_ACCOUNT_SUBTYPES_FOR_TYPE[(_h = form == null ? void 0 : form.data.type) == null ? void 0 : _h.value] : LEDGER_ACCOUNT_SUBTYPES,
|
|
@@ -16055,14 +16313,14 @@ var ChartOfAccountsForm = ({
|
|
|
16055
16313
|
disabled: sendingForm
|
|
16056
16314
|
}
|
|
16057
16315
|
)
|
|
16058
|
-
), /* @__PURE__ */
|
|
16316
|
+
), /* @__PURE__ */ React190.createElement(
|
|
16059
16317
|
InputGroup,
|
|
16060
16318
|
{
|
|
16061
16319
|
name: "normality",
|
|
16062
16320
|
label: (stringOverrides == null ? void 0 : stringOverrides.normalityLabel) || "Normality",
|
|
16063
16321
|
inline: true
|
|
16064
16322
|
},
|
|
16065
|
-
/* @__PURE__ */
|
|
16323
|
+
/* @__PURE__ */ React190.createElement(
|
|
16066
16324
|
Select2,
|
|
16067
16325
|
{
|
|
16068
16326
|
options: NORMALITY_OPTIONS,
|
|
@@ -16075,7 +16333,7 @@ var ChartOfAccountsForm = ({
|
|
|
16075
16333
|
disabled: sendingForm
|
|
16076
16334
|
}
|
|
16077
16335
|
)
|
|
16078
|
-
), /* @__PURE__ */
|
|
16336
|
+
), /* @__PURE__ */ React190.createElement("div", { className: "actions" }, /* @__PURE__ */ React190.createElement(
|
|
16079
16337
|
Button,
|
|
16080
16338
|
{
|
|
16081
16339
|
type: "button",
|
|
@@ -16084,7 +16342,7 @@ var ChartOfAccountsForm = ({
|
|
|
16084
16342
|
disabled: sendingForm
|
|
16085
16343
|
},
|
|
16086
16344
|
(stringOverrides == null ? void 0 : stringOverrides.cancelButton) || "Cancel"
|
|
16087
|
-
), apiError && /* @__PURE__ */
|
|
16345
|
+
), apiError && /* @__PURE__ */ React190.createElement(
|
|
16088
16346
|
RetryButton,
|
|
16089
16347
|
{
|
|
16090
16348
|
type: "submit",
|
|
@@ -16093,7 +16351,7 @@ var ChartOfAccountsForm = ({
|
|
|
16093
16351
|
disabled: sendingForm
|
|
16094
16352
|
},
|
|
16095
16353
|
(stringOverrides == null ? void 0 : stringOverrides.retryButton) || "Retry"
|
|
16096
|
-
), !apiError && /* @__PURE__ */
|
|
16354
|
+
), !apiError && /* @__PURE__ */ React190.createElement(
|
|
16097
16355
|
SubmitButton,
|
|
16098
16356
|
{
|
|
16099
16357
|
type: "submit",
|
|
@@ -16111,17 +16369,17 @@ var ChartOfAccountsSidebar = ({
|
|
|
16111
16369
|
parentRef: _parentRef,
|
|
16112
16370
|
stringOverrides
|
|
16113
16371
|
}) => {
|
|
16114
|
-
return /* @__PURE__ */
|
|
16372
|
+
return /* @__PURE__ */ React191.createElement(ChartOfAccountsForm, { stringOverrides });
|
|
16115
16373
|
};
|
|
16116
16374
|
|
|
16117
16375
|
// src/components/ChartOfAccountsTable/ChartOfAccountsTable.tsx
|
|
16118
|
-
import
|
|
16376
|
+
import React193, { useContext as useContext31, useEffect as useEffect41, useState as useState50 } from "react";
|
|
16119
16377
|
|
|
16120
16378
|
// src/icons/Edit2.tsx
|
|
16121
|
-
import * as
|
|
16379
|
+
import * as React192 from "react";
|
|
16122
16380
|
var Edit2 = (_a) => {
|
|
16123
16381
|
var _b = _a, { size = 18 } = _b, props = __objRest(_b, ["size"]);
|
|
16124
|
-
return /* @__PURE__ */
|
|
16382
|
+
return /* @__PURE__ */ React192.createElement(
|
|
16125
16383
|
"svg",
|
|
16126
16384
|
__spreadProps(__spreadValues({
|
|
16127
16385
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -16131,7 +16389,7 @@ var Edit2 = (_a) => {
|
|
|
16131
16389
|
width: size,
|
|
16132
16390
|
height: size
|
|
16133
16391
|
}),
|
|
16134
|
-
/* @__PURE__ */
|
|
16392
|
+
/* @__PURE__ */ React192.createElement(
|
|
16135
16393
|
"path",
|
|
16136
16394
|
{
|
|
16137
16395
|
d: "M12.75 2.25C12.947 2.05301 13.1808 1.89676 13.4382 1.79015C13.6956 1.68355 13.9714 1.62868 14.25 1.62868C14.5286 1.62868 14.8044 1.68355 15.0618 1.79015C15.3192 1.89676 15.553 2.05301 15.75 2.25C15.947 2.44698 16.1032 2.68083 16.2098 2.9382C16.3165 3.19557 16.3713 3.47142 16.3713 3.75C16.3713 4.02857 16.3165 4.30442 16.2098 4.56179C16.1032 4.81916 15.947 5.05302 15.75 5.25L5.625 15.375L1.5 16.5L2.625 12.375L12.75 2.25Z",
|
|
@@ -16154,7 +16412,7 @@ var ChartOfAccountsTable = ({
|
|
|
16154
16412
|
cumulativeIndex,
|
|
16155
16413
|
accountsLength,
|
|
16156
16414
|
templateAccountsEditable = true
|
|
16157
|
-
}) => /* @__PURE__ */
|
|
16415
|
+
}) => /* @__PURE__ */ React193.createElement(TableProvider, null, /* @__PURE__ */ React193.createElement(
|
|
16158
16416
|
ChartOfAccountsTableContent,
|
|
16159
16417
|
{
|
|
16160
16418
|
view,
|
|
@@ -16178,14 +16436,14 @@ var ChartOfAccountsTableContent = ({
|
|
|
16178
16436
|
const { editAccount } = useContext31(ChartOfAccountsContext);
|
|
16179
16437
|
const { isOpen, setIsOpen } = useTableExpandRow();
|
|
16180
16438
|
const [accountsRowKeys, setAccountsRowKeys] = useState50([]);
|
|
16181
|
-
|
|
16439
|
+
useEffect41(() => {
|
|
16182
16440
|
if (expandAll === "expanded") {
|
|
16183
16441
|
setIsOpen(accountsRowKeys);
|
|
16184
16442
|
} else if (expandAll === "collapsed") {
|
|
16185
16443
|
setIsOpen([]);
|
|
16186
16444
|
}
|
|
16187
16445
|
}, [expandAll]);
|
|
16188
|
-
|
|
16446
|
+
useEffect41(() => {
|
|
16189
16447
|
const defaultExpanded = data.accounts.map(
|
|
16190
16448
|
(account) => "coa-row-" + account.id
|
|
16191
16449
|
);
|
|
@@ -16204,7 +16462,7 @@ var ChartOfAccountsTableContent = ({
|
|
|
16204
16462
|
var _a, _b;
|
|
16205
16463
|
const expandable = !!account.sub_accounts && account.sub_accounts.length > 0;
|
|
16206
16464
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
16207
|
-
return /* @__PURE__ */
|
|
16465
|
+
return /* @__PURE__ */ React193.createElement(React193.Fragment, { key: rowKey + "-" + index }, /* @__PURE__ */ React193.createElement(
|
|
16208
16466
|
TableRow,
|
|
16209
16467
|
{
|
|
16210
16468
|
rowKey: rowKey + "-" + index,
|
|
@@ -16216,7 +16474,7 @@ var ChartOfAccountsTableContent = ({
|
|
|
16216
16474
|
},
|
|
16217
16475
|
depth
|
|
16218
16476
|
},
|
|
16219
|
-
/* @__PURE__ */
|
|
16477
|
+
/* @__PURE__ */ React193.createElement(
|
|
16220
16478
|
TableCell,
|
|
16221
16479
|
{
|
|
16222
16480
|
withExpandIcon: expandable,
|
|
@@ -16227,14 +16485,14 @@ var ChartOfAccountsTableContent = ({
|
|
|
16227
16485
|
},
|
|
16228
16486
|
account.name
|
|
16229
16487
|
),
|
|
16230
|
-
/* @__PURE__ */
|
|
16231
|
-
/* @__PURE__ */
|
|
16232
|
-
/* @__PURE__ */
|
|
16233
|
-
/* @__PURE__ */
|
|
16488
|
+
/* @__PURE__ */ React193.createElement(TableCell, null, (_a = account.account_type) == null ? void 0 : _a.display_name),
|
|
16489
|
+
/* @__PURE__ */ React193.createElement(TableCell, null, (_b = account.account_subtype) == null ? void 0 : _b.display_name),
|
|
16490
|
+
/* @__PURE__ */ React193.createElement(TableCell, { isCurrency: true }, account.balance),
|
|
16491
|
+
/* @__PURE__ */ React193.createElement(TableCell, null, /* @__PURE__ */ React193.createElement("span", { className: "Layer__coa__actions" }, /* @__PURE__ */ React193.createElement(
|
|
16234
16492
|
Button,
|
|
16235
16493
|
{
|
|
16236
16494
|
variant: "secondary" /* secondary */,
|
|
16237
|
-
rightIcon: /* @__PURE__ */
|
|
16495
|
+
rightIcon: /* @__PURE__ */ React193.createElement(Edit2_default, { size: 12 }),
|
|
16238
16496
|
iconOnly: true,
|
|
16239
16497
|
disabled: !templateAccountsEditable && !!account.stable_name,
|
|
16240
16498
|
onClick: (e) => {
|
|
@@ -16256,7 +16514,7 @@ var ChartOfAccountsTableContent = ({
|
|
|
16256
16514
|
);
|
|
16257
16515
|
}));
|
|
16258
16516
|
};
|
|
16259
|
-
return /* @__PURE__ */
|
|
16517
|
+
return /* @__PURE__ */ React193.createElement(Table, null, /* @__PURE__ */ React193.createElement(TableHead, null, /* @__PURE__ */ React193.createElement(TableRow, { isHeadRow: true, rowKey: "charts-of-accounts-head-row" }, /* @__PURE__ */ React193.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.nameColumnHeader) || "Name"), /* @__PURE__ */ React193.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.typeColumnHeader) || "Type"), /* @__PURE__ */ React193.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.subtypeColumnHeader) || "Sub-Type"), /* @__PURE__ */ React193.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.balanceColumnHeader) || "Balance"), /* @__PURE__ */ React193.createElement(TableCell, { isHeaderCell: true }))), /* @__PURE__ */ React193.createElement(TableBody, null, !error && data.accounts.map(
|
|
16260
16518
|
(account, idx) => renderChartOfAccountsDesktopRow(
|
|
16261
16519
|
account,
|
|
16262
16520
|
idx,
|
|
@@ -16282,10 +16540,10 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
16282
16540
|
const [expandAll, setExpandAll] = useState51();
|
|
16283
16541
|
const cumulativeIndex = 0;
|
|
16284
16542
|
const accountsLength = (_a = data == null ? void 0 : data.accounts.length) != null ? _a : 0;
|
|
16285
|
-
return /* @__PURE__ */
|
|
16543
|
+
return /* @__PURE__ */ React194.createElement(
|
|
16286
16544
|
Panel,
|
|
16287
16545
|
{
|
|
16288
|
-
sidebar: /* @__PURE__ */
|
|
16546
|
+
sidebar: /* @__PURE__ */ React194.createElement(
|
|
16289
16547
|
ChartOfAccountsSidebar,
|
|
16290
16548
|
{
|
|
16291
16549
|
parentRef: containerRef,
|
|
@@ -16295,7 +16553,7 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
16295
16553
|
sidebarIsOpen: Boolean(form),
|
|
16296
16554
|
parentRef: containerRef
|
|
16297
16555
|
},
|
|
16298
|
-
/* @__PURE__ */
|
|
16556
|
+
/* @__PURE__ */ React194.createElement(Header2, { className: `Layer__${COMPONENT_NAME5}__header`, asHeader: true, rounded: true }, /* @__PURE__ */ React194.createElement(HeaderRow, null, /* @__PURE__ */ React194.createElement(HeaderCol, null, /* @__PURE__ */ React194.createElement(
|
|
16299
16557
|
Heading,
|
|
16300
16558
|
{
|
|
16301
16559
|
className: `Layer__${COMPONENT_NAME5}__title`,
|
|
@@ -16303,13 +16561,13 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
16303
16561
|
},
|
|
16304
16562
|
(stringOverrides == null ? void 0 : stringOverrides.headerText) || "Chart of Accounts"
|
|
16305
16563
|
)))),
|
|
16306
|
-
/* @__PURE__ */
|
|
16564
|
+
/* @__PURE__ */ React194.createElement(Header2, { className: `Layer__${COMPONENT_NAME5}__header`, sticky: true }, /* @__PURE__ */ React194.createElement(HeaderRow, null, /* @__PURE__ */ React194.createElement(HeaderCol, null, /* @__PURE__ */ React194.createElement(
|
|
16307
16565
|
Heading,
|
|
16308
16566
|
{
|
|
16309
16567
|
size: "secondary" /* secondary */,
|
|
16310
16568
|
className: `Layer__${COMPONENT_NAME5}__subtitle`
|
|
16311
16569
|
},
|
|
16312
|
-
withDateControl || withExpandAllButton ? /* @__PURE__ */
|
|
16570
|
+
withDateControl || withExpandAllButton ? /* @__PURE__ */ React194.createElement("div", { className: "Layer__header__actions-col" }, withDateControl && /* @__PURE__ */ React194.createElement(ChartOfAccountsDatePicker, null), withExpandAllButton && /* @__PURE__ */ React194.createElement(
|
|
16313
16571
|
ExpandCollapseButton,
|
|
16314
16572
|
{
|
|
16315
16573
|
iconOnly: view === "mobile",
|
|
@@ -16320,17 +16578,17 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
16320
16578
|
variant: "secondary" /* secondary */
|
|
16321
16579
|
}
|
|
16322
16580
|
)) : null
|
|
16323
|
-
)), /* @__PURE__ */
|
|
16581
|
+
)), /* @__PURE__ */ React194.createElement(HeaderCol, null, /* @__PURE__ */ React194.createElement(
|
|
16324
16582
|
Button,
|
|
16325
16583
|
{
|
|
16326
16584
|
onClick: () => addAccount(),
|
|
16327
16585
|
disabled: isLoading,
|
|
16328
16586
|
iconOnly: ["mobile", "tablet"].includes(view),
|
|
16329
|
-
leftIcon: ["mobile", "tablet"].includes(view) && /* @__PURE__ */
|
|
16587
|
+
leftIcon: ["mobile", "tablet"].includes(view) && /* @__PURE__ */ React194.createElement(Plus_default, { size: 14 })
|
|
16330
16588
|
},
|
|
16331
16589
|
(stringOverrides == null ? void 0 : stringOverrides.addAccountButtonText) || "Add Account"
|
|
16332
16590
|
)))),
|
|
16333
|
-
data && /* @__PURE__ */
|
|
16591
|
+
data && /* @__PURE__ */ React194.createElement(
|
|
16334
16592
|
ChartOfAccountsTable,
|
|
16335
16593
|
{
|
|
16336
16594
|
view,
|
|
@@ -16343,7 +16601,7 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
16343
16601
|
templateAccountsEditable
|
|
16344
16602
|
}
|
|
16345
16603
|
),
|
|
16346
|
-
error ? /* @__PURE__ */
|
|
16604
|
+
error ? /* @__PURE__ */ React194.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React194.createElement(
|
|
16347
16605
|
DataState,
|
|
16348
16606
|
{
|
|
16349
16607
|
status: "failed" /* failed */,
|
|
@@ -16353,8 +16611,8 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
16353
16611
|
isLoading: isValidating || isLoading
|
|
16354
16612
|
}
|
|
16355
16613
|
)) : null,
|
|
16356
|
-
(!data || isLoading) && !error ? /* @__PURE__ */
|
|
16357
|
-
!isLoading && !error && (data == null ? void 0 : data.accounts.length) === 0 ? /* @__PURE__ */
|
|
16614
|
+
(!data || isLoading) && !error ? /* @__PURE__ */ React194.createElement("div", { className: `Layer__${COMPONENT_NAME5}__loader-container` }, /* @__PURE__ */ React194.createElement(Loader2, null)) : null,
|
|
16615
|
+
!isLoading && !error && (data == null ? void 0 : data.accounts.length) === 0 ? /* @__PURE__ */ React194.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React194.createElement(
|
|
16358
16616
|
DataState,
|
|
16359
16617
|
{
|
|
16360
16618
|
status: "info" /* info */,
|
|
@@ -16368,15 +16626,15 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
16368
16626
|
};
|
|
16369
16627
|
|
|
16370
16628
|
// src/components/LedgerAccount/LedgerAccountIndex.tsx
|
|
16371
|
-
import
|
|
16629
|
+
import React201, {
|
|
16372
16630
|
useContext as useContext35,
|
|
16373
|
-
useEffect as
|
|
16631
|
+
useEffect as useEffect43,
|
|
16374
16632
|
useMemo as useMemo27,
|
|
16375
16633
|
useState as useState53
|
|
16376
16634
|
} from "react";
|
|
16377
16635
|
|
|
16378
16636
|
// src/components/LedgerAccountEntryDetails/LedgerAccountEntryDetails.tsx
|
|
16379
|
-
import
|
|
16637
|
+
import React199, { useContext as useContext33, useMemo as useMemo26 } from "react";
|
|
16380
16638
|
|
|
16381
16639
|
// src/utils/journal.ts
|
|
16382
16640
|
var getAccountIdentifierPayload = (journalLineItem) => {
|
|
@@ -16400,14 +16658,14 @@ var entryNumber = (entry) => {
|
|
|
16400
16658
|
};
|
|
16401
16659
|
|
|
16402
16660
|
// src/components/Card/Card.tsx
|
|
16403
|
-
import
|
|
16661
|
+
import React195 from "react";
|
|
16404
16662
|
import classNames62 from "classnames";
|
|
16405
16663
|
var Card = ({ children, className }) => {
|
|
16406
|
-
return /* @__PURE__ */
|
|
16664
|
+
return /* @__PURE__ */ React195.createElement("div", { className: classNames62("Layer__card", className) }, children);
|
|
16407
16665
|
};
|
|
16408
16666
|
|
|
16409
16667
|
// src/components/DateTime/DateTime.tsx
|
|
16410
|
-
import
|
|
16668
|
+
import React196 from "react";
|
|
16411
16669
|
import { parseISO as parseISO12, format as formatTime10 } from "date-fns";
|
|
16412
16670
|
var DateTime = ({
|
|
16413
16671
|
value,
|
|
@@ -16418,11 +16676,11 @@ var DateTime = ({
|
|
|
16418
16676
|
onlyTime
|
|
16419
16677
|
}) => {
|
|
16420
16678
|
if (format8) {
|
|
16421
|
-
return /* @__PURE__ */
|
|
16679
|
+
return /* @__PURE__ */ React196.createElement(Text, { className: "Layer__datetime" }, formatTime10(parseISO12(value), format8));
|
|
16422
16680
|
}
|
|
16423
16681
|
const date = formatTime10(parseISO12(value), dateFormat != null ? dateFormat : DATE_FORMAT);
|
|
16424
16682
|
const time = formatTime10(parseISO12(value), timeFormat != null ? timeFormat : TIME_FORMAT);
|
|
16425
|
-
return /* @__PURE__ */
|
|
16683
|
+
return /* @__PURE__ */ React196.createElement(Text, { className: "Layer__datetime" }, !onlyTime && /* @__PURE__ */ React196.createElement(
|
|
16426
16684
|
Text,
|
|
16427
16685
|
{
|
|
16428
16686
|
as: "span",
|
|
@@ -16431,7 +16689,7 @@ var DateTime = ({
|
|
|
16431
16689
|
className: "Layer__datetime__date"
|
|
16432
16690
|
},
|
|
16433
16691
|
date
|
|
16434
|
-
), !onlyDate && /* @__PURE__ */
|
|
16692
|
+
), !onlyDate && /* @__PURE__ */ React196.createElement(
|
|
16435
16693
|
Text,
|
|
16436
16694
|
{
|
|
16437
16695
|
as: "span",
|
|
@@ -16444,7 +16702,7 @@ var DateTime = ({
|
|
|
16444
16702
|
};
|
|
16445
16703
|
|
|
16446
16704
|
// src/components/DetailsList/DetailsList.tsx
|
|
16447
|
-
import
|
|
16705
|
+
import React197 from "react";
|
|
16448
16706
|
import classNames63 from "classnames";
|
|
16449
16707
|
var DetailsList = ({
|
|
16450
16708
|
title,
|
|
@@ -16453,14 +16711,14 @@ var DetailsList = ({
|
|
|
16453
16711
|
titleClassName,
|
|
16454
16712
|
actions
|
|
16455
16713
|
}) => {
|
|
16456
|
-
return /* @__PURE__ */
|
|
16714
|
+
return /* @__PURE__ */ React197.createElement("div", { className: classNames63("Layer__details-list", className) }, title && /* @__PURE__ */ React197.createElement(Header, { className: titleClassName }, /* @__PURE__ */ React197.createElement(Heading, { size: "secondary" /* secondary */ }, title), actions && /* @__PURE__ */ React197.createElement("div", { className: "Layer__details-list__actions" }, actions)), /* @__PURE__ */ React197.createElement("ul", { className: "Layer__details-list__list" }, children));
|
|
16457
16715
|
};
|
|
16458
16716
|
|
|
16459
16717
|
// src/components/DetailsList/DetailsListItem.tsx
|
|
16460
|
-
import
|
|
16718
|
+
import React198 from "react";
|
|
16461
16719
|
var renderValue = (value) => {
|
|
16462
16720
|
if (typeof value === "string") {
|
|
16463
|
-
return /* @__PURE__ */
|
|
16721
|
+
return /* @__PURE__ */ React198.createElement(Text, { weight: "bold" /* bold */, size: "sm" /* sm */ }, value);
|
|
16464
16722
|
}
|
|
16465
16723
|
return value;
|
|
16466
16724
|
};
|
|
@@ -16469,7 +16727,7 @@ var DetailsListItem = ({
|
|
|
16469
16727
|
children,
|
|
16470
16728
|
isLoading
|
|
16471
16729
|
}) => {
|
|
16472
|
-
return /* @__PURE__ */
|
|
16730
|
+
return /* @__PURE__ */ React198.createElement("li", { className: "Layer__details-list-item" }, /* @__PURE__ */ React198.createElement("label", { className: "Layer__details-list-item__label" }, label), /* @__PURE__ */ React198.createElement("span", { className: "Layer__details-list-item__value" }, isLoading ? /* @__PURE__ */ React198.createElement(SkeletonLoader, null) : renderValue(children)));
|
|
16473
16731
|
};
|
|
16474
16732
|
|
|
16475
16733
|
// src/components/LedgerAccountEntryDetails/LedgerAccountEntryDetails.tsx
|
|
@@ -16480,19 +16738,19 @@ var SourceDetailView = ({
|
|
|
16480
16738
|
switch (source.type) {
|
|
16481
16739
|
case "Transaction_Ledger_Entry_Source": {
|
|
16482
16740
|
const transactionSource = source;
|
|
16483
|
-
return /* @__PURE__ */
|
|
16741
|
+
return /* @__PURE__ */ React199.createElement(React199.Fragment, null, /* @__PURE__ */ React199.createElement(
|
|
16484
16742
|
DetailsListItem,
|
|
16485
16743
|
{
|
|
16486
16744
|
label: (stringOverrides == null ? void 0 : stringOverrides.accountNameLabel) || "Account name"
|
|
16487
16745
|
},
|
|
16488
16746
|
transactionSource.account_name
|
|
16489
|
-
), /* @__PURE__ */
|
|
16747
|
+
), /* @__PURE__ */ React199.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.dateLabel) || "Date" }, /* @__PURE__ */ React199.createElement(DateTime, { value: transactionSource.date })), /* @__PURE__ */ React199.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(transactionSource.amount)}`), /* @__PURE__ */ React199.createElement(
|
|
16490
16748
|
DetailsListItem,
|
|
16491
16749
|
{
|
|
16492
16750
|
label: (stringOverrides == null ? void 0 : stringOverrides.directionLabel) || "Direction"
|
|
16493
16751
|
},
|
|
16494
16752
|
transactionSource.direction
|
|
16495
|
-
), /* @__PURE__ */
|
|
16753
|
+
), /* @__PURE__ */ React199.createElement(
|
|
16496
16754
|
DetailsListItem,
|
|
16497
16755
|
{
|
|
16498
16756
|
label: (stringOverrides == null ? void 0 : stringOverrides.counterpartyLabel) || "Counterparty"
|
|
@@ -16502,23 +16760,23 @@ var SourceDetailView = ({
|
|
|
16502
16760
|
}
|
|
16503
16761
|
case "Invoice_Ledger_Entry_Source": {
|
|
16504
16762
|
const invoiceSource = source;
|
|
16505
|
-
return /* @__PURE__ */
|
|
16763
|
+
return /* @__PURE__ */ React199.createElement(React199.Fragment, null, /* @__PURE__ */ React199.createElement(
|
|
16506
16764
|
DetailsListItem,
|
|
16507
16765
|
{
|
|
16508
16766
|
label: (stringOverrides == null ? void 0 : stringOverrides.invoiceNumberLabel) || "Invoice number"
|
|
16509
16767
|
},
|
|
16510
16768
|
invoiceSource.invoice_number
|
|
16511
|
-
), /* @__PURE__ */
|
|
16769
|
+
), /* @__PURE__ */ React199.createElement(
|
|
16512
16770
|
DetailsListItem,
|
|
16513
16771
|
{
|
|
16514
16772
|
label: (stringOverrides == null ? void 0 : stringOverrides.recipientNameLabel) || "Recipient name"
|
|
16515
16773
|
},
|
|
16516
16774
|
invoiceSource.recipient_name
|
|
16517
|
-
), /* @__PURE__ */
|
|
16775
|
+
), /* @__PURE__ */ React199.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.dateLabel) || "Date" }, /* @__PURE__ */ React199.createElement(DateTime, { value: invoiceSource.date })), /* @__PURE__ */ React199.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(invoiceSource.amount)}`));
|
|
16518
16776
|
}
|
|
16519
16777
|
case "Manual_Ledger_Entry_Source": {
|
|
16520
16778
|
const manualSource = source;
|
|
16521
|
-
return /* @__PURE__ */
|
|
16779
|
+
return /* @__PURE__ */ React199.createElement(React199.Fragment, null, /* @__PURE__ */ React199.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.memoLabel) || "Memo" }, manualSource.memo), /* @__PURE__ */ React199.createElement(
|
|
16522
16780
|
DetailsListItem,
|
|
16523
16781
|
{
|
|
16524
16782
|
label: (stringOverrides == null ? void 0 : stringOverrides.createdByLabel) || "Created by"
|
|
@@ -16528,17 +16786,17 @@ var SourceDetailView = ({
|
|
|
16528
16786
|
}
|
|
16529
16787
|
case "Invoice_Payment_Ledger_Entry_Source": {
|
|
16530
16788
|
const invoicePaymentSource = source;
|
|
16531
|
-
return /* @__PURE__ */
|
|
16789
|
+
return /* @__PURE__ */ React199.createElement(React199.Fragment, null, /* @__PURE__ */ React199.createElement(
|
|
16532
16790
|
DetailsListItem,
|
|
16533
16791
|
{
|
|
16534
16792
|
label: (stringOverrides == null ? void 0 : stringOverrides.invoiceNumberLabel) || "Invoice number"
|
|
16535
16793
|
},
|
|
16536
16794
|
invoicePaymentSource.invoice_number
|
|
16537
|
-
), /* @__PURE__ */
|
|
16795
|
+
), /* @__PURE__ */ React199.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(invoicePaymentSource.amount)}`));
|
|
16538
16796
|
}
|
|
16539
16797
|
case "Refund_Ledger_Entry_Source": {
|
|
16540
16798
|
const refundSource = source;
|
|
16541
|
-
return /* @__PURE__ */
|
|
16799
|
+
return /* @__PURE__ */ React199.createElement(React199.Fragment, null, /* @__PURE__ */ React199.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(refundSource.refunded_to_customer_amount)}`), /* @__PURE__ */ React199.createElement(
|
|
16542
16800
|
DetailsListItem,
|
|
16543
16801
|
{
|
|
16544
16802
|
label: (stringOverrides == null ? void 0 : stringOverrides.recipientNameLabel) || "Recipient name"
|
|
@@ -16548,7 +16806,7 @@ var SourceDetailView = ({
|
|
|
16548
16806
|
}
|
|
16549
16807
|
case "Refund_Payment_Ledger_Entry_Source": {
|
|
16550
16808
|
const refundSource = source;
|
|
16551
|
-
return /* @__PURE__ */
|
|
16809
|
+
return /* @__PURE__ */ React199.createElement(React199.Fragment, null, /* @__PURE__ */ React199.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(refundSource.refunded_to_customer_amount)}`), /* @__PURE__ */ React199.createElement(
|
|
16552
16810
|
DetailsListItem,
|
|
16553
16811
|
{
|
|
16554
16812
|
label: (stringOverrides == null ? void 0 : stringOverrides.recipientNameLabel) || "Recipient name"
|
|
@@ -16558,7 +16816,7 @@ var SourceDetailView = ({
|
|
|
16558
16816
|
}
|
|
16559
16817
|
case "Opening_Balance_Ledger_Entry_Source": {
|
|
16560
16818
|
const openingBalanceSource = source;
|
|
16561
|
-
return /* @__PURE__ */
|
|
16819
|
+
return /* @__PURE__ */ React199.createElement(React199.Fragment, null, /* @__PURE__ */ React199.createElement(
|
|
16562
16820
|
DetailsListItem,
|
|
16563
16821
|
{
|
|
16564
16822
|
label: (stringOverrides == null ? void 0 : stringOverrides.accountNameLabel) || "Account name"
|
|
@@ -16568,7 +16826,7 @@ var SourceDetailView = ({
|
|
|
16568
16826
|
}
|
|
16569
16827
|
case "Payout_Ledger_Entry_Source": {
|
|
16570
16828
|
const payoutSource = source;
|
|
16571
|
-
return /* @__PURE__ */
|
|
16829
|
+
return /* @__PURE__ */ React199.createElement(React199.Fragment, null, /* @__PURE__ */ React199.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(payoutSource.paid_out_amount)}`), /* @__PURE__ */ React199.createElement(
|
|
16572
16830
|
DetailsListItem,
|
|
16573
16831
|
{
|
|
16574
16832
|
label: (stringOverrides == null ? void 0 : stringOverrides.processorLabel) || "Processor"
|
|
@@ -16598,15 +16856,15 @@ var LedgerAccountEntryDetails = ({
|
|
|
16598
16856
|
});
|
|
16599
16857
|
return { totalDebit: totalDebit2, totalCredit: totalCredit2 };
|
|
16600
16858
|
}, [entryData]);
|
|
16601
|
-
return /* @__PURE__ */
|
|
16859
|
+
return /* @__PURE__ */ React199.createElement("div", { className: "Layer__ledger-account__entry-details" }, /* @__PURE__ */ React199.createElement(Header2, { className: "Layer__ledger-account__entry-details__header" }, /* @__PURE__ */ React199.createElement(HeaderRow, null, /* @__PURE__ */ React199.createElement(HeaderCol, { className: "Layer__hidden-lg Layer__hidden-xl" }, /* @__PURE__ */ React199.createElement(BackButton, { onClick: closeSelectedEntry }), /* @__PURE__ */ React199.createElement(Heading, { size: "secondary" /* secondary */ }, (stringOverrides == null ? void 0 : stringOverrides.title) || "Transaction details")), /* @__PURE__ */ React199.createElement(HeaderCol, { className: "Layer__show-lg Layer__show-xl" }, /* @__PURE__ */ React199.createElement(Heading, { size: "secondary" /* secondary */ }, ((_a = stringOverrides == null ? void 0 : stringOverrides.transactionSource) == null ? void 0 : _a.header) || "Transaction source")), /* @__PURE__ */ React199.createElement(HeaderCol, { className: "Layer__show-lg Layer__show-xl" }, /* @__PURE__ */ React199.createElement(CloseButton, { onClick: closeSelectedEntry })))), /* @__PURE__ */ React199.createElement(
|
|
16602
16860
|
DetailsList,
|
|
16603
16861
|
{
|
|
16604
16862
|
title: ((_b = stringOverrides == null ? void 0 : stringOverrides.transactionSource) == null ? void 0 : _b.header) || "Transaction source",
|
|
16605
16863
|
titleClassName: "Layer__hidden-lg Layer__hidden-xl",
|
|
16606
|
-
actions: /* @__PURE__ */
|
|
16864
|
+
actions: /* @__PURE__ */ React199.createElement(
|
|
16607
16865
|
Button,
|
|
16608
16866
|
{
|
|
16609
|
-
rightIcon: /* @__PURE__ */
|
|
16867
|
+
rightIcon: /* @__PURE__ */ React199.createElement(X_default, null),
|
|
16610
16868
|
iconOnly: true,
|
|
16611
16869
|
onClick: closeSelectedEntry,
|
|
16612
16870
|
variant: "secondary" /* secondary */,
|
|
@@ -16614,16 +16872,16 @@ var LedgerAccountEntryDetails = ({
|
|
|
16614
16872
|
}
|
|
16615
16873
|
)
|
|
16616
16874
|
},
|
|
16617
|
-
/* @__PURE__ */
|
|
16875
|
+
/* @__PURE__ */ React199.createElement(
|
|
16618
16876
|
DetailsListItem,
|
|
16619
16877
|
{
|
|
16620
16878
|
label: ((_d = (_c = stringOverrides == null ? void 0 : stringOverrides.transactionSource) == null ? void 0 : _c.details) == null ? void 0 : _d.sourceLabel) || "Source",
|
|
16621
16879
|
isLoading: isLoadingEntry
|
|
16622
16880
|
},
|
|
16623
|
-
/* @__PURE__ */
|
|
16881
|
+
/* @__PURE__ */ React199.createElement(Badge, null, (_e = entryData == null ? void 0 : entryData.source) == null ? void 0 : _e.entity_name)
|
|
16624
16882
|
),
|
|
16625
|
-
((_f = entryData == null ? void 0 : entryData.source) == null ? void 0 : _f.display_description) && /* @__PURE__ */
|
|
16626
|
-
), /* @__PURE__ */
|
|
16883
|
+
((_f = entryData == null ? void 0 : entryData.source) == null ? void 0 : _f.display_description) && /* @__PURE__ */ React199.createElement(SourceDetailView, { source: entryData == null ? void 0 : entryData.source })
|
|
16884
|
+
), /* @__PURE__ */ React199.createElement(
|
|
16627
16885
|
DetailsList,
|
|
16628
16886
|
{
|
|
16629
16887
|
title: ((_g = stringOverrides == null ? void 0 : stringOverrides.journalEntry) == null ? void 0 : _g.header) ? (_h = stringOverrides == null ? void 0 : stringOverrides.journalEntry) == null ? void 0 : _h.header(
|
|
@@ -16631,7 +16889,7 @@ var LedgerAccountEntryDetails = ({
|
|
|
16631
16889
|
) : `Journal Entry ${entryData ? entryNumber(entryData) : ""}`,
|
|
16632
16890
|
className: "Layer__border-top"
|
|
16633
16891
|
},
|
|
16634
|
-
/* @__PURE__ */
|
|
16892
|
+
/* @__PURE__ */ React199.createElement(
|
|
16635
16893
|
DetailsListItem,
|
|
16636
16894
|
{
|
|
16637
16895
|
label: ((_j = (_i = stringOverrides == null ? void 0 : stringOverrides.journalEntry) == null ? void 0 : _i.details) == null ? void 0 : _j.entryTypeLabel) || "Entry type",
|
|
@@ -16639,23 +16897,23 @@ var LedgerAccountEntryDetails = ({
|
|
|
16639
16897
|
},
|
|
16640
16898
|
humanizeEnum((_k = entryData == null ? void 0 : entryData.entry_type) != null ? _k : "")
|
|
16641
16899
|
),
|
|
16642
|
-
/* @__PURE__ */
|
|
16900
|
+
/* @__PURE__ */ React199.createElement(
|
|
16643
16901
|
DetailsListItem,
|
|
16644
16902
|
{
|
|
16645
16903
|
label: ((_m = (_l = stringOverrides == null ? void 0 : stringOverrides.journalEntry) == null ? void 0 : _l.details) == null ? void 0 : _m.dateLabel) || "Date",
|
|
16646
16904
|
isLoading: isLoadingEntry
|
|
16647
16905
|
},
|
|
16648
|
-
(entryData == null ? void 0 : entryData.entry_at) && /* @__PURE__ */
|
|
16906
|
+
(entryData == null ? void 0 : entryData.entry_at) && /* @__PURE__ */ React199.createElement(DateTime, { value: entryData == null ? void 0 : entryData.entry_at })
|
|
16649
16907
|
),
|
|
16650
|
-
/* @__PURE__ */
|
|
16908
|
+
/* @__PURE__ */ React199.createElement(
|
|
16651
16909
|
DetailsListItem,
|
|
16652
16910
|
{
|
|
16653
16911
|
label: ((_o = (_n = stringOverrides == null ? void 0 : stringOverrides.journalEntry) == null ? void 0 : _n.details) == null ? void 0 : _o.creationDateLabel) || "Creation date",
|
|
16654
16912
|
isLoading: isLoadingEntry
|
|
16655
16913
|
},
|
|
16656
|
-
(entryData == null ? void 0 : entryData.date) && /* @__PURE__ */
|
|
16914
|
+
(entryData == null ? void 0 : entryData.date) && /* @__PURE__ */ React199.createElement(DateTime, { value: entryData == null ? void 0 : entryData.date })
|
|
16657
16915
|
),
|
|
16658
|
-
(entryData == null ? void 0 : entryData.reversal_id) && /* @__PURE__ */
|
|
16916
|
+
(entryData == null ? void 0 : entryData.reversal_id) && /* @__PURE__ */ React199.createElement(
|
|
16659
16917
|
DetailsListItem,
|
|
16660
16918
|
{
|
|
16661
16919
|
label: ((_q = (_p = stringOverrides == null ? void 0 : stringOverrides.journalEntry) == null ? void 0 : _p.details) == null ? void 0 : _q.reversalLabel) || "Reversal",
|
|
@@ -16663,40 +16921,40 @@ var LedgerAccountEntryDetails = ({
|
|
|
16663
16921
|
},
|
|
16664
16922
|
entryData == null ? void 0 : entryData.reversal_id.substring(0, 5)
|
|
16665
16923
|
)
|
|
16666
|
-
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */
|
|
16924
|
+
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */ React199.createElement("div", { className: "Layer__ledger-account__entry-details__line-items" }, /* @__PURE__ */ React199.createElement(Card, null, /* @__PURE__ */ React199.createElement(
|
|
16667
16925
|
Table,
|
|
16668
16926
|
{
|
|
16669
16927
|
componentName: "ledger-account__entry-details",
|
|
16670
16928
|
borderCollapse: "collapse"
|
|
16671
16929
|
},
|
|
16672
|
-
/* @__PURE__ */
|
|
16673
|
-
/* @__PURE__ */
|
|
16930
|
+
/* @__PURE__ */ React199.createElement(TableHead, null, /* @__PURE__ */ React199.createElement(TableRow, { rowKey: "soc-flow-head-row", isHeadRow: true }, /* @__PURE__ */ React199.createElement(TableCell, null, ((_r = stringOverrides == null ? void 0 : stringOverrides.lineItemsTable) == null ? void 0 : _r.lineItemsColumnHeader) || "Line items"), /* @__PURE__ */ React199.createElement(TableCell, { align: "right" /* RIGHT */ }, ((_s = stringOverrides == null ? void 0 : stringOverrides.lineItemsTable) == null ? void 0 : _s.debitColumnHeader) || "Debit"), /* @__PURE__ */ React199.createElement(TableCell, { align: "right" /* RIGHT */ }, ((_t = stringOverrides == null ? void 0 : stringOverrides.lineItemsTable) == null ? void 0 : _t.creditColumnHeader) || "Credit"))),
|
|
16931
|
+
/* @__PURE__ */ React199.createElement(TableBody, null, (_u = entryData == null ? void 0 : entryData.line_items) == null ? void 0 : _u.map((item, index) => {
|
|
16674
16932
|
var _a2;
|
|
16675
|
-
return /* @__PURE__ */
|
|
16933
|
+
return /* @__PURE__ */ React199.createElement(
|
|
16676
16934
|
TableRow,
|
|
16677
16935
|
{
|
|
16678
16936
|
key: `ledger-line-item-${index}`,
|
|
16679
16937
|
rowKey: `ledger-line-item-${index}`
|
|
16680
16938
|
},
|
|
16681
|
-
/* @__PURE__ */
|
|
16682
|
-
/* @__PURE__ */
|
|
16683
|
-
/* @__PURE__ */
|
|
16939
|
+
/* @__PURE__ */ React199.createElement(TableCell, null, ((_a2 = item.account) == null ? void 0 : _a2.name) || ""),
|
|
16940
|
+
/* @__PURE__ */ React199.createElement(TableCell, { align: "right" /* RIGHT */ }, item.direction === "DEBIT" /* DEBIT */ && /* @__PURE__ */ React199.createElement(Badge, { variant: "warning" /* WARNING */ }, "$", centsToDollars(item.amount || 0))),
|
|
16941
|
+
/* @__PURE__ */ React199.createElement(TableCell, { align: "right" /* RIGHT */ }, item.direction === "CREDIT" /* CREDIT */ && /* @__PURE__ */ React199.createElement(Badge, { variant: "success" /* SUCCESS */ }, "$", centsToDollars(item.amount || 0)))
|
|
16684
16942
|
);
|
|
16685
|
-
}), /* @__PURE__ */
|
|
16943
|
+
}), /* @__PURE__ */ React199.createElement(
|
|
16686
16944
|
TableRow,
|
|
16687
16945
|
{
|
|
16688
16946
|
rowKey: "ledger-line-item-summation",
|
|
16689
16947
|
variant: "summation"
|
|
16690
16948
|
},
|
|
16691
|
-
/* @__PURE__ */
|
|
16692
|
-
/* @__PURE__ */
|
|
16693
|
-
/* @__PURE__ */
|
|
16949
|
+
/* @__PURE__ */ React199.createElement(TableCell, { primary: true }, ((_v = stringOverrides == null ? void 0 : stringOverrides.lineItemsTable) == null ? void 0 : _v.totalRowHeader) || "Total"),
|
|
16950
|
+
/* @__PURE__ */ React199.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, totalDebit || 0),
|
|
16951
|
+
/* @__PURE__ */ React199.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, totalCredit || 0)
|
|
16694
16952
|
))
|
|
16695
16953
|
))) : null);
|
|
16696
16954
|
};
|
|
16697
16955
|
|
|
16698
16956
|
// src/components/LedgerAccount/LedgerAccountRow.tsx
|
|
16699
|
-
import
|
|
16957
|
+
import React200, { useContext as useContext34, useEffect as useEffect42, useState as useState52 } from "react";
|
|
16700
16958
|
import classNames64 from "classnames";
|
|
16701
16959
|
import { parseISO as parseISO13, format as formatTime11 } from "date-fns";
|
|
16702
16960
|
var LedgerAccountRow = ({
|
|
@@ -16708,7 +16966,7 @@ var LedgerAccountRow = ({
|
|
|
16708
16966
|
var _a, _b, _c, _d, _e, _f;
|
|
16709
16967
|
const { selectedEntryId, setSelectedEntryId, closeSelectedEntry } = useContext34(LedgerAccountsContext);
|
|
16710
16968
|
const [showComponent, setShowComponent] = useState52(false);
|
|
16711
|
-
|
|
16969
|
+
useEffect42(() => {
|
|
16712
16970
|
if (initialLoad) {
|
|
16713
16971
|
const timeoutId = setTimeout(() => {
|
|
16714
16972
|
setShowComponent(true);
|
|
@@ -16719,7 +16977,7 @@ var LedgerAccountRow = ({
|
|
|
16719
16977
|
}
|
|
16720
16978
|
}, []);
|
|
16721
16979
|
if (view === "tablet") {
|
|
16722
|
-
return /* @__PURE__ */
|
|
16980
|
+
return /* @__PURE__ */ React200.createElement(
|
|
16723
16981
|
"tr",
|
|
16724
16982
|
{
|
|
16725
16983
|
className: classNames64(
|
|
@@ -16738,21 +16996,21 @@ var LedgerAccountRow = ({
|
|
|
16738
16996
|
}
|
|
16739
16997
|
}
|
|
16740
16998
|
},
|
|
16741
|
-
/* @__PURE__ */
|
|
16999
|
+
/* @__PURE__ */ React200.createElement("td", { className: "Layer__table-cell Layer__ledger-account-table__tablet-main-col" }, /* @__PURE__ */ React200.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ React200.createElement("div", { className: "Layer__ledger-account-table__tablet-main-col__date" }, /* @__PURE__ */ React200.createElement(Text, null, row.date && formatTime11(parseISO13(row.date), DATE_FORMAT)), /* @__PURE__ */ React200.createElement(
|
|
16742
17000
|
Text,
|
|
16743
17001
|
{
|
|
16744
17002
|
weight: "normal" /* normal */,
|
|
16745
17003
|
className: "Layer__ledger_account-table__journal-id"
|
|
16746
17004
|
},
|
|
16747
17005
|
entryNumber(row)
|
|
16748
|
-
)), /* @__PURE__ */
|
|
16749
|
-
/* @__PURE__ */
|
|
16750
|
-
/* @__PURE__ */
|
|
16751
|
-
/* @__PURE__ */
|
|
17006
|
+
)), /* @__PURE__ */ React200.createElement(Text, null, (_b = (_a = row.source) == null ? void 0 : _a.display_description) != null ? _b : ""))),
|
|
17007
|
+
/* @__PURE__ */ React200.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React200.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "DEBIT" /* DEBIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)),
|
|
17008
|
+
/* @__PURE__ */ React200.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React200.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "CREDIT" /* CREDIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)),
|
|
17009
|
+
/* @__PURE__ */ React200.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React200.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, `$${centsToDollars(row.running_balance)}`))
|
|
16752
17010
|
);
|
|
16753
17011
|
}
|
|
16754
17012
|
if (view === "mobile") {
|
|
16755
|
-
return /* @__PURE__ */
|
|
17013
|
+
return /* @__PURE__ */ React200.createElement(
|
|
16756
17014
|
"tr",
|
|
16757
17015
|
{
|
|
16758
17016
|
className: classNames64(
|
|
@@ -16771,17 +17029,17 @@ var LedgerAccountRow = ({
|
|
|
16771
17029
|
}
|
|
16772
17030
|
}
|
|
16773
17031
|
},
|
|
16774
|
-
/* @__PURE__ */
|
|
17032
|
+
/* @__PURE__ */ React200.createElement("td", { className: "Layer__table-cell Layer__ledger-account-table__tablet-main-col" }, /* @__PURE__ */ React200.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ React200.createElement("div", { className: "Layer__ledger-account-table__tablet-main-col__date" }, /* @__PURE__ */ React200.createElement(Text, null, row.date && formatTime11(parseISO13(row.date), DATE_FORMAT)), /* @__PURE__ */ React200.createElement(
|
|
16775
17033
|
Text,
|
|
16776
17034
|
{
|
|
16777
17035
|
weight: "normal" /* normal */,
|
|
16778
17036
|
className: "Layer__ledger_account-table__journal-id"
|
|
16779
17037
|
},
|
|
16780
17038
|
entryNumber(row)
|
|
16781
|
-
)), /* @__PURE__ */
|
|
17039
|
+
)), /* @__PURE__ */ React200.createElement(Text, null, (_d = (_c = row.source) == null ? void 0 : _c.display_description) != null ? _d : ""), /* @__PURE__ */ React200.createElement("div", { className: "Layer__ledger_account-table__balances-mobile" }, /* @__PURE__ */ React200.createElement("div", { className: "Layer__ledger_account-table__balance-item" }, /* @__PURE__ */ React200.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__label" }, "Debit"), /* @__PURE__ */ React200.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__value" }, " ", row.direction === "DEBIT" /* DEBIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)), /* @__PURE__ */ React200.createElement("div", { className: "Layer__ledger_account-table__balance-item" }, /* @__PURE__ */ React200.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__label" }, "Credit"), /* @__PURE__ */ React200.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__value" }, row.direction === "CREDIT" /* CREDIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)), /* @__PURE__ */ React200.createElement("div", { className: "Layer__ledger_account-table__balance-item" }, /* @__PURE__ */ React200.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__label" }, "Running balance"), /* @__PURE__ */ React200.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__value" }, `$${centsToDollars(row.running_balance)}`)))))
|
|
16782
17040
|
);
|
|
16783
17041
|
}
|
|
16784
|
-
return /* @__PURE__ */
|
|
17042
|
+
return /* @__PURE__ */ React200.createElement(
|
|
16785
17043
|
"tr",
|
|
16786
17044
|
{
|
|
16787
17045
|
className: classNames64(
|
|
@@ -16800,12 +17058,12 @@ var LedgerAccountRow = ({
|
|
|
16800
17058
|
}
|
|
16801
17059
|
}
|
|
16802
17060
|
},
|
|
16803
|
-
/* @__PURE__ */
|
|
16804
|
-
/* @__PURE__ */
|
|
16805
|
-
/* @__PURE__ */
|
|
16806
|
-
/* @__PURE__ */
|
|
16807
|
-
/* @__PURE__ */
|
|
16808
|
-
/* @__PURE__ */
|
|
17061
|
+
/* @__PURE__ */ React200.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React200.createElement("span", { className: "Layer__table-cell-content" }, row.date && formatTime11(parseISO13(row.date), DATE_FORMAT))),
|
|
17062
|
+
/* @__PURE__ */ React200.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React200.createElement("span", { className: "Layer__table-cell-content" }, entryNumber(row))),
|
|
17063
|
+
/* @__PURE__ */ React200.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React200.createElement("span", { className: "Layer__table-cell-content" }, (_f = (_e = row.source) == null ? void 0 : _e.display_description) != null ? _f : "")),
|
|
17064
|
+
/* @__PURE__ */ React200.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React200.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "DEBIT" /* DEBIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)),
|
|
17065
|
+
/* @__PURE__ */ React200.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React200.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "CREDIT" /* CREDIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)),
|
|
17066
|
+
/* @__PURE__ */ React200.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React200.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, `$${centsToDollars(row.running_balance)}`))
|
|
16809
17067
|
);
|
|
16810
17068
|
};
|
|
16811
17069
|
|
|
@@ -16832,7 +17090,7 @@ var LedgerAccount = ({
|
|
|
16832
17090
|
closeSelectedEntry,
|
|
16833
17091
|
refetch
|
|
16834
17092
|
} = useContext35(LedgerAccountsContext);
|
|
16835
|
-
|
|
17093
|
+
useEffect43(() => {
|
|
16836
17094
|
if (!isLoading) {
|
|
16837
17095
|
const timeoutLoad = setTimeout(() => {
|
|
16838
17096
|
setInitialLoad(false);
|
|
@@ -16859,10 +17117,10 @@ var LedgerAccount = ({
|
|
|
16859
17117
|
setAccountId(void 0);
|
|
16860
17118
|
closeSelectedEntry();
|
|
16861
17119
|
};
|
|
16862
|
-
return /* @__PURE__ */
|
|
17120
|
+
return /* @__PURE__ */ React201.createElement(
|
|
16863
17121
|
Panel,
|
|
16864
17122
|
{
|
|
16865
|
-
sidebar: /* @__PURE__ */
|
|
17123
|
+
sidebar: /* @__PURE__ */ React201.createElement(
|
|
16866
17124
|
LedgerAccountEntryDetails,
|
|
16867
17125
|
{
|
|
16868
17126
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.ledgerEntryDetail
|
|
@@ -16872,21 +17130,21 @@ var LedgerAccount = ({
|
|
|
16872
17130
|
parentRef: containerRef,
|
|
16873
17131
|
className: "Layer__ledger-account__panel"
|
|
16874
17132
|
},
|
|
16875
|
-
/* @__PURE__ */
|
|
17133
|
+
/* @__PURE__ */ React201.createElement("div", { className: baseClassName }, /* @__PURE__ */ React201.createElement(Header2, { className: "Layer__ledger-account__header" }, /* @__PURE__ */ React201.createElement(HeaderRow, null, /* @__PURE__ */ React201.createElement(HeaderCol, null, /* @__PURE__ */ React201.createElement(BackButton, { onClick: close }), /* @__PURE__ */ React201.createElement("div", { className: "Layer__ledger-account__title-container" }, /* @__PURE__ */ React201.createElement(
|
|
16876
17134
|
Text,
|
|
16877
17135
|
{
|
|
16878
17136
|
weight: "bold" /* bold */,
|
|
16879
17137
|
className: "Layer__ledger-account__title"
|
|
16880
17138
|
},
|
|
16881
17139
|
(_a = account == null ? void 0 : account.name) != null ? _a : ""
|
|
16882
|
-
), /* @__PURE__ */
|
|
17140
|
+
), /* @__PURE__ */ React201.createElement("div", { className: "Layer__ledger-account__balance-container" }, /* @__PURE__ */ React201.createElement(
|
|
16883
17141
|
Text,
|
|
16884
17142
|
{
|
|
16885
17143
|
className: "Layer__ledger-account__balance-label",
|
|
16886
17144
|
size: "sm" /* sm */
|
|
16887
17145
|
},
|
|
16888
17146
|
"Current balance"
|
|
16889
|
-
), /* @__PURE__ */
|
|
17147
|
+
), /* @__PURE__ */ React201.createElement(
|
|
16890
17148
|
Text,
|
|
16891
17149
|
{
|
|
16892
17150
|
className: "Layer__ledger-account__balance-value",
|
|
@@ -16894,9 +17152,9 @@ var LedgerAccount = ({
|
|
|
16894
17152
|
},
|
|
16895
17153
|
"$",
|
|
16896
17154
|
centsToDollars((account == null ? void 0 : account.balance) || 0)
|
|
16897
|
-
)))))), /* @__PURE__ */
|
|
17155
|
+
)))))), /* @__PURE__ */ React201.createElement("table", { className: "Layer__table Layer__table--hover-effect Layer__ledger-account-table" }, /* @__PURE__ */ React201.createElement("thead", null, /* @__PURE__ */ React201.createElement("tr", null, view !== "desktop" && /* @__PURE__ */ React201.createElement("th", null), view === "desktop" && /* @__PURE__ */ React201.createElement(React201.Fragment, null, /* @__PURE__ */ React201.createElement("th", { className: "Layer__table-header" }, ((_b = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _b.dateColumnHeader) || "Date"), /* @__PURE__ */ React201.createElement("th", { className: "Layer__table-header" }, ((_c = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _c.journalIdColumnHeader) || "Journal id #"), /* @__PURE__ */ React201.createElement("th", { className: "Layer__table-header" }, ((_d = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _d.sourceColumnHeader) || "Source")), view !== "mobile" && /* @__PURE__ */ React201.createElement(React201.Fragment, null, /* @__PURE__ */ React201.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, ((_e = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _e.debitColumnHeader) || "Debit"), /* @__PURE__ */ React201.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, ((_f = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _f.creditColumnHeader) || "Credit"), /* @__PURE__ */ React201.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, ((_g = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _g.runningBalanceColumnHeader) || "Running balance")))), /* @__PURE__ */ React201.createElement("tbody", null, (_h = data == null ? void 0 : data.filter(
|
|
16898
17156
|
(entry) => !entry.entry_reversal_of && !entry.entry_reversed_by
|
|
16899
|
-
)) == null ? void 0 : _h.map((x, index) => /* @__PURE__ */
|
|
17157
|
+
)) == null ? void 0 : _h.map((x, index) => /* @__PURE__ */ React201.createElement(
|
|
16900
17158
|
LedgerAccountRow,
|
|
16901
17159
|
{
|
|
16902
17160
|
key: x.id,
|
|
@@ -16905,7 +17163,7 @@ var LedgerAccount = ({
|
|
|
16905
17163
|
initialLoad,
|
|
16906
17164
|
view
|
|
16907
17165
|
}
|
|
16908
|
-
)))), data && /* @__PURE__ */
|
|
17166
|
+
)))), data && /* @__PURE__ */ React201.createElement("div", { className: "Layer__ledger-account__pagination" }, /* @__PURE__ */ React201.createElement(
|
|
16909
17167
|
Pagination,
|
|
16910
17168
|
{
|
|
16911
17169
|
currentPage,
|
|
@@ -16913,7 +17171,7 @@ var LedgerAccount = ({
|
|
|
16913
17171
|
pageSize,
|
|
16914
17172
|
onPageChange: (page) => setCurrentPage(page)
|
|
16915
17173
|
}
|
|
16916
|
-
)), error ? /* @__PURE__ */
|
|
17174
|
+
)), error ? /* @__PURE__ */ React201.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React201.createElement(
|
|
16917
17175
|
DataState,
|
|
16918
17176
|
{
|
|
16919
17177
|
status: "failed" /* failed */,
|
|
@@ -16922,7 +17180,7 @@ var LedgerAccount = ({
|
|
|
16922
17180
|
onRefresh: () => refetch(),
|
|
16923
17181
|
isLoading: isValidating || isLoading
|
|
16924
17182
|
}
|
|
16925
|
-
)) : null, (!data || isLoading) && !error ? /* @__PURE__ */
|
|
17183
|
+
)) : null, (!data || isLoading) && !error ? /* @__PURE__ */ React201.createElement("div", { className: "Layer__ledger-account__loader-container" }, /* @__PURE__ */ React201.createElement(Loader2, null)) : null, !isLoading && !error && (data == null ? void 0 : data.length) === 0 ? /* @__PURE__ */ React201.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React201.createElement(
|
|
16926
17184
|
DataState,
|
|
16927
17185
|
{
|
|
16928
17186
|
status: "info" /* info */,
|
|
@@ -16943,7 +17201,7 @@ var ChartOfAccounts = (props) => {
|
|
|
16943
17201
|
const ledgerAccountsContextData = useLedgerAccounts(
|
|
16944
17202
|
(_a = props.showReversalEntries) != null ? _a : false
|
|
16945
17203
|
);
|
|
16946
|
-
return /* @__PURE__ */
|
|
17204
|
+
return /* @__PURE__ */ React202.createElement(ChartOfAccountsContext.Provider, { value: chartOfAccountsContextData }, /* @__PURE__ */ React202.createElement(LedgerAccountsContext.Provider, { value: ledgerAccountsContextData }, /* @__PURE__ */ React202.createElement(ChartOfAccountsContent, __spreadValues({}, props))));
|
|
16947
17205
|
};
|
|
16948
17206
|
var ChartOfAccountsContent = ({
|
|
16949
17207
|
asWidget,
|
|
@@ -16953,18 +17211,15 @@ var ChartOfAccountsContent = ({
|
|
|
16953
17211
|
templateAccountsEditable
|
|
16954
17212
|
}) => {
|
|
16955
17213
|
const { accountId } = useContext36(LedgerAccountsContext);
|
|
16956
|
-
const
|
|
16957
|
-
|
|
16958
|
-
(newView) => setView(newView)
|
|
16959
|
-
);
|
|
16960
|
-
return /* @__PURE__ */ React199.createElement(Container, { name: "chart-of-accounts", ref: containerRef, asWidget }, accountId ? /* @__PURE__ */ React199.createElement(
|
|
17214
|
+
const { view, containerRef } = useElementViewSize();
|
|
17215
|
+
return /* @__PURE__ */ React202.createElement(Container, { name: "chart-of-accounts", ref: containerRef, asWidget }, accountId ? /* @__PURE__ */ React202.createElement(
|
|
16961
17216
|
LedgerAccount,
|
|
16962
17217
|
{
|
|
16963
17218
|
view,
|
|
16964
17219
|
containerRef,
|
|
16965
17220
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.ledgerAccount
|
|
16966
17221
|
}
|
|
16967
|
-
) : /* @__PURE__ */
|
|
17222
|
+
) : /* @__PURE__ */ React202.createElement(
|
|
16968
17223
|
ChartOfAccountsTableWithPanel,
|
|
16969
17224
|
{
|
|
16970
17225
|
asWidget,
|
|
@@ -16979,7 +17234,7 @@ var ChartOfAccountsContent = ({
|
|
|
16979
17234
|
};
|
|
16980
17235
|
|
|
16981
17236
|
// src/components/Journal/Journal.tsx
|
|
16982
|
-
import
|
|
17237
|
+
import React209 from "react";
|
|
16983
17238
|
|
|
16984
17239
|
// src/contexts/JournalContext/JournalContext.tsx
|
|
16985
17240
|
import { createContext as createContext18 } from "react";
|
|
@@ -17017,7 +17272,7 @@ var JournalContext = createContext18({
|
|
|
17017
17272
|
});
|
|
17018
17273
|
|
|
17019
17274
|
// src/hooks/useJournal/useJournal.tsx
|
|
17020
|
-
import { useEffect as
|
|
17275
|
+
import { useEffect as useEffect44, useState as useState54 } from "react";
|
|
17021
17276
|
import useSWR10 from "swr";
|
|
17022
17277
|
var useJournal = () => {
|
|
17023
17278
|
const {
|
|
@@ -17029,11 +17284,11 @@ var useJournal = () => {
|
|
|
17029
17284
|
} = useLayerContext();
|
|
17030
17285
|
const { apiUrl } = useEnvironment();
|
|
17031
17286
|
const { data: auth } = useAuth();
|
|
17032
|
-
const [selectedEntryId, setSelectedEntryId] =
|
|
17033
|
-
const [form, setForm] =
|
|
17034
|
-
const [addingEntry, setAddingEntry] =
|
|
17035
|
-
const [sendingForm, setSendingForm] =
|
|
17036
|
-
const [apiError, setApiError] =
|
|
17287
|
+
const [selectedEntryId, setSelectedEntryId] = useState54();
|
|
17288
|
+
const [form, setForm] = useState54();
|
|
17289
|
+
const [addingEntry, setAddingEntry] = useState54(false);
|
|
17290
|
+
const [sendingForm, setSendingForm] = useState54(false);
|
|
17291
|
+
const [apiError, setApiError] = useState54(void 0);
|
|
17037
17292
|
const queryKey = businessId && (auth == null ? void 0 : auth.access_token) && `journal-lines-${businessId}`;
|
|
17038
17293
|
const { data, isLoading, isValidating, error, mutate } = useSWR10(
|
|
17039
17294
|
queryKey,
|
|
@@ -17249,12 +17504,12 @@ var useJournal = () => {
|
|
|
17249
17504
|
params: { businessId, entryId }
|
|
17250
17505
|
});
|
|
17251
17506
|
});
|
|
17252
|
-
|
|
17507
|
+
useEffect44(() => {
|
|
17253
17508
|
if (queryKey && (isLoading || isValidating)) {
|
|
17254
17509
|
read("JOURNAL" /* JOURNAL */, queryKey);
|
|
17255
17510
|
}
|
|
17256
17511
|
}, [isLoading, isValidating]);
|
|
17257
|
-
|
|
17512
|
+
useEffect44(() => {
|
|
17258
17513
|
if (queryKey && hasBeenTouched(queryKey)) {
|
|
17259
17514
|
refetch();
|
|
17260
17515
|
}
|
|
@@ -17286,13 +17541,13 @@ var useJournal = () => {
|
|
|
17286
17541
|
};
|
|
17287
17542
|
|
|
17288
17543
|
// src/components/JournalTable/JournalTableWithPanel.tsx
|
|
17289
|
-
import
|
|
17544
|
+
import React208, { useContext as useContext42, useMemo as useMemo29, useState as useState56 } from "react";
|
|
17290
17545
|
|
|
17291
17546
|
// src/components/JournalSidebar/JournalSidebar.tsx
|
|
17292
|
-
import
|
|
17547
|
+
import React206, { useContext as useContext40 } from "react";
|
|
17293
17548
|
|
|
17294
17549
|
// src/components/JournalEntryDetails/JournalEntryDetails.tsx
|
|
17295
|
-
import
|
|
17550
|
+
import React203, { useContext as useContext37, useMemo as useMemo28, useState as useState55 } from "react";
|
|
17296
17551
|
var JournalEntryDetails = () => {
|
|
17297
17552
|
var _a, _b, _c, _d;
|
|
17298
17553
|
const {
|
|
@@ -17304,8 +17559,8 @@ var JournalEntryDetails = () => {
|
|
|
17304
17559
|
reverseEntry,
|
|
17305
17560
|
refetch
|
|
17306
17561
|
} = useContext37(JournalContext);
|
|
17307
|
-
const [reverseEntryProcessing, setReverseEntryProcessing] =
|
|
17308
|
-
const [reverseEntryError, setReverseEntryError] =
|
|
17562
|
+
const [reverseEntryProcessing, setReverseEntryProcessing] = useState55(false);
|
|
17563
|
+
const [reverseEntryError, setReverseEntryError] = useState55();
|
|
17309
17564
|
const entry = useMemo28(() => {
|
|
17310
17565
|
if (selectedEntryId && data) {
|
|
17311
17566
|
return data.find((x) => x.id === selectedEntryId);
|
|
@@ -17336,15 +17591,15 @@ var JournalEntryDetails = () => {
|
|
|
17336
17591
|
setReverseEntryProcessing(false);
|
|
17337
17592
|
}
|
|
17338
17593
|
});
|
|
17339
|
-
return /* @__PURE__ */
|
|
17594
|
+
return /* @__PURE__ */ React203.createElement("div", { className: "Layer__journal__entry-details" }, /* @__PURE__ */ React203.createElement(Header2, { className: "Layer__journal__entry-details__mobile-header" }, /* @__PURE__ */ React203.createElement(HeaderRow, null, /* @__PURE__ */ React203.createElement(HeaderCol, { className: "Layer__hidden-lg Layer__hidden-xl" }, /* @__PURE__ */ React203.createElement(BackButton, { onClick: closeSelectedEntry }), /* @__PURE__ */ React203.createElement(Heading, { size: "secondary" /* secondary */ }, "Transaction details")), /* @__PURE__ */ React203.createElement(HeaderCol, { className: "Layer__show-lg Layer__show-xl" }, /* @__PURE__ */ React203.createElement(Heading, { size: "secondary" /* secondary */ }, "Transaction source")), /* @__PURE__ */ React203.createElement(HeaderCol, { className: "Layer__show-lg Layer__show-xl" }, /* @__PURE__ */ React203.createElement(CloseButton, { onClick: closeSelectedEntry })))), /* @__PURE__ */ React203.createElement(
|
|
17340
17595
|
DetailsList,
|
|
17341
17596
|
{
|
|
17342
17597
|
title: "Transaction source",
|
|
17343
17598
|
titleClassName: "Layer__hidden-lg Layer__hidden-xl",
|
|
17344
|
-
actions: /* @__PURE__ */
|
|
17599
|
+
actions: /* @__PURE__ */ React203.createElement(
|
|
17345
17600
|
Button,
|
|
17346
17601
|
{
|
|
17347
|
-
rightIcon: /* @__PURE__ */
|
|
17602
|
+
rightIcon: /* @__PURE__ */ React203.createElement(X_default, null),
|
|
17348
17603
|
iconOnly: true,
|
|
17349
17604
|
onClick: closeSelectedEntry,
|
|
17350
17605
|
className: "Layer__details-list__close-btn",
|
|
@@ -17352,32 +17607,32 @@ var JournalEntryDetails = () => {
|
|
|
17352
17607
|
}
|
|
17353
17608
|
)
|
|
17354
17609
|
},
|
|
17355
|
-
/* @__PURE__ */
|
|
17356
|
-
((_b = entry == null ? void 0 : entry.source) == null ? void 0 : _b.display_description) && /* @__PURE__ */
|
|
17357
|
-
), /* @__PURE__ */
|
|
17610
|
+
/* @__PURE__ */ React203.createElement(DetailsListItem, { label: "Source", isLoading: isLoadingEntry }, /* @__PURE__ */ React203.createElement(Badge, null, (_a = entry == null ? void 0 : entry.source) == null ? void 0 : _a.entity_name)),
|
|
17611
|
+
((_b = entry == null ? void 0 : entry.source) == null ? void 0 : _b.display_description) && /* @__PURE__ */ React203.createElement(SourceDetailView, { source: entry == null ? void 0 : entry.source })
|
|
17612
|
+
), /* @__PURE__ */ React203.createElement(
|
|
17358
17613
|
DetailsList,
|
|
17359
17614
|
{
|
|
17360
17615
|
title: `Journal Entry ${entry ? entryNumber(entry) : ""}`,
|
|
17361
17616
|
className: "Layer__border-top"
|
|
17362
17617
|
},
|
|
17363
|
-
/* @__PURE__ */
|
|
17364
|
-
/* @__PURE__ */
|
|
17365
|
-
/* @__PURE__ */
|
|
17366
|
-
(entry == null ? void 0 : entry.reversal_id) && /* @__PURE__ */
|
|
17367
|
-
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */
|
|
17618
|
+
/* @__PURE__ */ React203.createElement(DetailsListItem, { label: "Entry type", isLoading: isLoadingEntry }, humanizeEnum((_c = entry == null ? void 0 : entry.entry_type) != null ? _c : "")),
|
|
17619
|
+
/* @__PURE__ */ React203.createElement(DetailsListItem, { label: "Effective date", isLoading: isLoadingEntry }, (entry == null ? void 0 : entry.entry_at) && /* @__PURE__ */ React203.createElement(DateTime, { value: entry == null ? void 0 : entry.entry_at })),
|
|
17620
|
+
/* @__PURE__ */ React203.createElement(DetailsListItem, { label: "Creation date", isLoading: isLoadingEntry }, (entry == null ? void 0 : entry.date) && /* @__PURE__ */ React203.createElement(DateTime, { value: entry == null ? void 0 : entry.date })),
|
|
17621
|
+
(entry == null ? void 0 : entry.reversal_id) && /* @__PURE__ */ React203.createElement(DetailsListItem, { label: "Reversal", isLoading: isLoadingEntry }, `Journal Entry #${entry == null ? void 0 : entry.reversal_id.substring(0, 5)}`)
|
|
17622
|
+
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */ React203.createElement("div", { className: "Layer__journal__entry-details__line-items" }, /* @__PURE__ */ React203.createElement(Card, null, /* @__PURE__ */ React203.createElement(
|
|
17368
17623
|
Table,
|
|
17369
17624
|
{
|
|
17370
17625
|
componentName: "journal__entry-details",
|
|
17371
17626
|
borderCollapse: "collapse"
|
|
17372
17627
|
},
|
|
17373
|
-
/* @__PURE__ */
|
|
17628
|
+
/* @__PURE__ */ React203.createElement(TableHead, null, /* @__PURE__ */ React203.createElement(TableRow, { rowKey: "soc-flow-head-row", isHeadRow: true }, /* @__PURE__ */ React203.createElement(TableCell, null, "Line items"), /* @__PURE__ */ React203.createElement(
|
|
17374
17629
|
TableCell,
|
|
17375
17630
|
{
|
|
17376
17631
|
className: "Layer__journal__debit-credit-col",
|
|
17377
17632
|
align: "right" /* RIGHT */
|
|
17378
17633
|
},
|
|
17379
17634
|
"Debit"
|
|
17380
|
-
), /* @__PURE__ */
|
|
17635
|
+
), /* @__PURE__ */ React203.createElement(
|
|
17381
17636
|
TableCell,
|
|
17382
17637
|
{
|
|
17383
17638
|
className: "Layer__journal__debit-credit-col",
|
|
@@ -17385,37 +17640,37 @@ var JournalEntryDetails = () => {
|
|
|
17385
17640
|
},
|
|
17386
17641
|
"Credit"
|
|
17387
17642
|
))),
|
|
17388
|
-
/* @__PURE__ */
|
|
17643
|
+
/* @__PURE__ */ React203.createElement(TableBody, null, sortedLineItems == null ? void 0 : sortedLineItems.map((item, index) => /* @__PURE__ */ React203.createElement(
|
|
17389
17644
|
TableRow,
|
|
17390
17645
|
{
|
|
17391
17646
|
key: `ledger-line-item-${index}`,
|
|
17392
17647
|
rowKey: `ledger-line-item-${index}`
|
|
17393
17648
|
},
|
|
17394
|
-
/* @__PURE__ */
|
|
17395
|
-
/* @__PURE__ */
|
|
17649
|
+
/* @__PURE__ */ React203.createElement(TableCell, null, item.account.name),
|
|
17650
|
+
/* @__PURE__ */ React203.createElement(
|
|
17396
17651
|
TableCell,
|
|
17397
17652
|
{
|
|
17398
17653
|
className: "Layer__journal__debit-credit-col",
|
|
17399
17654
|
align: "right" /* RIGHT */
|
|
17400
17655
|
},
|
|
17401
|
-
item.direction === "DEBIT" /* DEBIT */ && /* @__PURE__ */
|
|
17656
|
+
item.direction === "DEBIT" /* DEBIT */ && /* @__PURE__ */ React203.createElement(Badge, { variant: "warning" /* WARNING */ }, "$", centsToDollars(item.amount || 0))
|
|
17402
17657
|
),
|
|
17403
|
-
/* @__PURE__ */
|
|
17658
|
+
/* @__PURE__ */ React203.createElement(
|
|
17404
17659
|
TableCell,
|
|
17405
17660
|
{
|
|
17406
17661
|
className: "Layer__journal__debit-credit-col",
|
|
17407
17662
|
align: "right" /* RIGHT */
|
|
17408
17663
|
},
|
|
17409
|
-
item.direction === "CREDIT" /* CREDIT */ && /* @__PURE__ */
|
|
17664
|
+
item.direction === "CREDIT" /* CREDIT */ && /* @__PURE__ */ React203.createElement(Badge, { variant: "success" /* SUCCESS */ }, "$", centsToDollars(item.amount || 0))
|
|
17410
17665
|
)
|
|
17411
|
-
)), /* @__PURE__ */
|
|
17666
|
+
)), /* @__PURE__ */ React203.createElement(
|
|
17412
17667
|
TableRow,
|
|
17413
17668
|
{
|
|
17414
17669
|
rowKey: "ledger-line-item-summation",
|
|
17415
17670
|
variant: "summation"
|
|
17416
17671
|
},
|
|
17417
|
-
/* @__PURE__ */
|
|
17418
|
-
/* @__PURE__ */
|
|
17672
|
+
/* @__PURE__ */ React203.createElement(TableCell, { primary: true }, "Total"),
|
|
17673
|
+
/* @__PURE__ */ React203.createElement(
|
|
17419
17674
|
TableCell,
|
|
17420
17675
|
{
|
|
17421
17676
|
isCurrency: true,
|
|
@@ -17425,7 +17680,7 @@ var JournalEntryDetails = () => {
|
|
|
17425
17680
|
},
|
|
17426
17681
|
(entry == null ? void 0 : entry.line_items.filter((item) => item.direction === "DEBIT").map((item) => item.amount).reduce((a, b) => a + b, 0)) || 0
|
|
17427
17682
|
),
|
|
17428
|
-
/* @__PURE__ */
|
|
17683
|
+
/* @__PURE__ */ React203.createElement(
|
|
17429
17684
|
TableCell,
|
|
17430
17685
|
{
|
|
17431
17686
|
isCurrency: true,
|
|
@@ -17436,10 +17691,10 @@ var JournalEntryDetails = () => {
|
|
|
17436
17691
|
(entry == null ? void 0 : entry.line_items.filter((item) => item.direction === "CREDIT").map((item) => item.amount).reduce((a, b) => a + b, 0)) || 0
|
|
17437
17692
|
)
|
|
17438
17693
|
))
|
|
17439
|
-
)), /* @__PURE__ */
|
|
17694
|
+
)), /* @__PURE__ */ React203.createElement("div", { className: "Layer__journal__entry-details__reverse-btn-container" }, /* @__PURE__ */ React203.createElement(
|
|
17440
17695
|
Button,
|
|
17441
17696
|
{
|
|
17442
|
-
rightIcon: reverseEntryError ? /* @__PURE__ */
|
|
17697
|
+
rightIcon: reverseEntryError ? /* @__PURE__ */ React203.createElement(AlertCircle_default, { size: 12 }) : /* @__PURE__ */ React203.createElement(RefreshCcw_default, { size: 12 }),
|
|
17443
17698
|
variant: "secondary" /* secondary */,
|
|
17444
17699
|
onClick: reverseEntryProcessing ? () => {
|
|
17445
17700
|
} : onReverseEntry,
|
|
@@ -17452,10 +17707,10 @@ var JournalEntryDetails = () => {
|
|
|
17452
17707
|
};
|
|
17453
17708
|
|
|
17454
17709
|
// src/components/JournalForm/JournalForm.tsx
|
|
17455
|
-
import
|
|
17710
|
+
import React205, { useContext as useContext39 } from "react";
|
|
17456
17711
|
|
|
17457
17712
|
// src/components/JournalForm/JournalFormEntryLines.tsx
|
|
17458
|
-
import
|
|
17713
|
+
import React204, { useContext as useContext38 } from "react";
|
|
17459
17714
|
var JournalFormEntryLines = ({
|
|
17460
17715
|
entrylineItems,
|
|
17461
17716
|
addEntryLine,
|
|
@@ -17467,14 +17722,14 @@ var JournalFormEntryLines = ({
|
|
|
17467
17722
|
const { data: accountsData } = useContext38(ChartOfAccountsContext);
|
|
17468
17723
|
const { form } = useContext38(JournalContext);
|
|
17469
17724
|
const parentOptions = useParentOptions(accountsData);
|
|
17470
|
-
return /* @__PURE__ */
|
|
17471
|
-
return /* @__PURE__ */
|
|
17725
|
+
return /* @__PURE__ */ React204.createElement(React204.Fragment, null, ["DEBIT", "CREDIT"].map((direction, idx) => {
|
|
17726
|
+
return /* @__PURE__ */ React204.createElement(
|
|
17472
17727
|
"div",
|
|
17473
17728
|
{
|
|
17474
17729
|
key: "Layer__journal__form__input-group-" + idx,
|
|
17475
17730
|
className: "Layer__journal__form__input-group Layer__journal__form__input-group__border"
|
|
17476
17731
|
},
|
|
17477
|
-
/* @__PURE__ */
|
|
17732
|
+
/* @__PURE__ */ React204.createElement(
|
|
17478
17733
|
Text,
|
|
17479
17734
|
{
|
|
17480
17735
|
className: "Layer__journal__form__input-group__title",
|
|
@@ -17489,13 +17744,13 @@ var JournalFormEntryLines = ({
|
|
|
17489
17744
|
if (item.direction !== direction) {
|
|
17490
17745
|
return null;
|
|
17491
17746
|
}
|
|
17492
|
-
return /* @__PURE__ */
|
|
17747
|
+
return /* @__PURE__ */ React204.createElement(
|
|
17493
17748
|
"div",
|
|
17494
17749
|
{
|
|
17495
17750
|
className: "Layer__journal__form__input-group__line-item",
|
|
17496
17751
|
key: direction + "-" + idx2
|
|
17497
17752
|
},
|
|
17498
|
-
/* @__PURE__ */
|
|
17753
|
+
/* @__PURE__ */ React204.createElement(InputGroup, { name: direction, label: "Amount", inline: true }, /* @__PURE__ */ React204.createElement(
|
|
17499
17754
|
InputWithBadge,
|
|
17500
17755
|
{
|
|
17501
17756
|
name: direction,
|
|
@@ -17521,14 +17776,14 @@ var JournalFormEntryLines = ({
|
|
|
17521
17776
|
)) == null ? void 0 : _c.message
|
|
17522
17777
|
}
|
|
17523
17778
|
)),
|
|
17524
|
-
/* @__PURE__ */
|
|
17779
|
+
/* @__PURE__ */ React204.createElement(
|
|
17525
17780
|
InputGroup,
|
|
17526
17781
|
{
|
|
17527
17782
|
name: "account-name",
|
|
17528
17783
|
label: "Account name",
|
|
17529
17784
|
inline: true
|
|
17530
17785
|
},
|
|
17531
|
-
/* @__PURE__ */
|
|
17786
|
+
/* @__PURE__ */ React204.createElement(
|
|
17532
17787
|
Select2,
|
|
17533
17788
|
{
|
|
17534
17789
|
options: parentOptions,
|
|
@@ -17552,18 +17807,18 @@ var JournalFormEntryLines = ({
|
|
|
17552
17807
|
)) == null ? void 0 : _f.message
|
|
17553
17808
|
}
|
|
17554
17809
|
),
|
|
17555
|
-
idx2 >= 2 && /* @__PURE__ */
|
|
17810
|
+
idx2 >= 2 && /* @__PURE__ */ React204.createElement(
|
|
17556
17811
|
IconButton,
|
|
17557
17812
|
{
|
|
17558
17813
|
className: "Layer__remove__button",
|
|
17559
17814
|
onClick: () => removeEntryLine(idx2),
|
|
17560
|
-
icon: /* @__PURE__ */
|
|
17815
|
+
icon: /* @__PURE__ */ React204.createElement(Trash_default, null)
|
|
17561
17816
|
}
|
|
17562
17817
|
)
|
|
17563
17818
|
)
|
|
17564
17819
|
);
|
|
17565
17820
|
}),
|
|
17566
|
-
(config.form.addEntryLinesLimit === void 0 || config.form.addEntryLinesLimit > (entrylineItems == null ? void 0 : entrylineItems.length)) && /* @__PURE__ */
|
|
17821
|
+
(config.form.addEntryLinesLimit === void 0 || config.form.addEntryLinesLimit > (entrylineItems == null ? void 0 : entrylineItems.length)) && /* @__PURE__ */ React204.createElement(
|
|
17567
17822
|
TextButton,
|
|
17568
17823
|
{
|
|
17569
17824
|
className: "Layer__journal__add-entry-line",
|
|
@@ -17591,7 +17846,7 @@ var JournalForm = ({
|
|
|
17591
17846
|
addEntryLine,
|
|
17592
17847
|
removeEntryLine
|
|
17593
17848
|
} = useContext39(JournalContext);
|
|
17594
|
-
return /* @__PURE__ */
|
|
17849
|
+
return /* @__PURE__ */ React205.createElement(
|
|
17595
17850
|
"form",
|
|
17596
17851
|
{
|
|
17597
17852
|
className: "Layer__form",
|
|
@@ -17600,7 +17855,7 @@ var JournalForm = ({
|
|
|
17600
17855
|
submitForm();
|
|
17601
17856
|
}
|
|
17602
17857
|
},
|
|
17603
|
-
/* @__PURE__ */
|
|
17858
|
+
/* @__PURE__ */ React205.createElement(Header2, { className: "Layer__journal__sidebar__header" }, /* @__PURE__ */ React205.createElement(HeaderRow, null, /* @__PURE__ */ React205.createElement(HeaderCol, null, /* @__PURE__ */ React205.createElement(Heading, { size: "secondary" /* secondary */, className: "title" }, (_a = stringOverrides == null ? void 0 : stringOverrides.header) != null ? _a : "Add New Entry")), /* @__PURE__ */ React205.createElement(HeaderCol, { className: "actions" }, /* @__PURE__ */ React205.createElement(
|
|
17604
17859
|
Button,
|
|
17605
17860
|
{
|
|
17606
17861
|
type: "button",
|
|
@@ -17609,7 +17864,7 @@ var JournalForm = ({
|
|
|
17609
17864
|
disabled: sendingForm
|
|
17610
17865
|
},
|
|
17611
17866
|
(stringOverrides == null ? void 0 : stringOverrides.cancelButton) || "Cancel"
|
|
17612
|
-
), apiError && /* @__PURE__ */
|
|
17867
|
+
), apiError && /* @__PURE__ */ React205.createElement(
|
|
17613
17868
|
RetryButton,
|
|
17614
17869
|
{
|
|
17615
17870
|
type: "submit",
|
|
@@ -17618,7 +17873,7 @@ var JournalForm = ({
|
|
|
17618
17873
|
disabled: sendingForm
|
|
17619
17874
|
},
|
|
17620
17875
|
(stringOverrides == null ? void 0 : stringOverrides.retryButton) || "Retry"
|
|
17621
|
-
), !apiError && /* @__PURE__ */
|
|
17876
|
+
), !apiError && /* @__PURE__ */ React205.createElement(
|
|
17622
17877
|
SubmitButton,
|
|
17623
17878
|
{
|
|
17624
17879
|
type: "submit",
|
|
@@ -17628,7 +17883,7 @@ var JournalForm = ({
|
|
|
17628
17883
|
},
|
|
17629
17884
|
(stringOverrides == null ? void 0 : stringOverrides.saveButton) || "Save"
|
|
17630
17885
|
)))),
|
|
17631
|
-
apiError && /* @__PURE__ */
|
|
17886
|
+
apiError && /* @__PURE__ */ React205.createElement(
|
|
17632
17887
|
Text,
|
|
17633
17888
|
{
|
|
17634
17889
|
size: "sm" /* sm */,
|
|
@@ -17636,7 +17891,7 @@ var JournalForm = ({
|
|
|
17636
17891
|
},
|
|
17637
17892
|
apiError
|
|
17638
17893
|
),
|
|
17639
|
-
/* @__PURE__ */
|
|
17894
|
+
/* @__PURE__ */ React205.createElement("div", { className: "Layer__journal__form__input-group" }, /* @__PURE__ */ React205.createElement(InputGroup, { name: "date", label: "Effective Date", inline: true }, /* @__PURE__ */ React205.createElement("div", { className: "Layer__journal__datepicker__wrapper" }, /* @__PURE__ */ React205.createElement(
|
|
17640
17895
|
DatePicker,
|
|
17641
17896
|
{
|
|
17642
17897
|
selected: (form == null ? void 0 : form.data.entry_at) ? new Date(form == null ? void 0 : form.data.entry_at) : /* @__PURE__ */ new Date(),
|
|
@@ -17649,7 +17904,7 @@ var JournalForm = ({
|
|
|
17649
17904
|
placeholderText: "Select date",
|
|
17650
17905
|
currentDateOption: false
|
|
17651
17906
|
}
|
|
17652
|
-
), /* @__PURE__ */
|
|
17907
|
+
), /* @__PURE__ */ React205.createElement(
|
|
17653
17908
|
DatePicker,
|
|
17654
17909
|
{
|
|
17655
17910
|
selected: (form == null ? void 0 : form.data.entry_at) ? new Date(form == null ? void 0 : form.data.entry_at) : /* @__PURE__ */ new Date(),
|
|
@@ -17663,7 +17918,7 @@ var JournalForm = ({
|
|
|
17663
17918
|
currentDateOption: false
|
|
17664
17919
|
}
|
|
17665
17920
|
)))),
|
|
17666
|
-
/* @__PURE__ */
|
|
17921
|
+
/* @__PURE__ */ React205.createElement(
|
|
17667
17922
|
JournalFormEntryLines,
|
|
17668
17923
|
{
|
|
17669
17924
|
entrylineItems: (form == null ? void 0 : form.data.line_items) || [],
|
|
@@ -17674,7 +17929,7 @@ var JournalForm = ({
|
|
|
17674
17929
|
config
|
|
17675
17930
|
}
|
|
17676
17931
|
),
|
|
17677
|
-
/* @__PURE__ */
|
|
17932
|
+
/* @__PURE__ */ React205.createElement("div", { className: "Layer__journal__form__input-group Layer__journal__form__input-group__textarea" }, /* @__PURE__ */ React205.createElement(InputGroup, { name: "memo", label: "Notes" }, /* @__PURE__ */ React205.createElement(
|
|
17678
17933
|
Textarea,
|
|
17679
17934
|
{
|
|
17680
17935
|
name: "memo",
|
|
@@ -17684,7 +17939,7 @@ var JournalForm = ({
|
|
|
17684
17939
|
disabled: sendingForm
|
|
17685
17940
|
}
|
|
17686
17941
|
))),
|
|
17687
|
-
/* @__PURE__ */
|
|
17942
|
+
/* @__PURE__ */ React205.createElement("div", { className: "Layer__journal__bottom-actions" }, /* @__PURE__ */ React205.createElement(
|
|
17688
17943
|
Button,
|
|
17689
17944
|
{
|
|
17690
17945
|
type: "button",
|
|
@@ -17693,7 +17948,7 @@ var JournalForm = ({
|
|
|
17693
17948
|
disabled: sendingForm
|
|
17694
17949
|
},
|
|
17695
17950
|
(stringOverrides == null ? void 0 : stringOverrides.cancelButton) || "Cancel"
|
|
17696
|
-
), apiError && /* @__PURE__ */
|
|
17951
|
+
), apiError && /* @__PURE__ */ React205.createElement(
|
|
17697
17952
|
RetryButton,
|
|
17698
17953
|
{
|
|
17699
17954
|
type: "submit",
|
|
@@ -17702,7 +17957,7 @@ var JournalForm = ({
|
|
|
17702
17957
|
disabled: sendingForm
|
|
17703
17958
|
},
|
|
17704
17959
|
(stringOverrides == null ? void 0 : stringOverrides.retryButton) || "Retry"
|
|
17705
|
-
), !apiError && /* @__PURE__ */
|
|
17960
|
+
), !apiError && /* @__PURE__ */ React205.createElement(
|
|
17706
17961
|
SubmitButton,
|
|
17707
17962
|
{
|
|
17708
17963
|
type: "submit",
|
|
@@ -17723,13 +17978,13 @@ var JournalSidebar = ({
|
|
|
17723
17978
|
}) => {
|
|
17724
17979
|
const { selectedEntryId } = useContext40(JournalContext);
|
|
17725
17980
|
if (selectedEntryId !== "new") {
|
|
17726
|
-
return /* @__PURE__ */
|
|
17981
|
+
return /* @__PURE__ */ React206.createElement(JournalEntryDetails, null);
|
|
17727
17982
|
}
|
|
17728
|
-
return /* @__PURE__ */
|
|
17983
|
+
return /* @__PURE__ */ React206.createElement(JournalForm, { config, stringOverrides });
|
|
17729
17984
|
};
|
|
17730
17985
|
|
|
17731
17986
|
// src/components/JournalTable/JournalTable.tsx
|
|
17732
|
-
import
|
|
17987
|
+
import React207, { useContext as useContext41, useEffect as useEffect45 } from "react";
|
|
17733
17988
|
import { parseISO as parseISO14, format as formatTime12 } from "date-fns";
|
|
17734
17989
|
var accountName = (row) => {
|
|
17735
17990
|
if ("account" in row) {
|
|
@@ -17744,7 +17999,7 @@ var JournalTable = ({
|
|
|
17744
17999
|
view,
|
|
17745
18000
|
data,
|
|
17746
18001
|
stringOverrides
|
|
17747
|
-
}) => /* @__PURE__ */
|
|
18002
|
+
}) => /* @__PURE__ */ React207.createElement(TableProvider, null, /* @__PURE__ */ React207.createElement(
|
|
17748
18003
|
JournalTableContent,
|
|
17749
18004
|
{
|
|
17750
18005
|
view,
|
|
@@ -17758,7 +18013,7 @@ var JournalTableContent = ({
|
|
|
17758
18013
|
}) => {
|
|
17759
18014
|
const { selectedEntryId, setSelectedEntryId, closeSelectedEntry } = useContext41(JournalContext);
|
|
17760
18015
|
const { isOpen, setIsOpen } = useTableExpandRow();
|
|
17761
|
-
|
|
18016
|
+
useEffect45(() => {
|
|
17762
18017
|
if (data.length > 0) {
|
|
17763
18018
|
setIsOpen(data.map((x) => `journal-row-${x.id}`));
|
|
17764
18019
|
}
|
|
@@ -17766,7 +18021,7 @@ var JournalTableContent = ({
|
|
|
17766
18021
|
const renderJournalRow = (row, index, rowKey, depth) => {
|
|
17767
18022
|
const expandable = !!row.line_items && row.line_items.length > 0;
|
|
17768
18023
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
17769
|
-
return /* @__PURE__ */
|
|
18024
|
+
return /* @__PURE__ */ React207.createElement(React207.Fragment, { key: rowKey + "-" + index }, /* @__PURE__ */ React207.createElement(
|
|
17770
18025
|
TableRow,
|
|
17771
18026
|
{
|
|
17772
18027
|
rowKey: rowKey + "-" + index,
|
|
@@ -17784,7 +18039,7 @@ var JournalTableContent = ({
|
|
|
17784
18039
|
},
|
|
17785
18040
|
depth
|
|
17786
18041
|
},
|
|
17787
|
-
/* @__PURE__ */
|
|
18042
|
+
/* @__PURE__ */ React207.createElement(
|
|
17788
18043
|
TableCell,
|
|
17789
18044
|
{
|
|
17790
18045
|
withExpandIcon: expandable,
|
|
@@ -17795,16 +18050,16 @@ var JournalTableContent = ({
|
|
|
17795
18050
|
},
|
|
17796
18051
|
entryNumber(row)
|
|
17797
18052
|
),
|
|
17798
|
-
/* @__PURE__ */
|
|
17799
|
-
/* @__PURE__ */
|
|
17800
|
-
/* @__PURE__ */
|
|
17801
|
-
/* @__PURE__ */
|
|
18053
|
+
/* @__PURE__ */ React207.createElement(TableCell, null, row.entry_at && formatTime12(parseISO14(row.entry_at), DATE_FORMAT)),
|
|
18054
|
+
/* @__PURE__ */ React207.createElement(TableCell, null, humanizeEnum(row.entry_type)),
|
|
18055
|
+
/* @__PURE__ */ React207.createElement(TableCell, null, "(", row.line_items.length, ")"),
|
|
18056
|
+
/* @__PURE__ */ React207.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, "line_items" in row && Math.abs(
|
|
17802
18057
|
row.line_items.filter((item) => item.direction === "DEBIT").map((item) => item.amount).reduce((a, b) => a + b, 0)
|
|
17803
18058
|
)),
|
|
17804
|
-
/* @__PURE__ */
|
|
18059
|
+
/* @__PURE__ */ React207.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, "line_items" in row && Math.abs(
|
|
17805
18060
|
row.line_items.filter((item) => item.direction === "CREDIT").map((item) => item.amount).reduce((a, b) => a + b, 0)
|
|
17806
18061
|
))
|
|
17807
|
-
), expandable && expanded && row.line_items.map((subItem, subIdx) => /* @__PURE__ */
|
|
18062
|
+
), expandable && expanded && row.line_items.map((subItem, subIdx) => /* @__PURE__ */ React207.createElement(
|
|
17808
18063
|
TableRow,
|
|
17809
18064
|
{
|
|
17810
18065
|
key: rowKey + "-" + index + "-" + subIdx,
|
|
@@ -17812,15 +18067,15 @@ var JournalTableContent = ({
|
|
|
17812
18067
|
depth: depth + 1,
|
|
17813
18068
|
selected: selectedEntryId === row.id
|
|
17814
18069
|
},
|
|
17815
|
-
/* @__PURE__ */
|
|
17816
|
-
/* @__PURE__ */
|
|
17817
|
-
/* @__PURE__ */
|
|
17818
|
-
/* @__PURE__ */
|
|
17819
|
-
subItem.direction === "DEBIT" && subItem.amount >= 0 ? /* @__PURE__ */
|
|
17820
|
-
subItem.direction === "CREDIT" && subItem.amount >= 0 ? /* @__PURE__ */
|
|
18070
|
+
/* @__PURE__ */ React207.createElement(TableCell, null),
|
|
18071
|
+
/* @__PURE__ */ React207.createElement(TableCell, null),
|
|
18072
|
+
/* @__PURE__ */ React207.createElement(TableCell, null),
|
|
18073
|
+
/* @__PURE__ */ React207.createElement(TableCell, null, accountName(subItem)),
|
|
18074
|
+
subItem.direction === "DEBIT" && subItem.amount >= 0 ? /* @__PURE__ */ React207.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, subItem.amount) : /* @__PURE__ */ React207.createElement(TableCell, null),
|
|
18075
|
+
subItem.direction === "CREDIT" && subItem.amount >= 0 ? /* @__PURE__ */ React207.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, subItem.amount) : /* @__PURE__ */ React207.createElement(TableCell, null)
|
|
17821
18076
|
)));
|
|
17822
18077
|
};
|
|
17823
|
-
return /* @__PURE__ */
|
|
18078
|
+
return /* @__PURE__ */ React207.createElement(Table, { borderCollapse: "collapse" }, /* @__PURE__ */ React207.createElement(TableHead, null, /* @__PURE__ */ React207.createElement(TableRow, { isHeadRow: true, rowKey: "journal-head-row" }, /* @__PURE__ */ React207.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.idColumnHeader) || "Id"), /* @__PURE__ */ React207.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.dateColumnHeader) || "Date"), /* @__PURE__ */ React207.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.transactionColumnHeader) || "Transaction"), /* @__PURE__ */ React207.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.accountColumnHeader) || "Account Name"), /* @__PURE__ */ React207.createElement(TableCell, { isHeaderCell: true, align: "right" /* RIGHT */ }, (stringOverrides == null ? void 0 : stringOverrides.debitColumnHeader) || "Debit"), /* @__PURE__ */ React207.createElement(TableCell, { isHeaderCell: true, align: "right" /* RIGHT */ }, (stringOverrides == null ? void 0 : stringOverrides.creditColumnHeader) || "Credit"))), /* @__PURE__ */ React207.createElement(TableBody, null, data.map(
|
|
17824
18079
|
(entry, idx) => renderJournalRow(entry, idx, `journal-row-${entry.id}`, 0)
|
|
17825
18080
|
)));
|
|
17826
18081
|
};
|
|
@@ -17834,7 +18089,7 @@ var JournalTableWithPanel = ({
|
|
|
17834
18089
|
stringOverrides,
|
|
17835
18090
|
view
|
|
17836
18091
|
}) => {
|
|
17837
|
-
const [currentPage, setCurrentPage] =
|
|
18092
|
+
const [currentPage, setCurrentPage] = useState56(1);
|
|
17838
18093
|
const {
|
|
17839
18094
|
data: rawData,
|
|
17840
18095
|
isLoading,
|
|
@@ -17850,10 +18105,10 @@ var JournalTableWithPanel = ({
|
|
|
17850
18105
|
const lastPageIndex = firstPageIndex + pageSize;
|
|
17851
18106
|
return (_a = rawData == null ? void 0 : rawData.sort((a, b) => Date.parse(b.entry_at) - Date.parse(a.entry_at))) == null ? void 0 : _a.slice(firstPageIndex, lastPageIndex);
|
|
17852
18107
|
}, [rawData, currentPage]);
|
|
17853
|
-
return /* @__PURE__ */
|
|
18108
|
+
return /* @__PURE__ */ React208.createElement(
|
|
17854
18109
|
Panel,
|
|
17855
18110
|
{
|
|
17856
|
-
sidebar: /* @__PURE__ */
|
|
18111
|
+
sidebar: /* @__PURE__ */ React208.createElement(
|
|
17857
18112
|
JournalSidebar,
|
|
17858
18113
|
{
|
|
17859
18114
|
parentRef: containerRef,
|
|
@@ -17864,7 +18119,7 @@ var JournalTableWithPanel = ({
|
|
|
17864
18119
|
sidebarIsOpen: Boolean(selectedEntryId),
|
|
17865
18120
|
parentRef: containerRef
|
|
17866
18121
|
},
|
|
17867
|
-
/* @__PURE__ */
|
|
18122
|
+
/* @__PURE__ */ React208.createElement(
|
|
17868
18123
|
Header2,
|
|
17869
18124
|
{
|
|
17870
18125
|
className: `Layer__${COMPONENT_NAME6}__header`,
|
|
@@ -17872,7 +18127,7 @@ var JournalTableWithPanel = ({
|
|
|
17872
18127
|
sticky: true,
|
|
17873
18128
|
rounded: true
|
|
17874
18129
|
},
|
|
17875
|
-
/* @__PURE__ */
|
|
18130
|
+
/* @__PURE__ */ React208.createElement(HeaderRow, null, /* @__PURE__ */ React208.createElement(HeaderCol, null, /* @__PURE__ */ React208.createElement(
|
|
17876
18131
|
Heading,
|
|
17877
18132
|
{
|
|
17878
18133
|
className: `Layer__${COMPONENT_NAME6}__title`,
|
|
@@ -17881,25 +18136,25 @@ var JournalTableWithPanel = ({
|
|
|
17881
18136
|
(stringOverrides == null ? void 0 : stringOverrides.componentTitle) || "Journal"
|
|
17882
18137
|
)))
|
|
17883
18138
|
),
|
|
17884
|
-
/* @__PURE__ */
|
|
18139
|
+
/* @__PURE__ */ React208.createElement(Header2, null, /* @__PURE__ */ React208.createElement(HeaderRow, null, /* @__PURE__ */ React208.createElement(HeaderCol, null, /* @__PURE__ */ React208.createElement(
|
|
17885
18140
|
Heading,
|
|
17886
18141
|
{
|
|
17887
18142
|
size: "secondary" /* secondary */,
|
|
17888
18143
|
className: `Layer__${COMPONENT_NAME6}__subtitle`
|
|
17889
18144
|
},
|
|
17890
18145
|
(stringOverrides == null ? void 0 : stringOverrides.componentSubtitle) || "Entries"
|
|
17891
|
-
)), /* @__PURE__ */
|
|
18146
|
+
)), /* @__PURE__ */ React208.createElement(HeaderCol, null, /* @__PURE__ */ React208.createElement(
|
|
17892
18147
|
Button,
|
|
17893
18148
|
{
|
|
17894
18149
|
onClick: () => addEntry(),
|
|
17895
18150
|
disabled: isLoading,
|
|
17896
18151
|
iconOnly: view === "mobile",
|
|
17897
|
-
leftIcon: view === "mobile" && /* @__PURE__ */
|
|
18152
|
+
leftIcon: view === "mobile" && /* @__PURE__ */ React208.createElement(PlusIcon_default, { size: 14 })
|
|
17898
18153
|
},
|
|
17899
18154
|
(stringOverrides == null ? void 0 : stringOverrides.addEntryButton) || "Add Entry"
|
|
17900
18155
|
)))),
|
|
17901
|
-
data && /* @__PURE__ */
|
|
17902
|
-
data && /* @__PURE__ */
|
|
18156
|
+
data && /* @__PURE__ */ React208.createElement(JournalTable, { view: "desktop", data }),
|
|
18157
|
+
data && /* @__PURE__ */ React208.createElement("div", { className: "Layer__journal__pagination" }, /* @__PURE__ */ React208.createElement(
|
|
17903
18158
|
Pagination,
|
|
17904
18159
|
{
|
|
17905
18160
|
currentPage,
|
|
@@ -17908,7 +18163,7 @@ var JournalTableWithPanel = ({
|
|
|
17908
18163
|
onPageChange: (page) => setCurrentPage(page)
|
|
17909
18164
|
}
|
|
17910
18165
|
)),
|
|
17911
|
-
(data == null ? void 0 : data.length) === 0 && !isLoading && !error && /* @__PURE__ */
|
|
18166
|
+
(data == null ? void 0 : data.length) === 0 && !isLoading && !error && /* @__PURE__ */ React208.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React208.createElement(
|
|
17912
18167
|
DataState,
|
|
17913
18168
|
{
|
|
17914
18169
|
status: "allDone" /* allDone */,
|
|
@@ -17916,7 +18171,7 @@ var JournalTableWithPanel = ({
|
|
|
17916
18171
|
description: "There are no entries in the journal."
|
|
17917
18172
|
}
|
|
17918
18173
|
)),
|
|
17919
|
-
error ? /* @__PURE__ */
|
|
18174
|
+
error ? /* @__PURE__ */ React208.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React208.createElement(
|
|
17920
18175
|
DataState,
|
|
17921
18176
|
{
|
|
17922
18177
|
status: "failed" /* failed */,
|
|
@@ -17926,7 +18181,7 @@ var JournalTableWithPanel = ({
|
|
|
17926
18181
|
isLoading: isValidating || isLoading
|
|
17927
18182
|
}
|
|
17928
18183
|
)) : null,
|
|
17929
|
-
(!data || isLoading) && !error ? /* @__PURE__ */
|
|
18184
|
+
(!data || isLoading) && !error ? /* @__PURE__ */ React208.createElement("div", { className: `Layer__${COMPONENT_NAME6}__loader-container` }, /* @__PURE__ */ React208.createElement(Loader2, null)) : null
|
|
17930
18185
|
);
|
|
17931
18186
|
};
|
|
17932
18187
|
|
|
@@ -17939,18 +18194,15 @@ var JOURNAL_CONFIG = {
|
|
|
17939
18194
|
var Journal = (props) => {
|
|
17940
18195
|
const JournalContextData = useJournal();
|
|
17941
18196
|
const AccountsContextData = useChartOfAccounts();
|
|
17942
|
-
return /* @__PURE__ */
|
|
18197
|
+
return /* @__PURE__ */ React209.createElement(ChartOfAccountsContext.Provider, { value: AccountsContextData }, /* @__PURE__ */ React209.createElement(JournalContext.Provider, { value: JournalContextData }, /* @__PURE__ */ React209.createElement(JournalContent, __spreadValues({}, props))));
|
|
17943
18198
|
};
|
|
17944
18199
|
var JournalContent = ({
|
|
17945
18200
|
asWidget,
|
|
17946
18201
|
config = JOURNAL_CONFIG,
|
|
17947
18202
|
stringOverrides
|
|
17948
18203
|
}) => {
|
|
17949
|
-
const
|
|
17950
|
-
|
|
17951
|
-
(newView) => setView(newView)
|
|
17952
|
-
);
|
|
17953
|
-
return /* @__PURE__ */ React206.createElement(Container, { name: "journal", ref: containerRef, asWidget }, /* @__PURE__ */ React206.createElement(
|
|
18204
|
+
const { view, containerRef } = useElementViewSize();
|
|
18205
|
+
return /* @__PURE__ */ React209.createElement(Container, { name: "journal", ref: containerRef, asWidget }, /* @__PURE__ */ React209.createElement(
|
|
17954
18206
|
JournalTableWithPanel,
|
|
17955
18207
|
{
|
|
17956
18208
|
view,
|
|
@@ -17962,12 +18214,12 @@ var JournalContent = ({
|
|
|
17962
18214
|
};
|
|
17963
18215
|
|
|
17964
18216
|
// src/components/Tasks/Tasks.tsx
|
|
17965
|
-
import
|
|
18217
|
+
import React216, {
|
|
17966
18218
|
createContext as createContext20,
|
|
17967
18219
|
useContext as useContext47,
|
|
17968
|
-
useEffect as
|
|
18220
|
+
useEffect as useEffect48,
|
|
17969
18221
|
useMemo as useMemo31,
|
|
17970
|
-
useState as
|
|
18222
|
+
useState as useState60
|
|
17971
18223
|
} from "react";
|
|
17972
18224
|
|
|
17973
18225
|
// src/contexts/TasksContext/TasksContext.tsx
|
|
@@ -17986,7 +18238,7 @@ var TasksContext = createContext19({
|
|
|
17986
18238
|
});
|
|
17987
18239
|
|
|
17988
18240
|
// src/hooks/useTasks/useTasks.tsx
|
|
17989
|
-
import { useEffect as
|
|
18241
|
+
import { useEffect as useEffect46, useState as useState57 } from "react";
|
|
17990
18242
|
|
|
17991
18243
|
// src/hooks/useTasks/mockData.ts
|
|
17992
18244
|
var mockData = [
|
|
@@ -18028,7 +18280,7 @@ var mockData = [
|
|
|
18028
18280
|
import useSWR11 from "swr";
|
|
18029
18281
|
var DEBUG_MODE = false;
|
|
18030
18282
|
var useTasks = () => {
|
|
18031
|
-
const [loadedStatus, setLoadedStatus] =
|
|
18283
|
+
const [loadedStatus, setLoadedStatus] = useState57("initial");
|
|
18032
18284
|
const { businessId, read, syncTimestamps, hasBeenTouched } = useLayerContext();
|
|
18033
18285
|
const { apiUrl } = useEnvironment();
|
|
18034
18286
|
const { data: auth } = useAuth();
|
|
@@ -18039,7 +18291,7 @@ var useTasks = () => {
|
|
|
18039
18291
|
params: { businessId }
|
|
18040
18292
|
})
|
|
18041
18293
|
);
|
|
18042
|
-
|
|
18294
|
+
useEffect46(() => {
|
|
18043
18295
|
if (isLoading && loadedStatus === "initial") {
|
|
18044
18296
|
setLoadedStatus("loading");
|
|
18045
18297
|
} else if (!isLoading && loadedStatus === "loading") {
|
|
@@ -18070,12 +18322,12 @@ var useTasks = () => {
|
|
|
18070
18322
|
body: data2
|
|
18071
18323
|
}).then(() => refetch());
|
|
18072
18324
|
};
|
|
18073
|
-
|
|
18325
|
+
useEffect46(() => {
|
|
18074
18326
|
if (queryKey && (isLoading || isValidating)) {
|
|
18075
18327
|
read("TASKS" /* TASKS */, queryKey);
|
|
18076
18328
|
}
|
|
18077
18329
|
}, [isLoading, isValidating]);
|
|
18078
|
-
|
|
18330
|
+
useEffect46(() => {
|
|
18079
18331
|
if (queryKey && hasBeenTouched(queryKey)) {
|
|
18080
18332
|
refetch();
|
|
18081
18333
|
}
|
|
@@ -18099,13 +18351,13 @@ function isComplete(taskType) {
|
|
|
18099
18351
|
}
|
|
18100
18352
|
|
|
18101
18353
|
// src/components/TasksHeader/TasksHeader.tsx
|
|
18102
|
-
import
|
|
18354
|
+
import React211, { useContext as useContext43 } from "react";
|
|
18103
18355
|
|
|
18104
18356
|
// src/icons/ProgressIcon.tsx
|
|
18105
|
-
import * as
|
|
18357
|
+
import * as React210 from "react";
|
|
18106
18358
|
var ProgressIcon = (_a) => {
|
|
18107
18359
|
var _b = _a, { size = 12 } = _b, props = __objRest(_b, ["size"]);
|
|
18108
|
-
return /* @__PURE__ */
|
|
18360
|
+
return /* @__PURE__ */ React210.createElement(
|
|
18109
18361
|
"svg",
|
|
18110
18362
|
__spreadProps(__spreadValues({
|
|
18111
18363
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -18115,7 +18367,7 @@ var ProgressIcon = (_a) => {
|
|
|
18115
18367
|
width: size,
|
|
18116
18368
|
height: size
|
|
18117
18369
|
}),
|
|
18118
|
-
/* @__PURE__ */
|
|
18370
|
+
/* @__PURE__ */ React210.createElement(
|
|
18119
18371
|
"path",
|
|
18120
18372
|
{
|
|
18121
18373
|
d: "M9 1.5V4.5",
|
|
@@ -18124,7 +18376,7 @@ var ProgressIcon = (_a) => {
|
|
|
18124
18376
|
strokeLinejoin: "round"
|
|
18125
18377
|
}
|
|
18126
18378
|
),
|
|
18127
|
-
/* @__PURE__ */
|
|
18379
|
+
/* @__PURE__ */ React210.createElement(
|
|
18128
18380
|
"path",
|
|
18129
18381
|
{
|
|
18130
18382
|
d: "M9 13.5V16.5",
|
|
@@ -18133,7 +18385,7 @@ var ProgressIcon = (_a) => {
|
|
|
18133
18385
|
strokeLinejoin: "round"
|
|
18134
18386
|
}
|
|
18135
18387
|
),
|
|
18136
|
-
/* @__PURE__ */
|
|
18388
|
+
/* @__PURE__ */ React210.createElement(
|
|
18137
18389
|
"path",
|
|
18138
18390
|
{
|
|
18139
18391
|
d: "M3.6975 3.6975L5.82 5.82",
|
|
@@ -18142,7 +18394,7 @@ var ProgressIcon = (_a) => {
|
|
|
18142
18394
|
strokeLinejoin: "round"
|
|
18143
18395
|
}
|
|
18144
18396
|
),
|
|
18145
|
-
/* @__PURE__ */
|
|
18397
|
+
/* @__PURE__ */ React210.createElement(
|
|
18146
18398
|
"path",
|
|
18147
18399
|
{
|
|
18148
18400
|
d: "M12.18 12.18L14.3025 14.3025",
|
|
@@ -18151,7 +18403,7 @@ var ProgressIcon = (_a) => {
|
|
|
18151
18403
|
strokeLinejoin: "round"
|
|
18152
18404
|
}
|
|
18153
18405
|
),
|
|
18154
|
-
/* @__PURE__ */
|
|
18406
|
+
/* @__PURE__ */ React210.createElement(
|
|
18155
18407
|
"path",
|
|
18156
18408
|
{
|
|
18157
18409
|
d: "M1.5 9H4.5",
|
|
@@ -18160,7 +18412,7 @@ var ProgressIcon = (_a) => {
|
|
|
18160
18412
|
strokeLinejoin: "round"
|
|
18161
18413
|
}
|
|
18162
18414
|
),
|
|
18163
|
-
/* @__PURE__ */
|
|
18415
|
+
/* @__PURE__ */ React210.createElement(
|
|
18164
18416
|
"path",
|
|
18165
18417
|
{
|
|
18166
18418
|
d: "M13.5 9H16.5",
|
|
@@ -18169,7 +18421,7 @@ var ProgressIcon = (_a) => {
|
|
|
18169
18421
|
strokeLinejoin: "round"
|
|
18170
18422
|
}
|
|
18171
18423
|
),
|
|
18172
|
-
/* @__PURE__ */
|
|
18424
|
+
/* @__PURE__ */ React210.createElement(
|
|
18173
18425
|
"path",
|
|
18174
18426
|
{
|
|
18175
18427
|
d: "M3.6975 14.3025L5.82 12.18",
|
|
@@ -18178,7 +18430,7 @@ var ProgressIcon = (_a) => {
|
|
|
18178
18430
|
strokeLinejoin: "round"
|
|
18179
18431
|
}
|
|
18180
18432
|
),
|
|
18181
|
-
/* @__PURE__ */
|
|
18433
|
+
/* @__PURE__ */ React210.createElement(
|
|
18182
18434
|
"path",
|
|
18183
18435
|
{
|
|
18184
18436
|
d: "M12.18 5.82L14.3025 3.6975",
|
|
@@ -18194,22 +18446,22 @@ var ProgressIcon_default = ProgressIcon;
|
|
|
18194
18446
|
// src/components/TasksHeader/TasksHeader.tsx
|
|
18195
18447
|
var ICONS = {
|
|
18196
18448
|
loading: {
|
|
18197
|
-
icon: /* @__PURE__ */
|
|
18449
|
+
icon: /* @__PURE__ */ React211.createElement(ProgressIcon_default, { size: 12, className: "Layer__anim--rotating" }),
|
|
18198
18450
|
text: "Loading",
|
|
18199
18451
|
badge: "default" /* DEFAULT */
|
|
18200
18452
|
},
|
|
18201
18453
|
done: {
|
|
18202
|
-
icon: /* @__PURE__ */
|
|
18454
|
+
icon: /* @__PURE__ */ React211.createElement(Check_default, { size: 12 }),
|
|
18203
18455
|
text: "Done",
|
|
18204
18456
|
badge: "success" /* SUCCESS */
|
|
18205
18457
|
},
|
|
18206
18458
|
pending: {
|
|
18207
|
-
icon: /* @__PURE__ */
|
|
18459
|
+
icon: /* @__PURE__ */ React211.createElement(AlertCircle_default, { size: 12 }),
|
|
18208
18460
|
text: "In progress",
|
|
18209
18461
|
badge: "warning" /* WARNING */
|
|
18210
18462
|
},
|
|
18211
18463
|
refresh: {
|
|
18212
|
-
icon: /* @__PURE__ */
|
|
18464
|
+
icon: /* @__PURE__ */ React211.createElement(RefreshCcw_default, { size: 12 }),
|
|
18213
18465
|
text: "Refresh",
|
|
18214
18466
|
badge: "default" /* DEFAULT */
|
|
18215
18467
|
}
|
|
@@ -18223,7 +18475,7 @@ var TasksHeader = ({
|
|
|
18223
18475
|
const { data: tasks, loadedStatus, refetch, error } = useContext43(TasksContext);
|
|
18224
18476
|
const completedTasks = tasks == null ? void 0 : tasks.filter((task) => isComplete(task.status)).length;
|
|
18225
18477
|
const badgeVariant = completedTasks === (tasks == null ? void 0 : tasks.length) ? ICONS.done : ICONS.pending;
|
|
18226
|
-
return /* @__PURE__ */
|
|
18478
|
+
return /* @__PURE__ */ React211.createElement("div", { className: "Layer__tasks-header" }, /* @__PURE__ */ React211.createElement("div", { className: "Layer__tasks-header__left-col" }, /* @__PURE__ */ React211.createElement(Text, { size: "lg" /* lg */ }, tasksHeader), loadedStatus !== "complete" && !open ? /* @__PURE__ */ React211.createElement(Badge, { variant: ICONS.loading.badge, icon: ICONS.loading.icon }, ICONS.loading.text) : loadedStatus === "complete" && (!tasks || error) ? /* @__PURE__ */ React211.createElement(
|
|
18227
18479
|
Badge,
|
|
18228
18480
|
{
|
|
18229
18481
|
onClick: () => refetch(),
|
|
@@ -18231,17 +18483,17 @@ var TasksHeader = ({
|
|
|
18231
18483
|
icon: ICONS.refresh.icon
|
|
18232
18484
|
},
|
|
18233
18485
|
ICONS.refresh.text
|
|
18234
|
-
) : loadedStatus === "complete" ? /* @__PURE__ */
|
|
18486
|
+
) : loadedStatus === "complete" ? /* @__PURE__ */ React211.createElement(Badge, { variant: badgeVariant.badge, icon: badgeVariant.icon }, badgeVariant.text) : open ? null : /* @__PURE__ */ React211.createElement(Badge, { variant: badgeVariant.badge, icon: badgeVariant.icon }, badgeVariant.text)), collapsable && /* @__PURE__ */ React211.createElement(ExpandButton, { onClick: toggleContent, collapsed: !open }));
|
|
18235
18487
|
};
|
|
18236
18488
|
|
|
18237
18489
|
// src/components/TasksList/TasksList.tsx
|
|
18238
|
-
import
|
|
18490
|
+
import React214, { useContext as useContext45, useMemo as useMemo30, useState as useState59 } from "react";
|
|
18239
18491
|
|
|
18240
18492
|
// src/icons/SmileIcon.tsx
|
|
18241
|
-
import * as
|
|
18493
|
+
import * as React212 from "react";
|
|
18242
18494
|
var SmileIcon = (_a) => {
|
|
18243
18495
|
var _b = _a, { size = 12 } = _b, props = __objRest(_b, ["size"]);
|
|
18244
|
-
return /* @__PURE__ */
|
|
18496
|
+
return /* @__PURE__ */ React212.createElement(
|
|
18245
18497
|
"svg",
|
|
18246
18498
|
__spreadProps(__spreadValues({
|
|
18247
18499
|
viewBox: "0 0 12 12",
|
|
@@ -18251,7 +18503,7 @@ var SmileIcon = (_a) => {
|
|
|
18251
18503
|
width: size,
|
|
18252
18504
|
height: size
|
|
18253
18505
|
}),
|
|
18254
|
-
/* @__PURE__ */
|
|
18506
|
+
/* @__PURE__ */ React212.createElement(
|
|
18255
18507
|
"path",
|
|
18256
18508
|
{
|
|
18257
18509
|
d: "M6.5 11.5C9.26142 11.5 11.5 9.26142 11.5 6.5C11.5 3.73858 9.26142 1.5 6.5 1.5C3.73858 1.5 1.5 3.73858 1.5 6.5C1.5 9.26142 3.73858 11.5 6.5 11.5Z",
|
|
@@ -18260,7 +18512,7 @@ var SmileIcon = (_a) => {
|
|
|
18260
18512
|
strokeLinejoin: "round"
|
|
18261
18513
|
}
|
|
18262
18514
|
),
|
|
18263
|
-
/* @__PURE__ */
|
|
18515
|
+
/* @__PURE__ */ React212.createElement(
|
|
18264
18516
|
"path",
|
|
18265
18517
|
{
|
|
18266
18518
|
d: "M4.5 7.5C4.5 7.5 5.25 8.5 6.5 8.5C7.75 8.5 8.5 7.5 8.5 7.5",
|
|
@@ -18269,7 +18521,7 @@ var SmileIcon = (_a) => {
|
|
|
18269
18521
|
strokeLinejoin: "round"
|
|
18270
18522
|
}
|
|
18271
18523
|
),
|
|
18272
|
-
/* @__PURE__ */
|
|
18524
|
+
/* @__PURE__ */ React212.createElement(
|
|
18273
18525
|
"path",
|
|
18274
18526
|
{
|
|
18275
18527
|
d: "M5 5H5.005",
|
|
@@ -18278,7 +18530,7 @@ var SmileIcon = (_a) => {
|
|
|
18278
18530
|
strokeLinejoin: "round"
|
|
18279
18531
|
}
|
|
18280
18532
|
),
|
|
18281
|
-
/* @__PURE__ */
|
|
18533
|
+
/* @__PURE__ */ React212.createElement(
|
|
18282
18534
|
"path",
|
|
18283
18535
|
{
|
|
18284
18536
|
d: "M8 5H8.005",
|
|
@@ -18292,15 +18544,15 @@ var SmileIcon = (_a) => {
|
|
|
18292
18544
|
var SmileIcon_default = SmileIcon;
|
|
18293
18545
|
|
|
18294
18546
|
// src/components/TasksListItem/TasksListItem.tsx
|
|
18295
|
-
import
|
|
18547
|
+
import React213, { useContext as useContext44, useEffect as useEffect47, useState as useState58 } from "react";
|
|
18296
18548
|
import classNames66 from "classnames";
|
|
18297
18549
|
var TasksListItem = ({
|
|
18298
18550
|
task,
|
|
18299
18551
|
goToNextPageIfAllComplete,
|
|
18300
18552
|
defaultOpen
|
|
18301
18553
|
}) => {
|
|
18302
|
-
const [isOpen, setIsOpen] =
|
|
18303
|
-
const [userResponse, setUserResponse] =
|
|
18554
|
+
const [isOpen, setIsOpen] = useState58(defaultOpen);
|
|
18555
|
+
const [userResponse, setUserResponse] = useState58(task.user_response || "");
|
|
18304
18556
|
const { submitResponseToTask: submitResponseToTask2, uploadDocumentForTask } = useContext44(TasksContext);
|
|
18305
18557
|
const taskBodyClassName = classNames66(
|
|
18306
18558
|
"Layer__tasks-list-item__body",
|
|
@@ -18315,17 +18567,17 @@ var TasksListItem = ({
|
|
|
18315
18567
|
"Layer__tasks-list-item",
|
|
18316
18568
|
isOpen && "Layer__tasks-list-item__expanded"
|
|
18317
18569
|
);
|
|
18318
|
-
|
|
18570
|
+
useEffect47(() => {
|
|
18319
18571
|
setIsOpen(defaultOpen);
|
|
18320
18572
|
}, [defaultOpen]);
|
|
18321
|
-
return /* @__PURE__ */
|
|
18573
|
+
return /* @__PURE__ */ React213.createElement("div", { className: "Layer__tasks-list-item-wrapper" }, /* @__PURE__ */ React213.createElement("div", { className: taskItemClassName }, /* @__PURE__ */ React213.createElement(
|
|
18322
18574
|
"div",
|
|
18323
18575
|
{
|
|
18324
18576
|
className: "Layer__tasks-list-item__head",
|
|
18325
18577
|
onClick: () => setIsOpen(!isOpen)
|
|
18326
18578
|
},
|
|
18327
|
-
/* @__PURE__ */
|
|
18328
|
-
/* @__PURE__ */
|
|
18579
|
+
/* @__PURE__ */ React213.createElement("div", { className: taskHeadClassName }, /* @__PURE__ */ React213.createElement("div", { className: "Layer__tasks-list-item__head-info__status" }, isComplete(task.status) ? /* @__PURE__ */ React213.createElement(Check_default, { size: 12 }) : /* @__PURE__ */ React213.createElement(AlertCircle_default, { size: 12 })), /* @__PURE__ */ React213.createElement(Text, { size: "md" /* md */ }, task.title)),
|
|
18580
|
+
/* @__PURE__ */ React213.createElement(
|
|
18329
18581
|
ChevronDownFill_default,
|
|
18330
18582
|
{
|
|
18331
18583
|
size: 16,
|
|
@@ -18335,13 +18587,13 @@ var TasksListItem = ({
|
|
|
18335
18587
|
}
|
|
18336
18588
|
}
|
|
18337
18589
|
)
|
|
18338
|
-
), /* @__PURE__ */
|
|
18590
|
+
), /* @__PURE__ */ React213.createElement("div", { className: taskBodyClassName }, /* @__PURE__ */ React213.createElement("div", { className: "Layer__tasks-list-item__body-info" }, /* @__PURE__ */ React213.createElement(Text, { size: "sm" /* sm */ }, task.question), task.user_response_type === "FREE_RESPONSE" ? /* @__PURE__ */ React213.createElement(
|
|
18339
18591
|
Textarea,
|
|
18340
18592
|
{
|
|
18341
18593
|
value: userResponse,
|
|
18342
18594
|
onChange: (e) => setUserResponse(e.target.value)
|
|
18343
18595
|
}
|
|
18344
|
-
) : null, /* @__PURE__ */
|
|
18596
|
+
) : null, /* @__PURE__ */ React213.createElement("div", { className: "Layer__tasks-list-item__actions" }, task.user_response_type === "UPLOAD_DOCUMENT" ? /* @__PURE__ */ React213.createElement(
|
|
18345
18597
|
FileInput,
|
|
18346
18598
|
{
|
|
18347
18599
|
onUpload: (file) => {
|
|
@@ -18352,7 +18604,7 @@ var TasksListItem = ({
|
|
|
18352
18604
|
text: "Upload file",
|
|
18353
18605
|
disabled: task.completed_at != null || task.user_marked_completed_at != null || task.archived_at != null
|
|
18354
18606
|
}
|
|
18355
|
-
) : /* @__PURE__ */
|
|
18607
|
+
) : /* @__PURE__ */ React213.createElement(
|
|
18356
18608
|
Button,
|
|
18357
18609
|
{
|
|
18358
18610
|
disabled: userResponse.length === 0 || userResponse === task.user_response,
|
|
@@ -18376,14 +18628,14 @@ function paginateArray(array, chunkSize = 10) {
|
|
|
18376
18628
|
}
|
|
18377
18629
|
return result;
|
|
18378
18630
|
}
|
|
18379
|
-
var TasksEmptyState = () => /* @__PURE__ */
|
|
18631
|
+
var TasksEmptyState = () => /* @__PURE__ */ React214.createElement("div", { className: "Layer__tasks-empty-state" }, /* @__PURE__ */ React214.createElement("div", { className: "Layer__tasks-icon" }, /* @__PURE__ */ React214.createElement(SmileIcon_default, null)), /* @__PURE__ */ React214.createElement(Text, { size: "sm" /* sm */ }, "There are no pending tasks!", /* @__PURE__ */ React214.createElement("br", null), " Great job!"));
|
|
18380
18632
|
var TasksList = ({ pageSize = 10 }) => {
|
|
18381
18633
|
const { data: tasks, error } = useContext45(TasksContext);
|
|
18382
18634
|
const firstPageWithIincompleteTasks = paginateArray(
|
|
18383
18635
|
tasks || [],
|
|
18384
18636
|
pageSize
|
|
18385
18637
|
).findIndex((page) => page.some((task) => !isComplete(task.status)));
|
|
18386
|
-
const [currentPage, setCurrentPage] =
|
|
18638
|
+
const [currentPage, setCurrentPage] = useState59(
|
|
18387
18639
|
firstPageWithIincompleteTasks === -1 ? 1 : firstPageWithIincompleteTasks + 1
|
|
18388
18640
|
);
|
|
18389
18641
|
const sortedTasks = useMemo30(() => {
|
|
@@ -18400,7 +18652,7 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
18400
18652
|
setCurrentPage(currentPage + 1);
|
|
18401
18653
|
}
|
|
18402
18654
|
};
|
|
18403
|
-
return /* @__PURE__ */
|
|
18655
|
+
return /* @__PURE__ */ React214.createElement("div", { className: "Layer__tasks-list" }, sortedTasks && sortedTasks.length > 0 ? /* @__PURE__ */ React214.createElement(React214.Fragment, null, sortedTasks.map((task, index) => /* @__PURE__ */ React214.createElement(
|
|
18404
18656
|
TasksListItem,
|
|
18405
18657
|
{
|
|
18406
18658
|
key: task.id,
|
|
@@ -18408,7 +18660,7 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
18408
18660
|
goToNextPageIfAllComplete: goToNextPage,
|
|
18409
18661
|
defaultOpen: index === indexFirstIncomplete
|
|
18410
18662
|
}
|
|
18411
|
-
)), tasks && tasks.length >= 10 && /* @__PURE__ */
|
|
18663
|
+
)), tasks && tasks.length >= 10 && /* @__PURE__ */ React214.createElement("div", { className: "Layer__tasks__pagination" }, /* @__PURE__ */ React214.createElement(
|
|
18412
18664
|
Pagination,
|
|
18413
18665
|
{
|
|
18414
18666
|
currentPage,
|
|
@@ -18416,11 +18668,11 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
18416
18668
|
pageSize,
|
|
18417
18669
|
onPageChange: (page) => setCurrentPage(page)
|
|
18418
18670
|
}
|
|
18419
|
-
))) : /* @__PURE__ */
|
|
18671
|
+
))) : /* @__PURE__ */ React214.createElement(React214.Fragment, null, error ? /* @__PURE__ */ React214.createElement(ErrorText, null, "Approval failed. Check connection and retry in few seconds.") : /* @__PURE__ */ React214.createElement(TasksEmptyState, null)));
|
|
18420
18672
|
};
|
|
18421
18673
|
|
|
18422
18674
|
// src/components/TasksPending/TasksPending.tsx
|
|
18423
|
-
import
|
|
18675
|
+
import React215, { useContext as useContext46 } from "react";
|
|
18424
18676
|
import classNames67 from "classnames";
|
|
18425
18677
|
import { format as format7 } from "date-fns";
|
|
18426
18678
|
import { Cell as Cell4, Pie as Pie3, PieChart as PieChart4 } from "recharts";
|
|
@@ -18440,7 +18692,7 @@ var TasksPending = () => {
|
|
|
18440
18692
|
const taskStatusClassName = classNames67(
|
|
18441
18693
|
completedTasks && completedTasks > 0 ? "Layer__tasks-pending-bar__status--done" : "Layer__tasks-pending-bar__status--pending"
|
|
18442
18694
|
);
|
|
18443
|
-
return /* @__PURE__ */
|
|
18695
|
+
return /* @__PURE__ */ React215.createElement("div", { className: "Layer__tasks-pending" }, /* @__PURE__ */ React215.createElement(Text, { size: "lg" /* lg */ }, format7(Date.now(), "MMMM")), /* @__PURE__ */ React215.createElement("div", { className: "Layer__tasks-pending-bar" }, /* @__PURE__ */ React215.createElement(Text, { size: "sm" /* sm */ }, /* @__PURE__ */ React215.createElement("span", { className: taskStatusClassName }, completedTasks), "/", data == null ? void 0 : data.length, " done"), /* @__PURE__ */ React215.createElement(PieChart4, { width: 24, height: 24, className: "mini-chart" }, /* @__PURE__ */ React215.createElement(
|
|
18444
18696
|
Pie3,
|
|
18445
18697
|
{
|
|
18446
18698
|
data: chartData,
|
|
@@ -18458,7 +18710,7 @@ var TasksPending = () => {
|
|
|
18458
18710
|
animationEasing: "ease-in-out"
|
|
18459
18711
|
},
|
|
18460
18712
|
chartData.map((task, index) => {
|
|
18461
|
-
return /* @__PURE__ */
|
|
18713
|
+
return /* @__PURE__ */ React215.createElement(
|
|
18462
18714
|
Cell4,
|
|
18463
18715
|
{
|
|
18464
18716
|
key: `cell-${index}`,
|
|
@@ -18493,7 +18745,7 @@ var Tasks = ({
|
|
|
18493
18745
|
// deprecated
|
|
18494
18746
|
stringOverrides
|
|
18495
18747
|
}) => {
|
|
18496
|
-
return /* @__PURE__ */
|
|
18748
|
+
return /* @__PURE__ */ React216.createElement(TasksProvider, null, /* @__PURE__ */ React216.createElement(
|
|
18497
18749
|
TasksComponent,
|
|
18498
18750
|
{
|
|
18499
18751
|
collapsable,
|
|
@@ -18506,7 +18758,7 @@ var Tasks = ({
|
|
|
18506
18758
|
};
|
|
18507
18759
|
var TasksProvider = ({ children }) => {
|
|
18508
18760
|
const contextData = useTasks();
|
|
18509
|
-
return /* @__PURE__ */
|
|
18761
|
+
return /* @__PURE__ */ React216.createElement(TasksContext.Provider, { value: contextData }, children);
|
|
18510
18762
|
};
|
|
18511
18763
|
var TasksComponent = ({
|
|
18512
18764
|
collapsable = false,
|
|
@@ -18526,15 +18778,15 @@ var TasksComponent = ({
|
|
|
18526
18778
|
}
|
|
18527
18779
|
return false;
|
|
18528
18780
|
}, [data, isLoading]);
|
|
18529
|
-
const [open, setOpen] =
|
|
18781
|
+
const [open, setOpen] = useState60(
|
|
18530
18782
|
defaultCollapsed || collapsedWhenComplete ? false : true
|
|
18531
18783
|
);
|
|
18532
|
-
|
|
18784
|
+
useEffect48(() => {
|
|
18533
18785
|
if (allComplete && open && collapsedWhenComplete && loadedStatus === "complete") {
|
|
18534
18786
|
setOpen(false);
|
|
18535
18787
|
}
|
|
18536
18788
|
}, [allComplete]);
|
|
18537
|
-
return /* @__PURE__ */
|
|
18789
|
+
return /* @__PURE__ */ React216.createElement("div", { className: "Layer__tasks-component" }, /* @__PURE__ */ React216.createElement(
|
|
18538
18790
|
TasksHeader,
|
|
18539
18791
|
{
|
|
18540
18792
|
tasksHeader: (stringOverrides == null ? void 0 : stringOverrides.header) || tasksHeader,
|
|
@@ -18542,7 +18794,7 @@ var TasksComponent = ({
|
|
|
18542
18794
|
open,
|
|
18543
18795
|
toggleContent: () => setOpen(!open)
|
|
18544
18796
|
}
|
|
18545
|
-
), /* @__PURE__ */
|
|
18797
|
+
), /* @__PURE__ */ React216.createElement(
|
|
18546
18798
|
"div",
|
|
18547
18799
|
{
|
|
18548
18800
|
className: classNames68(
|
|
@@ -18550,21 +18802,21 @@ var TasksComponent = ({
|
|
|
18550
18802
|
!open && "Layer__tasks__content--collapsed"
|
|
18551
18803
|
)
|
|
18552
18804
|
},
|
|
18553
|
-
isLoading || !data ? /* @__PURE__ */
|
|
18805
|
+
isLoading || !data ? /* @__PURE__ */ React216.createElement("div", { className: "Layer__tasks__loader-container" }, /* @__PURE__ */ React216.createElement(Loader2, null)) : /* @__PURE__ */ React216.createElement(React216.Fragment, null, data.length > 0 && /* @__PURE__ */ React216.createElement(TasksPending, null), /* @__PURE__ */ React216.createElement(TasksList, null))
|
|
18554
18806
|
));
|
|
18555
18807
|
};
|
|
18556
18808
|
|
|
18557
18809
|
// src/components/PlatformOnboarding/LinkAccounts.tsx
|
|
18558
|
-
import
|
|
18810
|
+
import React217, { useContext as useContext48, useMemo as useMemo32 } from "react";
|
|
18559
18811
|
var LinkAccounts = (_a) => {
|
|
18560
18812
|
var _b = _a, { inBox } = _b, props = __objRest(_b, ["inBox"]);
|
|
18561
18813
|
const content = useMemo32(() => {
|
|
18562
18814
|
if (inBox) {
|
|
18563
|
-
return /* @__PURE__ */
|
|
18815
|
+
return /* @__PURE__ */ React217.createElement("div", { className: "Layer__link-accounts__box" }, /* @__PURE__ */ React217.createElement(LinkAccountsContent, __spreadValues({}, props)));
|
|
18564
18816
|
}
|
|
18565
|
-
return /* @__PURE__ */
|
|
18817
|
+
return /* @__PURE__ */ React217.createElement(LinkAccountsContent, __spreadValues({}, props));
|
|
18566
18818
|
}, [inBox, props]);
|
|
18567
|
-
return /* @__PURE__ */
|
|
18819
|
+
return /* @__PURE__ */ React217.createElement(LinkedAccountsProvider, null, content);
|
|
18568
18820
|
};
|
|
18569
18821
|
var LinkAccountsContent = ({
|
|
18570
18822
|
title,
|
|
@@ -18579,7 +18831,7 @@ var LinkAccountsContent = ({
|
|
|
18579
18831
|
}) => {
|
|
18580
18832
|
var _a;
|
|
18581
18833
|
const { data, loadingStatus, error, refetchAccounts, addConnection } = useContext48(LinkedAccountsContext);
|
|
18582
|
-
return /* @__PURE__ */
|
|
18834
|
+
return /* @__PURE__ */ React217.createElement("div", { className: "Layer__link-accounts Layer__component" }, title && /* @__PURE__ */ React217.createElement(Heading, { size: "view" /* view */ }, title), data && data.length === 0 ? /* @__PURE__ */ React217.createElement("div", { className: "Layer__link-accounts__data-status-container" }, !hideLoading && loadingStatus !== "complete" ? /* @__PURE__ */ React217.createElement(Loader2, null) : null, Boolean(error) && /* @__PURE__ */ React217.createElement(
|
|
18583
18835
|
DataState,
|
|
18584
18836
|
{
|
|
18585
18837
|
status: "failed" /* failed */,
|
|
@@ -18587,7 +18839,7 @@ var LinkAccountsContent = ({
|
|
|
18587
18839
|
description: "Please try again later",
|
|
18588
18840
|
onRefresh: refetchAccounts
|
|
18589
18841
|
}
|
|
18590
|
-
)) : null, data && data.length > 0 ? /* @__PURE__ */
|
|
18842
|
+
)) : null, data && data.length > 0 ? /* @__PURE__ */ React217.createElement("div", { className: "Layer__link-accounts__list" }, data == null ? void 0 : data.map((account, index) => /* @__PURE__ */ React217.createElement(
|
|
18591
18843
|
LinkedAccountItemThumb,
|
|
18592
18844
|
{
|
|
18593
18845
|
key: index,
|
|
@@ -18597,33 +18849,33 @@ var LinkAccountsContent = ({
|
|
|
18597
18849
|
showBreakConnection,
|
|
18598
18850
|
asWidget
|
|
18599
18851
|
}
|
|
18600
|
-
))) : null, /* @__PURE__ */
|
|
18852
|
+
))) : null, /* @__PURE__ */ React217.createElement(
|
|
18601
18853
|
ActionableRow,
|
|
18602
18854
|
{
|
|
18603
|
-
iconBox: /* @__PURE__ */
|
|
18855
|
+
iconBox: /* @__PURE__ */ React217.createElement(PlaidIcon_default, null),
|
|
18604
18856
|
title: data && data.length > 0 ? "Connect my next business account" : "Connect accounts",
|
|
18605
18857
|
description: "Import data with one simple integration.",
|
|
18606
|
-
button: /* @__PURE__ */
|
|
18858
|
+
button: /* @__PURE__ */ React217.createElement(
|
|
18607
18859
|
Button,
|
|
18608
18860
|
{
|
|
18609
18861
|
onClick: () => addConnection("PLAID"),
|
|
18610
|
-
rightIcon: /* @__PURE__ */
|
|
18862
|
+
rightIcon: /* @__PURE__ */ React217.createElement(Link_default, { size: 12 }),
|
|
18611
18863
|
disabled: loadingStatus !== "complete"
|
|
18612
18864
|
},
|
|
18613
18865
|
data && data.length > 0 ? "Connect next" : "Connect"
|
|
18614
18866
|
)
|
|
18615
18867
|
}
|
|
18616
|
-
), /* @__PURE__ */
|
|
18868
|
+
), /* @__PURE__ */ React217.createElement(LinkedAccountsConfirmationModal, null), onBack || onNext ? /* @__PURE__ */ React217.createElement("div", { className: "Layer__link-accounts__footer" }, onBack && /* @__PURE__ */ React217.createElement(Button, { onClick: onBack, variant: "secondary" /* secondary */ }, (_a = stringOverrides == null ? void 0 : stringOverrides.backButtonText) != null ? _a : "Back"), onNext && /* @__PURE__ */ React217.createElement(Button, { onClick: onNext }, (stringOverrides == null ? void 0 : stringOverrides.nextButtonText) || "I\u2019m done connecting my business accounts")) : null);
|
|
18617
18869
|
};
|
|
18618
18870
|
|
|
18619
18871
|
// src/components/UpsellBanner/BookkeepingUpsellBar.tsx
|
|
18620
|
-
import
|
|
18872
|
+
import React219 from "react";
|
|
18621
18873
|
|
|
18622
18874
|
// src/icons/Coffee.tsx
|
|
18623
|
-
import * as
|
|
18875
|
+
import * as React218 from "react";
|
|
18624
18876
|
var CoffeeIcon = (_a) => {
|
|
18625
18877
|
var _b = _a, { size = 11 } = _b, props = __objRest(_b, ["size"]);
|
|
18626
|
-
return /* @__PURE__ */
|
|
18878
|
+
return /* @__PURE__ */ React218.createElement(
|
|
18627
18879
|
"svg",
|
|
18628
18880
|
__spreadProps(__spreadValues({
|
|
18629
18881
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -18633,7 +18885,7 @@ var CoffeeIcon = (_a) => {
|
|
|
18633
18885
|
width: size,
|
|
18634
18886
|
height: size
|
|
18635
18887
|
}),
|
|
18636
|
-
/* @__PURE__ */
|
|
18888
|
+
/* @__PURE__ */ React218.createElement("g", { clipPath: "url(#clip0_5018_10141)" }, /* @__PURE__ */ React218.createElement(
|
|
18637
18889
|
"path",
|
|
18638
18890
|
{
|
|
18639
18891
|
d: "M3.25 4.16666H2.79167C2.30544 4.16666 1.83912 4.35981 1.4953 4.70363C1.15149 5.04744 0.958333 5.51376 0.958333 5.99999C0.958333 6.48622 1.15149 6.95254 1.4953 7.29635C1.83912 7.64017 2.30544 7.83332 2.79167 7.83332H3.25",
|
|
@@ -18641,7 +18893,7 @@ var CoffeeIcon = (_a) => {
|
|
|
18641
18893
|
strokeLinecap: "round",
|
|
18642
18894
|
strokeLinejoin: "round"
|
|
18643
18895
|
}
|
|
18644
|
-
), /* @__PURE__ */
|
|
18896
|
+
), /* @__PURE__ */ React218.createElement(
|
|
18645
18897
|
"path",
|
|
18646
18898
|
{
|
|
18647
18899
|
d: "M10.5834 4.16666H3.25004V8.29166C3.25004 8.77789 3.4432 9.2442 3.78701 9.58802C4.13083 9.93184 4.59714 10.125 5.08337 10.125H8.75004C9.23627 10.125 9.70259 9.93184 10.0464 9.58802C10.3902 9.2442 10.5834 8.77789 10.5834 8.29166V4.16666Z",
|
|
@@ -18649,7 +18901,7 @@ var CoffeeIcon = (_a) => {
|
|
|
18649
18901
|
strokeLinecap: "round",
|
|
18650
18902
|
strokeLinejoin: "round"
|
|
18651
18903
|
}
|
|
18652
|
-
), /* @__PURE__ */
|
|
18904
|
+
), /* @__PURE__ */ React218.createElement(
|
|
18653
18905
|
"path",
|
|
18654
18906
|
{
|
|
18655
18907
|
d: "M8.75 0.958344V2.33334",
|
|
@@ -18657,7 +18909,7 @@ var CoffeeIcon = (_a) => {
|
|
|
18657
18909
|
strokeLinecap: "round",
|
|
18658
18910
|
strokeLinejoin: "round"
|
|
18659
18911
|
}
|
|
18660
|
-
), /* @__PURE__ */
|
|
18912
|
+
), /* @__PURE__ */ React218.createElement(
|
|
18661
18913
|
"path",
|
|
18662
18914
|
{
|
|
18663
18915
|
d: "M6.91663 0.958344V2.33334",
|
|
@@ -18665,7 +18917,7 @@ var CoffeeIcon = (_a) => {
|
|
|
18665
18917
|
strokeLinecap: "round",
|
|
18666
18918
|
strokeLinejoin: "round"
|
|
18667
18919
|
}
|
|
18668
|
-
), /* @__PURE__ */
|
|
18920
|
+
), /* @__PURE__ */ React218.createElement(
|
|
18669
18921
|
"path",
|
|
18670
18922
|
{
|
|
18671
18923
|
d: "M5.08337 0.958344V2.33334",
|
|
@@ -18674,7 +18926,7 @@ var CoffeeIcon = (_a) => {
|
|
|
18674
18926
|
strokeLinejoin: "round"
|
|
18675
18927
|
}
|
|
18676
18928
|
)),
|
|
18677
|
-
/* @__PURE__ */
|
|
18929
|
+
/* @__PURE__ */ React218.createElement("defs", null, /* @__PURE__ */ React218.createElement("clipPath", { id: "clip0_5018_10141" }, /* @__PURE__ */ React218.createElement(
|
|
18678
18930
|
"rect",
|
|
18679
18931
|
{
|
|
18680
18932
|
width: "11",
|
|
@@ -18692,26 +18944,26 @@ var BookkeepingUpsellBar = ({
|
|
|
18692
18944
|
onClick,
|
|
18693
18945
|
href
|
|
18694
18946
|
}) => {
|
|
18695
|
-
return /* @__PURE__ */
|
|
18947
|
+
return /* @__PURE__ */ React219.createElement("div", { className: "Layer__bar-banner Layer__bar-banner--bookkeeping" }, /* @__PURE__ */ React219.createElement("div", { className: "Layer__bar-banner__left-col" }, /* @__PURE__ */ React219.createElement(IconBox, null, /* @__PURE__ */ React219.createElement(Coffee_default, null)), /* @__PURE__ */ React219.createElement("div", { className: "Layer__bar-banner__text-container" }, /* @__PURE__ */ React219.createElement(Text, { size: "md" /* md */, weight: "bold" /* bold */ }, "Need help with your books?"), /* @__PURE__ */ React219.createElement(
|
|
18696
18948
|
Text,
|
|
18697
18949
|
{
|
|
18698
18950
|
size: "sm" /* sm */,
|
|
18699
18951
|
className: "Layer__bar-banner__text-container__desc"
|
|
18700
18952
|
},
|
|
18701
18953
|
"Order bookkeeping service supported by real humans."
|
|
18702
|
-
))), onClick ? /* @__PURE__ */
|
|
18954
|
+
))), onClick ? /* @__PURE__ */ React219.createElement(Button, { variant: "secondary" /* secondary */, onClick }, "Schedule a demo") : href ? /* @__PURE__ */ React219.createElement(Link2, { href, target: "_blank", variant: "secondary" /* secondary */ }, "Schedule a demo") : null);
|
|
18703
18955
|
};
|
|
18704
18956
|
|
|
18705
18957
|
// src/views/BookkeepingOverview/BookkeepingOverview.tsx
|
|
18706
|
-
import
|
|
18958
|
+
import React221, { useState as useState61 } from "react";
|
|
18707
18959
|
|
|
18708
18960
|
// src/views/BookkeepingOverview/internal/BookkeepingProfitAndLossSummariesContainer.tsx
|
|
18709
|
-
import
|
|
18710
|
-
var
|
|
18961
|
+
import React220 from "react";
|
|
18962
|
+
var CLASS_NAME7 = "Layer__BookkeepingProfitAndLossSummariesContainer";
|
|
18711
18963
|
function BookkeepingProfitAndLossSummariesContainer({
|
|
18712
18964
|
children
|
|
18713
18965
|
}) {
|
|
18714
|
-
return /* @__PURE__ */
|
|
18966
|
+
return /* @__PURE__ */ React220.createElement("div", { className: CLASS_NAME7 }, children);
|
|
18715
18967
|
}
|
|
18716
18968
|
|
|
18717
18969
|
// src/views/BookkeepingOverview/BookkeepingOverview.tsx
|
|
@@ -18723,19 +18975,19 @@ var BookkeepingOverview = ({
|
|
|
18723
18975
|
slotProps
|
|
18724
18976
|
}) => {
|
|
18725
18977
|
var _a, _b, _c, _d, _e, _f;
|
|
18726
|
-
const [pnlToggle, setPnlToggle] =
|
|
18978
|
+
const [pnlToggle, setPnlToggle] = useState61("expenses");
|
|
18727
18979
|
const [width] = useWindowSize();
|
|
18728
18980
|
const profitAndLossSummariesVariants = (_b = (_a = slotProps == null ? void 0 : slotProps.profitAndLoss) == null ? void 0 : _a.summaries) == null ? void 0 : _b.variants;
|
|
18729
|
-
return /* @__PURE__ */
|
|
18981
|
+
return /* @__PURE__ */ React221.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React221.createElement(TasksProvider, null, /* @__PURE__ */ React221.createElement(
|
|
18730
18982
|
View,
|
|
18731
18983
|
{
|
|
18732
18984
|
viewClassName: "Layer__bookkeeping-overview--view",
|
|
18733
18985
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "Bookkeeping overview",
|
|
18734
18986
|
withSidebar: width > 1100,
|
|
18735
|
-
sidebar: /* @__PURE__ */
|
|
18987
|
+
sidebar: /* @__PURE__ */ React221.createElement(TasksComponent, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.tasks }),
|
|
18736
18988
|
showHeader: showTitle
|
|
18737
18989
|
},
|
|
18738
|
-
width <= 1100 && /* @__PURE__ */
|
|
18990
|
+
width <= 1100 && /* @__PURE__ */ React221.createElement(
|
|
18739
18991
|
TasksComponent,
|
|
18740
18992
|
{
|
|
18741
18993
|
collapsable: true,
|
|
@@ -18743,30 +18995,30 @@ var BookkeepingOverview = ({
|
|
|
18743
18995
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.tasks
|
|
18744
18996
|
}
|
|
18745
18997
|
),
|
|
18746
|
-
/* @__PURE__ */
|
|
18998
|
+
/* @__PURE__ */ React221.createElement(
|
|
18747
18999
|
Container,
|
|
18748
19000
|
{
|
|
18749
19001
|
name: "bookkeeping-overview-profit-and-loss",
|
|
18750
19002
|
asWidget: true,
|
|
18751
19003
|
elevated: true
|
|
18752
19004
|
},
|
|
18753
|
-
/* @__PURE__ */
|
|
19005
|
+
/* @__PURE__ */ React221.createElement(
|
|
18754
19006
|
ProfitAndLoss.Header,
|
|
18755
19007
|
{
|
|
18756
19008
|
text: ((_c = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _c.header) || "Profit & Loss",
|
|
18757
19009
|
withDatePicker: true
|
|
18758
19010
|
}
|
|
18759
19011
|
),
|
|
18760
|
-
/* @__PURE__ */
|
|
19012
|
+
/* @__PURE__ */ React221.createElement(BookkeepingProfitAndLossSummariesContainer, null, /* @__PURE__ */ React221.createElement(
|
|
18761
19013
|
ProfitAndLoss.Summaries,
|
|
18762
19014
|
{
|
|
18763
19015
|
stringOverrides: (_d = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _d.summaries,
|
|
18764
19016
|
variants: profitAndLossSummariesVariants
|
|
18765
19017
|
}
|
|
18766
19018
|
)),
|
|
18767
|
-
/* @__PURE__ */
|
|
19019
|
+
/* @__PURE__ */ React221.createElement(ProfitAndLoss.Chart, null)
|
|
18768
19020
|
),
|
|
18769
|
-
/* @__PURE__ */
|
|
19021
|
+
/* @__PURE__ */ React221.createElement("div", { className: "Layer__bookkeeping-overview-profit-and-loss-charts" }, /* @__PURE__ */ React221.createElement(
|
|
18770
19022
|
Toggle,
|
|
18771
19023
|
{
|
|
18772
19024
|
name: "pnl-detailed-charts",
|
|
@@ -18783,7 +19035,7 @@ var BookkeepingOverview = ({
|
|
|
18783
19035
|
selected: pnlToggle,
|
|
18784
19036
|
onChange: (e) => setPnlToggle(e.target.value)
|
|
18785
19037
|
}
|
|
18786
|
-
), /* @__PURE__ */
|
|
19038
|
+
), /* @__PURE__ */ React221.createElement(
|
|
18787
19039
|
Container,
|
|
18788
19040
|
{
|
|
18789
19041
|
name: classNames69(
|
|
@@ -18791,7 +19043,7 @@ var BookkeepingOverview = ({
|
|
|
18791
19043
|
pnlToggle !== "revenue" && "bookkeeping-overview-profit-and-loss-chart--hidden"
|
|
18792
19044
|
)
|
|
18793
19045
|
},
|
|
18794
|
-
/* @__PURE__ */
|
|
19046
|
+
/* @__PURE__ */ React221.createElement(
|
|
18795
19047
|
ProfitAndLoss.DetailedCharts,
|
|
18796
19048
|
{
|
|
18797
19049
|
scope: "revenue",
|
|
@@ -18799,7 +19051,7 @@ var BookkeepingOverview = ({
|
|
|
18799
19051
|
stringOverrides: (_e = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _e.detailedCharts
|
|
18800
19052
|
}
|
|
18801
19053
|
)
|
|
18802
|
-
), /* @__PURE__ */
|
|
19054
|
+
), /* @__PURE__ */ React221.createElement(
|
|
18803
19055
|
Container,
|
|
18804
19056
|
{
|
|
18805
19057
|
name: classNames69(
|
|
@@ -18807,7 +19059,7 @@ var BookkeepingOverview = ({
|
|
|
18807
19059
|
pnlToggle !== "expenses" && "bookkeeping-overview-profit-and-loss-chart--hidden"
|
|
18808
19060
|
)
|
|
18809
19061
|
},
|
|
18810
|
-
/* @__PURE__ */
|
|
19062
|
+
/* @__PURE__ */ React221.createElement(
|
|
18811
19063
|
ProfitAndLoss.DetailedCharts,
|
|
18812
19064
|
{
|
|
18813
19065
|
scope: "expenses",
|
|
@@ -18820,20 +19072,20 @@ var BookkeepingOverview = ({
|
|
|
18820
19072
|
};
|
|
18821
19073
|
|
|
18822
19074
|
// src/views/AccountingOverview/AccountingOverview.tsx
|
|
18823
|
-
import
|
|
19075
|
+
import React224, { useState as useState63 } from "react";
|
|
18824
19076
|
|
|
18825
19077
|
// src/views/AccountingOverview/internal/TransactionsToReview.tsx
|
|
18826
|
-
import
|
|
19078
|
+
import React223, { useContext as useContext49, useEffect as useEffect49, useState as useState62 } from "react";
|
|
18827
19079
|
|
|
18828
19080
|
// src/components/BadgeLoader/BadgeLoader.tsx
|
|
18829
|
-
import
|
|
19081
|
+
import React222 from "react";
|
|
18830
19082
|
var BadgeLoader = ({ children }) => {
|
|
18831
|
-
return /* @__PURE__ */
|
|
19083
|
+
return /* @__PURE__ */ React222.createElement("span", { className: "Layer__loader Layer__loader--as-badge" }, /* @__PURE__ */ React222.createElement(Loader_default, { size: 11, className: "Layer__anim--rotating" }), children);
|
|
18832
19084
|
};
|
|
18833
19085
|
|
|
18834
19086
|
// src/views/AccountingOverview/internal/TransactionsToReview.tsx
|
|
18835
19087
|
import { getMonth as getMonth2, getYear as getYear2, startOfMonth as startOfMonth17 } from "date-fns";
|
|
18836
|
-
var
|
|
19088
|
+
var CLASS_NAME8 = "Layer__TransactionsToReview";
|
|
18837
19089
|
function TransactionsToReview({
|
|
18838
19090
|
onClick,
|
|
18839
19091
|
usePnlDateRange,
|
|
@@ -18843,15 +19095,15 @@ function TransactionsToReview({
|
|
|
18843
19095
|
const { size = "sm" } = variants != null ? variants : {};
|
|
18844
19096
|
const { dateRange: contextDateRange } = useContext49(ProfitAndLoss.Context);
|
|
18845
19097
|
const dateRange = usePnlDateRange ? contextDateRange : void 0;
|
|
18846
|
-
const [toReview, setToReview] =
|
|
19098
|
+
const [toReview, setToReview] = useState62(0);
|
|
18847
19099
|
const { data, loaded, error, refetch } = useProfitAndLossLTM({
|
|
18848
19100
|
currentDate: dateRange ? dateRange.startDate : startOfMonth17(/* @__PURE__ */ new Date()),
|
|
18849
19101
|
tagFilter
|
|
18850
19102
|
});
|
|
18851
|
-
|
|
19103
|
+
useEffect49(() => {
|
|
18852
19104
|
checkTransactionsToReview();
|
|
18853
19105
|
}, []);
|
|
18854
|
-
|
|
19106
|
+
useEffect49(() => {
|
|
18855
19107
|
checkTransactionsToReview();
|
|
18856
19108
|
}, [dateRange, loaded]);
|
|
18857
19109
|
const checkTransactionsToReview = () => {
|
|
@@ -18873,33 +19125,33 @@ function TransactionsToReview({
|
|
|
18873
19125
|
verticalGap = "sm";
|
|
18874
19126
|
break;
|
|
18875
19127
|
}
|
|
18876
|
-
return /* @__PURE__ */
|
|
19128
|
+
return /* @__PURE__ */ React223.createElement("div", { onClick, className: CLASS_NAME8 }, /* @__PURE__ */ React223.createElement(VStack, { gap: verticalGap, align: "start" }, /* @__PURE__ */ React223.createElement(ProfitAndLossSummariesHeading, { variants }, "Transactions to review"), loaded === "initial" || loaded === "loading" ? /* @__PURE__ */ React223.createElement(BadgeLoader, null) : null, loaded === "complete" && error ? /* @__PURE__ */ React223.createElement(
|
|
18877
19129
|
Badge,
|
|
18878
19130
|
{
|
|
18879
19131
|
variant: "error" /* ERROR */,
|
|
18880
19132
|
size: "small" /* SMALL */,
|
|
18881
|
-
icon: /* @__PURE__ */
|
|
19133
|
+
icon: /* @__PURE__ */ React223.createElement(RefreshCcw_default, { size: 12 }),
|
|
18882
19134
|
onClick: () => refetch()
|
|
18883
19135
|
},
|
|
18884
19136
|
"Refresh"
|
|
18885
|
-
) : null, loaded === "complete" && !error && toReview > 0 ? /* @__PURE__ */
|
|
19137
|
+
) : null, loaded === "complete" && !error && toReview > 0 ? /* @__PURE__ */ React223.createElement(
|
|
18886
19138
|
Badge,
|
|
18887
19139
|
{
|
|
18888
19140
|
variant: "warning" /* WARNING */,
|
|
18889
19141
|
size: "small" /* SMALL */,
|
|
18890
|
-
icon: /* @__PURE__ */
|
|
19142
|
+
icon: /* @__PURE__ */ React223.createElement(Bell_default, { size: 12 })
|
|
18891
19143
|
},
|
|
18892
19144
|
toReview,
|
|
18893
19145
|
" pending"
|
|
18894
|
-
) : null, loaded === "complete" && !error && toReview === 0 ? /* @__PURE__ */
|
|
19146
|
+
) : null, loaded === "complete" && !error && toReview === 0 ? /* @__PURE__ */ React223.createElement(
|
|
18895
19147
|
Badge,
|
|
18896
19148
|
{
|
|
18897
19149
|
variant: "success" /* SUCCESS */,
|
|
18898
19150
|
size: "small" /* SMALL */,
|
|
18899
|
-
icon: /* @__PURE__ */
|
|
19151
|
+
icon: /* @__PURE__ */ React223.createElement(Check_default, { size: 12 })
|
|
18900
19152
|
},
|
|
18901
19153
|
"All done"
|
|
18902
|
-
) : null), /* @__PURE__ */
|
|
19154
|
+
) : null), /* @__PURE__ */ React223.createElement(IconButton, { icon: /* @__PURE__ */ React223.createElement(ChevronRight_default, null), withBorder: true, onClick }));
|
|
18903
19155
|
}
|
|
18904
19156
|
|
|
18905
19157
|
// src/views/AccountingOverview/AccountingOverview.tsx
|
|
@@ -18918,36 +19170,36 @@ var AccountingOverview = ({
|
|
|
18918
19170
|
slotProps
|
|
18919
19171
|
}) => {
|
|
18920
19172
|
var _a, _b, _c, _d, _e;
|
|
18921
|
-
const [pnlToggle, setPnlToggle] =
|
|
19173
|
+
const [pnlToggle, setPnlToggle] = useState63("expenses");
|
|
18922
19174
|
const profitAndLossSummariesVariants = (_b = (_a = slotProps == null ? void 0 : slotProps.profitAndLoss) == null ? void 0 : _a.summaries) == null ? void 0 : _b.variants;
|
|
18923
|
-
return /* @__PURE__ */
|
|
19175
|
+
return /* @__PURE__ */ React224.createElement(
|
|
18924
19176
|
ProfitAndLoss,
|
|
18925
19177
|
{
|
|
18926
19178
|
asContainer: false,
|
|
18927
19179
|
tagFilter: tagFilter ? { key: tagFilter.tagKey, values: tagFilter.tagValues } : void 0
|
|
18928
19180
|
},
|
|
18929
|
-
/* @__PURE__ */
|
|
19181
|
+
/* @__PURE__ */ React224.createElement(
|
|
18930
19182
|
View,
|
|
18931
19183
|
{
|
|
18932
19184
|
title,
|
|
18933
19185
|
showHeader: showTitle,
|
|
18934
|
-
header: /* @__PURE__ */
|
|
19186
|
+
header: /* @__PURE__ */ React224.createElement(Header2, null, /* @__PURE__ */ React224.createElement(HeaderRow, null, /* @__PURE__ */ React224.createElement(HeaderCol, null, /* @__PURE__ */ React224.createElement(ProfitAndLoss.DatePicker, null))))
|
|
18935
19187
|
},
|
|
18936
|
-
enableOnboarding && /* @__PURE__ */
|
|
19188
|
+
enableOnboarding && /* @__PURE__ */ React224.createElement(
|
|
18937
19189
|
Onboarding,
|
|
18938
19190
|
{
|
|
18939
19191
|
onTransactionsToReviewClick,
|
|
18940
19192
|
onboardingStepOverride
|
|
18941
19193
|
}
|
|
18942
19194
|
),
|
|
18943
|
-
/* @__PURE__ */
|
|
19195
|
+
/* @__PURE__ */ React224.createElement(
|
|
18944
19196
|
Internal_ProfitAndLossSummaries,
|
|
18945
19197
|
{
|
|
18946
19198
|
stringOverrides: (_c = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _c.summaries,
|
|
18947
19199
|
chartColorsList,
|
|
18948
19200
|
slots: {
|
|
18949
19201
|
unstable_AdditionalListItems: showTransactionsToReview ? [
|
|
18950
|
-
/* @__PURE__ */
|
|
19202
|
+
/* @__PURE__ */ React224.createElement(
|
|
18951
19203
|
TransactionsToReview,
|
|
18952
19204
|
{
|
|
18953
19205
|
key: "transactions-to-review",
|
|
@@ -18961,28 +19213,28 @@ var AccountingOverview = ({
|
|
|
18961
19213
|
variants: profitAndLossSummariesVariants
|
|
18962
19214
|
}
|
|
18963
19215
|
),
|
|
18964
|
-
/* @__PURE__ */
|
|
19216
|
+
/* @__PURE__ */ React224.createElement(
|
|
18965
19217
|
Container,
|
|
18966
19218
|
{
|
|
18967
19219
|
name: "accounting-overview-profit-and-loss",
|
|
18968
19220
|
asWidget: true,
|
|
18969
19221
|
elevated: true
|
|
18970
19222
|
},
|
|
18971
|
-
/* @__PURE__ */
|
|
19223
|
+
/* @__PURE__ */ React224.createElement(
|
|
18972
19224
|
ProfitAndLoss.Header,
|
|
18973
19225
|
{
|
|
18974
19226
|
text: (stringOverrides == null ? void 0 : stringOverrides.header) || "Profit & Loss"
|
|
18975
19227
|
}
|
|
18976
19228
|
),
|
|
18977
|
-
/* @__PURE__ */
|
|
19229
|
+
/* @__PURE__ */ React224.createElement(
|
|
18978
19230
|
ProfitAndLoss.Chart,
|
|
18979
19231
|
{
|
|
18980
19232
|
tagFilter: tagFilter ? { key: tagFilter.tagKey, values: tagFilter.tagValues } : void 0
|
|
18981
19233
|
}
|
|
18982
19234
|
)
|
|
18983
19235
|
),
|
|
18984
|
-
middleBanner && /* @__PURE__ */
|
|
18985
|
-
/* @__PURE__ */
|
|
19236
|
+
middleBanner && /* @__PURE__ */ React224.createElement(Container, { name: "accounting-overview-middle-banner" }, middleBanner),
|
|
19237
|
+
/* @__PURE__ */ React224.createElement("div", { className: "Layer__accounting-overview-profit-and-loss-charts" }, /* @__PURE__ */ React224.createElement(
|
|
18986
19238
|
Toggle,
|
|
18987
19239
|
{
|
|
18988
19240
|
name: "pnl-detailed-charts",
|
|
@@ -18999,7 +19251,7 @@ var AccountingOverview = ({
|
|
|
18999
19251
|
selected: pnlToggle,
|
|
19000
19252
|
onChange: (e) => setPnlToggle(e.target.value)
|
|
19001
19253
|
}
|
|
19002
|
-
), /* @__PURE__ */
|
|
19254
|
+
), /* @__PURE__ */ React224.createElement(
|
|
19003
19255
|
Container,
|
|
19004
19256
|
{
|
|
19005
19257
|
name: classNames70(
|
|
@@ -19007,7 +19259,7 @@ var AccountingOverview = ({
|
|
|
19007
19259
|
pnlToggle !== "revenue" && "accounting-overview-profit-and-loss-chart--hidden"
|
|
19008
19260
|
)
|
|
19009
19261
|
},
|
|
19010
|
-
/* @__PURE__ */
|
|
19262
|
+
/* @__PURE__ */ React224.createElement(
|
|
19011
19263
|
ProfitAndLoss.DetailedCharts,
|
|
19012
19264
|
{
|
|
19013
19265
|
scope: "revenue",
|
|
@@ -19016,7 +19268,7 @@ var AccountingOverview = ({
|
|
|
19016
19268
|
chartColorsList
|
|
19017
19269
|
}
|
|
19018
19270
|
)
|
|
19019
|
-
), /* @__PURE__ */
|
|
19271
|
+
), /* @__PURE__ */ React224.createElement(
|
|
19020
19272
|
Container,
|
|
19021
19273
|
{
|
|
19022
19274
|
name: classNames70(
|
|
@@ -19024,7 +19276,7 @@ var AccountingOverview = ({
|
|
|
19024
19276
|
pnlToggle !== "expenses" && "accounting-overview-profit-and-loss-chart--hidden"
|
|
19025
19277
|
)
|
|
19026
19278
|
},
|
|
19027
|
-
/* @__PURE__ */
|
|
19279
|
+
/* @__PURE__ */ React224.createElement(
|
|
19028
19280
|
ProfitAndLoss.DetailedCharts,
|
|
19029
19281
|
{
|
|
19030
19282
|
scope: "expenses",
|
|
@@ -19039,7 +19291,7 @@ var AccountingOverview = ({
|
|
|
19039
19291
|
};
|
|
19040
19292
|
|
|
19041
19293
|
// src/views/BankTransactionsWithLinkedAccounts/BankTransactionsWithLinkedAccounts.tsx
|
|
19042
|
-
import
|
|
19294
|
+
import React225 from "react";
|
|
19043
19295
|
var BankTransactionsWithLinkedAccounts = ({
|
|
19044
19296
|
title,
|
|
19045
19297
|
// deprecated
|
|
@@ -19055,13 +19307,13 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
19055
19307
|
mobileComponent,
|
|
19056
19308
|
stringOverrides
|
|
19057
19309
|
}) => {
|
|
19058
|
-
return /* @__PURE__ */
|
|
19310
|
+
return /* @__PURE__ */ React225.createElement(
|
|
19059
19311
|
View,
|
|
19060
19312
|
{
|
|
19061
19313
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "Bank transactions",
|
|
19062
19314
|
showHeader: showTitle
|
|
19063
19315
|
},
|
|
19064
|
-
/* @__PURE__ */
|
|
19316
|
+
/* @__PURE__ */ React225.createElement(
|
|
19065
19317
|
LinkedAccounts,
|
|
19066
19318
|
{
|
|
19067
19319
|
elevated: elevatedLinkedAccounts,
|
|
@@ -19071,7 +19323,7 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
19071
19323
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.linkedAccounts
|
|
19072
19324
|
}
|
|
19073
19325
|
),
|
|
19074
|
-
/* @__PURE__ */
|
|
19326
|
+
/* @__PURE__ */ React225.createElement(
|
|
19075
19327
|
BankTransactions,
|
|
19076
19328
|
{
|
|
19077
19329
|
asWidget: true,
|
|
@@ -19087,7 +19339,7 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
19087
19339
|
};
|
|
19088
19340
|
|
|
19089
19341
|
// src/views/GeneralLedger/GeneralLedger.tsx
|
|
19090
|
-
import
|
|
19342
|
+
import React226, { useState as useState64 } from "react";
|
|
19091
19343
|
var GeneralLedgerView = ({
|
|
19092
19344
|
title,
|
|
19093
19345
|
// deprecated
|
|
@@ -19095,14 +19347,14 @@ var GeneralLedgerView = ({
|
|
|
19095
19347
|
stringOverrides,
|
|
19096
19348
|
chartOfAccountsOptions
|
|
19097
19349
|
}) => {
|
|
19098
|
-
const [activeTab, setActiveTab] =
|
|
19099
|
-
return /* @__PURE__ */
|
|
19350
|
+
const [activeTab, setActiveTab] = useState64("chartOfAccounts");
|
|
19351
|
+
return /* @__PURE__ */ React226.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React226.createElement(
|
|
19100
19352
|
View,
|
|
19101
19353
|
{
|
|
19102
19354
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "General Ledger",
|
|
19103
19355
|
showHeader: showTitle
|
|
19104
19356
|
},
|
|
19105
|
-
/* @__PURE__ */
|
|
19357
|
+
/* @__PURE__ */ React226.createElement(
|
|
19106
19358
|
Toggle,
|
|
19107
19359
|
{
|
|
19108
19360
|
name: "general-ledger-tabs",
|
|
@@ -19120,7 +19372,7 @@ var GeneralLedgerView = ({
|
|
|
19120
19372
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
19121
19373
|
}
|
|
19122
19374
|
),
|
|
19123
|
-
activeTab === "chartOfAccounts" ? /* @__PURE__ */
|
|
19375
|
+
activeTab === "chartOfAccounts" ? /* @__PURE__ */ React226.createElement(
|
|
19124
19376
|
ChartOfAccounts,
|
|
19125
19377
|
{
|
|
19126
19378
|
asWidget: true,
|
|
@@ -19129,12 +19381,12 @@ var GeneralLedgerView = ({
|
|
|
19129
19381
|
templateAccountsEditable: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.templateAccountsEditable,
|
|
19130
19382
|
showReversalEntries: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.showReversalEntries
|
|
19131
19383
|
}
|
|
19132
|
-
) : /* @__PURE__ */
|
|
19384
|
+
) : /* @__PURE__ */ React226.createElement(Journal, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.journal })
|
|
19133
19385
|
));
|
|
19134
19386
|
};
|
|
19135
19387
|
|
|
19136
19388
|
// src/views/ProjectProfitability/ProjectProfitability.tsx
|
|
19137
|
-
import
|
|
19389
|
+
import React227, { useState as useState65 } from "react";
|
|
19138
19390
|
import Select4 from "react-select";
|
|
19139
19391
|
var ProjectProfitabilityView = ({
|
|
19140
19392
|
valueOptions,
|
|
@@ -19143,9 +19395,9 @@ var ProjectProfitabilityView = ({
|
|
|
19143
19395
|
datePickerMode = "monthPicker",
|
|
19144
19396
|
csvMoneyFormat = "DOLLAR_STRING"
|
|
19145
19397
|
}) => {
|
|
19146
|
-
const [activeTab, setActiveTab] =
|
|
19147
|
-
const [tagFilter, setTagFilter] =
|
|
19148
|
-
const [pnlTagFilter, setPnlTagFilter] =
|
|
19398
|
+
const [activeTab, setActiveTab] = useState65("overview");
|
|
19399
|
+
const [tagFilter, setTagFilter] = useState65(null);
|
|
19400
|
+
const [pnlTagFilter, setPnlTagFilter] = useState65(
|
|
19149
19401
|
void 0
|
|
19150
19402
|
);
|
|
19151
19403
|
const isOptionSelected = (option, selectValue) => {
|
|
@@ -19159,14 +19411,14 @@ var ProjectProfitabilityView = ({
|
|
|
19159
19411
|
values: tagFilter2.tagValues
|
|
19160
19412
|
} : void 0;
|
|
19161
19413
|
};
|
|
19162
|
-
return /* @__PURE__ */
|
|
19414
|
+
return /* @__PURE__ */ React227.createElement(
|
|
19163
19415
|
View,
|
|
19164
19416
|
{
|
|
19165
19417
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || "",
|
|
19166
19418
|
showHeader: showTitle,
|
|
19167
19419
|
viewClassName: "Layer__project-view"
|
|
19168
19420
|
},
|
|
19169
|
-
/* @__PURE__ */
|
|
19421
|
+
/* @__PURE__ */ React227.createElement("div", { className: "Layer__component Layer__header__actions" }, /* @__PURE__ */ React227.createElement("div", { className: "Layer__component" }, /* @__PURE__ */ React227.createElement(
|
|
19170
19422
|
Toggle,
|
|
19171
19423
|
{
|
|
19172
19424
|
name: "project-tabs",
|
|
@@ -19187,7 +19439,7 @@ var ProjectProfitabilityView = ({
|
|
|
19187
19439
|
selected: activeTab,
|
|
19188
19440
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
19189
19441
|
}
|
|
19190
|
-
)), /* @__PURE__ */
|
|
19442
|
+
)), /* @__PURE__ */ React227.createElement(
|
|
19191
19443
|
Select4,
|
|
19192
19444
|
{
|
|
19193
19445
|
className: "Layer__category-menu Layer__select",
|
|
@@ -19205,7 +19457,7 @@ var ProjectProfitabilityView = ({
|
|
|
19205
19457
|
}
|
|
19206
19458
|
}
|
|
19207
19459
|
)),
|
|
19208
|
-
/* @__PURE__ */
|
|
19460
|
+
/* @__PURE__ */ React227.createElement(Container, { name: "project" }, /* @__PURE__ */ React227.createElement(React227.Fragment, null, activeTab === "overview" && /* @__PURE__ */ React227.createElement(
|
|
19209
19461
|
AccountingOverview,
|
|
19210
19462
|
{
|
|
19211
19463
|
stringOverrides: { header: "Project Overview" },
|
|
@@ -19215,7 +19467,7 @@ var ProjectProfitabilityView = ({
|
|
|
19215
19467
|
showTransactionsToReview: false,
|
|
19216
19468
|
showTitle: false
|
|
19217
19469
|
}
|
|
19218
|
-
), activeTab === "transactions" && /* @__PURE__ */
|
|
19470
|
+
), activeTab === "transactions" && /* @__PURE__ */ React227.createElement(
|
|
19219
19471
|
BankTransactions,
|
|
19220
19472
|
{
|
|
19221
19473
|
hideHeader: true,
|
|
@@ -19224,7 +19476,7 @@ var ProjectProfitabilityView = ({
|
|
|
19224
19476
|
tagFilter: tagFilter != null ? tagFilter : void 0
|
|
19225
19477
|
}
|
|
19226
19478
|
}
|
|
19227
|
-
), activeTab === "report" && /* @__PURE__ */
|
|
19479
|
+
), activeTab === "report" && /* @__PURE__ */ React227.createElement(ProfitAndLoss, { asContainer: false, tagFilter: pnlTagFilter }, /* @__PURE__ */ React227.createElement(
|
|
19228
19480
|
ProfitAndLoss.Report,
|
|
19229
19481
|
{
|
|
19230
19482
|
stringOverrides,
|
|
@@ -19236,7 +19488,7 @@ var ProjectProfitabilityView = ({
|
|
|
19236
19488
|
};
|
|
19237
19489
|
|
|
19238
19490
|
// src/views/Reports/Reports.tsx
|
|
19239
|
-
import
|
|
19491
|
+
import React228, { useState as useState66 } from "react";
|
|
19240
19492
|
var getOptions = (enabledReports) => {
|
|
19241
19493
|
return [
|
|
19242
19494
|
enabledReports.includes("profitAndLoss") ? {
|
|
@@ -19263,20 +19515,17 @@ var Reports = ({
|
|
|
19263
19515
|
statementOfCashFlowConfig
|
|
19264
19516
|
}) => {
|
|
19265
19517
|
var _a;
|
|
19266
|
-
const [activeTab, setActiveTab] =
|
|
19267
|
-
const
|
|
19268
|
-
const containerRef = useElementViewSize(
|
|
19269
|
-
(newView) => setView(newView)
|
|
19270
|
-
);
|
|
19518
|
+
const [activeTab, setActiveTab] = useState66(enabledReports[0]);
|
|
19519
|
+
const { view, containerRef } = useElementViewSize();
|
|
19271
19520
|
const options = getOptions(enabledReports);
|
|
19272
19521
|
const defaultTitle = enabledReports.length > 1 ? "Reports" : (_a = options.find((option) => option.value = enabledReports[0])) == null ? void 0 : _a.label;
|
|
19273
|
-
return /* @__PURE__ */
|
|
19522
|
+
return /* @__PURE__ */ React228.createElement(
|
|
19274
19523
|
View,
|
|
19275
19524
|
{
|
|
19276
19525
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || defaultTitle,
|
|
19277
19526
|
showHeader: showTitle
|
|
19278
19527
|
},
|
|
19279
|
-
enabledReports.length > 1 && /* @__PURE__ */
|
|
19528
|
+
enabledReports.length > 1 && /* @__PURE__ */ React228.createElement("div", { className: "Layer__component Layer__header__actions" }, /* @__PURE__ */ React228.createElement(
|
|
19280
19529
|
Toggle,
|
|
19281
19530
|
{
|
|
19282
19531
|
name: "reports-tabs",
|
|
@@ -19285,7 +19534,7 @@ var Reports = ({
|
|
|
19285
19534
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
19286
19535
|
}
|
|
19287
19536
|
)),
|
|
19288
|
-
/* @__PURE__ */
|
|
19537
|
+
/* @__PURE__ */ React228.createElement(Container, { name: "reports", ref: containerRef }, /* @__PURE__ */ React228.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React228.createElement(
|
|
19289
19538
|
ReportsPanel,
|
|
19290
19539
|
{
|
|
19291
19540
|
containerRef,
|
|
@@ -19308,7 +19557,7 @@ var ReportsPanel = ({
|
|
|
19308
19557
|
statementOfCashFlowConfig,
|
|
19309
19558
|
view
|
|
19310
19559
|
}) => {
|
|
19311
|
-
return /* @__PURE__ */
|
|
19560
|
+
return /* @__PURE__ */ React228.createElement(React228.Fragment, null, openReport === "profitAndLoss" && /* @__PURE__ */ React228.createElement(
|
|
19312
19561
|
ProfitAndLoss.Report,
|
|
19313
19562
|
__spreadValues({
|
|
19314
19563
|
stringOverrides,
|
|
@@ -19316,7 +19565,7 @@ var ReportsPanel = ({
|
|
|
19316
19565
|
parentRef: containerRef,
|
|
19317
19566
|
view
|
|
19318
19567
|
}, profitAndLossConfig)
|
|
19319
|
-
), openReport === "balanceSheet" && /* @__PURE__ */
|
|
19568
|
+
), openReport === "balanceSheet" && /* @__PURE__ */ React228.createElement(BalanceSheet, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.balanceSheet }), openReport === "statementOfCashFlow" && /* @__PURE__ */ React228.createElement(
|
|
19320
19569
|
StatementOfCashFlow,
|
|
19321
19570
|
__spreadValues({
|
|
19322
19571
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.statementOfCashflow
|
|
@@ -19325,11 +19574,11 @@ var ReportsPanel = ({
|
|
|
19325
19574
|
};
|
|
19326
19575
|
|
|
19327
19576
|
// src/components/ProfitAndLossView/ProfitAndLossView.tsx
|
|
19328
|
-
import
|
|
19577
|
+
import React229, { useContext as useContext50, useRef as useRef23 } from "react";
|
|
19329
19578
|
var COMPONENT_NAME7 = "profit-and-loss";
|
|
19330
19579
|
var ProfitAndLossView = (props) => {
|
|
19331
|
-
const containerRef =
|
|
19332
|
-
return /* @__PURE__ */
|
|
19580
|
+
const containerRef = useRef23(null);
|
|
19581
|
+
return /* @__PURE__ */ React229.createElement(Container, { name: COMPONENT_NAME7, ref: containerRef }, /* @__PURE__ */ React229.createElement(ProfitAndLoss, null, /* @__PURE__ */ React229.createElement(ProfitAndLossPanel, __spreadValues({ containerRef }, props))));
|
|
19333
19582
|
};
|
|
19334
19583
|
var ProfitAndLossPanel = (_a) => {
|
|
19335
19584
|
var _b = _a, {
|
|
@@ -19340,10 +19589,10 @@ var ProfitAndLossPanel = (_a) => {
|
|
|
19340
19589
|
"stringOverrides"
|
|
19341
19590
|
]);
|
|
19342
19591
|
const { sidebarScope } = useContext50(ProfitAndLoss.Context);
|
|
19343
|
-
return /* @__PURE__ */
|
|
19592
|
+
return /* @__PURE__ */ React229.createElement(
|
|
19344
19593
|
Panel,
|
|
19345
19594
|
{
|
|
19346
|
-
sidebar: /* @__PURE__ */
|
|
19595
|
+
sidebar: /* @__PURE__ */ React229.createElement(
|
|
19347
19596
|
ProfitAndLossDetailedCharts,
|
|
19348
19597
|
{
|
|
19349
19598
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.profitAndLossDetailedCharts
|
|
@@ -19352,7 +19601,7 @@ var ProfitAndLossPanel = (_a) => {
|
|
|
19352
19601
|
sidebarIsOpen: Boolean(sidebarScope),
|
|
19353
19602
|
parentRef: containerRef
|
|
19354
19603
|
},
|
|
19355
|
-
/* @__PURE__ */
|
|
19604
|
+
/* @__PURE__ */ React229.createElement(
|
|
19356
19605
|
ProfitAndLoss.Header,
|
|
19357
19606
|
{
|
|
19358
19607
|
text: (stringOverrides == null ? void 0 : stringOverrides.header) || "Profit & Loss",
|
|
@@ -19360,7 +19609,7 @@ var ProfitAndLossPanel = (_a) => {
|
|
|
19360
19609
|
headingClassName: "Layer__profit-and-loss__title"
|
|
19361
19610
|
}
|
|
19362
19611
|
),
|
|
19363
|
-
/* @__PURE__ */
|
|
19612
|
+
/* @__PURE__ */ React229.createElement(Components, __spreadValues({ stringOverrides }, props))
|
|
19364
19613
|
);
|
|
19365
19614
|
};
|
|
19366
19615
|
var Components = ({
|
|
@@ -19372,7 +19621,7 @@ var Components = ({
|
|
|
19372
19621
|
ProfitAndLoss.Context
|
|
19373
19622
|
);
|
|
19374
19623
|
if (!isLoading && error) {
|
|
19375
|
-
return /* @__PURE__ */
|
|
19624
|
+
return /* @__PURE__ */ React229.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React229.createElement(
|
|
19376
19625
|
DataState,
|
|
19377
19626
|
{
|
|
19378
19627
|
status: "failed" /* failed */,
|
|
@@ -19383,26 +19632,26 @@ var Components = ({
|
|
|
19383
19632
|
}
|
|
19384
19633
|
));
|
|
19385
19634
|
}
|
|
19386
|
-
return /* @__PURE__ */
|
|
19635
|
+
return /* @__PURE__ */ React229.createElement(React229.Fragment, null, !hideChart && /* @__PURE__ */ React229.createElement("div", { className: `Layer__${COMPONENT_NAME7}__chart_with_summaries` }, /* @__PURE__ */ React229.createElement(
|
|
19387
19636
|
"div",
|
|
19388
19637
|
{
|
|
19389
19638
|
className: `Layer__${COMPONENT_NAME7}__chart_with_summaries__summary-col`
|
|
19390
19639
|
},
|
|
19391
|
-
/* @__PURE__ */
|
|
19392
|
-
/* @__PURE__ */
|
|
19640
|
+
/* @__PURE__ */ React229.createElement(ProfitAndLoss.DatePicker, null),
|
|
19641
|
+
/* @__PURE__ */ React229.createElement(
|
|
19393
19642
|
ProfitAndLoss.Summaries,
|
|
19394
19643
|
{
|
|
19395
19644
|
actionable: true,
|
|
19396
19645
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.profitAndLossSummaries
|
|
19397
19646
|
}
|
|
19398
19647
|
)
|
|
19399
|
-
), /* @__PURE__ */
|
|
19648
|
+
), /* @__PURE__ */ React229.createElement(
|
|
19400
19649
|
"div",
|
|
19401
19650
|
{
|
|
19402
19651
|
className: `Layer__${COMPONENT_NAME7}__chart_with_summaries__chart-col`
|
|
19403
19652
|
},
|
|
19404
|
-
/* @__PURE__ */
|
|
19405
|
-
)), !hideTable && /* @__PURE__ */
|
|
19653
|
+
/* @__PURE__ */ React229.createElement(ProfitAndLoss.Chart, null)
|
|
19654
|
+
)), !hideTable && /* @__PURE__ */ React229.createElement(
|
|
19406
19655
|
ProfitAndLoss.Table,
|
|
19407
19656
|
{
|
|
19408
19657
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.profitAndLossTable
|