@zeniai/client-epic-state 4.20.2-beta37RR → 4.20.2-betaJK1
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/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +19 -0
- package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +2 -0
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
- package/lib/entity/account/accountPayload.d.ts +2 -0
- package/lib/entity/account/accountReducer.d.ts +5 -2
- package/lib/entity/account/accountReducer.js +7 -2
- package/lib/entity/account/accountSelector.d.ts +1 -0
- package/lib/entity/account/accountSelector.js +8 -1
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -2
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
- 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/jeSchedules/jeSchedulesPayload.d.ts +38 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +78 -0
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +4 -1
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +5 -1
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +37 -0
- 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 -2
- package/lib/entity/task/taskPayload.d.ts +0 -3
- package/lib/entity/task/taskPayload.js +0 -5
- package/lib/entity/task/taskState.d.ts +0 -3
- package/lib/entity/tenant/tenantPayload.d.ts +1 -0
- package/lib/entity/tenant/tenantReducer.js +1 -0
- package/lib/entity/tenant/tenantSelector.d.ts +1 -0
- package/lib/entity/tenant/tenantSelector.js +9 -1
- package/lib/entity/tenant/tenantState.d.ts +1 -0
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +4 -1
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +3 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +18 -1
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +1 -0
- package/lib/entity/transaction/stateTypes/transaction.d.ts +5 -0
- package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
- package/lib/epic.d.ts +4 -3
- package/lib/epic.js +4 -3
- package/lib/esm/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +1 -0
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
- package/lib/esm/entity/account/accountReducer.js +6 -1
- package/lib/esm/entity/account/accountSelector.js +6 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +78 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +5 -1
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/esm/entity/task/taskPayload.js +0 -5
- package/lib/esm/entity/tenant/tenantReducer.js +1 -0
- package/lib/esm/entity/tenant/tenantSelector.js +7 -0
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +18 -1
- package/lib/esm/epic.js +4 -3
- package/lib/esm/index.js +14 -13
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +82 -1
- package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +8 -2
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +29 -0
- package/lib/esm/view/classList/fetchClassListEpic.js +9 -2
- package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
- package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
- package/lib/esm/view/companyView/types/cockpitTypes.js +0 -1
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +44 -0
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +6 -11
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +44 -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 +4 -3
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
- 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 +17 -1
- package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +148 -3
- package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +12 -4
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +90 -10
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +12 -6
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +18 -1
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
- package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +10 -0
- package/lib/esm/view/spendManagement/billPay/billList/billListState.js +1 -0
- package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
- package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +7 -4
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +0 -3
- package/lib/esm/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +0 -5
- package/lib/esm/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +0 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +0 -1
- package/lib/esm/view/taskManager/taskDetailView/taskDetail.js +0 -4
- package/lib/esm/view/taskManager/taskDetailView/taskDetailReducer.js +1 -49
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -11
- package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +8 -56
- package/lib/esm/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +0 -1
- package/lib/esm/view/taskManager/taskListView/epics/fetchTaskListEpic.js +3 -13
- package/lib/esm/view/taskManager/taskListView/taskList.js +0 -8
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +12 -106
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +39 -51
- package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
- package/lib/index.d.ts +20 -17
- package/lib/index.js +44 -36
- package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +7 -0
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +15 -1
- package/lib/view/aiCfoView/aiCfoViewReducer.js +83 -2
- package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +4 -1
- package/lib/view/aiCfoView/aiCfoViewSelector.js +9 -2
- package/lib/view/aiCfoView/aiCfoViewState.d.ts +15 -1
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -0
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +33 -0
- package/lib/view/auditReportView/auditReportViewState.d.ts +2 -2
- 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/classList/fetchClassListEpic.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.js +8 -1
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -0
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
- 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 +0 -1
- 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 +6 -11
- 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/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +1 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +4 -3
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
- 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/payload/reconciliationPayload.d.ts +33 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +18 -2
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +14 -3
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +149 -4
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +11 -1
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +12 -4
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +89 -9
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +11 -5
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +5 -0
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +20 -0
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +12 -0
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- 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 +3 -0
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -0
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +6 -3
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -0
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +0 -3
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +0 -5
- package/lib/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +0 -1
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +0 -1
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +0 -2
- package/lib/view/taskManager/taskDetailView/taskDetail.js +0 -4
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +1 -10
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +2 -50
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +0 -4
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -11
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +3 -9
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +7 -55
- package/lib/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +0 -1
- package/lib/view/taskManager/taskListView/epics/fetchTaskListEpic.js +3 -13
- package/lib/view/taskManager/taskListView/taskList.d.ts +1 -15
- package/lib/view/taskManager/taskListView/taskList.js +1 -10
- package/lib/view/taskManager/taskListView/taskListPayload.d.ts +0 -3
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +4 -8
- package/lib/view/taskManager/taskListView/taskListReducer.js +13 -107
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +3 -9
- package/lib/view/taskManager/taskListView/taskListSelector.js +39 -51
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
- package/package.json +1 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +0 -65
- package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +0 -56
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.d.ts +0 -9
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +0 -69
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.d.ts +0 -9
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +0 -60
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import orderBy from 'lodash/orderBy';
|
|
2
|
+
import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
|
|
2
3
|
import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
3
4
|
import { getCurrentTenant } from '../../../entity/tenant/tenantSelector';
|
|
4
5
|
import { getSupportedTransactionById, getSupportedTransactionsByIds, } from '../../../entity/transaction/transactionSelector';
|
|
@@ -7,7 +8,7 @@ import { getCompletedTransactionsCacheKey } from '../reducers/missingReceiptsVie
|
|
|
7
8
|
import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
|
|
8
9
|
import { isUnmatchedTabFileStatus, } from '../types/missingReceiptsViewState';
|
|
9
10
|
export function getExpenseAutomationMissingReceiptsView(state) {
|
|
10
|
-
const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
|
|
11
|
+
const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
|
|
11
12
|
const currentTenant = getCurrentTenant(state);
|
|
12
13
|
const { selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
13
14
|
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
@@ -36,7 +37,7 @@ export function getExpenseAutomationMissingReceiptsView(state) {
|
|
|
36
37
|
transaction.lines.length > 0 &&
|
|
37
38
|
transaction.lines[0]
|
|
38
39
|
?.class != null
|
|
39
|
-
? transaction.lines[0].class
|
|
40
|
+
? transaction.lines[0].class?.className.toLowerCase()
|
|
40
41
|
: null;
|
|
41
42
|
case 'vendor':
|
|
42
43
|
default:
|
|
@@ -175,9 +176,16 @@ export function getExpenseAutomationMissingReceiptsView(state) {
|
|
|
175
176
|
vendorLogo: result.vendorLogo ?? transaction?.logo?.href,
|
|
176
177
|
};
|
|
177
178
|
});
|
|
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
|
+
]);
|
|
178
186
|
return {
|
|
179
|
-
fetchState,
|
|
180
|
-
error,
|
|
187
|
+
fetchState: reducedFetchStatus.fetchState,
|
|
188
|
+
error: reducedFetchStatus.error,
|
|
181
189
|
uploadReceiptStatusById,
|
|
182
190
|
uiState,
|
|
183
191
|
refreshStatus,
|
|
@@ -5,7 +5,7 @@ import omit from 'lodash/omit';
|
|
|
5
5
|
import orderBy from 'lodash/orderBy';
|
|
6
6
|
import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
|
|
7
7
|
import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
8
|
-
import { getAccountsByType } from '../../../entity/account/accountSelector';
|
|
8
|
+
import { getAccountByAccountId, 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';
|
|
@@ -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, currentTenant, reconciliationViewState, expenseAutomationViewState, plaidAccountViewState, accountListState, accountState, classListState, classState, monthEndCloseChecksState, vendorState) => {
|
|
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) => state.monthEndCloseChecksViewState, (state, currentTenant, reconciliationViewState, expenseAutomationViewState, plaidAccountViewState, accountListState, accountState, classListState, classState, monthEndCloseChecksState, vendorState, monthEndCloseChecksViewState) => {
|
|
17
17
|
const { selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
18
18
|
const reconcileTabUiState = reconciliationViewState.reconTabsState.reconcile.uiState;
|
|
19
19
|
const reviewTabUiState = reconciliationViewState.reconTabsState.review.uiState;
|
|
@@ -35,6 +35,13 @@ 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 };
|
|
38
45
|
if (accountReconForMonthYearPeriod == null) {
|
|
39
46
|
return {
|
|
40
47
|
bankAccounts: [],
|
|
@@ -44,10 +51,13 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
44
51
|
classListNestedAccountHierarchy: [],
|
|
45
52
|
allAccountList: [],
|
|
46
53
|
allClassList: [],
|
|
47
|
-
fetchStatus:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
fetchStatus: reduceAnyFetchState([
|
|
55
|
+
{
|
|
56
|
+
fetchState: reconciliationViewState.fetchState,
|
|
57
|
+
error: reconciliationViewState.error,
|
|
58
|
+
},
|
|
59
|
+
monthEndFetchState,
|
|
60
|
+
]),
|
|
51
61
|
plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
|
|
52
62
|
.plaidConnectionDetails,
|
|
53
63
|
completionStatus: 'incomplete',
|
|
@@ -80,6 +90,30 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
80
90
|
totalVariancePercentage: undefined,
|
|
81
91
|
},
|
|
82
92
|
},
|
|
93
|
+
excludedAccountReconciliationByAccountID: {},
|
|
94
|
+
excludedAccountReconciliationBySectionID: {
|
|
95
|
+
assets: {
|
|
96
|
+
sectionId: 'assets',
|
|
97
|
+
accountIDs: [],
|
|
98
|
+
totalBankBalance: undefined,
|
|
99
|
+
totalClearedBalance: undefined,
|
|
100
|
+
totalReconciledBalance: undefined,
|
|
101
|
+
totalVariance: undefined,
|
|
102
|
+
totalVariancePercentage: undefined,
|
|
103
|
+
},
|
|
104
|
+
liabilities: {
|
|
105
|
+
sectionId: 'liabilities',
|
|
106
|
+
accountIDs: [],
|
|
107
|
+
totalBankBalance: undefined,
|
|
108
|
+
totalClearedBalance: undefined,
|
|
109
|
+
totalReconciledBalance: undefined,
|
|
110
|
+
totalVariance: undefined,
|
|
111
|
+
totalVariancePercentage: undefined,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
excludeAccountFetchState: reconciliationViewState.actionFetchState.excludeAccountFetch,
|
|
115
|
+
includeAccountFetchState: reconciliationViewState.actionFetchState.includeAccountFetch,
|
|
116
|
+
excludedAccountIDs: reconciliationViewState.excludedAccountIDs,
|
|
83
117
|
};
|
|
84
118
|
}
|
|
85
119
|
const allAccountIDs = accountReconForMonthYearPeriod.accountIDs;
|
|
@@ -239,6 +273,44 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
239
273
|
totalVariancePercentage: liabilityTotals.variancePercentage,
|
|
240
274
|
},
|
|
241
275
|
};
|
|
276
|
+
const bankAccountIdSet = new Set(uniqueBankAccounts.map((a) => a.accountId));
|
|
277
|
+
const creditCardIdSet = new Set(uniqueCreditCards.map((a) => a.accountId));
|
|
278
|
+
const excludedAssetAccountIDs = [];
|
|
279
|
+
const excludedLiabilityAccountIDs = [];
|
|
280
|
+
reconciliationViewState.excludedAccountIDs.forEach((accountID) => {
|
|
281
|
+
const isAsset = bankAccountIdSet.has(accountID);
|
|
282
|
+
const isLiability = creditCardIdSet.has(accountID);
|
|
283
|
+
if (!isAsset && !isLiability) {
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
if (isAsset) {
|
|
287
|
+
excludedAssetAccountIDs.push(accountID);
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
excludedLiabilityAccountIDs.push(accountID);
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
const excludedAccountReconciliationBySectionID = {
|
|
294
|
+
assets: {
|
|
295
|
+
sectionId: 'assets',
|
|
296
|
+
accountIDs: excludedAssetAccountIDs,
|
|
297
|
+
},
|
|
298
|
+
liabilities: {
|
|
299
|
+
sectionId: 'liabilities',
|
|
300
|
+
accountIDs: excludedLiabilityAccountIDs,
|
|
301
|
+
},
|
|
302
|
+
};
|
|
303
|
+
const excludedAccountReconciliationByAccountID = {};
|
|
304
|
+
reconciliationViewState.excludedAccountIDs.forEach((excludedAccountID) => {
|
|
305
|
+
const account = getAccountByAccountId(accountState, excludedAccountID);
|
|
306
|
+
const exclusionInfo = reconciliationViewState.excludedAccountExclusionInfo[excludedAccountID];
|
|
307
|
+
if (account != null) {
|
|
308
|
+
excludedAccountReconciliationByAccountID[excludedAccountID] = {
|
|
309
|
+
...account,
|
|
310
|
+
...exclusionInfo,
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
});
|
|
242
314
|
const accountListNestedAccountHierarchy = getNestedAccountListHierarchy(accountListState, 'accountList');
|
|
243
315
|
const classListNestedAccountHierarchy = getNestedClassListHierarchy(classListState);
|
|
244
316
|
const accountsList = getAccountList(accountState, accountListState, 'accountList');
|
|
@@ -270,10 +342,13 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
270
342
|
bankAccounts: uniqueBankAccounts,
|
|
271
343
|
creditCards: uniqueCreditCards,
|
|
272
344
|
accountReconciliationsByAccountID: reconList,
|
|
273
|
-
fetchStatus:
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
345
|
+
fetchStatus: reduceAnyFetchState([
|
|
346
|
+
{
|
|
347
|
+
fetchState: reconciliationViewState.fetchState,
|
|
348
|
+
error: reconciliationViewState.error,
|
|
349
|
+
},
|
|
350
|
+
monthEndFetchState,
|
|
351
|
+
]),
|
|
277
352
|
plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
|
|
278
353
|
.plaidConnectionDetails,
|
|
279
354
|
reconciliationTabsState: reconciliationViewState.reconTabsState,
|
|
@@ -296,6 +371,11 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
296
371
|
allClassList: allClasses,
|
|
297
372
|
reviewTabSelectedVendorByTransactionId,
|
|
298
373
|
reconListUIState: reconciliationViewState.reconListUIState,
|
|
374
|
+
excludedAccountReconciliationBySectionID,
|
|
375
|
+
excludedAccountReconciliationByAccountID,
|
|
376
|
+
excludeAccountFetchState: reconciliationViewState.actionFetchState.excludeAccountFetch,
|
|
377
|
+
includeAccountFetchState: reconciliationViewState.actionFetchState.includeAccountFetch,
|
|
378
|
+
excludedAccountIDs: reconciliationViewState.excludedAccountIDs,
|
|
299
379
|
};
|
|
300
380
|
});
|
|
301
381
|
export const isAccountReconReport = (reportId) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import omit from 'lodash/omit';
|
|
2
|
-
import { reduceAllFetchState } from '../../../commonStateTypes/reduceFetchState';
|
|
2
|
+
import { reduceAllFetchState, reduceAnyFetchState, } 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, } = state;
|
|
11
|
+
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = 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,10 +41,16 @@ 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
|
-
|
|
44
|
+
const monthEndFetchState = monthYearPeriodId != null
|
|
45
|
+
? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
|
|
46
|
+
: { fetchState: 'Not-Started', error: undefined };
|
|
47
|
+
const fetchStatus = reduceAnyFetchState([
|
|
48
|
+
reduceAllFetchState([
|
|
49
|
+
accountList,
|
|
50
|
+
classList,
|
|
51
|
+
expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
|
|
52
|
+
]),
|
|
53
|
+
monthEndFetchState,
|
|
48
54
|
]);
|
|
49
55
|
const totalCountByReview = expenseAutomationTransactionsViewState.transactionCategorizationView.review
|
|
50
56
|
.uiState.totalCount;
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
|
|
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);
|
package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js
CHANGED
|
@@ -3,6 +3,7 @@ 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';
|
|
6
7
|
import { enrichProfitAndLossByClassHorizontalReport } from './profitAndLossHorizontalEnrichment';
|
|
7
8
|
export const profitAndLossHorizontalIdsInOrder = [
|
|
8
9
|
'income',
|
|
@@ -303,6 +304,7 @@ function buildHeaderBalances(classColumns, timeframe, selectedPeriod, currency)
|
|
|
303
304
|
startDate,
|
|
304
305
|
type: 'default',
|
|
305
306
|
label: col.className,
|
|
307
|
+
id: col.classId,
|
|
306
308
|
}));
|
|
307
309
|
// Add a "Total" column
|
|
308
310
|
balances.push({
|
|
@@ -312,6 +314,7 @@ function buildHeaderBalances(classColumns, timeframe, selectedPeriod, currency)
|
|
|
312
314
|
startDate,
|
|
313
315
|
type: 'default',
|
|
314
316
|
label: 'Total',
|
|
317
|
+
id: HORIZONTAL_CLASS_TOTAL_BALANCE_ID,
|
|
315
318
|
});
|
|
316
319
|
return balances;
|
|
317
320
|
}
|
|
@@ -416,6 +416,14 @@ 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;
|
|
419
427
|
case 'dueDate':
|
|
420
428
|
if (currentTab === 'draft') {
|
|
421
429
|
if (Boolean(transaction.dueDate) === true) {
|
|
@@ -518,6 +526,8 @@ export const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions)
|
|
|
518
526
|
return transaction.totalAmountInUSD?.amount ?? 0;
|
|
519
527
|
case 'paymentMethod':
|
|
520
528
|
return transaction.billPayInfo.billPaymentMethodType.name;
|
|
529
|
+
case 'invoiceNumber':
|
|
530
|
+
return transaction.documentId;
|
|
521
531
|
}
|
|
522
532
|
}, getColumnWiseSortOrder(sortOrder));
|
|
523
533
|
return [
|
|
@@ -2,6 +2,7 @@ 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';
|
|
5
6
|
import { getVendorByVendorId } from '../../../../entity/vendor/vendorSelector';
|
|
6
7
|
import { getAccountList } from '../../../accountList/accountListSelector';
|
|
7
8
|
import { getAllFundingAccounts, } from '../../commonSetup/setupViewSelector';
|
|
@@ -73,11 +74,14 @@ export const getReviewPageBillDetail = (state, billId) => {
|
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
if (sourceBillDetail != null) {
|
|
76
|
-
|
|
77
|
+
const fetchStateList = [
|
|
77
78
|
sourceBillDetail.fetchStatus,
|
|
78
79
|
accountListState.byReportId['billPayAccountList'],
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
];
|
|
81
|
+
if (getIsAccountingClassesEnabled(state)) {
|
|
82
|
+
fetchStateList.push(classListState);
|
|
83
|
+
}
|
|
84
|
+
sourceBillDetailFetchState = reduceFetchState(fetchStateList).fetchState;
|
|
81
85
|
}
|
|
82
86
|
}
|
|
83
87
|
else {
|
|
@@ -3,6 +3,7 @@ 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';
|
|
6
7
|
import { getUserByUserId } from '../../../../entity/user/userSelector';
|
|
7
8
|
import { getUserRoleByUserId } from '../../../../entity/userRole/userRoleSelector';
|
|
8
9
|
export const getBillPaySetupApproverView = createSelector((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (billPaySetupApproverViewState, approvalRuleState, userState) => {
|
|
@@ -44,7 +45,7 @@ export const getBillPaySetupApproverView = createSelector((state) => state.billP
|
|
|
44
45
|
newApprovalRuleId,
|
|
45
46
|
};
|
|
46
47
|
});
|
|
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) => {
|
|
48
|
+
export const getBillPaySetupApproverUpdateDataView = createSelector((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (state) => state.classState, (state) => state.classListState, (state) => state.userRoleState, (state) => getIsAccountingClassesEnabled(state), (billPaySetupApproverViewState, approvalRuleState, userState, classState, classListState, userRoleState, isAccountingClassesEnabled) => {
|
|
48
49
|
const { affectedEntityIds, approvalRuleIds, approverListState, billPaySetupApproverViewUpdateData, fetchState, error, listeningToPusherEvent, } = billPaySetupApproverViewState;
|
|
49
50
|
const { approverIds, attributes } = approverListState;
|
|
50
51
|
const allApprovalRules = getApprovalRulesByIds(approvalRuleState, approvalRuleIds);
|
|
@@ -92,10 +93,9 @@ export const getBillPaySetupApproverUpdateDataView = createSelector((state) => s
|
|
|
92
93
|
allAttributes,
|
|
93
94
|
filteredAttributes,
|
|
94
95
|
billPaySetupApproverViewUpdateData,
|
|
95
|
-
approverListFetchStatus:
|
|
96
|
-
approverListState.fetchStatus,
|
|
97
|
-
|
|
98
|
-
]),
|
|
96
|
+
approverListFetchStatus: isAccountingClassesEnabled
|
|
97
|
+
? reduceAllFetchState([approverListState.fetchStatus, classListState])
|
|
98
|
+
: approverListState.fetchStatus,
|
|
99
99
|
fetchState,
|
|
100
100
|
allAccountingClasses,
|
|
101
101
|
error,
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import { concat, from } from 'rxjs';
|
|
2
2
|
import { filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { getIsAccountingClassesEnabled } from '../../../../../entity/tenant/tenantSelector';
|
|
3
4
|
import { fetchClassList } from '../../../../classList/classListReducer';
|
|
4
5
|
import { fetchBillPayApproversDetails, fetchBillPayApproversList, } from '../billPaySetupApproverViewReducer';
|
|
5
6
|
export const fetchBillPayApproversDetailsEpic = (actions$, state$) => actions$.pipe(filter(fetchBillPayApproversDetails.match), mergeMap((action) => {
|
|
6
7
|
const { cacheOverride, includeUserRoles } = action.payload;
|
|
7
8
|
const { billPaySetupApproverViewState, classListState } = state$.value;
|
|
8
9
|
const { approverListState } = billPaySetupApproverViewState;
|
|
10
|
+
const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state$.value);
|
|
9
11
|
const actions = [];
|
|
10
12
|
if (cacheOverride === true) {
|
|
11
13
|
actions.push(fetchBillPayApproversList(cacheOverride, includeUserRoles));
|
|
12
|
-
|
|
14
|
+
if (isAccountingClassesEnabled) {
|
|
15
|
+
actions.push(fetchClassList());
|
|
16
|
+
}
|
|
13
17
|
}
|
|
14
18
|
else {
|
|
15
19
|
if (billPaySetupApproverViewState.hasValidState() === false &&
|
|
16
20
|
approverListState.fetchStatus.fetchState !== 'In-Progress') {
|
|
17
21
|
actions.push(fetchBillPayApproversList(true, includeUserRoles));
|
|
18
22
|
}
|
|
19
|
-
if (
|
|
23
|
+
if (isAccountingClassesEnabled &&
|
|
24
|
+
classListState.hasValidState() === false &&
|
|
20
25
|
classListState.fetchState !== 'In-Progress') {
|
|
21
26
|
actions.push(fetchClassList());
|
|
22
27
|
}
|
|
@@ -7,6 +7,7 @@ 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';
|
|
10
11
|
import { getUserByUserId } from '../../../../entity/user/userSelector';
|
|
11
12
|
import { getVendorByQboId, getVendorByVendorId, } from '../../../../entity/vendor/vendorSelector';
|
|
12
13
|
import { dateNow } from '../../../../zeniDayJS';
|
|
@@ -172,12 +173,15 @@ export const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, i
|
|
|
172
173
|
isCancelled = sourceBillDetail.billDetailLocalData.isCancelled;
|
|
173
174
|
billStage = billPayInfo?.stage.code ?? 'draft';
|
|
174
175
|
if (billViewState != null) {
|
|
175
|
-
|
|
176
|
+
const fetchStateList = [
|
|
176
177
|
sourceBillDetail.fetchStatus,
|
|
177
178
|
accountListState.byReportId.billPayAccountList,
|
|
178
|
-
classListState,
|
|
179
179
|
billPaySetupApproverViewState,
|
|
180
|
-
]
|
|
180
|
+
];
|
|
181
|
+
if (getIsAccountingClassesEnabled(state)) {
|
|
182
|
+
fetchStateList.push(classListState);
|
|
183
|
+
}
|
|
184
|
+
fetchState = reduceFetchState(fetchStateList).fetchState;
|
|
181
185
|
deleteStatus = billViewState.deleteStatus;
|
|
182
186
|
billActivities = getBillActivities(state, billId, billPayInfo?.stage.code);
|
|
183
187
|
}
|
|
@@ -191,11 +195,14 @@ export const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, i
|
|
|
191
195
|
}
|
|
192
196
|
}
|
|
193
197
|
else {
|
|
194
|
-
|
|
198
|
+
const newBillFetchStateList = [
|
|
195
199
|
accountListState.byReportId.billPayAccountList,
|
|
196
|
-
classListState,
|
|
197
200
|
billPaySetupApproverViewState,
|
|
198
|
-
]
|
|
201
|
+
];
|
|
202
|
+
if (getIsAccountingClassesEnabled(state)) {
|
|
203
|
+
newBillFetchStateList.push(classListState);
|
|
204
|
+
}
|
|
205
|
+
fetchState = reduceFetchState(newBillFetchStateList).fetchState;
|
|
199
206
|
}
|
|
200
207
|
if (sourceBillDetail != null && fetchState == 'Completed') {
|
|
201
208
|
const updatedRecord = sourceBillDetail.billDetailLocalData;
|
|
@@ -219,6 +219,8 @@ 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';
|
|
222
224
|
case 'status':
|
|
223
225
|
return card.status.code;
|
|
224
226
|
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 } from '../../../../entity/tenant/tenantSelector';
|
|
5
|
+
import { getCurrentTenant, getIsAccountingClassesEnabled, } 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,13 +63,16 @@ export const getEditRemiDetail = (state, reimbursementId) => {
|
|
|
63
63
|
paymentTo: reimbursementInfo?.toAccount.billAccountId,
|
|
64
64
|
};
|
|
65
65
|
if (sourceRemiDetail != null) {
|
|
66
|
-
|
|
66
|
+
const fetchStateList = [
|
|
67
67
|
sourceRemiDetail.fetchStatus,
|
|
68
68
|
accountListState.byReportId.reimbursementAccountList,
|
|
69
|
-
classListState,
|
|
70
69
|
merchantListState,
|
|
71
70
|
reimbursementConfigState,
|
|
72
|
-
]
|
|
71
|
+
];
|
|
72
|
+
if (getIsAccountingClassesEnabled(state)) {
|
|
73
|
+
fetchStateList.push(classListState);
|
|
74
|
+
}
|
|
75
|
+
fetchState = reduceFetchState(fetchStateList).fetchState;
|
|
73
76
|
remiStage = reimbursementInfo?.stage.code ?? 'draft';
|
|
74
77
|
createdBy = getUserByUserId(userState, reimbursement?.createdBy ?? '');
|
|
75
78
|
createTime = reimbursement?.createTime;
|
|
@@ -45,6 +45,7 @@ export const getRemiList = (state, currentTimePeriod, isBulkActionFeatureEnabled
|
|
|
45
45
|
return {
|
|
46
46
|
...reimbursement,
|
|
47
47
|
submittedBy: getUserByUserId(userState, reimbursement.reimburseeUserId),
|
|
48
|
+
createdByUser: getUserByUserId(userState, reimbursement.createdBy),
|
|
48
49
|
approvers: approvers,
|
|
49
50
|
};
|
|
50
51
|
});
|
|
@@ -415,6 +416,14 @@ export const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements
|
|
|
415
416
|
reimbursementsWithNoSortKeyValue.push(reimbursement);
|
|
416
417
|
}
|
|
417
418
|
break;
|
|
419
|
+
case 'createdBy':
|
|
420
|
+
if (reimbursement.createdByUser != null) {
|
|
421
|
+
reimbursementsWithSortKeyValue.push(reimbursement);
|
|
422
|
+
}
|
|
423
|
+
else {
|
|
424
|
+
reimbursementsWithNoSortKeyValue.push(reimbursement);
|
|
425
|
+
}
|
|
426
|
+
break;
|
|
418
427
|
}
|
|
419
428
|
});
|
|
420
429
|
const getColumnWiseSortOrder = (sortOrder) => {
|
|
@@ -422,6 +431,7 @@ export const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements
|
|
|
422
431
|
case 'reportName':
|
|
423
432
|
case 'type':
|
|
424
433
|
case 'status':
|
|
434
|
+
case 'createdBy':
|
|
425
435
|
return sortOrder === 'ascending' ? 'asc' : 'desc';
|
|
426
436
|
default:
|
|
427
437
|
return sortOrder === 'ascending' ? 'desc' : 'asc';
|
|
@@ -441,6 +451,8 @@ export const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements
|
|
|
441
451
|
return getStatusPerTab(reimbursement);
|
|
442
452
|
case 'amount':
|
|
443
453
|
return reimbursement.amount.amount ?? 0;
|
|
454
|
+
case 'createdBy':
|
|
455
|
+
return `${reimbursement.createdByUser?.firstName ?? ''} ${reimbursement.createdByUser?.lastName ?? ''}`.toLowerCase();
|
|
444
456
|
}
|
|
445
457
|
}, getColumnWiseSortOrder(sortOrder));
|
|
446
458
|
return [
|
|
@@ -4,7 +4,6 @@ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
|
4
4
|
import { updateTasks } from '../../../../entity/task/taskReducer';
|
|
5
5
|
import { getTaskById } from '../../../../entity/task/taskSelector';
|
|
6
6
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
7
|
-
import { fetchTaskList, removeTaskFromList, } from '../../taskListView/taskListReducer';
|
|
8
7
|
import { archiveTask, archiveTaskSuccessOrFailure } from '../taskDetailReducer';
|
|
9
8
|
// Epic function to handle archiving of tasks
|
|
10
9
|
export const archiveTaskEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(archiveTask.match), mergeMap((action) => handleArchiveTask(action.payload.taskId, state$, zeniAPI)));
|
|
@@ -26,8 +25,6 @@ const handleApiResponse = (response, taskId) => {
|
|
|
26
25
|
response.data.tasks.length > 0) {
|
|
27
26
|
const fetchActions = [
|
|
28
27
|
updateTasks(response.data.tasks),
|
|
29
|
-
removeTaskFromList(taskId),
|
|
30
|
-
fetchTaskList(),
|
|
31
28
|
archiveTaskSuccessOrFailure({
|
|
32
29
|
fetchState: 'Completed',
|
|
33
30
|
taskId,
|
|
@@ -2,7 +2,6 @@ import { from, of } from 'rxjs';
|
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
4
4
|
import { createZeniAPIStatus, isSuccessStatus, } from '../../../../responsePayload';
|
|
5
|
-
import { fetchTaskList, removeTaskFromList, } from '../../taskListView/taskListReducer';
|
|
6
5
|
import { deleteTask, deleteTaskSuccessOrFailure } from '../taskDetailReducer';
|
|
7
6
|
export const deleteTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(deleteTask.match), mergeMap((action) => {
|
|
8
7
|
const { taskId } = action.payload;
|
|
@@ -11,10 +10,6 @@ export const deleteTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filt
|
|
|
11
10
|
.pipe(mergeMap((response) => {
|
|
12
11
|
if (isSuccessStatus(response)) {
|
|
13
12
|
const actions = [];
|
|
14
|
-
if (taskId != null) {
|
|
15
|
-
actions.push(removeTaskFromList(taskId));
|
|
16
|
-
}
|
|
17
|
-
actions.push(fetchTaskList());
|
|
18
13
|
actions.push(deleteTaskSuccessOrFailure({ fetchState: 'Completed', taskId }));
|
|
19
14
|
return from(actions);
|
|
20
15
|
}
|
|
@@ -25,7 +25,6 @@ export const initializeTaskToLocalStoreEpic = (actions$, state$) => actions$.pip
|
|
|
25
25
|
savedRecurringEndDate: task.recurringEndDate,
|
|
26
26
|
recurringStartDate: task.recurringStartDate,
|
|
27
27
|
timeSpent: task.timeSpent,
|
|
28
|
-
isPrivate: task.isPrivate,
|
|
29
28
|
};
|
|
30
29
|
const actions = [
|
|
31
30
|
saveTaskUpdatesToLocalStore({ taskDetailLocalData, taskId }),
|
|
@@ -94,6 +94,5 @@ const prepareTaskPayload = (state, taskId, taskGroupId) => {
|
|
|
94
94
|
sync_token: syncToken,
|
|
95
95
|
task_group_ids: taskGroupId != null ? [taskGroupId] : [],
|
|
96
96
|
time_spent: convertHHMMStrToMinutes(localData.timeSpent),
|
|
97
|
-
...(taskId == null ? { is_private: localData.isPrivate ?? false } : {}),
|
|
98
97
|
};
|
|
99
98
|
};
|