@zeniai/client-epic-state 5.2.62-beta1MM → 5.2.62-beta2KB
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/entity/actualMatching/actualMatchingReducer.d.ts +1 -3
- package/lib/entity/actualMatching/actualMatchingReducer.js +2 -11
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +0 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -1
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +0 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -1
- package/lib/entity/transaction/stateTypes/paymentType.d.ts +2 -2
- package/lib/entity/transaction/stateTypes/paymentType.js +9 -1
- package/lib/entity/transaction/stateTypes/printStatus.d.ts +4 -0
- package/lib/entity/transaction/stateTypes/printStatus.js +15 -0
- package/lib/epic.d.ts +4 -2
- package/lib/epic.js +6 -2
- package/lib/esm/entity/actualMatching/actualMatchingReducer.js +1 -9
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -1
- package/lib/esm/entity/snackbar/snackbarTypes.js +1 -1
- package/lib/esm/entity/transaction/stateTypes/paymentType.js +9 -1
- package/lib/esm/entity/transaction/stateTypes/printStatus.js +11 -0
- package/lib/esm/epic.js +6 -2
- package/lib/esm/index.js +10 -7
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +2 -4
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +13 -26
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +23 -2
- package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +38 -89
- package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +64 -61
- package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +0 -15
- package/lib/esm/view/transactionDetail/createTransaction/createTransactionLocalDataHelper.js +133 -0
- package/lib/esm/view/transactionDetail/createTransaction/createTransactionPayload.js +132 -0
- package/lib/esm/view/transactionDetail/createTransaction/createTransactionSelector.js +41 -0
- package/lib/esm/view/transactionDetail/createTransaction/createTransactionState.js +11 -0
- package/lib/esm/view/transactionDetail/createTransaction/epics/createTransactionEpic.js +60 -0
- package/lib/esm/view/transactionDetail/createTransaction/epics/fetchVendorRecommendationsForCreateTransactionEpic.js +55 -0
- package/lib/esm/view/transactionDetail/createTransaction/epics/initializeCreateTransactionLocalDataEpic.js +14 -0
- package/lib/esm/view/transactionDetail/transactionDetailReducer.js +174 -1
- package/lib/index.d.ts +12 -8
- package/lib/index.js +70 -57
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +1 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +11 -24
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +22 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +1 -12
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +8 -19
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +39 -90
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +8 -20
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +4 -7
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +64 -64
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +4 -20
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +1 -18
- package/lib/view/transactionDetail/createTransaction/createTransactionLocalDataHelper.d.ts +51 -0
- package/lib/view/transactionDetail/createTransaction/createTransactionLocalDataHelper.js +148 -0
- package/lib/view/transactionDetail/createTransaction/createTransactionPayload.d.ts +85 -0
- package/lib/view/transactionDetail/createTransaction/createTransactionPayload.js +136 -0
- package/lib/view/transactionDetail/createTransaction/createTransactionSelector.d.ts +40 -0
- package/lib/view/transactionDetail/createTransaction/createTransactionSelector.js +48 -0
- package/lib/view/transactionDetail/createTransaction/createTransactionState.d.ts +81 -0
- package/lib/view/transactionDetail/createTransaction/createTransactionState.js +14 -0
- package/lib/view/transactionDetail/createTransaction/epics/createTransactionEpic.d.ts +9 -0
- package/lib/view/transactionDetail/createTransaction/epics/createTransactionEpic.js +64 -0
- package/lib/view/transactionDetail/createTransaction/epics/fetchVendorRecommendationsForCreateTransactionEpic.d.ts +20 -0
- package/lib/view/transactionDetail/createTransaction/epics/fetchVendorRecommendationsForCreateTransactionEpic.js +59 -0
- package/lib/view/transactionDetail/createTransaction/epics/initializeCreateTransactionLocalDataEpic.d.ts +12 -0
- package/lib/view/transactionDetail/createTransaction/epics/initializeCreateTransactionLocalDataEpic.js +18 -0
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +37 -1
- package/lib/view/transactionDetail/transactionDetailReducer.js +176 -2
- package/lib/view/transactionDetail/transactionDetailState.d.ts +12 -0
- package/package.json +1 -1
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +0 -50
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.d.ts +0 -10
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +0 -54
package/lib/esm/index.js
CHANGED
|
@@ -188,7 +188,7 @@ import { toExpenseAutomationViewType, toExpenseAutomationViewTypeStrict, } from
|
|
|
188
188
|
import { computeNewScheduleJeDetails } from './view/expenseAutomationView/helpers/newScheduleLocalDataHelper';
|
|
189
189
|
import { isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardCreditType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, } from './view/expenseAutomationView/helpers/reconciliationHelpers';
|
|
190
190
|
import { MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, } from './view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper';
|
|
191
|
-
import {
|
|
191
|
+
import { ackCloseMatchAfterUndo, clearActualMatchingView as clearExpenseAutomationActualMatchingView, clearMatchNewModal, closeMatchNewModal, fetchActualMatchingMatch, fetchActualMatching as fetchExpenseAutomationActualMatching, fetchActualMatchingPage as fetchExpenseAutomationActualMatchingPage, matchAndReverseAccruals, openMatchNewModal, searchMatchAccruals, searchMatchTransactions, undoReversalAccruals, updateActualMatchingUIState as updateExpenseAutomationActualMatchingUIState, } from './view/expenseAutomationView/reducers/actualMatchingViewReducer';
|
|
192
192
|
import { clearExpenseAutomationFluxAnalysisView, fetchFluxAnalysisView, reviewFluxAnalysisView, updateFluxAnalysisViewPageMetaData, updateFluxAnalysisViewUIState, updateOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview, } from './view/expenseAutomationView/reducers/fluxAnalysisViewReducer';
|
|
193
193
|
import { clearJeScheduleLocalData as clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, clearSearchTransactionsForNewSchedule as clearJeSearchTransactionsForNewSchedule, createOneTimeAccrual, createOneTimeAccrualFailure, createOneTimeAccrualSuccess, fetchJeSchedulesPage as fetchExpenseAutomationJESchedulesPage, fetchOneTimeAccrual, ignoreRecommendedJeSchedule as ignoreExpenseAutomationJESchedule, ignoreOneTimeAccrual, initializeAccountSettingsView as initializeJeAccountSettingsView, initializeNewSchedule as initializeJeNewSchedule, initializeJeScheduleLocalData, promoteOneTimeAccrual, removeJeOneTimeAccrualLocalData, removeJeScheduleTransactionKey, resetNewScheduleLocalData as resetJeNewScheduleLocalData, retryJeSchedule as retryExpenseAutomationJESchedule, revertJeSchedule, revertOneTimeAccrual, saveAccountSettings as saveJeAccountSettings, saveAccountSettingsLocalData as saveJeAccountSettingsLocalData, saveNewSchedule as saveJeNewSchedule, saveNewScheduleFailure as saveJeNewScheduleFailure, saveNewScheduleSuccess as saveJeNewScheduleSuccess, searchTransactionsForNewSchedule as searchJeTransactionsForNewSchedule, searchTransactionsForNewScheduleFailure as searchJeTransactionsForNewScheduleFailure, searchTransactionsForNewScheduleSuccess as searchJeTransactionsForNewScheduleSuccess, toggleJECreatedGroupCollapsed, toggleJEFailedGroupCollapsed, toggleJEPendingGroupCollapsed, updateJESchedulesUIState as updateExpenseAutomationJESchedulesUIState, updateJEScheduleTypeFilter, updateNewScheduleLocalData as updateJeNewScheduleLocalData, updateJeOneTimeAccrualLocalData, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, } from './view/expenseAutomationView/reducers/jeSchedulesViewReducer';
|
|
194
194
|
import { acknowledgeBulkUploadConfirmMatchComplete, bulkUploadAutomatchingTimedOut, bulkUploadReceipts, bulkUploadReceiptsFailure, bulkUploadReceiptsSuccess, clearBulkUpload, clearBulkUploadBatchDetailsForScopeChange, clearManualSearchResults, clearMissingReceiptsTabNavigation, confirmBulkUploadMatch, confirmBulkUploadMatchFailure, confirmBulkUploadMatchSuccess, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsFailure, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches, fetchBulkUploadBatchesFailure, fetchBulkUploadBatchesSuccess, fetchCompletedTransactions, fetchCompletedTransactionsFailure, fetchCompletedTransactionsSuccess, fetchMissingReceipts as fetchExpenseAutomationMissingReceipts, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, markBatchDetailRefreshAttempted, markMissingReceiptAsDone as markExpenseAutomationMissingReceiptAsDone, pusherBatchStatusUpdate, refreshBatchDetailsForBatchId, requestMissingReceiptsTabNavigation, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState, searchTransactionsForManualMatch, searchTransactionsForManualMatchFailure, searchTransactionsForManualMatchSuccess, setBulkUploadCompletedSubTab, setBulkUploadResultsTab, setBulkUploadSortConfig, setBulkUploadUploadedFileCount, storeBatchDetails, updateBulkUploadProgress, updateMissingReceiptUploadState as updateExpenseAutomationMissingReceiptUploadState, updateMissingReceiptsUIState as updateExpenseAutomationMissingReceiptsUIState, uploadMissingReceiptSuccess as uploadExpenseAutomationMissingReceiptSuccess, } from './view/expenseAutomationView/reducers/missingReceiptsViewReducer';
|
|
@@ -200,7 +200,7 @@ import { getExpenseAutomationReconciliationView, getLedgerAccountIdsWithStatemen
|
|
|
200
200
|
import { getExpenseAutomationTransactionView, getLastTransferEntryReplacement, } from './view/expenseAutomationView/selectors/transactionCategorizationSelector';
|
|
201
201
|
import { applyTransactionFilters } from './view/expenseAutomationView/transactionFilterHelpers';
|
|
202
202
|
import { TRANSACTION_FILTER_CATEGORIES, } from './view/expenseAutomationView/transactionFilterTypes';
|
|
203
|
-
import { MATCH_ACCRUAL_SEARCH_LIMIT, MATCH_SEARCH_DEBOUNCE_MS, MATCH_TRANSACTION_SEARCH_PAGE_SIZE,
|
|
203
|
+
import { MATCH_ACCRUAL_SEARCH_LIMIT, MATCH_SEARCH_DEBOUNCE_MS, MATCH_TRANSACTION_SEARCH_PAGE_SIZE, actualMatchingTransactionLineKey, toActualMatchingSortKey as toExpenseAutomationActualMatchingSortKey, toMatchAndReverseResultStatus, toUndoReversalResultStatus, } from './view/expenseAutomationView/types/actualMatchingViewState';
|
|
204
204
|
import { DEFAULT_COMPLETED_SUB_TAB, toCompletedSubTab, } from './view/expenseAutomationView/types/completedSubTab';
|
|
205
205
|
import { ALL_JE_PAGE_TABS, toJEScheduleSortKey as toExpenseAutomationJEScheduleSortKey, toJEPageTab, } from './view/expenseAutomationView/types/jeSchedulesViewState';
|
|
206
206
|
import { BATCH_FILE_STATUSES, isUnmatchedTabFileStatus, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toMatchSource, toMissingReceiptsTab, } from './view/expenseAutomationView/types/missingReceiptsViewState';
|
|
@@ -428,8 +428,11 @@ import { getAllTopExpenses, getTop6Expenses, getTopExpenses, } from './view/topE
|
|
|
428
428
|
import { TOP_EX_TIME_PERIODS, } from './view/topEx/topExState';
|
|
429
429
|
import { getAccountingProviderAttachment, } from './view/transactionDetail/getAccountingProviderAttachmentSelector';
|
|
430
430
|
import { JOURNAL_ENTRY_SORT_KEYS, filterJournalEntryLinesExcludingLinked, journalEntryDefaultSortConfig, journalEntrySplitReconciliation, journalEntryTotalsByPostingSide, sortJournalEntryLines, sumJournalEntryAmounts, toJournalEntrySortKey, } from './view/transactionDetail/journalEntryLinesViewModel';
|
|
431
|
+
import { prepareCreateTransactionPayload, } from './view/transactionDetail/createTransaction/createTransactionPayload';
|
|
432
|
+
import { getCreateTransactionLocalData, getCreateTransactionStatus, getCreateTransactionVendorRecommendations, getCreateTransactionView, } from './view/transactionDetail/createTransaction/createTransactionSelector';
|
|
433
|
+
import { ALL_CREATABLE_TRANSACTION_TYPES, } from './view/transactionDetail/createTransaction/createTransactionState';
|
|
431
434
|
import { getChangedLineItemCountFromLocalData, isAccountUncategorized, } from './view/transactionDetail/transactionDetailLocalDataHelper';
|
|
432
|
-
import { addSplitLine, clearTransactionDetailSaveStatus, deleteSplitLine, deleteTransactionAttachment, downloadAccountingProviderAttachment, downloadAccountingProviderAttachmentFailure, downloadAccountingProviderAttachmentSuccess, fetchTransactionDetail, initializeTransactionDetailLocalData, markCategoryClassRecommendationsFailureForTransactionDetail, removeEntityRecommendationForLineIdForTransactionDetail, resetAllLineItemsToVendor, resetLineItemsCategoryClassInLocalData, resetSelectedCustomer, resetVendor, saveTransactionDetail, saveTransactionDetailLocalData, setAllLineItemsLocalDataIsUpdateAllChecked, setAllLineItemsToCategoryClassInLocalData, setIsVendorUpdateAllChecked, toggleSplitEditMode, updateLatestSelectedEntity, updateLocalDataWithTransactionsUpdateWithVendorCheckbox, updateSelectedCustomer, updateSelectedVendor, updateTransactionDetail, updateVendorBulkRecommendationsFetchStatus, updateVendorToAllLineItems, uploadMissingAttachmentSuccess, } from './view/transactionDetail/transactionDetailReducer';
|
|
435
|
+
import { addCreateTransactionLine, addSplitLine, clearRecommendationsForCreateTransactionLines, clearTransactionDetailSaveStatus, createTransaction, createTransactionSuccessOrFailure, fetchVendorRecommendationsForCreateTransaction, initializeCreateTransactionLocalData, removeCreateTransactionLine, resetCreateTransactionLocalData, setRecommendationsForCreateTransactionLines, updateCreateTransactionLineLocalData, updateCreateTransactionLocalData, deleteSplitLine, deleteTransactionAttachment, downloadAccountingProviderAttachment, downloadAccountingProviderAttachmentFailure, downloadAccountingProviderAttachmentSuccess, fetchTransactionDetail, initializeTransactionDetailLocalData, markCategoryClassRecommendationsFailureForTransactionDetail, removeEntityRecommendationForLineIdForTransactionDetail, resetAllLineItemsToVendor, resetLineItemsCategoryClassInLocalData, resetSelectedCustomer, resetVendor, saveTransactionDetail, saveTransactionDetailLocalData, setAllLineItemsLocalDataIsUpdateAllChecked, setAllLineItemsToCategoryClassInLocalData, setIsVendorUpdateAllChecked, toggleSplitEditMode, updateLatestSelectedEntity, updateLocalDataWithTransactionsUpdateWithVendorCheckbox, updateSelectedCustomer, updateSelectedVendor, updateTransactionDetail, updateVendorBulkRecommendationsFetchStatus, updateVendorToAllLineItems, uploadMissingAttachmentSuccess, } from './view/transactionDetail/transactionDetailReducer';
|
|
433
436
|
import { getInitialUpdatablePeriodsForTransactionRecommendations, getTransactionDetail, getTransactionDetailForTransaction, } from './view/transactionDetail/transactionDetailSelector';
|
|
434
437
|
import { getThirdPartyIdFromTransactionId, } from './view/transactionDetail/transactionDetailState';
|
|
435
438
|
import { getTransactionListByAccount, getTransactionListUIStateByAccountKey, } from './view/transactionList/transactionListByAccountSelector';
|
|
@@ -492,7 +495,7 @@ export { stringToUnion, stringToUnionStrict };
|
|
|
492
495
|
export { fetchMonthEndCloseChecks, fetchMonthClosePerformanceTrend, getMonthEndCloseChecksViewByTenantId, ALL_MONTH_END_CLOSE_CHECKS_FREQUENCY, };
|
|
493
496
|
export {
|
|
494
497
|
// Bulk Upload Types
|
|
495
|
-
BATCH_FILE_STATUSES, isUnmatchedTabFileStatus, DEFAULT_COMPLETED_SUB_TAB, DEFAULT_TRANSACTION_GROUP, TRANSACTION_GROUPS, toTransactionGroup, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toCompletedSubTab, toMatchSource, toMissingReceiptsTab,
|
|
498
|
+
BATCH_FILE_STATUSES, isUnmatchedTabFileStatus, DEFAULT_COMPLETED_SUB_TAB, DEFAULT_TRANSACTION_GROUP, TRANSACTION_GROUPS, toTransactionGroup, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toCompletedSubTab, toMatchSource, toMissingReceiptsTab, actualMatchingTransactionLineKey, ALL_JE_PAGE_TABS, MATCH_ACCRUAL_SEARCH_LIMIT, MATCH_SEARCH_DEBOUNCE_MS, MATCH_TRANSACTION_SEARCH_PAGE_SIZE, toExpenseAutomationJEScheduleSortKey, toExpenseAutomationActualMatchingSortKey, toJEPageTab, toMatchAndReverseResultStatus, toUndoReversalResultStatus, toggleJECreatedGroupCollapsed, toggleJEFailedGroupCollapsed, toggleJEPendingGroupCollapsed, updateJEScheduleTypeFilter, getExpenseAutomationView, toExpenseAutomationMissingReceiptsSortKey, toExpenseAutomationTransactionsTabKey, toExpenseAutomationViewType, toExpenseAutomationViewTypeStrict, uploadExpenseAutomationMissingReceiptSuccess, markExpenseAutomationMissingReceiptAsDone, fetchAllExpenseAutomationTabs, refreshExpenseAutomationCurrentTab, updateCurrentSelectedTransactionCategorizationTab, updateTransactionCategorizationCompletedSubTab, updateTransactionGroup, fetchExpenseAutomationMissingReceipts,
|
|
496
499
|
// Bulk Upload Actions
|
|
497
500
|
bulkUploadReceipts, bulkUploadAutomatchingTimedOut, bulkUploadReceiptsSuccess, bulkUploadReceiptsFailure, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState, updateBulkUploadProgress, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, clearMissingReceiptsTabNavigation, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatchDetailsFailure, storeBatchDetails, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, fetchBulkUploadBatches, fetchBulkUploadBatchesSuccess, fetchBulkUploadBatchesFailure, clearBulkUploadBatchDetailsForScopeChange, markBatchDetailRefreshAttempted, refreshBatchDetailsForBatchId, confirmBulkUploadMatch, confirmBulkUploadMatchSuccess, confirmBulkUploadMatchFailure, setBulkUploadResultsTab, setBulkUploadCompletedSubTab, setBulkUploadSortConfig, setBulkUploadUploadedFileCount, clearBulkUpload, searchTransactionsForManualMatch, searchTransactionsForManualMatchSuccess, searchTransactionsForManualMatchFailure, clearManualSearchResults, acknowledgeBulkUploadConfirmMatchComplete, fetchCompletedTransactions, fetchCompletedTransactionsSuccess, fetchCompletedTransactionsFailure, fetchFluxAnalysisView, clearExpenseAutomationFluxAnalysisView, updateOperatingExpensesIdsForReview as updateFluxOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview as updateFluxAnalysisSelectedSectionIdsForReview, reviewFluxAnalysisView, updateExpenseAutomationMissingReceiptUploadState, updateExpenseAutomationMissingReceiptsUIState, updateTransactionCategorizationUploadReceiptState, uploadTransactionCategorizationReceiptSuccess, getExpenseAutomationFluxAnalysisView, updateCurrentSelectedView, updateCurrentSelectedPeriod, getExpenseAutomationTransactionView, getLastTransferEntryReplacement, updateFluxAnalysisViewUIState, updateFluxAnalysisViewPageMetaData, MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, excludeAccountFromReconciliation, includeAccountInReconciliation, saveExpenseAutomationReconciliationDetail, updateExpenseAutomationReconcileTabListScrollState, updateExpenseAutomationReconReviewTabListSortState, updateExpenseAutomationReconcileTabListSortState, updateExpenseAutomationReconcileTabLocalData, updateExpenseAutomationAccountReconciliationSelectedTab, updateExpenseAutomationAccountReconciliationSelectedAccountId, getExpenseAutomationReconciliationView, getLedgerAccountIdsWithStatementOverrideWarning, getLedgerAccountsForCombinedStatementMapping, getReparseStatementStatusByAccountId, getUnavailableLedgerAccountIds, fetchReconciliationView, uploadAccountStatementIntoDocumentAI, updateExpenseAutomationReconListScrollPosition, setConnectionInProgressForAccountReconciliation, getAccountReconByAccountIdAndSelectedPeriod, toReconciliationTabsType, isAccountReconReport, updateExpenseAutomationReconReviewTabLocalData, updateExpenseAutomationSelectedDrawerAccountId, updateStatementProcessingFailed, saveExpenseAutomationReconciliationReview, updateExpenseAutomationAccountReconciliationLocalData, toReconciliationAccountSource, deleteAccountStatement, deleteCombinedStatement, uploadAccountStatement, parseCombinedStatement, parseStatement, parseStatementSuccess, parseStatementFailure, reparseStatement, reparseStatementSuccess, reparseStatementFailure, resetReparseStatementStatus, updateParsedStatementData, updateNodeCollapseState, updateStatementUploadChosen, submitCombinedStatementUpdate, submitStatementUpdate, clearStatementDateConflict, confirmStatementMapping, updateStatementUpdateLocalData, isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, isReviewTransactionCreditCardCreditType, setStatementParseInProgress, setStatementProcessingDismissedToBackground, updateStatementProcessingBackgroundCompletedSteps, };
|
|
498
501
|
export { computeNewScheduleJeDetails, createOneTimeAccrual, createOneTimeAccrualFailure, createOneTimeAccrualSuccess, fetchOneTimeAccrual, getJeNewAccrualAccountsView, ignoreOneTimeAccrual, promoteOneTimeAccrual, revertJeSchedule, revertOneTimeAccrual, getJeNewScheduleSearchTransactionsView, getJeNewScheduleView, };
|
|
@@ -554,7 +557,7 @@ export { isTransferTransaction };
|
|
|
554
557
|
export { getScheduleTransactionById, getSupportedTransactionById, };
|
|
555
558
|
export { updateLatestTransactionId, parallelFetchAccountTransactionList, parallelFetchEntityTransactionList, fetchAccountTransactionList, updateTransactionListByAccount, updateTransactionListByAccountFailure, updateTransactionListByAccountUIState, parallelFetchClassTransactionList, updateTransactionListByClassUIState, updateTransactionListByClass, parallelFetchProjectTransactionList, updateTransactionListByProjectUIState, updateTransactionListByProject, updateTransactionListUIStateByCategoryType, parallelFetchTransactionListByCategoryType, };
|
|
556
559
|
export { getTransactionListByAccount, getTransactionListUIStateByAccountKey, };
|
|
557
|
-
export { fetchEntityTransactionList, updateTransactionListByEntity, saveTransactionDetailLocalData, clearTransactionDetailSaveStatus, updateTransactionListByEntityFailure, resetLineItemsCategoryClassInLocalData, setAllLineItemsToCategoryClassInLocalData, saveTransactionDetail, setAllLineItemsLocalDataIsUpdateAllChecked, initializeTransactionDetailLocalData, markCategoryClassRecommendationsFailureForTransactionDetail, removeEntityRecommendationForLineIdForTransactionDetail, updateSelectedVendor, updateSelectedCustomer, resetSelectedCustomer, resetVendor, updateLocalDataWithTransactionsUpdateWithVendorCheckbox, updateVendorToAllLineItems, resetAllLineItemsToVendor, updateLatestSelectedEntity, updateVendorBulkRecommendationsFetchStatus, setIsVendorUpdateAllChecked, addSplitLine, deleteSplitLine, toggleSplitEditMode, };
|
|
560
|
+
export { ALL_CREATABLE_TRANSACTION_TYPES, initializeCreateTransactionLocalData, updateCreateTransactionLocalData, updateCreateTransactionLineLocalData, addCreateTransactionLine, removeCreateTransactionLine, resetCreateTransactionLocalData, createTransaction, createTransactionSuccessOrFailure, fetchVendorRecommendationsForCreateTransaction, setRecommendationsForCreateTransactionLines, clearRecommendationsForCreateTransactionLines, getCreateTransactionView, getCreateTransactionLocalData, getCreateTransactionStatus, getCreateTransactionVendorRecommendations, prepareCreateTransactionPayload, fetchEntityTransactionList, updateTransactionListByEntity, saveTransactionDetailLocalData, clearTransactionDetailSaveStatus, updateTransactionListByEntityFailure, resetLineItemsCategoryClassInLocalData, setAllLineItemsToCategoryClassInLocalData, saveTransactionDetail, setAllLineItemsLocalDataIsUpdateAllChecked, initializeTransactionDetailLocalData, markCategoryClassRecommendationsFailureForTransactionDetail, removeEntityRecommendationForLineIdForTransactionDetail, updateSelectedVendor, updateSelectedCustomer, resetSelectedCustomer, resetVendor, updateLocalDataWithTransactionsUpdateWithVendorCheckbox, updateVendorToAllLineItems, resetAllLineItemsToVendor, updateLatestSelectedEntity, updateVendorBulkRecommendationsFetchStatus, setIsVendorUpdateAllChecked, addSplitLine, deleteSplitLine, toggleSplitEditMode, };
|
|
558
561
|
export { downloadAccountingProviderAttachment, downloadAccountingProviderAttachmentSuccess, downloadAccountingProviderAttachmentFailure, fetchTransactionDetail, updateTransactionDetail, uploadMissingAttachmentSuccess, deleteTransactionAttachment, getThirdPartyIdFromTransactionId, };
|
|
559
562
|
export { getTransactionListByEntity };
|
|
560
563
|
export { getTransactionListByClass, getTransactionListUIStateByClassKey, getTransactionListByProject, getTransactionListUIStateByProjectKey, getTransactionListByEntityForSinglePeriod, };
|
|
@@ -663,7 +666,7 @@ export { TIME_SERIES_DURATIONS, convertToTimeSeriesSelectionRange, toTimeSeriesD
|
|
|
663
666
|
export { fetchApAging, getApAgingReport, updateApAgingUIState, };
|
|
664
667
|
export { fetchApAgingDetail, getApAgingDetailForVendor, updateApAgingDetailUIState, };
|
|
665
668
|
export { clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, clearJeSearchTransactionsForNewSchedule, fetchExpenseAutomationJESchedulesPage, ignoreExpenseAutomationJESchedule, initializeJeAccountSettingsView, initializeJeNewSchedule, initializeJeScheduleLocalData, removeJeScheduleTransactionKey, resetJeNewScheduleLocalData, retryExpenseAutomationJESchedule, saveJeNewSchedule, saveJeNewScheduleFailure, saveJeNewScheduleSuccess, searchJeTransactionsForNewSchedule, searchJeTransactionsForNewScheduleFailure, searchJeTransactionsForNewScheduleSuccess, updateExpenseAutomationJESchedulesUIState, updateJeNewScheduleLocalData, removeJeOneTimeAccrualLocalData, updateJeOneTimeAccrualLocalData, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, };
|
|
666
|
-
export {
|
|
669
|
+
export { ackCloseMatchAfterUndo, clearExpenseAutomationActualMatchingView, closeMatchNewModal, clearMatchNewModal, fetchExpenseAutomationActualMatching, fetchActualMatchingMatch, fetchExpenseAutomationActualMatchingPage, matchAndReverseAccruals, openMatchNewModal, searchMatchAccruals, searchMatchTransactions, undoReversalAccruals, updateExpenseAutomationActualMatchingUIState, };
|
|
667
670
|
export { createNewSchedulesAccrued, deleteScheduleAccruedDetail, cancelScheduleAccruedJournalEntry, fetchScheduleAccruedDetails, fetchScheduleAccruedDetailsPage, resetJEAccruedLinkInLocalData, saveScheduleAccruedDetails, updateAmountsInScheduleAccruedDetail, updatedJEAccruedLinkWithRecommendedLocalData, updatedJELinkInLocalDataAccruedExpenses, fetchRecommendedTransactionRowIndex, clearSelectedJELinkRowIndex, updateLinkBillExpenseLocalData, updateScheduleAccruedDetailsLocalData, updateSelectedJEAccruedScheduleKey, resetSelectedJEAccruedScheduleKey, resetAccruedDetailNewScheduleState, };
|
|
668
671
|
export { getJEScheduleTransactionKey, ALL_JE_SCHEDULE_IGNORE_REASONS, ALL_JE_SCHEDULE_REVERT_REASONS, ALL_ONE_TIME_ACCRUAL_IGNORE_REASONS, ALL_ONE_TIME_ACCRUAL_REVERT_REASONS, ALL_SCHEDULES_TYPES, getScheduleListReport, getAccruedScheduleListReport, fetchScheduleList, fetchAccruedScheduleList, fetchDownloadSchedules, fetchSchedulesAccount, updateScheduleListLocalData, getFetchStateForScheduleAccountList, toScheduleTypesType, toScheduleTypesTypeStrict, toScheduleListTabsFileTypeStrict, toScheduleSubTabType, updateScheduleListSubTab, updateScheduleListSearchText, updateScheduleListScrollState, updateScheduleListSortState, updateSelectedJEScheduleKey, fetchScheduleDetails, getScheduleDetailsView, getAccruedScheduleDetailsView, fetchScheduleDetailsPage, saveScheduleDetails, deleteScheduleDetail, createNewSchedules, updateScheduleDetailsLocalData, updateScheduleListDownloadState, updateAccruedJEScheduleAccruedByListKey, updatedSelectedJELinkRowIndex, getQBOUrlForLink, getThirdPartyIDFromQBOURL, updatedJELinkInLocalData, updateAmountsInScheduleDetail, resetJELinkInLocalData, updatedJELinkWithRecommendedLocalData, getFetchStateForScheduleListByType, getDefaultSelectedTimeframeForScheduleType, markAsCompleteScheduleDetail, resetMarkAsCompleteStatus, fetchVendorTabView, updateVendorTabViewTab, getVendorTabView, };
|
|
669
672
|
export { toVendorFirstReviewViewColumnKeyType, getGlobalMerchantAutoCompleteResults, getVendorFirstReviewView, getVendorFirstReviewAttachmentView, fetchVendorFirstReviewView, fetchVendorFirstReviewAttachments, updateVendorFirstReviewViewScrollYOffset, resetVendorFirstReviewLocalData, updateVendorFirstReviewViewPageToken, clearRecentlySavedErroredVendorData, saveVendorFirstReviewView, updateVendorFirstReviewViewLocalData, updateVendorFirstReviewSortUiState, fetchGlobalMerchantAutoCompleteView, clearGlobalMerchantAutoCompleteResults, updateReviewVendorDetailLocalData, saveVendorDetailsView, getVendorDetailSelectorView, };
|
|
@@ -867,4 +870,4 @@ export { getInvoicingOnboardingGateView } from './view/invoicing/invoicingConfig
|
|
|
867
870
|
// Accrued JE schedules are not a discriminated union member, so consumers need this guard to
|
|
868
871
|
// narrow a JEScheduleRow before reading baseTransaction / recurringAmount.
|
|
869
872
|
export { getExpenseAutomationJEOneTimeAccrualDetailView, getJEScheduleRowType, isAccruedScheduleRow, isAiAccountantSchedule, isExistingTabRow, isOneTimeAccrualRow, isRenderableOneTimeAccrual, isPendingReviewRow, } from './view/expenseAutomationView/selectors/jeSchedulesViewSelector';
|
|
870
|
-
export { getActualMatchingAmount, getActualMatchingReversalDate,
|
|
873
|
+
export { getActualMatchingAmount, getActualMatchingReversalDate, getCloseMatchAfterUndo, parseActualMatchingMatchId, getExpenseAutomationActualMatchingMatchView, getExpenseAutomationActualMatchingView, isAutoReversedAccrual, isManuallyReversedAccrual, isPendingReviewAccrual, } from './view/expenseAutomationView/selectors/actualMatchingViewSelector';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap, takeUntil } from 'rxjs/operators';
|
|
3
|
-
import {
|
|
3
|
+
import { updateActualMatchingMatches } from '../../../../../entity/actualMatching/actualMatchingReducer';
|
|
4
4
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
5
5
|
import { clearAll } from '../../../../../rootActions';
|
|
6
6
|
import { fetchActualMatchingMatch, fetchActualMatchingMatchFailure, fetchActualMatchingMatchSuccess, } from '../../../reducers/actualMatchingViewReducer';
|
|
@@ -32,7 +32,5 @@ export const fetchActualMatchingMatchEpic = (actions$, state$, zeniAPI) => actio
|
|
|
32
32
|
refreshViewInBackground,
|
|
33
33
|
status: createZeniAPIStatus('Unexpected Error', `Fetch actual matching match REST API call errored out ${JSON.stringify(error)}`),
|
|
34
34
|
}),
|
|
35
|
-
])), takeUntil(actions$.pipe(filter(
|
|
36
|
-
(removeActualMatchingMatch.match(action) &&
|
|
37
|
-
action.payload.matchId === matchId)))));
|
|
35
|
+
])), takeUntil(actions$.pipe(filter(clearAll.match))));
|
|
38
36
|
}));
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { from, of } from 'rxjs';
|
|
2
|
-
import { catchError, exhaustMap, filter,
|
|
2
|
+
import { catchError, exhaustMap, filter, mergeMap, takeUntil } from 'rxjs/operators';
|
|
3
3
|
import { getActualMatchingMatchById } from '../../../../../entity/actualMatching/actualMatchingSelector';
|
|
4
4
|
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
5
|
-
import { createZeniAPIStatus, isSuccessResponse
|
|
5
|
+
import { createZeniAPIStatus, isSuccessResponse } from '../../../../../responsePayload';
|
|
6
6
|
import { clearAll } from '../../../../../rootActions';
|
|
7
7
|
import { toMatchAndReverseResult, } from '../../../payload/actualMatchingPayload';
|
|
8
8
|
import { clearMatchNewModal, fetchActualMatchingMatch, matchAndReverseAccruals, matchAndReverseAccrualsFailure, matchAndReverseAccrualsSuccess, } from '../../../reducers/actualMatchingViewReducer';
|
|
9
9
|
import { isMatchAndReverseCompleteStatus, } from '../../../types/actualMatchingViewState';
|
|
10
10
|
import { refreshActualMatchingList } from './refreshActualMatchingList';
|
|
11
11
|
function isMatchFailedStatus(status) {
|
|
12
|
-
return status === 'conflict' || status === 'claim_lost' || status === 'error';
|
|
12
|
+
return (status === 'conflict' || status === 'claim_lost' || status === 'error');
|
|
13
13
|
}
|
|
14
14
|
function matchAndReverseSnackbar(results, vendorName) {
|
|
15
15
|
const reversedCount = results.filter((result) => result.status === 'reversed').length;
|
|
@@ -56,15 +56,12 @@ function matchAndReverseHttpFailSnackbar(vendorName) {
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
function matchVendorName(state, matchId) {
|
|
59
|
-
return
|
|
60
|
-
?.vendorName ?? '');
|
|
59
|
+
return getActualMatchingMatchById(state.actualMatchingState, matchId)?.vendorName ?? '';
|
|
61
60
|
}
|
|
62
61
|
export const matchAndReverseAccrualsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(matchAndReverseAccruals.match),
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
groupBy((action) => `${action.payload.transactionType.toLowerCase()}:${action.payload.transactionIntegrationId}`), mergeMap((perMatch$) => perMatch$.pipe(exhaustMap((action) => {
|
|
67
|
-
const { transactionId, transactionIntegrationId, transactionType, lineIds, accrualIds, transactionSyncToken, forMatchModal, } = action.payload;
|
|
62
|
+
// Posts reversing JEs; drop duplicate clicks while a request is in flight.
|
|
63
|
+
exhaustMap((action) => {
|
|
64
|
+
const { transactionId, transactionIntegrationId, transactionType, lineIds, accrualIds, transactionSyncToken, } = action.payload;
|
|
68
65
|
const body = {
|
|
69
66
|
transaction_id: transactionId,
|
|
70
67
|
transaction_integration_id: transactionIntegrationId,
|
|
@@ -83,39 +80,29 @@ groupBy((action) => `${action.payload.transactionType.toLowerCase()}:${action.pa
|
|
|
83
80
|
if (isSuccessResponse(response) && response.data != null) {
|
|
84
81
|
const results = response.data.results.map(toMatchAndReverseResult);
|
|
85
82
|
const successActions = [
|
|
86
|
-
matchAndReverseAccrualsSuccess({
|
|
87
|
-
matchId,
|
|
88
|
-
results,
|
|
89
|
-
...(forMatchModal === true ? { forMatchModal: true } : {}),
|
|
90
|
-
}),
|
|
83
|
+
matchAndReverseAccrualsSuccess({ matchId, results }),
|
|
91
84
|
];
|
|
92
85
|
const occupancyChanged = results.some((result) => isMatchAndReverseCompleteStatus(result.status));
|
|
93
86
|
const allComplete = results.length > 0 &&
|
|
94
87
|
results.every((result) => isMatchAndReverseCompleteStatus(result.status));
|
|
95
88
|
if (occupancyChanged) {
|
|
96
89
|
// List + detail: list can omit leftovers; detail GET always
|
|
97
|
-
// writes intended occupancy so
|
|
98
|
-
//
|
|
90
|
+
// writes intended occupancy so Continue match prefills the
|
|
91
|
+
// remaining leftover set instead of a stale cached row.
|
|
99
92
|
successActions.push(...refreshActualMatchingList(state$.value), fetchActualMatchingMatch(matchId, true));
|
|
100
93
|
}
|
|
101
94
|
const snackbar = matchAndReverseSnackbar(results, vendorName);
|
|
102
95
|
if (snackbar != null) {
|
|
103
96
|
successActions.push(snackbar);
|
|
104
97
|
}
|
|
105
|
-
if (allComplete
|
|
98
|
+
if (allComplete) {
|
|
106
99
|
successActions.push(clearMatchNewModal());
|
|
107
100
|
}
|
|
108
101
|
return from(successActions);
|
|
109
102
|
}
|
|
110
|
-
return of(matchAndReverseAccrualsFailure({
|
|
111
|
-
status: response.status,
|
|
112
|
-
matchId,
|
|
113
|
-
...(forMatchModal === true ? { forMatchModal: true } : {}),
|
|
114
|
-
}), matchAndReverseHttpFailSnackbar(vendorName));
|
|
103
|
+
return of(matchAndReverseAccrualsFailure({ status: response.status }), matchAndReverseHttpFailSnackbar(vendorName));
|
|
115
104
|
}), catchError((error) => of(matchAndReverseAccrualsFailure({
|
|
116
|
-
matchId,
|
|
117
|
-
...(forMatchModal === true ? { forMatchModal: true } : {}),
|
|
118
105
|
status: createZeniAPIStatus('Unexpected Error', 'Match and reverse accruals REST API call errored out' +
|
|
119
106
|
JSON.stringify(error)),
|
|
120
107
|
}), matchAndReverseHttpFailSnackbar(vendorName))), takeUntil(actions$.pipe(filter(clearAll.match))));
|
|
121
|
-
}))
|
|
108
|
+
}));
|
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
import { from, merge, of } from 'rxjs';
|
|
2
2
|
import { catchError, debounceTime, filter, mergeMap, switchMap, takeUntil, } from 'rxjs/operators';
|
|
3
|
+
import { getActualMatchingMatchById } from '../../../../../entity/actualMatching/actualMatchingSelector';
|
|
3
4
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
4
5
|
import { clearAll } from '../../../../../rootActions';
|
|
5
6
|
import { toActualMatchingTransactionSearchResult, } from '../../../payload/actualMatchingPayload';
|
|
6
7
|
import { openMatchNewModal, searchMatchAccruals, searchMatchTransactions, searchMatchTransactionsFailure, searchMatchTransactionsSuccess, } from '../../../reducers/actualMatchingViewReducer';
|
|
7
|
-
import { getTenantDisplayCurrency } from '../../../selectors/actualMatchingViewSelector';
|
|
8
|
+
import { getTenantDisplayCurrency, parseActualMatchingMatchId, } from '../../../selectors/actualMatchingViewSelector';
|
|
8
9
|
import { MATCH_SEARCH_DEBOUNCE_MS, MATCH_TRANSACTION_SEARCH_PAGE_SIZE, } from '../../../types/actualMatchingViewState';
|
|
9
10
|
export const searchMatchTransactionsEpic = (actions$, state$, zeniAPI) => {
|
|
10
|
-
const openModal$ = actions$.pipe(filter(openMatchNewModal.match), mergeMap(() =>
|
|
11
|
+
const openModal$ = actions$.pipe(filter(openMatchNewModal.match), mergeMap((action) => {
|
|
12
|
+
const matchId = action.payload.matchId;
|
|
13
|
+
if (matchId == null || matchId === '') {
|
|
14
|
+
return from([
|
|
15
|
+
searchMatchTransactions(''),
|
|
16
|
+
searchMatchAccruals(''),
|
|
17
|
+
]);
|
|
18
|
+
}
|
|
19
|
+
const match = getActualMatchingMatchById(state$.value.actualMatchingState, matchId);
|
|
20
|
+
const parsed = parseActualMatchingMatchId(matchId);
|
|
21
|
+
const transactionType = match?.transactionType != null && match.transactionType !== ''
|
|
22
|
+
? match.transactionType
|
|
23
|
+
: parsed?.transactionType;
|
|
24
|
+
const transactionIntegrationId = match?.transactionIntegrationId != null &&
|
|
25
|
+
match.transactionIntegrationId !== ''
|
|
26
|
+
? match.transactionIntegrationId
|
|
27
|
+
: parsed?.transactionIntegrationId;
|
|
28
|
+
return from([
|
|
29
|
+
searchMatchTransactions('', undefined, transactionType, transactionIntegrationId),
|
|
30
|
+
]);
|
|
31
|
+
}));
|
|
11
32
|
const searchActions$ = actions$.pipe(filter(searchMatchTransactions.match));
|
|
12
33
|
const pagination$ = searchActions$.pipe(filter((action) => action.payload.pageToken != null));
|
|
13
34
|
const newSearchDebounced$ = searchActions$.pipe(filter((action) => action.payload.pageToken == null), debounceTime(MATCH_SEARCH_DEBOUNCE_MS));
|
|
@@ -22,6 +22,9 @@ export const initialAccrualSearchState = {
|
|
|
22
22
|
};
|
|
23
23
|
export const initialMatchModalState = {
|
|
24
24
|
isOpen: false,
|
|
25
|
+
openedFromMatchId: undefined,
|
|
26
|
+
didPinPrefillTransactions: false,
|
|
27
|
+
pinnedTransactionResults: [],
|
|
25
28
|
transactionSearch: initialTransactionSearchState,
|
|
26
29
|
accrualSearch: initialAccrualSearchState,
|
|
27
30
|
confirmStatus: { fetchState: 'Not-Started', error: undefined },
|
|
@@ -41,28 +44,16 @@ export const initialState = {
|
|
|
41
44
|
sortOrder: 'descending',
|
|
42
45
|
searchString: '',
|
|
43
46
|
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
44
|
-
statusFilter: 'all',
|
|
45
47
|
},
|
|
46
48
|
matchModal: initialMatchModalState,
|
|
47
49
|
undoReversalStatusByMatchId: {},
|
|
48
|
-
|
|
49
|
-
confirmStatusByMatchId: {},
|
|
50
|
-
closeMatchAfterUndoMatchIds: [],
|
|
51
|
-
closeMatchAfterIgnoreMatchIds: [],
|
|
50
|
+
closeMatchAfterUndo: false,
|
|
52
51
|
lastMatchResultsByMatchId: {},
|
|
53
52
|
lastUndoResultsByMatchId: {},
|
|
54
53
|
hasValidState() {
|
|
55
54
|
return this.fetchState == 'Completed';
|
|
56
55
|
},
|
|
57
56
|
};
|
|
58
|
-
function enqueueCloseMatchId(ids, matchId) {
|
|
59
|
-
if (!ids.includes(matchId)) {
|
|
60
|
-
ids.push(matchId);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
function dropCloseMatchId(ids, matchId) {
|
|
64
|
-
return ids.filter((id) => id !== matchId);
|
|
65
|
-
}
|
|
66
57
|
function pruneLastMatchResultsForUndone(draft, matchId, results) {
|
|
67
58
|
const undoneIds = new Set(results
|
|
68
59
|
.filter((result) => result.status === 'undone')
|
|
@@ -105,6 +96,9 @@ function resetMatchModalSearches(draft) {
|
|
|
105
96
|
error: undefined,
|
|
106
97
|
};
|
|
107
98
|
draft.matchModal.lastBatchResults = undefined;
|
|
99
|
+
draft.matchModal.openedFromMatchId = undefined;
|
|
100
|
+
draft.matchModal.didPinPrefillTransactions = false;
|
|
101
|
+
draft.matchModal.pinnedTransactionResults = [];
|
|
108
102
|
}
|
|
109
103
|
const expenseAutomationActualMatchingView = createSlice({
|
|
110
104
|
name: 'expenseAutomationActualMatchingView',
|
|
@@ -245,13 +239,21 @@ const expenseAutomationActualMatchingView = createSlice({
|
|
|
245
239
|
if (action.payload.scrollPosition != null) {
|
|
246
240
|
draft.uiState.scrollPosition = action.payload.scrollPosition;
|
|
247
241
|
}
|
|
248
|
-
if (action.payload.statusFilter != null) {
|
|
249
|
-
draft.uiState.statusFilter = action.payload.statusFilter;
|
|
250
|
-
}
|
|
251
242
|
},
|
|
252
|
-
openMatchNewModal
|
|
253
|
-
|
|
254
|
-
|
|
243
|
+
openMatchNewModal: {
|
|
244
|
+
prepare(matchId) {
|
|
245
|
+
return { payload: { matchId } };
|
|
246
|
+
},
|
|
247
|
+
reducer(draft, action) {
|
|
248
|
+
resetMatchModalSearches(draft);
|
|
249
|
+
draft.matchModal.isOpen = true;
|
|
250
|
+
const matchId = action.payload.matchId;
|
|
251
|
+
draft.matchModal.openedFromMatchId =
|
|
252
|
+
matchId != null && matchId !== '' ? matchId : undefined;
|
|
253
|
+
if (draft.matchModal.openedFromMatchId != null) {
|
|
254
|
+
draft.matchModal.accrualSearch.fetchState = 'Completed';
|
|
255
|
+
}
|
|
256
|
+
},
|
|
255
257
|
},
|
|
256
258
|
// Dismiss (Cancel / overlay). Store reset matches `clearMatchNewModal`;
|
|
257
259
|
// the actions stay distinct so confirm-success vs user-dismiss stay observable.
|
|
@@ -306,6 +308,11 @@ const expenseAutomationActualMatchingView = createSlice({
|
|
|
306
308
|
}
|
|
307
309
|
else {
|
|
308
310
|
draft.matchModal.transactionSearch.results = results;
|
|
311
|
+
if (draft.matchModal.openedFromMatchId != null &&
|
|
312
|
+
!draft.matchModal.didPinPrefillTransactions) {
|
|
313
|
+
draft.matchModal.didPinPrefillTransactions = true;
|
|
314
|
+
draft.matchModal.pinnedTransactionResults = results;
|
|
315
|
+
}
|
|
309
316
|
}
|
|
310
317
|
draft.matchModal.transactionSearch.nextPageToken = nextPageToken;
|
|
311
318
|
draft.matchModal.transactionSearch.isLoadingMore = false;
|
|
@@ -358,27 +365,21 @@ const expenseAutomationActualMatchingView = createSlice({
|
|
|
358
365
|
draft.matchModal.accrualSearch.error = action.payload.error;
|
|
359
366
|
},
|
|
360
367
|
matchAndReverseAccruals: {
|
|
361
|
-
reducer(draft
|
|
362
|
-
|
|
368
|
+
reducer(draft) {
|
|
369
|
+
draft.matchModal.confirmStatus = {
|
|
363
370
|
fetchState: 'In-Progress',
|
|
364
371
|
error: undefined,
|
|
365
372
|
};
|
|
366
|
-
if (action.payload.forMatchModal === true) {
|
|
367
|
-
draft.matchModal.confirmStatus = inProgress;
|
|
368
|
-
}
|
|
369
|
-
const matchId = `${action.payload.transactionType.toLowerCase()}:${action.payload.transactionIntegrationId}`;
|
|
370
|
-
draft.confirmStatusByMatchId[matchId] = inProgress;
|
|
371
373
|
},
|
|
372
|
-
prepare(transactionId, transactionIntegrationId, transactionType, lineIds, transactionSyncToken, accrualIds
|
|
374
|
+
prepare(transactionId, transactionIntegrationId, transactionType, lineIds, transactionSyncToken, accrualIds) {
|
|
373
375
|
return {
|
|
374
376
|
payload: {
|
|
375
|
-
accrualIds,
|
|
376
|
-
lineIds,
|
|
377
377
|
transactionId,
|
|
378
378
|
transactionIntegrationId,
|
|
379
|
-
transactionSyncToken,
|
|
380
379
|
transactionType,
|
|
381
|
-
|
|
380
|
+
lineIds,
|
|
381
|
+
transactionSyncToken,
|
|
382
|
+
accrualIds,
|
|
382
383
|
},
|
|
383
384
|
};
|
|
384
385
|
},
|
|
@@ -387,33 +388,23 @@ const expenseAutomationActualMatchingView = createSlice({
|
|
|
387
388
|
const { results } = action.payload;
|
|
388
389
|
const allComplete = results.length > 0 &&
|
|
389
390
|
results.every((result) => isMatchAndReverseCompleteStatus(result.status));
|
|
390
|
-
|
|
391
|
+
draft.matchModal.confirmStatus = allComplete
|
|
391
392
|
? { fetchState: 'Completed', error: undefined }
|
|
392
393
|
: {
|
|
393
394
|
fetchState: 'Error',
|
|
394
395
|
error: createZeniAPIStatus('Partial match-and-reverse', 'Some accruals were not reversed'),
|
|
395
396
|
};
|
|
396
|
-
|
|
397
|
-
draft.matchModal.confirmStatus = confirmStatus;
|
|
398
|
-
draft.matchModal.lastBatchResults = results;
|
|
399
|
-
}
|
|
397
|
+
draft.matchModal.lastBatchResults = results;
|
|
400
398
|
if (action.payload.matchId != null) {
|
|
401
|
-
draft.confirmStatusByMatchId[action.payload.matchId] = confirmStatus;
|
|
402
399
|
draft.lastMatchResultsByMatchId[action.payload.matchId] = results;
|
|
403
400
|
pruneLastUndoResultsForMatched(draft, action.payload.matchId, action.payload.results);
|
|
404
401
|
}
|
|
405
402
|
},
|
|
406
403
|
matchAndReverseAccrualsFailure(draft, action) {
|
|
407
|
-
|
|
404
|
+
draft.matchModal.confirmStatus = {
|
|
408
405
|
fetchState: 'Error',
|
|
409
406
|
error: action.payload.status,
|
|
410
407
|
};
|
|
411
|
-
if (action.payload.forMatchModal === true) {
|
|
412
|
-
draft.matchModal.confirmStatus = failed;
|
|
413
|
-
}
|
|
414
|
-
if (action.payload.matchId != null) {
|
|
415
|
-
draft.confirmStatusByMatchId[action.payload.matchId] = failed;
|
|
416
|
-
}
|
|
417
408
|
},
|
|
418
409
|
undoReversalAccruals: {
|
|
419
410
|
reducer(draft, action) {
|
|
@@ -435,12 +426,7 @@ const expenseAutomationActualMatchingView = createSlice({
|
|
|
435
426
|
};
|
|
436
427
|
const allUndone = results.length > 0 &&
|
|
437
428
|
results.every((result) => result.status === 'undone');
|
|
438
|
-
|
|
439
|
-
enqueueCloseMatchId(draft.closeMatchAfterUndoMatchIds, matchId);
|
|
440
|
-
}
|
|
441
|
-
else {
|
|
442
|
-
draft.closeMatchAfterUndoMatchIds = dropCloseMatchId(draft.closeMatchAfterUndoMatchIds, matchId);
|
|
443
|
-
}
|
|
429
|
+
draft.closeMatchAfterUndo = allUndone;
|
|
444
430
|
pruneLastMatchResultsForUndone(draft, matchId, results);
|
|
445
431
|
if (allUndone) {
|
|
446
432
|
delete draft.lastUndoResultsByMatchId[matchId];
|
|
@@ -454,44 +440,7 @@ const expenseAutomationActualMatchingView = createSlice({
|
|
|
454
440
|
},
|
|
455
441
|
},
|
|
456
442
|
ackCloseMatchAfterUndo(draft) {
|
|
457
|
-
draft.
|
|
458
|
-
},
|
|
459
|
-
ignoreActualMatchingSuggestion: {
|
|
460
|
-
prepare(matchId, reason, note) {
|
|
461
|
-
return { payload: { matchId, reason, note } };
|
|
462
|
-
},
|
|
463
|
-
reducer(draft, action) {
|
|
464
|
-
draft.ignoreStatusByMatchId[action.payload.matchId] = {
|
|
465
|
-
fetchState: 'In-Progress',
|
|
466
|
-
error: undefined,
|
|
467
|
-
};
|
|
468
|
-
},
|
|
469
|
-
},
|
|
470
|
-
ignoreActualMatchingSuggestionSuccess(draft, action) {
|
|
471
|
-
const { matchId } = action.payload;
|
|
472
|
-
draft.ignoreStatusByMatchId[matchId] = {
|
|
473
|
-
fetchState: 'Completed',
|
|
474
|
-
error: undefined,
|
|
475
|
-
};
|
|
476
|
-
enqueueCloseMatchId(draft.closeMatchAfterIgnoreMatchIds, matchId);
|
|
477
|
-
delete draft.lastMatchResultsByMatchId[matchId];
|
|
478
|
-
delete draft.lastUndoResultsByMatchId[matchId];
|
|
479
|
-
delete draft.detailFetchStateByMatchId[matchId];
|
|
480
|
-
delete draft.detailRefreshStatusByMatchId[matchId];
|
|
481
|
-
delete draft.undoReversalStatusByMatchId[matchId];
|
|
482
|
-
delete draft.confirmStatusByMatchId[matchId];
|
|
483
|
-
Object.keys(draft.matchIdsByPeriod).forEach((periodId) => {
|
|
484
|
-
draft.matchIdsByPeriod[periodId] = draft.matchIdsByPeriod[periodId].filter((id) => id !== matchId);
|
|
485
|
-
});
|
|
486
|
-
},
|
|
487
|
-
ignoreActualMatchingSuggestionFailure(draft, action) {
|
|
488
|
-
draft.ignoreStatusByMatchId[action.payload.matchId] = {
|
|
489
|
-
fetchState: 'Error',
|
|
490
|
-
error: action.payload.status,
|
|
491
|
-
};
|
|
492
|
-
},
|
|
493
|
-
ackCloseMatchAfterIgnore(draft) {
|
|
494
|
-
draft.closeMatchAfterIgnoreMatchIds.shift();
|
|
443
|
+
draft.closeMatchAfterUndo = false;
|
|
495
444
|
},
|
|
496
445
|
undoReversalAccrualsFailure(draft, action) {
|
|
497
446
|
draft.undoReversalStatusByMatchId[action.payload.matchId] = {
|
|
@@ -509,5 +458,5 @@ const expenseAutomationActualMatchingView = createSlice({
|
|
|
509
458
|
});
|
|
510
459
|
},
|
|
511
460
|
});
|
|
512
|
-
export const {
|
|
461
|
+
export const { ackCloseMatchAfterUndo, clearActualMatchingView, clearMatchNewModal, closeMatchNewModal, fetchActualMatching, fetchActualMatchingFailure, fetchActualMatchingMatch, fetchActualMatchingMatchFailure, fetchActualMatchingMatchSuccess, fetchActualMatchingPage, fetchActualMatchingSuccess, matchAndReverseAccruals, matchAndReverseAccrualsFailure, matchAndReverseAccrualsSuccess, openMatchNewModal, searchMatchAccruals, searchMatchAccrualsFailure, searchMatchAccrualsSuccess, searchMatchTransactions, searchMatchTransactionsFailure, searchMatchTransactionsSuccess, undoReversalAccruals, undoReversalAccrualsFailure, undoReversalAccrualsSuccess, updateActualMatchingUIState, } = expenseAutomationActualMatchingView.actions;
|
|
513
462
|
export default expenseAutomationActualMatchingView.reducer;
|