@zeniai/client-epic-state 4.15.26 → 4.15.28
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/timePeriod.d.ts +1 -1
- package/lib/commonStateTypes/timePeriod.js +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
- package/lib/configureStore.js +2 -1
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/accountRecon/accountReconPayload.d.ts +70 -0
- package/lib/entity/accountRecon/accountReconPayload.js +125 -0
- package/lib/entity/accountRecon/accountReconReducer.d.ts +16 -0
- package/lib/entity/accountRecon/accountReconReducer.js +71 -0
- package/lib/entity/accountRecon/accountReconSelector.d.ts +28 -0
- package/lib/entity/accountRecon/accountReconSelector.js +44 -0
- package/lib/entity/accountRecon/accountReconState.d.ts +70 -0
- package/lib/entity/accountRecon/accountReconState.js +28 -0
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/customer/customerPayload.d.ts +1 -1
- package/lib/entity/customer/customerPayload.js +16 -6
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +4 -0
- package/lib/entity/task/taskState.d.ts +1 -1
- package/lib/entity/tenant/clearAllEpic.d.ts +4 -2
- package/lib/entity/tenant/clearAllEpic.js +4 -0
- package/lib/entity/tenant/tenantReducer.d.ts +1 -1
- package/lib/entity/tenant/tenantReducer.js +7 -2
- package/lib/entity/transaction/payloadTypes/customerTransactionPayload.d.ts +1 -1
- package/lib/entity/transaction/payloadTypes/customerTransactionPayload.js +1 -2
- package/lib/entity/transaction/payloadTypes/reconciliationTransactionPayloads.d.ts +35 -0
- package/lib/entity/transaction/payloadTypes/reconciliationTransactionPayloads.js +53 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +2 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +7 -3
- package/lib/entity/transaction/payloadTypes/vendorTransactionPayload.d.ts +9 -1
- package/lib/entity/transaction/payloadTypes/vendorTransactionPayload.js +23 -2
- package/lib/entity/transaction/stateTypes/reconciliationTransaction.d.ts +32 -0
- package/lib/entity/transaction/stateTypes/reconciliationTransaction.js +10 -0
- package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -1
- package/lib/entity/transaction/stateTypes/transactionType.d.ts +1 -1
- package/lib/entity/transaction/stateTypes/transactionType.js +1 -0
- package/lib/entity/transaction/stateTypes/vendorTransaction.d.ts +5 -0
- package/lib/entity/transaction/stateTypes/vendorTransaction.js +5 -1
- package/lib/entity/transaction/toSupportedTransaction.js +6 -1
- package/lib/entity/transaction/transactionReducer.d.ts +17 -0
- package/lib/entity/transaction/transactionReducer.js +47 -2
- package/lib/entity/transaction/transactionSelector.d.ts +2 -0
- package/lib/entity/transaction/transactionSelector.js +5 -0
- package/lib/entity/transaction/transactionState.d.ts +6 -4
- package/lib/entity/vendorExpense/vendorExpenseSelector.d.ts +2 -2
- package/lib/epic.d.ts +6 -1
- package/lib/epic.js +6 -1
- package/lib/index.d.ts +14 -6
- package/lib/index.js +52 -27
- package/lib/reducer.d.ts +7 -1
- package/lib/reducer.js +6 -0
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +2 -2
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.d.ts +15 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +118 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.d.ts +10 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.js +49 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationDetailEpic.d.ts +14 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationDetailEpic.js +169 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +154 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.d.ts +6 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.js +110 -0
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +24 -10
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +14 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +20 -4
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +17 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +2 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewState.js +1 -1
- package/lib/view/expenseAutomationView/helpers/reconciliationHelpers.d.ts +7 -0
- package/lib/view/expenseAutomationView/helpers/reconciliationHelpers.js +18 -0
- package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +81 -30
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +54 -10
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +28 -0
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.js +51 -0
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +66 -0
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +384 -0
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +5 -4
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.js +1 -1
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +51 -0
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +7 -0
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.d.ts +5 -0
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +250 -0
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +103 -0
- package/lib/view/expenseAutomationView/types/reconciliationViewState.js +38 -0
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +8 -0
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/validateBillsBulkActionEpic.ts.js +4 -3
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +11 -3
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +2 -1
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +3 -1
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +1 -1
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +13 -4
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +16 -3
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +22 -5
- package/lib/view/transactionDetail/transactionDetailState.d.ts +1 -0
- package/lib/view/transactionDetail/transactionDetailTypes.d.ts +6 -0
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewState.d.ts +1 -1
- package/lib/zeniAPI.d.ts +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isAccountReconReport = exports.getExpenseAutomationReconciliationView = void 0;
|
|
4
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
|
+
const lodash_1 = require("lodash");
|
|
6
|
+
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
7
|
+
const accountReconSelector_1 = require("../../../entity/accountRecon/accountReconSelector");
|
|
8
|
+
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
9
|
+
const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
10
|
+
const classListSelector_1 = require("../../classList/classListSelector");
|
|
11
|
+
const reconciliationViewReducer_1 = require("../reducers/reconciliationViewReducer");
|
|
12
|
+
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
13
|
+
exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((state) => state, (state) => (0, tenantSelector_1.getCurrentTenant)(state), (state) => state.expenseAutomationReconciliationViewState, (state) => state.expenseAutomationViewState, (state) => state.plaidAccountViewState, (state) => state.accountListState, (state) => state.accountState, (state) => state.classListState, (state) => state.classState, (state) => state.monthEndCloseChecksState, (state, currentTenant, reconciliationViewState, expenseAutomationViewState, plaidAccountViewState, accountListState, accountState, classListState, classState, monthEndCloseChecksState) => {
|
|
14
|
+
var _a;
|
|
15
|
+
const { selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
16
|
+
const reconcileTabUiState = reconciliationViewState.reconTabsState.reconcile.uiState;
|
|
17
|
+
const reviewTabUiState = reconciliationViewState.reconTabsState.review.uiState;
|
|
18
|
+
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
19
|
+
const accountReconForMonthYearPeriod = selectedPeriod != null
|
|
20
|
+
? reconciliationViewState.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]
|
|
21
|
+
: undefined;
|
|
22
|
+
if (accountReconForMonthYearPeriod == null) {
|
|
23
|
+
return {
|
|
24
|
+
accountListNestedAccountHierarchy: [],
|
|
25
|
+
classListNestedAccountHierarchy: [],
|
|
26
|
+
allAccountList: [],
|
|
27
|
+
allClassList: [],
|
|
28
|
+
fetchStatus: {
|
|
29
|
+
fetchState: reconciliationViewState.fetchState,
|
|
30
|
+
error: reconciliationViewState.error,
|
|
31
|
+
},
|
|
32
|
+
plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
|
|
33
|
+
.plaidConnectionDetails,
|
|
34
|
+
completionStatus: 'incomplete',
|
|
35
|
+
refreshStatus: reconciliationViewState.refreshStatus,
|
|
36
|
+
selectedTab: reconciliationViewState.selectedTab,
|
|
37
|
+
monthYearPeriod: selectedPeriod,
|
|
38
|
+
selectedAccountId: reconciliationViewState.selectedAccountId,
|
|
39
|
+
accountReconciliationsByAccountID: {},
|
|
40
|
+
reconciliationTabsState: reconciliationViewReducer_1.initialReconciliationTabsState,
|
|
41
|
+
actionFetchStates: reconciliationViewReducer_1.initialActionFetchState,
|
|
42
|
+
accountReconciliationBySectionID: {
|
|
43
|
+
assets: {
|
|
44
|
+
sectionId: 'assets',
|
|
45
|
+
accountIDs: [],
|
|
46
|
+
totalBankBalance: undefined,
|
|
47
|
+
totalClearedBalance: undefined,
|
|
48
|
+
totalReconciledBalance: undefined,
|
|
49
|
+
totalVariance: undefined,
|
|
50
|
+
totalVariancePercentage: undefined,
|
|
51
|
+
},
|
|
52
|
+
liabilities: {
|
|
53
|
+
sectionId: 'liabilities',
|
|
54
|
+
accountIDs: [],
|
|
55
|
+
totalBankBalance: undefined,
|
|
56
|
+
totalClearedBalance: undefined,
|
|
57
|
+
totalReconciledBalance: undefined,
|
|
58
|
+
totalVariance: undefined,
|
|
59
|
+
totalVariancePercentage: undefined,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
const allAccountIDs = accountReconForMonthYearPeriod.accountIDs;
|
|
65
|
+
const reconList = {};
|
|
66
|
+
const assetAccountIDs = [];
|
|
67
|
+
const liabilityAccountIDs = [];
|
|
68
|
+
const assetTotals = {};
|
|
69
|
+
const liabilityTotals = {};
|
|
70
|
+
allAccountIDs.forEach((accountID) => {
|
|
71
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
72
|
+
const accountRecon = (0, accountReconSelector_1.getAccountReconByAccountIdAndSelectedPeriod)(state, accountID, selectedPeriod);
|
|
73
|
+
if (accountRecon == null) {
|
|
74
|
+
console.error(`Account reconciliation not found for account ${accountID} in period ${selectedPeriod.toString()}`);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const accountConnectionStatus = reconciliationViewState.accountConnectionStatusByAccountID[accountID];
|
|
78
|
+
if (accountConnectionStatus == null) {
|
|
79
|
+
console.error(`Account connection status not found for account ${accountID} in period ${selectedPeriod.toString()}`);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const account = accountRecon.account;
|
|
83
|
+
const sortedReconcileTransactions = sortReconcileTransactions(accountRecon.transactionsToReconcile, reconcileTabUiState);
|
|
84
|
+
accountRecon.transactionsToReconcile = sortedReconcileTransactions;
|
|
85
|
+
const sortedReviewTabTransactions = sortReviewTabTransactions(accountRecon.transactionsToReview, reviewTabUiState);
|
|
86
|
+
accountRecon.transactionsToReview = sortedReviewTabTransactions;
|
|
87
|
+
if (accountConnectionStatus.status === 'connected') {
|
|
88
|
+
if ((account === null || account === void 0 ? void 0 : account.accountType) === 'bank') {
|
|
89
|
+
if (accountRecon.balance != null &&
|
|
90
|
+
accountRecon.clearedBalance != null &&
|
|
91
|
+
accountRecon.variance != null) {
|
|
92
|
+
assetTotals.balanceTotal = Object.assign(Object.assign({}, accountRecon.balance), { amount: ((_b = (_a = assetTotals.balanceTotal) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : 0) +
|
|
93
|
+
accountRecon.balance.amount });
|
|
94
|
+
assetTotals.clearedTotal = Object.assign(Object.assign({}, accountRecon.clearedBalance), { amount: ((_d = (_c = assetTotals.clearedTotal) === null || _c === void 0 ? void 0 : _c.amount) !== null && _d !== void 0 ? _d : 0) +
|
|
95
|
+
accountRecon.clearedBalance.amount });
|
|
96
|
+
assetTotals.varianceTotal = Object.assign(Object.assign({}, accountRecon.variance), { amount: ((_f = (_e = assetTotals.varianceTotal) === null || _e === void 0 ? void 0 : _e.amount) !== null && _f !== void 0 ? _f : 0) +
|
|
97
|
+
accountRecon.variance.amount });
|
|
98
|
+
assetTotals.variancePercentage =
|
|
99
|
+
assetTotals.varianceTotal.amount != null
|
|
100
|
+
? (assetTotals.varianceTotal.amount /
|
|
101
|
+
assetTotals.clearedTotal.amount) *
|
|
102
|
+
100
|
|
103
|
+
: undefined;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
else if (account.accountType === 'credit_card') {
|
|
107
|
+
if (accountRecon.balance != null &&
|
|
108
|
+
accountRecon.clearedBalance != null &&
|
|
109
|
+
accountRecon.variance != null) {
|
|
110
|
+
liabilityTotals.balanceTotal = Object.assign(Object.assign({}, accountRecon.balance), { amount: ((_h = (_g = liabilityTotals.balanceTotal) === null || _g === void 0 ? void 0 : _g.amount) !== null && _h !== void 0 ? _h : 0) +
|
|
111
|
+
accountRecon.balance.amount });
|
|
112
|
+
liabilityTotals.clearedTotal = Object.assign(Object.assign({}, accountRecon.clearedBalance), { amount: ((_k = (_j = liabilityTotals.clearedTotal) === null || _j === void 0 ? void 0 : _j.amount) !== null && _k !== void 0 ? _k : 0) +
|
|
113
|
+
accountRecon.clearedBalance.amount });
|
|
114
|
+
liabilityTotals.varianceTotal = Object.assign(Object.assign({}, accountRecon.variance), { amount: ((_m = (_l = liabilityTotals.varianceTotal) === null || _l === void 0 ? void 0 : _l.amount) !== null && _m !== void 0 ? _m : 0) +
|
|
115
|
+
accountRecon.variance.amount });
|
|
116
|
+
liabilityTotals.variancePercentage =
|
|
117
|
+
liabilityTotals.varianceTotal.amount != null
|
|
118
|
+
? (liabilityTotals.varianceTotal.amount /
|
|
119
|
+
liabilityTotals.clearedTotal.amount) *
|
|
120
|
+
100
|
|
121
|
+
: undefined;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if ((account === null || account === void 0 ? void 0 : account.accountType) === 'bank') {
|
|
126
|
+
assetAccountIDs.push(accountID);
|
|
127
|
+
}
|
|
128
|
+
else if (account.accountType === 'credit_card') {
|
|
129
|
+
liabilityAccountIDs.push(accountID);
|
|
130
|
+
}
|
|
131
|
+
reconList[accountID] = {
|
|
132
|
+
accountConnectionStatus: accountConnectionStatus.status,
|
|
133
|
+
paymentAccountId: accountConnectionStatus.paymentAccountId,
|
|
134
|
+
connectionInProgress: accountConnectionStatus.connectionInProgress,
|
|
135
|
+
accountReconEntity: accountRecon,
|
|
136
|
+
refreshStatus: accountReconForMonthYearPeriod.reconciliationByAccountID[accountID]
|
|
137
|
+
.refreshStatus,
|
|
138
|
+
transactionFetchState: accountReconForMonthYearPeriod.reconciliationByAccountID[accountID]
|
|
139
|
+
.transactionFetchState, // transaction fetch state
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
const accountReconciliationBySectionID = {
|
|
143
|
+
assets: {
|
|
144
|
+
sectionId: 'assets',
|
|
145
|
+
accountIDs: assetAccountIDs,
|
|
146
|
+
totalBankBalance: assetTotals.balanceTotal,
|
|
147
|
+
totalClearedBalance: assetTotals.clearedTotal,
|
|
148
|
+
totalReconciledBalance: assetTotals.varianceTotal,
|
|
149
|
+
totalVariance: assetTotals.varianceTotal,
|
|
150
|
+
totalVariancePercentage: assetTotals.variancePercentage,
|
|
151
|
+
},
|
|
152
|
+
liabilities: {
|
|
153
|
+
sectionId: 'liabilities',
|
|
154
|
+
accountIDs: liabilityAccountIDs,
|
|
155
|
+
totalBankBalance: liabilityTotals.balanceTotal,
|
|
156
|
+
totalClearedBalance: liabilityTotals.clearedTotal,
|
|
157
|
+
totalReconciledBalance: liabilityTotals.varianceTotal,
|
|
158
|
+
totalVariance: liabilityTotals.varianceTotal,
|
|
159
|
+
totalVariancePercentage: liabilityTotals.variancePercentage,
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
const accountListNestedAccountHierarchy = (0, accountListSelector_1.getNestedAccountListHierarchy)(accountListState, 'accountList');
|
|
163
|
+
const classListNestedAccountHierarchy = (0, classListSelector_1.getNestedClassListHierarchy)(classListState);
|
|
164
|
+
const accountsList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
|
|
165
|
+
const classList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
166
|
+
const allClasses = classList.classes.map((classData) => {
|
|
167
|
+
return (0, lodash_1.omit)(classData, ['accountIds', 'key']);
|
|
168
|
+
});
|
|
169
|
+
const allSteps = selectedPeriod != null
|
|
170
|
+
? (0, expenseAutomationViewSelectorTypes_1.getAllSteps)(monthEndCloseChecksState, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod), currentTenant.tenantId)
|
|
171
|
+
: [];
|
|
172
|
+
const reconciliationCompletionStatus = (_a = allSteps.find((step) => step.step === 'reconciliation')) === null || _a === void 0 ? void 0 : _a.completionStatus;
|
|
173
|
+
const completionStatus = reconciliationCompletionStatus !== null && reconciliationCompletionStatus !== void 0 ? reconciliationCompletionStatus : 'incomplete';
|
|
174
|
+
return {
|
|
175
|
+
accountReconciliationsByAccountID: reconList,
|
|
176
|
+
fetchStatus: {
|
|
177
|
+
fetchState: reconciliationViewState.fetchState,
|
|
178
|
+
error: reconciliationViewState.error,
|
|
179
|
+
},
|
|
180
|
+
plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
|
|
181
|
+
.plaidConnectionDetails,
|
|
182
|
+
reconciliationTabsState: reconciliationViewState.reconTabsState,
|
|
183
|
+
completionStatus,
|
|
184
|
+
refreshStatus: reconciliationViewState.refreshStatus,
|
|
185
|
+
selectedTab: reconciliationViewState.selectedTab,
|
|
186
|
+
selectedDrawerAccountId: reconciliationViewState.selectedDrawerAccountId,
|
|
187
|
+
monthYearPeriod: selectedPeriod,
|
|
188
|
+
accountReconciliationBySectionID,
|
|
189
|
+
selectedAccountId: reconciliationViewState.selectedAccountId,
|
|
190
|
+
selectedReconAccount: reconciliationViewState.selectedAccountId != null &&
|
|
191
|
+
reconList[reconciliationViewState.selectedAccountId] != null
|
|
192
|
+
? reconList[reconciliationViewState.selectedAccountId]
|
|
193
|
+
: undefined, // Selects the reconciliation account based on the selectedAccountId
|
|
194
|
+
accountListNestedAccountHierarchy,
|
|
195
|
+
actionFetchStates: reconciliationViewState.actionFetchState,
|
|
196
|
+
classListNestedAccountHierarchy,
|
|
197
|
+
allAccountList: accountsList.accounts,
|
|
198
|
+
allClassList: allClasses,
|
|
199
|
+
};
|
|
200
|
+
});
|
|
201
|
+
const isAccountReconReport = (reportId) => {
|
|
202
|
+
return reportId.endsWith('reconciliation');
|
|
203
|
+
};
|
|
204
|
+
exports.isAccountReconReport = isAccountReconReport;
|
|
205
|
+
function sortReconcileTransactions(transactions, uiState) {
|
|
206
|
+
const { sortKey, sortOrder } = uiState;
|
|
207
|
+
return (0, lodash_1.orderBy)(transactions, (transaction) => {
|
|
208
|
+
var _a, _b, _c, _d, _e, _f;
|
|
209
|
+
switch (sortKey) {
|
|
210
|
+
case 'clearedDate':
|
|
211
|
+
return (_b = (_a = transaction.clearedDate) === null || _a === void 0 ? void 0 : _a.valueOf()) !== null && _b !== void 0 ? _b : null;
|
|
212
|
+
case 'type':
|
|
213
|
+
return transaction.type.toLowerCase();
|
|
214
|
+
case 'payee':
|
|
215
|
+
return (_d = (_c = transaction.merchantName) === null || _c === void 0 ? void 0 : _c.toLowerCase()) !== null && _d !== void 0 ? _d : null;
|
|
216
|
+
case 'account':
|
|
217
|
+
return (_f = (_e = transaction.accountName) === null || _e === void 0 ? void 0 : _e.toLowerCase()) !== null && _f !== void 0 ? _f : null;
|
|
218
|
+
case 'transactionDirection':
|
|
219
|
+
return transaction.transactionDirection.toLowerCase();
|
|
220
|
+
case 'memo':
|
|
221
|
+
return transaction.memo.toLowerCase();
|
|
222
|
+
case 'amount':
|
|
223
|
+
return transaction.amount.amount;
|
|
224
|
+
case 'date':
|
|
225
|
+
default:
|
|
226
|
+
return transaction.date.valueOf();
|
|
227
|
+
}
|
|
228
|
+
}, sortOrder === 'ascending' ? 'asc' : 'desc');
|
|
229
|
+
}
|
|
230
|
+
function sortReviewTabTransactions(transactions, uiState) {
|
|
231
|
+
const { sortKey, sortOrder } = uiState;
|
|
232
|
+
return (0, lodash_1.orderBy)(transactions, (transaction) => {
|
|
233
|
+
var _a, _b, _c, _d;
|
|
234
|
+
switch (sortKey) {
|
|
235
|
+
case 'match':
|
|
236
|
+
return ((_b = (_a = transaction.recommendedAction) === null || _a === void 0 ? void 0 : _a.recommendedTransactions.length) !== null && _b !== void 0 ? _b : null);
|
|
237
|
+
case 'payee':
|
|
238
|
+
return (_d = (_c = transaction.merchantName) === null || _c === void 0 ? void 0 : _c.toLowerCase()) !== null && _d !== void 0 ? _d : null;
|
|
239
|
+
case 'direction':
|
|
240
|
+
return transaction.transactionDirection.toLowerCase();
|
|
241
|
+
case 'memo':
|
|
242
|
+
return transaction.memo.toLowerCase();
|
|
243
|
+
case 'amount':
|
|
244
|
+
return transaction.amount.amount;
|
|
245
|
+
case 'date':
|
|
246
|
+
default:
|
|
247
|
+
return transaction.transactionDate.valueOf();
|
|
248
|
+
}
|
|
249
|
+
}, sortOrder === 'ascending' ? 'asc' : 'desc');
|
|
250
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Amount } from '../../../commonStateTypes/amount';
|
|
2
|
+
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
3
|
+
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
4
|
+
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
5
|
+
import { BankStatusCodeType } from '../../../entity/accountRecon/accountReconState';
|
|
6
|
+
import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
7
|
+
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
8
|
+
export declare const RECONCILE_ACTIONS: readonly ["reconcile", "save_reconcile_for_later", "exclude"];
|
|
9
|
+
export declare const toReconcileActions: (v: string) => "reconcile" | "save_reconcile_for_later" | "exclude";
|
|
10
|
+
export type ReconcileActionType = ReturnType<typeof toReconcileActions>;
|
|
11
|
+
export type SaveReconcileDetailActionPayload = {
|
|
12
|
+
reconcileAction: 'exclude';
|
|
13
|
+
excludeTransactionId: ID;
|
|
14
|
+
} | {
|
|
15
|
+
reconcileAction: 'reconcile' | 'save_reconcile_for_later';
|
|
16
|
+
};
|
|
17
|
+
export interface SaveReconciliationDetailFailurePayload {
|
|
18
|
+
fetchStateByAction: SaveReconcileDetailActionPayload;
|
|
19
|
+
error: ZeniAPIStatus;
|
|
20
|
+
}
|
|
21
|
+
export declare const toReconciliationTabsType: (v: string) => "reconcile" | "review";
|
|
22
|
+
export declare type ReconciliationViewTabType = ReturnType<typeof toReconciliationTabsType>;
|
|
23
|
+
declare const toReconReconcileSortKeysType: (v: string) => "type" | "date" | "amount" | "account" | "memo" | "transactionDirection" | "clearedDate" | "payee" | "recommended";
|
|
24
|
+
export declare type ReconReconcileSortKey = ReturnType<typeof toReconReconcileSortKeysType>;
|
|
25
|
+
export interface ReconciliationReconcileTabLocalData {
|
|
26
|
+
selectedTransactionIds: ID[];
|
|
27
|
+
}
|
|
28
|
+
export interface ReconciliationReconcileTabViewUiState {
|
|
29
|
+
scrollYOffset?: number;
|
|
30
|
+
sortKey: ReconReconcileSortKey;
|
|
31
|
+
sortOrder: SortOrder;
|
|
32
|
+
}
|
|
33
|
+
export interface TransactionSummary {
|
|
34
|
+
count: number;
|
|
35
|
+
totalAmount: Amount;
|
|
36
|
+
}
|
|
37
|
+
export interface BalancesLocalData {
|
|
38
|
+
variance: Amount;
|
|
39
|
+
clearedBalance: Amount;
|
|
40
|
+
variancePercentage: number;
|
|
41
|
+
payments: TransactionSummary;
|
|
42
|
+
deposits: TransactionSummary;
|
|
43
|
+
}
|
|
44
|
+
export interface ReconciliationTabsState {
|
|
45
|
+
reconcile: {
|
|
46
|
+
localData: ReconciliationReconcileTabLocalData;
|
|
47
|
+
uiState: ReconciliationReconcileTabViewUiState;
|
|
48
|
+
};
|
|
49
|
+
review: {
|
|
50
|
+
localData: Record<ID, ReconciliationReviewTabLocalData>;
|
|
51
|
+
uiState: ReconciliationReviewTabViewUiState;
|
|
52
|
+
};
|
|
53
|
+
balances: BalancesLocalData;
|
|
54
|
+
}
|
|
55
|
+
declare const toReconReviewSortKey: (v: string) => "match" | "direction" | "date" | "amount" | "memo" | "payee";
|
|
56
|
+
export type ReconReviewSortKey = ReturnType<typeof toReconReviewSortKey>;
|
|
57
|
+
export interface ReconciliationReviewTabViewUiState {
|
|
58
|
+
scrollPosition: {
|
|
59
|
+
scrollLeft?: number;
|
|
60
|
+
scrollTop: number;
|
|
61
|
+
} | undefined;
|
|
62
|
+
sortKey: ReconReviewSortKey;
|
|
63
|
+
sortOrder: SortOrder;
|
|
64
|
+
}
|
|
65
|
+
export interface ReconciliationReviewTabLocalData {
|
|
66
|
+
memo: string;
|
|
67
|
+
categoryId?: ID;
|
|
68
|
+
classId?: ID;
|
|
69
|
+
vendor?: VendorBase;
|
|
70
|
+
matchedTransactionId?: ID;
|
|
71
|
+
}
|
|
72
|
+
export interface ActionFetchStates {
|
|
73
|
+
excludeFetchById: Record<ID, FetchStateAndError>;
|
|
74
|
+
saveForLaterFetch: FetchStateAndError;
|
|
75
|
+
reconcileFetch: FetchStateAndError;
|
|
76
|
+
saveReconciliationReviewFetch: Record<ID, FetchStateAndError>;
|
|
77
|
+
}
|
|
78
|
+
export interface ReconciliationViewState extends FetchStateAndError {
|
|
79
|
+
accountReconciliationRecordsBySelectedPeriod: Record<MonthYearPeriodId, AccountReconciliationRecords>;
|
|
80
|
+
refreshStatus: FetchStateAndError;
|
|
81
|
+
accountConnectionStatusByAccountID: Record<ID, BankConnectionStatus>;
|
|
82
|
+
selectedTab: ReconciliationViewTabType;
|
|
83
|
+
selectedAccountId?: ID;
|
|
84
|
+
selectedDrawerAccountId?: ID;
|
|
85
|
+
reconTabsState: ReconciliationTabsState;
|
|
86
|
+
actionFetchState: ActionFetchStates;
|
|
87
|
+
}
|
|
88
|
+
export interface BankConnectionStatus {
|
|
89
|
+
status: BankStatusCodeType;
|
|
90
|
+
connectionInProgress: boolean;
|
|
91
|
+
paymentAccountId?: ID;
|
|
92
|
+
}
|
|
93
|
+
export interface AccountReconciliationRecords {
|
|
94
|
+
accountIDs: ID[];
|
|
95
|
+
reconciliationByAccountID: Record<ID, AccountReconciliationDataWithTransactionFetchState>;
|
|
96
|
+
}
|
|
97
|
+
export interface AccountReconciliationDataWithTransactionFetchState {
|
|
98
|
+
accountId: ID;
|
|
99
|
+
reconciliationId?: ID;
|
|
100
|
+
transactionFetchState: FetchStateAndError;
|
|
101
|
+
refreshStatus: FetchStateAndError;
|
|
102
|
+
}
|
|
103
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toReconciliationTabsType = exports.toReconcileActions = exports.RECONCILE_ACTIONS = void 0;
|
|
4
|
+
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
|
+
exports.RECONCILE_ACTIONS = [
|
|
6
|
+
'reconcile',
|
|
7
|
+
'save_reconcile_for_later',
|
|
8
|
+
'exclude',
|
|
9
|
+
];
|
|
10
|
+
const toReconcileActions = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.RECONCILE_ACTIONS);
|
|
11
|
+
exports.toReconcileActions = toReconcileActions;
|
|
12
|
+
const RECONCILIATION_VIEW_TABS = ['reconcile', 'review'];
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
|
+
const toReconciliationTabsType = (v) => (0, stringToUnion_1.stringToUnion)(v, RECONCILIATION_VIEW_TABS);
|
|
15
|
+
exports.toReconciliationTabsType = toReconciliationTabsType;
|
|
16
|
+
const RECON_RECONCILE_SORT_KEYS = [
|
|
17
|
+
'date',
|
|
18
|
+
'clearedDate',
|
|
19
|
+
'type',
|
|
20
|
+
'payee',
|
|
21
|
+
'account',
|
|
22
|
+
'transactionDirection',
|
|
23
|
+
'memo',
|
|
24
|
+
'amount',
|
|
25
|
+
'recommended',
|
|
26
|
+
];
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28
|
+
const toReconReconcileSortKeysType = (v) => (0, stringToUnion_1.stringToUnion)(v, RECON_RECONCILE_SORT_KEYS);
|
|
29
|
+
const RECON_REVIEW_SORT_KEYS = [
|
|
30
|
+
'date',
|
|
31
|
+
'payee',
|
|
32
|
+
'memo',
|
|
33
|
+
'amount',
|
|
34
|
+
'direction',
|
|
35
|
+
'match',
|
|
36
|
+
];
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38
|
+
const toReconReviewSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, RECON_REVIEW_SORT_KEYS);
|
|
@@ -60,16 +60,23 @@ export interface TransactionReviewLocalData {
|
|
|
60
60
|
lineItemById: Record<ID, TransactionCategorizationLineItemData>;
|
|
61
61
|
sortedLineItems: ID[];
|
|
62
62
|
vendor?: VendorBase;
|
|
63
|
+
customer?: CustomerBase;
|
|
63
64
|
memo?: string;
|
|
64
65
|
vendorDetails?: {
|
|
65
66
|
id: ID;
|
|
66
67
|
qboId: string;
|
|
67
68
|
name: string;
|
|
68
69
|
};
|
|
70
|
+
customerDetails?: {
|
|
71
|
+
id: ID;
|
|
72
|
+
qboId: string;
|
|
73
|
+
name: string;
|
|
74
|
+
};
|
|
69
75
|
transactionDate?: ZeniDate;
|
|
70
76
|
transactionType?: TransactionType;
|
|
71
77
|
transactionTypeName?: string;
|
|
72
78
|
vendorUpdates?: TransactionVendorUpdates;
|
|
79
|
+
customerUpdates?: TransactionVendorUpdates;
|
|
73
80
|
}
|
|
74
81
|
export interface SupportedTransactionCategorization {
|
|
75
82
|
transactionReviewLocalData: TransactionReviewLocalData;
|
|
@@ -103,6 +110,7 @@ export interface TransactionUpdates {
|
|
|
103
110
|
memo?: string;
|
|
104
111
|
updatesByLineId: Record<ID, TransactionLineUpdates>;
|
|
105
112
|
vendorId?: ID;
|
|
113
|
+
customerId?: ID;
|
|
106
114
|
}
|
|
107
115
|
export interface EntityRelatedRecommendationUpdates {
|
|
108
116
|
entityId: ID;
|
|
@@ -17,7 +17,7 @@ export declare const fetchFinanceStatement: import("@reduxjs/toolkit").ActionCre
|
|
|
17
17
|
thisPeriod: TimeframeTick;
|
|
18
18
|
coaBalances: COABalance[];
|
|
19
19
|
maxNumOfPeriodsToHighlight: number;
|
|
20
|
-
}, "financeStatement/updateFinanceStatementThisPeriod">, updateCOABalancesRange: import("@reduxjs/toolkit").ActionCreatorWithPayload<COABalancesRange, "financeStatement/updateCOABalancesRange">, updateSelectedReportId: import("@reduxjs/toolkit").ActionCreatorWithPayload<"billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense", "financeStatement/updateSelectedReportId">, updateFinanceStatementAdditionalBalancesSelection: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
20
|
+
}, "financeStatement/updateFinanceStatementThisPeriod">, updateCOABalancesRange: import("@reduxjs/toolkit").ActionCreatorWithPayload<COABalancesRange, "financeStatement/updateCOABalancesRange">, updateSelectedReportId: import("@reduxjs/toolkit").ActionCreatorWithPayload<"billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense" | "account_reconciliation", "financeStatement/updateSelectedReportId">, updateFinanceStatementAdditionalBalancesSelection: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
21
21
|
firstMonthOfFY: Month;
|
|
22
22
|
isCompareModeOn: boolean;
|
|
23
23
|
additionalBalances: COABalanceType[];
|
|
@@ -3,9 +3,9 @@ import { ZeniAPIStatus } from '../../responsePayload';
|
|
|
3
3
|
import { VendorReviewViewAllRecommendationsPayload } from '../vendorReviewView/common/payload/commonTypes';
|
|
4
4
|
import { GlobalMerchantViewState, GlobalRecommendationFetchSource, NewGlobalMerchantCurrentSelection } from './globalMerchantViewState';
|
|
5
5
|
export declare const initialState: GlobalMerchantViewState;
|
|
6
|
-
export declare const createGlobalMerchant: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[merchantId?: string | undefined, context?: "billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense" | undefined], {
|
|
6
|
+
export declare const createGlobalMerchant: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[merchantId?: string | undefined, context?: "billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense" | "account_reconciliation" | undefined], {
|
|
7
7
|
merchantId: string | undefined;
|
|
8
|
-
context: "billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense" | undefined;
|
|
8
|
+
context: "billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense" | "account_reconciliation" | undefined;
|
|
9
9
|
}, "globalMerchantView/createGlobalMerchant", never, never>, createGlobalMerchantSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
10
|
merchantId: ID;
|
|
11
11
|
}, "globalMerchantView/createGlobalMerchantSuccess">, createGlobalMerchantFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../reducer';
|
|
2
2
|
export declare const getReimbursementCardReport: (state: RootState) => {
|
|
3
|
-
reportId: "billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense";
|
|
3
|
+
reportId: "billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense" | "account_reconciliation";
|
|
4
4
|
reportTitle: string;
|
|
5
5
|
version: string | number | undefined;
|
|
6
6
|
fetchState: import("../..").FetchState;
|
|
@@ -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) => "all" | "new" | "completed" | "ongoing";
|
|
9
9
|
export type ScheduleSubTabType = ReturnType<typeof toScheduleSubTabType>;
|
|
10
|
-
declare const toScheduleSortKeyType: (v: string) => "status" | "user" | "months" | "class" | "vendor" | "amount" | "createTime" | "balanceAsOfToday" | "memo" | "assetId" | "
|
|
10
|
+
declare const toScheduleSortKeyType: (v: string) => "status" | "user" | "months" | "class" | "vendor" | "amount" | "createTime" | "balanceAsOfToday" | "memo" | "assetId" | "transactionDate" | "transactionType" | "accruedExpenseCategory" | "scheduleCategory" | "expenseCategory" | "accumulatedDepreciationCategory" | "startMonth" | "endMonth";
|
|
11
11
|
export declare type ScheduleListSortKey = ReturnType<typeof toScheduleSortKeyType>;
|
|
12
12
|
export interface DownloadJEScheduleTabOptions {
|
|
13
13
|
timezone: string;
|
package/lib/view/spendManagement/billPay/billsBulkActionView/epics/validateBillsBulkActionEpic.ts.js
CHANGED
|
@@ -8,11 +8,12 @@ const billsBulkActionViewReducer_1 = require("../billsBulkActionViewReducer");
|
|
|
8
8
|
const validateBillsBulkActionEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billsBulkActionViewReducer_1.validateBillsBulkAction.match), (0, operators_1.mergeMap)(() => {
|
|
9
9
|
const { billsBulkActionViewState } = state$.value;
|
|
10
10
|
const { billsSelectedForBulkAction: transactionIds, bulkOperationTypeSelected, } = billsBulkActionViewState;
|
|
11
|
+
const validationValue = bulkOperationTypeSelected === 'send_for_approval'
|
|
12
|
+
? 'all'
|
|
13
|
+
: 'sufficient_funds';
|
|
11
14
|
const queryParam = {
|
|
12
15
|
entity_ids: transactionIds,
|
|
13
|
-
validations:
|
|
14
|
-
? 'all'
|
|
15
|
-
: 'sufficient_funds',
|
|
16
|
+
validations: [validationValue],
|
|
16
17
|
};
|
|
17
18
|
return zeniAPI
|
|
18
19
|
.getJSON(`${zeniAPI.apiEndPoints.spendManagementMicroServiceBaseUrl}/1.0/bulk/bills/transactions/validate?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js
CHANGED
|
@@ -14,14 +14,16 @@ const paymentAccountListReducer_1 = require("../../../zeniAccounts/paymentAccoun
|
|
|
14
14
|
const plaidAccountViewReducer_1 = require("../../plaidAccountViewReducer");
|
|
15
15
|
const establishPlaidConnectionEpic = (actions$, state, zeniAPI) => actions$.pipe((0, operators_1.filter)(plaidAccountViewReducer_1.establishPlaidConnection.match), (0, operators_1.mergeMap)((action) => {
|
|
16
16
|
var _a, _b;
|
|
17
|
-
const { publicToken, companyId, setupViewType, linkTokenType, plaidAccountKeyType, } = action.payload;
|
|
17
|
+
const { publicToken, companyId, setupViewType, linkTokenType, plaidAccountKeyType, zeniMappedAccountId, } = action.payload;
|
|
18
18
|
const requestPayload = {
|
|
19
19
|
public_token: publicToken,
|
|
20
20
|
};
|
|
21
|
+
const queryPayload = {};
|
|
21
22
|
const userId = (_b = (_a = state.value.tenantState.loggedInUser) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : '';
|
|
22
23
|
//setupViewType not passed means this is a user account
|
|
23
24
|
if (linkTokenType !== 'link_external_account') {
|
|
24
|
-
if (setupViewType == null
|
|
25
|
+
if (setupViewType == null &&
|
|
26
|
+
plaidAccountKeyType !== 'expense_automation_reconcile') {
|
|
25
27
|
requestPayload.is_user_account = true;
|
|
26
28
|
}
|
|
27
29
|
else if (plaidAccountKeyType === 'bill_pay_setup') {
|
|
@@ -39,9 +41,15 @@ const establishPlaidConnectionEpic = (actions$, state, zeniAPI) => actions$.pipe
|
|
|
39
41
|
else if (plaidAccountKeyType === 'billing_setup') {
|
|
40
42
|
requestPayload.is_primary_for_onboarding = true;
|
|
41
43
|
}
|
|
44
|
+
else if (plaidAccountKeyType === 'expense_automation_reconcile') {
|
|
45
|
+
queryPayload.zeni_mapped_account_id = zeniMappedAccountId !== null && zeniMappedAccountId !== void 0 ? zeniMappedAccountId : '';
|
|
46
|
+
}
|
|
42
47
|
}
|
|
48
|
+
const queryString = Object.entries(queryPayload).length > 0
|
|
49
|
+
? `?query=${JSON.stringify(queryPayload)}`
|
|
50
|
+
: '';
|
|
43
51
|
return zeniAPI
|
|
44
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/plaid/public-token`, requestPayload)
|
|
52
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/plaid/public-token${queryString}`, requestPayload)
|
|
45
53
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
46
54
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
47
55
|
const paymentAccount = response.data.payment_accounts[0];
|
|
@@ -61,12 +61,13 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
|
|
|
61
61
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
62
62
|
linkTokenType: PlaidLinkTokenType;
|
|
63
63
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
64
|
-
}, "plaidAccountView/getPlaidLinkTokenFailure", never, never>, establishPlaidConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[publicToken: string, companyId: string, plaidAccountKeyType: PlaidAccountKeyType, setupViewType?: "billing" | "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | undefined, linkTokenType?: PlaidLinkTokenType | undefined], {
|
|
64
|
+
}, "plaidAccountView/getPlaidLinkTokenFailure", never, never>, establishPlaidConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[publicToken: string, companyId: string, plaidAccountKeyType: PlaidAccountKeyType, setupViewType?: "billing" | "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | undefined, linkTokenType?: PlaidLinkTokenType | undefined, zeniMappedAccountId?: string | undefined], {
|
|
65
65
|
publicToken: string;
|
|
66
66
|
companyId: string;
|
|
67
67
|
setupViewType: "billing" | "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | undefined;
|
|
68
68
|
linkTokenType: PlaidLinkTokenType;
|
|
69
69
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
70
|
+
zeniMappedAccountId: string | undefined;
|
|
70
71
|
}, "plaidAccountView/establishPlaidConnection", never, never>, establishPlaidConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
71
72
|
linkTokenType: PlaidLinkTokenType;
|
|
72
73
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
@@ -14,6 +14,7 @@ exports.initialState = {
|
|
|
14
14
|
user_reimbursement_account: plaidAccountViewState_1.initialPlaidAccountState,
|
|
15
15
|
external_account: plaidAccountViewState_1.initialPlaidAccountState,
|
|
16
16
|
billing_setup: plaidAccountViewState_1.initialPlaidAccountState,
|
|
17
|
+
expense_automation_reconcile: plaidAccountViewState_1.initialPlaidAccountState,
|
|
17
18
|
};
|
|
18
19
|
const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
19
20
|
name: 'plaidAccountView',
|
|
@@ -264,7 +265,7 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
264
265
|
error: undefined,
|
|
265
266
|
} });
|
|
266
267
|
},
|
|
267
|
-
prepare(publicToken, companyId, plaidAccountKeyType, setupViewType, linkTokenType) {
|
|
268
|
+
prepare(publicToken, companyId, plaidAccountKeyType, setupViewType, linkTokenType, zeniMappedAccountId) {
|
|
268
269
|
return {
|
|
269
270
|
payload: {
|
|
270
271
|
publicToken,
|
|
@@ -272,6 +273,7 @@ const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
|
272
273
|
setupViewType,
|
|
273
274
|
linkTokenType: linkTokenType !== null && linkTokenType !== void 0 ? linkTokenType : 'link_account',
|
|
274
275
|
plaidAccountKeyType,
|
|
276
|
+
zeniMappedAccountId,
|
|
275
277
|
},
|
|
276
278
|
};
|
|
277
279
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
3
3
|
export type PlaidLinkTokenType = 'link_account' | 'update_account' | 'link_account_no_microdeposit' | 'link_external_account';
|
|
4
|
-
export type PlaidAccountKeyType = 'spend_management_setup' | 'bill_pay_setup' | 'reimbursement_setup' | 'account_setup' | 'charge_card_setup' | 'user_reimbursement_account' | 'external_account' | 'billing_setup';
|
|
4
|
+
export type PlaidAccountKeyType = 'spend_management_setup' | 'bill_pay_setup' | 'reimbursement_setup' | 'account_setup' | 'charge_card_setup' | 'user_reimbursement_account' | 'external_account' | 'billing_setup' | 'expense_automation_reconcile';
|
|
5
5
|
export type PlaidConnectionDetails = Record<PlaidLinkTokenType, {
|
|
6
6
|
linkToken?: string;
|
|
7
7
|
expiration?: ZeniDate;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../reducer';
|
|
2
2
|
export declare const getTasksCardReport: (state: RootState) => {
|
|
3
|
-
reportId: "billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense";
|
|
3
|
+
reportId: "billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense" | "account_reconciliation";
|
|
4
4
|
reportTitle: string;
|
|
5
5
|
version: string | number | undefined;
|
|
6
6
|
status: import("../..").Status | undefined;
|
|
@@ -4,7 +4,7 @@ import { RootState } from '../../reducer';
|
|
|
4
4
|
import { TopExReport, TopExTimePeriodWithMetaData } from './topExSelectorTypes';
|
|
5
5
|
import { TopExState } from './topExState';
|
|
6
6
|
export declare const getTopExpenses: (accountState: AccountState, topExState: TopExState, numberOfExpenses?: number) => {
|
|
7
|
-
reportId: "billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense";
|
|
7
|
+
reportId: "billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense" | "account_reconciliation";
|
|
8
8
|
reportTitle: string;
|
|
9
9
|
version: string | number | undefined;
|
|
10
10
|
status: import("../..").Status | undefined;
|