@zeniai/client-epic-state 5.2.35-beta0MM → 5.2.35-beta11MM
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/entity/actualMatching/actualMatchingPayload.d.ts +7 -1
- package/lib/entity/actualMatching/actualMatchingPayload.js +19 -12
- package/lib/entity/actualMatching/actualMatchingReducer.d.ts +3 -2
- package/lib/entity/actualMatching/actualMatchingReducer.js +3 -3
- package/lib/entity/actualMatching/actualMatchingState.d.ts +3 -2
- package/lib/entity/aiCfo/aiCfoReducer.js +78 -4
- package/lib/entity/aiCfo/aiCfoState.d.ts +16 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +2 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +4 -0
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +2 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/esm/entity/actualMatching/actualMatchingPayload.js +18 -12
- package/lib/esm/entity/actualMatching/actualMatchingReducer.js +3 -3
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +79 -5
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +4 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/esm/index.js +6 -6
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +3 -5
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingMatchEpic.js +3 -2
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +80 -25
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/refreshActualMatchingList.js +16 -0
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +16 -6
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +12 -11
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/undoReversalAccrualsEpic.js +50 -26
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +5 -9
- package/lib/esm/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +1 -9
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +13 -3
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +34 -16
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +8 -8
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewReducer.js +2 -1
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +5 -2
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewState.js +4 -2
- package/lib/esm/view/expenseAutomationView/payload/actualMatchingPayload.js +10 -10
- package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +107 -20
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -1
- package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +206 -61
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +1 -0
- package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +3 -0
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +3 -0
- package/lib/esm/view/financeStatement/financeStatementReducer.js +17 -27
- package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +3 -3
- package/lib/index.d.ts +7 -6
- package/lib/index.js +52 -48
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +3 -5
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingMatchEpic.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingMatchEpic.js +3 -2
- package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +77 -22
- package/lib/view/expenseAutomationView/epics/actualMatching/refreshActualMatchingList.d.ts +3 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/refreshActualMatchingList.js +19 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.d.ts +3 -2
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +15 -5
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +10 -9
- package/lib/view/expenseAutomationView/epics/actualMatching/undoReversalAccrualsEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/actualMatching/undoReversalAccrualsEpic.js +48 -24
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +1 -2
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +5 -9
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +1 -2
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +1 -9
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +13 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.d.ts +5 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +33 -15
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +1 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +8 -8
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +2 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +5 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +2 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewState.js +6 -3
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +3 -3
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.js +10 -10
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +21 -16
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +107 -20
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -1
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -1
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +13 -9
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +9 -0
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +11 -2
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +209 -60
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +1 -0
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +8 -2
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +4 -0
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +3 -0
- package/lib/view/financeStatement/financeStatementReducer.js +17 -27
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +2 -2
- package/package.json +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.updateActualMatchingUIState = exports.undoReversalAccrualsSuccess = exports.undoReversalAccrualsFailure = exports.undoReversalAccruals = exports.searchMatchTransactionsSuccess = exports.searchMatchTransactionsFailure = exports.searchMatchTransactions = exports.searchMatchAccrualsSuccess = exports.searchMatchAccrualsFailure = exports.searchMatchAccruals = exports.openMatchNewModal = exports.matchAndReverseAccrualsSuccess = exports.matchAndReverseAccrualsFailure = exports.matchAndReverseAccruals = exports.fetchActualMatchingSuccess = exports.fetchActualMatchingPage = exports.fetchActualMatchingMatchSuccess = exports.fetchActualMatchingMatchFailure = exports.fetchActualMatchingMatch = exports.fetchActualMatchingFailure = exports.fetchActualMatching = exports.closeMatchNewModal = exports.clearMatchNewModal = exports.clearActualMatchingView = exports.initialState = exports.initialMatchModalState = exports.initialAccrualSearchState = exports.initialTransactionSearchState = void 0;
|
|
4
|
+
exports.updateActualMatchingUIState = exports.undoReversalAccrualsSuccess = exports.undoReversalAccrualsFailure = exports.undoReversalAccruals = exports.searchMatchTransactionsSuccess = exports.searchMatchTransactionsFailure = exports.searchMatchTransactions = exports.searchMatchAccrualsSuccess = exports.searchMatchAccrualsFailure = exports.searchMatchAccruals = exports.openMatchNewModal = exports.matchAndReverseAccrualsSuccess = exports.matchAndReverseAccrualsFailure = exports.matchAndReverseAccruals = exports.fetchActualMatchingSuccess = exports.fetchActualMatchingPage = exports.fetchActualMatchingMatchSuccess = exports.fetchActualMatchingMatchFailure = exports.fetchActualMatchingMatch = exports.fetchActualMatchingFailure = exports.fetchActualMatching = exports.closeMatchNewModal = exports.clearMatchNewModal = exports.clearActualMatchingView = exports.ackCloseMatchAfterUndo = exports.initialState = exports.initialMatchModalState = exports.initialAccrualSearchState = exports.initialTransactionSearchState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
7
7
|
const jeScheduleHelper_1 = require("../../../entity/jeSchedules/jeScheduleHelper");
|
|
8
8
|
const rootActions_1 = require("../../../rootActions");
|
|
9
|
+
const actualMatchingViewState_1 = require("../types/actualMatchingViewState");
|
|
9
10
|
exports.initialTransactionSearchState = {
|
|
10
11
|
query: '',
|
|
11
12
|
results: [],
|
|
@@ -25,6 +26,7 @@ exports.initialAccrualSearchState = {
|
|
|
25
26
|
exports.initialMatchModalState = {
|
|
26
27
|
isOpen: false,
|
|
27
28
|
openedFromMatchId: undefined,
|
|
29
|
+
didPinPrefillTransactions: false,
|
|
28
30
|
pinnedTransactionResults: [],
|
|
29
31
|
transactionSearch: exports.initialTransactionSearchState,
|
|
30
32
|
accrualSearch: exports.initialAccrualSearchState,
|
|
@@ -47,11 +49,48 @@ exports.initialState = {
|
|
|
47
49
|
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
48
50
|
},
|
|
49
51
|
matchModal: exports.initialMatchModalState,
|
|
50
|
-
|
|
52
|
+
undoReversalStatusByMatchId: {},
|
|
53
|
+
closeMatchAfterUndo: false,
|
|
54
|
+
lastMatchResultsByMatchId: {},
|
|
55
|
+
lastUndoResultsByMatchId: {},
|
|
51
56
|
hasValidState() {
|
|
52
57
|
return this.fetchState == 'Completed';
|
|
53
58
|
},
|
|
54
59
|
};
|
|
60
|
+
function pruneLastMatchResultsForUndone(draft, matchId, results) {
|
|
61
|
+
const undoneIds = new Set(results
|
|
62
|
+
.filter((result) => result.status === 'undone')
|
|
63
|
+
.map((result) => result.accrualId));
|
|
64
|
+
if (undoneIds.size === 0) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const existing = draft.lastMatchResultsByMatchId[matchId];
|
|
68
|
+
if (existing == null) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const kept = existing.filter((result) => !undoneIds.has(result.accrualId));
|
|
72
|
+
if (kept.length === 0) {
|
|
73
|
+
delete draft.lastMatchResultsByMatchId[matchId];
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
draft.lastMatchResultsByMatchId[matchId] = kept;
|
|
77
|
+
}
|
|
78
|
+
function pruneLastUndoResultsForMatched(draft, matchId, results) {
|
|
79
|
+
const matchedIds = new Set(results.map((result) => result.accrualId));
|
|
80
|
+
if (matchedIds.size === 0) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const existing = draft.lastUndoResultsByMatchId[matchId];
|
|
84
|
+
if (existing == null) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const kept = existing.filter((result) => !matchedIds.has(result.accrualId));
|
|
88
|
+
if (kept.length === 0) {
|
|
89
|
+
delete draft.lastUndoResultsByMatchId[matchId];
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
draft.lastUndoResultsByMatchId[matchId] = kept;
|
|
93
|
+
}
|
|
55
94
|
function resetMatchModalSearches(draft) {
|
|
56
95
|
draft.matchModal.transactionSearch = exports.initialTransactionSearchState;
|
|
57
96
|
draft.matchModal.accrualSearch = exports.initialAccrualSearchState;
|
|
@@ -61,6 +100,7 @@ function resetMatchModalSearches(draft) {
|
|
|
61
100
|
};
|
|
62
101
|
draft.matchModal.lastBatchResults = undefined;
|
|
63
102
|
draft.matchModal.openedFromMatchId = undefined;
|
|
103
|
+
draft.matchModal.didPinPrefillTransactions = false;
|
|
64
104
|
draft.matchModal.pinnedTransactionResults = [];
|
|
65
105
|
}
|
|
66
106
|
const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
@@ -85,6 +125,9 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
85
125
|
const { refreshViewInBackground } = action.payload;
|
|
86
126
|
if (refreshViewInBackground) {
|
|
87
127
|
draft.refreshStatus = { fetchState: 'In-Progress', error: undefined };
|
|
128
|
+
if (draft.fetchState === 'Not-Started') {
|
|
129
|
+
draft.fetchState = 'In-Progress';
|
|
130
|
+
}
|
|
88
131
|
}
|
|
89
132
|
else {
|
|
90
133
|
draft.fetchState = 'In-Progress';
|
|
@@ -106,6 +149,10 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
106
149
|
draft.matchIdsByPeriod[periodId] = matchIds;
|
|
107
150
|
if (refreshViewInBackground) {
|
|
108
151
|
draft.refreshStatus = { fetchState: 'Completed', error: undefined };
|
|
152
|
+
if (draft.fetchState !== 'Completed') {
|
|
153
|
+
draft.fetchState = 'Completed';
|
|
154
|
+
draft.error = undefined;
|
|
155
|
+
}
|
|
109
156
|
}
|
|
110
157
|
else {
|
|
111
158
|
draft.fetchState = 'Completed';
|
|
@@ -116,6 +163,10 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
116
163
|
const { status, refreshViewInBackground } = action.payload;
|
|
117
164
|
if (refreshViewInBackground) {
|
|
118
165
|
draft.refreshStatus = { fetchState: 'Error', error: status };
|
|
166
|
+
if (draft.fetchState !== 'Completed') {
|
|
167
|
+
draft.fetchState = 'Error';
|
|
168
|
+
draft.error = status;
|
|
169
|
+
}
|
|
119
170
|
}
|
|
120
171
|
else {
|
|
121
172
|
draft.fetchState = 'Error';
|
|
@@ -201,10 +252,13 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
201
252
|
}
|
|
202
253
|
},
|
|
203
254
|
},
|
|
255
|
+
// Dismiss (Cancel / overlay). Store reset matches `clearMatchNewModal`;
|
|
256
|
+
// the actions stay distinct so confirm-success vs user-dismiss stay observable.
|
|
204
257
|
closeMatchNewModal(draft) {
|
|
205
258
|
draft.matchModal.isOpen = false;
|
|
206
259
|
resetMatchModalSearches(draft);
|
|
207
260
|
},
|
|
261
|
+
// Confirm-success / host reset. Same slice write as close; different action type.
|
|
208
262
|
clearMatchNewModal(draft) {
|
|
209
263
|
draft.matchModal.isOpen = false;
|
|
210
264
|
resetMatchModalSearches(draft);
|
|
@@ -225,7 +279,7 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
225
279
|
draft.matchModal.transactionSearch.error = undefined;
|
|
226
280
|
}
|
|
227
281
|
},
|
|
228
|
-
prepare(
|
|
282
|
+
prepare(query, pageToken, transactionType, transactionIntegrationId) {
|
|
229
283
|
return {
|
|
230
284
|
payload: {
|
|
231
285
|
query,
|
|
@@ -244,7 +298,7 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
244
298
|
...results,
|
|
245
299
|
];
|
|
246
300
|
const byKey = new Map(merged.map((result) => [
|
|
247
|
-
|
|
301
|
+
(0, actualMatchingViewState_1.actualMatchingTransactionLineKey)(result.transactionType, result.transactionIntegrationId, result.lineId),
|
|
248
302
|
result,
|
|
249
303
|
]));
|
|
250
304
|
draft.matchModal.transactionSearch.results = Array.from(byKey.values());
|
|
@@ -252,7 +306,8 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
252
306
|
else {
|
|
253
307
|
draft.matchModal.transactionSearch.results = results;
|
|
254
308
|
if (draft.matchModal.openedFromMatchId != null &&
|
|
255
|
-
draft.matchModal.
|
|
309
|
+
!draft.matchModal.didPinPrefillTransactions) {
|
|
310
|
+
draft.matchModal.didPinPrefillTransactions = true;
|
|
256
311
|
draft.matchModal.pinnedTransactionResults = results;
|
|
257
312
|
}
|
|
258
313
|
}
|
|
@@ -282,7 +337,7 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
282
337
|
draft.matchModal.accrualSearch.error = undefined;
|
|
283
338
|
}
|
|
284
339
|
},
|
|
285
|
-
prepare(
|
|
340
|
+
prepare(query, pageToken) {
|
|
286
341
|
return { payload: { query, pageToken: pageToken ?? undefined } };
|
|
287
342
|
},
|
|
288
343
|
},
|
|
@@ -313,8 +368,17 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
313
368
|
error: undefined,
|
|
314
369
|
};
|
|
315
370
|
},
|
|
316
|
-
prepare(
|
|
317
|
-
return {
|
|
371
|
+
prepare(transactionId, transactionIntegrationId, transactionType, lineIds, transactionSyncToken, accrualIds) {
|
|
372
|
+
return {
|
|
373
|
+
payload: {
|
|
374
|
+
transactionId,
|
|
375
|
+
transactionIntegrationId,
|
|
376
|
+
transactionType,
|
|
377
|
+
lineIds,
|
|
378
|
+
transactionSyncToken,
|
|
379
|
+
accrualIds,
|
|
380
|
+
},
|
|
381
|
+
};
|
|
318
382
|
},
|
|
319
383
|
},
|
|
320
384
|
matchAndReverseAccrualsSuccess(draft, action) {
|
|
@@ -323,6 +387,11 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
323
387
|
error: undefined,
|
|
324
388
|
};
|
|
325
389
|
draft.matchModal.lastBatchResults = action.payload.results;
|
|
390
|
+
if (action.payload.matchId != null) {
|
|
391
|
+
draft.lastMatchResultsByMatchId[action.payload.matchId] =
|
|
392
|
+
action.payload.results;
|
|
393
|
+
pruneLastUndoResultsForMatched(draft, action.payload.matchId, action.payload.results);
|
|
394
|
+
}
|
|
326
395
|
},
|
|
327
396
|
matchAndReverseAccrualsFailure(draft, action) {
|
|
328
397
|
draft.matchModal.confirmStatus = {
|
|
@@ -331,25 +400,43 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
331
400
|
};
|
|
332
401
|
},
|
|
333
402
|
undoReversalAccruals: {
|
|
334
|
-
reducer(draft) {
|
|
335
|
-
draft.
|
|
403
|
+
reducer(draft, action) {
|
|
404
|
+
draft.undoReversalStatusByMatchId[action.payload.matchId] = {
|
|
336
405
|
fetchState: 'In-Progress',
|
|
337
406
|
error: undefined,
|
|
338
407
|
};
|
|
339
408
|
},
|
|
340
|
-
prepare(
|
|
341
|
-
return { payload:
|
|
409
|
+
prepare(matchId, accrualIds) {
|
|
410
|
+
return { payload: { matchId, accrualIds } };
|
|
342
411
|
},
|
|
343
412
|
},
|
|
344
|
-
undoReversalAccrualsSuccess
|
|
345
|
-
draft
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
413
|
+
undoReversalAccrualsSuccess: {
|
|
414
|
+
reducer(draft, action) {
|
|
415
|
+
const { matchId, results } = action.payload;
|
|
416
|
+
draft.undoReversalStatusByMatchId[matchId] = {
|
|
417
|
+
fetchState: 'Completed',
|
|
418
|
+
error: undefined,
|
|
419
|
+
};
|
|
420
|
+
const allUndone = results.length > 0 &&
|
|
421
|
+
results.every((result) => result.status === 'undone');
|
|
422
|
+
draft.closeMatchAfterUndo = allUndone;
|
|
423
|
+
pruneLastMatchResultsForUndone(draft, matchId, results);
|
|
424
|
+
if (allUndone) {
|
|
425
|
+
delete draft.lastUndoResultsByMatchId[matchId];
|
|
426
|
+
}
|
|
427
|
+
else {
|
|
428
|
+
draft.lastUndoResultsByMatchId[matchId] = results;
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
prepare(matchId, results) {
|
|
432
|
+
return { payload: { matchId, results } };
|
|
433
|
+
},
|
|
434
|
+
},
|
|
435
|
+
ackCloseMatchAfterUndo(draft) {
|
|
436
|
+
draft.closeMatchAfterUndo = false;
|
|
350
437
|
},
|
|
351
438
|
undoReversalAccrualsFailure(draft, action) {
|
|
352
|
-
draft.
|
|
439
|
+
draft.undoReversalStatusByMatchId[action.payload.matchId] = {
|
|
353
440
|
fetchState: 'Error',
|
|
354
441
|
error: action.payload.status,
|
|
355
442
|
};
|
|
@@ -364,5 +451,5 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
364
451
|
});
|
|
365
452
|
},
|
|
366
453
|
});
|
|
367
|
-
_a = expenseAutomationActualMatchingView.actions, exports.clearActualMatchingView = _a.clearActualMatchingView, exports.clearMatchNewModal = _a.clearMatchNewModal, exports.closeMatchNewModal = _a.closeMatchNewModal, exports.fetchActualMatching = _a.fetchActualMatching, exports.fetchActualMatchingFailure = _a.fetchActualMatchingFailure, exports.fetchActualMatchingMatch = _a.fetchActualMatchingMatch, exports.fetchActualMatchingMatchFailure = _a.fetchActualMatchingMatchFailure, exports.fetchActualMatchingMatchSuccess = _a.fetchActualMatchingMatchSuccess, exports.fetchActualMatchingPage = _a.fetchActualMatchingPage, exports.fetchActualMatchingSuccess = _a.fetchActualMatchingSuccess, exports.matchAndReverseAccruals = _a.matchAndReverseAccruals, exports.matchAndReverseAccrualsFailure = _a.matchAndReverseAccrualsFailure, exports.matchAndReverseAccrualsSuccess = _a.matchAndReverseAccrualsSuccess, exports.openMatchNewModal = _a.openMatchNewModal, exports.searchMatchAccruals = _a.searchMatchAccruals, exports.searchMatchAccrualsFailure = _a.searchMatchAccrualsFailure, exports.searchMatchAccrualsSuccess = _a.searchMatchAccrualsSuccess, exports.searchMatchTransactions = _a.searchMatchTransactions, exports.searchMatchTransactionsFailure = _a.searchMatchTransactionsFailure, exports.searchMatchTransactionsSuccess = _a.searchMatchTransactionsSuccess, exports.undoReversalAccruals = _a.undoReversalAccruals, exports.undoReversalAccrualsFailure = _a.undoReversalAccrualsFailure, exports.undoReversalAccrualsSuccess = _a.undoReversalAccrualsSuccess, exports.updateActualMatchingUIState = _a.updateActualMatchingUIState;
|
|
454
|
+
_a = expenseAutomationActualMatchingView.actions, exports.ackCloseMatchAfterUndo = _a.ackCloseMatchAfterUndo, exports.clearActualMatchingView = _a.clearActualMatchingView, exports.clearMatchNewModal = _a.clearMatchNewModal, exports.closeMatchNewModal = _a.closeMatchNewModal, exports.fetchActualMatching = _a.fetchActualMatching, exports.fetchActualMatchingFailure = _a.fetchActualMatchingFailure, exports.fetchActualMatchingMatch = _a.fetchActualMatchingMatch, exports.fetchActualMatchingMatchFailure = _a.fetchActualMatchingMatchFailure, exports.fetchActualMatchingMatchSuccess = _a.fetchActualMatchingMatchSuccess, exports.fetchActualMatchingPage = _a.fetchActualMatchingPage, exports.fetchActualMatchingSuccess = _a.fetchActualMatchingSuccess, exports.matchAndReverseAccruals = _a.matchAndReverseAccruals, exports.matchAndReverseAccrualsFailure = _a.matchAndReverseAccrualsFailure, exports.matchAndReverseAccrualsSuccess = _a.matchAndReverseAccrualsSuccess, exports.openMatchNewModal = _a.openMatchNewModal, exports.searchMatchAccruals = _a.searchMatchAccruals, exports.searchMatchAccrualsFailure = _a.searchMatchAccrualsFailure, exports.searchMatchAccrualsSuccess = _a.searchMatchAccrualsSuccess, exports.searchMatchTransactions = _a.searchMatchTransactions, exports.searchMatchTransactionsFailure = _a.searchMatchTransactionsFailure, exports.searchMatchTransactionsSuccess = _a.searchMatchTransactionsSuccess, exports.undoReversalAccruals = _a.undoReversalAccruals, exports.undoReversalAccrualsFailure = _a.undoReversalAccrualsFailure, exports.undoReversalAccrualsSuccess = _a.undoReversalAccrualsSuccess, exports.updateActualMatchingUIState = _a.updateActualMatchingUIState;
|
|
368
455
|
exports.default = expenseAutomationActualMatchingView.reducer;
|
|
@@ -51,9 +51,10 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
51
51
|
selectedPageTab: JEPageTab;
|
|
52
52
|
selectedPeriod: MonthYearPeriod;
|
|
53
53
|
status: ZeniAPIStatus;
|
|
54
|
-
}, "expenseAutomationJESchedulesView/fetchJeSchedulesFailure">, fetchJeSchedulesPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
|
|
54
|
+
}, "expenseAutomationJESchedulesView/fetchJeSchedulesFailure">, fetchJeSchedulesPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any, isAccrualEnabled?: any], {
|
|
55
55
|
period: TimePeriod;
|
|
56
56
|
refreshViewInBackground: any;
|
|
57
|
+
isAccrualEnabled: any;
|
|
57
58
|
}, "expenseAutomationJESchedulesView/fetchJeSchedulesPage", never, never>, fetchJeSchedulesSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
58
59
|
accruedJeSchedules: JEAccruedScheduledTransactionPayload[];
|
|
59
60
|
failedJeSchedules: JEScheduledTransactionPayload[];
|
|
@@ -111,11 +111,12 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
111
111
|
initialState: exports.initialState,
|
|
112
112
|
reducers: {
|
|
113
113
|
fetchJeSchedulesPage: {
|
|
114
|
-
prepare(period, refreshViewInBackground = false) {
|
|
114
|
+
prepare(period, refreshViewInBackground = false, isAccrualEnabled = false) {
|
|
115
115
|
return {
|
|
116
116
|
payload: {
|
|
117
117
|
period,
|
|
118
118
|
refreshViewInBackground,
|
|
119
|
+
isAccrualEnabled,
|
|
119
120
|
},
|
|
120
121
|
};
|
|
121
122
|
},
|
|
@@ -19,6 +19,8 @@ export interface ActualMatchingRow extends JEOneTimeAccrual {
|
|
|
19
19
|
matchId: string;
|
|
20
20
|
groupedAccrualIds?: ID[];
|
|
21
21
|
groupedMembers?: ActualMatchingGroupedAccrual[];
|
|
22
|
+
intendedAccrualIds?: ID[];
|
|
23
|
+
leftovers?: ActualMatchingGroupedAccrual[];
|
|
22
24
|
matchShape?: string;
|
|
23
25
|
matchTier?: string;
|
|
24
26
|
reversalDate?: ZeniDate;
|
|
@@ -26,23 +28,25 @@ export interface ActualMatchingRow extends JEOneTimeAccrual {
|
|
|
26
28
|
transactionType?: string;
|
|
27
29
|
}
|
|
28
30
|
export interface ActualMatchingKpiSummary {
|
|
29
|
-
|
|
31
|
+
actualsReceived: {
|
|
30
32
|
count: number;
|
|
33
|
+
expectedCount: number;
|
|
34
|
+
vendorsPending: number;
|
|
31
35
|
};
|
|
32
36
|
autoReversed: {
|
|
33
|
-
|
|
34
|
-
count: number;
|
|
35
|
-
};
|
|
36
|
-
manual: {
|
|
37
|
+
clearedAmount: number;
|
|
37
38
|
count: number;
|
|
39
|
+
percent: number;
|
|
38
40
|
};
|
|
39
41
|
pendingReview: {
|
|
40
42
|
amount: number;
|
|
41
43
|
count: number;
|
|
44
|
+
estimatedMinutesToClear: number;
|
|
42
45
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
variance: {
|
|
47
|
+
averagePercentPerMatch: number;
|
|
48
|
+
netAmount: number;
|
|
49
|
+
percent: number;
|
|
46
50
|
};
|
|
47
51
|
}
|
|
48
52
|
export interface ActualMatchingMatchModalView {
|
|
@@ -67,6 +71,7 @@ export interface ActualMatchingMatchModalView {
|
|
|
67
71
|
prefill?: {
|
|
68
72
|
selectedAccrualIds: ID[];
|
|
69
73
|
actualAmount?: number;
|
|
74
|
+
consumedLineIds?: ID[];
|
|
70
75
|
matchedLineId?: string;
|
|
71
76
|
matchedTransactionId?: string;
|
|
72
77
|
};
|
|
@@ -79,5 +84,4 @@ export interface ExpenseAutomationActualMatchingViewSelector extends SelectorVie
|
|
|
79
84
|
refreshStatus: FetchStateAndError;
|
|
80
85
|
reversed: ActualMatchingRow[];
|
|
81
86
|
uiState: ActualMatchingViewUIState;
|
|
82
|
-
undoReversalStatus?: FetchStateAndError;
|
|
83
87
|
}
|
package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts
CHANGED
|
@@ -22,6 +22,15 @@ export interface ExpenseAutomationStepDetails {
|
|
|
22
22
|
title: string;
|
|
23
23
|
}
|
|
24
24
|
export interface ExpenseAutomationViewSelector extends SelectorView {
|
|
25
|
+
/**
|
|
26
|
+
* Sibling of `jeSchedules`, not nested under it. The Journal Entries navbar
|
|
27
|
+
* hosts Actual Matching (`selectedPageTab === 'actual_matching'`), but AM is
|
|
28
|
+
* a different GET, entity map (`byMatchId`), and period cache
|
|
29
|
+
* (`matchIdsByPeriod`) than Review / Existing. Nesting it on `jeSchedules`
|
|
30
|
+
* would hide a second store inside the schedules selector. Chrome coupling
|
|
31
|
+
* stays `jeSchedules.uiState.selectedPageTab`; AM rows, Match New, and undo
|
|
32
|
+
* live here.
|
|
33
|
+
*/
|
|
25
34
|
actualMatching: ExpenseAutomationActualMatchingViewSelector;
|
|
26
35
|
allSteps: ExpenseAutomationStepDetails[];
|
|
27
36
|
completionStatus: CompletionStatusType;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { FetchStateAndError } from '../../../commonStateTypes/common';
|
|
2
|
+
import { MonthYearPeriod } from '../../../commonStateTypes/timePeriod';
|
|
3
|
+
import { DisplayCurrencyFallback } from '../../../entity/actualMatching/actualMatchingPayload';
|
|
2
4
|
import { ActualMatchingMatch } from '../../../entity/actualMatching/actualMatchingState';
|
|
3
5
|
import { ActualMatchingMatchId } from '../../../entity/actualMatching/actualMatchingTypes';
|
|
4
6
|
import { JEOneTimeAccrual } from '../../../entity/jeSchedules/jeSchedulesSelector';
|
|
5
7
|
import { JEOneTimeAccrualMatchSuggestion } from '../../../entity/jeSchedules/jeSchedulesState';
|
|
6
8
|
import { RootState } from '../../../rootStateTypes';
|
|
7
9
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
8
|
-
import { ActualMatchingRow, ActualMatchingRowKind, ExpenseAutomationActualMatchingViewSelector } from '../selectorTypes/actualMatchingViewSelectorTypes';
|
|
10
|
+
import { ActualMatchingKpiSummary, ActualMatchingRow, ActualMatchingRowKind, ExpenseAutomationActualMatchingViewSelector } from '../selectorTypes/actualMatchingViewSelectorTypes';
|
|
11
|
+
import { MatchAndReverseResult, UndoReversalResult } from '../types/actualMatchingViewState';
|
|
12
|
+
export declare function getSelectedMonthYearForCurrentTenant(state: RootState): MonthYearPeriod | undefined;
|
|
13
|
+
export declare function getTenantDisplayCurrency(state: RootState): DisplayCurrencyFallback | undefined;
|
|
9
14
|
export declare function parseActualMatchingMatchId(matchId: string): {
|
|
10
15
|
transactionIntegrationId: string;
|
|
11
16
|
transactionType: string;
|
|
@@ -18,12 +23,16 @@ export declare function isPendingReviewAccrual(accrual: JEOneTimeAccrual): accru
|
|
|
18
23
|
export declare function isReversedMatchKind(kind: ActualMatchingRowKind): boolean;
|
|
19
24
|
export declare function getClearedMatchedAmount(accrual: JEOneTimeAccrual): number | undefined;
|
|
20
25
|
export declare function getActualMatchingAmount(row: ActualMatchingRow): number;
|
|
21
|
-
export declare function getActualMatchingReversalDate(accrual: JEOneTimeAccrual): ZeniDate | undefined;
|
|
26
|
+
export declare function getActualMatchingReversalDate(accrual: JEOneTimeAccrual, matchTransactionDate?: string): ZeniDate | undefined;
|
|
27
|
+
export declare function buildActualMatchingKpiSummary(rows: ActualMatchingRow[], displayCurrencyCode?: string): ActualMatchingKpiSummary;
|
|
22
28
|
export interface ExpenseAutomationActualMatchingMatchView {
|
|
23
29
|
detailFetchState: FetchStateAndError;
|
|
24
30
|
refreshStatus: FetchStateAndError;
|
|
25
31
|
undoReversalStatus: FetchStateAndError;
|
|
32
|
+
lastMatchResults?: MatchAndReverseResult[];
|
|
33
|
+
lastUndoResults?: UndoReversalResult[];
|
|
26
34
|
match?: ActualMatchingMatch;
|
|
27
35
|
}
|
|
28
36
|
export declare function getExpenseAutomationActualMatchingMatchView(state: RootState, matchId: ActualMatchingMatchId): ExpenseAutomationActualMatchingMatchView;
|
|
37
|
+
export declare function getCloseMatchAfterUndo(state: RootState): boolean;
|
|
29
38
|
export declare function getExpenseAutomationActualMatchingView(state: RootState): ExpenseAutomationActualMatchingViewSelector;
|