@zeniai/client-epic-state 4.19.96-betaJK21 → 4.19.96-betaJK4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/entity/accountRecon/accountReconState.d.ts +1 -1
- package/lib/entity/accountRecon/accountReconState.js +0 -1
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -2
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +35 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +44 -0
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +2 -1
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +2 -1
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +13 -0
- 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/transactionPayload.d.ts +3 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +11 -0
- package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -0
- package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
- package/lib/epic.d.ts +3 -1
- package/lib/epic.js +3 -1
- package/lib/esm/entity/accountRecon/accountReconState.js +0 -1
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +44 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +2 -1
- package/lib/esm/entity/tenant/tenantReducer.js +1 -0
- package/lib/esm/entity/tenant/tenantSelector.js +7 -0
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +11 -0
- package/lib/esm/epic.js +3 -1
- package/lib/esm/index.js +9 -7
- 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 +15 -5
- package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconExcludedAccountsEpic.js +27 -0
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +0 -2
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.js +0 -1
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +2 -29
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.js +1 -2
- 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/payload/reconciliationPayload.js +18 -0
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +17 -1
- package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +39 -1
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +50 -3
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +1 -1
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +152 -0
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +17 -1
- 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/taskDetailSelector.js +2 -2
- package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
- package/lib/index.d.ts +14 -10
- package/lib/index.js +44 -32
- 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 +18 -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 +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 +15 -5
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconExcludedAccountsEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconExcludedAccountsEpic.js +31 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +0 -2
- package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.js +0 -1
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +2 -29
- package/lib/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.js +1 -2
- package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +23 -1
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.js +20 -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 +9 -2
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +40 -2
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +1 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +50 -3
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +1 -1
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +152 -0
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +5 -0
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +19 -0
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +20 -4
- 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/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/taskDetailSelector.js +2 -2
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { FetchState, ID } from '../../../commonStateTypes/common';
|
|
|
3
3
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
4
4
|
import { MonthYearPeriod } from '../../../commonStateTypes/timePeriod';
|
|
5
5
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
6
|
-
import { ReconciliationPayload, UploadStatementDocumentAIPayload } from '../payload/reconciliationPayload';
|
|
6
|
+
import { ExcludedAccountPayload, ReconciliationPayload, UploadStatementDocumentAIPayload } from '../payload/reconciliationPayload';
|
|
7
7
|
import { AccountReconciliationLocalData, ActionFetchStates, ReconReconcileSortKey, ReconReviewSortKey, ReconciliationReviewTabLocalData, ReconciliationTabsState, ReconciliationViewState, ReconciliationViewTabType, SaveReconcileDetailActionPayload, SaveReconciliationDetailFailurePayload, TransactionSummary } from '../types/reconciliationViewState';
|
|
8
8
|
export declare const initialReconciliationTabsState: ReconciliationTabsState;
|
|
9
9
|
export declare const initialActionFetchState: ActionFetchStates;
|
|
@@ -99,6 +99,13 @@ export declare const fetchReconciliation: import("@reduxjs/toolkit").ActionCreat
|
|
|
99
99
|
selectedPeriod: MonthYearPeriod;
|
|
100
100
|
}, "expenseAutomationReconciliationView/uploadAccountStatementFailure">, updateStatementUploadChosen: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
101
101
|
statementUploadChosen: boolean;
|
|
102
|
-
}, "expenseAutomationReconciliationView/updateStatementUploadChosen"
|
|
102
|
+
}, "expenseAutomationReconciliationView/updateStatementUploadChosen">, fetchReconExcludedAccounts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountId: string, exclusionReason: string], {
|
|
103
|
+
accountId: string;
|
|
104
|
+
exclusionReason: string;
|
|
105
|
+
}, "expenseAutomationReconciliationView/fetchReconExcludedAccounts", never, never>, fetchReconExcludedAccountsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
106
|
+
excludedAccounts: ExcludedAccountPayload[];
|
|
107
|
+
}, "expenseAutomationReconciliationView/fetchReconExcludedAccountsSuccess">, fetchReconExcludedAccountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
108
|
+
error: ZeniAPIStatus;
|
|
109
|
+
}, "expenseAutomationReconciliationView/fetchReconExcludedAccountsFailure">;
|
|
103
110
|
declare const _default: import("redux").Reducer<ReconciliationViewState>;
|
|
104
111
|
export default _default;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.updateStatementUploadChosen = exports.uploadAccountStatementFailure = exports.uploadAccountStatementSuccess = exports.uploadAccountStatement = exports.deleteAccountStatementFailure = exports.deleteAccountStatementSuccess = exports.deleteAccountStatement = exports.updateAccountReconciliationLocalData = exports.updateReconListScrollPosition = exports.updateSaveReconciliationReviewFetchStatus = exports.saveReconciliationReview = exports.updateReviewTabLocalData = exports.initializeReconciliationReviewTabLocalData = exports.updateReviewTabSortState = exports.updateSelectedDrawerAccountId = exports.clearExpenseAutomationReconciliationView = exports.initialiseLocalDataForSelectedAccountId = exports.updateBalancesLocalData = exports.updateSelectedTab = exports.saveReconciliationDetailSuccess = exports.updateReconcileTabListScrollState = exports.updateReconcileTabListSortState = exports.updateReconcileTabLocalData = exports.setStatementParseInProgress = exports.setConnectionInProgressForAccount = exports.updateSelectedAccountId = exports.saveReconciliationDetailFailure = exports.saveReconciliationDetail = exports.fetchReconciliationSuccess = exports.fetchReconciliationFailure = exports.fetchReconciliation = exports.initialState = exports.initialActionFetchState = exports.initialReconciliationTabsState = void 0;
|
|
4
|
+
exports.fetchReconExcludedAccountsFailure = exports.fetchReconExcludedAccountsSuccess = exports.fetchReconExcludedAccounts = exports.updateStatementUploadChosen = exports.uploadAccountStatementFailure = exports.uploadAccountStatementSuccess = exports.uploadAccountStatement = exports.deleteAccountStatementFailure = exports.deleteAccountStatementSuccess = exports.deleteAccountStatement = exports.updateAccountReconciliationLocalData = exports.updateReconListScrollPosition = exports.updateSaveReconciliationReviewFetchStatus = exports.saveReconciliationReview = exports.updateReviewTabLocalData = exports.initializeReconciliationReviewTabLocalData = exports.updateReviewTabSortState = exports.updateSelectedDrawerAccountId = exports.clearExpenseAutomationReconciliationView = exports.initialiseLocalDataForSelectedAccountId = exports.updateBalancesLocalData = exports.updateSelectedTab = exports.saveReconciliationDetailSuccess = exports.updateReconcileTabListScrollState = exports.updateReconcileTabListSortState = exports.updateReconcileTabLocalData = exports.setStatementParseInProgress = exports.setConnectionInProgressForAccount = exports.updateSelectedAccountId = exports.saveReconciliationDetailFailure = exports.saveReconciliationDetail = exports.fetchReconciliationSuccess = exports.fetchReconciliationFailure = exports.fetchReconciliation = exports.initialState = exports.initialActionFetchState = exports.initialReconciliationTabsState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
7
7
|
const accountState_1 = require("../../../entity/account/accountState");
|
|
8
8
|
const accountReconState_1 = require("../../../entity/accountRecon/accountReconState");
|
|
9
|
+
const reconciliationPayload_1 = require("../payload/reconciliationPayload");
|
|
9
10
|
// Initial state
|
|
10
11
|
exports.initialReconciliationTabsState = {
|
|
11
12
|
balances: {
|
|
@@ -55,6 +56,8 @@ exports.initialActionFetchState = {
|
|
|
55
56
|
exports.initialState = {
|
|
56
57
|
accountReconciliationRecordsBySelectedPeriod: {},
|
|
57
58
|
accountConnectionStatusByAccountID: {},
|
|
59
|
+
excludedAccounts: [],
|
|
60
|
+
excludedAccountsFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
58
61
|
fetchState: 'Not-Started',
|
|
59
62
|
error: undefined,
|
|
60
63
|
selectedTab: 'review',
|
|
@@ -428,13 +431,48 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
428
431
|
updateStatementUploadChosen: (draft, action) => {
|
|
429
432
|
draft.statementUploadChosen = action.payload.statementUploadChosen;
|
|
430
433
|
},
|
|
434
|
+
fetchReconExcludedAccounts: {
|
|
435
|
+
reducer(draft) {
|
|
436
|
+
draft.excludedAccountsFetchState = {
|
|
437
|
+
fetchState: 'In-Progress',
|
|
438
|
+
error: undefined,
|
|
439
|
+
};
|
|
440
|
+
},
|
|
441
|
+
prepare(accountId, exclusionReason) {
|
|
442
|
+
return {
|
|
443
|
+
payload: { accountId, exclusionReason },
|
|
444
|
+
};
|
|
445
|
+
},
|
|
446
|
+
},
|
|
447
|
+
fetchReconExcludedAccountsSuccess: (draft, action) => {
|
|
448
|
+
draft.excludedAccountsFetchState = {
|
|
449
|
+
fetchState: 'Completed',
|
|
450
|
+
error: undefined,
|
|
451
|
+
};
|
|
452
|
+
action.payload.excludedAccounts.forEach((excludedAccount) => {
|
|
453
|
+
const existingIndex = draft.excludedAccounts.findIndex((account) => account.excludedAccountId === excludedAccount.excluded_account_id);
|
|
454
|
+
if (existingIndex >= 0) {
|
|
455
|
+
draft.excludedAccounts[existingIndex] =
|
|
456
|
+
(0, reconciliationPayload_1.toExcludedAccount)(excludedAccount);
|
|
457
|
+
}
|
|
458
|
+
else {
|
|
459
|
+
draft.excludedAccounts.push((0, reconciliationPayload_1.toExcludedAccount)(excludedAccount));
|
|
460
|
+
}
|
|
461
|
+
});
|
|
462
|
+
},
|
|
463
|
+
fetchReconExcludedAccountsFailure: (draft, action) => {
|
|
464
|
+
draft.excludedAccountsFetchState = {
|
|
465
|
+
fetchState: 'Error',
|
|
466
|
+
error: action.payload.error,
|
|
467
|
+
};
|
|
468
|
+
},
|
|
431
469
|
clearExpenseAutomationReconciliationView: (draft) => {
|
|
432
470
|
Object.assign(draft, exports.initialState);
|
|
433
471
|
},
|
|
434
472
|
},
|
|
435
473
|
});
|
|
436
474
|
// Export actions
|
|
437
|
-
_a = expenseAutomationReconciliationView.actions, exports.fetchReconciliation = _a.fetchReconciliation, exports.fetchReconciliationFailure = _a.fetchReconciliationFailure, exports.fetchReconciliationSuccess = _a.fetchReconciliationSuccess, exports.saveReconciliationDetail = _a.saveReconciliationDetail, exports.saveReconciliationDetailFailure = _a.saveReconciliationDetailFailure, exports.updateSelectedAccountId = _a.updateSelectedAccountId, exports.setConnectionInProgressForAccount = _a.setConnectionInProgressForAccount, exports.setStatementParseInProgress = _a.setStatementParseInProgress, exports.updateReconcileTabLocalData = _a.updateReconcileTabLocalData, exports.updateReconcileTabListSortState = _a.updateReconcileTabListSortState, exports.updateReconcileTabListScrollState = _a.updateReconcileTabListScrollState, exports.saveReconciliationDetailSuccess = _a.saveReconciliationDetailSuccess, exports.updateSelectedTab = _a.updateSelectedTab, exports.updateBalancesLocalData = _a.updateBalancesLocalData, exports.initialiseLocalDataForSelectedAccountId = _a.initialiseLocalDataForSelectedAccountId, exports.clearExpenseAutomationReconciliationView = _a.clearExpenseAutomationReconciliationView, exports.updateSelectedDrawerAccountId = _a.updateSelectedDrawerAccountId, exports.updateReviewTabSortState = _a.updateReviewTabSortState, exports.initializeReconciliationReviewTabLocalData = _a.initializeReconciliationReviewTabLocalData, exports.updateReviewTabLocalData = _a.updateReviewTabLocalData, exports.saveReconciliationReview = _a.saveReconciliationReview, exports.updateSaveReconciliationReviewFetchStatus = _a.updateSaveReconciliationReviewFetchStatus, exports.updateReconListScrollPosition = _a.updateReconListScrollPosition, exports.updateAccountReconciliationLocalData = _a.updateAccountReconciliationLocalData, exports.deleteAccountStatement = _a.deleteAccountStatement, exports.deleteAccountStatementSuccess = _a.deleteAccountStatementSuccess, exports.deleteAccountStatementFailure = _a.deleteAccountStatementFailure, exports.uploadAccountStatement = _a.uploadAccountStatement, exports.uploadAccountStatementSuccess = _a.uploadAccountStatementSuccess, exports.uploadAccountStatementFailure = _a.uploadAccountStatementFailure, exports.updateStatementUploadChosen = _a.updateStatementUploadChosen;
|
|
475
|
+
_a = expenseAutomationReconciliationView.actions, exports.fetchReconciliation = _a.fetchReconciliation, exports.fetchReconciliationFailure = _a.fetchReconciliationFailure, exports.fetchReconciliationSuccess = _a.fetchReconciliationSuccess, exports.saveReconciliationDetail = _a.saveReconciliationDetail, exports.saveReconciliationDetailFailure = _a.saveReconciliationDetailFailure, exports.updateSelectedAccountId = _a.updateSelectedAccountId, exports.setConnectionInProgressForAccount = _a.setConnectionInProgressForAccount, exports.setStatementParseInProgress = _a.setStatementParseInProgress, exports.updateReconcileTabLocalData = _a.updateReconcileTabLocalData, exports.updateReconcileTabListSortState = _a.updateReconcileTabListSortState, exports.updateReconcileTabListScrollState = _a.updateReconcileTabListScrollState, exports.saveReconciliationDetailSuccess = _a.saveReconciliationDetailSuccess, exports.updateSelectedTab = _a.updateSelectedTab, exports.updateBalancesLocalData = _a.updateBalancesLocalData, exports.initialiseLocalDataForSelectedAccountId = _a.initialiseLocalDataForSelectedAccountId, exports.clearExpenseAutomationReconciliationView = _a.clearExpenseAutomationReconciliationView, exports.updateSelectedDrawerAccountId = _a.updateSelectedDrawerAccountId, exports.updateReviewTabSortState = _a.updateReviewTabSortState, exports.initializeReconciliationReviewTabLocalData = _a.initializeReconciliationReviewTabLocalData, exports.updateReviewTabLocalData = _a.updateReviewTabLocalData, exports.saveReconciliationReview = _a.saveReconciliationReview, exports.updateSaveReconciliationReviewFetchStatus = _a.updateSaveReconciliationReviewFetchStatus, exports.updateReconListScrollPosition = _a.updateReconListScrollPosition, exports.updateAccountReconciliationLocalData = _a.updateAccountReconciliationLocalData, exports.deleteAccountStatement = _a.deleteAccountStatement, exports.deleteAccountStatementSuccess = _a.deleteAccountStatementSuccess, exports.deleteAccountStatementFailure = _a.deleteAccountStatementFailure, exports.uploadAccountStatement = _a.uploadAccountStatement, exports.uploadAccountStatementSuccess = _a.uploadAccountStatementSuccess, exports.uploadAccountStatementFailure = _a.uploadAccountStatementFailure, exports.updateStatementUploadChosen = _a.updateStatementUploadChosen, exports.fetchReconExcludedAccounts = _a.fetchReconExcludedAccounts, exports.fetchReconExcludedAccountsSuccess = _a.fetchReconExcludedAccountsSuccess, exports.fetchReconExcludedAccountsFailure = _a.fetchReconExcludedAccountsFailure;
|
|
438
476
|
// Export reducer
|
|
439
477
|
exports.default = expenseAutomationReconciliationView.reducer;
|
|
440
478
|
function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliationData, refreshViewInBackground) {
|
|
@@ -18,10 +18,12 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
|
18
18
|
allDepreciationAccountList: AccountBase[];
|
|
19
19
|
allDepreciationAccountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
20
20
|
classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
|
|
21
|
+
completedSchedules: JEScheduledTransaction[];
|
|
21
22
|
completionStatus: CompletionStatusType;
|
|
22
23
|
draftSchedules: JEScheduledTransaction[];
|
|
23
24
|
ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
|
|
24
25
|
jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
|
|
26
|
+
ongoingSchedules: JEScheduledTransaction[];
|
|
25
27
|
postStatusById: Record<ID, FetchStateAndError>;
|
|
26
28
|
refreshStatus: FetchStateAndError;
|
|
27
29
|
resolveSchedules: JEScheduledTransactionWithFailedEntries[];
|
|
@@ -24,6 +24,7 @@ export interface ExpenseAutomationReconciliationViewSelector {
|
|
|
24
24
|
classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
|
|
25
25
|
completionStatus: CompletionStatusType;
|
|
26
26
|
creditCards: AccountBase[];
|
|
27
|
+
excludedAccountReconciliationBySectionID: Record<AccountReconSectionID, AccountReconciliationBySection>;
|
|
27
28
|
fetchStatus: FetchStateAndError;
|
|
28
29
|
monthYearPeriod: MonthYearPeriod;
|
|
29
30
|
plaidConnectionDetails: PlaidConnectionDetails;
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getExpenseAutomationJESchedulesView = getExpenseAutomationJESchedulesView;
|
|
7
7
|
const omit_1 = __importDefault(require("lodash/omit"));
|
|
8
|
+
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
8
9
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
9
10
|
const accountSelector_1 = require("../../../entity/account/accountSelector");
|
|
10
11
|
const jeSchedulesSelector_1 = require("../../../entity/jeSchedules/jeSchedulesSelector");
|
|
@@ -16,6 +17,42 @@ const scheduleDetailSelector_1 = require("../../scheduleView/scheduleDetailView/
|
|
|
16
17
|
const scheduleListHelper_1 = require("../../scheduleView/scheduleListView/scheduleListHelper");
|
|
17
18
|
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
18
19
|
const jeAccountSettingsViewSelector_1 = require("./jeAccountSettingsViewSelector");
|
|
20
|
+
function getJEScheduleSortAccessor(sortKey) {
|
|
21
|
+
switch (sortKey) {
|
|
22
|
+
case 'vendor':
|
|
23
|
+
return (s) => s.vendor.name?.toLowerCase();
|
|
24
|
+
case 'category':
|
|
25
|
+
return (s) => s.jeDebit.account?.accountName?.toLowerCase();
|
|
26
|
+
case 'class':
|
|
27
|
+
return (s) => s.jeDebit.accountingClass?.className?.toLowerCase();
|
|
28
|
+
case 'scheduleCategory':
|
|
29
|
+
return (s) => s.jeScheduleType;
|
|
30
|
+
case 'startMonth':
|
|
31
|
+
return (s) => s.startDate?.valueOf();
|
|
32
|
+
case 'type':
|
|
33
|
+
return (s) => s.baseTransaction.typeOfTransaction;
|
|
34
|
+
case 'amortizationPeriod':
|
|
35
|
+
return (s) => s.period;
|
|
36
|
+
case 'jePostingDate':
|
|
37
|
+
return (s) => s.dayOfPostingDate;
|
|
38
|
+
case 'remainingMonths':
|
|
39
|
+
return (s) => s.period;
|
|
40
|
+
case 'runningBalance':
|
|
41
|
+
return (s) => s.balanceAsOfToday?.amount;
|
|
42
|
+
case 'totalAmount':
|
|
43
|
+
return (s) => s.baseTransaction.amount.amount;
|
|
44
|
+
case 'transactionDate':
|
|
45
|
+
return (s) => s.baseTransaction.date.valueOf();
|
|
46
|
+
case 'memo':
|
|
47
|
+
return (s) => s.baseTransaction.memo?.toLowerCase();
|
|
48
|
+
default:
|
|
49
|
+
return (s) => s.startDate?.valueOf();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function sortJEScheduledTransactions(transactions, sortKey, sortOrder) {
|
|
53
|
+
const accessor = getJEScheduleSortAccessor(sortKey);
|
|
54
|
+
return (0, orderBy_1.default)(transactions, [accessor], [sortOrder === 'ascending' ? 'asc' : 'desc']);
|
|
55
|
+
}
|
|
19
56
|
function getExpenseAutomationJESchedulesView(state) {
|
|
20
57
|
const jeScheduledTransaction = [];
|
|
21
58
|
const failedJeScheduledTransaction = [];
|
|
@@ -65,13 +102,21 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
65
102
|
const jeScheduleDetails = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleKey, state);
|
|
66
103
|
failedJeScheduledTransaction.push(jeScheduleDetails);
|
|
67
104
|
});
|
|
68
|
-
const
|
|
69
|
-
const
|
|
105
|
+
const { sortKey, sortOrder } = uiState;
|
|
106
|
+
const draftSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft'), sortKey, sortOrder);
|
|
107
|
+
const ongoingSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'ongoing'), sortKey, sortOrder);
|
|
108
|
+
const completedSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'completed' ||
|
|
109
|
+
schedule.status.code === 'marked_as_completed'), sortKey, sortOrder);
|
|
110
|
+
const unsortedResolveSchedules = [];
|
|
70
111
|
failedJeScheduledTransaction.forEach((schedule) => {
|
|
71
112
|
schedule.scheduledJournalEntry.forEach((journalEntry) => {
|
|
72
|
-
|
|
113
|
+
unsortedResolveSchedules.push({
|
|
114
|
+
...schedule,
|
|
115
|
+
scheduledJournalEntry: journalEntry,
|
|
116
|
+
});
|
|
73
117
|
});
|
|
74
118
|
});
|
|
119
|
+
const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
|
|
75
120
|
const allSteps = monthYearPeriodId != null
|
|
76
121
|
? (0, expenseAutomationViewSelectorTypes_1.getAllSteps)(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
|
|
77
122
|
: [];
|
|
@@ -85,7 +130,9 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
85
130
|
allAccountList: filteredAccounts,
|
|
86
131
|
accountListNestedAccountHierarchy,
|
|
87
132
|
allClassList: allClasses,
|
|
133
|
+
completedSchedules,
|
|
88
134
|
draftSchedules,
|
|
135
|
+
ongoingSchedules,
|
|
89
136
|
resolveSchedules: resolveSchedules,
|
|
90
137
|
accountSettingsView,
|
|
91
138
|
postStatusById: postStatusById,
|
|
@@ -42,7 +42,7 @@ function getExpenseAutomationMissingReceiptsView(state) {
|
|
|
42
42
|
transaction.lines.length > 0 &&
|
|
43
43
|
transaction.lines[0]
|
|
44
44
|
?.class != null
|
|
45
|
-
? transaction.lines[0].class
|
|
45
|
+
? transaction.lines[0].class?.className.toLowerCase()
|
|
46
46
|
: null;
|
|
47
47
|
case 'vendor':
|
|
48
48
|
default:
|
|
@@ -86,6 +86,26 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
|
|
|
86
86
|
totalVariancePercentage: undefined,
|
|
87
87
|
},
|
|
88
88
|
},
|
|
89
|
+
excludedAccountReconciliationBySectionID: {
|
|
90
|
+
assets: {
|
|
91
|
+
sectionId: 'assets',
|
|
92
|
+
accountIDs: [],
|
|
93
|
+
totalBankBalance: undefined,
|
|
94
|
+
totalClearedBalance: undefined,
|
|
95
|
+
totalReconciledBalance: undefined,
|
|
96
|
+
totalVariance: undefined,
|
|
97
|
+
totalVariancePercentage: undefined,
|
|
98
|
+
},
|
|
99
|
+
liabilities: {
|
|
100
|
+
sectionId: 'liabilities',
|
|
101
|
+
accountIDs: [],
|
|
102
|
+
totalBankBalance: undefined,
|
|
103
|
+
totalClearedBalance: undefined,
|
|
104
|
+
totalReconciledBalance: undefined,
|
|
105
|
+
totalVariance: undefined,
|
|
106
|
+
totalVariancePercentage: undefined,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
89
109
|
};
|
|
90
110
|
}
|
|
91
111
|
const allAccountIDs = accountReconForMonthYearPeriod.accountIDs;
|
|
@@ -245,6 +265,137 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
|
|
|
245
265
|
totalVariancePercentage: liabilityTotals.variancePercentage,
|
|
246
266
|
},
|
|
247
267
|
};
|
|
268
|
+
const bankAccountIdSet = new Set(uniqueBankAccounts.map((a) => a.accountId));
|
|
269
|
+
const creditCardIdSet = new Set(uniqueCreditCards.map((a) => a.accountId));
|
|
270
|
+
const excludedAssetAccountIDs = [];
|
|
271
|
+
const excludedLiabilityAccountIDs = [];
|
|
272
|
+
const excludedAssetTotals = {};
|
|
273
|
+
const excludedLiabilityTotals = {};
|
|
274
|
+
reconciliationViewState.excludedAccounts
|
|
275
|
+
.filter((ea) => !ea.isDeleted)
|
|
276
|
+
.forEach((excludedAccount) => {
|
|
277
|
+
const accountID = excludedAccount.accountId;
|
|
278
|
+
const accountRecon = (0, accountReconSelector_1.getAccountReconByAccountIdAndSelectedPeriod)(state, accountID, selectedPeriod);
|
|
279
|
+
const isAsset = bankAccountIdSet.has(accountID);
|
|
280
|
+
const isLiability = creditCardIdSet.has(accountID);
|
|
281
|
+
if (!isAsset && !isLiability) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
let balanceTotal = undefined;
|
|
285
|
+
let clearedTotal = undefined;
|
|
286
|
+
let varianceTotal = undefined;
|
|
287
|
+
const total = {};
|
|
288
|
+
if (isAsset) {
|
|
289
|
+
balanceTotal =
|
|
290
|
+
excludedAssetTotals.balanceTotal != null
|
|
291
|
+
? (0, big_js_1.default)(excludedAssetTotals.balanceTotal.amount)
|
|
292
|
+
: undefined;
|
|
293
|
+
clearedTotal =
|
|
294
|
+
excludedAssetTotals.clearedTotal != null
|
|
295
|
+
? (0, big_js_1.default)(excludedAssetTotals.clearedTotal.amount)
|
|
296
|
+
: undefined;
|
|
297
|
+
varianceTotal =
|
|
298
|
+
excludedAssetTotals.varianceTotal != null
|
|
299
|
+
? (0, big_js_1.default)(excludedAssetTotals.varianceTotal.amount)
|
|
300
|
+
: undefined;
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
balanceTotal =
|
|
304
|
+
excludedLiabilityTotals.balanceTotal != null
|
|
305
|
+
? (0, big_js_1.default)(excludedLiabilityTotals.balanceTotal.amount)
|
|
306
|
+
: undefined;
|
|
307
|
+
clearedTotal =
|
|
308
|
+
excludedLiabilityTotals.clearedTotal != null
|
|
309
|
+
? (0, big_js_1.default)(excludedLiabilityTotals.clearedTotal.amount)
|
|
310
|
+
: undefined;
|
|
311
|
+
varianceTotal =
|
|
312
|
+
excludedLiabilityTotals.varianceTotal != null
|
|
313
|
+
? (0, big_js_1.default)(excludedLiabilityTotals.varianceTotal.amount)
|
|
314
|
+
: undefined;
|
|
315
|
+
}
|
|
316
|
+
if (accountRecon?.balance != null && balanceTotal != null) {
|
|
317
|
+
balanceTotal = balanceTotal.plus(accountRecon.balance.amount);
|
|
318
|
+
}
|
|
319
|
+
else if (accountRecon?.balance != null && balanceTotal == null) {
|
|
320
|
+
balanceTotal = (0, big_js_1.default)(accountRecon.balance.amount);
|
|
321
|
+
}
|
|
322
|
+
if (accountRecon?.clearedBalance != null && clearedTotal != null) {
|
|
323
|
+
clearedTotal = clearedTotal.plus(accountRecon.clearedBalance.amount);
|
|
324
|
+
}
|
|
325
|
+
else if (accountRecon?.clearedBalance != null &&
|
|
326
|
+
clearedTotal == null) {
|
|
327
|
+
clearedTotal = (0, big_js_1.default)(accountRecon.clearedBalance.amount);
|
|
328
|
+
}
|
|
329
|
+
const currency = accountRecon?.currency;
|
|
330
|
+
if (balanceTotal != null && currency != null) {
|
|
331
|
+
total.balanceTotal = {
|
|
332
|
+
...currency,
|
|
333
|
+
amount: parseFloat(balanceTotal.toFixed(2)),
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
if (clearedTotal != null && currency != null) {
|
|
337
|
+
total.clearedTotal = {
|
|
338
|
+
...currency,
|
|
339
|
+
amount: parseFloat(clearedTotal.toFixed(2)),
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
if (clearedTotal != null && balanceTotal != null) {
|
|
343
|
+
varianceTotal = clearedTotal.minus(balanceTotal).abs();
|
|
344
|
+
}
|
|
345
|
+
else if (clearedTotal != null) {
|
|
346
|
+
varianceTotal = clearedTotal.abs();
|
|
347
|
+
}
|
|
348
|
+
else if (balanceTotal != null) {
|
|
349
|
+
varianceTotal = (0, big_js_1.default)(0).minus(balanceTotal).abs();
|
|
350
|
+
}
|
|
351
|
+
if (varianceTotal != null && currency != null) {
|
|
352
|
+
total.varianceTotal = {
|
|
353
|
+
...currency,
|
|
354
|
+
amount: parseFloat(varianceTotal.toFixed(2)),
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
total.variancePercentage =
|
|
358
|
+
total.varianceTotal != null &&
|
|
359
|
+
total.balanceTotal != null &&
|
|
360
|
+
total.balanceTotal.amount !== 0
|
|
361
|
+
? Math.abs((total.varianceTotal.amount / total.balanceTotal.amount) * 100)
|
|
362
|
+
: undefined;
|
|
363
|
+
if (isAsset) {
|
|
364
|
+
excludedAssetAccountIDs.push(accountID);
|
|
365
|
+
excludedAssetTotals.balanceTotal = total.balanceTotal;
|
|
366
|
+
excludedAssetTotals.clearedTotal = total.clearedTotal;
|
|
367
|
+
excludedAssetTotals.varianceTotal = total.varianceTotal;
|
|
368
|
+
excludedAssetTotals.variancePercentage = total.variancePercentage;
|
|
369
|
+
}
|
|
370
|
+
else {
|
|
371
|
+
excludedLiabilityAccountIDs.push(accountID);
|
|
372
|
+
excludedLiabilityTotals.balanceTotal = total.balanceTotal;
|
|
373
|
+
excludedLiabilityTotals.clearedTotal = total.clearedTotal;
|
|
374
|
+
excludedLiabilityTotals.varianceTotal = total.varianceTotal;
|
|
375
|
+
excludedLiabilityTotals.variancePercentage =
|
|
376
|
+
total.variancePercentage;
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
const excludedAccountReconciliationBySectionID = {
|
|
380
|
+
assets: {
|
|
381
|
+
sectionId: 'assets',
|
|
382
|
+
accountIDs: excludedAssetAccountIDs,
|
|
383
|
+
totalBankBalance: excludedAssetTotals.balanceTotal,
|
|
384
|
+
totalClearedBalance: excludedAssetTotals.clearedTotal,
|
|
385
|
+
totalReconciledBalance: excludedAssetTotals.varianceTotal,
|
|
386
|
+
totalVariance: excludedAssetTotals.varianceTotal,
|
|
387
|
+
totalVariancePercentage: excludedAssetTotals.variancePercentage,
|
|
388
|
+
},
|
|
389
|
+
liabilities: {
|
|
390
|
+
sectionId: 'liabilities',
|
|
391
|
+
accountIDs: excludedLiabilityAccountIDs,
|
|
392
|
+
totalBankBalance: excludedLiabilityTotals.balanceTotal,
|
|
393
|
+
totalClearedBalance: excludedLiabilityTotals.clearedTotal,
|
|
394
|
+
totalReconciledBalance: excludedLiabilityTotals.varianceTotal,
|
|
395
|
+
totalVariance: excludedLiabilityTotals.varianceTotal,
|
|
396
|
+
totalVariancePercentage: excludedLiabilityTotals.variancePercentage,
|
|
397
|
+
},
|
|
398
|
+
};
|
|
248
399
|
const accountListNestedAccountHierarchy = (0, accountListSelector_1.getNestedAccountListHierarchy)(accountListState, 'accountList');
|
|
249
400
|
const classListNestedAccountHierarchy = (0, classListSelector_1.getNestedClassListHierarchy)(classListState);
|
|
250
401
|
const accountsList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
|
|
@@ -290,6 +441,7 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
|
|
|
290
441
|
statementUploadChosen: reconciliationViewState.statementUploadChosen,
|
|
291
442
|
monthYearPeriod: selectedPeriod,
|
|
292
443
|
accountReconciliationBySectionID,
|
|
444
|
+
excludedAccountReconciliationBySectionID,
|
|
293
445
|
selectedAccountId: reconciliationViewState.selectedAccountId,
|
|
294
446
|
selectedReconAccount: reconciliationViewState.selectedAccountId != null &&
|
|
295
447
|
reconList[reconciliationViewState.selectedAccountId] != null
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
|
|
2
2
|
import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
3
3
|
import { Recommendation } from '../../../commonStateTypes/recommendationBase';
|
|
4
|
+
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
4
5
|
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
5
6
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
6
7
|
import { JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
7
8
|
import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
9
|
+
export declare const toJEScheduleSortKey: (v: string) => "vendor" | "type" | "category" | "class" | "memo" | "transactionDate" | "totalAmount" | "runningBalance" | "scheduleCategory" | "startMonth" | "amortizationPeriod" | "jePostingDate" | "remainingMonths";
|
|
10
|
+
export type JEScheduleSortKey = ReturnType<typeof toJEScheduleSortKey>;
|
|
8
11
|
export interface JESchedulesViewUIState {
|
|
9
12
|
scrollPosition: {
|
|
10
13
|
scrollTop: number;
|
|
11
14
|
scrollLeft?: number;
|
|
12
15
|
} | undefined;
|
|
13
16
|
searchString: string;
|
|
17
|
+
sortKey: JEScheduleSortKey;
|
|
18
|
+
sortOrder: SortOrder;
|
|
14
19
|
totalCount: number;
|
|
15
20
|
limit?: number;
|
|
16
21
|
}
|
|
@@ -1,2 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toJEScheduleSortKey = void 0;
|
|
4
|
+
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
|
+
const JE_SCHEDULE_SORT_KEYS = [
|
|
6
|
+
'vendor',
|
|
7
|
+
'category',
|
|
8
|
+
'class',
|
|
9
|
+
'scheduleCategory',
|
|
10
|
+
'startMonth',
|
|
11
|
+
'type',
|
|
12
|
+
'amortizationPeriod',
|
|
13
|
+
'jePostingDate',
|
|
14
|
+
'remainingMonths',
|
|
15
|
+
'runningBalance',
|
|
16
|
+
'totalAmount',
|
|
17
|
+
'transactionDate',
|
|
18
|
+
'memo',
|
|
19
|
+
];
|
|
20
|
+
const toJEScheduleSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_SCHEDULE_SORT_KEYS);
|
|
21
|
+
exports.toJEScheduleSortKey = toJEScheduleSortKey;
|
|
@@ -3,10 +3,11 @@ import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
|
3
3
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
4
4
|
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
5
5
|
import { ReconciliationAccountSourceType } from '../../../entity/account/accountState';
|
|
6
|
-
import { BankStatusCodeType
|
|
6
|
+
import { BankStatusCodeType } from '../../../entity/accountRecon/accountReconState';
|
|
7
7
|
import { CustomerBase } from '../../../entity/customer/customerState';
|
|
8
8
|
import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
9
9
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
10
|
+
import { ZeniDate } from '../../../zeniDayJS';
|
|
10
11
|
export declare const RECONCILE_ACTIONS: readonly ["reconcile", "save_reconcile_for_later", "exclude"];
|
|
11
12
|
export declare const toReconcileActions: (v: string) => "reconcile" | "save_reconcile_for_later" | "exclude";
|
|
12
13
|
export type ReconcileActionType = ReturnType<typeof toReconcileActions>;
|
|
@@ -71,10 +72,7 @@ export interface ReconciliationReviewTabLocalData {
|
|
|
71
72
|
classId?: ID;
|
|
72
73
|
creditCardId?: ID;
|
|
73
74
|
customer?: CustomerBase;
|
|
74
|
-
jeCreditClassId?: ID;
|
|
75
|
-
jeDebitClassId?: ID;
|
|
76
75
|
matchedTransactionId?: ID;
|
|
77
|
-
recommendedActionType?: RecommendedActionCodeType;
|
|
78
76
|
vendor?: VendorBase;
|
|
79
77
|
}
|
|
80
78
|
export interface ActionFetchStates {
|
|
@@ -83,6 +81,22 @@ export interface ActionFetchStates {
|
|
|
83
81
|
saveForLaterFetch: FetchStateAndError;
|
|
84
82
|
saveReconciliationReviewFetch: Record<ID, FetchStateAndError>;
|
|
85
83
|
}
|
|
84
|
+
export interface ExclusionHistory {
|
|
85
|
+
action: string;
|
|
86
|
+
at: string;
|
|
87
|
+
by: string;
|
|
88
|
+
reason: string;
|
|
89
|
+
}
|
|
90
|
+
export interface ExcludedAccount {
|
|
91
|
+
accountId: ID;
|
|
92
|
+
createTime: ZeniDate;
|
|
93
|
+
detectionSignals: string[];
|
|
94
|
+
excludedAccountId: ID;
|
|
95
|
+
excludedByUserId: ID;
|
|
96
|
+
exclusionHistory: ExclusionHistory[];
|
|
97
|
+
isDeleted: boolean;
|
|
98
|
+
updateTime: ZeniDate;
|
|
99
|
+
}
|
|
86
100
|
export interface ReconListUIState {
|
|
87
101
|
scrollPosition: {
|
|
88
102
|
scrollTop: number;
|
|
@@ -93,6 +107,8 @@ export interface ReconciliationViewState extends FetchStateAndError {
|
|
|
93
107
|
accountConnectionStatusByAccountID: Record<ID, BankConnectionStatus>;
|
|
94
108
|
accountReconciliationRecordsBySelectedPeriod: Record<MonthYearPeriodId, AccountReconciliationRecords>;
|
|
95
109
|
actionFetchState: ActionFetchStates;
|
|
110
|
+
excludedAccounts: ExcludedAccount[];
|
|
111
|
+
excludedAccountsFetchState: FetchStateAndError;
|
|
96
112
|
reconListUIState: ReconListUIState;
|
|
97
113
|
reconTabsState: ReconciliationTabsState;
|
|
98
114
|
refreshStatus: FetchStateAndError;
|
|
@@ -7,7 +7,7 @@ export declare const getScheduleListKey: (selectedCategory: ID, selectedTimefram
|
|
|
7
7
|
export type ScheduleListKey = ReturnType<typeof getScheduleListKey>;
|
|
8
8
|
export declare const toScheduleSubTabType: (v: string) => "completed" | "new" | "ongoing" | "all";
|
|
9
9
|
export type ScheduleSubTabType = ReturnType<typeof toScheduleSubTabType>;
|
|
10
|
-
declare const toScheduleSortKeyType: (v: string) => "months" | "amount" | "vendor" | "status" | "user" | "createTime" | "class" | "memo" | "balanceAsOfToday" | "transactionDate" | "transactionType" | "assetId" | "
|
|
10
|
+
declare const toScheduleSortKeyType: (v: string) => "months" | "amount" | "vendor" | "status" | "user" | "createTime" | "class" | "memo" | "balanceAsOfToday" | "transactionDate" | "transactionType" | "assetId" | "scheduleCategory" | "startMonth" | "accruedExpenseCategory" | "expenseCategory" | "accumulatedDepreciationCategory" | "endMonth";
|
|
11
11
|
export declare type ScheduleListSortKey = ReturnType<typeof toScheduleSortKeyType>;
|
|
12
12
|
export interface DownloadJEScheduleTabOptions {
|
|
13
13
|
categoryId: ID;
|
|
@@ -424,6 +424,14 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
|
|
|
424
424
|
transactionsWithNoSortKeyValue.push(transaction);
|
|
425
425
|
}
|
|
426
426
|
break;
|
|
427
|
+
case 'invoiceNumber':
|
|
428
|
+
if (transaction.documentId != null) {
|
|
429
|
+
transactionsWithSortKeyValue.push(transaction);
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
transactionsWithNoSortKeyValue.push(transaction);
|
|
433
|
+
}
|
|
434
|
+
break;
|
|
427
435
|
case 'dueDate':
|
|
428
436
|
if (currentTab === 'draft') {
|
|
429
437
|
if (Boolean(transaction.dueDate) === true) {
|
|
@@ -526,6 +534,8 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
|
|
|
526
534
|
return transaction.totalAmountInUSD?.amount ?? 0;
|
|
527
535
|
case 'paymentMethod':
|
|
528
536
|
return transaction.billPayInfo.billPaymentMethodType.name;
|
|
537
|
+
case 'invoiceNumber':
|
|
538
|
+
return transaction.documentId;
|
|
529
539
|
}
|
|
530
540
|
}, getColumnWiseSortOrder(sortOrder));
|
|
531
541
|
return [
|
|
@@ -37,7 +37,7 @@ declare const toBillTabType: (v: string) => "paid" | "pending_approval" | "sched
|
|
|
37
37
|
export type BillTab = ReturnType<typeof toBillTabType>;
|
|
38
38
|
declare const toBillsSubTabType: (v: string) => "rejected" | "failed" | "ach" | "wire" | "cancelled" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "offline";
|
|
39
39
|
export type BillsSubTabType = ReturnType<typeof toBillsSubTabType>;
|
|
40
|
-
declare const toBillPaySortKeyType: (v: string) => "amount" | "status" | "name" | "dueDate" | "paymentMethod" | "invoiceDate";
|
|
40
|
+
declare const toBillPaySortKeyType: (v: string) => "amount" | "status" | "name" | "dueDate" | "paymentMethod" | "invoiceNumber" | "invoiceDate";
|
|
41
41
|
export declare type BillPayViewSortKey = ReturnType<typeof toBillPaySortKeyType>;
|
|
42
42
|
export interface BillPayFilters {
|
|
43
43
|
categories: BillPayFilterCategory[];
|
|
@@ -47,6 +47,7 @@ const ALL_BILL_PAY_SORT_KEYS = [
|
|
|
47
47
|
'invoiceDate',
|
|
48
48
|
'name',
|
|
49
49
|
'paymentMethod',
|
|
50
|
+
'invoiceNumber',
|
|
50
51
|
];
|
|
51
52
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
52
53
|
const toBillPaySortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_BILL_PAY_SORT_KEYS);
|
|
@@ -9,6 +9,7 @@ const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchStat
|
|
|
9
9
|
const contactSelector_1 = require("../../../../entity/billPay/contact/contactSelector");
|
|
10
10
|
const paymentAccountSelector_1 = require("../../../../entity/paymentAccount/paymentAccountSelector");
|
|
11
11
|
const vendorSelector_1 = require("../../../../entity/vendor/vendorSelector");
|
|
12
|
+
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
12
13
|
const accountListSelector_1 = require("../../../accountList/accountListSelector");
|
|
13
14
|
const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
14
15
|
const depositAccountListSelector_1 = require("../../zeniAccounts/depositAccountList/depositAccountListSelector");
|
|
@@ -80,11 +81,14 @@ const getReviewPageBillDetail = (state, billId) => {
|
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
if (sourceBillDetail != null) {
|
|
83
|
-
|
|
84
|
+
const fetchStateList = [
|
|
84
85
|
sourceBillDetail.fetchStatus,
|
|
85
86
|
accountListState.byReportId['billPayAccountList'],
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
];
|
|
88
|
+
if ((0, tenantSelector_1.getIsAccountingClassesEnabled)(state)) {
|
|
89
|
+
fetchStateList.push(classListState);
|
|
90
|
+
}
|
|
91
|
+
sourceBillDetailFetchState = (0, reduceFetchState_1.reduceFetchState)(fetchStateList).fetchState;
|
|
88
92
|
}
|
|
89
93
|
}
|
|
90
94
|
else {
|
|
@@ -9,6 +9,7 @@ const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
|
9
9
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
10
10
|
const approvalRuleSelector_1 = require("../../../../entity/approvalRule/approvalRuleSelector");
|
|
11
11
|
const classSelector_1 = require("../../../../entity/class/classSelector");
|
|
12
|
+
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
12
13
|
const userSelector_1 = require("../../../../entity/user/userSelector");
|
|
13
14
|
const userRoleSelector_1 = require("../../../../entity/userRole/userRoleSelector");
|
|
14
15
|
exports.getBillPaySetupApproverView = (0, toolkit_1.createSelector)((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (billPaySetupApproverViewState, approvalRuleState, userState) => {
|
|
@@ -50,7 +51,7 @@ exports.getBillPaySetupApproverView = (0, toolkit_1.createSelector)((state) => s
|
|
|
50
51
|
newApprovalRuleId,
|
|
51
52
|
};
|
|
52
53
|
});
|
|
53
|
-
exports.getBillPaySetupApproverUpdateDataView = (0, toolkit_1.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) => {
|
|
54
|
+
exports.getBillPaySetupApproverUpdateDataView = (0, toolkit_1.createSelector)((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (state) => state.classState, (state) => state.classListState, (state) => state.userRoleState, (state) => (0, tenantSelector_1.getIsAccountingClassesEnabled)(state), (billPaySetupApproverViewState, approvalRuleState, userState, classState, classListState, userRoleState, isAccountingClassesEnabled) => {
|
|
54
55
|
const { affectedEntityIds, approvalRuleIds, approverListState, billPaySetupApproverViewUpdateData, fetchState, error, listeningToPusherEvent, } = billPaySetupApproverViewState;
|
|
55
56
|
const { approverIds, attributes } = approverListState;
|
|
56
57
|
const allApprovalRules = (0, approvalRuleSelector_1.getApprovalRulesByIds)(approvalRuleState, approvalRuleIds);
|
|
@@ -98,10 +99,9 @@ exports.getBillPaySetupApproverUpdateDataView = (0, toolkit_1.createSelector)((s
|
|
|
98
99
|
allAttributes,
|
|
99
100
|
filteredAttributes,
|
|
100
101
|
billPaySetupApproverViewUpdateData,
|
|
101
|
-
approverListFetchStatus:
|
|
102
|
-
approverListState.fetchStatus,
|
|
103
|
-
|
|
104
|
-
]),
|
|
102
|
+
approverListFetchStatus: isAccountingClassesEnabled
|
|
103
|
+
? (0, reduceFetchState_1.reduceAllFetchState)([approverListState.fetchStatus, classListState])
|
|
104
|
+
: approverListState.fetchStatus,
|
|
105
105
|
fetchState,
|
|
106
106
|
allAccountingClasses,
|
|
107
107
|
error,
|