@zeniai/client-epic-state 4.13.90 → 4.13.91
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/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +5 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +4 -1
- package/package.json +1 -1
package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export declare const MAX_SELECTION_LIMIT = 5;
|
|
|
9
9
|
export declare const INCOME_QBOID = "30";
|
|
10
10
|
export declare const EXPENSE_QBOID = "31";
|
|
11
11
|
export declare const toTransactionDetailLocalData: (transaction: SupportedTransaction) => TransactionReviewLocalData;
|
|
12
|
-
export declare const toSetAllLineItemsToCategoryClass: (draft: TransactionsTabViewState, transaction: SupportedTransaction, transactionId: ID, transactionLineId: ID, transactionDetailLocalData: TransactionReviewLocalData, vendorId?: string | undefined, selectedAccount?: AccountBase | undefined, selectedClassBase?: ClassBase | undefined) => TransactionReviewLocalData;
|
|
12
|
+
export declare const toSetAllLineItemsToCategoryClass: (draft: TransactionsTabViewState, transaction: SupportedTransaction, transactionId: ID, transactionLineId: ID, transactionDetailLocalData: TransactionReviewLocalData, updatedItem: 'category' | 'class', vendorId?: string | undefined, selectedAccount?: AccountBase | undefined, selectedClassBase?: ClassBase | undefined) => TransactionReviewLocalData;
|
|
13
13
|
export declare const setEntityRecommendationForLineIdInLocalData: (draft: TransactionsTabViewState, transaction: SupportedTransaction, transactionDetailLocalData: TransactionReviewLocalData, entity: Entity, recommendationLineIds: ID[], recommendationByLineId?: RecommendationByLineId | undefined) => TransactionReviewLocalData;
|
|
14
14
|
export declare const checkIfAllLineItemsAreCategoryClassFilled: (transaction: SupportedTransaction, transactionDetailLocalData: TransactionReviewLocalData) => boolean;
|
|
@@ -91,7 +91,7 @@ const buildLineItemById = (transaction, recommendations) => {
|
|
|
91
91
|
});
|
|
92
92
|
return lineItemData;
|
|
93
93
|
};
|
|
94
|
-
const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, transactionLineId, transactionDetailLocalData, vendorId, selectedAccount, selectedClassBase) => {
|
|
94
|
+
const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, transactionLineId, transactionDetailLocalData, updatedItem, vendorId, selectedAccount, selectedClassBase) => {
|
|
95
95
|
const newLineItems = {};
|
|
96
96
|
let selectedCheckBoxTransactionIds = draft.selectedCheckBoxTransactionIds;
|
|
97
97
|
if (transaction.lines != null) {
|
|
@@ -131,6 +131,7 @@ const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, tra
|
|
|
131
131
|
(record.vendor != null && record.vendor.id === vendorId)) {
|
|
132
132
|
// if the vendor is same, then set the account and class with the selected ones and add the transaction to the selected list
|
|
133
133
|
if (selectedAccount != null &&
|
|
134
|
+
updatedItem === 'category' &&
|
|
134
135
|
(((_a = record.account) === null || _a === void 0 ? void 0 : _a.qboId) == null ||
|
|
135
136
|
((_b = record.account) === null || _b === void 0 ? void 0 : _b.qboId) === exports.EXPENSE_QBOID ||
|
|
136
137
|
((_c = record.account) === null || _c === void 0 ? void 0 : _c.qboId) === exports.INCOME_QBOID)) {
|
|
@@ -142,7 +143,9 @@ const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, tra
|
|
|
142
143
|
selectedCheckBoxTransactionIds.push(transaction.id);
|
|
143
144
|
}
|
|
144
145
|
}
|
|
145
|
-
if (selectedClassBase != null &&
|
|
146
|
+
if (selectedClassBase != null &&
|
|
147
|
+
updatedItem === 'class' &&
|
|
148
|
+
((_d = record.class) === null || _d === void 0 ? void 0 : _d.qboId) == null) {
|
|
146
149
|
record.class = selectedClassBase;
|
|
147
150
|
if (record.account != null &&
|
|
148
151
|
selectedCheckBoxTransactionIds.length < exports.MAX_SELECTION_LIMIT &&
|
|
@@ -234,6 +234,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
234
234
|
reducer(draft, action) {
|
|
235
235
|
const { vendorId, selectedAccount, selectedClassBase, transactions, transactionId, lineId, selectedTab, } = action.payload;
|
|
236
236
|
const transactionLocalData = (0, get_1.default)(draft[selectedTab].transactionReviewLocalDataById, transactionId, undefined);
|
|
237
|
+
const existingAccount = transactionLocalData === null || transactionLocalData === void 0 ? void 0 : transactionLocalData.transactionReviewLocalData.lineItemById[lineId].account;
|
|
237
238
|
if (transactionLocalData != null) {
|
|
238
239
|
const newTransactionLocalData = Object.assign(Object.assign({}, transactionLocalData.transactionReviewLocalData), { lineItemById: Object.assign(Object.assign({}, transactionLocalData.transactionReviewLocalData.lineItemById), { [lineId]: Object.assign(Object.assign({}, transactionLocalData.transactionReviewLocalData.lineItemById[lineId]), { account: selectedAccount, class: selectedClassBase }) }) });
|
|
239
240
|
draft[selectedTab].transactionReviewLocalDataById[transactionId] = {
|
|
@@ -258,7 +259,9 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
258
259
|
if (transactionLocalData != null) {
|
|
259
260
|
draft[selectedTab].transactionReviewLocalDataById[transaction.id] = {
|
|
260
261
|
transactionId: transaction.id,
|
|
261
|
-
transactionReviewLocalData: (0, transactionCategorizationLocalDataHelper_1.toSetAllLineItemsToCategoryClass)(draft[selectedTab], transaction, transactionId, lineId, transactionLocalData.transactionReviewLocalData,
|
|
262
|
+
transactionReviewLocalData: (0, transactionCategorizationLocalDataHelper_1.toSetAllLineItemsToCategoryClass)(draft[selectedTab], transaction, transactionId, lineId, transactionLocalData.transactionReviewLocalData, (existingAccount === null || existingAccount === void 0 ? void 0 : existingAccount.accountId) !== (selectedAccount === null || selectedAccount === void 0 ? void 0 : selectedAccount.accountId)
|
|
263
|
+
? 'category'
|
|
264
|
+
: 'class', vendorId, selectedAccount, selectedClassBase),
|
|
262
265
|
};
|
|
263
266
|
}
|
|
264
267
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.91",
|
|
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
|
"types": "lib/index.d.ts",
|