@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
|
@@ -24,7 +24,6 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
|
24
24
|
ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
|
|
25
25
|
jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
|
|
26
26
|
ongoingSchedules: JEScheduledTransaction[];
|
|
27
|
-
pendingReviewSchedules: (JEScheduledTransaction | JEScheduledTransactionWithFailedEntries)[];
|
|
28
27
|
postStatusById: Record<ID, FetchStateAndError>;
|
|
29
28
|
refreshStatus: FetchStateAndError;
|
|
30
29
|
resolveSchedules: JEScheduledTransactionWithFailedEntries[];
|
|
@@ -29,33 +29,19 @@ function getJEScheduleSortAccessor(sortKey) {
|
|
|
29
29
|
case 'depCategory':
|
|
30
30
|
return (s) => s.jeCredit.account?.accountName?.toLowerCase();
|
|
31
31
|
case 'scheduleCategory':
|
|
32
|
-
return (s) => s.
|
|
32
|
+
return (s) => s.jeScheduleType;
|
|
33
33
|
case 'startMonth':
|
|
34
34
|
return (s) => s.startDate?.valueOf();
|
|
35
35
|
case 'type':
|
|
36
|
-
return (s) => s.
|
|
36
|
+
return (s) => s.baseTransaction.typeOfTransaction;
|
|
37
37
|
case 'amortizationPeriod':
|
|
38
38
|
return (s) => s.period;
|
|
39
39
|
case 'jePostingDate':
|
|
40
|
-
return (s) => s.
|
|
41
|
-
? timePeriod_1.LAST_SCHEDULE_DAY_OF_MONTH
|
|
42
|
-
: (s.dayOfPostingDate ?? null);
|
|
40
|
+
return (s) => s.dayOfPostingDate;
|
|
43
41
|
case 'remainingMonths':
|
|
44
|
-
return (s) =>
|
|
45
|
-
const total = s.period ?? 0;
|
|
46
|
-
const posted = Array.isArray(s.scheduledJournalEntry)
|
|
47
|
-
? s.scheduledJournalEntry.length
|
|
48
|
-
: 0;
|
|
49
|
-
return total - posted;
|
|
50
|
-
};
|
|
42
|
+
return (s) => s.period;
|
|
51
43
|
case 'runningBalance':
|
|
52
|
-
return (s) =>
|
|
53
|
-
const sje = s.scheduledJournalEntry;
|
|
54
|
-
if (sje != null && !Array.isArray(sje)) {
|
|
55
|
-
return sje.runningBalance?.amount ?? null;
|
|
56
|
-
}
|
|
57
|
-
return s.balanceAsOfToday?.amount ?? null;
|
|
58
|
-
};
|
|
44
|
+
return (s) => s.balanceAsOfToday?.amount;
|
|
59
45
|
case 'totalAmount':
|
|
60
46
|
return (s) => s.baseTransaction.amount.amount;
|
|
61
47
|
case 'transactionDate':
|
|
@@ -134,11 +120,6 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
134
120
|
});
|
|
135
121
|
});
|
|
136
122
|
const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
|
|
137
|
-
const validResolveForPending = unsortedResolveSchedules.filter((r) => jeScheduleLocalDataById[r.scheduledJournalEntry.scheduledJournalEntryID] != null);
|
|
138
|
-
const pendingReviewSchedules = sortJEScheduledTransactions([
|
|
139
|
-
...jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft'),
|
|
140
|
-
...validResolveForPending,
|
|
141
|
-
], sortKey, sortOrder);
|
|
142
123
|
const allSteps = monthYearPeriodId != null
|
|
143
124
|
? (0, expenseAutomationViewSelectorTypes_1.getAllSteps)(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
|
|
144
125
|
: [];
|
|
@@ -162,7 +143,6 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
162
143
|
completedSchedules,
|
|
163
144
|
draftSchedules,
|
|
164
145
|
ongoingSchedules,
|
|
165
|
-
pendingReviewSchedules,
|
|
166
146
|
resolveSchedules: resolveSchedules,
|
|
167
147
|
accountSettingsView,
|
|
168
148
|
postStatusById: postStatusById,
|
|
@@ -53,13 +53,8 @@ const sortedJETransactionsView = (jeTransactions, sortKey, sortOrder) => {
|
|
|
53
53
|
return jeTransaction.endDate != null
|
|
54
54
|
? jeTransaction.endDate.valueOf()
|
|
55
55
|
: null;
|
|
56
|
-
case 'months':
|
|
57
|
-
|
|
58
|
-
const posted = Array.isArray(jeTransaction.scheduledJournalEntry)
|
|
59
|
-
? jeTransaction.scheduledJournalEntry.length
|
|
60
|
-
: 0;
|
|
61
|
-
return total - posted;
|
|
62
|
-
}
|
|
56
|
+
case 'months':
|
|
57
|
+
return jeTransaction.period ?? null;
|
|
63
58
|
case 'transactionType':
|
|
64
59
|
return jeTransaction.baseTransaction.type.toLowerCase();
|
|
65
60
|
case 'status':
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.16
|
|
3
|
+
"version": "5.0.16",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|