@layerfi/components 0.1.83 → 0.1.84-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +619 -419
- package/dist/esm/index.mjs +534 -334
- package/dist/index.d.ts +86 -1
- package/package.json +7 -2
- package/dist/esm/index.mjs.map +0 -7
- package/dist/index.css.map +0 -7
- package/eslint.config.mjs +0 -101
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.84-alpha";
|
|
61
61
|
|
|
62
62
|
// src/models/APIError.ts
|
|
63
63
|
var APIError = class _APIError extends Error {
|
|
@@ -296,6 +296,9 @@ var getLedgerAccountsLines = get(
|
|
|
296
296
|
var getLedgerAccountsEntry = get(
|
|
297
297
|
({ businessId, entryId }) => `/v1/businesses/${businessId}/ledger/entries/${entryId}`
|
|
298
298
|
);
|
|
299
|
+
var getLedgerAccountBalancesCSV = get(
|
|
300
|
+
({ businessId }) => `/v1/businesses/${businessId}/ledger/balances/exports/csv`
|
|
301
|
+
);
|
|
299
302
|
|
|
300
303
|
// src/api/layer/journal.ts
|
|
301
304
|
var getJournal = get(
|
|
@@ -307,6 +310,9 @@ var createJournalEntries = post(
|
|
|
307
310
|
var reverseJournalEntry = post(
|
|
308
311
|
({ businessId, entryId }) => `/v1/businesses/${businessId}/ledger/entries/${entryId}/reverse`
|
|
309
312
|
);
|
|
313
|
+
var getJournalEntriesCSV = get(
|
|
314
|
+
({ businessId }) => `/v1/businesses/${businessId}/ledger/entries/exports/csv`
|
|
315
|
+
);
|
|
310
316
|
|
|
311
317
|
// src/api/layer/linked_accounts.ts
|
|
312
318
|
var syncConnection = post(({ businessId }) => `/v1/businesses/${businessId}/sync`);
|
|
@@ -449,6 +455,7 @@ var Layer = {
|
|
|
449
455
|
getCategories,
|
|
450
456
|
getChartOfAccounts,
|
|
451
457
|
getLedgerAccountBalances,
|
|
458
|
+
getLedgerAccountBalancesCSV,
|
|
452
459
|
getLedgerAccountsLines,
|
|
453
460
|
getLedgerAccountsEntry,
|
|
454
461
|
getProfitAndLoss,
|
|
@@ -456,6 +463,7 @@ var Layer = {
|
|
|
456
463
|
getProfitAndLossCsv,
|
|
457
464
|
getLinkedAccounts,
|
|
458
465
|
getJournal,
|
|
466
|
+
getJournalEntriesCSV,
|
|
459
467
|
reverseJournalEntry,
|
|
460
468
|
compareProfitAndLoss,
|
|
461
469
|
profitAndLossComparisonCsv,
|
|
@@ -15511,7 +15519,7 @@ var StatementOfCashFlowView = ({
|
|
|
15511
15519
|
};
|
|
15512
15520
|
|
|
15513
15521
|
// src/components/ChartOfAccounts/ChartOfAccounts.tsx
|
|
15514
|
-
import
|
|
15522
|
+
import React203, { useContext as useContext36 } from "react";
|
|
15515
15523
|
|
|
15516
15524
|
// src/contexts/ChartOfAccountsContext/ChartOfAccountsContext.tsx
|
|
15517
15525
|
import { createContext as createContext16 } from "react";
|
|
@@ -16154,7 +16162,7 @@ var useLedgerAccounts = (showReversalEntries = false) => {
|
|
|
16154
16162
|
};
|
|
16155
16163
|
|
|
16156
16164
|
// src/components/ChartOfAccountsTable/ChartOfAccountsTableWithPanel.tsx
|
|
16157
|
-
import
|
|
16165
|
+
import React195, { useContext as useContext32, useState as useState51 } from "react";
|
|
16158
16166
|
|
|
16159
16167
|
// src/icons/Plus.tsx
|
|
16160
16168
|
import * as React188 from "react";
|
|
@@ -16587,6 +16595,91 @@ var ChartOfAccountsTableContent = ({
|
|
|
16587
16595
|
)));
|
|
16588
16596
|
};
|
|
16589
16597
|
|
|
16598
|
+
// src/components/ChartOfAccounts/download/AccountBalancesDownloadButton.tsx
|
|
16599
|
+
import React194 from "react";
|
|
16600
|
+
|
|
16601
|
+
// src/components/ChartOfAccounts/download/useAccountBalancesDownload.ts
|
|
16602
|
+
import useSWRMutation4 from "swr/mutation";
|
|
16603
|
+
function buildKey4({
|
|
16604
|
+
access_token: accessToken,
|
|
16605
|
+
apiUrl,
|
|
16606
|
+
businessId,
|
|
16607
|
+
startCutoff,
|
|
16608
|
+
endCutoff
|
|
16609
|
+
}) {
|
|
16610
|
+
if (accessToken && apiUrl) {
|
|
16611
|
+
return {
|
|
16612
|
+
accessToken,
|
|
16613
|
+
apiUrl,
|
|
16614
|
+
businessId,
|
|
16615
|
+
startCutoff,
|
|
16616
|
+
endCutoff,
|
|
16617
|
+
tags: ["#account-balances", "#exports", "#csv"]
|
|
16618
|
+
};
|
|
16619
|
+
}
|
|
16620
|
+
}
|
|
16621
|
+
function useAccountBalancesDownload({
|
|
16622
|
+
startCutoff,
|
|
16623
|
+
endCutoff,
|
|
16624
|
+
onSuccess
|
|
16625
|
+
}) {
|
|
16626
|
+
const { data: auth } = useAuth();
|
|
16627
|
+
const { businessId } = useLayerContext();
|
|
16628
|
+
return useSWRMutation4(
|
|
16629
|
+
() => buildKey4(__spreadProps(__spreadValues({}, auth), {
|
|
16630
|
+
businessId,
|
|
16631
|
+
startCutoff,
|
|
16632
|
+
endCutoff
|
|
16633
|
+
})),
|
|
16634
|
+
({ accessToken, apiUrl, businessId: businessId2, startCutoff: startCutoff2, endCutoff: endCutoff2 }) => getLedgerAccountBalancesCSV(
|
|
16635
|
+
apiUrl,
|
|
16636
|
+
accessToken,
|
|
16637
|
+
{
|
|
16638
|
+
params: {
|
|
16639
|
+
businessId: businessId2,
|
|
16640
|
+
startCutoff: startCutoff2 == null ? void 0 : startCutoff2.toISOString(),
|
|
16641
|
+
endCutoff: endCutoff2 == null ? void 0 : endCutoff2.toISOString()
|
|
16642
|
+
}
|
|
16643
|
+
}
|
|
16644
|
+
)().then(({ data }) => {
|
|
16645
|
+
if (onSuccess) {
|
|
16646
|
+
return onSuccess(data);
|
|
16647
|
+
}
|
|
16648
|
+
}),
|
|
16649
|
+
{
|
|
16650
|
+
revalidate: false,
|
|
16651
|
+
throwOnError: false
|
|
16652
|
+
}
|
|
16653
|
+
);
|
|
16654
|
+
}
|
|
16655
|
+
|
|
16656
|
+
// src/components/ChartOfAccounts/download/AccountBalancesDownloadButton.tsx
|
|
16657
|
+
function AccountBalancesDownloadButton({
|
|
16658
|
+
startCutoff,
|
|
16659
|
+
endCutoff,
|
|
16660
|
+
iconOnly
|
|
16661
|
+
}) {
|
|
16662
|
+
const { invisibleDownloadRef, triggerInvisibleDownload } = useInvisibleDownload();
|
|
16663
|
+
const { trigger, isMutating, error } = useAccountBalancesDownload({
|
|
16664
|
+
startCutoff,
|
|
16665
|
+
endCutoff,
|
|
16666
|
+
onSuccess: ({ presignedUrl }) => triggerInvisibleDownload({ url: presignedUrl })
|
|
16667
|
+
});
|
|
16668
|
+
return /* @__PURE__ */ React194.createElement(React194.Fragment, null, /* @__PURE__ */ React194.createElement(
|
|
16669
|
+
DownloadButton,
|
|
16670
|
+
{
|
|
16671
|
+
iconOnly,
|
|
16672
|
+
onClick: () => {
|
|
16673
|
+
trigger();
|
|
16674
|
+
},
|
|
16675
|
+
isDownloading: isMutating,
|
|
16676
|
+
requestFailed: Boolean(error),
|
|
16677
|
+
text: "Download CSV",
|
|
16678
|
+
retryText: "Retry"
|
|
16679
|
+
}
|
|
16680
|
+
), /* @__PURE__ */ React194.createElement(InvisibleDownload_default, { ref: invisibleDownloadRef }));
|
|
16681
|
+
}
|
|
16682
|
+
|
|
16590
16683
|
// src/components/ChartOfAccountsTable/ChartOfAccountsTableWithPanel.tsx
|
|
16591
16684
|
var COMPONENT_NAME5 = "chart-of-accounts";
|
|
16592
16685
|
var ChartOfAccountsTableWithPanel = ({
|
|
@@ -16595,6 +16688,7 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
16595
16688
|
asWidget = false,
|
|
16596
16689
|
withDateControl = false,
|
|
16597
16690
|
withExpandAllButton = false,
|
|
16691
|
+
showAddAccountButton = true,
|
|
16598
16692
|
stringOverrides,
|
|
16599
16693
|
templateAccountsEditable
|
|
16600
16694
|
}) => {
|
|
@@ -16603,10 +16697,10 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
16603
16697
|
const [expandAll, setExpandAll] = useState51();
|
|
16604
16698
|
const cumulativeIndex = 0;
|
|
16605
16699
|
const accountsLength = (_a = data == null ? void 0 : data.accounts.length) != null ? _a : 0;
|
|
16606
|
-
return /* @__PURE__ */
|
|
16700
|
+
return /* @__PURE__ */ React195.createElement(
|
|
16607
16701
|
Panel,
|
|
16608
16702
|
{
|
|
16609
|
-
sidebar: /* @__PURE__ */
|
|
16703
|
+
sidebar: /* @__PURE__ */ React195.createElement(
|
|
16610
16704
|
ChartOfAccountsSidebar,
|
|
16611
16705
|
{
|
|
16612
16706
|
parentRef: containerRef,
|
|
@@ -16616,7 +16710,7 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
16616
16710
|
sidebarIsOpen: Boolean(form),
|
|
16617
16711
|
parentRef: containerRef
|
|
16618
16712
|
},
|
|
16619
|
-
/* @__PURE__ */
|
|
16713
|
+
/* @__PURE__ */ React195.createElement(Header2, { className: `Layer__${COMPONENT_NAME5}__header`, asHeader: true, rounded: true }, /* @__PURE__ */ React195.createElement(HeaderRow, null, /* @__PURE__ */ React195.createElement(HeaderCol, null, /* @__PURE__ */ React195.createElement(
|
|
16620
16714
|
Heading,
|
|
16621
16715
|
{
|
|
16622
16716
|
className: `Layer__${COMPONENT_NAME5}__title`,
|
|
@@ -16624,13 +16718,13 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
16624
16718
|
},
|
|
16625
16719
|
(stringOverrides == null ? void 0 : stringOverrides.headerText) || "Chart of Accounts"
|
|
16626
16720
|
)))),
|
|
16627
|
-
/* @__PURE__ */
|
|
16721
|
+
/* @__PURE__ */ React195.createElement(Header2, { className: `Layer__${COMPONENT_NAME5}__header`, sticky: true }, /* @__PURE__ */ React195.createElement(HeaderRow, null, /* @__PURE__ */ React195.createElement(HeaderCol, null, /* @__PURE__ */ React195.createElement(
|
|
16628
16722
|
Heading,
|
|
16629
16723
|
{
|
|
16630
16724
|
size: "secondary" /* secondary */,
|
|
16631
16725
|
className: `Layer__${COMPONENT_NAME5}__subtitle`
|
|
16632
16726
|
},
|
|
16633
|
-
withDateControl || withExpandAllButton ? /* @__PURE__ */
|
|
16727
|
+
withDateControl || withExpandAllButton ? /* @__PURE__ */ React195.createElement("div", { className: "Layer__header__actions-col" }, withDateControl && /* @__PURE__ */ React195.createElement(ChartOfAccountsDatePicker, null), withExpandAllButton && /* @__PURE__ */ React195.createElement(
|
|
16634
16728
|
ExpandCollapseButton,
|
|
16635
16729
|
{
|
|
16636
16730
|
iconOnly: view === "mobile",
|
|
@@ -16641,17 +16735,22 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
16641
16735
|
variant: "secondary" /* secondary */
|
|
16642
16736
|
}
|
|
16643
16737
|
)) : null
|
|
16644
|
-
)), /* @__PURE__ */
|
|
16738
|
+
)), /* @__PURE__ */ React195.createElement(HeaderCol, null, /* @__PURE__ */ React195.createElement(
|
|
16739
|
+
AccountBalancesDownloadButton,
|
|
16740
|
+
{
|
|
16741
|
+
iconOnly: ["mobile", "tablet"].includes(view)
|
|
16742
|
+
}
|
|
16743
|
+
), showAddAccountButton && /* @__PURE__ */ React195.createElement(
|
|
16645
16744
|
Button,
|
|
16646
16745
|
{
|
|
16647
16746
|
onClick: () => addAccount(),
|
|
16648
16747
|
disabled: isLoading,
|
|
16649
16748
|
iconOnly: ["mobile", "tablet"].includes(view),
|
|
16650
|
-
leftIcon: ["mobile", "tablet"].includes(view) && /* @__PURE__ */
|
|
16749
|
+
leftIcon: ["mobile", "tablet"].includes(view) && /* @__PURE__ */ React195.createElement(Plus_default, { size: 14 })
|
|
16651
16750
|
},
|
|
16652
16751
|
(stringOverrides == null ? void 0 : stringOverrides.addAccountButtonText) || "Add Account"
|
|
16653
16752
|
)))),
|
|
16654
|
-
data && /* @__PURE__ */
|
|
16753
|
+
data && /* @__PURE__ */ React195.createElement(
|
|
16655
16754
|
ChartOfAccountsTable,
|
|
16656
16755
|
{
|
|
16657
16756
|
view,
|
|
@@ -16664,7 +16763,7 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
16664
16763
|
templateAccountsEditable
|
|
16665
16764
|
}
|
|
16666
16765
|
),
|
|
16667
|
-
error ? /* @__PURE__ */
|
|
16766
|
+
error ? /* @__PURE__ */ React195.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React195.createElement(
|
|
16668
16767
|
DataState,
|
|
16669
16768
|
{
|
|
16670
16769
|
status: "failed" /* failed */,
|
|
@@ -16674,8 +16773,8 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
16674
16773
|
isLoading: isValidating || isLoading
|
|
16675
16774
|
}
|
|
16676
16775
|
)) : null,
|
|
16677
|
-
(!data || isLoading) && !error ? /* @__PURE__ */
|
|
16678
|
-
!isLoading && !error && (data == null ? void 0 : data.accounts.length) === 0 ? /* @__PURE__ */
|
|
16776
|
+
(!data || isLoading) && !error ? /* @__PURE__ */ React195.createElement("div", { className: `Layer__${COMPONENT_NAME5}__loader-container` }, /* @__PURE__ */ React195.createElement(Loader2, null)) : null,
|
|
16777
|
+
!isLoading && !error && (data == null ? void 0 : data.accounts.length) === 0 ? /* @__PURE__ */ React195.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React195.createElement(
|
|
16679
16778
|
DataState,
|
|
16680
16779
|
{
|
|
16681
16780
|
status: "info" /* info */,
|
|
@@ -16689,7 +16788,7 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
16689
16788
|
};
|
|
16690
16789
|
|
|
16691
16790
|
// src/components/LedgerAccount/LedgerAccountIndex.tsx
|
|
16692
|
-
import
|
|
16791
|
+
import React202, {
|
|
16693
16792
|
useContext as useContext35,
|
|
16694
16793
|
useEffect as useEffect43,
|
|
16695
16794
|
useMemo as useMemo28,
|
|
@@ -16697,7 +16796,7 @@ import React201, {
|
|
|
16697
16796
|
} from "react";
|
|
16698
16797
|
|
|
16699
16798
|
// src/components/LedgerAccountEntryDetails/LedgerAccountEntryDetails.tsx
|
|
16700
|
-
import
|
|
16799
|
+
import React200, { useContext as useContext33, useMemo as useMemo27 } from "react";
|
|
16701
16800
|
|
|
16702
16801
|
// src/utils/journal.ts
|
|
16703
16802
|
var getAccountIdentifierPayload = (journalLineItem) => {
|
|
@@ -16721,14 +16820,14 @@ var entryNumber = (entry) => {
|
|
|
16721
16820
|
};
|
|
16722
16821
|
|
|
16723
16822
|
// src/components/Card/Card.tsx
|
|
16724
|
-
import
|
|
16823
|
+
import React196 from "react";
|
|
16725
16824
|
import classNames62 from "classnames";
|
|
16726
16825
|
var Card = ({ children, className }) => {
|
|
16727
|
-
return /* @__PURE__ */
|
|
16826
|
+
return /* @__PURE__ */ React196.createElement("div", { className: classNames62("Layer__card", className) }, children);
|
|
16728
16827
|
};
|
|
16729
16828
|
|
|
16730
16829
|
// src/components/DateTime/DateTime.tsx
|
|
16731
|
-
import
|
|
16830
|
+
import React197 from "react";
|
|
16732
16831
|
import { parseISO as parseISO12, format as formatTime10 } from "date-fns";
|
|
16733
16832
|
var DateTime = ({
|
|
16734
16833
|
value,
|
|
@@ -16739,11 +16838,11 @@ var DateTime = ({
|
|
|
16739
16838
|
onlyTime
|
|
16740
16839
|
}) => {
|
|
16741
16840
|
if (format9) {
|
|
16742
|
-
return /* @__PURE__ */
|
|
16841
|
+
return /* @__PURE__ */ React197.createElement(Text, { className: "Layer__datetime" }, formatTime10(parseISO12(value), format9));
|
|
16743
16842
|
}
|
|
16744
16843
|
const date = formatTime10(parseISO12(value), dateFormat != null ? dateFormat : DATE_FORMAT);
|
|
16745
16844
|
const time = formatTime10(parseISO12(value), timeFormat != null ? timeFormat : TIME_FORMAT);
|
|
16746
|
-
return /* @__PURE__ */
|
|
16845
|
+
return /* @__PURE__ */ React197.createElement(Text, { className: "Layer__datetime" }, !onlyTime && /* @__PURE__ */ React197.createElement(
|
|
16747
16846
|
Text,
|
|
16748
16847
|
{
|
|
16749
16848
|
as: "span",
|
|
@@ -16752,7 +16851,7 @@ var DateTime = ({
|
|
|
16752
16851
|
className: "Layer__datetime__date"
|
|
16753
16852
|
},
|
|
16754
16853
|
date
|
|
16755
|
-
), !onlyDate && /* @__PURE__ */
|
|
16854
|
+
), !onlyDate && /* @__PURE__ */ React197.createElement(
|
|
16756
16855
|
Text,
|
|
16757
16856
|
{
|
|
16758
16857
|
as: "span",
|
|
@@ -16765,7 +16864,7 @@ var DateTime = ({
|
|
|
16765
16864
|
};
|
|
16766
16865
|
|
|
16767
16866
|
// src/components/DetailsList/DetailsList.tsx
|
|
16768
|
-
import
|
|
16867
|
+
import React198 from "react";
|
|
16769
16868
|
import classNames63 from "classnames";
|
|
16770
16869
|
var DetailsList = ({
|
|
16771
16870
|
title,
|
|
@@ -16774,14 +16873,14 @@ var DetailsList = ({
|
|
|
16774
16873
|
titleClassName,
|
|
16775
16874
|
actions
|
|
16776
16875
|
}) => {
|
|
16777
|
-
return /* @__PURE__ */
|
|
16876
|
+
return /* @__PURE__ */ React198.createElement("div", { className: classNames63("Layer__details-list", className) }, title && /* @__PURE__ */ React198.createElement(Header, { className: titleClassName }, /* @__PURE__ */ React198.createElement(Heading, { size: "secondary" /* secondary */ }, title), actions && /* @__PURE__ */ React198.createElement("div", { className: "Layer__details-list__actions" }, actions)), /* @__PURE__ */ React198.createElement("ul", { className: "Layer__details-list__list" }, children));
|
|
16778
16877
|
};
|
|
16779
16878
|
|
|
16780
16879
|
// src/components/DetailsList/DetailsListItem.tsx
|
|
16781
|
-
import
|
|
16880
|
+
import React199 from "react";
|
|
16782
16881
|
var renderValue = (value) => {
|
|
16783
16882
|
if (typeof value === "string") {
|
|
16784
|
-
return /* @__PURE__ */
|
|
16883
|
+
return /* @__PURE__ */ React199.createElement(Text, { weight: "bold" /* bold */, size: "sm" /* sm */ }, value);
|
|
16785
16884
|
}
|
|
16786
16885
|
return value;
|
|
16787
16886
|
};
|
|
@@ -16790,7 +16889,7 @@ var DetailsListItem = ({
|
|
|
16790
16889
|
children,
|
|
16791
16890
|
isLoading
|
|
16792
16891
|
}) => {
|
|
16793
|
-
return /* @__PURE__ */
|
|
16892
|
+
return /* @__PURE__ */ React199.createElement("li", { className: "Layer__details-list-item" }, /* @__PURE__ */ React199.createElement("label", { className: "Layer__details-list-item__label" }, label), /* @__PURE__ */ React199.createElement("span", { className: "Layer__details-list-item__value" }, isLoading ? /* @__PURE__ */ React199.createElement(SkeletonLoader, null) : renderValue(children)));
|
|
16794
16893
|
};
|
|
16795
16894
|
|
|
16796
16895
|
// src/components/LedgerAccountEntryDetails/LedgerAccountEntryDetails.tsx
|
|
@@ -16801,19 +16900,19 @@ var SourceDetailView = ({
|
|
|
16801
16900
|
switch (source.type) {
|
|
16802
16901
|
case "Transaction_Ledger_Entry_Source": {
|
|
16803
16902
|
const transactionSource = source;
|
|
16804
|
-
return /* @__PURE__ */
|
|
16903
|
+
return /* @__PURE__ */ React200.createElement(React200.Fragment, null, /* @__PURE__ */ React200.createElement(
|
|
16805
16904
|
DetailsListItem,
|
|
16806
16905
|
{
|
|
16807
16906
|
label: (stringOverrides == null ? void 0 : stringOverrides.accountNameLabel) || "Account name"
|
|
16808
16907
|
},
|
|
16809
16908
|
transactionSource.account_name
|
|
16810
|
-
), /* @__PURE__ */
|
|
16909
|
+
), /* @__PURE__ */ React200.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.dateLabel) || "Date" }, /* @__PURE__ */ React200.createElement(DateTime, { value: transactionSource.date })), /* @__PURE__ */ React200.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(transactionSource.amount)}`), /* @__PURE__ */ React200.createElement(
|
|
16811
16910
|
DetailsListItem,
|
|
16812
16911
|
{
|
|
16813
16912
|
label: (stringOverrides == null ? void 0 : stringOverrides.directionLabel) || "Direction"
|
|
16814
16913
|
},
|
|
16815
16914
|
transactionSource.direction
|
|
16816
|
-
), /* @__PURE__ */
|
|
16915
|
+
), /* @__PURE__ */ React200.createElement(
|
|
16817
16916
|
DetailsListItem,
|
|
16818
16917
|
{
|
|
16819
16918
|
label: (stringOverrides == null ? void 0 : stringOverrides.counterpartyLabel) || "Counterparty"
|
|
@@ -16823,23 +16922,23 @@ var SourceDetailView = ({
|
|
|
16823
16922
|
}
|
|
16824
16923
|
case "Invoice_Ledger_Entry_Source": {
|
|
16825
16924
|
const invoiceSource = source;
|
|
16826
|
-
return /* @__PURE__ */
|
|
16925
|
+
return /* @__PURE__ */ React200.createElement(React200.Fragment, null, /* @__PURE__ */ React200.createElement(
|
|
16827
16926
|
DetailsListItem,
|
|
16828
16927
|
{
|
|
16829
16928
|
label: (stringOverrides == null ? void 0 : stringOverrides.invoiceNumberLabel) || "Invoice number"
|
|
16830
16929
|
},
|
|
16831
16930
|
invoiceSource.invoice_number
|
|
16832
|
-
), /* @__PURE__ */
|
|
16931
|
+
), /* @__PURE__ */ React200.createElement(
|
|
16833
16932
|
DetailsListItem,
|
|
16834
16933
|
{
|
|
16835
16934
|
label: (stringOverrides == null ? void 0 : stringOverrides.recipientNameLabel) || "Recipient name"
|
|
16836
16935
|
},
|
|
16837
16936
|
invoiceSource.recipient_name
|
|
16838
|
-
), /* @__PURE__ */
|
|
16937
|
+
), /* @__PURE__ */ React200.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.dateLabel) || "Date" }, /* @__PURE__ */ React200.createElement(DateTime, { value: invoiceSource.date })), /* @__PURE__ */ React200.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(invoiceSource.amount)}`));
|
|
16839
16938
|
}
|
|
16840
16939
|
case "Manual_Ledger_Entry_Source": {
|
|
16841
16940
|
const manualSource = source;
|
|
16842
|
-
return /* @__PURE__ */
|
|
16941
|
+
return /* @__PURE__ */ React200.createElement(React200.Fragment, null, /* @__PURE__ */ React200.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.memoLabel) || "Memo" }, manualSource.memo), /* @__PURE__ */ React200.createElement(
|
|
16843
16942
|
DetailsListItem,
|
|
16844
16943
|
{
|
|
16845
16944
|
label: (stringOverrides == null ? void 0 : stringOverrides.createdByLabel) || "Created by"
|
|
@@ -16849,17 +16948,17 @@ var SourceDetailView = ({
|
|
|
16849
16948
|
}
|
|
16850
16949
|
case "Invoice_Payment_Ledger_Entry_Source": {
|
|
16851
16950
|
const invoicePaymentSource = source;
|
|
16852
|
-
return /* @__PURE__ */
|
|
16951
|
+
return /* @__PURE__ */ React200.createElement(React200.Fragment, null, /* @__PURE__ */ React200.createElement(
|
|
16853
16952
|
DetailsListItem,
|
|
16854
16953
|
{
|
|
16855
16954
|
label: (stringOverrides == null ? void 0 : stringOverrides.invoiceNumberLabel) || "Invoice number"
|
|
16856
16955
|
},
|
|
16857
16956
|
invoicePaymentSource.invoice_number
|
|
16858
|
-
), /* @__PURE__ */
|
|
16957
|
+
), /* @__PURE__ */ React200.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(invoicePaymentSource.amount)}`));
|
|
16859
16958
|
}
|
|
16860
16959
|
case "Refund_Ledger_Entry_Source": {
|
|
16861
16960
|
const refundSource = source;
|
|
16862
|
-
return /* @__PURE__ */
|
|
16961
|
+
return /* @__PURE__ */ React200.createElement(React200.Fragment, null, /* @__PURE__ */ React200.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(refundSource.refunded_to_customer_amount)}`), /* @__PURE__ */ React200.createElement(
|
|
16863
16962
|
DetailsListItem,
|
|
16864
16963
|
{
|
|
16865
16964
|
label: (stringOverrides == null ? void 0 : stringOverrides.recipientNameLabel) || "Recipient name"
|
|
@@ -16869,7 +16968,7 @@ var SourceDetailView = ({
|
|
|
16869
16968
|
}
|
|
16870
16969
|
case "Refund_Payment_Ledger_Entry_Source": {
|
|
16871
16970
|
const refundSource = source;
|
|
16872
|
-
return /* @__PURE__ */
|
|
16971
|
+
return /* @__PURE__ */ React200.createElement(React200.Fragment, null, /* @__PURE__ */ React200.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(refundSource.refunded_to_customer_amount)}`), /* @__PURE__ */ React200.createElement(
|
|
16873
16972
|
DetailsListItem,
|
|
16874
16973
|
{
|
|
16875
16974
|
label: (stringOverrides == null ? void 0 : stringOverrides.recipientNameLabel) || "Recipient name"
|
|
@@ -16879,7 +16978,7 @@ var SourceDetailView = ({
|
|
|
16879
16978
|
}
|
|
16880
16979
|
case "Opening_Balance_Ledger_Entry_Source": {
|
|
16881
16980
|
const openingBalanceSource = source;
|
|
16882
|
-
return /* @__PURE__ */
|
|
16981
|
+
return /* @__PURE__ */ React200.createElement(React200.Fragment, null, /* @__PURE__ */ React200.createElement(
|
|
16883
16982
|
DetailsListItem,
|
|
16884
16983
|
{
|
|
16885
16984
|
label: (stringOverrides == null ? void 0 : stringOverrides.accountNameLabel) || "Account name"
|
|
@@ -16889,7 +16988,7 @@ var SourceDetailView = ({
|
|
|
16889
16988
|
}
|
|
16890
16989
|
case "Payout_Ledger_Entry_Source": {
|
|
16891
16990
|
const payoutSource = source;
|
|
16892
|
-
return /* @__PURE__ */
|
|
16991
|
+
return /* @__PURE__ */ React200.createElement(React200.Fragment, null, /* @__PURE__ */ React200.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(payoutSource.paid_out_amount)}`), /* @__PURE__ */ React200.createElement(
|
|
16893
16992
|
DetailsListItem,
|
|
16894
16993
|
{
|
|
16895
16994
|
label: (stringOverrides == null ? void 0 : stringOverrides.processorLabel) || "Processor"
|
|
@@ -16919,15 +17018,15 @@ var LedgerAccountEntryDetails = ({
|
|
|
16919
17018
|
});
|
|
16920
17019
|
return { totalDebit: totalDebit2, totalCredit: totalCredit2 };
|
|
16921
17020
|
}, [entryData]);
|
|
16922
|
-
return /* @__PURE__ */
|
|
17021
|
+
return /* @__PURE__ */ React200.createElement("div", { className: "Layer__ledger-account__entry-details" }, /* @__PURE__ */ React200.createElement(Header2, { className: "Layer__ledger-account__entry-details__header" }, /* @__PURE__ */ React200.createElement(HeaderRow, null, /* @__PURE__ */ React200.createElement(HeaderCol, { className: "Layer__hidden-lg Layer__hidden-xl" }, /* @__PURE__ */ React200.createElement(BackButton, { onClick: closeSelectedEntry }), /* @__PURE__ */ React200.createElement(Heading, { size: "secondary" /* secondary */ }, (stringOverrides == null ? void 0 : stringOverrides.title) || "Transaction details")), /* @__PURE__ */ React200.createElement(HeaderCol, { className: "Layer__show-lg Layer__show-xl" }, /* @__PURE__ */ React200.createElement(Heading, { size: "secondary" /* secondary */ }, ((_a = stringOverrides == null ? void 0 : stringOverrides.transactionSource) == null ? void 0 : _a.header) || "Transaction source")), /* @__PURE__ */ React200.createElement(HeaderCol, { className: "Layer__show-lg Layer__show-xl" }, /* @__PURE__ */ React200.createElement(CloseButton, { onClick: closeSelectedEntry })))), /* @__PURE__ */ React200.createElement(
|
|
16923
17022
|
DetailsList,
|
|
16924
17023
|
{
|
|
16925
17024
|
title: ((_b = stringOverrides == null ? void 0 : stringOverrides.transactionSource) == null ? void 0 : _b.header) || "Transaction source",
|
|
16926
17025
|
titleClassName: "Layer__hidden-lg Layer__hidden-xl",
|
|
16927
|
-
actions: /* @__PURE__ */
|
|
17026
|
+
actions: /* @__PURE__ */ React200.createElement(
|
|
16928
17027
|
Button,
|
|
16929
17028
|
{
|
|
16930
|
-
rightIcon: /* @__PURE__ */
|
|
17029
|
+
rightIcon: /* @__PURE__ */ React200.createElement(X_default, null),
|
|
16931
17030
|
iconOnly: true,
|
|
16932
17031
|
onClick: closeSelectedEntry,
|
|
16933
17032
|
variant: "secondary" /* secondary */,
|
|
@@ -16935,16 +17034,16 @@ var LedgerAccountEntryDetails = ({
|
|
|
16935
17034
|
}
|
|
16936
17035
|
)
|
|
16937
17036
|
},
|
|
16938
|
-
/* @__PURE__ */
|
|
17037
|
+
/* @__PURE__ */ React200.createElement(
|
|
16939
17038
|
DetailsListItem,
|
|
16940
17039
|
{
|
|
16941
17040
|
label: ((_d = (_c = stringOverrides == null ? void 0 : stringOverrides.transactionSource) == null ? void 0 : _c.details) == null ? void 0 : _d.sourceLabel) || "Source",
|
|
16942
17041
|
isLoading: isLoadingEntry
|
|
16943
17042
|
},
|
|
16944
|
-
/* @__PURE__ */
|
|
17043
|
+
/* @__PURE__ */ React200.createElement(Badge, null, (_e = entryData == null ? void 0 : entryData.source) == null ? void 0 : _e.entity_name)
|
|
16945
17044
|
),
|
|
16946
|
-
((_f = entryData == null ? void 0 : entryData.source) == null ? void 0 : _f.display_description) && /* @__PURE__ */
|
|
16947
|
-
), /* @__PURE__ */
|
|
17045
|
+
((_f = entryData == null ? void 0 : entryData.source) == null ? void 0 : _f.display_description) && /* @__PURE__ */ React200.createElement(SourceDetailView, { source: entryData == null ? void 0 : entryData.source })
|
|
17046
|
+
), /* @__PURE__ */ React200.createElement(
|
|
16948
17047
|
DetailsList,
|
|
16949
17048
|
{
|
|
16950
17049
|
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(
|
|
@@ -16952,7 +17051,7 @@ var LedgerAccountEntryDetails = ({
|
|
|
16952
17051
|
) : `Journal Entry ${entryData ? entryNumber(entryData) : ""}`,
|
|
16953
17052
|
className: "Layer__border-top"
|
|
16954
17053
|
},
|
|
16955
|
-
/* @__PURE__ */
|
|
17054
|
+
/* @__PURE__ */ React200.createElement(
|
|
16956
17055
|
DetailsListItem,
|
|
16957
17056
|
{
|
|
16958
17057
|
label: ((_j = (_i = stringOverrides == null ? void 0 : stringOverrides.journalEntry) == null ? void 0 : _i.details) == null ? void 0 : _j.entryTypeLabel) || "Entry type",
|
|
@@ -16960,23 +17059,23 @@ var LedgerAccountEntryDetails = ({
|
|
|
16960
17059
|
},
|
|
16961
17060
|
humanizeEnum((_k = entryData == null ? void 0 : entryData.entry_type) != null ? _k : "")
|
|
16962
17061
|
),
|
|
16963
|
-
/* @__PURE__ */
|
|
17062
|
+
/* @__PURE__ */ React200.createElement(
|
|
16964
17063
|
DetailsListItem,
|
|
16965
17064
|
{
|
|
16966
17065
|
label: ((_m = (_l = stringOverrides == null ? void 0 : stringOverrides.journalEntry) == null ? void 0 : _l.details) == null ? void 0 : _m.dateLabel) || "Date",
|
|
16967
17066
|
isLoading: isLoadingEntry
|
|
16968
17067
|
},
|
|
16969
|
-
(entryData == null ? void 0 : entryData.entry_at) && /* @__PURE__ */
|
|
17068
|
+
(entryData == null ? void 0 : entryData.entry_at) && /* @__PURE__ */ React200.createElement(DateTime, { value: entryData == null ? void 0 : entryData.entry_at })
|
|
16970
17069
|
),
|
|
16971
|
-
/* @__PURE__ */
|
|
17070
|
+
/* @__PURE__ */ React200.createElement(
|
|
16972
17071
|
DetailsListItem,
|
|
16973
17072
|
{
|
|
16974
17073
|
label: ((_o = (_n = stringOverrides == null ? void 0 : stringOverrides.journalEntry) == null ? void 0 : _n.details) == null ? void 0 : _o.creationDateLabel) || "Creation date",
|
|
16975
17074
|
isLoading: isLoadingEntry
|
|
16976
17075
|
},
|
|
16977
|
-
(entryData == null ? void 0 : entryData.date) && /* @__PURE__ */
|
|
17076
|
+
(entryData == null ? void 0 : entryData.date) && /* @__PURE__ */ React200.createElement(DateTime, { value: entryData == null ? void 0 : entryData.date })
|
|
16978
17077
|
),
|
|
16979
|
-
(entryData == null ? void 0 : entryData.reversal_id) && /* @__PURE__ */
|
|
17078
|
+
(entryData == null ? void 0 : entryData.reversal_id) && /* @__PURE__ */ React200.createElement(
|
|
16980
17079
|
DetailsListItem,
|
|
16981
17080
|
{
|
|
16982
17081
|
label: ((_q = (_p = stringOverrides == null ? void 0 : stringOverrides.journalEntry) == null ? void 0 : _p.details) == null ? void 0 : _q.reversalLabel) || "Reversal",
|
|
@@ -16984,40 +17083,40 @@ var LedgerAccountEntryDetails = ({
|
|
|
16984
17083
|
},
|
|
16985
17084
|
entryData == null ? void 0 : entryData.reversal_id.substring(0, 5)
|
|
16986
17085
|
)
|
|
16987
|
-
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */
|
|
17086
|
+
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */ React200.createElement("div", { className: "Layer__ledger-account__entry-details__line-items" }, /* @__PURE__ */ React200.createElement(Card, null, /* @__PURE__ */ React200.createElement(
|
|
16988
17087
|
Table,
|
|
16989
17088
|
{
|
|
16990
17089
|
componentName: "ledger-account__entry-details",
|
|
16991
17090
|
borderCollapse: "collapse"
|
|
16992
17091
|
},
|
|
16993
|
-
/* @__PURE__ */
|
|
16994
|
-
/* @__PURE__ */
|
|
17092
|
+
/* @__PURE__ */ React200.createElement(TableHead, null, /* @__PURE__ */ React200.createElement(TableRow, { rowKey: "soc-flow-head-row", isHeadRow: true }, /* @__PURE__ */ React200.createElement(TableCell, null, ((_r = stringOverrides == null ? void 0 : stringOverrides.lineItemsTable) == null ? void 0 : _r.lineItemsColumnHeader) || "Line items"), /* @__PURE__ */ React200.createElement(TableCell, { align: "right" /* RIGHT */ }, ((_s = stringOverrides == null ? void 0 : stringOverrides.lineItemsTable) == null ? void 0 : _s.debitColumnHeader) || "Debit"), /* @__PURE__ */ React200.createElement(TableCell, { align: "right" /* RIGHT */ }, ((_t = stringOverrides == null ? void 0 : stringOverrides.lineItemsTable) == null ? void 0 : _t.creditColumnHeader) || "Credit"))),
|
|
17093
|
+
/* @__PURE__ */ React200.createElement(TableBody, null, (_u = entryData == null ? void 0 : entryData.line_items) == null ? void 0 : _u.map((item, index) => {
|
|
16995
17094
|
var _a2;
|
|
16996
|
-
return /* @__PURE__ */
|
|
17095
|
+
return /* @__PURE__ */ React200.createElement(
|
|
16997
17096
|
TableRow,
|
|
16998
17097
|
{
|
|
16999
17098
|
key: `ledger-line-item-${index}`,
|
|
17000
17099
|
rowKey: `ledger-line-item-${index}`
|
|
17001
17100
|
},
|
|
17002
|
-
/* @__PURE__ */
|
|
17003
|
-
/* @__PURE__ */
|
|
17004
|
-
/* @__PURE__ */
|
|
17101
|
+
/* @__PURE__ */ React200.createElement(TableCell, null, ((_a2 = item.account) == null ? void 0 : _a2.name) || ""),
|
|
17102
|
+
/* @__PURE__ */ React200.createElement(TableCell, { align: "right" /* RIGHT */ }, item.direction === "DEBIT" /* DEBIT */ && /* @__PURE__ */ React200.createElement(Badge, { variant: "warning" /* WARNING */ }, "$", centsToDollars(item.amount || 0))),
|
|
17103
|
+
/* @__PURE__ */ React200.createElement(TableCell, { align: "right" /* RIGHT */ }, item.direction === "CREDIT" /* CREDIT */ && /* @__PURE__ */ React200.createElement(Badge, { variant: "success" /* SUCCESS */ }, "$", centsToDollars(item.amount || 0)))
|
|
17005
17104
|
);
|
|
17006
|
-
}), /* @__PURE__ */
|
|
17105
|
+
}), /* @__PURE__ */ React200.createElement(
|
|
17007
17106
|
TableRow,
|
|
17008
17107
|
{
|
|
17009
17108
|
rowKey: "ledger-line-item-summation",
|
|
17010
17109
|
variant: "summation"
|
|
17011
17110
|
},
|
|
17012
|
-
/* @__PURE__ */
|
|
17013
|
-
/* @__PURE__ */
|
|
17014
|
-
/* @__PURE__ */
|
|
17111
|
+
/* @__PURE__ */ React200.createElement(TableCell, { primary: true }, ((_v = stringOverrides == null ? void 0 : stringOverrides.lineItemsTable) == null ? void 0 : _v.totalRowHeader) || "Total"),
|
|
17112
|
+
/* @__PURE__ */ React200.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, totalDebit || 0),
|
|
17113
|
+
/* @__PURE__ */ React200.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, totalCredit || 0)
|
|
17015
17114
|
))
|
|
17016
17115
|
))) : null);
|
|
17017
17116
|
};
|
|
17018
17117
|
|
|
17019
17118
|
// src/components/LedgerAccount/LedgerAccountRow.tsx
|
|
17020
|
-
import
|
|
17119
|
+
import React201, { useContext as useContext34, useEffect as useEffect42, useState as useState52 } from "react";
|
|
17021
17120
|
import classNames64 from "classnames";
|
|
17022
17121
|
import { parseISO as parseISO13, format as formatTime11 } from "date-fns";
|
|
17023
17122
|
var LedgerAccountRow = ({
|
|
@@ -17040,7 +17139,7 @@ var LedgerAccountRow = ({
|
|
|
17040
17139
|
}
|
|
17041
17140
|
}, []);
|
|
17042
17141
|
if (view === "tablet") {
|
|
17043
|
-
return /* @__PURE__ */
|
|
17142
|
+
return /* @__PURE__ */ React201.createElement(
|
|
17044
17143
|
"tr",
|
|
17045
17144
|
{
|
|
17046
17145
|
className: classNames64(
|
|
@@ -17059,21 +17158,21 @@ var LedgerAccountRow = ({
|
|
|
17059
17158
|
}
|
|
17060
17159
|
}
|
|
17061
17160
|
},
|
|
17062
|
-
/* @__PURE__ */
|
|
17161
|
+
/* @__PURE__ */ React201.createElement("td", { className: "Layer__table-cell Layer__ledger-account-table__tablet-main-col" }, /* @__PURE__ */ React201.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ React201.createElement("div", { className: "Layer__ledger-account-table__tablet-main-col__date" }, /* @__PURE__ */ React201.createElement(Text, null, row.date && formatTime11(parseISO13(row.date), DATE_FORMAT)), /* @__PURE__ */ React201.createElement(
|
|
17063
17162
|
Text,
|
|
17064
17163
|
{
|
|
17065
17164
|
weight: "normal" /* normal */,
|
|
17066
17165
|
className: "Layer__ledger_account-table__journal-id"
|
|
17067
17166
|
},
|
|
17068
17167
|
entryNumber(row)
|
|
17069
|
-
)), /* @__PURE__ */
|
|
17070
|
-
/* @__PURE__ */
|
|
17071
|
-
/* @__PURE__ */
|
|
17072
|
-
/* @__PURE__ */
|
|
17168
|
+
)), /* @__PURE__ */ React201.createElement(Text, null, (_b = (_a = row.source) == null ? void 0 : _a.display_description) != null ? _b : ""))),
|
|
17169
|
+
/* @__PURE__ */ React201.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React201.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "DEBIT" /* DEBIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)),
|
|
17170
|
+
/* @__PURE__ */ React201.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React201.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "CREDIT" /* CREDIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)),
|
|
17171
|
+
/* @__PURE__ */ React201.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React201.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, `$${centsToDollars(row.running_balance)}`))
|
|
17073
17172
|
);
|
|
17074
17173
|
}
|
|
17075
17174
|
if (view === "mobile") {
|
|
17076
|
-
return /* @__PURE__ */
|
|
17175
|
+
return /* @__PURE__ */ React201.createElement(
|
|
17077
17176
|
"tr",
|
|
17078
17177
|
{
|
|
17079
17178
|
className: classNames64(
|
|
@@ -17092,17 +17191,17 @@ var LedgerAccountRow = ({
|
|
|
17092
17191
|
}
|
|
17093
17192
|
}
|
|
17094
17193
|
},
|
|
17095
|
-
/* @__PURE__ */
|
|
17194
|
+
/* @__PURE__ */ React201.createElement("td", { className: "Layer__table-cell Layer__ledger-account-table__tablet-main-col" }, /* @__PURE__ */ React201.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ React201.createElement("div", { className: "Layer__ledger-account-table__tablet-main-col__date" }, /* @__PURE__ */ React201.createElement(Text, null, row.date && formatTime11(parseISO13(row.date), DATE_FORMAT)), /* @__PURE__ */ React201.createElement(
|
|
17096
17195
|
Text,
|
|
17097
17196
|
{
|
|
17098
17197
|
weight: "normal" /* normal */,
|
|
17099
17198
|
className: "Layer__ledger_account-table__journal-id"
|
|
17100
17199
|
},
|
|
17101
17200
|
entryNumber(row)
|
|
17102
|
-
)), /* @__PURE__ */
|
|
17201
|
+
)), /* @__PURE__ */ React201.createElement(Text, null, (_d = (_c = row.source) == null ? void 0 : _c.display_description) != null ? _d : ""), /* @__PURE__ */ React201.createElement("div", { className: "Layer__ledger_account-table__balances-mobile" }, /* @__PURE__ */ React201.createElement("div", { className: "Layer__ledger_account-table__balance-item" }, /* @__PURE__ */ React201.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__label" }, "Debit"), /* @__PURE__ */ React201.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__value" }, " ", row.direction === "DEBIT" /* DEBIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)), /* @__PURE__ */ React201.createElement("div", { className: "Layer__ledger_account-table__balance-item" }, /* @__PURE__ */ React201.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__label" }, "Credit"), /* @__PURE__ */ React201.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__value" }, row.direction === "CREDIT" /* CREDIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)), /* @__PURE__ */ React201.createElement("div", { className: "Layer__ledger_account-table__balance-item" }, /* @__PURE__ */ React201.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__label" }, "Running balance"), /* @__PURE__ */ React201.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__value" }, `$${centsToDollars(row.running_balance)}`)))))
|
|
17103
17202
|
);
|
|
17104
17203
|
}
|
|
17105
|
-
return /* @__PURE__ */
|
|
17204
|
+
return /* @__PURE__ */ React201.createElement(
|
|
17106
17205
|
"tr",
|
|
17107
17206
|
{
|
|
17108
17207
|
className: classNames64(
|
|
@@ -17121,12 +17220,12 @@ var LedgerAccountRow = ({
|
|
|
17121
17220
|
}
|
|
17122
17221
|
}
|
|
17123
17222
|
},
|
|
17124
|
-
/* @__PURE__ */
|
|
17125
|
-
/* @__PURE__ */
|
|
17126
|
-
/* @__PURE__ */
|
|
17127
|
-
/* @__PURE__ */
|
|
17128
|
-
/* @__PURE__ */
|
|
17129
|
-
/* @__PURE__ */
|
|
17223
|
+
/* @__PURE__ */ React201.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React201.createElement("span", { className: "Layer__table-cell-content" }, row.date && formatTime11(parseISO13(row.date), DATE_FORMAT))),
|
|
17224
|
+
/* @__PURE__ */ React201.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React201.createElement("span", { className: "Layer__table-cell-content" }, entryNumber(row))),
|
|
17225
|
+
/* @__PURE__ */ React201.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React201.createElement("span", { className: "Layer__table-cell-content" }, (_f = (_e = row.source) == null ? void 0 : _e.display_description) != null ? _f : "")),
|
|
17226
|
+
/* @__PURE__ */ React201.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React201.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "DEBIT" /* DEBIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)),
|
|
17227
|
+
/* @__PURE__ */ React201.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React201.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "CREDIT" /* CREDIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)),
|
|
17228
|
+
/* @__PURE__ */ React201.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React201.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, `$${centsToDollars(row.running_balance)}`))
|
|
17130
17229
|
);
|
|
17131
17230
|
};
|
|
17132
17231
|
|
|
@@ -17180,10 +17279,10 @@ var LedgerAccount = ({
|
|
|
17180
17279
|
setAccountId(void 0);
|
|
17181
17280
|
closeSelectedEntry();
|
|
17182
17281
|
};
|
|
17183
|
-
return /* @__PURE__ */
|
|
17282
|
+
return /* @__PURE__ */ React202.createElement(
|
|
17184
17283
|
Panel,
|
|
17185
17284
|
{
|
|
17186
|
-
sidebar: /* @__PURE__ */
|
|
17285
|
+
sidebar: /* @__PURE__ */ React202.createElement(
|
|
17187
17286
|
LedgerAccountEntryDetails,
|
|
17188
17287
|
{
|
|
17189
17288
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.ledgerEntryDetail
|
|
@@ -17193,21 +17292,21 @@ var LedgerAccount = ({
|
|
|
17193
17292
|
parentRef: containerRef,
|
|
17194
17293
|
className: "Layer__ledger-account__panel"
|
|
17195
17294
|
},
|
|
17196
|
-
/* @__PURE__ */
|
|
17295
|
+
/* @__PURE__ */ React202.createElement("div", { className: baseClassName }, /* @__PURE__ */ React202.createElement(Header2, { className: "Layer__ledger-account__header" }, /* @__PURE__ */ React202.createElement(HeaderRow, null, /* @__PURE__ */ React202.createElement(HeaderCol, null, /* @__PURE__ */ React202.createElement(BackButton, { onClick: close }), /* @__PURE__ */ React202.createElement("div", { className: "Layer__ledger-account__title-container" }, /* @__PURE__ */ React202.createElement(
|
|
17197
17296
|
Text,
|
|
17198
17297
|
{
|
|
17199
17298
|
weight: "bold" /* bold */,
|
|
17200
17299
|
className: "Layer__ledger-account__title"
|
|
17201
17300
|
},
|
|
17202
17301
|
(_a = account == null ? void 0 : account.name) != null ? _a : ""
|
|
17203
|
-
), /* @__PURE__ */
|
|
17302
|
+
), /* @__PURE__ */ React202.createElement("div", { className: "Layer__ledger-account__balance-container" }, /* @__PURE__ */ React202.createElement(
|
|
17204
17303
|
Text,
|
|
17205
17304
|
{
|
|
17206
17305
|
className: "Layer__ledger-account__balance-label",
|
|
17207
17306
|
size: "sm" /* sm */
|
|
17208
17307
|
},
|
|
17209
17308
|
"Current balance"
|
|
17210
|
-
), /* @__PURE__ */
|
|
17309
|
+
), /* @__PURE__ */ React202.createElement(
|
|
17211
17310
|
Text,
|
|
17212
17311
|
{
|
|
17213
17312
|
className: "Layer__ledger-account__balance-value",
|
|
@@ -17215,9 +17314,9 @@ var LedgerAccount = ({
|
|
|
17215
17314
|
},
|
|
17216
17315
|
"$",
|
|
17217
17316
|
centsToDollars((account == null ? void 0 : account.balance) || 0)
|
|
17218
|
-
)))))), /* @__PURE__ */
|
|
17317
|
+
)))))), /* @__PURE__ */ React202.createElement("table", { className: "Layer__table Layer__table--hover-effect Layer__ledger-account-table" }, /* @__PURE__ */ React202.createElement("thead", null, /* @__PURE__ */ React202.createElement("tr", null, view !== "desktop" && /* @__PURE__ */ React202.createElement("th", null), view === "desktop" && /* @__PURE__ */ React202.createElement(React202.Fragment, null, /* @__PURE__ */ React202.createElement("th", { className: "Layer__table-header" }, ((_b = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _b.dateColumnHeader) || "Date"), /* @__PURE__ */ React202.createElement("th", { className: "Layer__table-header" }, ((_c = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _c.journalIdColumnHeader) || "Journal id #"), /* @__PURE__ */ React202.createElement("th", { className: "Layer__table-header" }, ((_d = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _d.sourceColumnHeader) || "Source")), view !== "mobile" && /* @__PURE__ */ React202.createElement(React202.Fragment, null, /* @__PURE__ */ React202.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, ((_e = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _e.debitColumnHeader) || "Debit"), /* @__PURE__ */ React202.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, ((_f = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _f.creditColumnHeader) || "Credit"), /* @__PURE__ */ React202.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__ */ React202.createElement("tbody", null, (_h = data == null ? void 0 : data.filter(
|
|
17219
17318
|
(entry) => !entry.entry_reversal_of && !entry.entry_reversed_by
|
|
17220
|
-
)) == null ? void 0 : _h.map((x, index) => /* @__PURE__ */
|
|
17319
|
+
)) == null ? void 0 : _h.map((x, index) => /* @__PURE__ */ React202.createElement(
|
|
17221
17320
|
LedgerAccountRow,
|
|
17222
17321
|
{
|
|
17223
17322
|
key: x.id,
|
|
@@ -17226,7 +17325,7 @@ var LedgerAccount = ({
|
|
|
17226
17325
|
initialLoad,
|
|
17227
17326
|
view
|
|
17228
17327
|
}
|
|
17229
|
-
)))), data && /* @__PURE__ */
|
|
17328
|
+
)))), data && /* @__PURE__ */ React202.createElement("div", { className: "Layer__ledger-account__pagination" }, /* @__PURE__ */ React202.createElement(
|
|
17230
17329
|
Pagination,
|
|
17231
17330
|
{
|
|
17232
17331
|
currentPage,
|
|
@@ -17234,7 +17333,7 @@ var LedgerAccount = ({
|
|
|
17234
17333
|
pageSize,
|
|
17235
17334
|
onPageChange: (page) => setCurrentPage(page)
|
|
17236
17335
|
}
|
|
17237
|
-
)), error ? /* @__PURE__ */
|
|
17336
|
+
)), error ? /* @__PURE__ */ React202.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React202.createElement(
|
|
17238
17337
|
DataState,
|
|
17239
17338
|
{
|
|
17240
17339
|
status: "failed" /* failed */,
|
|
@@ -17243,7 +17342,7 @@ var LedgerAccount = ({
|
|
|
17243
17342
|
onRefresh: () => refetch(),
|
|
17244
17343
|
isLoading: isValidating || isLoading
|
|
17245
17344
|
}
|
|
17246
|
-
)) : null, (!data || isLoading) && !error ? /* @__PURE__ */
|
|
17345
|
+
)) : null, (!data || isLoading) && !error ? /* @__PURE__ */ React202.createElement("div", { className: "Layer__ledger-account__loader-container" }, /* @__PURE__ */ React202.createElement(Loader2, null)) : null, !isLoading && !error && (data == null ? void 0 : data.length) === 0 ? /* @__PURE__ */ React202.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React202.createElement(
|
|
17247
17346
|
DataState,
|
|
17248
17347
|
{
|
|
17249
17348
|
status: "info" /* info */,
|
|
@@ -17264,25 +17363,26 @@ var ChartOfAccounts = (props) => {
|
|
|
17264
17363
|
const ledgerAccountsContextData = useLedgerAccounts(
|
|
17265
17364
|
(_a = props.showReversalEntries) != null ? _a : false
|
|
17266
17365
|
);
|
|
17267
|
-
return /* @__PURE__ */
|
|
17366
|
+
return /* @__PURE__ */ React203.createElement(ChartOfAccountsContext.Provider, { value: chartOfAccountsContextData }, /* @__PURE__ */ React203.createElement(LedgerAccountsContext.Provider, { value: ledgerAccountsContextData }, /* @__PURE__ */ React203.createElement(ChartOfAccountsContent, __spreadValues({}, props))));
|
|
17268
17367
|
};
|
|
17269
17368
|
var ChartOfAccountsContent = ({
|
|
17270
17369
|
asWidget,
|
|
17271
17370
|
withDateControl,
|
|
17272
17371
|
withExpandAllButton,
|
|
17273
17372
|
stringOverrides,
|
|
17274
|
-
templateAccountsEditable
|
|
17373
|
+
templateAccountsEditable,
|
|
17374
|
+
showAddAccountButton
|
|
17275
17375
|
}) => {
|
|
17276
17376
|
const { accountId } = useContext36(LedgerAccountsContext);
|
|
17277
17377
|
const { view, containerRef } = useElementViewSize();
|
|
17278
|
-
return /* @__PURE__ */
|
|
17378
|
+
return /* @__PURE__ */ React203.createElement(Container, { name: "chart-of-accounts", ref: containerRef, asWidget }, accountId ? /* @__PURE__ */ React203.createElement(
|
|
17279
17379
|
LedgerAccount,
|
|
17280
17380
|
{
|
|
17281
17381
|
view,
|
|
17282
17382
|
containerRef,
|
|
17283
17383
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.ledgerAccount
|
|
17284
17384
|
}
|
|
17285
|
-
) : /* @__PURE__ */
|
|
17385
|
+
) : /* @__PURE__ */ React203.createElement(
|
|
17286
17386
|
ChartOfAccountsTableWithPanel,
|
|
17287
17387
|
{
|
|
17288
17388
|
asWidget,
|
|
@@ -17290,6 +17390,7 @@ var ChartOfAccountsContent = ({
|
|
|
17290
17390
|
withExpandAllButton,
|
|
17291
17391
|
view,
|
|
17292
17392
|
containerRef,
|
|
17393
|
+
showAddAccountButton,
|
|
17293
17394
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.chartOfAccountsTable,
|
|
17294
17395
|
templateAccountsEditable
|
|
17295
17396
|
}
|
|
@@ -17297,7 +17398,7 @@ var ChartOfAccountsContent = ({
|
|
|
17297
17398
|
};
|
|
17298
17399
|
|
|
17299
17400
|
// src/components/Journal/Journal.tsx
|
|
17300
|
-
import
|
|
17401
|
+
import React211 from "react";
|
|
17301
17402
|
|
|
17302
17403
|
// src/contexts/JournalContext/JournalContext.tsx
|
|
17303
17404
|
import { createContext as createContext18 } from "react";
|
|
@@ -17604,13 +17705,13 @@ var useJournal = () => {
|
|
|
17604
17705
|
};
|
|
17605
17706
|
|
|
17606
17707
|
// src/components/JournalTable/JournalTableWithPanel.tsx
|
|
17607
|
-
import
|
|
17708
|
+
import React210, { useContext as useContext42, useMemo as useMemo30, useState as useState56 } from "react";
|
|
17608
17709
|
|
|
17609
17710
|
// src/components/JournalSidebar/JournalSidebar.tsx
|
|
17610
|
-
import
|
|
17711
|
+
import React207, { useContext as useContext40 } from "react";
|
|
17611
17712
|
|
|
17612
17713
|
// src/components/JournalEntryDetails/JournalEntryDetails.tsx
|
|
17613
|
-
import
|
|
17714
|
+
import React204, { useContext as useContext37, useMemo as useMemo29, useState as useState55 } from "react";
|
|
17614
17715
|
var JournalEntryDetails = () => {
|
|
17615
17716
|
var _a, _b, _c, _d;
|
|
17616
17717
|
const {
|
|
@@ -17654,15 +17755,15 @@ var JournalEntryDetails = () => {
|
|
|
17654
17755
|
setReverseEntryProcessing(false);
|
|
17655
17756
|
}
|
|
17656
17757
|
});
|
|
17657
|
-
return /* @__PURE__ */
|
|
17758
|
+
return /* @__PURE__ */ React204.createElement("div", { className: "Layer__journal__entry-details" }, /* @__PURE__ */ React204.createElement(Header2, { className: "Layer__journal__entry-details__mobile-header" }, /* @__PURE__ */ React204.createElement(HeaderRow, null, /* @__PURE__ */ React204.createElement(HeaderCol, { className: "Layer__hidden-lg Layer__hidden-xl" }, /* @__PURE__ */ React204.createElement(BackButton, { onClick: closeSelectedEntry }), /* @__PURE__ */ React204.createElement(Heading, { size: "secondary" /* secondary */ }, "Transaction details")), /* @__PURE__ */ React204.createElement(HeaderCol, { className: "Layer__show-lg Layer__show-xl" }, /* @__PURE__ */ React204.createElement(Heading, { size: "secondary" /* secondary */ }, "Transaction source")), /* @__PURE__ */ React204.createElement(HeaderCol, { className: "Layer__show-lg Layer__show-xl" }, /* @__PURE__ */ React204.createElement(CloseButton, { onClick: closeSelectedEntry })))), /* @__PURE__ */ React204.createElement(
|
|
17658
17759
|
DetailsList,
|
|
17659
17760
|
{
|
|
17660
17761
|
title: "Transaction source",
|
|
17661
17762
|
titleClassName: "Layer__hidden-lg Layer__hidden-xl",
|
|
17662
|
-
actions: /* @__PURE__ */
|
|
17763
|
+
actions: /* @__PURE__ */ React204.createElement(
|
|
17663
17764
|
Button,
|
|
17664
17765
|
{
|
|
17665
|
-
rightIcon: /* @__PURE__ */
|
|
17766
|
+
rightIcon: /* @__PURE__ */ React204.createElement(X_default, null),
|
|
17666
17767
|
iconOnly: true,
|
|
17667
17768
|
onClick: closeSelectedEntry,
|
|
17668
17769
|
className: "Layer__details-list__close-btn",
|
|
@@ -17670,32 +17771,32 @@ var JournalEntryDetails = () => {
|
|
|
17670
17771
|
}
|
|
17671
17772
|
)
|
|
17672
17773
|
},
|
|
17673
|
-
/* @__PURE__ */
|
|
17674
|
-
((_b = entry == null ? void 0 : entry.source) == null ? void 0 : _b.display_description) && /* @__PURE__ */
|
|
17675
|
-
), /* @__PURE__ */
|
|
17774
|
+
/* @__PURE__ */ React204.createElement(DetailsListItem, { label: "Source", isLoading: isLoadingEntry }, /* @__PURE__ */ React204.createElement(Badge, null, (_a = entry == null ? void 0 : entry.source) == null ? void 0 : _a.entity_name)),
|
|
17775
|
+
((_b = entry == null ? void 0 : entry.source) == null ? void 0 : _b.display_description) && /* @__PURE__ */ React204.createElement(SourceDetailView, { source: entry == null ? void 0 : entry.source })
|
|
17776
|
+
), /* @__PURE__ */ React204.createElement(
|
|
17676
17777
|
DetailsList,
|
|
17677
17778
|
{
|
|
17678
17779
|
title: `Journal Entry ${entry ? entryNumber(entry) : ""}`,
|
|
17679
17780
|
className: "Layer__border-top"
|
|
17680
17781
|
},
|
|
17681
|
-
/* @__PURE__ */
|
|
17682
|
-
/* @__PURE__ */
|
|
17683
|
-
/* @__PURE__ */
|
|
17684
|
-
(entry == null ? void 0 : entry.reversal_id) && /* @__PURE__ */
|
|
17685
|
-
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */
|
|
17782
|
+
/* @__PURE__ */ React204.createElement(DetailsListItem, { label: "Entry type", isLoading: isLoadingEntry }, humanizeEnum((_c = entry == null ? void 0 : entry.entry_type) != null ? _c : "")),
|
|
17783
|
+
/* @__PURE__ */ React204.createElement(DetailsListItem, { label: "Effective date", isLoading: isLoadingEntry }, (entry == null ? void 0 : entry.entry_at) && /* @__PURE__ */ React204.createElement(DateTime, { value: entry == null ? void 0 : entry.entry_at })),
|
|
17784
|
+
/* @__PURE__ */ React204.createElement(DetailsListItem, { label: "Creation date", isLoading: isLoadingEntry }, (entry == null ? void 0 : entry.date) && /* @__PURE__ */ React204.createElement(DateTime, { value: entry == null ? void 0 : entry.date })),
|
|
17785
|
+
(entry == null ? void 0 : entry.reversal_id) && /* @__PURE__ */ React204.createElement(DetailsListItem, { label: "Reversal", isLoading: isLoadingEntry }, `Journal Entry #${entry == null ? void 0 : entry.reversal_id.substring(0, 5)}`)
|
|
17786
|
+
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */ React204.createElement("div", { className: "Layer__journal__entry-details__line-items" }, /* @__PURE__ */ React204.createElement(Card, null, /* @__PURE__ */ React204.createElement(
|
|
17686
17787
|
Table,
|
|
17687
17788
|
{
|
|
17688
17789
|
componentName: "journal__entry-details",
|
|
17689
17790
|
borderCollapse: "collapse"
|
|
17690
17791
|
},
|
|
17691
|
-
/* @__PURE__ */
|
|
17792
|
+
/* @__PURE__ */ React204.createElement(TableHead, null, /* @__PURE__ */ React204.createElement(TableRow, { rowKey: "soc-flow-head-row", isHeadRow: true }, /* @__PURE__ */ React204.createElement(TableCell, null, "Line items"), /* @__PURE__ */ React204.createElement(
|
|
17692
17793
|
TableCell,
|
|
17693
17794
|
{
|
|
17694
17795
|
className: "Layer__journal__debit-credit-col",
|
|
17695
17796
|
align: "right" /* RIGHT */
|
|
17696
17797
|
},
|
|
17697
17798
|
"Debit"
|
|
17698
|
-
), /* @__PURE__ */
|
|
17799
|
+
), /* @__PURE__ */ React204.createElement(
|
|
17699
17800
|
TableCell,
|
|
17700
17801
|
{
|
|
17701
17802
|
className: "Layer__journal__debit-credit-col",
|
|
@@ -17703,37 +17804,37 @@ var JournalEntryDetails = () => {
|
|
|
17703
17804
|
},
|
|
17704
17805
|
"Credit"
|
|
17705
17806
|
))),
|
|
17706
|
-
/* @__PURE__ */
|
|
17807
|
+
/* @__PURE__ */ React204.createElement(TableBody, null, sortedLineItems == null ? void 0 : sortedLineItems.map((item, index) => /* @__PURE__ */ React204.createElement(
|
|
17707
17808
|
TableRow,
|
|
17708
17809
|
{
|
|
17709
17810
|
key: `ledger-line-item-${index}`,
|
|
17710
17811
|
rowKey: `ledger-line-item-${index}`
|
|
17711
17812
|
},
|
|
17712
|
-
/* @__PURE__ */
|
|
17713
|
-
/* @__PURE__ */
|
|
17813
|
+
/* @__PURE__ */ React204.createElement(TableCell, null, item.account.name),
|
|
17814
|
+
/* @__PURE__ */ React204.createElement(
|
|
17714
17815
|
TableCell,
|
|
17715
17816
|
{
|
|
17716
17817
|
className: "Layer__journal__debit-credit-col",
|
|
17717
17818
|
align: "right" /* RIGHT */
|
|
17718
17819
|
},
|
|
17719
|
-
item.direction === "DEBIT" /* DEBIT */ && /* @__PURE__ */
|
|
17820
|
+
item.direction === "DEBIT" /* DEBIT */ && /* @__PURE__ */ React204.createElement(Badge, { variant: "warning" /* WARNING */ }, "$", centsToDollars(item.amount || 0))
|
|
17720
17821
|
),
|
|
17721
|
-
/* @__PURE__ */
|
|
17822
|
+
/* @__PURE__ */ React204.createElement(
|
|
17722
17823
|
TableCell,
|
|
17723
17824
|
{
|
|
17724
17825
|
className: "Layer__journal__debit-credit-col",
|
|
17725
17826
|
align: "right" /* RIGHT */
|
|
17726
17827
|
},
|
|
17727
|
-
item.direction === "CREDIT" /* CREDIT */ && /* @__PURE__ */
|
|
17828
|
+
item.direction === "CREDIT" /* CREDIT */ && /* @__PURE__ */ React204.createElement(Badge, { variant: "success" /* SUCCESS */ }, "$", centsToDollars(item.amount || 0))
|
|
17728
17829
|
)
|
|
17729
|
-
)), /* @__PURE__ */
|
|
17830
|
+
)), /* @__PURE__ */ React204.createElement(
|
|
17730
17831
|
TableRow,
|
|
17731
17832
|
{
|
|
17732
17833
|
rowKey: "ledger-line-item-summation",
|
|
17733
17834
|
variant: "summation"
|
|
17734
17835
|
},
|
|
17735
|
-
/* @__PURE__ */
|
|
17736
|
-
/* @__PURE__ */
|
|
17836
|
+
/* @__PURE__ */ React204.createElement(TableCell, { primary: true }, "Total"),
|
|
17837
|
+
/* @__PURE__ */ React204.createElement(
|
|
17737
17838
|
TableCell,
|
|
17738
17839
|
{
|
|
17739
17840
|
isCurrency: true,
|
|
@@ -17743,7 +17844,7 @@ var JournalEntryDetails = () => {
|
|
|
17743
17844
|
},
|
|
17744
17845
|
(entry == null ? void 0 : entry.line_items.filter((item) => item.direction === "DEBIT").map((item) => item.amount).reduce((a, b) => a + b, 0)) || 0
|
|
17745
17846
|
),
|
|
17746
|
-
/* @__PURE__ */
|
|
17847
|
+
/* @__PURE__ */ React204.createElement(
|
|
17747
17848
|
TableCell,
|
|
17748
17849
|
{
|
|
17749
17850
|
isCurrency: true,
|
|
@@ -17754,10 +17855,10 @@ var JournalEntryDetails = () => {
|
|
|
17754
17855
|
(entry == null ? void 0 : entry.line_items.filter((item) => item.direction === "CREDIT").map((item) => item.amount).reduce((a, b) => a + b, 0)) || 0
|
|
17755
17856
|
)
|
|
17756
17857
|
))
|
|
17757
|
-
)), /* @__PURE__ */
|
|
17858
|
+
)), /* @__PURE__ */ React204.createElement("div", { className: "Layer__journal__entry-details__reverse-btn-container" }, /* @__PURE__ */ React204.createElement(
|
|
17758
17859
|
Button,
|
|
17759
17860
|
{
|
|
17760
|
-
rightIcon: reverseEntryError ? /* @__PURE__ */
|
|
17861
|
+
rightIcon: reverseEntryError ? /* @__PURE__ */ React204.createElement(AlertCircle_default, { size: 12 }) : /* @__PURE__ */ React204.createElement(RefreshCcw_default, { size: 12 }),
|
|
17761
17862
|
variant: "secondary" /* secondary */,
|
|
17762
17863
|
onClick: reverseEntryProcessing ? () => {
|
|
17763
17864
|
} : onReverseEntry,
|
|
@@ -17770,10 +17871,10 @@ var JournalEntryDetails = () => {
|
|
|
17770
17871
|
};
|
|
17771
17872
|
|
|
17772
17873
|
// src/components/JournalForm/JournalForm.tsx
|
|
17773
|
-
import
|
|
17874
|
+
import React206, { useContext as useContext39 } from "react";
|
|
17774
17875
|
|
|
17775
17876
|
// src/components/JournalForm/JournalFormEntryLines.tsx
|
|
17776
|
-
import
|
|
17877
|
+
import React205, { useContext as useContext38 } from "react";
|
|
17777
17878
|
var JournalFormEntryLines = ({
|
|
17778
17879
|
entrylineItems,
|
|
17779
17880
|
addEntryLine,
|
|
@@ -17785,14 +17886,14 @@ var JournalFormEntryLines = ({
|
|
|
17785
17886
|
const { data: accountsData } = useContext38(ChartOfAccountsContext);
|
|
17786
17887
|
const { form } = useContext38(JournalContext);
|
|
17787
17888
|
const parentOptions = useParentOptions(accountsData);
|
|
17788
|
-
return /* @__PURE__ */
|
|
17789
|
-
return /* @__PURE__ */
|
|
17889
|
+
return /* @__PURE__ */ React205.createElement(React205.Fragment, null, ["DEBIT", "CREDIT"].map((direction, idx) => {
|
|
17890
|
+
return /* @__PURE__ */ React205.createElement(
|
|
17790
17891
|
"div",
|
|
17791
17892
|
{
|
|
17792
17893
|
key: "Layer__journal__form__input-group-" + idx,
|
|
17793
17894
|
className: "Layer__journal__form__input-group Layer__journal__form__input-group__border"
|
|
17794
17895
|
},
|
|
17795
|
-
/* @__PURE__ */
|
|
17896
|
+
/* @__PURE__ */ React205.createElement(
|
|
17796
17897
|
Text,
|
|
17797
17898
|
{
|
|
17798
17899
|
className: "Layer__journal__form__input-group__title",
|
|
@@ -17807,13 +17908,13 @@ var JournalFormEntryLines = ({
|
|
|
17807
17908
|
if (item.direction !== direction) {
|
|
17808
17909
|
return null;
|
|
17809
17910
|
}
|
|
17810
|
-
return /* @__PURE__ */
|
|
17911
|
+
return /* @__PURE__ */ React205.createElement(
|
|
17811
17912
|
"div",
|
|
17812
17913
|
{
|
|
17813
17914
|
className: "Layer__journal__form__input-group__line-item",
|
|
17814
17915
|
key: direction + "-" + idx2
|
|
17815
17916
|
},
|
|
17816
|
-
/* @__PURE__ */
|
|
17917
|
+
/* @__PURE__ */ React205.createElement(InputGroup, { name: direction, label: "Amount", inline: true }, /* @__PURE__ */ React205.createElement(
|
|
17817
17918
|
InputWithBadge,
|
|
17818
17919
|
{
|
|
17819
17920
|
name: direction,
|
|
@@ -17839,14 +17940,14 @@ var JournalFormEntryLines = ({
|
|
|
17839
17940
|
)) == null ? void 0 : _c.message
|
|
17840
17941
|
}
|
|
17841
17942
|
)),
|
|
17842
|
-
/* @__PURE__ */
|
|
17943
|
+
/* @__PURE__ */ React205.createElement(
|
|
17843
17944
|
InputGroup,
|
|
17844
17945
|
{
|
|
17845
17946
|
name: "account-name",
|
|
17846
17947
|
label: "Account name",
|
|
17847
17948
|
inline: true
|
|
17848
17949
|
},
|
|
17849
|
-
/* @__PURE__ */
|
|
17950
|
+
/* @__PURE__ */ React205.createElement(
|
|
17850
17951
|
Select2,
|
|
17851
17952
|
{
|
|
17852
17953
|
options: parentOptions,
|
|
@@ -17870,18 +17971,18 @@ var JournalFormEntryLines = ({
|
|
|
17870
17971
|
)) == null ? void 0 : _f.message
|
|
17871
17972
|
}
|
|
17872
17973
|
),
|
|
17873
|
-
idx2 >= 2 && /* @__PURE__ */
|
|
17974
|
+
idx2 >= 2 && /* @__PURE__ */ React205.createElement(
|
|
17874
17975
|
IconButton,
|
|
17875
17976
|
{
|
|
17876
17977
|
className: "Layer__remove__button",
|
|
17877
17978
|
onClick: () => removeEntryLine(idx2),
|
|
17878
|
-
icon: /* @__PURE__ */
|
|
17979
|
+
icon: /* @__PURE__ */ React205.createElement(Trash_default, null)
|
|
17879
17980
|
}
|
|
17880
17981
|
)
|
|
17881
17982
|
)
|
|
17882
17983
|
);
|
|
17883
17984
|
}),
|
|
17884
|
-
(config.form.addEntryLinesLimit === void 0 || config.form.addEntryLinesLimit > (entrylineItems == null ? void 0 : entrylineItems.length)) && /* @__PURE__ */
|
|
17985
|
+
(config.form.addEntryLinesLimit === void 0 || config.form.addEntryLinesLimit > (entrylineItems == null ? void 0 : entrylineItems.length)) && /* @__PURE__ */ React205.createElement(
|
|
17885
17986
|
TextButton,
|
|
17886
17987
|
{
|
|
17887
17988
|
className: "Layer__journal__add-entry-line",
|
|
@@ -17909,7 +18010,7 @@ var JournalForm = ({
|
|
|
17909
18010
|
addEntryLine,
|
|
17910
18011
|
removeEntryLine
|
|
17911
18012
|
} = useContext39(JournalContext);
|
|
17912
|
-
return /* @__PURE__ */
|
|
18013
|
+
return /* @__PURE__ */ React206.createElement(
|
|
17913
18014
|
"form",
|
|
17914
18015
|
{
|
|
17915
18016
|
className: "Layer__form",
|
|
@@ -17918,7 +18019,7 @@ var JournalForm = ({
|
|
|
17918
18019
|
submitForm();
|
|
17919
18020
|
}
|
|
17920
18021
|
},
|
|
17921
|
-
/* @__PURE__ */
|
|
18022
|
+
/* @__PURE__ */ React206.createElement(Header2, { className: "Layer__journal__sidebar__header" }, /* @__PURE__ */ React206.createElement(HeaderRow, null, /* @__PURE__ */ React206.createElement(HeaderCol, null, /* @__PURE__ */ React206.createElement(Heading, { size: "secondary" /* secondary */, className: "title" }, (_a = stringOverrides == null ? void 0 : stringOverrides.header) != null ? _a : "Add New Entry")), /* @__PURE__ */ React206.createElement(HeaderCol, { className: "actions" }, /* @__PURE__ */ React206.createElement(
|
|
17922
18023
|
Button,
|
|
17923
18024
|
{
|
|
17924
18025
|
type: "button",
|
|
@@ -17927,7 +18028,7 @@ var JournalForm = ({
|
|
|
17927
18028
|
disabled: sendingForm
|
|
17928
18029
|
},
|
|
17929
18030
|
(stringOverrides == null ? void 0 : stringOverrides.cancelButton) || "Cancel"
|
|
17930
|
-
), apiError && /* @__PURE__ */
|
|
18031
|
+
), apiError && /* @__PURE__ */ React206.createElement(
|
|
17931
18032
|
RetryButton,
|
|
17932
18033
|
{
|
|
17933
18034
|
type: "submit",
|
|
@@ -17936,7 +18037,7 @@ var JournalForm = ({
|
|
|
17936
18037
|
disabled: sendingForm
|
|
17937
18038
|
},
|
|
17938
18039
|
(stringOverrides == null ? void 0 : stringOverrides.retryButton) || "Retry"
|
|
17939
|
-
), !apiError && /* @__PURE__ */
|
|
18040
|
+
), !apiError && /* @__PURE__ */ React206.createElement(
|
|
17940
18041
|
SubmitButton,
|
|
17941
18042
|
{
|
|
17942
18043
|
type: "submit",
|
|
@@ -17946,7 +18047,7 @@ var JournalForm = ({
|
|
|
17946
18047
|
},
|
|
17947
18048
|
(stringOverrides == null ? void 0 : stringOverrides.saveButton) || "Save"
|
|
17948
18049
|
)))),
|
|
17949
|
-
apiError && /* @__PURE__ */
|
|
18050
|
+
apiError && /* @__PURE__ */ React206.createElement(
|
|
17950
18051
|
Text,
|
|
17951
18052
|
{
|
|
17952
18053
|
size: "sm" /* sm */,
|
|
@@ -17954,7 +18055,7 @@ var JournalForm = ({
|
|
|
17954
18055
|
},
|
|
17955
18056
|
apiError
|
|
17956
18057
|
),
|
|
17957
|
-
/* @__PURE__ */
|
|
18058
|
+
/* @__PURE__ */ React206.createElement("div", { className: "Layer__journal__form__input-group" }, /* @__PURE__ */ React206.createElement(InputGroup, { name: "date", label: "Effective Date", inline: true }, /* @__PURE__ */ React206.createElement("div", { className: "Layer__journal__datepicker__wrapper" }, /* @__PURE__ */ React206.createElement(
|
|
17958
18059
|
DatePicker,
|
|
17959
18060
|
{
|
|
17960
18061
|
selected: (form == null ? void 0 : form.data.entry_at) ? new Date(form == null ? void 0 : form.data.entry_at) : /* @__PURE__ */ new Date(),
|
|
@@ -17967,7 +18068,7 @@ var JournalForm = ({
|
|
|
17967
18068
|
placeholderText: "Select date",
|
|
17968
18069
|
currentDateOption: false
|
|
17969
18070
|
}
|
|
17970
|
-
), /* @__PURE__ */
|
|
18071
|
+
), /* @__PURE__ */ React206.createElement(
|
|
17971
18072
|
DatePicker,
|
|
17972
18073
|
{
|
|
17973
18074
|
selected: (form == null ? void 0 : form.data.entry_at) ? new Date(form == null ? void 0 : form.data.entry_at) : /* @__PURE__ */ new Date(),
|
|
@@ -17981,7 +18082,7 @@ var JournalForm = ({
|
|
|
17981
18082
|
currentDateOption: false
|
|
17982
18083
|
}
|
|
17983
18084
|
)))),
|
|
17984
|
-
/* @__PURE__ */
|
|
18085
|
+
/* @__PURE__ */ React206.createElement(
|
|
17985
18086
|
JournalFormEntryLines,
|
|
17986
18087
|
{
|
|
17987
18088
|
entrylineItems: (form == null ? void 0 : form.data.line_items) || [],
|
|
@@ -17992,7 +18093,7 @@ var JournalForm = ({
|
|
|
17992
18093
|
config
|
|
17993
18094
|
}
|
|
17994
18095
|
),
|
|
17995
|
-
/* @__PURE__ */
|
|
18096
|
+
/* @__PURE__ */ React206.createElement("div", { className: "Layer__journal__form__input-group Layer__journal__form__input-group__textarea" }, /* @__PURE__ */ React206.createElement(InputGroup, { name: "memo", label: "Notes" }, /* @__PURE__ */ React206.createElement(
|
|
17996
18097
|
Textarea,
|
|
17997
18098
|
{
|
|
17998
18099
|
name: "memo",
|
|
@@ -18002,7 +18103,7 @@ var JournalForm = ({
|
|
|
18002
18103
|
disabled: sendingForm
|
|
18003
18104
|
}
|
|
18004
18105
|
))),
|
|
18005
|
-
/* @__PURE__ */
|
|
18106
|
+
/* @__PURE__ */ React206.createElement("div", { className: "Layer__journal__bottom-actions" }, /* @__PURE__ */ React206.createElement(
|
|
18006
18107
|
Button,
|
|
18007
18108
|
{
|
|
18008
18109
|
type: "button",
|
|
@@ -18011,7 +18112,7 @@ var JournalForm = ({
|
|
|
18011
18112
|
disabled: sendingForm
|
|
18012
18113
|
},
|
|
18013
18114
|
(stringOverrides == null ? void 0 : stringOverrides.cancelButton) || "Cancel"
|
|
18014
|
-
), apiError && /* @__PURE__ */
|
|
18115
|
+
), apiError && /* @__PURE__ */ React206.createElement(
|
|
18015
18116
|
RetryButton,
|
|
18016
18117
|
{
|
|
18017
18118
|
type: "submit",
|
|
@@ -18020,7 +18121,7 @@ var JournalForm = ({
|
|
|
18020
18121
|
disabled: sendingForm
|
|
18021
18122
|
},
|
|
18022
18123
|
(stringOverrides == null ? void 0 : stringOverrides.retryButton) || "Retry"
|
|
18023
|
-
), !apiError && /* @__PURE__ */
|
|
18124
|
+
), !apiError && /* @__PURE__ */ React206.createElement(
|
|
18024
18125
|
SubmitButton,
|
|
18025
18126
|
{
|
|
18026
18127
|
type: "submit",
|
|
@@ -18041,13 +18142,13 @@ var JournalSidebar = ({
|
|
|
18041
18142
|
}) => {
|
|
18042
18143
|
const { selectedEntryId } = useContext40(JournalContext);
|
|
18043
18144
|
if (selectedEntryId !== "new") {
|
|
18044
|
-
return /* @__PURE__ */
|
|
18145
|
+
return /* @__PURE__ */ React207.createElement(JournalEntryDetails, null);
|
|
18045
18146
|
}
|
|
18046
|
-
return /* @__PURE__ */
|
|
18147
|
+
return /* @__PURE__ */ React207.createElement(JournalForm, { config, stringOverrides });
|
|
18047
18148
|
};
|
|
18048
18149
|
|
|
18049
18150
|
// src/components/JournalTable/JournalTable.tsx
|
|
18050
|
-
import
|
|
18151
|
+
import React208, { useContext as useContext41, useEffect as useEffect45 } from "react";
|
|
18051
18152
|
import { parseISO as parseISO14, format as formatTime12 } from "date-fns";
|
|
18052
18153
|
var accountName = (row) => {
|
|
18053
18154
|
if ("account" in row) {
|
|
@@ -18062,7 +18163,7 @@ var JournalTable = ({
|
|
|
18062
18163
|
view,
|
|
18063
18164
|
data,
|
|
18064
18165
|
stringOverrides
|
|
18065
|
-
}) => /* @__PURE__ */
|
|
18166
|
+
}) => /* @__PURE__ */ React208.createElement(TableProvider, null, /* @__PURE__ */ React208.createElement(
|
|
18066
18167
|
JournalTableContent,
|
|
18067
18168
|
{
|
|
18068
18169
|
view,
|
|
@@ -18084,7 +18185,7 @@ var JournalTableContent = ({
|
|
|
18084
18185
|
const renderJournalRow = (row, index, rowKey, depth) => {
|
|
18085
18186
|
const expandable = !!row.line_items && row.line_items.length > 0;
|
|
18086
18187
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
18087
|
-
return /* @__PURE__ */
|
|
18188
|
+
return /* @__PURE__ */ React208.createElement(React208.Fragment, { key: rowKey + "-" + index }, /* @__PURE__ */ React208.createElement(
|
|
18088
18189
|
TableRow,
|
|
18089
18190
|
{
|
|
18090
18191
|
rowKey: rowKey + "-" + index,
|
|
@@ -18102,7 +18203,7 @@ var JournalTableContent = ({
|
|
|
18102
18203
|
},
|
|
18103
18204
|
depth
|
|
18104
18205
|
},
|
|
18105
|
-
/* @__PURE__ */
|
|
18206
|
+
/* @__PURE__ */ React208.createElement(
|
|
18106
18207
|
TableCell,
|
|
18107
18208
|
{
|
|
18108
18209
|
withExpandIcon: expandable,
|
|
@@ -18113,16 +18214,16 @@ var JournalTableContent = ({
|
|
|
18113
18214
|
},
|
|
18114
18215
|
entryNumber(row)
|
|
18115
18216
|
),
|
|
18116
|
-
/* @__PURE__ */
|
|
18117
|
-
/* @__PURE__ */
|
|
18118
|
-
/* @__PURE__ */
|
|
18119
|
-
/* @__PURE__ */
|
|
18217
|
+
/* @__PURE__ */ React208.createElement(TableCell, null, row.entry_at && formatTime12(parseISO14(row.entry_at), DATE_FORMAT)),
|
|
18218
|
+
/* @__PURE__ */ React208.createElement(TableCell, null, humanizeEnum(row.entry_type)),
|
|
18219
|
+
/* @__PURE__ */ React208.createElement(TableCell, null, "(", row.line_items.length, ")"),
|
|
18220
|
+
/* @__PURE__ */ React208.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, "line_items" in row && Math.abs(
|
|
18120
18221
|
row.line_items.filter((item) => item.direction === "DEBIT").map((item) => item.amount).reduce((a, b) => a + b, 0)
|
|
18121
18222
|
)),
|
|
18122
|
-
/* @__PURE__ */
|
|
18223
|
+
/* @__PURE__ */ React208.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, "line_items" in row && Math.abs(
|
|
18123
18224
|
row.line_items.filter((item) => item.direction === "CREDIT").map((item) => item.amount).reduce((a, b) => a + b, 0)
|
|
18124
18225
|
))
|
|
18125
|
-
), expandable && expanded && row.line_items.map((subItem, subIdx) => /* @__PURE__ */
|
|
18226
|
+
), expandable && expanded && row.line_items.map((subItem, subIdx) => /* @__PURE__ */ React208.createElement(
|
|
18126
18227
|
TableRow,
|
|
18127
18228
|
{
|
|
18128
18229
|
key: rowKey + "-" + index + "-" + subIdx,
|
|
@@ -18130,19 +18231,104 @@ var JournalTableContent = ({
|
|
|
18130
18231
|
depth: depth + 1,
|
|
18131
18232
|
selected: selectedEntryId === row.id
|
|
18132
18233
|
},
|
|
18133
|
-
/* @__PURE__ */
|
|
18134
|
-
/* @__PURE__ */
|
|
18135
|
-
/* @__PURE__ */
|
|
18136
|
-
/* @__PURE__ */
|
|
18137
|
-
subItem.direction === "DEBIT" && subItem.amount >= 0 ? /* @__PURE__ */
|
|
18138
|
-
subItem.direction === "CREDIT" && subItem.amount >= 0 ? /* @__PURE__ */
|
|
18234
|
+
/* @__PURE__ */ React208.createElement(TableCell, null),
|
|
18235
|
+
/* @__PURE__ */ React208.createElement(TableCell, null),
|
|
18236
|
+
/* @__PURE__ */ React208.createElement(TableCell, null),
|
|
18237
|
+
/* @__PURE__ */ React208.createElement(TableCell, null, accountName(subItem)),
|
|
18238
|
+
subItem.direction === "DEBIT" && subItem.amount >= 0 ? /* @__PURE__ */ React208.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, subItem.amount) : /* @__PURE__ */ React208.createElement(TableCell, null),
|
|
18239
|
+
subItem.direction === "CREDIT" && subItem.amount >= 0 ? /* @__PURE__ */ React208.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, subItem.amount) : /* @__PURE__ */ React208.createElement(TableCell, null)
|
|
18139
18240
|
)));
|
|
18140
18241
|
};
|
|
18141
|
-
return /* @__PURE__ */
|
|
18242
|
+
return /* @__PURE__ */ React208.createElement(Table, { borderCollapse: "collapse" }, /* @__PURE__ */ React208.createElement(TableHead, null, /* @__PURE__ */ React208.createElement(TableRow, { isHeadRow: true, rowKey: "journal-head-row" }, /* @__PURE__ */ React208.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.idColumnHeader) || "Id"), /* @__PURE__ */ React208.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.dateColumnHeader) || "Date"), /* @__PURE__ */ React208.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.transactionColumnHeader) || "Transaction"), /* @__PURE__ */ React208.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.accountColumnHeader) || "Account Name"), /* @__PURE__ */ React208.createElement(TableCell, { isHeaderCell: true, align: "right" /* RIGHT */ }, (stringOverrides == null ? void 0 : stringOverrides.debitColumnHeader) || "Debit"), /* @__PURE__ */ React208.createElement(TableCell, { isHeaderCell: true, align: "right" /* RIGHT */ }, (stringOverrides == null ? void 0 : stringOverrides.creditColumnHeader) || "Credit"))), /* @__PURE__ */ React208.createElement(TableBody, null, data.map(
|
|
18142
18243
|
(entry, idx) => renderJournalRow(entry, idx, `journal-row-${entry.id}`, 0)
|
|
18143
18244
|
)));
|
|
18144
18245
|
};
|
|
18145
18246
|
|
|
18247
|
+
// src/components/Journal/download/JournalEntriesDownloadButton.tsx
|
|
18248
|
+
import React209 from "react";
|
|
18249
|
+
|
|
18250
|
+
// src/components/Journal/download/useJournalEntriesDownload.ts
|
|
18251
|
+
import useSWRMutation5 from "swr/mutation";
|
|
18252
|
+
function buildKey5({
|
|
18253
|
+
access_token: accessToken,
|
|
18254
|
+
apiUrl,
|
|
18255
|
+
businessId,
|
|
18256
|
+
startCutoff,
|
|
18257
|
+
endCutoff
|
|
18258
|
+
}) {
|
|
18259
|
+
if (accessToken && apiUrl) {
|
|
18260
|
+
return {
|
|
18261
|
+
accessToken,
|
|
18262
|
+
apiUrl,
|
|
18263
|
+
businessId,
|
|
18264
|
+
startCutoff,
|
|
18265
|
+
endCutoff,
|
|
18266
|
+
tags: ["#journal-entries", "#exports", "#csv"]
|
|
18267
|
+
};
|
|
18268
|
+
}
|
|
18269
|
+
}
|
|
18270
|
+
function useJournalEntriesDownload({
|
|
18271
|
+
startCutoff,
|
|
18272
|
+
endCutoff,
|
|
18273
|
+
onSuccess
|
|
18274
|
+
}) {
|
|
18275
|
+
const { data: auth } = useAuth();
|
|
18276
|
+
const { businessId } = useLayerContext();
|
|
18277
|
+
return useSWRMutation5(
|
|
18278
|
+
() => buildKey5(__spreadProps(__spreadValues({}, auth), {
|
|
18279
|
+
businessId,
|
|
18280
|
+
startCutoff,
|
|
18281
|
+
endCutoff
|
|
18282
|
+
})),
|
|
18283
|
+
({ accessToken, apiUrl, businessId: businessId2, startCutoff: startCutoff2, endCutoff: endCutoff2 }) => getJournalEntriesCSV(
|
|
18284
|
+
apiUrl,
|
|
18285
|
+
accessToken,
|
|
18286
|
+
{
|
|
18287
|
+
params: {
|
|
18288
|
+
businessId: businessId2,
|
|
18289
|
+
startCutoff: startCutoff2 == null ? void 0 : startCutoff2.toISOString(),
|
|
18290
|
+
endCutoff: endCutoff2 == null ? void 0 : endCutoff2.toISOString()
|
|
18291
|
+
}
|
|
18292
|
+
}
|
|
18293
|
+
)().then(({ data }) => {
|
|
18294
|
+
if (onSuccess) {
|
|
18295
|
+
return onSuccess(data);
|
|
18296
|
+
}
|
|
18297
|
+
}),
|
|
18298
|
+
{
|
|
18299
|
+
revalidate: false,
|
|
18300
|
+
throwOnError: false
|
|
18301
|
+
}
|
|
18302
|
+
);
|
|
18303
|
+
}
|
|
18304
|
+
|
|
18305
|
+
// src/components/Journal/download/JournalEntriesDownloadButton.tsx
|
|
18306
|
+
function JournalEntriesDownloadButton({
|
|
18307
|
+
startCutoff,
|
|
18308
|
+
endCutoff,
|
|
18309
|
+
iconOnly
|
|
18310
|
+
}) {
|
|
18311
|
+
const { invisibleDownloadRef, triggerInvisibleDownload } = useInvisibleDownload();
|
|
18312
|
+
const { trigger, isMutating, error } = useJournalEntriesDownload({
|
|
18313
|
+
startCutoff,
|
|
18314
|
+
endCutoff,
|
|
18315
|
+
onSuccess: ({ presignedUrl }) => triggerInvisibleDownload({ url: presignedUrl })
|
|
18316
|
+
});
|
|
18317
|
+
return /* @__PURE__ */ React209.createElement(React209.Fragment, null, /* @__PURE__ */ React209.createElement(
|
|
18318
|
+
DownloadButton,
|
|
18319
|
+
{
|
|
18320
|
+
iconOnly,
|
|
18321
|
+
onClick: () => {
|
|
18322
|
+
trigger();
|
|
18323
|
+
},
|
|
18324
|
+
isDownloading: isMutating,
|
|
18325
|
+
requestFailed: Boolean(error),
|
|
18326
|
+
text: "Download CSV",
|
|
18327
|
+
retryText: "Retry"
|
|
18328
|
+
}
|
|
18329
|
+
), /* @__PURE__ */ React209.createElement(InvisibleDownload_default, { ref: invisibleDownloadRef }));
|
|
18330
|
+
}
|
|
18331
|
+
|
|
18146
18332
|
// src/components/JournalTable/JournalTableWithPanel.tsx
|
|
18147
18333
|
var COMPONENT_NAME6 = "journal";
|
|
18148
18334
|
var JournalTableWithPanel = ({
|
|
@@ -18168,10 +18354,10 @@ var JournalTableWithPanel = ({
|
|
|
18168
18354
|
const lastPageIndex = firstPageIndex + pageSize;
|
|
18169
18355
|
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);
|
|
18170
18356
|
}, [rawData, currentPage]);
|
|
18171
|
-
return /* @__PURE__ */
|
|
18357
|
+
return /* @__PURE__ */ React210.createElement(
|
|
18172
18358
|
Panel,
|
|
18173
18359
|
{
|
|
18174
|
-
sidebar: /* @__PURE__ */
|
|
18360
|
+
sidebar: /* @__PURE__ */ React210.createElement(
|
|
18175
18361
|
JournalSidebar,
|
|
18176
18362
|
{
|
|
18177
18363
|
parentRef: containerRef,
|
|
@@ -18182,7 +18368,7 @@ var JournalTableWithPanel = ({
|
|
|
18182
18368
|
sidebarIsOpen: Boolean(selectedEntryId),
|
|
18183
18369
|
parentRef: containerRef
|
|
18184
18370
|
},
|
|
18185
|
-
/* @__PURE__ */
|
|
18371
|
+
/* @__PURE__ */ React210.createElement(
|
|
18186
18372
|
Header2,
|
|
18187
18373
|
{
|
|
18188
18374
|
className: `Layer__${COMPONENT_NAME6}__header`,
|
|
@@ -18190,7 +18376,7 @@ var JournalTableWithPanel = ({
|
|
|
18190
18376
|
sticky: true,
|
|
18191
18377
|
rounded: true
|
|
18192
18378
|
},
|
|
18193
|
-
/* @__PURE__ */
|
|
18379
|
+
/* @__PURE__ */ React210.createElement(HeaderRow, null, /* @__PURE__ */ React210.createElement(HeaderCol, null, /* @__PURE__ */ React210.createElement(
|
|
18194
18380
|
Heading,
|
|
18195
18381
|
{
|
|
18196
18382
|
className: `Layer__${COMPONENT_NAME6}__title`,
|
|
@@ -18199,25 +18385,30 @@ var JournalTableWithPanel = ({
|
|
|
18199
18385
|
(stringOverrides == null ? void 0 : stringOverrides.componentTitle) || "Journal"
|
|
18200
18386
|
)))
|
|
18201
18387
|
),
|
|
18202
|
-
/* @__PURE__ */
|
|
18388
|
+
/* @__PURE__ */ React210.createElement(Header2, null, /* @__PURE__ */ React210.createElement(HeaderRow, null, /* @__PURE__ */ React210.createElement(HeaderCol, null, /* @__PURE__ */ React210.createElement(
|
|
18203
18389
|
Heading,
|
|
18204
18390
|
{
|
|
18205
18391
|
size: "secondary" /* secondary */,
|
|
18206
18392
|
className: `Layer__${COMPONENT_NAME6}__subtitle`
|
|
18207
18393
|
},
|
|
18208
18394
|
(stringOverrides == null ? void 0 : stringOverrides.componentSubtitle) || "Entries"
|
|
18209
|
-
)), /* @__PURE__ */
|
|
18395
|
+
)), /* @__PURE__ */ React210.createElement(HeaderCol, null, /* @__PURE__ */ React210.createElement(
|
|
18396
|
+
JournalEntriesDownloadButton,
|
|
18397
|
+
{
|
|
18398
|
+
iconOnly: ["mobile", "tablet"].includes(view)
|
|
18399
|
+
}
|
|
18400
|
+
), /* @__PURE__ */ React210.createElement(
|
|
18210
18401
|
Button,
|
|
18211
18402
|
{
|
|
18212
18403
|
onClick: () => addEntry(),
|
|
18213
18404
|
disabled: isLoading,
|
|
18214
18405
|
iconOnly: view === "mobile",
|
|
18215
|
-
leftIcon: view === "mobile" && /* @__PURE__ */
|
|
18406
|
+
leftIcon: view === "mobile" && /* @__PURE__ */ React210.createElement(PlusIcon_default, { size: 14 })
|
|
18216
18407
|
},
|
|
18217
18408
|
(stringOverrides == null ? void 0 : stringOverrides.addEntryButton) || "Add Entry"
|
|
18218
18409
|
)))),
|
|
18219
|
-
data && /* @__PURE__ */
|
|
18220
|
-
data && /* @__PURE__ */
|
|
18410
|
+
data && /* @__PURE__ */ React210.createElement(JournalTable, { view: "desktop", data }),
|
|
18411
|
+
data && /* @__PURE__ */ React210.createElement("div", { className: "Layer__journal__pagination" }, /* @__PURE__ */ React210.createElement(
|
|
18221
18412
|
Pagination,
|
|
18222
18413
|
{
|
|
18223
18414
|
currentPage,
|
|
@@ -18226,7 +18417,7 @@ var JournalTableWithPanel = ({
|
|
|
18226
18417
|
onPageChange: (page) => setCurrentPage(page)
|
|
18227
18418
|
}
|
|
18228
18419
|
)),
|
|
18229
|
-
(data == null ? void 0 : data.length) === 0 && !isLoading && !error && /* @__PURE__ */
|
|
18420
|
+
(data == null ? void 0 : data.length) === 0 && !isLoading && !error && /* @__PURE__ */ React210.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React210.createElement(
|
|
18230
18421
|
DataState,
|
|
18231
18422
|
{
|
|
18232
18423
|
status: "allDone" /* allDone */,
|
|
@@ -18234,7 +18425,7 @@ var JournalTableWithPanel = ({
|
|
|
18234
18425
|
description: "There are no entries in the journal."
|
|
18235
18426
|
}
|
|
18236
18427
|
)),
|
|
18237
|
-
error ? /* @__PURE__ */
|
|
18428
|
+
error ? /* @__PURE__ */ React210.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React210.createElement(
|
|
18238
18429
|
DataState,
|
|
18239
18430
|
{
|
|
18240
18431
|
status: "failed" /* failed */,
|
|
@@ -18244,7 +18435,7 @@ var JournalTableWithPanel = ({
|
|
|
18244
18435
|
isLoading: isValidating || isLoading
|
|
18245
18436
|
}
|
|
18246
18437
|
)) : null,
|
|
18247
|
-
(!data || isLoading) && !error ? /* @__PURE__ */
|
|
18438
|
+
(!data || isLoading) && !error ? /* @__PURE__ */ React210.createElement("div", { className: `Layer__${COMPONENT_NAME6}__loader-container` }, /* @__PURE__ */ React210.createElement(Loader2, null)) : null
|
|
18248
18439
|
);
|
|
18249
18440
|
};
|
|
18250
18441
|
|
|
@@ -18257,7 +18448,7 @@ var JOURNAL_CONFIG = {
|
|
|
18257
18448
|
var Journal = (props) => {
|
|
18258
18449
|
const JournalContextData = useJournal();
|
|
18259
18450
|
const AccountsContextData = useChartOfAccounts();
|
|
18260
|
-
return /* @__PURE__ */
|
|
18451
|
+
return /* @__PURE__ */ React211.createElement(ChartOfAccountsContext.Provider, { value: AccountsContextData }, /* @__PURE__ */ React211.createElement(JournalContext.Provider, { value: JournalContextData }, /* @__PURE__ */ React211.createElement(JournalContent, __spreadValues({}, props))));
|
|
18261
18452
|
};
|
|
18262
18453
|
var JournalContent = ({
|
|
18263
18454
|
asWidget,
|
|
@@ -18265,7 +18456,7 @@ var JournalContent = ({
|
|
|
18265
18456
|
stringOverrides
|
|
18266
18457
|
}) => {
|
|
18267
18458
|
const { view, containerRef } = useElementViewSize();
|
|
18268
|
-
return /* @__PURE__ */
|
|
18459
|
+
return /* @__PURE__ */ React211.createElement(Container, { name: "journal", ref: containerRef, asWidget }, /* @__PURE__ */ React211.createElement(
|
|
18269
18460
|
JournalTableWithPanel,
|
|
18270
18461
|
{
|
|
18271
18462
|
view,
|
|
@@ -18277,7 +18468,7 @@ var JournalContent = ({
|
|
|
18277
18468
|
};
|
|
18278
18469
|
|
|
18279
18470
|
// src/components/Tasks/Tasks.tsx
|
|
18280
|
-
import
|
|
18471
|
+
import React220, {
|
|
18281
18472
|
createContext as createContext20,
|
|
18282
18473
|
useContext as useContext47,
|
|
18283
18474
|
useEffect as useEffect48,
|
|
@@ -18491,13 +18682,13 @@ var useTasks = ({
|
|
|
18491
18682
|
};
|
|
18492
18683
|
|
|
18493
18684
|
// src/components/TasksHeader/TasksHeader.tsx
|
|
18494
|
-
import
|
|
18685
|
+
import React213, { useContext as useContext43 } from "react";
|
|
18495
18686
|
|
|
18496
18687
|
// src/icons/ProgressIcon.tsx
|
|
18497
|
-
import * as
|
|
18688
|
+
import * as React212 from "react";
|
|
18498
18689
|
var ProgressIcon = (_a) => {
|
|
18499
18690
|
var _b = _a, { size = 12 } = _b, props = __objRest(_b, ["size"]);
|
|
18500
|
-
return /* @__PURE__ */
|
|
18691
|
+
return /* @__PURE__ */ React212.createElement(
|
|
18501
18692
|
"svg",
|
|
18502
18693
|
__spreadProps(__spreadValues({
|
|
18503
18694
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -18507,7 +18698,7 @@ var ProgressIcon = (_a) => {
|
|
|
18507
18698
|
width: size,
|
|
18508
18699
|
height: size
|
|
18509
18700
|
}),
|
|
18510
|
-
/* @__PURE__ */
|
|
18701
|
+
/* @__PURE__ */ React212.createElement(
|
|
18511
18702
|
"path",
|
|
18512
18703
|
{
|
|
18513
18704
|
d: "M9 1.5V4.5",
|
|
@@ -18516,7 +18707,7 @@ var ProgressIcon = (_a) => {
|
|
|
18516
18707
|
strokeLinejoin: "round"
|
|
18517
18708
|
}
|
|
18518
18709
|
),
|
|
18519
|
-
/* @__PURE__ */
|
|
18710
|
+
/* @__PURE__ */ React212.createElement(
|
|
18520
18711
|
"path",
|
|
18521
18712
|
{
|
|
18522
18713
|
d: "M9 13.5V16.5",
|
|
@@ -18525,7 +18716,7 @@ var ProgressIcon = (_a) => {
|
|
|
18525
18716
|
strokeLinejoin: "round"
|
|
18526
18717
|
}
|
|
18527
18718
|
),
|
|
18528
|
-
/* @__PURE__ */
|
|
18719
|
+
/* @__PURE__ */ React212.createElement(
|
|
18529
18720
|
"path",
|
|
18530
18721
|
{
|
|
18531
18722
|
d: "M3.6975 3.6975L5.82 5.82",
|
|
@@ -18534,7 +18725,7 @@ var ProgressIcon = (_a) => {
|
|
|
18534
18725
|
strokeLinejoin: "round"
|
|
18535
18726
|
}
|
|
18536
18727
|
),
|
|
18537
|
-
/* @__PURE__ */
|
|
18728
|
+
/* @__PURE__ */ React212.createElement(
|
|
18538
18729
|
"path",
|
|
18539
18730
|
{
|
|
18540
18731
|
d: "M12.18 12.18L14.3025 14.3025",
|
|
@@ -18543,7 +18734,7 @@ var ProgressIcon = (_a) => {
|
|
|
18543
18734
|
strokeLinejoin: "round"
|
|
18544
18735
|
}
|
|
18545
18736
|
),
|
|
18546
|
-
/* @__PURE__ */
|
|
18737
|
+
/* @__PURE__ */ React212.createElement(
|
|
18547
18738
|
"path",
|
|
18548
18739
|
{
|
|
18549
18740
|
d: "M1.5 9H4.5",
|
|
@@ -18552,7 +18743,7 @@ var ProgressIcon = (_a) => {
|
|
|
18552
18743
|
strokeLinejoin: "round"
|
|
18553
18744
|
}
|
|
18554
18745
|
),
|
|
18555
|
-
/* @__PURE__ */
|
|
18746
|
+
/* @__PURE__ */ React212.createElement(
|
|
18556
18747
|
"path",
|
|
18557
18748
|
{
|
|
18558
18749
|
d: "M13.5 9H16.5",
|
|
@@ -18561,7 +18752,7 @@ var ProgressIcon = (_a) => {
|
|
|
18561
18752
|
strokeLinejoin: "round"
|
|
18562
18753
|
}
|
|
18563
18754
|
),
|
|
18564
|
-
/* @__PURE__ */
|
|
18755
|
+
/* @__PURE__ */ React212.createElement(
|
|
18565
18756
|
"path",
|
|
18566
18757
|
{
|
|
18567
18758
|
d: "M3.6975 14.3025L5.82 12.18",
|
|
@@ -18570,7 +18761,7 @@ var ProgressIcon = (_a) => {
|
|
|
18570
18761
|
strokeLinejoin: "round"
|
|
18571
18762
|
}
|
|
18572
18763
|
),
|
|
18573
|
-
/* @__PURE__ */
|
|
18764
|
+
/* @__PURE__ */ React212.createElement(
|
|
18574
18765
|
"path",
|
|
18575
18766
|
{
|
|
18576
18767
|
d: "M12.18 5.82L14.3025 3.6975",
|
|
@@ -18588,22 +18779,22 @@ import { endOfYear as endOfYear5, getYear as getYear3, startOfYear as startOfYea
|
|
|
18588
18779
|
import classNames66 from "classnames";
|
|
18589
18780
|
var ICONS = {
|
|
18590
18781
|
loading: {
|
|
18591
|
-
icon: /* @__PURE__ */
|
|
18782
|
+
icon: /* @__PURE__ */ React213.createElement(ProgressIcon_default, { size: 12, className: "Layer__anim--rotating" }),
|
|
18592
18783
|
text: "Loading",
|
|
18593
18784
|
badge: "default" /* DEFAULT */
|
|
18594
18785
|
},
|
|
18595
18786
|
done: {
|
|
18596
|
-
icon: /* @__PURE__ */
|
|
18787
|
+
icon: /* @__PURE__ */ React213.createElement(Check_default, { size: 12 }),
|
|
18597
18788
|
text: "Done",
|
|
18598
18789
|
badge: "success" /* SUCCESS */
|
|
18599
18790
|
},
|
|
18600
18791
|
pending: {
|
|
18601
|
-
icon: /* @__PURE__ */
|
|
18792
|
+
icon: /* @__PURE__ */ React213.createElement(AlertCircle_default, { size: 12 }),
|
|
18602
18793
|
text: "In progress",
|
|
18603
18794
|
badge: "warning" /* WARNING */
|
|
18604
18795
|
},
|
|
18605
18796
|
refresh: {
|
|
18606
|
-
icon: /* @__PURE__ */
|
|
18797
|
+
icon: /* @__PURE__ */ React213.createElement(RefreshCcw_default, { size: 12 }),
|
|
18607
18798
|
text: "Refresh",
|
|
18608
18799
|
badge: "default" /* DEFAULT */
|
|
18609
18800
|
}
|
|
@@ -18626,7 +18817,7 @@ var TasksHeader = ({
|
|
|
18626
18817
|
const completedTasks = tasks == null ? void 0 : tasks.filter((task) => isComplete(task.status)).length;
|
|
18627
18818
|
const badgeVariant = completedTasks === (tasks == null ? void 0 : tasks.length) ? ICONS.done : ICONS.pending;
|
|
18628
18819
|
const minDate = getEarliestDateToBrowse(business);
|
|
18629
|
-
return /* @__PURE__ */
|
|
18820
|
+
return /* @__PURE__ */ React213.createElement("div", { className: classNames66("Layer__tasks-header", collapsable && "Layer__tasks-header--collapsable") }, /* @__PURE__ */ React213.createElement("div", { className: "Layer__tasks-header__left-col" }, /* @__PURE__ */ React213.createElement("div", { className: "Layer__tasks-header__left-col__title" }, /* @__PURE__ */ React213.createElement(Text, { size: "lg" /* lg */ }, tasksHeader), loadedStatus !== "complete" && !open ? /* @__PURE__ */ React213.createElement(Badge, { variant: ICONS.loading.badge, icon: ICONS.loading.icon }, ICONS.loading.text) : loadedStatus === "complete" && !open && (!tasks || error) ? /* @__PURE__ */ React213.createElement(
|
|
18630
18821
|
Badge,
|
|
18631
18822
|
{
|
|
18632
18823
|
onClick: () => refetch(),
|
|
@@ -18634,7 +18825,7 @@ var TasksHeader = ({
|
|
|
18634
18825
|
icon: ICONS.refresh.icon
|
|
18635
18826
|
},
|
|
18636
18827
|
ICONS.refresh.text
|
|
18637
|
-
) : loadedStatus === "complete" && !open ? /* @__PURE__ */
|
|
18828
|
+
) : loadedStatus === "complete" && !open ? /* @__PURE__ */ React213.createElement(Badge, { variant: badgeVariant.badge, icon: badgeVariant.icon }, badgeVariant.text) : open ? null : /* @__PURE__ */ React213.createElement(Badge, { variant: badgeVariant.badge, icon: badgeVariant.icon }, badgeVariant.text)), /* @__PURE__ */ React213.createElement("div", { className: "Layer__tasks-header__left-col__controls" }, /* @__PURE__ */ React213.createElement(
|
|
18638
18829
|
DatePicker,
|
|
18639
18830
|
{
|
|
18640
18831
|
selected: dateRange.startDate,
|
|
@@ -18654,17 +18845,17 @@ var TasksHeader = ({
|
|
|
18654
18845
|
navigateArrows: ["mobile", "desktop"],
|
|
18655
18846
|
disabled: minDate && getYear3(minDate) === getYear3(/* @__PURE__ */ new Date())
|
|
18656
18847
|
}
|
|
18657
|
-
), collapsable && /* @__PURE__ */
|
|
18848
|
+
), collapsable && /* @__PURE__ */ React213.createElement("div", { className: "Layer__tasks-header__left-col__expand" }, /* @__PURE__ */ React213.createElement(ExpandButton, { onClick: toggleContent, collapsed: !open })))));
|
|
18658
18849
|
};
|
|
18659
18850
|
|
|
18660
18851
|
// src/components/TasksList/TasksList.tsx
|
|
18661
|
-
import
|
|
18852
|
+
import React216, { useContext as useContext45, useMemo as useMemo33, useState as useState59 } from "react";
|
|
18662
18853
|
|
|
18663
18854
|
// src/icons/SmileIcon.tsx
|
|
18664
|
-
import * as
|
|
18855
|
+
import * as React214 from "react";
|
|
18665
18856
|
var SmileIcon = (_a) => {
|
|
18666
18857
|
var _b = _a, { size = 12 } = _b, props = __objRest(_b, ["size"]);
|
|
18667
|
-
return /* @__PURE__ */
|
|
18858
|
+
return /* @__PURE__ */ React214.createElement(
|
|
18668
18859
|
"svg",
|
|
18669
18860
|
__spreadProps(__spreadValues({
|
|
18670
18861
|
viewBox: "0 0 12 12",
|
|
@@ -18674,7 +18865,7 @@ var SmileIcon = (_a) => {
|
|
|
18674
18865
|
width: size,
|
|
18675
18866
|
height: size
|
|
18676
18867
|
}),
|
|
18677
|
-
/* @__PURE__ */
|
|
18868
|
+
/* @__PURE__ */ React214.createElement(
|
|
18678
18869
|
"path",
|
|
18679
18870
|
{
|
|
18680
18871
|
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",
|
|
@@ -18683,7 +18874,7 @@ var SmileIcon = (_a) => {
|
|
|
18683
18874
|
strokeLinejoin: "round"
|
|
18684
18875
|
}
|
|
18685
18876
|
),
|
|
18686
|
-
/* @__PURE__ */
|
|
18877
|
+
/* @__PURE__ */ React214.createElement(
|
|
18687
18878
|
"path",
|
|
18688
18879
|
{
|
|
18689
18880
|
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",
|
|
@@ -18692,7 +18883,7 @@ var SmileIcon = (_a) => {
|
|
|
18692
18883
|
strokeLinejoin: "round"
|
|
18693
18884
|
}
|
|
18694
18885
|
),
|
|
18695
|
-
/* @__PURE__ */
|
|
18886
|
+
/* @__PURE__ */ React214.createElement(
|
|
18696
18887
|
"path",
|
|
18697
18888
|
{
|
|
18698
18889
|
d: "M5 5H5.005",
|
|
@@ -18701,7 +18892,7 @@ var SmileIcon = (_a) => {
|
|
|
18701
18892
|
strokeLinejoin: "round"
|
|
18702
18893
|
}
|
|
18703
18894
|
),
|
|
18704
|
-
/* @__PURE__ */
|
|
18895
|
+
/* @__PURE__ */ React214.createElement(
|
|
18705
18896
|
"path",
|
|
18706
18897
|
{
|
|
18707
18898
|
d: "M8 5H8.005",
|
|
@@ -18715,7 +18906,7 @@ var SmileIcon = (_a) => {
|
|
|
18715
18906
|
var SmileIcon_default = SmileIcon;
|
|
18716
18907
|
|
|
18717
18908
|
// src/components/TasksListItem/TasksListItem.tsx
|
|
18718
|
-
import
|
|
18909
|
+
import React215, { useContext as useContext44, useEffect as useEffect47, useMemo as useMemo32, useState as useState58 } from "react";
|
|
18719
18910
|
import classNames67 from "classnames";
|
|
18720
18911
|
var TasksListItem = ({
|
|
18721
18912
|
task,
|
|
@@ -18752,7 +18943,7 @@ var TasksListItem = ({
|
|
|
18752
18943
|
if (task.user_response_type === "UPLOAD_DOCUMENT") {
|
|
18753
18944
|
if (task.status === "TODO") {
|
|
18754
18945
|
if (!selectedFiles) {
|
|
18755
|
-
return /* @__PURE__ */
|
|
18946
|
+
return /* @__PURE__ */ React215.createElement(
|
|
18756
18947
|
FileInput,
|
|
18757
18948
|
{
|
|
18758
18949
|
onUpload: (files) => {
|
|
@@ -18763,10 +18954,19 @@ var TasksListItem = ({
|
|
|
18763
18954
|
}
|
|
18764
18955
|
);
|
|
18765
18956
|
} else {
|
|
18766
|
-
return /* @__PURE__ */
|
|
18957
|
+
return /* @__PURE__ */ React215.createElement(React215.Fragment, null, /* @__PURE__ */ React215.createElement(
|
|
18767
18958
|
Button,
|
|
18768
18959
|
{
|
|
18769
18960
|
variant: "secondary" /* secondary */,
|
|
18961
|
+
onClick: () => __async(void 0, null, function* () {
|
|
18962
|
+
setSelectedFiles(void 0);
|
|
18963
|
+
})
|
|
18964
|
+
},
|
|
18965
|
+
"Cancel"
|
|
18966
|
+
), /* @__PURE__ */ React215.createElement(
|
|
18967
|
+
Button,
|
|
18968
|
+
{
|
|
18969
|
+
variant: "primary" /* primary */,
|
|
18770
18970
|
onClick: () => __async(void 0, null, function* () {
|
|
18771
18971
|
yield uploadDocumentsForTask(task.id, selectedFiles, userResponse);
|
|
18772
18972
|
setIsOpen(false);
|
|
@@ -18775,11 +18975,11 @@ var TasksListItem = ({
|
|
|
18775
18975
|
})
|
|
18776
18976
|
},
|
|
18777
18977
|
"Submit"
|
|
18778
|
-
);
|
|
18978
|
+
));
|
|
18779
18979
|
}
|
|
18780
18980
|
} else if (task.status === "USER_MARKED_COMPLETED") {
|
|
18781
18981
|
if (task.user_response && task.user_response != userResponse) {
|
|
18782
|
-
return /* @__PURE__ */
|
|
18982
|
+
return /* @__PURE__ */ React215.createElement(
|
|
18783
18983
|
Button,
|
|
18784
18984
|
{
|
|
18785
18985
|
variant: "secondary" /* secondary */,
|
|
@@ -18790,7 +18990,7 @@ var TasksListItem = ({
|
|
|
18790
18990
|
"Update"
|
|
18791
18991
|
);
|
|
18792
18992
|
} else {
|
|
18793
|
-
return /* @__PURE__ */
|
|
18993
|
+
return /* @__PURE__ */ React215.createElement(
|
|
18794
18994
|
Button,
|
|
18795
18995
|
{
|
|
18796
18996
|
variant: "secondary" /* secondary */,
|
|
@@ -18806,14 +19006,14 @@ var TasksListItem = ({
|
|
|
18806
19006
|
}
|
|
18807
19007
|
}
|
|
18808
19008
|
}, [task, selectedFiles, userResponse]);
|
|
18809
|
-
return /* @__PURE__ */
|
|
19009
|
+
return /* @__PURE__ */ React215.createElement("div", { className: "Layer__tasks-list-item-wrapper" }, /* @__PURE__ */ React215.createElement("div", { className: taskItemClassName }, /* @__PURE__ */ React215.createElement(
|
|
18810
19010
|
"div",
|
|
18811
19011
|
{
|
|
18812
19012
|
className: "Layer__tasks-list-item__head",
|
|
18813
19013
|
onClick: () => setIsOpen(!isOpen)
|
|
18814
19014
|
},
|
|
18815
|
-
/* @__PURE__ */
|
|
18816
|
-
/* @__PURE__ */
|
|
19015
|
+
/* @__PURE__ */ React215.createElement("div", { className: taskHeadClassName }, /* @__PURE__ */ React215.createElement("div", { className: "Layer__tasks-list-item__head-info__status" }, isComplete(task.status) ? /* @__PURE__ */ React215.createElement(Check_default, { size: 12 }) : /* @__PURE__ */ React215.createElement(AlertCircle_default, { size: 12 })), /* @__PURE__ */ React215.createElement(Text, { size: "md" /* md */ }, task.title)),
|
|
19016
|
+
/* @__PURE__ */ React215.createElement(
|
|
18817
19017
|
ChevronDownFill_default,
|
|
18818
19018
|
{
|
|
18819
19019
|
size: 16,
|
|
@@ -18823,14 +19023,14 @@ var TasksListItem = ({
|
|
|
18823
19023
|
}
|
|
18824
19024
|
}
|
|
18825
19025
|
)
|
|
18826
|
-
), /* @__PURE__ */
|
|
19026
|
+
), /* @__PURE__ */ React215.createElement("div", { className: taskBodyClassName }, /* @__PURE__ */ React215.createElement("div", { className: "Layer__tasks-list-item__body-info" }, /* @__PURE__ */ React215.createElement(Text, { size: "sm" /* sm */ }, task.question), /* @__PURE__ */ React215.createElement(
|
|
18827
19027
|
Textarea,
|
|
18828
19028
|
{
|
|
18829
19029
|
value: userResponse,
|
|
18830
19030
|
placeholder: task.user_response_type === "UPLOAD_DOCUMENT" ? "Optional description" : "",
|
|
18831
19031
|
onChange: (e) => setUserResponse(e.target.value)
|
|
18832
19032
|
}
|
|
18833
|
-
), task.user_response_type === "UPLOAD_DOCUMENT" ? /* @__PURE__ */
|
|
19033
|
+
), task.user_response_type === "UPLOAD_DOCUMENT" ? /* @__PURE__ */ React215.createElement("div", { className: "Layer__tasks-list__link-list" }, selectedFiles ? /* @__PURE__ */ React215.createElement("div", { className: "Layer__tasks-list__link-list-header" }, "Selected Files:") : task.documents ? /* @__PURE__ */ React215.createElement("div", { className: "Layer__tasks-list__link-list-header" }, "Uploaded Files:") : null, /* @__PURE__ */ React215.createElement("ul", { className: "Layer__tasks-list__links-list" }, (_a = task.documents) == null ? void 0 : _a.map((document2, idx) => /* @__PURE__ */ React215.createElement("li", { key: `uploaded-doc-name-${idx}` }, /* @__PURE__ */ React215.createElement("a", { className: "Layer__tasks-list-item__link", href: document2.presigned_url.presignedUrl }, document2.file_name))), selectedFiles == null ? void 0 : selectedFiles.map((file, idx) => /* @__PURE__ */ React215.createElement("li", { key: `selected-file-name-${idx}` }, /* @__PURE__ */ React215.createElement("a", { className: "Layer__tasks-list-item__link" }, file.name))))) : null, /* @__PURE__ */ React215.createElement("div", { className: "Layer__tasks-list-item__actions" }, task.user_response_type === "UPLOAD_DOCUMENT" ? uploadDocumentAction : /* @__PURE__ */ React215.createElement(
|
|
18834
19034
|
Button,
|
|
18835
19035
|
{
|
|
18836
19036
|
disabled: userResponse.length === 0 || userResponse === task.user_response,
|
|
@@ -18855,7 +19055,7 @@ function paginateArray(array, chunkSize = 10) {
|
|
|
18855
19055
|
}
|
|
18856
19056
|
return result;
|
|
18857
19057
|
}
|
|
18858
|
-
var TasksEmptyState = () => /* @__PURE__ */
|
|
19058
|
+
var TasksEmptyState = () => /* @__PURE__ */ React216.createElement("div", { className: "Layer__tasks-empty-state" }, /* @__PURE__ */ React216.createElement("div", { className: "Layer__tasks-icon" }, /* @__PURE__ */ React216.createElement(SmileIcon_default, null)), /* @__PURE__ */ React216.createElement(Text, { size: "sm" /* sm */ }, "There are no pending tasks!", /* @__PURE__ */ React216.createElement("br", null), " Great job!"));
|
|
18859
19059
|
var TasksList = ({ pageSize = 10 }) => {
|
|
18860
19060
|
const { data: rawData, error, currentDate } = useContext45(TasksContext);
|
|
18861
19061
|
const tasks = useMemo33(() => {
|
|
@@ -18886,7 +19086,7 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
18886
19086
|
setCurrentPage(currentPage + 1);
|
|
18887
19087
|
}
|
|
18888
19088
|
};
|
|
18889
|
-
return /* @__PURE__ */
|
|
19089
|
+
return /* @__PURE__ */ React216.createElement("div", { className: "Layer__tasks-list" }, sortedTasks && sortedTasks.length > 0 ? /* @__PURE__ */ React216.createElement(React216.Fragment, null, sortedTasks.map((task, index) => /* @__PURE__ */ React216.createElement(
|
|
18890
19090
|
TasksListItem,
|
|
18891
19091
|
{
|
|
18892
19092
|
key: task.id,
|
|
@@ -18894,7 +19094,7 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
18894
19094
|
goToNextPageIfAllComplete: goToNextPage,
|
|
18895
19095
|
defaultOpen: index === indexFirstIncomplete
|
|
18896
19096
|
}
|
|
18897
|
-
)), tasks && tasks.length >= 10 && /* @__PURE__ */
|
|
19097
|
+
)), tasks && tasks.length >= 10 && /* @__PURE__ */ React216.createElement("div", { className: "Layer__tasks__pagination" }, /* @__PURE__ */ React216.createElement(
|
|
18898
19098
|
Pagination,
|
|
18899
19099
|
{
|
|
18900
19100
|
currentPage,
|
|
@@ -18902,11 +19102,11 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
18902
19102
|
pageSize,
|
|
18903
19103
|
onPageChange: (page) => setCurrentPage(page)
|
|
18904
19104
|
}
|
|
18905
|
-
))) : /* @__PURE__ */
|
|
19105
|
+
))) : /* @__PURE__ */ React216.createElement(React216.Fragment, null, error ? /* @__PURE__ */ React216.createElement(ErrorText, null, "Approval failed. Check connection and retry in few seconds.") : /* @__PURE__ */ React216.createElement(TasksEmptyState, null)));
|
|
18906
19106
|
};
|
|
18907
19107
|
|
|
18908
19108
|
// src/components/TasksPending/TasksPending.tsx
|
|
18909
|
-
import
|
|
19109
|
+
import React217, { useContext as useContext46, useMemo as useMemo34 } from "react";
|
|
18910
19110
|
import classNames68 from "classnames";
|
|
18911
19111
|
import { endOfMonth as endOfMonth16, format as format7, isAfter as isAfter2, isBefore as isBefore2, parseISO as parseISO17, startOfMonth as startOfMonth18 } from "date-fns";
|
|
18912
19112
|
import { Cell as Cell4, Pie as Pie3, PieChart as PieChart4 } from "recharts";
|
|
@@ -18932,7 +19132,7 @@ var TasksPending = () => {
|
|
|
18932
19132
|
const taskStatusClassName = classNames68(
|
|
18933
19133
|
completedTasks && completedTasks > 0 ? "Layer__tasks-pending-bar__status--done" : "Layer__tasks-pending-bar__status--pending"
|
|
18934
19134
|
);
|
|
18935
|
-
return /* @__PURE__ */
|
|
19135
|
+
return /* @__PURE__ */ React217.createElement("div", { className: "Layer__tasks-pending" }, /* @__PURE__ */ React217.createElement(Text, { size: "lg" /* lg */ }, format7(currentDate, "MMMM")), data && (data == null ? void 0 : data.length) > 0 ? /* @__PURE__ */ React217.createElement("div", { className: "Layer__tasks-pending-bar" }, /* @__PURE__ */ React217.createElement(Text, { size: "sm" /* sm */ }, /* @__PURE__ */ React217.createElement("span", { className: taskStatusClassName }, completedTasks), "/", data == null ? void 0 : data.length, " done"), /* @__PURE__ */ React217.createElement(PieChart4, { width: 24, height: 24, className: "mini-chart" }, /* @__PURE__ */ React217.createElement(
|
|
18936
19136
|
Pie3,
|
|
18937
19137
|
{
|
|
18938
19138
|
data: chartData,
|
|
@@ -18950,7 +19150,7 @@ var TasksPending = () => {
|
|
|
18950
19150
|
animationEasing: "ease-in-out"
|
|
18951
19151
|
},
|
|
18952
19152
|
chartData.map((task, index) => {
|
|
18953
|
-
return /* @__PURE__ */
|
|
19153
|
+
return /* @__PURE__ */ React217.createElement(
|
|
18954
19154
|
Cell4,
|
|
18955
19155
|
{
|
|
18956
19156
|
key: `cell-${index}`,
|
|
@@ -18963,11 +19163,11 @@ var TasksPending = () => {
|
|
|
18963
19163
|
};
|
|
18964
19164
|
|
|
18965
19165
|
// src/components/TasksMonthSelector/TasksMonthSelector.tsx
|
|
18966
|
-
import
|
|
19166
|
+
import React219, { useMemo as useMemo35 } from "react";
|
|
18967
19167
|
import { endOfMonth as endOfMonth17, format as format8, getMonth as getMonth3, getYear as getYear4, isAfter as isAfter3, isBefore as isBefore3, set, startOfMonth as startOfMonth19 } from "date-fns";
|
|
18968
19168
|
|
|
18969
19169
|
// src/components/TasksMonthSelector/TaskMonthTile.tsx
|
|
18970
|
-
import
|
|
19170
|
+
import React218 from "react";
|
|
18971
19171
|
import classNames69 from "classnames";
|
|
18972
19172
|
var TaskMonthTile = ({ monthData, onClick, active, disabled }) => {
|
|
18973
19173
|
const isCompleted = monthData.total === monthData.completed;
|
|
@@ -18977,7 +19177,7 @@ var TaskMonthTile = ({ monthData, onClick, active, disabled }) => {
|
|
|
18977
19177
|
active && "Layer__tasks-month-selector__month--active",
|
|
18978
19178
|
disabled && "Layer__tasks-month-selector__month--disabled"
|
|
18979
19179
|
);
|
|
18980
|
-
return /* @__PURE__ */
|
|
19180
|
+
return /* @__PURE__ */ React218.createElement("div", { className: baseClass, onClick: () => !disabled && onClick(monthData.startDate) }, /* @__PURE__ */ React218.createElement(Text, { size: "sm" /* sm */, className: "Layer__tasks-month-selector__month__str" }, monthData.monthStr), /* @__PURE__ */ React218.createElement(Text, { size: "sm" /* sm */, className: "Layer__tasks-month-selector__month__total" }, monthData.total > 0 && isCompleted ? monthData.total : ""), isCompleted && monthData.total > 0 && /* @__PURE__ */ React218.createElement("span", { className: "Layer__tasks-month-selector__month__completed" }, /* @__PURE__ */ React218.createElement(Check_default, { size: 12 })), !isCompleted && monthData.total > 0 && /* @__PURE__ */ React218.createElement("span", { className: "Layer__tasks-month-selector__month__incompleted" }, /* @__PURE__ */ React218.createElement(Text, { size: "sm" /* sm */ }, monthData.total), /* @__PURE__ */ React218.createElement(AlertCircle_default, { size: 12 })));
|
|
18981
19181
|
};
|
|
18982
19182
|
|
|
18983
19183
|
// src/components/TasksMonthSelector/TasksMonthSelector.tsx
|
|
@@ -19022,8 +19222,8 @@ var TasksMonthSelector = ({ tasks, year, currentDate, onClick }) => {
|
|
|
19022
19222
|
}, taskData);
|
|
19023
19223
|
});
|
|
19024
19224
|
}, [tasks, year, minDate]);
|
|
19025
|
-
return /* @__PURE__ */
|
|
19026
|
-
return /* @__PURE__ */
|
|
19225
|
+
return /* @__PURE__ */ React219.createElement("div", { className: "Layer__tasks-month-selector" }, months.map((month, idx) => {
|
|
19226
|
+
return /* @__PURE__ */ React219.createElement(
|
|
19027
19227
|
TaskMonthTile,
|
|
19028
19228
|
{
|
|
19029
19229
|
key: idx,
|
|
@@ -19069,7 +19269,7 @@ var Tasks = ({
|
|
|
19069
19269
|
// deprecated
|
|
19070
19270
|
stringOverrides
|
|
19071
19271
|
}) => {
|
|
19072
|
-
return /* @__PURE__ */
|
|
19272
|
+
return /* @__PURE__ */ React220.createElement(TasksProvider, null, /* @__PURE__ */ React220.createElement(
|
|
19073
19273
|
TasksComponent,
|
|
19074
19274
|
{
|
|
19075
19275
|
collapsable,
|
|
@@ -19082,7 +19282,7 @@ var Tasks = ({
|
|
|
19082
19282
|
};
|
|
19083
19283
|
var TasksProvider = ({ children }) => {
|
|
19084
19284
|
const contextData = useTasks();
|
|
19085
|
-
return /* @__PURE__ */
|
|
19285
|
+
return /* @__PURE__ */ React220.createElement(TasksContext.Provider, { value: contextData }, children);
|
|
19086
19286
|
};
|
|
19087
19287
|
var TasksComponent = ({
|
|
19088
19288
|
collapsable = false,
|
|
@@ -19118,7 +19318,7 @@ var TasksComponent = ({
|
|
|
19118
19318
|
setOpen(false);
|
|
19119
19319
|
}
|
|
19120
19320
|
}, [allComplete]);
|
|
19121
|
-
return /* @__PURE__ */
|
|
19321
|
+
return /* @__PURE__ */ React220.createElement("div", { className: "Layer__tasks-component" }, /* @__PURE__ */ React220.createElement(
|
|
19122
19322
|
TasksHeader,
|
|
19123
19323
|
{
|
|
19124
19324
|
tasksHeader: (stringOverrides == null ? void 0 : stringOverrides.header) || tasksHeader,
|
|
@@ -19126,7 +19326,7 @@ var TasksComponent = ({
|
|
|
19126
19326
|
open,
|
|
19127
19327
|
toggleContent: () => setOpen(!open)
|
|
19128
19328
|
}
|
|
19129
|
-
), /* @__PURE__ */
|
|
19329
|
+
), /* @__PURE__ */ React220.createElement(
|
|
19130
19330
|
"div",
|
|
19131
19331
|
{
|
|
19132
19332
|
className: classNames70(
|
|
@@ -19134,7 +19334,7 @@ var TasksComponent = ({
|
|
|
19134
19334
|
!open && "Layer__tasks__content--collapsed"
|
|
19135
19335
|
)
|
|
19136
19336
|
},
|
|
19137
|
-
isLoading || !data ? /* @__PURE__ */
|
|
19337
|
+
isLoading || !data ? /* @__PURE__ */ React220.createElement("div", { className: "Layer__tasks__loader-container" }, /* @__PURE__ */ React220.createElement(Loader2, null)) : /* @__PURE__ */ React220.createElement(React220.Fragment, null, /* @__PURE__ */ React220.createElement(
|
|
19138
19338
|
TasksMonthSelector,
|
|
19139
19339
|
{
|
|
19140
19340
|
tasks: monthlyData,
|
|
@@ -19142,21 +19342,21 @@ var TasksComponent = ({
|
|
|
19142
19342
|
onClick: setCurrentDate,
|
|
19143
19343
|
year: getYear5(dateRange.startDate)
|
|
19144
19344
|
}
|
|
19145
|
-
), /* @__PURE__ */
|
|
19345
|
+
), /* @__PURE__ */ React220.createElement(TasksPending, null), /* @__PURE__ */ React220.createElement(TasksList, null))
|
|
19146
19346
|
));
|
|
19147
19347
|
};
|
|
19148
19348
|
|
|
19149
19349
|
// src/components/PlatformOnboarding/LinkAccounts.tsx
|
|
19150
|
-
import
|
|
19350
|
+
import React221, { useContext as useContext48, useMemo as useMemo37 } from "react";
|
|
19151
19351
|
var LinkAccounts = (_a) => {
|
|
19152
19352
|
var _b = _a, { inBox } = _b, props = __objRest(_b, ["inBox"]);
|
|
19153
19353
|
const content = useMemo37(() => {
|
|
19154
19354
|
if (inBox) {
|
|
19155
|
-
return /* @__PURE__ */
|
|
19355
|
+
return /* @__PURE__ */ React221.createElement("div", { className: "Layer__link-accounts__box" }, /* @__PURE__ */ React221.createElement(LinkAccountsContent, __spreadValues({}, props)));
|
|
19156
19356
|
}
|
|
19157
|
-
return /* @__PURE__ */
|
|
19357
|
+
return /* @__PURE__ */ React221.createElement(LinkAccountsContent, __spreadValues({}, props));
|
|
19158
19358
|
}, [inBox, props]);
|
|
19159
|
-
return /* @__PURE__ */
|
|
19359
|
+
return /* @__PURE__ */ React221.createElement(LinkedAccountsProvider, null, content);
|
|
19160
19360
|
};
|
|
19161
19361
|
var LinkAccountsContent = ({
|
|
19162
19362
|
title,
|
|
@@ -19171,7 +19371,7 @@ var LinkAccountsContent = ({
|
|
|
19171
19371
|
}) => {
|
|
19172
19372
|
var _a;
|
|
19173
19373
|
const { data, loadingStatus, error, refetchAccounts, addConnection } = useContext48(LinkedAccountsContext);
|
|
19174
|
-
return /* @__PURE__ */
|
|
19374
|
+
return /* @__PURE__ */ React221.createElement("div", { className: "Layer__link-accounts Layer__component" }, title && /* @__PURE__ */ React221.createElement(Heading, { size: "view" /* view */ }, title), data && data.length === 0 ? /* @__PURE__ */ React221.createElement("div", { className: "Layer__link-accounts__data-status-container" }, !hideLoading && loadingStatus !== "complete" ? /* @__PURE__ */ React221.createElement(Loader2, null) : null, Boolean(error) && /* @__PURE__ */ React221.createElement(
|
|
19175
19375
|
DataState,
|
|
19176
19376
|
{
|
|
19177
19377
|
status: "failed" /* failed */,
|
|
@@ -19179,7 +19379,7 @@ var LinkAccountsContent = ({
|
|
|
19179
19379
|
description: "Please try again later",
|
|
19180
19380
|
onRefresh: refetchAccounts
|
|
19181
19381
|
}
|
|
19182
|
-
)) : null, data && data.length > 0 ? /* @__PURE__ */
|
|
19382
|
+
)) : null, data && data.length > 0 ? /* @__PURE__ */ React221.createElement("div", { className: "Layer__link-accounts__list" }, data == null ? void 0 : data.map((account, index) => /* @__PURE__ */ React221.createElement(
|
|
19183
19383
|
LinkedAccountItemThumb,
|
|
19184
19384
|
{
|
|
19185
19385
|
key: index,
|
|
@@ -19189,33 +19389,33 @@ var LinkAccountsContent = ({
|
|
|
19189
19389
|
showBreakConnection,
|
|
19190
19390
|
asWidget
|
|
19191
19391
|
}
|
|
19192
|
-
))) : null, /* @__PURE__ */
|
|
19392
|
+
))) : null, /* @__PURE__ */ React221.createElement(
|
|
19193
19393
|
ActionableRow,
|
|
19194
19394
|
{
|
|
19195
|
-
iconBox: /* @__PURE__ */
|
|
19395
|
+
iconBox: /* @__PURE__ */ React221.createElement(PlaidIcon_default, null),
|
|
19196
19396
|
title: data && data.length > 0 ? "Connect my next business account" : "Connect accounts",
|
|
19197
19397
|
description: "Import data with one simple integration.",
|
|
19198
|
-
button: /* @__PURE__ */
|
|
19398
|
+
button: /* @__PURE__ */ React221.createElement(
|
|
19199
19399
|
Button,
|
|
19200
19400
|
{
|
|
19201
19401
|
onClick: () => addConnection("PLAID"),
|
|
19202
|
-
rightIcon: /* @__PURE__ */
|
|
19402
|
+
rightIcon: /* @__PURE__ */ React221.createElement(Link_default, { size: 12 }),
|
|
19203
19403
|
disabled: loadingStatus !== "complete"
|
|
19204
19404
|
},
|
|
19205
19405
|
data && data.length > 0 ? "Connect next" : "Connect"
|
|
19206
19406
|
)
|
|
19207
19407
|
}
|
|
19208
|
-
), /* @__PURE__ */
|
|
19408
|
+
), /* @__PURE__ */ React221.createElement(LinkedAccountsConfirmationModal, null), onBack || onNext ? /* @__PURE__ */ React221.createElement("div", { className: "Layer__link-accounts__footer" }, onBack && /* @__PURE__ */ React221.createElement(Button, { onClick: onBack, variant: "secondary" /* secondary */ }, (_a = stringOverrides == null ? void 0 : stringOverrides.backButtonText) != null ? _a : "Back"), onNext && /* @__PURE__ */ React221.createElement(Button, { onClick: onNext }, (stringOverrides == null ? void 0 : stringOverrides.nextButtonText) || "I\u2019m done connecting my business accounts")) : null);
|
|
19209
19409
|
};
|
|
19210
19410
|
|
|
19211
19411
|
// src/components/UpsellBanner/BookkeepingUpsellBar.tsx
|
|
19212
|
-
import
|
|
19412
|
+
import React223 from "react";
|
|
19213
19413
|
|
|
19214
19414
|
// src/icons/Coffee.tsx
|
|
19215
|
-
import * as
|
|
19415
|
+
import * as React222 from "react";
|
|
19216
19416
|
var CoffeeIcon = (_a) => {
|
|
19217
19417
|
var _b = _a, { size = 11 } = _b, props = __objRest(_b, ["size"]);
|
|
19218
|
-
return /* @__PURE__ */
|
|
19418
|
+
return /* @__PURE__ */ React222.createElement(
|
|
19219
19419
|
"svg",
|
|
19220
19420
|
__spreadProps(__spreadValues({
|
|
19221
19421
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -19225,7 +19425,7 @@ var CoffeeIcon = (_a) => {
|
|
|
19225
19425
|
width: size,
|
|
19226
19426
|
height: size
|
|
19227
19427
|
}),
|
|
19228
|
-
/* @__PURE__ */
|
|
19428
|
+
/* @__PURE__ */ React222.createElement("g", { clipPath: "url(#clip0_5018_10141)" }, /* @__PURE__ */ React222.createElement(
|
|
19229
19429
|
"path",
|
|
19230
19430
|
{
|
|
19231
19431
|
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",
|
|
@@ -19233,7 +19433,7 @@ var CoffeeIcon = (_a) => {
|
|
|
19233
19433
|
strokeLinecap: "round",
|
|
19234
19434
|
strokeLinejoin: "round"
|
|
19235
19435
|
}
|
|
19236
|
-
), /* @__PURE__ */
|
|
19436
|
+
), /* @__PURE__ */ React222.createElement(
|
|
19237
19437
|
"path",
|
|
19238
19438
|
{
|
|
19239
19439
|
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",
|
|
@@ -19241,7 +19441,7 @@ var CoffeeIcon = (_a) => {
|
|
|
19241
19441
|
strokeLinecap: "round",
|
|
19242
19442
|
strokeLinejoin: "round"
|
|
19243
19443
|
}
|
|
19244
|
-
), /* @__PURE__ */
|
|
19444
|
+
), /* @__PURE__ */ React222.createElement(
|
|
19245
19445
|
"path",
|
|
19246
19446
|
{
|
|
19247
19447
|
d: "M8.75 0.958344V2.33334",
|
|
@@ -19249,7 +19449,7 @@ var CoffeeIcon = (_a) => {
|
|
|
19249
19449
|
strokeLinecap: "round",
|
|
19250
19450
|
strokeLinejoin: "round"
|
|
19251
19451
|
}
|
|
19252
|
-
), /* @__PURE__ */
|
|
19452
|
+
), /* @__PURE__ */ React222.createElement(
|
|
19253
19453
|
"path",
|
|
19254
19454
|
{
|
|
19255
19455
|
d: "M6.91663 0.958344V2.33334",
|
|
@@ -19257,7 +19457,7 @@ var CoffeeIcon = (_a) => {
|
|
|
19257
19457
|
strokeLinecap: "round",
|
|
19258
19458
|
strokeLinejoin: "round"
|
|
19259
19459
|
}
|
|
19260
|
-
), /* @__PURE__ */
|
|
19460
|
+
), /* @__PURE__ */ React222.createElement(
|
|
19261
19461
|
"path",
|
|
19262
19462
|
{
|
|
19263
19463
|
d: "M5.08337 0.958344V2.33334",
|
|
@@ -19266,7 +19466,7 @@ var CoffeeIcon = (_a) => {
|
|
|
19266
19466
|
strokeLinejoin: "round"
|
|
19267
19467
|
}
|
|
19268
19468
|
)),
|
|
19269
|
-
/* @__PURE__ */
|
|
19469
|
+
/* @__PURE__ */ React222.createElement("defs", null, /* @__PURE__ */ React222.createElement("clipPath", { id: "clip0_5018_10141" }, /* @__PURE__ */ React222.createElement(
|
|
19270
19470
|
"rect",
|
|
19271
19471
|
{
|
|
19272
19472
|
width: "11",
|
|
@@ -19284,26 +19484,26 @@ var BookkeepingUpsellBar = ({
|
|
|
19284
19484
|
onClick,
|
|
19285
19485
|
href
|
|
19286
19486
|
}) => {
|
|
19287
|
-
return /* @__PURE__ */
|
|
19487
|
+
return /* @__PURE__ */ React223.createElement("div", { className: "Layer__bar-banner Layer__bar-banner--bookkeeping" }, /* @__PURE__ */ React223.createElement("div", { className: "Layer__bar-banner__left-col" }, /* @__PURE__ */ React223.createElement(IconBox, null, /* @__PURE__ */ React223.createElement(Coffee_default, null)), /* @__PURE__ */ React223.createElement("div", { className: "Layer__bar-banner__text-container" }, /* @__PURE__ */ React223.createElement(Text, { size: "md" /* md */, weight: "bold" /* bold */ }, "Need help with your books?"), /* @__PURE__ */ React223.createElement(
|
|
19288
19488
|
Text,
|
|
19289
19489
|
{
|
|
19290
19490
|
size: "sm" /* sm */,
|
|
19291
19491
|
className: "Layer__bar-banner__text-container__desc"
|
|
19292
19492
|
},
|
|
19293
19493
|
"Order bookkeeping service supported by real humans."
|
|
19294
|
-
))), onClick ? /* @__PURE__ */
|
|
19494
|
+
))), onClick ? /* @__PURE__ */ React223.createElement(Button, { variant: "secondary" /* secondary */, onClick }, "Schedule a demo") : href ? /* @__PURE__ */ React223.createElement(Link2, { href, target: "_blank", variant: "secondary" /* secondary */ }, "Schedule a demo") : null);
|
|
19295
19495
|
};
|
|
19296
19496
|
|
|
19297
19497
|
// src/views/BookkeepingOverview/BookkeepingOverview.tsx
|
|
19298
|
-
import
|
|
19498
|
+
import React225, { useState as useState61 } from "react";
|
|
19299
19499
|
|
|
19300
19500
|
// src/views/BookkeepingOverview/internal/BookkeepingProfitAndLossSummariesContainer.tsx
|
|
19301
|
-
import
|
|
19501
|
+
import React224 from "react";
|
|
19302
19502
|
var CLASS_NAME7 = "Layer__BookkeepingProfitAndLossSummariesContainer";
|
|
19303
19503
|
function BookkeepingProfitAndLossSummariesContainer({
|
|
19304
19504
|
children
|
|
19305
19505
|
}) {
|
|
19306
|
-
return /* @__PURE__ */
|
|
19506
|
+
return /* @__PURE__ */ React224.createElement("div", { className: CLASS_NAME7 }, children);
|
|
19307
19507
|
}
|
|
19308
19508
|
|
|
19309
19509
|
// src/views/BookkeepingOverview/BookkeepingOverview.tsx
|
|
@@ -19318,16 +19518,16 @@ var BookkeepingOverview = ({
|
|
|
19318
19518
|
const [pnlToggle, setPnlToggle] = useState61("expenses");
|
|
19319
19519
|
const [width] = useWindowSize();
|
|
19320
19520
|
const profitAndLossSummariesVariants = (_b = (_a = slotProps == null ? void 0 : slotProps.profitAndLoss) == null ? void 0 : _a.summaries) == null ? void 0 : _b.variants;
|
|
19321
|
-
return /* @__PURE__ */
|
|
19521
|
+
return /* @__PURE__ */ React225.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React225.createElement(TasksProvider, null, /* @__PURE__ */ React225.createElement(
|
|
19322
19522
|
View,
|
|
19323
19523
|
{
|
|
19324
19524
|
viewClassName: "Layer__bookkeeping-overview--view",
|
|
19325
19525
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "Bookkeeping overview",
|
|
19326
19526
|
withSidebar: width > 1100,
|
|
19327
|
-
sidebar: /* @__PURE__ */
|
|
19527
|
+
sidebar: /* @__PURE__ */ React225.createElement(TasksComponent, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.tasks }),
|
|
19328
19528
|
showHeader: showTitle
|
|
19329
19529
|
},
|
|
19330
|
-
width <= 1100 && /* @__PURE__ */
|
|
19530
|
+
width <= 1100 && /* @__PURE__ */ React225.createElement(
|
|
19331
19531
|
TasksComponent,
|
|
19332
19532
|
{
|
|
19333
19533
|
collapsable: true,
|
|
@@ -19335,30 +19535,30 @@ var BookkeepingOverview = ({
|
|
|
19335
19535
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.tasks
|
|
19336
19536
|
}
|
|
19337
19537
|
),
|
|
19338
|
-
/* @__PURE__ */
|
|
19538
|
+
/* @__PURE__ */ React225.createElement(
|
|
19339
19539
|
Container,
|
|
19340
19540
|
{
|
|
19341
19541
|
name: "bookkeeping-overview-profit-and-loss",
|
|
19342
19542
|
asWidget: true,
|
|
19343
19543
|
elevated: true
|
|
19344
19544
|
},
|
|
19345
|
-
/* @__PURE__ */
|
|
19545
|
+
/* @__PURE__ */ React225.createElement(
|
|
19346
19546
|
ProfitAndLoss.Header,
|
|
19347
19547
|
{
|
|
19348
19548
|
text: ((_c = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _c.header) || "Profit & Loss",
|
|
19349
19549
|
withDatePicker: true
|
|
19350
19550
|
}
|
|
19351
19551
|
),
|
|
19352
|
-
/* @__PURE__ */
|
|
19552
|
+
/* @__PURE__ */ React225.createElement(BookkeepingProfitAndLossSummariesContainer, null, /* @__PURE__ */ React225.createElement(
|
|
19353
19553
|
ProfitAndLoss.Summaries,
|
|
19354
19554
|
{
|
|
19355
19555
|
stringOverrides: (_d = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _d.summaries,
|
|
19356
19556
|
variants: profitAndLossSummariesVariants
|
|
19357
19557
|
}
|
|
19358
19558
|
)),
|
|
19359
|
-
/* @__PURE__ */
|
|
19559
|
+
/* @__PURE__ */ React225.createElement(ProfitAndLoss.Chart, null)
|
|
19360
19560
|
),
|
|
19361
|
-
/* @__PURE__ */
|
|
19561
|
+
/* @__PURE__ */ React225.createElement("div", { className: "Layer__bookkeeping-overview-profit-and-loss-charts" }, /* @__PURE__ */ React225.createElement(
|
|
19362
19562
|
Toggle,
|
|
19363
19563
|
{
|
|
19364
19564
|
name: "pnl-detailed-charts",
|
|
@@ -19375,7 +19575,7 @@ var BookkeepingOverview = ({
|
|
|
19375
19575
|
selected: pnlToggle,
|
|
19376
19576
|
onChange: (e) => setPnlToggle(e.target.value)
|
|
19377
19577
|
}
|
|
19378
|
-
), /* @__PURE__ */
|
|
19578
|
+
), /* @__PURE__ */ React225.createElement(
|
|
19379
19579
|
Container,
|
|
19380
19580
|
{
|
|
19381
19581
|
name: classNames71(
|
|
@@ -19383,7 +19583,7 @@ var BookkeepingOverview = ({
|
|
|
19383
19583
|
pnlToggle !== "revenue" && "bookkeeping-overview-profit-and-loss-chart--hidden"
|
|
19384
19584
|
)
|
|
19385
19585
|
},
|
|
19386
|
-
/* @__PURE__ */
|
|
19586
|
+
/* @__PURE__ */ React225.createElement(
|
|
19387
19587
|
ProfitAndLoss.DetailedCharts,
|
|
19388
19588
|
{
|
|
19389
19589
|
scope: "revenue",
|
|
@@ -19391,7 +19591,7 @@ var BookkeepingOverview = ({
|
|
|
19391
19591
|
stringOverrides: (_e = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _e.detailedCharts
|
|
19392
19592
|
}
|
|
19393
19593
|
)
|
|
19394
|
-
), /* @__PURE__ */
|
|
19594
|
+
), /* @__PURE__ */ React225.createElement(
|
|
19395
19595
|
Container,
|
|
19396
19596
|
{
|
|
19397
19597
|
name: classNames71(
|
|
@@ -19399,7 +19599,7 @@ var BookkeepingOverview = ({
|
|
|
19399
19599
|
pnlToggle !== "expenses" && "bookkeeping-overview-profit-and-loss-chart--hidden"
|
|
19400
19600
|
)
|
|
19401
19601
|
},
|
|
19402
|
-
/* @__PURE__ */
|
|
19602
|
+
/* @__PURE__ */ React225.createElement(
|
|
19403
19603
|
ProfitAndLoss.DetailedCharts,
|
|
19404
19604
|
{
|
|
19405
19605
|
scope: "expenses",
|
|
@@ -19412,15 +19612,15 @@ var BookkeepingOverview = ({
|
|
|
19412
19612
|
};
|
|
19413
19613
|
|
|
19414
19614
|
// src/views/AccountingOverview/AccountingOverview.tsx
|
|
19415
|
-
import
|
|
19615
|
+
import React228, { useState as useState63 } from "react";
|
|
19416
19616
|
|
|
19417
19617
|
// src/views/AccountingOverview/internal/TransactionsToReview.tsx
|
|
19418
|
-
import
|
|
19618
|
+
import React227, { useContext as useContext49, useEffect as useEffect49, useState as useState62 } from "react";
|
|
19419
19619
|
|
|
19420
19620
|
// src/components/BadgeLoader/BadgeLoader.tsx
|
|
19421
|
-
import
|
|
19621
|
+
import React226 from "react";
|
|
19422
19622
|
var BadgeLoader = ({ children }) => {
|
|
19423
|
-
return /* @__PURE__ */
|
|
19623
|
+
return /* @__PURE__ */ React226.createElement("span", { className: "Layer__loader Layer__loader--as-badge" }, /* @__PURE__ */ React226.createElement(Loader_default, { size: 11, className: "Layer__anim--rotating" }), children);
|
|
19424
19624
|
};
|
|
19425
19625
|
|
|
19426
19626
|
// src/views/AccountingOverview/internal/TransactionsToReview.tsx
|
|
@@ -19465,33 +19665,33 @@ function TransactionsToReview({
|
|
|
19465
19665
|
verticalGap = "sm";
|
|
19466
19666
|
break;
|
|
19467
19667
|
}
|
|
19468
|
-
return /* @__PURE__ */
|
|
19668
|
+
return /* @__PURE__ */ React227.createElement("div", { onClick, className: CLASS_NAME8 }, /* @__PURE__ */ React227.createElement(VStack, { gap: verticalGap, align: "start" }, /* @__PURE__ */ React227.createElement(ProfitAndLossSummariesHeading, { variants }, "Transactions to review"), loaded === "initial" || loaded === "loading" ? /* @__PURE__ */ React227.createElement(BadgeLoader, null) : null, loaded === "complete" && error ? /* @__PURE__ */ React227.createElement(
|
|
19469
19669
|
Badge,
|
|
19470
19670
|
{
|
|
19471
19671
|
variant: "error" /* ERROR */,
|
|
19472
19672
|
size: "small" /* SMALL */,
|
|
19473
|
-
icon: /* @__PURE__ */
|
|
19673
|
+
icon: /* @__PURE__ */ React227.createElement(RefreshCcw_default, { size: 12 }),
|
|
19474
19674
|
onClick: () => refetch()
|
|
19475
19675
|
},
|
|
19476
19676
|
"Refresh"
|
|
19477
|
-
) : null, loaded === "complete" && !error && toReview > 0 ? /* @__PURE__ */
|
|
19677
|
+
) : null, loaded === "complete" && !error && toReview > 0 ? /* @__PURE__ */ React227.createElement(
|
|
19478
19678
|
Badge,
|
|
19479
19679
|
{
|
|
19480
19680
|
variant: "warning" /* WARNING */,
|
|
19481
19681
|
size: "small" /* SMALL */,
|
|
19482
|
-
icon: /* @__PURE__ */
|
|
19682
|
+
icon: /* @__PURE__ */ React227.createElement(Bell_default, { size: 12 })
|
|
19483
19683
|
},
|
|
19484
19684
|
toReview,
|
|
19485
19685
|
" pending"
|
|
19486
|
-
) : null, loaded === "complete" && !error && toReview === 0 ? /* @__PURE__ */
|
|
19686
|
+
) : null, loaded === "complete" && !error && toReview === 0 ? /* @__PURE__ */ React227.createElement(
|
|
19487
19687
|
Badge,
|
|
19488
19688
|
{
|
|
19489
19689
|
variant: "success" /* SUCCESS */,
|
|
19490
19690
|
size: "small" /* SMALL */,
|
|
19491
|
-
icon: /* @__PURE__ */
|
|
19691
|
+
icon: /* @__PURE__ */ React227.createElement(Check_default, { size: 12 })
|
|
19492
19692
|
},
|
|
19493
19693
|
"All done"
|
|
19494
|
-
) : null), /* @__PURE__ */
|
|
19694
|
+
) : null), /* @__PURE__ */ React227.createElement(IconButton, { icon: /* @__PURE__ */ React227.createElement(ChevronRight_default, null), withBorder: true, onClick }));
|
|
19495
19695
|
}
|
|
19496
19696
|
|
|
19497
19697
|
// src/views/AccountingOverview/AccountingOverview.tsx
|
|
@@ -19512,34 +19712,34 @@ var AccountingOverview = ({
|
|
|
19512
19712
|
var _a, _b, _c, _d, _e;
|
|
19513
19713
|
const [pnlToggle, setPnlToggle] = useState63("expenses");
|
|
19514
19714
|
const profitAndLossSummariesVariants = (_b = (_a = slotProps == null ? void 0 : slotProps.profitAndLoss) == null ? void 0 : _a.summaries) == null ? void 0 : _b.variants;
|
|
19515
|
-
return /* @__PURE__ */
|
|
19715
|
+
return /* @__PURE__ */ React228.createElement(
|
|
19516
19716
|
ProfitAndLoss,
|
|
19517
19717
|
{
|
|
19518
19718
|
asContainer: false,
|
|
19519
19719
|
tagFilter: tagFilter ? { key: tagFilter.tagKey, values: tagFilter.tagValues } : void 0
|
|
19520
19720
|
},
|
|
19521
|
-
/* @__PURE__ */
|
|
19721
|
+
/* @__PURE__ */ React228.createElement(
|
|
19522
19722
|
View,
|
|
19523
19723
|
{
|
|
19524
19724
|
title,
|
|
19525
19725
|
showHeader: showTitle,
|
|
19526
|
-
header: /* @__PURE__ */
|
|
19726
|
+
header: /* @__PURE__ */ React228.createElement(Header2, null, /* @__PURE__ */ React228.createElement(HeaderRow, null, /* @__PURE__ */ React228.createElement(HeaderCol, null, /* @__PURE__ */ React228.createElement(ProfitAndLoss.DatePicker, null))))
|
|
19527
19727
|
},
|
|
19528
|
-
enableOnboarding && /* @__PURE__ */
|
|
19728
|
+
enableOnboarding && /* @__PURE__ */ React228.createElement(
|
|
19529
19729
|
Onboarding,
|
|
19530
19730
|
{
|
|
19531
19731
|
onTransactionsToReviewClick,
|
|
19532
19732
|
onboardingStepOverride
|
|
19533
19733
|
}
|
|
19534
19734
|
),
|
|
19535
|
-
/* @__PURE__ */
|
|
19735
|
+
/* @__PURE__ */ React228.createElement(
|
|
19536
19736
|
Internal_ProfitAndLossSummaries,
|
|
19537
19737
|
{
|
|
19538
19738
|
stringOverrides: (_c = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _c.summaries,
|
|
19539
19739
|
chartColorsList,
|
|
19540
19740
|
slots: {
|
|
19541
19741
|
unstable_AdditionalListItems: showTransactionsToReview ? [
|
|
19542
|
-
/* @__PURE__ */
|
|
19742
|
+
/* @__PURE__ */ React228.createElement(
|
|
19543
19743
|
TransactionsToReview,
|
|
19544
19744
|
{
|
|
19545
19745
|
key: "transactions-to-review",
|
|
@@ -19553,28 +19753,28 @@ var AccountingOverview = ({
|
|
|
19553
19753
|
variants: profitAndLossSummariesVariants
|
|
19554
19754
|
}
|
|
19555
19755
|
),
|
|
19556
|
-
/* @__PURE__ */
|
|
19756
|
+
/* @__PURE__ */ React228.createElement(
|
|
19557
19757
|
Container,
|
|
19558
19758
|
{
|
|
19559
19759
|
name: "accounting-overview-profit-and-loss",
|
|
19560
19760
|
asWidget: true,
|
|
19561
19761
|
elevated: true
|
|
19562
19762
|
},
|
|
19563
|
-
/* @__PURE__ */
|
|
19763
|
+
/* @__PURE__ */ React228.createElement(
|
|
19564
19764
|
ProfitAndLoss.Header,
|
|
19565
19765
|
{
|
|
19566
19766
|
text: (stringOverrides == null ? void 0 : stringOverrides.header) || "Profit & Loss"
|
|
19567
19767
|
}
|
|
19568
19768
|
),
|
|
19569
|
-
/* @__PURE__ */
|
|
19769
|
+
/* @__PURE__ */ React228.createElement(
|
|
19570
19770
|
ProfitAndLoss.Chart,
|
|
19571
19771
|
{
|
|
19572
19772
|
tagFilter: tagFilter ? { key: tagFilter.tagKey, values: tagFilter.tagValues } : void 0
|
|
19573
19773
|
}
|
|
19574
19774
|
)
|
|
19575
19775
|
),
|
|
19576
|
-
middleBanner && /* @__PURE__ */
|
|
19577
|
-
/* @__PURE__ */
|
|
19776
|
+
middleBanner && /* @__PURE__ */ React228.createElement(Container, { name: "accounting-overview-middle-banner" }, middleBanner),
|
|
19777
|
+
/* @__PURE__ */ React228.createElement("div", { className: "Layer__accounting-overview-profit-and-loss-charts" }, /* @__PURE__ */ React228.createElement(
|
|
19578
19778
|
Toggle,
|
|
19579
19779
|
{
|
|
19580
19780
|
name: "pnl-detailed-charts",
|
|
@@ -19591,7 +19791,7 @@ var AccountingOverview = ({
|
|
|
19591
19791
|
selected: pnlToggle,
|
|
19592
19792
|
onChange: (e) => setPnlToggle(e.target.value)
|
|
19593
19793
|
}
|
|
19594
|
-
), /* @__PURE__ */
|
|
19794
|
+
), /* @__PURE__ */ React228.createElement(
|
|
19595
19795
|
Container,
|
|
19596
19796
|
{
|
|
19597
19797
|
name: classNames72(
|
|
@@ -19599,7 +19799,7 @@ var AccountingOverview = ({
|
|
|
19599
19799
|
pnlToggle !== "revenue" && "accounting-overview-profit-and-loss-chart--hidden"
|
|
19600
19800
|
)
|
|
19601
19801
|
},
|
|
19602
|
-
/* @__PURE__ */
|
|
19802
|
+
/* @__PURE__ */ React228.createElement(
|
|
19603
19803
|
ProfitAndLoss.DetailedCharts,
|
|
19604
19804
|
{
|
|
19605
19805
|
scope: "revenue",
|
|
@@ -19608,7 +19808,7 @@ var AccountingOverview = ({
|
|
|
19608
19808
|
chartColorsList
|
|
19609
19809
|
}
|
|
19610
19810
|
)
|
|
19611
|
-
), /* @__PURE__ */
|
|
19811
|
+
), /* @__PURE__ */ React228.createElement(
|
|
19612
19812
|
Container,
|
|
19613
19813
|
{
|
|
19614
19814
|
name: classNames72(
|
|
@@ -19616,7 +19816,7 @@ var AccountingOverview = ({
|
|
|
19616
19816
|
pnlToggle !== "expenses" && "accounting-overview-profit-and-loss-chart--hidden"
|
|
19617
19817
|
)
|
|
19618
19818
|
},
|
|
19619
|
-
/* @__PURE__ */
|
|
19819
|
+
/* @__PURE__ */ React228.createElement(
|
|
19620
19820
|
ProfitAndLoss.DetailedCharts,
|
|
19621
19821
|
{
|
|
19622
19822
|
scope: "expenses",
|
|
@@ -19631,7 +19831,7 @@ var AccountingOverview = ({
|
|
|
19631
19831
|
};
|
|
19632
19832
|
|
|
19633
19833
|
// src/views/BankTransactionsWithLinkedAccounts/BankTransactionsWithLinkedAccounts.tsx
|
|
19634
|
-
import
|
|
19834
|
+
import React229 from "react";
|
|
19635
19835
|
var BankTransactionsWithLinkedAccounts = ({
|
|
19636
19836
|
title,
|
|
19637
19837
|
// deprecated
|
|
@@ -19647,13 +19847,13 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
19647
19847
|
mobileComponent,
|
|
19648
19848
|
stringOverrides
|
|
19649
19849
|
}) => {
|
|
19650
|
-
return /* @__PURE__ */
|
|
19850
|
+
return /* @__PURE__ */ React229.createElement(
|
|
19651
19851
|
View,
|
|
19652
19852
|
{
|
|
19653
19853
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "Bank transactions",
|
|
19654
19854
|
showHeader: showTitle
|
|
19655
19855
|
},
|
|
19656
|
-
/* @__PURE__ */
|
|
19856
|
+
/* @__PURE__ */ React229.createElement(
|
|
19657
19857
|
LinkedAccounts,
|
|
19658
19858
|
{
|
|
19659
19859
|
elevated: elevatedLinkedAccounts,
|
|
@@ -19663,7 +19863,7 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
19663
19863
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.linkedAccounts
|
|
19664
19864
|
}
|
|
19665
19865
|
),
|
|
19666
|
-
/* @__PURE__ */
|
|
19866
|
+
/* @__PURE__ */ React229.createElement(
|
|
19667
19867
|
BankTransactions,
|
|
19668
19868
|
{
|
|
19669
19869
|
asWidget: true,
|
|
@@ -19679,7 +19879,7 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
19679
19879
|
};
|
|
19680
19880
|
|
|
19681
19881
|
// src/views/GeneralLedger/GeneralLedger.tsx
|
|
19682
|
-
import
|
|
19882
|
+
import React230, { useState as useState64 } from "react";
|
|
19683
19883
|
var GeneralLedgerView = ({
|
|
19684
19884
|
title,
|
|
19685
19885
|
// deprecated
|
|
@@ -19688,13 +19888,13 @@ var GeneralLedgerView = ({
|
|
|
19688
19888
|
chartOfAccountsOptions
|
|
19689
19889
|
}) => {
|
|
19690
19890
|
const [activeTab, setActiveTab] = useState64("chartOfAccounts");
|
|
19691
|
-
return /* @__PURE__ */
|
|
19891
|
+
return /* @__PURE__ */ React230.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React230.createElement(
|
|
19692
19892
|
View,
|
|
19693
19893
|
{
|
|
19694
19894
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "General Ledger",
|
|
19695
19895
|
showHeader: showTitle
|
|
19696
19896
|
},
|
|
19697
|
-
/* @__PURE__ */
|
|
19897
|
+
/* @__PURE__ */ React230.createElement(
|
|
19698
19898
|
Toggle,
|
|
19699
19899
|
{
|
|
19700
19900
|
name: "general-ledger-tabs",
|
|
@@ -19712,7 +19912,7 @@ var GeneralLedgerView = ({
|
|
|
19712
19912
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
19713
19913
|
}
|
|
19714
19914
|
),
|
|
19715
|
-
activeTab === "chartOfAccounts" ? /* @__PURE__ */
|
|
19915
|
+
activeTab === "chartOfAccounts" ? /* @__PURE__ */ React230.createElement(
|
|
19716
19916
|
ChartOfAccounts,
|
|
19717
19917
|
{
|
|
19718
19918
|
asWidget: true,
|
|
@@ -19721,12 +19921,12 @@ var GeneralLedgerView = ({
|
|
|
19721
19921
|
templateAccountsEditable: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.templateAccountsEditable,
|
|
19722
19922
|
showReversalEntries: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.showReversalEntries
|
|
19723
19923
|
}
|
|
19724
|
-
) : /* @__PURE__ */
|
|
19924
|
+
) : /* @__PURE__ */ React230.createElement(Journal, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.journal })
|
|
19725
19925
|
));
|
|
19726
19926
|
};
|
|
19727
19927
|
|
|
19728
19928
|
// src/views/ProjectProfitability/ProjectProfitability.tsx
|
|
19729
|
-
import
|
|
19929
|
+
import React231, { useState as useState65 } from "react";
|
|
19730
19930
|
import Select4 from "react-select";
|
|
19731
19931
|
var ProjectProfitabilityView = ({
|
|
19732
19932
|
valueOptions,
|
|
@@ -19751,14 +19951,14 @@ var ProjectProfitabilityView = ({
|
|
|
19751
19951
|
values: tagFilter2.tagValues
|
|
19752
19952
|
} : void 0;
|
|
19753
19953
|
};
|
|
19754
|
-
return /* @__PURE__ */
|
|
19954
|
+
return /* @__PURE__ */ React231.createElement(
|
|
19755
19955
|
View,
|
|
19756
19956
|
{
|
|
19757
19957
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || "",
|
|
19758
19958
|
showHeader: showTitle,
|
|
19759
19959
|
viewClassName: "Layer__project-view"
|
|
19760
19960
|
},
|
|
19761
|
-
/* @__PURE__ */
|
|
19961
|
+
/* @__PURE__ */ React231.createElement("div", { className: "Layer__component Layer__header__actions" }, /* @__PURE__ */ React231.createElement("div", { className: "Layer__component" }, /* @__PURE__ */ React231.createElement(
|
|
19762
19962
|
Toggle,
|
|
19763
19963
|
{
|
|
19764
19964
|
name: "project-tabs",
|
|
@@ -19779,7 +19979,7 @@ var ProjectProfitabilityView = ({
|
|
|
19779
19979
|
selected: activeTab,
|
|
19780
19980
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
19781
19981
|
}
|
|
19782
|
-
)), /* @__PURE__ */
|
|
19982
|
+
)), /* @__PURE__ */ React231.createElement(
|
|
19783
19983
|
Select4,
|
|
19784
19984
|
{
|
|
19785
19985
|
className: "Layer__category-menu Layer__select",
|
|
@@ -19797,7 +19997,7 @@ var ProjectProfitabilityView = ({
|
|
|
19797
19997
|
}
|
|
19798
19998
|
}
|
|
19799
19999
|
)),
|
|
19800
|
-
/* @__PURE__ */
|
|
20000
|
+
/* @__PURE__ */ React231.createElement(Container, { name: "project" }, /* @__PURE__ */ React231.createElement(React231.Fragment, null, activeTab === "overview" && /* @__PURE__ */ React231.createElement(
|
|
19801
20001
|
AccountingOverview,
|
|
19802
20002
|
{
|
|
19803
20003
|
stringOverrides: { header: "Project Overview" },
|
|
@@ -19807,7 +20007,7 @@ var ProjectProfitabilityView = ({
|
|
|
19807
20007
|
showTransactionsToReview: false,
|
|
19808
20008
|
showTitle: false
|
|
19809
20009
|
}
|
|
19810
|
-
), activeTab === "transactions" && /* @__PURE__ */
|
|
20010
|
+
), activeTab === "transactions" && /* @__PURE__ */ React231.createElement(
|
|
19811
20011
|
BankTransactions,
|
|
19812
20012
|
{
|
|
19813
20013
|
hideHeader: true,
|
|
@@ -19816,7 +20016,7 @@ var ProjectProfitabilityView = ({
|
|
|
19816
20016
|
tagFilter: tagFilter != null ? tagFilter : void 0
|
|
19817
20017
|
}
|
|
19818
20018
|
}
|
|
19819
|
-
), activeTab === "report" && /* @__PURE__ */
|
|
20019
|
+
), activeTab === "report" && /* @__PURE__ */ React231.createElement(ProfitAndLoss, { asContainer: false, tagFilter: pnlTagFilter }, /* @__PURE__ */ React231.createElement(
|
|
19820
20020
|
ProfitAndLoss.Report,
|
|
19821
20021
|
{
|
|
19822
20022
|
stringOverrides,
|
|
@@ -19828,7 +20028,7 @@ var ProjectProfitabilityView = ({
|
|
|
19828
20028
|
};
|
|
19829
20029
|
|
|
19830
20030
|
// src/views/Reports/Reports.tsx
|
|
19831
|
-
import
|
|
20031
|
+
import React232, { useState as useState66 } from "react";
|
|
19832
20032
|
var getOptions = (enabledReports) => {
|
|
19833
20033
|
return [
|
|
19834
20034
|
enabledReports.includes("profitAndLoss") ? {
|
|
@@ -19859,13 +20059,13 @@ var Reports = ({
|
|
|
19859
20059
|
const { view, containerRef } = useElementViewSize();
|
|
19860
20060
|
const options = getOptions(enabledReports);
|
|
19861
20061
|
const defaultTitle = enabledReports.length > 1 ? "Reports" : (_a = options.find((option) => option.value = enabledReports[0])) == null ? void 0 : _a.label;
|
|
19862
|
-
return /* @__PURE__ */
|
|
20062
|
+
return /* @__PURE__ */ React232.createElement(
|
|
19863
20063
|
View,
|
|
19864
20064
|
{
|
|
19865
20065
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || defaultTitle,
|
|
19866
20066
|
showHeader: showTitle
|
|
19867
20067
|
},
|
|
19868
|
-
enabledReports.length > 1 && /* @__PURE__ */
|
|
20068
|
+
enabledReports.length > 1 && /* @__PURE__ */ React232.createElement("div", { className: "Layer__component Layer__header__actions" }, /* @__PURE__ */ React232.createElement(
|
|
19869
20069
|
Toggle,
|
|
19870
20070
|
{
|
|
19871
20071
|
name: "reports-tabs",
|
|
@@ -19874,7 +20074,7 @@ var Reports = ({
|
|
|
19874
20074
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
19875
20075
|
}
|
|
19876
20076
|
)),
|
|
19877
|
-
/* @__PURE__ */
|
|
20077
|
+
/* @__PURE__ */ React232.createElement(Container, { name: "reports", ref: containerRef }, /* @__PURE__ */ React232.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React232.createElement(
|
|
19878
20078
|
ReportsPanel,
|
|
19879
20079
|
{
|
|
19880
20080
|
containerRef,
|
|
@@ -19897,7 +20097,7 @@ var ReportsPanel = ({
|
|
|
19897
20097
|
statementOfCashFlowConfig,
|
|
19898
20098
|
view
|
|
19899
20099
|
}) => {
|
|
19900
|
-
return /* @__PURE__ */
|
|
20100
|
+
return /* @__PURE__ */ React232.createElement(React232.Fragment, null, openReport === "profitAndLoss" && /* @__PURE__ */ React232.createElement(
|
|
19901
20101
|
ProfitAndLoss.Report,
|
|
19902
20102
|
__spreadValues({
|
|
19903
20103
|
stringOverrides,
|
|
@@ -19905,7 +20105,7 @@ var ReportsPanel = ({
|
|
|
19905
20105
|
parentRef: containerRef,
|
|
19906
20106
|
view
|
|
19907
20107
|
}, profitAndLossConfig)
|
|
19908
|
-
), openReport === "balanceSheet" && /* @__PURE__ */
|
|
20108
|
+
), openReport === "balanceSheet" && /* @__PURE__ */ React232.createElement(BalanceSheet, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.balanceSheet }), openReport === "statementOfCashFlow" && /* @__PURE__ */ React232.createElement(
|
|
19909
20109
|
StatementOfCashFlow,
|
|
19910
20110
|
__spreadValues({
|
|
19911
20111
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.statementOfCashflow
|
|
@@ -19914,11 +20114,11 @@ var ReportsPanel = ({
|
|
|
19914
20114
|
};
|
|
19915
20115
|
|
|
19916
20116
|
// src/components/ProfitAndLossView/ProfitAndLossView.tsx
|
|
19917
|
-
import
|
|
20117
|
+
import React233, { useContext as useContext50, useRef as useRef23 } from "react";
|
|
19918
20118
|
var COMPONENT_NAME7 = "profit-and-loss";
|
|
19919
20119
|
var ProfitAndLossView = (props) => {
|
|
19920
20120
|
const containerRef = useRef23(null);
|
|
19921
|
-
return /* @__PURE__ */
|
|
20121
|
+
return /* @__PURE__ */ React233.createElement(Container, { name: COMPONENT_NAME7, ref: containerRef }, /* @__PURE__ */ React233.createElement(ProfitAndLoss, null, /* @__PURE__ */ React233.createElement(ProfitAndLossPanel, __spreadValues({ containerRef }, props))));
|
|
19922
20122
|
};
|
|
19923
20123
|
var ProfitAndLossPanel = (_a) => {
|
|
19924
20124
|
var _b = _a, {
|
|
@@ -19929,10 +20129,10 @@ var ProfitAndLossPanel = (_a) => {
|
|
|
19929
20129
|
"stringOverrides"
|
|
19930
20130
|
]);
|
|
19931
20131
|
const { sidebarScope } = useContext50(ProfitAndLoss.Context);
|
|
19932
|
-
return /* @__PURE__ */
|
|
20132
|
+
return /* @__PURE__ */ React233.createElement(
|
|
19933
20133
|
Panel,
|
|
19934
20134
|
{
|
|
19935
|
-
sidebar: /* @__PURE__ */
|
|
20135
|
+
sidebar: /* @__PURE__ */ React233.createElement(
|
|
19936
20136
|
ProfitAndLossDetailedCharts,
|
|
19937
20137
|
{
|
|
19938
20138
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.profitAndLossDetailedCharts
|
|
@@ -19941,7 +20141,7 @@ var ProfitAndLossPanel = (_a) => {
|
|
|
19941
20141
|
sidebarIsOpen: Boolean(sidebarScope),
|
|
19942
20142
|
parentRef: containerRef
|
|
19943
20143
|
},
|
|
19944
|
-
/* @__PURE__ */
|
|
20144
|
+
/* @__PURE__ */ React233.createElement(
|
|
19945
20145
|
ProfitAndLoss.Header,
|
|
19946
20146
|
{
|
|
19947
20147
|
text: (stringOverrides == null ? void 0 : stringOverrides.header) || "Profit & Loss",
|
|
@@ -19949,7 +20149,7 @@ var ProfitAndLossPanel = (_a) => {
|
|
|
19949
20149
|
headingClassName: "Layer__profit-and-loss__title"
|
|
19950
20150
|
}
|
|
19951
20151
|
),
|
|
19952
|
-
/* @__PURE__ */
|
|
20152
|
+
/* @__PURE__ */ React233.createElement(Components, __spreadValues({ stringOverrides }, props))
|
|
19953
20153
|
);
|
|
19954
20154
|
};
|
|
19955
20155
|
var Components = ({
|
|
@@ -19961,7 +20161,7 @@ var Components = ({
|
|
|
19961
20161
|
ProfitAndLoss.Context
|
|
19962
20162
|
);
|
|
19963
20163
|
if (!isLoading && error) {
|
|
19964
|
-
return /* @__PURE__ */
|
|
20164
|
+
return /* @__PURE__ */ React233.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React233.createElement(
|
|
19965
20165
|
DataState,
|
|
19966
20166
|
{
|
|
19967
20167
|
status: "failed" /* failed */,
|
|
@@ -19972,26 +20172,26 @@ var Components = ({
|
|
|
19972
20172
|
}
|
|
19973
20173
|
));
|
|
19974
20174
|
}
|
|
19975
|
-
return /* @__PURE__ */
|
|
20175
|
+
return /* @__PURE__ */ React233.createElement(React233.Fragment, null, !hideChart && /* @__PURE__ */ React233.createElement("div", { className: `Layer__${COMPONENT_NAME7}__chart_with_summaries` }, /* @__PURE__ */ React233.createElement(
|
|
19976
20176
|
"div",
|
|
19977
20177
|
{
|
|
19978
20178
|
className: `Layer__${COMPONENT_NAME7}__chart_with_summaries__summary-col`
|
|
19979
20179
|
},
|
|
19980
|
-
/* @__PURE__ */
|
|
19981
|
-
/* @__PURE__ */
|
|
20180
|
+
/* @__PURE__ */ React233.createElement(ProfitAndLoss.DatePicker, null),
|
|
20181
|
+
/* @__PURE__ */ React233.createElement(
|
|
19982
20182
|
ProfitAndLoss.Summaries,
|
|
19983
20183
|
{
|
|
19984
20184
|
actionable: true,
|
|
19985
20185
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.profitAndLossSummaries
|
|
19986
20186
|
}
|
|
19987
20187
|
)
|
|
19988
|
-
), /* @__PURE__ */
|
|
20188
|
+
), /* @__PURE__ */ React233.createElement(
|
|
19989
20189
|
"div",
|
|
19990
20190
|
{
|
|
19991
20191
|
className: `Layer__${COMPONENT_NAME7}__chart_with_summaries__chart-col`
|
|
19992
20192
|
},
|
|
19993
|
-
/* @__PURE__ */
|
|
19994
|
-
)), !hideTable && /* @__PURE__ */
|
|
20193
|
+
/* @__PURE__ */ React233.createElement(ProfitAndLoss.Chart, null)
|
|
20194
|
+
)), !hideTable && /* @__PURE__ */ React233.createElement(
|
|
19995
20195
|
ProfitAndLoss.Table,
|
|
19996
20196
|
{
|
|
19997
20197
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.profitAndLossTable
|