@zeniai/client-epic-state 4.20.3-betaML22 → 4.20.3-betaML4
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/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
- package/lib/entity/account/accountPayload.d.ts +0 -2
- package/lib/entity/account/accountReducer.d.ts +2 -5
- package/lib/entity/account/accountReducer.js +2 -7
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/entity/tenant/tenantReducer.d.ts +2 -5
- package/lib/entity/tenant/tenantReducer.js +2 -8
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +0 -6
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +0 -62
- package/lib/entity/transaction/stateTypes/transaction.d.ts +0 -6
- package/lib/epic.d.ts +7 -10
- package/lib/epic.js +7 -10
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
- package/lib/esm/entity/account/accountReducer.js +1 -6
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/esm/entity/tenant/tenantReducer.js +1 -7
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +0 -62
- package/lib/esm/epic.js +7 -10
- package/lib/esm/index.js +6 -6
- package/lib/esm/view/companyView/companyViewReducer.js +1 -26
- package/lib/esm/view/companyView/types/companyPassport/companyPassportViewState.js +0 -4
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +9 -4
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +1 -5
- package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +3 -167
- package/lib/esm/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -1
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +0 -114
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +6 -10
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +0 -6
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +2 -4
- package/lib/index.d.ts +6 -6
- package/lib/index.js +32 -38
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/companyView/companyViewReducer.d.ts +1 -6
- package/lib/view/companyView/companyViewReducer.js +2 -28
- package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +0 -1
- package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +0 -4
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +9 -4
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +0 -45
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +1 -5
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +4 -18
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +4 -168
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +2 -7
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -2
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +0 -114
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +5 -9
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +0 -3
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -8
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +0 -14
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +2 -4
- 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
- package/lib/esm/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +0 -61
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +0 -44
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +0 -44
- package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.d.ts +0 -10
- package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +0 -65
- package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +0 -48
- package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.d.ts +0 -9
- package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +0 -48
|
@@ -284,31 +284,6 @@ const companyView = createSlice({
|
|
|
284
284
|
error: status,
|
|
285
285
|
};
|
|
286
286
|
},
|
|
287
|
-
updateAccountingClassesEnabled: {
|
|
288
|
-
reducer(draft,
|
|
289
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
290
|
-
_action) {
|
|
291
|
-
draft.passportView.accountingClassesUpdateStatus = {
|
|
292
|
-
fetchState: 'In-Progress',
|
|
293
|
-
error: undefined,
|
|
294
|
-
};
|
|
295
|
-
},
|
|
296
|
-
prepare(companyId, enabled) {
|
|
297
|
-
return { payload: { companyId, enabled } };
|
|
298
|
-
},
|
|
299
|
-
},
|
|
300
|
-
updateAccountingClassesEnabledSuccess(draft) {
|
|
301
|
-
draft.passportView.accountingClassesUpdateStatus = {
|
|
302
|
-
fetchState: 'Completed',
|
|
303
|
-
error: undefined,
|
|
304
|
-
};
|
|
305
|
-
},
|
|
306
|
-
updateAccountingClassesEnabledFailure(draft, action) {
|
|
307
|
-
draft.passportView.accountingClassesUpdateStatus = {
|
|
308
|
-
fetchState: 'Error',
|
|
309
|
-
error: action.payload.status,
|
|
310
|
-
};
|
|
311
|
-
},
|
|
312
287
|
companyPassportUpdatePrimaryContact: {
|
|
313
288
|
reducer(draft, action) {
|
|
314
289
|
const { primaryContact } = action.payload;
|
|
@@ -582,5 +557,5 @@ const companyView = createSlice({
|
|
|
582
557
|
},
|
|
583
558
|
},
|
|
584
559
|
});
|
|
585
|
-
export const { fetchCompanyPassportView, fetchAllCockpitViews, fetchOnboardingView, fetchManagementView, fetchSubscriptionView, fetchPortfolioView, fetchCompanyManagementView, companyManagementSaveUpdates, companyManagementSavePendingUpdates, companyManagementDiscardUpdates, companyManagementSaveUpdatesSuccess, companyManagementSaveUpdatesFailure, updateCompanyViewOnSuccess, updateCompanyViewOnFailure, fetchCompanyPortfolioView, fetchZeniUsers, updateZeniUsersOnSuccess, updateZeniUsersOnFailure, clearCompanyView, updateCompanyPortfolioUIState, updateCompanyManagementUIState, companyPassportSaveDataInLocalStore, deleteCompanyOfficerInLocalStore, companyPassportClearDataInLocalStore, companyPassportUpdateCompanyDetails, companyPassportUpdateCompanyDetailsSuccess, companyPassportUpdateCompanyDetailsFailure,
|
|
560
|
+
export const { fetchCompanyPassportView, fetchAllCockpitViews, fetchOnboardingView, fetchManagementView, fetchSubscriptionView, fetchPortfolioView, fetchCompanyManagementView, companyManagementSaveUpdates, companyManagementSavePendingUpdates, companyManagementDiscardUpdates, companyManagementSaveUpdatesSuccess, companyManagementSaveUpdatesFailure, updateCompanyViewOnSuccess, updateCompanyViewOnFailure, fetchCompanyPortfolioView, fetchZeniUsers, updateZeniUsersOnSuccess, updateZeniUsersOnFailure, clearCompanyView, updateCompanyPortfolioUIState, updateCompanyManagementUIState, companyPassportSaveDataInLocalStore, deleteCompanyOfficerInLocalStore, companyPassportClearDataInLocalStore, companyPassportUpdateCompanyDetails, companyPassportUpdateCompanyDetailsSuccess, companyPassportUpdateCompanyDetailsFailure, companyPassportUpdatePrimaryContact, companyPassportUpdatePrimaryContactSuccess, companyPassportUpdatePrimaryContactFailure, companyPassportUpdateCompanyOfficer, companyPassportUpdateCompanyOfficerSuccess, companyPassportUpdateCompanyOfficerFailure, companyPassportCreateCompanyOfficers, companyPassportCreateCompanyOfficersSuccess, companyPassportCreateCompanyOfficersFailure, updateCompanyPassportLocalStoreData, saveIndustryAndIncDateInCompanyPassportLocalStore, saveCompanyPassportDetails, fetchParentSubsidiaryManagementView, updateParentSubsidiaryView, updateParentSubsidiaryViewOnFailure, updateCompanyDownloadState, fetchCompanyMetaData, updateCompanyMetaDataOnSuccess, updateCompanyMetaDataOnFailure, updateMetaDataOnSendMonthEndReport, } = companyView.actions;
|
|
586
561
|
export default companyView.reducer;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { initialCommonState } from '../commonState';
|
|
2
2
|
export const initialCompanyPassportView = {
|
|
3
3
|
...initialCommonState,
|
|
4
|
-
accountingClassesUpdateStatus: {
|
|
5
|
-
fetchState: 'Not-Started',
|
|
6
|
-
error: undefined,
|
|
7
|
-
},
|
|
8
4
|
companyDetails: {
|
|
9
5
|
localData: undefined,
|
|
10
6
|
updateStatus: {
|
package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js
CHANGED
|
@@ -53,17 +53,22 @@ export const fetchReconciliationViewEpic = (actions$, state$, zeniAPI) => action
|
|
|
53
53
|
return zeniAPI.getJSON(apiUrl).pipe(mergeMap((response) => {
|
|
54
54
|
if (isSuccessResponse(response) && response.data != null) {
|
|
55
55
|
const updateActions = [];
|
|
56
|
-
|
|
57
|
-
updateActions.push(
|
|
56
|
+
updateActions.push(updateAccounts(response.data.accounts, 'account_reconciliation'));
|
|
57
|
+
updateActions.push(updateAllUsers({
|
|
58
58
|
users: response.data.users ?? [],
|
|
59
59
|
updateType: 'merge',
|
|
60
|
-
})
|
|
60
|
+
}));
|
|
61
|
+
updateActions.push(updateFiles({ files: response.data.files ?? [] }));
|
|
62
|
+
const allTransactionsPerRecon = getAllReviewTransactionsFromReconcilePayload(response.data.reconciliation);
|
|
63
|
+
updateActions.push(updateMultipleReconcileTransactions(allTransactionsPerRecon, 'merge'));
|
|
64
|
+
updateActions.push(updateAccountRecon(selectedPeriod, response.data.reconciliation));
|
|
61
65
|
const reviewTabLocalData = prepareReviewTabLocalData(response.data.reconciliation[0]?.transactions?.review ?? []);
|
|
62
66
|
if (accountId != null) {
|
|
63
67
|
const selectedTransactionIds = getTransactionIdFromCheckedMatchedTransactionPayload(response.data.reconciliation[0].transactions.reconcile);
|
|
64
68
|
updateActions.push(updateReconcileTabLocalData({
|
|
65
69
|
selectedTransactionIds: selectedTransactionIds,
|
|
66
|
-
})
|
|
70
|
+
}));
|
|
71
|
+
updateActions.push(initializeReconciliationReviewTabLocalData(reviewTabLocalData));
|
|
67
72
|
}
|
|
68
73
|
updateActions.push(fetchReconciliationSuccess(selectedPeriod, response.data, refreshViewInBackground, accountId));
|
|
69
74
|
return from(updateActions);
|
|
@@ -44,8 +44,7 @@ export const initialState = {
|
|
|
44
44
|
uiState: {
|
|
45
45
|
searchString: '',
|
|
46
46
|
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
47
|
-
|
|
48
|
-
sortKey: 'transactionDate',
|
|
47
|
+
sortKey: 'startMonth',
|
|
49
48
|
sortOrder: 'descending',
|
|
50
49
|
totalCount: 0,
|
|
51
50
|
limit: 10,
|
|
@@ -381,9 +380,6 @@ const expenseAutomationJESchedulesView = createSlice({
|
|
|
381
380
|
if (action.payload.scrollPosition != null) {
|
|
382
381
|
draft.uiState.scrollPosition = action.payload.scrollPosition;
|
|
383
382
|
}
|
|
384
|
-
if (action.payload.selectedMainTab != null) {
|
|
385
|
-
draft.uiState.selectedMainTab = action.payload.selectedMainTab;
|
|
386
|
-
}
|
|
387
383
|
},
|
|
388
384
|
clearExpenseAutomationJESchedulesView(draft) {
|
|
389
385
|
Object.assign(draft, initialState);
|
|
@@ -37,15 +37,7 @@ export const initialReconciliationTabsState = {
|
|
|
37
37
|
},
|
|
38
38
|
};
|
|
39
39
|
export const initialActionFetchState = {
|
|
40
|
-
excludeAccountFetch: {
|
|
41
|
-
fetchState: 'Not-Started',
|
|
42
|
-
error: undefined,
|
|
43
|
-
},
|
|
44
40
|
excludeFetchById: {},
|
|
45
|
-
includeAccountFetch: {
|
|
46
|
-
fetchState: 'Not-Started',
|
|
47
|
-
error: undefined,
|
|
48
|
-
},
|
|
49
41
|
reconcileFetch: {
|
|
50
42
|
fetchState: 'Not-Started',
|
|
51
43
|
error: undefined,
|
|
@@ -59,7 +51,6 @@ export const initialActionFetchState = {
|
|
|
59
51
|
export const initialState = {
|
|
60
52
|
accountReconciliationRecordsBySelectedPeriod: {},
|
|
61
53
|
accountConnectionStatusByAccountID: {},
|
|
62
|
-
excludedAccountExclusionInfo: {},
|
|
63
54
|
fetchState: 'Not-Started',
|
|
64
55
|
error: undefined,
|
|
65
56
|
selectedTab: 'review',
|
|
@@ -69,12 +60,10 @@ export const initialState = {
|
|
|
69
60
|
selectedAccountId: undefined,
|
|
70
61
|
statementUploadChosen: false,
|
|
71
62
|
reconListUIState: {
|
|
72
|
-
nodeCollapseState: {},
|
|
73
63
|
scrollPosition: {
|
|
74
64
|
scrollTop: 0,
|
|
75
65
|
},
|
|
76
66
|
},
|
|
77
|
-
excludedAccountIDs: [],
|
|
78
67
|
};
|
|
79
68
|
// Create slice with reducers
|
|
80
69
|
const expenseAutomationReconciliationView = createSlice({
|
|
@@ -143,7 +132,7 @@ const expenseAutomationReconciliationView = createSlice({
|
|
|
143
132
|
fetchReconciliationSuccess: {
|
|
144
133
|
reducer(draft, action) {
|
|
145
134
|
if (action.payload.accountId == null) {
|
|
146
|
-
updateAllReconciliation(draft, action.payload.reconciliation.accounts, action.payload.selectedPeriod, action.payload.reconciliation.reconciliation, action.payload.refreshViewInBackground
|
|
135
|
+
updateAllReconciliation(draft, action.payload.reconciliation.accounts, action.payload.selectedPeriod, action.payload.reconciliation.reconciliation, action.payload.refreshViewInBackground);
|
|
147
136
|
}
|
|
148
137
|
else if (action.payload.reconciliation.reconciliation.length > 0 &&
|
|
149
138
|
action.payload.reconciliation.accounts.length > 0) {
|
|
@@ -355,10 +344,6 @@ const expenseAutomationReconciliationView = createSlice({
|
|
|
355
344
|
updateReconListScrollPosition: (draft, action) => {
|
|
356
345
|
draft.reconListUIState.scrollPosition = action.payload.scrollPosition;
|
|
357
346
|
},
|
|
358
|
-
updateNodeCollapseState: (draft, action) => {
|
|
359
|
-
draft.reconListUIState.nodeCollapseState[action.payload.nodeId] =
|
|
360
|
-
action.payload.collapsed;
|
|
361
|
-
},
|
|
362
347
|
setConnectionInProgressForAccount: (draft, action) => {
|
|
363
348
|
if (draft.accountConnectionStatusByAccountID[action.payload.accountId] ==
|
|
364
349
|
null) {
|
|
@@ -436,85 +421,6 @@ const expenseAutomationReconciliationView = createSlice({
|
|
|
436
421
|
...localData,
|
|
437
422
|
};
|
|
438
423
|
},
|
|
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
|
-
},
|
|
518
424
|
updateStatementUploadChosen: (draft, action) => {
|
|
519
425
|
draft.statementUploadChosen = action.payload.statementUploadChosen;
|
|
520
426
|
},
|
|
@@ -524,38 +430,10 @@ const expenseAutomationReconciliationView = createSlice({
|
|
|
524
430
|
},
|
|
525
431
|
});
|
|
526
432
|
// Export 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,
|
|
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;
|
|
528
434
|
// Export reducer
|
|
529
435
|
export default expenseAutomationReconciliationView.reducer;
|
|
530
|
-
function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliationData, refreshViewInBackground
|
|
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
|
-
});
|
|
436
|
+
function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliationData, refreshViewInBackground) {
|
|
559
437
|
draft.accountReconciliationRecordsBySelectedPeriod[toMonthYearPeriodId(selectedPeriod)] = {
|
|
560
438
|
accountIDs: [],
|
|
561
439
|
reconciliationByAccountID: {},
|
|
@@ -593,9 +471,6 @@ function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliation
|
|
|
593
471
|
? toReconciliationAccountSource(account.reconciliation_source)
|
|
594
472
|
: undefined,
|
|
595
473
|
},
|
|
596
|
-
accountDetectionReason: account?.detection_info != null && account.detection_reason != null
|
|
597
|
-
? account.detection_reason
|
|
598
|
-
: undefined,
|
|
599
474
|
};
|
|
600
475
|
accountReconciliationRecords.accountIDs.push(reconciliation.account_id);
|
|
601
476
|
});
|
|
@@ -641,42 +516,3 @@ function updateReconciliationByAccountID(draft, accounts, selectedPeriod, accoun
|
|
|
641
516
|
};
|
|
642
517
|
}
|
|
643
518
|
}
|
|
644
|
-
const updateExcludedAccountExclusionInfo = (draft, account) => {
|
|
645
|
-
draft.excludedAccountExclusionInfo[account.account_id] = {
|
|
646
|
-
bankBalance: account.bank_balance != null
|
|
647
|
-
? {
|
|
648
|
-
amount: account.bank_balance,
|
|
649
|
-
currencyCode: account.currency_code ?? 'USD',
|
|
650
|
-
currencySymbol: account.currency_symbol ?? '$',
|
|
651
|
-
}
|
|
652
|
-
: undefined,
|
|
653
|
-
clearedBalance: account.cleared_balance != null
|
|
654
|
-
? {
|
|
655
|
-
amount: account.cleared_balance,
|
|
656
|
-
currencyCode: account.currency_code ?? 'USD',
|
|
657
|
-
currencySymbol: account.currency_symbol ?? '$',
|
|
658
|
-
}
|
|
659
|
-
: undefined,
|
|
660
|
-
variance: account.variance != null
|
|
661
|
-
? {
|
|
662
|
-
amount: account.variance,
|
|
663
|
-
currencyCode: account.currency_code ?? 'USD',
|
|
664
|
-
currencySymbol: account.currency_symbol ?? '$',
|
|
665
|
-
}
|
|
666
|
-
: undefined,
|
|
667
|
-
};
|
|
668
|
-
};
|
|
669
|
-
const updateReconciliationByAccountIDOnIncludeAccount = (draft, accountId, reconciliation, monthYearPeriodId) => {
|
|
670
|
-
draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId].reconciliationByAccountID[accountId] = {
|
|
671
|
-
accountId,
|
|
672
|
-
reconciliationId: reconciliation.reconciliation_id ?? undefined,
|
|
673
|
-
transactionFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
674
|
-
refreshStatus: { fetchState: 'Not-Started', error: undefined },
|
|
675
|
-
statementDeleteStatus: { fetchState: 'Not-Started', error: undefined },
|
|
676
|
-
statementUploadStatus: { fetchState: 'Not-Started', error: undefined },
|
|
677
|
-
statementUpdateStatus: { fetchState: 'Not-Started', error: undefined },
|
|
678
|
-
statementParseInProgress: reconciliation.bank_status.code === 'parsing',
|
|
679
|
-
localData: {},
|
|
680
|
-
accountDetectionReason: undefined,
|
|
681
|
-
};
|
|
682
|
-
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
|
|
2
2
|
export const ALL_ACCOUNT_RECON_SECTION_IDS = ['assets', 'liabilities'];
|
|
3
|
-
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4
|
+
const toAccountReconSectionID = (v) => stringToUnion(v, ALL_ACCOUNT_RECON_SECTION_IDS);
|
|
@@ -9,7 +9,6 @@ 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';
|
|
13
12
|
import { getAccountList, getNestedAccountListHierarchy, } from '../../accountList/accountListSelector';
|
|
14
13
|
import { getClassList, getNestedClassListHierarchy, } from '../../classList/classListSelector';
|
|
15
14
|
import { initialActionFetchState, initialReconciliationTabsState, initialState, } from '../reducers/reconciliationViewReducer';
|
|
@@ -91,30 +90,6 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
91
90
|
totalVariancePercentage: undefined,
|
|
92
91
|
},
|
|
93
92
|
},
|
|
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,
|
|
118
93
|
};
|
|
119
94
|
}
|
|
120
95
|
const allAccountIDs = accountReconForMonthYearPeriod.accountIDs;
|
|
@@ -252,8 +227,6 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
252
227
|
.transactionFetchState,
|
|
253
228
|
accountListState.byReportId.accountList,
|
|
254
229
|
]),
|
|
255
|
-
accountDetectionReason: accountReconForMonthYearPeriod.reconciliationByAccountID[accountID]
|
|
256
|
-
.accountDetectionReason,
|
|
257
230
|
};
|
|
258
231
|
});
|
|
259
232
|
const accountReconciliationBySectionID = {
|
|
@@ -276,88 +249,6 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
276
249
|
totalVariancePercentage: liabilityTotals.variancePercentage,
|
|
277
250
|
},
|
|
278
251
|
};
|
|
279
|
-
const bankAccountIdSet = new Set(uniqueBankAccounts.map((a) => a.accountId));
|
|
280
|
-
const creditCardIdSet = new Set(uniqueCreditCards.map((a) => a.accountId));
|
|
281
|
-
const excludedAssetAccountIDs = [];
|
|
282
|
-
const excludedLiabilityAccountIDs = [];
|
|
283
|
-
reconciliationViewState.excludedAccountIDs.forEach((accountID) => {
|
|
284
|
-
const isAsset = bankAccountIdSet.has(accountID);
|
|
285
|
-
const isLiability = creditCardIdSet.has(accountID);
|
|
286
|
-
if (!isAsset && !isLiability) {
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
if (isAsset) {
|
|
290
|
-
excludedAssetAccountIDs.push(accountID);
|
|
291
|
-
}
|
|
292
|
-
else {
|
|
293
|
-
excludedLiabilityAccountIDs.push(accountID);
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
const excludedAccountReconciliationBySectionID = {
|
|
297
|
-
assets: {
|
|
298
|
-
sectionId: 'assets',
|
|
299
|
-
accountIDs: excludedAssetAccountIDs,
|
|
300
|
-
},
|
|
301
|
-
liabilities: {
|
|
302
|
-
sectionId: 'liabilities',
|
|
303
|
-
accountIDs: excludedLiabilityAccountIDs,
|
|
304
|
-
},
|
|
305
|
-
};
|
|
306
|
-
const excludedAccountReconciliationByAccountID = {};
|
|
307
|
-
const accountsInState = Object.values(accountState.accountsByKey);
|
|
308
|
-
const accountsInStateMap = new Map(accountsInState.map((a) => [a.accountId, a]));
|
|
309
|
-
reconciliationViewState.excludedAccountIDs.forEach((excludedAccountID) => {
|
|
310
|
-
const account = accountsInStateMap.get(excludedAccountID);
|
|
311
|
-
const exclusionInfo = reconciliationViewState.excludedAccountExclusionInfo[excludedAccountID];
|
|
312
|
-
if (account != null) {
|
|
313
|
-
excludedAccountReconciliationByAccountID[excludedAccountID] = {
|
|
314
|
-
refreshStatus: { fetchState: 'Not-Started' },
|
|
315
|
-
statementUpdateStatus: { fetchState: 'Not-Started' },
|
|
316
|
-
statementUploadStatus: { fetchState: 'Not-Started' },
|
|
317
|
-
statementDeleteStatus: { fetchState: 'Not-Started' },
|
|
318
|
-
localData: {},
|
|
319
|
-
connectionInProgress: false,
|
|
320
|
-
statementParseInProgress: false,
|
|
321
|
-
accountConnectionStatus: 'not_connected',
|
|
322
|
-
transactionFetchState: { fetchState: 'Not-Started' },
|
|
323
|
-
accountReconEntity: {
|
|
324
|
-
account: {
|
|
325
|
-
accountId: account.accountId,
|
|
326
|
-
accountName: account.accountName,
|
|
327
|
-
accountType: account.accountType,
|
|
328
|
-
accountSubType: account.accountSubType,
|
|
329
|
-
accountDescription: account.accountDescription,
|
|
330
|
-
qboId: account.qboId,
|
|
331
|
-
coaId: account.coaId,
|
|
332
|
-
labels: account.labels,
|
|
333
|
-
},
|
|
334
|
-
currency: {
|
|
335
|
-
currencyCode: exclusionInfo?.bankBalance?.currencyCode ??
|
|
336
|
-
exclusionInfo?.clearedBalance?.currencyCode ??
|
|
337
|
-
'USD',
|
|
338
|
-
currencySymbol: exclusionInfo?.bankBalance?.currencySymbol ??
|
|
339
|
-
exclusionInfo?.clearedBalance?.currencySymbol ??
|
|
340
|
-
'$',
|
|
341
|
-
},
|
|
342
|
-
startDate: date(new Date().toDateString()),
|
|
343
|
-
endDate: date(new Date().toDateString()),
|
|
344
|
-
statementStatus: { code: 'not_found', label: 'Not Found' },
|
|
345
|
-
transactionsToReconcile: [],
|
|
346
|
-
transactionsToReview: [],
|
|
347
|
-
balance: exclusionInfo?.bankBalance,
|
|
348
|
-
clearedBalance: exclusionInfo?.clearedBalance,
|
|
349
|
-
variance: exclusionInfo?.variance,
|
|
350
|
-
variancePercentage: exclusionInfo?.variance != null &&
|
|
351
|
-
exclusionInfo?.bankBalance != null &&
|
|
352
|
-
exclusionInfo?.bankBalance.amount !== 0
|
|
353
|
-
? Math.abs((exclusionInfo.variance.amount /
|
|
354
|
-
exclusionInfo.bankBalance.amount) *
|
|
355
|
-
100)
|
|
356
|
-
: undefined,
|
|
357
|
-
},
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
252
|
const accountListNestedAccountHierarchy = getNestedAccountListHierarchy(accountListState, 'accountList');
|
|
362
253
|
const classListNestedAccountHierarchy = getNestedClassListHierarchy(classListState);
|
|
363
254
|
const accountsList = getAccountList(accountState, accountListState, 'accountList');
|
|
@@ -418,11 +309,6 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
418
309
|
allClassList: allClasses,
|
|
419
310
|
reviewTabSelectedVendorByTransactionId,
|
|
420
311
|
reconListUIState: reconciliationViewState.reconListUIState,
|
|
421
|
-
excludedAccountReconciliationBySectionID,
|
|
422
|
-
excludedAccountReconciliationByAccountID,
|
|
423
|
-
excludeAccountFetchState: reconciliationViewState.actionFetchState.excludeAccountFetch,
|
|
424
|
-
includeAccountFetchState: reconciliationViewState.actionFetchState.includeAccountFetch,
|
|
425
|
-
excludedAccountIDs: reconciliationViewState.excludedAccountIDs,
|
|
426
312
|
};
|
|
427
313
|
});
|
|
428
314
|
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 {
|
|
4
|
+
import { 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,16 +44,12 @@ 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
|
-
}
|
|
55
47
|
const fetchStatus = reduceAnyFetchState([
|
|
56
|
-
reduceAllFetchState(
|
|
48
|
+
reduceAllFetchState([
|
|
49
|
+
accountList,
|
|
50
|
+
classList,
|
|
51
|
+
expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
|
|
52
|
+
]),
|
|
57
53
|
monthEndFetchState,
|
|
58
54
|
]);
|
|
59
55
|
const totalCountByReview = expenseAutomationTransactionsViewState.transactionCategorizationView.review
|
|
@@ -16,9 +16,3 @@ 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);
|
package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js
CHANGED
|
@@ -122,12 +122,10 @@ function buildClassColumns(classHierarchy, classesToFilterOut) {
|
|
|
122
122
|
qboId: c.qboId,
|
|
123
123
|
}))
|
|
124
124
|
.sort((a, b) => {
|
|
125
|
-
|
|
126
|
-
const bIsNotSpecified = b.classId === NOT_SPECIFIED_CLASS_ID;
|
|
127
|
-
if (aIsNotSpecified && !bIsNotSpecified) {
|
|
125
|
+
if (a.classId === NOT_SPECIFIED_CLASS_ID) {
|
|
128
126
|
return 1;
|
|
129
127
|
}
|
|
130
|
-
if (
|
|
128
|
+
if (b.classId === NOT_SPECIFIED_CLASS_ID) {
|
|
131
129
|
return -1;
|
|
132
130
|
}
|
|
133
131
|
return a.className.localeCompare(b.className, [], {
|