@zeniai/client-epic-state 4.19.86-betaRD9 → 4.19.86-betaSS2
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/billPay/billTransaction/billTransactionState.d.ts +2 -2
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +35 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +44 -0
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +2 -1
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +2 -1
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +13 -0
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.js +0 -1
- package/lib/entity/tenant/tenantSelector.d.ts +0 -1
- package/lib/entity/tenant/tenantSelector.js +1 -9
- package/lib/entity/tenant/tenantState.d.ts +0 -1
- package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +44 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +2 -1
- package/lib/esm/entity/tenant/tenantReducer.js +0 -1
- package/lib/esm/entity/tenant/tenantSelector.js +0 -7
- package/lib/esm/index.js +6 -5
- package/lib/esm/view/classList/fetchClassListEpic.js +2 -3
- package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +5 -15
- package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +1 -4
- package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +1 -2
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +17 -1
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +46 -3
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +1 -1
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +15 -1
- package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -7
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +2 -7
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +6 -13
- package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +1 -2
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +14 -15
- package/lib/index.d.ts +8 -7
- package/lib/index.js +13 -11
- package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.js +1 -2
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +0 -1
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +5 -15
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +0 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +1 -4
- package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +1 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +18 -2
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +46 -3
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +1 -1
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +5 -0
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +17 -0
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -7
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +2 -7
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +6 -13
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +1 -2
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +14 -15
- package/package.json +1 -1
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
|
@@ -7,6 +7,8 @@ import { VendorTransaction } from '../../transaction/stateTypes/vendorTransactio
|
|
|
7
7
|
export interface BillTransaction extends VendorTransaction {
|
|
8
8
|
billPayInfo: BillPayInfo;
|
|
9
9
|
candidateVendorName: string;
|
|
10
|
+
classId: ID;
|
|
11
|
+
className: string;
|
|
10
12
|
createdBy: ID;
|
|
11
13
|
deletionInfo: DeletionInfo;
|
|
12
14
|
entityApprovalId: ID;
|
|
@@ -19,8 +21,6 @@ export interface BillTransaction extends VendorTransaction {
|
|
|
19
21
|
updateTime: ZeniDate;
|
|
20
22
|
bookCloseDate?: ZeniDate;
|
|
21
23
|
bulkProcessingDetail?: BulkProcessingDetail;
|
|
22
|
-
classId?: ID;
|
|
23
|
-
className?: string;
|
|
24
24
|
lastUpdatedByUserId?: ID;
|
|
25
25
|
recurringBillConfigId?: ID;
|
|
26
26
|
recurringBillInstance?: number;
|
|
@@ -13,6 +13,39 @@ export interface JEScheduleOtherAttributesPayload {
|
|
|
13
13
|
asset_id?: string | null;
|
|
14
14
|
starting_balance?: number | null;
|
|
15
15
|
}
|
|
16
|
+
export interface JEScheduleAISummaryFieldPayload {
|
|
17
|
+
confidence: number;
|
|
18
|
+
reasoning: string;
|
|
19
|
+
predicted_value?: number | string;
|
|
20
|
+
}
|
|
21
|
+
export interface JEScheduleAISummariesPayload {
|
|
22
|
+
credit_account?: JEScheduleAISummaryFieldPayload;
|
|
23
|
+
credit_accounting_class?: JEScheduleAISummaryFieldPayload;
|
|
24
|
+
debit_account?: JEScheduleAISummaryFieldPayload;
|
|
25
|
+
debit_accounting_class?: JEScheduleAISummaryFieldPayload;
|
|
26
|
+
period?: JEScheduleAISummaryFieldPayload;
|
|
27
|
+
posting_date?: JEScheduleAISummaryFieldPayload;
|
|
28
|
+
}
|
|
29
|
+
export interface JEScheduleRecommendationsPayload {
|
|
30
|
+
amortization_days?: number | null;
|
|
31
|
+
amortization_months_estimate?: number | null;
|
|
32
|
+
credit_account_confidence?: number;
|
|
33
|
+
credit_account_id?: string | null;
|
|
34
|
+
credit_accounting_class_id?: string | null;
|
|
35
|
+
credit_class_confidence?: number;
|
|
36
|
+
debit_account_confidence?: number;
|
|
37
|
+
debit_account_id?: string | null;
|
|
38
|
+
debit_accounting_class_id?: string | null;
|
|
39
|
+
debit_class_confidence?: number;
|
|
40
|
+
end_date?: string | null;
|
|
41
|
+
je_schedule_type?: string | null;
|
|
42
|
+
period?: number | null;
|
|
43
|
+
period_confidence?: number;
|
|
44
|
+
posting_date?: string | null;
|
|
45
|
+
similar_transactions?: unknown[];
|
|
46
|
+
start_date?: string | null;
|
|
47
|
+
starting_month?: string | null;
|
|
48
|
+
}
|
|
16
49
|
export interface JEScheduledTransactionPayload {
|
|
17
50
|
balance: number | null;
|
|
18
51
|
base_transaction: ScheduleTransactionPayload;
|
|
@@ -35,7 +68,9 @@ export interface JEScheduledTransactionPayload {
|
|
|
35
68
|
status: StatusCodeWithLabelPayload;
|
|
36
69
|
updated_by: UserPayload;
|
|
37
70
|
vendor: VendorPayload;
|
|
71
|
+
ai_summaries?: JEScheduleAISummariesPayload;
|
|
38
72
|
end_date?: string | null;
|
|
73
|
+
recommendations?: JEScheduleRecommendationsPayload;
|
|
39
74
|
updated_at?: string | null;
|
|
40
75
|
}
|
|
41
76
|
export interface JEAccruedScheduledTransactionPayload extends Omit<JEScheduledTransactionPayload, 'base_transaction' | 'je_schedule_id' | 'je_schedule_type'> {
|
|
@@ -144,6 +144,49 @@ function toJEScheduleOtherAttributes(payload) {
|
|
|
144
144
|
assetId: payload.asset_id ?? undefined,
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
|
+
function toJEScheduleAIRecommendations(payload) {
|
|
148
|
+
if (payload == null) {
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
const result = {};
|
|
152
|
+
if (payload.debit_account != null) {
|
|
153
|
+
result.debitAccount = {
|
|
154
|
+
confidence: payload.debit_account.confidence,
|
|
155
|
+
reasoning: payload.debit_account.reasoning,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
if (payload.credit_account != null) {
|
|
159
|
+
result.creditAccount = {
|
|
160
|
+
confidence: payload.credit_account.confidence,
|
|
161
|
+
reasoning: payload.credit_account.reasoning,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
if (payload.debit_accounting_class != null) {
|
|
165
|
+
result.debitClass = {
|
|
166
|
+
confidence: payload.debit_accounting_class.confidence,
|
|
167
|
+
reasoning: payload.debit_accounting_class.reasoning,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
if (payload.credit_accounting_class != null) {
|
|
171
|
+
result.creditClass = {
|
|
172
|
+
confidence: payload.credit_accounting_class.confidence,
|
|
173
|
+
reasoning: payload.credit_accounting_class.reasoning,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
if (payload.period != null) {
|
|
177
|
+
result.period = {
|
|
178
|
+
confidence: payload.period.confidence,
|
|
179
|
+
reasoning: payload.period.reasoning,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
if (payload.posting_date != null) {
|
|
183
|
+
result.postingDate = {
|
|
184
|
+
confidence: payload.posting_date.confidence,
|
|
185
|
+
reasoning: payload.posting_date.reasoning,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
return Object.keys(result).length > 0 ? result : undefined;
|
|
189
|
+
}
|
|
147
190
|
function toJEScheduledTransaction(payload) {
|
|
148
191
|
return {
|
|
149
192
|
jeScheduleId: payload.je_schedule_id ?? undefined,
|
|
@@ -185,6 +228,7 @@ function toJEScheduledTransaction(payload) {
|
|
|
185
228
|
? toJEScheduleOtherAttributes(payload.other_attributes)
|
|
186
229
|
: {},
|
|
187
230
|
scheduledJournalEntry: [],
|
|
231
|
+
aiRecommendations: toJEScheduleAIRecommendations(payload.ai_summaries),
|
|
188
232
|
};
|
|
189
233
|
}
|
|
190
234
|
function toJEAccruedScheduledTransaction(payload) {
|
|
@@ -9,7 +9,7 @@ import { ScheduleTransaction } from '../transaction/stateTypes/scheduleTransacti
|
|
|
9
9
|
import { TransactionID } from '../transaction/stateTypes/transaction';
|
|
10
10
|
import { User } from '../user/userState';
|
|
11
11
|
import { Vendor } from '../vendor/vendorState';
|
|
12
|
-
import { JEScheduleOtherAttributes, ScheduleJournalStatusCode, ScheduleStatus } from './jeSchedulesState';
|
|
12
|
+
import { JEScheduleAIRecommendations, JEScheduleOtherAttributes, ScheduleJournalStatusCode, ScheduleStatus } from './jeSchedulesState';
|
|
13
13
|
import { JEScheduleKey, JEScheduleTransactionKey, JournalEntryErrorCodeType, ScheduleTypes } from './jeSchedulesTypes';
|
|
14
14
|
export interface ScheduledJournalEntry {
|
|
15
15
|
error: JournalEntryErrorCodeType[];
|
|
@@ -59,6 +59,7 @@ export interface JEScheduledTransaction {
|
|
|
59
59
|
scheduledJournalEntry: ScheduledJournalEntry[];
|
|
60
60
|
status: ScheduleStatus;
|
|
61
61
|
vendor: Vendor;
|
|
62
|
+
aiRecommendations?: JEScheduleAIRecommendations;
|
|
62
63
|
balanceAsOfToday?: Amount;
|
|
63
64
|
dayOfPostingDate?: ScheduleDaysOfMonth;
|
|
64
65
|
endDate?: ZeniDate;
|
|
@@ -77,7 +77,7 @@ exports.getJEAccruedScheduleByJEScheduleKey = getJEAccruedScheduleByJEScheduleKe
|
|
|
77
77
|
const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTransactionKey, state) => {
|
|
78
78
|
const { jeSchedulesState, vendorState, accountState, userState, classState, transactionState, } = state;
|
|
79
79
|
const jeScheduleTransactionState = (0, get_1.default)(jeSchedulesState.schedulesByTransactionKey, jeScheduleTransactionKey);
|
|
80
|
-
const { period, updatedByUserID: updatedBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, baseTransaction, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, otherAttributes, jeScheduleType, } = jeScheduleTransactionState;
|
|
80
|
+
const { period, updatedByUserID: updatedBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, baseTransaction, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, otherAttributes, jeScheduleType, aiRecommendations, } = jeScheduleTransactionState;
|
|
81
81
|
const vendorDetails = (0, vendorSelector_1.getVendorByVendorId)(vendorState, vendorId);
|
|
82
82
|
if (vendorDetails == null) {
|
|
83
83
|
throw new Error(`Vendor with ${vendorId} doesn't exist`);
|
|
@@ -134,6 +134,7 @@ const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTransacti
|
|
|
134
134
|
account: accountDebit,
|
|
135
135
|
},
|
|
136
136
|
scheduledJournalEntry,
|
|
137
|
+
aiRecommendations,
|
|
137
138
|
};
|
|
138
139
|
};
|
|
139
140
|
exports.getJEScheduledTransactionByJEScheduleTransactionKey = getJEScheduledTransactionByJEScheduleTransactionKey;
|
|
@@ -13,6 +13,18 @@ export interface ScheduleJournalStatusCode {
|
|
|
13
13
|
code: ScheduleJournalEntryStatusCodeType;
|
|
14
14
|
label: string;
|
|
15
15
|
}
|
|
16
|
+
export interface JEScheduleFieldRecommendation {
|
|
17
|
+
confidence: number;
|
|
18
|
+
reasoning: string;
|
|
19
|
+
}
|
|
20
|
+
export interface JEScheduleAIRecommendations {
|
|
21
|
+
creditAccount?: JEScheduleFieldRecommendation;
|
|
22
|
+
creditClass?: JEScheduleFieldRecommendation;
|
|
23
|
+
debitAccount?: JEScheduleFieldRecommendation;
|
|
24
|
+
debitClass?: JEScheduleFieldRecommendation;
|
|
25
|
+
period?: JEScheduleFieldRecommendation;
|
|
26
|
+
postingDate?: JEScheduleFieldRecommendation;
|
|
27
|
+
}
|
|
16
28
|
export interface JEScheduleOtherAttributes {
|
|
17
29
|
assetId?: string;
|
|
18
30
|
startingBalance?: Amount;
|
|
@@ -57,6 +69,7 @@ export interface JEScheduledTransactionState {
|
|
|
57
69
|
scheduledJournalEntry: ScheduledJournalEntryState[];
|
|
58
70
|
status: ScheduleStatus;
|
|
59
71
|
vendorId: ID;
|
|
72
|
+
aiRecommendations?: JEScheduleAIRecommendations;
|
|
60
73
|
balanceAsOfToday?: number;
|
|
61
74
|
dayOfPostingDate?: ScheduleDaysOfMonth;
|
|
62
75
|
endDate?: ZeniDate;
|
|
@@ -561,7 +561,6 @@ function mapTenantsPayloadToState(tenantsPayload, userTenantPayload) {
|
|
|
561
561
|
function mapTenantPayloadToTenant(payload, userTenantPayload) {
|
|
562
562
|
const tenant = {
|
|
563
563
|
accountingClassIDs: payload.accounting_class_ids,
|
|
564
|
-
isAccountingClassesEnabled: payload.is_accounting_classes_enabled ?? true,
|
|
565
564
|
bookCloseDate: payload.book_close_date != null
|
|
566
565
|
? (0, zeniDayJS_1.date)(payload.book_close_date)
|
|
567
566
|
: undefined,
|
|
@@ -85,7 +85,6 @@ export declare const getCurrentTenantExternalConnections: (tenantState: TenantSt
|
|
|
85
85
|
export declare const toTenantCoreDetailsView: (tenantsBaseView: TenantBaseView[]) => TenantCoreDetailsView[];
|
|
86
86
|
export declare const isTenantBankingOnly: (isDebitCardFlagEnabled: boolean, tenant: Tenant | undefined) => boolean;
|
|
87
87
|
export declare const isTenantCardsOnly: (tenant: Tenant | undefined) => boolean;
|
|
88
|
-
export declare const getIsAccountingClassesEnabled: (state: RootState) => boolean;
|
|
89
88
|
export declare const isTenantBookkeepingEnabled: (tenant: Tenant | undefined) => boolean;
|
|
90
89
|
export declare const isOtherProductsEnabledForTenant: (tenant: Tenant | undefined) => boolean;
|
|
91
90
|
export declare const isTenantTreasuryEnabled: (tenant: Tenant | undefined) => boolean;
|
|
@@ -3,7 +3,7 @@ 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.isTenantTreasuryEnabled = exports.isOtherProductsEnabledForTenant = exports.isTenantBookkeepingEnabled = exports.
|
|
6
|
+
exports.isTenantTreasuryEnabled = exports.isOtherProductsEnabledForTenant = exports.isTenantBookkeepingEnabled = exports.isTenantCardsOnly = exports.isTenantBankingOnly = exports.toTenantCoreDetailsView = exports.getCurrentTenantExternalConnections = exports.isTenantUsingZeniCOA = exports.isZeniDomainTenant = exports.getTenantBaseViewForTenantView = exports.getTenantsCoreDetailsByCheckInDateSelector = exports.getTenantsBaseByCheckInDateSelector = exports.getTenantBaseById = exports.getTenantsByCheckInDateSelector = exports.getCurrentTenant = exports.getTenantBaseViewForTenantId = void 0;
|
|
7
7
|
exports.getTenant = getTenant;
|
|
8
8
|
exports.getOnboardingTenantByTenantId = getOnboardingTenantByTenantId;
|
|
9
9
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
@@ -280,14 +280,6 @@ const isTenantCardsOnly = (tenant) => {
|
|
|
280
280
|
: false;
|
|
281
281
|
};
|
|
282
282
|
exports.isTenantCardsOnly = isTenantCardsOnly;
|
|
283
|
-
const getIsAccountingClassesEnabled = (state) => {
|
|
284
|
-
const { currentTenantId, tenantsById } = state.tenantState;
|
|
285
|
-
if (currentTenantId == null) {
|
|
286
|
-
return true;
|
|
287
|
-
}
|
|
288
|
-
return tenantsById[currentTenantId]?.isAccountingClassesEnabled ?? true;
|
|
289
|
-
};
|
|
290
|
-
exports.getIsAccountingClassesEnabled = getIsAccountingClassesEnabled;
|
|
291
283
|
const isTenantBookkeepingEnabled = (tenant) => {
|
|
292
284
|
// if the tenants API takes time, tenant can be non null with productSettings as null
|
|
293
285
|
return tenant != null && tenant.productSettings != null
|
|
@@ -35,9 +35,9 @@ export interface LinkedTransactionLine extends TransactionLineBase {
|
|
|
35
35
|
export interface TransactionWithAccountAndClassLine extends TransactionLineBase {
|
|
36
36
|
account: AccountBase;
|
|
37
37
|
billable: BillableStatus;
|
|
38
|
+
class: ClassBase;
|
|
38
39
|
isCategoryMiscategorized: boolean;
|
|
39
40
|
isClassMiscategorized: boolean;
|
|
40
|
-
class?: ClassBase;
|
|
41
41
|
customer?: CustomerBase;
|
|
42
42
|
vendor?: VendorBase;
|
|
43
43
|
}
|
|
@@ -134,6 +134,49 @@ function toJEScheduleOtherAttributes(payload) {
|
|
|
134
134
|
assetId: payload.asset_id ?? undefined,
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
|
+
function toJEScheduleAIRecommendations(payload) {
|
|
138
|
+
if (payload == null) {
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
141
|
+
const result = {};
|
|
142
|
+
if (payload.debit_account != null) {
|
|
143
|
+
result.debitAccount = {
|
|
144
|
+
confidence: payload.debit_account.confidence,
|
|
145
|
+
reasoning: payload.debit_account.reasoning,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
if (payload.credit_account != null) {
|
|
149
|
+
result.creditAccount = {
|
|
150
|
+
confidence: payload.credit_account.confidence,
|
|
151
|
+
reasoning: payload.credit_account.reasoning,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
if (payload.debit_accounting_class != null) {
|
|
155
|
+
result.debitClass = {
|
|
156
|
+
confidence: payload.debit_accounting_class.confidence,
|
|
157
|
+
reasoning: payload.debit_accounting_class.reasoning,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
if (payload.credit_accounting_class != null) {
|
|
161
|
+
result.creditClass = {
|
|
162
|
+
confidence: payload.credit_accounting_class.confidence,
|
|
163
|
+
reasoning: payload.credit_accounting_class.reasoning,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
if (payload.period != null) {
|
|
167
|
+
result.period = {
|
|
168
|
+
confidence: payload.period.confidence,
|
|
169
|
+
reasoning: payload.period.reasoning,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
if (payload.posting_date != null) {
|
|
173
|
+
result.postingDate = {
|
|
174
|
+
confidence: payload.posting_date.confidence,
|
|
175
|
+
reasoning: payload.posting_date.reasoning,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
return Object.keys(result).length > 0 ? result : undefined;
|
|
179
|
+
}
|
|
137
180
|
export function toJEScheduledTransaction(payload) {
|
|
138
181
|
return {
|
|
139
182
|
jeScheduleId: payload.je_schedule_id ?? undefined,
|
|
@@ -175,6 +218,7 @@ export function toJEScheduledTransaction(payload) {
|
|
|
175
218
|
? toJEScheduleOtherAttributes(payload.other_attributes)
|
|
176
219
|
: {},
|
|
177
220
|
scheduledJournalEntry: [],
|
|
221
|
+
aiRecommendations: toJEScheduleAIRecommendations(payload.ai_summaries),
|
|
178
222
|
};
|
|
179
223
|
}
|
|
180
224
|
export function toJEAccruedScheduledTransaction(payload) {
|
|
@@ -70,7 +70,7 @@ export const getJEAccruedScheduleByJEScheduleKey = (JEScheduleKey, state) => {
|
|
|
70
70
|
export const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTransactionKey, state) => {
|
|
71
71
|
const { jeSchedulesState, vendorState, accountState, userState, classState, transactionState, } = state;
|
|
72
72
|
const jeScheduleTransactionState = recordGet(jeSchedulesState.schedulesByTransactionKey, jeScheduleTransactionKey);
|
|
73
|
-
const { period, updatedByUserID: updatedBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, baseTransaction, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, otherAttributes, jeScheduleType, } = jeScheduleTransactionState;
|
|
73
|
+
const { period, updatedByUserID: updatedBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, baseTransaction, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, otherAttributes, jeScheduleType, aiRecommendations, } = jeScheduleTransactionState;
|
|
74
74
|
const vendorDetails = getVendorByVendorId(vendorState, vendorId);
|
|
75
75
|
if (vendorDetails == null) {
|
|
76
76
|
throw new Error(`Vendor with ${vendorId} doesn't exist`);
|
|
@@ -127,5 +127,6 @@ export const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTr
|
|
|
127
127
|
account: accountDebit,
|
|
128
128
|
},
|
|
129
129
|
scheduledJournalEntry,
|
|
130
|
+
aiRecommendations,
|
|
130
131
|
};
|
|
131
132
|
};
|
|
@@ -553,7 +553,6 @@ function mapTenantsPayloadToState(tenantsPayload, userTenantPayload) {
|
|
|
553
553
|
function mapTenantPayloadToTenant(payload, userTenantPayload) {
|
|
554
554
|
const tenant = {
|
|
555
555
|
accountingClassIDs: payload.accounting_class_ids,
|
|
556
|
-
isAccountingClassesEnabled: payload.is_accounting_classes_enabled ?? true,
|
|
557
556
|
bookCloseDate: payload.book_close_date != null
|
|
558
557
|
? date(payload.book_close_date)
|
|
559
558
|
: undefined,
|
|
@@ -265,13 +265,6 @@ export const isTenantCardsOnly = (tenant) => {
|
|
|
265
265
|
tenant.productSettings.isSpendManagementEnabled === false
|
|
266
266
|
: false;
|
|
267
267
|
};
|
|
268
|
-
export const getIsAccountingClassesEnabled = (state) => {
|
|
269
|
-
const { currentTenantId, tenantsById } = state.tenantState;
|
|
270
|
-
if (currentTenantId == null) {
|
|
271
|
-
return true;
|
|
272
|
-
}
|
|
273
|
-
return tenantsById[currentTenantId]?.isAccountingClassesEnabled ?? true;
|
|
274
|
-
};
|
|
275
268
|
export const isTenantBookkeepingEnabled = (tenant) => {
|
|
276
269
|
// if the tenants API takes time, tenant can be non null with productSettings as null
|
|
277
270
|
return tenant != null && tenant.productSettings != null
|
package/lib/esm/index.js
CHANGED
|
@@ -60,7 +60,7 @@ import { getSnackbar } from './entity/snackbar/snackbarSelector';
|
|
|
60
60
|
import { toPriorityCodeType, toTaskStatusCodeType, } from './entity/task/taskState';
|
|
61
61
|
import { getTaskGroupById } from './entity/taskGroup/taskGroupSelector';
|
|
62
62
|
import { clearAll, doMagicLinkSignIn, doSignIn, doSignOut, fetchActiveTenant, fetchAllTenants, fetchExcludedResources as fetchExcludedResourcesForTenant, fetchExternalConnections as fetchExternalConnectionsForTenant, fetchSubscriptionSummaryForTenant, resendVerifyDeviceOTP, resetSignInState, saveExternalConnection as saveExternalConnectionForTenant, sendEmailMagicLinkToUser, updateCurrentTenant, updateSignInState, verifyDeviceWithTwoFA, } from './entity/tenant/tenantReducer';
|
|
63
|
-
import { getCurrentTenant,
|
|
63
|
+
import { getCurrentTenant, getTenantBaseById, getTenantBaseViewForTenantId, getTenantBaseViewForTenantView, getTenantsBaseByCheckInDateSelector, getTenantsByCheckInDateSelector, getTenantsCoreDetailsByCheckInDateSelector, isOtherProductsEnabledForTenant, isTenantBankingOnly, isTenantBookkeepingEnabled, isTenantCardsOnly, isTenantUsingZeniCOA, isZeniDomainTenant, toTenantCoreDetailsView, } from './entity/tenant/tenantSelector';
|
|
64
64
|
import { pushToastNotification } from './entity/toastNotification/toastNotificationReducer';
|
|
65
65
|
import { getLastNotificationTime, getNotifications, } from './entity/toastNotification/toastNotificationSelector';
|
|
66
66
|
import { mapFileEntityToAttachment, toContentType, toContentTypeStrict, } from './entity/transaction/stateTypes/attachment';
|
|
@@ -162,13 +162,14 @@ import { toExpenseAutomationViewType, } from './view/expenseAutomationView/expen
|
|
|
162
162
|
import { isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardCreditType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, } from './view/expenseAutomationView/helpers/reconciliationHelpers';
|
|
163
163
|
import { MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, } from './view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper';
|
|
164
164
|
import { clearExpenseAutomationFluxAnalysisView, fetchFluxAnalysisView, reviewFluxAnalysisView, updateFluxAnalysisViewPageMetaData, updateFluxAnalysisViewUIState, updateOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview, } from './view/expenseAutomationView/reducers/fluxAnalysisViewReducer';
|
|
165
|
-
import { clearJeScheduleLocalData as clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, fetchJeSchedulesPage as fetchExpenseAutomationJESchedulesPage, ignoreRecommendedJeSchedule as ignoreExpenseAutomationJESchedule, initializeAccountSettingsView as initializeJeAccountSettingsView, initializeJeScheduleLocalData, removeJeScheduleTransactionKey, retryJeSchedule as retryExpenseAutomationJESchedule, saveAccountSettings as saveJeAccountSettings, saveAccountSettingsLocalData as saveJeAccountSettingsLocalData, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, } from './view/expenseAutomationView/reducers/jeSchedulesViewReducer';
|
|
165
|
+
import { clearJeScheduleLocalData as clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, fetchJeSchedulesPage as fetchExpenseAutomationJESchedulesPage, ignoreRecommendedJeSchedule as ignoreExpenseAutomationJESchedule, initializeAccountSettingsView as initializeJeAccountSettingsView, initializeJeScheduleLocalData, removeJeScheduleTransactionKey, retryJeSchedule as retryExpenseAutomationJESchedule, saveAccountSettings as saveJeAccountSettings, saveAccountSettingsLocalData as saveJeAccountSettingsLocalData, updateJESchedulesUIState as updateExpenseAutomationJESchedulesUIState, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, } from './view/expenseAutomationView/reducers/jeSchedulesViewReducer';
|
|
166
166
|
import { fetchMissingReceipts as fetchExpenseAutomationMissingReceipts, markMissingReceiptAsDone as markExpenseAutomationMissingReceiptAsDone, updateMissingReceiptUploadState as updateExpenseAutomationMissingReceiptUploadState, updateMissingReceiptsUIState as updateExpenseAutomationMissingReceiptsUIState, uploadMissingReceiptSuccess as uploadExpenseAutomationMissingReceiptSuccess, } from './view/expenseAutomationView/reducers/missingReceiptsViewReducer';
|
|
167
167
|
import { deleteAccountStatement, fetchReconciliation as fetchReconciliationView, saveReconciliationDetail as saveExpenseAutomationReconciliationDetail, saveReconciliationReview as saveExpenseAutomationReconciliationReview, setConnectionInProgressForAccount as setConnectionInProgressForAccountReconciliation, setStatementParseInProgress, updateAccountReconciliationLocalData as updateExpenseAutomationAccountReconciliationLocalData, updateSelectedAccountId as updateExpenseAutomationAccountReconciliationSelectedAccountId, updateSelectedTab as updateExpenseAutomationAccountReconciliationSelectedTab, updateReconListScrollPosition as updateExpenseAutomationReconListScrollPosition, updateReviewTabSortState as updateExpenseAutomationReconReviewTabListSortState, updateReviewTabLocalData as updateExpenseAutomationReconReviewTabLocalData, updateReconcileTabListScrollState as updateExpenseAutomationReconcileTabListScrollState, updateReconcileTabListSortState as updateExpenseAutomationReconcileTabListSortState, updateReconcileTabLocalData as updateExpenseAutomationReconcileTabLocalData, updateSelectedDrawerAccountId as updateExpenseAutomationSelectedDrawerAccountId, updateStatementUploadChosen, uploadAccountStatement, } from './view/expenseAutomationView/reducers/reconciliationViewReducer';
|
|
168
168
|
import { backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationView, initializeTransactionCategorizationViewLocalData, markTransactionAsNotMiscategorized, saveTransactionCategorization, saveTransactionCategorizationLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, setEntityRecommendationForLineIdsForCategorization, syncTransactionCategorizationFromDetailSave, updateCurrentSelectedTransactionCategorizationTab, updateSelectedCheckboxTransactionIds, updateSelectedCustomerForTransaction, updateSelectedTransactionId, updateSelectedVendorForTransaction, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, updateTransactionCategorizationUIState, updateTransactionCategorizationUploadReceiptState, uploadTransactionCategorizationReceiptSuccess, } from './view/expenseAutomationView/reducers/transactionsViewReducer';
|
|
169
169
|
import { getExpenseAutomationFluxAnalysisView } from './view/expenseAutomationView/selectors/fluxAnalysisViewSelector';
|
|
170
170
|
import { getExpenseAutomationReconciliationView, isAccountReconReport, } from './view/expenseAutomationView/selectors/reconciliationViewSelector';
|
|
171
171
|
import { getExpenseAutomationTransactionView } from './view/expenseAutomationView/selectors/transactionCategorizationSelector';
|
|
172
|
+
import { toJEScheduleSortKey as toExpenseAutomationJEScheduleSortKey, } from './view/expenseAutomationView/types/jeSchedulesViewState';
|
|
172
173
|
import { toMissingReceiptsSortKey as toExpenseAutomationMissingReceiptsSortKey, } from './view/expenseAutomationView/types/missingReceiptsViewState';
|
|
173
174
|
import { toReconciliationTabsType, } from './view/expenseAutomationView/types/reconciliationViewState';
|
|
174
175
|
import { toTransactionsTabKey as toExpenseAutomationTransactionsTabKey, toTransactionsSortKey, } from './view/expenseAutomationView/types/transactionsViewState';
|
|
@@ -415,14 +416,14 @@ export { newBalancesFilterClassesView };
|
|
|
415
416
|
export { toCOABalanceTypeStrict, toCOABalanceType as toCOABlanaceType, isCalculatedBalanceType, };
|
|
416
417
|
export { stringToUnion, stringToUnionStrict };
|
|
417
418
|
export { fetchMonthEndCloseChecks, fetchMonthClosePerformanceTrend, getMonthEndCloseChecksViewByTenantId, ALL_MONTH_END_CLOSE_CHECKS_FREQUENCY, };
|
|
418
|
-
export { getExpenseAutomationView, toExpenseAutomationMissingReceiptsSortKey, toExpenseAutomationTransactionsTabKey, toExpenseAutomationViewType, uploadExpenseAutomationMissingReceiptSuccess, markExpenseAutomationMissingReceiptAsDone, fetchAllExpenseAutomationTabs, refreshExpenseAutomationCurrentTab, updateCurrentSelectedTransactionCategorizationTab, fetchExpenseAutomationMissingReceipts, fetchFluxAnalysisView, clearExpenseAutomationFluxAnalysisView, updateOperatingExpensesIdsForReview as updateFluxOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview as updateFluxAnalysisSelectedSectionIdsForReview, reviewFluxAnalysisView, updateExpenseAutomationMissingReceiptUploadState, updateExpenseAutomationMissingReceiptsUIState, updateTransactionCategorizationUploadReceiptState, uploadTransactionCategorizationReceiptSuccess, getExpenseAutomationFluxAnalysisView, updateCurrentSelectedView, updateCurrentSelectedPeriod, getExpenseAutomationTransactionView, updateFluxAnalysisViewUIState, updateFluxAnalysisViewPageMetaData, MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, saveExpenseAutomationReconciliationDetail, updateExpenseAutomationReconcileTabListScrollState, updateExpenseAutomationReconReviewTabListSortState, updateExpenseAutomationReconcileTabListSortState, updateExpenseAutomationReconcileTabLocalData, updateExpenseAutomationAccountReconciliationSelectedTab, updateExpenseAutomationAccountReconciliationSelectedAccountId, getExpenseAutomationReconciliationView, fetchReconciliationView, uploadAccountStatementIntoDocumentAI, updateExpenseAutomationReconListScrollPosition, setConnectionInProgressForAccountReconciliation, getAccountReconByAccountIdAndSelectedPeriod, toReconciliationTabsType, isAccountReconReport, updateExpenseAutomationReconReviewTabLocalData, updateExpenseAutomationSelectedDrawerAccountId, saveExpenseAutomationReconciliationReview, updateExpenseAutomationAccountReconciliationLocalData, toReconciliationAccountSource, deleteAccountStatement, uploadAccountStatement, updateStatementUploadChosen, isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, isReviewTransactionCreditCardCreditType, setStatementParseInProgress, };
|
|
419
|
+
export { toExpenseAutomationJEScheduleSortKey, getExpenseAutomationView, toExpenseAutomationMissingReceiptsSortKey, toExpenseAutomationTransactionsTabKey, toExpenseAutomationViewType, uploadExpenseAutomationMissingReceiptSuccess, markExpenseAutomationMissingReceiptAsDone, fetchAllExpenseAutomationTabs, refreshExpenseAutomationCurrentTab, updateCurrentSelectedTransactionCategorizationTab, fetchExpenseAutomationMissingReceipts, fetchFluxAnalysisView, clearExpenseAutomationFluxAnalysisView, updateOperatingExpensesIdsForReview as updateFluxOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview as updateFluxAnalysisSelectedSectionIdsForReview, reviewFluxAnalysisView, updateExpenseAutomationMissingReceiptUploadState, updateExpenseAutomationMissingReceiptsUIState, updateTransactionCategorizationUploadReceiptState, uploadTransactionCategorizationReceiptSuccess, getExpenseAutomationFluxAnalysisView, updateCurrentSelectedView, updateCurrentSelectedPeriod, getExpenseAutomationTransactionView, updateFluxAnalysisViewUIState, updateFluxAnalysisViewPageMetaData, MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, saveExpenseAutomationReconciliationDetail, updateExpenseAutomationReconcileTabListScrollState, updateExpenseAutomationReconReviewTabListSortState, updateExpenseAutomationReconcileTabListSortState, updateExpenseAutomationReconcileTabLocalData, updateExpenseAutomationAccountReconciliationSelectedTab, updateExpenseAutomationAccountReconciliationSelectedAccountId, getExpenseAutomationReconciliationView, fetchReconciliationView, uploadAccountStatementIntoDocumentAI, updateExpenseAutomationReconListScrollPosition, setConnectionInProgressForAccountReconciliation, getAccountReconByAccountIdAndSelectedPeriod, toReconciliationTabsType, isAccountReconReport, updateExpenseAutomationReconReviewTabLocalData, updateExpenseAutomationSelectedDrawerAccountId, saveExpenseAutomationReconciliationReview, updateExpenseAutomationAccountReconciliationLocalData, toReconciliationAccountSource, deleteAccountStatement, uploadAccountStatement, updateStatementUploadChosen, isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, isReviewTransactionCreditCardCreditType, setStatementParseInProgress, };
|
|
419
420
|
export { fetchTransactionCategorization, fetchTransactionCategorizationView, updateTransactionCategorizationUIState, updateSelectedCheckboxTransactionIds, setEntityRecommendationForLineIdsForCategorization, initializeTransactionCategorizationViewLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, saveTransactionCategorizationLocalData, fetchTransactionCategorizationFailure, saveTransactionCategorization, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, markTransactionAsNotMiscategorized, updateSelectedVendorForTransaction, updateSelectedCustomerForTransaction, updateSelectedTransactionId, syncTransactionCategorizationFromDetailSave, backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, toTransactionsSortKey, };
|
|
420
421
|
export { TOP_EX_TIME_PERIODS };
|
|
421
422
|
export { toTimeframeTick, mapTimePeriodtoTimeframeTick, toTimePeriod, toAbsoluteDay, toMonthYearPeriodId, convertToPeriod, };
|
|
422
423
|
export { toVendorSpendTrendFilterTabsTypeStrict, } from './entity/vendorExpense/vendorExpenseSelector';
|
|
423
424
|
export { getNumberOfPeriods };
|
|
424
425
|
export { SCHEDULE_DAYS_OF_MONTH, toScheduleDaysOfMonth, toMonth, toMonthStrict, toQuarter, toQuarterStrict, };
|
|
425
|
-
export { getTenantBaseById, getCurrentTenant,
|
|
426
|
+
export { getTenantBaseById, getCurrentTenant, getTenantsByCheckInDateSelector, getTenantsBaseByCheckInDateSelector, getTenantsCoreDetailsByCheckInDateSelector, toTenantCoreDetailsView, getTenantBaseViewForTenantView, getTenantBaseViewForTenantId, isZeniDomainTenant, isTenantUsingZeniCOA, fetchActiveTenant, fetchAllTenants, updateCurrentTenant, clearAll, doMagicLinkSignIn, verifyDeviceWithTwoFA, resendVerifyDeviceOTP, sendEmailMagicLinkToUser, doSignIn, updateSignInState, doSignOut, resetSignInState, fetchExcludedResourcesForTenant, fetchExternalConnectionsForTenant, saveExternalConnectionForTenant, fetchSubscriptionSummaryForTenant, isTenantBankingOnly, isTenantCardsOnly, isTenantBookkeepingEnabled, isOtherProductsEnabledForTenant, };
|
|
426
427
|
export { toAccountType, toAccountGroupType, getAccountGroupKey, };
|
|
427
428
|
export { getClassById } from './entity/class/classSelector';
|
|
428
429
|
export { getForecast };
|
|
@@ -571,7 +572,7 @@ export { updateChargeCardTransactionAttachments, attachmentFilePathToAttachment,
|
|
|
571
572
|
export { TIME_SERIES_DURATIONS, convertToTimeSeriesSelectionRange, toTimeSeriesDuration, fetchAggregatedReport, aggregatedReportView, };
|
|
572
573
|
export { fetchApAging, getApAgingReport, updateApAgingUIState, };
|
|
573
574
|
export { fetchApAgingDetail, getApAgingDetailForVendor, updateApAgingDetailUIState, };
|
|
574
|
-
export { clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, fetchExpenseAutomationJESchedulesPage, ignoreExpenseAutomationJESchedule, initializeJeAccountSettingsView, initializeJeScheduleLocalData, removeJeScheduleTransactionKey, retryExpenseAutomationJESchedule, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, };
|
|
575
|
+
export { clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, fetchExpenseAutomationJESchedulesPage, ignoreExpenseAutomationJESchedule, initializeJeAccountSettingsView, initializeJeScheduleLocalData, removeJeScheduleTransactionKey, retryExpenseAutomationJESchedule, updateExpenseAutomationJESchedulesUIState, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, };
|
|
575
576
|
export { createNewSchedulesAccrued, deleteScheduleAccruedDetail, cancelScheduleAccruedJournalEntry, fetchScheduleAccruedDetails, fetchScheduleAccruedDetailsPage, resetJEAccruedLinkInLocalData, saveScheduleAccruedDetails, updateAmountsInScheduleAccruedDetail, updatedJEAccruedLinkWithRecommendedLocalData, updatedJELinkInLocalDataAccruedExpenses, fetchRecommendedTransactionRowIndex, clearSelectedJELinkRowIndex, updateLinkBillExpenseLocalData, updateScheduleAccruedDetailsLocalData, updateSelectedJEAccruedScheduleKey, resetSelectedJEAccruedScheduleKey, resetAccruedDetailNewScheduleState, };
|
|
576
577
|
export { ALL_SCHEDULES_TYPES, getScheduleListReport, getAccruedScheduleListReport, fetchScheduleList, fetchAccruedScheduleList, fetchDownloadSchedules, fetchSchedulesAccount, updateScheduleListLocalData, getFetchStateForScheduleAccountList, toScheduleTypesType, toScheduleTypesTypeStrict, toScheduleListTabsFileTypeStrict, toScheduleSubTabType, updateScheduleListSubTab, updateScheduleListSearchText, updateScheduleListScrollState, updateScheduleListSortState, updateSelectedJEScheduleKey, fetchScheduleDetails, getScheduleDetailsView, getAccruedScheduleDetailsView, fetchScheduleDetailsPage, saveScheduleDetails, deleteScheduleDetail, createNewSchedules, updateScheduleDetailsLocalData, updateScheduleListDownloadState, updateAccruedJEScheduleAccruedByListKey, updatedSelectedJELinkRowIndex, getQBOUrlForLink, getThirdPartyIDFromQBOURL, updatedJELinkInLocalData, updateAmountsInScheduleDetail, resetJELinkInLocalData, updatedJELinkWithRecommendedLocalData, getFetchStateForScheduleListByType, getDefaultSelectedTimeframeForScheduleType, markAsCompleteScheduleDetail, resetMarkAsCompleteStatus, fetchVendorTabView, updateVendorTabViewTab, getVendorTabView, };
|
|
577
578
|
export { toVendorFirstReviewViewColumnKeyType, getGlobalMerchantAutoCompleteResults, getVendorFirstReviewView, getVendorFirstReviewAttachmentView, fetchVendorFirstReviewView, fetchVendorFirstReviewAttachments, updateVendorFirstReviewViewScrollYOffset, resetVendorFirstReviewLocalData, updateVendorFirstReviewViewPageToken, clearRecentlySavedErroredVendorData, saveVendorFirstReviewView, updateVendorFirstReviewViewLocalData, updateVendorFirstReviewSortUiState, fetchGlobalMerchantAutoCompleteView, clearGlobalMerchantAutoCompleteResults, updateReviewVendorDetailLocalData, saveVendorDetailsView, getVendorDetailSelectorView, };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap, switchMap
|
|
2
|
+
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
3
|
import { updateClasses } from '../../entity/class/classReducer';
|
|
4
|
-
import { getIsAccountingClassesEnabled } from '../../entity/tenant/tenantSelector';
|
|
5
4
|
import { createZeniAPIStatus, isSuccessResponse } from '../../responsePayload';
|
|
6
5
|
import { fetchClassList, updateClassList, updateClassListFailure, } from './classListReducer';
|
|
7
|
-
export const fetchClassListEpic = (actions$,
|
|
6
|
+
export const fetchClassListEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchClassList.match), switchMap((action) => {
|
|
8
7
|
const { isIncludeDeleted } = action.payload;
|
|
9
8
|
const queryParams = isIncludeDeleted === true
|
|
10
9
|
? `?query=${encodeURIComponent(JSON.stringify({ is_include_deleted: true }))}`
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { reduceAnyFetchState, reduceFetchState, } from '../../../commonStateTypes/reduceFetchState';
|
|
2
|
-
import { getIsAccountingClassesEnabled } from '../../../entity/tenant/tenantSelector';
|
|
3
2
|
import { getAccountBase } from '../../../entity/account/accountSelector';
|
|
4
3
|
import { getAddressByAddressId } from '../../../entity/address/addressSelector';
|
|
5
4
|
import { getBankAccountsByBankAccountIds } from '../../../entity/bankAccount/bankAccountSelector';
|
|
@@ -61,17 +60,13 @@ export const getVendorView = (state, vendorIdFromUrl) => {
|
|
|
61
60
|
?.vendorDetailLocalData,
|
|
62
61
|
supportedCountries: billPayConfigState.vendor.supportedCountries,
|
|
63
62
|
};
|
|
64
|
-
|
|
65
|
-
const editFetchStateList = [
|
|
63
|
+
fetchState = reduceFetchState([
|
|
66
64
|
accountList,
|
|
65
|
+
classList,
|
|
67
66
|
vendorTypeListState,
|
|
68
67
|
vendorViewState.editVendorStateById[vendorIdFromUrl]?.fetchStatus ??
|
|
69
68
|
vendorViewInitialState.newVendorState.fetchStatus,
|
|
70
|
-
];
|
|
71
|
-
if (isAccountingClassesEnabled) {
|
|
72
|
-
editFetchStateList.push(classList);
|
|
73
|
-
}
|
|
74
|
-
fetchState = reduceFetchState(editFetchStateList);
|
|
69
|
+
]);
|
|
75
70
|
}
|
|
76
71
|
else {
|
|
77
72
|
const basicVendorDetails = getBasicVendorDetailsForNewVendor(state, vendorViewState.newVendorState);
|
|
@@ -100,14 +95,11 @@ export const getVendorView = (state, vendorIdFromUrl) => {
|
|
|
100
95
|
if (tentativeName != null) {
|
|
101
96
|
entityRecommendations = getRecommendationsForEntity(state, tentativeName, 'vendor');
|
|
102
97
|
}
|
|
103
|
-
const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state);
|
|
104
98
|
const fetchStateList = [
|
|
105
99
|
{ fetchState: accountList.fetchState, error: accountList.error },
|
|
100
|
+
{ fetchState: classList.fetchState, error: classList.error },
|
|
106
101
|
vendorTypeListState,
|
|
107
102
|
];
|
|
108
|
-
if (isAccountingClassesEnabled) {
|
|
109
|
-
fetchStateList.push({ fetchState: classList.fetchState, error: classList.error });
|
|
110
|
-
}
|
|
111
103
|
if (entityRecommendations != null &&
|
|
112
104
|
entityRecommendations.recommendations != null &&
|
|
113
105
|
entityRecommendations.recommendations.length > 0) {
|
|
@@ -152,7 +144,6 @@ export const getVendorView = (state, vendorIdFromUrl) => {
|
|
|
152
144
|
fetchState: fetchState.fetchState,
|
|
153
145
|
hasWireTransfer,
|
|
154
146
|
hasInternationalWireTransfer,
|
|
155
|
-
isAccountingClassesEnabled: getIsAccountingClassesEnabled(state),
|
|
156
147
|
deleteFileStatusById,
|
|
157
148
|
updateFileStatusById,
|
|
158
149
|
loggedInUserVerification,
|
|
@@ -228,10 +219,9 @@ const getBasicVendorDetailsForNewVendor = (state, newVendor) => {
|
|
|
228
219
|
};
|
|
229
220
|
export const getVendorDetailPageView = (state, vendorId, entity) => {
|
|
230
221
|
const trendWithTransactions = getTrendWithTransactions(state, entity, 'EntityDetail');
|
|
231
|
-
const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state);
|
|
232
222
|
const reducedFetchState = reduceAnyFetchState([
|
|
233
223
|
state.accountListState.byReportId.accountList,
|
|
234
|
-
|
|
224
|
+
state.classListState,
|
|
235
225
|
state.vendorTypeListState,
|
|
236
226
|
state.ownerListState,
|
|
237
227
|
state.vendorViewState.editVendorStateById[vendorId]?.fetchStatus ?? {
|
|
@@ -3,7 +3,6 @@ import { getStartOfAndEndOfTimeframeForFY } from '../../../commonStateTypes/fisc
|
|
|
3
3
|
import { reduceAnyFetchState, reduceFetchState, } from '../../../commonStateTypes/reduceFetchState';
|
|
4
4
|
import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
|
|
5
5
|
import { getAccountBase } from '../../../entity/account/accountSelector';
|
|
6
|
-
import { getIsAccountingClassesEnabled } from '../../../entity/tenant/tenantSelector';
|
|
7
6
|
import { getAddressByAddressId } from '../../../entity/address/addressSelector';
|
|
8
7
|
import { getContactsByIds } from '../../../entity/billPay/contact/contactSelector';
|
|
9
8
|
import { getClassById } from '../../../entity/class/classSelector';
|
|
@@ -21,7 +20,6 @@ const ALL_VENDOR_DETAIL_TABS_TYPES = [
|
|
|
21
20
|
export const toVendorDetailTabsType = (v) => stringToUnion(v, ALL_VENDOR_DETAIL_TABS_TYPES);
|
|
22
21
|
export const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
23
22
|
const { accountListState, accountState, classListState, classState, vendorState, userState, vendorsTabVendorViewState, vendorTypeListState, addressState, addressViewState, contactState, } = state;
|
|
24
|
-
const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state);
|
|
25
23
|
const accountList = getAccountList(accountState, accountListState, 'accountList');
|
|
26
24
|
const classList = getClassList(classState, classListState);
|
|
27
25
|
const ownerList = getUsersByUserIds(state.userState, state.ownerListState.ownerIds);
|
|
@@ -53,7 +51,7 @@ export const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
|
53
51
|
}
|
|
54
52
|
fetchState = reduceFetchState([
|
|
55
53
|
accountList,
|
|
56
|
-
|
|
54
|
+
classList,
|
|
57
55
|
vendorTypeListState,
|
|
58
56
|
vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]?.fetchStatus ?? {
|
|
59
57
|
fetchState: 'Not-Started',
|
|
@@ -64,7 +62,6 @@ export const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
|
64
62
|
return {
|
|
65
63
|
accountList: accountList,
|
|
66
64
|
classList: classList,
|
|
67
|
-
isAccountingClassesEnabled,
|
|
68
65
|
vendorTypeList: vendorTypeList,
|
|
69
66
|
accountsHierarchyList,
|
|
70
67
|
classHierarchyList,
|
|
@@ -65,8 +65,7 @@ export const toTransactionUpdatesFromTransactionCategorizationLocalData = (trans
|
|
|
65
65
|
Boolean(lineItem.account?.qboId);
|
|
66
66
|
hasClassChanged =
|
|
67
67
|
Boolean(lineItem.class?.qboId) &&
|
|
68
|
-
|
|
69
|
-
lineItem.class?.qboId !== accountLine.class?.qboId;
|
|
68
|
+
lineItem.class?.qboId !== accountLine.class.qboId;
|
|
70
69
|
const recommendedAccountBase = toRecommendedAccountBase(lineItem.amount.amount, lineItem.account);
|
|
71
70
|
const recommendedClassBase = toRecommendedClassBase(lineItem.amount.amount, lineItem.class);
|
|
72
71
|
if (entityDetails != null &&
|
package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js
CHANGED
|
@@ -234,7 +234,7 @@ const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendati
|
|
|
234
234
|
isPreFilled: true,
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
|
-
if (
|
|
237
|
+
if (accountLine.class.classId === '' &&
|
|
238
238
|
higherPreferenceRecommendation?.class != null) {
|
|
239
239
|
record.class = {
|
|
240
240
|
...higherPreferenceRecommendation.class,
|
|
@@ -464,7 +464,7 @@ export const setEntityRecommendationForLineIdInLocalData = (draft, transaction,
|
|
|
464
464
|
}
|
|
465
465
|
: accountLine.account;
|
|
466
466
|
record.class =
|
|
467
|
-
|
|
467
|
+
accountLine.class.classId !== ''
|
|
468
468
|
? accountLine.class
|
|
469
469
|
: recommendations?.[0]?.class
|
|
470
470
|
? {
|
|
@@ -46,6 +46,8 @@ export const initialState = {
|
|
|
46
46
|
uiState: {
|
|
47
47
|
searchString: '',
|
|
48
48
|
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
49
|
+
sortKey: 'startMonth',
|
|
50
|
+
sortOrder: 'descending',
|
|
49
51
|
totalCount: 0,
|
|
50
52
|
limit: 10,
|
|
51
53
|
},
|
|
@@ -373,12 +375,26 @@ const expenseAutomationJESchedulesView = createSlice({
|
|
|
373
375
|
clearJeAccountSettingsLocalData(draft) {
|
|
374
376
|
draft.accountSettings.localData = accountSettingsInitialState.localData;
|
|
375
377
|
},
|
|
378
|
+
updateJESchedulesUIState(draft, action) {
|
|
379
|
+
if (action.payload.sortKey != null) {
|
|
380
|
+
draft.uiState.sortKey = action.payload.sortKey;
|
|
381
|
+
}
|
|
382
|
+
if (action.payload.sortOrder != null) {
|
|
383
|
+
draft.uiState.sortOrder = action.payload.sortOrder;
|
|
384
|
+
}
|
|
385
|
+
if (action.payload.searchString != null) {
|
|
386
|
+
draft.uiState.searchString = action.payload.searchString;
|
|
387
|
+
}
|
|
388
|
+
if (action.payload.scrollPosition != null) {
|
|
389
|
+
draft.uiState.scrollPosition = action.payload.scrollPosition;
|
|
390
|
+
}
|
|
391
|
+
},
|
|
376
392
|
clearExpenseAutomationJESchedulesView(draft) {
|
|
377
393
|
Object.assign(draft, initialState);
|
|
378
394
|
},
|
|
379
395
|
},
|
|
380
396
|
});
|
|
381
|
-
export const { clearExpenseAutomationJESchedulesView, clearJeAccountSettingsLocalData, clearJeScheduleLocalData, fetchAccountSettingsListForAccountTypes, fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesPage, fetchJeSchedulesSuccess, fetchRecommendationForAccountSettings, ignoreRecommendedJeSchedule, ignoreRecommendedJeScheduleFailure, ignoreRecommendedJeScheduleSuccess, initializeAccountSettingsView, initializeJeScheduleLocalData, removeFailedJeScheduleTransactionKey, removeJeScheduleLocalDataById, removeJeScheduleTransactionKey, retryJeSchedule, retryJeScheduleFailure, retryJeScheduleSuccess, saveAccountSettings, saveAccountSettingsFailure, saveAccountSettingsLocalData, saveAccountSettingsSuccess, updateAccountSettingsListForAccountTypes, updateAccountSettingsListForAccountTypesFailure, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, updateRecommendationForAccountSettings, updateRecommendationForAccountSettingsFailure, } = expenseAutomationJESchedulesView.actions;
|
|
397
|
+
export const { clearExpenseAutomationJESchedulesView, clearJeAccountSettingsLocalData, clearJeScheduleLocalData, fetchAccountSettingsListForAccountTypes, fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesPage, fetchJeSchedulesSuccess, fetchRecommendationForAccountSettings, ignoreRecommendedJeSchedule, ignoreRecommendedJeScheduleFailure, ignoreRecommendedJeScheduleSuccess, initializeAccountSettingsView, initializeJeScheduleLocalData, removeFailedJeScheduleTransactionKey, removeJeScheduleLocalDataById, removeJeScheduleTransactionKey, retryJeSchedule, retryJeScheduleFailure, retryJeScheduleSuccess, saveAccountSettings, saveAccountSettingsFailure, saveAccountSettingsLocalData, saveAccountSettingsSuccess, updateAccountSettingsListForAccountTypes, updateAccountSettingsListForAccountTypesFailure, updateJESchedulesUIState, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, updateRecommendationForAccountSettings, updateRecommendationForAccountSettingsFailure, } = expenseAutomationJESchedulesView.actions;
|
|
382
398
|
export default expenseAutomationJESchedulesView.reducer;
|
|
383
399
|
const doUpdateRecommendationForAccountSettings = (draft, payload) => {
|
|
384
400
|
const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = mapAccountTypeRecommendationPayloadToAccountRecommendationByType(payload);
|