@zeniai/client-epic-state 5.1.62-betaRD1 → 5.1.62
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/jeSchedules/jeSchedulesPayload.d.ts +0 -2
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -2
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +0 -4
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +1 -11
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +0 -2
- package/lib/epic.d.ts +1 -5
- package/lib/epic.js +1 -5
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -2
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +1 -11
- package/lib/esm/epic.js +1 -5
- package/lib/esm/index.js +4 -7
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -15
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +6 -126
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +11 -65
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +6 -3
- package/lib/index.d.ts +6 -9
- package/lib/index.js +48 -66
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +1 -14
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +0 -1
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +8 -36
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +7 -128
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +4 -29
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +11 -65
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +6 -53
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -5
- package/package.json +1 -1
- package/lib/entity/transaction/scheduleTransactionHelper.d.ts +0 -15
- package/lib/entity/transaction/scheduleTransactionHelper.js +0 -43
- package/lib/esm/entity/transaction/scheduleTransactionHelper.js +0 -39
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +0 -21
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +0 -110
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +0 -44
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -22
- package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +0 -152
- package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +0 -1
- package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +0 -71
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +0 -25
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +0 -45
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +0 -114
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +0 -48
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +0 -6
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -26
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +0 -43
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +0 -158
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +0 -25
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +0 -2
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +0 -10
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +0 -76
|
@@ -3,12 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fetchJeSchedulesEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const formatZeniDateFY_1 = require("../../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
|
|
7
6
|
const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
|
|
8
7
|
const jeSchedulesReducer_1 = require("../../../../entity/jeSchedules/jeSchedulesReducer");
|
|
9
8
|
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
10
9
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
11
|
-
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
12
10
|
const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
|
|
13
11
|
const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.fetchJeSchedules.match), (0, operators_1.mergeMap)((action) => {
|
|
14
12
|
const state = state$.value;
|
|
@@ -16,20 +14,9 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
|
|
|
16
14
|
const { period, refreshViewInBackground } = action.payload;
|
|
17
15
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
18
16
|
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
19
|
-
const isClosePeriodTab = state.expenseAutomationJESchedulesViewState.uiState.selectedPageTab ===
|
|
20
|
-
'schedules';
|
|
21
|
-
const existingEndDate = (0, timePeriod_1.toAbsoluteDay)((0, zeniDayJS_1.date)((0, timePeriod_1.toString)(period.start))
|
|
22
|
-
.subtract(1, 'month')
|
|
23
|
-
.endOf('month')
|
|
24
|
-
.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT));
|
|
25
17
|
const queryParam = {
|
|
26
18
|
start_date: (0, timePeriod_1.toString)(period.start),
|
|
27
|
-
end_date:
|
|
28
|
-
? (0, timePeriod_1.toString)(period.end)
|
|
29
|
-
: (0, timePeriod_1.toString)(existingEndDate),
|
|
30
|
-
...(isClosePeriodTab
|
|
31
|
-
? { close_period_start_date: (0, timePeriod_1.toString)(period.start) }
|
|
32
|
-
: {}),
|
|
19
|
+
end_date: (0, timePeriod_1.toString)(period.end),
|
|
33
20
|
};
|
|
34
21
|
return zeniAPI
|
|
35
22
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expenses_automation/je_schedules?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
@@ -8,7 +8,6 @@ import { JEScheduleLocalData } from '../types/jeSchedulesViewState';
|
|
|
8
8
|
export interface ExpenseAutomationJESchedulesQueryPayload {
|
|
9
9
|
end_date: string;
|
|
10
10
|
start_date: string;
|
|
11
|
-
close_period_start_date?: string;
|
|
12
11
|
}
|
|
13
12
|
interface ExpenseAutomationJESchedulesPayload {
|
|
14
13
|
failed_je_postings: {
|
|
@@ -2,16 +2,13 @@ import { ID } from '../../../commonStateTypes/common';
|
|
|
2
2
|
import { MonthYearPeriod, TimePeriod } from '../../../commonStateTypes/timePeriod';
|
|
3
3
|
import { AccountMetadataPayload } from '../../../entity/account/accountPayload';
|
|
4
4
|
import { JEScheduledTransactionPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
|
|
5
|
-
import { JEScheduleTransactionKey
|
|
5
|
+
import { JEScheduleTransactionKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
6
6
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
7
7
|
import { AccountTypeRecommendationPayload } from '../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload';
|
|
8
|
-
import { AccountSettingsLocalData, AccountSettingsState, JEScheduleLocalData, JESchedulesViewState, JESchedulesViewUIState
|
|
8
|
+
import { AccountSettingsLocalData, AccountSettingsState, JEScheduleLocalData, JESchedulesViewState, JESchedulesViewUIState } from '../types/jeSchedulesViewState';
|
|
9
9
|
export declare const accountSettingsInitialState: AccountSettingsState;
|
|
10
|
-
export declare const getBaseNewScheduleLocalData: (scheduleType: ScheduleTypes) => NewScheduleLocalData;
|
|
11
|
-
export declare const newScheduleInitialState: JESchedulesViewState['newSchedule']['newScheduleState'];
|
|
12
|
-
export declare const searchTransactionsInitialState: SearchTransactionsState;
|
|
13
10
|
export declare const initialState: JESchedulesViewState;
|
|
14
|
-
export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearExpenseAutomationJESchedulesView">, clearJeAccountSettingsLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeAccountSettingsLocalData">, clearJeScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeScheduleLocalData">,
|
|
11
|
+
export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearExpenseAutomationJESchedulesView">, clearJeAccountSettingsLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeAccountSettingsLocalData">, clearJeScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeScheduleLocalData">, fetchAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/fetchAccountSettingsListForAccountTypes">, fetchJeSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
|
|
15
12
|
period: TimePeriod;
|
|
16
13
|
refreshViewInBackground: any;
|
|
17
14
|
}, "expenseAutomationJESchedulesView/fetchJeSchedules", never, never>, fetchJeSchedulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -35,11 +32,7 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
35
32
|
jeScheduleTransactionKey: `${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`;
|
|
36
33
|
}, "expenseAutomationJESchedulesView/ignoreRecommendedJeScheduleSuccess", never, never>, initializeAccountSettingsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/initializeAccountSettingsView">, initializeJeScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeSchedules: JEScheduledTransactionPayload[]], {
|
|
37
34
|
jeScheduleTransactionKeys: (`${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[];
|
|
38
|
-
}, "expenseAutomationJESchedulesView/initializeJeScheduleLocalData", never, never>,
|
|
39
|
-
scheduleType: "fixed_assets" | "prepaid_expenses";
|
|
40
|
-
}], {
|
|
41
|
-
scheduleType: "prepaid_expenses" | "fixed_assets";
|
|
42
|
-
}, "expenseAutomationJESchedulesView/initializeNewSchedule", never, never>, removeFailedJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[failedJeScheduleKey: `${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`, selectedPeriod: MonthYearPeriod], {
|
|
35
|
+
}, "expenseAutomationJESchedulesView/initializeJeScheduleLocalData", never, never>, removeFailedJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[failedJeScheduleKey: `${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`, selectedPeriod: MonthYearPeriod], {
|
|
43
36
|
failedJeScheduleKey: `${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`;
|
|
44
37
|
selectedPeriod: MonthYearPeriod;
|
|
45
38
|
}, "expenseAutomationJESchedulesView/removeFailedJeScheduleTransactionKey", never, never>, removeJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -47,11 +40,7 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
47
40
|
}, "expenseAutomationJESchedulesView/removeJeScheduleLocalDataById">, removeJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKey: `${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`, selectedPeriod: MonthYearPeriod], {
|
|
48
41
|
jeScheduleKey: `${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`;
|
|
49
42
|
selectedPeriod: MonthYearPeriod;
|
|
50
|
-
}, "expenseAutomationJESchedulesView/removeJeScheduleTransactionKey", never, never>,
|
|
51
|
-
scheduleType: "fixed_assets" | "prepaid_expenses";
|
|
52
|
-
}], {
|
|
53
|
-
scheduleType: "prepaid_expenses" | "fixed_assets";
|
|
54
|
-
}, "expenseAutomationJESchedulesView/resetNewScheduleLocalData", never, never>, retryJeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
43
|
+
}, "expenseAutomationJESchedulesView/removeJeScheduleTransactionKey", never, never>, retryJeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
55
44
|
jeScheduleTransactionKey: JEScheduleTransactionKey;
|
|
56
45
|
scheduledJournalEntryID: ID;
|
|
57
46
|
}, "expenseAutomationJESchedulesView/retryJeSchedule">, retryJeScheduleFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -63,34 +52,17 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
63
52
|
status: ZeniAPIStatus;
|
|
64
53
|
}, "expenseAutomationJESchedulesView/saveAccountSettingsFailure">, saveAccountSettingsLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
65
54
|
data: Partial<AccountSettingsLocalData>;
|
|
66
|
-
}, "expenseAutomationJESchedulesView/saveAccountSettingsLocalData">, saveAccountSettingsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/saveAccountSettingsSuccess">,
|
|
67
|
-
scheduleType: "fixed_assets" | "prepaid_expenses";
|
|
68
|
-
}], {
|
|
69
|
-
scheduleType: "prepaid_expenses" | "fixed_assets";
|
|
70
|
-
}, "expenseAutomationJESchedulesView/saveNewSchedule", never, never>, saveNewScheduleFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
71
|
-
status: ZeniAPIStatus;
|
|
72
|
-
}, "expenseAutomationJESchedulesView/saveNewScheduleFailure">, saveNewScheduleSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/saveNewScheduleSuccess">, searchTransactionsForNewSchedule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
|
|
73
|
-
query: string;
|
|
74
|
-
}], {
|
|
75
|
-
query: string;
|
|
76
|
-
}, "expenseAutomationJESchedulesView/searchTransactionsForNewSchedule", never, never>, searchTransactionsForNewScheduleFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
77
|
-
status: ZeniAPIStatus;
|
|
78
|
-
}, "expenseAutomationJESchedulesView/searchTransactionsForNewScheduleFailure">, searchTransactionsForNewScheduleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
79
|
-
searchResults: ID[];
|
|
80
|
-
}, "expenseAutomationJESchedulesView/searchTransactionsForNewScheduleSuccess">, toggleJECreatedGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJECreatedGroupCollapsed">, toggleJEPendingGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJEPendingGroupCollapsed">, updateAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
55
|
+
}, "expenseAutomationJESchedulesView/saveAccountSettingsLocalData">, saveAccountSettingsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/saveAccountSettingsSuccess">, updateAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
81
56
|
accountPayload: AccountMetadataPayload[];
|
|
82
57
|
}, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypes">, updateAccountSettingsListForAccountTypesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
83
58
|
status: ZeniAPIStatus;
|
|
84
|
-
}, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJESchedulesUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<JESchedulesViewUIState>, "expenseAutomationJESchedulesView/updateJESchedulesUIState">,
|
|
59
|
+
}, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJESchedulesUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<JESchedulesViewUIState>, "expenseAutomationJESchedulesView/updateJESchedulesUIState">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
85
60
|
localData: Partial<JEScheduleLocalData>;
|
|
86
61
|
scheduledJournalEntryID: ID;
|
|
87
62
|
}, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[], selectedPeriod: MonthYearPeriod], {
|
|
88
63
|
jeScheduleKeys: (`${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[];
|
|
89
64
|
selectedPeriod: MonthYearPeriod;
|
|
90
|
-
}, "expenseAutomationJESchedulesView/updateJeScheduleTransactionKeys", never, never>,
|
|
91
|
-
localData: Partial<NewScheduleLocalDataFixedAssets>;
|
|
92
|
-
scheduleType: "fixed_assets" | "prepaid_expenses";
|
|
93
|
-
}, "expenseAutomationJESchedulesView/updateNewScheduleLocalData">, updateRecommendationForAccountSettings: import("@reduxjs/toolkit").ActionCreatorWithPayload<AccountTypeRecommendationPayload, "expenseAutomationJESchedulesView/updateRecommendationForAccountSettings">, updateRecommendationForAccountSettingsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
65
|
+
}, "expenseAutomationJESchedulesView/updateJeScheduleTransactionKeys", never, never>, updateRecommendationForAccountSettings: import("@reduxjs/toolkit").ActionCreatorWithPayload<AccountTypeRecommendationPayload, "expenseAutomationJESchedulesView/updateRecommendationForAccountSettings">, updateRecommendationForAccountSettingsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
94
66
|
status: ZeniAPIStatus;
|
|
95
67
|
}, "expenseAutomationJESchedulesView/updateRecommendationForAccountSettingsFailure">;
|
|
96
68
|
declare const _default: import("redux").Reducer<JESchedulesViewState>;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.
|
|
4
|
+
exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.removeJeScheduleTransactionKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.accountSettingsInitialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const getNestedAccountIDHierarchyForReport_1 = require("../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport");
|
|
7
7
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
8
8
|
const accountPayload_1 = require("../../../entity/account/accountPayload");
|
|
9
9
|
const jeSchedulesPayload_1 = require("../../../entity/jeSchedules/jeSchedulesPayload");
|
|
10
10
|
const accountTypeRecommendationPayload_1 = require("../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload");
|
|
11
|
-
const jeSchedulesViewState_1 = require("../types/jeSchedulesViewState");
|
|
12
11
|
exports.accountSettingsInitialState = {
|
|
13
12
|
localData: {
|
|
14
13
|
selectedPrepaidExpensesAccountIds: [],
|
|
@@ -40,20 +39,6 @@ exports.accountSettingsInitialState = {
|
|
|
40
39
|
accruedExpensesNestedAccountListHierarchy: [],
|
|
41
40
|
accruedExpensesRecommendations: [],
|
|
42
41
|
};
|
|
43
|
-
const getBaseNewScheduleLocalData = (scheduleType) => ({
|
|
44
|
-
scheduleType,
|
|
45
|
-
jeScheduleDetails: [],
|
|
46
|
-
});
|
|
47
|
-
exports.getBaseNewScheduleLocalData = getBaseNewScheduleLocalData;
|
|
48
|
-
exports.newScheduleInitialState = {
|
|
49
|
-
fixed_assets: (0, exports.getBaseNewScheduleLocalData)('fixed_assets'),
|
|
50
|
-
prepaid_expenses: (0, exports.getBaseNewScheduleLocalData)('prepaid_expenses'),
|
|
51
|
-
};
|
|
52
|
-
exports.searchTransactionsInitialState = {
|
|
53
|
-
searchResults: [],
|
|
54
|
-
fetchState: 'Not-Started',
|
|
55
|
-
error: undefined,
|
|
56
|
-
};
|
|
57
42
|
exports.initialState = {
|
|
58
43
|
jeScheduleTransactionKeysByPeriod: {},
|
|
59
44
|
failedJeScheduleTransactionKeysByPeriod: {},
|
|
@@ -61,12 +46,9 @@ exports.initialState = {
|
|
|
61
46
|
ignoreStatusById: {},
|
|
62
47
|
jeScheduleLocalDataById: {},
|
|
63
48
|
uiState: {
|
|
64
|
-
createdGroupCollapsed: false,
|
|
65
|
-
pendingGroupCollapsed: false,
|
|
66
|
-
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
67
49
|
searchString: '',
|
|
68
|
-
|
|
69
|
-
|
|
50
|
+
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
51
|
+
selectedMainTab: 'pending_review',
|
|
70
52
|
sortKey: 'transactionDate',
|
|
71
53
|
sortOrder: 'descending',
|
|
72
54
|
totalCount: 0,
|
|
@@ -77,13 +59,6 @@ exports.initialState = {
|
|
|
77
59
|
error: undefined,
|
|
78
60
|
},
|
|
79
61
|
accountSettings: exports.accountSettingsInitialState,
|
|
80
|
-
newSchedule: {
|
|
81
|
-
newScheduleState: exports.newScheduleInitialState,
|
|
82
|
-
saveStatus: { fetchState: 'Not-Started', error: undefined },
|
|
83
|
-
searchTransactions: exports.searchTransactionsInitialState,
|
|
84
|
-
fetchState: 'Not-Started',
|
|
85
|
-
error: undefined,
|
|
86
|
-
},
|
|
87
62
|
fetchState: 'Not-Started',
|
|
88
63
|
error: undefined,
|
|
89
64
|
hasValidState() {
|
|
@@ -150,8 +125,8 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
150
125
|
else {
|
|
151
126
|
draft.fetchState = 'Error';
|
|
152
127
|
draft.error = status;
|
|
153
|
-
draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = [];
|
|
154
128
|
}
|
|
129
|
+
draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = [];
|
|
155
130
|
},
|
|
156
131
|
retryJeSchedule(draft, action) {
|
|
157
132
|
const { scheduledJournalEntryID } = action.payload;
|
|
@@ -397,91 +372,6 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
397
372
|
clearJeAccountSettingsLocalData(draft) {
|
|
398
373
|
draft.accountSettings.localData = exports.accountSettingsInitialState.localData;
|
|
399
374
|
},
|
|
400
|
-
initializeNewSchedule: {
|
|
401
|
-
prepare({ scheduleType, }) {
|
|
402
|
-
return { payload: { scheduleType } };
|
|
403
|
-
},
|
|
404
|
-
reducer() {
|
|
405
|
-
// Purely an epic-trigger action — the epic fans out the account/class
|
|
406
|
-
// list fetches plus resetNewScheduleLocalData.
|
|
407
|
-
},
|
|
408
|
-
},
|
|
409
|
-
resetNewScheduleLocalData: {
|
|
410
|
-
prepare({ scheduleType, }) {
|
|
411
|
-
return { payload: { scheduleType } };
|
|
412
|
-
},
|
|
413
|
-
reducer(draft, action) {
|
|
414
|
-
const { scheduleType } = action.payload;
|
|
415
|
-
draft.newSchedule.newScheduleState[scheduleType] =
|
|
416
|
-
(0, exports.getBaseNewScheduleLocalData)(scheduleType);
|
|
417
|
-
},
|
|
418
|
-
},
|
|
419
|
-
updateNewScheduleLocalData(draft, action) {
|
|
420
|
-
const { scheduleType, localData } = action.payload;
|
|
421
|
-
draft.newSchedule.newScheduleState[scheduleType] = {
|
|
422
|
-
...draft.newSchedule.newScheduleState[scheduleType],
|
|
423
|
-
...localData,
|
|
424
|
-
};
|
|
425
|
-
},
|
|
426
|
-
searchTransactionsForNewSchedule: {
|
|
427
|
-
prepare({ query }) {
|
|
428
|
-
return { payload: { query } };
|
|
429
|
-
},
|
|
430
|
-
reducer(draft, action) {
|
|
431
|
-
const trimmed = action.payload.query.trim();
|
|
432
|
-
// Cleared or too-short query: no API (see epic) — reset immediately.
|
|
433
|
-
if (trimmed.length < jeSchedulesViewState_1.MIN_NEW_SCHEDULE_SEARCH_LENGTH) {
|
|
434
|
-
draft.newSchedule.searchTransactions = exports.searchTransactionsInitialState;
|
|
435
|
-
return;
|
|
436
|
-
}
|
|
437
|
-
draft.newSchedule.searchTransactions = {
|
|
438
|
-
...draft.newSchedule.searchTransactions,
|
|
439
|
-
searchString: action.payload.query,
|
|
440
|
-
fetchState: 'In-Progress',
|
|
441
|
-
};
|
|
442
|
-
},
|
|
443
|
-
},
|
|
444
|
-
searchTransactionsForNewScheduleSuccess(draft, action) {
|
|
445
|
-
draft.newSchedule.searchTransactions = {
|
|
446
|
-
...draft.newSchedule.searchTransactions,
|
|
447
|
-
searchResults: action.payload.searchResults,
|
|
448
|
-
fetchState: 'Completed',
|
|
449
|
-
error: undefined,
|
|
450
|
-
};
|
|
451
|
-
},
|
|
452
|
-
searchTransactionsForNewScheduleFailure(draft, action) {
|
|
453
|
-
draft.newSchedule.searchTransactions = {
|
|
454
|
-
...draft.newSchedule.searchTransactions,
|
|
455
|
-
fetchState: 'Error',
|
|
456
|
-
error: action.payload.status,
|
|
457
|
-
};
|
|
458
|
-
},
|
|
459
|
-
clearSearchTransactionsForNewSchedule(draft) {
|
|
460
|
-
draft.newSchedule.searchTransactions = exports.searchTransactionsInitialState;
|
|
461
|
-
},
|
|
462
|
-
saveNewSchedule: {
|
|
463
|
-
prepare({ scheduleType, }) {
|
|
464
|
-
return { payload: { scheduleType } };
|
|
465
|
-
},
|
|
466
|
-
reducer(draft) {
|
|
467
|
-
draft.newSchedule.saveStatus = {
|
|
468
|
-
fetchState: 'In-Progress',
|
|
469
|
-
error: undefined,
|
|
470
|
-
};
|
|
471
|
-
},
|
|
472
|
-
},
|
|
473
|
-
saveNewScheduleSuccess(draft) {
|
|
474
|
-
draft.newSchedule.saveStatus = {
|
|
475
|
-
fetchState: 'Completed',
|
|
476
|
-
error: undefined,
|
|
477
|
-
};
|
|
478
|
-
},
|
|
479
|
-
saveNewScheduleFailure(draft, action) {
|
|
480
|
-
draft.newSchedule.saveStatus = {
|
|
481
|
-
fetchState: 'Error',
|
|
482
|
-
error: action.payload.status,
|
|
483
|
-
};
|
|
484
|
-
},
|
|
485
375
|
updateJESchedulesUIState(draft, action) {
|
|
486
376
|
if (action.payload.sortKey != null) {
|
|
487
377
|
draft.uiState.sortKey = action.payload.sortKey;
|
|
@@ -495,27 +385,16 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
495
385
|
if (action.payload.scrollPosition != null) {
|
|
496
386
|
draft.uiState.scrollPosition = action.payload.scrollPosition;
|
|
497
387
|
}
|
|
498
|
-
if (action.payload.
|
|
499
|
-
draft.uiState.
|
|
388
|
+
if (action.payload.selectedMainTab != null) {
|
|
389
|
+
draft.uiState.selectedMainTab = action.payload.selectedMainTab;
|
|
500
390
|
}
|
|
501
391
|
},
|
|
502
|
-
updateJEScheduleTypeFilter(draft, action) {
|
|
503
|
-
draft.uiState.selectedJETypeFilter = action.payload;
|
|
504
|
-
},
|
|
505
|
-
toggleJEPendingGroupCollapsed(draft) {
|
|
506
|
-
draft.uiState.pendingGroupCollapsed =
|
|
507
|
-
!draft.uiState.pendingGroupCollapsed;
|
|
508
|
-
},
|
|
509
|
-
toggleJECreatedGroupCollapsed(draft) {
|
|
510
|
-
draft.uiState.createdGroupCollapsed =
|
|
511
|
-
!draft.uiState.createdGroupCollapsed;
|
|
512
|
-
},
|
|
513
392
|
clearExpenseAutomationJESchedulesView(draft) {
|
|
514
393
|
Object.assign(draft, exports.initialState);
|
|
515
394
|
},
|
|
516
395
|
},
|
|
517
396
|
});
|
|
518
|
-
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.
|
|
397
|
+
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
|
|
519
398
|
exports.default = expenseAutomationJESchedulesView.reducer;
|
|
520
399
|
const doUpdateRecommendationForAccountSettings = (draft, payload) => {
|
|
521
400
|
const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
|
|
@@ -5,30 +5,11 @@ import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndRep
|
|
|
5
5
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
6
6
|
import { ClassBase } from '../../../entity/class/classState';
|
|
7
7
|
import { JEScheduledTransaction } from '../../../entity/jeSchedules/jeSchedulesSelector';
|
|
8
|
-
import { JEScheduleTransactionKey
|
|
8
|
+
import { JEScheduleTransactionKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
9
9
|
import { UncategorizedAccounts } from '../../accountList/accountListSelector';
|
|
10
10
|
import { JEAccountSettingsView } from '../selectorTypes/jeAccountSettingsViewSelectorTypes';
|
|
11
|
-
import { NewScheduleView } from '../selectorTypes/jeNewScheduleViewSelectorTypes';
|
|
12
11
|
import { JEScheduledTransactionWithFailedEntries } from '../selectors/jeSchedulesViewSelector';
|
|
13
12
|
import { JEScheduleLocalData, JESchedulesViewUIState } from '../types/jeSchedulesViewState';
|
|
14
|
-
export interface JEKpiSummary {
|
|
15
|
-
aiAccountant: {
|
|
16
|
-
amount: number;
|
|
17
|
-
count: number;
|
|
18
|
-
};
|
|
19
|
-
manual: {
|
|
20
|
-
amount: number;
|
|
21
|
-
count: number;
|
|
22
|
-
};
|
|
23
|
-
needsReview: {
|
|
24
|
-
amount: number;
|
|
25
|
-
count: number;
|
|
26
|
-
};
|
|
27
|
-
total: {
|
|
28
|
-
amount: number;
|
|
29
|
-
count: number;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
13
|
export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
33
14
|
accountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
34
15
|
accountSettingsView: JEAccountSettingsView;
|
|
@@ -37,19 +18,13 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
|
37
18
|
allDepreciationAccountList: AccountBase[];
|
|
38
19
|
allDepreciationAccountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
39
20
|
classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
|
|
21
|
+
completedSchedules: JEScheduledTransaction[];
|
|
40
22
|
completionStatus: CompletionStatusType;
|
|
41
|
-
|
|
42
|
-
createdTotal: number;
|
|
23
|
+
draftSchedules: JEScheduledTransaction[];
|
|
43
24
|
ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
|
|
44
25
|
jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
|
|
45
|
-
|
|
46
|
-
active: Record<ScheduleTypes, number>;
|
|
47
|
-
ongoing: Record<ScheduleTypes, number>;
|
|
48
|
-
};
|
|
49
|
-
kpiSummary: JEKpiSummary;
|
|
50
|
-
newScheduleView: NewScheduleView | undefined;
|
|
26
|
+
ongoingSchedules: JEScheduledTransaction[];
|
|
51
27
|
pendingReviewSchedules: (JEScheduledTransaction | JEScheduledTransactionWithFailedEntries)[];
|
|
52
|
-
pendingReviewTotal: number;
|
|
53
28
|
postStatusById: Record<ID, FetchStateAndError>;
|
|
54
29
|
refreshStatus: FetchStateAndError;
|
|
55
30
|
resolveSchedules: JEScheduledTransactionWithFailedEntries[];
|
|
@@ -10,7 +10,6 @@ const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState")
|
|
|
10
10
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
11
11
|
const accountSelector_1 = require("../../../entity/account/accountSelector");
|
|
12
12
|
const jeSchedulesSelector_1 = require("../../../entity/jeSchedules/jeSchedulesSelector");
|
|
13
|
-
const jeSchedulesTypes_1 = require("../../../entity/jeSchedules/jeSchedulesTypes");
|
|
14
13
|
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
15
14
|
const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
16
15
|
const classListSelector_1 = require("../../classList/classListSelector");
|
|
@@ -19,7 +18,6 @@ const scheduleDetailSelector_1 = require("../../scheduleView/scheduleDetailView/
|
|
|
19
18
|
const scheduleListHelper_1 = require("../../scheduleView/scheduleListView/scheduleListHelper");
|
|
20
19
|
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
21
20
|
const jeAccountSettingsViewSelector_1 = require("./jeAccountSettingsViewSelector");
|
|
22
|
-
const jeNewScheduleViewSelector_1 = require("./jeNewScheduleViewSelector");
|
|
23
21
|
function getJEScheduleSortAccessor(sortKey) {
|
|
24
22
|
switch (sortKey) {
|
|
25
23
|
case 'vendor':
|
|
@@ -61,7 +59,7 @@ function getJEScheduleSortAccessor(sortKey) {
|
|
|
61
59
|
case 'totalAmount':
|
|
62
60
|
return (s) => s.baseTransaction.amount.amount;
|
|
63
61
|
case 'transactionDate':
|
|
64
|
-
return (s) => s.
|
|
62
|
+
return (s) => s.baseTransaction.date.valueOf();
|
|
65
63
|
case 'memo':
|
|
66
64
|
return (s) => s.baseTransaction.memo?.toLowerCase();
|
|
67
65
|
default:
|
|
@@ -76,12 +74,8 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
76
74
|
const jeScheduledTransaction = [];
|
|
77
75
|
const failedJeScheduledTransaction = [];
|
|
78
76
|
const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
|
|
79
|
-
const { jeScheduleTransactionKeysByPeriod, failedJeScheduleTransactionKeysByPeriod, jeScheduleLocalDataById, postStatusById, ignoreStatusById, uiState, error, fetchState, refreshStatus,
|
|
77
|
+
const { jeScheduleTransactionKeysByPeriod, failedJeScheduleTransactionKeysByPeriod, jeScheduleLocalDataById, postStatusById, ignoreStatusById, uiState, error, fetchState, refreshStatus, } = expenseAutomationJESchedulesViewState;
|
|
80
78
|
const accountSettingsView = (0, jeAccountSettingsViewSelector_1.getJEAccountSettingsView)(state);
|
|
81
|
-
const newScheduleView = newSchedule.selectedDetailScheduleType === 'fixed_assets' ||
|
|
82
|
-
newSchedule.selectedDetailScheduleType === 'prepaid_expenses'
|
|
83
|
-
? (0, jeNewScheduleViewSelector_1.getNewScheduleView)(state, newSchedule.selectedDetailScheduleType)
|
|
84
|
-
: undefined;
|
|
85
79
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
86
80
|
const { selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
87
81
|
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
@@ -125,7 +119,11 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
125
119
|
const jeScheduleDetails = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleKey, state);
|
|
126
120
|
failedJeScheduledTransaction.push(jeScheduleDetails);
|
|
127
121
|
});
|
|
128
|
-
const { sortKey, sortOrder
|
|
122
|
+
const { sortKey, sortOrder } = uiState;
|
|
123
|
+
const draftSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft'), sortKey, sortOrder);
|
|
124
|
+
const ongoingSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'ongoing'), sortKey, sortOrder);
|
|
125
|
+
const completedSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'completed' ||
|
|
126
|
+
schedule.status.code === 'marked_as_completed'), sortKey, sortOrder);
|
|
129
127
|
const unsortedResolveSchedules = [];
|
|
130
128
|
failedJeScheduledTransaction.forEach((schedule) => {
|
|
131
129
|
schedule.scheduledJournalEntry.forEach((journalEntry) => {
|
|
@@ -138,42 +136,9 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
138
136
|
const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
|
|
139
137
|
const validResolveForPending = unsortedResolveSchedules.filter((r) => jeScheduleLocalDataById[r.scheduledJournalEntry.scheduledJournalEntryID] != null);
|
|
140
138
|
const pendingReviewSchedules = sortJEScheduledTransactions([
|
|
141
|
-
...jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft'
|
|
142
|
-
(selectedJETypeFilter == null ||
|
|
143
|
-
schedule.jeScheduleType === selectedJETypeFilter)),
|
|
139
|
+
...jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft'),
|
|
144
140
|
...validResolveForPending,
|
|
145
141
|
], sortKey, sortOrder);
|
|
146
|
-
const createdSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => (schedule.status.code === 'ongoing' ||
|
|
147
|
-
schedule.status.code === 'completed' ||
|
|
148
|
-
schedule.status.code === 'marked_as_completed') &&
|
|
149
|
-
(selectedJETypeFilter == null ||
|
|
150
|
-
schedule.jeScheduleType === selectedJETypeFilter)), sortKey, sortOrder);
|
|
151
|
-
// KPI summary — derived from unfiltered schedules so counts are always accurate
|
|
152
|
-
const allSchedules = jeScheduledTransaction;
|
|
153
|
-
const sumAmount = (schedules) => schedules.reduce((total, schedule) => total + (schedule.baseTransaction.amount.amount ?? 0), 0);
|
|
154
|
-
const pendingReviewTotal = sumAmount(pendingReviewSchedules);
|
|
155
|
-
const createdTotal = sumAmount(createdSchedules);
|
|
156
|
-
const aiAccountantSchedules = allSchedules.filter((schedule) => schedule.confidenceScore != null);
|
|
157
|
-
const pendingUnfiltered = allSchedules.filter((schedule) => schedule.status.code === 'draft');
|
|
158
|
-
const kpiSummary = {
|
|
159
|
-
aiAccountant: {
|
|
160
|
-
count: aiAccountantSchedules.length,
|
|
161
|
-
amount: sumAmount(aiAccountantSchedules),
|
|
162
|
-
},
|
|
163
|
-
manual: {
|
|
164
|
-
count: allSchedules.filter((schedule) => schedule.confidenceScore == null)
|
|
165
|
-
.length,
|
|
166
|
-
amount: sumAmount(allSchedules.filter((schedule) => schedule.confidenceScore == null)),
|
|
167
|
-
},
|
|
168
|
-
needsReview: {
|
|
169
|
-
count: pendingUnfiltered.length,
|
|
170
|
-
amount: sumAmount(pendingUnfiltered),
|
|
171
|
-
},
|
|
172
|
-
total: {
|
|
173
|
-
count: allSchedules.length,
|
|
174
|
-
amount: sumAmount(allSchedules),
|
|
175
|
-
},
|
|
176
|
-
};
|
|
177
142
|
const allSteps = monthYearPeriodId != null
|
|
178
143
|
? (0, expenseAutomationViewSelectorTypes_1.getAllSteps)(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
|
|
179
144
|
: [];
|
|
@@ -186,22 +151,6 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
186
151
|
{ fetchState, error },
|
|
187
152
|
monthEndFetchState,
|
|
188
153
|
]);
|
|
189
|
-
const countByType = (schedules) => {
|
|
190
|
-
const counts = jeSchedulesTypes_1.ALL_SCHEDULES_TYPES.reduce((acc, type) => ({ ...acc, [type]: 0 }), {});
|
|
191
|
-
schedules.forEach((schedule) => {
|
|
192
|
-
if (schedule.jeScheduleType != null) {
|
|
193
|
-
counts[schedule.jeScheduleType] += 1;
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
return counts;
|
|
197
|
-
};
|
|
198
|
-
const jeScheduleTypeCounts = {
|
|
199
|
-
active: countByType(allSchedules.filter((schedule) => schedule.status.code === 'draft' ||
|
|
200
|
-
schedule.status.code === 'ongoing' ||
|
|
201
|
-
schedule.status.code === 'completed' ||
|
|
202
|
-
schedule.status.code === 'marked_as_completed')),
|
|
203
|
-
ongoing: countByType(allSchedules.filter((schedule) => schedule.status.code === 'ongoing')),
|
|
204
|
-
};
|
|
205
154
|
return {
|
|
206
155
|
uncategorizedAccounts,
|
|
207
156
|
allDepreciationAccountList: filteredDepAccounts,
|
|
@@ -210,15 +159,12 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
210
159
|
allAccountList: filteredAccounts,
|
|
211
160
|
accountListNestedAccountHierarchy,
|
|
212
161
|
allClassList: allClasses,
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
kpiSummary,
|
|
162
|
+
completedSchedules,
|
|
163
|
+
draftSchedules,
|
|
164
|
+
ongoingSchedules,
|
|
217
165
|
pendingReviewSchedules,
|
|
218
|
-
pendingReviewTotal,
|
|
219
166
|
resolveSchedules: resolveSchedules,
|
|
220
167
|
accountSettingsView,
|
|
221
|
-
newScheduleView,
|
|
222
168
|
postStatusById: postStatusById,
|
|
223
169
|
ignoreStatusById: ignoreStatusById,
|
|
224
170
|
fetchState: reducedFetchStatus.fetchState,
|