@zeniai/client-epic-state 5.2.7-betaRD1 → 5.2.8
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/invoicing/invoicingCommonPayload.d.ts +22 -0
- package/lib/entity/invoicing/invoicingCommonPayload.js +51 -10
- package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +0 -1
- package/lib/entity/jeSchedules/jeScheduleHelper.js +0 -7
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +1 -66
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -135
- package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +2 -4
- package/lib/entity/jeSchedules/jeSchedulesReducer.js +2 -30
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +2 -11
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +3 -38
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +1 -79
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -24
- package/lib/entity/jeSchedules/jeSchedulesTypes.js +1 -88
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -3
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +0 -2
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -2
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +0 -2
- package/lib/epic.d.ts +1 -9
- package/lib/epic.js +0 -16
- package/lib/esm/entity/invoicing/invoicingCommonPayload.js +51 -10
- package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +0 -6
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +1 -135
- package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +2 -30
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +2 -36
- package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +0 -78
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -3
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -2
- package/lib/esm/epic.js +0 -16
- package/lib/esm/index.js +8 -14
- package/lib/esm/view/accountList/accountListReducer.js +0 -1
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -6
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +5 -41
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +2 -14
- package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +0 -55
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +29 -306
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +22 -294
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +6 -5
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +2 -1
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +2 -0
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingAccountingPickersEpic.js +10 -5
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +27 -3
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +7 -3
- package/lib/esm/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
- package/lib/esm/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +2 -7
- package/lib/esm/view/scheduleView/scheduleListView/scheduleListReducer.js +3 -5
- package/lib/index.d.ts +12 -17
- package/lib/index.js +47 -91
- package/lib/view/accountList/accountListReducer.js +0 -1
- package/lib/view/accountList/accountListState.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -6
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +2 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +3 -39
- package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +2 -14
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +3 -72
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +1 -58
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +12 -91
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +29 -308
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +7 -36
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +0 -34
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +21 -302
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +8 -82
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -8
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +5 -0
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +1 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +1 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +2 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingAccountingPickersEpic.js +10 -5
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.d.ts +9 -1
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +30 -4
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +11 -4
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +7 -3
- package/lib/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
- package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +2 -7
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +2 -4
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +3 -5
- package/package.json +1 -1
- package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSection.d.ts +0 -0
- package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +0 -1
- package/lib/entity/invoicing/coupon/couponConstants.d.ts +0 -11
- package/lib/entity/invoicing/coupon/couponConstants.js +0 -29
- package/lib/esm/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +0 -1
- package/lib/esm/entity/invoicing/coupon/couponConstants.js +0 -26
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +0 -45
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +0 -81
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +0 -25
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +0 -110
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +0 -79
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +0 -139
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +0 -106
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -22
- package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +0 -140
- package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +0 -1
- package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +0 -106
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +0 -25
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +0 -15
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -18
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -18
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +0 -18
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +0 -16
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +0 -1
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +0 -60
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +0 -12
- package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +0 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.d.ts +0 -20
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +0 -49
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +0 -85
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +0 -29
- 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 -83
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +0 -12
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +0 -146
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +0 -64
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +0 -110
- 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 -36
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +0 -145
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +0 -42
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +0 -2
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +0 -21
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +0 -112
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.d.ts +0 -6
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +0 -29
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.d.ts +0 -6
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +0 -19
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +0 -8
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -22
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +0 -8
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -22
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.d.ts +0 -8
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +0 -22
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.d.ts +0 -13
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +0 -20
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.d.ts +0 -11
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +0 -2
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.d.ts +0 -7
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +0 -64
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.d.ts +0 -12
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +0 -15
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.d.ts +0 -9
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +0 -2
|
@@ -3,23 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isAiAccountantSchedule = void 0;
|
|
7
|
-
exports.isRenderableOneTimeAccrual = isRenderableOneTimeAccrual;
|
|
8
|
-
exports.getJEScheduleRowType = getJEScheduleRowType;
|
|
9
|
-
exports.isPendingReviewRow = isPendingReviewRow;
|
|
10
|
-
exports.isExistingTabRow = isExistingTabRow;
|
|
11
|
-
exports.isAccruedScheduleRow = isAccruedScheduleRow;
|
|
12
|
-
exports.isOneTimeAccrualRow = isOneTimeAccrualRow;
|
|
13
6
|
exports.getExpenseAutomationJESchedulesView = getExpenseAutomationJESchedulesView;
|
|
14
|
-
exports.getExpenseAutomationJEOneTimeAccrualDetailView = getExpenseAutomationJEOneTimeAccrualDetailView;
|
|
15
7
|
const omit_1 = __importDefault(require("lodash/omit"));
|
|
16
8
|
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
17
9
|
const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
|
|
18
10
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
19
11
|
const accountSelector_1 = require("../../../entity/account/accountSelector");
|
|
20
|
-
const jeScheduleHelper_1 = require("../../../entity/jeSchedules/jeScheduleHelper");
|
|
21
12
|
const jeSchedulesSelector_1 = require("../../../entity/jeSchedules/jeSchedulesSelector");
|
|
22
|
-
const jeSchedulesTypes_1 = require("../../../entity/jeSchedules/jeSchedulesTypes");
|
|
23
13
|
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
24
14
|
const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
25
15
|
const classListSelector_1 = require("../../classList/classListSelector");
|
|
@@ -27,127 +17,8 @@ const scheduleDetailLocalDataHelper_1 = require("../../scheduleView/scheduleDeta
|
|
|
27
17
|
const scheduleDetailSelector_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailSelector");
|
|
28
18
|
const scheduleListHelper_1 = require("../../scheduleView/scheduleListView/scheduleListHelper");
|
|
29
19
|
const getAllStepsHelper_1 = require("./getAllStepsHelper");
|
|
30
|
-
const jeSchedulesViewState_1 = require("../types/jeSchedulesViewState");
|
|
31
20
|
const jeAccountSettingsViewSelector_1 = require("./jeAccountSettingsViewSelector");
|
|
32
|
-
const jeNewScheduleViewSelector_1 = require("./jeNewScheduleViewSelector");
|
|
33
|
-
// Matches the AI-automation user addresses webc's schedule list row already
|
|
34
|
-
// checks (JEScheduleReadOnlyListRow/JEScheduleDraftListRow "Method" column,
|
|
35
|
-
// strings.ts aiBotEmail/botEmail) to determine whether a schedule was
|
|
36
|
-
// created by the AI accountant vs. a human.
|
|
37
|
-
const AI_BOT_EMAIL = 'ai@zeni.ai';
|
|
38
|
-
const BOT_EMAIL = 'bot@zeni.ai';
|
|
39
|
-
// A one-time accrual has no jeScheduleType of its own — it is not a JE schedule. It is still an
|
|
40
|
-
// accrued expense, so it counts and filters under that type on the page's type tabs.
|
|
41
|
-
const ONE_TIME_ACCRUAL_SCHEDULE_TYPE = 'accrued_expenses';
|
|
42
|
-
// Which of the two list buckets an accrual belongs in. `draft` still needs a human to post it;
|
|
43
|
-
// everything else is already on the books or in a transient claim.
|
|
44
|
-
const ONE_TIME_ACCRUAL_REVIEW_STATUSES = [
|
|
45
|
-
'draft',
|
|
46
|
-
];
|
|
47
|
-
/**
|
|
48
|
-
* `posting_blocked` is written by the posting Cron when a JE fails to post. It is an internal
|
|
49
|
-
* failure state with no human action attached, so it is dropped here rather than hidden at render
|
|
50
|
-
* time — filtering in the view would leave the group counts and KPI totals counting rows nobody
|
|
51
|
-
* can see. The expense-automation endpoint applies no status filter on the close-period path, so
|
|
52
|
-
* these rows do arrive.
|
|
53
|
-
*/
|
|
54
|
-
function isRenderableOneTimeAccrual(accrual) {
|
|
55
|
-
return accrual.accrualStatus !== 'posting_blocked';
|
|
56
|
-
}
|
|
57
|
-
function getJEScheduleRowType(schedule) {
|
|
58
|
-
return isOneTimeAccrualRow(schedule)
|
|
59
|
-
? ONE_TIME_ACCRUAL_SCHEDULE_TYPE
|
|
60
|
-
: schedule.jeScheduleType;
|
|
61
|
-
}
|
|
62
|
-
function isPendingReviewRow(schedule) {
|
|
63
|
-
return isOneTimeAccrualRow(schedule)
|
|
64
|
-
? ONE_TIME_ACCRUAL_REVIEW_STATUSES.includes(schedule.accrualStatus)
|
|
65
|
-
: schedule.status.code === 'draft';
|
|
66
|
-
}
|
|
67
|
-
// Belongs on the Existing Schedules tab. For an accrual the endpoint has already filtered to
|
|
68
|
-
// posted, so this only has to agree with that rather than re-derive it.
|
|
69
|
-
function isExistingTabRow(schedule) {
|
|
70
|
-
return isOneTimeAccrualRow(schedule)
|
|
71
|
-
? schedule.accrualStatus === 'posted'
|
|
72
|
-
: schedule.status.code === 'ongoing';
|
|
73
|
-
}
|
|
74
|
-
// Exported (rather than kept as a closure inside the selector) so it can be
|
|
75
|
-
// unit-tested directly — confidenceScore is a separate, more narrowly
|
|
76
|
-
// populated field that can be null on a schedule the bot user created,
|
|
77
|
-
// which previously caused these schedules to display as "AI Accountant" in
|
|
78
|
-
// the list but count under "Manual" in the KPI summary.
|
|
79
|
-
const isAiAccountantSchedule = (schedule) => {
|
|
80
|
-
// A one-time accrual records who made it as `origin`, which is authoritative — no email
|
|
81
|
-
// sniffing needed, and the JE bot is often absent from the user entity entirely.
|
|
82
|
-
if (isOneTimeAccrualRow(schedule)) {
|
|
83
|
-
return schedule.origin === 'agent';
|
|
84
|
-
}
|
|
85
|
-
return (schedule.createdByUser?.email === AI_BOT_EMAIL ||
|
|
86
|
-
schedule.createdByUser?.email === BOT_EMAIL);
|
|
87
|
-
};
|
|
88
|
-
exports.isAiAccountantSchedule = isAiAccountantSchedule;
|
|
89
|
-
// Accrued schedules are structurally distinct — no baseTransaction, carrying recurringAmount and
|
|
90
|
-
// memo in its place — so anything reading baseTransaction has to branch on this first.
|
|
91
|
-
//
|
|
92
|
-
// Discriminates on jeAccruedScheduleKey, which only JEAccruedSchedule carries. jeScheduleType
|
|
93
|
-
// cannot be used: it is a data field present on BOTH row shapes, so an accrued-typed row that
|
|
94
|
-
// arrived through the prepaid/fixed DTO (failed_je_postings, legacy fetches) would be
|
|
95
|
-
// misclassified and then crash on recurringAmount / jeAccruedScheduleKey.
|
|
96
|
-
function isAccruedScheduleRow(schedule) {
|
|
97
|
-
return 'jeAccruedScheduleKey' in schedule;
|
|
98
|
-
}
|
|
99
|
-
// Same structural approach as isAccruedScheduleRow, and for the same reason: jeOneTimeAccrualKey
|
|
100
|
-
// exists only on this shape. Note the two guards are NOT interchangeable — a one-time accrual is
|
|
101
|
-
// not an accrued *schedule*, and routing it into the accrued branch would read recurringAmount,
|
|
102
|
-
// render postedCount/lifecycleTotal as a lifecycle and startDate–endDate as a period, none of
|
|
103
|
-
// which it has.
|
|
104
|
-
function isOneTimeAccrualRow(schedule) {
|
|
105
|
-
return 'jeOneTimeAccrualKey' in schedule;
|
|
106
|
-
}
|
|
107
|
-
function getScheduleAmount(schedule) {
|
|
108
|
-
if (isOneTimeAccrualRow(schedule)) {
|
|
109
|
-
return schedule.estimatedAmount.amount;
|
|
110
|
-
}
|
|
111
|
-
if (isAccruedScheduleRow(schedule)) {
|
|
112
|
-
return schedule.recurringAmount.amount;
|
|
113
|
-
}
|
|
114
|
-
return schedule.baseTransaction.amount.amount;
|
|
115
|
-
}
|
|
116
|
-
// A one-time accrual shares almost no sortable field with a schedule, so it gets its own accessor
|
|
117
|
-
// rather than a guard on each of the dozen cases below. Keys with no meaning for a single-month
|
|
118
|
-
// accrual -- amortizationPeriod, remainingMonths, runningBalance, jePostingDate, scheduleCategory --
|
|
119
|
-
// deliberately fall through to undefined, which sorts them together at one end.
|
|
120
|
-
function getOneTimeAccrualSortValue(accrual, sortKey) {
|
|
121
|
-
switch (sortKey) {
|
|
122
|
-
case 'vendor':
|
|
123
|
-
return accrual.vendorName.toLowerCase();
|
|
124
|
-
case 'category':
|
|
125
|
-
return accrual.jeDebitAccountName?.toLowerCase();
|
|
126
|
-
case 'class':
|
|
127
|
-
return accrual.jeDebitAccountingClassName?.toLowerCase();
|
|
128
|
-
case 'depCategory':
|
|
129
|
-
return accrual.jeCreditAccountName?.toLowerCase();
|
|
130
|
-
case 'type':
|
|
131
|
-
return ONE_TIME_ACCRUAL_SCHEDULE_TYPE;
|
|
132
|
-
case 'totalAmount':
|
|
133
|
-
return accrual.estimatedAmount.amount;
|
|
134
|
-
case 'transactionDate':
|
|
135
|
-
return accrual.postingDate?.valueOf();
|
|
136
|
-
case 'memo':
|
|
137
|
-
return accrual.memo.toLowerCase();
|
|
138
|
-
case 'startMonth':
|
|
139
|
-
return accrual.serviceMonth;
|
|
140
|
-
default:
|
|
141
|
-
return undefined;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
21
|
function getJEScheduleSortAccessor(sortKey) {
|
|
145
|
-
const scheduleAccessor = getScheduleRowSortAccessor(sortKey);
|
|
146
|
-
return (schedule) => isOneTimeAccrualRow(schedule)
|
|
147
|
-
? getOneTimeAccrualSortValue(schedule, sortKey)
|
|
148
|
-
: scheduleAccessor(schedule);
|
|
149
|
-
}
|
|
150
|
-
function getScheduleRowSortAccessor(sortKey) {
|
|
151
22
|
switch (sortKey) {
|
|
152
23
|
case 'vendor':
|
|
153
24
|
return (s) => s.vendor.name?.toLowerCase();
|
|
@@ -158,9 +29,7 @@ function getScheduleRowSortAccessor(sortKey) {
|
|
|
158
29
|
case 'depCategory':
|
|
159
30
|
return (s) => s.jeCredit.account?.accountName?.toLowerCase();
|
|
160
31
|
case 'scheduleCategory':
|
|
161
|
-
return (s) =>
|
|
162
|
-
? undefined
|
|
163
|
-
: s.baseTransaction.account?.accountName?.toLowerCase();
|
|
32
|
+
return (s) => s.baseTransaction.account?.accountName?.toLowerCase();
|
|
164
33
|
case 'startMonth':
|
|
165
34
|
return (s) => s.startDate?.valueOf();
|
|
166
35
|
case 'type':
|
|
@@ -188,13 +57,11 @@ function getScheduleRowSortAccessor(sortKey) {
|
|
|
188
57
|
return s.balanceAsOfToday?.amount ?? null;
|
|
189
58
|
};
|
|
190
59
|
case 'totalAmount':
|
|
191
|
-
return (s) =>
|
|
60
|
+
return (s) => s.baseTransaction.amount.amount;
|
|
192
61
|
case 'transactionDate':
|
|
193
|
-
return (s) => s.
|
|
62
|
+
return (s) => s.baseTransaction.date.valueOf();
|
|
194
63
|
case 'memo':
|
|
195
|
-
return (s) =>
|
|
196
|
-
? s.memo.toLowerCase()
|
|
197
|
-
: s.baseTransaction.memo?.toLowerCase();
|
|
64
|
+
return (s) => s.baseTransaction.memo?.toLowerCase();
|
|
198
65
|
default:
|
|
199
66
|
return (s) => s.startDate?.valueOf();
|
|
200
67
|
}
|
|
@@ -206,15 +73,9 @@ function sortJEScheduledTransactions(transactions, sortKey, sortOrder) {
|
|
|
206
73
|
function getExpenseAutomationJESchedulesView(state) {
|
|
207
74
|
const jeScheduledTransaction = [];
|
|
208
75
|
const failedJeScheduledTransaction = [];
|
|
209
|
-
const accruedSchedules = [];
|
|
210
|
-
const oneTimeAccruals = [];
|
|
211
76
|
const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
|
|
212
|
-
const {
|
|
77
|
+
const { jeScheduleTransactionKeysByPeriod, failedJeScheduleTransactionKeysByPeriod, jeScheduleLocalDataById, postStatusById, ignoreStatusById, uiState, error, fetchState, refreshStatus, } = expenseAutomationJESchedulesViewState;
|
|
213
78
|
const accountSettingsView = (0, jeAccountSettingsViewSelector_1.getJEAccountSettingsView)(state);
|
|
214
|
-
const newScheduleView = newSchedule.selectedDetailScheduleType === 'fixed_assets' ||
|
|
215
|
-
newSchedule.selectedDetailScheduleType === 'prepaid_expenses'
|
|
216
|
-
? (0, jeNewScheduleViewSelector_1.getNewScheduleView)(state, newSchedule.selectedDetailScheduleType)
|
|
217
|
-
: undefined;
|
|
218
79
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
219
80
|
const { selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
220
81
|
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
@@ -242,48 +103,27 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
242
103
|
const filteredDepAccountListNestedAccountHierarchy = (0, scheduleDetailSelector_1.filterNestedAccountHierarchyById)(depAccountListNestedAccountHierarchy, filteredDepAccounts.map((account) => account.accountId));
|
|
243
104
|
const classListNestedAccountHierarchy = (0, classListSelector_1.getNestedClassListHierarchy)(classListState);
|
|
244
105
|
const monthYearPeriodId = selectedPeriod != null ? (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod) : null;
|
|
245
|
-
const
|
|
246
|
-
?
|
|
106
|
+
const jeScheduleTransactionKeysForSelectedPeriod = monthYearPeriodId != null
|
|
107
|
+
? jeScheduleTransactionKeysByPeriod[monthYearPeriodId]
|
|
247
108
|
: null;
|
|
248
|
-
const
|
|
249
|
-
?
|
|
250
|
-
:
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
: undefined;
|
|
254
|
-
// Distinguishes "this tab has never been fetched for this period" from "fetched and genuinely
|
|
255
|
-
// empty". Without it the page cannot tell a first visit from a real empty state, and renders an
|
|
256
|
-
// empty table where it should render a skeleton.
|
|
257
|
-
const hasLoadedForSelectedTab = jeScheduleTransactionKeysForSelectedTab != null;
|
|
258
|
-
const jeScheduleTransactionKeys = jeScheduleTransactionKeysForSelectedTab ?? [];
|
|
259
|
-
const failedJeScheduleTransactionKeys = failedJeScheduleTransactionKeysForSelectedTab ?? [];
|
|
260
|
-
const jeScheduleAccruedKeys = (selectedPeriodTabKey != null
|
|
261
|
-
? jeScheduleAccruedKeysByPeriodAndTab[selectedPeriodTabKey]
|
|
262
|
-
: undefined) ?? [];
|
|
263
|
-
const jeScheduleOneTimeAccrualKeys = (selectedPeriodTabKey != null
|
|
264
|
-
? jeScheduleOneTimeAccrualKeysByPeriodAndTab[selectedPeriodTabKey]
|
|
265
|
-
: undefined) ?? [];
|
|
266
|
-
jeScheduleOneTimeAccrualKeys.forEach((jeOneTimeAccrualKey) => {
|
|
267
|
-
const accrual = (0, jeSchedulesSelector_1.getJEOneTimeAccrualByKey)(jeOneTimeAccrualKey, state.jeSchedulesState);
|
|
268
|
-
if (accrual != null && isRenderableOneTimeAccrual(accrual)) {
|
|
269
|
-
oneTimeAccruals.push(accrual);
|
|
270
|
-
}
|
|
271
|
-
});
|
|
109
|
+
const failedJeScheduleTransactionKeysForSelectedPeriod = monthYearPeriodId != null
|
|
110
|
+
? failedJeScheduleTransactionKeysByPeriod[monthYearPeriodId]
|
|
111
|
+
: null;
|
|
112
|
+
const jeScheduleTransactionKeys = jeScheduleTransactionKeysForSelectedPeriod ?? [];
|
|
113
|
+
const failedJeScheduleTransactionKeys = failedJeScheduleTransactionKeysForSelectedPeriod ?? [];
|
|
272
114
|
jeScheduleTransactionKeys.forEach((jeScheduleKey) => {
|
|
273
115
|
const jeScheduleDetails = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleKey, state);
|
|
274
116
|
jeScheduledTransaction.push(jeScheduleDetails);
|
|
275
117
|
});
|
|
276
|
-
jeScheduleAccruedKeys.forEach((jeAccruedScheduleKey) => {
|
|
277
|
-
const accruedScheduleDetails = (0, jeSchedulesSelector_1.getJEAccruedScheduleByJEScheduleKey)(jeAccruedScheduleKey, state);
|
|
278
|
-
if (accruedScheduleDetails != null) {
|
|
279
|
-
accruedSchedules.push(accruedScheduleDetails);
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
118
|
failedJeScheduleTransactionKeys.forEach((jeScheduleKey) => {
|
|
283
119
|
const jeScheduleDetails = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleKey, state);
|
|
284
120
|
failedJeScheduledTransaction.push(jeScheduleDetails);
|
|
285
121
|
});
|
|
286
|
-
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);
|
|
287
127
|
const unsortedResolveSchedules = [];
|
|
288
128
|
failedJeScheduledTransaction.forEach((schedule) => {
|
|
289
129
|
schedule.scheduledJournalEntry.forEach((journalEntry) => {
|
|
@@ -295,87 +135,10 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
295
135
|
});
|
|
296
136
|
const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
|
|
297
137
|
const validResolveForPending = unsortedResolveSchedules.filter((r) => jeScheduleLocalDataById[r.scheduledJournalEntry.scheduledJournalEntryID] != null);
|
|
298
|
-
const matchesTypeFilter = (schedule) => selectedJETypeFilter == null ||
|
|
299
|
-
getJEScheduleRowType(schedule) === selectedJETypeFilter;
|
|
300
|
-
const isCreatedStatus = (schedule) => {
|
|
301
|
-
// An accrual is "created" once it is not review work: posted, reversing, reversed, or in a
|
|
302
|
-
// transient posting claim.
|
|
303
|
-
if (isOneTimeAccrualRow(schedule)) {
|
|
304
|
-
return !isPendingReviewRow(schedule);
|
|
305
|
-
}
|
|
306
|
-
return (schedule.status.code === 'ongoing' ||
|
|
307
|
-
schedule.status.code === 'completed' ||
|
|
308
|
-
schedule.status.code === 'marked_as_completed');
|
|
309
|
-
};
|
|
310
|
-
const allScheduleRows = [
|
|
311
|
-
...jeScheduledTransaction,
|
|
312
|
-
...accruedSchedules,
|
|
313
|
-
...oneTimeAccruals,
|
|
314
|
-
];
|
|
315
138
|
const pendingReviewSchedules = sortJEScheduledTransactions([
|
|
316
|
-
...
|
|
139
|
+
...jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft'),
|
|
317
140
|
...validResolveForPending,
|
|
318
141
|
], sortKey, sortOrder);
|
|
319
|
-
const createdSchedules = sortJEScheduledTransactions(allScheduleRows.filter((schedule) => isCreatedStatus(schedule) && matchesTypeFilter(schedule)), sortKey, sortOrder);
|
|
320
|
-
// KPI summary — derived from unfiltered schedules so counts are always accurate
|
|
321
|
-
const allSchedules = allScheduleRows;
|
|
322
|
-
const sumAmount = (schedules) => schedules.reduce((total, schedule) => total + (getScheduleAmount(schedule) ?? 0), 0);
|
|
323
|
-
const pendingReviewTotal = sumAmount(pendingReviewSchedules);
|
|
324
|
-
const createdTotal = sumAmount(createdSchedules);
|
|
325
|
-
const aiAccountantSchedules = allSchedules.filter(exports.isAiAccountantSchedule);
|
|
326
|
-
const manualSchedules = allSchedules.filter((schedule) => !(0, exports.isAiAccountantSchedule)(schedule));
|
|
327
|
-
const pendingUnfiltered = allSchedules.filter((schedule) => isPendingReviewRow(schedule));
|
|
328
|
-
const kpiSummary = {
|
|
329
|
-
aiAccountant: {
|
|
330
|
-
count: aiAccountantSchedules.length,
|
|
331
|
-
amount: sumAmount(aiAccountantSchedules),
|
|
332
|
-
},
|
|
333
|
-
manual: {
|
|
334
|
-
count: manualSchedules.length,
|
|
335
|
-
amount: sumAmount(manualSchedules),
|
|
336
|
-
},
|
|
337
|
-
needsReview: {
|
|
338
|
-
count: pendingUnfiltered.length,
|
|
339
|
-
amount: sumAmount(pendingUnfiltered),
|
|
340
|
-
},
|
|
341
|
-
total: {
|
|
342
|
-
count: allSchedules.length,
|
|
343
|
-
amount: sumAmount(allSchedules),
|
|
344
|
-
},
|
|
345
|
-
};
|
|
346
|
-
// Each tab's badge counts from that tab's own bucket. A tab that has not been fetched yet
|
|
347
|
-
// reports undefined rather than 0, so the UI can hide the badge instead of asserting "none".
|
|
348
|
-
const scheduleCountsByTab = {};
|
|
349
|
-
jeSchedulesViewState_1.ALL_JE_PAGE_TABS.forEach((pageTab) => {
|
|
350
|
-
const periodTabKey = monthYearPeriodId != null
|
|
351
|
-
? (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(pageTab, monthYearPeriodId)
|
|
352
|
-
: null;
|
|
353
|
-
const transactionKeys = periodTabKey != null
|
|
354
|
-
? jeScheduleTransactionKeysByPeriodAndTab[periodTabKey]
|
|
355
|
-
: undefined;
|
|
356
|
-
if (transactionKeys == null) {
|
|
357
|
-
return;
|
|
358
|
-
}
|
|
359
|
-
const accruedKeys = (periodTabKey != null
|
|
360
|
-
? jeScheduleAccruedKeysByPeriodAndTab[periodTabKey]
|
|
361
|
-
: undefined) ?? [];
|
|
362
|
-
const oneTimeAccrualKeys = (periodTabKey != null
|
|
363
|
-
? jeScheduleOneTimeAccrualKeysByPeriodAndTab[periodTabKey]
|
|
364
|
-
: undefined) ?? [];
|
|
365
|
-
const rowsForTab = [
|
|
366
|
-
...transactionKeys.map((transactionKey) => (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(transactionKey, state)),
|
|
367
|
-
...accruedKeys
|
|
368
|
-
.map((accruedKey) => (0, jeSchedulesSelector_1.getJEAccruedScheduleByJEScheduleKey)(accruedKey, state))
|
|
369
|
-
.filter((accruedRow) => accruedRow != null),
|
|
370
|
-
...oneTimeAccrualKeys
|
|
371
|
-
.map((accrualKey) => (0, jeSchedulesSelector_1.getJEOneTimeAccrualByKey)(accrualKey, state.jeSchedulesState))
|
|
372
|
-
.filter((accrualRow) => accrualRow != null && isRenderableOneTimeAccrual(accrualRow)),
|
|
373
|
-
];
|
|
374
|
-
scheduleCountsByTab[pageTab] =
|
|
375
|
-
pageTab === 'existing_schedules'
|
|
376
|
-
? rowsForTab.filter((row) => isExistingTabRow(row)).length
|
|
377
|
-
: rowsForTab.filter((row) => isPendingReviewRow(row) || isCreatedStatus(row)).length;
|
|
378
|
-
});
|
|
379
142
|
const allSteps = monthYearPeriodId != null
|
|
380
143
|
? (0, getAllStepsHelper_1.getAllSteps)(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
|
|
381
144
|
: [];
|
|
@@ -388,20 +151,6 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
388
151
|
{ fetchState, error },
|
|
389
152
|
monthEndFetchState,
|
|
390
153
|
]);
|
|
391
|
-
const countByType = (schedules) => {
|
|
392
|
-
const counts = jeSchedulesTypes_1.ALL_SCHEDULES_TYPES.reduce((acc, type) => ({ ...acc, [type]: 0 }), {});
|
|
393
|
-
schedules.forEach((schedule) => {
|
|
394
|
-
const scheduleType = getJEScheduleRowType(schedule);
|
|
395
|
-
if (scheduleType != null) {
|
|
396
|
-
counts[scheduleType] += 1;
|
|
397
|
-
}
|
|
398
|
-
});
|
|
399
|
-
return counts;
|
|
400
|
-
};
|
|
401
|
-
const jeScheduleTypeCounts = {
|
|
402
|
-
active: countByType(allSchedules.filter((schedule) => isPendingReviewRow(schedule) || isCreatedStatus(schedule))),
|
|
403
|
-
ongoing: countByType(allSchedules.filter((schedule) => isExistingTabRow(schedule))),
|
|
404
|
-
};
|
|
405
154
|
return {
|
|
406
155
|
uncategorizedAccounts,
|
|
407
156
|
allDepreciationAccountList: filteredDepAccounts,
|
|
@@ -410,21 +159,14 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
410
159
|
allAccountList: filteredAccounts,
|
|
411
160
|
accountListNestedAccountHierarchy,
|
|
412
161
|
allClassList: allClasses,
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
jeScheduleTypeCounts,
|
|
417
|
-
scheduleCountsByTab,
|
|
418
|
-
kpiSummary,
|
|
162
|
+
completedSchedules,
|
|
163
|
+
draftSchedules,
|
|
164
|
+
ongoingSchedules,
|
|
419
165
|
pendingReviewSchedules,
|
|
420
|
-
pendingReviewTotal,
|
|
421
166
|
resolveSchedules: resolveSchedules,
|
|
422
167
|
accountSettingsView,
|
|
423
|
-
newScheduleView,
|
|
424
168
|
postStatusById: postStatusById,
|
|
425
169
|
ignoreStatusById: ignoreStatusById,
|
|
426
|
-
revertStatusById: revertStatusById,
|
|
427
|
-
oneTimeAccrualActionStatusById: oneTimeAccrualActionStatusById,
|
|
428
170
|
fetchState: reducedFetchStatus.fetchState,
|
|
429
171
|
jeScheduleLocalDataById: jeScheduleLocalDataById,
|
|
430
172
|
uiState: uiState,
|
|
@@ -433,26 +175,3 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
433
175
|
completionStatus,
|
|
434
176
|
};
|
|
435
177
|
}
|
|
436
|
-
/**
|
|
437
|
-
* One accrual plus the status of its promote / ignore request, for the detail screen.
|
|
438
|
-
*
|
|
439
|
-
* `accrual` is undefined on a cold load — a refresh or a shared link, where the list has never run
|
|
440
|
-
* — so the screen dispatches `fetchOneTimeAccrual` and waits on `detailFetchState`. The two states
|
|
441
|
-
* are separate on purpose: `actionFetchState` drives the row spinner and the post-revert navigation,
|
|
442
|
-
* and a page load must not look like an action that just finished.
|
|
443
|
-
*/
|
|
444
|
-
function getExpenseAutomationJEOneTimeAccrualDetailView(state, accrualId) {
|
|
445
|
-
return {
|
|
446
|
-
accrual: (0, jeSchedulesSelector_1.getJEOneTimeAccrualByKey)((0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrualId), state.jeSchedulesState),
|
|
447
|
-
actionFetchState: state.expenseAutomationJESchedulesViewState
|
|
448
|
-
.oneTimeAccrualActionStatusById[accrualId] ?? {
|
|
449
|
-
fetchState: 'Not-Started',
|
|
450
|
-
error: undefined,
|
|
451
|
-
},
|
|
452
|
-
detailFetchState: state.expenseAutomationJESchedulesViewState
|
|
453
|
-
.oneTimeAccrualFetchStatusById[accrualId] ?? {
|
|
454
|
-
fetchState: 'Not-Started',
|
|
455
|
-
error: undefined,
|
|
456
|
-
},
|
|
457
|
-
};
|
|
458
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const toCompletedSubTab: (v: string) => "
|
|
1
|
+
export declare const toCompletedSubTab: (v: string) => "all" | "ai_accountant" | "manual";
|
|
2
2
|
export type CompletedSubTab = ReturnType<typeof toCompletedSubTab>;
|
|
3
3
|
/**
|
|
4
4
|
* "No sub-tab filter" sentinel — single source of truth for the default
|
|
@@ -1,31 +1,22 @@
|
|
|
1
1
|
import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
|
|
2
|
-
import { Amount } from '../../../commonStateTypes/amount';
|
|
3
2
|
import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
4
3
|
import { Recommendation } from '../../../commonStateTypes/recommendationBase';
|
|
5
4
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
6
|
-
import { MonthYearPeriodId
|
|
5
|
+
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
7
6
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
8
|
-
import {
|
|
7
|
+
import { JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
9
8
|
import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
10
|
-
|
|
11
|
-
import { JETransactionLink } from '../../scheduleView/scheduleDetailView/scheduleDetailState';
|
|
12
|
-
export declare const toJEScheduleSortKey: (v: string) => "type" | "vendor" | "category" | "class" | "memo" | "jePostingDate" | "runningBalance" | "depCategory" | "scheduleCategory" | "startMonth" | "amortizationPeriod" | "remainingMonths" | "totalAmount" | "transactionDate";
|
|
9
|
+
export declare const toJEScheduleSortKey: (v: string) => "type" | "vendor" | "category" | "class" | "memo" | "depCategory" | "scheduleCategory" | "startMonth" | "amortizationPeriod" | "jePostingDate" | "remainingMonths" | "runningBalance" | "totalAmount" | "transactionDate";
|
|
13
10
|
export type JEScheduleSortKey = ReturnType<typeof toJEScheduleSortKey>;
|
|
14
|
-
export declare const
|
|
15
|
-
export type
|
|
16
|
-
export declare const ALL_JE_PAGE_TABS: readonly JEPageTab[];
|
|
17
|
-
export type JESchedulePeriodTabKey = `${JEPageTab}_${MonthYearPeriodId}`;
|
|
18
|
-
export declare const getJESchedulePeriodTabKey: (selectedPageTab: JEPageTab, monthYearPeriodId: MonthYearPeriodId) => JESchedulePeriodTabKey;
|
|
11
|
+
export declare const toJEScheduleMainTab: (v: string) => "pending_review" | "completed" | "ongoing";
|
|
12
|
+
export type JEScheduleMainTab = ReturnType<typeof toJEScheduleMainTab>;
|
|
19
13
|
export interface JESchedulesViewUIState {
|
|
20
|
-
createdGroupCollapsed: boolean;
|
|
21
|
-
pendingGroupCollapsed: boolean;
|
|
22
14
|
scrollPosition: {
|
|
23
15
|
scrollTop: number;
|
|
24
16
|
scrollLeft?: number;
|
|
25
17
|
} | undefined;
|
|
26
18
|
searchString: string;
|
|
27
|
-
|
|
28
|
-
selectedPageTab: JEPageTab;
|
|
19
|
+
selectedMainTab: JEScheduleMainTab;
|
|
29
20
|
sortKey: JEScheduleSortKey;
|
|
30
21
|
sortOrder: SortOrder;
|
|
31
22
|
totalCount: number;
|
|
@@ -42,79 +33,14 @@ export interface JEScheduleLocalData {
|
|
|
42
33
|
}
|
|
43
34
|
export interface JESchedulesViewState extends FetchedState {
|
|
44
35
|
accountSettings: AccountSettingsState;
|
|
45
|
-
|
|
36
|
+
failedJeScheduleTransactionKeysByPeriod: Record<MonthYearPeriodId, JEScheduleTransactionKey[]>;
|
|
46
37
|
ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
|
|
47
|
-
jeScheduleAccruedKeysByPeriodAndTab: Record<JESchedulePeriodTabKey, JEScheduleKey[]>;
|
|
48
38
|
jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
|
|
49
|
-
|
|
50
|
-
jeScheduleTransactionKeysByPeriodAndTab: Record<JESchedulePeriodTabKey, JEScheduleTransactionKey[]>;
|
|
51
|
-
newSchedule: NewJeScheduleState;
|
|
52
|
-
oneTimeAccrualActionStatusById: Record<ID, FetchStateAndError>;
|
|
53
|
-
oneTimeAccrualFetchStatusById: Record<ID, FetchStateAndError>;
|
|
39
|
+
jeScheduleTransactionKeysByPeriod: Record<MonthYearPeriodId, JEScheduleTransactionKey[]>;
|
|
54
40
|
postStatusById: Record<ID, FetchStateAndError>;
|
|
55
41
|
refreshStatus: FetchStateAndError;
|
|
56
|
-
revertStatusById: Record<JEScheduleKey | JEScheduleTransactionKey, FetchStateAndError>;
|
|
57
42
|
uiState: JESchedulesViewUIState;
|
|
58
43
|
}
|
|
59
|
-
export interface NewJeDetailLocalData {
|
|
60
|
-
amount: Amount;
|
|
61
|
-
jeLink: JETransactionLink;
|
|
62
|
-
memo: string;
|
|
63
|
-
postingDate: ZeniDate;
|
|
64
|
-
postingStatus: ScheduleJournalEntryStatusCodeType;
|
|
65
|
-
runningBalance: Amount;
|
|
66
|
-
}
|
|
67
|
-
export interface NewScheduleLocalData {
|
|
68
|
-
jeScheduleDetails: NewJeDetailLocalData[];
|
|
69
|
-
scheduleType: ScheduleTypes;
|
|
70
|
-
lastDayOfMonth?: boolean;
|
|
71
|
-
selectedAccount?: ID;
|
|
72
|
-
selectedBaseTransactionId?: ScheduleTransactionID;
|
|
73
|
-
selectedClass?: ID;
|
|
74
|
-
selectedDate?: ZeniDate;
|
|
75
|
-
selectedDayOfMonth?: ScheduleDaysOfMonth;
|
|
76
|
-
selectedJEScheduleKey?: JEScheduleTransactionKey;
|
|
77
|
-
selectedMonths?: number;
|
|
78
|
-
selectedVendor?: VendorBase;
|
|
79
|
-
}
|
|
80
|
-
export interface NewScheduleLocalDataFixedAssets extends NewScheduleLocalData {
|
|
81
|
-
assetId?: string;
|
|
82
|
-
selectedAccumulatedDepreciationCategory?: ID;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* The form values for creating a one-time accrual. Not stored in the slice — a one-time accrual is
|
|
86
|
-
* created in a single POST with no draft/resume step, so this is passed straight through the action
|
|
87
|
-
* to the payload builder.
|
|
88
|
-
*/
|
|
89
|
-
export interface NewOneTimeAccrualLocalData {
|
|
90
|
-
amount: number;
|
|
91
|
-
creditAccountId: ID;
|
|
92
|
-
debitAccountId: ID;
|
|
93
|
-
memo: string;
|
|
94
|
-
reverseNextMonth: boolean;
|
|
95
|
-
serviceMonth: ZeniDate;
|
|
96
|
-
vendorId: ID;
|
|
97
|
-
vendorName: string;
|
|
98
|
-
creditAccountName?: string;
|
|
99
|
-
debitAccountName?: string;
|
|
100
|
-
debitClassId?: ID;
|
|
101
|
-
debitClassName?: string;
|
|
102
|
-
}
|
|
103
|
-
export interface SearchTransactionsState extends FetchStateAndError {
|
|
104
|
-
searchResults: JEScheduleTransactionKey[];
|
|
105
|
-
searchString?: string;
|
|
106
|
-
}
|
|
107
|
-
export declare const MIN_NEW_SCHEDULE_SEARCH_LENGTH = 2;
|
|
108
|
-
export interface NewJeScheduleState extends FetchStateAndError {
|
|
109
|
-
createOneTimeAccrualStatus: FetchStateAndError;
|
|
110
|
-
newScheduleState: {
|
|
111
|
-
fixed_assets: NewScheduleLocalDataFixedAssets;
|
|
112
|
-
prepaid_expenses: NewScheduleLocalData;
|
|
113
|
-
};
|
|
114
|
-
saveStatus: FetchStateAndError;
|
|
115
|
-
searchTransactions: SearchTransactionsState;
|
|
116
|
-
selectedDetailScheduleType?: ScheduleTypes;
|
|
117
|
-
}
|
|
118
44
|
export interface AccountSettingsLocalData {
|
|
119
45
|
previousAccruedExpensesAccount: AccountBase[];
|
|
120
46
|
previousFixedAssetsAccount: AccountBase[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toJEScheduleMainTab = exports.toJEScheduleSortKey = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
5
|
const JE_SCHEDULE_SORT_KEYS = [
|
|
6
6
|
'vendor',
|
|
@@ -20,10 +20,10 @@ const JE_SCHEDULE_SORT_KEYS = [
|
|
|
20
20
|
];
|
|
21
21
|
const toJEScheduleSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_SCHEDULE_SORT_KEYS);
|
|
22
22
|
exports.toJEScheduleSortKey = toJEScheduleSortKey;
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
exports.
|
|
23
|
+
const JE_SCHEDULE_MAIN_TABS = [
|
|
24
|
+
'pending_review',
|
|
25
|
+
'ongoing',
|
|
26
|
+
'completed',
|
|
27
|
+
];
|
|
28
|
+
const toJEScheduleMainTab = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_SCHEDULE_MAIN_TABS);
|
|
29
|
+
exports.toJEScheduleMainTab = toJEScheduleMainTab;
|
|
@@ -200,7 +200,7 @@ export interface SaveReconciliationDetailFailurePayload {
|
|
|
200
200
|
}
|
|
201
201
|
export declare const toReconciliationTabsType: (v: string) => "review" | "reconcile";
|
|
202
202
|
export declare type ReconciliationViewTabType = ReturnType<typeof toReconciliationTabsType>;
|
|
203
|
-
declare const toReconReconcileSortKeysType: (v: string) => "type" | "date" | "amount" | "memo" | "account" | "
|
|
203
|
+
declare const toReconReconcileSortKeysType: (v: string) => "type" | "date" | "amount" | "memo" | "account" | "clearedDate" | "payee" | "transactionDirection" | "recommended";
|
|
204
204
|
export declare type ReconReconcileSortKey = ReturnType<typeof toReconReconcileSortKeysType>;
|
|
205
205
|
export interface ReconciliationReconcileTabLocalData {
|
|
206
206
|
selectedTransactionIds: ID[];
|
|
@@ -37,6 +37,11 @@ export interface InvoicingCatalogItemFormView extends SelectorView {
|
|
|
37
37
|
* Folded in here so the screen never reaches for the config view itself.
|
|
38
38
|
*/
|
|
39
39
|
fieldHelp: InvoicingFieldHelpByCode;
|
|
40
|
+
/**
|
|
41
|
+
* True while the accounting lists are still loading, so the form can wait
|
|
42
|
+
* instead of mounting pickers whose options are not there yet.
|
|
43
|
+
*/
|
|
44
|
+
isQboPickerDataLoading: boolean;
|
|
40
45
|
localData: InvoicingCatalogItemFormLocalData;
|
|
41
46
|
mode: 'create' | 'edit';
|
|
42
47
|
periodUnitOptions: InvoicingNamedOption[];
|
|
@@ -59,6 +59,7 @@ const getInvoicingCatalogItemFormView = (state, id) => {
|
|
|
59
59
|
const { billingPeriodUnitOptions, catalogItemTypeOptions, catalogTierTypeOptionsByPricingModel, catalogTrialEndActionOptions, catalogTrialUnitOptions, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
60
60
|
return {
|
|
61
61
|
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'catalog'),
|
|
62
|
+
isQboPickerDataLoading: (0, invoicingQboViewSelector_1.isInvoicingAccountingPickerDataLoading)(state),
|
|
62
63
|
qboClassHierarchy: isQboConnected
|
|
63
64
|
? (0, invoicingQboViewSelector_1.getInvoicingQboView)(state).nestedClassHierarchy
|
|
64
65
|
: [],
|
|
@@ -32,6 +32,7 @@ export interface InvoicingOnboardingGateView {
|
|
|
32
32
|
acceptTermsState: FetchStateAndError;
|
|
33
33
|
enableState: FetchStateAndError;
|
|
34
34
|
fetchState: FetchState;
|
|
35
|
+
isQboConnected: boolean;
|
|
35
36
|
status?: InvoicingOnboardingStatus;
|
|
36
37
|
}
|
|
37
38
|
export declare const getInvoicingOnboardingGateView: (state: RootState) => InvoicingOnboardingGateView;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.invoicingFieldHelpForGroup = exports.getInvoicingOnboardingGateView = exports.getInvoicingConfigView = void 0;
|
|
4
|
+
const invoicingQboViewSelector_1 = require("../invoicingQboView/invoicingQboViewSelector");
|
|
4
5
|
const invoicingConfigViewPayload_1 = require("./invoicingConfigViewPayload");
|
|
5
6
|
const getInvoicingConfigView = (state) => {
|
|
6
7
|
const { acceptTermsFetchState, enableFetchState, ...configState } = state.invoicingConfigViewState;
|
|
@@ -18,6 +19,7 @@ const getInvoicingOnboardingGateView = (state) => {
|
|
|
18
19
|
acceptTermsState: acceptTermsFetchState,
|
|
19
20
|
enableState: enableFetchState,
|
|
20
21
|
fetchState,
|
|
22
|
+
isQboConnected: (0, invoicingQboViewSelector_1.isInvoicingQboConnected)(state),
|
|
21
23
|
status: (0, invoicingConfigViewPayload_1.deriveInvoicingOnboardingStatus)(state.invoicingConfigViewState.isInvoicingTosAccepted, state.invoicingConfigViewState.isInvoicingEnabled),
|
|
22
24
|
};
|
|
23
25
|
};
|