@@ -1044,12 +1044,16 @@ function changeTransactionsReport({
10441044 actionName : oldIOUAction ?. actionName ?? CONST . REPORT . ACTIONS . TYPE . IOU ,
10451045 created : oldIOUAction ?. created ?? DateUtils . getDBTime ( ) ,
10461046 ...( ! oldIOUAction && {
1047+ actorAccountID : accountID ,
10471048 message : getIOUReportActionMessage ( reportID , actionType , Math . abs ( transaction . amount ) , transaction . comment ?. comment ?? '' , transaction . currency ) ,
10481049 } ) ,
10491050 } ;
10501051
10511052 const { comment} = isUnreported ? recalculateUnreportedTransactionDetails ( ) : { } ;
10521053
1054+ const shouldCopyOriginalAmount = transaction . originalAmount !== undefined && transaction . originalAmount !== transaction . amount ;
1055+ const shouldCopyOriginalCurrency = transaction . originalCurrency !== undefined && transaction . originalCurrency !== transaction . currency ;
1056+
10531057 // 1. Optimistically update the transaction with full data and changed fields.
10541058 // Spreading the full transaction ensures the TRANSACTION collection has complete data
10551059 // (e.g. amount) even when the existing entry was incomplete from search results.
@@ -1060,6 +1064,8 @@ function changeTransactionsReport({
10601064 ...transaction ,
10611065 reportID,
10621066 comment,
1067+ originalAmount : shouldCopyOriginalAmount ? transaction . originalAmount : null ,
1068+ originalCurrency : shouldCopyOriginalCurrency ? transaction . originalCurrency : null ,
10631069 ...( shouldClearAmount && { pendingAction : CONST . RED_BRICK_ROAD_PENDING_ACTION . UPDATE } ) ,
10641070 ...( shouldClearAmount && { convertedAmount : null } ) ,
10651071 ...( oldIOUAction ? { linkedTrackedExpenseReportAction : newIOUAction } : { } ) ,
@@ -1081,6 +1087,8 @@ function changeTransactionsReport({
10811087 value : {
10821088 reportID : transaction . reportID ,
10831089 comment : transaction . comment ,
1090+ originalAmount : transaction . originalAmount ,
1091+ originalCurrency : transaction . originalCurrency ,
10841092 ...( shouldClearAmount && { pendingAction : transaction . pendingAction ?? null } ) ,
10851093 ...( shouldClearAmount && { convertedAmount : transaction . convertedAmount } ) ,
10861094 } ,
0 commit comments