@zeniai/client-epic-state 5.1.88-betaRD5 → 5.1.88-betaRD7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/index.js +1 -1
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +7 -2
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +14 -6
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +6 -1
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +8 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +15 -6
- package/package.json +1 -1
package/lib/esm/index.js
CHANGED
|
@@ -853,4 +853,4 @@ export { acceptInvoicingTerms, clearInvoicingConfig, enableInvoicing, fetchInvoi
|
|
|
853
853
|
export { getInvoicingConfigView } from './view/invoicing/invoicingConfigView/invoicingConfigViewSelector';
|
|
854
854
|
// Accrued JE schedules are not a discriminated union member, so consumers need this guard to
|
|
855
855
|
// narrow a JEScheduleRow before reading baseTransaction / recurringAmount.
|
|
856
|
-
export { getExpenseAutomationJEOneTimeAccrualDetailView, getJEScheduleRowType, isAccruedScheduleRow, isAiAccountantSchedule, isExistingTabRow, isOneTimeAccrualRow, isPendingReviewRow, } from './view/expenseAutomationView/selectors/jeSchedulesViewSelector';
|
|
856
|
+
export { getExpenseAutomationJEOneTimeAccrualDetailView, getJEScheduleRowType, isAccruedScheduleRow, isAiAccountantSchedule, isExistingTabRow, isOneTimeAccrualRow, isRenderableOneTimeAccrual, isPendingReviewRow, } from './view/expenseAutomationView/selectors/jeSchedulesViewSelector';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { from, of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
2
|
+
import { catchError, filter, mergeMap, takeUntil } from 'rxjs/operators';
|
|
3
3
|
import { DEFAULT_DATE_FORMAT } from '../../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY';
|
|
4
4
|
import { toAbsoluteDay, toString } from '../../../../commonStateTypes/timePeriod';
|
|
5
5
|
import { updateAccruedJESchedules, updateAccruedJESchedulesDetails, updateJEOneTimeAccruals, updateJESchedules, updateJESchedulesDetails, } from '../../../../entity/jeSchedules/jeSchedulesReducer';
|
|
6
6
|
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
7
7
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
8
|
+
import { clearAll } from '../../../../rootActions';
|
|
8
9
|
import { date } from '../../../../zeniDayJS';
|
|
9
10
|
import { fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesSuccess, initializeJeScheduleLocalData, } from '../../reducers/jeSchedulesViewReducer';
|
|
10
11
|
export const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchJeSchedules.match), mergeMap((action) => {
|
|
@@ -77,5 +78,9 @@ export const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe
|
|
|
77
78
|
JSON.stringify(error)),
|
|
78
79
|
selectedPeriod,
|
|
79
80
|
selectedPageTab,
|
|
80
|
-
})))
|
|
81
|
+
}))),
|
|
82
|
+
// A tenant switch clears the store while this request is still in flight. Without this
|
|
83
|
+
// the old tenant's rows are written back into the freshly cleared store and stay on
|
|
84
|
+
// screen under the new tenant until a manual refresh.
|
|
85
|
+
takeUntil(actions$.pipe(filter(clearAll.match))));
|
|
81
86
|
}));
|
|
@@ -25,13 +25,21 @@ const BOT_EMAIL = 'bot@zeni.ai';
|
|
|
25
25
|
// A one-time accrual has no jeScheduleType of its own — it is not a JE schedule. It is still an
|
|
26
26
|
// accrued expense, so it counts and filters under that type on the page's type tabs.
|
|
27
27
|
const ONE_TIME_ACCRUAL_SCHEDULE_TYPE = 'accrued_expenses';
|
|
28
|
-
// Which of the two list buckets an accrual belongs in. `draft` still needs a human to post it
|
|
29
|
-
//
|
|
30
|
-
// books or in a transient claim.
|
|
28
|
+
// Which of the two list buckets an accrual belongs in. `draft` still needs a human to post it;
|
|
29
|
+
// everything else is already on the books or in a transient claim.
|
|
31
30
|
const ONE_TIME_ACCRUAL_REVIEW_STATUSES = [
|
|
32
31
|
'draft',
|
|
33
|
-
'posting_blocked',
|
|
34
32
|
];
|
|
33
|
+
/**
|
|
34
|
+
* `posting_blocked` is written by the posting Cron when a JE fails to post. It is an internal
|
|
35
|
+
* failure state with no human action attached, so it is dropped here rather than hidden at render
|
|
36
|
+
* time — filtering in the view would leave the group counts and KPI totals counting rows nobody
|
|
37
|
+
* can see. The expense-automation endpoint applies no status filter on the close-period path, so
|
|
38
|
+
* these rows do arrive.
|
|
39
|
+
*/
|
|
40
|
+
export function isRenderableOneTimeAccrual(accrual) {
|
|
41
|
+
return accrual.accrualStatus !== 'posting_blocked';
|
|
42
|
+
}
|
|
35
43
|
export function getJEScheduleRowType(schedule) {
|
|
36
44
|
return isOneTimeAccrualRow(schedule)
|
|
37
45
|
? ONE_TIME_ACCRUAL_SCHEDULE_TYPE
|
|
@@ -242,7 +250,7 @@ export function getExpenseAutomationJESchedulesView(state) {
|
|
|
242
250
|
: undefined) ?? [];
|
|
243
251
|
jeScheduleOneTimeAccrualKeys.forEach((jeOneTimeAccrualKey) => {
|
|
244
252
|
const accrual = getJEOneTimeAccrualByKey(jeOneTimeAccrualKey, state.jeSchedulesState);
|
|
245
|
-
if (accrual != null) {
|
|
253
|
+
if (accrual != null && isRenderableOneTimeAccrual(accrual)) {
|
|
246
254
|
oneTimeAccruals.push(accrual);
|
|
247
255
|
}
|
|
248
256
|
});
|
|
@@ -346,7 +354,7 @@ export function getExpenseAutomationJESchedulesView(state) {
|
|
|
346
354
|
.filter((accruedRow) => accruedRow != null),
|
|
347
355
|
...oneTimeAccrualKeys
|
|
348
356
|
.map((accrualKey) => getJEOneTimeAccrualByKey(accrualKey, state.jeSchedulesState))
|
|
349
|
-
.filter((accrualRow) => accrualRow != null),
|
|
357
|
+
.filter((accrualRow) => accrualRow != null && isRenderableOneTimeAccrual(accrualRow)),
|
|
350
358
|
];
|
|
351
359
|
scheduleCountsByTab[pageTab] =
|
|
352
360
|
pageTab === 'existing_schedules'
|
package/lib/index.d.ts
CHANGED
|
@@ -1227,4 +1227,4 @@ export { acceptInvoicingTerms, clearInvoicingConfig, enableInvoicing, fetchInvoi
|
|
|
1227
1227
|
export { getInvoicingConfigView } from './view/invoicing/invoicingConfigView/invoicingConfigViewSelector';
|
|
1228
1228
|
export type { InvoicingConfigView } from './view/invoicing/invoicingConfigView/invoicingConfigViewSelector';
|
|
1229
1229
|
export type { InvoicingOnboardingStatus } from './view/invoicing/invoicingConfigView/invoicingConfigViewPayload';
|
|
1230
|
-
export { getExpenseAutomationJEOneTimeAccrualDetailView, getJEScheduleRowType, isAccruedScheduleRow, isAiAccountantSchedule, isExistingTabRow, isOneTimeAccrualRow, isPendingReviewRow, } from './view/expenseAutomationView/selectors/jeSchedulesViewSelector';
|
|
1230
|
+
export { getExpenseAutomationJEOneTimeAccrualDetailView, getJEScheduleRowType, isAccruedScheduleRow, isAiAccountantSchedule, isExistingTabRow, isOneTimeAccrualRow, isRenderableOneTimeAccrual, isPendingReviewRow, } from './view/expenseAutomationView/selectors/jeSchedulesViewSelector';
|
package/lib/index.js
CHANGED
|
@@ -85,7 +85,7 @@ exports.ALL_INVOICING_SUBSCRIPTION_SORT_KEYS = exports.updateInvoicingSubscripti
|
|
|
85
85
|
exports.fetchInvoicingCouponListPage = exports.fetchInvoicingCouponList = exports.fetchInvoicingCouponCounts = exports.clearInvoicingCouponView = exports.updateInvoicingCoupons = exports.removeInvoicingCoupon = exports.clearAllInvoicingCoupons = exports.getInvoicingCreditNoteDetail = exports.getInvoicingCreditNoteById = exports.fetchInvoicingCreditNoteDetail = exports.clearInvoicingCreditNoteDetailView = exports.getInvoicingCreditNoteListView = exports.INVOICING_CREDIT_NOTE_TABS = exports.INVOICING_CREDIT_NOTE_COLUMNS = exports.ALL_INVOICING_CREDIT_NOTE_TAB_IDS = exports.ALL_INVOICING_CREDIT_NOTE_SORT_KEYS = exports.updateInvoicingCreditNoteFilters = exports.setInvoicingCreditNoteActiveTab = exports.fetchInvoicingCreditNoteListPage = exports.fetchInvoicingCreditNoteList = exports.fetchInvoicingCreditNoteCounts = exports.clearInvoicingCreditNoteListView = exports.updateInvoicingCreditNotes = exports.removeInvoicingCreditNote = exports.clearAllInvoicingCreditNotes = exports.getInvoicingTransactionDetail = exports.getInvoicingTransactionById = exports.fetchInvoicingTransactionDetail = exports.clearInvoicingTransactionDetailView = exports.getInvoicingTransactionListView = exports.INVOICING_TRANSACTION_TABS = exports.INVOICING_TRANSACTION_COLUMNS = exports.ALL_INVOICING_TRANSACTION_TAB_IDS = exports.ALL_INVOICING_TRANSACTION_SORT_KEYS = exports.updateInvoicingTransactionFilters = exports.setInvoicingTransactionActiveTab = exports.fetchInvoicingTransactionListPage = exports.fetchInvoicingTransactionList = exports.clearInvoicingTransactionListView = exports.updateInvoicingTransactions = exports.removeInvoicingTransaction = exports.clearAllInvoicingTransactions = exports.getInvoicingSubscriptionDetail = exports.getInvoicingSubscriptionById = exports.fetchInvoicingSubscriptionDetail = exports.clearInvoicingSubscriptionDetailView = exports.getInvoicingSubscriptionListView = exports.INVOICING_SUBSCRIPTION_TABS = exports.INVOICING_SUBSCRIPTION_COLUMNS = exports.ALL_INVOICING_SUBSCRIPTION_TAB_IDS = void 0;
|
|
86
86
|
exports.fetchInvoicingCatalogProductList = exports.fetchInvoicingCatalogPlanList = exports.fetchInvoicingCatalogListPage = exports.fetchInvoicingCatalogCounts = exports.clearInvoicingCatalogListView = exports.updateInvoicingProducts = exports.removeInvoicingProduct = exports.clearAllInvoicingProducts = exports.updateInvoicingPlans = exports.removeInvoicingPlan = exports.mergeInvoicingPlanSubFamily = exports.clearAllInvoicingPlans = exports.getInvoicingDunningEmailPreview = exports.getInvoicingDunningCaseDetail = exports.getInvoicingDunningCaseById = exports.invalidateInvoicingDunningEmailPreview = exports.fetchInvoicingDunningEmailPreviewPage = exports.fetchInvoicingDunningCaseDetail = exports.clearInvoicingDunningCaseDetailView = exports.getInvoicingDunningCaseListView = exports.INVOICING_DUNNING_CASE_TABS = exports.INVOICING_DUNNING_CASE_COLUMNS = exports.ALL_INVOICING_DUNNING_CASE_TAB_IDS = exports.ALL_INVOICING_DUNNING_CASE_SORT_KEYS = exports.updateInvoicingDunningCaseFilters = exports.setInvoicingDunningCaseActiveTab = exports.fetchInvoicingDunningCaseListPage = exports.fetchInvoicingDunningCaseList = exports.fetchInvoicingDunningCaseCounts = exports.clearInvoicingDunningCaseListView = exports.updateInvoicingDunningCases = exports.removeInvoicingDunningCase = exports.clearAllInvoicingDunningCases = exports.getInvoicingCouponDetail = exports.fetchInvoicingCouponDetail = exports.clearInvoicingCouponDetailView = exports.getInvoicingCouponById = exports.getInvoicingCouponListView = exports.getInvoicingCouponListNextCursor = exports.getInvoicingCouponListItems = exports.getInvoicingCouponListHasMore = exports.getInvoicingCouponListFilters = exports.getInvoicingCouponListFetchState = exports.getInvoicingCouponCounts = exports.INVOICING_COUPON_TABS = exports.INVOICING_COUPON_COLUMNS = exports.ALL_INVOICING_COUPON_TAB_IDS = exports.ALL_INVOICING_COUPON_SORT_KEYS = exports.updateInvoicingCouponFilters = exports.setInvoicingCouponActiveTab = void 0;
|
|
87
87
|
exports.isAccruedScheduleRow = exports.getJEScheduleRowType = exports.getExpenseAutomationJEOneTimeAccrualDetailView = exports.getInvoicingConfigView = exports.updateInvoicingConfig = exports.resetInvoicingConfigActionStates = exports.fetchInvoicingConfig = exports.enableInvoicing = exports.clearInvoicingConfig = exports.acceptInvoicingTerms = exports.withInvoicingQboAccountMappingId = exports.toInvoicingQboCustomerMatchingMode = exports.getInvoicingQboAccountMappingId = exports.INVOICING_QBO_CUSTOMER_MATCHING_MODES = exports.getInvoicingQboView = exports.startInvoicingQboBackfill = exports.retryInvoicingQboSyncTask = exports.fetchInvoicingQboSyncHealth = exports.fetchInvoicingQboConnection = exports.fetchInvoicingQboClasses = exports.fetchInvoicingQboAccounts = exports.clearInvoicingQboView = exports.isStripeConnectedFromSettings = exports.initialInvoicingBrandingFormLocalData = exports.entityToInvoicingBrandingFormLocalData = exports.INVOICING_BUSINESS_ADDRESS_TYPE = exports.getInvoicingSettingsView = exports.getInvoicingSettingsFetchState = exports.getInvoicingSettings = exports.getInvoicingBrandingFormView = exports.updateInvoicingSettings = exports.updateInvoicingBrandingFormDraft = exports.submitInvoicingBrandingForm = exports.saveInvoicingSettings = exports.resetSaveInvoicingSettings = exports.resetInvoicingBrandingFormDraft = exports.fetchInvoicingSettings = exports.disconnectInvoicingStripe = exports.connectInvoicingStripe = exports.clearInvoicingSettings = exports.getInvoicingProductById = exports.getInvoicingPlanById = exports.getInvoicingCatalogItemDetail = exports.fetchInvoicingCatalogItemDetail = exports.clearInvoicingCatalogItemDetailView = exports.getInvoicingCatalogListView = exports.INVOICING_PRODUCT_COLUMNS = exports.ALL_INVOICING_PRODUCT_SORT_KEYS = exports.updateInvoicingCatalogProductFilters = exports.updateInvoicingCatalogPlanFilters = void 0;
|
|
88
|
-
exports.isPendingReviewRow = exports.isOneTimeAccrualRow = exports.isExistingTabRow = exports.isAiAccountantSchedule = void 0;
|
|
88
|
+
exports.isPendingReviewRow = exports.isRenderableOneTimeAccrual = exports.isOneTimeAccrualRow = exports.isExistingTabRow = exports.isAiAccountantSchedule = void 0;
|
|
89
89
|
const allowedValue_1 = require("./commonStateTypes/allowedValue");
|
|
90
90
|
Object.defineProperty(exports, "isAllowedValueWithCode", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithCode; } });
|
|
91
91
|
Object.defineProperty(exports, "isAllowedValueWithID", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithID; } });
|
|
@@ -3197,4 +3197,5 @@ Object.defineProperty(exports, "isAccruedScheduleRow", { enumerable: true, get:
|
|
|
3197
3197
|
Object.defineProperty(exports, "isAiAccountantSchedule", { enumerable: true, get: function () { return jeSchedulesViewSelector_1.isAiAccountantSchedule; } });
|
|
3198
3198
|
Object.defineProperty(exports, "isExistingTabRow", { enumerable: true, get: function () { return jeSchedulesViewSelector_1.isExistingTabRow; } });
|
|
3199
3199
|
Object.defineProperty(exports, "isOneTimeAccrualRow", { enumerable: true, get: function () { return jeSchedulesViewSelector_1.isOneTimeAccrualRow; } });
|
|
3200
|
+
Object.defineProperty(exports, "isRenderableOneTimeAccrual", { enumerable: true, get: function () { return jeSchedulesViewSelector_1.isRenderableOneTimeAccrual; } });
|
|
3200
3201
|
Object.defineProperty(exports, "isPendingReviewRow", { enumerable: true, get: function () { return jeSchedulesViewSelector_1.isPendingReviewRow; } });
|
|
@@ -2,7 +2,8 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { updateAccruedJESchedules, updateAccruedJESchedulesDetails, updateJEOneTimeAccruals, updateJESchedules, updateJESchedulesDetails } from '../../../../entity/jeSchedules/jeSchedulesReducer';
|
|
4
4
|
import { RootState } from '../../../../reducer';
|
|
5
|
+
import { clearAll } from '../../../../rootActions';
|
|
5
6
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
7
|
import { fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesSuccess, initializeJeScheduleLocalData } from '../../reducers/jeSchedulesViewReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof fetchJeSchedules> | ReturnType<typeof fetchJeSchedulesFailure> | ReturnType<typeof fetchJeSchedulesSuccess> | ReturnType<typeof initializeJeScheduleLocalData> | ReturnType<typeof updateAccruedJESchedules> | ReturnType<typeof updateAccruedJESchedulesDetails> | ReturnType<typeof updateJEOneTimeAccruals> | ReturnType<typeof updateJESchedules> | ReturnType<typeof updateJESchedulesDetails>;
|
|
8
|
+
export type ActionType = ReturnType<typeof clearAll> | ReturnType<typeof fetchJeSchedules> | ReturnType<typeof fetchJeSchedulesFailure> | ReturnType<typeof fetchJeSchedulesSuccess> | ReturnType<typeof initializeJeScheduleLocalData> | ReturnType<typeof updateAccruedJESchedules> | ReturnType<typeof updateAccruedJESchedulesDetails> | ReturnType<typeof updateJEOneTimeAccruals> | ReturnType<typeof updateJESchedules> | ReturnType<typeof updateJESchedulesDetails>;
|
|
8
9
|
export declare const fetchJeSchedulesEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -8,6 +8,7 @@ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
|
|
|
8
8
|
const jeSchedulesReducer_1 = require("../../../../entity/jeSchedules/jeSchedulesReducer");
|
|
9
9
|
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
10
10
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
11
|
+
const rootActions_1 = require("../../../../rootActions");
|
|
11
12
|
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
12
13
|
const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
|
|
13
14
|
const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.fetchJeSchedules.match), (0, operators_1.mergeMap)((action) => {
|
|
@@ -80,6 +81,10 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
|
|
|
80
81
|
JSON.stringify(error)),
|
|
81
82
|
selectedPeriod,
|
|
82
83
|
selectedPageTab,
|
|
83
|
-
})))
|
|
84
|
+
}))),
|
|
85
|
+
// A tenant switch clears the store while this request is still in flight. Without this
|
|
86
|
+
// the old tenant's rows are written back into the freshly cleared store and stay on
|
|
87
|
+
// screen under the new tenant until a manual refresh.
|
|
88
|
+
(0, operators_1.takeUntil)(actions$.pipe((0, operators_1.filter)(rootActions_1.clearAll.match))));
|
|
84
89
|
}));
|
|
85
90
|
exports.fetchJeSchedulesEpic = fetchJeSchedulesEpic;
|
|
@@ -3,6 +3,14 @@ import { JEAccruedSchedule, JEOneTimeAccrual, JEScheduledTransaction, ScheduledJ
|
|
|
3
3
|
import { ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
4
4
|
import { RootState } from '../../../reducer';
|
|
5
5
|
import { ExpenseAutomationJESchedulesViewSelector } from '../selectorTypes/jeSchedulesSelectorTypes';
|
|
6
|
+
/**
|
|
7
|
+
* `posting_blocked` is written by the posting Cron when a JE fails to post. It is an internal
|
|
8
|
+
* failure state with no human action attached, so it is dropped here rather than hidden at render
|
|
9
|
+
* time — filtering in the view would leave the group counts and KPI totals counting rows nobody
|
|
10
|
+
* can see. The expense-automation endpoint applies no status filter on the close-period path, so
|
|
11
|
+
* these rows do arrive.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isRenderableOneTimeAccrual(accrual: JEOneTimeAccrual): boolean;
|
|
6
14
|
export declare function getJEScheduleRowType(schedule: JEScheduleRow): ScheduleTypes | undefined;
|
|
7
15
|
export declare function isPendingReviewRow(schedule: JEScheduleRow): boolean;
|
|
8
16
|
export declare function isExistingTabRow(schedule: JEScheduleRow): boolean;
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.isAiAccountantSchedule = void 0;
|
|
7
|
+
exports.isRenderableOneTimeAccrual = isRenderableOneTimeAccrual;
|
|
7
8
|
exports.getJEScheduleRowType = getJEScheduleRowType;
|
|
8
9
|
exports.isPendingReviewRow = isPendingReviewRow;
|
|
9
10
|
exports.isExistingTabRow = isExistingTabRow;
|
|
@@ -38,13 +39,21 @@ const BOT_EMAIL = 'bot@zeni.ai';
|
|
|
38
39
|
// A one-time accrual has no jeScheduleType of its own — it is not a JE schedule. It is still an
|
|
39
40
|
// accrued expense, so it counts and filters under that type on the page's type tabs.
|
|
40
41
|
const ONE_TIME_ACCRUAL_SCHEDULE_TYPE = 'accrued_expenses';
|
|
41
|
-
// Which of the two list buckets an accrual belongs in. `draft` still needs a human to post it
|
|
42
|
-
//
|
|
43
|
-
// books or in a transient claim.
|
|
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
44
|
const ONE_TIME_ACCRUAL_REVIEW_STATUSES = [
|
|
45
45
|
'draft',
|
|
46
|
-
'posting_blocked',
|
|
47
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
|
+
}
|
|
48
57
|
function getJEScheduleRowType(schedule) {
|
|
49
58
|
return isOneTimeAccrualRow(schedule)
|
|
50
59
|
? ONE_TIME_ACCRUAL_SCHEDULE_TYPE
|
|
@@ -256,7 +265,7 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
256
265
|
: undefined) ?? [];
|
|
257
266
|
jeScheduleOneTimeAccrualKeys.forEach((jeOneTimeAccrualKey) => {
|
|
258
267
|
const accrual = (0, jeSchedulesSelector_1.getJEOneTimeAccrualByKey)(jeOneTimeAccrualKey, state.jeSchedulesState);
|
|
259
|
-
if (accrual != null) {
|
|
268
|
+
if (accrual != null && isRenderableOneTimeAccrual(accrual)) {
|
|
260
269
|
oneTimeAccruals.push(accrual);
|
|
261
270
|
}
|
|
262
271
|
});
|
|
@@ -360,7 +369,7 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
360
369
|
.filter((accruedRow) => accruedRow != null),
|
|
361
370
|
...oneTimeAccrualKeys
|
|
362
371
|
.map((accrualKey) => (0, jeSchedulesSelector_1.getJEOneTimeAccrualByKey)(accrualKey, state.jeSchedulesState))
|
|
363
|
-
.filter((accrualRow) => accrualRow != null),
|
|
372
|
+
.filter((accrualRow) => accrualRow != null && isRenderableOneTimeAccrual(accrualRow)),
|
|
364
373
|
];
|
|
365
374
|
scheduleCountsByTab[pageTab] =
|
|
366
375
|
pageTab === 'existing_schedules'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.88-
|
|
3
|
+
"version": "5.1.88-betaRD7",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|