@zeniai/client-epic-state 5.0.0-betaRD2 → 5.0.0
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/lib/commonPayloadTypes/subAccountView/reportBySubAccountPayload.d.ts +0 -2
- package/lib/commonStateTypes/common.d.ts +1 -1
- package/lib/commonStateTypes/viewAndReport/reportIDHelper.d.ts +0 -1
- package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +1 -3
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
- package/lib/entity/account/accountReducer.js +3 -5
- package/lib/entity/account/accountSelector.d.ts +0 -7
- package/lib/entity/account/accountSelector.js +2 -4
- package/lib/entity/account/accountState.d.ts +1 -3
- package/lib/entity/account/accountState.js +1 -4
- package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +0 -1
- package/lib/entity/account/subAccountSelector.d.ts +0 -2
- package/lib/entity/account/subAccountSelector.js +0 -2
- package/lib/entity/accountGroup/accountGroupSelector.d.ts +0 -22
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -5
- package/lib/entity/tenant/clearAllEpic.js +0 -6
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.js +0 -1
- package/lib/entity/tenant/tenantSelector.d.ts +0 -1
- package/lib/entity/tenant/tenantSelector.js +1 -9
- package/lib/entity/tenant/tenantState.d.ts +0 -1
- package/lib/epic.d.ts +1 -4
- package/lib/epic.js +1 -4
- package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +0 -1
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
- package/lib/esm/entity/account/accountReducer.js +3 -5
- package/lib/esm/entity/account/accountSelector.js +2 -4
- package/lib/esm/entity/account/accountState.js +1 -4
- package/lib/esm/entity/account/subAccountSelector.js +0 -2
- package/lib/esm/entity/tenant/clearAllEpic.js +0 -6
- package/lib/esm/entity/tenant/tenantReducer.js +0 -1
- package/lib/esm/entity/tenant/tenantSelector.js +0 -7
- package/lib/esm/epic.js +1 -4
- package/lib/esm/index.js +4 -7
- package/lib/esm/reducer.js +0 -9
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +1 -1
- package/lib/esm/view/financeStatement/financeStatementSelector.js +1 -12
- package/lib/esm/view/reportsResync/reportsClassViewRefetchingEpic.js +0 -4
- package/lib/index.d.ts +4 -11
- package/lib/index.js +34 -46
- package/lib/reducer.d.ts +0 -9
- package/lib/reducer.js +0 -9
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +1 -1
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -2
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -2
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/financeStatement/financeStatementSelector.d.ts +0 -2
- package/lib/view/financeStatement/financeStatementSelector.js +1 -12
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsClassViewRefetchingEpic.d.ts +1 -2
- package/lib/view/reportsResync/reportsClassViewRefetchingEpic.js +0 -4
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/package.json +1 -1
- package/lib/commonStateTypes/coaBalance/coaBalancesFilterProjectView.d.ts +0 -13
- package/lib/commonStateTypes/coaBalance/coaBalancesFilterProjectView.js +0 -9
- package/lib/commonStateTypes/projectView/projectViewParentID.d.ts +0 -5
- package/lib/commonStateTypes/projectView/projectViewParentID.js +0 -2
- package/lib/entity/project/projectPayload.d.ts +0 -13
- package/lib/entity/project/projectPayload.js +0 -30
- package/lib/entity/project/projectReducer.d.ts +0 -10
- package/lib/entity/project/projectReducer.js +0 -31
- package/lib/entity/project/projectSelector.d.ts +0 -5
- package/lib/entity/project/projectSelector.js +0 -12
- package/lib/entity/project/projectState.d.ts +0 -13
- package/lib/entity/project/projectState.js +0 -2
- package/lib/entity/sectionProjectView/sectionProjectView.d.ts +0 -11
- package/lib/entity/sectionProjectView/sectionProjectView.js +0 -6
- package/lib/entity/sectionProjectView/sectionProjectViewEpic.d.ts +0 -6
- package/lib/entity/sectionProjectView/sectionProjectViewEpic.js +0 -56
- package/lib/entity/sectionProjectView/sectionProjectViewHelper.d.ts +0 -10
- package/lib/entity/sectionProjectView/sectionProjectViewHelper.js +0 -14
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +0 -15
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.js +0 -56
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.d.ts +0 -11
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +0 -94
- package/lib/entity/sectionProjectView/sectionProjectViewSelectorTypes.d.ts +0 -16
- package/lib/entity/sectionProjectView/sectionProjectViewSelectorTypes.js +0 -2
- package/lib/entity/sectionProjectView/sectionProjectViewState.d.ts +0 -4
- package/lib/entity/sectionProjectView/sectionProjectViewState.js +0 -2
- package/lib/esm/commonStateTypes/coaBalance/coaBalancesFilterProjectView.js +0 -5
- package/lib/esm/commonStateTypes/projectView/projectViewParentID.js +0 -1
- package/lib/esm/entity/project/projectPayload.js +0 -26
- package/lib/esm/entity/project/projectReducer.js +0 -27
- package/lib/esm/entity/project/projectSelector.js +0 -8
- package/lib/esm/entity/project/projectState.js +0 -1
- package/lib/esm/entity/sectionProjectView/sectionProjectView.js +0 -3
- package/lib/esm/entity/sectionProjectView/sectionProjectViewEpic.js +0 -52
- package/lib/esm/entity/sectionProjectView/sectionProjectViewHelper.js +0 -10
- package/lib/esm/entity/sectionProjectView/sectionProjectViewReducer.js +0 -52
- package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +0 -87
- package/lib/esm/entity/sectionProjectView/sectionProjectViewSelectorTypes.js +0 -1
- package/lib/esm/entity/sectionProjectView/sectionProjectViewState.js +0 -1
- package/lib/esm/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +0 -47
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +0 -30
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +0 -1
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +0 -113
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +0 -67
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +0 -1
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewState.js +0 -1
- package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.d.ts +0 -9
- package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +0 -51
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.d.ts +0 -6
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +0 -34
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.d.ts +0 -33
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +0 -2
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.d.ts +0 -33
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +0 -117
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.d.ts +0 -9
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +0 -71
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +0 -19
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +0 -2
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.d.ts +0 -22
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.js +0 -2
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getProfitAndLossProjectView = exports.profitAndLossProjectIdsInOrder = void 0;
|
|
4
|
-
const getDifferenceOfBalancesGroupedByPeriod_1 = require("../../commonStateTypes/coaBalance/classBalances/getDifferenceOfBalancesGroupedByPeriod");
|
|
5
|
-
const getSumOfBalancesGroupedByPeriod_1 = require("../../commonStateTypes/coaBalance/classBalances/getSumOfBalancesGroupedByPeriod");
|
|
6
|
-
const coaBalance_1 = require("../../commonStateTypes/coaBalance/coaBalance");
|
|
7
|
-
const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
|
|
8
|
-
const projectSelector_1 = require("../../entity/project/projectSelector");
|
|
9
|
-
const sectionProjectViewSelector_1 = require("../../entity/sectionProjectView/sectionProjectViewSelector");
|
|
10
|
-
const profitAndLossClassesViewSelectorTypes_1 = require("../profitAndLossClassesView/profitAndLossClassesViewSelectorTypes");
|
|
11
|
-
exports.profitAndLossProjectIdsInOrder = [
|
|
12
|
-
'income',
|
|
13
|
-
'cogs',
|
|
14
|
-
'grossProfit',
|
|
15
|
-
'expenses',
|
|
16
|
-
'earningsBeforeInterestAndTax',
|
|
17
|
-
'otherIncome',
|
|
18
|
-
'otherExpenses',
|
|
19
|
-
'netOtherIncome',
|
|
20
|
-
'netIncome',
|
|
21
|
-
];
|
|
22
|
-
const getProfitAndLossProjectView = (filter, accountState, projectState, sectionsState, profitAndLossProjectViewState) => {
|
|
23
|
-
const fetchState = (0, reduceFetchState_1.reduceFetchStateParallelTimeframes)([
|
|
24
|
-
profitAndLossProjectViewState.fetchState.month,
|
|
25
|
-
profitAndLossProjectViewState.fetchState.quarter,
|
|
26
|
-
profitAndLossProjectViewState.fetchState.year,
|
|
27
|
-
]);
|
|
28
|
-
const reportId = 'profit_and_loss_by_projects';
|
|
29
|
-
const sections = {};
|
|
30
|
-
const calculatedSections = {};
|
|
31
|
-
if (fetchState.fetchState === 'Completed') {
|
|
32
|
-
profitAndLossClassesViewSelectorTypes_1.ALL_PANDL_REPORT_VIEW_SECTION_IDS.forEach((sectionId) => {
|
|
33
|
-
sections[`${sectionId}`] = (0, sectionProjectViewSelector_1.getSectionProjectViewReport)(accountState, projectState, sectionsState, profitAndLossProjectViewState.projectIds, {
|
|
34
|
-
reportId,
|
|
35
|
-
sectionId,
|
|
36
|
-
}, filter);
|
|
37
|
-
});
|
|
38
|
-
const grossProfitBalancesByPeriod = (0, getDifferenceOfBalancesGroupedByPeriod_1.getDifferenceOfBalancesGroupedByPeriod)(sections['income'].sectionBalancesTotalByPeriod, sections['cogs'].sectionBalancesTotalByPeriod);
|
|
39
|
-
calculatedSections['grossProfit'] = (0, coaBalance_1.getCOABalances)(grossProfitBalancesByPeriod, filter);
|
|
40
|
-
const ebitBalancesByPeriod = (0, getDifferenceOfBalancesGroupedByPeriod_1.getDifferenceOfBalancesGroupedByPeriod)(grossProfitBalancesByPeriod, sections['expenses'].sectionBalancesTotalByPeriod);
|
|
41
|
-
calculatedSections['earningsBeforeInterestAndTax'] = (0, coaBalance_1.getCOABalances)(ebitBalancesByPeriod, filter);
|
|
42
|
-
const netOtherIncomeBalances = (0, getDifferenceOfBalancesGroupedByPeriod_1.getDifferenceOfBalancesGroupedByPeriod)(sections['otherIncome'].sectionBalancesTotalByPeriod, sections['otherExpenses'].sectionBalancesTotalByPeriod);
|
|
43
|
-
calculatedSections['netOtherIncome'] = (0, coaBalance_1.getCOABalances)(netOtherIncomeBalances, filter);
|
|
44
|
-
const netIncomeBalances = netOtherIncomeBalances != null
|
|
45
|
-
? (0, getSumOfBalancesGroupedByPeriod_1.getSumOfBalancesByGroupedByPeriod)([
|
|
46
|
-
ebitBalancesByPeriod,
|
|
47
|
-
netOtherIncomeBalances,
|
|
48
|
-
])
|
|
49
|
-
: ebitBalancesByPeriod;
|
|
50
|
-
calculatedSections['netIncome'] = (0, coaBalance_1.getCOABalances)(netIncomeBalances, filter);
|
|
51
|
-
}
|
|
52
|
-
return {
|
|
53
|
-
sections,
|
|
54
|
-
calculatedSections,
|
|
55
|
-
reportId: profitAndLossProjectViewState.reportId,
|
|
56
|
-
reportTitle: profitAndLossProjectViewState.reportTitle,
|
|
57
|
-
firstMonthOfFY: profitAndLossProjectViewState.firstMonthOfFY,
|
|
58
|
-
dataAvailable: profitAndLossProjectViewState.dataAvailable,
|
|
59
|
-
bookCloseDate: profitAndLossProjectViewState.bookCloseDate,
|
|
60
|
-
version: profitAndLossProjectViewState.version,
|
|
61
|
-
status: profitAndLossProjectViewState.status,
|
|
62
|
-
fetchState: fetchState.fetchState,
|
|
63
|
-
error: fetchState.error,
|
|
64
|
-
filter,
|
|
65
|
-
uiState: profitAndLossProjectViewState.uiState,
|
|
66
|
-
projects: (0, projectSelector_1.getProjectsByIds)(projectState, profitAndLossProjectViewState.projectIds),
|
|
67
|
-
projectsToFilterOut: profitAndLossProjectViewState.uiState.projectsToFilterOut,
|
|
68
|
-
idsInOrder: exports.profitAndLossProjectIdsInOrder,
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
exports.getProfitAndLossProjectView = getProfitAndLossProjectView;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SectionProjectViewReport } from '../../entity/sectionProjectView/sectionProjectViewSelectorTypes';
|
|
2
|
-
import { COABalancesFilterProjectView } from '../../commonStateTypes/coaBalance/coaBalancesFilterProjectView';
|
|
3
|
-
import { ID } from '../../commonStateTypes/common';
|
|
4
|
-
import { DataAvailable } from '../../commonStateTypes/dataAvailable';
|
|
5
|
-
import { CalculatedSection } from '../../commonStateTypes/selectorTypes/selectorTypes';
|
|
6
|
-
import { SelectorReport } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
7
|
-
import { Project } from '../../entity/project/projectState';
|
|
8
|
-
import { PandLReportViewCalculatedSectionID, PandLReportViewSectionID } from '../profitAndLossClassesView/profitAndLossClassesViewSelectorTypes';
|
|
9
|
-
import { ProfitAndLossProjectViewUIState } from './profitAndLossProjectViewState';
|
|
10
|
-
export interface ProfitAndLossProjectViewReport extends SelectorReport {
|
|
11
|
-
calculatedSections: Record<PandLReportViewCalculatedSectionID, CalculatedSection>;
|
|
12
|
-
filter: COABalancesFilterProjectView;
|
|
13
|
-
idsInOrder: (PandLReportViewSectionID | PandLReportViewCalculatedSectionID)[];
|
|
14
|
-
projects: Project[];
|
|
15
|
-
projectsToFilterOut: ID[];
|
|
16
|
-
sections: Record<PandLReportViewSectionID, SectionProjectViewReport>;
|
|
17
|
-
uiState: ProfitAndLossProjectViewUIState;
|
|
18
|
-
dataAvailable?: DataAvailable;
|
|
19
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Currency } from '../../commonStateTypes/amount';
|
|
2
|
-
import { AccountViewMode, FetchStateAndError, ID } from '../../commonStateTypes/common';
|
|
3
|
-
import { Report } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
|
-
export interface ProfitAndLossProjectViewUIState {
|
|
5
|
-
accountViewMode: AccountViewMode;
|
|
6
|
-
nodeCollapseState: Record<ID, boolean>;
|
|
7
|
-
projectsToFilterOut: ID[];
|
|
8
|
-
scrollPosition: {
|
|
9
|
-
scrollTop: number;
|
|
10
|
-
scrollLeft?: number;
|
|
11
|
-
} | undefined;
|
|
12
|
-
}
|
|
13
|
-
export interface ProfitAndLossProjectViewState extends Report {
|
|
14
|
-
fetchState: {
|
|
15
|
-
month: FetchStateAndError;
|
|
16
|
-
quarter: FetchStateAndError;
|
|
17
|
-
year: FetchStateAndError;
|
|
18
|
-
};
|
|
19
|
-
projectIds: ID[];
|
|
20
|
-
uiState: ProfitAndLossProjectViewUIState;
|
|
21
|
-
currency?: Currency;
|
|
22
|
-
}
|