@zeniai/client-epic-state 5.2.30-betaRD0 → 5.2.31
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/commonStateTypes/coaBalance/classBalances/getSumOfBalancesGroupedByPeriod.js +16 -3
- package/lib/commonStateTypes/viewAndReport/reportIDHelper.d.ts +6 -0
- package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +12 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- 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/sectionClassesViewEpic.js +2 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
- package/lib/epic.d.ts +5 -1
- package/lib/epic.js +8 -0
- package/lib/esm/commonStateTypes/coaBalance/classBalances/getSumOfBalancesGroupedByPeriod.js +16 -3
- package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +7 -0
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/esm/entity/sectionClassesViewV2/sectionClassesViewEpic.js +2 -1
- package/lib/esm/epic.js +8 -0
- package/lib/esm/index.js +7 -3
- package/lib/esm/reducer.js +6 -0
- package/lib/esm/view/cashFlow/cashFlowGroupedSectionOrder.js +47 -0
- package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewEpic.js +30 -0
- package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewPayload.js +1 -0
- package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewReducer.js +129 -0
- package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewSelector.js +53 -0
- package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewSelectorTypes.js +1 -0
- package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewState.js +1 -0
- package/lib/esm/view/cashFlowClassesView/cashFlowForTimeframeClassesViewEpic.js +55 -0
- package/lib/esm/view/cashFlowProjectView/cashFlowForTimeframeProjectViewEpic.js +57 -0
- package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewEpic.js +30 -0
- package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewPayload.js +1 -0
- package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewReducer.js +125 -0
- package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewSelector.js +54 -0
- package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewSelectorTypes.js +1 -0
- package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewState.js +1 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +11 -29
- package/lib/esm/view/financeStatement/financeStatementSelector.js +21 -1
- package/lib/index.d.ts +11 -3
- package/lib/index.js +71 -48
- package/lib/reducer.d.ts +2 -0
- package/lib/reducer.js +6 -0
- package/lib/rootStateTypes.d.ts +4 -0
- 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 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashFlow/cashFlowGroupedSectionOrder.d.ts +15 -0
- package/lib/view/cashFlow/cashFlowGroupedSectionOrder.js +50 -0
- package/lib/view/cashFlowClassesView/cashFlowClassesViewEpic.d.ts +6 -0
- package/lib/view/cashFlowClassesView/cashFlowClassesViewEpic.js +34 -0
- package/lib/view/cashFlowClassesView/cashFlowClassesViewPayload.d.ts +14 -0
- package/lib/view/cashFlowClassesView/cashFlowClassesViewPayload.js +2 -0
- package/lib/view/cashFlowClassesView/cashFlowClassesViewReducer.d.ts +34 -0
- package/lib/view/cashFlowClassesView/cashFlowClassesViewReducer.js +133 -0
- package/lib/view/cashFlowClassesView/cashFlowClassesViewSelector.d.ts +7 -0
- package/lib/view/cashFlowClassesView/cashFlowClassesViewSelector.js +57 -0
- package/lib/view/cashFlowClassesView/cashFlowClassesViewSelectorTypes.d.ts +15 -0
- package/lib/view/cashFlowClassesView/cashFlowClassesViewSelectorTypes.js +2 -0
- package/lib/view/cashFlowClassesView/cashFlowClassesViewState.d.ts +23 -0
- package/lib/view/cashFlowClassesView/cashFlowClassesViewState.js +2 -0
- package/lib/view/cashFlowClassesView/cashFlowForTimeframeClassesViewEpic.d.ts +9 -0
- package/lib/view/cashFlowClassesView/cashFlowForTimeframeClassesViewEpic.js +60 -0
- package/lib/view/cashFlowProjectView/cashFlowForTimeframeProjectViewEpic.d.ts +10 -0
- package/lib/view/cashFlowProjectView/cashFlowForTimeframeProjectViewEpic.js +62 -0
- package/lib/view/cashFlowProjectView/cashFlowProjectViewEpic.d.ts +6 -0
- package/lib/view/cashFlowProjectView/cashFlowProjectViewEpic.js +34 -0
- package/lib/view/cashFlowProjectView/cashFlowProjectViewPayload.d.ts +14 -0
- package/lib/view/cashFlowProjectView/cashFlowProjectViewPayload.js +2 -0
- package/lib/view/cashFlowProjectView/cashFlowProjectViewReducer.d.ts +33 -0
- package/lib/view/cashFlowProjectView/cashFlowProjectViewReducer.js +129 -0
- package/lib/view/cashFlowProjectView/cashFlowProjectViewSelector.d.ts +7 -0
- package/lib/view/cashFlowProjectView/cashFlowProjectViewSelector.js +58 -0
- package/lib/view/cashFlowProjectView/cashFlowProjectViewSelectorTypes.d.ts +19 -0
- package/lib/view/cashFlowProjectView/cashFlowProjectViewSelectorTypes.js +2 -0
- package/lib/view/cashFlowProjectView/cashFlowProjectViewState.d.ts +22 -0
- package/lib/view/cashFlowProjectView/cashFlowProjectViewState.js +2 -0
- 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/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +11 -29
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/financeStatement/financeStatementSelector.d.ts +4 -0
- package/lib/view/financeStatement/financeStatementSelector.js +21 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- 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
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateProjects } from '../../entity/project/projectReducer';
|
|
4
|
+
import { updateSectionProjectView } from '../../entity/sectionProjectView/sectionProjectViewReducer';
|
|
5
|
+
import { RootState } from '../../reducer';
|
|
6
|
+
import { ZeniAPI } from '../../zeniAPI';
|
|
7
|
+
import { fetchCashFlowForTimeframeProjectView, updateCashFlowForTimeframeProjectView, updateCashFlowForTimeframeProjectViewFailure } from './cashFlowProjectViewReducer';
|
|
8
|
+
export type ActionType = ReturnType<typeof fetchCashFlowForTimeframeProjectView> | ReturnType<typeof updateCashFlowForTimeframeProjectView> | ReturnType<typeof updateCashFlowForTimeframeProjectViewFailure> | ReturnType<typeof updateProjects> | ReturnType<typeof updateSectionProjectView>;
|
|
9
|
+
export declare const reportIdUniqueKey: () => "cash_flow_by_projects";
|
|
10
|
+
export declare const fetchCashFlowForTimeframeProjectViewEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchCashFlowForTimeframeProjectViewEpic = exports.reportIdUniqueKey = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const projectReducer_1 = require("../../entity/project/projectReducer");
|
|
7
|
+
const sectionProjectViewReducer_1 = require("../../entity/sectionProjectView/sectionProjectViewReducer");
|
|
8
|
+
const responsePayload_1 = require("../../responsePayload");
|
|
9
|
+
const cashFlowPayload_1 = require("../cashFlow/cashFlowPayload");
|
|
10
|
+
const cashFlowProjectViewReducer_1 = require("./cashFlowProjectViewReducer");
|
|
11
|
+
const getTimeSeriesGroup = (timeframe) => {
|
|
12
|
+
switch (timeframe) {
|
|
13
|
+
case 'month':
|
|
14
|
+
return 'months';
|
|
15
|
+
case 'quarter':
|
|
16
|
+
return 'quarters';
|
|
17
|
+
case 'year':
|
|
18
|
+
return 'years';
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const reportIdUniqueKey = () => 'cash_flow_by_projects';
|
|
22
|
+
exports.reportIdUniqueKey = reportIdUniqueKey;
|
|
23
|
+
const fetchCashFlowForTimeframeProjectViewEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(cashFlowProjectViewReducer_1.fetchCashFlowForTimeframeProjectView.match), (0, operators_1.mergeMap)((action) => {
|
|
24
|
+
const queryValue = {
|
|
25
|
+
is_full_response: true,
|
|
26
|
+
time_series_groups: [getTimeSeriesGroup(action.payload.timeframe)],
|
|
27
|
+
is_group_by_project: true,
|
|
28
|
+
// Only sent when refreshing: the flag makes the backend bypass its saved
|
|
29
|
+
// report and regenerate, so a normal lookup must not carry it.
|
|
30
|
+
...(action.payload.cacheOverride === true
|
|
31
|
+
? { is_hard_refresh: true }
|
|
32
|
+
: {}),
|
|
33
|
+
};
|
|
34
|
+
return zeniAPI
|
|
35
|
+
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/2.0/reports/cash_flow?query=${encodeURIComponent(JSON.stringify(queryValue))}`)
|
|
36
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
37
|
+
if (response.data != null && (0, responsePayload_1.isSuccessResponse)(response)) {
|
|
38
|
+
const actions = [];
|
|
39
|
+
const { report } = response.data;
|
|
40
|
+
const currency = report.currency;
|
|
41
|
+
actions.push((0, projectReducer_1.updateProjects)(report.projects));
|
|
42
|
+
actions.push((0, sectionProjectViewReducer_1.updateSectionProjectView)(action.payload.timeframe, (0, cashFlowPayload_1.toCashFlowReportViewID)('adjustments'), (0, exports.reportIdUniqueKey)(), report.operating_activities.adjustments, report.accounts, currency));
|
|
43
|
+
actions.push((0, sectionProjectViewReducer_1.updateSectionProjectView)(action.payload.timeframe, (0, cashFlowPayload_1.toCashFlowReportViewID)('investing_activities'), (0, exports.reportIdUniqueKey)(), report.investing_activities, report.accounts, currency));
|
|
44
|
+
actions.push((0, sectionProjectViewReducer_1.updateSectionProjectView)(action.payload.timeframe, (0, cashFlowPayload_1.toCashFlowReportViewID)('financing_activities'), (0, exports.reportIdUniqueKey)(), report.financing_activities, report.accounts, currency));
|
|
45
|
+
actions.push((0, sectionProjectViewReducer_1.updateSectionProjectView)(action.payload.timeframe, (0, cashFlowPayload_1.toCashFlowReportViewID)('net_income'), (0, exports.reportIdUniqueKey)(), report.operating_activities.net_income, report.accounts, currency));
|
|
46
|
+
actions.push((0, sectionProjectViewReducer_1.updateSectionProjectView)(action.payload.timeframe, (0, cashFlowPayload_1.toCashFlowReportViewID)('operating_activities'), (0, exports.reportIdUniqueKey)(), report.operating_activities, report.accounts, currency));
|
|
47
|
+
actions.push((0, sectionProjectViewReducer_1.updateSectionProjectView)(action.payload.timeframe, (0, cashFlowPayload_1.toCashFlowReportViewID)('change_in_cash_and_equivalents'), (0, exports.reportIdUniqueKey)(), report.change_in_cash_and_equivalents, report.accounts, currency));
|
|
48
|
+
actions.push((0, cashFlowProjectViewReducer_1.updateCashFlowForTimeframeProjectView)({
|
|
49
|
+
timeframe: action.payload.timeframe,
|
|
50
|
+
report: response.data,
|
|
51
|
+
}));
|
|
52
|
+
return (0, rxjs_1.from)(actions);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
return (0, rxjs_1.of)((0, cashFlowProjectViewReducer_1.updateCashFlowForTimeframeProjectViewFailure)(response.status, action.payload.timeframe));
|
|
56
|
+
}
|
|
57
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, cashFlowProjectViewReducer_1.updateCashFlowForTimeframeProjectViewFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Cash Flow by Project REST API call errored out: ' +
|
|
58
|
+
(error instanceof Error
|
|
59
|
+
? error.message
|
|
60
|
+
: JSON.stringify(error))), action.payload.timeframe))));
|
|
61
|
+
}));
|
|
62
|
+
exports.fetchCashFlowForTimeframeProjectViewEpic = fetchCashFlowForTimeframeProjectViewEpic;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../reducer';
|
|
4
|
+
import { fetchCashFlowForTimeframeProjectView, fetchCashFlowProjectView } from './cashFlowProjectViewReducer';
|
|
5
|
+
export type ActionType = ReturnType<typeof fetchCashFlowProjectView> | ReturnType<typeof fetchCashFlowForTimeframeProjectView>;
|
|
6
|
+
export declare const fetchCashFlowProjectViewEpic: (actions$: ActionsObservable<ActionType>, state: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchCashFlowProjectViewEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const cashFlowProjectViewReducer_1 = require("./cashFlowProjectViewReducer");
|
|
7
|
+
const fetchCashFlowProjectViewEpic = (actions$, state) => actions$.pipe((0, operators_1.filter)(cashFlowProjectViewReducer_1.fetchCashFlowProjectView.match), (0, operators_1.switchMap)((action) => {
|
|
8
|
+
const { cacheOverride } = action.payload;
|
|
9
|
+
if (cacheOverride === true) {
|
|
10
|
+
return (0, rxjs_1.from)([
|
|
11
|
+
(0, cashFlowProjectViewReducer_1.fetchCashFlowForTimeframeProjectView)('month', true),
|
|
12
|
+
(0, cashFlowProjectViewReducer_1.fetchCashFlowForTimeframeProjectView)('quarter', true),
|
|
13
|
+
(0, cashFlowProjectViewReducer_1.fetchCashFlowForTimeframeProjectView)('year', true),
|
|
14
|
+
]);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
const fetchActions = [];
|
|
18
|
+
const projectFetchState = state.value.cashFlowProjectViewState.fetchState;
|
|
19
|
+
if (projectFetchState['month'].fetchState !== 'In-Progress' &&
|
|
20
|
+
projectFetchState['month'].fetchState !== 'Completed') {
|
|
21
|
+
fetchActions.push((0, cashFlowProjectViewReducer_1.fetchCashFlowForTimeframeProjectView)('month'));
|
|
22
|
+
}
|
|
23
|
+
if (projectFetchState['quarter'].fetchState !== 'In-Progress' &&
|
|
24
|
+
projectFetchState['quarter'].fetchState !== 'Completed') {
|
|
25
|
+
fetchActions.push((0, cashFlowProjectViewReducer_1.fetchCashFlowForTimeframeProjectView)('quarter'));
|
|
26
|
+
}
|
|
27
|
+
if (projectFetchState['year'].fetchState !== 'In-Progress' &&
|
|
28
|
+
projectFetchState['year'].fetchState !== 'Completed') {
|
|
29
|
+
fetchActions.push((0, cashFlowProjectViewReducer_1.fetchCashFlowForTimeframeProjectView)('year'));
|
|
30
|
+
}
|
|
31
|
+
return (0, rxjs_1.from)(fetchActions);
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
34
|
+
exports.fetchCashFlowProjectViewEpic = fetchCashFlowProjectViewEpic;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ZeniReportResponse } from '../../responsePayload';
|
|
2
|
+
import { ReportByProjectMetadataPayloadV2, SectionByProjectCOABalanceGroupedPayloadV2 } from '../profitAndLossProjectView/profitAndLossProjectViewPayload';
|
|
3
|
+
interface OperatingActivitiesProjectView {
|
|
4
|
+
adjustments: SectionByProjectCOABalanceGroupedPayloadV2;
|
|
5
|
+
net_income: SectionByProjectCOABalanceGroupedPayloadV2;
|
|
6
|
+
}
|
|
7
|
+
export interface CashFlowProjectViewPayload extends ReportByProjectMetadataPayloadV2 {
|
|
8
|
+
change_in_cash_and_equivalents: SectionByProjectCOABalanceGroupedPayloadV2;
|
|
9
|
+
financing_activities: SectionByProjectCOABalanceGroupedPayloadV2;
|
|
10
|
+
investing_activities: SectionByProjectCOABalanceGroupedPayloadV2;
|
|
11
|
+
operating_activities: SectionByProjectCOABalanceGroupedPayloadV2 & OperatingActivitiesProjectView;
|
|
12
|
+
}
|
|
13
|
+
export type CashFlowReportProjectViewResponse = ZeniReportResponse<CashFlowProjectViewPayload>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AccountViewMode, ID } from '../../commonStateTypes/common';
|
|
2
|
+
import { ZeniAPIStatus, ZeniReportData } from '../../responsePayload';
|
|
3
|
+
import { CashFlowProjectViewPayload } from './cashFlowProjectViewPayload';
|
|
4
|
+
import { CashFlowProjectViewState } from './cashFlowProjectViewState';
|
|
5
|
+
export declare const initialState: CashFlowProjectViewState;
|
|
6
|
+
export declare const fetchCashFlowProjectView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
|
|
7
|
+
cacheOverride: boolean;
|
|
8
|
+
}, "cashFlowProjectView/fetchCashFlowProjectView", never, never>, fetchCashFlowForTimeframeProjectView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[timeframe: "month" | "year" | "quarter", cacheOverride?: boolean | undefined], {
|
|
9
|
+
timeframe: "month" | "year" | "quarter";
|
|
10
|
+
cacheOverride: boolean;
|
|
11
|
+
}, "cashFlowProjectView/fetchCashFlowForTimeframeProjectView", never, never>, updateCashFlowForTimeframeProjectView: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
12
|
+
report: ZeniReportData<CashFlowProjectViewPayload>;
|
|
13
|
+
timeframe: "month" | "quarter" | "year";
|
|
14
|
+
}, "cashFlowProjectView/updateCashFlowForTimeframeProjectView">, updateCashFlowForTimeframeProjectViewFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, timeframe: "month" | "year" | "quarter"], {
|
|
15
|
+
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
16
|
+
timeframe: "month" | "year" | "quarter";
|
|
17
|
+
}, "cashFlowProjectView/updateCashFlowForTimeframeProjectViewFailure", never, never>, updateCashFlowProjectsToFilterOut: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
18
|
+
projectsToFilterOut: ID[];
|
|
19
|
+
}, "cashFlowProjectView/updateCashFlowProjectsToFilterOut">, updateCashFlowProjectViewUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
20
|
+
nodeCollapseState?: {
|
|
21
|
+
isCollapsed: boolean;
|
|
22
|
+
nodeId: ID;
|
|
23
|
+
};
|
|
24
|
+
resetLeftScroll?: boolean;
|
|
25
|
+
scrollPosition?: {
|
|
26
|
+
scrollTop: number;
|
|
27
|
+
scrollLeft?: number;
|
|
28
|
+
};
|
|
29
|
+
}, "cashFlowProjectView/updateCashFlowProjectViewUIState">, updateCashFlowProjectViewAccountViewMode: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
30
|
+
viewMode: AccountViewMode;
|
|
31
|
+
}, "cashFlowProjectView/updateCashFlowProjectViewAccountViewMode">, resetCashFlowProjectNodeCollapseState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cashFlowProjectView/resetCashFlowProjectNodeCollapseState">;
|
|
32
|
+
declare const _default: import("redux").Reducer<CashFlowProjectViewState>;
|
|
33
|
+
export default _default;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.resetCashFlowProjectNodeCollapseState = exports.updateCashFlowProjectViewAccountViewMode = exports.updateCashFlowProjectViewUIState = exports.updateCashFlowProjectsToFilterOut = exports.updateCashFlowForTimeframeProjectViewFailure = exports.updateCashFlowForTimeframeProjectView = exports.fetchCashFlowForTimeframeProjectView = exports.fetchCashFlowProjectView = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const viewAndReportPayloadv2_1 = require("../../commonPayloadTypes/v2/viewAndReportPayloadv2");
|
|
7
|
+
const rootActions_1 = require("../../rootActions");
|
|
8
|
+
exports.initialState = {
|
|
9
|
+
bookCloseDate: undefined,
|
|
10
|
+
fetchState: {
|
|
11
|
+
month: {
|
|
12
|
+
fetchState: 'Not-Started',
|
|
13
|
+
error: undefined,
|
|
14
|
+
},
|
|
15
|
+
quarter: {
|
|
16
|
+
fetchState: 'Not-Started',
|
|
17
|
+
error: undefined,
|
|
18
|
+
},
|
|
19
|
+
year: {
|
|
20
|
+
fetchState: 'Not-Started',
|
|
21
|
+
error: undefined,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
firstMonthOfFY: 1,
|
|
25
|
+
projectIds: [],
|
|
26
|
+
reportId: 'cash_flow_by_projects',
|
|
27
|
+
reportTitle: 'cash_flow_by_projects',
|
|
28
|
+
uiState: {
|
|
29
|
+
accountViewMode: 'account_group',
|
|
30
|
+
nodeCollapseState: {},
|
|
31
|
+
projectsToFilterOut: [],
|
|
32
|
+
scrollPosition: undefined,
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
const cashFlowProjectView = (0, toolkit_1.createSlice)({
|
|
36
|
+
name: 'cashFlowProjectView',
|
|
37
|
+
initialState: exports.initialState,
|
|
38
|
+
reducers: {
|
|
39
|
+
fetchCashFlowProjectView: {
|
|
40
|
+
prepare(cacheOverride = false) {
|
|
41
|
+
return { payload: { cacheOverride } };
|
|
42
|
+
},
|
|
43
|
+
reducer(
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
45
|
+
_draft,
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
47
|
+
_action) {
|
|
48
|
+
// nothing to do here
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
fetchCashFlowForTimeframeProjectView: {
|
|
52
|
+
prepare(timeframe, cacheOverride = false) {
|
|
53
|
+
return { payload: { timeframe, cacheOverride } };
|
|
54
|
+
},
|
|
55
|
+
reducer(draft, action) {
|
|
56
|
+
const timeframe = action.payload.timeframe;
|
|
57
|
+
draft.fetchState[timeframe].fetchState = 'In-Progress';
|
|
58
|
+
draft.fetchState[timeframe].error = undefined;
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
updateCashFlowForTimeframeProjectView(draft, action) {
|
|
62
|
+
doUpdateCashFlowProjectView(draft, action.payload.timeframe, action.payload.report);
|
|
63
|
+
},
|
|
64
|
+
updateCashFlowForTimeframeProjectViewFailure: {
|
|
65
|
+
prepare(error, timeframe) {
|
|
66
|
+
return {
|
|
67
|
+
payload: {
|
|
68
|
+
error,
|
|
69
|
+
timeframe,
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
reducer(draft, action) {
|
|
74
|
+
draft.fetchState[action.payload.timeframe] = {
|
|
75
|
+
fetchState: 'Error',
|
|
76
|
+
error: action.payload.error,
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
updateCashFlowProjectsToFilterOut(draft, action) {
|
|
81
|
+
draft.uiState.projectsToFilterOut = action.payload.projectsToFilterOut;
|
|
82
|
+
},
|
|
83
|
+
updateCashFlowProjectViewUIState(draft, action) {
|
|
84
|
+
const { nodeCollapseState, scrollPosition, resetLeftScroll } = action.payload;
|
|
85
|
+
if (nodeCollapseState != null) {
|
|
86
|
+
draft.uiState.nodeCollapseState = Object.assign({}, draft.uiState.nodeCollapseState, {
|
|
87
|
+
[nodeCollapseState.nodeId]: nodeCollapseState.isCollapsed,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
// Mutually exclusive: resetLeftScroll clears only scrollLeft from the
|
|
91
|
+
// recorded position, scrollPosition replaces the whole record.
|
|
92
|
+
if (resetLeftScroll === true && draft.uiState.scrollPosition != null) {
|
|
93
|
+
draft.uiState.scrollPosition.scrollLeft = undefined;
|
|
94
|
+
}
|
|
95
|
+
else if (scrollPosition != null) {
|
|
96
|
+
draft.uiState.scrollPosition = scrollPosition;
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
updateCashFlowProjectViewAccountViewMode(draft, action) {
|
|
100
|
+
draft.uiState.accountViewMode = action.payload.viewMode;
|
|
101
|
+
},
|
|
102
|
+
resetCashFlowProjectNodeCollapseState(draft) {
|
|
103
|
+
draft.uiState.nodeCollapseState = {};
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
extraReducers: (builder) => {
|
|
107
|
+
builder.addCase(rootActions_1.clearAll, (draft) => {
|
|
108
|
+
Object.assign(draft, exports.initialState);
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
_a = cashFlowProjectView.actions, exports.fetchCashFlowProjectView = _a.fetchCashFlowProjectView, exports.fetchCashFlowForTimeframeProjectView = _a.fetchCashFlowForTimeframeProjectView, exports.updateCashFlowForTimeframeProjectView = _a.updateCashFlowForTimeframeProjectView, exports.updateCashFlowForTimeframeProjectViewFailure = _a.updateCashFlowForTimeframeProjectViewFailure, exports.updateCashFlowProjectsToFilterOut = _a.updateCashFlowProjectsToFilterOut, exports.updateCashFlowProjectViewUIState = _a.updateCashFlowProjectViewUIState, exports.updateCashFlowProjectViewAccountViewMode = _a.updateCashFlowProjectViewAccountViewMode, exports.resetCashFlowProjectNodeCollapseState = _a.resetCashFlowProjectNodeCollapseState;
|
|
113
|
+
exports.default = cashFlowProjectView.reducer;
|
|
114
|
+
const doUpdateCashFlowProjectView = (draft, timeframe, cashFlowReport) => {
|
|
115
|
+
const report = (0, viewAndReportPayloadv2_1.mapReportPayloadV2ToReportV2)(cashFlowReport.report);
|
|
116
|
+
draft.currency = report.currency;
|
|
117
|
+
draft.dataAvailable = report.dataAvailable;
|
|
118
|
+
draft.firstMonthOfFY = report.firstMonthOfFY;
|
|
119
|
+
draft.bookCloseDate = report.bookCloseDate;
|
|
120
|
+
draft.status = report.status;
|
|
121
|
+
draft.fetchState[timeframe].fetchState = 'Completed';
|
|
122
|
+
draft.fetchState[timeframe].error = undefined;
|
|
123
|
+
// Populated once, as with classHierarchy in the classes view: a project added
|
|
124
|
+
// mid-session is not picked up until the store is cleared, even by a hard
|
|
125
|
+
// refresh. Matches profitAndLossProjectViewReducer.
|
|
126
|
+
if (draft.projectIds.length <= 0) {
|
|
127
|
+
draft.projectIds = cashFlowReport.report.projects.map((project) => project.accounting_project_id);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { COABalancesFilterProjectView } from '../../commonStateTypes/coaBalance/coaBalancesFilterProjectView';
|
|
2
|
+
import { AccountState } from '../../entity/account/accountState';
|
|
3
|
+
import { ProjectState } from '../../entity/project/projectReducer';
|
|
4
|
+
import { SectionProjectViewState } from '../../entity/sectionProjectView/sectionProjectViewState';
|
|
5
|
+
import { CashFlowProjectViewReport } from './cashFlowProjectViewSelectorTypes';
|
|
6
|
+
import { CashFlowProjectViewState } from './cashFlowProjectViewState';
|
|
7
|
+
export declare const getCashFlowProjectView: (filter: COABalancesFilterProjectView, accountState: AccountState, projectState: ProjectState, sectionsState: SectionProjectViewState, cashFlowProjectViewState: CashFlowProjectViewState) => CashFlowProjectViewReport;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCashFlowProjectView = void 0;
|
|
4
|
+
const getCOABalancesSlice_1 = require("../../commonStateTypes/coaBalance/getCOABalancesSlice");
|
|
5
|
+
const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
|
|
6
|
+
const projectSelector_1 = require("../../entity/project/projectSelector");
|
|
7
|
+
const sectionProjectViewSelector_1 = require("../../entity/sectionProjectView/sectionProjectViewSelector");
|
|
8
|
+
const cashFlowGroupedSectionOrder_1 = require("../cashFlow/cashFlowGroupedSectionOrder");
|
|
9
|
+
const getCashFlowProjectView = (filter, accountState, projectState, sectionsState, cashFlowProjectViewState) => {
|
|
10
|
+
const fetchState = (0, reduceFetchState_1.reduceFetchStateParallelTimeframes)([
|
|
11
|
+
cashFlowProjectViewState.fetchState.month,
|
|
12
|
+
cashFlowProjectViewState.fetchState.quarter,
|
|
13
|
+
cashFlowProjectViewState.fetchState.year,
|
|
14
|
+
]);
|
|
15
|
+
const reportId = 'cash_flow_by_projects';
|
|
16
|
+
const sections = {};
|
|
17
|
+
const calculatedSections = {};
|
|
18
|
+
if (fetchState.fetchState === 'Completed') {
|
|
19
|
+
cashFlowGroupedSectionOrder_1.CASH_FLOW_GROUPED_BREAKDOWN_IDS.forEach((sectionId) => {
|
|
20
|
+
sections[sectionId] = (0, sectionProjectViewSelector_1.getSectionProjectViewReport)(accountState, projectState, sectionsState, cashFlowProjectViewState.projectIds, { reportId, sectionId }, filter);
|
|
21
|
+
});
|
|
22
|
+
// These come back grouped, so each figure is read through the section layer
|
|
23
|
+
// and arrives already pruned by the class/project picker — the same source
|
|
24
|
+
// the breakdown rows above render from, so the two can never disagree.
|
|
25
|
+
cashFlowGroupedSectionOrder_1.CASH_FLOW_GROUPED_CALCULATED_IDS.forEach((calculatedSectionId) => {
|
|
26
|
+
calculatedSections[calculatedSectionId] = (0, getCOABalancesSlice_1.getCOABalances)(
|
|
27
|
+
// Already built by the breakdown loop above; rebuilding it would repeat
|
|
28
|
+
// the whole section walk on every recompute.
|
|
29
|
+
sections[calculatedSectionId].sectionBalancesTotalByPeriod, filter);
|
|
30
|
+
});
|
|
31
|
+
calculatedSections['investingActivitiesTotal'] = (0, getCOABalancesSlice_1.getCOABalances)(sections['investingActivities'].sectionBalancesTotalByPeriod, filter);
|
|
32
|
+
calculatedSections['financingActivitiesTotal'] = (0, getCOABalancesSlice_1.getCOABalances)(sections['financingActivities'].sectionBalancesTotalByPeriod, filter);
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
sections,
|
|
36
|
+
calculatedSections,
|
|
37
|
+
fetchState: fetchState.fetchState,
|
|
38
|
+
error: fetchState.error,
|
|
39
|
+
filter,
|
|
40
|
+
uiState: cashFlowProjectViewState.uiState,
|
|
41
|
+
projects: (0, projectSelector_1.getProjectsByIds)(projectState, cashFlowProjectViewState.projectIds),
|
|
42
|
+
projectsToFilterOut: cashFlowProjectViewState.uiState.projectsToFilterOut,
|
|
43
|
+
reportId: cashFlowProjectViewState.reportId,
|
|
44
|
+
reportTitle: cashFlowProjectViewState.reportTitle,
|
|
45
|
+
firstMonthOfFY: cashFlowProjectViewState.firstMonthOfFY,
|
|
46
|
+
dataAvailable: cashFlowProjectViewState.dataAvailable,
|
|
47
|
+
bookCloseDate: cashFlowProjectViewState.bookCloseDate,
|
|
48
|
+
version: cashFlowProjectViewState.version,
|
|
49
|
+
status: cashFlowProjectViewState.status,
|
|
50
|
+
idsInOrder: cashFlowGroupedSectionOrder_1.CASH_FLOW_GROUPED_IDS_IN_ORDER,
|
|
51
|
+
rootSectionsWithSubSectionIds: {
|
|
52
|
+
operatingActivities: cashFlowGroupedSectionOrder_1.CASH_FLOW_GROUPED_OPERATING_IDS_IN_ORDER,
|
|
53
|
+
investingActivities: cashFlowGroupedSectionOrder_1.CASH_FLOW_GROUPED_INVESTING_IDS_IN_ORDER,
|
|
54
|
+
financingActivities: cashFlowGroupedSectionOrder_1.CASH_FLOW_GROUPED_FINANCING_IDS_IN_ORDER,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
exports.getCashFlowProjectView = getCashFlowProjectView;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { COABalancesFilterProjectView } from '../../commonStateTypes/coaBalance/coaBalancesFilterProjectView';
|
|
2
|
+
import { ID } from '../../commonStateTypes/common';
|
|
3
|
+
import { CalculatedSection } from '../../commonStateTypes/selectorTypes/selectorTypes';
|
|
4
|
+
import { SelectorReport } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
|
+
import { Project } from '../../entity/project/projectState';
|
|
6
|
+
import { SectionProjectViewReport } from '../../entity/sectionProjectView/sectionProjectViewSelectorTypes';
|
|
7
|
+
import { CashFlowReportViewCalculatedSectionID, CashFlowReportViewSectionID } from '../cashFlow/cashFlowPayload';
|
|
8
|
+
import { SectionIdsWithSubSectionIds } from '../cashFlow/cashFlowSelectorTypes';
|
|
9
|
+
import { CashFlowProjectViewUIState } from './cashFlowProjectViewState';
|
|
10
|
+
export interface CashFlowProjectViewReport extends SelectorReport {
|
|
11
|
+
calculatedSections: Record<CashFlowReportViewCalculatedSectionID, CalculatedSection>;
|
|
12
|
+
filter: COABalancesFilterProjectView;
|
|
13
|
+
idsInOrder: (CashFlowReportViewSectionID | CashFlowReportViewCalculatedSectionID)[];
|
|
14
|
+
projects: Project[];
|
|
15
|
+
projectsToFilterOut: ID[];
|
|
16
|
+
rootSectionsWithSubSectionIds: SectionIdsWithSubSectionIds;
|
|
17
|
+
sections: Record<CashFlowReportViewSectionID, SectionProjectViewReport> & Partial<Record<CashFlowReportViewCalculatedSectionID, SectionProjectViewReport>>;
|
|
18
|
+
uiState: CashFlowProjectViewUIState;
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Currency } from '../../commonStateTypes/amount';
|
|
2
|
+
import { AccountViewMode, FetchStateAndError, ID } from '../../commonStateTypes/common';
|
|
3
|
+
import { Report } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
|
+
export interface CashFlowProjectViewUIState {
|
|
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 CashFlowProjectViewState extends Report {
|
|
14
|
+
fetchState: {
|
|
15
|
+
month: FetchStateAndError;
|
|
16
|
+
quarter: FetchStateAndError;
|
|
17
|
+
year: FetchStateAndError;
|
|
18
|
+
};
|
|
19
|
+
projectIds: ID[];
|
|
20
|
+
uiState: CashFlowProjectViewUIState;
|
|
21
|
+
currency?: Currency;
|
|
22
|
+
}
|
|
@@ -15,7 +15,7 @@ export declare const getCashInCashOut: (accountState: AccountState, accountGroup
|
|
|
15
15
|
firstMonthOfFY: 1 | 2 | 3 | 4 | 5 | 11 | 6 | 7 | 8 | 9 | 10 | 12;
|
|
16
16
|
dataAvailable: import("../../commonStateTypes/timeframeTick").TimeframeTick | undefined;
|
|
17
17
|
availableNumberOfPeriods: number | undefined;
|
|
18
|
-
reportId: "vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
18
|
+
reportId: "vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "cash_flow_by_classes" | "cash_flow_by_projects" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
19
19
|
reportTitle: string;
|
|
20
20
|
version: string | number | undefined;
|
|
21
21
|
status: import("../..").Status | undefined;
|
|
@@ -12,7 +12,7 @@ export declare const getCashPosition: (accountState: AccountState, cashPositionS
|
|
|
12
12
|
firstMonthOfFY: 1 | 2 | 3 | 4 | 5 | 11 | 6 | 7 | 8 | 9 | 10 | 12;
|
|
13
13
|
dataAvailable: import("../../commonStateTypes/timeframeTick").TimeframeTick | undefined;
|
|
14
14
|
availableNumberOfPeriods: number | undefined;
|
|
15
|
-
reportId: "vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
15
|
+
reportId: "vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "cash_flow_by_classes" | "cash_flow_by_projects" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
16
16
|
reportTitle: string;
|
|
17
17
|
version: string | number | undefined;
|
|
18
18
|
status: import("../..").Status | undefined;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DashboardState } from './dashboardState';
|
|
2
2
|
export declare const initialState: DashboardState;
|
|
3
|
-
export declare const fetchDashboard: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[userId: string, companyId: string, tenantId: string, fetchFullReport?: any, cacheOverride?: any, excludeResources?: ("vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts")[] | undefined], {
|
|
3
|
+
export declare const fetchDashboard: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[userId: string, companyId: string, tenantId: string, fetchFullReport?: any, cacheOverride?: any, excludeResources?: ("vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "cash_flow_by_classes" | "cash_flow_by_projects" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts")[] | undefined], {
|
|
4
4
|
userId: string;
|
|
5
5
|
companyId: string;
|
|
6
6
|
tenantId: string;
|
|
7
7
|
fetchFullReport: any;
|
|
8
8
|
cacheOverride: any;
|
|
9
|
-
excludeResources: ("vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts")[];
|
|
9
|
+
excludeResources: ("vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "cash_flow_by_classes" | "cash_flow_by_projects" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts")[];
|
|
10
10
|
}, "dashboard/fetchDashboard", never, never>;
|
|
11
11
|
declare const _default: import("redux").Reducer<DashboardState>;
|
|
12
12
|
export default _default;
|
|
@@ -12,18 +12,6 @@ const rootActions_1 = require("../../../../rootActions");
|
|
|
12
12
|
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
13
13
|
const jeSchedulesPayload_1 = require("../../payload/jeSchedulesPayload");
|
|
14
14
|
const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
|
|
15
|
-
/**
|
|
16
|
-
* How far back to look for accrued schedules, matching the Vendors page
|
|
17
|
-
* (`getDefaultSelectedTimeframeForScheduleType`, 'accrued_expenses'), which queries the same
|
|
18
|
-
* start_date filter through /1.0/schedules.
|
|
19
|
-
*/
|
|
20
|
-
const ACCRUED_LOOKBACK_MONTHS = 24;
|
|
21
|
-
/**
|
|
22
|
-
* One-time accruals keep their own, narrower lookback. Unlike an accrued schedule they belong to
|
|
23
|
-
* exactly one service month and never span months, so the reason the accrued window has to reach
|
|
24
|
-
* back does not apply to them -- widening it would only add older history to the Existing tab.
|
|
25
|
-
*/
|
|
26
|
-
const ONE_TIME_ACCRUAL_LOOKBACK_MONTHS = 12;
|
|
27
15
|
const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.fetchJeSchedules.match), (0, operators_1.mergeMap)((action) => {
|
|
28
16
|
const state = state$.value;
|
|
29
17
|
const { expenseAutomationViewState: { selectedPeriodByTenantId }, } = state;
|
|
@@ -45,21 +33,15 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
|
|
|
45
33
|
const endDate = isClosePeriodTab || existingEndDate == null
|
|
46
34
|
? (0, timePeriod_2.toString)(period.end)
|
|
47
35
|
: (0, timePeriod_2.toString)(existingEndDate);
|
|
48
|
-
// Accrued rows are windowed on the schedule's own start_date
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
.format(timePeriod_1.DEFAULT_DATE_FORMAT);
|
|
58
|
-
// Formatted as a service month, not a date: that is the only thing it is sent as.
|
|
59
|
-
const oneTimeAccrualServiceMonthStart = parsedEndDate
|
|
60
|
-
.subtract(ONE_TIME_ACCRUAL_LOOKBACK_MONTHS, 'month')
|
|
61
|
-
.startOf('month')
|
|
62
|
-
.format(jeSchedulesPayload_1.SERVICE_MONTH_FORMAT);
|
|
36
|
+
// Accrued rows are windowed on the schedule's own start_date rather than a transaction date,
|
|
37
|
+
// so they get their own bounds. Review wants the month being closed; Existing wants the year
|
|
38
|
+
// up to endDate, snapped to the 1st — the same window the server used to compute for itself.
|
|
39
|
+
const accruedStartDate = isClosePeriodTab
|
|
40
|
+
? (0, timePeriod_2.toString)(period.start)
|
|
41
|
+
: (0, zeniDayJS_1.date)(endDate)
|
|
42
|
+
.subtract(1, 'year')
|
|
43
|
+
.startOf('month')
|
|
44
|
+
.format(timePeriod_1.DEFAULT_DATE_FORMAT);
|
|
63
45
|
const queryParam = {
|
|
64
46
|
base_transaction_end_date: endDate,
|
|
65
47
|
end_date: endDate,
|
|
@@ -80,8 +62,8 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
|
|
|
80
62
|
filter_failed_je_postings_by_date: true,
|
|
81
63
|
}
|
|
82
64
|
: {
|
|
83
|
-
one_time_accrual_service_month_start:
|
|
84
|
-
one_time_accrual_service_month_end:
|
|
65
|
+
one_time_accrual_service_month_start: (0, zeniDayJS_1.date)(accruedStartDate).format(jeSchedulesPayload_1.SERVICE_MONTH_FORMAT),
|
|
66
|
+
one_time_accrual_service_month_end: (0, zeniDayJS_1.date)(endDate).format(jeSchedulesPayload_1.SERVICE_MONTH_FORMAT),
|
|
85
67
|
// Existing lists what actually reached the books.
|
|
86
68
|
one_time_accrual_statuses: ['posted'],
|
|
87
69
|
// A failed posting from an earlier month still needs to surface here, so this list
|
|
@@ -17,7 +17,7 @@ export declare const fetchFinanceStatement: import("@reduxjs/toolkit").ActionCre
|
|
|
17
17
|
firstMonthOfFY: Month;
|
|
18
18
|
maxNumOfPeriodsToHighlight: number;
|
|
19
19
|
thisPeriod: TimeframeTick;
|
|
20
|
-
}, "financeStatement/updateFinanceStatementThisPeriod">, updateCOABalancesRange: import("@reduxjs/toolkit").ActionCreatorWithPayload<COABalancesRange, "financeStatement/updateCOABalancesRange">, updateSelectedReportId: import("@reduxjs/toolkit").ActionCreatorWithPayload<"vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts", "financeStatement/updateSelectedReportId">, updateFinanceStatementAdditionalBalancesSelection: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
20
|
+
}, "financeStatement/updateFinanceStatementThisPeriod">, updateCOABalancesRange: import("@reduxjs/toolkit").ActionCreatorWithPayload<COABalancesRange, "financeStatement/updateCOABalancesRange">, updateSelectedReportId: import("@reduxjs/toolkit").ActionCreatorWithPayload<"vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "cash_flow_by_classes" | "cash_flow_by_projects" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts", "financeStatement/updateSelectedReportId">, updateFinanceStatementAdditionalBalancesSelection: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
21
21
|
additionalBalances: COABalanceType[];
|
|
22
22
|
coaBalances: COABalance[];
|
|
23
23
|
firstMonthOfFY: Month;
|
|
@@ -9,6 +9,8 @@ import { BalanceSheetReport } from '../balanceSheet/balanceSheetSelectorTypes';
|
|
|
9
9
|
import { BalanceSheetClassesViewReport } from '../balanceSheetClassesView/balanceSheetClassesViewSelectorTypes';
|
|
10
10
|
import { BalanceSheetProjectViewReport } from '../balanceSheetProjectView/balanceSheetProjectViewSelectorTypes';
|
|
11
11
|
import { CashFlowReport } from '../cashFlow/cashFlowSelectorTypes';
|
|
12
|
+
import { CashFlowClassesViewReport } from '../cashFlowClassesView/cashFlowClassesViewSelectorTypes';
|
|
13
|
+
import { CashFlowProjectViewReport } from '../cashFlowProjectView/cashFlowProjectViewSelectorTypes';
|
|
12
14
|
import { ProfitAndLossReport } from '../profitAndLoss/profitAndLossSelector';
|
|
13
15
|
import { ProfitAndLossByClassHorizontalReport } from '../profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes';
|
|
14
16
|
import { ProfitAndLossClassesViewReport } from '../profitAndLossClassesView/profitAndLossClassesViewSelectorTypes';
|
|
@@ -19,6 +21,8 @@ export interface FinanceStatementReport extends SelectorReport {
|
|
|
19
21
|
balanceSheetByProjectReport: BalanceSheetProjectViewReport;
|
|
20
22
|
balanceSheetReport: BalanceSheetReport;
|
|
21
23
|
balancesInTimeframe: COABalance[];
|
|
24
|
+
cashFlowByClassReport: CashFlowClassesViewReport;
|
|
25
|
+
cashFlowByProjectReport: CashFlowProjectViewReport;
|
|
22
26
|
cashFlowReport: CashFlowReport;
|
|
23
27
|
displayOrder: COABalancesOrder;
|
|
24
28
|
downloadState: FetchState;
|