@zeniai/client-epic-state 5.2.35-beta0MM → 5.2.35-beta10MM
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 +90 -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 +90 -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,32 @@ 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
|
+
}
|
|
55
78
|
function resetMatchModalSearches(draft) {
|
|
56
79
|
draft.matchModal.transactionSearch = exports.initialTransactionSearchState;
|
|
57
80
|
draft.matchModal.accrualSearch = exports.initialAccrualSearchState;
|
|
@@ -61,6 +84,7 @@ function resetMatchModalSearches(draft) {
|
|
|
61
84
|
};
|
|
62
85
|
draft.matchModal.lastBatchResults = undefined;
|
|
63
86
|
draft.matchModal.openedFromMatchId = undefined;
|
|
87
|
+
draft.matchModal.didPinPrefillTransactions = false;
|
|
64
88
|
draft.matchModal.pinnedTransactionResults = [];
|
|
65
89
|
}
|
|
66
90
|
const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
@@ -85,6 +109,9 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
85
109
|
const { refreshViewInBackground } = action.payload;
|
|
86
110
|
if (refreshViewInBackground) {
|
|
87
111
|
draft.refreshStatus = { fetchState: 'In-Progress', error: undefined };
|
|
112
|
+
if (draft.fetchState === 'Not-Started') {
|
|
113
|
+
draft.fetchState = 'In-Progress';
|
|
114
|
+
}
|
|
88
115
|
}
|
|
89
116
|
else {
|
|
90
117
|
draft.fetchState = 'In-Progress';
|
|
@@ -106,6 +133,10 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
106
133
|
draft.matchIdsByPeriod[periodId] = matchIds;
|
|
107
134
|
if (refreshViewInBackground) {
|
|
108
135
|
draft.refreshStatus = { fetchState: 'Completed', error: undefined };
|
|
136
|
+
if (draft.fetchState !== 'Completed') {
|
|
137
|
+
draft.fetchState = 'Completed';
|
|
138
|
+
draft.error = undefined;
|
|
139
|
+
}
|
|
109
140
|
}
|
|
110
141
|
else {
|
|
111
142
|
draft.fetchState = 'Completed';
|
|
@@ -116,6 +147,10 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
116
147
|
const { status, refreshViewInBackground } = action.payload;
|
|
117
148
|
if (refreshViewInBackground) {
|
|
118
149
|
draft.refreshStatus = { fetchState: 'Error', error: status };
|
|
150
|
+
if (draft.fetchState !== 'Completed') {
|
|
151
|
+
draft.fetchState = 'Error';
|
|
152
|
+
draft.error = status;
|
|
153
|
+
}
|
|
119
154
|
}
|
|
120
155
|
else {
|
|
121
156
|
draft.fetchState = 'Error';
|
|
@@ -201,10 +236,13 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
201
236
|
}
|
|
202
237
|
},
|
|
203
238
|
},
|
|
239
|
+
// Dismiss (Cancel / overlay). Store reset matches `clearMatchNewModal`;
|
|
240
|
+
// the actions stay distinct so confirm-success vs user-dismiss stay observable.
|
|
204
241
|
closeMatchNewModal(draft) {
|
|
205
242
|
draft.matchModal.isOpen = false;
|
|
206
243
|
resetMatchModalSearches(draft);
|
|
207
244
|
},
|
|
245
|
+
// Confirm-success / host reset. Same slice write as close; different action type.
|
|
208
246
|
clearMatchNewModal(draft) {
|
|
209
247
|
draft.matchModal.isOpen = false;
|
|
210
248
|
resetMatchModalSearches(draft);
|
|
@@ -225,7 +263,7 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
225
263
|
draft.matchModal.transactionSearch.error = undefined;
|
|
226
264
|
}
|
|
227
265
|
},
|
|
228
|
-
prepare(
|
|
266
|
+
prepare(query, pageToken, transactionType, transactionIntegrationId) {
|
|
229
267
|
return {
|
|
230
268
|
payload: {
|
|
231
269
|
query,
|
|
@@ -244,7 +282,7 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
244
282
|
...results,
|
|
245
283
|
];
|
|
246
284
|
const byKey = new Map(merged.map((result) => [
|
|
247
|
-
|
|
285
|
+
(0, actualMatchingViewState_1.actualMatchingTransactionLineKey)(result.transactionType, result.transactionIntegrationId, result.lineId),
|
|
248
286
|
result,
|
|
249
287
|
]));
|
|
250
288
|
draft.matchModal.transactionSearch.results = Array.from(byKey.values());
|
|
@@ -252,7 +290,8 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
252
290
|
else {
|
|
253
291
|
draft.matchModal.transactionSearch.results = results;
|
|
254
292
|
if (draft.matchModal.openedFromMatchId != null &&
|
|
255
|
-
draft.matchModal.
|
|
293
|
+
!draft.matchModal.didPinPrefillTransactions) {
|
|
294
|
+
draft.matchModal.didPinPrefillTransactions = true;
|
|
256
295
|
draft.matchModal.pinnedTransactionResults = results;
|
|
257
296
|
}
|
|
258
297
|
}
|
|
@@ -282,7 +321,7 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
282
321
|
draft.matchModal.accrualSearch.error = undefined;
|
|
283
322
|
}
|
|
284
323
|
},
|
|
285
|
-
prepare(
|
|
324
|
+
prepare(query, pageToken) {
|
|
286
325
|
return { payload: { query, pageToken: pageToken ?? undefined } };
|
|
287
326
|
},
|
|
288
327
|
},
|
|
@@ -313,8 +352,17 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
313
352
|
error: undefined,
|
|
314
353
|
};
|
|
315
354
|
},
|
|
316
|
-
prepare(
|
|
317
|
-
return {
|
|
355
|
+
prepare(transactionId, transactionIntegrationId, transactionType, lineIds, transactionSyncToken, accrualIds) {
|
|
356
|
+
return {
|
|
357
|
+
payload: {
|
|
358
|
+
transactionId,
|
|
359
|
+
transactionIntegrationId,
|
|
360
|
+
transactionType,
|
|
361
|
+
lineIds,
|
|
362
|
+
transactionSyncToken,
|
|
363
|
+
accrualIds,
|
|
364
|
+
},
|
|
365
|
+
};
|
|
318
366
|
},
|
|
319
367
|
},
|
|
320
368
|
matchAndReverseAccrualsSuccess(draft, action) {
|
|
@@ -323,6 +371,10 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
323
371
|
error: undefined,
|
|
324
372
|
};
|
|
325
373
|
draft.matchModal.lastBatchResults = action.payload.results;
|
|
374
|
+
if (action.payload.matchId != null) {
|
|
375
|
+
draft.lastMatchResultsByMatchId[action.payload.matchId] =
|
|
376
|
+
action.payload.results;
|
|
377
|
+
}
|
|
326
378
|
},
|
|
327
379
|
matchAndReverseAccrualsFailure(draft, action) {
|
|
328
380
|
draft.matchModal.confirmStatus = {
|
|
@@ -331,25 +383,43 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
331
383
|
};
|
|
332
384
|
},
|
|
333
385
|
undoReversalAccruals: {
|
|
334
|
-
reducer(draft) {
|
|
335
|
-
draft.
|
|
386
|
+
reducer(draft, action) {
|
|
387
|
+
draft.undoReversalStatusByMatchId[action.payload.matchId] = {
|
|
336
388
|
fetchState: 'In-Progress',
|
|
337
389
|
error: undefined,
|
|
338
390
|
};
|
|
339
391
|
},
|
|
340
|
-
prepare(
|
|
341
|
-
return { payload:
|
|
392
|
+
prepare(matchId, accrualIds) {
|
|
393
|
+
return { payload: { matchId, accrualIds } };
|
|
342
394
|
},
|
|
343
395
|
},
|
|
344
|
-
undoReversalAccrualsSuccess
|
|
345
|
-
draft
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
396
|
+
undoReversalAccrualsSuccess: {
|
|
397
|
+
reducer(draft, action) {
|
|
398
|
+
const { matchId, results } = action.payload;
|
|
399
|
+
draft.undoReversalStatusByMatchId[matchId] = {
|
|
400
|
+
fetchState: 'Completed',
|
|
401
|
+
error: undefined,
|
|
402
|
+
};
|
|
403
|
+
const allUndone = results.length > 0 &&
|
|
404
|
+
results.every((result) => result.status === 'undone');
|
|
405
|
+
draft.closeMatchAfterUndo = allUndone;
|
|
406
|
+
pruneLastMatchResultsForUndone(draft, matchId, results);
|
|
407
|
+
if (allUndone) {
|
|
408
|
+
delete draft.lastUndoResultsByMatchId[matchId];
|
|
409
|
+
}
|
|
410
|
+
else {
|
|
411
|
+
draft.lastUndoResultsByMatchId[matchId] = results;
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
prepare(matchId, results) {
|
|
415
|
+
return { payload: { matchId, results } };
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
ackCloseMatchAfterUndo(draft) {
|
|
419
|
+
draft.closeMatchAfterUndo = false;
|
|
350
420
|
},
|
|
351
421
|
undoReversalAccrualsFailure(draft, action) {
|
|
352
|
-
draft.
|
|
422
|
+
draft.undoReversalStatusByMatchId[action.payload.matchId] = {
|
|
353
423
|
fetchState: 'Error',
|
|
354
424
|
error: action.payload.status,
|
|
355
425
|
};
|
|
@@ -364,5 +434,5 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
|
|
|
364
434
|
});
|
|
365
435
|
},
|
|
366
436
|
});
|
|
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;
|
|
437
|
+
_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
438
|
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;
|