@zeniai/client-epic-state 5.0.16-betaSS1 → 5.0.16
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/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +6 -26
- package/lib/esm/view/scheduleView/scheduleListView/scheduleListSelector.js +2 -7
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +0 -1
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +5 -25
- package/lib/view/scheduleView/scheduleListView/scheduleListSelector.js +2 -7
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import omit from 'lodash/omit';
|
|
2
2
|
import orderBy from 'lodash/orderBy';
|
|
3
3
|
import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
|
|
4
|
-
import {
|
|
4
|
+
import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
5
5
|
import { getAccountIdsForTypes } from '../../../entity/account/accountSelector';
|
|
6
6
|
import { getJEScheduledTransactionByJEScheduleTransactionKey, } from '../../../entity/jeSchedules/jeSchedulesSelector';
|
|
7
7
|
import { getCurrentTenant } from '../../../entity/tenant/tenantSelector';
|
|
@@ -23,33 +23,19 @@ function getJEScheduleSortAccessor(sortKey) {
|
|
|
23
23
|
case 'depCategory':
|
|
24
24
|
return (s) => s.jeCredit.account?.accountName?.toLowerCase();
|
|
25
25
|
case 'scheduleCategory':
|
|
26
|
-
return (s) => s.
|
|
26
|
+
return (s) => s.jeScheduleType;
|
|
27
27
|
case 'startMonth':
|
|
28
28
|
return (s) => s.startDate?.valueOf();
|
|
29
29
|
case 'type':
|
|
30
|
-
return (s) => s.
|
|
30
|
+
return (s) => s.baseTransaction.typeOfTransaction;
|
|
31
31
|
case 'amortizationPeriod':
|
|
32
32
|
return (s) => s.period;
|
|
33
33
|
case 'jePostingDate':
|
|
34
|
-
return (s) => s.
|
|
35
|
-
? LAST_SCHEDULE_DAY_OF_MONTH
|
|
36
|
-
: (s.dayOfPostingDate ?? null);
|
|
34
|
+
return (s) => s.dayOfPostingDate;
|
|
37
35
|
case 'remainingMonths':
|
|
38
|
-
return (s) =>
|
|
39
|
-
const total = s.period ?? 0;
|
|
40
|
-
const posted = Array.isArray(s.scheduledJournalEntry)
|
|
41
|
-
? s.scheduledJournalEntry.length
|
|
42
|
-
: 0;
|
|
43
|
-
return total - posted;
|
|
44
|
-
};
|
|
36
|
+
return (s) => s.period;
|
|
45
37
|
case 'runningBalance':
|
|
46
|
-
return (s) =>
|
|
47
|
-
const sje = s.scheduledJournalEntry;
|
|
48
|
-
if (sje != null && !Array.isArray(sje)) {
|
|
49
|
-
return sje.runningBalance?.amount ?? null;
|
|
50
|
-
}
|
|
51
|
-
return s.balanceAsOfToday?.amount ?? null;
|
|
52
|
-
};
|
|
38
|
+
return (s) => s.balanceAsOfToday?.amount;
|
|
53
39
|
case 'totalAmount':
|
|
54
40
|
return (s) => s.baseTransaction.amount.amount;
|
|
55
41
|
case 'transactionDate':
|
|
@@ -128,11 +114,6 @@ export function getExpenseAutomationJESchedulesView(state) {
|
|
|
128
114
|
});
|
|
129
115
|
});
|
|
130
116
|
const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
|
|
131
|
-
const validResolveForPending = unsortedResolveSchedules.filter((r) => jeScheduleLocalDataById[r.scheduledJournalEntry.scheduledJournalEntryID] != null);
|
|
132
|
-
const pendingReviewSchedules = sortJEScheduledTransactions([
|
|
133
|
-
...jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft'),
|
|
134
|
-
...validResolveForPending,
|
|
135
|
-
], sortKey, sortOrder);
|
|
136
117
|
const allSteps = monthYearPeriodId != null
|
|
137
118
|
? getAllSteps(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
|
|
138
119
|
: [];
|
|
@@ -156,7 +137,6 @@ export function getExpenseAutomationJESchedulesView(state) {
|
|
|
156
137
|
completedSchedules,
|
|
157
138
|
draftSchedules,
|
|
158
139
|
ongoingSchedules,
|
|
159
|
-
pendingReviewSchedules,
|
|
160
140
|
resolveSchedules: resolveSchedules,
|
|
161
141
|
accountSettingsView,
|
|
162
142
|
postStatusById: postStatusById,
|
|
@@ -47,13 +47,8 @@ const sortedJETransactionsView = (jeTransactions, sortKey, sortOrder) => {
|
|
|
47
47
|
return jeTransaction.endDate != null
|
|
48
48
|
? jeTransaction.endDate.valueOf()
|
|
49
49
|
: null;
|
|
50
|
-
case 'months':
|
|
51
|
-
|
|
52
|
-
const posted = Array.isArray(jeTransaction.scheduledJournalEntry)
|
|
53
|
-
? jeTransaction.scheduledJournalEntry.length
|
|
54
|
-
: 0;
|
|
55
|
-
return total - posted;
|
|
56
|
-
}
|
|
50
|
+
case 'months':
|
|
51
|
+
return jeTransaction.period ?? null;
|
|
57
52
|
case 'transactionType':
|
|
58
53
|
return jeTransaction.baseTransaction.type.toLowerCase();
|
|
59
54
|
case 'status':
|