@layerfi/components 0.1.75 → 0.1.76
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/README.md +5 -17
- package/dist/esm/index.js +806 -684
- package/dist/esm/index.js.map +4 -4
- package/dist/index.d.ts +155 -57
- package/dist/index.js +938 -816
- package/dist/index.js.map +4 -4
- package/dist/styles/index.css +126 -175
- package/dist/styles/index.css.map +3 -3
- package/package.json +1 -1
- package/.idea/codeStyles/Project.xml +0 -61
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/layer-react.iml +0 -9
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
package/dist/esm/index.js
CHANGED
|
@@ -1161,7 +1161,6 @@ var useLinkedAccounts = () => {
|
|
|
1161
1161
|
} = useLayerContext();
|
|
1162
1162
|
const [linkToken, setLinkToken] = useState4(null);
|
|
1163
1163
|
const [loadingStatus, setLoadingStatus] = useState4("initial");
|
|
1164
|
-
const USE_PLAID_SANDBOX = usePlaidSandbox != null ? usePlaidSandbox : true;
|
|
1165
1164
|
const [linkMode, setLinkMode] = useState4("add");
|
|
1166
1165
|
const queryKey = businessId && (auth == null ? void 0 : auth.access_token) && `linked-accounts-${businessId}`;
|
|
1167
1166
|
const {
|
|
@@ -1230,7 +1229,7 @@ var useLinkedAccounts = () => {
|
|
|
1230
1229
|
}
|
|
1231
1230
|
}),
|
|
1232
1231
|
onExit: () => setLinkMode("add"),
|
|
1233
|
-
env:
|
|
1232
|
+
env: usePlaidSandbox ? "sandbox" : void 0
|
|
1234
1233
|
});
|
|
1235
1234
|
useEffect2(() => {
|
|
1236
1235
|
if (plaidLinkReady) {
|
|
@@ -1881,7 +1880,12 @@ var BusinessProvider = ({
|
|
|
1881
1880
|
};
|
|
1882
1881
|
errorHandler.setOnError(onError);
|
|
1883
1882
|
const colors = buildColorsPalette(theme);
|
|
1884
|
-
const {
|
|
1883
|
+
const {
|
|
1884
|
+
url,
|
|
1885
|
+
scope,
|
|
1886
|
+
apiUrl,
|
|
1887
|
+
usePlaidSandbox: defaultUsePlaidSandbox
|
|
1888
|
+
} = LayerEnvironment[environment];
|
|
1885
1889
|
const [state, dispatch] = useReducer(reducer, {
|
|
1886
1890
|
auth: {
|
|
1887
1891
|
access_token: "",
|
|
@@ -1895,7 +1899,7 @@ var BusinessProvider = ({
|
|
|
1895
1899
|
apiUrl,
|
|
1896
1900
|
theme,
|
|
1897
1901
|
colors,
|
|
1898
|
-
usePlaidSandbox,
|
|
1902
|
+
usePlaidSandbox: usePlaidSandbox != null ? usePlaidSandbox : defaultUsePlaidSandbox,
|
|
1899
1903
|
onboardingStep: void 0,
|
|
1900
1904
|
environment,
|
|
1901
1905
|
toasts: [],
|
|
@@ -2099,22 +2103,26 @@ var LayerEnvironment = {
|
|
|
2099
2103
|
production: {
|
|
2100
2104
|
url: "https://auth.layerfi.com/oauth2/token",
|
|
2101
2105
|
scope: "https://api.layerfi.com/production",
|
|
2102
|
-
apiUrl: "https://api.layerfi.com"
|
|
2106
|
+
apiUrl: "https://api.layerfi.com",
|
|
2107
|
+
usePlaidSandbox: false
|
|
2103
2108
|
},
|
|
2104
2109
|
sandbox: {
|
|
2105
2110
|
url: "https://auth.layerfi.com/oauth2/token",
|
|
2106
2111
|
scope: "https://sandbox.layerfi.com/sandbox",
|
|
2107
|
-
apiUrl: "https://sandbox.layerfi.com"
|
|
2112
|
+
apiUrl: "https://sandbox.layerfi.com",
|
|
2113
|
+
usePlaidSandbox: true
|
|
2108
2114
|
},
|
|
2109
2115
|
staging: {
|
|
2110
2116
|
url: "https://auth.layerfi.com/oauth2/token",
|
|
2111
2117
|
scope: "https://sandbox.layerfi.com/sandbox",
|
|
2112
|
-
apiUrl: "https://staging.layerfi.com"
|
|
2118
|
+
apiUrl: "https://staging.layerfi.com",
|
|
2119
|
+
usePlaidSandbox: true
|
|
2113
2120
|
},
|
|
2114
2121
|
internalStaging: {
|
|
2115
2122
|
url: "https://auth.layerfi.com/oauth2/token",
|
|
2116
2123
|
scope: "https://sandbox.layerfi.com/sandbox",
|
|
2117
|
-
apiUrl: "https://staging.layerfi.com"
|
|
2124
|
+
apiUrl: "https://staging.layerfi.com",
|
|
2125
|
+
usePlaidSandbox: true
|
|
2118
2126
|
}
|
|
2119
2127
|
};
|
|
2120
2128
|
var LayerProvider = (props) => {
|
|
@@ -10318,7 +10326,7 @@ var Quickbooks = () => {
|
|
|
10318
10326
|
};
|
|
10319
10327
|
|
|
10320
10328
|
// src/components/ProfitAndLoss/ProfitAndLoss.tsx
|
|
10321
|
-
import
|
|
10329
|
+
import React164, { createContext as createContext10 } from "react";
|
|
10322
10330
|
|
|
10323
10331
|
// src/contexts/ProfitAndLossComparisonContext/ProfitAndLossComparisonContext.tsx
|
|
10324
10332
|
import { createContext as createContext8 } from "react";
|
|
@@ -13025,14 +13033,103 @@ var ProfitAndLossReport = ({
|
|
|
13025
13033
|
};
|
|
13026
13034
|
|
|
13027
13035
|
// src/components/ProfitAndLossSummaries/ProfitAndLossSummaries.tsx
|
|
13028
|
-
import
|
|
13036
|
+
import React153, { useContext as useContext21, useMemo as useMemo15 } from "react";
|
|
13037
|
+
|
|
13038
|
+
// src/components/ProfitAndLossSummaries/internal/ProfitAndLossSummariesList.tsx
|
|
13039
|
+
import React149, { useMemo as useMemo12 } from "react";
|
|
13040
|
+
|
|
13041
|
+
// src/utils/styleUtils/toDataProperties.ts
|
|
13042
|
+
function toDataProperties(input) {
|
|
13043
|
+
const unsafeProperties = Object.fromEntries(
|
|
13044
|
+
Object.entries(input).map(([key, value]) => {
|
|
13045
|
+
if (typeof value !== "string" && typeof value !== "number" && value !== true) {
|
|
13046
|
+
return null;
|
|
13047
|
+
}
|
|
13048
|
+
return [`data-${key}`, value];
|
|
13049
|
+
}).filter((entry) => entry !== null)
|
|
13050
|
+
);
|
|
13051
|
+
return unsafeProperties;
|
|
13052
|
+
}
|
|
13029
13053
|
|
|
13030
|
-
// src/components/ProfitAndLossSummaries/
|
|
13031
|
-
|
|
13054
|
+
// src/components/ProfitAndLossSummaries/internal/ProfitAndLossSummariesList.tsx
|
|
13055
|
+
var LIST_ITEM_CLASS_NAME = "Layer__ProfitAndLossSummariesListItem";
|
|
13056
|
+
function ProfitAndLossSummariesListItem({
|
|
13057
|
+
children,
|
|
13058
|
+
isActive,
|
|
13059
|
+
onClick
|
|
13060
|
+
}) {
|
|
13061
|
+
const dataProperties = useMemo12(
|
|
13062
|
+
() => toDataProperties({ active: isActive, clickable: !!onClick }),
|
|
13063
|
+
[isActive]
|
|
13064
|
+
);
|
|
13065
|
+
return /* @__PURE__ */ React149.createElement("li", __spreadProps(__spreadValues({ className: LIST_ITEM_CLASS_NAME }, dataProperties), { onClick }), children);
|
|
13066
|
+
}
|
|
13067
|
+
var LIST_CLASS_NAME = "Layer__ProfitAndLossSummariesList";
|
|
13068
|
+
function ProfitAndLossSummariesList({
|
|
13069
|
+
children,
|
|
13070
|
+
itemCount
|
|
13071
|
+
}) {
|
|
13072
|
+
const dataProperties = useMemo12(
|
|
13073
|
+
() => toDataProperties({ ["column-count"]: itemCount }),
|
|
13074
|
+
[itemCount]
|
|
13075
|
+
);
|
|
13076
|
+
return /* @__PURE__ */ React149.createElement("ul", __spreadValues({ className: LIST_CLASS_NAME }, dataProperties), children);
|
|
13077
|
+
}
|
|
13078
|
+
|
|
13079
|
+
// src/components/ProfitAndLossSummaries/internal/ProfitAndLossSummariesMiniChart.tsx
|
|
13080
|
+
import React150 from "react";
|
|
13032
13081
|
import { PieChart as PieChart2, Pie as Pie2, Cell as Cell3 } from "recharts";
|
|
13033
|
-
var
|
|
13082
|
+
var CHART_PLACEHOLDER = [
|
|
13083
|
+
{
|
|
13084
|
+
name: "placeholder",
|
|
13085
|
+
display_name: "placeholder",
|
|
13086
|
+
value: 1,
|
|
13087
|
+
type: "placeholder",
|
|
13088
|
+
share: 1
|
|
13089
|
+
}
|
|
13090
|
+
];
|
|
13091
|
+
function toMiniChartData({
|
|
13092
|
+
scope,
|
|
13093
|
+
data
|
|
13094
|
+
}) {
|
|
13095
|
+
if (!data) {
|
|
13096
|
+
return CHART_PLACEHOLDER;
|
|
13097
|
+
}
|
|
13098
|
+
let items = [];
|
|
13099
|
+
switch (scope) {
|
|
13100
|
+
case "revenue":
|
|
13101
|
+
items = collectRevenueItems(data);
|
|
13102
|
+
break;
|
|
13103
|
+
default:
|
|
13104
|
+
items = collectExpensesItems(data);
|
|
13105
|
+
}
|
|
13106
|
+
if (!items || items.length === 0 || !items.find((x) => Math.abs(x.value) !== 0)) {
|
|
13107
|
+
return CHART_PLACEHOLDER;
|
|
13108
|
+
}
|
|
13109
|
+
return items.slice();
|
|
13110
|
+
}
|
|
13111
|
+
function ProfitAndLossSummariesMiniChart({
|
|
13112
|
+
data,
|
|
13113
|
+
chartColorsList,
|
|
13114
|
+
variants
|
|
13115
|
+
}) {
|
|
13034
13116
|
const typeColorMapping = mapTypesToColors(data, chartColorsList);
|
|
13035
|
-
|
|
13117
|
+
let chartDimension = 52;
|
|
13118
|
+
let innerRadius = 10;
|
|
13119
|
+
let outerRadius = 16;
|
|
13120
|
+
switch (variants == null ? void 0 : variants.size) {
|
|
13121
|
+
case "sm":
|
|
13122
|
+
chartDimension = 52;
|
|
13123
|
+
innerRadius = 10;
|
|
13124
|
+
outerRadius = 16;
|
|
13125
|
+
break;
|
|
13126
|
+
case "lg":
|
|
13127
|
+
chartDimension = 64;
|
|
13128
|
+
innerRadius = 12;
|
|
13129
|
+
outerRadius = 20;
|
|
13130
|
+
break;
|
|
13131
|
+
}
|
|
13132
|
+
return /* @__PURE__ */ React150.createElement(PieChart2, { width: chartDimension, height: chartDimension }, /* @__PURE__ */ React150.createElement(
|
|
13036
13133
|
Pie2,
|
|
13037
13134
|
{
|
|
13038
13135
|
data,
|
|
@@ -13040,18 +13137,18 @@ var MiniChart = ({ data, chartColorsList }) => {
|
|
|
13040
13137
|
nameKey: "name",
|
|
13041
13138
|
cx: "50%",
|
|
13042
13139
|
cy: "50%",
|
|
13043
|
-
innerRadius
|
|
13044
|
-
outerRadius
|
|
13140
|
+
innerRadius,
|
|
13141
|
+
outerRadius,
|
|
13045
13142
|
paddingAngle: 0.4,
|
|
13046
13143
|
fill: "#8884d8",
|
|
13047
|
-
width:
|
|
13048
|
-
height:
|
|
13144
|
+
width: 36,
|
|
13145
|
+
height: 36,
|
|
13049
13146
|
animationDuration: 250,
|
|
13050
13147
|
animationEasing: "ease-in-out"
|
|
13051
13148
|
},
|
|
13052
13149
|
data.map((entry, index) => {
|
|
13053
13150
|
const colorConfig = typeColorMapping[index];
|
|
13054
|
-
return /* @__PURE__ */
|
|
13151
|
+
return /* @__PURE__ */ React150.createElement(
|
|
13055
13152
|
Cell3,
|
|
13056
13153
|
{
|
|
13057
13154
|
key: `cell-${index}`,
|
|
@@ -13062,44 +13159,61 @@ var MiniChart = ({ data, chartColorsList }) => {
|
|
|
13062
13159
|
);
|
|
13063
13160
|
})
|
|
13064
13161
|
));
|
|
13065
|
-
}
|
|
13162
|
+
}
|
|
13163
|
+
|
|
13164
|
+
// src/components/ProfitAndLossSummaries/internal/ProfitAndLossSummariesSummary.tsx
|
|
13165
|
+
import React152, { useMemo as useMemo14 } from "react";
|
|
13166
|
+
|
|
13167
|
+
// src/components/ProfitAndLossSummaries/internal/ProfitAndLossSummariesHeading.tsx
|
|
13168
|
+
import { useMemo as useMemo13 } from "react";
|
|
13169
|
+
import React151 from "react";
|
|
13170
|
+
var HEADING_CLASS_NAME = "Layer__ProfitAndLossSummariesSummaryHeading";
|
|
13171
|
+
function ProfitAndLossSummariesHeading({
|
|
13172
|
+
variants,
|
|
13173
|
+
children
|
|
13174
|
+
}) {
|
|
13175
|
+
const { size = "sm" } = variants != null ? variants : {};
|
|
13176
|
+
const labelDataProperties = useMemo13(() => toDataProperties({ size }), [size]);
|
|
13177
|
+
return /* @__PURE__ */ React151.createElement("h3", __spreadValues({ className: HEADING_CLASS_NAME }, labelDataProperties), children);
|
|
13178
|
+
}
|
|
13179
|
+
|
|
13180
|
+
// src/components/ProfitAndLossSummaries/internal/ProfitAndLossSummariesSummary.tsx
|
|
13181
|
+
var CLASS_NAME = "Layer__ProfitAndLossSummariesSummary";
|
|
13182
|
+
var CHART_AREA_CLASS_NAME = "Layer__ProfitAndLossSummariesSummaryChartArea";
|
|
13183
|
+
var AMOUNT_CLASS_NAME = "Layer__ProfitAndLossSummariesSummaryAmount";
|
|
13184
|
+
function ProfitAndLossSummariesSummary({
|
|
13185
|
+
label,
|
|
13186
|
+
amount,
|
|
13187
|
+
isLoading,
|
|
13188
|
+
slots,
|
|
13189
|
+
variants
|
|
13190
|
+
}) {
|
|
13191
|
+
const { Chart } = slots != null ? slots : {};
|
|
13192
|
+
const { size = "sm" } = variants != null ? variants : {};
|
|
13193
|
+
const dataProperties = useMemo14(() => toDataProperties({ size }), [size]);
|
|
13194
|
+
const amountDataProperties = useMemo14(
|
|
13195
|
+
() => toDataProperties({
|
|
13196
|
+
positive: amount >= 0,
|
|
13197
|
+
negative: amount < 0,
|
|
13198
|
+
size
|
|
13199
|
+
}),
|
|
13200
|
+
[amount, size]
|
|
13201
|
+
);
|
|
13202
|
+
return /* @__PURE__ */ React152.createElement("div", __spreadValues({ className: CLASS_NAME }, dataProperties), Chart && /* @__PURE__ */ React152.createElement("div", { className: CHART_AREA_CLASS_NAME }, Chart), /* @__PURE__ */ React152.createElement(ProfitAndLossSummariesHeading, { variants }, label), isLoading ? /* @__PURE__ */ React152.createElement(SkeletonLoader, null) : /* @__PURE__ */ React152.createElement("span", __spreadValues({ className: AMOUNT_CLASS_NAME }, amountDataProperties), centsToDollars(Math.abs(amount))));
|
|
13203
|
+
}
|
|
13066
13204
|
|
|
13067
13205
|
// src/components/ProfitAndLossSummaries/ProfitAndLossSummaries.tsx
|
|
13068
|
-
|
|
13069
|
-
var
|
|
13070
|
-
|
|
13071
|
-
name: "placeholder",
|
|
13072
|
-
display_name: "placeholder",
|
|
13073
|
-
value: 1,
|
|
13074
|
-
type: "placeholder",
|
|
13075
|
-
share: 1
|
|
13076
|
-
}
|
|
13077
|
-
];
|
|
13078
|
-
var buildMiniChartData = (scope, data) => {
|
|
13079
|
-
if (!data) {
|
|
13080
|
-
return CHART_PLACEHOLDER;
|
|
13081
|
-
}
|
|
13082
|
-
let items = [];
|
|
13083
|
-
switch (scope) {
|
|
13084
|
-
case "revenue":
|
|
13085
|
-
items = collectRevenueItems(data);
|
|
13086
|
-
break;
|
|
13087
|
-
default:
|
|
13088
|
-
items = collectExpensesItems(data);
|
|
13089
|
-
}
|
|
13090
|
-
if (!items || items.length === 0 || !items.find((x) => Math.abs(x.value) !== 0)) {
|
|
13091
|
-
return CHART_PLACEHOLDER;
|
|
13092
|
-
}
|
|
13093
|
-
return items.slice();
|
|
13094
|
-
};
|
|
13095
|
-
var ProfitAndLossSummaries = ({
|
|
13096
|
-
vertical,
|
|
13206
|
+
var SECTION_CLASS_NAME = "Layer__ProfitAndLossSummaries";
|
|
13207
|
+
var SECTION_CLASS_NAMES = `${SECTION_CLASS_NAME} Layer__component`;
|
|
13208
|
+
function Internal_ProfitAndLossSummaries({
|
|
13097
13209
|
actionable = false,
|
|
13098
13210
|
revenueLabel,
|
|
13099
13211
|
stringOverrides,
|
|
13100
|
-
chartColorsList
|
|
13101
|
-
|
|
13102
|
-
|
|
13212
|
+
chartColorsList,
|
|
13213
|
+
slots,
|
|
13214
|
+
variants
|
|
13215
|
+
}) {
|
|
13216
|
+
var _a, _b;
|
|
13103
13217
|
const {
|
|
13104
13218
|
data: storedData,
|
|
13105
13219
|
isLoading,
|
|
@@ -13107,91 +13221,83 @@ var ProfitAndLossSummaries = ({
|
|
|
13107
13221
|
sidebarScope
|
|
13108
13222
|
} = useContext21(ProfitAndLoss.Context);
|
|
13109
13223
|
const dataItem = Array.isArray(storedData) ? storedData[storedData.length - 1] : storedData;
|
|
13110
|
-
const expensesChartData =
|
|
13111
|
-
|
|
13112
|
-
|
|
13113
|
-
|
|
13114
|
-
|
|
13115
|
-
|
|
13224
|
+
const { revenueChartData, expensesChartData } = useMemo15(
|
|
13225
|
+
() => ({
|
|
13226
|
+
revenueChartData: toMiniChartData({ scope: "revenue", data: dataItem }),
|
|
13227
|
+
expensesChartData: toMiniChartData({ scope: "expenses", data: dataItem })
|
|
13228
|
+
}),
|
|
13229
|
+
[dataItem]
|
|
13230
|
+
);
|
|
13116
13231
|
const data = dataItem ? dataItem : { income: { value: NaN }, net_profit: NaN };
|
|
13117
|
-
const
|
|
13118
|
-
const
|
|
13119
|
-
|
|
13120
|
-
|
|
13121
|
-
"div",
|
|
13232
|
+
const { unstable_AdditionalListItems = [] } = slots != null ? slots : {};
|
|
13233
|
+
const listItemCount = unstable_AdditionalListItems.length + 3;
|
|
13234
|
+
return /* @__PURE__ */ React153.createElement("section", { className: SECTION_CLASS_NAMES }, /* @__PURE__ */ React153.createElement(ProfitAndLossSummariesList, { itemCount: listItemCount }, /* @__PURE__ */ React153.createElement(
|
|
13235
|
+
ProfitAndLossSummariesListItem,
|
|
13122
13236
|
{
|
|
13123
|
-
|
|
13237
|
+
isActive: sidebarScope === "revenue",
|
|
13238
|
+
onClick: actionable ? () => setSidebarScope("revenue") : void 0
|
|
13124
13239
|
},
|
|
13125
|
-
/* @__PURE__ */
|
|
13126
|
-
|
|
13240
|
+
/* @__PURE__ */ React153.createElement(
|
|
13241
|
+
ProfitAndLossSummariesSummary,
|
|
13127
13242
|
{
|
|
13128
|
-
|
|
13129
|
-
|
|
13130
|
-
|
|
13131
|
-
|
|
13132
|
-
|
|
13133
|
-
|
|
13134
|
-
|
|
13135
|
-
|
|
13136
|
-
|
|
13137
|
-
|
|
13138
|
-
|
|
13139
|
-
|
|
13140
|
-
"span",
|
|
13141
|
-
{
|
|
13142
|
-
className: `Layer__profit-and-loss-summaries__amount ${incomeDirectionClass}`
|
|
13143
|
-
},
|
|
13144
|
-
centsToDollars(Math.abs((_e = (_d = data == null ? void 0 : data.income) == null ? void 0 : _d.value) != null ? _e : NaN))
|
|
13145
|
-
))
|
|
13146
|
-
),
|
|
13147
|
-
/* @__PURE__ */ React150.createElement(
|
|
13148
|
-
"div",
|
|
13149
|
-
{
|
|
13150
|
-
className: classNames57(
|
|
13151
|
-
"Layer__profit-and-loss-summaries__summary",
|
|
13152
|
-
actionable && "Layer__actionable",
|
|
13153
|
-
"Layer__profit-and-loss-summaries__summary--expenses",
|
|
13154
|
-
sidebarScope === "expenses" ? "active" : ""
|
|
13155
|
-
),
|
|
13156
|
-
onClick: () => {
|
|
13157
|
-
actionable && setSidebarScope("expenses");
|
|
13158
|
-
}
|
|
13159
|
-
},
|
|
13160
|
-
/* @__PURE__ */ React150.createElement(MiniChart, { data: expensesChartData, chartColorsList }),
|
|
13161
|
-
/* @__PURE__ */ React150.createElement("div", { className: "Layer__profit-and-loss-summaries__text" }, /* @__PURE__ */ React150.createElement("span", { className: "Layer__profit-and-loss-summaries__title" }, (stringOverrides == null ? void 0 : stringOverrides.expensesLabel) || "Expenses"), isLoading || storedData === void 0 ? /* @__PURE__ */ React150.createElement("div", { className: "Layer__profit-and-loss-summaries__loader" }, /* @__PURE__ */ React150.createElement(SkeletonLoader, { className: "Layer__profit-and-loss-summaries__loader" })) : /* @__PURE__ */ React150.createElement(
|
|
13162
|
-
"span",
|
|
13163
|
-
{
|
|
13164
|
-
className: `Layer__profit-and-loss-summaries__amount ${expensesDirectionClass}`
|
|
13243
|
+
label: (stringOverrides == null ? void 0 : stringOverrides.revenueLabel) || revenueLabel || "Revenue",
|
|
13244
|
+
amount: data.income.value,
|
|
13245
|
+
isLoading,
|
|
13246
|
+
slots: {
|
|
13247
|
+
Chart: /* @__PURE__ */ React153.createElement(
|
|
13248
|
+
ProfitAndLossSummariesMiniChart,
|
|
13249
|
+
{
|
|
13250
|
+
data: revenueChartData,
|
|
13251
|
+
chartColorsList,
|
|
13252
|
+
variants
|
|
13253
|
+
}
|
|
13254
|
+
)
|
|
13165
13255
|
},
|
|
13166
|
-
|
|
13167
|
-
|
|
13168
|
-
|
|
13169
|
-
|
|
13170
|
-
|
|
13171
|
-
|
|
13172
|
-
"
|
|
13256
|
+
variants
|
|
13257
|
+
}
|
|
13258
|
+
)
|
|
13259
|
+
), /* @__PURE__ */ React153.createElement(
|
|
13260
|
+
ProfitAndLossSummariesListItem,
|
|
13261
|
+
{
|
|
13262
|
+
isActive: sidebarScope === "expenses",
|
|
13263
|
+
onClick: actionable ? () => setSidebarScope("expenses") : void 0
|
|
13264
|
+
},
|
|
13265
|
+
/* @__PURE__ */ React153.createElement(
|
|
13266
|
+
ProfitAndLossSummariesSummary,
|
|
13173
13267
|
{
|
|
13174
|
-
|
|
13175
|
-
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
|
|
13179
|
-
|
|
13180
|
-
|
|
13181
|
-
|
|
13182
|
-
|
|
13268
|
+
label: (stringOverrides == null ? void 0 : stringOverrides.revenueLabel) || revenueLabel || "Expenses",
|
|
13269
|
+
amount: ((_b = (_a = data == null ? void 0 : data.income) == null ? void 0 : _a.value) != null ? _b : NaN) - data.net_profit,
|
|
13270
|
+
isLoading,
|
|
13271
|
+
slots: {
|
|
13272
|
+
Chart: /* @__PURE__ */ React153.createElement(
|
|
13273
|
+
ProfitAndLossSummariesMiniChart,
|
|
13274
|
+
{
|
|
13275
|
+
data: expensesChartData,
|
|
13276
|
+
chartColorsList,
|
|
13277
|
+
variants
|
|
13278
|
+
}
|
|
13279
|
+
)
|
|
13183
13280
|
},
|
|
13184
|
-
|
|
13185
|
-
|
|
13281
|
+
variants
|
|
13282
|
+
}
|
|
13186
13283
|
)
|
|
13187
|
-
)
|
|
13188
|
-
|
|
13284
|
+
), /* @__PURE__ */ React153.createElement(ProfitAndLossSummariesListItem, null, /* @__PURE__ */ React153.createElement(
|
|
13285
|
+
ProfitAndLossSummariesSummary,
|
|
13286
|
+
{
|
|
13287
|
+
label: (stringOverrides == null ? void 0 : stringOverrides.netProfitLabel) || "Net Profit",
|
|
13288
|
+
amount: data.net_profit,
|
|
13289
|
+
variants,
|
|
13290
|
+
isLoading
|
|
13291
|
+
}
|
|
13292
|
+
)), unstable_AdditionalListItems.map((item, index) => /* @__PURE__ */ React153.createElement(ProfitAndLossSummariesListItem, { key: index }, item))));
|
|
13293
|
+
}
|
|
13294
|
+
var ProfitAndLossSummaries = (props) => Internal_ProfitAndLossSummaries(props);
|
|
13189
13295
|
|
|
13190
13296
|
// src/components/ProfitAndLossTable/ProfitAndLossTableWithProvider.tsx
|
|
13191
|
-
import
|
|
13297
|
+
import React163, { useContext as useContext25 } from "react";
|
|
13192
13298
|
|
|
13193
13299
|
// src/contexts/TableContext/TableContext.tsx
|
|
13194
|
-
import
|
|
13300
|
+
import React154, { createContext as createContext9, useState as useState40 } from "react";
|
|
13195
13301
|
var defaultValue = {
|
|
13196
13302
|
expandedRows: [],
|
|
13197
13303
|
setExpandedRows: () => {
|
|
@@ -13227,11 +13333,11 @@ var TableProvider = ({ children }) => {
|
|
|
13227
13333
|
expandedAllRows,
|
|
13228
13334
|
setExpandedAllRows
|
|
13229
13335
|
};
|
|
13230
|
-
return /* @__PURE__ */
|
|
13336
|
+
return /* @__PURE__ */ React154.createElement(TableContext.Provider, { value: contextValue }, children);
|
|
13231
13337
|
};
|
|
13232
13338
|
|
|
13233
13339
|
// src/components/ProfitAndLossTable/ProfitAndLossCompareTable.tsx
|
|
13234
|
-
import
|
|
13340
|
+
import React160, { useContext as useContext23, useEffect as useEffect32 } from "react";
|
|
13235
13341
|
|
|
13236
13342
|
// src/hooks/useTableExpandRow/useTableExpandRow.tsx
|
|
13237
13343
|
import { useContext as useContext22 } from "react";
|
|
@@ -13333,14 +13439,14 @@ var mergeComparisonLineItemsAtDepth = (lineItems) => {
|
|
|
13333
13439
|
};
|
|
13334
13440
|
|
|
13335
13441
|
// src/components/TableBody/TableBody.tsx
|
|
13336
|
-
import
|
|
13442
|
+
import React155 from "react";
|
|
13337
13443
|
var TableBody = ({ children }) => {
|
|
13338
|
-
return /* @__PURE__ */
|
|
13444
|
+
return /* @__PURE__ */ React155.createElement("tbody", { className: "Layer__table-body" }, children);
|
|
13339
13445
|
};
|
|
13340
13446
|
|
|
13341
13447
|
// src/components/TableCell/TableCell.tsx
|
|
13342
|
-
import
|
|
13343
|
-
import
|
|
13448
|
+
import React156 from "react";
|
|
13449
|
+
import classNames57 from "classnames";
|
|
13344
13450
|
var TableCell = ({
|
|
13345
13451
|
children,
|
|
13346
13452
|
className,
|
|
@@ -13358,7 +13464,7 @@ var TableCell = ({
|
|
|
13358
13464
|
const amount = typeof children === "number" ? children : 0;
|
|
13359
13465
|
const isPositive = amount >= 0;
|
|
13360
13466
|
const amountString = centsToDollars(Math.abs(amount));
|
|
13361
|
-
const cellClassNames =
|
|
13467
|
+
const cellClassNames = classNames57(
|
|
13362
13468
|
"Layer__table-cell",
|
|
13363
13469
|
(primary || isHeaderCell) && "Layer__table-cell--primary",
|
|
13364
13470
|
isCurrency && "Layer__table-cell-amount",
|
|
@@ -13368,9 +13474,9 @@ var TableCell = ({
|
|
|
13368
13474
|
className
|
|
13369
13475
|
);
|
|
13370
13476
|
if (isHeaderCell) {
|
|
13371
|
-
return /* @__PURE__ */
|
|
13477
|
+
return /* @__PURE__ */ React156.createElement("th", { className: cellClassNames, colSpan, style }, /* @__PURE__ */ React156.createElement("span", { className: "Layer__table-cell-content" }, children));
|
|
13372
13478
|
}
|
|
13373
|
-
return /* @__PURE__ */
|
|
13479
|
+
return /* @__PURE__ */ React156.createElement(
|
|
13374
13480
|
"td",
|
|
13375
13481
|
{
|
|
13376
13482
|
className: cellClassNames,
|
|
@@ -13378,7 +13484,7 @@ var TableCell = ({
|
|
|
13378
13484
|
colSpan,
|
|
13379
13485
|
onClick: (e) => onClick && onClick(e)
|
|
13380
13486
|
},
|
|
13381
|
-
/* @__PURE__ */
|
|
13487
|
+
/* @__PURE__ */ React156.createElement("span", { className: "Layer__table-cell-content" }, withExpandIcon && /* @__PURE__ */ React156.createElement(
|
|
13382
13488
|
ChevronDownFill_default,
|
|
13383
13489
|
{
|
|
13384
13490
|
className: "Layer__table-row--expand-icon",
|
|
@@ -13389,14 +13495,14 @@ var TableCell = ({
|
|
|
13389
13495
|
};
|
|
13390
13496
|
|
|
13391
13497
|
// src/components/TableHead/TableHead.tsx
|
|
13392
|
-
import
|
|
13498
|
+
import React157 from "react";
|
|
13393
13499
|
var TableHead = ({ children }) => {
|
|
13394
|
-
return /* @__PURE__ */
|
|
13500
|
+
return /* @__PURE__ */ React157.createElement("thead", { className: "Layer__table-header" }, children);
|
|
13395
13501
|
};
|
|
13396
13502
|
|
|
13397
13503
|
// src/components/TableRow/TableRow.tsx
|
|
13398
|
-
import
|
|
13399
|
-
import
|
|
13504
|
+
import React158 from "react";
|
|
13505
|
+
import classNames58 from "classnames";
|
|
13400
13506
|
var TableRow = ({
|
|
13401
13507
|
rowKey,
|
|
13402
13508
|
children,
|
|
@@ -13420,14 +13526,14 @@ var TableRow = ({
|
|
|
13420
13526
|
handleExpand && handleExpand();
|
|
13421
13527
|
}
|
|
13422
13528
|
};
|
|
13423
|
-
const rowClassNames =
|
|
13529
|
+
const rowClassNames = classNames58([
|
|
13424
13530
|
"Layer__table-row",
|
|
13425
13531
|
!isHeadRow && `Layer__table-row--depth-${depth}`,
|
|
13426
13532
|
!isHeadRow && `Layer__table-row--variant-${variant}`,
|
|
13427
13533
|
selected && "Layer__table-row--selected",
|
|
13428
13534
|
!isHeadRow && expandable && (isExpanded ? "Layer__table-row--expanded" : "Layer__table-row--collapsed")
|
|
13429
13535
|
]);
|
|
13430
|
-
return /* @__PURE__ */
|
|
13536
|
+
return /* @__PURE__ */ React158.createElement(React158.Fragment, null, withDivider && withDividerPosition === "top" && /* @__PURE__ */ React158.createElement("tr", { className: "Layer__table-empty-row" }, /* @__PURE__ */ React158.createElement("td", { colSpan: Array.isArray(children) ? children.length : 1 })), /* @__PURE__ */ React158.createElement(
|
|
13431
13537
|
"tr",
|
|
13432
13538
|
{
|
|
13433
13539
|
"data-key": rowKey,
|
|
@@ -13435,12 +13541,12 @@ var TableRow = ({
|
|
|
13435
13541
|
onClick: (e) => toggleExpanded(e)
|
|
13436
13542
|
},
|
|
13437
13543
|
children
|
|
13438
|
-
), withDivider && withDividerPosition === "bottom" && /* @__PURE__ */
|
|
13544
|
+
), withDivider && withDividerPosition === "bottom" && /* @__PURE__ */ React158.createElement("tr", { className: "Layer__table-empty-row" }, /* @__PURE__ */ React158.createElement("td", { colSpan: Array.isArray(children) ? children.length : 1 })));
|
|
13439
13545
|
};
|
|
13440
13546
|
|
|
13441
13547
|
// src/components/Table/Table.tsx
|
|
13442
|
-
import
|
|
13443
|
-
import
|
|
13548
|
+
import React159, { useEffect as useEffect31, useRef as useRef19 } from "react";
|
|
13549
|
+
import classNames59 from "classnames";
|
|
13444
13550
|
var Table = ({
|
|
13445
13551
|
componentName,
|
|
13446
13552
|
children,
|
|
@@ -13480,20 +13586,20 @@ var Table = ({
|
|
|
13480
13586
|
prevChildrenRef.current = newChildrenKeys;
|
|
13481
13587
|
}
|
|
13482
13588
|
}, [children]);
|
|
13483
|
-
const tableWrapperClassNames =
|
|
13589
|
+
const tableWrapperClassNames = classNames59(
|
|
13484
13590
|
"Layer__table-wrapper",
|
|
13485
13591
|
bottomSpacing && "Layer__table-wrapper--bottom-spacing"
|
|
13486
13592
|
);
|
|
13487
|
-
const tableClassNames =
|
|
13593
|
+
const tableClassNames = classNames59(
|
|
13488
13594
|
"Layer__table",
|
|
13489
13595
|
componentName && `Layer__${componentName}__table`,
|
|
13490
13596
|
borderCollapse && `Layer__table__${borderCollapse}-rows`
|
|
13491
13597
|
);
|
|
13492
|
-
return /* @__PURE__ */
|
|
13598
|
+
return /* @__PURE__ */ React159.createElement("div", { className: tableWrapperClassNames }, /* @__PURE__ */ React159.createElement("table", { className: tableClassNames, ref: tableRef }, children));
|
|
13493
13599
|
};
|
|
13494
13600
|
|
|
13495
13601
|
// src/components/ProfitAndLossTable/ProfitAndLossCompareTable.tsx
|
|
13496
|
-
import
|
|
13602
|
+
import classNames60 from "classnames";
|
|
13497
13603
|
var ProfitAndLossCompareTable = ({
|
|
13498
13604
|
stringOverrides
|
|
13499
13605
|
}) => {
|
|
@@ -13521,12 +13627,12 @@ var ProfitAndLossCompareTable = ({
|
|
|
13521
13627
|
}
|
|
13522
13628
|
}, [dateRange, comparisonData]);
|
|
13523
13629
|
if (isLoading || comparisonData === void 0) {
|
|
13524
|
-
return /* @__PURE__ */
|
|
13630
|
+
return /* @__PURE__ */ React160.createElement(
|
|
13525
13631
|
"div",
|
|
13526
13632
|
{
|
|
13527
|
-
className:
|
|
13633
|
+
className: classNames60("Layer__profit-and-loss-table__loader-container")
|
|
13528
13634
|
},
|
|
13529
|
-
/* @__PURE__ */
|
|
13635
|
+
/* @__PURE__ */ React160.createElement(Loader2, null)
|
|
13530
13636
|
);
|
|
13531
13637
|
}
|
|
13532
13638
|
const renderRow = (rowKey, depth, rowDisplayName, lineItem, data) => {
|
|
@@ -13538,7 +13644,7 @@ var ProfitAndLossCompareTable = ({
|
|
|
13538
13644
|
}
|
|
13539
13645
|
});
|
|
13540
13646
|
if (rowData.length === 0) {
|
|
13541
|
-
return /* @__PURE__ */
|
|
13647
|
+
return /* @__PURE__ */ React160.createElement(React160.Fragment, null);
|
|
13542
13648
|
}
|
|
13543
13649
|
const mergedLineItems = mergeComparisonLineItemsAtDepth(
|
|
13544
13650
|
rowData
|
|
@@ -13547,7 +13653,7 @@ var ProfitAndLossCompareTable = ({
|
|
|
13547
13653
|
}
|
|
13548
13654
|
const expandable = (lineItem == null ? void 0 : lineItem.line_items) && lineItem.line_items.length > 0 ? true : false;
|
|
13549
13655
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
13550
|
-
return /* @__PURE__ */
|
|
13656
|
+
return /* @__PURE__ */ React160.createElement(React160.Fragment, { key: rowKey }, /* @__PURE__ */ React160.createElement(
|
|
13551
13657
|
TableRow,
|
|
13552
13658
|
{
|
|
13553
13659
|
rowKey,
|
|
@@ -13557,8 +13663,8 @@ var ProfitAndLossCompareTable = ({
|
|
|
13557
13663
|
variant: expandable ? "expandable" : "default",
|
|
13558
13664
|
handleExpand: () => setIsOpen(rowKey)
|
|
13559
13665
|
},
|
|
13560
|
-
/* @__PURE__ */
|
|
13561
|
-
rowData.map((cell, i) => /* @__PURE__ */
|
|
13666
|
+
/* @__PURE__ */ React160.createElement(TableCell, { primary: true, withExpandIcon: expandable }, lineItem ? lineItem.display_name : rowDisplayName),
|
|
13667
|
+
rowData.map((cell, i) => /* @__PURE__ */ React160.createElement(TableCell, { key: "compare-value" + i, isCurrency: true }, getComparisonValue(
|
|
13562
13668
|
lineItem ? lineItem.display_name : rowDisplayName,
|
|
13563
13669
|
depth,
|
|
13564
13670
|
cell
|
|
@@ -13573,13 +13679,13 @@ var ProfitAndLossCompareTable = ({
|
|
|
13573
13679
|
)
|
|
13574
13680
|
) : null);
|
|
13575
13681
|
};
|
|
13576
|
-
return /* @__PURE__ */
|
|
13682
|
+
return /* @__PURE__ */ React160.createElement(Table, { borderCollapse: "collapse", bottomSpacing: false }, /* @__PURE__ */ React160.createElement(TableHead, null, compareOptions && compareOptions.length > 1 && /* @__PURE__ */ React160.createElement(TableRow, { rowKey: "" }, /* @__PURE__ */ React160.createElement(TableCell, { isHeaderCell: true }), compareOptions.map((option, i) => /* @__PURE__ */ React160.createElement(React160.Fragment, { key: option + "-" + i }, /* @__PURE__ */ React160.createElement(TableCell, { key: option + "-" + i, primary: true, isHeaderCell: true }, option.displayName), compareMonths && Array.from({ length: compareMonths - 1 }, (_, index) => /* @__PURE__ */ React160.createElement(TableCell, { key: option + "-" + index, isHeaderCell: true })))))), /* @__PURE__ */ React160.createElement(TableBody, null, compareMonths && /* @__PURE__ */ React160.createElement(TableRow, { rowKey: "" }, /* @__PURE__ */ React160.createElement(TableCell, { isHeaderCell: true }), compareOptions && compareOptions.length > 0 ? compareOptions.map((option, i) => /* @__PURE__ */ React160.createElement(React160.Fragment, { key: option + "-" + i }, generatComparisonMonths(
|
|
13577
13683
|
dateRange.startDate,
|
|
13578
13684
|
compareMonths
|
|
13579
|
-
).map((month, index) => /* @__PURE__ */
|
|
13685
|
+
).map((month, index) => /* @__PURE__ */ React160.createElement(TableCell, { key: option + "-" + index, isHeaderCell: true }, month)))) : /* @__PURE__ */ React160.createElement(React160.Fragment, { key: "total-1" }, generatComparisonMonths(
|
|
13580
13686
|
dateRange.startDate,
|
|
13581
13687
|
compareMonths
|
|
13582
|
-
).map((month, index) => /* @__PURE__ */
|
|
13688
|
+
).map((month, index) => /* @__PURE__ */ React160.createElement(TableCell, { key: "total-" + index + "-cell", isHeaderCell: true }, month)))), renderRow("income", 0, "Income"), renderRow("cost_of_goods_sold", 0, "Cost of Goods Sold"), renderRow(
|
|
13583
13689
|
"gross_profit",
|
|
13584
13690
|
0,
|
|
13585
13691
|
(stringOverrides == null ? void 0 : stringOverrides.grossProfitLabel) || "Gross Profit"
|
|
@@ -13595,13 +13701,13 @@ var ProfitAndLossCompareTable = ({
|
|
|
13595
13701
|
};
|
|
13596
13702
|
|
|
13597
13703
|
// src/components/ProfitAndLossTable/ProfitAndLossTableComponent.tsx
|
|
13598
|
-
import
|
|
13704
|
+
import React162, { useContext as useContext24, useEffect as useEffect33 } from "react";
|
|
13599
13705
|
|
|
13600
13706
|
// src/icons/PieChart.tsx
|
|
13601
|
-
import * as
|
|
13707
|
+
import * as React161 from "react";
|
|
13602
13708
|
var PieChart3 = (_a) => {
|
|
13603
13709
|
var _b = _a, { size = 12 } = _b, props = __objRest(_b, ["size"]);
|
|
13604
|
-
return /* @__PURE__ */
|
|
13710
|
+
return /* @__PURE__ */ React161.createElement(
|
|
13605
13711
|
"svg",
|
|
13606
13712
|
__spreadProps(__spreadValues({
|
|
13607
13713
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -13611,7 +13717,7 @@ var PieChart3 = (_a) => {
|
|
|
13611
13717
|
width: size,
|
|
13612
13718
|
height: size
|
|
13613
13719
|
}),
|
|
13614
|
-
/* @__PURE__ */
|
|
13720
|
+
/* @__PURE__ */ React161.createElement("g", null, /* @__PURE__ */ React161.createElement(
|
|
13615
13721
|
"path",
|
|
13616
13722
|
{
|
|
13617
13723
|
d: "M10.2213 7.78271C9.92969 8.47226 9.47363 9.07989 8.89297 9.55247C8.3123 10.0251 7.62471 10.3482 6.89031 10.4936C6.1559 10.6391 5.39705 10.6024 4.68009 10.3869C3.96313 10.1713 3.30989 9.78337 2.77749 9.25701C2.24509 8.73065 1.84973 8.08189 1.62598 7.36744C1.40223 6.65298 1.3569 5.8946 1.49396 5.15858C1.63102 4.42257 1.94629 3.73133 2.41221 3.14531C2.87813 2.55928 3.48051 2.09631 4.16669 1.79688",
|
|
@@ -13619,7 +13725,7 @@ var PieChart3 = (_a) => {
|
|
|
13619
13725
|
strokeLinecap: "round",
|
|
13620
13726
|
strokeLinejoin: "round"
|
|
13621
13727
|
}
|
|
13622
|
-
), /* @__PURE__ */
|
|
13728
|
+
), /* @__PURE__ */ React161.createElement(
|
|
13623
13729
|
"path",
|
|
13624
13730
|
{
|
|
13625
13731
|
d: "M10.5833 6.00033C10.5833 5.39843 10.4648 4.80244 10.2344 4.24636C10.0041 3.69028 9.66651 3.18502 9.24091 2.75942C8.8153 2.33382 8.31004 1.99621 7.75397 1.76588C7.19789 1.53554 6.60189 1.41699 6 1.41699V6.00033H10.5833Z",
|
|
@@ -13681,7 +13787,7 @@ var empty_profit_and_loss_report_default = {
|
|
|
13681
13787
|
};
|
|
13682
13788
|
|
|
13683
13789
|
// src/components/ProfitAndLossTable/ProfitAndLossTableComponent.tsx
|
|
13684
|
-
import
|
|
13790
|
+
import classNames61 from "classnames";
|
|
13685
13791
|
var ProfitAndLossTableComponent = ({
|
|
13686
13792
|
asContainer,
|
|
13687
13793
|
stringOverrides
|
|
@@ -13698,21 +13804,21 @@ var ProfitAndLossTableComponent = ({
|
|
|
13698
13804
|
const currentData = Array.isArray(actualData) ? actualData[actualData.length - 1] : actualData;
|
|
13699
13805
|
const data = !currentData || isLoading ? empty_profit_and_loss_report_default : currentData;
|
|
13700
13806
|
if (isLoading || actualData === void 0) {
|
|
13701
|
-
return /* @__PURE__ */
|
|
13807
|
+
return /* @__PURE__ */ React162.createElement(
|
|
13702
13808
|
"div",
|
|
13703
13809
|
{
|
|
13704
|
-
className:
|
|
13810
|
+
className: classNames61(
|
|
13705
13811
|
"Layer__profit-and-loss-table__loader-container",
|
|
13706
13812
|
asContainer && "Layer__component-container"
|
|
13707
13813
|
)
|
|
13708
13814
|
},
|
|
13709
|
-
/* @__PURE__ */
|
|
13815
|
+
/* @__PURE__ */ React162.createElement(Loader2, null)
|
|
13710
13816
|
);
|
|
13711
13817
|
}
|
|
13712
13818
|
const renderLineItem = (lineItem, depth, rowKey, rowIndex, scope, setSidebarScope2, variant) => {
|
|
13713
13819
|
const expandable = !!lineItem.line_items && lineItem.line_items.length > 0;
|
|
13714
13820
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
13715
|
-
return /* @__PURE__ */
|
|
13821
|
+
return /* @__PURE__ */ React162.createElement(React162.Fragment, { key: rowKey + "-" + rowIndex }, /* @__PURE__ */ React162.createElement(
|
|
13716
13822
|
TableRow,
|
|
13717
13823
|
{
|
|
13718
13824
|
rowKey: rowKey + "-" + rowIndex,
|
|
@@ -13722,7 +13828,7 @@ var ProfitAndLossTableComponent = ({
|
|
|
13722
13828
|
variant: variant ? variant : expandable ? "expandable" : "default",
|
|
13723
13829
|
handleExpand: () => setIsOpen(rowKey)
|
|
13724
13830
|
},
|
|
13725
|
-
/* @__PURE__ */
|
|
13831
|
+
/* @__PURE__ */ React162.createElement(
|
|
13726
13832
|
TableCell,
|
|
13727
13833
|
{
|
|
13728
13834
|
primary: true,
|
|
@@ -13731,7 +13837,7 @@ var ProfitAndLossTableComponent = ({
|
|
|
13731
13837
|
},
|
|
13732
13838
|
lineItem.display_name,
|
|
13733
13839
|
" ",
|
|
13734
|
-
setSidebarScope2 && /* @__PURE__ */
|
|
13840
|
+
setSidebarScope2 && /* @__PURE__ */ React162.createElement(
|
|
13735
13841
|
"span",
|
|
13736
13842
|
{
|
|
13737
13843
|
className: "Layer__profit-and-loss-row__detailed-chart-btn",
|
|
@@ -13740,10 +13846,10 @@ var ProfitAndLossTableComponent = ({
|
|
|
13740
13846
|
setSidebarScope2 && setSidebarScope2(scope != null ? scope : "expenses");
|
|
13741
13847
|
}
|
|
13742
13848
|
},
|
|
13743
|
-
/* @__PURE__ */
|
|
13849
|
+
/* @__PURE__ */ React162.createElement(PieChart_default, null)
|
|
13744
13850
|
)
|
|
13745
13851
|
),
|
|
13746
|
-
/* @__PURE__ */
|
|
13852
|
+
/* @__PURE__ */ React162.createElement(TableCell, { isCurrency: true, primary: true }, Number.isNaN(lineItem.value) ? 0 : lineItem.value)
|
|
13747
13853
|
), expanded && lineItem.line_items ? lineItem.line_items.map(
|
|
13748
13854
|
(child, i) => renderLineItem(
|
|
13749
13855
|
child,
|
|
@@ -13753,7 +13859,7 @@ var ProfitAndLossTableComponent = ({
|
|
|
13753
13859
|
)
|
|
13754
13860
|
) : null);
|
|
13755
13861
|
};
|
|
13756
|
-
return /* @__PURE__ */
|
|
13862
|
+
return /* @__PURE__ */ React162.createElement(Table, { borderCollapse: "collapse", bottomSpacing: false }, /* @__PURE__ */ React162.createElement(TableBody, null, renderLineItem(
|
|
13757
13863
|
data.income,
|
|
13758
13864
|
0,
|
|
13759
13865
|
"income",
|
|
@@ -13807,13 +13913,13 @@ var ProfitAndLossTableComponent = ({
|
|
|
13807
13913
|
void 0,
|
|
13808
13914
|
void 0,
|
|
13809
13915
|
"summation"
|
|
13810
|
-
), data.personal_expenses ? /* @__PURE__ */
|
|
13916
|
+
), data.personal_expenses ? /* @__PURE__ */ React162.createElement(React162.Fragment, null, renderLineItem(data.personal_expenses, 0, "personal_expenses", 7)) : null, data.other_outflows ? /* @__PURE__ */ React162.createElement(React162.Fragment, null, renderLineItem(data.other_outflows, 0, "other_outflows", 6)) : null));
|
|
13811
13917
|
};
|
|
13812
13918
|
|
|
13813
13919
|
// src/components/ProfitAndLossTable/ProfitAndLossTableWithProvider.tsx
|
|
13814
13920
|
var ProfitAndLossTableWithProvider = (props) => {
|
|
13815
13921
|
const { compareMode } = useContext25(ProfitAndLoss.ComparisonContext);
|
|
13816
|
-
return /* @__PURE__ */
|
|
13922
|
+
return /* @__PURE__ */ React163.createElement(TableProvider, null, compareMode ? /* @__PURE__ */ React163.createElement("div", { className: "Layer__compare__table__wrapper" }, /* @__PURE__ */ React163.createElement(ProfitAndLossCompareTable, __spreadValues({}, props))) : /* @__PURE__ */ React163.createElement(ProfitAndLossTableComponent, __spreadValues({}, props)));
|
|
13817
13923
|
};
|
|
13818
13924
|
|
|
13819
13925
|
// src/components/ProfitAndLoss/ProfitAndLoss.tsx
|
|
@@ -13856,7 +13962,7 @@ var ProfitAndLoss = ({
|
|
|
13856
13962
|
}) => {
|
|
13857
13963
|
const contextData = useProfitAndLoss({ tagFilter, reportingBasis });
|
|
13858
13964
|
const comparisonContextData = useProfitAndLossComparison({ reportingBasis });
|
|
13859
|
-
return /* @__PURE__ */
|
|
13965
|
+
return /* @__PURE__ */ React164.createElement(PNLContext.Provider, { value: contextData }, /* @__PURE__ */ React164.createElement(PNLComparisonContext.Provider, { value: comparisonContextData }, asContainer ? /* @__PURE__ */ React164.createElement(Container, { name: "profit-and-loss" }, children) : children));
|
|
13860
13966
|
};
|
|
13861
13967
|
ProfitAndLoss.Chart = ProfitAndLossChart;
|
|
13862
13968
|
ProfitAndLoss.Context = PNLContext;
|
|
@@ -13871,7 +13977,7 @@ ProfitAndLoss.Report = ProfitAndLossReport;
|
|
|
13871
13977
|
ProfitAndLoss.DownloadButton = ProfitAndLossDownloadButton;
|
|
13872
13978
|
|
|
13873
13979
|
// src/components/BalanceSheet/BalanceSheet.tsx
|
|
13874
|
-
import
|
|
13980
|
+
import React168, { useEffect as useEffect37, useState as useState42 } from "react";
|
|
13875
13981
|
|
|
13876
13982
|
// src/contexts/BalanceSheetContext/BalanceSheetContext.tsx
|
|
13877
13983
|
import { createContext as createContext11 } from "react";
|
|
@@ -13959,12 +14065,12 @@ var useElementViewSize = (callback) => {
|
|
|
13959
14065
|
};
|
|
13960
14066
|
|
|
13961
14067
|
// src/components/BalanceSheetDatePicker/BalanceSheetDatePicker.tsx
|
|
13962
|
-
import
|
|
14068
|
+
import React165 from "react";
|
|
13963
14069
|
var BalanceSheetDatePicker = ({
|
|
13964
14070
|
effectiveDate,
|
|
13965
14071
|
setEffectiveDate
|
|
13966
14072
|
}) => {
|
|
13967
|
-
return /* @__PURE__ */
|
|
14073
|
+
return /* @__PURE__ */ React165.createElement(React165.Fragment, null, /* @__PURE__ */ React165.createElement(
|
|
13968
14074
|
DatePicker,
|
|
13969
14075
|
{
|
|
13970
14076
|
selected: effectiveDate,
|
|
@@ -13975,12 +14081,12 @@ var BalanceSheetDatePicker = ({
|
|
|
13975
14081
|
};
|
|
13976
14082
|
|
|
13977
14083
|
// src/components/BalanceSheetExpandAllButton/BalanceSheetExpandAllButton.tsx
|
|
13978
|
-
import
|
|
14084
|
+
import React166 from "react";
|
|
13979
14085
|
var BalanceSheetExpandAllButton = ({
|
|
13980
14086
|
view
|
|
13981
14087
|
}) => {
|
|
13982
14088
|
const { expandedAllRows, toggleAllRows } = useTableExpandRow();
|
|
13983
|
-
return /* @__PURE__ */
|
|
14089
|
+
return /* @__PURE__ */ React166.createElement(
|
|
13984
14090
|
ExpandCollapseButton,
|
|
13985
14091
|
{
|
|
13986
14092
|
onClick: toggleAllRows,
|
|
@@ -13991,7 +14097,7 @@ var BalanceSheetExpandAllButton = ({
|
|
|
13991
14097
|
};
|
|
13992
14098
|
|
|
13993
14099
|
// src/components/BalanceSheetTable/BalanceSheetTable.tsx
|
|
13994
|
-
import
|
|
14100
|
+
import React167, { useEffect as useEffect36 } from "react";
|
|
13995
14101
|
var BalanceSheetTable = ({
|
|
13996
14102
|
data,
|
|
13997
14103
|
config,
|
|
@@ -14014,7 +14120,7 @@ var BalanceSheetTable = ({
|
|
|
14014
14120
|
if (expandable) {
|
|
14015
14121
|
allRowKeys.push(rowKey);
|
|
14016
14122
|
}
|
|
14017
|
-
return /* @__PURE__ */
|
|
14123
|
+
return /* @__PURE__ */ React167.createElement(React167.Fragment, { key: rowKey + "-" + rowIndex }, /* @__PURE__ */ React167.createElement(
|
|
14018
14124
|
TableRow,
|
|
14019
14125
|
{
|
|
14020
14126
|
rowKey: rowKey + "-" + rowIndex,
|
|
@@ -14024,8 +14130,8 @@ var BalanceSheetTable = ({
|
|
|
14024
14130
|
depth,
|
|
14025
14131
|
withDivider: depth === 0 && rowIndex > 0
|
|
14026
14132
|
},
|
|
14027
|
-
/* @__PURE__ */
|
|
14028
|
-
/* @__PURE__ */
|
|
14133
|
+
/* @__PURE__ */ React167.createElement(TableCell, { withExpandIcon: expandable, primary: expandable }, lineItem.display_name),
|
|
14134
|
+
/* @__PURE__ */ React167.createElement(
|
|
14029
14135
|
TableCell,
|
|
14030
14136
|
{
|
|
14031
14137
|
isCurrency: !expandable || expandable && !expanded,
|
|
@@ -14041,18 +14147,18 @@ var BalanceSheetTable = ({
|
|
|
14041
14147
|
rowKey + ":" + subItem.name,
|
|
14042
14148
|
subIdx
|
|
14043
14149
|
)
|
|
14044
|
-
), showChildren && expandable && /* @__PURE__ */
|
|
14150
|
+
), showChildren && expandable && /* @__PURE__ */ React167.createElement(
|
|
14045
14151
|
TableRow,
|
|
14046
14152
|
{
|
|
14047
14153
|
rowKey: rowKey + "-" + rowIndex + "--summation",
|
|
14048
14154
|
depth: depth + 1,
|
|
14049
14155
|
variant: "summation"
|
|
14050
14156
|
},
|
|
14051
|
-
/* @__PURE__ */
|
|
14052
|
-
/* @__PURE__ */
|
|
14157
|
+
/* @__PURE__ */ React167.createElement(TableCell, { primary: true }, `Total of ${lineItem.display_name}`),
|
|
14158
|
+
/* @__PURE__ */ React167.createElement(TableCell, { primary: true, isCurrency: true, align: "right" /* RIGHT */ }, lineItem.value)
|
|
14053
14159
|
));
|
|
14054
14160
|
};
|
|
14055
|
-
return /* @__PURE__ */
|
|
14161
|
+
return /* @__PURE__ */ React167.createElement(Table, { borderCollapse: "collapse" }, /* @__PURE__ */ React167.createElement(TableHead, null, /* @__PURE__ */ React167.createElement(TableRow, { isHeadRow: true, rowKey: "balance-sheet-head-row" }, /* @__PURE__ */ React167.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.typeColumnHeader) || "Type"), /* @__PURE__ */ React167.createElement(TableCell, { isHeaderCell: true, align: "right" /* RIGHT */ }, (stringOverrides == null ? void 0 : stringOverrides.totalColumnHeader) || "Total"))), /* @__PURE__ */ React167.createElement(TableBody, null, config.map((row, idx) => /* @__PURE__ */ React167.createElement(React167.Fragment, { key: row.lineItem }, data[row.lineItem] && renderLineItem(
|
|
14056
14162
|
data[row.lineItem],
|
|
14057
14163
|
0,
|
|
14058
14164
|
row.lineItem,
|
|
@@ -14079,7 +14185,7 @@ import { format as format5, parse, startOfDay as startOfDay2 } from "date-fns";
|
|
|
14079
14185
|
var COMPONENT_NAME3 = "balance-sheet";
|
|
14080
14186
|
var BalanceSheet = (props) => {
|
|
14081
14187
|
const balanceSheetContextData = useBalanceSheet(props.effectiveDate);
|
|
14082
|
-
return /* @__PURE__ */
|
|
14188
|
+
return /* @__PURE__ */ React168.createElement(BalanceSheetContext.Provider, { value: balanceSheetContextData }, /* @__PURE__ */ React168.createElement(
|
|
14083
14189
|
BalanceSheetView,
|
|
14084
14190
|
__spreadValues({
|
|
14085
14191
|
asWidget: props.asWidget,
|
|
@@ -14111,20 +14217,20 @@ var BalanceSheetView = ({
|
|
|
14111
14217
|
}
|
|
14112
14218
|
}, [effectiveDate]);
|
|
14113
14219
|
if (asWidget) {
|
|
14114
|
-
return /* @__PURE__ */
|
|
14220
|
+
return /* @__PURE__ */ React168.createElement(TableProvider, null, /* @__PURE__ */ React168.createElement(Container, { name: COMPONENT_NAME3, asWidget: true }, /* @__PURE__ */ React168.createElement(
|
|
14115
14221
|
View,
|
|
14116
14222
|
{
|
|
14117
14223
|
type: "panel",
|
|
14118
14224
|
ref: containerRef,
|
|
14119
|
-
header: /* @__PURE__ */
|
|
14225
|
+
header: /* @__PURE__ */ React168.createElement(Header2, null, /* @__PURE__ */ React168.createElement(HeaderRow, null, /* @__PURE__ */ React168.createElement(HeaderCol, null, /* @__PURE__ */ React168.createElement(
|
|
14120
14226
|
BalanceSheetDatePicker,
|
|
14121
14227
|
{
|
|
14122
14228
|
effectiveDate,
|
|
14123
14229
|
setEffectiveDate
|
|
14124
14230
|
}
|
|
14125
|
-
)), withExpandAllButton && /* @__PURE__ */
|
|
14231
|
+
)), withExpandAllButton && /* @__PURE__ */ React168.createElement(HeaderCol, null, /* @__PURE__ */ React168.createElement(BalanceSheetExpandAllButton, { view }))))
|
|
14126
14232
|
},
|
|
14127
|
-
!data || isLoading ? /* @__PURE__ */
|
|
14233
|
+
!data || isLoading ? /* @__PURE__ */ React168.createElement("div", { className: `Layer__${COMPONENT_NAME3}__loader-container` }, /* @__PURE__ */ React168.createElement(Loader2, null)) : /* @__PURE__ */ React168.createElement(
|
|
14128
14234
|
BalanceSheetTable,
|
|
14129
14235
|
{
|
|
14130
14236
|
data,
|
|
@@ -14134,20 +14240,20 @@ var BalanceSheetView = ({
|
|
|
14134
14240
|
)
|
|
14135
14241
|
)));
|
|
14136
14242
|
}
|
|
14137
|
-
return /* @__PURE__ */
|
|
14243
|
+
return /* @__PURE__ */ React168.createElement(TableProvider, null, /* @__PURE__ */ React168.createElement(
|
|
14138
14244
|
View,
|
|
14139
14245
|
{
|
|
14140
14246
|
type: "panel",
|
|
14141
14247
|
ref: containerRef,
|
|
14142
|
-
header: /* @__PURE__ */
|
|
14248
|
+
header: /* @__PURE__ */ React168.createElement(Header2, null, /* @__PURE__ */ React168.createElement(HeaderRow, null, /* @__PURE__ */ React168.createElement(HeaderCol, null, /* @__PURE__ */ React168.createElement(
|
|
14143
14249
|
BalanceSheetDatePicker,
|
|
14144
14250
|
{
|
|
14145
14251
|
effectiveDate,
|
|
14146
14252
|
setEffectiveDate
|
|
14147
14253
|
}
|
|
14148
|
-
)), withExpandAllButton && /* @__PURE__ */
|
|
14254
|
+
)), withExpandAllButton && /* @__PURE__ */ React168.createElement(HeaderCol, null, /* @__PURE__ */ React168.createElement(BalanceSheetExpandAllButton, { view }))))
|
|
14149
14255
|
},
|
|
14150
|
-
!data || isLoading ? /* @__PURE__ */
|
|
14256
|
+
!data || isLoading ? /* @__PURE__ */ React168.createElement("div", { className: `Layer__${COMPONENT_NAME3}__loader-container` }, /* @__PURE__ */ React168.createElement(Loader2, null)) : /* @__PURE__ */ React168.createElement(
|
|
14151
14257
|
BalanceSheetTable,
|
|
14152
14258
|
{
|
|
14153
14259
|
data,
|
|
@@ -14159,7 +14265,7 @@ var BalanceSheetView = ({
|
|
|
14159
14265
|
};
|
|
14160
14266
|
|
|
14161
14267
|
// src/components/StatementOfCashFlow/StatementOfCashFlow.tsx
|
|
14162
|
-
import
|
|
14268
|
+
import React170, { useState as useState43 } from "react";
|
|
14163
14269
|
|
|
14164
14270
|
// src/contexts/StatementOfCashContext/StatementOfCashFlowContext.tsx
|
|
14165
14271
|
import { createContext as createContext12 } from "react";
|
|
@@ -14210,7 +14316,7 @@ var useStatementOfCashFlow = (startDate = /* @__PURE__ */ new Date(), endDate =
|
|
|
14210
14316
|
};
|
|
14211
14317
|
|
|
14212
14318
|
// src/components/StatementOfCashFlowTable/StatementOfCashFlowTable.tsx
|
|
14213
|
-
import
|
|
14319
|
+
import React169 from "react";
|
|
14214
14320
|
var StatementOfCashFlowTable = ({
|
|
14215
14321
|
data,
|
|
14216
14322
|
config,
|
|
@@ -14220,7 +14326,7 @@ var StatementOfCashFlowTable = ({
|
|
|
14220
14326
|
const renderLineItem = (lineItem, depth = 0, rowKey, rowIndex) => {
|
|
14221
14327
|
const expandable = !!lineItem.line_items && lineItem.line_items.length > 0;
|
|
14222
14328
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
14223
|
-
return /* @__PURE__ */
|
|
14329
|
+
return /* @__PURE__ */ React169.createElement(React169.Fragment, { key: rowKey + "-" + rowIndex }, /* @__PURE__ */ React169.createElement(
|
|
14224
14330
|
TableRow,
|
|
14225
14331
|
{
|
|
14226
14332
|
rowKey: rowKey + "-" + rowIndex,
|
|
@@ -14229,8 +14335,8 @@ var StatementOfCashFlowTable = ({
|
|
|
14229
14335
|
handleExpand: () => setIsOpen(rowKey),
|
|
14230
14336
|
depth
|
|
14231
14337
|
},
|
|
14232
|
-
/* @__PURE__ */
|
|
14233
|
-
/* @__PURE__ */
|
|
14338
|
+
/* @__PURE__ */ React169.createElement(TableCell, { withExpandIcon: expandable, primary: expandable }, lineItem.display_name),
|
|
14339
|
+
/* @__PURE__ */ React169.createElement(
|
|
14234
14340
|
TableCell,
|
|
14235
14341
|
{
|
|
14236
14342
|
isCurrency: !expandable || expandable && !expanded,
|
|
@@ -14246,35 +14352,35 @@ var StatementOfCashFlowTable = ({
|
|
|
14246
14352
|
rowKey + ":" + subItem.name,
|
|
14247
14353
|
subIdx
|
|
14248
14354
|
)
|
|
14249
|
-
), expanded && expandable && /* @__PURE__ */
|
|
14355
|
+
), expanded && expandable && /* @__PURE__ */ React169.createElement(
|
|
14250
14356
|
TableRow,
|
|
14251
14357
|
{
|
|
14252
14358
|
rowKey: rowKey + "-" + rowIndex + "--summation",
|
|
14253
14359
|
depth: depth + 1,
|
|
14254
14360
|
variant: "summation"
|
|
14255
14361
|
},
|
|
14256
|
-
/* @__PURE__ */
|
|
14257
|
-
/* @__PURE__ */
|
|
14362
|
+
/* @__PURE__ */ React169.createElement(TableCell, { primary: true }, `Total of ${lineItem.display_name}`),
|
|
14363
|
+
/* @__PURE__ */ React169.createElement(TableCell, { primary: true, isCurrency: true, align: "right" /* RIGHT */ }, lineItem.value)
|
|
14258
14364
|
));
|
|
14259
14365
|
};
|
|
14260
|
-
return /* @__PURE__ */
|
|
14366
|
+
return /* @__PURE__ */ React169.createElement(Table, { borderCollapse: "collapse" }, /* @__PURE__ */ React169.createElement(TableHead, null, /* @__PURE__ */ React169.createElement(TableRow, { rowKey: "soc-flow-head-row", isHeadRow: true }, /* @__PURE__ */ React169.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.typeColumnHeader) || "Type"), /* @__PURE__ */ React169.createElement(TableCell, { isHeaderCell: true, align: "right" /* RIGHT */ }, (stringOverrides == null ? void 0 : stringOverrides.totalColumnHeader) || "Total"))), /* @__PURE__ */ React169.createElement(TableBody, null, config.map((row, idx) => {
|
|
14261
14367
|
if (row.type === "line_item") {
|
|
14262
|
-
return /* @__PURE__ */
|
|
14368
|
+
return /* @__PURE__ */ React169.createElement(React169.Fragment, { key: row.lineItem }, data[row.lineItem] && renderLineItem(
|
|
14263
14369
|
data[row.lineItem],
|
|
14264
14370
|
0,
|
|
14265
14371
|
row.lineItem ? row.lineItem : "",
|
|
14266
14372
|
idx
|
|
14267
14373
|
));
|
|
14268
14374
|
} else {
|
|
14269
|
-
return /* @__PURE__ */
|
|
14375
|
+
return /* @__PURE__ */ React169.createElement(
|
|
14270
14376
|
TableRow,
|
|
14271
14377
|
{
|
|
14272
14378
|
key: row.name + "-" + idx,
|
|
14273
14379
|
rowKey: row.name + "-" + idx,
|
|
14274
14380
|
variant: "default"
|
|
14275
14381
|
},
|
|
14276
|
-
/* @__PURE__ */
|
|
14277
|
-
/* @__PURE__ */
|
|
14382
|
+
/* @__PURE__ */ React169.createElement(TableCell, { primary: true }, row.displayName),
|
|
14383
|
+
/* @__PURE__ */ React169.createElement(TableCell, { primary: true, isCurrency: true, align: "right" /* RIGHT */ }, row.lineItem)
|
|
14278
14384
|
);
|
|
14279
14385
|
}
|
|
14280
14386
|
})));
|
|
@@ -14324,7 +14430,7 @@ import { endOfMonth as endOfMonth9, startOfDay as startOfDay4, startOfMonth as s
|
|
|
14324
14430
|
var COMPONENT_NAME4 = "statement-of-cash-flow";
|
|
14325
14431
|
var StatementOfCashFlow = (props) => {
|
|
14326
14432
|
const cashContextData = useStatementOfCashFlow();
|
|
14327
|
-
return /* @__PURE__ */
|
|
14433
|
+
return /* @__PURE__ */ React170.createElement(StatementOfCashFlowContext.Provider, { value: cashContextData }, /* @__PURE__ */ React170.createElement(StatementOfCashFlowView, __spreadValues({}, props)));
|
|
14328
14434
|
};
|
|
14329
14435
|
var StatementOfCashFlowView = ({
|
|
14330
14436
|
stringOverrides,
|
|
@@ -14355,7 +14461,7 @@ var StatementOfCashFlowView = ({
|
|
|
14355
14461
|
refetch();
|
|
14356
14462
|
}
|
|
14357
14463
|
};
|
|
14358
|
-
const datePicker = datePickerMode === "monthPicker" ? /* @__PURE__ */
|
|
14464
|
+
const datePicker = datePickerMode === "monthPicker" ? /* @__PURE__ */ React170.createElement(
|
|
14359
14465
|
DatePicker,
|
|
14360
14466
|
{
|
|
14361
14467
|
selected: startDate,
|
|
@@ -14373,7 +14479,7 @@ var StatementOfCashFlowView = ({
|
|
|
14373
14479
|
ModeSelector: DatePickerModeSelector
|
|
14374
14480
|
}
|
|
14375
14481
|
}
|
|
14376
|
-
) : /* @__PURE__ */
|
|
14482
|
+
) : /* @__PURE__ */ React170.createElement(
|
|
14377
14483
|
DatePicker,
|
|
14378
14484
|
{
|
|
14379
14485
|
selected: [startDate, endDate],
|
|
@@ -14388,13 +14494,13 @@ var StatementOfCashFlowView = ({
|
|
|
14388
14494
|
}
|
|
14389
14495
|
}
|
|
14390
14496
|
);
|
|
14391
|
-
return /* @__PURE__ */
|
|
14497
|
+
return /* @__PURE__ */ React170.createElement(TableProvider, null, /* @__PURE__ */ React170.createElement(
|
|
14392
14498
|
View,
|
|
14393
14499
|
{
|
|
14394
14500
|
type: "panel",
|
|
14395
|
-
header: /* @__PURE__ */
|
|
14501
|
+
header: /* @__PURE__ */ React170.createElement(Header2, null, /* @__PURE__ */ React170.createElement(HeaderRow, null, /* @__PURE__ */ React170.createElement(HeaderCol, null, datePicker)))
|
|
14396
14502
|
},
|
|
14397
|
-
!data || isLoading ? /* @__PURE__ */
|
|
14503
|
+
!data || isLoading ? /* @__PURE__ */ React170.createElement("div", { className: `Layer__${COMPONENT_NAME4}__loader-container` }, /* @__PURE__ */ React170.createElement(Loader2, null)) : /* @__PURE__ */ React170.createElement(
|
|
14398
14504
|
StatementOfCashFlowTable,
|
|
14399
14505
|
{
|
|
14400
14506
|
data,
|
|
@@ -14406,7 +14512,7 @@ var StatementOfCashFlowView = ({
|
|
|
14406
14512
|
};
|
|
14407
14513
|
|
|
14408
14514
|
// src/components/ChartOfAccounts/ChartOfAccounts.tsx
|
|
14409
|
-
import
|
|
14515
|
+
import React185, { useContext as useContext33, useState as useState50 } from "react";
|
|
14410
14516
|
|
|
14411
14517
|
// src/contexts/ChartOfAccountsContext/ChartOfAccountsContext.tsx
|
|
14412
14518
|
import { createContext as createContext13 } from "react";
|
|
@@ -15047,13 +15153,13 @@ var useLedgerAccounts = (showReversalEntries = false) => {
|
|
|
15047
15153
|
};
|
|
15048
15154
|
|
|
15049
15155
|
// src/components/ChartOfAccountsTable/ChartOfAccountsTableWithPanel.tsx
|
|
15050
|
-
import
|
|
15156
|
+
import React177, { useContext as useContext29, useState as useState47 } from "react";
|
|
15051
15157
|
|
|
15052
15158
|
// src/icons/Plus.tsx
|
|
15053
|
-
import * as
|
|
15159
|
+
import * as React171 from "react";
|
|
15054
15160
|
var Plus = (_a) => {
|
|
15055
15161
|
var _b = _a, { size = 14 } = _b, props = __objRest(_b, ["size"]);
|
|
15056
|
-
return /* @__PURE__ */
|
|
15162
|
+
return /* @__PURE__ */ React171.createElement(
|
|
15057
15163
|
"svg",
|
|
15058
15164
|
__spreadProps(__spreadValues({
|
|
15059
15165
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -15063,7 +15169,7 @@ var Plus = (_a) => {
|
|
|
15063
15169
|
width: size,
|
|
15064
15170
|
height: size
|
|
15065
15171
|
}),
|
|
15066
|
-
/* @__PURE__ */
|
|
15172
|
+
/* @__PURE__ */ React171.createElement(
|
|
15067
15173
|
"path",
|
|
15068
15174
|
{
|
|
15069
15175
|
d: "M7 2.91602V11.0827",
|
|
@@ -15072,7 +15178,7 @@ var Plus = (_a) => {
|
|
|
15072
15178
|
strokeLinejoin: "round"
|
|
15073
15179
|
}
|
|
15074
15180
|
),
|
|
15075
|
-
/* @__PURE__ */
|
|
15181
|
+
/* @__PURE__ */ React171.createElement(
|
|
15076
15182
|
"path",
|
|
15077
15183
|
{
|
|
15078
15184
|
d: "M2.91669 7H11.0834",
|
|
@@ -15086,11 +15192,11 @@ var Plus = (_a) => {
|
|
|
15086
15192
|
var Plus_default = Plus;
|
|
15087
15193
|
|
|
15088
15194
|
// src/components/ChartOfAccountsDatePicker/ChartOfAccountsDatePicker.tsx
|
|
15089
|
-
import
|
|
15195
|
+
import React172, { useContext as useContext26 } from "react";
|
|
15090
15196
|
import { endOfMonth as endOfMonth12, startOfMonth as startOfMonth15 } from "date-fns";
|
|
15091
15197
|
var ChartOfAccountsDatePicker = () => {
|
|
15092
15198
|
const { changeDateRange, dateRange } = useContext26(ChartOfAccountsContext);
|
|
15093
|
-
return /* @__PURE__ */
|
|
15199
|
+
return /* @__PURE__ */ React172.createElement(
|
|
15094
15200
|
DatePicker,
|
|
15095
15201
|
{
|
|
15096
15202
|
mode: "monthPicker",
|
|
@@ -15108,16 +15214,16 @@ var ChartOfAccountsDatePicker = () => {
|
|
|
15108
15214
|
};
|
|
15109
15215
|
|
|
15110
15216
|
// src/components/ChartOfAccountsSidebar/ChartOfAccountsSidebar.tsx
|
|
15111
|
-
import
|
|
15217
|
+
import React174 from "react";
|
|
15112
15218
|
|
|
15113
15219
|
// src/components/ChartOfAccountsForm/ChartOfAccountsForm.tsx
|
|
15114
|
-
import
|
|
15220
|
+
import React173, { useContext as useContext27, useMemo as useMemo17 } from "react";
|
|
15115
15221
|
|
|
15116
15222
|
// src/components/ChartOfAccountsForm/useParentOptions.ts
|
|
15117
|
-
import { useMemo as
|
|
15223
|
+
import { useMemo as useMemo16 } from "react";
|
|
15118
15224
|
var useParentOptions = (data) => {
|
|
15119
15225
|
var _a;
|
|
15120
|
-
return
|
|
15226
|
+
return useMemo16(
|
|
15121
15227
|
() => flattenAccounts((data == null ? void 0 : data.accounts) || []).sort((a, b) => (a == null ? void 0 : a.name) && (b == null ? void 0 : b.name) ? a.name.localeCompare(b.name) : 0).map((x) => {
|
|
15122
15228
|
return {
|
|
15123
15229
|
label: x.name,
|
|
@@ -15143,7 +15249,7 @@ var ChartOfAccountsForm = ({
|
|
|
15143
15249
|
apiError
|
|
15144
15250
|
} = useContext27(ChartOfAccountsContext);
|
|
15145
15251
|
const parentOptions = useParentOptions(data);
|
|
15146
|
-
const entry =
|
|
15252
|
+
const entry = useMemo17(() => {
|
|
15147
15253
|
if ((form == null ? void 0 : form.action) === "edit" && form.accountId) {
|
|
15148
15254
|
return flattenAccounts((data == null ? void 0 : data.accounts) || []).find(
|
|
15149
15255
|
(x) => x.id === form.accountId
|
|
@@ -15154,7 +15260,7 @@ var ChartOfAccountsForm = ({
|
|
|
15154
15260
|
if (!form) {
|
|
15155
15261
|
return null;
|
|
15156
15262
|
}
|
|
15157
|
-
return /* @__PURE__ */
|
|
15263
|
+
return /* @__PURE__ */ React173.createElement(
|
|
15158
15264
|
"form",
|
|
15159
15265
|
{
|
|
15160
15266
|
className: "Layer__form",
|
|
@@ -15163,7 +15269,7 @@ var ChartOfAccountsForm = ({
|
|
|
15163
15269
|
submitForm();
|
|
15164
15270
|
}
|
|
15165
15271
|
},
|
|
15166
|
-
/* @__PURE__ */
|
|
15272
|
+
/* @__PURE__ */ React173.createElement(Header2, { className: "Layer__chart-of-accounts__sidebar__header" }, /* @__PURE__ */ React173.createElement(HeaderRow, null, /* @__PURE__ */ React173.createElement(HeaderCol, null, /* @__PURE__ */ React173.createElement(Heading, { size: "secondary" /* secondary */, className: "title" }, (form == null ? void 0 : form.action) === "edit" ? (stringOverrides == null ? void 0 : stringOverrides.editModeHeader) || "Edit Account" : (stringOverrides == null ? void 0 : stringOverrides.createModeHeader) || "Add New Account")), /* @__PURE__ */ React173.createElement(HeaderCol, { className: "actions" }, /* @__PURE__ */ React173.createElement(
|
|
15167
15273
|
Button,
|
|
15168
15274
|
{
|
|
15169
15275
|
type: "button",
|
|
@@ -15172,7 +15278,7 @@ var ChartOfAccountsForm = ({
|
|
|
15172
15278
|
disabled: sendingForm
|
|
15173
15279
|
},
|
|
15174
15280
|
(stringOverrides == null ? void 0 : stringOverrides.cancelButton) || "Cancel"
|
|
15175
|
-
), apiError && /* @__PURE__ */
|
|
15281
|
+
), apiError && /* @__PURE__ */ React173.createElement(
|
|
15176
15282
|
RetryButton,
|
|
15177
15283
|
{
|
|
15178
15284
|
type: "submit",
|
|
@@ -15181,7 +15287,7 @@ var ChartOfAccountsForm = ({
|
|
|
15181
15287
|
disabled: sendingForm
|
|
15182
15288
|
},
|
|
15183
15289
|
(stringOverrides == null ? void 0 : stringOverrides.retryButton) || "Retry"
|
|
15184
|
-
), !apiError && /* @__PURE__ */
|
|
15290
|
+
), !apiError && /* @__PURE__ */ React173.createElement(
|
|
15185
15291
|
SubmitButton,
|
|
15186
15292
|
{
|
|
15187
15293
|
type: "submit",
|
|
@@ -15191,7 +15297,7 @@ var ChartOfAccountsForm = ({
|
|
|
15191
15297
|
},
|
|
15192
15298
|
(stringOverrides == null ? void 0 : stringOverrides.saveButton) || "Save"
|
|
15193
15299
|
)))),
|
|
15194
|
-
apiError && /* @__PURE__ */
|
|
15300
|
+
apiError && /* @__PURE__ */ React173.createElement(
|
|
15195
15301
|
Text,
|
|
15196
15302
|
{
|
|
15197
15303
|
size: "sm" /* sm */,
|
|
@@ -15199,15 +15305,15 @@ var ChartOfAccountsForm = ({
|
|
|
15199
15305
|
},
|
|
15200
15306
|
apiError
|
|
15201
15307
|
),
|
|
15202
|
-
entry && /* @__PURE__ */
|
|
15203
|
-
/* @__PURE__ */
|
|
15308
|
+
entry && /* @__PURE__ */ React173.createElement("div", { className: "Layer__chart-of-accounts__form-edit-entry" }, /* @__PURE__ */ React173.createElement(Text, { weight: "bold" /* bold */ }, entry.name), /* @__PURE__ */ React173.createElement(Text, { weight: "bold" /* bold */ }, "$", centsToDollars(entry.balance || 0))),
|
|
15309
|
+
/* @__PURE__ */ React173.createElement("div", { className: "Layer__chart-of-accounts__form" }, /* @__PURE__ */ React173.createElement(
|
|
15204
15310
|
InputGroup,
|
|
15205
15311
|
{
|
|
15206
15312
|
name: "parent",
|
|
15207
15313
|
label: (stringOverrides == null ? void 0 : stringOverrides.parentLabel) || "Parent",
|
|
15208
15314
|
inline: true
|
|
15209
15315
|
},
|
|
15210
|
-
/* @__PURE__ */
|
|
15316
|
+
/* @__PURE__ */ React173.createElement(
|
|
15211
15317
|
Select2,
|
|
15212
15318
|
{
|
|
15213
15319
|
options: parentOptions,
|
|
@@ -15216,14 +15322,14 @@ var ChartOfAccountsForm = ({
|
|
|
15216
15322
|
disabled: sendingForm
|
|
15217
15323
|
}
|
|
15218
15324
|
)
|
|
15219
|
-
), /* @__PURE__ */
|
|
15325
|
+
), /* @__PURE__ */ React173.createElement(
|
|
15220
15326
|
InputGroup,
|
|
15221
15327
|
{
|
|
15222
15328
|
name: "name",
|
|
15223
15329
|
label: (stringOverrides == null ? void 0 : stringOverrides.nameLabel) || "Name",
|
|
15224
15330
|
inline: true
|
|
15225
15331
|
},
|
|
15226
|
-
/* @__PURE__ */
|
|
15332
|
+
/* @__PURE__ */ React173.createElement(
|
|
15227
15333
|
Input,
|
|
15228
15334
|
{
|
|
15229
15335
|
name: "name",
|
|
@@ -15235,14 +15341,14 @@ var ChartOfAccountsForm = ({
|
|
|
15235
15341
|
onChange: (e) => changeFormData("name", e.target.value)
|
|
15236
15342
|
}
|
|
15237
15343
|
)
|
|
15238
|
-
), /* @__PURE__ */
|
|
15344
|
+
), /* @__PURE__ */ React173.createElement(
|
|
15239
15345
|
InputGroup,
|
|
15240
15346
|
{
|
|
15241
15347
|
name: "type",
|
|
15242
15348
|
label: (stringOverrides == null ? void 0 : stringOverrides.typeLabel) || "Type",
|
|
15243
15349
|
inline: true
|
|
15244
15350
|
},
|
|
15245
|
-
/* @__PURE__ */
|
|
15351
|
+
/* @__PURE__ */ React173.createElement(
|
|
15246
15352
|
Select2,
|
|
15247
15353
|
{
|
|
15248
15354
|
options: LEDGER_ACCOUNT_TYPES,
|
|
@@ -15253,14 +15359,14 @@ var ChartOfAccountsForm = ({
|
|
|
15253
15359
|
disabled: sendingForm || form.action === "edit" || form.data.parent !== void 0
|
|
15254
15360
|
}
|
|
15255
15361
|
)
|
|
15256
|
-
), /* @__PURE__ */
|
|
15362
|
+
), /* @__PURE__ */ React173.createElement(
|
|
15257
15363
|
InputGroup,
|
|
15258
15364
|
{
|
|
15259
15365
|
name: "subType",
|
|
15260
15366
|
label: (stringOverrides == null ? void 0 : stringOverrides.subTypeLabel) || "Sub-Type",
|
|
15261
15367
|
inline: true
|
|
15262
15368
|
},
|
|
15263
|
-
/* @__PURE__ */
|
|
15369
|
+
/* @__PURE__ */ React173.createElement(
|
|
15264
15370
|
Select2,
|
|
15265
15371
|
{
|
|
15266
15372
|
options: ((_g = form == null ? void 0 : form.data.type) == null ? void 0 : _g.value) !== void 0 ? LEDGER_ACCOUNT_SUBTYPES_FOR_TYPE[(_h = form == null ? void 0 : form.data.type) == null ? void 0 : _h.value] : LEDGER_ACCOUNT_SUBTYPES,
|
|
@@ -15269,14 +15375,14 @@ var ChartOfAccountsForm = ({
|
|
|
15269
15375
|
disabled: sendingForm
|
|
15270
15376
|
}
|
|
15271
15377
|
)
|
|
15272
|
-
), /* @__PURE__ */
|
|
15378
|
+
), /* @__PURE__ */ React173.createElement(
|
|
15273
15379
|
InputGroup,
|
|
15274
15380
|
{
|
|
15275
15381
|
name: "normality",
|
|
15276
15382
|
label: (stringOverrides == null ? void 0 : stringOverrides.normalityLabel) || "Normality",
|
|
15277
15383
|
inline: true
|
|
15278
15384
|
},
|
|
15279
|
-
/* @__PURE__ */
|
|
15385
|
+
/* @__PURE__ */ React173.createElement(
|
|
15280
15386
|
Select2,
|
|
15281
15387
|
{
|
|
15282
15388
|
options: NORMALITY_OPTIONS,
|
|
@@ -15289,7 +15395,7 @@ var ChartOfAccountsForm = ({
|
|
|
15289
15395
|
disabled: sendingForm
|
|
15290
15396
|
}
|
|
15291
15397
|
)
|
|
15292
|
-
), /* @__PURE__ */
|
|
15398
|
+
), /* @__PURE__ */ React173.createElement("div", { className: "actions" }, /* @__PURE__ */ React173.createElement(
|
|
15293
15399
|
Button,
|
|
15294
15400
|
{
|
|
15295
15401
|
type: "button",
|
|
@@ -15298,7 +15404,7 @@ var ChartOfAccountsForm = ({
|
|
|
15298
15404
|
disabled: sendingForm
|
|
15299
15405
|
},
|
|
15300
15406
|
(stringOverrides == null ? void 0 : stringOverrides.cancelButton) || "Cancel"
|
|
15301
|
-
), apiError && /* @__PURE__ */
|
|
15407
|
+
), apiError && /* @__PURE__ */ React173.createElement(
|
|
15302
15408
|
RetryButton,
|
|
15303
15409
|
{
|
|
15304
15410
|
type: "submit",
|
|
@@ -15307,7 +15413,7 @@ var ChartOfAccountsForm = ({
|
|
|
15307
15413
|
disabled: sendingForm
|
|
15308
15414
|
},
|
|
15309
15415
|
(stringOverrides == null ? void 0 : stringOverrides.retryButton) || "Retry"
|
|
15310
|
-
), !apiError && /* @__PURE__ */
|
|
15416
|
+
), !apiError && /* @__PURE__ */ React173.createElement(
|
|
15311
15417
|
SubmitButton,
|
|
15312
15418
|
{
|
|
15313
15419
|
type: "submit",
|
|
@@ -15325,17 +15431,17 @@ var ChartOfAccountsSidebar = ({
|
|
|
15325
15431
|
parentRef: _parentRef,
|
|
15326
15432
|
stringOverrides
|
|
15327
15433
|
}) => {
|
|
15328
|
-
return /* @__PURE__ */
|
|
15434
|
+
return /* @__PURE__ */ React174.createElement(ChartOfAccountsForm, { stringOverrides });
|
|
15329
15435
|
};
|
|
15330
15436
|
|
|
15331
15437
|
// src/components/ChartOfAccountsTable/ChartOfAccountsTable.tsx
|
|
15332
|
-
import
|
|
15438
|
+
import React176, { useContext as useContext28, useEffect as useEffect41, useState as useState46 } from "react";
|
|
15333
15439
|
|
|
15334
15440
|
// src/icons/Edit2.tsx
|
|
15335
|
-
import * as
|
|
15441
|
+
import * as React175 from "react";
|
|
15336
15442
|
var Edit2 = (_a) => {
|
|
15337
15443
|
var _b = _a, { size = 18 } = _b, props = __objRest(_b, ["size"]);
|
|
15338
|
-
return /* @__PURE__ */
|
|
15444
|
+
return /* @__PURE__ */ React175.createElement(
|
|
15339
15445
|
"svg",
|
|
15340
15446
|
__spreadProps(__spreadValues({
|
|
15341
15447
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -15345,7 +15451,7 @@ var Edit2 = (_a) => {
|
|
|
15345
15451
|
width: size,
|
|
15346
15452
|
height: size
|
|
15347
15453
|
}),
|
|
15348
|
-
/* @__PURE__ */
|
|
15454
|
+
/* @__PURE__ */ React175.createElement(
|
|
15349
15455
|
"path",
|
|
15350
15456
|
{
|
|
15351
15457
|
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",
|
|
@@ -15368,7 +15474,7 @@ var ChartOfAccountsTable = ({
|
|
|
15368
15474
|
cumulativeIndex,
|
|
15369
15475
|
accountsLength,
|
|
15370
15476
|
templateAccountsEditable = true
|
|
15371
|
-
}) => /* @__PURE__ */
|
|
15477
|
+
}) => /* @__PURE__ */ React176.createElement(TableProvider, null, /* @__PURE__ */ React176.createElement(
|
|
15372
15478
|
ChartOfAccountsTableContent,
|
|
15373
15479
|
{
|
|
15374
15480
|
view,
|
|
@@ -15418,7 +15524,7 @@ var ChartOfAccountsTableContent = ({
|
|
|
15418
15524
|
var _a, _b;
|
|
15419
15525
|
const expandable = !!account.sub_accounts && account.sub_accounts.length > 0;
|
|
15420
15526
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
15421
|
-
return /* @__PURE__ */
|
|
15527
|
+
return /* @__PURE__ */ React176.createElement(React176.Fragment, { key: rowKey + "-" + index }, /* @__PURE__ */ React176.createElement(
|
|
15422
15528
|
TableRow,
|
|
15423
15529
|
{
|
|
15424
15530
|
rowKey: rowKey + "-" + index,
|
|
@@ -15430,7 +15536,7 @@ var ChartOfAccountsTableContent = ({
|
|
|
15430
15536
|
},
|
|
15431
15537
|
depth
|
|
15432
15538
|
},
|
|
15433
|
-
/* @__PURE__ */
|
|
15539
|
+
/* @__PURE__ */ React176.createElement(
|
|
15434
15540
|
TableCell,
|
|
15435
15541
|
{
|
|
15436
15542
|
withExpandIcon: expandable,
|
|
@@ -15441,14 +15547,14 @@ var ChartOfAccountsTableContent = ({
|
|
|
15441
15547
|
},
|
|
15442
15548
|
account.name
|
|
15443
15549
|
),
|
|
15444
|
-
/* @__PURE__ */
|
|
15445
|
-
/* @__PURE__ */
|
|
15446
|
-
/* @__PURE__ */
|
|
15447
|
-
/* @__PURE__ */
|
|
15550
|
+
/* @__PURE__ */ React176.createElement(TableCell, null, (_a = account.account_type) == null ? void 0 : _a.display_name),
|
|
15551
|
+
/* @__PURE__ */ React176.createElement(TableCell, null, (_b = account.account_subtype) == null ? void 0 : _b.display_name),
|
|
15552
|
+
/* @__PURE__ */ React176.createElement(TableCell, { isCurrency: true }, account.balance),
|
|
15553
|
+
/* @__PURE__ */ React176.createElement(TableCell, null, /* @__PURE__ */ React176.createElement("span", { className: "Layer__coa__actions" }, /* @__PURE__ */ React176.createElement(
|
|
15448
15554
|
Button,
|
|
15449
15555
|
{
|
|
15450
15556
|
variant: "secondary" /* secondary */,
|
|
15451
|
-
rightIcon: /* @__PURE__ */
|
|
15557
|
+
rightIcon: /* @__PURE__ */ React176.createElement(Edit2_default, { size: 12 }),
|
|
15452
15558
|
iconOnly: true,
|
|
15453
15559
|
disabled: !templateAccountsEditable && !!account.stable_name,
|
|
15454
15560
|
onClick: (e) => {
|
|
@@ -15470,7 +15576,7 @@ var ChartOfAccountsTableContent = ({
|
|
|
15470
15576
|
);
|
|
15471
15577
|
}));
|
|
15472
15578
|
};
|
|
15473
|
-
return /* @__PURE__ */
|
|
15579
|
+
return /* @__PURE__ */ React176.createElement(Table, null, /* @__PURE__ */ React176.createElement(TableHead, null, /* @__PURE__ */ React176.createElement(TableRow, { isHeadRow: true, rowKey: "charts-of-accounts-head-row" }, /* @__PURE__ */ React176.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.nameColumnHeader) || "Name"), /* @__PURE__ */ React176.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.typeColumnHeader) || "Type"), /* @__PURE__ */ React176.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.subtypeColumnHeader) || "Sub-Type"), /* @__PURE__ */ React176.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.balanceColumnHeader) || "Balance"), /* @__PURE__ */ React176.createElement(TableCell, { isHeaderCell: true }))), /* @__PURE__ */ React176.createElement(TableBody, null, !error && data.accounts.map(
|
|
15474
15580
|
(account, idx) => renderChartOfAccountsDesktopRow(
|
|
15475
15581
|
account,
|
|
15476
15582
|
idx,
|
|
@@ -15496,10 +15602,10 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
15496
15602
|
const [expandAll, setExpandAll] = useState47();
|
|
15497
15603
|
const cumulativeIndex = 0;
|
|
15498
15604
|
const accountsLength = (_a = data == null ? void 0 : data.accounts.length) != null ? _a : 0;
|
|
15499
|
-
return /* @__PURE__ */
|
|
15605
|
+
return /* @__PURE__ */ React177.createElement(
|
|
15500
15606
|
Panel,
|
|
15501
15607
|
{
|
|
15502
|
-
sidebar: /* @__PURE__ */
|
|
15608
|
+
sidebar: /* @__PURE__ */ React177.createElement(
|
|
15503
15609
|
ChartOfAccountsSidebar,
|
|
15504
15610
|
{
|
|
15505
15611
|
parentRef: containerRef,
|
|
@@ -15509,7 +15615,7 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
15509
15615
|
sidebarIsOpen: Boolean(form),
|
|
15510
15616
|
parentRef: containerRef
|
|
15511
15617
|
},
|
|
15512
|
-
/* @__PURE__ */
|
|
15618
|
+
/* @__PURE__ */ React177.createElement(Header2, { className: `Layer__${COMPONENT_NAME5}__header`, asHeader: true, rounded: true }, /* @__PURE__ */ React177.createElement(HeaderRow, null, /* @__PURE__ */ React177.createElement(HeaderCol, null, /* @__PURE__ */ React177.createElement(
|
|
15513
15619
|
Heading,
|
|
15514
15620
|
{
|
|
15515
15621
|
className: `Layer__${COMPONENT_NAME5}__title`,
|
|
@@ -15517,13 +15623,13 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
15517
15623
|
},
|
|
15518
15624
|
(stringOverrides == null ? void 0 : stringOverrides.headerText) || "Chart of Accounts"
|
|
15519
15625
|
)))),
|
|
15520
|
-
/* @__PURE__ */
|
|
15626
|
+
/* @__PURE__ */ React177.createElement(Header2, { className: `Layer__${COMPONENT_NAME5}__header`, sticky: true }, /* @__PURE__ */ React177.createElement(HeaderRow, null, /* @__PURE__ */ React177.createElement(HeaderCol, null, /* @__PURE__ */ React177.createElement(
|
|
15521
15627
|
Heading,
|
|
15522
15628
|
{
|
|
15523
15629
|
size: "secondary" /* secondary */,
|
|
15524
15630
|
className: `Layer__${COMPONENT_NAME5}__subtitle`
|
|
15525
15631
|
},
|
|
15526
|
-
withDateControl || withExpandAllButton ? /* @__PURE__ */
|
|
15632
|
+
withDateControl || withExpandAllButton ? /* @__PURE__ */ React177.createElement("div", { className: "Layer__header__actions-col" }, withDateControl && /* @__PURE__ */ React177.createElement(ChartOfAccountsDatePicker, null), withExpandAllButton && /* @__PURE__ */ React177.createElement(
|
|
15527
15633
|
ExpandCollapseButton,
|
|
15528
15634
|
{
|
|
15529
15635
|
iconOnly: view === "mobile",
|
|
@@ -15534,17 +15640,17 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
15534
15640
|
variant: "secondary" /* secondary */
|
|
15535
15641
|
}
|
|
15536
15642
|
)) : null
|
|
15537
|
-
)), /* @__PURE__ */
|
|
15643
|
+
)), /* @__PURE__ */ React177.createElement(HeaderCol, null, /* @__PURE__ */ React177.createElement(
|
|
15538
15644
|
Button,
|
|
15539
15645
|
{
|
|
15540
15646
|
onClick: () => addAccount(),
|
|
15541
15647
|
disabled: isLoading,
|
|
15542
15648
|
iconOnly: ["mobile", "tablet"].includes(view),
|
|
15543
|
-
leftIcon: ["mobile", "tablet"].includes(view) && /* @__PURE__ */
|
|
15649
|
+
leftIcon: ["mobile", "tablet"].includes(view) && /* @__PURE__ */ React177.createElement(Plus_default, { size: 14 })
|
|
15544
15650
|
},
|
|
15545
15651
|
(stringOverrides == null ? void 0 : stringOverrides.addAccountButtonText) || "Add Account"
|
|
15546
15652
|
)))),
|
|
15547
|
-
data && /* @__PURE__ */
|
|
15653
|
+
data && /* @__PURE__ */ React177.createElement(
|
|
15548
15654
|
ChartOfAccountsTable,
|
|
15549
15655
|
{
|
|
15550
15656
|
view,
|
|
@@ -15557,7 +15663,7 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
15557
15663
|
templateAccountsEditable
|
|
15558
15664
|
}
|
|
15559
15665
|
),
|
|
15560
|
-
error ? /* @__PURE__ */
|
|
15666
|
+
error ? /* @__PURE__ */ React177.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React177.createElement(
|
|
15561
15667
|
DataState,
|
|
15562
15668
|
{
|
|
15563
15669
|
status: "failed" /* failed */,
|
|
@@ -15567,8 +15673,8 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
15567
15673
|
isLoading: isValidating || isLoading
|
|
15568
15674
|
}
|
|
15569
15675
|
)) : null,
|
|
15570
|
-
(!data || isLoading) && !error ? /* @__PURE__ */
|
|
15571
|
-
!isLoading && !error && (data == null ? void 0 : data.accounts.length) === 0 ? /* @__PURE__ */
|
|
15676
|
+
(!data || isLoading) && !error ? /* @__PURE__ */ React177.createElement("div", { className: `Layer__${COMPONENT_NAME5}__loader-container` }, /* @__PURE__ */ React177.createElement(Loader2, null)) : null,
|
|
15677
|
+
!isLoading && !error && (data == null ? void 0 : data.accounts.length) === 0 ? /* @__PURE__ */ React177.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React177.createElement(
|
|
15572
15678
|
DataState,
|
|
15573
15679
|
{
|
|
15574
15680
|
status: "info" /* info */,
|
|
@@ -15582,15 +15688,15 @@ var ChartOfAccountsTableWithPanel = ({
|
|
|
15582
15688
|
};
|
|
15583
15689
|
|
|
15584
15690
|
// src/components/LedgerAccount/LedgerAccountIndex.tsx
|
|
15585
|
-
import
|
|
15691
|
+
import React184, {
|
|
15586
15692
|
useContext as useContext32,
|
|
15587
15693
|
useEffect as useEffect43,
|
|
15588
|
-
useMemo as
|
|
15694
|
+
useMemo as useMemo19,
|
|
15589
15695
|
useState as useState49
|
|
15590
15696
|
} from "react";
|
|
15591
15697
|
|
|
15592
15698
|
// src/components/LedgerAccountEntryDetails/LedgerAccountEntryDetails.tsx
|
|
15593
|
-
import
|
|
15699
|
+
import React182, { useContext as useContext30, useMemo as useMemo18 } from "react";
|
|
15594
15700
|
|
|
15595
15701
|
// src/utils/journal.ts
|
|
15596
15702
|
var getAccountIdentifierPayload = (journalLineItem) => {
|
|
@@ -15614,14 +15720,14 @@ var entryNumber = (entry) => {
|
|
|
15614
15720
|
};
|
|
15615
15721
|
|
|
15616
15722
|
// src/components/Card/Card.tsx
|
|
15617
|
-
import
|
|
15618
|
-
import
|
|
15723
|
+
import React178 from "react";
|
|
15724
|
+
import classNames62 from "classnames";
|
|
15619
15725
|
var Card = ({ children, className }) => {
|
|
15620
|
-
return /* @__PURE__ */
|
|
15726
|
+
return /* @__PURE__ */ React178.createElement("div", { className: classNames62("Layer__card", className) }, children);
|
|
15621
15727
|
};
|
|
15622
15728
|
|
|
15623
15729
|
// src/components/DateTime/DateTime.tsx
|
|
15624
|
-
import
|
|
15730
|
+
import React179 from "react";
|
|
15625
15731
|
import { parseISO as parseISO13, format as formatTime10 } from "date-fns";
|
|
15626
15732
|
var DateTime = ({
|
|
15627
15733
|
value,
|
|
@@ -15632,11 +15738,11 @@ var DateTime = ({
|
|
|
15632
15738
|
onlyTime
|
|
15633
15739
|
}) => {
|
|
15634
15740
|
if (format8) {
|
|
15635
|
-
return /* @__PURE__ */
|
|
15741
|
+
return /* @__PURE__ */ React179.createElement(Text, { className: "Layer__datetime" }, formatTime10(parseISO13(value), format8));
|
|
15636
15742
|
}
|
|
15637
15743
|
const date = formatTime10(parseISO13(value), dateFormat != null ? dateFormat : DATE_FORMAT);
|
|
15638
15744
|
const time = formatTime10(parseISO13(value), timeFormat != null ? timeFormat : TIME_FORMAT);
|
|
15639
|
-
return /* @__PURE__ */
|
|
15745
|
+
return /* @__PURE__ */ React179.createElement(Text, { className: "Layer__datetime" }, !onlyTime && /* @__PURE__ */ React179.createElement(
|
|
15640
15746
|
Text,
|
|
15641
15747
|
{
|
|
15642
15748
|
as: "span",
|
|
@@ -15645,7 +15751,7 @@ var DateTime = ({
|
|
|
15645
15751
|
className: "Layer__datetime__date"
|
|
15646
15752
|
},
|
|
15647
15753
|
date
|
|
15648
|
-
), !onlyDate && /* @__PURE__ */
|
|
15754
|
+
), !onlyDate && /* @__PURE__ */ React179.createElement(
|
|
15649
15755
|
Text,
|
|
15650
15756
|
{
|
|
15651
15757
|
as: "span",
|
|
@@ -15658,8 +15764,8 @@ var DateTime = ({
|
|
|
15658
15764
|
};
|
|
15659
15765
|
|
|
15660
15766
|
// src/components/DetailsList/DetailsList.tsx
|
|
15661
|
-
import
|
|
15662
|
-
import
|
|
15767
|
+
import React180 from "react";
|
|
15768
|
+
import classNames63 from "classnames";
|
|
15663
15769
|
var DetailsList = ({
|
|
15664
15770
|
title,
|
|
15665
15771
|
children,
|
|
@@ -15667,14 +15773,14 @@ var DetailsList = ({
|
|
|
15667
15773
|
titleClassName,
|
|
15668
15774
|
actions
|
|
15669
15775
|
}) => {
|
|
15670
|
-
return /* @__PURE__ */
|
|
15776
|
+
return /* @__PURE__ */ React180.createElement("div", { className: classNames63("Layer__details-list", className) }, title && /* @__PURE__ */ React180.createElement(Header, { className: titleClassName }, /* @__PURE__ */ React180.createElement(Heading, { size: "secondary" /* secondary */ }, title), actions && /* @__PURE__ */ React180.createElement("div", { className: "Layer__details-list__actions" }, actions)), /* @__PURE__ */ React180.createElement("ul", { className: "Layer__details-list__list" }, children));
|
|
15671
15777
|
};
|
|
15672
15778
|
|
|
15673
15779
|
// src/components/DetailsList/DetailsListItem.tsx
|
|
15674
|
-
import
|
|
15780
|
+
import React181 from "react";
|
|
15675
15781
|
var renderValue = (value) => {
|
|
15676
15782
|
if (typeof value === "string") {
|
|
15677
|
-
return /* @__PURE__ */
|
|
15783
|
+
return /* @__PURE__ */ React181.createElement(Text, { weight: "bold" /* bold */, size: "sm" /* sm */ }, value);
|
|
15678
15784
|
}
|
|
15679
15785
|
return value;
|
|
15680
15786
|
};
|
|
@@ -15683,7 +15789,7 @@ var DetailsListItem = ({
|
|
|
15683
15789
|
children,
|
|
15684
15790
|
isLoading
|
|
15685
15791
|
}) => {
|
|
15686
|
-
return /* @__PURE__ */
|
|
15792
|
+
return /* @__PURE__ */ React181.createElement("li", { className: "Layer__details-list-item" }, /* @__PURE__ */ React181.createElement("label", { className: "Layer__details-list-item__label" }, label), /* @__PURE__ */ React181.createElement("span", { className: "Layer__details-list-item__value" }, isLoading ? /* @__PURE__ */ React181.createElement(SkeletonLoader, null) : renderValue(children)));
|
|
15687
15793
|
};
|
|
15688
15794
|
|
|
15689
15795
|
// src/components/LedgerAccountEntryDetails/LedgerAccountEntryDetails.tsx
|
|
@@ -15694,19 +15800,19 @@ var SourceDetailView = ({
|
|
|
15694
15800
|
switch (source.type) {
|
|
15695
15801
|
case "Transaction_Ledger_Entry_Source": {
|
|
15696
15802
|
const transactionSource = source;
|
|
15697
|
-
return /* @__PURE__ */
|
|
15803
|
+
return /* @__PURE__ */ React182.createElement(React182.Fragment, null, /* @__PURE__ */ React182.createElement(
|
|
15698
15804
|
DetailsListItem,
|
|
15699
15805
|
{
|
|
15700
15806
|
label: (stringOverrides == null ? void 0 : stringOverrides.accountNameLabel) || "Account name"
|
|
15701
15807
|
},
|
|
15702
15808
|
transactionSource.account_name
|
|
15703
|
-
), /* @__PURE__ */
|
|
15809
|
+
), /* @__PURE__ */ React182.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.dateLabel) || "Date" }, /* @__PURE__ */ React182.createElement(DateTime, { value: transactionSource.date })), /* @__PURE__ */ React182.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(transactionSource.amount)}`), /* @__PURE__ */ React182.createElement(
|
|
15704
15810
|
DetailsListItem,
|
|
15705
15811
|
{
|
|
15706
15812
|
label: (stringOverrides == null ? void 0 : stringOverrides.directionLabel) || "Direction"
|
|
15707
15813
|
},
|
|
15708
15814
|
transactionSource.direction
|
|
15709
|
-
), /* @__PURE__ */
|
|
15815
|
+
), /* @__PURE__ */ React182.createElement(
|
|
15710
15816
|
DetailsListItem,
|
|
15711
15817
|
{
|
|
15712
15818
|
label: (stringOverrides == null ? void 0 : stringOverrides.counterpartyLabel) || "Counterparty"
|
|
@@ -15716,23 +15822,23 @@ var SourceDetailView = ({
|
|
|
15716
15822
|
}
|
|
15717
15823
|
case "Invoice_Ledger_Entry_Source": {
|
|
15718
15824
|
const invoiceSource = source;
|
|
15719
|
-
return /* @__PURE__ */
|
|
15825
|
+
return /* @__PURE__ */ React182.createElement(React182.Fragment, null, /* @__PURE__ */ React182.createElement(
|
|
15720
15826
|
DetailsListItem,
|
|
15721
15827
|
{
|
|
15722
15828
|
label: (stringOverrides == null ? void 0 : stringOverrides.invoiceNumberLabel) || "Invoice number"
|
|
15723
15829
|
},
|
|
15724
15830
|
invoiceSource.invoice_number
|
|
15725
|
-
), /* @__PURE__ */
|
|
15831
|
+
), /* @__PURE__ */ React182.createElement(
|
|
15726
15832
|
DetailsListItem,
|
|
15727
15833
|
{
|
|
15728
15834
|
label: (stringOverrides == null ? void 0 : stringOverrides.recipientNameLabel) || "Recipient name"
|
|
15729
15835
|
},
|
|
15730
15836
|
invoiceSource.recipient_name
|
|
15731
|
-
), /* @__PURE__ */
|
|
15837
|
+
), /* @__PURE__ */ React182.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.dateLabel) || "Date" }, /* @__PURE__ */ React182.createElement(DateTime, { value: invoiceSource.date })), /* @__PURE__ */ React182.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(invoiceSource.amount)}`));
|
|
15732
15838
|
}
|
|
15733
15839
|
case "Manual_Ledger_Entry_Source": {
|
|
15734
15840
|
const manualSource = source;
|
|
15735
|
-
return /* @__PURE__ */
|
|
15841
|
+
return /* @__PURE__ */ React182.createElement(React182.Fragment, null, /* @__PURE__ */ React182.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.memoLabel) || "Memo" }, manualSource.memo), /* @__PURE__ */ React182.createElement(
|
|
15736
15842
|
DetailsListItem,
|
|
15737
15843
|
{
|
|
15738
15844
|
label: (stringOverrides == null ? void 0 : stringOverrides.createdByLabel) || "Created by"
|
|
@@ -15742,17 +15848,17 @@ var SourceDetailView = ({
|
|
|
15742
15848
|
}
|
|
15743
15849
|
case "Invoice_Payment_Ledger_Entry_Source": {
|
|
15744
15850
|
const invoicePaymentSource = source;
|
|
15745
|
-
return /* @__PURE__ */
|
|
15851
|
+
return /* @__PURE__ */ React182.createElement(React182.Fragment, null, /* @__PURE__ */ React182.createElement(
|
|
15746
15852
|
DetailsListItem,
|
|
15747
15853
|
{
|
|
15748
15854
|
label: (stringOverrides == null ? void 0 : stringOverrides.invoiceNumberLabel) || "Invoice number"
|
|
15749
15855
|
},
|
|
15750
15856
|
invoicePaymentSource.invoice_number
|
|
15751
|
-
), /* @__PURE__ */
|
|
15857
|
+
), /* @__PURE__ */ React182.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(invoicePaymentSource.amount)}`));
|
|
15752
15858
|
}
|
|
15753
15859
|
case "Refund_Ledger_Entry_Source": {
|
|
15754
15860
|
const refundSource = source;
|
|
15755
|
-
return /* @__PURE__ */
|
|
15861
|
+
return /* @__PURE__ */ React182.createElement(React182.Fragment, null, /* @__PURE__ */ React182.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(refundSource.refunded_to_customer_amount)}`), /* @__PURE__ */ React182.createElement(
|
|
15756
15862
|
DetailsListItem,
|
|
15757
15863
|
{
|
|
15758
15864
|
label: (stringOverrides == null ? void 0 : stringOverrides.recipientNameLabel) || "Recipient name"
|
|
@@ -15762,7 +15868,7 @@ var SourceDetailView = ({
|
|
|
15762
15868
|
}
|
|
15763
15869
|
case "Refund_Payment_Ledger_Entry_Source": {
|
|
15764
15870
|
const refundSource = source;
|
|
15765
|
-
return /* @__PURE__ */
|
|
15871
|
+
return /* @__PURE__ */ React182.createElement(React182.Fragment, null, /* @__PURE__ */ React182.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(refundSource.refunded_to_customer_amount)}`), /* @__PURE__ */ React182.createElement(
|
|
15766
15872
|
DetailsListItem,
|
|
15767
15873
|
{
|
|
15768
15874
|
label: (stringOverrides == null ? void 0 : stringOverrides.recipientNameLabel) || "Recipient name"
|
|
@@ -15772,7 +15878,7 @@ var SourceDetailView = ({
|
|
|
15772
15878
|
}
|
|
15773
15879
|
case "Opening_Balance_Ledger_Entry_Source": {
|
|
15774
15880
|
const openingBalanceSource = source;
|
|
15775
|
-
return /* @__PURE__ */
|
|
15881
|
+
return /* @__PURE__ */ React182.createElement(React182.Fragment, null, /* @__PURE__ */ React182.createElement(
|
|
15776
15882
|
DetailsListItem,
|
|
15777
15883
|
{
|
|
15778
15884
|
label: (stringOverrides == null ? void 0 : stringOverrides.accountNameLabel) || "Account name"
|
|
@@ -15782,7 +15888,7 @@ var SourceDetailView = ({
|
|
|
15782
15888
|
}
|
|
15783
15889
|
case "Payout_Ledger_Entry_Source": {
|
|
15784
15890
|
const payoutSource = source;
|
|
15785
|
-
return /* @__PURE__ */
|
|
15891
|
+
return /* @__PURE__ */ React182.createElement(React182.Fragment, null, /* @__PURE__ */ React182.createElement(DetailsListItem, { label: (stringOverrides == null ? void 0 : stringOverrides.amountLabel) || "Amount" }, `$${centsToDollars(payoutSource.paid_out_amount)}`), /* @__PURE__ */ React182.createElement(
|
|
15786
15892
|
DetailsListItem,
|
|
15787
15893
|
{
|
|
15788
15894
|
label: (stringOverrides == null ? void 0 : stringOverrides.processorLabel) || "Processor"
|
|
@@ -15799,7 +15905,7 @@ var LedgerAccountEntryDetails = ({
|
|
|
15799
15905
|
}) => {
|
|
15800
15906
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
15801
15907
|
const { entryData, isLoadingEntry, closeSelectedEntry, errorEntry } = useContext30(LedgerAccountsContext);
|
|
15802
|
-
const { totalDebit, totalCredit } =
|
|
15908
|
+
const { totalDebit, totalCredit } = useMemo18(() => {
|
|
15803
15909
|
var _a2;
|
|
15804
15910
|
let totalDebit2 = 0;
|
|
15805
15911
|
let totalCredit2 = 0;
|
|
@@ -15812,15 +15918,15 @@ var LedgerAccountEntryDetails = ({
|
|
|
15812
15918
|
});
|
|
15813
15919
|
return { totalDebit: totalDebit2, totalCredit: totalCredit2 };
|
|
15814
15920
|
}, [entryData]);
|
|
15815
|
-
return /* @__PURE__ */
|
|
15921
|
+
return /* @__PURE__ */ React182.createElement("div", { className: "Layer__ledger-account__entry-details" }, /* @__PURE__ */ React182.createElement(Header2, { className: "Layer__ledger-account__entry-details__header" }, /* @__PURE__ */ React182.createElement(HeaderRow, null, /* @__PURE__ */ React182.createElement(HeaderCol, { className: "Layer__hidden-lg Layer__hidden-xl" }, /* @__PURE__ */ React182.createElement(BackButton, { onClick: closeSelectedEntry }), /* @__PURE__ */ React182.createElement(Heading, { size: "secondary" /* secondary */ }, (stringOverrides == null ? void 0 : stringOverrides.title) || "Transaction details")), /* @__PURE__ */ React182.createElement(HeaderCol, { className: "Layer__show-lg Layer__show-xl" }, /* @__PURE__ */ React182.createElement(Heading, { size: "secondary" /* secondary */ }, ((_a = stringOverrides == null ? void 0 : stringOverrides.transactionSource) == null ? void 0 : _a.header) || "Transaction source")), /* @__PURE__ */ React182.createElement(HeaderCol, { className: "Layer__show-lg Layer__show-xl" }, /* @__PURE__ */ React182.createElement(CloseButton, { onClick: closeSelectedEntry })))), /* @__PURE__ */ React182.createElement(
|
|
15816
15922
|
DetailsList,
|
|
15817
15923
|
{
|
|
15818
15924
|
title: ((_b = stringOverrides == null ? void 0 : stringOverrides.transactionSource) == null ? void 0 : _b.header) || "Transaction source",
|
|
15819
15925
|
titleClassName: "Layer__hidden-lg Layer__hidden-xl",
|
|
15820
|
-
actions: /* @__PURE__ */
|
|
15926
|
+
actions: /* @__PURE__ */ React182.createElement(
|
|
15821
15927
|
Button,
|
|
15822
15928
|
{
|
|
15823
|
-
rightIcon: /* @__PURE__ */
|
|
15929
|
+
rightIcon: /* @__PURE__ */ React182.createElement(X_default, null),
|
|
15824
15930
|
iconOnly: true,
|
|
15825
15931
|
onClick: closeSelectedEntry,
|
|
15826
15932
|
variant: "secondary" /* secondary */,
|
|
@@ -15828,16 +15934,16 @@ var LedgerAccountEntryDetails = ({
|
|
|
15828
15934
|
}
|
|
15829
15935
|
)
|
|
15830
15936
|
},
|
|
15831
|
-
/* @__PURE__ */
|
|
15937
|
+
/* @__PURE__ */ React182.createElement(
|
|
15832
15938
|
DetailsListItem,
|
|
15833
15939
|
{
|
|
15834
15940
|
label: ((_d = (_c = stringOverrides == null ? void 0 : stringOverrides.transactionSource) == null ? void 0 : _c.details) == null ? void 0 : _d.sourceLabel) || "Source",
|
|
15835
15941
|
isLoading: isLoadingEntry
|
|
15836
15942
|
},
|
|
15837
|
-
/* @__PURE__ */
|
|
15943
|
+
/* @__PURE__ */ React182.createElement(Badge, null, (_e = entryData == null ? void 0 : entryData.source) == null ? void 0 : _e.entity_name)
|
|
15838
15944
|
),
|
|
15839
|
-
((_f = entryData == null ? void 0 : entryData.source) == null ? void 0 : _f.display_description) && /* @__PURE__ */
|
|
15840
|
-
), /* @__PURE__ */
|
|
15945
|
+
((_f = entryData == null ? void 0 : entryData.source) == null ? void 0 : _f.display_description) && /* @__PURE__ */ React182.createElement(SourceDetailView, { source: entryData == null ? void 0 : entryData.source })
|
|
15946
|
+
), /* @__PURE__ */ React182.createElement(
|
|
15841
15947
|
DetailsList,
|
|
15842
15948
|
{
|
|
15843
15949
|
title: ((_g = stringOverrides == null ? void 0 : stringOverrides.journalEntry) == null ? void 0 : _g.header) ? (_h = stringOverrides == null ? void 0 : stringOverrides.journalEntry) == null ? void 0 : _h.header(
|
|
@@ -15845,7 +15951,7 @@ var LedgerAccountEntryDetails = ({
|
|
|
15845
15951
|
) : `Journal Entry ${entryData ? entryNumber(entryData) : ""}`,
|
|
15846
15952
|
className: "Layer__border-top"
|
|
15847
15953
|
},
|
|
15848
|
-
/* @__PURE__ */
|
|
15954
|
+
/* @__PURE__ */ React182.createElement(
|
|
15849
15955
|
DetailsListItem,
|
|
15850
15956
|
{
|
|
15851
15957
|
label: ((_j = (_i = stringOverrides == null ? void 0 : stringOverrides.journalEntry) == null ? void 0 : _i.details) == null ? void 0 : _j.entryTypeLabel) || "Entry type",
|
|
@@ -15853,23 +15959,23 @@ var LedgerAccountEntryDetails = ({
|
|
|
15853
15959
|
},
|
|
15854
15960
|
humanizeEnum((_k = entryData == null ? void 0 : entryData.entry_type) != null ? _k : "")
|
|
15855
15961
|
),
|
|
15856
|
-
/* @__PURE__ */
|
|
15962
|
+
/* @__PURE__ */ React182.createElement(
|
|
15857
15963
|
DetailsListItem,
|
|
15858
15964
|
{
|
|
15859
15965
|
label: ((_m = (_l = stringOverrides == null ? void 0 : stringOverrides.journalEntry) == null ? void 0 : _l.details) == null ? void 0 : _m.dateLabel) || "Date",
|
|
15860
15966
|
isLoading: isLoadingEntry
|
|
15861
15967
|
},
|
|
15862
|
-
(entryData == null ? void 0 : entryData.entry_at) && /* @__PURE__ */
|
|
15968
|
+
(entryData == null ? void 0 : entryData.entry_at) && /* @__PURE__ */ React182.createElement(DateTime, { value: entryData == null ? void 0 : entryData.entry_at })
|
|
15863
15969
|
),
|
|
15864
|
-
/* @__PURE__ */
|
|
15970
|
+
/* @__PURE__ */ React182.createElement(
|
|
15865
15971
|
DetailsListItem,
|
|
15866
15972
|
{
|
|
15867
15973
|
label: ((_o = (_n = stringOverrides == null ? void 0 : stringOverrides.journalEntry) == null ? void 0 : _n.details) == null ? void 0 : _o.creationDateLabel) || "Creation date",
|
|
15868
15974
|
isLoading: isLoadingEntry
|
|
15869
15975
|
},
|
|
15870
|
-
(entryData == null ? void 0 : entryData.date) && /* @__PURE__ */
|
|
15976
|
+
(entryData == null ? void 0 : entryData.date) && /* @__PURE__ */ React182.createElement(DateTime, { value: entryData == null ? void 0 : entryData.date })
|
|
15871
15977
|
),
|
|
15872
|
-
(entryData == null ? void 0 : entryData.reversal_id) && /* @__PURE__ */
|
|
15978
|
+
(entryData == null ? void 0 : entryData.reversal_id) && /* @__PURE__ */ React182.createElement(
|
|
15873
15979
|
DetailsListItem,
|
|
15874
15980
|
{
|
|
15875
15981
|
label: ((_q = (_p = stringOverrides == null ? void 0 : stringOverrides.journalEntry) == null ? void 0 : _p.details) == null ? void 0 : _q.reversalLabel) || "Reversal",
|
|
@@ -15877,41 +15983,41 @@ var LedgerAccountEntryDetails = ({
|
|
|
15877
15983
|
},
|
|
15878
15984
|
entryData == null ? void 0 : entryData.reversal_id.substring(0, 5)
|
|
15879
15985
|
)
|
|
15880
|
-
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */
|
|
15986
|
+
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */ React182.createElement("div", { className: "Layer__ledger-account__entry-details__line-items" }, /* @__PURE__ */ React182.createElement(Card, null, /* @__PURE__ */ React182.createElement(
|
|
15881
15987
|
Table,
|
|
15882
15988
|
{
|
|
15883
15989
|
componentName: "ledger-account__entry-details",
|
|
15884
15990
|
borderCollapse: "collapse"
|
|
15885
15991
|
},
|
|
15886
|
-
/* @__PURE__ */
|
|
15887
|
-
/* @__PURE__ */
|
|
15992
|
+
/* @__PURE__ */ React182.createElement(TableHead, null, /* @__PURE__ */ React182.createElement(TableRow, { rowKey: "soc-flow-head-row", isHeadRow: true }, /* @__PURE__ */ React182.createElement(TableCell, null, ((_r = stringOverrides == null ? void 0 : stringOverrides.lineItemsTable) == null ? void 0 : _r.lineItemsColumnHeader) || "Line items"), /* @__PURE__ */ React182.createElement(TableCell, { align: "right" /* RIGHT */ }, ((_s = stringOverrides == null ? void 0 : stringOverrides.lineItemsTable) == null ? void 0 : _s.debitColumnHeader) || "Debit"), /* @__PURE__ */ React182.createElement(TableCell, { align: "right" /* RIGHT */ }, ((_t = stringOverrides == null ? void 0 : stringOverrides.lineItemsTable) == null ? void 0 : _t.creditColumnHeader) || "Credit"))),
|
|
15993
|
+
/* @__PURE__ */ React182.createElement(TableBody, null, (_u = entryData == null ? void 0 : entryData.line_items) == null ? void 0 : _u.map((item, index) => {
|
|
15888
15994
|
var _a2;
|
|
15889
|
-
return /* @__PURE__ */
|
|
15995
|
+
return /* @__PURE__ */ React182.createElement(
|
|
15890
15996
|
TableRow,
|
|
15891
15997
|
{
|
|
15892
15998
|
key: `ledger-line-item-${index}`,
|
|
15893
15999
|
rowKey: `ledger-line-item-${index}`
|
|
15894
16000
|
},
|
|
15895
|
-
/* @__PURE__ */
|
|
15896
|
-
/* @__PURE__ */
|
|
15897
|
-
/* @__PURE__ */
|
|
16001
|
+
/* @__PURE__ */ React182.createElement(TableCell, null, ((_a2 = item.account) == null ? void 0 : _a2.name) || ""),
|
|
16002
|
+
/* @__PURE__ */ React182.createElement(TableCell, { align: "right" /* RIGHT */ }, item.direction === "DEBIT" /* DEBIT */ && /* @__PURE__ */ React182.createElement(Badge, { variant: "warning" /* WARNING */ }, "$", centsToDollars(item.amount || 0))),
|
|
16003
|
+
/* @__PURE__ */ React182.createElement(TableCell, { align: "right" /* RIGHT */ }, item.direction === "CREDIT" /* CREDIT */ && /* @__PURE__ */ React182.createElement(Badge, { variant: "success" /* SUCCESS */ }, "$", centsToDollars(item.amount || 0)))
|
|
15898
16004
|
);
|
|
15899
|
-
}), /* @__PURE__ */
|
|
16005
|
+
}), /* @__PURE__ */ React182.createElement(
|
|
15900
16006
|
TableRow,
|
|
15901
16007
|
{
|
|
15902
16008
|
rowKey: "ledger-line-item-summation",
|
|
15903
16009
|
variant: "summation"
|
|
15904
16010
|
},
|
|
15905
|
-
/* @__PURE__ */
|
|
15906
|
-
/* @__PURE__ */
|
|
15907
|
-
/* @__PURE__ */
|
|
16011
|
+
/* @__PURE__ */ React182.createElement(TableCell, { primary: true }, ((_v = stringOverrides == null ? void 0 : stringOverrides.lineItemsTable) == null ? void 0 : _v.totalRowHeader) || "Total"),
|
|
16012
|
+
/* @__PURE__ */ React182.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, totalDebit || 0),
|
|
16013
|
+
/* @__PURE__ */ React182.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, totalCredit || 0)
|
|
15908
16014
|
))
|
|
15909
16015
|
))) : null);
|
|
15910
16016
|
};
|
|
15911
16017
|
|
|
15912
16018
|
// src/components/LedgerAccount/LedgerAccountRow.tsx
|
|
15913
|
-
import
|
|
15914
|
-
import
|
|
16019
|
+
import React183, { useContext as useContext31, useEffect as useEffect42, useState as useState48 } from "react";
|
|
16020
|
+
import classNames64 from "classnames";
|
|
15915
16021
|
import { parseISO as parseISO14, format as formatTime11 } from "date-fns";
|
|
15916
16022
|
var LedgerAccountRow = ({
|
|
15917
16023
|
row,
|
|
@@ -15933,10 +16039,10 @@ var LedgerAccountRow = ({
|
|
|
15933
16039
|
}
|
|
15934
16040
|
}, []);
|
|
15935
16041
|
if (view === "tablet") {
|
|
15936
|
-
return /* @__PURE__ */
|
|
16042
|
+
return /* @__PURE__ */ React183.createElement(
|
|
15937
16043
|
"tr",
|
|
15938
16044
|
{
|
|
15939
|
-
className:
|
|
16045
|
+
className: classNames64(
|
|
15940
16046
|
"Layer__table-row",
|
|
15941
16047
|
row.entry_id === selectedEntryId && "Layer__table-row--active",
|
|
15942
16048
|
initialLoad && "initial-load",
|
|
@@ -15952,24 +16058,24 @@ var LedgerAccountRow = ({
|
|
|
15952
16058
|
}
|
|
15953
16059
|
}
|
|
15954
16060
|
},
|
|
15955
|
-
/* @__PURE__ */
|
|
16061
|
+
/* @__PURE__ */ React183.createElement("td", { className: "Layer__table-cell Layer__ledger-account-table__tablet-main-col" }, /* @__PURE__ */ React183.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ React183.createElement("div", { className: "Layer__ledger-account-table__tablet-main-col__date" }, /* @__PURE__ */ React183.createElement(Text, null, row.date && formatTime11(parseISO14(row.date), DATE_FORMAT)), /* @__PURE__ */ React183.createElement(
|
|
15956
16062
|
Text,
|
|
15957
16063
|
{
|
|
15958
16064
|
weight: "normal" /* normal */,
|
|
15959
16065
|
className: "Layer__ledger_account-table__journal-id"
|
|
15960
16066
|
},
|
|
15961
16067
|
entryNumber(row)
|
|
15962
|
-
)), /* @__PURE__ */
|
|
15963
|
-
/* @__PURE__ */
|
|
15964
|
-
/* @__PURE__ */
|
|
15965
|
-
/* @__PURE__ */
|
|
16068
|
+
)), /* @__PURE__ */ React183.createElement(Text, null, (_b = (_a = row.source) == null ? void 0 : _a.display_description) != null ? _b : ""))),
|
|
16069
|
+
/* @__PURE__ */ React183.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React183.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "DEBIT" /* DEBIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)),
|
|
16070
|
+
/* @__PURE__ */ React183.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React183.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "CREDIT" /* CREDIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)),
|
|
16071
|
+
/* @__PURE__ */ React183.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React183.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, `$${centsToDollars(row.running_balance)}`))
|
|
15966
16072
|
);
|
|
15967
16073
|
}
|
|
15968
16074
|
if (view === "mobile") {
|
|
15969
|
-
return /* @__PURE__ */
|
|
16075
|
+
return /* @__PURE__ */ React183.createElement(
|
|
15970
16076
|
"tr",
|
|
15971
16077
|
{
|
|
15972
|
-
className:
|
|
16078
|
+
className: classNames64(
|
|
15973
16079
|
"Layer__table-row",
|
|
15974
16080
|
row.entry_id === selectedEntryId && "Layer__table-row--active",
|
|
15975
16081
|
initialLoad && "initial-load",
|
|
@@ -15985,20 +16091,20 @@ var LedgerAccountRow = ({
|
|
|
15985
16091
|
}
|
|
15986
16092
|
}
|
|
15987
16093
|
},
|
|
15988
|
-
/* @__PURE__ */
|
|
16094
|
+
/* @__PURE__ */ React183.createElement("td", { className: "Layer__table-cell Layer__ledger-account-table__tablet-main-col" }, /* @__PURE__ */ React183.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ React183.createElement("div", { className: "Layer__ledger-account-table__tablet-main-col__date" }, /* @__PURE__ */ React183.createElement(Text, null, row.date && formatTime11(parseISO14(row.date), DATE_FORMAT)), /* @__PURE__ */ React183.createElement(
|
|
15989
16095
|
Text,
|
|
15990
16096
|
{
|
|
15991
16097
|
weight: "normal" /* normal */,
|
|
15992
16098
|
className: "Layer__ledger_account-table__journal-id"
|
|
15993
16099
|
},
|
|
15994
16100
|
entryNumber(row)
|
|
15995
|
-
)), /* @__PURE__ */
|
|
16101
|
+
)), /* @__PURE__ */ React183.createElement(Text, null, (_d = (_c = row.source) == null ? void 0 : _c.display_description) != null ? _d : ""), /* @__PURE__ */ React183.createElement("div", { className: "Layer__ledger_account-table__balances-mobile" }, /* @__PURE__ */ React183.createElement("div", { className: "Layer__ledger_account-table__balance-item" }, /* @__PURE__ */ React183.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__label" }, "Debit"), /* @__PURE__ */ React183.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__value" }, " ", row.direction === "DEBIT" /* DEBIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)), /* @__PURE__ */ React183.createElement("div", { className: "Layer__ledger_account-table__balance-item" }, /* @__PURE__ */ React183.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__label" }, "Credit"), /* @__PURE__ */ React183.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__value" }, row.direction === "CREDIT" /* CREDIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)), /* @__PURE__ */ React183.createElement("div", { className: "Layer__ledger_account-table__balance-item" }, /* @__PURE__ */ React183.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__label" }, "Running balance"), /* @__PURE__ */ React183.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__value" }, `$${centsToDollars(row.running_balance)}`)))))
|
|
15996
16102
|
);
|
|
15997
16103
|
}
|
|
15998
|
-
return /* @__PURE__ */
|
|
16104
|
+
return /* @__PURE__ */ React183.createElement(
|
|
15999
16105
|
"tr",
|
|
16000
16106
|
{
|
|
16001
|
-
className:
|
|
16107
|
+
className: classNames64(
|
|
16002
16108
|
"Layer__table-row",
|
|
16003
16109
|
row.entry_id === selectedEntryId && "Layer__table-row--active",
|
|
16004
16110
|
initialLoad && "initial-load",
|
|
@@ -16014,17 +16120,17 @@ var LedgerAccountRow = ({
|
|
|
16014
16120
|
}
|
|
16015
16121
|
}
|
|
16016
16122
|
},
|
|
16017
|
-
/* @__PURE__ */
|
|
16018
|
-
/* @__PURE__ */
|
|
16019
|
-
/* @__PURE__ */
|
|
16020
|
-
/* @__PURE__ */
|
|
16021
|
-
/* @__PURE__ */
|
|
16022
|
-
/* @__PURE__ */
|
|
16123
|
+
/* @__PURE__ */ React183.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React183.createElement("span", { className: "Layer__table-cell-content" }, row.date && formatTime11(parseISO14(row.date), DATE_FORMAT))),
|
|
16124
|
+
/* @__PURE__ */ React183.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React183.createElement("span", { className: "Layer__table-cell-content" }, entryNumber(row))),
|
|
16125
|
+
/* @__PURE__ */ React183.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React183.createElement("span", { className: "Layer__table-cell-content" }, (_f = (_e = row.source) == null ? void 0 : _e.display_description) != null ? _f : "")),
|
|
16126
|
+
/* @__PURE__ */ React183.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React183.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "DEBIT" /* DEBIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)),
|
|
16127
|
+
/* @__PURE__ */ React183.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React183.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "CREDIT" /* CREDIT */ && `$${centsToDollars((row == null ? void 0 : row.amount) || 0)}`)),
|
|
16128
|
+
/* @__PURE__ */ React183.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React183.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, `$${centsToDollars(row.running_balance)}`))
|
|
16023
16129
|
);
|
|
16024
16130
|
};
|
|
16025
16131
|
|
|
16026
16132
|
// src/components/LedgerAccount/LedgerAccountIndex.tsx
|
|
16027
|
-
import
|
|
16133
|
+
import classNames65 from "classnames";
|
|
16028
16134
|
var LedgerAccount = ({
|
|
16029
16135
|
containerRef,
|
|
16030
16136
|
pageSize = 15,
|
|
@@ -16054,16 +16160,16 @@ var LedgerAccount = ({
|
|
|
16054
16160
|
return () => clearTimeout(timeoutLoad);
|
|
16055
16161
|
}
|
|
16056
16162
|
}, [isLoading]);
|
|
16057
|
-
const baseClassName =
|
|
16163
|
+
const baseClassName = classNames65(
|
|
16058
16164
|
"Layer__ledger-account__index",
|
|
16059
16165
|
accountId && "open"
|
|
16060
16166
|
);
|
|
16061
|
-
const account =
|
|
16167
|
+
const account = useMemo19(() => {
|
|
16062
16168
|
return flattenAccounts((accountData == null ? void 0 : accountData.accounts) || []).find(
|
|
16063
16169
|
(x) => x.id === accountId
|
|
16064
16170
|
);
|
|
16065
16171
|
}, [accountId]);
|
|
16066
|
-
const data =
|
|
16172
|
+
const data = useMemo19(() => {
|
|
16067
16173
|
var _a2;
|
|
16068
16174
|
const firstPageIndex = (currentPage - 1) * pageSize;
|
|
16069
16175
|
const lastPageIndex = firstPageIndex + pageSize;
|
|
@@ -16073,10 +16179,10 @@ var LedgerAccount = ({
|
|
|
16073
16179
|
setAccountId(void 0);
|
|
16074
16180
|
closeSelectedEntry();
|
|
16075
16181
|
};
|
|
16076
|
-
return /* @__PURE__ */
|
|
16182
|
+
return /* @__PURE__ */ React184.createElement(
|
|
16077
16183
|
Panel,
|
|
16078
16184
|
{
|
|
16079
|
-
sidebar: /* @__PURE__ */
|
|
16185
|
+
sidebar: /* @__PURE__ */ React184.createElement(
|
|
16080
16186
|
LedgerAccountEntryDetails,
|
|
16081
16187
|
{
|
|
16082
16188
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.ledgerEntryDetail
|
|
@@ -16086,21 +16192,21 @@ var LedgerAccount = ({
|
|
|
16086
16192
|
parentRef: containerRef,
|
|
16087
16193
|
className: "Layer__ledger-account__panel"
|
|
16088
16194
|
},
|
|
16089
|
-
/* @__PURE__ */
|
|
16195
|
+
/* @__PURE__ */ React184.createElement("div", { className: baseClassName }, /* @__PURE__ */ React184.createElement(Header2, { className: "Layer__ledger-account__header" }, /* @__PURE__ */ React184.createElement(HeaderRow, null, /* @__PURE__ */ React184.createElement(HeaderCol, null, /* @__PURE__ */ React184.createElement(BackButton, { onClick: close }), /* @__PURE__ */ React184.createElement("div", { className: "Layer__ledger-account__title-container" }, /* @__PURE__ */ React184.createElement(
|
|
16090
16196
|
Text,
|
|
16091
16197
|
{
|
|
16092
16198
|
weight: "bold" /* bold */,
|
|
16093
16199
|
className: "Layer__ledger-account__title"
|
|
16094
16200
|
},
|
|
16095
16201
|
(_a = account == null ? void 0 : account.name) != null ? _a : ""
|
|
16096
|
-
), /* @__PURE__ */
|
|
16202
|
+
), /* @__PURE__ */ React184.createElement("div", { className: "Layer__ledger-account__balance-container" }, /* @__PURE__ */ React184.createElement(
|
|
16097
16203
|
Text,
|
|
16098
16204
|
{
|
|
16099
16205
|
className: "Layer__ledger-account__balance-label",
|
|
16100
16206
|
size: "sm" /* sm */
|
|
16101
16207
|
},
|
|
16102
16208
|
"Current balance"
|
|
16103
|
-
), /* @__PURE__ */
|
|
16209
|
+
), /* @__PURE__ */ React184.createElement(
|
|
16104
16210
|
Text,
|
|
16105
16211
|
{
|
|
16106
16212
|
className: "Layer__ledger-account__balance-value",
|
|
@@ -16108,9 +16214,9 @@ var LedgerAccount = ({
|
|
|
16108
16214
|
},
|
|
16109
16215
|
"$",
|
|
16110
16216
|
centsToDollars((account == null ? void 0 : account.balance) || 0)
|
|
16111
|
-
)))))), /* @__PURE__ */
|
|
16217
|
+
)))))), /* @__PURE__ */ React184.createElement("table", { className: "Layer__table Layer__table--hover-effect Layer__ledger-account-table" }, /* @__PURE__ */ React184.createElement("thead", null, /* @__PURE__ */ React184.createElement("tr", null, view !== "desktop" && /* @__PURE__ */ React184.createElement("th", null), view === "desktop" && /* @__PURE__ */ React184.createElement(React184.Fragment, null, /* @__PURE__ */ React184.createElement("th", { className: "Layer__table-header" }, ((_b = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _b.dateColumnHeader) || "Date"), /* @__PURE__ */ React184.createElement("th", { className: "Layer__table-header" }, ((_c = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _c.journalIdColumnHeader) || "Journal id #"), /* @__PURE__ */ React184.createElement("th", { className: "Layer__table-header" }, ((_d = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _d.sourceColumnHeader) || "Source")), view !== "mobile" && /* @__PURE__ */ React184.createElement(React184.Fragment, null, /* @__PURE__ */ React184.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, ((_e = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _e.debitColumnHeader) || "Debit"), /* @__PURE__ */ React184.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, ((_f = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _f.creditColumnHeader) || "Credit"), /* @__PURE__ */ React184.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, ((_g = stringOverrides == null ? void 0 : stringOverrides.ledgerEntriesTable) == null ? void 0 : _g.runningBalanceColumnHeader) || "Running balance")))), /* @__PURE__ */ React184.createElement("tbody", null, (_h = data == null ? void 0 : data.filter(
|
|
16112
16218
|
(entry) => !entry.entry_reversal_of && !entry.entry_reversed_by
|
|
16113
|
-
)) == null ? void 0 : _h.map((x, index) => /* @__PURE__ */
|
|
16219
|
+
)) == null ? void 0 : _h.map((x, index) => /* @__PURE__ */ React184.createElement(
|
|
16114
16220
|
LedgerAccountRow,
|
|
16115
16221
|
{
|
|
16116
16222
|
key: x.id,
|
|
@@ -16119,7 +16225,7 @@ var LedgerAccount = ({
|
|
|
16119
16225
|
initialLoad,
|
|
16120
16226
|
view
|
|
16121
16227
|
}
|
|
16122
|
-
)))), data && /* @__PURE__ */
|
|
16228
|
+
)))), data && /* @__PURE__ */ React184.createElement("div", { className: "Layer__ledger-account__pagination" }, /* @__PURE__ */ React184.createElement(
|
|
16123
16229
|
Pagination,
|
|
16124
16230
|
{
|
|
16125
16231
|
currentPage,
|
|
@@ -16127,7 +16233,7 @@ var LedgerAccount = ({
|
|
|
16127
16233
|
pageSize,
|
|
16128
16234
|
onPageChange: (page) => setCurrentPage(page)
|
|
16129
16235
|
}
|
|
16130
|
-
)), error ? /* @__PURE__ */
|
|
16236
|
+
)), error ? /* @__PURE__ */ React184.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React184.createElement(
|
|
16131
16237
|
DataState,
|
|
16132
16238
|
{
|
|
16133
16239
|
status: "failed" /* failed */,
|
|
@@ -16136,7 +16242,7 @@ var LedgerAccount = ({
|
|
|
16136
16242
|
onRefresh: () => refetch(),
|
|
16137
16243
|
isLoading: isValidating || isLoading
|
|
16138
16244
|
}
|
|
16139
|
-
)) : null, (!data || isLoading) && !error ? /* @__PURE__ */
|
|
16245
|
+
)) : null, (!data || isLoading) && !error ? /* @__PURE__ */ React184.createElement("div", { className: "Layer__ledger-account__loader-container" }, /* @__PURE__ */ React184.createElement(Loader2, null)) : null, !isLoading && !error && (data == null ? void 0 : data.length) === 0 ? /* @__PURE__ */ React184.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React184.createElement(
|
|
16140
16246
|
DataState,
|
|
16141
16247
|
{
|
|
16142
16248
|
status: "info" /* info */,
|
|
@@ -16157,7 +16263,7 @@ var ChartOfAccounts = (props) => {
|
|
|
16157
16263
|
const ledgerAccountsContextData = useLedgerAccounts(
|
|
16158
16264
|
(_a = props.showReversalEntries) != null ? _a : false
|
|
16159
16265
|
);
|
|
16160
|
-
return /* @__PURE__ */
|
|
16266
|
+
return /* @__PURE__ */ React185.createElement(ChartOfAccountsContext.Provider, { value: chartOfAccountsContextData }, /* @__PURE__ */ React185.createElement(LedgerAccountsContext.Provider, { value: ledgerAccountsContextData }, /* @__PURE__ */ React185.createElement(ChartOfAccountsContent, __spreadValues({}, props))));
|
|
16161
16267
|
};
|
|
16162
16268
|
var ChartOfAccountsContent = ({
|
|
16163
16269
|
asWidget,
|
|
@@ -16171,14 +16277,14 @@ var ChartOfAccountsContent = ({
|
|
|
16171
16277
|
const containerRef = useElementViewSize(
|
|
16172
16278
|
(newView) => setView(newView)
|
|
16173
16279
|
);
|
|
16174
|
-
return /* @__PURE__ */
|
|
16280
|
+
return /* @__PURE__ */ React185.createElement(Container, { name: "chart-of-accounts", ref: containerRef, asWidget }, accountId ? /* @__PURE__ */ React185.createElement(
|
|
16175
16281
|
LedgerAccount,
|
|
16176
16282
|
{
|
|
16177
16283
|
view,
|
|
16178
16284
|
containerRef,
|
|
16179
16285
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.ledgerAccount
|
|
16180
16286
|
}
|
|
16181
|
-
) : /* @__PURE__ */
|
|
16287
|
+
) : /* @__PURE__ */ React185.createElement(
|
|
16182
16288
|
ChartOfAccountsTableWithPanel,
|
|
16183
16289
|
{
|
|
16184
16290
|
asWidget,
|
|
@@ -16193,7 +16299,7 @@ var ChartOfAccountsContent = ({
|
|
|
16193
16299
|
};
|
|
16194
16300
|
|
|
16195
16301
|
// src/components/Journal/Journal.tsx
|
|
16196
|
-
import
|
|
16302
|
+
import React192, { useState as useState54 } from "react";
|
|
16197
16303
|
|
|
16198
16304
|
// src/contexts/JournalContext/JournalContext.tsx
|
|
16199
16305
|
import { createContext as createContext15 } from "react";
|
|
@@ -16500,13 +16606,13 @@ var useJournal = () => {
|
|
|
16500
16606
|
};
|
|
16501
16607
|
|
|
16502
16608
|
// src/components/JournalTable/JournalTableWithPanel.tsx
|
|
16503
|
-
import
|
|
16609
|
+
import React191, { useContext as useContext39, useMemo as useMemo21, useState as useState53 } from "react";
|
|
16504
16610
|
|
|
16505
16611
|
// src/components/JournalSidebar/JournalSidebar.tsx
|
|
16506
|
-
import
|
|
16612
|
+
import React189, { useContext as useContext37 } from "react";
|
|
16507
16613
|
|
|
16508
16614
|
// src/components/JournalEntryDetails/JournalEntryDetails.tsx
|
|
16509
|
-
import
|
|
16615
|
+
import React186, { useContext as useContext34, useMemo as useMemo20, useState as useState52 } from "react";
|
|
16510
16616
|
var JournalEntryDetails = () => {
|
|
16511
16617
|
var _a, _b, _c, _d;
|
|
16512
16618
|
const {
|
|
@@ -16520,13 +16626,13 @@ var JournalEntryDetails = () => {
|
|
|
16520
16626
|
} = useContext34(JournalContext);
|
|
16521
16627
|
const [reverseEntryProcessing, setReverseEntryProcessing] = useState52(false);
|
|
16522
16628
|
const [reverseEntryError, setReverseEntryError] = useState52();
|
|
16523
|
-
const entry =
|
|
16629
|
+
const entry = useMemo20(() => {
|
|
16524
16630
|
if (selectedEntryId && data) {
|
|
16525
16631
|
return data.find((x) => x.id === selectedEntryId);
|
|
16526
16632
|
}
|
|
16527
16633
|
return;
|
|
16528
16634
|
}, [data, selectedEntryId]);
|
|
16529
|
-
const sortedLineItems =
|
|
16635
|
+
const sortedLineItems = useMemo20(
|
|
16530
16636
|
() => {
|
|
16531
16637
|
var _a2;
|
|
16532
16638
|
return (_a2 = entry == null ? void 0 : entry.line_items) == null ? void 0 : _a2.sort(
|
|
@@ -16550,15 +16656,15 @@ var JournalEntryDetails = () => {
|
|
|
16550
16656
|
setReverseEntryProcessing(false);
|
|
16551
16657
|
}
|
|
16552
16658
|
});
|
|
16553
|
-
return /* @__PURE__ */
|
|
16659
|
+
return /* @__PURE__ */ React186.createElement("div", { className: "Layer__journal__entry-details" }, /* @__PURE__ */ React186.createElement(Header2, { className: "Layer__journal__entry-details__mobile-header" }, /* @__PURE__ */ React186.createElement(HeaderRow, null, /* @__PURE__ */ React186.createElement(HeaderCol, { className: "Layer__hidden-lg Layer__hidden-xl" }, /* @__PURE__ */ React186.createElement(BackButton, { onClick: closeSelectedEntry }), /* @__PURE__ */ React186.createElement(Heading, { size: "secondary" /* secondary */ }, "Transaction details")), /* @__PURE__ */ React186.createElement(HeaderCol, { className: "Layer__show-lg Layer__show-xl" }, /* @__PURE__ */ React186.createElement(Heading, { size: "secondary" /* secondary */ }, "Transaction source")), /* @__PURE__ */ React186.createElement(HeaderCol, { className: "Layer__show-lg Layer__show-xl" }, /* @__PURE__ */ React186.createElement(CloseButton, { onClick: closeSelectedEntry })))), /* @__PURE__ */ React186.createElement(
|
|
16554
16660
|
DetailsList,
|
|
16555
16661
|
{
|
|
16556
16662
|
title: "Transaction source",
|
|
16557
16663
|
titleClassName: "Layer__hidden-lg Layer__hidden-xl",
|
|
16558
|
-
actions: /* @__PURE__ */
|
|
16664
|
+
actions: /* @__PURE__ */ React186.createElement(
|
|
16559
16665
|
Button,
|
|
16560
16666
|
{
|
|
16561
|
-
rightIcon: /* @__PURE__ */
|
|
16667
|
+
rightIcon: /* @__PURE__ */ React186.createElement(X_default, null),
|
|
16562
16668
|
iconOnly: true,
|
|
16563
16669
|
onClick: closeSelectedEntry,
|
|
16564
16670
|
className: "Layer__details-list__close-btn",
|
|
@@ -16566,32 +16672,32 @@ var JournalEntryDetails = () => {
|
|
|
16566
16672
|
}
|
|
16567
16673
|
)
|
|
16568
16674
|
},
|
|
16569
|
-
/* @__PURE__ */
|
|
16570
|
-
((_b = entry == null ? void 0 : entry.source) == null ? void 0 : _b.display_description) && /* @__PURE__ */
|
|
16571
|
-
), /* @__PURE__ */
|
|
16675
|
+
/* @__PURE__ */ React186.createElement(DetailsListItem, { label: "Source", isLoading: isLoadingEntry }, /* @__PURE__ */ React186.createElement(Badge, null, (_a = entry == null ? void 0 : entry.source) == null ? void 0 : _a.entity_name)),
|
|
16676
|
+
((_b = entry == null ? void 0 : entry.source) == null ? void 0 : _b.display_description) && /* @__PURE__ */ React186.createElement(SourceDetailView, { source: entry == null ? void 0 : entry.source })
|
|
16677
|
+
), /* @__PURE__ */ React186.createElement(
|
|
16572
16678
|
DetailsList,
|
|
16573
16679
|
{
|
|
16574
16680
|
title: `Journal Entry ${entry ? entryNumber(entry) : ""}`,
|
|
16575
16681
|
className: "Layer__border-top"
|
|
16576
16682
|
},
|
|
16577
|
-
/* @__PURE__ */
|
|
16578
|
-
/* @__PURE__ */
|
|
16579
|
-
/* @__PURE__ */
|
|
16580
|
-
(entry == null ? void 0 : entry.reversal_id) && /* @__PURE__ */
|
|
16581
|
-
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */
|
|
16683
|
+
/* @__PURE__ */ React186.createElement(DetailsListItem, { label: "Entry type", isLoading: isLoadingEntry }, humanizeEnum((_c = entry == null ? void 0 : entry.entry_type) != null ? _c : "")),
|
|
16684
|
+
/* @__PURE__ */ React186.createElement(DetailsListItem, { label: "Effective date", isLoading: isLoadingEntry }, (entry == null ? void 0 : entry.entry_at) && /* @__PURE__ */ React186.createElement(DateTime, { value: entry == null ? void 0 : entry.entry_at })),
|
|
16685
|
+
/* @__PURE__ */ React186.createElement(DetailsListItem, { label: "Creation date", isLoading: isLoadingEntry }, (entry == null ? void 0 : entry.date) && /* @__PURE__ */ React186.createElement(DateTime, { value: entry == null ? void 0 : entry.date })),
|
|
16686
|
+
(entry == null ? void 0 : entry.reversal_id) && /* @__PURE__ */ React186.createElement(DetailsListItem, { label: "Reversal", isLoading: isLoadingEntry }, `Journal Entry #${entry == null ? void 0 : entry.reversal_id.substring(0, 5)}`)
|
|
16687
|
+
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */ React186.createElement("div", { className: "Layer__journal__entry-details__line-items" }, /* @__PURE__ */ React186.createElement(Card, null, /* @__PURE__ */ React186.createElement(
|
|
16582
16688
|
Table,
|
|
16583
16689
|
{
|
|
16584
16690
|
componentName: "journal__entry-details",
|
|
16585
16691
|
borderCollapse: "collapse"
|
|
16586
16692
|
},
|
|
16587
|
-
/* @__PURE__ */
|
|
16693
|
+
/* @__PURE__ */ React186.createElement(TableHead, null, /* @__PURE__ */ React186.createElement(TableRow, { rowKey: "soc-flow-head-row", isHeadRow: true }, /* @__PURE__ */ React186.createElement(TableCell, null, "Line items"), /* @__PURE__ */ React186.createElement(
|
|
16588
16694
|
TableCell,
|
|
16589
16695
|
{
|
|
16590
16696
|
className: "Layer__journal__debit-credit-col",
|
|
16591
16697
|
align: "right" /* RIGHT */
|
|
16592
16698
|
},
|
|
16593
16699
|
"Debit"
|
|
16594
|
-
), /* @__PURE__ */
|
|
16700
|
+
), /* @__PURE__ */ React186.createElement(
|
|
16595
16701
|
TableCell,
|
|
16596
16702
|
{
|
|
16597
16703
|
className: "Layer__journal__debit-credit-col",
|
|
@@ -16599,37 +16705,37 @@ var JournalEntryDetails = () => {
|
|
|
16599
16705
|
},
|
|
16600
16706
|
"Credit"
|
|
16601
16707
|
))),
|
|
16602
|
-
/* @__PURE__ */
|
|
16708
|
+
/* @__PURE__ */ React186.createElement(TableBody, null, sortedLineItems == null ? void 0 : sortedLineItems.map((item, index) => /* @__PURE__ */ React186.createElement(
|
|
16603
16709
|
TableRow,
|
|
16604
16710
|
{
|
|
16605
16711
|
key: `ledger-line-item-${index}`,
|
|
16606
16712
|
rowKey: `ledger-line-item-${index}`
|
|
16607
16713
|
},
|
|
16608
|
-
/* @__PURE__ */
|
|
16609
|
-
/* @__PURE__ */
|
|
16714
|
+
/* @__PURE__ */ React186.createElement(TableCell, null, item.account.name),
|
|
16715
|
+
/* @__PURE__ */ React186.createElement(
|
|
16610
16716
|
TableCell,
|
|
16611
16717
|
{
|
|
16612
16718
|
className: "Layer__journal__debit-credit-col",
|
|
16613
16719
|
align: "right" /* RIGHT */
|
|
16614
16720
|
},
|
|
16615
|
-
item.direction === "DEBIT" /* DEBIT */ && /* @__PURE__ */
|
|
16721
|
+
item.direction === "DEBIT" /* DEBIT */ && /* @__PURE__ */ React186.createElement(Badge, { variant: "warning" /* WARNING */ }, "$", centsToDollars(item.amount || 0))
|
|
16616
16722
|
),
|
|
16617
|
-
/* @__PURE__ */
|
|
16723
|
+
/* @__PURE__ */ React186.createElement(
|
|
16618
16724
|
TableCell,
|
|
16619
16725
|
{
|
|
16620
16726
|
className: "Layer__journal__debit-credit-col",
|
|
16621
16727
|
align: "right" /* RIGHT */
|
|
16622
16728
|
},
|
|
16623
|
-
item.direction === "CREDIT" /* CREDIT */ && /* @__PURE__ */
|
|
16729
|
+
item.direction === "CREDIT" /* CREDIT */ && /* @__PURE__ */ React186.createElement(Badge, { variant: "success" /* SUCCESS */ }, "$", centsToDollars(item.amount || 0))
|
|
16624
16730
|
)
|
|
16625
|
-
)), /* @__PURE__ */
|
|
16731
|
+
)), /* @__PURE__ */ React186.createElement(
|
|
16626
16732
|
TableRow,
|
|
16627
16733
|
{
|
|
16628
16734
|
rowKey: "ledger-line-item-summation",
|
|
16629
16735
|
variant: "summation"
|
|
16630
16736
|
},
|
|
16631
|
-
/* @__PURE__ */
|
|
16632
|
-
/* @__PURE__ */
|
|
16737
|
+
/* @__PURE__ */ React186.createElement(TableCell, { primary: true }, "Total"),
|
|
16738
|
+
/* @__PURE__ */ React186.createElement(
|
|
16633
16739
|
TableCell,
|
|
16634
16740
|
{
|
|
16635
16741
|
isCurrency: true,
|
|
@@ -16639,7 +16745,7 @@ var JournalEntryDetails = () => {
|
|
|
16639
16745
|
},
|
|
16640
16746
|
(entry == null ? void 0 : entry.line_items.filter((item) => item.direction === "DEBIT").map((item) => item.amount).reduce((a, b) => a + b, 0)) || 0
|
|
16641
16747
|
),
|
|
16642
|
-
/* @__PURE__ */
|
|
16748
|
+
/* @__PURE__ */ React186.createElement(
|
|
16643
16749
|
TableCell,
|
|
16644
16750
|
{
|
|
16645
16751
|
isCurrency: true,
|
|
@@ -16650,10 +16756,10 @@ var JournalEntryDetails = () => {
|
|
|
16650
16756
|
(entry == null ? void 0 : entry.line_items.filter((item) => item.direction === "CREDIT").map((item) => item.amount).reduce((a, b) => a + b, 0)) || 0
|
|
16651
16757
|
)
|
|
16652
16758
|
))
|
|
16653
|
-
)), /* @__PURE__ */
|
|
16759
|
+
)), /* @__PURE__ */ React186.createElement("div", { className: "Layer__journal__entry-details__reverse-btn-container" }, /* @__PURE__ */ React186.createElement(
|
|
16654
16760
|
Button,
|
|
16655
16761
|
{
|
|
16656
|
-
rightIcon: reverseEntryError ? /* @__PURE__ */
|
|
16762
|
+
rightIcon: reverseEntryError ? /* @__PURE__ */ React186.createElement(AlertCircle_default, { size: 12 }) : /* @__PURE__ */ React186.createElement(RefreshCcw_default, { size: 12 }),
|
|
16657
16763
|
variant: "secondary" /* secondary */,
|
|
16658
16764
|
onClick: reverseEntryProcessing ? () => {
|
|
16659
16765
|
} : onReverseEntry,
|
|
@@ -16666,10 +16772,10 @@ var JournalEntryDetails = () => {
|
|
|
16666
16772
|
};
|
|
16667
16773
|
|
|
16668
16774
|
// src/components/JournalForm/JournalForm.tsx
|
|
16669
|
-
import
|
|
16775
|
+
import React188, { useContext as useContext36 } from "react";
|
|
16670
16776
|
|
|
16671
16777
|
// src/components/JournalForm/JournalFormEntryLines.tsx
|
|
16672
|
-
import
|
|
16778
|
+
import React187, { useContext as useContext35 } from "react";
|
|
16673
16779
|
var JournalFormEntryLines = ({
|
|
16674
16780
|
entrylineItems,
|
|
16675
16781
|
addEntryLine,
|
|
@@ -16681,14 +16787,14 @@ var JournalFormEntryLines = ({
|
|
|
16681
16787
|
const { data: accountsData } = useContext35(ChartOfAccountsContext);
|
|
16682
16788
|
const { form } = useContext35(JournalContext);
|
|
16683
16789
|
const parentOptions = useParentOptions(accountsData);
|
|
16684
|
-
return /* @__PURE__ */
|
|
16685
|
-
return /* @__PURE__ */
|
|
16790
|
+
return /* @__PURE__ */ React187.createElement(React187.Fragment, null, ["DEBIT", "CREDIT"].map((direction, idx) => {
|
|
16791
|
+
return /* @__PURE__ */ React187.createElement(
|
|
16686
16792
|
"div",
|
|
16687
16793
|
{
|
|
16688
16794
|
key: "Layer__journal__form__input-group-" + idx,
|
|
16689
16795
|
className: "Layer__journal__form__input-group Layer__journal__form__input-group__border"
|
|
16690
16796
|
},
|
|
16691
|
-
/* @__PURE__ */
|
|
16797
|
+
/* @__PURE__ */ React187.createElement(
|
|
16692
16798
|
Text,
|
|
16693
16799
|
{
|
|
16694
16800
|
className: "Layer__journal__form__input-group__title",
|
|
@@ -16703,13 +16809,13 @@ var JournalFormEntryLines = ({
|
|
|
16703
16809
|
if (item.direction !== direction) {
|
|
16704
16810
|
return null;
|
|
16705
16811
|
}
|
|
16706
|
-
return /* @__PURE__ */
|
|
16812
|
+
return /* @__PURE__ */ React187.createElement(
|
|
16707
16813
|
"div",
|
|
16708
16814
|
{
|
|
16709
16815
|
className: "Layer__journal__form__input-group__line-item",
|
|
16710
16816
|
key: direction + "-" + idx2
|
|
16711
16817
|
},
|
|
16712
|
-
/* @__PURE__ */
|
|
16818
|
+
/* @__PURE__ */ React187.createElement(InputGroup, { name: direction, label: "Amount", inline: true }, /* @__PURE__ */ React187.createElement(
|
|
16713
16819
|
InputWithBadge,
|
|
16714
16820
|
{
|
|
16715
16821
|
name: direction,
|
|
@@ -16735,14 +16841,14 @@ var JournalFormEntryLines = ({
|
|
|
16735
16841
|
)) == null ? void 0 : _c.message
|
|
16736
16842
|
}
|
|
16737
16843
|
)),
|
|
16738
|
-
/* @__PURE__ */
|
|
16844
|
+
/* @__PURE__ */ React187.createElement(
|
|
16739
16845
|
InputGroup,
|
|
16740
16846
|
{
|
|
16741
16847
|
name: "account-name",
|
|
16742
16848
|
label: "Account name",
|
|
16743
16849
|
inline: true
|
|
16744
16850
|
},
|
|
16745
|
-
/* @__PURE__ */
|
|
16851
|
+
/* @__PURE__ */ React187.createElement(
|
|
16746
16852
|
Select2,
|
|
16747
16853
|
{
|
|
16748
16854
|
options: parentOptions,
|
|
@@ -16766,18 +16872,18 @@ var JournalFormEntryLines = ({
|
|
|
16766
16872
|
)) == null ? void 0 : _f.message
|
|
16767
16873
|
}
|
|
16768
16874
|
),
|
|
16769
|
-
idx2 >= 2 && /* @__PURE__ */
|
|
16875
|
+
idx2 >= 2 && /* @__PURE__ */ React187.createElement(
|
|
16770
16876
|
IconButton,
|
|
16771
16877
|
{
|
|
16772
16878
|
className: "Layer__remove__button",
|
|
16773
16879
|
onClick: () => removeEntryLine(idx2),
|
|
16774
|
-
icon: /* @__PURE__ */
|
|
16880
|
+
icon: /* @__PURE__ */ React187.createElement(Trash_default, null)
|
|
16775
16881
|
}
|
|
16776
16882
|
)
|
|
16777
16883
|
)
|
|
16778
16884
|
);
|
|
16779
16885
|
}),
|
|
16780
|
-
(config.form.addEntryLinesLimit === void 0 || config.form.addEntryLinesLimit > (entrylineItems == null ? void 0 : entrylineItems.length)) && /* @__PURE__ */
|
|
16886
|
+
(config.form.addEntryLinesLimit === void 0 || config.form.addEntryLinesLimit > (entrylineItems == null ? void 0 : entrylineItems.length)) && /* @__PURE__ */ React187.createElement(
|
|
16781
16887
|
TextButton,
|
|
16782
16888
|
{
|
|
16783
16889
|
className: "Layer__journal__add-entry-line",
|
|
@@ -16805,7 +16911,7 @@ var JournalForm = ({
|
|
|
16805
16911
|
addEntryLine,
|
|
16806
16912
|
removeEntryLine
|
|
16807
16913
|
} = useContext36(JournalContext);
|
|
16808
|
-
return /* @__PURE__ */
|
|
16914
|
+
return /* @__PURE__ */ React188.createElement(
|
|
16809
16915
|
"form",
|
|
16810
16916
|
{
|
|
16811
16917
|
className: "Layer__form",
|
|
@@ -16814,7 +16920,7 @@ var JournalForm = ({
|
|
|
16814
16920
|
submitForm();
|
|
16815
16921
|
}
|
|
16816
16922
|
},
|
|
16817
|
-
/* @__PURE__ */
|
|
16923
|
+
/* @__PURE__ */ React188.createElement(Header2, { className: "Layer__journal__sidebar__header" }, /* @__PURE__ */ React188.createElement(HeaderRow, null, /* @__PURE__ */ React188.createElement(HeaderCol, null, /* @__PURE__ */ React188.createElement(Heading, { size: "secondary" /* secondary */, className: "title" }, (_a = stringOverrides == null ? void 0 : stringOverrides.header) != null ? _a : "Add New Entry")), /* @__PURE__ */ React188.createElement(HeaderCol, { className: "actions" }, /* @__PURE__ */ React188.createElement(
|
|
16818
16924
|
Button,
|
|
16819
16925
|
{
|
|
16820
16926
|
type: "button",
|
|
@@ -16823,7 +16929,7 @@ var JournalForm = ({
|
|
|
16823
16929
|
disabled: sendingForm
|
|
16824
16930
|
},
|
|
16825
16931
|
(stringOverrides == null ? void 0 : stringOverrides.cancelButton) || "Cancel"
|
|
16826
|
-
), apiError && /* @__PURE__ */
|
|
16932
|
+
), apiError && /* @__PURE__ */ React188.createElement(
|
|
16827
16933
|
RetryButton,
|
|
16828
16934
|
{
|
|
16829
16935
|
type: "submit",
|
|
@@ -16832,7 +16938,7 @@ var JournalForm = ({
|
|
|
16832
16938
|
disabled: sendingForm
|
|
16833
16939
|
},
|
|
16834
16940
|
(stringOverrides == null ? void 0 : stringOverrides.retryButton) || "Retry"
|
|
16835
|
-
), !apiError && /* @__PURE__ */
|
|
16941
|
+
), !apiError && /* @__PURE__ */ React188.createElement(
|
|
16836
16942
|
SubmitButton,
|
|
16837
16943
|
{
|
|
16838
16944
|
type: "submit",
|
|
@@ -16842,7 +16948,7 @@ var JournalForm = ({
|
|
|
16842
16948
|
},
|
|
16843
16949
|
(stringOverrides == null ? void 0 : stringOverrides.saveButton) || "Save"
|
|
16844
16950
|
)))),
|
|
16845
|
-
apiError && /* @__PURE__ */
|
|
16951
|
+
apiError && /* @__PURE__ */ React188.createElement(
|
|
16846
16952
|
Text,
|
|
16847
16953
|
{
|
|
16848
16954
|
size: "sm" /* sm */,
|
|
@@ -16850,7 +16956,7 @@ var JournalForm = ({
|
|
|
16850
16956
|
},
|
|
16851
16957
|
apiError
|
|
16852
16958
|
),
|
|
16853
|
-
/* @__PURE__ */
|
|
16959
|
+
/* @__PURE__ */ React188.createElement("div", { className: "Layer__journal__form__input-group" }, /* @__PURE__ */ React188.createElement(InputGroup, { name: "date", label: "Effective Date", inline: true }, /* @__PURE__ */ React188.createElement("div", { className: "Layer__journal__datepicker__wrapper" }, /* @__PURE__ */ React188.createElement(
|
|
16854
16960
|
DatePicker,
|
|
16855
16961
|
{
|
|
16856
16962
|
selected: (form == null ? void 0 : form.data.entry_at) ? new Date(form == null ? void 0 : form.data.entry_at) : /* @__PURE__ */ new Date(),
|
|
@@ -16863,7 +16969,7 @@ var JournalForm = ({
|
|
|
16863
16969
|
placeholderText: "Select date",
|
|
16864
16970
|
currentDateOption: false
|
|
16865
16971
|
}
|
|
16866
|
-
), /* @__PURE__ */
|
|
16972
|
+
), /* @__PURE__ */ React188.createElement(
|
|
16867
16973
|
DatePicker,
|
|
16868
16974
|
{
|
|
16869
16975
|
selected: (form == null ? void 0 : form.data.entry_at) ? new Date(form == null ? void 0 : form.data.entry_at) : /* @__PURE__ */ new Date(),
|
|
@@ -16877,7 +16983,7 @@ var JournalForm = ({
|
|
|
16877
16983
|
currentDateOption: false
|
|
16878
16984
|
}
|
|
16879
16985
|
)))),
|
|
16880
|
-
/* @__PURE__ */
|
|
16986
|
+
/* @__PURE__ */ React188.createElement(
|
|
16881
16987
|
JournalFormEntryLines,
|
|
16882
16988
|
{
|
|
16883
16989
|
entrylineItems: (form == null ? void 0 : form.data.line_items) || [],
|
|
@@ -16888,7 +16994,7 @@ var JournalForm = ({
|
|
|
16888
16994
|
config
|
|
16889
16995
|
}
|
|
16890
16996
|
),
|
|
16891
|
-
/* @__PURE__ */
|
|
16997
|
+
/* @__PURE__ */ React188.createElement("div", { className: "Layer__journal__form__input-group Layer__journal__form__input-group__textarea" }, /* @__PURE__ */ React188.createElement(InputGroup, { name: "memo", label: "Notes" }, /* @__PURE__ */ React188.createElement(
|
|
16892
16998
|
Textarea,
|
|
16893
16999
|
{
|
|
16894
17000
|
name: "memo",
|
|
@@ -16898,7 +17004,7 @@ var JournalForm = ({
|
|
|
16898
17004
|
disabled: sendingForm
|
|
16899
17005
|
}
|
|
16900
17006
|
))),
|
|
16901
|
-
/* @__PURE__ */
|
|
17007
|
+
/* @__PURE__ */ React188.createElement("div", { className: "Layer__journal__bottom-actions" }, /* @__PURE__ */ React188.createElement(
|
|
16902
17008
|
Button,
|
|
16903
17009
|
{
|
|
16904
17010
|
type: "button",
|
|
@@ -16907,7 +17013,7 @@ var JournalForm = ({
|
|
|
16907
17013
|
disabled: sendingForm
|
|
16908
17014
|
},
|
|
16909
17015
|
(stringOverrides == null ? void 0 : stringOverrides.cancelButton) || "Cancel"
|
|
16910
|
-
), apiError && /* @__PURE__ */
|
|
17016
|
+
), apiError && /* @__PURE__ */ React188.createElement(
|
|
16911
17017
|
RetryButton,
|
|
16912
17018
|
{
|
|
16913
17019
|
type: "submit",
|
|
@@ -16916,7 +17022,7 @@ var JournalForm = ({
|
|
|
16916
17022
|
disabled: sendingForm
|
|
16917
17023
|
},
|
|
16918
17024
|
(stringOverrides == null ? void 0 : stringOverrides.retryButton) || "Retry"
|
|
16919
|
-
), !apiError && /* @__PURE__ */
|
|
17025
|
+
), !apiError && /* @__PURE__ */ React188.createElement(
|
|
16920
17026
|
SubmitButton,
|
|
16921
17027
|
{
|
|
16922
17028
|
type: "submit",
|
|
@@ -16937,13 +17043,13 @@ var JournalSidebar = ({
|
|
|
16937
17043
|
}) => {
|
|
16938
17044
|
const { selectedEntryId } = useContext37(JournalContext);
|
|
16939
17045
|
if (selectedEntryId !== "new") {
|
|
16940
|
-
return /* @__PURE__ */
|
|
17046
|
+
return /* @__PURE__ */ React189.createElement(JournalEntryDetails, null);
|
|
16941
17047
|
}
|
|
16942
|
-
return /* @__PURE__ */
|
|
17048
|
+
return /* @__PURE__ */ React189.createElement(JournalForm, { config, stringOverrides });
|
|
16943
17049
|
};
|
|
16944
17050
|
|
|
16945
17051
|
// src/components/JournalTable/JournalTable.tsx
|
|
16946
|
-
import
|
|
17052
|
+
import React190, { useContext as useContext38, useEffect as useEffect45 } from "react";
|
|
16947
17053
|
import { parseISO as parseISO15, format as formatTime12 } from "date-fns";
|
|
16948
17054
|
var accountName = (row) => {
|
|
16949
17055
|
if ("account" in row) {
|
|
@@ -16958,7 +17064,7 @@ var JournalTable = ({
|
|
|
16958
17064
|
view,
|
|
16959
17065
|
data,
|
|
16960
17066
|
stringOverrides
|
|
16961
|
-
}) => /* @__PURE__ */
|
|
17067
|
+
}) => /* @__PURE__ */ React190.createElement(TableProvider, null, /* @__PURE__ */ React190.createElement(
|
|
16962
17068
|
JournalTableContent,
|
|
16963
17069
|
{
|
|
16964
17070
|
view,
|
|
@@ -16980,7 +17086,7 @@ var JournalTableContent = ({
|
|
|
16980
17086
|
const renderJournalRow = (row, index, rowKey, depth) => {
|
|
16981
17087
|
const expandable = !!row.line_items && row.line_items.length > 0;
|
|
16982
17088
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
16983
|
-
return /* @__PURE__ */
|
|
17089
|
+
return /* @__PURE__ */ React190.createElement(React190.Fragment, { key: rowKey + "-" + index }, /* @__PURE__ */ React190.createElement(
|
|
16984
17090
|
TableRow,
|
|
16985
17091
|
{
|
|
16986
17092
|
rowKey: rowKey + "-" + index,
|
|
@@ -16998,7 +17104,7 @@ var JournalTableContent = ({
|
|
|
16998
17104
|
},
|
|
16999
17105
|
depth
|
|
17000
17106
|
},
|
|
17001
|
-
/* @__PURE__ */
|
|
17107
|
+
/* @__PURE__ */ React190.createElement(
|
|
17002
17108
|
TableCell,
|
|
17003
17109
|
{
|
|
17004
17110
|
withExpandIcon: expandable,
|
|
@@ -17009,16 +17115,16 @@ var JournalTableContent = ({
|
|
|
17009
17115
|
},
|
|
17010
17116
|
entryNumber(row)
|
|
17011
17117
|
),
|
|
17012
|
-
/* @__PURE__ */
|
|
17013
|
-
/* @__PURE__ */
|
|
17014
|
-
/* @__PURE__ */
|
|
17015
|
-
/* @__PURE__ */
|
|
17118
|
+
/* @__PURE__ */ React190.createElement(TableCell, null, row.entry_at && formatTime12(parseISO15(row.entry_at), DATE_FORMAT)),
|
|
17119
|
+
/* @__PURE__ */ React190.createElement(TableCell, null, humanizeEnum(row.entry_type)),
|
|
17120
|
+
/* @__PURE__ */ React190.createElement(TableCell, null, "(", row.line_items.length, ")"),
|
|
17121
|
+
/* @__PURE__ */ React190.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, "line_items" in row && Math.abs(
|
|
17016
17122
|
row.line_items.filter((item) => item.direction === "DEBIT").map((item) => item.amount).reduce((a, b) => a + b, 0)
|
|
17017
17123
|
)),
|
|
17018
|
-
/* @__PURE__ */
|
|
17124
|
+
/* @__PURE__ */ React190.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, "line_items" in row && Math.abs(
|
|
17019
17125
|
row.line_items.filter((item) => item.direction === "CREDIT").map((item) => item.amount).reduce((a, b) => a + b, 0)
|
|
17020
17126
|
))
|
|
17021
|
-
), expandable && expanded && row.line_items.map((subItem, subIdx) => /* @__PURE__ */
|
|
17127
|
+
), expandable && expanded && row.line_items.map((subItem, subIdx) => /* @__PURE__ */ React190.createElement(
|
|
17022
17128
|
TableRow,
|
|
17023
17129
|
{
|
|
17024
17130
|
key: rowKey + "-" + index + "-" + subIdx,
|
|
@@ -17026,15 +17132,15 @@ var JournalTableContent = ({
|
|
|
17026
17132
|
depth: depth + 1,
|
|
17027
17133
|
selected: selectedEntryId === row.id
|
|
17028
17134
|
},
|
|
17029
|
-
/* @__PURE__ */
|
|
17030
|
-
/* @__PURE__ */
|
|
17031
|
-
/* @__PURE__ */
|
|
17032
|
-
/* @__PURE__ */
|
|
17033
|
-
subItem.direction === "DEBIT" && subItem.amount >= 0 ? /* @__PURE__ */
|
|
17034
|
-
subItem.direction === "CREDIT" && subItem.amount >= 0 ? /* @__PURE__ */
|
|
17135
|
+
/* @__PURE__ */ React190.createElement(TableCell, null),
|
|
17136
|
+
/* @__PURE__ */ React190.createElement(TableCell, null),
|
|
17137
|
+
/* @__PURE__ */ React190.createElement(TableCell, null),
|
|
17138
|
+
/* @__PURE__ */ React190.createElement(TableCell, null, accountName(subItem)),
|
|
17139
|
+
subItem.direction === "DEBIT" && subItem.amount >= 0 ? /* @__PURE__ */ React190.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, subItem.amount) : /* @__PURE__ */ React190.createElement(TableCell, null),
|
|
17140
|
+
subItem.direction === "CREDIT" && subItem.amount >= 0 ? /* @__PURE__ */ React190.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, subItem.amount) : /* @__PURE__ */ React190.createElement(TableCell, null)
|
|
17035
17141
|
)));
|
|
17036
17142
|
};
|
|
17037
|
-
return /* @__PURE__ */
|
|
17143
|
+
return /* @__PURE__ */ React190.createElement(Table, { borderCollapse: "collapse" }, /* @__PURE__ */ React190.createElement(TableHead, null, /* @__PURE__ */ React190.createElement(TableRow, { isHeadRow: true, rowKey: "journal-head-row" }, /* @__PURE__ */ React190.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.idColumnHeader) || "Id"), /* @__PURE__ */ React190.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.dateColumnHeader) || "Date"), /* @__PURE__ */ React190.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.transactionColumnHeader) || "Transaction"), /* @__PURE__ */ React190.createElement(TableCell, { isHeaderCell: true }, (stringOverrides == null ? void 0 : stringOverrides.accountColumnHeader) || "Account Name"), /* @__PURE__ */ React190.createElement(TableCell, { isHeaderCell: true, align: "right" /* RIGHT */ }, (stringOverrides == null ? void 0 : stringOverrides.debitColumnHeader) || "Debit"), /* @__PURE__ */ React190.createElement(TableCell, { isHeaderCell: true, align: "right" /* RIGHT */ }, (stringOverrides == null ? void 0 : stringOverrides.creditColumnHeader) || "Credit"))), /* @__PURE__ */ React190.createElement(TableBody, null, data.map(
|
|
17038
17144
|
(entry, idx) => renderJournalRow(entry, idx, `journal-row-${entry.id}`, 0)
|
|
17039
17145
|
)));
|
|
17040
17146
|
};
|
|
@@ -17058,16 +17164,16 @@ var JournalTableWithPanel = ({
|
|
|
17058
17164
|
selectedEntryId,
|
|
17059
17165
|
addEntry
|
|
17060
17166
|
} = useContext39(JournalContext);
|
|
17061
|
-
const data =
|
|
17167
|
+
const data = useMemo21(() => {
|
|
17062
17168
|
var _a;
|
|
17063
17169
|
const firstPageIndex = (currentPage - 1) * pageSize;
|
|
17064
17170
|
const lastPageIndex = firstPageIndex + pageSize;
|
|
17065
17171
|
return (_a = rawData == null ? void 0 : rawData.sort((a, b) => Date.parse(b.entry_at) - Date.parse(a.entry_at))) == null ? void 0 : _a.slice(firstPageIndex, lastPageIndex);
|
|
17066
17172
|
}, [rawData, currentPage]);
|
|
17067
|
-
return /* @__PURE__ */
|
|
17173
|
+
return /* @__PURE__ */ React191.createElement(
|
|
17068
17174
|
Panel,
|
|
17069
17175
|
{
|
|
17070
|
-
sidebar: /* @__PURE__ */
|
|
17176
|
+
sidebar: /* @__PURE__ */ React191.createElement(
|
|
17071
17177
|
JournalSidebar,
|
|
17072
17178
|
{
|
|
17073
17179
|
parentRef: containerRef,
|
|
@@ -17078,7 +17184,7 @@ var JournalTableWithPanel = ({
|
|
|
17078
17184
|
sidebarIsOpen: Boolean(selectedEntryId),
|
|
17079
17185
|
parentRef: containerRef
|
|
17080
17186
|
},
|
|
17081
|
-
/* @__PURE__ */
|
|
17187
|
+
/* @__PURE__ */ React191.createElement(
|
|
17082
17188
|
Header2,
|
|
17083
17189
|
{
|
|
17084
17190
|
className: `Layer__${COMPONENT_NAME6}__header`,
|
|
@@ -17086,7 +17192,7 @@ var JournalTableWithPanel = ({
|
|
|
17086
17192
|
sticky: true,
|
|
17087
17193
|
rounded: true
|
|
17088
17194
|
},
|
|
17089
|
-
/* @__PURE__ */
|
|
17195
|
+
/* @__PURE__ */ React191.createElement(HeaderRow, null, /* @__PURE__ */ React191.createElement(HeaderCol, null, /* @__PURE__ */ React191.createElement(
|
|
17090
17196
|
Heading,
|
|
17091
17197
|
{
|
|
17092
17198
|
className: `Layer__${COMPONENT_NAME6}__title`,
|
|
@@ -17095,25 +17201,25 @@ var JournalTableWithPanel = ({
|
|
|
17095
17201
|
(stringOverrides == null ? void 0 : stringOverrides.componentTitle) || "Journal"
|
|
17096
17202
|
)))
|
|
17097
17203
|
),
|
|
17098
|
-
/* @__PURE__ */
|
|
17204
|
+
/* @__PURE__ */ React191.createElement(Header2, null, /* @__PURE__ */ React191.createElement(HeaderRow, null, /* @__PURE__ */ React191.createElement(HeaderCol, null, /* @__PURE__ */ React191.createElement(
|
|
17099
17205
|
Heading,
|
|
17100
17206
|
{
|
|
17101
17207
|
size: "secondary" /* secondary */,
|
|
17102
17208
|
className: `Layer__${COMPONENT_NAME6}__subtitle`
|
|
17103
17209
|
},
|
|
17104
17210
|
(stringOverrides == null ? void 0 : stringOverrides.componentSubtitle) || "Entries"
|
|
17105
|
-
)), /* @__PURE__ */
|
|
17211
|
+
)), /* @__PURE__ */ React191.createElement(HeaderCol, null, /* @__PURE__ */ React191.createElement(
|
|
17106
17212
|
Button,
|
|
17107
17213
|
{
|
|
17108
17214
|
onClick: () => addEntry(),
|
|
17109
17215
|
disabled: isLoading,
|
|
17110
17216
|
iconOnly: view === "mobile",
|
|
17111
|
-
leftIcon: view === "mobile" && /* @__PURE__ */
|
|
17217
|
+
leftIcon: view === "mobile" && /* @__PURE__ */ React191.createElement(PlusIcon_default, { size: 14 })
|
|
17112
17218
|
},
|
|
17113
17219
|
(stringOverrides == null ? void 0 : stringOverrides.addEntryButton) || "Add Entry"
|
|
17114
17220
|
)))),
|
|
17115
|
-
data && /* @__PURE__ */
|
|
17116
|
-
data && /* @__PURE__ */
|
|
17221
|
+
data && /* @__PURE__ */ React191.createElement(JournalTable, { view: "desktop", data }),
|
|
17222
|
+
data && /* @__PURE__ */ React191.createElement("div", { className: "Layer__journal__pagination" }, /* @__PURE__ */ React191.createElement(
|
|
17117
17223
|
Pagination,
|
|
17118
17224
|
{
|
|
17119
17225
|
currentPage,
|
|
@@ -17122,7 +17228,7 @@ var JournalTableWithPanel = ({
|
|
|
17122
17228
|
onPageChange: (page) => setCurrentPage(page)
|
|
17123
17229
|
}
|
|
17124
17230
|
)),
|
|
17125
|
-
(data == null ? void 0 : data.length) === 0 && !isLoading && !error && /* @__PURE__ */
|
|
17231
|
+
(data == null ? void 0 : data.length) === 0 && !isLoading && !error && /* @__PURE__ */ React191.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React191.createElement(
|
|
17126
17232
|
DataState,
|
|
17127
17233
|
{
|
|
17128
17234
|
status: "allDone" /* allDone */,
|
|
@@ -17130,7 +17236,7 @@ var JournalTableWithPanel = ({
|
|
|
17130
17236
|
description: "There are no entries in the journal."
|
|
17131
17237
|
}
|
|
17132
17238
|
)),
|
|
17133
|
-
error ? /* @__PURE__ */
|
|
17239
|
+
error ? /* @__PURE__ */ React191.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React191.createElement(
|
|
17134
17240
|
DataState,
|
|
17135
17241
|
{
|
|
17136
17242
|
status: "failed" /* failed */,
|
|
@@ -17140,7 +17246,7 @@ var JournalTableWithPanel = ({
|
|
|
17140
17246
|
isLoading: isValidating || isLoading
|
|
17141
17247
|
}
|
|
17142
17248
|
)) : null,
|
|
17143
|
-
(!data || isLoading) && !error ? /* @__PURE__ */
|
|
17249
|
+
(!data || isLoading) && !error ? /* @__PURE__ */ React191.createElement("div", { className: `Layer__${COMPONENT_NAME6}__loader-container` }, /* @__PURE__ */ React191.createElement(Loader2, null)) : null
|
|
17144
17250
|
);
|
|
17145
17251
|
};
|
|
17146
17252
|
|
|
@@ -17153,7 +17259,7 @@ var JOURNAL_CONFIG = {
|
|
|
17153
17259
|
var Journal = (props) => {
|
|
17154
17260
|
const JournalContextData = useJournal();
|
|
17155
17261
|
const AccountsContextData = useChartOfAccounts();
|
|
17156
|
-
return /* @__PURE__ */
|
|
17262
|
+
return /* @__PURE__ */ React192.createElement(ChartOfAccountsContext.Provider, { value: AccountsContextData }, /* @__PURE__ */ React192.createElement(JournalContext.Provider, { value: JournalContextData }, /* @__PURE__ */ React192.createElement(JournalContent, __spreadValues({}, props))));
|
|
17157
17263
|
};
|
|
17158
17264
|
var JournalContent = ({
|
|
17159
17265
|
asWidget,
|
|
@@ -17164,7 +17270,7 @@ var JournalContent = ({
|
|
|
17164
17270
|
const containerRef = useElementViewSize(
|
|
17165
17271
|
(newView) => setView(newView)
|
|
17166
17272
|
);
|
|
17167
|
-
return /* @__PURE__ */
|
|
17273
|
+
return /* @__PURE__ */ React192.createElement(Container, { name: "journal", ref: containerRef, asWidget }, /* @__PURE__ */ React192.createElement(
|
|
17168
17274
|
JournalTableWithPanel,
|
|
17169
17275
|
{
|
|
17170
17276
|
view,
|
|
@@ -17176,11 +17282,11 @@ var JournalContent = ({
|
|
|
17176
17282
|
};
|
|
17177
17283
|
|
|
17178
17284
|
// src/components/Tasks/Tasks.tsx
|
|
17179
|
-
import
|
|
17285
|
+
import React199, {
|
|
17180
17286
|
createContext as createContext17,
|
|
17181
17287
|
useContext as useContext44,
|
|
17182
17288
|
useEffect as useEffect48,
|
|
17183
|
-
useMemo as
|
|
17289
|
+
useMemo as useMemo23,
|
|
17184
17290
|
useState as useState58
|
|
17185
17291
|
} from "react";
|
|
17186
17292
|
|
|
@@ -17311,13 +17417,13 @@ function isComplete(taskType) {
|
|
|
17311
17417
|
}
|
|
17312
17418
|
|
|
17313
17419
|
// src/components/TasksHeader/TasksHeader.tsx
|
|
17314
|
-
import
|
|
17420
|
+
import React194, { useContext as useContext40 } from "react";
|
|
17315
17421
|
|
|
17316
17422
|
// src/icons/ProgressIcon.tsx
|
|
17317
|
-
import * as
|
|
17423
|
+
import * as React193 from "react";
|
|
17318
17424
|
var ProgressIcon = (_a) => {
|
|
17319
17425
|
var _b = _a, { size = 12 } = _b, props = __objRest(_b, ["size"]);
|
|
17320
|
-
return /* @__PURE__ */
|
|
17426
|
+
return /* @__PURE__ */ React193.createElement(
|
|
17321
17427
|
"svg",
|
|
17322
17428
|
__spreadProps(__spreadValues({
|
|
17323
17429
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -17327,7 +17433,7 @@ var ProgressIcon = (_a) => {
|
|
|
17327
17433
|
width: size,
|
|
17328
17434
|
height: size
|
|
17329
17435
|
}),
|
|
17330
|
-
/* @__PURE__ */
|
|
17436
|
+
/* @__PURE__ */ React193.createElement(
|
|
17331
17437
|
"path",
|
|
17332
17438
|
{
|
|
17333
17439
|
d: "M9 1.5V4.5",
|
|
@@ -17336,7 +17442,7 @@ var ProgressIcon = (_a) => {
|
|
|
17336
17442
|
strokeLinejoin: "round"
|
|
17337
17443
|
}
|
|
17338
17444
|
),
|
|
17339
|
-
/* @__PURE__ */
|
|
17445
|
+
/* @__PURE__ */ React193.createElement(
|
|
17340
17446
|
"path",
|
|
17341
17447
|
{
|
|
17342
17448
|
d: "M9 13.5V16.5",
|
|
@@ -17345,7 +17451,7 @@ var ProgressIcon = (_a) => {
|
|
|
17345
17451
|
strokeLinejoin: "round"
|
|
17346
17452
|
}
|
|
17347
17453
|
),
|
|
17348
|
-
/* @__PURE__ */
|
|
17454
|
+
/* @__PURE__ */ React193.createElement(
|
|
17349
17455
|
"path",
|
|
17350
17456
|
{
|
|
17351
17457
|
d: "M3.6975 3.6975L5.82 5.82",
|
|
@@ -17354,7 +17460,7 @@ var ProgressIcon = (_a) => {
|
|
|
17354
17460
|
strokeLinejoin: "round"
|
|
17355
17461
|
}
|
|
17356
17462
|
),
|
|
17357
|
-
/* @__PURE__ */
|
|
17463
|
+
/* @__PURE__ */ React193.createElement(
|
|
17358
17464
|
"path",
|
|
17359
17465
|
{
|
|
17360
17466
|
d: "M12.18 12.18L14.3025 14.3025",
|
|
@@ -17363,7 +17469,7 @@ var ProgressIcon = (_a) => {
|
|
|
17363
17469
|
strokeLinejoin: "round"
|
|
17364
17470
|
}
|
|
17365
17471
|
),
|
|
17366
|
-
/* @__PURE__ */
|
|
17472
|
+
/* @__PURE__ */ React193.createElement(
|
|
17367
17473
|
"path",
|
|
17368
17474
|
{
|
|
17369
17475
|
d: "M1.5 9H4.5",
|
|
@@ -17372,7 +17478,7 @@ var ProgressIcon = (_a) => {
|
|
|
17372
17478
|
strokeLinejoin: "round"
|
|
17373
17479
|
}
|
|
17374
17480
|
),
|
|
17375
|
-
/* @__PURE__ */
|
|
17481
|
+
/* @__PURE__ */ React193.createElement(
|
|
17376
17482
|
"path",
|
|
17377
17483
|
{
|
|
17378
17484
|
d: "M13.5 9H16.5",
|
|
@@ -17381,7 +17487,7 @@ var ProgressIcon = (_a) => {
|
|
|
17381
17487
|
strokeLinejoin: "round"
|
|
17382
17488
|
}
|
|
17383
17489
|
),
|
|
17384
|
-
/* @__PURE__ */
|
|
17490
|
+
/* @__PURE__ */ React193.createElement(
|
|
17385
17491
|
"path",
|
|
17386
17492
|
{
|
|
17387
17493
|
d: "M3.6975 14.3025L5.82 12.18",
|
|
@@ -17390,7 +17496,7 @@ var ProgressIcon = (_a) => {
|
|
|
17390
17496
|
strokeLinejoin: "round"
|
|
17391
17497
|
}
|
|
17392
17498
|
),
|
|
17393
|
-
/* @__PURE__ */
|
|
17499
|
+
/* @__PURE__ */ React193.createElement(
|
|
17394
17500
|
"path",
|
|
17395
17501
|
{
|
|
17396
17502
|
d: "M12.18 5.82L14.3025 3.6975",
|
|
@@ -17406,22 +17512,22 @@ var ProgressIcon_default = ProgressIcon;
|
|
|
17406
17512
|
// src/components/TasksHeader/TasksHeader.tsx
|
|
17407
17513
|
var ICONS = {
|
|
17408
17514
|
loading: {
|
|
17409
|
-
icon: /* @__PURE__ */
|
|
17515
|
+
icon: /* @__PURE__ */ React194.createElement(ProgressIcon_default, { size: 12, className: "Layer__anim--rotating" }),
|
|
17410
17516
|
text: "Loading",
|
|
17411
17517
|
badge: "default" /* DEFAULT */
|
|
17412
17518
|
},
|
|
17413
17519
|
done: {
|
|
17414
|
-
icon: /* @__PURE__ */
|
|
17520
|
+
icon: /* @__PURE__ */ React194.createElement(Check_default, { size: 12 }),
|
|
17415
17521
|
text: "Done",
|
|
17416
17522
|
badge: "success" /* SUCCESS */
|
|
17417
17523
|
},
|
|
17418
17524
|
pending: {
|
|
17419
|
-
icon: /* @__PURE__ */
|
|
17525
|
+
icon: /* @__PURE__ */ React194.createElement(AlertCircle_default, { size: 12 }),
|
|
17420
17526
|
text: "In progress",
|
|
17421
17527
|
badge: "warning" /* WARNING */
|
|
17422
17528
|
},
|
|
17423
17529
|
refresh: {
|
|
17424
|
-
icon: /* @__PURE__ */
|
|
17530
|
+
icon: /* @__PURE__ */ React194.createElement(RefreshCcw_default, { size: 12 }),
|
|
17425
17531
|
text: "Refresh",
|
|
17426
17532
|
badge: "default" /* DEFAULT */
|
|
17427
17533
|
}
|
|
@@ -17435,7 +17541,7 @@ var TasksHeader = ({
|
|
|
17435
17541
|
const { data: tasks, loadedStatus, refetch, error } = useContext40(TasksContext);
|
|
17436
17542
|
const completedTasks = tasks == null ? void 0 : tasks.filter((task) => isComplete(task.status)).length;
|
|
17437
17543
|
const badgeVariant = completedTasks === (tasks == null ? void 0 : tasks.length) ? ICONS.done : ICONS.pending;
|
|
17438
|
-
return /* @__PURE__ */
|
|
17544
|
+
return /* @__PURE__ */ React194.createElement("div", { className: "Layer__tasks-header" }, /* @__PURE__ */ React194.createElement("div", { className: "Layer__tasks-header__left-col" }, /* @__PURE__ */ React194.createElement(Text, { size: "lg" /* lg */ }, tasksHeader), loadedStatus !== "complete" && !open ? /* @__PURE__ */ React194.createElement(Badge, { variant: ICONS.loading.badge, icon: ICONS.loading.icon }, ICONS.loading.text) : loadedStatus === "complete" && (!tasks || error) ? /* @__PURE__ */ React194.createElement(
|
|
17439
17545
|
Badge,
|
|
17440
17546
|
{
|
|
17441
17547
|
onClick: () => refetch(),
|
|
@@ -17443,17 +17549,17 @@ var TasksHeader = ({
|
|
|
17443
17549
|
icon: ICONS.refresh.icon
|
|
17444
17550
|
},
|
|
17445
17551
|
ICONS.refresh.text
|
|
17446
|
-
) : loadedStatus === "complete" ? /* @__PURE__ */
|
|
17552
|
+
) : loadedStatus === "complete" ? /* @__PURE__ */ React194.createElement(Badge, { variant: badgeVariant.badge, icon: badgeVariant.icon }, badgeVariant.text) : open ? null : /* @__PURE__ */ React194.createElement(Badge, { variant: badgeVariant.badge, icon: badgeVariant.icon }, badgeVariant.text)), collapsable && /* @__PURE__ */ React194.createElement(ExpandButton, { onClick: toggleContent, collapsed: !open }));
|
|
17447
17553
|
};
|
|
17448
17554
|
|
|
17449
17555
|
// src/components/TasksList/TasksList.tsx
|
|
17450
|
-
import
|
|
17556
|
+
import React197, { useContext as useContext42, useMemo as useMemo22, useState as useState57 } from "react";
|
|
17451
17557
|
|
|
17452
17558
|
// src/icons/SmileIcon.tsx
|
|
17453
|
-
import * as
|
|
17559
|
+
import * as React195 from "react";
|
|
17454
17560
|
var SmileIcon = (_a) => {
|
|
17455
17561
|
var _b = _a, { size = 12 } = _b, props = __objRest(_b, ["size"]);
|
|
17456
|
-
return /* @__PURE__ */
|
|
17562
|
+
return /* @__PURE__ */ React195.createElement(
|
|
17457
17563
|
"svg",
|
|
17458
17564
|
__spreadProps(__spreadValues({
|
|
17459
17565
|
viewBox: "0 0 12 12",
|
|
@@ -17463,7 +17569,7 @@ var SmileIcon = (_a) => {
|
|
|
17463
17569
|
width: size,
|
|
17464
17570
|
height: size
|
|
17465
17571
|
}),
|
|
17466
|
-
/* @__PURE__ */
|
|
17572
|
+
/* @__PURE__ */ React195.createElement(
|
|
17467
17573
|
"path",
|
|
17468
17574
|
{
|
|
17469
17575
|
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",
|
|
@@ -17472,7 +17578,7 @@ var SmileIcon = (_a) => {
|
|
|
17472
17578
|
strokeLinejoin: "round"
|
|
17473
17579
|
}
|
|
17474
17580
|
),
|
|
17475
|
-
/* @__PURE__ */
|
|
17581
|
+
/* @__PURE__ */ React195.createElement(
|
|
17476
17582
|
"path",
|
|
17477
17583
|
{
|
|
17478
17584
|
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",
|
|
@@ -17481,7 +17587,7 @@ var SmileIcon = (_a) => {
|
|
|
17481
17587
|
strokeLinejoin: "round"
|
|
17482
17588
|
}
|
|
17483
17589
|
),
|
|
17484
|
-
/* @__PURE__ */
|
|
17590
|
+
/* @__PURE__ */ React195.createElement(
|
|
17485
17591
|
"path",
|
|
17486
17592
|
{
|
|
17487
17593
|
d: "M5 5H5.005",
|
|
@@ -17490,7 +17596,7 @@ var SmileIcon = (_a) => {
|
|
|
17490
17596
|
strokeLinejoin: "round"
|
|
17491
17597
|
}
|
|
17492
17598
|
),
|
|
17493
|
-
/* @__PURE__ */
|
|
17599
|
+
/* @__PURE__ */ React195.createElement(
|
|
17494
17600
|
"path",
|
|
17495
17601
|
{
|
|
17496
17602
|
d: "M8 5H8.005",
|
|
@@ -17504,8 +17610,8 @@ var SmileIcon = (_a) => {
|
|
|
17504
17610
|
var SmileIcon_default = SmileIcon;
|
|
17505
17611
|
|
|
17506
17612
|
// src/components/TasksListItem/TasksListItem.tsx
|
|
17507
|
-
import
|
|
17508
|
-
import
|
|
17613
|
+
import React196, { useContext as useContext41, useEffect as useEffect47, useState as useState56 } from "react";
|
|
17614
|
+
import classNames66 from "classnames";
|
|
17509
17615
|
var TasksListItem = ({
|
|
17510
17616
|
task,
|
|
17511
17617
|
goToNextPageIfAllComplete,
|
|
@@ -17514,30 +17620,30 @@ var TasksListItem = ({
|
|
|
17514
17620
|
const [isOpen, setIsOpen] = useState56(defaultOpen);
|
|
17515
17621
|
const [userResponse, setUserResponse] = useState56(task.user_response || "");
|
|
17516
17622
|
const { submitResponseToTask: submitResponseToTask2, uploadDocumentForTask } = useContext41(TasksContext);
|
|
17517
|
-
const taskBodyClassName =
|
|
17623
|
+
const taskBodyClassName = classNames66(
|
|
17518
17624
|
"Layer__tasks-list-item__body",
|
|
17519
17625
|
isOpen && "Layer__tasks-list-item__body--expanded",
|
|
17520
17626
|
isComplete(task.status) && "Layer__tasks-list-item--completed"
|
|
17521
17627
|
);
|
|
17522
|
-
const taskHeadClassName =
|
|
17628
|
+
const taskHeadClassName = classNames66(
|
|
17523
17629
|
"Layer__tasks-list-item__head-info",
|
|
17524
17630
|
isComplete(task.status) ? "Layer__tasks-list-item--completed" : "Layer__tasks-list-item--pending"
|
|
17525
17631
|
);
|
|
17526
|
-
const taskItemClassName =
|
|
17632
|
+
const taskItemClassName = classNames66(
|
|
17527
17633
|
"Layer__tasks-list-item",
|
|
17528
17634
|
isOpen && "Layer__tasks-list-item__expanded"
|
|
17529
17635
|
);
|
|
17530
17636
|
useEffect47(() => {
|
|
17531
17637
|
setIsOpen(defaultOpen);
|
|
17532
17638
|
}, [defaultOpen]);
|
|
17533
|
-
return /* @__PURE__ */
|
|
17639
|
+
return /* @__PURE__ */ React196.createElement("div", { className: "Layer__tasks-list-item-wrapper" }, /* @__PURE__ */ React196.createElement("div", { className: taskItemClassName }, /* @__PURE__ */ React196.createElement(
|
|
17534
17640
|
"div",
|
|
17535
17641
|
{
|
|
17536
17642
|
className: "Layer__tasks-list-item__head",
|
|
17537
17643
|
onClick: () => setIsOpen(!isOpen)
|
|
17538
17644
|
},
|
|
17539
|
-
/* @__PURE__ */
|
|
17540
|
-
/* @__PURE__ */
|
|
17645
|
+
/* @__PURE__ */ React196.createElement("div", { className: taskHeadClassName }, /* @__PURE__ */ React196.createElement("div", { className: "Layer__tasks-list-item__head-info__status" }, isComplete(task.status) ? /* @__PURE__ */ React196.createElement(Check_default, { size: 12 }) : /* @__PURE__ */ React196.createElement(AlertCircle_default, { size: 12 })), /* @__PURE__ */ React196.createElement(Text, { size: "md" /* md */ }, task.title)),
|
|
17646
|
+
/* @__PURE__ */ React196.createElement(
|
|
17541
17647
|
ChevronDownFill_default,
|
|
17542
17648
|
{
|
|
17543
17649
|
size: 16,
|
|
@@ -17547,13 +17653,13 @@ var TasksListItem = ({
|
|
|
17547
17653
|
}
|
|
17548
17654
|
}
|
|
17549
17655
|
)
|
|
17550
|
-
), /* @__PURE__ */
|
|
17656
|
+
), /* @__PURE__ */ React196.createElement("div", { className: taskBodyClassName }, /* @__PURE__ */ React196.createElement("div", { className: "Layer__tasks-list-item__body-info" }, /* @__PURE__ */ React196.createElement(Text, { size: "sm" /* sm */ }, task.question), task.user_response_type === "FREE_RESPONSE" ? /* @__PURE__ */ React196.createElement(
|
|
17551
17657
|
Textarea,
|
|
17552
17658
|
{
|
|
17553
17659
|
value: userResponse,
|
|
17554
17660
|
onChange: (e) => setUserResponse(e.target.value)
|
|
17555
17661
|
}
|
|
17556
|
-
) : null, /* @__PURE__ */
|
|
17662
|
+
) : null, /* @__PURE__ */ React196.createElement("div", { className: "Layer__tasks-list-item__actions" }, task.user_response_type === "UPLOAD_DOCUMENT" ? /* @__PURE__ */ React196.createElement(
|
|
17557
17663
|
FileInput,
|
|
17558
17664
|
{
|
|
17559
17665
|
onUpload: (file) => {
|
|
@@ -17564,7 +17670,7 @@ var TasksListItem = ({
|
|
|
17564
17670
|
text: "Upload file",
|
|
17565
17671
|
disabled: task.completed_at != null || task.user_marked_completed_at != null || task.archived_at != null
|
|
17566
17672
|
}
|
|
17567
|
-
) : /* @__PURE__ */
|
|
17673
|
+
) : /* @__PURE__ */ React196.createElement(
|
|
17568
17674
|
Button,
|
|
17569
17675
|
{
|
|
17570
17676
|
disabled: userResponse.length === 0 || userResponse === task.user_response,
|
|
@@ -17588,7 +17694,7 @@ function paginateArray(array, chunkSize = 10) {
|
|
|
17588
17694
|
}
|
|
17589
17695
|
return result;
|
|
17590
17696
|
}
|
|
17591
|
-
var TasksEmptyState = () => /* @__PURE__ */
|
|
17697
|
+
var TasksEmptyState = () => /* @__PURE__ */ React197.createElement("div", { className: "Layer__tasks-empty-state" }, /* @__PURE__ */ React197.createElement("div", { className: "Layer__tasks-icon" }, /* @__PURE__ */ React197.createElement(SmileIcon_default, null)), /* @__PURE__ */ React197.createElement(Text, { size: "sm" /* sm */ }, "There are no pending tasks!", /* @__PURE__ */ React197.createElement("br", null), " Great job!"));
|
|
17592
17698
|
var TasksList = ({ pageSize = 10 }) => {
|
|
17593
17699
|
const { data: tasks, error } = useContext42(TasksContext);
|
|
17594
17700
|
const firstPageWithIincompleteTasks = paginateArray(
|
|
@@ -17598,7 +17704,7 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
17598
17704
|
const [currentPage, setCurrentPage] = useState57(
|
|
17599
17705
|
firstPageWithIincompleteTasks === -1 ? 1 : firstPageWithIincompleteTasks + 1
|
|
17600
17706
|
);
|
|
17601
|
-
const sortedTasks =
|
|
17707
|
+
const sortedTasks = useMemo22(() => {
|
|
17602
17708
|
const firstPageIndex = (currentPage - 1) * pageSize;
|
|
17603
17709
|
const lastPageIndex = firstPageIndex + pageSize;
|
|
17604
17710
|
return tasks == null ? void 0 : tasks.slice(firstPageIndex, lastPageIndex);
|
|
@@ -17612,7 +17718,7 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
17612
17718
|
setCurrentPage(currentPage + 1);
|
|
17613
17719
|
}
|
|
17614
17720
|
};
|
|
17615
|
-
return /* @__PURE__ */
|
|
17721
|
+
return /* @__PURE__ */ React197.createElement("div", { className: "Layer__tasks-list" }, sortedTasks && sortedTasks.length > 0 ? /* @__PURE__ */ React197.createElement(React197.Fragment, null, sortedTasks.map((task, index) => /* @__PURE__ */ React197.createElement(
|
|
17616
17722
|
TasksListItem,
|
|
17617
17723
|
{
|
|
17618
17724
|
key: task.id,
|
|
@@ -17620,7 +17726,7 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
17620
17726
|
goToNextPageIfAllComplete: goToNextPage,
|
|
17621
17727
|
defaultOpen: index === indexFirstIncomplete
|
|
17622
17728
|
}
|
|
17623
|
-
)), tasks && tasks.length >= 10 && /* @__PURE__ */
|
|
17729
|
+
)), tasks && tasks.length >= 10 && /* @__PURE__ */ React197.createElement("div", { className: "Layer__tasks__pagination" }, /* @__PURE__ */ React197.createElement(
|
|
17624
17730
|
Pagination,
|
|
17625
17731
|
{
|
|
17626
17732
|
currentPage,
|
|
@@ -17628,12 +17734,12 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
17628
17734
|
pageSize,
|
|
17629
17735
|
onPageChange: (page) => setCurrentPage(page)
|
|
17630
17736
|
}
|
|
17631
|
-
))) : /* @__PURE__ */
|
|
17737
|
+
))) : /* @__PURE__ */ React197.createElement(React197.Fragment, null, error ? /* @__PURE__ */ React197.createElement(ErrorText, null, "Approval failed. Check connection and retry in few seconds.") : /* @__PURE__ */ React197.createElement(TasksEmptyState, null)));
|
|
17632
17738
|
};
|
|
17633
17739
|
|
|
17634
17740
|
// src/components/TasksPending/TasksPending.tsx
|
|
17635
|
-
import
|
|
17636
|
-
import
|
|
17741
|
+
import React198, { useContext as useContext43 } from "react";
|
|
17742
|
+
import classNames67 from "classnames";
|
|
17637
17743
|
import { format as format7 } from "date-fns";
|
|
17638
17744
|
import { Cell as Cell4, Pie as Pie3, PieChart as PieChart4 } from "recharts";
|
|
17639
17745
|
var TasksPending = () => {
|
|
@@ -17649,10 +17755,10 @@ var TasksPending = () => {
|
|
|
17649
17755
|
value: data == null ? void 0 : data.filter((task) => !isComplete(task.status)).length
|
|
17650
17756
|
}
|
|
17651
17757
|
];
|
|
17652
|
-
const taskStatusClassName =
|
|
17758
|
+
const taskStatusClassName = classNames67(
|
|
17653
17759
|
completedTasks && completedTasks > 0 ? "Layer__tasks-pending-bar__status--done" : "Layer__tasks-pending-bar__status--pending"
|
|
17654
17760
|
);
|
|
17655
|
-
return /* @__PURE__ */
|
|
17761
|
+
return /* @__PURE__ */ React198.createElement("div", { className: "Layer__tasks-pending" }, /* @__PURE__ */ React198.createElement(Text, { size: "lg" /* lg */ }, format7(Date.now(), "MMMM")), /* @__PURE__ */ React198.createElement("div", { className: "Layer__tasks-pending-bar" }, /* @__PURE__ */ React198.createElement(Text, { size: "sm" /* sm */ }, /* @__PURE__ */ React198.createElement("span", { className: taskStatusClassName }, completedTasks), "/", data == null ? void 0 : data.length, " done"), /* @__PURE__ */ React198.createElement(PieChart4, { width: 24, height: 24, className: "mini-chart" }, /* @__PURE__ */ React198.createElement(
|
|
17656
17762
|
Pie3,
|
|
17657
17763
|
{
|
|
17658
17764
|
data: chartData,
|
|
@@ -17670,7 +17776,7 @@ var TasksPending = () => {
|
|
|
17670
17776
|
animationEasing: "ease-in-out"
|
|
17671
17777
|
},
|
|
17672
17778
|
chartData.map((task, index) => {
|
|
17673
|
-
return /* @__PURE__ */
|
|
17779
|
+
return /* @__PURE__ */ React198.createElement(
|
|
17674
17780
|
Cell4,
|
|
17675
17781
|
{
|
|
17676
17782
|
key: `cell-${index}`,
|
|
@@ -17683,7 +17789,7 @@ var TasksPending = () => {
|
|
|
17683
17789
|
};
|
|
17684
17790
|
|
|
17685
17791
|
// src/components/Tasks/Tasks.tsx
|
|
17686
|
-
import
|
|
17792
|
+
import classNames68 from "classnames";
|
|
17687
17793
|
var UseTasksContext = createContext17({
|
|
17688
17794
|
data: void 0,
|
|
17689
17795
|
isLoading: void 0,
|
|
@@ -17705,7 +17811,7 @@ var Tasks = ({
|
|
|
17705
17811
|
// deprecated
|
|
17706
17812
|
stringOverrides
|
|
17707
17813
|
}) => {
|
|
17708
|
-
return /* @__PURE__ */
|
|
17814
|
+
return /* @__PURE__ */ React199.createElement(TasksProvider, null, /* @__PURE__ */ React199.createElement(
|
|
17709
17815
|
TasksComponent,
|
|
17710
17816
|
{
|
|
17711
17817
|
collapsable,
|
|
@@ -17718,7 +17824,7 @@ var Tasks = ({
|
|
|
17718
17824
|
};
|
|
17719
17825
|
var TasksProvider = ({ children }) => {
|
|
17720
17826
|
const contextData = useTasks();
|
|
17721
|
-
return /* @__PURE__ */
|
|
17827
|
+
return /* @__PURE__ */ React199.createElement(TasksContext.Provider, { value: contextData }, children);
|
|
17722
17828
|
};
|
|
17723
17829
|
var TasksComponent = ({
|
|
17724
17830
|
collapsable = false,
|
|
@@ -17729,7 +17835,7 @@ var TasksComponent = ({
|
|
|
17729
17835
|
stringOverrides
|
|
17730
17836
|
}) => {
|
|
17731
17837
|
const { isLoading, loadedStatus, data } = useContext44(TasksContext);
|
|
17732
|
-
const allComplete =
|
|
17838
|
+
const allComplete = useMemo23(() => {
|
|
17733
17839
|
if (!data) {
|
|
17734
17840
|
return void 0;
|
|
17735
17841
|
}
|
|
@@ -17746,7 +17852,7 @@ var TasksComponent = ({
|
|
|
17746
17852
|
setOpen(false);
|
|
17747
17853
|
}
|
|
17748
17854
|
}, [allComplete]);
|
|
17749
|
-
return /* @__PURE__ */
|
|
17855
|
+
return /* @__PURE__ */ React199.createElement("div", { className: "Layer__tasks-component" }, /* @__PURE__ */ React199.createElement(
|
|
17750
17856
|
TasksHeader,
|
|
17751
17857
|
{
|
|
17752
17858
|
tasksHeader: (stringOverrides == null ? void 0 : stringOverrides.header) || tasksHeader,
|
|
@@ -17754,26 +17860,26 @@ var TasksComponent = ({
|
|
|
17754
17860
|
open,
|
|
17755
17861
|
toggleContent: () => setOpen(!open)
|
|
17756
17862
|
}
|
|
17757
|
-
), /* @__PURE__ */
|
|
17863
|
+
), /* @__PURE__ */ React199.createElement(
|
|
17758
17864
|
"div",
|
|
17759
17865
|
{
|
|
17760
|
-
className:
|
|
17866
|
+
className: classNames68(
|
|
17761
17867
|
"Layer__tasks__content",
|
|
17762
17868
|
!open && "Layer__tasks__content--collapsed"
|
|
17763
17869
|
)
|
|
17764
17870
|
},
|
|
17765
|
-
isLoading || !data ? /* @__PURE__ */
|
|
17871
|
+
isLoading || !data ? /* @__PURE__ */ React199.createElement("div", { className: "Layer__tasks__loader-container" }, /* @__PURE__ */ React199.createElement(Loader2, null)) : /* @__PURE__ */ React199.createElement(React199.Fragment, null, data.length > 0 && /* @__PURE__ */ React199.createElement(TasksPending, null), /* @__PURE__ */ React199.createElement(TasksList, null))
|
|
17766
17872
|
));
|
|
17767
17873
|
};
|
|
17768
17874
|
|
|
17769
17875
|
// src/components/PlatformOnboarding/LinkAccounts.tsx
|
|
17770
|
-
import
|
|
17876
|
+
import React200, { useContext as useContext45 } from "react";
|
|
17771
17877
|
var LinkAccounts = (_a) => {
|
|
17772
17878
|
var _b = _a, { inBox } = _b, props = __objRest(_b, ["inBox"]);
|
|
17773
17879
|
if (inBox) {
|
|
17774
|
-
return /* @__PURE__ */
|
|
17880
|
+
return /* @__PURE__ */ React200.createElement(LinkedAccountsProvider, null, /* @__PURE__ */ React200.createElement("div", { className: "Layer__link-accounts__box" }, /* @__PURE__ */ React200.createElement(LinkAccountsContent, __spreadValues({}, props))));
|
|
17775
17881
|
}
|
|
17776
|
-
return /* @__PURE__ */
|
|
17882
|
+
return /* @__PURE__ */ React200.createElement(LinkedAccountsProvider, null, /* @__PURE__ */ React200.createElement(LinkAccountsContent, __spreadValues({}, props)));
|
|
17777
17883
|
};
|
|
17778
17884
|
var LinkAccountsContent = ({
|
|
17779
17885
|
title,
|
|
@@ -17788,7 +17894,7 @@ var LinkAccountsContent = ({
|
|
|
17788
17894
|
}) => {
|
|
17789
17895
|
var _a, _b;
|
|
17790
17896
|
const { data, loadingStatus, error, refetchAccounts, addConnection } = useContext45(LinkedAccountsContext);
|
|
17791
|
-
return /* @__PURE__ */
|
|
17897
|
+
return /* @__PURE__ */ React200.createElement("div", { className: "Layer__link-accounts Layer__component" }, title && /* @__PURE__ */ React200.createElement(Heading, { size: "view" /* view */ }, title), data && data.length === 0 ? /* @__PURE__ */ React200.createElement("div", { className: "Layer__link-accounts__data-status-container" }, !hideLoading && loadingStatus !== "complete" ? /* @__PURE__ */ React200.createElement(Loader2, null) : null, Boolean(error) && /* @__PURE__ */ React200.createElement(
|
|
17792
17898
|
DataState,
|
|
17793
17899
|
{
|
|
17794
17900
|
status: "failed" /* failed */,
|
|
@@ -17796,7 +17902,7 @@ var LinkAccountsContent = ({
|
|
|
17796
17902
|
description: "Please try again later",
|
|
17797
17903
|
onRefresh: refetchAccounts
|
|
17798
17904
|
}
|
|
17799
|
-
)) : null, data && data.length > 0 ? /* @__PURE__ */
|
|
17905
|
+
)) : null, data && data.length > 0 ? /* @__PURE__ */ React200.createElement("div", { className: "Layer__link-accounts__list" }, data == null ? void 0 : data.map((account, index) => /* @__PURE__ */ React200.createElement(
|
|
17800
17906
|
LinkedAccountItemThumb,
|
|
17801
17907
|
{
|
|
17802
17908
|
key: index,
|
|
@@ -17806,33 +17912,33 @@ var LinkAccountsContent = ({
|
|
|
17806
17912
|
showBreakConnection,
|
|
17807
17913
|
asWidget
|
|
17808
17914
|
}
|
|
17809
|
-
))) : null, /* @__PURE__ */
|
|
17915
|
+
))) : null, /* @__PURE__ */ React200.createElement(
|
|
17810
17916
|
ActionableRow,
|
|
17811
17917
|
{
|
|
17812
|
-
iconBox: /* @__PURE__ */
|
|
17918
|
+
iconBox: /* @__PURE__ */ React200.createElement(PlaidIcon_default, null),
|
|
17813
17919
|
title: data && data.length > 0 ? "Connect my next business account" : "Connect accounts",
|
|
17814
17920
|
description: "Import data with one simple integration.",
|
|
17815
|
-
button: /* @__PURE__ */
|
|
17921
|
+
button: /* @__PURE__ */ React200.createElement(
|
|
17816
17922
|
Button,
|
|
17817
17923
|
{
|
|
17818
17924
|
onClick: () => addConnection("PLAID"),
|
|
17819
|
-
rightIcon: /* @__PURE__ */
|
|
17925
|
+
rightIcon: /* @__PURE__ */ React200.createElement(Link_default, { size: 12 }),
|
|
17820
17926
|
disabled: loadingStatus !== "complete"
|
|
17821
17927
|
},
|
|
17822
17928
|
data && data.length > 0 ? "Connect next" : "Connect"
|
|
17823
17929
|
)
|
|
17824
17930
|
}
|
|
17825
|
-
), onBack || onNext ? /* @__PURE__ */
|
|
17931
|
+
), onBack || onNext ? /* @__PURE__ */ React200.createElement("div", { className: "Layer__link-accounts__footer" }, onBack && /* @__PURE__ */ React200.createElement(Button, { onClick: onBack, variant: "secondary" /* secondary */ }, (_a = stringOverrides == null ? void 0 : stringOverrides.backButtonText) != null ? _a : "Back"), onNext && /* @__PURE__ */ React200.createElement(Button, { onClick: onNext }, (_b = stringOverrides == null ? void 0 : stringOverrides.nextButtonText) != null ? _b : "I\u2019m done connecting my business accounts")) : null);
|
|
17826
17932
|
};
|
|
17827
17933
|
|
|
17828
17934
|
// src/components/UpsellBanner/BookkeepingUpsellBar.tsx
|
|
17829
|
-
import
|
|
17935
|
+
import React202 from "react";
|
|
17830
17936
|
|
|
17831
17937
|
// src/icons/Coffee.tsx
|
|
17832
|
-
import * as
|
|
17938
|
+
import * as React201 from "react";
|
|
17833
17939
|
var CoffeeIcon = (_a) => {
|
|
17834
17940
|
var _b = _a, { size = 11 } = _b, props = __objRest(_b, ["size"]);
|
|
17835
|
-
return /* @__PURE__ */
|
|
17941
|
+
return /* @__PURE__ */ React201.createElement(
|
|
17836
17942
|
"svg",
|
|
17837
17943
|
__spreadProps(__spreadValues({
|
|
17838
17944
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -17842,7 +17948,7 @@ var CoffeeIcon = (_a) => {
|
|
|
17842
17948
|
width: size,
|
|
17843
17949
|
height: size
|
|
17844
17950
|
}),
|
|
17845
|
-
/* @__PURE__ */
|
|
17951
|
+
/* @__PURE__ */ React201.createElement("g", { clipPath: "url(#clip0_5018_10141)" }, /* @__PURE__ */ React201.createElement(
|
|
17846
17952
|
"path",
|
|
17847
17953
|
{
|
|
17848
17954
|
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",
|
|
@@ -17850,7 +17956,7 @@ var CoffeeIcon = (_a) => {
|
|
|
17850
17956
|
strokeLinecap: "round",
|
|
17851
17957
|
strokeLinejoin: "round"
|
|
17852
17958
|
}
|
|
17853
|
-
), /* @__PURE__ */
|
|
17959
|
+
), /* @__PURE__ */ React201.createElement(
|
|
17854
17960
|
"path",
|
|
17855
17961
|
{
|
|
17856
17962
|
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",
|
|
@@ -17858,7 +17964,7 @@ var CoffeeIcon = (_a) => {
|
|
|
17858
17964
|
strokeLinecap: "round",
|
|
17859
17965
|
strokeLinejoin: "round"
|
|
17860
17966
|
}
|
|
17861
|
-
), /* @__PURE__ */
|
|
17967
|
+
), /* @__PURE__ */ React201.createElement(
|
|
17862
17968
|
"path",
|
|
17863
17969
|
{
|
|
17864
17970
|
d: "M8.75 0.958344V2.33334",
|
|
@@ -17866,7 +17972,7 @@ var CoffeeIcon = (_a) => {
|
|
|
17866
17972
|
strokeLinecap: "round",
|
|
17867
17973
|
strokeLinejoin: "round"
|
|
17868
17974
|
}
|
|
17869
|
-
), /* @__PURE__ */
|
|
17975
|
+
), /* @__PURE__ */ React201.createElement(
|
|
17870
17976
|
"path",
|
|
17871
17977
|
{
|
|
17872
17978
|
d: "M6.91663 0.958344V2.33334",
|
|
@@ -17874,7 +17980,7 @@ var CoffeeIcon = (_a) => {
|
|
|
17874
17980
|
strokeLinecap: "round",
|
|
17875
17981
|
strokeLinejoin: "round"
|
|
17876
17982
|
}
|
|
17877
|
-
), /* @__PURE__ */
|
|
17983
|
+
), /* @__PURE__ */ React201.createElement(
|
|
17878
17984
|
"path",
|
|
17879
17985
|
{
|
|
17880
17986
|
d: "M5.08337 0.958344V2.33334",
|
|
@@ -17883,7 +17989,7 @@ var CoffeeIcon = (_a) => {
|
|
|
17883
17989
|
strokeLinejoin: "round"
|
|
17884
17990
|
}
|
|
17885
17991
|
)),
|
|
17886
|
-
/* @__PURE__ */
|
|
17992
|
+
/* @__PURE__ */ React201.createElement("defs", null, /* @__PURE__ */ React201.createElement("clipPath", { id: "clip0_5018_10141" }, /* @__PURE__ */ React201.createElement(
|
|
17887
17993
|
"rect",
|
|
17888
17994
|
{
|
|
17889
17995
|
width: "11",
|
|
@@ -17901,38 +18007,50 @@ var BookkeepingUpsellBar = ({
|
|
|
17901
18007
|
onClick,
|
|
17902
18008
|
href
|
|
17903
18009
|
}) => {
|
|
17904
|
-
return /* @__PURE__ */
|
|
18010
|
+
return /* @__PURE__ */ React202.createElement("div", { className: "Layer__bar-banner Layer__bar-banner--bookkeeping" }, /* @__PURE__ */ React202.createElement("div", { className: "Layer__bar-banner__left-col" }, /* @__PURE__ */ React202.createElement(IconBox, null, /* @__PURE__ */ React202.createElement(Coffee_default, null)), /* @__PURE__ */ React202.createElement("div", { className: "Layer__bar-banner__text-container" }, /* @__PURE__ */ React202.createElement(Text, { size: "md" /* md */, weight: "bold" /* bold */ }, "Need help with your books?"), /* @__PURE__ */ React202.createElement(
|
|
17905
18011
|
Text,
|
|
17906
18012
|
{
|
|
17907
18013
|
size: "sm" /* sm */,
|
|
17908
18014
|
className: "Layer__bar-banner__text-container__desc"
|
|
17909
18015
|
},
|
|
17910
18016
|
"Order bookkeeping service supported by real humans."
|
|
17911
|
-
))), onClick ? /* @__PURE__ */
|
|
18017
|
+
))), onClick ? /* @__PURE__ */ React202.createElement(Button, { variant: "secondary" /* secondary */, onClick }, "Schedule a demo") : href ? /* @__PURE__ */ React202.createElement(Link2, { href, target: "_blank", variant: "secondary" /* secondary */ }, "Schedule a demo") : null);
|
|
17912
18018
|
};
|
|
17913
18019
|
|
|
17914
18020
|
// src/views/BookkeepingOverview/BookkeepingOverview.tsx
|
|
17915
|
-
import
|
|
17916
|
-
|
|
18021
|
+
import React204, { useState as useState59 } from "react";
|
|
18022
|
+
|
|
18023
|
+
// src/views/BookkeepingOverview/internal/BookkeepingProfitAndLossSummariesContainer.tsx
|
|
18024
|
+
import React203 from "react";
|
|
18025
|
+
var CLASS_NAME2 = "Layer__BookkeepingProfitAndLossSummariesContainer";
|
|
18026
|
+
function BookkeepingProfitAndLossSummariesContainer({
|
|
18027
|
+
children
|
|
18028
|
+
}) {
|
|
18029
|
+
return /* @__PURE__ */ React203.createElement("div", { className: CLASS_NAME2 }, children);
|
|
18030
|
+
}
|
|
18031
|
+
|
|
18032
|
+
// src/views/BookkeepingOverview/BookkeepingOverview.tsx
|
|
18033
|
+
import classNames69 from "classnames";
|
|
17917
18034
|
var BookkeepingOverview = ({
|
|
17918
18035
|
title,
|
|
17919
|
-
// deprecated
|
|
17920
18036
|
showTitle = true,
|
|
17921
|
-
stringOverrides
|
|
18037
|
+
stringOverrides,
|
|
18038
|
+
slotProps
|
|
17922
18039
|
}) => {
|
|
17923
|
-
var _a, _b, _c, _d;
|
|
18040
|
+
var _a, _b, _c, _d, _e, _f;
|
|
17924
18041
|
const [pnlToggle, setPnlToggle] = useState59("expenses");
|
|
17925
18042
|
const [width] = useWindowSize();
|
|
17926
|
-
|
|
18043
|
+
const profitAndLossSummariesVariants = (_b = (_a = slotProps == null ? void 0 : slotProps.profitAndLoss) == null ? void 0 : _a.summaries) == null ? void 0 : _b.variants;
|
|
18044
|
+
return /* @__PURE__ */ React204.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React204.createElement(TasksProvider, null, /* @__PURE__ */ React204.createElement(
|
|
17927
18045
|
View,
|
|
17928
18046
|
{
|
|
17929
18047
|
viewClassName: "Layer__bookkeeping-overview--view",
|
|
17930
18048
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "Bookkeeping overview",
|
|
17931
18049
|
withSidebar: width > 1100,
|
|
17932
|
-
sidebar: /* @__PURE__ */
|
|
18050
|
+
sidebar: /* @__PURE__ */ React204.createElement(TasksComponent, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.tasks }),
|
|
17933
18051
|
showHeader: showTitle
|
|
17934
18052
|
},
|
|
17935
|
-
width <= 1100 && /* @__PURE__ */
|
|
18053
|
+
width <= 1100 && /* @__PURE__ */ React204.createElement(
|
|
17936
18054
|
TasksComponent,
|
|
17937
18055
|
{
|
|
17938
18056
|
collapsable: true,
|
|
@@ -17940,29 +18058,30 @@ var BookkeepingOverview = ({
|
|
|
17940
18058
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.tasks
|
|
17941
18059
|
}
|
|
17942
18060
|
),
|
|
17943
|
-
/* @__PURE__ */
|
|
18061
|
+
/* @__PURE__ */ React204.createElement(
|
|
17944
18062
|
Container,
|
|
17945
18063
|
{
|
|
17946
18064
|
name: "bookkeeping-overview-profit-and-loss",
|
|
17947
18065
|
asWidget: true,
|
|
17948
18066
|
elevated: true
|
|
17949
18067
|
},
|
|
17950
|
-
/* @__PURE__ */
|
|
18068
|
+
/* @__PURE__ */ React204.createElement(
|
|
17951
18069
|
ProfitAndLoss.Header,
|
|
17952
18070
|
{
|
|
17953
|
-
text: ((
|
|
18071
|
+
text: ((_c = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _c.header) || "Profit & Loss",
|
|
17954
18072
|
withDatePicker: true
|
|
17955
18073
|
}
|
|
17956
18074
|
),
|
|
17957
|
-
/* @__PURE__ */
|
|
18075
|
+
/* @__PURE__ */ React204.createElement(BookkeepingProfitAndLossSummariesContainer, null, /* @__PURE__ */ React204.createElement(
|
|
17958
18076
|
ProfitAndLoss.Summaries,
|
|
17959
18077
|
{
|
|
17960
|
-
stringOverrides: (
|
|
18078
|
+
stringOverrides: (_d = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _d.summaries,
|
|
18079
|
+
variants: profitAndLossSummariesVariants
|
|
17961
18080
|
}
|
|
17962
18081
|
)),
|
|
17963
|
-
/* @__PURE__ */
|
|
18082
|
+
/* @__PURE__ */ React204.createElement(ProfitAndLoss.Chart, null)
|
|
17964
18083
|
),
|
|
17965
|
-
/* @__PURE__ */
|
|
18084
|
+
/* @__PURE__ */ React204.createElement("div", { className: "Layer__bookkeeping-overview-profit-and-loss-charts" }, /* @__PURE__ */ React204.createElement(
|
|
17966
18085
|
Toggle,
|
|
17967
18086
|
{
|
|
17968
18087
|
name: "pnl-detailed-charts",
|
|
@@ -17979,36 +18098,36 @@ var BookkeepingOverview = ({
|
|
|
17979
18098
|
selected: pnlToggle,
|
|
17980
18099
|
onChange: (e) => setPnlToggle(e.target.value)
|
|
17981
18100
|
}
|
|
17982
|
-
), /* @__PURE__ */
|
|
18101
|
+
), /* @__PURE__ */ React204.createElement(
|
|
17983
18102
|
Container,
|
|
17984
18103
|
{
|
|
17985
|
-
name:
|
|
18104
|
+
name: classNames69(
|
|
17986
18105
|
"bookkeeping-overview-profit-and-loss-chart",
|
|
17987
18106
|
pnlToggle !== "revenue" && "bookkeeping-overview-profit-and-loss-chart--hidden"
|
|
17988
18107
|
)
|
|
17989
18108
|
},
|
|
17990
|
-
/* @__PURE__ */
|
|
18109
|
+
/* @__PURE__ */ React204.createElement(
|
|
17991
18110
|
ProfitAndLoss.DetailedCharts,
|
|
17992
18111
|
{
|
|
17993
18112
|
scope: "revenue",
|
|
17994
18113
|
hideClose: true,
|
|
17995
|
-
stringOverrides: (
|
|
18114
|
+
stringOverrides: (_e = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _e.detailedCharts
|
|
17996
18115
|
}
|
|
17997
18116
|
)
|
|
17998
|
-
), /* @__PURE__ */
|
|
18117
|
+
), /* @__PURE__ */ React204.createElement(
|
|
17999
18118
|
Container,
|
|
18000
18119
|
{
|
|
18001
|
-
name:
|
|
18120
|
+
name: classNames69(
|
|
18002
18121
|
"bookkeeping-overview-profit-and-loss-chart",
|
|
18003
18122
|
pnlToggle !== "expenses" && "bookkeeping-overview-profit-and-loss-chart--hidden"
|
|
18004
18123
|
)
|
|
18005
18124
|
},
|
|
18006
|
-
/* @__PURE__ */
|
|
18125
|
+
/* @__PURE__ */ React204.createElement(
|
|
18007
18126
|
ProfitAndLoss.DetailedCharts,
|
|
18008
18127
|
{
|
|
18009
18128
|
scope: "expenses",
|
|
18010
18129
|
hideClose: true,
|
|
18011
|
-
stringOverrides: (
|
|
18130
|
+
stringOverrides: (_f = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _f.detailedCharts
|
|
18012
18131
|
}
|
|
18013
18132
|
)
|
|
18014
18133
|
))
|
|
@@ -18016,42 +18135,38 @@ var BookkeepingOverview = ({
|
|
|
18016
18135
|
};
|
|
18017
18136
|
|
|
18018
18137
|
// src/views/AccountingOverview/AccountingOverview.tsx
|
|
18019
|
-
import
|
|
18138
|
+
import React208, { useState as useState61 } from "react";
|
|
18020
18139
|
|
|
18021
|
-
// src/
|
|
18022
|
-
import
|
|
18140
|
+
// src/views/AccountingOverview/internal/TransactionsToReview.tsx
|
|
18141
|
+
import React207, { useContext as useContext46, useEffect as useEffect49, useState as useState60 } from "react";
|
|
18023
18142
|
|
|
18024
18143
|
// src/components/BadgeLoader/BadgeLoader.tsx
|
|
18025
|
-
import
|
|
18144
|
+
import React205 from "react";
|
|
18026
18145
|
var BadgeLoader = ({ children }) => {
|
|
18027
|
-
return /* @__PURE__ */
|
|
18146
|
+
return /* @__PURE__ */ React205.createElement("span", { className: "Layer__loader Layer__loader--as-badge" }, /* @__PURE__ */ React205.createElement(Loader_default, { size: 11, className: "Layer__anim--rotating" }), children);
|
|
18028
18147
|
};
|
|
18029
18148
|
|
|
18030
|
-
// src/components/
|
|
18031
|
-
import
|
|
18032
|
-
|
|
18033
|
-
|
|
18034
|
-
|
|
18035
|
-
|
|
18036
|
-
|
|
18037
|
-
|
|
18038
|
-
return /* @__PURE__ */
|
|
18039
|
-
|
|
18040
|
-
{
|
|
18041
|
-
icon: /* @__PURE__ */ React202.createElement(ChevronRight_default, null),
|
|
18042
|
-
withBorder: true,
|
|
18043
|
-
onClick: () => onClick()
|
|
18044
|
-
}
|
|
18045
|
-
));
|
|
18046
|
-
};
|
|
18149
|
+
// src/components/ui/Stack.tsx
|
|
18150
|
+
import React206, { useMemo as useMemo24 } from "react";
|
|
18151
|
+
var CLASS_NAME3 = "Layer__VStack";
|
|
18152
|
+
function VStack({ align, children, gap }) {
|
|
18153
|
+
const dataProperties = useMemo24(
|
|
18154
|
+
() => toDataProperties({ align, gap }),
|
|
18155
|
+
[align, gap]
|
|
18156
|
+
);
|
|
18157
|
+
return /* @__PURE__ */ React206.createElement("div", __spreadValues({ className: CLASS_NAME3 }, dataProperties), children);
|
|
18158
|
+
}
|
|
18047
18159
|
|
|
18048
|
-
// src/
|
|
18160
|
+
// src/views/AccountingOverview/internal/TransactionsToReview.tsx
|
|
18049
18161
|
import { getMonth as getMonth2, getYear as getYear2, startOfMonth as startOfMonth16 } from "date-fns";
|
|
18050
|
-
var
|
|
18162
|
+
var CLASS_NAME4 = "Layer__TransactionsToReview";
|
|
18163
|
+
function TransactionsToReview({
|
|
18051
18164
|
onClick,
|
|
18052
18165
|
usePnlDateRange,
|
|
18053
|
-
tagFilter = void 0
|
|
18054
|
-
|
|
18166
|
+
tagFilter = void 0,
|
|
18167
|
+
variants
|
|
18168
|
+
}) {
|
|
18169
|
+
const { size = "sm" } = variants != null ? variants : {};
|
|
18055
18170
|
const { dateRange: contextDateRange } = useContext46(ProfitAndLoss.Context);
|
|
18056
18171
|
const dateRange = usePnlDateRange ? contextDateRange : void 0;
|
|
18057
18172
|
const [toReview, setToReview] = useState60(0);
|
|
@@ -18075,48 +18190,46 @@ var TransactionToReviewCard = ({
|
|
|
18075
18190
|
}
|
|
18076
18191
|
}
|
|
18077
18192
|
};
|
|
18078
|
-
|
|
18079
|
-
|
|
18193
|
+
let verticalGap = "3xs";
|
|
18194
|
+
switch (size) {
|
|
18195
|
+
case "sm":
|
|
18196
|
+
verticalGap = "3xs";
|
|
18197
|
+
break;
|
|
18198
|
+
case "lg":
|
|
18199
|
+
verticalGap = "sm";
|
|
18200
|
+
break;
|
|
18201
|
+
}
|
|
18202
|
+
return /* @__PURE__ */ React207.createElement("div", { onClick, className: CLASS_NAME4 }, /* @__PURE__ */ React207.createElement(VStack, { gap: verticalGap, align: "start" }, /* @__PURE__ */ React207.createElement(ProfitAndLossSummariesHeading, { variants }, "Transactions to review"), loaded === "initial" || loaded === "loading" ? /* @__PURE__ */ React207.createElement(BadgeLoader, null) : null, loaded === "complete" && error ? /* @__PURE__ */ React207.createElement(
|
|
18203
|
+
Badge,
|
|
18080
18204
|
{
|
|
18081
|
-
|
|
18082
|
-
|
|
18205
|
+
variant: "error" /* ERROR */,
|
|
18206
|
+
size: "small" /* SMALL */,
|
|
18207
|
+
icon: /* @__PURE__ */ React207.createElement(RefreshCcw_default, { size: 12 }),
|
|
18208
|
+
onClick: () => refetch()
|
|
18083
18209
|
},
|
|
18084
|
-
|
|
18085
|
-
|
|
18086
|
-
|
|
18087
|
-
|
|
18088
|
-
|
|
18089
|
-
|
|
18090
|
-
|
|
18091
|
-
|
|
18092
|
-
|
|
18093
|
-
|
|
18094
|
-
|
|
18095
|
-
|
|
18096
|
-
|
|
18097
|
-
|
|
18098
|
-
|
|
18099
|
-
|
|
18100
|
-
|
|
18101
|
-
|
|
18102
|
-
|
|
18103
|
-
|
|
18104
|
-
" pending"
|
|
18105
|
-
) : null,
|
|
18106
|
-
loaded === "complete" && !error && toReview === 0 ? /* @__PURE__ */ React203.createElement(
|
|
18107
|
-
Badge,
|
|
18108
|
-
{
|
|
18109
|
-
variant: "success" /* SUCCESS */,
|
|
18110
|
-
size: "small" /* SMALL */,
|
|
18111
|
-
icon: /* @__PURE__ */ React203.createElement(Check_default, { size: 12 })
|
|
18112
|
-
},
|
|
18113
|
-
"All done"
|
|
18114
|
-
) : null
|
|
18115
|
-
);
|
|
18116
|
-
};
|
|
18210
|
+
"Refresh"
|
|
18211
|
+
) : null, loaded === "complete" && !error && toReview > 0 ? /* @__PURE__ */ React207.createElement(
|
|
18212
|
+
Badge,
|
|
18213
|
+
{
|
|
18214
|
+
variant: "warning" /* WARNING */,
|
|
18215
|
+
size: "small" /* SMALL */,
|
|
18216
|
+
icon: /* @__PURE__ */ React207.createElement(Bell_default, { size: 12 })
|
|
18217
|
+
},
|
|
18218
|
+
toReview,
|
|
18219
|
+
" pending"
|
|
18220
|
+
) : null, loaded === "complete" && !error && toReview === 0 ? /* @__PURE__ */ React207.createElement(
|
|
18221
|
+
Badge,
|
|
18222
|
+
{
|
|
18223
|
+
variant: "success" /* SUCCESS */,
|
|
18224
|
+
size: "small" /* SMALL */,
|
|
18225
|
+
icon: /* @__PURE__ */ React207.createElement(Check_default, { size: 12 })
|
|
18226
|
+
},
|
|
18227
|
+
"All done"
|
|
18228
|
+
) : null), /* @__PURE__ */ React207.createElement(IconButton, { icon: /* @__PURE__ */ React207.createElement(ChevronRight_default, null), withBorder: true, onClick }));
|
|
18229
|
+
}
|
|
18117
18230
|
|
|
18118
18231
|
// src/views/AccountingOverview/AccountingOverview.tsx
|
|
18119
|
-
import
|
|
18232
|
+
import classNames70 from "classnames";
|
|
18120
18233
|
var AccountingOverview = ({
|
|
18121
18234
|
title = "Accounting overview",
|
|
18122
18235
|
showTitle = true,
|
|
@@ -18127,65 +18240,75 @@ var AccountingOverview = ({
|
|
|
18127
18240
|
chartColorsList,
|
|
18128
18241
|
stringOverrides,
|
|
18129
18242
|
tagFilter = void 0,
|
|
18130
|
-
showTransactionsToReview = true
|
|
18243
|
+
showTransactionsToReview = true,
|
|
18244
|
+
slotProps
|
|
18131
18245
|
}) => {
|
|
18132
|
-
var _a, _b, _c;
|
|
18246
|
+
var _a, _b, _c, _d, _e;
|
|
18133
18247
|
const [pnlToggle, setPnlToggle] = useState61("expenses");
|
|
18134
|
-
|
|
18248
|
+
const profitAndLossSummariesVariants = (_b = (_a = slotProps == null ? void 0 : slotProps.profitAndLoss) == null ? void 0 : _a.summaries) == null ? void 0 : _b.variants;
|
|
18249
|
+
return /* @__PURE__ */ React208.createElement(
|
|
18135
18250
|
ProfitAndLoss,
|
|
18136
18251
|
{
|
|
18137
18252
|
asContainer: false,
|
|
18138
18253
|
tagFilter: tagFilter ? { key: tagFilter.tagKey, values: tagFilter.tagValues } : void 0
|
|
18139
18254
|
},
|
|
18140
|
-
/* @__PURE__ */
|
|
18255
|
+
/* @__PURE__ */ React208.createElement(
|
|
18141
18256
|
View,
|
|
18142
18257
|
{
|
|
18143
18258
|
title,
|
|
18144
18259
|
showHeader: showTitle,
|
|
18145
|
-
header: /* @__PURE__ */
|
|
18260
|
+
header: /* @__PURE__ */ React208.createElement(Header2, null, /* @__PURE__ */ React208.createElement(HeaderRow, null, /* @__PURE__ */ React208.createElement(HeaderCol, null, /* @__PURE__ */ React208.createElement(ProfitAndLoss.DatePicker, null))))
|
|
18146
18261
|
},
|
|
18147
|
-
enableOnboarding && /* @__PURE__ */
|
|
18262
|
+
enableOnboarding && /* @__PURE__ */ React208.createElement(
|
|
18148
18263
|
Onboarding,
|
|
18149
18264
|
{
|
|
18150
18265
|
onTransactionsToReviewClick,
|
|
18151
18266
|
onboardingStepOverride
|
|
18152
18267
|
}
|
|
18153
18268
|
),
|
|
18154
|
-
/* @__PURE__ */
|
|
18155
|
-
|
|
18156
|
-
{
|
|
18157
|
-
stringOverrides: (_a = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _a.summaries,
|
|
18158
|
-
chartColorsList
|
|
18159
|
-
}
|
|
18160
|
-
), showTransactionsToReview && /* @__PURE__ */ React204.createElement(
|
|
18161
|
-
TransactionToReviewCard,
|
|
18269
|
+
/* @__PURE__ */ React208.createElement(
|
|
18270
|
+
Internal_ProfitAndLossSummaries,
|
|
18162
18271
|
{
|
|
18163
|
-
|
|
18164
|
-
|
|
18272
|
+
stringOverrides: (_c = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _c.summaries,
|
|
18273
|
+
chartColorsList,
|
|
18274
|
+
slots: {
|
|
18275
|
+
unstable_AdditionalListItems: showTransactionsToReview ? [
|
|
18276
|
+
/* @__PURE__ */ React208.createElement(
|
|
18277
|
+
TransactionsToReview,
|
|
18278
|
+
{
|
|
18279
|
+
key: "transactions-to-review",
|
|
18280
|
+
usePnlDateRange: true,
|
|
18281
|
+
onClick: onTransactionsToReviewClick,
|
|
18282
|
+
variants: profitAndLossSummariesVariants
|
|
18283
|
+
}
|
|
18284
|
+
)
|
|
18285
|
+
] : void 0
|
|
18286
|
+
},
|
|
18287
|
+
variants: profitAndLossSummariesVariants
|
|
18165
18288
|
}
|
|
18166
|
-
)
|
|
18167
|
-
/* @__PURE__ */
|
|
18289
|
+
),
|
|
18290
|
+
/* @__PURE__ */ React208.createElement(
|
|
18168
18291
|
Container,
|
|
18169
18292
|
{
|
|
18170
18293
|
name: "accounting-overview-profit-and-loss",
|
|
18171
18294
|
asWidget: true,
|
|
18172
18295
|
elevated: true
|
|
18173
18296
|
},
|
|
18174
|
-
/* @__PURE__ */
|
|
18297
|
+
/* @__PURE__ */ React208.createElement(
|
|
18175
18298
|
ProfitAndLoss.Header,
|
|
18176
18299
|
{
|
|
18177
18300
|
text: (stringOverrides == null ? void 0 : stringOverrides.header) || "Profit & Loss"
|
|
18178
18301
|
}
|
|
18179
18302
|
),
|
|
18180
|
-
/* @__PURE__ */
|
|
18303
|
+
/* @__PURE__ */ React208.createElement(
|
|
18181
18304
|
ProfitAndLoss.Chart,
|
|
18182
18305
|
{
|
|
18183
18306
|
tagFilter: tagFilter ? { key: tagFilter.tagKey, values: tagFilter.tagValues } : void 0
|
|
18184
18307
|
}
|
|
18185
18308
|
)
|
|
18186
18309
|
),
|
|
18187
|
-
middleBanner && /* @__PURE__ */
|
|
18188
|
-
/* @__PURE__ */
|
|
18310
|
+
middleBanner && /* @__PURE__ */ React208.createElement(Container, { name: "accounting-overview-middle-banner" }, middleBanner),
|
|
18311
|
+
/* @__PURE__ */ React208.createElement("div", { className: "Layer__accounting-overview-profit-and-loss-charts" }, /* @__PURE__ */ React208.createElement(
|
|
18189
18312
|
Toggle,
|
|
18190
18313
|
{
|
|
18191
18314
|
name: "pnl-detailed-charts",
|
|
@@ -18202,37 +18325,37 @@ var AccountingOverview = ({
|
|
|
18202
18325
|
selected: pnlToggle,
|
|
18203
18326
|
onChange: (e) => setPnlToggle(e.target.value)
|
|
18204
18327
|
}
|
|
18205
|
-
), /* @__PURE__ */
|
|
18328
|
+
), /* @__PURE__ */ React208.createElement(
|
|
18206
18329
|
Container,
|
|
18207
18330
|
{
|
|
18208
|
-
name:
|
|
18331
|
+
name: classNames70(
|
|
18209
18332
|
"accounting-overview-profit-and-loss-chart",
|
|
18210
18333
|
pnlToggle !== "revenue" && "accounting-overview-profit-and-loss-chart--hidden"
|
|
18211
18334
|
)
|
|
18212
18335
|
},
|
|
18213
|
-
/* @__PURE__ */
|
|
18336
|
+
/* @__PURE__ */ React208.createElement(
|
|
18214
18337
|
ProfitAndLoss.DetailedCharts,
|
|
18215
18338
|
{
|
|
18216
18339
|
scope: "revenue",
|
|
18217
18340
|
hideClose: true,
|
|
18218
|
-
stringOverrides: (
|
|
18341
|
+
stringOverrides: (_d = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _d.detailedCharts,
|
|
18219
18342
|
chartColorsList
|
|
18220
18343
|
}
|
|
18221
18344
|
)
|
|
18222
|
-
), /* @__PURE__ */
|
|
18345
|
+
), /* @__PURE__ */ React208.createElement(
|
|
18223
18346
|
Container,
|
|
18224
18347
|
{
|
|
18225
|
-
name:
|
|
18348
|
+
name: classNames70(
|
|
18226
18349
|
"accounting-overview-profit-and-loss-chart",
|
|
18227
18350
|
pnlToggle !== "expenses" && "accounting-overview-profit-and-loss-chart--hidden"
|
|
18228
18351
|
)
|
|
18229
18352
|
},
|
|
18230
|
-
/* @__PURE__ */
|
|
18353
|
+
/* @__PURE__ */ React208.createElement(
|
|
18231
18354
|
ProfitAndLoss.DetailedCharts,
|
|
18232
18355
|
{
|
|
18233
18356
|
scope: "expenses",
|
|
18234
18357
|
hideClose: true,
|
|
18235
|
-
stringOverrides: (
|
|
18358
|
+
stringOverrides: (_e = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _e.detailedCharts,
|
|
18236
18359
|
chartColorsList
|
|
18237
18360
|
}
|
|
18238
18361
|
)
|
|
@@ -18242,7 +18365,7 @@ var AccountingOverview = ({
|
|
|
18242
18365
|
};
|
|
18243
18366
|
|
|
18244
18367
|
// src/views/BankTransactionsWithLinkedAccounts/BankTransactionsWithLinkedAccounts.tsx
|
|
18245
|
-
import
|
|
18368
|
+
import React209 from "react";
|
|
18246
18369
|
var BankTransactionsWithLinkedAccounts = ({
|
|
18247
18370
|
title,
|
|
18248
18371
|
// deprecated
|
|
@@ -18258,13 +18381,13 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
18258
18381
|
mobileComponent,
|
|
18259
18382
|
stringOverrides
|
|
18260
18383
|
}) => {
|
|
18261
|
-
return /* @__PURE__ */
|
|
18384
|
+
return /* @__PURE__ */ React209.createElement(
|
|
18262
18385
|
View,
|
|
18263
18386
|
{
|
|
18264
18387
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "Bank transactions",
|
|
18265
18388
|
showHeader: showTitle
|
|
18266
18389
|
},
|
|
18267
|
-
/* @__PURE__ */
|
|
18390
|
+
/* @__PURE__ */ React209.createElement(
|
|
18268
18391
|
LinkedAccounts,
|
|
18269
18392
|
{
|
|
18270
18393
|
elevated: elevatedLinkedAccounts,
|
|
@@ -18274,7 +18397,7 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
18274
18397
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.linkedAccounts
|
|
18275
18398
|
}
|
|
18276
18399
|
),
|
|
18277
|
-
/* @__PURE__ */
|
|
18400
|
+
/* @__PURE__ */ React209.createElement(
|
|
18278
18401
|
BankTransactions,
|
|
18279
18402
|
{
|
|
18280
18403
|
asWidget: true,
|
|
@@ -18290,7 +18413,7 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
18290
18413
|
};
|
|
18291
18414
|
|
|
18292
18415
|
// src/views/GeneralLedger/GeneralLedger.tsx
|
|
18293
|
-
import
|
|
18416
|
+
import React210, { useState as useState62 } from "react";
|
|
18294
18417
|
var GeneralLedgerView = ({
|
|
18295
18418
|
title,
|
|
18296
18419
|
// deprecated
|
|
@@ -18299,13 +18422,13 @@ var GeneralLedgerView = ({
|
|
|
18299
18422
|
chartOfAccountsOptions
|
|
18300
18423
|
}) => {
|
|
18301
18424
|
const [activeTab, setActiveTab] = useState62("chartOfAccounts");
|
|
18302
|
-
return /* @__PURE__ */
|
|
18425
|
+
return /* @__PURE__ */ React210.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React210.createElement(
|
|
18303
18426
|
View,
|
|
18304
18427
|
{
|
|
18305
18428
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "General Ledger",
|
|
18306
18429
|
showHeader: showTitle
|
|
18307
18430
|
},
|
|
18308
|
-
/* @__PURE__ */
|
|
18431
|
+
/* @__PURE__ */ React210.createElement(
|
|
18309
18432
|
Toggle,
|
|
18310
18433
|
{
|
|
18311
18434
|
name: "general-ledger-tabs",
|
|
@@ -18323,7 +18446,7 @@ var GeneralLedgerView = ({
|
|
|
18323
18446
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
18324
18447
|
}
|
|
18325
18448
|
),
|
|
18326
|
-
activeTab === "chartOfAccounts" ? /* @__PURE__ */
|
|
18449
|
+
activeTab === "chartOfAccounts" ? /* @__PURE__ */ React210.createElement(
|
|
18327
18450
|
ChartOfAccounts,
|
|
18328
18451
|
{
|
|
18329
18452
|
asWidget: true,
|
|
@@ -18332,12 +18455,12 @@ var GeneralLedgerView = ({
|
|
|
18332
18455
|
templateAccountsEditable: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.templateAccountsEditable,
|
|
18333
18456
|
showReversalEntries: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.showReversalEntries
|
|
18334
18457
|
}
|
|
18335
|
-
) : /* @__PURE__ */
|
|
18458
|
+
) : /* @__PURE__ */ React210.createElement(Journal, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.journal })
|
|
18336
18459
|
));
|
|
18337
18460
|
};
|
|
18338
18461
|
|
|
18339
18462
|
// src/views/ProjectProfitability/ProjectProfitability.tsx
|
|
18340
|
-
import
|
|
18463
|
+
import React211, { useState as useState63 } from "react";
|
|
18341
18464
|
import Select4 from "react-select";
|
|
18342
18465
|
var ProjectProfitabilityView = ({
|
|
18343
18466
|
valueOptions,
|
|
@@ -18362,14 +18485,14 @@ var ProjectProfitabilityView = ({
|
|
|
18362
18485
|
values: tagFilter2.tagValues
|
|
18363
18486
|
} : void 0;
|
|
18364
18487
|
};
|
|
18365
|
-
return /* @__PURE__ */
|
|
18488
|
+
return /* @__PURE__ */ React211.createElement(
|
|
18366
18489
|
View,
|
|
18367
18490
|
{
|
|
18368
18491
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || "",
|
|
18369
18492
|
showHeader: showTitle,
|
|
18370
18493
|
viewClassName: "Layer__project-view"
|
|
18371
18494
|
},
|
|
18372
|
-
/* @__PURE__ */
|
|
18495
|
+
/* @__PURE__ */ React211.createElement("div", { className: "Layer__component Layer__header__actions" }, /* @__PURE__ */ React211.createElement("div", { className: "Layer__component" }, /* @__PURE__ */ React211.createElement(
|
|
18373
18496
|
Toggle,
|
|
18374
18497
|
{
|
|
18375
18498
|
name: "project-tabs",
|
|
@@ -18390,7 +18513,7 @@ var ProjectProfitabilityView = ({
|
|
|
18390
18513
|
selected: activeTab,
|
|
18391
18514
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
18392
18515
|
}
|
|
18393
|
-
)), /* @__PURE__ */
|
|
18516
|
+
)), /* @__PURE__ */ React211.createElement(
|
|
18394
18517
|
Select4,
|
|
18395
18518
|
{
|
|
18396
18519
|
className: "Layer__category-menu Layer__select",
|
|
@@ -18408,7 +18531,7 @@ var ProjectProfitabilityView = ({
|
|
|
18408
18531
|
}
|
|
18409
18532
|
}
|
|
18410
18533
|
)),
|
|
18411
|
-
/* @__PURE__ */
|
|
18534
|
+
/* @__PURE__ */ React211.createElement(Container, { name: "project" }, /* @__PURE__ */ React211.createElement(React211.Fragment, null, activeTab === "overview" && /* @__PURE__ */ React211.createElement(
|
|
18412
18535
|
AccountingOverview,
|
|
18413
18536
|
{
|
|
18414
18537
|
stringOverrides: { header: "Project Overview" },
|
|
@@ -18418,7 +18541,7 @@ var ProjectProfitabilityView = ({
|
|
|
18418
18541
|
showTransactionsToReview: false,
|
|
18419
18542
|
showTitle: false
|
|
18420
18543
|
}
|
|
18421
|
-
), activeTab === "transactions" && /* @__PURE__ */
|
|
18544
|
+
), activeTab === "transactions" && /* @__PURE__ */ React211.createElement(
|
|
18422
18545
|
BankTransactions,
|
|
18423
18546
|
{
|
|
18424
18547
|
hideHeader: true,
|
|
@@ -18427,7 +18550,7 @@ var ProjectProfitabilityView = ({
|
|
|
18427
18550
|
tagFilter: tagFilter != null ? tagFilter : void 0
|
|
18428
18551
|
}
|
|
18429
18552
|
}
|
|
18430
|
-
), activeTab === "report" && /* @__PURE__ */
|
|
18553
|
+
), activeTab === "report" && /* @__PURE__ */ React211.createElement(ProfitAndLoss, { asContainer: false, tagFilter: pnlTagFilter }, /* @__PURE__ */ React211.createElement(
|
|
18431
18554
|
ProfitAndLoss.Report,
|
|
18432
18555
|
{
|
|
18433
18556
|
stringOverrides,
|
|
@@ -18439,7 +18562,7 @@ var ProjectProfitabilityView = ({
|
|
|
18439
18562
|
};
|
|
18440
18563
|
|
|
18441
18564
|
// src/views/Reports/Reports.tsx
|
|
18442
|
-
import
|
|
18565
|
+
import React212, { useState as useState64 } from "react";
|
|
18443
18566
|
var getOptions = (enabledReports) => {
|
|
18444
18567
|
return [
|
|
18445
18568
|
enabledReports.includes("profitAndLoss") ? {
|
|
@@ -18473,13 +18596,13 @@ var Reports = ({
|
|
|
18473
18596
|
);
|
|
18474
18597
|
const options = getOptions(enabledReports);
|
|
18475
18598
|
const defaultTitle = enabledReports.length > 1 ? "Reports" : (_a = options.find((option) => option.value = enabledReports[0])) == null ? void 0 : _a.label;
|
|
18476
|
-
return /* @__PURE__ */
|
|
18599
|
+
return /* @__PURE__ */ React212.createElement(
|
|
18477
18600
|
View,
|
|
18478
18601
|
{
|
|
18479
18602
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || defaultTitle,
|
|
18480
18603
|
showHeader: showTitle
|
|
18481
18604
|
},
|
|
18482
|
-
enabledReports.length > 1 && /* @__PURE__ */
|
|
18605
|
+
enabledReports.length > 1 && /* @__PURE__ */ React212.createElement("div", { className: "Layer__component Layer__header__actions" }, /* @__PURE__ */ React212.createElement(
|
|
18483
18606
|
Toggle,
|
|
18484
18607
|
{
|
|
18485
18608
|
name: "reports-tabs",
|
|
@@ -18488,7 +18611,7 @@ var Reports = ({
|
|
|
18488
18611
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
18489
18612
|
}
|
|
18490
18613
|
)),
|
|
18491
|
-
/* @__PURE__ */
|
|
18614
|
+
/* @__PURE__ */ React212.createElement(Container, { name: "reports", ref: containerRef }, /* @__PURE__ */ React212.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React212.createElement(
|
|
18492
18615
|
ReportsPanel,
|
|
18493
18616
|
{
|
|
18494
18617
|
containerRef,
|
|
@@ -18511,7 +18634,7 @@ var ReportsPanel = ({
|
|
|
18511
18634
|
statementOfCashFlowConfig,
|
|
18512
18635
|
view
|
|
18513
18636
|
}) => {
|
|
18514
|
-
return /* @__PURE__ */
|
|
18637
|
+
return /* @__PURE__ */ React212.createElement(React212.Fragment, null, openReport === "profitAndLoss" && /* @__PURE__ */ React212.createElement(
|
|
18515
18638
|
ProfitAndLoss.Report,
|
|
18516
18639
|
__spreadValues({
|
|
18517
18640
|
stringOverrides,
|
|
@@ -18519,7 +18642,7 @@ var ReportsPanel = ({
|
|
|
18519
18642
|
parentRef: containerRef,
|
|
18520
18643
|
view
|
|
18521
18644
|
}, profitAndLossConfig)
|
|
18522
|
-
), openReport === "balanceSheet" && /* @__PURE__ */
|
|
18645
|
+
), openReport === "balanceSheet" && /* @__PURE__ */ React212.createElement(BalanceSheet, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.balanceSheet }), openReport === "statementOfCashFlow" && /* @__PURE__ */ React212.createElement(
|
|
18523
18646
|
StatementOfCashFlow,
|
|
18524
18647
|
__spreadValues({
|
|
18525
18648
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.statementOfCashflow
|
|
@@ -18528,11 +18651,11 @@ var ReportsPanel = ({
|
|
|
18528
18651
|
};
|
|
18529
18652
|
|
|
18530
18653
|
// src/components/ProfitAndLossView/ProfitAndLossView.tsx
|
|
18531
|
-
import
|
|
18654
|
+
import React213, { useContext as useContext47, useRef as useRef21 } from "react";
|
|
18532
18655
|
var COMPONENT_NAME7 = "profit-and-loss";
|
|
18533
18656
|
var ProfitAndLossView = (props) => {
|
|
18534
18657
|
const containerRef = useRef21(null);
|
|
18535
|
-
return /* @__PURE__ */
|
|
18658
|
+
return /* @__PURE__ */ React213.createElement(Container, { name: COMPONENT_NAME7, ref: containerRef }, /* @__PURE__ */ React213.createElement(ProfitAndLoss, null, /* @__PURE__ */ React213.createElement(ProfitAndLossPanel, __spreadValues({ containerRef }, props))));
|
|
18536
18659
|
};
|
|
18537
18660
|
var ProfitAndLossPanel = (_a) => {
|
|
18538
18661
|
var _b = _a, {
|
|
@@ -18543,10 +18666,10 @@ var ProfitAndLossPanel = (_a) => {
|
|
|
18543
18666
|
"stringOverrides"
|
|
18544
18667
|
]);
|
|
18545
18668
|
const { sidebarScope } = useContext47(ProfitAndLoss.Context);
|
|
18546
|
-
return /* @__PURE__ */
|
|
18669
|
+
return /* @__PURE__ */ React213.createElement(
|
|
18547
18670
|
Panel,
|
|
18548
18671
|
{
|
|
18549
|
-
sidebar: /* @__PURE__ */
|
|
18672
|
+
sidebar: /* @__PURE__ */ React213.createElement(
|
|
18550
18673
|
ProfitAndLossDetailedCharts,
|
|
18551
18674
|
{
|
|
18552
18675
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.profitAndLossDetailedCharts
|
|
@@ -18555,7 +18678,7 @@ var ProfitAndLossPanel = (_a) => {
|
|
|
18555
18678
|
sidebarIsOpen: Boolean(sidebarScope),
|
|
18556
18679
|
parentRef: containerRef
|
|
18557
18680
|
},
|
|
18558
|
-
/* @__PURE__ */
|
|
18681
|
+
/* @__PURE__ */ React213.createElement(
|
|
18559
18682
|
ProfitAndLoss.Header,
|
|
18560
18683
|
{
|
|
18561
18684
|
text: (stringOverrides == null ? void 0 : stringOverrides.header) || "Profit & Loss",
|
|
@@ -18563,7 +18686,7 @@ var ProfitAndLossPanel = (_a) => {
|
|
|
18563
18686
|
headingClassName: "Layer__profit-and-loss__title"
|
|
18564
18687
|
}
|
|
18565
18688
|
),
|
|
18566
|
-
/* @__PURE__ */
|
|
18689
|
+
/* @__PURE__ */ React213.createElement(Components, __spreadValues({ stringOverrides }, props))
|
|
18567
18690
|
);
|
|
18568
18691
|
};
|
|
18569
18692
|
var Components = ({
|
|
@@ -18575,7 +18698,7 @@ var Components = ({
|
|
|
18575
18698
|
ProfitAndLoss.Context
|
|
18576
18699
|
);
|
|
18577
18700
|
if (!isLoading && error) {
|
|
18578
|
-
return /* @__PURE__ */
|
|
18701
|
+
return /* @__PURE__ */ React213.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React213.createElement(
|
|
18579
18702
|
DataState,
|
|
18580
18703
|
{
|
|
18581
18704
|
status: "failed" /* failed */,
|
|
@@ -18586,27 +18709,26 @@ var Components = ({
|
|
|
18586
18709
|
}
|
|
18587
18710
|
));
|
|
18588
18711
|
}
|
|
18589
|
-
return /* @__PURE__ */
|
|
18712
|
+
return /* @__PURE__ */ React213.createElement(React213.Fragment, null, !hideChart && /* @__PURE__ */ React213.createElement("div", { className: `Layer__${COMPONENT_NAME7}__chart_with_summaries` }, /* @__PURE__ */ React213.createElement(
|
|
18590
18713
|
"div",
|
|
18591
18714
|
{
|
|
18592
18715
|
className: `Layer__${COMPONENT_NAME7}__chart_with_summaries__summary-col`
|
|
18593
18716
|
},
|
|
18594
|
-
/* @__PURE__ */
|
|
18595
|
-
/* @__PURE__ */
|
|
18717
|
+
/* @__PURE__ */ React213.createElement(ProfitAndLoss.DatePicker, null),
|
|
18718
|
+
/* @__PURE__ */ React213.createElement(
|
|
18596
18719
|
ProfitAndLoss.Summaries,
|
|
18597
18720
|
{
|
|
18598
|
-
vertical: true,
|
|
18599
18721
|
actionable: true,
|
|
18600
18722
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.profitAndLossSummaries
|
|
18601
18723
|
}
|
|
18602
18724
|
)
|
|
18603
|
-
), /* @__PURE__ */
|
|
18725
|
+
), /* @__PURE__ */ React213.createElement(
|
|
18604
18726
|
"div",
|
|
18605
18727
|
{
|
|
18606
18728
|
className: `Layer__${COMPONENT_NAME7}__chart_with_summaries__chart-col`
|
|
18607
18729
|
},
|
|
18608
|
-
/* @__PURE__ */
|
|
18609
|
-
)), !hideTable && /* @__PURE__ */
|
|
18730
|
+
/* @__PURE__ */ React213.createElement(ProfitAndLoss.Chart, null)
|
|
18731
|
+
)), !hideTable && /* @__PURE__ */ React213.createElement(
|
|
18610
18732
|
ProfitAndLoss.Table,
|
|
18611
18733
|
{
|
|
18612
18734
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.profitAndLossTable
|