@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.
|
@@ -39,11 +39,14 @@ export const toTransactionUpdatesFromTransactionDetailLocalData = (transactionDe
|
|
|
39
39
|
let lastUpdatedClass;
|
|
40
40
|
// single recommendation to just pick the last recommendation in the list of lines
|
|
41
41
|
transaction.lines?.forEach((line) => {
|
|
42
|
-
const
|
|
42
|
+
const lineItem = transactionDetailLocalData.lineItemById[line.id];
|
|
43
43
|
if (line.type === 'transaction_with_account_and_class_line' ||
|
|
44
44
|
line.type === 'transaction_with_product_or_service_line' ||
|
|
45
45
|
line.type === 'journal_entry_transaction_line') {
|
|
46
|
-
|
|
46
|
+
if (lineItem == null) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const entityDetails = getEntityDetails(selectedEntity, lineItem, transactionDetailLocalData.vendorUpdates, transactionDetailLocalData.customerUpdates);
|
|
47
50
|
updatesByLineId[line.id] = {
|
|
48
51
|
lineDescription: lineItem.lineDescription,
|
|
49
52
|
class: lineItem.class,
|
|
@@ -76,8 +79,8 @@ export const toTransactionUpdatesFromTransactionDetailLocalData = (transactionDe
|
|
|
76
79
|
lineItem.class?.qboId !== accountLine.class.qboId;
|
|
77
80
|
const recommendedAccountBase = toRecommendedAccountBase(lineItem.amount.amount, lineItem.account);
|
|
78
81
|
const recommendedClassBase = toRecommendedClassBase(lineItem.amount.amount, lineItem.class);
|
|
79
|
-
const latestRecommendedCategory =
|
|
80
|
-
const latestrecommendedClass =
|
|
82
|
+
const latestRecommendedCategory = lineItem.recommendedAccount;
|
|
83
|
+
const latestrecommendedClass = lineItem.recommendedClass;
|
|
81
84
|
// If at any time the recommended category selected is different from the most recent
|
|
82
85
|
const isMostRecentRecommendedCategorySelected = Boolean(recommendedAccountBase) &&
|
|
83
86
|
Boolean(latestRecommendedCategory) &&
|
|
@@ -233,7 +236,7 @@ const getEntityDetails = (entity, lineItemLocalData, vendorUpdates, customerUpda
|
|
|
233
236
|
entityName: entity.name,
|
|
234
237
|
};
|
|
235
238
|
}
|
|
236
|
-
if (lineItemLocalData
|
|
239
|
+
if (lineItemLocalData?.lineEntity != null) {
|
|
237
240
|
return {
|
|
238
241
|
entityId: lineItemLocalData.lineEntity.qboId ?? lineItemLocalData.lineEntity.id,
|
|
239
242
|
entityType: lineItemLocalData.lineEntity.type,
|