@zeniai/client-epic-state 5.2.11-betaAM4 → 5.2.11-betaAM5
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 +2 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +2 -0
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +2 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +2 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +27 -15
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -1
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +2 -1
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +1 -0
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +28 -15
- package/package.json +1 -1
|
@@ -139,7 +139,9 @@ export interface JEOneTimeAccrualClearedPayload {
|
|
|
139
139
|
reversed_at?: string | null;
|
|
140
140
|
}
|
|
141
141
|
export interface JEOneTimeAccrualMatchSuggestionPayload {
|
|
142
|
+
match_tier?: string | null;
|
|
142
143
|
matched_amount?: number | null;
|
|
144
|
+
matched_line_id?: string | null;
|
|
143
145
|
matched_transaction_id?: string | null;
|
|
144
146
|
matched_transaction_integration_id?: string | null;
|
|
145
147
|
matched_transaction_type?: string | null;
|
|
@@ -476,9 +476,11 @@ function toJEOneTimeAccrualMatchSuggestion(payload, currencyCode) {
|
|
|
476
476
|
}
|
|
477
477
|
return {
|
|
478
478
|
resolution: payload.resolution ?? undefined,
|
|
479
|
+
matchTier: payload.match_tier ?? undefined,
|
|
479
480
|
matchedTransactionIntegrationId: payload.matched_transaction_integration_id ?? undefined,
|
|
480
481
|
matchedTransactionId: payload.matched_transaction_id ?? undefined,
|
|
481
482
|
matchedTransactionType: payload.matched_transaction_type ?? undefined,
|
|
483
|
+
matchedLineId: payload.matched_line_id ?? undefined,
|
|
482
484
|
matchedAmount: payload.matched_amount != null
|
|
483
485
|
? toOneTimeAccrualAmount(payload.matched_amount, currencyCode)
|
|
484
486
|
: undefined,
|
|
@@ -212,9 +212,11 @@ export interface JEOneTimeAccrualCleared {
|
|
|
212
212
|
/** AI match suggestion on a posted on-bill-match accrual awaiting review. */
|
|
213
213
|
export interface JEOneTimeAccrualMatchSuggestion {
|
|
214
214
|
matchedAmount?: Amount;
|
|
215
|
+
matchedLineId?: string;
|
|
215
216
|
matchedTransactionId?: string;
|
|
216
217
|
matchedTransactionIntegrationId?: string;
|
|
217
218
|
matchedTransactionType?: string;
|
|
219
|
+
matchTier?: string;
|
|
218
220
|
resolution?: string;
|
|
219
221
|
}
|
|
220
222
|
export interface JEOneTimeAccrualState {
|
|
@@ -465,9 +465,11 @@ function toJEOneTimeAccrualMatchSuggestion(payload, currencyCode) {
|
|
|
465
465
|
}
|
|
466
466
|
return {
|
|
467
467
|
resolution: payload.resolution ?? undefined,
|
|
468
|
+
matchTier: payload.match_tier ?? undefined,
|
|
468
469
|
matchedTransactionIntegrationId: payload.matched_transaction_integration_id ?? undefined,
|
|
469
470
|
matchedTransactionId: payload.matched_transaction_id ?? undefined,
|
|
470
471
|
matchedTransactionType: payload.matched_transaction_type ?? undefined,
|
|
472
|
+
matchedLineId: payload.matched_line_id ?? undefined,
|
|
471
473
|
matchedAmount: payload.matched_amount != null
|
|
472
474
|
? toOneTimeAccrualAmount(payload.matched_amount, currencyCode)
|
|
473
475
|
: undefined,
|
package/lib/esm/index.js
CHANGED
|
@@ -871,4 +871,4 @@ export { getInvoicingOnboardingGateView } from './view/invoicing/invoicingConfig
|
|
|
871
871
|
// Accrued JE schedules are not a discriminated union member, so consumers need this guard to
|
|
872
872
|
// narrow a JEScheduleRow before reading baseTransaction / recurringAmount.
|
|
873
873
|
export { getExpenseAutomationJEOneTimeAccrualDetailView, getJEScheduleRowType, isAccruedScheduleRow, isAiAccountantSchedule, isExistingTabRow, isOneTimeAccrualRow, isRenderableOneTimeAccrual, isPendingReviewRow, } from './view/expenseAutomationView/selectors/jeSchedulesViewSelector';
|
|
874
|
-
export { getActualMatchingAmount, getActualMatchingReversalDate, getExpenseAutomationActualMatchingView, isAutoReversedAccrual, isPendingReviewAccrual, } from './view/expenseAutomationView/selectors/actualMatchingViewSelector';
|
|
874
|
+
export { getActualMatchingAmount, getActualMatchingReversalDate, getExpenseAutomationActualMatchingView, isAutoReversedAccrual, isManuallyReversedAccrual, isPendingReviewAccrual, } from './view/expenseAutomationView/selectors/actualMatchingViewSelector';
|
|
@@ -6,6 +6,10 @@ export function isAutoReversedAccrual(accrual) {
|
|
|
6
6
|
return (accrual.accrualStatus === 'reversed' &&
|
|
7
7
|
accrual.reversalTrigger === 'bill_match');
|
|
8
8
|
}
|
|
9
|
+
export function isManuallyReversedAccrual(accrual) {
|
|
10
|
+
return (accrual.accrualStatus === 'reversed' &&
|
|
11
|
+
accrual.reversalTrigger === 'manual_reverse');
|
|
12
|
+
}
|
|
9
13
|
export function isPendingReviewAccrual(accrual) {
|
|
10
14
|
if (accrual.accrualStatus !== 'posted' || accrual.matchSuggestion == null) {
|
|
11
15
|
return false;
|
|
@@ -14,10 +18,12 @@ export function isPendingReviewAccrual(accrual) {
|
|
|
14
18
|
return resolution == null || resolution.length === 0;
|
|
15
19
|
}
|
|
16
20
|
export function getActualMatchingAmount(accrual) {
|
|
17
|
-
return (accrual.cleared?.matchedAmount?.amount ??
|
|
21
|
+
return (accrual.cleared?.matchedAmount?.amount ??
|
|
22
|
+
accrual.matchSuggestion?.matchedAmount?.amount ??
|
|
23
|
+
accrual.estimatedAmount.amount);
|
|
18
24
|
}
|
|
19
25
|
export function getActualMatchingReversalDate(accrual) {
|
|
20
|
-
if (!isAutoReversedAccrual(accrual)) {
|
|
26
|
+
if (!isAutoReversedAccrual(accrual) && !isManuallyReversedAccrual(accrual)) {
|
|
21
27
|
return undefined;
|
|
22
28
|
}
|
|
23
29
|
return accrual.actualReversalPostDate ?? accrual.cleared?.reversedAt;
|
|
@@ -26,9 +32,9 @@ function toActualMatchingRow(accrual, kind) {
|
|
|
26
32
|
return {
|
|
27
33
|
...accrual,
|
|
28
34
|
kind,
|
|
29
|
-
reversalDate: kind === '
|
|
30
|
-
?
|
|
31
|
-
:
|
|
35
|
+
reversalDate: kind === 'pending_review'
|
|
36
|
+
? undefined
|
|
37
|
+
: getActualMatchingReversalDate(accrual),
|
|
32
38
|
};
|
|
33
39
|
}
|
|
34
40
|
function matchesSearch(accrual, searchString) {
|
|
@@ -92,32 +98,37 @@ export function getExpenseAutomationActualMatchingView(state) {
|
|
|
92
98
|
const pendingReview = sortActualMatchingRows(filtered
|
|
93
99
|
.filter(isPendingReviewAccrual)
|
|
94
100
|
.map((accrual) => toActualMatchingRow(accrual, 'pending_review')), uiState);
|
|
95
|
-
const
|
|
96
|
-
|
|
101
|
+
const manuallyReversed = sortActualMatchingRows(filtered
|
|
102
|
+
.filter(isManuallyReversedAccrual)
|
|
103
|
+
.map((accrual) => toActualMatchingRow(accrual, 'manually_reversed')), uiState);
|
|
104
|
+
const listedAccruals = accruals.filter((accrual) => isAutoReversedAccrual(accrual) ||
|
|
105
|
+
isPendingReviewAccrual(accrual) ||
|
|
106
|
+
isManuallyReversedAccrual(accrual));
|
|
107
|
+
const kpiSummary = listedAccruals.length === 0
|
|
97
108
|
? emptyKpiSummary()
|
|
98
109
|
: {
|
|
99
110
|
autoReversed: {
|
|
100
|
-
count:
|
|
101
|
-
amount:
|
|
111
|
+
count: listedAccruals.filter(isAutoReversedAccrual).length,
|
|
112
|
+
amount: listedAccruals
|
|
102
113
|
.filter(isAutoReversedAccrual)
|
|
103
114
|
.reduce((sum, accrual) => sum + getActualMatchingAmount(accrual), 0),
|
|
104
115
|
},
|
|
105
116
|
pendingReview: {
|
|
106
|
-
count:
|
|
107
|
-
amount:
|
|
117
|
+
count: listedAccruals.filter(isPendingReviewAccrual).length,
|
|
118
|
+
amount: listedAccruals
|
|
108
119
|
.filter(isPendingReviewAccrual)
|
|
109
120
|
.reduce((sum, accrual) => sum + getActualMatchingAmount(accrual), 0),
|
|
110
121
|
},
|
|
111
122
|
totalThisClose: {
|
|
112
|
-
count:
|
|
113
|
-
amount:
|
|
123
|
+
count: listedAccruals.length,
|
|
124
|
+
amount: listedAccruals.reduce((sum, accrual) => sum + getActualMatchingAmount(accrual), 0),
|
|
114
125
|
},
|
|
115
126
|
ai: {
|
|
116
|
-
count:
|
|
127
|
+
count: listedAccruals.filter((accrual) => accrual.origin === 'agent')
|
|
117
128
|
.length,
|
|
118
129
|
},
|
|
119
130
|
manual: {
|
|
120
|
-
count:
|
|
131
|
+
count: listedAccruals.filter((accrual) => accrual.origin === 'human')
|
|
121
132
|
.length,
|
|
122
133
|
},
|
|
123
134
|
};
|
|
@@ -129,6 +140,7 @@ export function getExpenseAutomationActualMatchingView(state) {
|
|
|
129
140
|
error,
|
|
130
141
|
autoReversed,
|
|
131
142
|
pendingReview,
|
|
143
|
+
manuallyReversed,
|
|
132
144
|
kpiSummary,
|
|
133
145
|
uiState,
|
|
134
146
|
refreshStatus,
|
package/lib/index.d.ts
CHANGED
|
@@ -1265,4 +1265,4 @@ export type { InvoicingOnboardingGateView } from './view/invoicing/invoicingConf
|
|
|
1265
1265
|
export type { InvoicingConfigView } from './view/invoicing/invoicingConfigView/invoicingConfigViewSelector';
|
|
1266
1266
|
export type { InvoicingOnboardingStatus } from './view/invoicing/invoicingConfigView/invoicingConfigViewPayload';
|
|
1267
1267
|
export { getExpenseAutomationJEOneTimeAccrualDetailView, getJEScheduleRowType, isAccruedScheduleRow, isAiAccountantSchedule, isExistingTabRow, isOneTimeAccrualRow, isRenderableOneTimeAccrual, isPendingReviewRow, } from './view/expenseAutomationView/selectors/jeSchedulesViewSelector';
|
|
1268
|
-
export { getActualMatchingAmount, getActualMatchingReversalDate, getExpenseAutomationActualMatchingView, isAutoReversedAccrual, isPendingReviewAccrual, } from './view/expenseAutomationView/selectors/actualMatchingViewSelector';
|
|
1268
|
+
export { getActualMatchingAmount, getActualMatchingReversalDate, getExpenseAutomationActualMatchingView, isAutoReversedAccrual, isManuallyReversedAccrual, isPendingReviewAccrual, } from './view/expenseAutomationView/selectors/actualMatchingViewSelector';
|
package/lib/index.js
CHANGED
|
@@ -84,7 +84,7 @@ exports.getInvoicingDiscountActionState = exports.runInvoicingDiscountAction = e
|
|
|
84
84
|
exports.updateInvoicingSubscriptions = exports.removeInvoicingSubscription = exports.resetPromotionalCreditAction = exports.submitAddPromotionalCredits = exports.getInvoicingSetupIntentFetchState = exports.getInvoicingSetupIntent = exports.getInvoicingSentPaymentLinkMagicUrl = exports.getInvoicingSentPaymentLinkEmail = exports.getInvoicingPlaidLinkTokenFetchState = exports.getInvoicingPlaidLinkToken = exports.getInvoicingPaymentMethodSaveState = exports.getInvoicingPaymentLinkSendState = exports.sendInvoicingPaymentLink = exports.saveInvoicingPaymentMethod = exports.resetInvoicingCustomerPaymentMethod = exports.fetchInvoicingPlaidLinkToken = exports.createInvoicingSetupIntent = exports.getInvoicingCustomerDetail = exports.fetchInvoicingCustomerDetailPage = exports.fetchInvoicingCustomerDetail = exports.getInvoicingCustomerListView = exports.INVOICING_CUSTOMER_COLUMNS = exports.ALL_INVOICING_CUSTOMER_TAB_IDS = exports.ALL_INVOICING_CUSTOMER_SORT_KEYS = exports.updateInvoicingCustomerFilters = exports.setInvoicingCustomerActiveTab = exports.fetchInvoicingCustomerListPage = exports.fetchInvoicingCustomerList = exports.fetchInvoicingCustomerCounts = exports.updateInvoicingCustomers = exports.removeInvoicingCustomer = exports.INVOICING_LIST_PAGE_SIZE = exports.getInvoicingDataImportActionState = exports.uploadInvoicingMigrationFiles = exports.startInvoicingMigration = exports.rollbackInvoicingMigration = exports.retryInvoicingMigration = exports.connectInvoicingChargebee = exports.getInvoicingDataImportView = exports.setInvoicingActiveMigrationSessionId = exports.fetchInvoicingMigrationSessions = exports.fetchInvoicingMigrationSession = exports.fetchInvoicingMigrationDiagnostics = exports.fetchInvoicingDataImportStatus = exports.getInvoicingPaymentActionState = exports.runInvoicingPaymentAction = exports.getInvoicingDunningActionState = exports.runInvoicingDunningAction = exports.getInvoicingSubscriptionActionState = exports.runInvoicingSubscriptionAction = void 0;
|
|
85
85
|
exports.getInvoicingCouponCounts = exports.INVOICING_COUPON_COLUMNS = exports.ALL_INVOICING_COUPON_TAB_IDS = exports.ALL_INVOICING_COUPON_SORT_KEYS = exports.updateInvoicingCouponFilters = exports.setInvoicingCouponActiveTab = exports.fetchInvoicingCouponListPage = exports.fetchInvoicingCouponList = exports.fetchInvoicingCouponCounts = exports.updateInvoicingCoupons = exports.removeInvoicingCoupon = exports.getInvoicingCreditNoteDetail = exports.getInvoicingCreditNoteById = exports.fetchInvoicingCreditNoteDetail = exports.getInvoicingCreditNoteListView = 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.updateInvoicingCreditNotes = exports.removeInvoicingCreditNote = exports.getInvoicingTransactionDetail = exports.getInvoicingTransactionById = exports.fetchInvoicingTransactionDetail = exports.getInvoicingTransactionListView = 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.updateInvoicingTransactions = exports.removeInvoicingTransaction = exports.getInvoicingSubscriptionDetail = exports.getInvoicingSubscriptionById = exports.fetchInvoicingSubscriptionDetail = exports.getInvoicingSubscriptionListView = exports.INVOICING_SUBSCRIPTION_COLUMNS = exports.ALL_INVOICING_SUBSCRIPTION_TAB_IDS = exports.ALL_INVOICING_SUBSCRIPTION_SORT_KEYS = exports.updateInvoicingSubscriptionFilters = exports.setInvoicingSubscriptionActiveTab = exports.fetchInvoicingSubscriptionListPage = exports.fetchInvoicingSubscriptionList = exports.fetchInvoicingSubscriptionCounts = void 0;
|
|
86
86
|
exports.resetSaveInvoicingSettings = exports.resetInvoicingBrandingFormDraft = exports.fetchInvoicingSettings = exports.disconnectInvoicingStripe = exports.connectInvoicingStripe = exports.getInvoicingProductById = exports.getInvoicingPlanById = exports.getInvoicingCatalogItemDetail = exports.fetchInvoicingCatalogItemDetail = exports.getInvoicingCatalogListView = exports.INVOICING_PRODUCT_COLUMNS = exports.ALL_INVOICING_PRODUCT_SORT_KEYS = exports.updateInvoicingCatalogProductFilters = exports.updateInvoicingCatalogPlanFilters = exports.fetchInvoicingCatalogProductList = exports.fetchInvoicingCatalogPlanList = exports.fetchInvoicingCatalogListPage = exports.fetchInvoicingCatalogCounts = exports.updateInvoicingProducts = exports.removeInvoicingProduct = exports.updateInvoicingPlans = exports.removeInvoicingPlan = exports.mergeInvoicingPlanSubFamily = exports.getInvoicingDunningEmailPreview = exports.getInvoicingDunningCaseDetail = exports.getInvoicingDunningCaseById = exports.invalidateInvoicingDunningEmailPreview = exports.fetchInvoicingDunningEmailPreviewPage = exports.fetchInvoicingDunningCaseDetail = exports.clearInvoicingDunningCaseDetailView = exports.getInvoicingDunningCaseListView = 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.updateInvoicingDunningCases = exports.removeInvoicingDunningCase = exports.getInvoicingCouponDetail = exports.fetchInvoicingCouponDetail = exports.getInvoicingCouponById = exports.getInvoicingCouponListView = exports.getInvoicingCouponListNextCursor = exports.getInvoicingCouponListItems = exports.getInvoicingCouponListHasMore = exports.getInvoicingCouponListFilters = exports.getInvoicingCouponListFetchState = void 0;
|
|
87
|
-
exports.isPendingReviewAccrual = exports.isAutoReversedAccrual = exports.getExpenseAutomationActualMatchingView = exports.getActualMatchingReversalDate = exports.getActualMatchingAmount = exports.isPendingReviewRow = exports.isRenderableOneTimeAccrual = exports.isOneTimeAccrualRow = exports.isExistingTabRow = exports.isAiAccountantSchedule = exports.isAccruedScheduleRow = exports.getJEScheduleRowType = exports.getExpenseAutomationJEOneTimeAccrualDetailView = exports.getInvoicingOnboardingGateView = exports.getInvoicingConfigView = exports.updateInvoicingConfig = exports.resetInvoicingConfigActionStates = exports.fetchInvoicingConfig = exports.enableInvoicing = exports.acceptInvoicingTerms = exports.withInvoicingQboAccountMappingId = exports.toInvoicingQboCustomerMatchingMode = exports.toInvoicingNamedOptionsByKey = exports.getInvoicingQboAccountMappingId = exports.INVOICING_QBO_CUSTOMER_MATCHING_MODES = exports.getInvoicingQboView = exports.invoicingAccountsForQboAccountTypes = exports.INVOICING_INCOME_ACCOUNT_TYPES = exports.startInvoicingQboBackfill = exports.retryInvoicingQboSyncTask = exports.fetchInvoicingQboSyncHealth = exports.fetchInvoicingQboConnection = exports.fetchInvoicingAccountingPickers = exports.isStripeConnectedFromSettings = exports.initialInvoicingBrandingFormLocalData = exports.entityToInvoicingBrandingFormLocalData = exports.INVOICING_BUSINESS_ADDRESS_TYPE = exports.getInvoicingSettingsView = exports.getInvoicingSettingsHubView = exports.getInvoicingSettingsFetchState = exports.getInvoicingSettings = exports.getInvoicingBrandingFormView = exports.updateInvoicingSettings = exports.updateInvoicingBrandingFormDraft = exports.submitInvoicingBrandingForm = exports.saveInvoicingSettings = void 0;
|
|
87
|
+
exports.isPendingReviewAccrual = exports.isManuallyReversedAccrual = exports.isAutoReversedAccrual = exports.getExpenseAutomationActualMatchingView = exports.getActualMatchingReversalDate = exports.getActualMatchingAmount = exports.isPendingReviewRow = exports.isRenderableOneTimeAccrual = exports.isOneTimeAccrualRow = exports.isExistingTabRow = exports.isAiAccountantSchedule = exports.isAccruedScheduleRow = exports.getJEScheduleRowType = exports.getExpenseAutomationJEOneTimeAccrualDetailView = exports.getInvoicingOnboardingGateView = exports.getInvoicingConfigView = exports.updateInvoicingConfig = exports.resetInvoicingConfigActionStates = exports.fetchInvoicingConfig = exports.enableInvoicing = exports.acceptInvoicingTerms = exports.withInvoicingQboAccountMappingId = exports.toInvoicingQboCustomerMatchingMode = exports.toInvoicingNamedOptionsByKey = exports.getInvoicingQboAccountMappingId = exports.INVOICING_QBO_CUSTOMER_MATCHING_MODES = exports.getInvoicingQboView = exports.invoicingAccountsForQboAccountTypes = exports.INVOICING_INCOME_ACCOUNT_TYPES = exports.startInvoicingQboBackfill = exports.retryInvoicingQboSyncTask = exports.fetchInvoicingQboSyncHealth = exports.fetchInvoicingQboConnection = exports.fetchInvoicingAccountingPickers = exports.isStripeConnectedFromSettings = exports.initialInvoicingBrandingFormLocalData = exports.entityToInvoicingBrandingFormLocalData = exports.INVOICING_BUSINESS_ADDRESS_TYPE = exports.getInvoicingSettingsView = exports.getInvoicingSettingsHubView = exports.getInvoicingSettingsFetchState = exports.getInvoicingSettings = exports.getInvoicingBrandingFormView = exports.updateInvoicingSettings = exports.updateInvoicingBrandingFormDraft = exports.submitInvoicingBrandingForm = exports.saveInvoicingSettings = void 0;
|
|
88
88
|
const allowedValue_1 = require("./commonStateTypes/allowedValue");
|
|
89
89
|
Object.defineProperty(exports, "isAllowedValueWithCode", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithCode; } });
|
|
90
90
|
Object.defineProperty(exports, "isAllowedValueWithID", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithID; } });
|
|
@@ -3204,4 +3204,5 @@ Object.defineProperty(exports, "getActualMatchingAmount", { enumerable: true, ge
|
|
|
3204
3204
|
Object.defineProperty(exports, "getActualMatchingReversalDate", { enumerable: true, get: function () { return actualMatchingViewSelector_1.getActualMatchingReversalDate; } });
|
|
3205
3205
|
Object.defineProperty(exports, "getExpenseAutomationActualMatchingView", { enumerable: true, get: function () { return actualMatchingViewSelector_1.getExpenseAutomationActualMatchingView; } });
|
|
3206
3206
|
Object.defineProperty(exports, "isAutoReversedAccrual", { enumerable: true, get: function () { return actualMatchingViewSelector_1.isAutoReversedAccrual; } });
|
|
3207
|
+
Object.defineProperty(exports, "isManuallyReversedAccrual", { enumerable: true, get: function () { return actualMatchingViewSelector_1.isManuallyReversedAccrual; } });
|
|
3207
3208
|
Object.defineProperty(exports, "isPendingReviewAccrual", { enumerable: true, get: function () { return actualMatchingViewSelector_1.isPendingReviewAccrual; } });
|
|
@@ -3,7 +3,7 @@ import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndRep
|
|
|
3
3
|
import { JEOneTimeAccrual } from '../../../entity/jeSchedules/jeSchedulesSelector';
|
|
4
4
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
5
5
|
import { ActualMatchingTransactionSearchResult, ActualMatchingViewUIState, MatchAndReverseResult } from '../types/actualMatchingViewState';
|
|
6
|
-
export type ActualMatchingRowKind = 'auto_reversed' | 'pending_review';
|
|
6
|
+
export type ActualMatchingRowKind = 'auto_reversed' | 'pending_review' | 'manually_reversed';
|
|
7
7
|
export interface ActualMatchingRow extends JEOneTimeAccrual {
|
|
8
8
|
kind: ActualMatchingRowKind;
|
|
9
9
|
reversalDate?: ZeniDate;
|
|
@@ -51,6 +51,7 @@ export interface ExpenseAutomationActualMatchingViewSelector extends SelectorVie
|
|
|
51
51
|
autoReversed: ActualMatchingRow[];
|
|
52
52
|
hasLoadedForSelectedPeriod: boolean;
|
|
53
53
|
kpiSummary: ActualMatchingKpiSummary;
|
|
54
|
+
manuallyReversed: ActualMatchingRow[];
|
|
54
55
|
matchModal: ActualMatchingMatchModalView;
|
|
55
56
|
pendingReview: ActualMatchingRow[];
|
|
56
57
|
refreshStatus: FetchStateAndError;
|
|
@@ -3,6 +3,7 @@ import { RootState } from '../../../rootStateTypes';
|
|
|
3
3
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
4
4
|
import { ExpenseAutomationActualMatchingViewSelector } from '../selectorTypes/actualMatchingViewSelectorTypes';
|
|
5
5
|
export declare function isAutoReversedAccrual(accrual: JEOneTimeAccrual): boolean;
|
|
6
|
+
export declare function isManuallyReversedAccrual(accrual: JEOneTimeAccrual): boolean;
|
|
6
7
|
export declare function isPendingReviewAccrual(accrual: JEOneTimeAccrual): boolean;
|
|
7
8
|
export declare function getActualMatchingAmount(accrual: JEOneTimeAccrual): number;
|
|
8
9
|
export declare function getActualMatchingReversalDate(accrual: JEOneTimeAccrual): ZeniDate | undefined;
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.isAutoReversedAccrual = isAutoReversedAccrual;
|
|
7
|
+
exports.isManuallyReversedAccrual = isManuallyReversedAccrual;
|
|
7
8
|
exports.isPendingReviewAccrual = isPendingReviewAccrual;
|
|
8
9
|
exports.getActualMatchingAmount = getActualMatchingAmount;
|
|
9
10
|
exports.getActualMatchingReversalDate = getActualMatchingReversalDate;
|
|
@@ -16,6 +17,10 @@ function isAutoReversedAccrual(accrual) {
|
|
|
16
17
|
return (accrual.accrualStatus === 'reversed' &&
|
|
17
18
|
accrual.reversalTrigger === 'bill_match');
|
|
18
19
|
}
|
|
20
|
+
function isManuallyReversedAccrual(accrual) {
|
|
21
|
+
return (accrual.accrualStatus === 'reversed' &&
|
|
22
|
+
accrual.reversalTrigger === 'manual_reverse');
|
|
23
|
+
}
|
|
19
24
|
function isPendingReviewAccrual(accrual) {
|
|
20
25
|
if (accrual.accrualStatus !== 'posted' || accrual.matchSuggestion == null) {
|
|
21
26
|
return false;
|
|
@@ -24,10 +29,12 @@ function isPendingReviewAccrual(accrual) {
|
|
|
24
29
|
return resolution == null || resolution.length === 0;
|
|
25
30
|
}
|
|
26
31
|
function getActualMatchingAmount(accrual) {
|
|
27
|
-
return (accrual.cleared?.matchedAmount?.amount ??
|
|
32
|
+
return (accrual.cleared?.matchedAmount?.amount ??
|
|
33
|
+
accrual.matchSuggestion?.matchedAmount?.amount ??
|
|
34
|
+
accrual.estimatedAmount.amount);
|
|
28
35
|
}
|
|
29
36
|
function getActualMatchingReversalDate(accrual) {
|
|
30
|
-
if (!isAutoReversedAccrual(accrual)) {
|
|
37
|
+
if (!isAutoReversedAccrual(accrual) && !isManuallyReversedAccrual(accrual)) {
|
|
31
38
|
return undefined;
|
|
32
39
|
}
|
|
33
40
|
return accrual.actualReversalPostDate ?? accrual.cleared?.reversedAt;
|
|
@@ -36,9 +43,9 @@ function toActualMatchingRow(accrual, kind) {
|
|
|
36
43
|
return {
|
|
37
44
|
...accrual,
|
|
38
45
|
kind,
|
|
39
|
-
reversalDate: kind === '
|
|
40
|
-
?
|
|
41
|
-
:
|
|
46
|
+
reversalDate: kind === 'pending_review'
|
|
47
|
+
? undefined
|
|
48
|
+
: getActualMatchingReversalDate(accrual),
|
|
42
49
|
};
|
|
43
50
|
}
|
|
44
51
|
function matchesSearch(accrual, searchString) {
|
|
@@ -102,32 +109,37 @@ function getExpenseAutomationActualMatchingView(state) {
|
|
|
102
109
|
const pendingReview = sortActualMatchingRows(filtered
|
|
103
110
|
.filter(isPendingReviewAccrual)
|
|
104
111
|
.map((accrual) => toActualMatchingRow(accrual, 'pending_review')), uiState);
|
|
105
|
-
const
|
|
106
|
-
|
|
112
|
+
const manuallyReversed = sortActualMatchingRows(filtered
|
|
113
|
+
.filter(isManuallyReversedAccrual)
|
|
114
|
+
.map((accrual) => toActualMatchingRow(accrual, 'manually_reversed')), uiState);
|
|
115
|
+
const listedAccruals = accruals.filter((accrual) => isAutoReversedAccrual(accrual) ||
|
|
116
|
+
isPendingReviewAccrual(accrual) ||
|
|
117
|
+
isManuallyReversedAccrual(accrual));
|
|
118
|
+
const kpiSummary = listedAccruals.length === 0
|
|
107
119
|
? emptyKpiSummary()
|
|
108
120
|
: {
|
|
109
121
|
autoReversed: {
|
|
110
|
-
count:
|
|
111
|
-
amount:
|
|
122
|
+
count: listedAccruals.filter(isAutoReversedAccrual).length,
|
|
123
|
+
amount: listedAccruals
|
|
112
124
|
.filter(isAutoReversedAccrual)
|
|
113
125
|
.reduce((sum, accrual) => sum + getActualMatchingAmount(accrual), 0),
|
|
114
126
|
},
|
|
115
127
|
pendingReview: {
|
|
116
|
-
count:
|
|
117
|
-
amount:
|
|
128
|
+
count: listedAccruals.filter(isPendingReviewAccrual).length,
|
|
129
|
+
amount: listedAccruals
|
|
118
130
|
.filter(isPendingReviewAccrual)
|
|
119
131
|
.reduce((sum, accrual) => sum + getActualMatchingAmount(accrual), 0),
|
|
120
132
|
},
|
|
121
133
|
totalThisClose: {
|
|
122
|
-
count:
|
|
123
|
-
amount:
|
|
134
|
+
count: listedAccruals.length,
|
|
135
|
+
amount: listedAccruals.reduce((sum, accrual) => sum + getActualMatchingAmount(accrual), 0),
|
|
124
136
|
},
|
|
125
137
|
ai: {
|
|
126
|
-
count:
|
|
138
|
+
count: listedAccruals.filter((accrual) => accrual.origin === 'agent')
|
|
127
139
|
.length,
|
|
128
140
|
},
|
|
129
141
|
manual: {
|
|
130
|
-
count:
|
|
142
|
+
count: listedAccruals.filter((accrual) => accrual.origin === 'human')
|
|
131
143
|
.length,
|
|
132
144
|
},
|
|
133
145
|
};
|
|
@@ -139,6 +151,7 @@ function getExpenseAutomationActualMatchingView(state) {
|
|
|
139
151
|
error,
|
|
140
152
|
autoReversed,
|
|
141
153
|
pendingReview,
|
|
154
|
+
manuallyReversed,
|
|
142
155
|
kpiSummary,
|
|
143
156
|
uiState,
|
|
144
157
|
refreshStatus,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.2.11-
|
|
3
|
+
"version": "5.2.11-betaAM5",
|
|
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",
|