@zeniai/client-epic-state 4.19.48 → 4.19.49
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.
|
@@ -42,11 +42,14 @@ const toTransactionUpdatesFromTransactionDetailLocalData = (transactionDetailLoc
|
|
|
42
42
|
let lastUpdatedClass;
|
|
43
43
|
// single recommendation to just pick the last recommendation in the list of lines
|
|
44
44
|
transaction.lines?.forEach((line) => {
|
|
45
|
-
const
|
|
45
|
+
const lineItem = transactionDetailLocalData.lineItemById[line.id];
|
|
46
46
|
if (line.type === 'transaction_with_account_and_class_line' ||
|
|
47
47
|
line.type === 'transaction_with_product_or_service_line' ||
|
|
48
48
|
line.type === 'journal_entry_transaction_line') {
|
|
49
|
-
|
|
49
|
+
if (lineItem == null) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const entityDetails = getEntityDetails(selectedEntity, lineItem, transactionDetailLocalData.vendorUpdates, transactionDetailLocalData.customerUpdates);
|
|
50
53
|
updatesByLineId[line.id] = {
|
|
51
54
|
lineDescription: lineItem.lineDescription,
|
|
52
55
|
class: lineItem.class,
|
|
@@ -79,8 +82,8 @@ const toTransactionUpdatesFromTransactionDetailLocalData = (transactionDetailLoc
|
|
|
79
82
|
lineItem.class?.qboId !== accountLine.class.qboId;
|
|
80
83
|
const recommendedAccountBase = (0, exports.toRecommendedAccountBase)(lineItem.amount.amount, lineItem.account);
|
|
81
84
|
const recommendedClassBase = (0, exports.toRecommendedClassBase)(lineItem.amount.amount, lineItem.class);
|
|
82
|
-
const latestRecommendedCategory =
|
|
83
|
-
const latestrecommendedClass =
|
|
85
|
+
const latestRecommendedCategory = lineItem.recommendedAccount;
|
|
86
|
+
const latestrecommendedClass = lineItem.recommendedClass;
|
|
84
87
|
// If at any time the recommended category selected is different from the most recent
|
|
85
88
|
const isMostRecentRecommendedCategorySelected = Boolean(recommendedAccountBase) &&
|
|
86
89
|
Boolean(latestRecommendedCategory) &&
|
|
@@ -239,7 +242,7 @@ const getEntityDetails = (entity, lineItemLocalData, vendorUpdates, customerUpda
|
|
|
239
242
|
entityName: entity.name,
|
|
240
243
|
};
|
|
241
244
|
}
|
|
242
|
-
if (lineItemLocalData
|
|
245
|
+
if (lineItemLocalData?.lineEntity != null) {
|
|
243
246
|
return {
|
|
244
247
|
entityId: lineItemLocalData.lineEntity.qboId ?? lineItemLocalData.lineEntity.id,
|
|
245
248
|
entityType: lineItemLocalData.lineEntity.type,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.19.
|
|
3
|
+
"version": "4.19.49",
|
|
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",
|