@zeniai/client-epic-state 4.20.2-beta0ND → 4.20.2-beta25RR
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/animations.d.ts +1 -1
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +2 -1
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +0 -38
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -78
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +1 -4
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +1 -5
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +0 -37
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/entity/task/taskPayload.d.ts +3 -0
- package/lib/entity/task/taskPayload.js +5 -0
- package/lib/entity/task/taskState.d.ts +3 -0
- 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/scheduleTransactionPayload.d.ts +1 -4
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -1
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +0 -3
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +1 -17
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +0 -1
- package/lib/entity/transaction/stateTypes/transaction.d.ts +0 -5
- package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
- package/lib/epic.d.ts +3 -2
- package/lib/epic.js +3 -2
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -78
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +1 -5
- package/lib/esm/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/esm/entity/task/taskPayload.js +5 -0
- package/lib/esm/entity/tenant/tenantReducer.js +0 -1
- package/lib/esm/entity/tenant/tenantSelector.js +0 -7
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -1
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +1 -17
- package/lib/esm/epic.js +3 -2
- package/lib/esm/index.js +9 -10
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +1 -82
- package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +2 -8
- package/lib/esm/view/classList/fetchClassListEpic.js +2 -9
- package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +5 -18
- package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +2 -6
- package/lib/esm/view/companyView/types/cockpitTypes.js +1 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +3 -4
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +1 -0
- package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +1 -17
- package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +2 -10
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +6 -63
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +4 -12
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +9 -22
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +6 -12
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -18
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +0 -3
- package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +0 -10
- package/lib/esm/view/spendManagement/billPay/billList/billListState.js +0 -1
- package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -7
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +2 -7
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +6 -13
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
- package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +4 -7
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +2 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +4 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +1 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +1 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +64 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +54 -0
- package/lib/esm/view/taskManager/taskDetailView/taskDetail.js +4 -0
- package/lib/esm/view/taskManager/taskDetailView/taskDetailReducer.js +49 -1
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +5 -2
- package/lib/esm/view/taskManager/taskListView/taskList.js +1 -0
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +23 -1
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +43 -11
- package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +14 -16
- package/lib/index.d.ts +12 -15
- package/lib/index.js +34 -42
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +0 -7
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +1 -15
- package/lib/view/aiCfoView/aiCfoViewReducer.js +2 -83
- package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +1 -4
- package/lib/view/aiCfoView/aiCfoViewSelector.js +2 -9
- package/lib/view/aiCfoView/aiCfoViewState.d.ts +1 -15
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.js +1 -8
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +0 -1
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +5 -18
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +0 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +2 -6
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
- package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
- package/lib/view/companyView/types/cockpitTypes.js +1 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +1 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +3 -4
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +1 -0
- package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -18
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +0 -2
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +2 -10
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +6 -63
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +4 -12
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +9 -22
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +5 -11
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +0 -5
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +0 -20
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +0 -3
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +0 -10
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListState.js +0 -1
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -7
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +2 -7
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +6 -13
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +3 -6
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +0 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.d.ts +2 -1
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +2 -0
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.d.ts +2 -1
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +4 -0
- package/lib/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +1 -0
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +1 -0
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.d.ts +9 -0
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +68 -0
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.d.ts +8 -0
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +58 -0
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +2 -0
- package/lib/view/taskManager/taskDetailView/taskDetail.js +4 -0
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +10 -1
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +50 -2
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +2 -0
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +5 -2
- package/lib/view/taskManager/taskListView/taskList.d.ts +1 -1
- package/lib/view/taskManager/taskListView/taskList.js +1 -0
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +3 -3
- package/lib/view/taskManager/taskListView/taskListReducer.js +24 -2
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +6 -2
- package/lib/view/taskManager/taskListView/taskListSelector.js +43 -11
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +14 -16
- package/package.json +1 -1
- package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +0 -19
- package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +0 -2
- package/lib/esm/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +0 -1
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -29
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +0 -8
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -33
package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js
CHANGED
|
@@ -234,7 +234,7 @@ const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendati
|
|
|
234
234
|
isPreFilled: true,
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
|
-
if (
|
|
237
|
+
if (accountLine.class.classId === '' &&
|
|
238
238
|
higherPreferenceRecommendation?.class != null) {
|
|
239
239
|
record.class = {
|
|
240
240
|
...higherPreferenceRecommendation.class,
|
|
@@ -464,7 +464,7 @@ export const setEntityRecommendationForLineIdInLocalData = (draft, transaction,
|
|
|
464
464
|
}
|
|
465
465
|
: accountLine.account;
|
|
466
466
|
record.class =
|
|
467
|
-
|
|
467
|
+
accountLine.class.classId !== ''
|
|
468
468
|
? accountLine.class
|
|
469
469
|
: recommendations?.[0]?.class
|
|
470
470
|
? {
|
|
@@ -44,8 +44,6 @@ export const initialState = {
|
|
|
44
44
|
uiState: {
|
|
45
45
|
searchString: '',
|
|
46
46
|
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
47
|
-
sortKey: 'startMonth',
|
|
48
|
-
sortOrder: 'descending',
|
|
49
47
|
totalCount: 0,
|
|
50
48
|
limit: 10,
|
|
51
49
|
},
|
|
@@ -367,26 +365,12 @@ const expenseAutomationJESchedulesView = createSlice({
|
|
|
367
365
|
clearJeAccountSettingsLocalData(draft) {
|
|
368
366
|
draft.accountSettings.localData = accountSettingsInitialState.localData;
|
|
369
367
|
},
|
|
370
|
-
updateJESchedulesUIState(draft, action) {
|
|
371
|
-
if (action.payload.sortKey != null) {
|
|
372
|
-
draft.uiState.sortKey = action.payload.sortKey;
|
|
373
|
-
}
|
|
374
|
-
if (action.payload.sortOrder != null) {
|
|
375
|
-
draft.uiState.sortOrder = action.payload.sortOrder;
|
|
376
|
-
}
|
|
377
|
-
if (action.payload.searchString != null) {
|
|
378
|
-
draft.uiState.searchString = action.payload.searchString;
|
|
379
|
-
}
|
|
380
|
-
if (action.payload.scrollPosition != null) {
|
|
381
|
-
draft.uiState.scrollPosition = action.payload.scrollPosition;
|
|
382
|
-
}
|
|
383
|
-
},
|
|
384
368
|
clearExpenseAutomationJESchedulesView(draft) {
|
|
385
369
|
Object.assign(draft, initialState);
|
|
386
370
|
},
|
|
387
371
|
},
|
|
388
372
|
});
|
|
389
|
-
export const { clearExpenseAutomationJESchedulesView, clearJeAccountSettingsLocalData, clearJeScheduleLocalData, fetchAccountSettingsListForAccountTypes, fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesPage, fetchJeSchedulesSuccess, fetchRecommendationForAccountSettings, ignoreRecommendedJeSchedule, ignoreRecommendedJeScheduleFailure, ignoreRecommendedJeScheduleSuccess, initializeAccountSettingsView, initializeJeScheduleLocalData, removeFailedJeScheduleTransactionKey, removeJeScheduleLocalDataById, removeJeScheduleTransactionKey, retryJeSchedule, retryJeScheduleFailure, retryJeScheduleSuccess, saveAccountSettings, saveAccountSettingsFailure, saveAccountSettingsLocalData, saveAccountSettingsSuccess, updateAccountSettingsListForAccountTypes, updateAccountSettingsListForAccountTypesFailure,
|
|
373
|
+
export const { clearExpenseAutomationJESchedulesView, clearJeAccountSettingsLocalData, clearJeScheduleLocalData, fetchAccountSettingsListForAccountTypes, fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesPage, fetchJeSchedulesSuccess, fetchRecommendationForAccountSettings, ignoreRecommendedJeSchedule, ignoreRecommendedJeScheduleFailure, ignoreRecommendedJeScheduleSuccess, initializeAccountSettingsView, initializeJeScheduleLocalData, removeFailedJeScheduleTransactionKey, removeJeScheduleLocalDataById, removeJeScheduleTransactionKey, retryJeSchedule, retryJeScheduleFailure, retryJeScheduleSuccess, saveAccountSettings, saveAccountSettingsFailure, saveAccountSettingsLocalData, saveAccountSettingsSuccess, updateAccountSettingsListForAccountTypes, updateAccountSettingsListForAccountTypesFailure, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, updateRecommendationForAccountSettings, updateRecommendationForAccountSettingsFailure, } = expenseAutomationJESchedulesView.actions;
|
|
390
374
|
export default expenseAutomationJESchedulesView.reducer;
|
|
391
375
|
const doUpdateRecommendationForAccountSettings = (draft, payload) => {
|
|
392
376
|
const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = mapAccountTypeRecommendationPayloadToAccountRecommendationByType(payload);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
|
|
2
1
|
import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
3
2
|
import { getAccountBase } from '../../../entity/account/accountSelector';
|
|
4
3
|
import { getClassById } from '../../../entity/class/classSelector';
|
|
@@ -7,7 +6,7 @@ import { getUserByUserId } from '../../../entity/user/userSelector';
|
|
|
7
6
|
import { getVendorByVendorId } from '../../../entity/vendor/vendorSelector';
|
|
8
7
|
import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
|
|
9
8
|
export function getExpenseAutomationFluxAnalysisView(state) {
|
|
10
|
-
const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState
|
|
9
|
+
const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState } = state;
|
|
11
10
|
const { fetchState, error, refreshStatus, uiState, reviewOperatingExpenseIdsByPeriod, selectedSectionIdsByPeriod, groupsBySelectedPeriod, fluxAnalysisEntities, bulkReviewStatus, currency, totalBalancesAndVariance, } = expenseAutomationFluxAnalysisViewState;
|
|
12
11
|
const fetchStateAndError = {
|
|
13
12
|
fetchState,
|
|
@@ -92,17 +91,10 @@ export function getExpenseAutomationFluxAnalysisView(state) {
|
|
|
92
91
|
},
|
|
93
92
|
};
|
|
94
93
|
const completionStatus = fluxCompletionStatus != null ? fluxCompletionStatus : 'incomplete';
|
|
95
|
-
const monthEndFetchState = monthYearPeriodId != null
|
|
96
|
-
? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
|
|
97
|
-
: { fetchState: 'Not-Started', error: undefined };
|
|
98
|
-
const reducedFetchStatus = reduceAnyFetchState([
|
|
99
|
-
fetchStateAndError,
|
|
100
|
-
monthEndFetchState,
|
|
101
|
-
]);
|
|
102
94
|
return {
|
|
103
95
|
sections,
|
|
104
96
|
totalBalancesAndVariance,
|
|
105
|
-
fetchStatus:
|
|
97
|
+
fetchStatus: fetchStateAndError,
|
|
106
98
|
bulkReviewStatus,
|
|
107
99
|
reviewOperatingExpensesIds,
|
|
108
100
|
selectedSectionIds,
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import omit from 'lodash/omit';
|
|
2
|
-
import orderBy from 'lodash/orderBy';
|
|
3
|
-
import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
|
|
4
2
|
import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
5
3
|
import { getAccountIdsForTypes } from '../../../entity/account/accountSelector';
|
|
6
4
|
import { getJEScheduledTransactionByJEScheduleTransactionKey, } from '../../../entity/jeSchedules/jeSchedulesSelector';
|
|
@@ -12,48 +10,10 @@ import { filterNestedAccountHierarchyById } from '../../scheduleView/scheduleDet
|
|
|
12
10
|
import { getAccountLabelForScheduleType, getAccountsTypesForScheduleList, } from '../../scheduleView/scheduleListView/scheduleListHelper';
|
|
13
11
|
import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
|
|
14
12
|
import { getJEAccountSettingsView } from './jeAccountSettingsViewSelector';
|
|
15
|
-
function getJEScheduleSortAccessor(sortKey) {
|
|
16
|
-
switch (sortKey) {
|
|
17
|
-
case 'vendor':
|
|
18
|
-
return (s) => s.vendor.name?.toLowerCase();
|
|
19
|
-
case 'category':
|
|
20
|
-
return (s) => s.jeDebit.account?.accountName?.toLowerCase();
|
|
21
|
-
case 'class':
|
|
22
|
-
return (s) => s.jeDebit.accountingClass?.className?.toLowerCase();
|
|
23
|
-
case 'depCategory':
|
|
24
|
-
return (s) => s.jeCredit.account?.accountName?.toLowerCase();
|
|
25
|
-
case 'scheduleCategory':
|
|
26
|
-
return (s) => s.jeScheduleType;
|
|
27
|
-
case 'startMonth':
|
|
28
|
-
return (s) => s.startDate?.valueOf();
|
|
29
|
-
case 'type':
|
|
30
|
-
return (s) => s.baseTransaction.typeOfTransaction;
|
|
31
|
-
case 'amortizationPeriod':
|
|
32
|
-
return (s) => s.period;
|
|
33
|
-
case 'jePostingDate':
|
|
34
|
-
return (s) => s.dayOfPostingDate;
|
|
35
|
-
case 'remainingMonths':
|
|
36
|
-
return (s) => s.period;
|
|
37
|
-
case 'runningBalance':
|
|
38
|
-
return (s) => s.balanceAsOfToday?.amount;
|
|
39
|
-
case 'totalAmount':
|
|
40
|
-
return (s) => s.baseTransaction.amount.amount;
|
|
41
|
-
case 'transactionDate':
|
|
42
|
-
return (s) => s.baseTransaction.date.valueOf();
|
|
43
|
-
case 'memo':
|
|
44
|
-
return (s) => s.baseTransaction.memo?.toLowerCase();
|
|
45
|
-
default:
|
|
46
|
-
return (s) => s.startDate?.valueOf();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function sortJEScheduledTransactions(transactions, sortKey, sortOrder) {
|
|
50
|
-
const accessor = getJEScheduleSortAccessor(sortKey);
|
|
51
|
-
return orderBy(transactions, [accessor], [sortOrder === 'ascending' ? 'asc' : 'desc']);
|
|
52
|
-
}
|
|
53
13
|
export function getExpenseAutomationJESchedulesView(state) {
|
|
54
14
|
const jeScheduledTransaction = [];
|
|
55
15
|
const failedJeScheduledTransaction = [];
|
|
56
|
-
const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState,
|
|
16
|
+
const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, } = state;
|
|
57
17
|
const { jeScheduleTransactionKeysByPeriod, failedJeScheduleTransactionKeysByPeriod, jeScheduleLocalDataById, postStatusById, ignoreStatusById, uiState, error, fetchState, refreshStatus, } = expenseAutomationJESchedulesViewState;
|
|
58
18
|
const accountSettingsView = getJEAccountSettingsView(state);
|
|
59
19
|
const currentTenant = getCurrentTenant(state);
|
|
@@ -99,33 +59,18 @@ export function getExpenseAutomationJESchedulesView(state) {
|
|
|
99
59
|
const jeScheduleDetails = getJEScheduledTransactionByJEScheduleTransactionKey(jeScheduleKey, state);
|
|
100
60
|
failedJeScheduledTransaction.push(jeScheduleDetails);
|
|
101
61
|
});
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
const ongoingSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'ongoing'), sortKey, sortOrder);
|
|
105
|
-
const completedSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'completed' ||
|
|
106
|
-
schedule.status.code === 'marked_as_completed'), sortKey, sortOrder);
|
|
107
|
-
const unsortedResolveSchedules = [];
|
|
62
|
+
const draftSchedules = jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft');
|
|
63
|
+
const resolveSchedules = [];
|
|
108
64
|
failedJeScheduledTransaction.forEach((schedule) => {
|
|
109
65
|
schedule.scheduledJournalEntry.forEach((journalEntry) => {
|
|
110
|
-
|
|
111
|
-
...schedule,
|
|
112
|
-
scheduledJournalEntry: journalEntry,
|
|
113
|
-
});
|
|
66
|
+
resolveSchedules.push({ ...schedule, scheduledJournalEntry: journalEntry });
|
|
114
67
|
});
|
|
115
68
|
});
|
|
116
|
-
const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
|
|
117
69
|
const allSteps = monthYearPeriodId != null
|
|
118
70
|
? getAllSteps(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
|
|
119
71
|
: [];
|
|
120
72
|
const jeCompletionStatus = allSteps.find((step) => step.step === 'je_schedules')?.completionStatus;
|
|
121
73
|
const completionStatus = jeCompletionStatus != null ? jeCompletionStatus : 'incomplete';
|
|
122
|
-
const monthEndFetchState = monthYearPeriodId != null
|
|
123
|
-
? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
|
|
124
|
-
: { fetchState: 'Not-Started', error: undefined };
|
|
125
|
-
const reducedFetchStatus = reduceAnyFetchState([
|
|
126
|
-
{ fetchState, error },
|
|
127
|
-
monthEndFetchState,
|
|
128
|
-
]);
|
|
129
74
|
return {
|
|
130
75
|
uncategorizedAccounts,
|
|
131
76
|
allDepreciationAccountList: filteredDepAccounts,
|
|
@@ -134,17 +79,15 @@ export function getExpenseAutomationJESchedulesView(state) {
|
|
|
134
79
|
allAccountList: filteredAccounts,
|
|
135
80
|
accountListNestedAccountHierarchy,
|
|
136
81
|
allClassList: allClasses,
|
|
137
|
-
completedSchedules,
|
|
138
82
|
draftSchedules,
|
|
139
|
-
ongoingSchedules,
|
|
140
83
|
resolveSchedules: resolveSchedules,
|
|
141
84
|
accountSettingsView,
|
|
142
85
|
postStatusById: postStatusById,
|
|
143
86
|
ignoreStatusById: ignoreStatusById,
|
|
144
|
-
fetchState:
|
|
87
|
+
fetchState: fetchState,
|
|
145
88
|
jeScheduleLocalDataById: jeScheduleLocalDataById,
|
|
146
89
|
uiState: uiState,
|
|
147
|
-
error:
|
|
90
|
+
error: error,
|
|
148
91
|
refreshStatus,
|
|
149
92
|
completionStatus,
|
|
150
93
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import orderBy from 'lodash/orderBy';
|
|
2
|
-
import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
|
|
3
2
|
import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
4
3
|
import { getCurrentTenant } from '../../../entity/tenant/tenantSelector';
|
|
5
4
|
import { getSupportedTransactionById, getSupportedTransactionsByIds, } from '../../../entity/transaction/transactionSelector';
|
|
@@ -8,7 +7,7 @@ import { getCompletedTransactionsCacheKey } from '../reducers/missingReceiptsVie
|
|
|
8
7
|
import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
|
|
9
8
|
import { isUnmatchedTabFileStatus, } from '../types/missingReceiptsViewState';
|
|
10
9
|
export function getExpenseAutomationMissingReceiptsView(state) {
|
|
11
|
-
const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState,
|
|
10
|
+
const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
|
|
12
11
|
const currentTenant = getCurrentTenant(state);
|
|
13
12
|
const { selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
14
13
|
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
@@ -37,7 +36,7 @@ export function getExpenseAutomationMissingReceiptsView(state) {
|
|
|
37
36
|
transaction.lines.length > 0 &&
|
|
38
37
|
transaction.lines[0]
|
|
39
38
|
?.class != null
|
|
40
|
-
? transaction.lines[0].class
|
|
39
|
+
? transaction.lines[0].class.className.toLowerCase()
|
|
41
40
|
: null;
|
|
42
41
|
case 'vendor':
|
|
43
42
|
default:
|
|
@@ -176,16 +175,9 @@ export function getExpenseAutomationMissingReceiptsView(state) {
|
|
|
176
175
|
vendorLogo: result.vendorLogo ?? transaction?.logo?.href,
|
|
177
176
|
};
|
|
178
177
|
});
|
|
179
|
-
const monthEndFetchState = monthYearPeriodId != null
|
|
180
|
-
? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
|
|
181
|
-
: { fetchState: 'Not-Started', error: undefined };
|
|
182
|
-
const reducedFetchStatus = reduceAnyFetchState([
|
|
183
|
-
{ fetchState, error },
|
|
184
|
-
monthEndFetchState,
|
|
185
|
-
]);
|
|
186
178
|
return {
|
|
187
|
-
fetchState
|
|
188
|
-
error
|
|
179
|
+
fetchState,
|
|
180
|
+
error,
|
|
189
181
|
uploadReceiptStatusById,
|
|
190
182
|
uiState,
|
|
191
183
|
refreshStatus,
|
|
@@ -13,7 +13,7 @@ import { getAccountList, getNestedAccountListHierarchy, } from '../../accountLis
|
|
|
13
13
|
import { getClassList, getNestedClassListHierarchy, } from '../../classList/classListSelector';
|
|
14
14
|
import { initialActionFetchState, initialReconciliationTabsState, initialState, } from '../reducers/reconciliationViewReducer';
|
|
15
15
|
import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
|
|
16
|
-
export const getExpenseAutomationReconciliationView = createSelector((state) => state, (state) => getCurrentTenant(state), (state) => state.expenseAutomationReconciliationViewState, (state) => state.expenseAutomationViewState, (state) => state.plaidAccountViewState, (state) => state.accountListState, (state) => state.accountState, (state) => state.classListState, (state) => state.classState, (state) => state.monthEndCloseChecksState, (state) => state.vendorState, (state
|
|
16
|
+
export const getExpenseAutomationReconciliationView = createSelector((state) => state, (state) => getCurrentTenant(state), (state) => state.expenseAutomationReconciliationViewState, (state) => state.expenseAutomationViewState, (state) => state.plaidAccountViewState, (state) => state.accountListState, (state) => state.accountState, (state) => state.classListState, (state) => state.classState, (state) => state.monthEndCloseChecksState, (state) => state.vendorState, (state, currentTenant, reconciliationViewState, expenseAutomationViewState, plaidAccountViewState, accountListState, accountState, classListState, classState, monthEndCloseChecksState, vendorState) => {
|
|
17
17
|
const { selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
18
18
|
const reconcileTabUiState = reconciliationViewState.reconTabsState.reconcile.uiState;
|
|
19
19
|
const reviewTabUiState = reconciliationViewState.reconTabsState.review.uiState;
|
|
@@ -35,13 +35,6 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
35
35
|
}
|
|
36
36
|
return acc;
|
|
37
37
|
}, []);
|
|
38
|
-
const monthYearPeriodId = selectedPeriod != null ? toMonthYearPeriodId(selectedPeriod) : null;
|
|
39
|
-
const monthEndFetchState = monthYearPeriodId != null
|
|
40
|
-
? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? {
|
|
41
|
-
fetchState: 'Not-Started',
|
|
42
|
-
error: undefined,
|
|
43
|
-
})
|
|
44
|
-
: { fetchState: 'Not-Started', error: undefined };
|
|
45
38
|
if (accountReconForMonthYearPeriod == null) {
|
|
46
39
|
return {
|
|
47
40
|
bankAccounts: [],
|
|
@@ -51,13 +44,10 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
51
44
|
classListNestedAccountHierarchy: [],
|
|
52
45
|
allAccountList: [],
|
|
53
46
|
allClassList: [],
|
|
54
|
-
fetchStatus:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
monthEndFetchState,
|
|
60
|
-
]),
|
|
47
|
+
fetchStatus: {
|
|
48
|
+
fetchState: reconciliationViewState.fetchState,
|
|
49
|
+
error: reconciliationViewState.error,
|
|
50
|
+
},
|
|
61
51
|
plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
|
|
62
52
|
.plaidConnectionDetails,
|
|
63
53
|
completionStatus: 'incomplete',
|
|
@@ -280,13 +270,10 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
280
270
|
bankAccounts: uniqueBankAccounts,
|
|
281
271
|
creditCards: uniqueCreditCards,
|
|
282
272
|
accountReconciliationsByAccountID: reconList,
|
|
283
|
-
fetchStatus:
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
},
|
|
288
|
-
monthEndFetchState,
|
|
289
|
-
]),
|
|
273
|
+
fetchStatus: {
|
|
274
|
+
fetchState: reconciliationViewState.fetchState,
|
|
275
|
+
error: reconciliationViewState.error,
|
|
276
|
+
},
|
|
290
277
|
plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
|
|
291
278
|
.plaidConnectionDetails,
|
|
292
279
|
reconciliationTabsState: reconciliationViewState.reconTabsState,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import omit from 'lodash/omit';
|
|
2
|
-
import { reduceAllFetchState
|
|
2
|
+
import { reduceAllFetchState } from '../../../commonStateTypes/reduceFetchState';
|
|
3
3
|
import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
4
4
|
import { getCurrentTenant } from '../../../entity/tenant/tenantSelector';
|
|
5
5
|
import { getTransactionWithCOT } from '../../../entity/transaction/transactionHelper';
|
|
@@ -8,7 +8,7 @@ import { getAccountList, getNestedAccountListHierarchy, getUncategorizedAccounts
|
|
|
8
8
|
import { getClassList, getNestedClassListHierarchy, } from '../../classList/classListSelector';
|
|
9
9
|
import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
|
|
10
10
|
export function getExpenseAutomationTransactionView(state) {
|
|
11
|
-
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState,
|
|
11
|
+
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
|
|
12
12
|
const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
|
|
13
13
|
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
14
14
|
const uncategorizedIncomeExpense = getUncategorizedAccounts(accountState, accountListState, 'accountList');
|
|
@@ -41,16 +41,10 @@ export function getExpenseAutomationTransactionView(state) {
|
|
|
41
41
|
.filter((transaction) => transaction != null);
|
|
42
42
|
const transactions = getSupportedTransactionsByIds(transactionState, transactionIds);
|
|
43
43
|
const transactionsWithCOT = transactions.map((transaction) => getTransactionWithCOT(transaction));
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
reduceAllFetchState([
|
|
49
|
-
accountList,
|
|
50
|
-
classList,
|
|
51
|
-
expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
|
|
52
|
-
]),
|
|
53
|
-
monthEndFetchState,
|
|
44
|
+
const fetchStatus = reduceAllFetchState([
|
|
45
|
+
accountList,
|
|
46
|
+
classList,
|
|
47
|
+
expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
|
|
54
48
|
]);
|
|
55
49
|
const totalCountByReview = expenseAutomationTransactionsViewState.transactionCategorizationView.review
|
|
56
50
|
.uiState.totalCount;
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
|
|
2
|
-
const JE_SCHEDULE_SORT_KEYS = [
|
|
3
|
-
'vendor',
|
|
4
|
-
'category',
|
|
5
|
-
'class',
|
|
6
|
-
'depCategory',
|
|
7
|
-
'scheduleCategory',
|
|
8
|
-
'startMonth',
|
|
9
|
-
'type',
|
|
10
|
-
'amortizationPeriod',
|
|
11
|
-
'jePostingDate',
|
|
12
|
-
'remainingMonths',
|
|
13
|
-
'runningBalance',
|
|
14
|
-
'totalAmount',
|
|
15
|
-
'transactionDate',
|
|
16
|
-
'memo',
|
|
17
|
-
];
|
|
18
|
-
export const toJEScheduleSortKey = (v) => stringToUnion(v, JE_SCHEDULE_SORT_KEYS);
|
|
1
|
+
export {};
|
package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js
CHANGED
|
@@ -3,7 +3,6 @@ import { getSummationFreeRangeTotalBalance } from '../../commonStateTypes/coaBal
|
|
|
3
3
|
import { defaultCustomerCurrency } from '../../commonStateTypes/currencyHelper';
|
|
4
4
|
import { reduceFetchStateParallelTimeframes } from '../../commonStateTypes/reduceFetchState';
|
|
5
5
|
import { getSectionClassesViewReport } from '../../entity/sectionClassesViewV2/sectionClassesViewSelector';
|
|
6
|
-
import { HORIZONTAL_CLASS_TOTAL_BALANCE_ID, } from './profitAndLossClassesByClassHorizontalSelectorTypes';
|
|
7
6
|
import { enrichProfitAndLossByClassHorizontalReport } from './profitAndLossHorizontalEnrichment';
|
|
8
7
|
export const profitAndLossHorizontalIdsInOrder = [
|
|
9
8
|
'income',
|
|
@@ -304,7 +303,6 @@ function buildHeaderBalances(classColumns, timeframe, selectedPeriod, currency)
|
|
|
304
303
|
startDate,
|
|
305
304
|
type: 'default',
|
|
306
305
|
label: col.className,
|
|
307
|
-
id: col.classId,
|
|
308
306
|
}));
|
|
309
307
|
// Add a "Total" column
|
|
310
308
|
balances.push({
|
|
@@ -314,7 +312,6 @@ function buildHeaderBalances(classColumns, timeframe, selectedPeriod, currency)
|
|
|
314
312
|
startDate,
|
|
315
313
|
type: 'default',
|
|
316
314
|
label: 'Total',
|
|
317
|
-
id: HORIZONTAL_CLASS_TOTAL_BALANCE_ID,
|
|
318
315
|
});
|
|
319
316
|
return balances;
|
|
320
317
|
}
|
|
@@ -416,14 +416,6 @@ export const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions)
|
|
|
416
416
|
transactionsWithNoSortKeyValue.push(transaction);
|
|
417
417
|
}
|
|
418
418
|
break;
|
|
419
|
-
case 'invoiceNumber':
|
|
420
|
-
if (transaction.documentId != null) {
|
|
421
|
-
transactionsWithSortKeyValue.push(transaction);
|
|
422
|
-
}
|
|
423
|
-
else {
|
|
424
|
-
transactionsWithNoSortKeyValue.push(transaction);
|
|
425
|
-
}
|
|
426
|
-
break;
|
|
427
419
|
case 'dueDate':
|
|
428
420
|
if (currentTab === 'draft') {
|
|
429
421
|
if (Boolean(transaction.dueDate) === true) {
|
|
@@ -526,8 +518,6 @@ export const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions)
|
|
|
526
518
|
return transaction.totalAmountInUSD?.amount ?? 0;
|
|
527
519
|
case 'paymentMethod':
|
|
528
520
|
return transaction.billPayInfo.billPaymentMethodType.name;
|
|
529
|
-
case 'invoiceNumber':
|
|
530
|
-
return transaction.documentId;
|
|
531
521
|
}
|
|
532
522
|
}, getColumnWiseSortOrder(sortOrder));
|
|
533
523
|
return [
|
|
@@ -2,7 +2,6 @@ import recordGet from 'lodash/get';
|
|
|
2
2
|
import { reduceFetchState } from '../../../../commonStateTypes/reduceFetchState';
|
|
3
3
|
import { getContactsByIds } from '../../../../entity/billPay/contact/contactSelector';
|
|
4
4
|
import { getPaymentAccountsByPaymentAccountIds } from '../../../../entity/paymentAccount/paymentAccountSelector';
|
|
5
|
-
import { getIsAccountingClassesEnabled } from '../../../../entity/tenant/tenantSelector';
|
|
6
5
|
import { getVendorByVendorId } from '../../../../entity/vendor/vendorSelector';
|
|
7
6
|
import { getAccountList } from '../../../accountList/accountListSelector';
|
|
8
7
|
import { getAllFundingAccounts, } from '../../commonSetup/setupViewSelector';
|
|
@@ -74,14 +73,11 @@ export const getReviewPageBillDetail = (state, billId) => {
|
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
if (sourceBillDetail != null) {
|
|
77
|
-
|
|
76
|
+
sourceBillDetailFetchState = reduceFetchState([
|
|
78
77
|
sourceBillDetail.fetchStatus,
|
|
79
78
|
accountListState.byReportId['billPayAccountList'],
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
fetchStateList.push(classListState);
|
|
83
|
-
}
|
|
84
|
-
sourceBillDetailFetchState = reduceFetchState(fetchStateList).fetchState;
|
|
79
|
+
classListState,
|
|
80
|
+
]).fetchState;
|
|
85
81
|
}
|
|
86
82
|
}
|
|
87
83
|
else {
|
|
@@ -3,7 +3,6 @@ import cloneDeep from 'lodash/cloneDeep';
|
|
|
3
3
|
import { reduceAllFetchState, reduceAnyFetchState, } from '../../../../commonStateTypes/reduceFetchState';
|
|
4
4
|
import { getApprovalRulesByIds } from '../../../../entity/approvalRule/approvalRuleSelector';
|
|
5
5
|
import { getClassesByIds } from '../../../../entity/class/classSelector';
|
|
6
|
-
import { getIsAccountingClassesEnabled } from '../../../../entity/tenant/tenantSelector';
|
|
7
6
|
import { getUserByUserId } from '../../../../entity/user/userSelector';
|
|
8
7
|
import { getUserRoleByUserId } from '../../../../entity/userRole/userRoleSelector';
|
|
9
8
|
export const getBillPaySetupApproverView = createSelector((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (billPaySetupApproverViewState, approvalRuleState, userState) => {
|
|
@@ -45,7 +44,7 @@ export const getBillPaySetupApproverView = createSelector((state) => state.billP
|
|
|
45
44
|
newApprovalRuleId,
|
|
46
45
|
};
|
|
47
46
|
});
|
|
48
|
-
export const getBillPaySetupApproverUpdateDataView = createSelector((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (state) => state.classState, (state) => state.classListState, (state) => state.userRoleState, (
|
|
47
|
+
export const getBillPaySetupApproverUpdateDataView = createSelector((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (state) => state.classState, (state) => state.classListState, (state) => state.userRoleState, (billPaySetupApproverViewState, approvalRuleState, userState, classState, classListState, userRoleState) => {
|
|
49
48
|
const { affectedEntityIds, approvalRuleIds, approverListState, billPaySetupApproverViewUpdateData, fetchState, error, listeningToPusherEvent, } = billPaySetupApproverViewState;
|
|
50
49
|
const { approverIds, attributes } = approverListState;
|
|
51
50
|
const allApprovalRules = getApprovalRulesByIds(approvalRuleState, approvalRuleIds);
|
|
@@ -93,9 +92,10 @@ export const getBillPaySetupApproverUpdateDataView = createSelector((state) => s
|
|
|
93
92
|
allAttributes,
|
|
94
93
|
filteredAttributes,
|
|
95
94
|
billPaySetupApproverViewUpdateData,
|
|
96
|
-
approverListFetchStatus:
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
approverListFetchStatus: reduceAllFetchState([
|
|
96
|
+
approverListState.fetchStatus,
|
|
97
|
+
classListState,
|
|
98
|
+
]),
|
|
99
99
|
fetchState,
|
|
100
100
|
allAccountingClasses,
|
|
101
101
|
error,
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
import { concat, from } from 'rxjs';
|
|
2
2
|
import { filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { getIsAccountingClassesEnabled } from '../../../../../entity/tenant/tenantSelector';
|
|
4
3
|
import { fetchClassList } from '../../../../classList/classListReducer';
|
|
5
4
|
import { fetchBillPayApproversDetails, fetchBillPayApproversList, } from '../billPaySetupApproverViewReducer';
|
|
6
5
|
export const fetchBillPayApproversDetailsEpic = (actions$, state$) => actions$.pipe(filter(fetchBillPayApproversDetails.match), mergeMap((action) => {
|
|
7
6
|
const { cacheOverride, includeUserRoles } = action.payload;
|
|
8
7
|
const { billPaySetupApproverViewState, classListState } = state$.value;
|
|
9
8
|
const { approverListState } = billPaySetupApproverViewState;
|
|
10
|
-
const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state$.value);
|
|
11
9
|
const actions = [];
|
|
12
10
|
if (cacheOverride === true) {
|
|
13
11
|
actions.push(fetchBillPayApproversList(cacheOverride, includeUserRoles));
|
|
14
|
-
|
|
15
|
-
actions.push(fetchClassList());
|
|
16
|
-
}
|
|
12
|
+
actions.push(fetchClassList());
|
|
17
13
|
}
|
|
18
14
|
else {
|
|
19
15
|
if (billPaySetupApproverViewState.hasValidState() === false &&
|
|
20
16
|
approverListState.fetchStatus.fetchState !== 'In-Progress') {
|
|
21
17
|
actions.push(fetchBillPayApproversList(true, includeUserRoles));
|
|
22
18
|
}
|
|
23
|
-
if (
|
|
24
|
-
classListState.hasValidState() === false &&
|
|
19
|
+
if (classListState.hasValidState() === false &&
|
|
25
20
|
classListState.fetchState !== 'In-Progress') {
|
|
26
21
|
actions.push(fetchClassList());
|
|
27
22
|
}
|
|
@@ -7,7 +7,6 @@ import { getCompanyByCompanyId } from '../../../../entity/company/companySelecto
|
|
|
7
7
|
import { getDepositAccountByDepositAccountId } from '../../../../entity/depositAccount/depositAccountSelector';
|
|
8
8
|
import { getPaymentAccountByPaymentAccountId, getPaymentAccountsByPaymentAccountIds, } from '../../../../entity/paymentAccount/paymentAccountSelector';
|
|
9
9
|
import { getPaymentInstrumentById, getPaymentInstrumentsByIds, } from '../../../../entity/paymentInstrument/paymentInstrumentSelector';
|
|
10
|
-
import { getIsAccountingClassesEnabled } from '../../../../entity/tenant/tenantSelector';
|
|
11
10
|
import { getUserByUserId } from '../../../../entity/user/userSelector';
|
|
12
11
|
import { getVendorByQboId, getVendorByVendorId, } from '../../../../entity/vendor/vendorSelector';
|
|
13
12
|
import { dateNow } from '../../../../zeniDayJS';
|
|
@@ -173,15 +172,12 @@ export const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, i
|
|
|
173
172
|
isCancelled = sourceBillDetail.billDetailLocalData.isCancelled;
|
|
174
173
|
billStage = billPayInfo?.stage.code ?? 'draft';
|
|
175
174
|
if (billViewState != null) {
|
|
176
|
-
|
|
175
|
+
fetchState = reduceFetchState([
|
|
177
176
|
sourceBillDetail.fetchStatus,
|
|
178
177
|
accountListState.byReportId.billPayAccountList,
|
|
178
|
+
classListState,
|
|
179
179
|
billPaySetupApproverViewState,
|
|
180
|
-
];
|
|
181
|
-
if (getIsAccountingClassesEnabled(state)) {
|
|
182
|
-
fetchStateList.push(classListState);
|
|
183
|
-
}
|
|
184
|
-
fetchState = reduceFetchState(fetchStateList).fetchState;
|
|
180
|
+
]).fetchState;
|
|
185
181
|
deleteStatus = billViewState.deleteStatus;
|
|
186
182
|
billActivities = getBillActivities(state, billId, billPayInfo?.stage.code);
|
|
187
183
|
}
|
|
@@ -195,14 +191,11 @@ export const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, i
|
|
|
195
191
|
}
|
|
196
192
|
}
|
|
197
193
|
else {
|
|
198
|
-
|
|
194
|
+
fetchState = reduceFetchState([
|
|
199
195
|
accountListState.byReportId.billPayAccountList,
|
|
196
|
+
classListState,
|
|
200
197
|
billPaySetupApproverViewState,
|
|
201
|
-
];
|
|
202
|
-
if (getIsAccountingClassesEnabled(state)) {
|
|
203
|
-
newBillFetchStateList.push(classListState);
|
|
204
|
-
}
|
|
205
|
-
fetchState = reduceFetchState(newBillFetchStateList).fetchState;
|
|
198
|
+
]).fetchState;
|
|
206
199
|
}
|
|
207
200
|
if (sourceBillDetail != null && fetchState == 'Completed') {
|
|
208
201
|
const updatedRecord = sourceBillDetail.billDetailLocalData;
|
|
@@ -219,8 +219,6 @@ const getCardsBySortKey = (card, sortKey) => {
|
|
|
219
219
|
return card.cardName.toLowerCase();
|
|
220
220
|
case 'cardType':
|
|
221
221
|
return card.type.code;
|
|
222
|
-
case 'accountType':
|
|
223
|
-
return card.type.code.includes('credit') ? 'credit' : 'debit';
|
|
224
222
|
case 'status':
|
|
225
223
|
return card.status.code;
|
|
226
224
|
case 'utilisation':
|
|
@@ -2,7 +2,7 @@ import recordGet from 'lodash/get';
|
|
|
2
2
|
import { reduceFetchState } from '../../../../commonStateTypes/reduceFetchState';
|
|
3
3
|
import { getBankAccountByBankAccountId } from '../../../../entity/bankAccount/bankAccountSelector';
|
|
4
4
|
import { getAllCurrencies } from '../../../../entity/currency/currencySelector';
|
|
5
|
-
import { getCurrentTenant
|
|
5
|
+
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
6
6
|
import { getUserByUserId } from '../../../../entity/user/userSelector';
|
|
7
7
|
import { getAccountList, getNestedAccountListHierarchy, } from '../../../accountList/accountListSelector';
|
|
8
8
|
import { getBankAccount, } from '../../../bankAccountView/bankAccountViewSelector';
|
|
@@ -63,16 +63,13 @@ export const getEditRemiDetail = (state, reimbursementId) => {
|
|
|
63
63
|
paymentTo: reimbursementInfo?.toAccount.billAccountId,
|
|
64
64
|
};
|
|
65
65
|
if (sourceRemiDetail != null) {
|
|
66
|
-
|
|
66
|
+
fetchState = reduceFetchState([
|
|
67
67
|
sourceRemiDetail.fetchStatus,
|
|
68
68
|
accountListState.byReportId.reimbursementAccountList,
|
|
69
|
+
classListState,
|
|
69
70
|
merchantListState,
|
|
70
71
|
reimbursementConfigState,
|
|
71
|
-
];
|
|
72
|
-
if (getIsAccountingClassesEnabled(state)) {
|
|
73
|
-
fetchStateList.push(classListState);
|
|
74
|
-
}
|
|
75
|
-
fetchState = reduceFetchState(fetchStateList).fetchState;
|
|
72
|
+
]).fetchState;
|
|
76
73
|
remiStage = reimbursementInfo?.stage.code ?? 'draft';
|
|
77
74
|
createdBy = getUserByUserId(userState, reimbursement?.createdBy ?? '');
|
|
78
75
|
createTime = reimbursement?.createTime;
|