@zeniai/client-epic-state 4.20.3-betaRD2 → 4.20.3-betaRD21
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 +1 -1
- package/lib/entity/account/accountPayload.d.ts +2 -0
- package/lib/entity/account/accountReducer.d.ts +5 -2
- package/lib/entity/account/accountReducer.js +10 -7
- 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/accountGroup/accountGroupSelector.d.ts +0 -22
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.d.ts +44 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +55 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.d.ts +10 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +51 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +48 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +66 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.d.ts +52 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.js +37 -0
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
- package/lib/entity/chargeCard/chargeCard.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/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
- package/lib/entity/entityApprovalStatus/entityApprovalStatusState.d.ts +2 -2
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/jeSchedules/jeSchedulesTypes.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/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/tenant/clearAllEpic.d.ts +4 -5
- package/lib/entity/tenant/clearAllEpic.js +4 -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/entity/transaction/payloadTypes/transactionPayload.js +1 -0
- package/lib/entity/userRole/userRoleType.d.ts +2 -2
- package/lib/epic.d.ts +3 -4
- package/lib/epic.js +3 -4
- package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +0 -1
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +1 -1
- package/lib/esm/entity/account/accountReducer.js +9 -6
- package/lib/esm/entity/account/accountSelector.js +2 -4
- package/lib/esm/entity/account/accountState.js +1 -4
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +49 -0
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +47 -0
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +62 -0
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerState.js +31 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +4 -6
- package/lib/esm/entity/tenant/tenantReducer.js +0 -1
- package/lib/esm/entity/tenant/tenantSelector.js +0 -7
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +1 -0
- package/lib/esm/epic.js +3 -4
- package/lib/esm/index.js +15 -11
- package/lib/esm/reducer.js +6 -9
- package/lib/esm/view/aiAccountantView/aiAccountantViewPayload.js +2 -0
- package/lib/esm/view/aiAccountantView/aiAccountantViewReducer.js +149 -0
- package/lib/esm/view/aiAccountantView/aiAccountantViewSelector.js +72 -0
- package/lib/esm/view/aiAccountantView/aiAccountantViewState.js +11 -0
- package/lib/esm/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +46 -0
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +27 -0
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +47 -0
- package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +52 -0
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +44 -0
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +44 -0
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +5 -1
- package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +163 -3
- package/lib/esm/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +1 -2
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +112 -0
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +10 -6
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +6 -0
- package/lib/esm/view/financeStatement/financeStatementSelector.js +1 -12
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +4 -2
- package/lib/esm/view/reportsResync/reportsClassViewRefetchingEpic.js +0 -4
- package/lib/index.d.ts +16 -14
- package/lib/index.js +65 -45
- package/lib/reducer.d.ts +6 -9
- package/lib/reducer.js +6 -9
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +31 -0
- package/lib/view/aiAccountantView/aiAccountantViewPayload.js +8 -0
- package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +29 -0
- package/lib/view/aiAccountantView/aiAccountantViewReducer.js +153 -0
- package/lib/view/aiAccountantView/aiAccountantViewSelector.d.ts +14 -0
- package/lib/view/aiAccountantView/aiAccountantViewSelector.js +78 -0
- package/lib/view/aiAccountantView/aiAccountantViewState.d.ts +27 -0
- package/lib/view/aiAccountantView/aiAccountantViewState.js +13 -0
- package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.d.ts +33 -0
- package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +50 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.d.ts +23 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +31 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.d.ts +33 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +51 -0
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.d.ts +28 -0
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +56 -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 -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/companyView/types/cockpitTypes.d.ts +6 -5
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +48 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
- package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +48 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +33 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +5 -1
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +18 -4
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +164 -4
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +6 -2
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -2
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +112 -0
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +9 -5
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +3 -0
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -1
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +13 -0
- 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/onboardingView/cockpitView/types/onboardingCockpitViewTypes.d.ts +1 -1
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +4 -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/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +4 -4
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +3 -3
- package/lib/view/subscriptionView/types/subscriptionTypes.d.ts +1 -1
- 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 -10
- package/lib/entity/sectionProjectView/sectionProjectView.js +0 -6
- package/lib/entity/sectionProjectView/sectionProjectViewEpic.d.ts +0 -6
- package/lib/entity/sectionProjectView/sectionProjectViewEpic.js +0 -51
- package/lib/entity/sectionProjectView/sectionProjectViewHelper.d.ts +0 -9
- package/lib/entity/sectionProjectView/sectionProjectViewHelper.js +0 -13
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +0 -15
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.js +0 -50
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.d.ts +0 -11
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +0 -77
- 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 -47
- package/lib/esm/entity/sectionProjectView/sectionProjectViewHelper.js +0 -9
- package/lib/esm/entity/sectionProjectView/sectionProjectViewReducer.js +0 -46
- package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +0 -70
- 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 -45
- 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 -66
- 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 -8
- package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +0 -49
- 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 -70
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +0 -18
- 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
|
@@ -44,7 +44,8 @@ export const initialState = {
|
|
|
44
44
|
uiState: {
|
|
45
45
|
searchString: '',
|
|
46
46
|
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
47
|
-
|
|
47
|
+
selectedMainTab: 'pending_review',
|
|
48
|
+
sortKey: 'transactionDate',
|
|
48
49
|
sortOrder: 'descending',
|
|
49
50
|
totalCount: 0,
|
|
50
51
|
limit: 10,
|
|
@@ -380,6 +381,9 @@ const expenseAutomationJESchedulesView = createSlice({
|
|
|
380
381
|
if (action.payload.scrollPosition != null) {
|
|
381
382
|
draft.uiState.scrollPosition = action.payload.scrollPosition;
|
|
382
383
|
}
|
|
384
|
+
if (action.payload.selectedMainTab != null) {
|
|
385
|
+
draft.uiState.selectedMainTab = action.payload.selectedMainTab;
|
|
386
|
+
}
|
|
383
387
|
},
|
|
384
388
|
clearExpenseAutomationJESchedulesView(draft) {
|
|
385
389
|
Object.assign(draft, initialState);
|
|
@@ -37,7 +37,15 @@ export const initialReconciliationTabsState = {
|
|
|
37
37
|
},
|
|
38
38
|
};
|
|
39
39
|
export const initialActionFetchState = {
|
|
40
|
+
excludeAccountFetch: {
|
|
41
|
+
fetchState: 'Not-Started',
|
|
42
|
+
error: undefined,
|
|
43
|
+
},
|
|
40
44
|
excludeFetchById: {},
|
|
45
|
+
includeAccountFetch: {
|
|
46
|
+
fetchState: 'Not-Started',
|
|
47
|
+
error: undefined,
|
|
48
|
+
},
|
|
41
49
|
reconcileFetch: {
|
|
42
50
|
fetchState: 'Not-Started',
|
|
43
51
|
error: undefined,
|
|
@@ -51,6 +59,7 @@ export const initialActionFetchState = {
|
|
|
51
59
|
export const initialState = {
|
|
52
60
|
accountReconciliationRecordsBySelectedPeriod: {},
|
|
53
61
|
accountConnectionStatusByAccountID: {},
|
|
62
|
+
excludedAccountExclusionInfo: {},
|
|
54
63
|
fetchState: 'Not-Started',
|
|
55
64
|
error: undefined,
|
|
56
65
|
selectedTab: 'review',
|
|
@@ -60,10 +69,12 @@ export const initialState = {
|
|
|
60
69
|
selectedAccountId: undefined,
|
|
61
70
|
statementUploadChosen: false,
|
|
62
71
|
reconListUIState: {
|
|
72
|
+
nodeCollapseState: {},
|
|
63
73
|
scrollPosition: {
|
|
64
74
|
scrollTop: 0,
|
|
65
75
|
},
|
|
66
76
|
},
|
|
77
|
+
excludedAccountIDs: [],
|
|
67
78
|
};
|
|
68
79
|
// Create slice with reducers
|
|
69
80
|
const expenseAutomationReconciliationView = createSlice({
|
|
@@ -132,7 +143,7 @@ const expenseAutomationReconciliationView = createSlice({
|
|
|
132
143
|
fetchReconciliationSuccess: {
|
|
133
144
|
reducer(draft, action) {
|
|
134
145
|
if (action.payload.accountId == null) {
|
|
135
|
-
updateAllReconciliation(draft, action.payload.reconciliation.accounts, action.payload.selectedPeriod, action.payload.reconciliation.reconciliation, action.payload.refreshViewInBackground);
|
|
146
|
+
updateAllReconciliation(draft, action.payload.reconciliation.accounts, action.payload.selectedPeriod, action.payload.reconciliation.reconciliation, action.payload.refreshViewInBackground, action.payload.reconciliation.excluded_accounts ?? []);
|
|
136
147
|
}
|
|
137
148
|
else if (action.payload.reconciliation.reconciliation.length > 0 &&
|
|
138
149
|
action.payload.reconciliation.accounts.length > 0) {
|
|
@@ -344,6 +355,10 @@ const expenseAutomationReconciliationView = createSlice({
|
|
|
344
355
|
updateReconListScrollPosition: (draft, action) => {
|
|
345
356
|
draft.reconListUIState.scrollPosition = action.payload.scrollPosition;
|
|
346
357
|
},
|
|
358
|
+
updateNodeCollapseState: (draft, action) => {
|
|
359
|
+
draft.reconListUIState.nodeCollapseState[action.payload.nodeId] =
|
|
360
|
+
action.payload.collapsed;
|
|
361
|
+
},
|
|
347
362
|
setConnectionInProgressForAccount: (draft, action) => {
|
|
348
363
|
if (draft.accountConnectionStatusByAccountID[action.payload.accountId] ==
|
|
349
364
|
null) {
|
|
@@ -421,6 +436,85 @@ const expenseAutomationReconciliationView = createSlice({
|
|
|
421
436
|
...localData,
|
|
422
437
|
};
|
|
423
438
|
},
|
|
439
|
+
excludeAccountFromReconciliation: {
|
|
440
|
+
reducer(draft) {
|
|
441
|
+
draft.actionFetchState.excludeAccountFetch = {
|
|
442
|
+
fetchState: 'In-Progress',
|
|
443
|
+
error: undefined,
|
|
444
|
+
};
|
|
445
|
+
},
|
|
446
|
+
prepare(payload) {
|
|
447
|
+
return { payload };
|
|
448
|
+
},
|
|
449
|
+
},
|
|
450
|
+
excludeAccountFromReconciliationSuccess: (draft, action) => {
|
|
451
|
+
draft.actionFetchState.excludeAccountFetch = {
|
|
452
|
+
fetchState: 'Completed',
|
|
453
|
+
error: undefined,
|
|
454
|
+
};
|
|
455
|
+
const { account, selectedPeriod } = action.payload;
|
|
456
|
+
if (account != null) {
|
|
457
|
+
if (!draft.excludedAccountIDs.includes(account.account_id)) {
|
|
458
|
+
draft.excludedAccountIDs.push(account.account_id);
|
|
459
|
+
}
|
|
460
|
+
updateExcludedAccountExclusionInfo(draft, account);
|
|
461
|
+
const monthYearPeriodId = toMonthYearPeriodId(selectedPeriod);
|
|
462
|
+
if (draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId]
|
|
463
|
+
?.accountIDs != null) {
|
|
464
|
+
draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId].accountIDs = draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId].accountIDs.filter((id) => id !== account.account_id);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
excludeAccountFromReconciliationFailure: (draft, action) => {
|
|
469
|
+
draft.actionFetchState.excludeAccountFetch = {
|
|
470
|
+
fetchState: 'Error',
|
|
471
|
+
error: action.payload.error,
|
|
472
|
+
};
|
|
473
|
+
},
|
|
474
|
+
includeAccountInReconciliation: {
|
|
475
|
+
reducer(draft) {
|
|
476
|
+
draft.actionFetchState.includeAccountFetch = {
|
|
477
|
+
fetchState: 'In-Progress',
|
|
478
|
+
error: undefined,
|
|
479
|
+
};
|
|
480
|
+
},
|
|
481
|
+
prepare(payload) {
|
|
482
|
+
return { payload };
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
includeAccountInReconciliationSuccess: (draft, action) => {
|
|
486
|
+
draft.actionFetchState.includeAccountFetch = {
|
|
487
|
+
fetchState: 'Completed',
|
|
488
|
+
error: undefined,
|
|
489
|
+
};
|
|
490
|
+
const { reconciliation, selectedPeriod } = action.payload;
|
|
491
|
+
if (reconciliation == null) {
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
const accountId = reconciliation.account_id;
|
|
495
|
+
draft.excludedAccountIDs = draft.excludedAccountIDs.filter((id) => id !== accountId);
|
|
496
|
+
delete draft.excludedAccountExclusionInfo[accountId];
|
|
497
|
+
const monthYearPeriodId = toMonthYearPeriodId(selectedPeriod);
|
|
498
|
+
const accountReconciliationRecords = draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId];
|
|
499
|
+
if (accountReconciliationRecords != null) {
|
|
500
|
+
if (!accountReconciliationRecords.accountIDs.includes(accountId)) {
|
|
501
|
+
accountReconciliationRecords.accountIDs.push(accountId);
|
|
502
|
+
}
|
|
503
|
+
// put this in a function
|
|
504
|
+
updateReconciliationByAccountIDOnIncludeAccount(draft, accountId, reconciliation, monthYearPeriodId);
|
|
505
|
+
}
|
|
506
|
+
draft.accountConnectionStatusByAccountID[accountId] = {
|
|
507
|
+
status: toBankStatusCodeType(reconciliation.bank_status.code),
|
|
508
|
+
connectionInProgress: false,
|
|
509
|
+
paymentAccountId: undefined,
|
|
510
|
+
};
|
|
511
|
+
},
|
|
512
|
+
includeAccountInReconciliationFailure: (draft, action) => {
|
|
513
|
+
draft.actionFetchState.includeAccountFetch = {
|
|
514
|
+
fetchState: 'Error',
|
|
515
|
+
error: action.payload.error,
|
|
516
|
+
};
|
|
517
|
+
},
|
|
424
518
|
updateStatementUploadChosen: (draft, action) => {
|
|
425
519
|
draft.statementUploadChosen = action.payload.statementUploadChosen;
|
|
426
520
|
},
|
|
@@ -430,10 +524,38 @@ const expenseAutomationReconciliationView = createSlice({
|
|
|
430
524
|
},
|
|
431
525
|
});
|
|
432
526
|
// Export actions
|
|
433
|
-
export const { fetchReconciliation, fetchReconciliationFailure, fetchReconciliationSuccess, saveReconciliationDetail, saveReconciliationDetailFailure, updateSelectedAccountId, setConnectionInProgressForAccount, setStatementParseInProgress, updateReconcileTabLocalData, updateReconcileTabListSortState, updateReconcileTabListScrollState, saveReconciliationDetailSuccess, updateSelectedTab, updateBalancesLocalData, initialiseLocalDataForSelectedAccountId, clearExpenseAutomationReconciliationView, updateSelectedDrawerAccountId, updateReviewTabSortState, initializeReconciliationReviewTabLocalData, updateReviewTabLocalData, saveReconciliationReview, updateSaveReconciliationReviewFetchStatus, updateReconListScrollPosition, updateAccountReconciliationLocalData, deleteAccountStatement, deleteAccountStatementSuccess, deleteAccountStatementFailure, uploadAccountStatement, uploadAccountStatementSuccess, uploadAccountStatementFailure, updateStatementUploadChosen, } = expenseAutomationReconciliationView.actions;
|
|
527
|
+
export const { fetchReconciliation, fetchReconciliationFailure, fetchReconciliationSuccess, saveReconciliationDetail, saveReconciliationDetailFailure, updateSelectedAccountId, setConnectionInProgressForAccount, setStatementParseInProgress, updateReconcileTabLocalData, updateReconcileTabListSortState, updateReconcileTabListScrollState, saveReconciliationDetailSuccess, updateSelectedTab, updateBalancesLocalData, initialiseLocalDataForSelectedAccountId, clearExpenseAutomationReconciliationView, updateSelectedDrawerAccountId, updateReviewTabSortState, initializeReconciliationReviewTabLocalData, updateReviewTabLocalData, saveReconciliationReview, updateSaveReconciliationReviewFetchStatus, updateReconListScrollPosition, updateAccountReconciliationLocalData, deleteAccountStatement, deleteAccountStatementSuccess, deleteAccountStatementFailure, excludeAccountFromReconciliation, excludeAccountFromReconciliationSuccess, excludeAccountFromReconciliationFailure, includeAccountInReconciliation, includeAccountInReconciliationSuccess, includeAccountInReconciliationFailure, uploadAccountStatement, uploadAccountStatementSuccess, uploadAccountStatementFailure, updateStatementUploadChosen, updateNodeCollapseState, } = expenseAutomationReconciliationView.actions;
|
|
434
528
|
// Export reducer
|
|
435
529
|
export default expenseAutomationReconciliationView.reducer;
|
|
436
|
-
function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliationData, refreshViewInBackground) {
|
|
530
|
+
function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliationData, refreshViewInBackground, excludedAccounts) {
|
|
531
|
+
draft.excludedAccountIDs = excludedAccounts.map((ea) => ea.account_id);
|
|
532
|
+
draft.excludedAccountExclusionInfo = {};
|
|
533
|
+
excludedAccounts.forEach((ea) => {
|
|
534
|
+
const { exclusion_info } = ea;
|
|
535
|
+
draft.excludedAccountExclusionInfo[ea.account_id] = {
|
|
536
|
+
bankBalance: exclusion_info.bank_balance != null
|
|
537
|
+
? {
|
|
538
|
+
amount: exclusion_info.bank_balance,
|
|
539
|
+
currencyCode: ea.currency_code ?? 'USD',
|
|
540
|
+
currencySymbol: ea.currency_symbol ?? '$',
|
|
541
|
+
}
|
|
542
|
+
: undefined,
|
|
543
|
+
clearedBalance: exclusion_info.cleared_balance != null
|
|
544
|
+
? {
|
|
545
|
+
amount: exclusion_info.cleared_balance,
|
|
546
|
+
currencyCode: ea.currency_code ?? 'USD',
|
|
547
|
+
currencySymbol: ea.currency_symbol ?? '$',
|
|
548
|
+
}
|
|
549
|
+
: undefined,
|
|
550
|
+
variance: exclusion_info.variance != null
|
|
551
|
+
? {
|
|
552
|
+
amount: exclusion_info.variance,
|
|
553
|
+
currencyCode: ea.currency_code ?? 'USD',
|
|
554
|
+
currencySymbol: ea.currency_symbol ?? '$',
|
|
555
|
+
}
|
|
556
|
+
: undefined,
|
|
557
|
+
};
|
|
558
|
+
});
|
|
437
559
|
draft.accountReconciliationRecordsBySelectedPeriod[toMonthYearPeriodId(selectedPeriod)] = {
|
|
438
560
|
accountIDs: [],
|
|
439
561
|
reconciliationByAccountID: {},
|
|
@@ -516,3 +638,41 @@ function updateReconciliationByAccountID(draft, accounts, selectedPeriod, accoun
|
|
|
516
638
|
};
|
|
517
639
|
}
|
|
518
640
|
}
|
|
641
|
+
const updateExcludedAccountExclusionInfo = (draft, account) => {
|
|
642
|
+
draft.excludedAccountExclusionInfo[account.account_id] = {
|
|
643
|
+
bankBalance: account.bank_balance != null
|
|
644
|
+
? {
|
|
645
|
+
amount: account.bank_balance,
|
|
646
|
+
currencyCode: account.currency_code ?? 'USD',
|
|
647
|
+
currencySymbol: account.currency_symbol ?? '$',
|
|
648
|
+
}
|
|
649
|
+
: undefined,
|
|
650
|
+
clearedBalance: account.cleared_balance != null
|
|
651
|
+
? {
|
|
652
|
+
amount: account.cleared_balance,
|
|
653
|
+
currencyCode: account.currency_code ?? 'USD',
|
|
654
|
+
currencySymbol: account.currency_symbol ?? '$',
|
|
655
|
+
}
|
|
656
|
+
: undefined,
|
|
657
|
+
variance: account.variance != null
|
|
658
|
+
? {
|
|
659
|
+
amount: account.variance,
|
|
660
|
+
currencyCode: account.currency_code ?? 'USD',
|
|
661
|
+
currencySymbol: account.currency_symbol ?? '$',
|
|
662
|
+
}
|
|
663
|
+
: undefined,
|
|
664
|
+
};
|
|
665
|
+
};
|
|
666
|
+
const updateReconciliationByAccountIDOnIncludeAccount = (draft, accountId, reconciliation, monthYearPeriodId) => {
|
|
667
|
+
draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId].reconciliationByAccountID[accountId] = {
|
|
668
|
+
accountId,
|
|
669
|
+
reconciliationId: reconciliation.reconciliation_id ?? undefined,
|
|
670
|
+
transactionFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
671
|
+
refreshStatus: { fetchState: 'Not-Started', error: undefined },
|
|
672
|
+
statementDeleteStatus: { fetchState: 'Not-Started', error: undefined },
|
|
673
|
+
statementUploadStatus: { fetchState: 'Not-Started', error: undefined },
|
|
674
|
+
statementUpdateStatus: { fetchState: 'Not-Started', error: undefined },
|
|
675
|
+
statementParseInProgress: reconciliation.bank_status.code === 'parsing',
|
|
676
|
+
localData: {},
|
|
677
|
+
};
|
|
678
|
+
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
|
|
2
2
|
export const ALL_ACCOUNT_RECON_SECTION_IDS = ['assets', 'liabilities'];
|
|
3
|
-
|
|
4
|
-
const toAccountReconSectionID = (v) => stringToUnion(v, ALL_ACCOUNT_RECON_SECTION_IDS);
|
|
3
|
+
export const toAccountReconSectionID = (v) => stringToUnion(v, ALL_ACCOUNT_RECON_SECTION_IDS);
|
|
@@ -9,6 +9,7 @@ import { getAccountsByType } from '../../../entity/account/accountSelector';
|
|
|
9
9
|
import { getAccountReconByAccountIdAndSelectedPeriod } from '../../../entity/accountRecon/accountReconSelector';
|
|
10
10
|
import { getCurrentTenant } from '../../../entity/tenant/tenantSelector';
|
|
11
11
|
import { getVendorByVendorId } from '../../../entity/vendor/vendorSelector';
|
|
12
|
+
import { date } from '../../../zeniDayJS';
|
|
12
13
|
import { getAccountList, getNestedAccountListHierarchy, } from '../../accountList/accountListSelector';
|
|
13
14
|
import { getClassList, getNestedClassListHierarchy, } from '../../classList/classListSelector';
|
|
14
15
|
import { initialActionFetchState, initialReconciliationTabsState, initialState, } from '../reducers/reconciliationViewReducer';
|
|
@@ -90,6 +91,30 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
90
91
|
totalVariancePercentage: undefined,
|
|
91
92
|
},
|
|
92
93
|
},
|
|
94
|
+
excludedAccountReconciliationByAccountID: {},
|
|
95
|
+
excludedAccountReconciliationBySectionID: {
|
|
96
|
+
assets: {
|
|
97
|
+
sectionId: 'assets',
|
|
98
|
+
accountIDs: [],
|
|
99
|
+
totalBankBalance: undefined,
|
|
100
|
+
totalClearedBalance: undefined,
|
|
101
|
+
totalReconciledBalance: undefined,
|
|
102
|
+
totalVariance: undefined,
|
|
103
|
+
totalVariancePercentage: undefined,
|
|
104
|
+
},
|
|
105
|
+
liabilities: {
|
|
106
|
+
sectionId: 'liabilities',
|
|
107
|
+
accountIDs: [],
|
|
108
|
+
totalBankBalance: undefined,
|
|
109
|
+
totalClearedBalance: undefined,
|
|
110
|
+
totalReconciledBalance: undefined,
|
|
111
|
+
totalVariance: undefined,
|
|
112
|
+
totalVariancePercentage: undefined,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
excludeAccountFetchState: reconciliationViewState.actionFetchState.excludeAccountFetch,
|
|
116
|
+
includeAccountFetchState: reconciliationViewState.actionFetchState.includeAccountFetch,
|
|
117
|
+
excludedAccountIDs: reconciliationViewState.excludedAccountIDs,
|
|
93
118
|
};
|
|
94
119
|
}
|
|
95
120
|
const allAccountIDs = accountReconForMonthYearPeriod.accountIDs;
|
|
@@ -249,6 +274,88 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
249
274
|
totalVariancePercentage: liabilityTotals.variancePercentage,
|
|
250
275
|
},
|
|
251
276
|
};
|
|
277
|
+
const bankAccountIdSet = new Set(uniqueBankAccounts.map((a) => a.accountId));
|
|
278
|
+
const creditCardIdSet = new Set(uniqueCreditCards.map((a) => a.accountId));
|
|
279
|
+
const excludedAssetAccountIDs = [];
|
|
280
|
+
const excludedLiabilityAccountIDs = [];
|
|
281
|
+
reconciliationViewState.excludedAccountIDs.forEach((accountID) => {
|
|
282
|
+
const isAsset = bankAccountIdSet.has(accountID);
|
|
283
|
+
const isLiability = creditCardIdSet.has(accountID);
|
|
284
|
+
if (!isAsset && !isLiability) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
if (isAsset) {
|
|
288
|
+
excludedAssetAccountIDs.push(accountID);
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
excludedLiabilityAccountIDs.push(accountID);
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
const excludedAccountReconciliationBySectionID = {
|
|
295
|
+
assets: {
|
|
296
|
+
sectionId: 'assets',
|
|
297
|
+
accountIDs: excludedAssetAccountIDs,
|
|
298
|
+
},
|
|
299
|
+
liabilities: {
|
|
300
|
+
sectionId: 'liabilities',
|
|
301
|
+
accountIDs: excludedLiabilityAccountIDs,
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
const excludedAccountReconciliationByAccountID = {};
|
|
305
|
+
const accountsInState = Object.values(accountState.accountsByKey);
|
|
306
|
+
const accountsInStateMap = new Map(accountsInState.map((a) => [a.accountId, a]));
|
|
307
|
+
reconciliationViewState.excludedAccountIDs.forEach((excludedAccountID) => {
|
|
308
|
+
const account = accountsInStateMap.get(excludedAccountID);
|
|
309
|
+
const exclusionInfo = reconciliationViewState.excludedAccountExclusionInfo[excludedAccountID];
|
|
310
|
+
if (account != null) {
|
|
311
|
+
excludedAccountReconciliationByAccountID[excludedAccountID] = {
|
|
312
|
+
refreshStatus: { fetchState: 'Not-Started' },
|
|
313
|
+
statementUpdateStatus: { fetchState: 'Not-Started' },
|
|
314
|
+
statementUploadStatus: { fetchState: 'Not-Started' },
|
|
315
|
+
statementDeleteStatus: { fetchState: 'Not-Started' },
|
|
316
|
+
localData: {},
|
|
317
|
+
connectionInProgress: false,
|
|
318
|
+
statementParseInProgress: false,
|
|
319
|
+
accountConnectionStatus: 'not_connected',
|
|
320
|
+
transactionFetchState: { fetchState: 'Not-Started' },
|
|
321
|
+
accountReconEntity: {
|
|
322
|
+
account: {
|
|
323
|
+
accountId: account.accountId,
|
|
324
|
+
accountName: account.accountName,
|
|
325
|
+
accountType: account.accountType,
|
|
326
|
+
accountSubType: account.accountSubType,
|
|
327
|
+
accountDescription: account.accountDescription,
|
|
328
|
+
qboId: account.qboId,
|
|
329
|
+
coaId: account.coaId,
|
|
330
|
+
labels: account.labels,
|
|
331
|
+
},
|
|
332
|
+
currency: {
|
|
333
|
+
currencyCode: exclusionInfo?.bankBalance?.currencyCode ??
|
|
334
|
+
exclusionInfo?.clearedBalance?.currencyCode ??
|
|
335
|
+
'USD',
|
|
336
|
+
currencySymbol: exclusionInfo?.bankBalance?.currencySymbol ??
|
|
337
|
+
exclusionInfo?.clearedBalance?.currencySymbol ??
|
|
338
|
+
'$',
|
|
339
|
+
},
|
|
340
|
+
startDate: date(new Date().toDateString()),
|
|
341
|
+
endDate: date(new Date().toDateString()),
|
|
342
|
+
statementStatus: { code: 'not_found', label: 'Not Found' },
|
|
343
|
+
transactionsToReconcile: [],
|
|
344
|
+
transactionsToReview: [],
|
|
345
|
+
balance: exclusionInfo?.bankBalance,
|
|
346
|
+
clearedBalance: exclusionInfo?.clearedBalance,
|
|
347
|
+
variance: exclusionInfo?.variance,
|
|
348
|
+
variancePercentage: exclusionInfo?.variance != null &&
|
|
349
|
+
exclusionInfo?.bankBalance != null &&
|
|
350
|
+
exclusionInfo?.bankBalance.amount !== 0
|
|
351
|
+
? Math.abs((exclusionInfo.variance.amount /
|
|
352
|
+
exclusionInfo.bankBalance.amount) *
|
|
353
|
+
100)
|
|
354
|
+
: undefined,
|
|
355
|
+
},
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
});
|
|
252
359
|
const accountListNestedAccountHierarchy = getNestedAccountListHierarchy(accountListState, 'accountList');
|
|
253
360
|
const classListNestedAccountHierarchy = getNestedClassListHierarchy(classListState);
|
|
254
361
|
const accountsList = getAccountList(accountState, accountListState, 'accountList');
|
|
@@ -309,6 +416,11 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
309
416
|
allClassList: allClasses,
|
|
310
417
|
reviewTabSelectedVendorByTransactionId,
|
|
311
418
|
reconListUIState: reconciliationViewState.reconListUIState,
|
|
419
|
+
excludedAccountReconciliationBySectionID,
|
|
420
|
+
excludedAccountReconciliationByAccountID,
|
|
421
|
+
excludeAccountFetchState: reconciliationViewState.actionFetchState.excludeAccountFetch,
|
|
422
|
+
includeAccountFetchState: reconciliationViewState.actionFetchState.includeAccountFetch,
|
|
423
|
+
excludedAccountIDs: reconciliationViewState.excludedAccountIDs,
|
|
312
424
|
};
|
|
313
425
|
});
|
|
314
426
|
export const isAccountReconReport = (reportId) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import omit from 'lodash/omit';
|
|
2
2
|
import { reduceAllFetchState, reduceAnyFetchState, } from '../../../commonStateTypes/reduceFetchState';
|
|
3
3
|
import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
4
|
-
import { getCurrentTenant } from '../../../entity/tenant/tenantSelector';
|
|
4
|
+
import { getIsAccountingClassesEnabled, getCurrentTenant, } from '../../../entity/tenant/tenantSelector';
|
|
5
5
|
import { getTransactionWithCOT } from '../../../entity/transaction/transactionHelper';
|
|
6
6
|
import { getSupportedTransactionsByIds } from '../../../entity/transaction/transactionSelector';
|
|
7
7
|
import { getAccountList, getNestedAccountListHierarchy, getUncategorizedAccounts, } from '../../accountList/accountListSelector';
|
|
@@ -44,12 +44,16 @@ export function getExpenseAutomationTransactionView(state) {
|
|
|
44
44
|
const monthEndFetchState = monthYearPeriodId != null
|
|
45
45
|
? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
|
|
46
46
|
: { fetchState: 'Not-Started', error: undefined };
|
|
47
|
+
const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state);
|
|
48
|
+
const allFetchStateList = [
|
|
49
|
+
accountList,
|
|
50
|
+
expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
|
|
51
|
+
];
|
|
52
|
+
if (isAccountingClassesEnabled) {
|
|
53
|
+
allFetchStateList.push(classList);
|
|
54
|
+
}
|
|
47
55
|
const fetchStatus = reduceAnyFetchState([
|
|
48
|
-
reduceAllFetchState(
|
|
49
|
-
accountList,
|
|
50
|
-
classList,
|
|
51
|
-
expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
|
|
52
|
-
]),
|
|
56
|
+
reduceAllFetchState(allFetchStateList),
|
|
53
57
|
monthEndFetchState,
|
|
54
58
|
]);
|
|
55
59
|
const totalCountByReview = expenseAutomationTransactionsViewState.transactionCategorizationView.review
|
|
@@ -16,3 +16,9 @@ const JE_SCHEDULE_SORT_KEYS = [
|
|
|
16
16
|
'memo',
|
|
17
17
|
];
|
|
18
18
|
export const toJEScheduleSortKey = (v) => stringToUnion(v, JE_SCHEDULE_SORT_KEYS);
|
|
19
|
+
const JE_SCHEDULE_MAIN_TABS = [
|
|
20
|
+
'pending_review',
|
|
21
|
+
'ongoing',
|
|
22
|
+
'completed',
|
|
23
|
+
];
|
|
24
|
+
export const toJEScheduleMainTab = (v) => stringToUnion(v, JE_SCHEDULE_MAIN_TABS);
|
|
@@ -9,10 +9,8 @@ import { extractThisPeriod } from '../../commonStateTypes/viewAndReport/thisPeri
|
|
|
9
9
|
import { getBalanceSheet } from '../balanceSheet/balanceSheetSelector';
|
|
10
10
|
import { getCashFlow } from '../cashFlow/cashFlowSelector';
|
|
11
11
|
import { getProfitAndLossReport, } from '../profitAndLoss/profitAndLossSelector';
|
|
12
|
-
import { newBalancesFilterProjectView } from '../../commonStateTypes/coaBalance/coaBalancesFilterProjectView';
|
|
13
12
|
import { getProfitAndLossClassesHorizontalView } from '../profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector';
|
|
14
13
|
import { getProfitAndLossClassesView } from '../profitAndLossClassesView/profitAndLossClassesViewSelector';
|
|
15
|
-
import { getProfitAndLossProjectView } from '../profitAndLossProjectView/profitAndLossProjectViewSelector';
|
|
16
14
|
function getDateRangeForFinanceReports(profitAndLossState, balanceSheetState, cashFlowState) {
|
|
17
15
|
const datesSorted = [
|
|
18
16
|
profitAndLossState.dataAvailable?.startDate,
|
|
@@ -37,7 +35,7 @@ function getFirstMonthOfFY(profitAndLossState, balanceSheetState, cashFlowState)
|
|
|
37
35
|
cashFlowState.firstMonthOfFY ??
|
|
38
36
|
1);
|
|
39
37
|
}
|
|
40
|
-
export const getFinanceStatement = createSelector((state) => state.accountState, (state) => state.accountGroupState, (state) => state.classState, (state) => state.sectionClassesViewStateV2, (state) => state.profitAndLossState, (state) => state.profitAndLossClassesViewState, (state) => state.
|
|
38
|
+
export const getFinanceStatement = createSelector((state) => state.accountState, (state) => state.accountGroupState, (state) => state.classState, (state) => state.sectionClassesViewStateV2, (state) => state.profitAndLossState, (state) => state.profitAndLossClassesViewState, (state) => state.balanceSheetState, (state) => state.cashFlowState, (state) => state.financeStatementState, (state) => state.sectionAccountsViewState, (state) => state.forecastState, (accountState, accountGroupState, classState, sectionsState, profitAndLossState, profitAndLossClassesViewState, balanceSheetState, cashFlowState, financeStatementState, sectionAccountsViewState, forecastState) => {
|
|
41
39
|
// to get min and max dates across three reports
|
|
42
40
|
let allTimeframeTicks = [];
|
|
43
41
|
let balancesInTimeframe = [];
|
|
@@ -71,8 +69,6 @@ export const getFinanceStatement = createSelector((state) => state.accountState,
|
|
|
71
69
|
const profitAndLossReport = getProfitAndLossReport(filter, undefined, accountState, accountGroupState, sectionAccountsViewState, profitAndLossState, forecastState);
|
|
72
70
|
const classFilter = newBalancesFilterClassesView(filter.firstMonthOfFY, filter.timeframe, filter.balancesRange.numberOfPeriods, filter.balancesRange.thisPeriod, filter.balancesRange.orderBy, filter.additionalBalances, profitAndLossClassesViewState.uiState.classesToFilterOut);
|
|
73
71
|
const profitAndLossByClassReport = getProfitAndLossClassesView(classFilter, accountState, classState, sectionsState, profitAndLossClassesViewState);
|
|
74
|
-
const projectFilter = newBalancesFilterProjectView(filter.firstMonthOfFY, filter.timeframe, filter.balancesRange.numberOfPeriods, filter.balancesRange.thisPeriod, filter.balancesRange.orderBy, filter.additionalBalances, profitAndLossProjectViewState.uiState.projectsToFilterOut);
|
|
75
|
-
const profitAndLossByProjectReport = getProfitAndLossProjectView(projectFilter, accountState, projectState, sectionProjectViewState, profitAndLossProjectViewState);
|
|
76
72
|
const profitAndLossByClassHorizontalReport = getProfitAndLossClassesHorizontalView(classFilter, accountState, classState, sectionsState, profitAndLossClassesViewState, profitAndLossClassesViewState.uiState.classViewLayout === 'horizontal'
|
|
77
73
|
? thisPeriod
|
|
78
74
|
: undefined);
|
|
@@ -93,12 +89,6 @@ export const getFinanceStatement = createSelector((state) => state.accountState,
|
|
|
93
89
|
error: profitAndLossReport.error,
|
|
94
90
|
};
|
|
95
91
|
break;
|
|
96
|
-
case 'profit_and_loss_by_projects':
|
|
97
|
-
selectedReportAndTimeframeFetchState = {
|
|
98
|
-
fetchState: profitAndLossByProjectReport.fetchState,
|
|
99
|
-
error: profitAndLossByProjectReport.error,
|
|
100
|
-
};
|
|
101
|
-
break;
|
|
102
92
|
case 'balance_sheet':
|
|
103
93
|
selectedReportAndTimeframeFetchState = {
|
|
104
94
|
fetchState: balanceSheetReport.fetchState,
|
|
@@ -129,7 +119,6 @@ export const getFinanceStatement = createSelector((state) => state.accountState,
|
|
|
129
119
|
dataAvailable,
|
|
130
120
|
profitAndLossReport,
|
|
131
121
|
profitAndLossByClassReport,
|
|
132
|
-
profitAndLossByProjectReport,
|
|
133
122
|
profitAndLossByClassHorizontalReport,
|
|
134
123
|
balanceSheetReport,
|
|
135
124
|
cashFlowReport,
|
package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js
CHANGED
|
@@ -122,10 +122,12 @@ function buildClassColumns(classHierarchy, classesToFilterOut) {
|
|
|
122
122
|
qboId: c.qboId,
|
|
123
123
|
}))
|
|
124
124
|
.sort((a, b) => {
|
|
125
|
-
|
|
125
|
+
const aIsNotSpecified = a.classId === NOT_SPECIFIED_CLASS_ID;
|
|
126
|
+
const bIsNotSpecified = b.classId === NOT_SPECIFIED_CLASS_ID;
|
|
127
|
+
if (aIsNotSpecified && !bIsNotSpecified) {
|
|
126
128
|
return 1;
|
|
127
129
|
}
|
|
128
|
-
if (
|
|
130
|
+
if (!aIsNotSpecified && bIsNotSpecified) {
|
|
129
131
|
return -1;
|
|
130
132
|
}
|
|
131
133
|
return a.className.localeCompare(b.className, [], {
|
|
@@ -3,7 +3,6 @@ import { filter, switchMap } from 'rxjs/operators';
|
|
|
3
3
|
import { fetchNetBurnOrIncomeClassesView } from '../netBurnOrIncomeClassesView/netBurnOrIncomeClassesViewReducer';
|
|
4
4
|
import { fetchOpExClassesView } from '../opExClassesView/opExClassesViewReducer';
|
|
5
5
|
import { fetchProfitAndLossClassesView } from '../profitAndLossClassesView/profitAndLossClassesViewReducer';
|
|
6
|
-
import { fetchProfitAndLossProjectView } from '../profitAndLossProjectView/profitAndLossProjectViewReducer';
|
|
7
6
|
import { fetchRevenueClassesView } from '../revenueClassesView/revenueClassesViewReducer';
|
|
8
7
|
import { initiateReportsClassViewRefetching } from './reportsResyncReducer';
|
|
9
8
|
export const initiateReportsClassViewRefetchingEpic = (actions$,
|
|
@@ -24,9 +23,6 @@ _) => actions$.pipe(filter(initiateReportsClassViewRefetching.match), switchMap(
|
|
|
24
23
|
case 'net_burn_or_income_by_classes':
|
|
25
24
|
actions.push(fetchNetBurnOrIncomeClassesView(true));
|
|
26
25
|
break;
|
|
27
|
-
case 'profit_and_loss_by_projects':
|
|
28
|
-
actions.push(fetchProfitAndLossProjectView(true));
|
|
29
|
-
break;
|
|
30
26
|
default:
|
|
31
27
|
break;
|
|
32
28
|
}
|