@layerfi/components 0.1.49 → 0.1.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +414 -410
- package/dist/esm/index.js.map +4 -4
- package/dist/index.d.ts +14 -12
- package/dist/index.js +538 -534
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -4776,25 +4776,20 @@ var allCategoriesDivider = [
|
|
|
4776
4776
|
}
|
|
4777
4777
|
];
|
|
4778
4778
|
function flattenCategories2(categories) {
|
|
4779
|
-
|
|
4780
|
-
if (category
|
|
4781
|
-
|
|
4782
|
-
return [
|
|
4783
|
-
{
|
|
4784
|
-
label: category.display_name,
|
|
4785
|
-
options: category.subCategories.map((x) => mapCategoryToOption2(x))
|
|
4786
|
-
}
|
|
4787
|
-
];
|
|
4788
|
-
}
|
|
4789
|
-
return flattenCategories2(category.subCategories);
|
|
4779
|
+
function getLeafCategories(category) {
|
|
4780
|
+
if (!category.subCategories || category.subCategories.length === 0) {
|
|
4781
|
+
return [category];
|
|
4790
4782
|
}
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4783
|
+
return category.subCategories.flatMap((subCategory) => getLeafCategories(subCategory));
|
|
4784
|
+
}
|
|
4785
|
+
return categories.map(
|
|
4786
|
+
(category) => {
|
|
4787
|
+
return {
|
|
4788
|
+
label: category.display_name,
|
|
4789
|
+
options: getLeafCategories(category).map((x) => mapCategoryToOption2(x))
|
|
4790
|
+
};
|
|
4791
|
+
}
|
|
4792
|
+
);
|
|
4798
4793
|
}
|
|
4799
4794
|
var CategorySelect = ({
|
|
4800
4795
|
bankTransaction,
|
|
@@ -8715,7 +8710,7 @@ var Quickbooks = () => {
|
|
|
8715
8710
|
};
|
|
8716
8711
|
|
|
8717
8712
|
// src/components/ProfitAndLoss/ProfitAndLoss.tsx
|
|
8718
|
-
import
|
|
8713
|
+
import React131, { createContext as createContext7 } from "react";
|
|
8719
8714
|
|
|
8720
8715
|
// src/hooks/useProfitAndLoss/useProfitAndLoss.tsx
|
|
8721
8716
|
import { useMemo as useMemo8, useState as useState28 } from "react";
|
|
@@ -10889,11 +10884,8 @@ var ProfitAndLossSummaries = ({
|
|
|
10889
10884
|
);
|
|
10890
10885
|
};
|
|
10891
10886
|
|
|
10892
|
-
// src/components/ProfitAndLossTable/
|
|
10893
|
-
import
|
|
10894
|
-
|
|
10895
|
-
// src/hooks/useTableExpandRow/useTableExpandRow.tsx
|
|
10896
|
-
import { useContext as useContext16 } from "react";
|
|
10887
|
+
// src/components/ProfitAndLossTable/ProfitAndLossTableWithProvider.tsx
|
|
10888
|
+
import React130 from "react";
|
|
10897
10889
|
|
|
10898
10890
|
// src/contexts/TableContext/TableContext.tsx
|
|
10899
10891
|
import React122, { createContext as createContext6, useState as useState32 } from "react";
|
|
@@ -10935,7 +10927,11 @@ var TableProvider = ({ children }) => {
|
|
|
10935
10927
|
return /* @__PURE__ */ React122.createElement(TableContext.Provider, { value: contextValue }, children);
|
|
10936
10928
|
};
|
|
10937
10929
|
|
|
10930
|
+
// src/components/ProfitAndLossTable/ProfitAndLossTableComponent.tsx
|
|
10931
|
+
import React129, { useContext as useContext17, useEffect as useEffect27 } from "react";
|
|
10932
|
+
|
|
10938
10933
|
// src/hooks/useTableExpandRow/useTableExpandRow.tsx
|
|
10934
|
+
import { useContext as useContext16 } from "react";
|
|
10939
10935
|
var useTableExpandRow = () => {
|
|
10940
10936
|
const {
|
|
10941
10937
|
expandedAllRows,
|
|
@@ -11185,9 +11181,12 @@ var empty_profit_and_loss_report_default = {
|
|
|
11185
11181
|
fully_categorized: false
|
|
11186
11182
|
};
|
|
11187
11183
|
|
|
11188
|
-
// src/components/ProfitAndLossTable/
|
|
11184
|
+
// src/components/ProfitAndLossTable/ProfitAndLossTableComponent.tsx
|
|
11189
11185
|
import classNames48 from "classnames";
|
|
11190
|
-
var
|
|
11186
|
+
var ProfitAndLossTableComponent = ({
|
|
11187
|
+
asContainer,
|
|
11188
|
+
stringOverrides
|
|
11189
|
+
}) => {
|
|
11191
11190
|
const {
|
|
11192
11191
|
data: actualData,
|
|
11193
11192
|
isLoading,
|
|
@@ -11309,7 +11308,12 @@ var ProfitAndLossTable = ({ asContainer, stringOverrides }) => {
|
|
|
11309
11308
|
void 0,
|
|
11310
11309
|
void 0,
|
|
11311
11310
|
"summation"
|
|
11312
|
-
), data.
|
|
11311
|
+
), data.personal_expenses ? /* @__PURE__ */ React129.createElement(React129.Fragment, null, renderLineItem(data.personal_expenses, 0, "personal_expenses", 7)) : null, data.other_outflows ? /* @__PURE__ */ React129.createElement(React129.Fragment, null, renderLineItem(data.other_outflows, 0, "other_outflows", 6)) : null));
|
|
11312
|
+
};
|
|
11313
|
+
|
|
11314
|
+
// src/components/ProfitAndLossTable/ProfitAndLossTableWithProvider.tsx
|
|
11315
|
+
var ProfitAndLossTableWithProvider = (props) => {
|
|
11316
|
+
return /* @__PURE__ */ React130.createElement(TableProvider, null, /* @__PURE__ */ React130.createElement(ProfitAndLossTableComponent, { ...props }));
|
|
11313
11317
|
};
|
|
11314
11318
|
|
|
11315
11319
|
// src/components/ProfitAndLoss/ProfitAndLoss.tsx
|
|
@@ -11350,17 +11354,17 @@ var ProfitAndLoss = ({
|
|
|
11350
11354
|
asContainer = true
|
|
11351
11355
|
}) => {
|
|
11352
11356
|
const contextData = useProfitAndLoss({ tagFilter, reportingBasis });
|
|
11353
|
-
return /* @__PURE__ */
|
|
11357
|
+
return /* @__PURE__ */ React131.createElement(PNLContext.Provider, { value: contextData }, asContainer ? /* @__PURE__ */ React131.createElement(Container, { name: "profit-and-loss" }, children) : children);
|
|
11354
11358
|
};
|
|
11355
11359
|
ProfitAndLoss.Chart = ProfitAndLossChart;
|
|
11356
11360
|
ProfitAndLoss.Context = PNLContext;
|
|
11357
11361
|
ProfitAndLoss.DatePicker = ProfitAndLossDatePicker;
|
|
11358
11362
|
ProfitAndLoss.Summaries = ProfitAndLossSummaries;
|
|
11359
|
-
ProfitAndLoss.Table =
|
|
11363
|
+
ProfitAndLoss.Table = ProfitAndLossTableWithProvider;
|
|
11360
11364
|
ProfitAndLoss.DetailedCharts = ProfitAndLossDetailedCharts;
|
|
11361
11365
|
|
|
11362
11366
|
// src/components/BalanceSheet/BalanceSheet.tsx
|
|
11363
|
-
import
|
|
11367
|
+
import React138, { useEffect as useEffect31, useState as useState34 } from "react";
|
|
11364
11368
|
|
|
11365
11369
|
// src/contexts/BalanceSheetContext/BalanceSheetContext.tsx
|
|
11366
11370
|
import { createContext as createContext8 } from "react";
|
|
@@ -11406,12 +11410,12 @@ var useBalanceSheet = (date = /* @__PURE__ */ new Date()) => {
|
|
|
11406
11410
|
};
|
|
11407
11411
|
|
|
11408
11412
|
// src/components/BalanceSheetDatePicker/BalanceSheetDatePicker.tsx
|
|
11409
|
-
import
|
|
11413
|
+
import React132 from "react";
|
|
11410
11414
|
var BalanceSheetDatePicker = ({
|
|
11411
11415
|
effectiveDate,
|
|
11412
11416
|
setEffectiveDate
|
|
11413
11417
|
}) => {
|
|
11414
|
-
return /* @__PURE__ */
|
|
11418
|
+
return /* @__PURE__ */ React132.createElement(React132.Fragment, null, /* @__PURE__ */ React132.createElement(
|
|
11415
11419
|
DatePicker,
|
|
11416
11420
|
{
|
|
11417
11421
|
selected: effectiveDate,
|
|
@@ -11422,14 +11426,14 @@ var BalanceSheetDatePicker = ({
|
|
|
11422
11426
|
};
|
|
11423
11427
|
|
|
11424
11428
|
// src/components/BalanceSheetExpandAllButton/BalanceSheetExpandAllButton.tsx
|
|
11425
|
-
import
|
|
11429
|
+
import React133 from "react";
|
|
11426
11430
|
var BalanceSheetExpandAllButton = () => {
|
|
11427
11431
|
const { expandedAllRows, toggleAllRows } = useTableExpandRow();
|
|
11428
|
-
return /* @__PURE__ */
|
|
11432
|
+
return /* @__PURE__ */ React133.createElement(Button, { onClick: () => toggleAllRows(), variant: "secondary" /* secondary */ }, !expandedAllRows ? "Expand all rows" : "Collapse all rows");
|
|
11429
11433
|
};
|
|
11430
11434
|
|
|
11431
11435
|
// src/components/BalanceSheetTable/BalanceSheetTable.tsx
|
|
11432
|
-
import
|
|
11436
|
+
import React134, { useEffect as useEffect29 } from "react";
|
|
11433
11437
|
var BalanceSheetTable = ({
|
|
11434
11438
|
data,
|
|
11435
11439
|
config,
|
|
@@ -11452,7 +11456,7 @@ var BalanceSheetTable = ({
|
|
|
11452
11456
|
if (expandable) {
|
|
11453
11457
|
allRowKeys.push(rowKey);
|
|
11454
11458
|
}
|
|
11455
|
-
return /* @__PURE__ */
|
|
11459
|
+
return /* @__PURE__ */ React134.createElement(React134.Fragment, { key: rowKey + "-" + rowIndex }, /* @__PURE__ */ React134.createElement(
|
|
11456
11460
|
TableRow,
|
|
11457
11461
|
{
|
|
11458
11462
|
rowKey: rowKey + "-" + rowIndex,
|
|
@@ -11462,8 +11466,8 @@ var BalanceSheetTable = ({
|
|
|
11462
11466
|
depth,
|
|
11463
11467
|
withDivider: depth === 0 && rowIndex > 0
|
|
11464
11468
|
},
|
|
11465
|
-
/* @__PURE__ */
|
|
11466
|
-
/* @__PURE__ */
|
|
11469
|
+
/* @__PURE__ */ React134.createElement(TableCell, { withExpandIcon: expandable, primary: expandable }, lineItem.display_name),
|
|
11470
|
+
/* @__PURE__ */ React134.createElement(
|
|
11467
11471
|
TableCell,
|
|
11468
11472
|
{
|
|
11469
11473
|
isCurrency: !expandable || expandable && !expanded,
|
|
@@ -11478,18 +11482,18 @@ var BalanceSheetTable = ({
|
|
|
11478
11482
|
rowKey + ":" + subItem.name,
|
|
11479
11483
|
subIdx
|
|
11480
11484
|
)
|
|
11481
|
-
), showChildren && expandable && /* @__PURE__ */
|
|
11485
|
+
), showChildren && expandable && /* @__PURE__ */ React134.createElement(
|
|
11482
11486
|
TableRow,
|
|
11483
11487
|
{
|
|
11484
11488
|
rowKey: rowKey + "-" + rowIndex + "--summation",
|
|
11485
11489
|
depth: depth + 1,
|
|
11486
11490
|
variant: "summation"
|
|
11487
11491
|
},
|
|
11488
|
-
/* @__PURE__ */
|
|
11489
|
-
/* @__PURE__ */
|
|
11492
|
+
/* @__PURE__ */ React134.createElement(TableCell, { primary: true }, `Total of ${lineItem.display_name}`),
|
|
11493
|
+
/* @__PURE__ */ React134.createElement(TableCell, { primary: true, isCurrency: true }, lineItem.value)
|
|
11490
11494
|
));
|
|
11491
11495
|
};
|
|
11492
|
-
return /* @__PURE__ */
|
|
11496
|
+
return /* @__PURE__ */ React134.createElement(Table, { borderCollapse: "collapse" }, /* @__PURE__ */ React134.createElement(TableHead, null, /* @__PURE__ */ React134.createElement(TableRow, { isHeadRow: true, rowKey: "balance-sheet-head-row" }, /* @__PURE__ */ React134.createElement(TableCell, { isHeaderCell: true }, stringOverrides?.typeColumnHeader || "Type"), /* @__PURE__ */ React134.createElement(TableCell, { isHeaderCell: true }, stringOverrides?.totalColumnHeader || "Total"))), /* @__PURE__ */ React134.createElement(TableBody, null, config.map((row, idx) => /* @__PURE__ */ React134.createElement(React134.Fragment, { key: row.lineItem }, data[row.lineItem] && renderLineItem(
|
|
11493
11497
|
data[row.lineItem],
|
|
11494
11498
|
0,
|
|
11495
11499
|
row.lineItem,
|
|
@@ -11498,16 +11502,16 @@ var BalanceSheetTable = ({
|
|
|
11498
11502
|
};
|
|
11499
11503
|
|
|
11500
11504
|
// src/components/View/View.tsx
|
|
11501
|
-
import
|
|
11505
|
+
import React137 from "react";
|
|
11502
11506
|
|
|
11503
11507
|
// src/components/ViewHeader/ViewHeader.tsx
|
|
11504
|
-
import
|
|
11508
|
+
import React135 from "react";
|
|
11505
11509
|
var ViewHeader = ({ title, controls }) => {
|
|
11506
|
-
return /* @__PURE__ */
|
|
11510
|
+
return /* @__PURE__ */ React135.createElement("div", { className: "Layer__view-header" }, /* @__PURE__ */ React135.createElement("div", { className: "Layer__view-header__content" }, title && /* @__PURE__ */ React135.createElement(Heading, null, title), controls && /* @__PURE__ */ React135.createElement("div", { className: "Layer__view-header__controls" }, controls)));
|
|
11507
11511
|
};
|
|
11508
11512
|
|
|
11509
11513
|
// src/components/Panel/Panel.tsx
|
|
11510
|
-
import
|
|
11514
|
+
import React136, { useEffect as useEffect30, useState as useState33 } from "react";
|
|
11511
11515
|
import classNames49 from "classnames";
|
|
11512
11516
|
var Panel = ({
|
|
11513
11517
|
children,
|
|
@@ -11528,7 +11532,7 @@ var Panel = ({
|
|
|
11528
11532
|
"Layer__panel__sidebar",
|
|
11529
11533
|
defaultSidebarHeight && "Layer__panel__sidebar--default"
|
|
11530
11534
|
);
|
|
11531
|
-
return /* @__PURE__ */
|
|
11535
|
+
return /* @__PURE__ */ React136.createElement(
|
|
11532
11536
|
"div",
|
|
11533
11537
|
{
|
|
11534
11538
|
className: classNames49(
|
|
@@ -11537,8 +11541,8 @@ var Panel = ({
|
|
|
11537
11541
|
sidebarIsOpen && "Layer__panel--open"
|
|
11538
11542
|
)
|
|
11539
11543
|
},
|
|
11540
|
-
/* @__PURE__ */
|
|
11541
|
-
sidebar && /* @__PURE__ */
|
|
11544
|
+
/* @__PURE__ */ React136.createElement("div", { className: "Layer__panel__content" }, header, children),
|
|
11545
|
+
sidebar && /* @__PURE__ */ React136.createElement(
|
|
11542
11546
|
"div",
|
|
11543
11547
|
{
|
|
11544
11548
|
className: sidebarClass,
|
|
@@ -11546,7 +11550,7 @@ var Panel = ({
|
|
|
11546
11550
|
maxHeight: sidebarHeight > 0 && sidebarIsOpen ? sidebarHeight : 0
|
|
11547
11551
|
} : {}
|
|
11548
11552
|
},
|
|
11549
|
-
/* @__PURE__ */
|
|
11553
|
+
/* @__PURE__ */ React136.createElement("div", { className: "Layer__panel__sidebar-content" }, sidebar)
|
|
11550
11554
|
)
|
|
11551
11555
|
);
|
|
11552
11556
|
};
|
|
@@ -11569,7 +11573,7 @@ var View = ({
|
|
|
11569
11573
|
type === "panel" && "Layer__view--panel",
|
|
11570
11574
|
viewClassName
|
|
11571
11575
|
);
|
|
11572
|
-
return /* @__PURE__ */
|
|
11576
|
+
return /* @__PURE__ */ React137.createElement("div", { className: viewClassNames, style: { ...styles } }, /* @__PURE__ */ React137.createElement(ViewHeader, { title, controls: headerControls }), withSidebar ? /* @__PURE__ */ React137.createElement(Panel, { sidebarIsOpen: true, sidebar, defaultSidebarHeight: true }, /* @__PURE__ */ React137.createElement("div", { className: "Layer__view-main" }, children)) : /* @__PURE__ */ React137.createElement("div", { className: "Layer__view-main" }, children));
|
|
11573
11577
|
};
|
|
11574
11578
|
|
|
11575
11579
|
// src/components/BalanceSheet/constants.ts
|
|
@@ -11591,7 +11595,7 @@ import { format as format4, parse, startOfDay as startOfDay2 } from "date-fns";
|
|
|
11591
11595
|
var COMPONENT_NAME3 = "balance-sheet";
|
|
11592
11596
|
var BalanceSheet = (props) => {
|
|
11593
11597
|
const balanceSheetContextData = useBalanceSheet(props.effectiveDate);
|
|
11594
|
-
return /* @__PURE__ */
|
|
11598
|
+
return /* @__PURE__ */ React138.createElement(BalanceSheetContext.Provider, { value: balanceSheetContextData }, /* @__PURE__ */ React138.createElement(
|
|
11595
11599
|
BalanceSheetView,
|
|
11596
11600
|
{
|
|
11597
11601
|
asWidget: props.asWidget,
|
|
@@ -11620,19 +11624,19 @@ var BalanceSheetView = ({
|
|
|
11620
11624
|
}
|
|
11621
11625
|
}, [effectiveDate]);
|
|
11622
11626
|
if (asWidget) {
|
|
11623
|
-
return /* @__PURE__ */
|
|
11627
|
+
return /* @__PURE__ */ React138.createElement(TableProvider, null, /* @__PURE__ */ React138.createElement(Container, { name: COMPONENT_NAME3, asWidget: true }, /* @__PURE__ */ React138.createElement(
|
|
11624
11628
|
View,
|
|
11625
11629
|
{
|
|
11626
11630
|
type: "panel",
|
|
11627
|
-
headerControls: /* @__PURE__ */
|
|
11631
|
+
headerControls: /* @__PURE__ */ React138.createElement(React138.Fragment, null, /* @__PURE__ */ React138.createElement(
|
|
11628
11632
|
BalanceSheetDatePicker,
|
|
11629
11633
|
{
|
|
11630
11634
|
effectiveDate,
|
|
11631
11635
|
setEffectiveDate
|
|
11632
11636
|
}
|
|
11633
|
-
), withExpandAllButton && /* @__PURE__ */
|
|
11637
|
+
), withExpandAllButton && /* @__PURE__ */ React138.createElement(BalanceSheetExpandAllButton, null))
|
|
11634
11638
|
},
|
|
11635
|
-
!data || isLoading ? /* @__PURE__ */
|
|
11639
|
+
!data || isLoading ? /* @__PURE__ */ React138.createElement("div", { className: `Layer__${COMPONENT_NAME3}__loader-container` }, /* @__PURE__ */ React138.createElement(Loader2, null)) : /* @__PURE__ */ React138.createElement(
|
|
11636
11640
|
BalanceSheetTable,
|
|
11637
11641
|
{
|
|
11638
11642
|
data,
|
|
@@ -11642,19 +11646,19 @@ var BalanceSheetView = ({
|
|
|
11642
11646
|
)
|
|
11643
11647
|
)));
|
|
11644
11648
|
}
|
|
11645
|
-
return /* @__PURE__ */
|
|
11649
|
+
return /* @__PURE__ */ React138.createElement(TableProvider, null, /* @__PURE__ */ React138.createElement(
|
|
11646
11650
|
View,
|
|
11647
11651
|
{
|
|
11648
11652
|
type: "panel",
|
|
11649
|
-
headerControls: /* @__PURE__ */
|
|
11653
|
+
headerControls: /* @__PURE__ */ React138.createElement(React138.Fragment, null, /* @__PURE__ */ React138.createElement(
|
|
11650
11654
|
BalanceSheetDatePicker,
|
|
11651
11655
|
{
|
|
11652
11656
|
effectiveDate,
|
|
11653
11657
|
setEffectiveDate
|
|
11654
11658
|
}
|
|
11655
|
-
), withExpandAllButton && /* @__PURE__ */
|
|
11659
|
+
), withExpandAllButton && /* @__PURE__ */ React138.createElement(BalanceSheetExpandAllButton, null))
|
|
11656
11660
|
},
|
|
11657
|
-
!data || isLoading ? /* @__PURE__ */
|
|
11661
|
+
!data || isLoading ? /* @__PURE__ */ React138.createElement("div", { className: `Layer__${COMPONENT_NAME3}__loader-container` }, /* @__PURE__ */ React138.createElement(Loader2, null)) : /* @__PURE__ */ React138.createElement(
|
|
11658
11662
|
BalanceSheetTable,
|
|
11659
11663
|
{
|
|
11660
11664
|
data,
|
|
@@ -11666,7 +11670,7 @@ var BalanceSheetView = ({
|
|
|
11666
11670
|
};
|
|
11667
11671
|
|
|
11668
11672
|
// src/components/StatementOfCashFlow/StatementOfCashFlow.tsx
|
|
11669
|
-
import
|
|
11673
|
+
import React140, { useState as useState35 } from "react";
|
|
11670
11674
|
|
|
11671
11675
|
// src/contexts/StatementOfCashContext/StatementOfCashFlowContext.tsx
|
|
11672
11676
|
import { createContext as createContext9 } from "react";
|
|
@@ -11717,7 +11721,7 @@ var useStatementOfCashFlow = (startDate = /* @__PURE__ */ new Date(), endDate =
|
|
|
11717
11721
|
};
|
|
11718
11722
|
|
|
11719
11723
|
// src/components/StatementOfCashFlowTable/StatementOfCashFlowTable.tsx
|
|
11720
|
-
import
|
|
11724
|
+
import React139 from "react";
|
|
11721
11725
|
var StatementOfCashFlowTable = ({
|
|
11722
11726
|
data,
|
|
11723
11727
|
config,
|
|
@@ -11727,7 +11731,7 @@ var StatementOfCashFlowTable = ({
|
|
|
11727
11731
|
const renderLineItem = (lineItem, depth = 0, rowKey, rowIndex) => {
|
|
11728
11732
|
const expandable = !!lineItem.line_items && lineItem.line_items.length > 0;
|
|
11729
11733
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
11730
|
-
return /* @__PURE__ */
|
|
11734
|
+
return /* @__PURE__ */ React139.createElement(React139.Fragment, { key: rowKey + "-" + rowIndex }, /* @__PURE__ */ React139.createElement(
|
|
11731
11735
|
TableRow,
|
|
11732
11736
|
{
|
|
11733
11737
|
rowKey: rowKey + "-" + rowIndex,
|
|
@@ -11736,8 +11740,8 @@ var StatementOfCashFlowTable = ({
|
|
|
11736
11740
|
handleExpand: () => setIsOpen(rowKey),
|
|
11737
11741
|
depth
|
|
11738
11742
|
},
|
|
11739
|
-
/* @__PURE__ */
|
|
11740
|
-
/* @__PURE__ */
|
|
11743
|
+
/* @__PURE__ */ React139.createElement(TableCell, { withExpandIcon: expandable, primary: expandable }, lineItem.display_name),
|
|
11744
|
+
/* @__PURE__ */ React139.createElement(
|
|
11741
11745
|
TableCell,
|
|
11742
11746
|
{
|
|
11743
11747
|
isCurrency: !expandable || expandable && !expanded,
|
|
@@ -11752,27 +11756,27 @@ var StatementOfCashFlowTable = ({
|
|
|
11752
11756
|
rowKey + ":" + subItem.name,
|
|
11753
11757
|
subIdx
|
|
11754
11758
|
)
|
|
11755
|
-
), expanded && expandable && /* @__PURE__ */
|
|
11759
|
+
), expanded && expandable && /* @__PURE__ */ React139.createElement(
|
|
11756
11760
|
TableRow,
|
|
11757
11761
|
{
|
|
11758
11762
|
rowKey: rowKey + "-" + rowIndex + "--summation",
|
|
11759
11763
|
depth: depth + 1,
|
|
11760
11764
|
variant: "summation"
|
|
11761
11765
|
},
|
|
11762
|
-
/* @__PURE__ */
|
|
11763
|
-
/* @__PURE__ */
|
|
11766
|
+
/* @__PURE__ */ React139.createElement(TableCell, { primary: true }, `Total of ${lineItem.display_name}`),
|
|
11767
|
+
/* @__PURE__ */ React139.createElement(TableCell, { primary: true, isCurrency: true }, lineItem.value)
|
|
11764
11768
|
));
|
|
11765
11769
|
};
|
|
11766
|
-
return /* @__PURE__ */
|
|
11770
|
+
return /* @__PURE__ */ React139.createElement(Table, { borderCollapse: "collapse" }, /* @__PURE__ */ React139.createElement(TableHead, null, /* @__PURE__ */ React139.createElement(TableRow, { rowKey: "soc-flow-head-row", isHeadRow: true }, /* @__PURE__ */ React139.createElement(TableCell, { isHeaderCell: true }, stringOverrides?.typeColumnHeader || "Type"), /* @__PURE__ */ React139.createElement(TableCell, { isHeaderCell: true }, stringOverrides?.totalColumnHeader || "Total"))), /* @__PURE__ */ React139.createElement(TableBody, null, config.map((row, idx) => {
|
|
11767
11771
|
if (row.type === "line_item") {
|
|
11768
|
-
return /* @__PURE__ */
|
|
11772
|
+
return /* @__PURE__ */ React139.createElement(React139.Fragment, { key: row.lineItem }, data[row.lineItem] && renderLineItem(
|
|
11769
11773
|
data[row.lineItem],
|
|
11770
11774
|
0,
|
|
11771
11775
|
row.lineItem ? row.lineItem : "",
|
|
11772
11776
|
idx
|
|
11773
11777
|
));
|
|
11774
11778
|
} else {
|
|
11775
|
-
return /* @__PURE__ */
|
|
11779
|
+
return /* @__PURE__ */ React139.createElement(TableRow, { rowKey: row.name + "-" + idx, variant: "default" }, /* @__PURE__ */ React139.createElement(TableCell, { primary: true }, row.displayName), /* @__PURE__ */ React139.createElement(TableCell, { primary: true, isCurrency: true }, row.lineItem));
|
|
11776
11780
|
}
|
|
11777
11781
|
})));
|
|
11778
11782
|
};
|
|
@@ -11821,7 +11825,7 @@ import { startOfDay as startOfDay4, subWeeks } from "date-fns";
|
|
|
11821
11825
|
var COMPONENT_NAME4 = "statement-of-cash-flow";
|
|
11822
11826
|
var StatementOfCashFlow = ({ stringOverrides }) => {
|
|
11823
11827
|
const cashContextData = useStatementOfCashFlow();
|
|
11824
|
-
return /* @__PURE__ */
|
|
11828
|
+
return /* @__PURE__ */ React140.createElement(StatementOfCashFlowContext.Provider, { value: cashContextData }, /* @__PURE__ */ React140.createElement(StatementOfCashFlowView, { stringOverrides }));
|
|
11825
11829
|
};
|
|
11826
11830
|
var StatementOfCashFlowView = ({ stringOverrides }) => {
|
|
11827
11831
|
const [startDate, setStartDate] = useState35(
|
|
@@ -11843,11 +11847,11 @@ var StatementOfCashFlowView = ({ stringOverrides }) => {
|
|
|
11843
11847
|
refetch();
|
|
11844
11848
|
}
|
|
11845
11849
|
};
|
|
11846
|
-
return /* @__PURE__ */
|
|
11850
|
+
return /* @__PURE__ */ React140.createElement(TableProvider, null, /* @__PURE__ */ React140.createElement(
|
|
11847
11851
|
View,
|
|
11848
11852
|
{
|
|
11849
11853
|
type: "panel",
|
|
11850
|
-
headerControls: /* @__PURE__ */
|
|
11854
|
+
headerControls: /* @__PURE__ */ React140.createElement(React140.Fragment, null, /* @__PURE__ */ React140.createElement(
|
|
11851
11855
|
DatePicker,
|
|
11852
11856
|
{
|
|
11853
11857
|
selected: [startDate, endDate],
|
|
@@ -11857,7 +11861,7 @@ var StatementOfCashFlowView = ({ stringOverrides }) => {
|
|
|
11857
11861
|
}
|
|
11858
11862
|
))
|
|
11859
11863
|
},
|
|
11860
|
-
!data || isLoading ? /* @__PURE__ */
|
|
11864
|
+
!data || isLoading ? /* @__PURE__ */ React140.createElement("div", { className: `Layer__${COMPONENT_NAME4}__loader-container` }, /* @__PURE__ */ React140.createElement(Loader2, null)) : /* @__PURE__ */ React140.createElement(
|
|
11861
11865
|
StatementOfCashFlowTable,
|
|
11862
11866
|
{
|
|
11863
11867
|
data,
|
|
@@ -11869,7 +11873,7 @@ var StatementOfCashFlowView = ({ stringOverrides }) => {
|
|
|
11869
11873
|
};
|
|
11870
11874
|
|
|
11871
11875
|
// src/components/ChartOfAccounts/ChartOfAccounts.tsx
|
|
11872
|
-
import
|
|
11876
|
+
import React155, { useContext as useContext25, useState as useState42 } from "react";
|
|
11873
11877
|
|
|
11874
11878
|
// src/contexts/ChartOfAccountsContext/ChartOfAccountsContext.tsx
|
|
11875
11879
|
import { createContext as createContext10 } from "react";
|
|
@@ -12502,14 +12506,14 @@ var useLedgerAccounts = () => {
|
|
|
12502
12506
|
};
|
|
12503
12507
|
|
|
12504
12508
|
// src/components/ChartOfAccountsTable/ChartOfAccountsTable.tsx
|
|
12505
|
-
import
|
|
12509
|
+
import React147, { useContext as useContext21, useState as useState39 } from "react";
|
|
12506
12510
|
|
|
12507
12511
|
// src/components/ChartOfAccountsDatePicker/ChartOfAccountsDatePicker.tsx
|
|
12508
|
-
import
|
|
12512
|
+
import React141, { useContext as useContext18 } from "react";
|
|
12509
12513
|
import { endOfMonth as endOfMonth11, startOfMonth as startOfMonth13 } from "date-fns";
|
|
12510
12514
|
var ChartOfAccountsDatePicker = () => {
|
|
12511
12515
|
const { changeDateRange, dateRange } = useContext18(ChartOfAccountsContext);
|
|
12512
|
-
return /* @__PURE__ */
|
|
12516
|
+
return /* @__PURE__ */ React141.createElement(
|
|
12513
12517
|
DatePicker,
|
|
12514
12518
|
{
|
|
12515
12519
|
mode: "monthPicker",
|
|
@@ -12527,11 +12531,11 @@ var ChartOfAccountsDatePicker = () => {
|
|
|
12527
12531
|
};
|
|
12528
12532
|
|
|
12529
12533
|
// src/components/ChartOfAccountsRow/ChartOfAccountsRow.tsx
|
|
12530
|
-
import
|
|
12534
|
+
import React143, { useContext as useContext19, useEffect as useEffect35, useState as useState38 } from "react";
|
|
12531
12535
|
|
|
12532
12536
|
// src/icons/Edit2.tsx
|
|
12533
|
-
import * as
|
|
12534
|
-
var Edit2 = ({ size = 18, ...props }) => /* @__PURE__ */
|
|
12537
|
+
import * as React142 from "react";
|
|
12538
|
+
var Edit2 = ({ size = 18, ...props }) => /* @__PURE__ */ React142.createElement(
|
|
12535
12539
|
"svg",
|
|
12536
12540
|
{
|
|
12537
12541
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12541,7 +12545,7 @@ var Edit2 = ({ size = 18, ...props }) => /* @__PURE__ */ React141.createElement(
|
|
|
12541
12545
|
width: size,
|
|
12542
12546
|
height: size
|
|
12543
12547
|
},
|
|
12544
|
-
/* @__PURE__ */
|
|
12548
|
+
/* @__PURE__ */ React142.createElement(
|
|
12545
12549
|
"path",
|
|
12546
12550
|
{
|
|
12547
12551
|
d: "M12.75 2.25C12.947 2.05301 13.1808 1.89676 13.4382 1.79015C13.6956 1.68355 13.9714 1.62868 14.25 1.62868C14.5286 1.62868 14.8044 1.68355 15.0618 1.79015C15.3192 1.89676 15.553 2.05301 15.75 2.25C15.947 2.44698 16.1032 2.68083 16.2098 2.9382C16.3165 3.19557 16.3713 3.47142 16.3713 3.75C16.3713 4.02857 16.3165 4.30442 16.2098 4.56179C16.1032 4.81916 15.947 5.05302 15.75 5.25L5.625 15.375L1.5 16.5L2.625 12.375L12.75 2.25Z",
|
|
@@ -12625,7 +12629,7 @@ var ChartOfAccountsRow = ({
|
|
|
12625
12629
|
baseClass,
|
|
12626
12630
|
"Layer__chart-of-accounts__row---mobile"
|
|
12627
12631
|
);
|
|
12628
|
-
return /* @__PURE__ */
|
|
12632
|
+
return /* @__PURE__ */ React143.createElement(React143.Fragment, null, view === "desktop" && /* @__PURE__ */ React143.createElement(
|
|
12629
12633
|
"tr",
|
|
12630
12634
|
{
|
|
12631
12635
|
className: desktopRowClass,
|
|
@@ -12635,7 +12639,7 @@ var ChartOfAccountsRow = ({
|
|
|
12635
12639
|
setAccountId(account.id);
|
|
12636
12640
|
}
|
|
12637
12641
|
},
|
|
12638
|
-
/* @__PURE__ */
|
|
12642
|
+
/* @__PURE__ */ React143.createElement("td", { className: "Layer__table-cell Layer__coa__name" }, /* @__PURE__ */ React143.createElement("span", { className: "Layer__table-cell-content", style }, /* @__PURE__ */ React143.createElement(
|
|
12639
12643
|
"span",
|
|
12640
12644
|
{
|
|
12641
12645
|
className: "Layer__table-cell-content-indentation",
|
|
@@ -12643,7 +12647,7 @@ var ChartOfAccountsRow = ({
|
|
|
12643
12647
|
paddingLeft: INDENTATION * depth + 16
|
|
12644
12648
|
}
|
|
12645
12649
|
},
|
|
12646
|
-
account.sub_accounts && account.sub_accounts.length > 0 && /* @__PURE__ */
|
|
12650
|
+
account.sub_accounts && account.sub_accounts.length > 0 && /* @__PURE__ */ React143.createElement(
|
|
12647
12651
|
ChevronDownFill_default,
|
|
12648
12652
|
{
|
|
12649
12653
|
size: 16,
|
|
@@ -12654,22 +12658,22 @@ var ChartOfAccountsRow = ({
|
|
|
12654
12658
|
}
|
|
12655
12659
|
}
|
|
12656
12660
|
),
|
|
12657
|
-
/* @__PURE__ */
|
|
12661
|
+
/* @__PURE__ */ React143.createElement("span", { className: "Layer__coa__name__text" }, account.name)
|
|
12658
12662
|
))),
|
|
12659
|
-
/* @__PURE__ */
|
|
12663
|
+
/* @__PURE__ */ React143.createElement("td", { className: "Layer__table-cell Layer__coa__type" }, /* @__PURE__ */ React143.createElement(
|
|
12660
12664
|
"span",
|
|
12661
12665
|
{
|
|
12662
12666
|
className: "Layer__table-cell-content Layer__mobile--hidden",
|
|
12663
12667
|
style
|
|
12664
12668
|
},
|
|
12665
12669
|
account.account_type?.display_name
|
|
12666
|
-
), /* @__PURE__ */
|
|
12670
|
+
), /* @__PURE__ */ React143.createElement(
|
|
12667
12671
|
"span",
|
|
12668
12672
|
{
|
|
12669
12673
|
className: "Layer__table-cell-content Layer__desktop--hidden",
|
|
12670
12674
|
style
|
|
12671
12675
|
},
|
|
12672
|
-
/* @__PURE__ */
|
|
12676
|
+
/* @__PURE__ */ React143.createElement(
|
|
12673
12677
|
Text,
|
|
12674
12678
|
{
|
|
12675
12679
|
weight: "bold" /* bold */,
|
|
@@ -12677,10 +12681,10 @@ var ChartOfAccountsRow = ({
|
|
|
12677
12681
|
},
|
|
12678
12682
|
account.normality
|
|
12679
12683
|
),
|
|
12680
|
-
/* @__PURE__ */
|
|
12684
|
+
/* @__PURE__ */ React143.createElement(Text, { className: "Layer__coa__subtype--mobile" }, account.account_subtype?.display_name)
|
|
12681
12685
|
)),
|
|
12682
|
-
/* @__PURE__ */
|
|
12683
|
-
/* @__PURE__ */
|
|
12686
|
+
/* @__PURE__ */ React143.createElement("td", { className: "Layer__table-cell Layer__coa__subtype Layer__mobile--hidden" }, /* @__PURE__ */ React143.createElement("span", { className: "Layer__table-cell-content", style }, account.account_subtype?.display_name)),
|
|
12687
|
+
/* @__PURE__ */ React143.createElement("td", { className: "Layer__table-cell Layer__coa__balance" }, /* @__PURE__ */ React143.createElement(
|
|
12684
12688
|
"span",
|
|
12685
12689
|
{
|
|
12686
12690
|
className: "Layer__table-cell-content Layer__table-cell--amount",
|
|
@@ -12689,11 +12693,11 @@ var ChartOfAccountsRow = ({
|
|
|
12689
12693
|
"$",
|
|
12690
12694
|
centsToDollars(Math.abs(account.balance || 0))
|
|
12691
12695
|
)),
|
|
12692
|
-
/* @__PURE__ */
|
|
12696
|
+
/* @__PURE__ */ React143.createElement("td", { className: "Layer__table-cell Layer__coa__actions" }, /* @__PURE__ */ React143.createElement("span", { className: "Layer__table-cell-content", style }, /* @__PURE__ */ React143.createElement(
|
|
12693
12697
|
Button,
|
|
12694
12698
|
{
|
|
12695
12699
|
variant: "secondary" /* secondary */,
|
|
12696
|
-
rightIcon: /* @__PURE__ */
|
|
12700
|
+
rightIcon: /* @__PURE__ */ React143.createElement(Edit2_default, { size: 12 }),
|
|
12697
12701
|
iconOnly: true,
|
|
12698
12702
|
onClick: (e) => {
|
|
12699
12703
|
e.preventDefault();
|
|
@@ -12703,7 +12707,7 @@ var ChartOfAccountsRow = ({
|
|
|
12703
12707
|
},
|
|
12704
12708
|
"Edit"
|
|
12705
12709
|
)))
|
|
12706
|
-
), view === "mobile" || view === "tablet" ? /* @__PURE__ */
|
|
12710
|
+
), view === "mobile" || view === "tablet" ? /* @__PURE__ */ React143.createElement(
|
|
12707
12711
|
"tr",
|
|
12708
12712
|
{
|
|
12709
12713
|
className: mobileRowClass,
|
|
@@ -12713,7 +12717,7 @@ var ChartOfAccountsRow = ({
|
|
|
12713
12717
|
setAccountId(account.id);
|
|
12714
12718
|
}
|
|
12715
12719
|
},
|
|
12716
|
-
/* @__PURE__ */
|
|
12720
|
+
/* @__PURE__ */ React143.createElement("td", { className: "Layer__table-cell", colSpan: 5 }, /* @__PURE__ */ React143.createElement(
|
|
12717
12721
|
"span",
|
|
12718
12722
|
{
|
|
12719
12723
|
className: "Layer__table-cell-content Layer__table-cell-content-indentation",
|
|
@@ -12722,7 +12726,7 @@ var ChartOfAccountsRow = ({
|
|
|
12722
12726
|
...style
|
|
12723
12727
|
}
|
|
12724
12728
|
},
|
|
12725
|
-
account.sub_accounts && account.sub_accounts.length > 0 && /* @__PURE__ */
|
|
12729
|
+
account.sub_accounts && account.sub_accounts.length > 0 && /* @__PURE__ */ React143.createElement(
|
|
12726
12730
|
ChevronDownFill_default,
|
|
12727
12731
|
{
|
|
12728
12732
|
size: 16,
|
|
@@ -12733,14 +12737,14 @@ var ChartOfAccountsRow = ({
|
|
|
12733
12737
|
}
|
|
12734
12738
|
}
|
|
12735
12739
|
),
|
|
12736
|
-
/* @__PURE__ */
|
|
12740
|
+
/* @__PURE__ */ React143.createElement("div", { className: "Layer__chart-of-accounts__mobile-row-content" }, /* @__PURE__ */ React143.createElement("div", { className: "Layer__chart-of-accounts__mobile-row-content__top-row" }, /* @__PURE__ */ React143.createElement(
|
|
12737
12741
|
Text,
|
|
12738
12742
|
{
|
|
12739
12743
|
as: "span",
|
|
12740
12744
|
className: "Layer__chart-of-accounts__mobile-row-content__name"
|
|
12741
12745
|
},
|
|
12742
12746
|
account.name
|
|
12743
|
-
), /* @__PURE__ */
|
|
12747
|
+
), /* @__PURE__ */ React143.createElement(
|
|
12744
12748
|
TextButton,
|
|
12745
12749
|
{
|
|
12746
12750
|
onClick: (e) => {
|
|
@@ -12750,7 +12754,7 @@ var ChartOfAccountsRow = ({
|
|
|
12750
12754
|
}
|
|
12751
12755
|
},
|
|
12752
12756
|
"Edit"
|
|
12753
|
-
)), /* @__PURE__ */
|
|
12757
|
+
)), /* @__PURE__ */ React143.createElement("div", { className: "Layer__chart-of-accounts__mobile-row-content__bottom-row" }, /* @__PURE__ */ React143.createElement("div", { className: "Layer__chart-of-accounts__mobile-row-content__types" }, /* @__PURE__ */ React143.createElement(Text, { as: "span" }, account.normality), /* @__PURE__ */ React143.createElement("span", { className: "Layer__chart-of-accounts__mobile-row-content__separator" }), /* @__PURE__ */ React143.createElement(Text, { as: "span" }, "Sub-Type")), /* @__PURE__ */ React143.createElement(
|
|
12754
12758
|
Text,
|
|
12755
12759
|
{
|
|
12756
12760
|
as: "span",
|
|
@@ -12760,7 +12764,7 @@ var ChartOfAccountsRow = ({
|
|
|
12760
12764
|
centsToDollars(Math.abs(account.balance || 0))
|
|
12761
12765
|
)))
|
|
12762
12766
|
))
|
|
12763
|
-
) : null, (account.sub_accounts || []).map((subAccount, idx) => /* @__PURE__ */
|
|
12767
|
+
) : null, (account.sub_accounts || []).map((subAccount, idx) => /* @__PURE__ */ React143.createElement(
|
|
12764
12768
|
ChartOfAccountsRow,
|
|
12765
12769
|
{
|
|
12766
12770
|
key: subAccount.id,
|
|
@@ -12777,10 +12781,10 @@ var ChartOfAccountsRow = ({
|
|
|
12777
12781
|
};
|
|
12778
12782
|
|
|
12779
12783
|
// src/components/ChartOfAccountsSidebar/ChartOfAccountsSidebar.tsx
|
|
12780
|
-
import
|
|
12784
|
+
import React146 from "react";
|
|
12781
12785
|
|
|
12782
12786
|
// src/components/ChartOfAccountsForm/ChartOfAccountsForm.tsx
|
|
12783
|
-
import
|
|
12787
|
+
import React145, { useContext as useContext20, useMemo as useMemo13 } from "react";
|
|
12784
12788
|
|
|
12785
12789
|
// src/components/ChartOfAccountsForm/useParentOptions.ts
|
|
12786
12790
|
import { useMemo as useMemo12 } from "react";
|
|
@@ -12817,7 +12821,7 @@ var ChartOfAccountsForm = ({ stringOverrides }) => {
|
|
|
12817
12821
|
if (!form) {
|
|
12818
12822
|
return;
|
|
12819
12823
|
}
|
|
12820
|
-
return /* @__PURE__ */
|
|
12824
|
+
return /* @__PURE__ */ React145.createElement(
|
|
12821
12825
|
"form",
|
|
12822
12826
|
{
|
|
12823
12827
|
className: "Layer__form",
|
|
@@ -12826,7 +12830,7 @@ var ChartOfAccountsForm = ({ stringOverrides }) => {
|
|
|
12826
12830
|
submitForm();
|
|
12827
12831
|
}
|
|
12828
12832
|
},
|
|
12829
|
-
/* @__PURE__ */
|
|
12833
|
+
/* @__PURE__ */ React145.createElement("div", { className: "Layer__chart-of-accounts__sidebar__header" }, /* @__PURE__ */ React145.createElement(Text, { size: "lg" /* lg */, weight: "bold" /* bold */, className: "title" }, form?.action === "edit" ? stringOverrides?.editModeHeader || "Edit Account" : stringOverrides?.createModeHeader || "Add New Account"), /* @__PURE__ */ React145.createElement("div", { className: "actions" }, /* @__PURE__ */ React145.createElement(
|
|
12830
12834
|
Button,
|
|
12831
12835
|
{
|
|
12832
12836
|
type: "button",
|
|
@@ -12835,7 +12839,7 @@ var ChartOfAccountsForm = ({ stringOverrides }) => {
|
|
|
12835
12839
|
disabled: sendingForm
|
|
12836
12840
|
},
|
|
12837
12841
|
stringOverrides?.cancelButton || "Cancel"
|
|
12838
|
-
), apiError && /* @__PURE__ */
|
|
12842
|
+
), apiError && /* @__PURE__ */ React145.createElement(
|
|
12839
12843
|
RetryButton,
|
|
12840
12844
|
{
|
|
12841
12845
|
type: "submit",
|
|
@@ -12844,7 +12848,7 @@ var ChartOfAccountsForm = ({ stringOverrides }) => {
|
|
|
12844
12848
|
disabled: sendingForm
|
|
12845
12849
|
},
|
|
12846
12850
|
stringOverrides?.retryButton || "Retry"
|
|
12847
|
-
), !apiError && /* @__PURE__ */
|
|
12851
|
+
), !apiError && /* @__PURE__ */ React145.createElement(
|
|
12848
12852
|
SubmitButton,
|
|
12849
12853
|
{
|
|
12850
12854
|
type: "submit",
|
|
@@ -12854,7 +12858,7 @@ var ChartOfAccountsForm = ({ stringOverrides }) => {
|
|
|
12854
12858
|
},
|
|
12855
12859
|
stringOverrides?.saveButton || "Save"
|
|
12856
12860
|
))),
|
|
12857
|
-
apiError && /* @__PURE__ */
|
|
12861
|
+
apiError && /* @__PURE__ */ React145.createElement(
|
|
12858
12862
|
Text,
|
|
12859
12863
|
{
|
|
12860
12864
|
size: "sm" /* sm */,
|
|
@@ -12862,8 +12866,8 @@ var ChartOfAccountsForm = ({ stringOverrides }) => {
|
|
|
12862
12866
|
},
|
|
12863
12867
|
apiError
|
|
12864
12868
|
),
|
|
12865
|
-
entry && /* @__PURE__ */
|
|
12866
|
-
/* @__PURE__ */
|
|
12869
|
+
entry && /* @__PURE__ */ React145.createElement("div", { className: "Layer__chart-of-accounts__form-edit-entry" }, /* @__PURE__ */ React145.createElement(Text, { weight: "bold" /* bold */ }, entry.name), /* @__PURE__ */ React145.createElement(Text, { weight: "bold" /* bold */ }, "$", centsToDollars(entry.balance || 0))),
|
|
12870
|
+
/* @__PURE__ */ React145.createElement("div", { className: "Layer__chart-of-accounts__form" }, /* @__PURE__ */ React145.createElement(InputGroup, { name: "parent", label: stringOverrides?.parentLabel || "Parent", inline: true }, /* @__PURE__ */ React145.createElement(
|
|
12867
12871
|
Select2,
|
|
12868
12872
|
{
|
|
12869
12873
|
options: parentOptions,
|
|
@@ -12871,7 +12875,7 @@ var ChartOfAccountsForm = ({ stringOverrides }) => {
|
|
|
12871
12875
|
onChange: (sel) => changeFormData("parent", sel),
|
|
12872
12876
|
disabled: sendingForm
|
|
12873
12877
|
}
|
|
12874
|
-
)), /* @__PURE__ */
|
|
12878
|
+
)), /* @__PURE__ */ React145.createElement(InputGroup, { name: "name", label: stringOverrides?.nameLabel || "Name", inline: true }, /* @__PURE__ */ React145.createElement(
|
|
12875
12879
|
Input,
|
|
12876
12880
|
{
|
|
12877
12881
|
name: "name",
|
|
@@ -12882,7 +12886,7 @@ var ChartOfAccountsForm = ({ stringOverrides }) => {
|
|
|
12882
12886
|
disabled: sendingForm,
|
|
12883
12887
|
onChange: (e) => changeFormData("name", e.target.value)
|
|
12884
12888
|
}
|
|
12885
|
-
)), /* @__PURE__ */
|
|
12889
|
+
)), /* @__PURE__ */ React145.createElement(InputGroup, { name: "type", label: stringOverrides?.typeLabel || "Type", inline: true }, /* @__PURE__ */ React145.createElement(
|
|
12886
12890
|
Select2,
|
|
12887
12891
|
{
|
|
12888
12892
|
options: LEDGER_ACCOUNT_TYPES,
|
|
@@ -12892,7 +12896,7 @@ var ChartOfAccountsForm = ({ stringOverrides }) => {
|
|
|
12892
12896
|
errorMessage: form?.errors?.find((x) => x.field === "type")?.message,
|
|
12893
12897
|
disabled: sendingForm || form.action === "edit" || form.data.parent !== void 0
|
|
12894
12898
|
}
|
|
12895
|
-
)), /* @__PURE__ */
|
|
12899
|
+
)), /* @__PURE__ */ React145.createElement(InputGroup, { name: "subType", label: stringOverrides?.subTypeLabel || "Sub-Type", inline: true }, /* @__PURE__ */ React145.createElement(
|
|
12896
12900
|
Select2,
|
|
12897
12901
|
{
|
|
12898
12902
|
options: form?.data.type?.value !== void 0 ? LEDGER_ACCOUNT_SUBTYPES_FOR_TYPE[form?.data.type?.value] : LEDGER_ACCOUNT_SUBTYPES,
|
|
@@ -12900,7 +12904,7 @@ var ChartOfAccountsForm = ({ stringOverrides }) => {
|
|
|
12900
12904
|
onChange: (sel) => changeFormData("subType", sel),
|
|
12901
12905
|
disabled: sendingForm
|
|
12902
12906
|
}
|
|
12903
|
-
)), /* @__PURE__ */
|
|
12907
|
+
)), /* @__PURE__ */ React145.createElement(InputGroup, { name: "normality", label: stringOverrides?.normalityLabel || "Normality", inline: true }, /* @__PURE__ */ React145.createElement(
|
|
12904
12908
|
Select2,
|
|
12905
12909
|
{
|
|
12906
12910
|
options: NORMALITY_OPTIONS,
|
|
@@ -12912,7 +12916,7 @@ var ChartOfAccountsForm = ({ stringOverrides }) => {
|
|
|
12912
12916
|
onChange: (sel) => changeFormData("normality", sel),
|
|
12913
12917
|
disabled: sendingForm
|
|
12914
12918
|
}
|
|
12915
|
-
)), /* @__PURE__ */
|
|
12919
|
+
)), /* @__PURE__ */ React145.createElement("div", { className: "actions" }, /* @__PURE__ */ React145.createElement(
|
|
12916
12920
|
Button,
|
|
12917
12921
|
{
|
|
12918
12922
|
type: "button",
|
|
@@ -12921,7 +12925,7 @@ var ChartOfAccountsForm = ({ stringOverrides }) => {
|
|
|
12921
12925
|
disabled: sendingForm
|
|
12922
12926
|
},
|
|
12923
12927
|
stringOverrides?.cancelButton || "Cancel"
|
|
12924
|
-
), apiError && /* @__PURE__ */
|
|
12928
|
+
), apiError && /* @__PURE__ */ React145.createElement(
|
|
12925
12929
|
RetryButton,
|
|
12926
12930
|
{
|
|
12927
12931
|
type: "submit",
|
|
@@ -12930,7 +12934,7 @@ var ChartOfAccountsForm = ({ stringOverrides }) => {
|
|
|
12930
12934
|
disabled: sendingForm
|
|
12931
12935
|
},
|
|
12932
12936
|
stringOverrides?.retryButton || "Retry"
|
|
12933
|
-
), !apiError && /* @__PURE__ */
|
|
12937
|
+
), !apiError && /* @__PURE__ */ React145.createElement(
|
|
12934
12938
|
SubmitButton,
|
|
12935
12939
|
{
|
|
12936
12940
|
type: "submit",
|
|
@@ -12948,7 +12952,7 @@ var ChartOfAccountsSidebar = ({
|
|
|
12948
12952
|
parentRef: _parentRef,
|
|
12949
12953
|
stringOverrides
|
|
12950
12954
|
}) => {
|
|
12951
|
-
return /* @__PURE__ */
|
|
12955
|
+
return /* @__PURE__ */ React146.createElement(ChartOfAccountsForm, { stringOverrides });
|
|
12952
12956
|
};
|
|
12953
12957
|
|
|
12954
12958
|
// src/components/ChartOfAccountsTable/ChartOfAccountsTable.tsx
|
|
@@ -12965,10 +12969,10 @@ var ChartOfAccountsTable = ({
|
|
|
12965
12969
|
const [expandAll, setExpandAll] = useState39();
|
|
12966
12970
|
let cumulativeIndex = 0;
|
|
12967
12971
|
const accountsLength = data?.accounts.length ?? 0;
|
|
12968
|
-
return /* @__PURE__ */
|
|
12972
|
+
return /* @__PURE__ */ React147.createElement(
|
|
12969
12973
|
Panel,
|
|
12970
12974
|
{
|
|
12971
|
-
sidebar: /* @__PURE__ */
|
|
12975
|
+
sidebar: /* @__PURE__ */ React147.createElement(
|
|
12972
12976
|
ChartOfAccountsSidebar,
|
|
12973
12977
|
{
|
|
12974
12978
|
parentRef: containerRef,
|
|
@@ -12978,13 +12982,13 @@ var ChartOfAccountsTable = ({
|
|
|
12978
12982
|
sidebarIsOpen: Boolean(form),
|
|
12979
12983
|
parentRef: containerRef
|
|
12980
12984
|
},
|
|
12981
|
-
/* @__PURE__ */
|
|
12985
|
+
/* @__PURE__ */ React147.createElement(
|
|
12982
12986
|
Header,
|
|
12983
12987
|
{
|
|
12984
12988
|
className: `Layer__${COMPONENT_NAME5}__header`,
|
|
12985
12989
|
layout: withDateControl ? "next-line-actions" /* NEXT_LINE_ACTIONS */ : void 0
|
|
12986
12990
|
},
|
|
12987
|
-
/* @__PURE__ */
|
|
12991
|
+
/* @__PURE__ */ React147.createElement(
|
|
12988
12992
|
Heading,
|
|
12989
12993
|
{
|
|
12990
12994
|
className: `Layer__${COMPONENT_NAME5}__title`,
|
|
@@ -12992,12 +12996,12 @@ var ChartOfAccountsTable = ({
|
|
|
12992
12996
|
},
|
|
12993
12997
|
stringOverrides?.headerText || "Chart of Accounts"
|
|
12994
12998
|
),
|
|
12995
|
-
/* @__PURE__ */
|
|
12999
|
+
/* @__PURE__ */ React147.createElement(
|
|
12996
13000
|
"div",
|
|
12997
13001
|
{
|
|
12998
13002
|
className: `Layer__${COMPONENT_NAME5}__actions Layer__header__actions`
|
|
12999
13003
|
},
|
|
13000
|
-
withDateControl || withExpandAllButton ? /* @__PURE__ */
|
|
13004
|
+
withDateControl || withExpandAllButton ? /* @__PURE__ */ React147.createElement("div", { className: "Layer__header__actions-col" }, withDateControl && /* @__PURE__ */ React147.createElement(ChartOfAccountsDatePicker, null), withExpandAllButton && /* @__PURE__ */ React147.createElement(
|
|
13001
13005
|
Button,
|
|
13002
13006
|
{
|
|
13003
13007
|
variant: "secondary" /* secondary */,
|
|
@@ -13007,13 +13011,13 @@ var ChartOfAccountsTable = ({
|
|
|
13007
13011
|
},
|
|
13008
13012
|
!expandAll || expandAll === "collapsed" ? "Expand all rows" : "Collapse all rows"
|
|
13009
13013
|
)) : null,
|
|
13010
|
-
/* @__PURE__ */
|
|
13014
|
+
/* @__PURE__ */ React147.createElement("div", { className: "Layer__header__actions-col" }, /* @__PURE__ */ React147.createElement(Button, { onClick: () => addAccount(), disabled: isLoading }, stringOverrides?.addAccountButtonText || "Add Account"))
|
|
13011
13015
|
)
|
|
13012
13016
|
),
|
|
13013
|
-
/* @__PURE__ */
|
|
13017
|
+
/* @__PURE__ */ React147.createElement("table", { className: "Layer__chart-of-accounts__table" }, /* @__PURE__ */ React147.createElement("thead", null, /* @__PURE__ */ React147.createElement("tr", { className: "Layer__table-row--header" }, /* @__PURE__ */ React147.createElement("th", { className: "Layer__table-header Layer__coa__name" }, stringOverrides?.nameColumnHeader || "Name"), /* @__PURE__ */ React147.createElement("th", { className: "Layer__table-header Layer__coa__type" }, stringOverrides?.typeColumnHeader || "Type"), /* @__PURE__ */ React147.createElement("th", { className: "Layer__table-header Layer__coa__subtype Layer__mobile--hidden" }, stringOverrides?.subtypeColumnHeader || "Sub-Type"), /* @__PURE__ */ React147.createElement("th", { className: "Layer__table-header Layer__coa__balance" }, stringOverrides?.balanceColumnHeader || "Balance"), /* @__PURE__ */ React147.createElement("th", { className: "Layer__table-header Layer__coa__actions" }))), /* @__PURE__ */ React147.createElement("tbody", null, !error && data?.accounts.map((account, idx) => {
|
|
13014
13018
|
const currentCumulativeIndex = cumulativeIndex;
|
|
13015
13019
|
cumulativeIndex = (account.sub_accounts?.length || 0) + cumulativeIndex + 1;
|
|
13016
|
-
return /* @__PURE__ */
|
|
13020
|
+
return /* @__PURE__ */ React147.createElement(
|
|
13017
13021
|
ChartOfAccountsRow,
|
|
13018
13022
|
{
|
|
13019
13023
|
key: account.id,
|
|
@@ -13029,7 +13033,7 @@ var ChartOfAccountsTable = ({
|
|
|
13029
13033
|
}
|
|
13030
13034
|
);
|
|
13031
13035
|
}))),
|
|
13032
|
-
error ? /* @__PURE__ */
|
|
13036
|
+
error ? /* @__PURE__ */ React147.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React147.createElement(
|
|
13033
13037
|
DataState,
|
|
13034
13038
|
{
|
|
13035
13039
|
status: "failed" /* failed */,
|
|
@@ -13039,8 +13043,8 @@ var ChartOfAccountsTable = ({
|
|
|
13039
13043
|
isLoading: isValidating || isLoading
|
|
13040
13044
|
}
|
|
13041
13045
|
)) : null,
|
|
13042
|
-
(!data || isLoading) && !error ? /* @__PURE__ */
|
|
13043
|
-
!isLoading && !error && data?.accounts.length === 0 ? /* @__PURE__ */
|
|
13046
|
+
(!data || isLoading) && !error ? /* @__PURE__ */ React147.createElement("div", { className: `Layer__${COMPONENT_NAME5}__loader-container` }, /* @__PURE__ */ React147.createElement(Loader2, null)) : null,
|
|
13047
|
+
!isLoading && !error && data?.accounts.length === 0 ? /* @__PURE__ */ React147.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React147.createElement(
|
|
13044
13048
|
DataState,
|
|
13045
13049
|
{
|
|
13046
13050
|
status: "info" /* info */,
|
|
@@ -13054,7 +13058,7 @@ var ChartOfAccountsTable = ({
|
|
|
13054
13058
|
};
|
|
13055
13059
|
|
|
13056
13060
|
// src/components/LedgerAccount/LedgerAccountIndex.tsx
|
|
13057
|
-
import
|
|
13061
|
+
import React154, {
|
|
13058
13062
|
useContext as useContext24,
|
|
13059
13063
|
useEffect as useEffect37,
|
|
13060
13064
|
useMemo as useMemo15,
|
|
@@ -13062,17 +13066,17 @@ import React153, {
|
|
|
13062
13066
|
} from "react";
|
|
13063
13067
|
|
|
13064
13068
|
// src/components/LedgerAccountEntryDetails/LedgerAccountEntryDetails.tsx
|
|
13065
|
-
import
|
|
13069
|
+
import React152, { useContext as useContext22, useMemo as useMemo14 } from "react";
|
|
13066
13070
|
|
|
13067
13071
|
// src/components/Card/Card.tsx
|
|
13068
|
-
import
|
|
13072
|
+
import React148 from "react";
|
|
13069
13073
|
import classNames52 from "classnames";
|
|
13070
13074
|
var Card = ({ children, className }) => {
|
|
13071
|
-
return /* @__PURE__ */
|
|
13075
|
+
return /* @__PURE__ */ React148.createElement("div", { className: classNames52("Layer__card", className) }, children);
|
|
13072
13076
|
};
|
|
13073
13077
|
|
|
13074
13078
|
// src/components/DateTime/DateTime.tsx
|
|
13075
|
-
import
|
|
13079
|
+
import React149 from "react";
|
|
13076
13080
|
import { parseISO as parseISO13, format as formatTime9 } from "date-fns";
|
|
13077
13081
|
var DateTime = ({
|
|
13078
13082
|
value,
|
|
@@ -13083,11 +13087,11 @@ var DateTime = ({
|
|
|
13083
13087
|
onlyTime
|
|
13084
13088
|
}) => {
|
|
13085
13089
|
if (format7) {
|
|
13086
|
-
return /* @__PURE__ */
|
|
13090
|
+
return /* @__PURE__ */ React149.createElement(Text, { className: "Layer__datetime" }, formatTime9(parseISO13(value), format7));
|
|
13087
13091
|
}
|
|
13088
13092
|
const date = formatTime9(parseISO13(value), dateFormat ?? DATE_FORMAT);
|
|
13089
13093
|
const time = formatTime9(parseISO13(value), timeFormat ?? TIME_FORMAT);
|
|
13090
|
-
return /* @__PURE__ */
|
|
13094
|
+
return /* @__PURE__ */ React149.createElement(Text, { className: "Layer__datetime" }, !onlyTime && /* @__PURE__ */ React149.createElement(
|
|
13091
13095
|
Text,
|
|
13092
13096
|
{
|
|
13093
13097
|
as: "span",
|
|
@@ -13096,7 +13100,7 @@ var DateTime = ({
|
|
|
13096
13100
|
className: "Layer__datetime__date"
|
|
13097
13101
|
},
|
|
13098
13102
|
date
|
|
13099
|
-
), !onlyDate && /* @__PURE__ */
|
|
13103
|
+
), !onlyDate && /* @__PURE__ */ React149.createElement(
|
|
13100
13104
|
Text,
|
|
13101
13105
|
{
|
|
13102
13106
|
as: "span",
|
|
@@ -13109,7 +13113,7 @@ var DateTime = ({
|
|
|
13109
13113
|
};
|
|
13110
13114
|
|
|
13111
13115
|
// src/components/DetailsList/DetailsList.tsx
|
|
13112
|
-
import
|
|
13116
|
+
import React150 from "react";
|
|
13113
13117
|
import classNames53 from "classnames";
|
|
13114
13118
|
var DetailsList = ({
|
|
13115
13119
|
title,
|
|
@@ -13117,14 +13121,14 @@ var DetailsList = ({
|
|
|
13117
13121
|
className,
|
|
13118
13122
|
actions
|
|
13119
13123
|
}) => {
|
|
13120
|
-
return /* @__PURE__ */
|
|
13124
|
+
return /* @__PURE__ */ React150.createElement("div", { className: classNames53("Layer__details-list", className) }, title && /* @__PURE__ */ React150.createElement(Header, null, /* @__PURE__ */ React150.createElement(Heading, { size: "secondary" /* secondary */ }, title), actions && /* @__PURE__ */ React150.createElement("div", { className: "Layer__details-list__actions" }, actions)), /* @__PURE__ */ React150.createElement("ul", { className: "Layer__details-list__list" }, children));
|
|
13121
13125
|
};
|
|
13122
13126
|
|
|
13123
13127
|
// src/components/DetailsList/DetailsListItem.tsx
|
|
13124
|
-
import
|
|
13128
|
+
import React151 from "react";
|
|
13125
13129
|
var renderValue = (value) => {
|
|
13126
13130
|
if (typeof value === "string") {
|
|
13127
|
-
return /* @__PURE__ */
|
|
13131
|
+
return /* @__PURE__ */ React151.createElement(Text, { weight: "bold" /* bold */, size: "sm" /* sm */ }, value);
|
|
13128
13132
|
}
|
|
13129
13133
|
return value;
|
|
13130
13134
|
};
|
|
@@ -13133,7 +13137,7 @@ var DetailsListItem = ({
|
|
|
13133
13137
|
children,
|
|
13134
13138
|
isLoading
|
|
13135
13139
|
}) => {
|
|
13136
|
-
return /* @__PURE__ */
|
|
13140
|
+
return /* @__PURE__ */ React151.createElement("li", { className: "Layer__details-list-item" }, /* @__PURE__ */ React151.createElement("label", { className: "Layer__details-list-item__label" }, label), /* @__PURE__ */ React151.createElement("span", { className: "Layer__details-list-item__value" }, isLoading ? /* @__PURE__ */ React151.createElement(SkeletonLoader, null) : renderValue(children)));
|
|
13137
13141
|
};
|
|
13138
13142
|
|
|
13139
13143
|
// src/components/LedgerAccountEntryDetails/LedgerAccountEntryDetails.tsx
|
|
@@ -13141,31 +13145,31 @@ var SourceDetailView = ({ source, stringOverrides }) => {
|
|
|
13141
13145
|
switch (source.type) {
|
|
13142
13146
|
case "Transaction_Ledger_Entry_Source": {
|
|
13143
13147
|
const transactionSource = source;
|
|
13144
|
-
return /* @__PURE__ */
|
|
13148
|
+
return /* @__PURE__ */ React152.createElement(React152.Fragment, null, /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.accountNameLabel || "Account name" }, transactionSource.account_name), /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.dateLabel || "Date" }, /* @__PURE__ */ React152.createElement(DateTime, { value: transactionSource.date })), /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.amountLabel || "Amount" }, `$${centsToDollars(transactionSource.amount)}`), /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.directionLabel || "Direction" }, transactionSource.direction), /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.counterpartyLabel || "Counterparty" }, transactionSource.counterparty));
|
|
13145
13149
|
}
|
|
13146
13150
|
case "Invoice_Ledger_Entry_Source": {
|
|
13147
13151
|
const invoiceSource = source;
|
|
13148
|
-
return /* @__PURE__ */
|
|
13152
|
+
return /* @__PURE__ */ React152.createElement(React152.Fragment, null, /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.invoiceNumberLabel || "Invoice number" }, invoiceSource.invoice_number), /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.recipientNameLabel || "Recipient name" }, invoiceSource.recipient_name), /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.dateLabel || "Date" }, /* @__PURE__ */ React152.createElement(DateTime, { value: invoiceSource.date })), /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.amountLabel || "Amount" }, `$${centsToDollars(invoiceSource.amount)}`));
|
|
13149
13153
|
}
|
|
13150
13154
|
case "Manual_Ledger_Entry_Source": {
|
|
13151
13155
|
const manualSource = source;
|
|
13152
|
-
return /* @__PURE__ */
|
|
13156
|
+
return /* @__PURE__ */ React152.createElement(React152.Fragment, null, /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.memoLabel || "Memo" }, manualSource.memo), /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.createdByLabel || "Created by" }, manualSource.created_by));
|
|
13153
13157
|
}
|
|
13154
13158
|
case "Invoice_Payment_Ledger_Entry_Source": {
|
|
13155
13159
|
const invoicePaymentSource = source;
|
|
13156
|
-
return /* @__PURE__ */
|
|
13160
|
+
return /* @__PURE__ */ React152.createElement(React152.Fragment, null, /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.invoiceNumberLabel || "Invoice number" }, invoicePaymentSource.invoice_number), /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.amountLabel || "Amount" }, `$${centsToDollars(invoicePaymentSource.amount)}`));
|
|
13157
13161
|
}
|
|
13158
13162
|
case "Refund_Ledger_Entry_Source": {
|
|
13159
13163
|
const refundSource = source;
|
|
13160
|
-
return /* @__PURE__ */
|
|
13164
|
+
return /* @__PURE__ */ React152.createElement(React152.Fragment, null, /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.amountLabel || "Amount" }, `$${centsToDollars(refundSource.refunded_to_customer_amount)}`), /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.recipientNameLabel || "Recipient name" }, refundSource.recipient_name));
|
|
13161
13165
|
}
|
|
13162
13166
|
case "Opening_Balance_Ledger_Entry_Source": {
|
|
13163
13167
|
const openingBalanceSource = source;
|
|
13164
|
-
return /* @__PURE__ */
|
|
13168
|
+
return /* @__PURE__ */ React152.createElement(React152.Fragment, null, /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.accountNameLabel || "Account name" }, openingBalanceSource.account_name));
|
|
13165
13169
|
}
|
|
13166
13170
|
case "Payout_Ledger_Entry_Source": {
|
|
13167
13171
|
const payoutSource = source;
|
|
13168
|
-
return /* @__PURE__ */
|
|
13172
|
+
return /* @__PURE__ */ React152.createElement(React152.Fragment, null, /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.amountLabel || "Amount" }, `$${centsToDollars(payoutSource.paid_out_amount)}`), /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.processorLabel || "Processor" }, payoutSource.processor));
|
|
13169
13173
|
}
|
|
13170
13174
|
default:
|
|
13171
13175
|
return null;
|
|
@@ -13185,14 +13189,14 @@ var LedgerAccountEntryDetails = ({ stringOverrides }) => {
|
|
|
13185
13189
|
});
|
|
13186
13190
|
return { totalDebit: totalDebit2, totalCredit: totalCredit2 };
|
|
13187
13191
|
}, [entryData]);
|
|
13188
|
-
return /* @__PURE__ */
|
|
13192
|
+
return /* @__PURE__ */ React152.createElement("div", { className: "Layer__ledger-account__entry-details" }, /* @__PURE__ */ React152.createElement("div", { className: "Layer__ledger-account__entry-details__back-btn" }, /* @__PURE__ */ React152.createElement(BackButton, { onClick: () => closeSelectedEntry() }), /* @__PURE__ */ React152.createElement("div", { className: "Layer__ledger-account__entry-details__title-container" }, /* @__PURE__ */ React152.createElement(Text, { weight: "bold" /* bold */ }, stringOverrides?.title || "Transaction details"))), /* @__PURE__ */ React152.createElement(
|
|
13189
13193
|
DetailsList,
|
|
13190
13194
|
{
|
|
13191
13195
|
title: stringOverrides?.transactionSource?.header || "Transaction source",
|
|
13192
|
-
actions: /* @__PURE__ */
|
|
13196
|
+
actions: /* @__PURE__ */ React152.createElement(
|
|
13193
13197
|
Button,
|
|
13194
13198
|
{
|
|
13195
|
-
rightIcon: /* @__PURE__ */
|
|
13199
|
+
rightIcon: /* @__PURE__ */ React152.createElement(X_default, null),
|
|
13196
13200
|
iconOnly: true,
|
|
13197
13201
|
onClick: closeSelectedEntry,
|
|
13198
13202
|
variant: "secondary" /* secondary */,
|
|
@@ -13200,56 +13204,56 @@ var LedgerAccountEntryDetails = ({ stringOverrides }) => {
|
|
|
13200
13204
|
}
|
|
13201
13205
|
)
|
|
13202
13206
|
},
|
|
13203
|
-
/* @__PURE__ */
|
|
13207
|
+
/* @__PURE__ */ React152.createElement(
|
|
13204
13208
|
DetailsListItem,
|
|
13205
13209
|
{
|
|
13206
13210
|
label: stringOverrides?.transactionSource?.details?.sourceLabel || "Source",
|
|
13207
13211
|
isLoading: isLoadingEntry
|
|
13208
13212
|
},
|
|
13209
|
-
/* @__PURE__ */
|
|
13213
|
+
/* @__PURE__ */ React152.createElement(Badge, null, entryData?.source?.entity_name)
|
|
13210
13214
|
),
|
|
13211
|
-
entryData?.source?.display_description && /* @__PURE__ */
|
|
13212
|
-
), /* @__PURE__ */
|
|
13215
|
+
entryData?.source?.display_description && /* @__PURE__ */ React152.createElement(SourceDetailView, { source: entryData?.source })
|
|
13216
|
+
), /* @__PURE__ */ React152.createElement(
|
|
13213
13217
|
DetailsList,
|
|
13214
13218
|
{
|
|
13215
13219
|
title: stringOverrides?.journalEntry?.header ? stringOverrides?.journalEntry?.header(entryData?.id.substring(0, 5)) : `Journal Entry ${entryData?.id.substring(0, 5)}`,
|
|
13216
13220
|
className: "Layer__border-top"
|
|
13217
13221
|
},
|
|
13218
|
-
/* @__PURE__ */
|
|
13219
|
-
/* @__PURE__ */
|
|
13220
|
-
/* @__PURE__ */
|
|
13221
|
-
entryData?.reversal_id && /* @__PURE__ */
|
|
13222
|
-
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */
|
|
13222
|
+
/* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.journalEntry?.details?.entryTypeLabel || "Entry type", isLoading: isLoadingEntry }, humanizeEnum(entryData?.entry_type ?? "")),
|
|
13223
|
+
/* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.journalEntry?.details?.dateLabel || "Date", isLoading: isLoadingEntry }, entryData?.entry_at && /* @__PURE__ */ React152.createElement(DateTime, { value: entryData?.entry_at })),
|
|
13224
|
+
/* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.journalEntry?.details?.creationDateLabel || "Creation date", isLoading: isLoadingEntry }, entryData?.date && /* @__PURE__ */ React152.createElement(DateTime, { value: entryData?.date })),
|
|
13225
|
+
entryData?.reversal_id && /* @__PURE__ */ React152.createElement(DetailsListItem, { label: stringOverrides?.journalEntry?.details?.reversalLabel || "Reversal", isLoading: isLoadingEntry }, entryData?.reversal_id.substring(0, 5))
|
|
13226
|
+
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */ React152.createElement("div", { className: "Layer__ledger-account__entry-details__line-items" }, /* @__PURE__ */ React152.createElement(Card, null, /* @__PURE__ */ React152.createElement(
|
|
13223
13227
|
Table,
|
|
13224
13228
|
{
|
|
13225
13229
|
componentName: "ledger-account__entry-details",
|
|
13226
13230
|
borderCollapse: "collapse"
|
|
13227
13231
|
},
|
|
13228
|
-
/* @__PURE__ */
|
|
13229
|
-
/* @__PURE__ */
|
|
13232
|
+
/* @__PURE__ */ React152.createElement(TableHead, null, /* @__PURE__ */ React152.createElement(TableRow, { rowKey: "soc-flow-head-row", isHeadRow: true }, /* @__PURE__ */ React152.createElement(TableCell, null, stringOverrides?.lineItemsTable?.lineItemsColumnHeader || "Line items"), /* @__PURE__ */ React152.createElement(TableCell, null, stringOverrides?.lineItemsTable?.debitColumnHeader || "Debit"), /* @__PURE__ */ React152.createElement(TableCell, null, stringOverrides?.lineItemsTable?.creditColumnHeader || "Credit"))),
|
|
13233
|
+
/* @__PURE__ */ React152.createElement(TableBody, null, entryData?.line_items?.map((item, index) => /* @__PURE__ */ React152.createElement(
|
|
13230
13234
|
TableRow,
|
|
13231
13235
|
{
|
|
13232
13236
|
key: `ledger-line-item-${index}`,
|
|
13233
13237
|
rowKey: `ledger-line-item-${index}`
|
|
13234
13238
|
},
|
|
13235
|
-
/* @__PURE__ */
|
|
13236
|
-
/* @__PURE__ */
|
|
13237
|
-
/* @__PURE__ */
|
|
13238
|
-
)), /* @__PURE__ */
|
|
13239
|
+
/* @__PURE__ */ React152.createElement(TableCell, null, item.account?.name || ""),
|
|
13240
|
+
/* @__PURE__ */ React152.createElement(TableCell, null, item.direction === "DEBIT" /* DEBIT */ && /* @__PURE__ */ React152.createElement(Badge, { variant: "warning" /* WARNING */ }, "$", centsToDollars(item.amount || 0))),
|
|
13241
|
+
/* @__PURE__ */ React152.createElement(TableCell, null, item.direction === "CREDIT" /* CREDIT */ && /* @__PURE__ */ React152.createElement(Badge, { variant: "success" /* SUCCESS */ }, "$", centsToDollars(item.amount || 0)))
|
|
13242
|
+
)), /* @__PURE__ */ React152.createElement(
|
|
13239
13243
|
TableRow,
|
|
13240
13244
|
{
|
|
13241
13245
|
rowKey: "ledger-line-item-summation",
|
|
13242
13246
|
variant: "summation"
|
|
13243
13247
|
},
|
|
13244
|
-
/* @__PURE__ */
|
|
13245
|
-
/* @__PURE__ */
|
|
13246
|
-
/* @__PURE__ */
|
|
13248
|
+
/* @__PURE__ */ React152.createElement(TableCell, { primary: true }, stringOverrides?.lineItemsTable?.totalRowHeader || "Total"),
|
|
13249
|
+
/* @__PURE__ */ React152.createElement(TableCell, { isCurrency: true, primary: true }, totalDebit || 0),
|
|
13250
|
+
/* @__PURE__ */ React152.createElement(TableCell, { isCurrency: true, primary: true }, totalCredit || 0)
|
|
13247
13251
|
))
|
|
13248
13252
|
))) : null);
|
|
13249
13253
|
};
|
|
13250
13254
|
|
|
13251
13255
|
// src/components/LedgerAccount/LedgerAccountRow.tsx
|
|
13252
|
-
import
|
|
13256
|
+
import React153, { useContext as useContext23, useEffect as useEffect36, useState as useState40 } from "react";
|
|
13253
13257
|
import classNames54 from "classnames";
|
|
13254
13258
|
import { parseISO as parseISO14, format as formatTime10 } from "date-fns";
|
|
13255
13259
|
var LedgerAccountRow = ({
|
|
@@ -13271,7 +13275,7 @@ var LedgerAccountRow = ({
|
|
|
13271
13275
|
}
|
|
13272
13276
|
}, []);
|
|
13273
13277
|
if (view === "tablet") {
|
|
13274
|
-
return /* @__PURE__ */
|
|
13278
|
+
return /* @__PURE__ */ React153.createElement(
|
|
13275
13279
|
"tr",
|
|
13276
13280
|
{
|
|
13277
13281
|
className: classNames54(
|
|
@@ -13290,21 +13294,21 @@ var LedgerAccountRow = ({
|
|
|
13290
13294
|
}
|
|
13291
13295
|
}
|
|
13292
13296
|
},
|
|
13293
|
-
/* @__PURE__ */
|
|
13297
|
+
/* @__PURE__ */ React153.createElement("td", { className: "Layer__table-cell Layer__ledger-account-table__tablet-main-col" }, /* @__PURE__ */ React153.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ React153.createElement("div", { className: "Layer__ledger-account-table__tablet-main-col__date" }, /* @__PURE__ */ React153.createElement(Text, null, row.date && formatTime10(parseISO14(row.date), DATE_FORMAT)), /* @__PURE__ */ React153.createElement(
|
|
13294
13298
|
Text,
|
|
13295
13299
|
{
|
|
13296
13300
|
weight: "normal" /* normal */,
|
|
13297
13301
|
className: "Layer__ledger_account-table__journal-id"
|
|
13298
13302
|
},
|
|
13299
13303
|
row.entry_id.substring(0, 5)
|
|
13300
|
-
)), /* @__PURE__ */
|
|
13301
|
-
/* @__PURE__ */
|
|
13302
|
-
/* @__PURE__ */
|
|
13303
|
-
/* @__PURE__ */
|
|
13304
|
+
)), /* @__PURE__ */ React153.createElement(Text, null, row.source?.display_description ?? ""))),
|
|
13305
|
+
/* @__PURE__ */ React153.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React153.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "DEBIT" /* DEBIT */ && `$${centsToDollars(row?.amount || 0)}`)),
|
|
13306
|
+
/* @__PURE__ */ React153.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React153.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "CREDIT" /* CREDIT */ && `$${centsToDollars(row?.amount || 0)}`)),
|
|
13307
|
+
/* @__PURE__ */ React153.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React153.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, `$${centsToDollars(row.running_balance)}`))
|
|
13304
13308
|
);
|
|
13305
13309
|
}
|
|
13306
13310
|
if (view === "mobile") {
|
|
13307
|
-
return /* @__PURE__ */
|
|
13311
|
+
return /* @__PURE__ */ React153.createElement(
|
|
13308
13312
|
"tr",
|
|
13309
13313
|
{
|
|
13310
13314
|
className: classNames54(
|
|
@@ -13323,17 +13327,17 @@ var LedgerAccountRow = ({
|
|
|
13323
13327
|
}
|
|
13324
13328
|
}
|
|
13325
13329
|
},
|
|
13326
|
-
/* @__PURE__ */
|
|
13330
|
+
/* @__PURE__ */ React153.createElement("td", { className: "Layer__table-cell Layer__ledger-account-table__tablet-main-col" }, /* @__PURE__ */ React153.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ React153.createElement("div", { className: "Layer__ledger-account-table__tablet-main-col__date" }, /* @__PURE__ */ React153.createElement(Text, null, row.date && formatTime10(parseISO14(row.date), DATE_FORMAT)), /* @__PURE__ */ React153.createElement(
|
|
13327
13331
|
Text,
|
|
13328
13332
|
{
|
|
13329
13333
|
weight: "normal" /* normal */,
|
|
13330
13334
|
className: "Layer__ledger_account-table__journal-id"
|
|
13331
13335
|
},
|
|
13332
13336
|
row.entry_id.substring(0, 5)
|
|
13333
|
-
)), /* @__PURE__ */
|
|
13337
|
+
)), /* @__PURE__ */ React153.createElement(Text, null, row.source?.display_description ?? ""), /* @__PURE__ */ React153.createElement("div", { className: "Layer__ledger_account-table__balances-mobile" }, /* @__PURE__ */ React153.createElement("div", { className: "Layer__ledger_account-table__balance-item" }, /* @__PURE__ */ React153.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__label" }, "Debit"), /* @__PURE__ */ React153.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__value" }, " ", row.direction === "DEBIT" /* DEBIT */ && `$${centsToDollars(row?.amount || 0)}`)), /* @__PURE__ */ React153.createElement("div", { className: "Layer__ledger_account-table__balance-item" }, /* @__PURE__ */ React153.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__label" }, "Credit"), /* @__PURE__ */ React153.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__value" }, row.direction === "CREDIT" /* CREDIT */ && `$${centsToDollars(row?.amount || 0)}`)), /* @__PURE__ */ React153.createElement("div", { className: "Layer__ledger_account-table__balance-item" }, /* @__PURE__ */ React153.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__label" }, "Running balance"), /* @__PURE__ */ React153.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__value" }, `$${centsToDollars(row.running_balance)}`)))))
|
|
13334
13338
|
);
|
|
13335
13339
|
}
|
|
13336
|
-
return /* @__PURE__ */
|
|
13340
|
+
return /* @__PURE__ */ React153.createElement(
|
|
13337
13341
|
"tr",
|
|
13338
13342
|
{
|
|
13339
13343
|
className: classNames54(
|
|
@@ -13352,12 +13356,12 @@ var LedgerAccountRow = ({
|
|
|
13352
13356
|
}
|
|
13353
13357
|
}
|
|
13354
13358
|
},
|
|
13355
|
-
/* @__PURE__ */
|
|
13356
|
-
/* @__PURE__ */
|
|
13357
|
-
/* @__PURE__ */
|
|
13358
|
-
/* @__PURE__ */
|
|
13359
|
-
/* @__PURE__ */
|
|
13360
|
-
/* @__PURE__ */
|
|
13359
|
+
/* @__PURE__ */ React153.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React153.createElement("span", { className: "Layer__table-cell-content" }, row.date && formatTime10(parseISO14(row.date), DATE_FORMAT))),
|
|
13360
|
+
/* @__PURE__ */ React153.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React153.createElement("span", { className: "Layer__table-cell-content" }, row.entry_id.substring(0, 5))),
|
|
13361
|
+
/* @__PURE__ */ React153.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React153.createElement("span", { className: "Layer__table-cell-content" }, row.source?.display_description ?? "")),
|
|
13362
|
+
/* @__PURE__ */ React153.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React153.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "DEBIT" /* DEBIT */ && `$${centsToDollars(row?.amount || 0)}`)),
|
|
13363
|
+
/* @__PURE__ */ React153.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React153.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "CREDIT" /* CREDIT */ && `$${centsToDollars(row?.amount || 0)}`)),
|
|
13364
|
+
/* @__PURE__ */ React153.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React153.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, `$${centsToDollars(row.running_balance)}`))
|
|
13361
13365
|
);
|
|
13362
13366
|
};
|
|
13363
13367
|
|
|
@@ -13409,10 +13413,10 @@ var LedgerAccount = ({
|
|
|
13409
13413
|
setAccountId(void 0);
|
|
13410
13414
|
closeSelectedEntry();
|
|
13411
13415
|
};
|
|
13412
|
-
return /* @__PURE__ */
|
|
13416
|
+
return /* @__PURE__ */ React154.createElement(
|
|
13413
13417
|
Panel,
|
|
13414
13418
|
{
|
|
13415
|
-
sidebar: /* @__PURE__ */
|
|
13419
|
+
sidebar: /* @__PURE__ */ React154.createElement(
|
|
13416
13420
|
LedgerAccountEntryDetails,
|
|
13417
13421
|
{
|
|
13418
13422
|
stringOverrides: stringOverrides?.ledgerEntryDetail
|
|
@@ -13422,21 +13426,21 @@ var LedgerAccount = ({
|
|
|
13422
13426
|
parentRef: containerRef,
|
|
13423
13427
|
className: "Layer__ledger-account__panel"
|
|
13424
13428
|
},
|
|
13425
|
-
/* @__PURE__ */
|
|
13429
|
+
/* @__PURE__ */ React154.createElement("div", { className: baseClassName }, /* @__PURE__ */ React154.createElement("div", { className: "Layer__ledger-account__header" }, /* @__PURE__ */ React154.createElement(BackButton, { onClick: close }), /* @__PURE__ */ React154.createElement("div", { className: "Layer__ledger-account__title-container" }, /* @__PURE__ */ React154.createElement(
|
|
13426
13430
|
Text,
|
|
13427
13431
|
{
|
|
13428
13432
|
weight: "bold" /* bold */,
|
|
13429
13433
|
className: "Layer__ledger-account__title"
|
|
13430
13434
|
},
|
|
13431
13435
|
entry?.name ?? ""
|
|
13432
|
-
), /* @__PURE__ */
|
|
13436
|
+
), /* @__PURE__ */ React154.createElement("div", { className: "Layer__ledger-account__balance-container" }, /* @__PURE__ */ React154.createElement(
|
|
13433
13437
|
Text,
|
|
13434
13438
|
{
|
|
13435
13439
|
className: "Layer__ledger-account__balance-label",
|
|
13436
13440
|
size: "sm" /* sm */
|
|
13437
13441
|
},
|
|
13438
13442
|
"Current balance"
|
|
13439
|
-
), /* @__PURE__ */
|
|
13443
|
+
), /* @__PURE__ */ React154.createElement(
|
|
13440
13444
|
Text,
|
|
13441
13445
|
{
|
|
13442
13446
|
className: "Layer__ledger-account__balance-value",
|
|
@@ -13444,7 +13448,7 @@ var LedgerAccount = ({
|
|
|
13444
13448
|
},
|
|
13445
13449
|
"$",
|
|
13446
13450
|
centsToDollars(entry?.balance || 0)
|
|
13447
|
-
)))), /* @__PURE__ */
|
|
13451
|
+
)))), /* @__PURE__ */ React154.createElement("table", { className: "Layer__table Layer__table--hover-effect Layer__ledger-account-table" }, /* @__PURE__ */ React154.createElement("thead", null, /* @__PURE__ */ React154.createElement("tr", null, view !== "desktop" && /* @__PURE__ */ React154.createElement("th", null), view === "desktop" && /* @__PURE__ */ React154.createElement(React154.Fragment, null, /* @__PURE__ */ React154.createElement("th", { className: "Layer__table-header" }, stringOverrides?.ledgerEntriesTable?.dateColumnHeader || "Date"), /* @__PURE__ */ React154.createElement("th", { className: "Layer__table-header" }, stringOverrides?.ledgerEntriesTable?.journalIdColumnHeader || "Journal id #"), /* @__PURE__ */ React154.createElement("th", { className: "Layer__table-header" }, stringOverrides?.ledgerEntriesTable?.sourceColumnHeader || "Source")), view !== "mobile" && /* @__PURE__ */ React154.createElement(React154.Fragment, null, /* @__PURE__ */ React154.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, stringOverrides?.ledgerEntriesTable?.debitColumnHeader || "Debit"), /* @__PURE__ */ React154.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, stringOverrides?.ledgerEntriesTable?.creditColumnHeader || "Credit"), /* @__PURE__ */ React154.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, stringOverrides?.ledgerEntriesTable?.runningBalanceColumnHeader || "Running balance")))), /* @__PURE__ */ React154.createElement("tbody", null, data?.map((x, index) => /* @__PURE__ */ React154.createElement(
|
|
13448
13452
|
LedgerAccountRow,
|
|
13449
13453
|
{
|
|
13450
13454
|
key: x.id,
|
|
@@ -13453,7 +13457,7 @@ var LedgerAccount = ({
|
|
|
13453
13457
|
initialLoad,
|
|
13454
13458
|
view
|
|
13455
13459
|
}
|
|
13456
|
-
)))), data && /* @__PURE__ */
|
|
13460
|
+
)))), data && /* @__PURE__ */ React154.createElement("div", { className: "Layer__ledger-account__pagination" }, /* @__PURE__ */ React154.createElement(
|
|
13457
13461
|
Pagination,
|
|
13458
13462
|
{
|
|
13459
13463
|
currentPage,
|
|
@@ -13461,7 +13465,7 @@ var LedgerAccount = ({
|
|
|
13461
13465
|
pageSize,
|
|
13462
13466
|
onPageChange: (page) => setCurrentPage(page)
|
|
13463
13467
|
}
|
|
13464
|
-
)), error ? /* @__PURE__ */
|
|
13468
|
+
)), error ? /* @__PURE__ */ React154.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React154.createElement(
|
|
13465
13469
|
DataState,
|
|
13466
13470
|
{
|
|
13467
13471
|
status: "failed" /* failed */,
|
|
@@ -13470,7 +13474,7 @@ var LedgerAccount = ({
|
|
|
13470
13474
|
onRefresh: () => refetch(),
|
|
13471
13475
|
isLoading: isValidating || isLoading
|
|
13472
13476
|
}
|
|
13473
|
-
)) : null, (!data || isLoading) && !error ? /* @__PURE__ */
|
|
13477
|
+
)) : null, (!data || isLoading) && !error ? /* @__PURE__ */ React154.createElement("div", { className: `Layer__ledger-account__loader-container` }, /* @__PURE__ */ React154.createElement(Loader2, null)) : null, !isLoading && !error && data?.length === 0 ? /* @__PURE__ */ React154.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React154.createElement(
|
|
13474
13478
|
DataState,
|
|
13475
13479
|
{
|
|
13476
13480
|
status: "info" /* info */,
|
|
@@ -13488,7 +13492,7 @@ var ChartOfAccounts = (props) => {
|
|
|
13488
13492
|
withDates: props.withDateControl
|
|
13489
13493
|
});
|
|
13490
13494
|
const ledgerAccountsContextData = useLedgerAccounts();
|
|
13491
|
-
return /* @__PURE__ */
|
|
13495
|
+
return /* @__PURE__ */ React155.createElement(ChartOfAccountsContext.Provider, { value: chartOfAccountsContextData }, /* @__PURE__ */ React155.createElement(LedgerAccountsContext.Provider, { value: ledgerAccountsContextData }, /* @__PURE__ */ React155.createElement(ChartOfAccountsContent, { ...props })));
|
|
13492
13496
|
};
|
|
13493
13497
|
var ChartOfAccountsContent = ({
|
|
13494
13498
|
asWidget,
|
|
@@ -13509,7 +13513,7 @@ var ChartOfAccountsContent = ({
|
|
|
13509
13513
|
}
|
|
13510
13514
|
}
|
|
13511
13515
|
});
|
|
13512
|
-
return /* @__PURE__ */
|
|
13516
|
+
return /* @__PURE__ */ React155.createElement(Container, { name: "chart-of-accounts", ref: containerRef, asWidget }, accountId ? /* @__PURE__ */ React155.createElement(LedgerAccount, { view, containerRef, stringOverrides: stringOverrides?.ledgerAccount }) : /* @__PURE__ */ React155.createElement(
|
|
13513
13517
|
ChartOfAccountsTable,
|
|
13514
13518
|
{
|
|
13515
13519
|
asWidget,
|
|
@@ -13523,7 +13527,7 @@ var ChartOfAccountsContent = ({
|
|
|
13523
13527
|
};
|
|
13524
13528
|
|
|
13525
13529
|
// src/components/Journal/Journal.tsx
|
|
13526
|
-
import
|
|
13530
|
+
import React162, { useState as useState46 } from "react";
|
|
13527
13531
|
|
|
13528
13532
|
// src/contexts/JournalContext/JournalContext.tsx
|
|
13529
13533
|
import { createContext as createContext12 } from "react";
|
|
@@ -13857,10 +13861,10 @@ var useJournal = () => {
|
|
|
13857
13861
|
};
|
|
13858
13862
|
|
|
13859
13863
|
// src/components/JournalTable/JournalTable.tsx
|
|
13860
|
-
import
|
|
13864
|
+
import React161, { useContext as useContext31, useMemo as useMemo17, useState as useState45 } from "react";
|
|
13861
13865
|
|
|
13862
13866
|
// src/components/JournalRow/JournalRow.tsx
|
|
13863
|
-
import
|
|
13867
|
+
import React156, { useContext as useContext26, useEffect as useEffect39, useState as useState44 } from "react";
|
|
13864
13868
|
import classNames56 from "classnames";
|
|
13865
13869
|
import { parseISO as parseISO15, format as formatTime11 } from "date-fns";
|
|
13866
13870
|
var INDENTATION2 = 24;
|
|
@@ -13936,7 +13940,7 @@ var JournalRow = ({
|
|
|
13936
13940
|
}
|
|
13937
13941
|
}, []);
|
|
13938
13942
|
if ("line_items" in row) {
|
|
13939
|
-
return /* @__PURE__ */
|
|
13943
|
+
return /* @__PURE__ */ React156.createElement(React156.Fragment, null, /* @__PURE__ */ React156.createElement(
|
|
13940
13944
|
"tr",
|
|
13941
13945
|
{
|
|
13942
13946
|
className: baseClass,
|
|
@@ -13950,7 +13954,7 @@ var JournalRow = ({
|
|
|
13950
13954
|
}
|
|
13951
13955
|
}
|
|
13952
13956
|
},
|
|
13953
|
-
/* @__PURE__ */
|
|
13957
|
+
/* @__PURE__ */ React156.createElement("td", { className: "Layer__table-cell Layer__journal__arrow" }, /* @__PURE__ */ React156.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ React156.createElement(
|
|
13954
13958
|
"span",
|
|
13955
13959
|
{
|
|
13956
13960
|
className: "Layer__table-cell-content-indentation",
|
|
@@ -13963,7 +13967,7 @@ var JournalRow = ({
|
|
|
13963
13967
|
setIsOpen(!isOpen);
|
|
13964
13968
|
}
|
|
13965
13969
|
},
|
|
13966
|
-
row.line_items && row.line_items.length > 0 && /* @__PURE__ */
|
|
13970
|
+
row.line_items && row.line_items.length > 0 && /* @__PURE__ */ React156.createElement(
|
|
13967
13971
|
ChevronDownFill_default,
|
|
13968
13972
|
{
|
|
13969
13973
|
size: 16,
|
|
@@ -13974,21 +13978,21 @@ var JournalRow = ({
|
|
|
13974
13978
|
}
|
|
13975
13979
|
)
|
|
13976
13980
|
))),
|
|
13977
|
-
/* @__PURE__ */
|
|
13978
|
-
/* @__PURE__ */
|
|
13979
|
-
/* @__PURE__ */
|
|
13980
|
-
/* @__PURE__ */
|
|
13981
|
-
/* @__PURE__ */
|
|
13981
|
+
/* @__PURE__ */ React156.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React156.createElement("span", { className: "Layer__table-cell-content" }, row.id.substring(0, 5))),
|
|
13982
|
+
/* @__PURE__ */ React156.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React156.createElement("span", { className: "Layer__table-cell-content" }, row.date && formatTime11(parseISO15(row.date), DATE_FORMAT))),
|
|
13983
|
+
/* @__PURE__ */ React156.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React156.createElement("span", { className: "Layer__table-cell-content" }, humanizeEnum(row.entry_type))),
|
|
13984
|
+
/* @__PURE__ */ React156.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React156.createElement("span", { className: "Layer__table-cell-content" }, `(${row.line_items.length})`)),
|
|
13985
|
+
/* @__PURE__ */ React156.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React156.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, "$", centsToDollars(
|
|
13982
13986
|
Math.abs(
|
|
13983
13987
|
row.line_items.filter((item) => item.direction === "DEBIT").map((item) => item.amount).reduce((a, b) => a + b, 0)
|
|
13984
13988
|
)
|
|
13985
13989
|
))),
|
|
13986
|
-
/* @__PURE__ */
|
|
13990
|
+
/* @__PURE__ */ React156.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React156.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, "$", centsToDollars(
|
|
13987
13991
|
Math.abs(
|
|
13988
13992
|
row.line_items.filter((item) => item.direction === "CREDIT").map((item) => item.amount).reduce((a, b) => a + b, 0)
|
|
13989
13993
|
)
|
|
13990
13994
|
)))
|
|
13991
|
-
), (row.line_items || []).map((lineItem, idx) => /* @__PURE__ */
|
|
13995
|
+
), (row.line_items || []).map((lineItem, idx) => /* @__PURE__ */ React156.createElement(
|
|
13992
13996
|
JournalRow,
|
|
13993
13997
|
{
|
|
13994
13998
|
key: `${row.id}-${idx}`,
|
|
@@ -14003,18 +14007,18 @@ var JournalRow = ({
|
|
|
14003
14007
|
}
|
|
14004
14008
|
)));
|
|
14005
14009
|
}
|
|
14006
|
-
return /* @__PURE__ */
|
|
14010
|
+
return /* @__PURE__ */ React156.createElement(
|
|
14007
14011
|
"tr",
|
|
14008
14012
|
{
|
|
14009
14013
|
className: journalEntryLineClass,
|
|
14010
14014
|
style: { transitionDelay: `${15 * index}ms` }
|
|
14011
14015
|
},
|
|
14012
|
-
/* @__PURE__ */
|
|
14013
|
-
/* @__PURE__ */
|
|
14014
|
-
/* @__PURE__ */
|
|
14015
|
-
/* @__PURE__ */
|
|
14016
|
-
/* @__PURE__ */
|
|
14017
|
-
/* @__PURE__ */
|
|
14016
|
+
/* @__PURE__ */ React156.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React156.createElement("span", { className: "Layer__table-cell-content", style })),
|
|
14017
|
+
/* @__PURE__ */ React156.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React156.createElement("span", { className: "Layer__table-cell-content", style }, /* @__PURE__ */ React156.createElement("span", { className: "Layer__table-cell-hidden" }, rowId(row).substring(0, 5)))),
|
|
14018
|
+
/* @__PURE__ */ React156.createElement("td", { className: "Layer__table-cell" }),
|
|
14019
|
+
/* @__PURE__ */ React156.createElement("td", { className: "Layer__table-cell" }),
|
|
14020
|
+
/* @__PURE__ */ React156.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React156.createElement("span", { className: "Layer__table-cell-content", style }, accountName(row))),
|
|
14021
|
+
/* @__PURE__ */ React156.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, row.direction === "DEBIT" && /* @__PURE__ */ React156.createElement(
|
|
14018
14022
|
"span",
|
|
14019
14023
|
{
|
|
14020
14024
|
className: "Layer__table-cell-content Layer__table-cell--amount",
|
|
@@ -14023,7 +14027,7 @@ var JournalRow = ({
|
|
|
14023
14027
|
"$",
|
|
14024
14028
|
centsToDollars(Math.abs(row.amount))
|
|
14025
14029
|
)),
|
|
14026
|
-
/* @__PURE__ */
|
|
14030
|
+
/* @__PURE__ */ React156.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, row.direction === "CREDIT" && /* @__PURE__ */ React156.createElement(
|
|
14027
14031
|
"span",
|
|
14028
14032
|
{
|
|
14029
14033
|
className: "Layer__table-cell-content Layer__table-cell--amount",
|
|
@@ -14036,10 +14040,10 @@ var JournalRow = ({
|
|
|
14036
14040
|
};
|
|
14037
14041
|
|
|
14038
14042
|
// src/components/JournalSidebar/JournalSidebar.tsx
|
|
14039
|
-
import
|
|
14043
|
+
import React160, { useContext as useContext30 } from "react";
|
|
14040
14044
|
|
|
14041
14045
|
// src/components/JournalEntryDetails/JournalEntryDetails.tsx
|
|
14042
|
-
import
|
|
14046
|
+
import React157, { useContext as useContext27, useMemo as useMemo16 } from "react";
|
|
14043
14047
|
var JournalEntryDetails = () => {
|
|
14044
14048
|
const {
|
|
14045
14049
|
data,
|
|
@@ -14054,14 +14058,14 @@ var JournalEntryDetails = () => {
|
|
|
14054
14058
|
}
|
|
14055
14059
|
return;
|
|
14056
14060
|
}, [data, selectedEntryId]);
|
|
14057
|
-
return /* @__PURE__ */
|
|
14061
|
+
return /* @__PURE__ */ React157.createElement("div", { className: "Layer__journal__entry-details" }, /* @__PURE__ */ React157.createElement(
|
|
14058
14062
|
DetailsList,
|
|
14059
14063
|
{
|
|
14060
14064
|
title: "Transaction source",
|
|
14061
|
-
actions: /* @__PURE__ */
|
|
14065
|
+
actions: /* @__PURE__ */ React157.createElement(
|
|
14062
14066
|
Button,
|
|
14063
14067
|
{
|
|
14064
|
-
rightIcon: /* @__PURE__ */
|
|
14068
|
+
rightIcon: /* @__PURE__ */ React157.createElement(X_default, null),
|
|
14065
14069
|
iconOnly: true,
|
|
14066
14070
|
onClick: closeSelectedEntry,
|
|
14067
14071
|
className: "Layer__details-list__close-btn",
|
|
@@ -14069,54 +14073,54 @@ var JournalEntryDetails = () => {
|
|
|
14069
14073
|
}
|
|
14070
14074
|
)
|
|
14071
14075
|
},
|
|
14072
|
-
/* @__PURE__ */
|
|
14073
|
-
entry?.source?.display_description && /* @__PURE__ */
|
|
14074
|
-
), /* @__PURE__ */
|
|
14076
|
+
/* @__PURE__ */ React157.createElement(DetailsListItem, { label: "Source", isLoading: isLoadingEntry }, /* @__PURE__ */ React157.createElement(Badge, null, entry?.source?.entity_name)),
|
|
14077
|
+
entry?.source?.display_description && /* @__PURE__ */ React157.createElement(SourceDetailView, { source: entry?.source })
|
|
14078
|
+
), /* @__PURE__ */ React157.createElement(
|
|
14075
14079
|
DetailsList,
|
|
14076
14080
|
{
|
|
14077
14081
|
title: `Journal Entry ${entry?.id.substring(0, 5)}`,
|
|
14078
14082
|
className: "Layer__border-top"
|
|
14079
14083
|
},
|
|
14080
|
-
/* @__PURE__ */
|
|
14081
|
-
/* @__PURE__ */
|
|
14082
|
-
/* @__PURE__ */
|
|
14083
|
-
entry?.reversal_id && /* @__PURE__ */
|
|
14084
|
-
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */
|
|
14084
|
+
/* @__PURE__ */ React157.createElement(DetailsListItem, { label: "Entry type", isLoading: isLoadingEntry }, humanizeEnum(entry?.entry_type ?? "")),
|
|
14085
|
+
/* @__PURE__ */ React157.createElement(DetailsListItem, { label: "Date", isLoading: isLoadingEntry }, entry?.entry_at && /* @__PURE__ */ React157.createElement(DateTime, { value: entry?.entry_at })),
|
|
14086
|
+
/* @__PURE__ */ React157.createElement(DetailsListItem, { label: "Creation date", isLoading: isLoadingEntry }, entry?.date && /* @__PURE__ */ React157.createElement(DateTime, { value: entry?.date })),
|
|
14087
|
+
entry?.reversal_id && /* @__PURE__ */ React157.createElement(DetailsListItem, { label: "Reversal", isLoading: isLoadingEntry }, "Journal Entry #", entry?.reversal_id)
|
|
14088
|
+
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */ React157.createElement("div", { className: "Layer__ledger-account__entry-details__line-items" }, /* @__PURE__ */ React157.createElement(Card, null, /* @__PURE__ */ React157.createElement(
|
|
14085
14089
|
Table,
|
|
14086
14090
|
{
|
|
14087
14091
|
componentName: "ledger-account__entry-details",
|
|
14088
14092
|
borderCollapse: "collapse"
|
|
14089
14093
|
},
|
|
14090
|
-
/* @__PURE__ */
|
|
14091
|
-
/* @__PURE__ */
|
|
14094
|
+
/* @__PURE__ */ React157.createElement(TableHead, null, /* @__PURE__ */ React157.createElement(TableRow, { rowKey: "soc-flow-head-row", isHeadRow: true }, /* @__PURE__ */ React157.createElement(TableCell, null, "Line items"), [...Array(3)].map((_, index) => /* @__PURE__ */ React157.createElement(TableCell, { key: `ledger-empty-cell-${index}` })), /* @__PURE__ */ React157.createElement(TableCell, null, "Debit"), /* @__PURE__ */ React157.createElement(TableCell, null, "Credit"))),
|
|
14095
|
+
/* @__PURE__ */ React157.createElement(TableBody, null, entry?.line_items?.map((item, index) => /* @__PURE__ */ React157.createElement(
|
|
14092
14096
|
TableRow,
|
|
14093
14097
|
{
|
|
14094
14098
|
key: `ledger-line-item-${index}`,
|
|
14095
14099
|
rowKey: `ledger-line-item-${index}`
|
|
14096
14100
|
},
|
|
14097
|
-
/* @__PURE__ */
|
|
14098
|
-
[...Array(3)].map((_, index2) => /* @__PURE__ */
|
|
14099
|
-
/* @__PURE__ */
|
|
14100
|
-
/* @__PURE__ */
|
|
14101
|
-
)), /* @__PURE__ */
|
|
14101
|
+
/* @__PURE__ */ React157.createElement(TableCell, null, item.account_identifier?.name || ""),
|
|
14102
|
+
[...Array(3)].map((_, index2) => /* @__PURE__ */ React157.createElement(TableCell, { key: `ledger-empty-cell-${index2}` })),
|
|
14103
|
+
/* @__PURE__ */ React157.createElement(TableCell, null, item.direction === "DEBIT" /* DEBIT */ && /* @__PURE__ */ React157.createElement(Badge, { variant: "warning" /* WARNING */ }, "$", centsToDollars(item.amount || 0))),
|
|
14104
|
+
/* @__PURE__ */ React157.createElement(TableCell, null, item.direction === "CREDIT" /* CREDIT */ && /* @__PURE__ */ React157.createElement(Badge, { variant: "success" /* SUCCESS */ }, "$", centsToDollars(item.amount || 0)))
|
|
14105
|
+
)), /* @__PURE__ */ React157.createElement(
|
|
14102
14106
|
TableRow,
|
|
14103
14107
|
{
|
|
14104
14108
|
rowKey: "ledger-line-item-summation",
|
|
14105
14109
|
variant: "summation"
|
|
14106
14110
|
},
|
|
14107
|
-
/* @__PURE__ */
|
|
14108
|
-
[...Array(3)].map((_, index) => /* @__PURE__ */
|
|
14109
|
-
/* @__PURE__ */
|
|
14110
|
-
/* @__PURE__ */
|
|
14111
|
+
/* @__PURE__ */ React157.createElement(TableCell, { primary: true }, "Total"),
|
|
14112
|
+
[...Array(3)].map((_, index) => /* @__PURE__ */ React157.createElement(TableCell, { key: `ledger-empty-cell-${index}` })),
|
|
14113
|
+
/* @__PURE__ */ React157.createElement(TableCell, { isCurrency: true, primary: true }, entry?.line_items.filter((item) => item.direction === "DEBIT").map((item) => item.amount).reduce((a, b) => a + b, 0) || 0),
|
|
14114
|
+
/* @__PURE__ */ React157.createElement(TableCell, { isCurrency: true, primary: true }, entry?.line_items.filter((item) => item.direction === "CREDIT").map((item) => item.amount).reduce((a, b) => a + b, 0) || 0)
|
|
14111
14115
|
))
|
|
14112
14116
|
))) : null);
|
|
14113
14117
|
};
|
|
14114
14118
|
|
|
14115
14119
|
// src/components/JournalForm/JournalForm.tsx
|
|
14116
|
-
import
|
|
14120
|
+
import React159, { useContext as useContext29 } from "react";
|
|
14117
14121
|
|
|
14118
14122
|
// src/components/JournalForm/JournalFormEntryLines.tsx
|
|
14119
|
-
import
|
|
14123
|
+
import React158, { useContext as useContext28 } from "react";
|
|
14120
14124
|
var JournalFormEntryLines = ({
|
|
14121
14125
|
entrylineItems,
|
|
14122
14126
|
addEntryLine,
|
|
@@ -14128,14 +14132,14 @@ var JournalFormEntryLines = ({
|
|
|
14128
14132
|
const { data: accountsData } = useContext28(ChartOfAccountsContext);
|
|
14129
14133
|
const { form } = useContext28(JournalContext);
|
|
14130
14134
|
const parentOptions = useParentOptions(accountsData);
|
|
14131
|
-
return /* @__PURE__ */
|
|
14132
|
-
return /* @__PURE__ */
|
|
14135
|
+
return /* @__PURE__ */ React158.createElement(React158.Fragment, null, Object.keys(Direction).map((direction, idx) => {
|
|
14136
|
+
return /* @__PURE__ */ React158.createElement(
|
|
14133
14137
|
"div",
|
|
14134
14138
|
{
|
|
14135
14139
|
key: "Layer__journal__form__input-group-" + idx,
|
|
14136
14140
|
className: "Layer__journal__form__input-group Layer__journal__form__input-group__border"
|
|
14137
14141
|
},
|
|
14138
|
-
/* @__PURE__ */
|
|
14142
|
+
/* @__PURE__ */ React158.createElement(
|
|
14139
14143
|
Text,
|
|
14140
14144
|
{
|
|
14141
14145
|
className: "Layer__journal__form__input-group__title",
|
|
@@ -14149,13 +14153,13 @@ var JournalFormEntryLines = ({
|
|
|
14149
14153
|
if (item.direction !== direction) {
|
|
14150
14154
|
return null;
|
|
14151
14155
|
}
|
|
14152
|
-
return /* @__PURE__ */
|
|
14156
|
+
return /* @__PURE__ */ React158.createElement(
|
|
14153
14157
|
"div",
|
|
14154
14158
|
{
|
|
14155
14159
|
className: "Layer__journal__form__input-group__line-item",
|
|
14156
14160
|
key: direction + "-" + idx2
|
|
14157
14161
|
},
|
|
14158
|
-
/* @__PURE__ */
|
|
14162
|
+
/* @__PURE__ */ React158.createElement(InputGroup, { name: direction, label: "Amount", inline: true }, /* @__PURE__ */ React158.createElement(
|
|
14159
14163
|
InputWithBadge,
|
|
14160
14164
|
{
|
|
14161
14165
|
name: direction,
|
|
@@ -14181,14 +14185,14 @@ var JournalFormEntryLines = ({
|
|
|
14181
14185
|
)?.message
|
|
14182
14186
|
}
|
|
14183
14187
|
)),
|
|
14184
|
-
/* @__PURE__ */
|
|
14188
|
+
/* @__PURE__ */ React158.createElement(
|
|
14185
14189
|
InputGroup,
|
|
14186
14190
|
{
|
|
14187
14191
|
name: "account-name",
|
|
14188
14192
|
label: "Account name",
|
|
14189
14193
|
inline: true
|
|
14190
14194
|
},
|
|
14191
|
-
/* @__PURE__ */
|
|
14195
|
+
/* @__PURE__ */ React158.createElement(
|
|
14192
14196
|
Select2,
|
|
14193
14197
|
{
|
|
14194
14198
|
options: parentOptions,
|
|
@@ -14212,18 +14216,18 @@ var JournalFormEntryLines = ({
|
|
|
14212
14216
|
)?.message
|
|
14213
14217
|
}
|
|
14214
14218
|
),
|
|
14215
|
-
idx2 >= 2 && /* @__PURE__ */
|
|
14219
|
+
idx2 >= 2 && /* @__PURE__ */ React158.createElement(
|
|
14216
14220
|
IconButton,
|
|
14217
14221
|
{
|
|
14218
14222
|
className: "Layer__remove__button",
|
|
14219
14223
|
onClick: () => removeEntryLine(idx2),
|
|
14220
|
-
icon: /* @__PURE__ */
|
|
14224
|
+
icon: /* @__PURE__ */ React158.createElement(Trash_default, null)
|
|
14221
14225
|
}
|
|
14222
14226
|
)
|
|
14223
14227
|
)
|
|
14224
14228
|
);
|
|
14225
14229
|
}),
|
|
14226
|
-
(config.form.addEntryLinesLimit === void 0 || config.form.addEntryLinesLimit > entrylineItems?.length) && /* @__PURE__ */
|
|
14230
|
+
(config.form.addEntryLinesLimit === void 0 || config.form.addEntryLinesLimit > entrylineItems?.length) && /* @__PURE__ */ React158.createElement(
|
|
14227
14231
|
TextButton,
|
|
14228
14232
|
{
|
|
14229
14233
|
className: "Layer__journal__add-entry-line",
|
|
@@ -14247,7 +14251,7 @@ var JournalForm = ({ config, stringOverrides }) => {
|
|
|
14247
14251
|
addEntryLine,
|
|
14248
14252
|
removeEntryLine
|
|
14249
14253
|
} = useContext29(JournalContext);
|
|
14250
|
-
return /* @__PURE__ */
|
|
14254
|
+
return /* @__PURE__ */ React159.createElement(
|
|
14251
14255
|
"form",
|
|
14252
14256
|
{
|
|
14253
14257
|
className: "Layer__form",
|
|
@@ -14256,7 +14260,7 @@ var JournalForm = ({ config, stringOverrides }) => {
|
|
|
14256
14260
|
submitForm();
|
|
14257
14261
|
}
|
|
14258
14262
|
},
|
|
14259
|
-
/* @__PURE__ */
|
|
14263
|
+
/* @__PURE__ */ React159.createElement("div", { className: "Layer__journal__sidebar__header" }, /* @__PURE__ */ React159.createElement(Text, { size: "lg" /* lg */, weight: "bold" /* bold */, className: "title" }, stringOverrides?.header && "Add New Entry"), /* @__PURE__ */ React159.createElement("div", { className: "actions" }, /* @__PURE__ */ React159.createElement(
|
|
14260
14264
|
Button,
|
|
14261
14265
|
{
|
|
14262
14266
|
type: "button",
|
|
@@ -14265,7 +14269,7 @@ var JournalForm = ({ config, stringOverrides }) => {
|
|
|
14265
14269
|
disabled: sendingForm
|
|
14266
14270
|
},
|
|
14267
14271
|
stringOverrides?.cancelButton || "Cancel"
|
|
14268
|
-
), apiError && /* @__PURE__ */
|
|
14272
|
+
), apiError && /* @__PURE__ */ React159.createElement(
|
|
14269
14273
|
RetryButton,
|
|
14270
14274
|
{
|
|
14271
14275
|
type: "submit",
|
|
@@ -14274,7 +14278,7 @@ var JournalForm = ({ config, stringOverrides }) => {
|
|
|
14274
14278
|
disabled: sendingForm
|
|
14275
14279
|
},
|
|
14276
14280
|
stringOverrides?.retryButton || "Retry"
|
|
14277
|
-
), !apiError && /* @__PURE__ */
|
|
14281
|
+
), !apiError && /* @__PURE__ */ React159.createElement(
|
|
14278
14282
|
SubmitButton,
|
|
14279
14283
|
{
|
|
14280
14284
|
type: "submit",
|
|
@@ -14284,7 +14288,7 @@ var JournalForm = ({ config, stringOverrides }) => {
|
|
|
14284
14288
|
},
|
|
14285
14289
|
stringOverrides?.saveButton || "Save"
|
|
14286
14290
|
))),
|
|
14287
|
-
apiError && /* @__PURE__ */
|
|
14291
|
+
apiError && /* @__PURE__ */ React159.createElement(
|
|
14288
14292
|
Text,
|
|
14289
14293
|
{
|
|
14290
14294
|
size: "sm" /* sm */,
|
|
@@ -14292,7 +14296,7 @@ var JournalForm = ({ config, stringOverrides }) => {
|
|
|
14292
14296
|
},
|
|
14293
14297
|
apiError
|
|
14294
14298
|
),
|
|
14295
|
-
/* @__PURE__ */
|
|
14299
|
+
/* @__PURE__ */ React159.createElement("div", { className: "Layer__journal__form__input-group" }, /* @__PURE__ */ React159.createElement(InputGroup, { name: "date", label: "Date", inline: true }, /* @__PURE__ */ React159.createElement("div", { className: "Layer__journal__datepicker__wrapper" }, /* @__PURE__ */ React159.createElement(
|
|
14296
14300
|
DatePicker,
|
|
14297
14301
|
{
|
|
14298
14302
|
selected: form?.data.entry_at ? new Date(form?.data.entry_at) : /* @__PURE__ */ new Date(),
|
|
@@ -14305,7 +14309,7 @@ var JournalForm = ({ config, stringOverrides }) => {
|
|
|
14305
14309
|
placeholderText: "Select date",
|
|
14306
14310
|
currentDateOption: false
|
|
14307
14311
|
}
|
|
14308
|
-
), /* @__PURE__ */
|
|
14312
|
+
), /* @__PURE__ */ React159.createElement(
|
|
14309
14313
|
DatePicker,
|
|
14310
14314
|
{
|
|
14311
14315
|
selected: form?.data.entry_at ? new Date(form?.data.entry_at) : /* @__PURE__ */ new Date(),
|
|
@@ -14319,7 +14323,7 @@ var JournalForm = ({ config, stringOverrides }) => {
|
|
|
14319
14323
|
currentDateOption: false
|
|
14320
14324
|
}
|
|
14321
14325
|
)))),
|
|
14322
|
-
/* @__PURE__ */
|
|
14326
|
+
/* @__PURE__ */ React159.createElement(
|
|
14323
14327
|
JournalFormEntryLines,
|
|
14324
14328
|
{
|
|
14325
14329
|
entrylineItems: form?.data.line_items || [],
|
|
@@ -14330,7 +14334,7 @@ var JournalForm = ({ config, stringOverrides }) => {
|
|
|
14330
14334
|
config
|
|
14331
14335
|
}
|
|
14332
14336
|
),
|
|
14333
|
-
/* @__PURE__ */
|
|
14337
|
+
/* @__PURE__ */ React159.createElement("div", { className: "Layer__journal__form__input-group Layer__journal__form__input-group__textarea" }, /* @__PURE__ */ React159.createElement(InputGroup, { name: "memo", label: "Notes" }, /* @__PURE__ */ React159.createElement(
|
|
14334
14338
|
Textarea,
|
|
14335
14339
|
{
|
|
14336
14340
|
name: "memo",
|
|
@@ -14340,7 +14344,7 @@ var JournalForm = ({ config, stringOverrides }) => {
|
|
|
14340
14344
|
disabled: sendingForm
|
|
14341
14345
|
}
|
|
14342
14346
|
))),
|
|
14343
|
-
/* @__PURE__ */
|
|
14347
|
+
/* @__PURE__ */ React159.createElement("div", { className: "Layer__journal__bottom-actions" }, /* @__PURE__ */ React159.createElement(
|
|
14344
14348
|
Button,
|
|
14345
14349
|
{
|
|
14346
14350
|
type: "button",
|
|
@@ -14349,7 +14353,7 @@ var JournalForm = ({ config, stringOverrides }) => {
|
|
|
14349
14353
|
disabled: sendingForm
|
|
14350
14354
|
},
|
|
14351
14355
|
stringOverrides?.cancelButton || "Cancel"
|
|
14352
|
-
), apiError && /* @__PURE__ */
|
|
14356
|
+
), apiError && /* @__PURE__ */ React159.createElement(
|
|
14353
14357
|
RetryButton,
|
|
14354
14358
|
{
|
|
14355
14359
|
type: "submit",
|
|
@@ -14358,7 +14362,7 @@ var JournalForm = ({ config, stringOverrides }) => {
|
|
|
14358
14362
|
disabled: sendingForm
|
|
14359
14363
|
},
|
|
14360
14364
|
stringOverrides?.retryButton || "Retry"
|
|
14361
|
-
), !apiError && /* @__PURE__ */
|
|
14365
|
+
), !apiError && /* @__PURE__ */ React159.createElement(
|
|
14362
14366
|
SubmitButton,
|
|
14363
14367
|
{
|
|
14364
14368
|
type: "submit",
|
|
@@ -14379,9 +14383,9 @@ var JournalSidebar = ({
|
|
|
14379
14383
|
}) => {
|
|
14380
14384
|
const { selectedEntryId } = useContext30(JournalContext);
|
|
14381
14385
|
if (selectedEntryId !== "new") {
|
|
14382
|
-
return /* @__PURE__ */
|
|
14386
|
+
return /* @__PURE__ */ React160.createElement(JournalEntryDetails, null);
|
|
14383
14387
|
}
|
|
14384
|
-
return /* @__PURE__ */
|
|
14388
|
+
return /* @__PURE__ */ React160.createElement(JournalForm, { config, stringOverrides });
|
|
14385
14389
|
};
|
|
14386
14390
|
|
|
14387
14391
|
// src/components/JournalTable/JournalTable.tsx
|
|
@@ -14408,16 +14412,16 @@ var JournalTable = ({
|
|
|
14408
14412
|
const lastPageIndex = firstPageIndex + pageSize;
|
|
14409
14413
|
return rawData?.sort((a, b) => Date.parse(b.date) - Date.parse(a.date))?.slice(firstPageIndex, lastPageIndex);
|
|
14410
14414
|
}, [rawData, currentPage]);
|
|
14411
|
-
return /* @__PURE__ */
|
|
14415
|
+
return /* @__PURE__ */ React161.createElement(
|
|
14412
14416
|
Panel,
|
|
14413
14417
|
{
|
|
14414
|
-
sidebar: /* @__PURE__ */
|
|
14418
|
+
sidebar: /* @__PURE__ */ React161.createElement(JournalSidebar, { parentRef: containerRef, config, stringOverrides: stringOverrides?.journalForm }),
|
|
14415
14419
|
sidebarIsOpen: Boolean(selectedEntryId),
|
|
14416
14420
|
parentRef: containerRef
|
|
14417
14421
|
},
|
|
14418
|
-
/* @__PURE__ */
|
|
14419
|
-
/* @__PURE__ */
|
|
14420
|
-
return /* @__PURE__ */
|
|
14422
|
+
/* @__PURE__ */ React161.createElement(Header, { className: `Layer__${COMPONENT_NAME6}__header` }, /* @__PURE__ */ React161.createElement(Heading, { className: `Layer__${COMPONENT_NAME6}__title` }, stringOverrides?.componentTitle || "Journal"), /* @__PURE__ */ React161.createElement("div", { className: `Layer__${COMPONENT_NAME6}__actions` }, /* @__PURE__ */ React161.createElement(Button, { onClick: () => addEntry(), disabled: isLoading }, stringOverrides?.addEntryButton || "Add Entry"))),
|
|
14423
|
+
/* @__PURE__ */ React161.createElement("table", { className: "Layer__table Layer__table--hover-effect Layer__journal__table" }, /* @__PURE__ */ React161.createElement("thead", null, /* @__PURE__ */ React161.createElement("tr", null, /* @__PURE__ */ React161.createElement("th", { className: "Layer__table-header" }), /* @__PURE__ */ React161.createElement("th", { className: "Layer__table-header" }, stringOverrides?.idColumnHeader || "Id"), /* @__PURE__ */ React161.createElement("th", { className: "Layer__table-header" }, stringOverrides?.dateColumnHeader || "Date"), /* @__PURE__ */ React161.createElement("th", { className: "Layer__table-header" }, stringOverrides?.transactionColumnHeader || "Transaction"), /* @__PURE__ */ React161.createElement("th", { className: "Layer__table-header" }, stringOverrides?.accountColumnHeader || "Account"), /* @__PURE__ */ React161.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, stringOverrides?.debitColumnHeader || "Debit"), /* @__PURE__ */ React161.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, stringOverrides?.creditColumnHeader || "Credit"))), /* @__PURE__ */ React161.createElement("tbody", null, !error && data?.map((entry, idx) => {
|
|
14424
|
+
return /* @__PURE__ */ React161.createElement(
|
|
14421
14425
|
JournalRow,
|
|
14422
14426
|
{
|
|
14423
14427
|
key: "journal-row-" + idx + entry.id,
|
|
@@ -14427,7 +14431,7 @@ var JournalTable = ({
|
|
|
14427
14431
|
}
|
|
14428
14432
|
);
|
|
14429
14433
|
}))),
|
|
14430
|
-
data && /* @__PURE__ */
|
|
14434
|
+
data && /* @__PURE__ */ React161.createElement("div", { className: "Layer__journal__pagination" }, /* @__PURE__ */ React161.createElement(
|
|
14431
14435
|
Pagination,
|
|
14432
14436
|
{
|
|
14433
14437
|
currentPage,
|
|
@@ -14436,7 +14440,7 @@ var JournalTable = ({
|
|
|
14436
14440
|
onPageChange: (page) => setCurrentPage(page)
|
|
14437
14441
|
}
|
|
14438
14442
|
)),
|
|
14439
|
-
error ? /* @__PURE__ */
|
|
14443
|
+
error ? /* @__PURE__ */ React161.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React161.createElement(
|
|
14440
14444
|
DataState,
|
|
14441
14445
|
{
|
|
14442
14446
|
status: "failed" /* failed */,
|
|
@@ -14446,7 +14450,7 @@ var JournalTable = ({
|
|
|
14446
14450
|
isLoading: isValidating || isLoading
|
|
14447
14451
|
}
|
|
14448
14452
|
)) : null,
|
|
14449
|
-
(!data || isLoading) && !error ? /* @__PURE__ */
|
|
14453
|
+
(!data || isLoading) && !error ? /* @__PURE__ */ React161.createElement("div", { className: `Layer__${COMPONENT_NAME6}__loader-container` }, /* @__PURE__ */ React161.createElement(Loader2, null)) : null
|
|
14450
14454
|
);
|
|
14451
14455
|
};
|
|
14452
14456
|
|
|
@@ -14459,7 +14463,7 @@ var JOURNAL_CONFIG = {
|
|
|
14459
14463
|
var Journal = (props) => {
|
|
14460
14464
|
const JournalContextData = useJournal();
|
|
14461
14465
|
const AccountsContextData = useChartOfAccounts();
|
|
14462
|
-
return /* @__PURE__ */
|
|
14466
|
+
return /* @__PURE__ */ React162.createElement(ChartOfAccountsContext.Provider, { value: AccountsContextData }, /* @__PURE__ */ React162.createElement(JournalContext.Provider, { value: JournalContextData }, /* @__PURE__ */ React162.createElement(TableProvider, null, /* @__PURE__ */ React162.createElement(JournalContent, { ...props }))));
|
|
14463
14467
|
};
|
|
14464
14468
|
var JournalContent = ({
|
|
14465
14469
|
asWidget,
|
|
@@ -14478,7 +14482,7 @@ var JournalContent = ({
|
|
|
14478
14482
|
}
|
|
14479
14483
|
}
|
|
14480
14484
|
});
|
|
14481
|
-
return /* @__PURE__ */
|
|
14485
|
+
return /* @__PURE__ */ React162.createElement(Container, { name: "journal", ref: containerRef, asWidget }, /* @__PURE__ */ React162.createElement(
|
|
14482
14486
|
JournalTable,
|
|
14483
14487
|
{
|
|
14484
14488
|
view,
|
|
@@ -14490,7 +14494,7 @@ var JournalContent = ({
|
|
|
14490
14494
|
};
|
|
14491
14495
|
|
|
14492
14496
|
// src/components/Tasks/Tasks.tsx
|
|
14493
|
-
import
|
|
14497
|
+
import React169, {
|
|
14494
14498
|
createContext as createContext14,
|
|
14495
14499
|
useContext as useContext36,
|
|
14496
14500
|
useEffect as useEffect43,
|
|
@@ -14572,11 +14576,11 @@ function isComplete(taskType) {
|
|
|
14572
14576
|
}
|
|
14573
14577
|
|
|
14574
14578
|
// src/components/TasksHeader/TasksHeader.tsx
|
|
14575
|
-
import
|
|
14579
|
+
import React164, { useContext as useContext32 } from "react";
|
|
14576
14580
|
|
|
14577
14581
|
// src/icons/ProgressIcon.tsx
|
|
14578
|
-
import * as
|
|
14579
|
-
var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */
|
|
14582
|
+
import * as React163 from "react";
|
|
14583
|
+
var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React163.createElement(
|
|
14580
14584
|
"svg",
|
|
14581
14585
|
{
|
|
14582
14586
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -14586,7 +14590,7 @@ var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React162.createE
|
|
|
14586
14590
|
width: size,
|
|
14587
14591
|
height: size
|
|
14588
14592
|
},
|
|
14589
|
-
/* @__PURE__ */
|
|
14593
|
+
/* @__PURE__ */ React163.createElement(
|
|
14590
14594
|
"path",
|
|
14591
14595
|
{
|
|
14592
14596
|
d: "M9 1.5V4.5",
|
|
@@ -14595,7 +14599,7 @@ var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React162.createE
|
|
|
14595
14599
|
strokeLinejoin: "round"
|
|
14596
14600
|
}
|
|
14597
14601
|
),
|
|
14598
|
-
/* @__PURE__ */
|
|
14602
|
+
/* @__PURE__ */ React163.createElement(
|
|
14599
14603
|
"path",
|
|
14600
14604
|
{
|
|
14601
14605
|
d: "M9 13.5V16.5",
|
|
@@ -14604,7 +14608,7 @@ var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React162.createE
|
|
|
14604
14608
|
strokeLinejoin: "round"
|
|
14605
14609
|
}
|
|
14606
14610
|
),
|
|
14607
|
-
/* @__PURE__ */
|
|
14611
|
+
/* @__PURE__ */ React163.createElement(
|
|
14608
14612
|
"path",
|
|
14609
14613
|
{
|
|
14610
14614
|
d: "M3.6975 3.6975L5.82 5.82",
|
|
@@ -14613,7 +14617,7 @@ var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React162.createE
|
|
|
14613
14617
|
strokeLinejoin: "round"
|
|
14614
14618
|
}
|
|
14615
14619
|
),
|
|
14616
|
-
/* @__PURE__ */
|
|
14620
|
+
/* @__PURE__ */ React163.createElement(
|
|
14617
14621
|
"path",
|
|
14618
14622
|
{
|
|
14619
14623
|
d: "M12.18 12.18L14.3025 14.3025",
|
|
@@ -14622,7 +14626,7 @@ var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React162.createE
|
|
|
14622
14626
|
strokeLinejoin: "round"
|
|
14623
14627
|
}
|
|
14624
14628
|
),
|
|
14625
|
-
/* @__PURE__ */
|
|
14629
|
+
/* @__PURE__ */ React163.createElement(
|
|
14626
14630
|
"path",
|
|
14627
14631
|
{
|
|
14628
14632
|
d: "M1.5 9H4.5",
|
|
@@ -14631,7 +14635,7 @@ var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React162.createE
|
|
|
14631
14635
|
strokeLinejoin: "round"
|
|
14632
14636
|
}
|
|
14633
14637
|
),
|
|
14634
|
-
/* @__PURE__ */
|
|
14638
|
+
/* @__PURE__ */ React163.createElement(
|
|
14635
14639
|
"path",
|
|
14636
14640
|
{
|
|
14637
14641
|
d: "M13.5 9H16.5",
|
|
@@ -14640,7 +14644,7 @@ var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React162.createE
|
|
|
14640
14644
|
strokeLinejoin: "round"
|
|
14641
14645
|
}
|
|
14642
14646
|
),
|
|
14643
|
-
/* @__PURE__ */
|
|
14647
|
+
/* @__PURE__ */ React163.createElement(
|
|
14644
14648
|
"path",
|
|
14645
14649
|
{
|
|
14646
14650
|
d: "M3.6975 14.3025L5.82 12.18",
|
|
@@ -14649,7 +14653,7 @@ var ProgressIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React162.createE
|
|
|
14649
14653
|
strokeLinejoin: "round"
|
|
14650
14654
|
}
|
|
14651
14655
|
),
|
|
14652
|
-
/* @__PURE__ */
|
|
14656
|
+
/* @__PURE__ */ React163.createElement(
|
|
14653
14657
|
"path",
|
|
14654
14658
|
{
|
|
14655
14659
|
d: "M12.18 5.82L14.3025 3.6975",
|
|
@@ -14664,22 +14668,22 @@ var ProgressIcon_default = ProgressIcon;
|
|
|
14664
14668
|
// src/components/TasksHeader/TasksHeader.tsx
|
|
14665
14669
|
var ICONS = {
|
|
14666
14670
|
loading: {
|
|
14667
|
-
icon: /* @__PURE__ */
|
|
14671
|
+
icon: /* @__PURE__ */ React164.createElement(ProgressIcon_default, { size: 12, className: "Layer__anim--rotating" }),
|
|
14668
14672
|
text: "Loading",
|
|
14669
14673
|
badge: "default" /* DEFAULT */
|
|
14670
14674
|
},
|
|
14671
14675
|
done: {
|
|
14672
|
-
icon: /* @__PURE__ */
|
|
14676
|
+
icon: /* @__PURE__ */ React164.createElement(Check_default, { size: 12 }),
|
|
14673
14677
|
text: "Done",
|
|
14674
14678
|
badge: "success" /* SUCCESS */
|
|
14675
14679
|
},
|
|
14676
14680
|
pending: {
|
|
14677
|
-
icon: /* @__PURE__ */
|
|
14681
|
+
icon: /* @__PURE__ */ React164.createElement(AlertCircle_default, { size: 12 }),
|
|
14678
14682
|
text: "In progress",
|
|
14679
14683
|
badge: "warning" /* WARNING */
|
|
14680
14684
|
},
|
|
14681
14685
|
refresh: {
|
|
14682
|
-
icon: /* @__PURE__ */
|
|
14686
|
+
icon: /* @__PURE__ */ React164.createElement(RefreshCcw_default, { size: 12 }),
|
|
14683
14687
|
text: "Refresh",
|
|
14684
14688
|
badge: "default" /* DEFAULT */
|
|
14685
14689
|
}
|
|
@@ -14693,7 +14697,7 @@ var TasksHeader = ({
|
|
|
14693
14697
|
const { data: tasks, loadedStatus, refetch, error } = useContext32(TasksContext);
|
|
14694
14698
|
const completedTasks = tasks?.filter((task) => isComplete(task.status)).length;
|
|
14695
14699
|
const badgeVariant = completedTasks === tasks?.length ? ICONS.done : ICONS.pending;
|
|
14696
|
-
return /* @__PURE__ */
|
|
14700
|
+
return /* @__PURE__ */ React164.createElement("div", { className: "Layer__tasks-header" }, /* @__PURE__ */ React164.createElement("div", { className: "Layer__tasks-header__left-col" }, /* @__PURE__ */ React164.createElement(Text, { size: "lg" /* lg */ }, tasksHeader), loadedStatus !== "complete" && !open ? /* @__PURE__ */ React164.createElement(Badge, { variant: ICONS.loading.badge, icon: ICONS.loading.icon }, ICONS.loading.text) : loadedStatus === "complete" && (!tasks || error) ? /* @__PURE__ */ React164.createElement(
|
|
14697
14701
|
Badge,
|
|
14698
14702
|
{
|
|
14699
14703
|
onClick: () => refetch(),
|
|
@@ -14701,15 +14705,15 @@ var TasksHeader = ({
|
|
|
14701
14705
|
icon: ICONS.refresh.icon
|
|
14702
14706
|
},
|
|
14703
14707
|
ICONS.refresh.text
|
|
14704
|
-
) : loadedStatus === "complete" ? /* @__PURE__ */
|
|
14708
|
+
) : loadedStatus === "complete" ? /* @__PURE__ */ React164.createElement(Badge, { variant: badgeVariant.badge, icon: badgeVariant.icon }, badgeVariant.text) : open ? null : /* @__PURE__ */ React164.createElement(Badge, { variant: badgeVariant.badge, icon: badgeVariant.icon }, badgeVariant.text)), collapsable && /* @__PURE__ */ React164.createElement(ExpandButton, { onClick: toggleContent, collapsed: !open }));
|
|
14705
14709
|
};
|
|
14706
14710
|
|
|
14707
14711
|
// src/components/TasksList/TasksList.tsx
|
|
14708
|
-
import
|
|
14712
|
+
import React167, { useContext as useContext34, useMemo as useMemo18, useState as useState49 } from "react";
|
|
14709
14713
|
|
|
14710
14714
|
// src/icons/SmileIcon.tsx
|
|
14711
|
-
import * as
|
|
14712
|
-
var SmileIcon = ({ size = 12, ...props }) => /* @__PURE__ */
|
|
14715
|
+
import * as React165 from "react";
|
|
14716
|
+
var SmileIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React165.createElement(
|
|
14713
14717
|
"svg",
|
|
14714
14718
|
{
|
|
14715
14719
|
viewBox: "0 0 12 12",
|
|
@@ -14719,7 +14723,7 @@ var SmileIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React164.createElem
|
|
|
14719
14723
|
width: size,
|
|
14720
14724
|
height: size
|
|
14721
14725
|
},
|
|
14722
|
-
/* @__PURE__ */
|
|
14726
|
+
/* @__PURE__ */ React165.createElement(
|
|
14723
14727
|
"path",
|
|
14724
14728
|
{
|
|
14725
14729
|
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",
|
|
@@ -14728,7 +14732,7 @@ var SmileIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React164.createElem
|
|
|
14728
14732
|
strokeLinejoin: "round"
|
|
14729
14733
|
}
|
|
14730
14734
|
),
|
|
14731
|
-
/* @__PURE__ */
|
|
14735
|
+
/* @__PURE__ */ React165.createElement(
|
|
14732
14736
|
"path",
|
|
14733
14737
|
{
|
|
14734
14738
|
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",
|
|
@@ -14737,7 +14741,7 @@ var SmileIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React164.createElem
|
|
|
14737
14741
|
strokeLinejoin: "round"
|
|
14738
14742
|
}
|
|
14739
14743
|
),
|
|
14740
|
-
/* @__PURE__ */
|
|
14744
|
+
/* @__PURE__ */ React165.createElement(
|
|
14741
14745
|
"path",
|
|
14742
14746
|
{
|
|
14743
14747
|
d: "M5 5H5.005",
|
|
@@ -14746,7 +14750,7 @@ var SmileIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React164.createElem
|
|
|
14746
14750
|
strokeLinejoin: "round"
|
|
14747
14751
|
}
|
|
14748
14752
|
),
|
|
14749
|
-
/* @__PURE__ */
|
|
14753
|
+
/* @__PURE__ */ React165.createElement(
|
|
14750
14754
|
"path",
|
|
14751
14755
|
{
|
|
14752
14756
|
d: "M8 5H8.005",
|
|
@@ -14759,7 +14763,7 @@ var SmileIcon = ({ size = 12, ...props }) => /* @__PURE__ */ React164.createElem
|
|
|
14759
14763
|
var SmileIcon_default = SmileIcon;
|
|
14760
14764
|
|
|
14761
14765
|
// src/components/TasksListItem/TasksListItem.tsx
|
|
14762
|
-
import
|
|
14766
|
+
import React166, { useContext as useContext33, useEffect as useEffect41, useState as useState48 } from "react";
|
|
14763
14767
|
import classNames57 from "classnames";
|
|
14764
14768
|
var TasksListItem = ({
|
|
14765
14769
|
task,
|
|
@@ -14785,14 +14789,14 @@ var TasksListItem = ({
|
|
|
14785
14789
|
useEffect41(() => {
|
|
14786
14790
|
setIsOpen(defaultOpen);
|
|
14787
14791
|
}, [defaultOpen]);
|
|
14788
|
-
return /* @__PURE__ */
|
|
14792
|
+
return /* @__PURE__ */ React166.createElement("div", { className: "Layer__tasks-list-item-wrapper" }, /* @__PURE__ */ React166.createElement("div", { className: taskItemClassName }, /* @__PURE__ */ React166.createElement(
|
|
14789
14793
|
"div",
|
|
14790
14794
|
{
|
|
14791
14795
|
className: "Layer__tasks-list-item__head",
|
|
14792
14796
|
onClick: () => setIsOpen(!isOpen)
|
|
14793
14797
|
},
|
|
14794
|
-
/* @__PURE__ */
|
|
14795
|
-
/* @__PURE__ */
|
|
14798
|
+
/* @__PURE__ */ React166.createElement("div", { className: taskHeadClassName }, /* @__PURE__ */ React166.createElement("div", { className: "Layer__tasks-list-item__head-info__status" }, isComplete(task.status) ? /* @__PURE__ */ React166.createElement(Check_default, { size: 12 }) : /* @__PURE__ */ React166.createElement(AlertCircle_default, { size: 12 })), /* @__PURE__ */ React166.createElement(Text, { size: "md" /* md */ }, task.title)),
|
|
14799
|
+
/* @__PURE__ */ React166.createElement(
|
|
14796
14800
|
ChevronDownFill_default,
|
|
14797
14801
|
{
|
|
14798
14802
|
size: 16,
|
|
@@ -14802,13 +14806,13 @@ var TasksListItem = ({
|
|
|
14802
14806
|
}
|
|
14803
14807
|
}
|
|
14804
14808
|
)
|
|
14805
|
-
), /* @__PURE__ */
|
|
14809
|
+
), /* @__PURE__ */ React166.createElement("div", { className: taskBodyClassName }, /* @__PURE__ */ React166.createElement("div", { className: "Layer__tasks-list-item__body-info" }, /* @__PURE__ */ React166.createElement(Text, { size: "sm" /* sm */ }, task.question), /* @__PURE__ */ React166.createElement(
|
|
14806
14810
|
Textarea,
|
|
14807
14811
|
{
|
|
14808
14812
|
value: userResponse,
|
|
14809
14813
|
onChange: (e) => setUserResponse(e.target.value)
|
|
14810
14814
|
}
|
|
14811
|
-
), /* @__PURE__ */
|
|
14815
|
+
), /* @__PURE__ */ React166.createElement("div", { className: "Layer__tasks-list-item__actions" }, /* @__PURE__ */ React166.createElement(
|
|
14812
14816
|
Button,
|
|
14813
14817
|
{
|
|
14814
14818
|
disabled: userResponse.length === 0 || userResponse === task.user_response,
|
|
@@ -14832,7 +14836,7 @@ function paginateArray(array, chunkSize = 10) {
|
|
|
14832
14836
|
}
|
|
14833
14837
|
return result;
|
|
14834
14838
|
}
|
|
14835
|
-
var TasksEmptyState = () => /* @__PURE__ */
|
|
14839
|
+
var TasksEmptyState = () => /* @__PURE__ */ React167.createElement("div", { className: "Layer__tasks-empty-state" }, /* @__PURE__ */ React167.createElement("div", { className: "Layer__tasks-icon" }, /* @__PURE__ */ React167.createElement(SmileIcon_default, null)), /* @__PURE__ */ React167.createElement(Text, { size: "sm" /* sm */ }, "There are no pending tasks!", /* @__PURE__ */ React167.createElement("br", null), " Great job!"));
|
|
14836
14840
|
var TasksList = ({ pageSize = 10 }) => {
|
|
14837
14841
|
const { data: tasks, error } = useContext34(TasksContext);
|
|
14838
14842
|
const firstPageWithIincompleteTasks = paginateArray(
|
|
@@ -14856,7 +14860,7 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
14856
14860
|
setCurrentPage(currentPage + 1);
|
|
14857
14861
|
}
|
|
14858
14862
|
};
|
|
14859
|
-
return /* @__PURE__ */
|
|
14863
|
+
return /* @__PURE__ */ React167.createElement("div", { className: "Layer__tasks-list" }, sortedTasks && sortedTasks.length > 0 ? /* @__PURE__ */ React167.createElement(React167.Fragment, null, sortedTasks.map((task, index) => /* @__PURE__ */ React167.createElement(
|
|
14860
14864
|
TasksListItem,
|
|
14861
14865
|
{
|
|
14862
14866
|
key: task.id,
|
|
@@ -14864,7 +14868,7 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
14864
14868
|
goToNextPageIfAllComplete: goToNextPage,
|
|
14865
14869
|
defaultOpen: index === indexFirstIncomplete
|
|
14866
14870
|
}
|
|
14867
|
-
)), tasks && tasks.length >= 10 && /* @__PURE__ */
|
|
14871
|
+
)), tasks && tasks.length >= 10 && /* @__PURE__ */ React167.createElement("div", { className: "Layer__tasks__pagination" }, /* @__PURE__ */ React167.createElement(
|
|
14868
14872
|
Pagination,
|
|
14869
14873
|
{
|
|
14870
14874
|
currentPage,
|
|
@@ -14872,11 +14876,11 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
14872
14876
|
pageSize,
|
|
14873
14877
|
onPageChange: (page) => setCurrentPage(page)
|
|
14874
14878
|
}
|
|
14875
|
-
))) : /* @__PURE__ */
|
|
14879
|
+
))) : /* @__PURE__ */ React167.createElement(React167.Fragment, null, error ? /* @__PURE__ */ React167.createElement(ErrorText, null, "Approval failed. Check connection and retry in few seconds.") : /* @__PURE__ */ React167.createElement(TasksEmptyState, null)));
|
|
14876
14880
|
};
|
|
14877
14881
|
|
|
14878
14882
|
// src/components/TasksPending/TasksPending.tsx
|
|
14879
|
-
import
|
|
14883
|
+
import React168, { useContext as useContext35 } from "react";
|
|
14880
14884
|
import classNames58 from "classnames";
|
|
14881
14885
|
import { format as format6 } from "date-fns";
|
|
14882
14886
|
import { Cell as Cell4, Pie as Pie3, PieChart as PieChart4 } from "recharts";
|
|
@@ -14896,7 +14900,7 @@ var TasksPending = () => {
|
|
|
14896
14900
|
const taskStatusClassName = classNames58(
|
|
14897
14901
|
completedTasks && completedTasks > 0 ? "Layer__tasks-pending-bar__status--done" : "Layer__tasks-pending-bar__status--pending"
|
|
14898
14902
|
);
|
|
14899
|
-
return /* @__PURE__ */
|
|
14903
|
+
return /* @__PURE__ */ React168.createElement("div", { className: "Layer__tasks-pending" }, /* @__PURE__ */ React168.createElement(Text, { size: "lg" /* lg */ }, format6(Date.now(), "MMMM")), /* @__PURE__ */ React168.createElement("div", { className: "Layer__tasks-pending-bar" }, /* @__PURE__ */ React168.createElement(Text, { size: "sm" /* sm */ }, /* @__PURE__ */ React168.createElement("span", { className: taskStatusClassName }, completedTasks), "/", data?.length, " done"), /* @__PURE__ */ React168.createElement(PieChart4, { width: 24, height: 24, className: "mini-chart" }, /* @__PURE__ */ React168.createElement(
|
|
14900
14904
|
Pie3,
|
|
14901
14905
|
{
|
|
14902
14906
|
data: chartData,
|
|
@@ -14914,7 +14918,7 @@ var TasksPending = () => {
|
|
|
14914
14918
|
animationEasing: "ease-in-out"
|
|
14915
14919
|
},
|
|
14916
14920
|
chartData.map((task, index) => {
|
|
14917
|
-
return /* @__PURE__ */
|
|
14921
|
+
return /* @__PURE__ */ React168.createElement(
|
|
14918
14922
|
Cell4,
|
|
14919
14923
|
{
|
|
14920
14924
|
key: `cell-${index}`,
|
|
@@ -14947,7 +14951,7 @@ var Tasks = ({
|
|
|
14947
14951
|
// deprecated
|
|
14948
14952
|
stringOverrides
|
|
14949
14953
|
}) => {
|
|
14950
|
-
return /* @__PURE__ */
|
|
14954
|
+
return /* @__PURE__ */ React169.createElement(TasksProvider, null, /* @__PURE__ */ React169.createElement(
|
|
14951
14955
|
TasksComponent,
|
|
14952
14956
|
{
|
|
14953
14957
|
collapsable,
|
|
@@ -14960,7 +14964,7 @@ var Tasks = ({
|
|
|
14960
14964
|
};
|
|
14961
14965
|
var TasksProvider = ({ children }) => {
|
|
14962
14966
|
const contextData = useTasks();
|
|
14963
|
-
return /* @__PURE__ */
|
|
14967
|
+
return /* @__PURE__ */ React169.createElement(TasksContext.Provider, { value: contextData }, children);
|
|
14964
14968
|
};
|
|
14965
14969
|
var TasksComponent = ({
|
|
14966
14970
|
collapsable = false,
|
|
@@ -14988,7 +14992,7 @@ var TasksComponent = ({
|
|
|
14988
14992
|
setOpen(false);
|
|
14989
14993
|
}
|
|
14990
14994
|
}, [allComplete]);
|
|
14991
|
-
return /* @__PURE__ */
|
|
14995
|
+
return /* @__PURE__ */ React169.createElement("div", { className: "Layer__tasks-component" }, /* @__PURE__ */ React169.createElement(
|
|
14992
14996
|
TasksHeader,
|
|
14993
14997
|
{
|
|
14994
14998
|
tasksHeader: stringOverrides?.header || tasksHeader,
|
|
@@ -14996,7 +15000,7 @@ var TasksComponent = ({
|
|
|
14996
15000
|
open,
|
|
14997
15001
|
toggleContent: () => setOpen(!open)
|
|
14998
15002
|
}
|
|
14999
|
-
), /* @__PURE__ */
|
|
15003
|
+
), /* @__PURE__ */ React169.createElement(
|
|
15000
15004
|
"div",
|
|
15001
15005
|
{
|
|
15002
15006
|
className: classNames59(
|
|
@@ -15004,16 +15008,16 @@ var TasksComponent = ({
|
|
|
15004
15008
|
!open && "Layer__tasks__content--collapsed"
|
|
15005
15009
|
)
|
|
15006
15010
|
},
|
|
15007
|
-
isLoading || !data ? /* @__PURE__ */
|
|
15011
|
+
isLoading || !data ? /* @__PURE__ */ React169.createElement("div", { className: "Layer__tasks__loader-container" }, /* @__PURE__ */ React169.createElement(Loader2, null)) : /* @__PURE__ */ React169.createElement(React169.Fragment, null, data.length > 0 && /* @__PURE__ */ React169.createElement(TasksPending, null), /* @__PURE__ */ React169.createElement(TasksList, null))
|
|
15008
15012
|
));
|
|
15009
15013
|
};
|
|
15010
15014
|
|
|
15011
15015
|
// src/components/UpsellBanner/BookkeepingUpsellBar.tsx
|
|
15012
|
-
import
|
|
15016
|
+
import React172 from "react";
|
|
15013
15017
|
|
|
15014
15018
|
// src/icons/Coffee.tsx
|
|
15015
|
-
import * as
|
|
15016
|
-
var CoffeeIcon = ({ size = 11, ...props }) => /* @__PURE__ */
|
|
15019
|
+
import * as React170 from "react";
|
|
15020
|
+
var CoffeeIcon = ({ size = 11, ...props }) => /* @__PURE__ */ React170.createElement(
|
|
15017
15021
|
"svg",
|
|
15018
15022
|
{
|
|
15019
15023
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -15023,7 +15027,7 @@ var CoffeeIcon = ({ size = 11, ...props }) => /* @__PURE__ */ React169.createEle
|
|
|
15023
15027
|
width: size,
|
|
15024
15028
|
height: size
|
|
15025
15029
|
},
|
|
15026
|
-
/* @__PURE__ */
|
|
15030
|
+
/* @__PURE__ */ React170.createElement("g", { "clip-path": "url(#clip0_5018_10141)" }, /* @__PURE__ */ React170.createElement(
|
|
15027
15031
|
"path",
|
|
15028
15032
|
{
|
|
15029
15033
|
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",
|
|
@@ -15031,7 +15035,7 @@ var CoffeeIcon = ({ size = 11, ...props }) => /* @__PURE__ */ React169.createEle
|
|
|
15031
15035
|
strokeLinecap: "round",
|
|
15032
15036
|
strokeLinejoin: "round"
|
|
15033
15037
|
}
|
|
15034
|
-
), /* @__PURE__ */
|
|
15038
|
+
), /* @__PURE__ */ React170.createElement(
|
|
15035
15039
|
"path",
|
|
15036
15040
|
{
|
|
15037
15041
|
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",
|
|
@@ -15039,7 +15043,7 @@ var CoffeeIcon = ({ size = 11, ...props }) => /* @__PURE__ */ React169.createEle
|
|
|
15039
15043
|
strokeLinecap: "round",
|
|
15040
15044
|
strokeLinejoin: "round"
|
|
15041
15045
|
}
|
|
15042
|
-
), /* @__PURE__ */
|
|
15046
|
+
), /* @__PURE__ */ React170.createElement(
|
|
15043
15047
|
"path",
|
|
15044
15048
|
{
|
|
15045
15049
|
d: "M8.75 0.958344V2.33334",
|
|
@@ -15047,7 +15051,7 @@ var CoffeeIcon = ({ size = 11, ...props }) => /* @__PURE__ */ React169.createEle
|
|
|
15047
15051
|
strokeLinecap: "round",
|
|
15048
15052
|
strokeLinejoin: "round"
|
|
15049
15053
|
}
|
|
15050
|
-
), /* @__PURE__ */
|
|
15054
|
+
), /* @__PURE__ */ React170.createElement(
|
|
15051
15055
|
"path",
|
|
15052
15056
|
{
|
|
15053
15057
|
d: "M6.91663 0.958344V2.33334",
|
|
@@ -15055,7 +15059,7 @@ var CoffeeIcon = ({ size = 11, ...props }) => /* @__PURE__ */ React169.createEle
|
|
|
15055
15059
|
strokeLinecap: "round",
|
|
15056
15060
|
strokeLinejoin: "round"
|
|
15057
15061
|
}
|
|
15058
|
-
), /* @__PURE__ */
|
|
15062
|
+
), /* @__PURE__ */ React170.createElement(
|
|
15059
15063
|
"path",
|
|
15060
15064
|
{
|
|
15061
15065
|
d: "M5.08337 0.958344V2.33334",
|
|
@@ -15064,7 +15068,7 @@ var CoffeeIcon = ({ size = 11, ...props }) => /* @__PURE__ */ React169.createEle
|
|
|
15064
15068
|
strokeLinejoin: "round"
|
|
15065
15069
|
}
|
|
15066
15070
|
)),
|
|
15067
|
-
/* @__PURE__ */
|
|
15071
|
+
/* @__PURE__ */ React170.createElement("defs", null, /* @__PURE__ */ React170.createElement("clipPath", { id: "clip0_5018_10141" }, /* @__PURE__ */ React170.createElement(
|
|
15068
15072
|
"rect",
|
|
15069
15073
|
{
|
|
15070
15074
|
width: "11",
|
|
@@ -15077,9 +15081,9 @@ var CoffeeIcon = ({ size = 11, ...props }) => /* @__PURE__ */ React169.createEle
|
|
|
15077
15081
|
var Coffee_default = CoffeeIcon;
|
|
15078
15082
|
|
|
15079
15083
|
// src/components/IconBox/IconBox.tsx
|
|
15080
|
-
import
|
|
15084
|
+
import React171 from "react";
|
|
15081
15085
|
var IconBox = ({ children }) => {
|
|
15082
|
-
return /* @__PURE__ */
|
|
15086
|
+
return /* @__PURE__ */ React171.createElement("span", { className: "Layer__icon-box" }, children);
|
|
15083
15087
|
};
|
|
15084
15088
|
|
|
15085
15089
|
// src/components/UpsellBanner/BookkeepingUpsellBar.tsx
|
|
@@ -15087,18 +15091,18 @@ var BookkeepingUpsellBar = ({
|
|
|
15087
15091
|
onClick,
|
|
15088
15092
|
href
|
|
15089
15093
|
}) => {
|
|
15090
|
-
return /* @__PURE__ */
|
|
15094
|
+
return /* @__PURE__ */ React172.createElement("div", { className: "Layer__bar-banner Layer__bar-banner--bookkeeping" }, /* @__PURE__ */ React172.createElement("div", { className: "Layer__bar-banner__left-col" }, /* @__PURE__ */ React172.createElement(IconBox, null, /* @__PURE__ */ React172.createElement(Coffee_default, null)), /* @__PURE__ */ React172.createElement("div", { className: "Layer__bar-banner__text-container" }, /* @__PURE__ */ React172.createElement(Text, { size: "md" /* md */, weight: "bold" /* bold */ }, "Need help with your books?"), /* @__PURE__ */ React172.createElement(
|
|
15091
15095
|
Text,
|
|
15092
15096
|
{
|
|
15093
15097
|
size: "sm" /* sm */,
|
|
15094
15098
|
className: "Layer__bar-banner__text-container__desc"
|
|
15095
15099
|
},
|
|
15096
15100
|
"Order bookkeeping service supported by real humans."
|
|
15097
|
-
))), onClick ? /* @__PURE__ */
|
|
15101
|
+
))), onClick ? /* @__PURE__ */ React172.createElement(Button, { variant: "secondary" /* secondary */, onClick }, "Schedule a demo") : href ? /* @__PURE__ */ React172.createElement(Link2, { href, target: "_blank", variant: "secondary" /* secondary */ }, "Schedule a demo") : null);
|
|
15098
15102
|
};
|
|
15099
15103
|
|
|
15100
15104
|
// src/views/BookkeepingOverview/BookkeepingOverview.tsx
|
|
15101
|
-
import
|
|
15105
|
+
import React173, { useState as useState51 } from "react";
|
|
15102
15106
|
import classNames60 from "classnames";
|
|
15103
15107
|
var BookkeepingOverview = ({
|
|
15104
15108
|
title,
|
|
@@ -15107,15 +15111,15 @@ var BookkeepingOverview = ({
|
|
|
15107
15111
|
}) => {
|
|
15108
15112
|
const [pnlToggle, setPnlToggle] = useState51("expenses");
|
|
15109
15113
|
const [width] = useWindowSize();
|
|
15110
|
-
return /* @__PURE__ */
|
|
15114
|
+
return /* @__PURE__ */ React173.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React173.createElement(TasksProvider, null, /* @__PURE__ */ React173.createElement(
|
|
15111
15115
|
View,
|
|
15112
15116
|
{
|
|
15113
15117
|
viewClassName: "Layer__bookkeeping-overview--view",
|
|
15114
15118
|
title: stringOverrides?.title || title || "Bookkeeping overview",
|
|
15115
15119
|
withSidebar: width > 1100,
|
|
15116
|
-
sidebar: /* @__PURE__ */
|
|
15120
|
+
sidebar: /* @__PURE__ */ React173.createElement(TasksComponent, { stringOverrides: stringOverrides?.tasks })
|
|
15117
15121
|
},
|
|
15118
|
-
width <= 1100 && /* @__PURE__ */
|
|
15122
|
+
width <= 1100 && /* @__PURE__ */ React173.createElement(
|
|
15119
15123
|
TasksComponent,
|
|
15120
15124
|
{
|
|
15121
15125
|
collapsable: true,
|
|
@@ -15123,23 +15127,23 @@ var BookkeepingOverview = ({
|
|
|
15123
15127
|
stringOverrides: stringOverrides?.tasks
|
|
15124
15128
|
}
|
|
15125
15129
|
),
|
|
15126
|
-
/* @__PURE__ */
|
|
15130
|
+
/* @__PURE__ */ React173.createElement(
|
|
15127
15131
|
Container,
|
|
15128
15132
|
{
|
|
15129
15133
|
name: "bookkeeping-overview-profit-and-loss",
|
|
15130
15134
|
asWidget: true,
|
|
15131
15135
|
elevated: true
|
|
15132
15136
|
},
|
|
15133
|
-
/* @__PURE__ */
|
|
15134
|
-
/* @__PURE__ */
|
|
15137
|
+
/* @__PURE__ */ React173.createElement(Header, null, /* @__PURE__ */ React173.createElement(Heading, { size: "secondary" /* secondary */ }, stringOverrides?.profitAndLoss?.header || "Profit & Loss"), /* @__PURE__ */ React173.createElement(ProfitAndLoss.DatePicker, null)),
|
|
15138
|
+
/* @__PURE__ */ React173.createElement("div", { className: "Layer__bookkeeping-overview__summaries-row" }, /* @__PURE__ */ React173.createElement(
|
|
15135
15139
|
ProfitAndLoss.Summaries,
|
|
15136
15140
|
{
|
|
15137
15141
|
stringOverrides: stringOverrides?.profitAndLoss?.summaries
|
|
15138
15142
|
}
|
|
15139
15143
|
)),
|
|
15140
|
-
/* @__PURE__ */
|
|
15144
|
+
/* @__PURE__ */ React173.createElement(ProfitAndLoss.Chart, null)
|
|
15141
15145
|
),
|
|
15142
|
-
/* @__PURE__ */
|
|
15146
|
+
/* @__PURE__ */ React173.createElement("div", { className: "Layer__bookkeeping-overview-profit-and-loss-charts" }, /* @__PURE__ */ React173.createElement(
|
|
15143
15147
|
Toggle,
|
|
15144
15148
|
{
|
|
15145
15149
|
name: "pnl-detailed-charts",
|
|
@@ -15156,7 +15160,7 @@ var BookkeepingOverview = ({
|
|
|
15156
15160
|
selected: pnlToggle,
|
|
15157
15161
|
onChange: (e) => setPnlToggle(e.target.value)
|
|
15158
15162
|
}
|
|
15159
|
-
), /* @__PURE__ */
|
|
15163
|
+
), /* @__PURE__ */ React173.createElement(
|
|
15160
15164
|
Container,
|
|
15161
15165
|
{
|
|
15162
15166
|
name: classNames60(
|
|
@@ -15164,7 +15168,7 @@ var BookkeepingOverview = ({
|
|
|
15164
15168
|
pnlToggle !== "revenue" && "bookkeeping-overview-profit-and-loss-chart--hidden"
|
|
15165
15169
|
)
|
|
15166
15170
|
},
|
|
15167
|
-
/* @__PURE__ */
|
|
15171
|
+
/* @__PURE__ */ React173.createElement(
|
|
15168
15172
|
ProfitAndLoss.DetailedCharts,
|
|
15169
15173
|
{
|
|
15170
15174
|
scope: "revenue",
|
|
@@ -15172,7 +15176,7 @@ var BookkeepingOverview = ({
|
|
|
15172
15176
|
stringOverrides: stringOverrides?.profitAndLoss?.detailedCharts
|
|
15173
15177
|
}
|
|
15174
15178
|
)
|
|
15175
|
-
), /* @__PURE__ */
|
|
15179
|
+
), /* @__PURE__ */ React173.createElement(
|
|
15176
15180
|
Container,
|
|
15177
15181
|
{
|
|
15178
15182
|
name: classNames60(
|
|
@@ -15180,7 +15184,7 @@ var BookkeepingOverview = ({
|
|
|
15180
15184
|
pnlToggle !== "expenses" && "bookkeeping-overview-profit-and-loss-chart--hidden"
|
|
15181
15185
|
)
|
|
15182
15186
|
},
|
|
15183
|
-
/* @__PURE__ */
|
|
15187
|
+
/* @__PURE__ */ React173.createElement(
|
|
15184
15188
|
ProfitAndLoss.DetailedCharts,
|
|
15185
15189
|
{
|
|
15186
15190
|
scope: "expenses",
|
|
@@ -15193,29 +15197,29 @@ var BookkeepingOverview = ({
|
|
|
15193
15197
|
};
|
|
15194
15198
|
|
|
15195
15199
|
// src/views/AccountingOverview/AccountingOverview.tsx
|
|
15196
|
-
import
|
|
15200
|
+
import React177, { useState as useState53 } from "react";
|
|
15197
15201
|
|
|
15198
15202
|
// src/components/TransactionToReviewCard/TransactionToReviewCard.tsx
|
|
15199
|
-
import
|
|
15203
|
+
import React176, { useContext as useContext37, useEffect as useEffect44, useState as useState52 } from "react";
|
|
15200
15204
|
|
|
15201
15205
|
// src/components/BadgeLoader/BadgeLoader.tsx
|
|
15202
|
-
import
|
|
15206
|
+
import React174 from "react";
|
|
15203
15207
|
var BadgeLoader = ({ children }) => {
|
|
15204
|
-
return /* @__PURE__ */
|
|
15208
|
+
return /* @__PURE__ */ React174.createElement("span", { className: "Layer__loader Layer__loader--as-badge" }, /* @__PURE__ */ React174.createElement(Loader_default, { size: 11, className: "Layer__anim--rotating" }), children);
|
|
15205
15209
|
};
|
|
15206
15210
|
|
|
15207
15211
|
// src/components/NotificationCard/NotificationCard.tsx
|
|
15208
|
-
import
|
|
15212
|
+
import React175 from "react";
|
|
15209
15213
|
import classNames61 from "classnames";
|
|
15210
15214
|
var NotificationCard = ({
|
|
15211
15215
|
onClick,
|
|
15212
15216
|
children,
|
|
15213
15217
|
className
|
|
15214
15218
|
}) => {
|
|
15215
|
-
return /* @__PURE__ */
|
|
15219
|
+
return /* @__PURE__ */ React175.createElement("div", { className: classNames61("Layer__notification-card", className) }, /* @__PURE__ */ React175.createElement("div", { className: "Layer__notification-card__main" }, children), /* @__PURE__ */ React175.createElement(
|
|
15216
15220
|
IconButton,
|
|
15217
15221
|
{
|
|
15218
|
-
icon: /* @__PURE__ */
|
|
15222
|
+
icon: /* @__PURE__ */ React175.createElement(ChevronRight_default, null),
|
|
15219
15223
|
withBorder: true,
|
|
15220
15224
|
onClick: () => onClick()
|
|
15221
15225
|
}
|
|
@@ -15250,40 +15254,40 @@ var TransactionToReviewCard = ({
|
|
|
15250
15254
|
}
|
|
15251
15255
|
}
|
|
15252
15256
|
};
|
|
15253
|
-
return /* @__PURE__ */
|
|
15257
|
+
return /* @__PURE__ */ React176.createElement(
|
|
15254
15258
|
NotificationCard,
|
|
15255
15259
|
{
|
|
15256
15260
|
className: "Layer__txs-to-review",
|
|
15257
15261
|
onClick: () => onClick && onClick()
|
|
15258
15262
|
},
|
|
15259
|
-
/* @__PURE__ */
|
|
15260
|
-
loaded === "initial" || loaded === "loading" ? /* @__PURE__ */
|
|
15261
|
-
loaded === "complete" && error ? /* @__PURE__ */
|
|
15263
|
+
/* @__PURE__ */ React176.createElement(Text, { size: "sm" /* sm */ }, "Transactions to review"),
|
|
15264
|
+
loaded === "initial" || loaded === "loading" ? /* @__PURE__ */ React176.createElement(BadgeLoader, null) : null,
|
|
15265
|
+
loaded === "complete" && error ? /* @__PURE__ */ React176.createElement(
|
|
15262
15266
|
Badge,
|
|
15263
15267
|
{
|
|
15264
15268
|
variant: "error" /* ERROR */,
|
|
15265
15269
|
size: "small" /* SMALL */,
|
|
15266
|
-
icon: /* @__PURE__ */
|
|
15270
|
+
icon: /* @__PURE__ */ React176.createElement(RefreshCcw_default, { size: 12 }),
|
|
15267
15271
|
onClick: () => refetch()
|
|
15268
15272
|
},
|
|
15269
15273
|
"Refresh"
|
|
15270
15274
|
) : null,
|
|
15271
|
-
loaded === "complete" && !error && toReview > 0 ? /* @__PURE__ */
|
|
15275
|
+
loaded === "complete" && !error && toReview > 0 ? /* @__PURE__ */ React176.createElement(
|
|
15272
15276
|
Badge,
|
|
15273
15277
|
{
|
|
15274
15278
|
variant: "warning" /* WARNING */,
|
|
15275
15279
|
size: "small" /* SMALL */,
|
|
15276
|
-
icon: /* @__PURE__ */
|
|
15280
|
+
icon: /* @__PURE__ */ React176.createElement(Bell_default, { size: 12 })
|
|
15277
15281
|
},
|
|
15278
15282
|
toReview,
|
|
15279
15283
|
" pending"
|
|
15280
15284
|
) : null,
|
|
15281
|
-
loaded === "complete" && !error && toReview === 0 ? /* @__PURE__ */
|
|
15285
|
+
loaded === "complete" && !error && toReview === 0 ? /* @__PURE__ */ React176.createElement(
|
|
15282
15286
|
Badge,
|
|
15283
15287
|
{
|
|
15284
15288
|
variant: "success" /* SUCCESS */,
|
|
15285
15289
|
size: "small" /* SMALL */,
|
|
15286
|
-
icon: /* @__PURE__ */
|
|
15290
|
+
icon: /* @__PURE__ */ React176.createElement(Check_default, { size: 12 })
|
|
15287
15291
|
},
|
|
15288
15292
|
"All done"
|
|
15289
15293
|
) : null
|
|
@@ -15301,32 +15305,32 @@ var AccountingOverview = ({
|
|
|
15301
15305
|
stringOverrides
|
|
15302
15306
|
}) => {
|
|
15303
15307
|
const [pnlToggle, setPnlToggle] = useState53("expenses");
|
|
15304
|
-
return /* @__PURE__ */
|
|
15308
|
+
return /* @__PURE__ */ React177.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React177.createElement(View, { title, headerControls: /* @__PURE__ */ React177.createElement(ProfitAndLoss.DatePicker, null) }, enableOnboarding && /* @__PURE__ */ React177.createElement(
|
|
15305
15309
|
Onboarding,
|
|
15306
15310
|
{
|
|
15307
15311
|
onTransactionsToReviewClick
|
|
15308
15312
|
}
|
|
15309
|
-
), /* @__PURE__ */
|
|
15313
|
+
), /* @__PURE__ */ React177.createElement("div", { className: "Layer__accounting-overview__summaries-row" }, /* @__PURE__ */ React177.createElement(
|
|
15310
15314
|
ProfitAndLoss.Summaries,
|
|
15311
15315
|
{
|
|
15312
15316
|
stringOverrides: stringOverrides?.profitAndLoss?.summaries
|
|
15313
15317
|
}
|
|
15314
|
-
), /* @__PURE__ */
|
|
15318
|
+
), /* @__PURE__ */ React177.createElement(
|
|
15315
15319
|
TransactionToReviewCard,
|
|
15316
15320
|
{
|
|
15317
15321
|
usePnlDateRange: true,
|
|
15318
15322
|
onClick: onTransactionsToReviewClick
|
|
15319
15323
|
}
|
|
15320
|
-
)), /* @__PURE__ */
|
|
15324
|
+
)), /* @__PURE__ */ React177.createElement(
|
|
15321
15325
|
Container,
|
|
15322
15326
|
{
|
|
15323
15327
|
name: "accounting-overview-profit-and-loss",
|
|
15324
15328
|
asWidget: true,
|
|
15325
15329
|
elevated: true
|
|
15326
15330
|
},
|
|
15327
|
-
/* @__PURE__ */
|
|
15328
|
-
/* @__PURE__ */
|
|
15329
|
-
), middleBanner && /* @__PURE__ */
|
|
15331
|
+
/* @__PURE__ */ React177.createElement(Header, null, /* @__PURE__ */ React177.createElement(Heading, { size: "secondary" /* secondary */ }, stringOverrides?.header || "Profit & Loss")),
|
|
15332
|
+
/* @__PURE__ */ React177.createElement(ProfitAndLoss.Chart, null)
|
|
15333
|
+
), middleBanner && /* @__PURE__ */ React177.createElement(Container, { name: "accounting-overview-middle-banner" }, middleBanner), /* @__PURE__ */ React177.createElement("div", { className: "Layer__accounting-overview-profit-and-loss-charts" }, /* @__PURE__ */ React177.createElement(
|
|
15330
15334
|
Toggle,
|
|
15331
15335
|
{
|
|
15332
15336
|
name: "pnl-detailed-charts",
|
|
@@ -15343,7 +15347,7 @@ var AccountingOverview = ({
|
|
|
15343
15347
|
selected: pnlToggle,
|
|
15344
15348
|
onChange: (e) => setPnlToggle(e.target.value)
|
|
15345
15349
|
}
|
|
15346
|
-
), /* @__PURE__ */
|
|
15350
|
+
), /* @__PURE__ */ React177.createElement(
|
|
15347
15351
|
Container,
|
|
15348
15352
|
{
|
|
15349
15353
|
name: classNames62(
|
|
@@ -15351,7 +15355,7 @@ var AccountingOverview = ({
|
|
|
15351
15355
|
pnlToggle !== "revenue" && "accounting-overview-profit-and-loss-chart--hidden"
|
|
15352
15356
|
)
|
|
15353
15357
|
},
|
|
15354
|
-
/* @__PURE__ */
|
|
15358
|
+
/* @__PURE__ */ React177.createElement(
|
|
15355
15359
|
ProfitAndLoss.DetailedCharts,
|
|
15356
15360
|
{
|
|
15357
15361
|
scope: "revenue",
|
|
@@ -15360,7 +15364,7 @@ var AccountingOverview = ({
|
|
|
15360
15364
|
chartColorsList
|
|
15361
15365
|
}
|
|
15362
15366
|
)
|
|
15363
|
-
), /* @__PURE__ */
|
|
15367
|
+
), /* @__PURE__ */ React177.createElement(
|
|
15364
15368
|
Container,
|
|
15365
15369
|
{
|
|
15366
15370
|
name: classNames62(
|
|
@@ -15368,7 +15372,7 @@ var AccountingOverview = ({
|
|
|
15368
15372
|
pnlToggle !== "expenses" && "accounting-overview-profit-and-loss-chart--hidden"
|
|
15369
15373
|
)
|
|
15370
15374
|
},
|
|
15371
|
-
/* @__PURE__ */
|
|
15375
|
+
/* @__PURE__ */ React177.createElement(
|
|
15372
15376
|
ProfitAndLoss.DetailedCharts,
|
|
15373
15377
|
{
|
|
15374
15378
|
scope: "expenses",
|
|
@@ -15381,7 +15385,7 @@ var AccountingOverview = ({
|
|
|
15381
15385
|
};
|
|
15382
15386
|
|
|
15383
15387
|
// src/views/BankTransactionsWithLinkedAccounts/BankTransactionsWithLinkedAccounts.tsx
|
|
15384
|
-
import
|
|
15388
|
+
import React178 from "react";
|
|
15385
15389
|
var BankTransactionsWithLinkedAccounts = ({
|
|
15386
15390
|
title,
|
|
15387
15391
|
// deprecated
|
|
@@ -15395,7 +15399,7 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
15395
15399
|
mobileComponent,
|
|
15396
15400
|
stringOverrides
|
|
15397
15401
|
}) => {
|
|
15398
|
-
return /* @__PURE__ */
|
|
15402
|
+
return /* @__PURE__ */ React178.createElement(View, { title: stringOverrides?.title || title || "Bank transactions" }, /* @__PURE__ */ React178.createElement(
|
|
15399
15403
|
LinkedAccounts,
|
|
15400
15404
|
{
|
|
15401
15405
|
elevated: elevatedLinkedAccounts,
|
|
@@ -15404,7 +15408,7 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
15404
15408
|
showBreakConnection,
|
|
15405
15409
|
stringOverrides: stringOverrides?.linkedAccounts
|
|
15406
15410
|
}
|
|
15407
|
-
), /* @__PURE__ */
|
|
15411
|
+
), /* @__PURE__ */ React178.createElement(
|
|
15408
15412
|
BankTransactions,
|
|
15409
15413
|
{
|
|
15410
15414
|
asWidget: true,
|
|
@@ -15418,14 +15422,14 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
15418
15422
|
};
|
|
15419
15423
|
|
|
15420
15424
|
// src/views/GeneralLedger/GeneralLedger.tsx
|
|
15421
|
-
import
|
|
15425
|
+
import React179, { useState as useState54 } from "react";
|
|
15422
15426
|
var GeneralLedgerView = ({
|
|
15423
15427
|
title,
|
|
15424
15428
|
// deprecated
|
|
15425
15429
|
stringOverrides
|
|
15426
15430
|
}) => {
|
|
15427
15431
|
const [activeTab, setActiveTab] = useState54("chartOfAccounts");
|
|
15428
|
-
return /* @__PURE__ */
|
|
15432
|
+
return /* @__PURE__ */ React179.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React179.createElement(View, { title: stringOverrides?.title || title || "General Ledger" }, /* @__PURE__ */ React179.createElement(
|
|
15429
15433
|
Toggle,
|
|
15430
15434
|
{
|
|
15431
15435
|
name: "general-ledger-tabs",
|
|
@@ -15442,18 +15446,18 @@ var GeneralLedgerView = ({
|
|
|
15442
15446
|
selected: activeTab,
|
|
15443
15447
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
15444
15448
|
}
|
|
15445
|
-
), /* @__PURE__ */
|
|
15449
|
+
), /* @__PURE__ */ React179.createElement(Container, { name: "generalLedger" }, activeTab === "chartOfAccounts" ? /* @__PURE__ */ React179.createElement(
|
|
15446
15450
|
ChartOfAccounts,
|
|
15447
15451
|
{
|
|
15448
15452
|
asWidget: true,
|
|
15449
15453
|
withExpandAllButton: true,
|
|
15450
15454
|
stringOverrides: stringOverrides?.chartOfAccounts
|
|
15451
15455
|
}
|
|
15452
|
-
) : /* @__PURE__ */
|
|
15456
|
+
) : /* @__PURE__ */ React179.createElement(Journal, { stringOverrides: stringOverrides?.journal }))));
|
|
15453
15457
|
};
|
|
15454
15458
|
|
|
15455
15459
|
// src/views/Reports/Reports.tsx
|
|
15456
|
-
import
|
|
15460
|
+
import React180, { useContext as useContext38, useRef as useRef16, useState as useState55 } from "react";
|
|
15457
15461
|
var DownloadButton2 = ({
|
|
15458
15462
|
stringOverrides
|
|
15459
15463
|
}) => {
|
|
@@ -15486,7 +15490,7 @@ var DownloadButton2 = ({
|
|
|
15486
15490
|
setRequestFailed(true);
|
|
15487
15491
|
}
|
|
15488
15492
|
};
|
|
15489
|
-
return requestFailed ? /* @__PURE__ */
|
|
15493
|
+
return requestFailed ? /* @__PURE__ */ React180.createElement(
|
|
15490
15494
|
RetryButton,
|
|
15491
15495
|
{
|
|
15492
15496
|
onClick: handleClick,
|
|
@@ -15494,11 +15498,11 @@ var DownloadButton2 = ({
|
|
|
15494
15498
|
error: "Approval failed. Check connection and retry in few seconds."
|
|
15495
15499
|
},
|
|
15496
15500
|
stringOverrides?.retryButtonText || "Retry"
|
|
15497
|
-
) : /* @__PURE__ */
|
|
15501
|
+
) : /* @__PURE__ */ React180.createElement(
|
|
15498
15502
|
Button,
|
|
15499
15503
|
{
|
|
15500
15504
|
variant: "secondary" /* secondary */,
|
|
15501
|
-
rightIcon: /* @__PURE__ */
|
|
15505
|
+
rightIcon: /* @__PURE__ */ React180.createElement(DownloadCloud_default, { size: 12 }),
|
|
15502
15506
|
onClick: handleClick
|
|
15503
15507
|
},
|
|
15504
15508
|
stringOverrides?.downloadButtonText || "Download"
|
|
@@ -15529,7 +15533,7 @@ var Reports = ({
|
|
|
15529
15533
|
const [activeTab, setActiveTab] = useState55(enabledReports[0]);
|
|
15530
15534
|
const options = getOptions(enabledReports);
|
|
15531
15535
|
const defaultTitle = enabledReports.length > 1 ? "Reports" : options.find((option) => option.value = enabledReports[0])?.label;
|
|
15532
|
-
return /* @__PURE__ */
|
|
15536
|
+
return /* @__PURE__ */ React180.createElement(View, { title: stringOverrides?.title || title || defaultTitle }, enabledReports.length > 1 && /* @__PURE__ */ React180.createElement("div", { className: "Layer__component Layer__header__actions" }, /* @__PURE__ */ React180.createElement(
|
|
15533
15537
|
Toggle,
|
|
15534
15538
|
{
|
|
15535
15539
|
name: "reports-tabs",
|
|
@@ -15537,7 +15541,7 @@ var Reports = ({
|
|
|
15537
15541
|
selected: activeTab,
|
|
15538
15542
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
15539
15543
|
}
|
|
15540
|
-
)), /* @__PURE__ */
|
|
15544
|
+
)), /* @__PURE__ */ React180.createElement(Container, { name: "reports", ref: containerRef }, /* @__PURE__ */ React180.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React180.createElement(
|
|
15541
15545
|
ReportsPanel,
|
|
15542
15546
|
{
|
|
15543
15547
|
containerRef,
|
|
@@ -15552,21 +15556,21 @@ var ReportsPanel = ({
|
|
|
15552
15556
|
stringOverrides
|
|
15553
15557
|
}) => {
|
|
15554
15558
|
const { sidebarScope } = useContext38(ProfitAndLoss.Context);
|
|
15555
|
-
return /* @__PURE__ */
|
|
15559
|
+
return /* @__PURE__ */ React180.createElement(React180.Fragment, null, openReport === "profitAndLoss" && /* @__PURE__ */ React180.createElement(
|
|
15556
15560
|
View,
|
|
15557
15561
|
{
|
|
15558
15562
|
type: "panel",
|
|
15559
|
-
headerControls: /* @__PURE__ */
|
|
15563
|
+
headerControls: /* @__PURE__ */ React180.createElement(React180.Fragment, null, /* @__PURE__ */ React180.createElement(ProfitAndLoss.DatePicker, null), /* @__PURE__ */ React180.createElement(
|
|
15560
15564
|
DownloadButton2,
|
|
15561
15565
|
{
|
|
15562
15566
|
stringOverrides: stringOverrides?.downloadButton
|
|
15563
15567
|
}
|
|
15564
15568
|
))
|
|
15565
15569
|
},
|
|
15566
|
-
/* @__PURE__ */
|
|
15570
|
+
/* @__PURE__ */ React180.createElement(
|
|
15567
15571
|
Panel,
|
|
15568
15572
|
{
|
|
15569
|
-
sidebar: /* @__PURE__ */
|
|
15573
|
+
sidebar: /* @__PURE__ */ React180.createElement(
|
|
15570
15574
|
ProfitAndLoss.DetailedCharts,
|
|
15571
15575
|
{
|
|
15572
15576
|
showDatePicker: false,
|
|
@@ -15576,7 +15580,7 @@ var ReportsPanel = ({
|
|
|
15576
15580
|
sidebarIsOpen: Boolean(sidebarScope),
|
|
15577
15581
|
parentRef: containerRef
|
|
15578
15582
|
},
|
|
15579
|
-
/* @__PURE__ */
|
|
15583
|
+
/* @__PURE__ */ React180.createElement(
|
|
15580
15584
|
ProfitAndLoss.Table,
|
|
15581
15585
|
{
|
|
15582
15586
|
asContainer: false,
|
|
@@ -15584,7 +15588,7 @@ var ReportsPanel = ({
|
|
|
15584
15588
|
}
|
|
15585
15589
|
)
|
|
15586
15590
|
)
|
|
15587
|
-
)
|
|
15591
|
+
), openReport === "balanceSheet" && /* @__PURE__ */ React180.createElement(BalanceSheet, { stringOverrides: stringOverrides?.balanceSheet }), openReport === "statementOfCashFlow" && /* @__PURE__ */ React180.createElement(
|
|
15588
15592
|
StatementOfCashFlow,
|
|
15589
15593
|
{
|
|
15590
15594
|
stringOverrides: stringOverrides?.statementOfCashflow
|
|
@@ -15593,11 +15597,11 @@ var ReportsPanel = ({
|
|
|
15593
15597
|
};
|
|
15594
15598
|
|
|
15595
15599
|
// src/components/ProfitAndLossView/ProfitAndLossView.tsx
|
|
15596
|
-
import
|
|
15600
|
+
import React181, { useContext as useContext39, useRef as useRef17 } from "react";
|
|
15597
15601
|
var COMPONENT_NAME7 = "profit-and-loss";
|
|
15598
15602
|
var ProfitAndLossView = (props) => {
|
|
15599
15603
|
const containerRef = useRef17(null);
|
|
15600
|
-
return /* @__PURE__ */
|
|
15604
|
+
return /* @__PURE__ */ React181.createElement(Container, { name: COMPONENT_NAME7, ref: containerRef }, /* @__PURE__ */ React181.createElement(ProfitAndLoss, null, /* @__PURE__ */ React181.createElement(ProfitAndLossPanel, { containerRef, ...props })));
|
|
15601
15605
|
};
|
|
15602
15606
|
var ProfitAndLossPanel = ({
|
|
15603
15607
|
containerRef,
|
|
@@ -15605,10 +15609,10 @@ var ProfitAndLossPanel = ({
|
|
|
15605
15609
|
...props
|
|
15606
15610
|
}) => {
|
|
15607
15611
|
const { sidebarScope } = useContext39(ProfitAndLoss.Context);
|
|
15608
|
-
return /* @__PURE__ */
|
|
15612
|
+
return /* @__PURE__ */ React181.createElement(
|
|
15609
15613
|
Panel,
|
|
15610
15614
|
{
|
|
15611
|
-
sidebar: /* @__PURE__ */
|
|
15615
|
+
sidebar: /* @__PURE__ */ React181.createElement(
|
|
15612
15616
|
ProfitAndLossDetailedCharts,
|
|
15613
15617
|
{
|
|
15614
15618
|
stringOverrides: stringOverrides?.profitAndLossDetailedCharts
|
|
@@ -15617,8 +15621,8 @@ var ProfitAndLossPanel = ({
|
|
|
15617
15621
|
sidebarIsOpen: Boolean(sidebarScope),
|
|
15618
15622
|
parentRef: containerRef
|
|
15619
15623
|
},
|
|
15620
|
-
/* @__PURE__ */
|
|
15621
|
-
/* @__PURE__ */
|
|
15624
|
+
/* @__PURE__ */ React181.createElement(Header, { className: `Layer__${COMPONENT_NAME7}__header` }, /* @__PURE__ */ React181.createElement(Heading, { className: "Layer__profit-and-loss__title" }, stringOverrides?.header || "Profit & Loss")),
|
|
15625
|
+
/* @__PURE__ */ React181.createElement(Components, { stringOverrides, ...props })
|
|
15622
15626
|
);
|
|
15623
15627
|
};
|
|
15624
15628
|
var Components = ({
|
|
@@ -15630,7 +15634,7 @@ var Components = ({
|
|
|
15630
15634
|
ProfitAndLoss.Context
|
|
15631
15635
|
);
|
|
15632
15636
|
if (!isLoading && error) {
|
|
15633
|
-
return /* @__PURE__ */
|
|
15637
|
+
return /* @__PURE__ */ React181.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React181.createElement(
|
|
15634
15638
|
DataState,
|
|
15635
15639
|
{
|
|
15636
15640
|
status: "failed" /* failed */,
|
|
@@ -15641,13 +15645,13 @@ var Components = ({
|
|
|
15641
15645
|
}
|
|
15642
15646
|
));
|
|
15643
15647
|
}
|
|
15644
|
-
return /* @__PURE__ */
|
|
15648
|
+
return /* @__PURE__ */ React181.createElement(React181.Fragment, null, !hideChart && /* @__PURE__ */ React181.createElement("div", { className: `Layer__${COMPONENT_NAME7}__chart_with_summaries` }, /* @__PURE__ */ React181.createElement(
|
|
15645
15649
|
"div",
|
|
15646
15650
|
{
|
|
15647
15651
|
className: `Layer__${COMPONENT_NAME7}__chart_with_summaries__summary-col`
|
|
15648
15652
|
},
|
|
15649
|
-
/* @__PURE__ */
|
|
15650
|
-
/* @__PURE__ */
|
|
15653
|
+
/* @__PURE__ */ React181.createElement(ProfitAndLoss.DatePicker, null),
|
|
15654
|
+
/* @__PURE__ */ React181.createElement(
|
|
15651
15655
|
ProfitAndLoss.Summaries,
|
|
15652
15656
|
{
|
|
15653
15657
|
vertical: true,
|
|
@@ -15655,18 +15659,18 @@ var Components = ({
|
|
|
15655
15659
|
stringOverrides: stringOverrides?.profitAndLossSummaries
|
|
15656
15660
|
}
|
|
15657
15661
|
)
|
|
15658
|
-
), /* @__PURE__ */
|
|
15662
|
+
), /* @__PURE__ */ React181.createElement(
|
|
15659
15663
|
"div",
|
|
15660
15664
|
{
|
|
15661
15665
|
className: `Layer__${COMPONENT_NAME7}__chart_with_summaries__chart-col`
|
|
15662
15666
|
},
|
|
15663
|
-
/* @__PURE__ */
|
|
15664
|
-
)), !hideTable && /* @__PURE__ */
|
|
15667
|
+
/* @__PURE__ */ React181.createElement(ProfitAndLoss.Chart, null)
|
|
15668
|
+
)), !hideTable && /* @__PURE__ */ React181.createElement(
|
|
15665
15669
|
ProfitAndLoss.Table,
|
|
15666
15670
|
{
|
|
15667
15671
|
stringOverrides: stringOverrides?.profitAndLossTable
|
|
15668
15672
|
}
|
|
15669
|
-
))
|
|
15673
|
+
));
|
|
15670
15674
|
};
|
|
15671
15675
|
export {
|
|
15672
15676
|
AccountingOverview,
|