From eebbf7c2378e0fb5b33d0b6a8c000053ef822293 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 13:44:56 -0700 Subject: [PATCH 01/21] add original amount --- src/CONST/index.ts | 2 ++ .../SelectionListWithSections/SearchTableHeader.tsx | 5 +++++ src/components/TransactionItemRow/index.tsx | 12 ++++++++++++ src/languages/en.ts | 1 + src/styles/utils/index.ts | 1 + 5 files changed, 21 insertions(+) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index f88ade495d2f..6e105249cac4 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -6695,6 +6695,7 @@ const CONST = { TO: this.TABLE_COLUMNS.TO, CATEGORY: this.TABLE_COLUMNS.CATEGORY, TAG: this.TABLE_COLUMNS.TAG, + ORIGINAL_AMOUNT: this.TABLE_COLUMNS.ORIGINAL_AMOUNT, STATUS: this.TABLE_COLUMNS.STATUS, ACTION: this.TABLE_COLUMNS.ACTION, }, @@ -6787,6 +6788,7 @@ const CONST = { TO: 'to', CATEGORY: 'category', TAG: 'tag', + ORIGINAL_AMOUNT: 'originalAmount', TOTAL_AMOUNT: 'amount', TOTAL: 'total', TYPE: 'type', diff --git a/src/components/SelectionListWithSections/SearchTableHeader.tsx b/src/components/SelectionListWithSections/SearchTableHeader.tsx index 250a13725754..a4fee3549bfc 100644 --- a/src/components/SelectionListWithSections/SearchTableHeader.tsx +++ b/src/components/SelectionListWithSections/SearchTableHeader.tsx @@ -76,6 +76,11 @@ const getExpenseHeaders = (groupBy?: SearchGroupBy): SearchColumnConfig[] => [ translationKey: 'common.tag', canBeMissing: true, }, + { + columnName: CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT, + translationKey: 'search.filters.originalAmount', + canBeMissing: true, + }, { columnName: CONST.SEARCH.TABLE_COLUMNS.WITHDRAWAL_ID, translationKey: 'common.withdrawalID', diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index 6753c6741a92..73967ec9a789 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -11,6 +11,7 @@ import ActionCell from '@components/SelectionListWithSections/Search/ActionCell' import DateCell from '@components/SelectionListWithSections/Search/DateCell'; import StatusCell from '@components/SelectionListWithSections/Search/StatusCell'; import UserInfoCell from '@components/SelectionListWithSections/Search/UserInfoCell'; +import AmountCell from '@components/SelectionListWithSections/Search/TotalCell'; import Text from '@components/Text'; import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; import useLocalize from '@hooks/useLocalize'; @@ -397,6 +398,17 @@ function TransactionItemRow({ /> ), + [CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT]: ( + + + + ), [CONST.SEARCH.TABLE_COLUMNS.TAX]: ( ({ case CONST.SEARCH.TABLE_COLUMNS.TAX_AMOUNT: columnWidth = {...getWidthStyle(isTaxAmountColumnWide ? variables.w130 : variables.w96), ...styles.alignItemsEnd}; break; + case CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT: case CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT: case CONST.SEARCH.TABLE_COLUMNS.TOTAL: columnWidth = {...getWidthStyle(isAmountColumnWide ? variables.w130 : variables.w96), ...styles.flex1, ...styles.alignItemsEnd}; From cd5fd50a224b02e37b6219f2c27f7aafebfe7d53 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 13:45:52 -0700 Subject: [PATCH 02/21] fix undefined value --- src/components/TransactionItemRow/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index 73967ec9a789..93706cdcc78b 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -31,6 +31,8 @@ import { isMerchantMissing, isScanning, isUnreportedAndHasInvalidDistanceRateTransaction, + getAmount, + getCurrency, } from '@libs/TransactionUtils'; import CONST from '@src/CONST'; import type {TranslationPaths} from '@src/languages/types'; @@ -404,8 +406,8 @@ function TransactionItemRow({ style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT, undefined, isAmountColumnWide)]} > ), From ff5a6c32a31e73815e0f69c148f52823b7da5ea4 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 13:48:20 -0700 Subject: [PATCH 03/21] move string --- src/components/SelectionListWithSections/SearchTableHeader.tsx | 2 +- src/languages/en.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/SelectionListWithSections/SearchTableHeader.tsx b/src/components/SelectionListWithSections/SearchTableHeader.tsx index a4fee3549bfc..bb8cdf0de724 100644 --- a/src/components/SelectionListWithSections/SearchTableHeader.tsx +++ b/src/components/SelectionListWithSections/SearchTableHeader.tsx @@ -78,7 +78,7 @@ const getExpenseHeaders = (groupBy?: SearchGroupBy): SearchColumnConfig[] => [ }, { columnName: CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT, - translationKey: 'search.filters.originalAmount', + translationKey: 'common.originalAmount', canBeMissing: true, }, { diff --git a/src/languages/en.ts b/src/languages/en.ts index eb761b1fcc91..98f23aa60bba 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -671,6 +671,7 @@ const translations = { unstableInternetConnection: 'Unstable internet connection. Please check your network and try again.', enableGlobalReimbursements: 'Enable Global Reimbursements', purchaseAmount: 'Purchase amount', + originalAmount: 'Original amount', frequency: 'Frequency', link: 'Link', pinned: 'Pinned', @@ -6676,7 +6677,6 @@ const translations = { selectAllMatchingItems: 'Select all matching items', allMatchingItemsSelected: 'All matching items selected', }, - originalAmount: 'Original amount', }, genericErrorPage: { title: 'Uh-oh, something went wrong!', From 24810ff403b1fbe129e38a4ae06b74fb725732ea Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 13:53:55 -0700 Subject: [PATCH 04/21] add to types --- src/components/SelectionListWithSections/types.ts | 6 ++++++ src/libs/SearchUIUtils.ts | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/components/SelectionListWithSections/types.ts b/src/components/SelectionListWithSections/types.ts index 9db2323fbd90..9c2b5cd9f18b 100644 --- a/src/components/SelectionListWithSections/types.ts +++ b/src/components/SelectionListWithSections/types.ts @@ -276,6 +276,12 @@ type TransactionListItemType = ListItem & /** final and formatted "merchant" value used for displaying and sorting */ formattedMerchant: string; + /** The original amount of the transaction */ + originalAmount: number; + + /** The original currency of the transaction */ + originalCurrency: string; + /** final "date" value used for sorting */ date: string; diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index 214d5ef24d56..c9c7a09233c1 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -144,6 +144,7 @@ const transactionColumnNamesToSortingProperty: TransactionSorting = { [CONST.SEARCH.TABLE_COLUMNS.MERCHANT]: 'formattedMerchant' as const, [CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT]: 'formattedTotal' as const, [CONST.SEARCH.TABLE_COLUMNS.CATEGORY]: 'category' as const, + [CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT]: 'originalAmount' as const, [CONST.SEARCH.TABLE_COLUMNS.TYPE]: null, [CONST.SEARCH.TABLE_COLUMNS.ACTION]: 'action' as const, [CONST.SEARCH.TABLE_COLUMNS.DESCRIPTION]: 'comment' as const, @@ -2221,6 +2222,8 @@ function getSearchColumnTranslationKey(columnId: SearchCustomColumnIds): Transla return 'common.receipt'; case CONST.SEARCH.TABLE_COLUMNS.TAG: return 'common.tag'; + case CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT: + return 'common.originalAmount'; case CONST.SEARCH.TABLE_COLUMNS.ACTION: return 'common.action'; case CONST.SEARCH.TABLE_COLUMNS.TITLE: @@ -2686,6 +2689,7 @@ function getColumnsToShow( [CONST.SEARCH.TABLE_COLUMNS.CATEGORY]: false, [CONST.SEARCH.TABLE_COLUMNS.TAG]: false, [CONST.SEARCH.TABLE_COLUMNS.TAX_AMOUNT]: false, + [CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT]: false, [CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT]: true, [CONST.SEARCH.TABLE_COLUMNS.STATUS]: false, [CONST.SEARCH.TABLE_COLUMNS.ACTION]: true, From ee27d267e854ec6499119a870ab3da0d25aec0f5 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 13:54:55 -0700 Subject: [PATCH 05/21] add to types --- src/types/onyx/SearchResults.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/types/onyx/SearchResults.ts b/src/types/onyx/SearchResults.ts index 08b66a5086af..9afc18f8c5b6 100644 --- a/src/types/onyx/SearchResults.ts +++ b/src/types/onyx/SearchResults.ts @@ -158,6 +158,12 @@ type SearchTransaction = { /** The type of action that's pending */ pendingAction?: OnyxCommon.PendingAction; + /** The original amount of the transaction */ + originalAmount?: number; + + /** The original currency of the transaction */ + originalCurrency?: string; + /** The CC for this transaction */ cardID?: number; From b0f231563b77fb4493e816a43591ca5f2f3b8fe4 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 13:55:22 -0700 Subject: [PATCH 06/21] fix type --- src/components/SelectionListWithSections/types.ts | 4 ++-- src/types/onyx/SearchResults.ts | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/components/SelectionListWithSections/types.ts b/src/components/SelectionListWithSections/types.ts index 9c2b5cd9f18b..3d62d2387670 100644 --- a/src/components/SelectionListWithSections/types.ts +++ b/src/components/SelectionListWithSections/types.ts @@ -277,10 +277,10 @@ type TransactionListItemType = ListItem & formattedMerchant: string; /** The original amount of the transaction */ - originalAmount: number; + originalAmount?: number; /** The original currency of the transaction */ - originalCurrency: string; + originalCurrency?: string; /** final "date" value used for sorting */ date: string; diff --git a/src/types/onyx/SearchResults.ts b/src/types/onyx/SearchResults.ts index 9afc18f8c5b6..08b66a5086af 100644 --- a/src/types/onyx/SearchResults.ts +++ b/src/types/onyx/SearchResults.ts @@ -158,12 +158,6 @@ type SearchTransaction = { /** The type of action that's pending */ pendingAction?: OnyxCommon.PendingAction; - /** The original amount of the transaction */ - originalAmount?: number; - - /** The original currency of the transaction */ - originalCurrency?: string; - /** The CC for this transaction */ cardID?: number; From 2422fd4570d86adc8147cbb6d0be7331bf2c237a Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 13:56:05 -0700 Subject: [PATCH 07/21] add translations --- src/languages/de.ts | 1 + src/languages/fr.ts | 1 + src/languages/it.ts | 1 + src/languages/ja.ts | 1 + src/languages/nl.ts | 1 + src/languages/pl.ts | 1 + src/languages/pt-BR.ts | 1 + src/languages/zh-hans.ts | 1 + 8 files changed, 8 insertions(+) diff --git a/src/languages/de.ts b/src/languages/de.ts index d3f2b7f6ddbf..4b4cf21b6a31 100644 --- a/src/languages/de.ts +++ b/src/languages/de.ts @@ -691,6 +691,7 @@ const translations: TranslationDeepObject = { actionRequired: 'Aktion erforderlich', duplicate: 'Duplizieren', duplicated: 'Dupliziert', + originalAmount: 'Ursprünglicher Betrag', }, supportalNoAccess: { title: 'Nicht so schnell', diff --git a/src/languages/fr.ts b/src/languages/fr.ts index 9d7b9a189d68..684040348e4a 100644 --- a/src/languages/fr.ts +++ b/src/languages/fr.ts @@ -693,6 +693,7 @@ const translations: TranslationDeepObject = { actionRequired: 'Action requise', duplicate: 'Dupliquer', duplicated: 'Dupliqué', + originalAmount: 'Montant d’origine', }, supportalNoAccess: { title: 'Pas si vite', diff --git a/src/languages/it.ts b/src/languages/it.ts index cdecb0981289..08730e0a86d9 100644 --- a/src/languages/it.ts +++ b/src/languages/it.ts @@ -692,6 +692,7 @@ const translations: TranslationDeepObject = { actionRequired: 'Azione richiesta', duplicate: 'Duplica', duplicated: 'Duplicato', + originalAmount: 'Importo originale', }, supportalNoAccess: { title: 'Non così in fretta', diff --git a/src/languages/ja.ts b/src/languages/ja.ts index 3e62d11f4448..1cce0054ea8b 100644 --- a/src/languages/ja.ts +++ b/src/languages/ja.ts @@ -691,6 +691,7 @@ const translations: TranslationDeepObject = { actionRequired: '対応が必要', duplicate: '複製', duplicated: '重複', + originalAmount: '元の金額', }, supportalNoAccess: { title: 'ちょっと待ってください', diff --git a/src/languages/nl.ts b/src/languages/nl.ts index eaa4dfc0c1ab..f051127c27f6 100644 --- a/src/languages/nl.ts +++ b/src/languages/nl.ts @@ -692,6 +692,7 @@ const translations: TranslationDeepObject = { actionRequired: 'Actie vereist', duplicate: 'Dupliceren', duplicated: 'Gedupliceerd', + originalAmount: 'Oorspronkelijk bedrag', }, supportalNoAccess: { title: 'Niet zo snel', diff --git a/src/languages/pl.ts b/src/languages/pl.ts index 7832371a2f2d..2ea6769557da 100644 --- a/src/languages/pl.ts +++ b/src/languages/pl.ts @@ -692,6 +692,7 @@ const translations: TranslationDeepObject = { actionRequired: 'Wymagane działanie', duplicate: 'Duplikat', duplicated: 'Zduplikowano', + originalAmount: 'Kwota pierwotna', }, supportalNoAccess: { title: 'Nie tak szybko', diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts index 8e3eec5ab566..be62a9544d14 100644 --- a/src/languages/pt-BR.ts +++ b/src/languages/pt-BR.ts @@ -691,6 +691,7 @@ const translations: TranslationDeepObject = { actionRequired: 'Ação necessária', duplicate: 'Duplicar', duplicated: 'Duplicado', + originalAmount: 'Valor original', }, supportalNoAccess: { title: 'Não tão rápido', diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts index 0ee2a324d7ce..3e67e63bd07c 100644 --- a/src/languages/zh-hans.ts +++ b/src/languages/zh-hans.ts @@ -688,6 +688,7 @@ const translations: TranslationDeepObject = { actionRequired: '需要操作', duplicate: '复制', duplicated: '已重复', + originalAmount: '原始金额', }, supportalNoAccess: { title: '先别急', From d30a6479b73a7f5e352f893a7b40f863ffefaacc Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 14:13:16 -0700 Subject: [PATCH 08/21] fix prettier --- src/components/TransactionItemRow/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index 93706cdcc78b..f8a4ab444300 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -10,8 +10,8 @@ import type {SearchColumnType, TableColumnSize} from '@components/Search/types'; import ActionCell from '@components/SelectionListWithSections/Search/ActionCell'; import DateCell from '@components/SelectionListWithSections/Search/DateCell'; import StatusCell from '@components/SelectionListWithSections/Search/StatusCell'; -import UserInfoCell from '@components/SelectionListWithSections/Search/UserInfoCell'; import AmountCell from '@components/SelectionListWithSections/Search/TotalCell'; +import UserInfoCell from '@components/SelectionListWithSections/Search/UserInfoCell'; import Text from '@components/Text'; import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; import useLocalize from '@hooks/useLocalize'; @@ -23,6 +23,8 @@ import {isCategoryMissing} from '@libs/CategoryUtils'; import {isSettled} from '@libs/ReportUtils'; import StringUtils from '@libs/StringUtils'; import { + getAmount, + getCurrency, getDescription, getMerchant, getCreated as getTransactionCreated, @@ -31,8 +33,6 @@ import { isMerchantMissing, isScanning, isUnreportedAndHasInvalidDistanceRateTransaction, - getAmount, - getCurrency, } from '@libs/TransactionUtils'; import CONST from '@src/CONST'; import type {TranslationPaths} from '@src/languages/types'; From 0508dbfeb64f8703f60f4edc31dc5337b0289757 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 14:18:19 -0700 Subject: [PATCH 09/21] add es, fix negative amount --- src/components/TransactionItemRow/index.tsx | 6 ++++-- src/languages/es.ts | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index f8a4ab444300..e6beb77785f3 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -33,6 +33,8 @@ import { isMerchantMissing, isScanning, isUnreportedAndHasInvalidDistanceRateTransaction, + getOriginalAmount, + getOriginalCurrency, } from '@libs/TransactionUtils'; import CONST from '@src/CONST'; import type {TranslationPaths} from '@src/languages/types'; @@ -406,8 +408,8 @@ function TransactionItemRow({ style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT, undefined, isAmountColumnWide)]} > ), diff --git a/src/languages/es.ts b/src/languages/es.ts index 52c73efba25e..db394e8c1d6c 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -367,6 +367,7 @@ const translations: TranslationDeepObject = { unstableInternetConnection: 'Conexión a internet inestable. Por favor, revisa tu red e inténtalo de nuevo.', enableGlobalReimbursements: 'Habilitar Reembolsos Globales', purchaseAmount: 'Importe de compra', + originalAmount: 'Importe original', frequency: 'Frecuencia', link: 'Enlace', pinned: 'Fijado', From e5e751e931f8312b7eee49531e6ddf02092f4ff0 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 14:48:55 -0700 Subject: [PATCH 10/21] gst --- src/components/TransactionItemRow/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index e6beb77785f3..748db4929363 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -20,21 +20,21 @@ import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import {isCategoryMissing} from '@libs/CategoryUtils'; -import {isSettled} from '@libs/ReportUtils'; +import {isExpenseReport, isSettled} from '@libs/ReportUtils'; import StringUtils from '@libs/StringUtils'; import { getAmount, getCurrency, getDescription, getMerchant, + getOriginalAmount, + getOriginalCurrency, getCreated as getTransactionCreated, hasMissingSmartscanFields, isAmountMissing, isMerchantMissing, isScanning, isUnreportedAndHasInvalidDistanceRateTransaction, - getOriginalAmount, - getOriginalCurrency, } from '@libs/TransactionUtils'; import CONST from '@src/CONST'; import type {TranslationPaths} from '@src/languages/types'; @@ -408,7 +408,7 @@ function TransactionItemRow({ style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT, undefined, isAmountColumnWide)]} > From 95c9d323b58d684c8b83193e4dcfd5f6d02a8d30 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 14:50:07 -0700 Subject: [PATCH 11/21] rm additional logic --- src/components/TransactionItemRow/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index 748db4929363..b9081f91cbb3 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -408,7 +408,7 @@ function TransactionItemRow({ style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT, undefined, isAmountColumnWide)]} > From 98596b087756b0fce6f83c9ff7a2a009e62dc4e8 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 15:30:31 -0700 Subject: [PATCH 12/21] use util methods --- src/components/TransactionItemRow/index.tsx | 5 +++-- src/libs/SearchUIUtils.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index b9081f91cbb3..27a189c5a442 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -408,8 +408,8 @@ function TransactionItemRow({ style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT, undefined, isAmountColumnWide)]} > ), @@ -456,6 +456,7 @@ function TransactionItemRow({ report?.policyID, report?.total, areAllOptionalColumnsHidden, + report, ], ); const shouldRenderChatBubbleCell = useMemo(() => { diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index c9c7a09233c1..1def45b1371a 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -1975,8 +1975,8 @@ function compareValues(a: unknown, b: unknown, sortOrder: SortOrder, sortBy: str } if (typeof a === 'number' && typeof b === 'number') { - const aValue = sortBy === CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT && !shouldCompareOriginalValue ? Math.abs(a) : a; - const bValue = sortBy === CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT && !shouldCompareOriginalValue ? Math.abs(b) : b; + const aValue = (sortBy === CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT || sortBy === CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT) && !shouldCompareOriginalValue ? Math.abs(a) : a; + const bValue = (sortBy === CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT || sortBy === CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT) && !shouldCompareOriginalValue ? Math.abs(b) : b; return isAsc ? aValue - bValue : bValue - aValue; } From f5ecfcbb6aa0f65e3660fdab3350f71b2a7d3250 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 15:31:36 -0700 Subject: [PATCH 13/21] rm incorrect dependency --- src/components/TransactionItemRow/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index 27a189c5a442..8608229ac6e6 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -456,7 +456,6 @@ function TransactionItemRow({ report?.policyID, report?.total, areAllOptionalColumnsHidden, - report, ], ); const shouldRenderChatBubbleCell = useMemo(() => { From d27bada45063a263961e0a709e5b2a375b5a30b5 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 16:17:23 -0700 Subject: [PATCH 14/21] fix dispaly amount, col name --- src/CONST/index.ts | 2 +- src/components/TransactionItemRow/index.tsx | 10 ++++++---- src/libs/SearchUIUtils.ts | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 6e105249cac4..8ceffe33918c 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -6788,7 +6788,7 @@ const CONST = { TO: 'to', CATEGORY: 'category', TAG: 'tag', - ORIGINAL_AMOUNT: 'originalAmount', + ORIGINAL_AMOUNT: 'originalamount', TOTAL_AMOUNT: 'amount', TOTAL: 'total', TYPE: 'type', diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index 8608229ac6e6..8f8617cfddb6 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -20,11 +20,9 @@ import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import {isCategoryMissing} from '@libs/CategoryUtils'; -import {isExpenseReport, isSettled} from '@libs/ReportUtils'; +import {isSettled} from '@libs/ReportUtils'; import StringUtils from '@libs/StringUtils'; import { - getAmount, - getCurrency, getDescription, getMerchant, getOriginalAmount, @@ -215,6 +213,10 @@ function TransactionItemRow({ } }, [transactionItem, translate, report]); + if (transactionItem.transactionID === '3710155799987794335') { + console.log('transactionItem', {transactionItem, originalAmount: (transactionItem.originalAmount ?? 0) * (transactionItem.report?.type === CONST.REPORT.TYPE.EXPENSE ? -1 : 1), reportType: transactionItem.report?.type}); + } + const columnComponent = useMemo( () => ({ [CONST.SEARCH.TABLE_COLUMNS.TYPE]: ( @@ -408,7 +410,7 @@ function TransactionItemRow({ style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT, undefined, isAmountColumnWide)]} > diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index 1def45b1371a..c9c7a09233c1 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -1975,8 +1975,8 @@ function compareValues(a: unknown, b: unknown, sortOrder: SortOrder, sortBy: str } if (typeof a === 'number' && typeof b === 'number') { - const aValue = (sortBy === CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT || sortBy === CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT) && !shouldCompareOriginalValue ? Math.abs(a) : a; - const bValue = (sortBy === CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT || sortBy === CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT) && !shouldCompareOriginalValue ? Math.abs(b) : b; + const aValue = sortBy === CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT && !shouldCompareOriginalValue ? Math.abs(a) : a; + const bValue = sortBy === CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT && !shouldCompareOriginalValue ? Math.abs(b) : b; return isAsc ? aValue - bValue : bValue - aValue; } From 290aea36caa0337b90030b7fcbc30e9dbf0a0ceb Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 16:18:04 -0700 Subject: [PATCH 15/21] use method --- src/components/TransactionItemRow/index.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index 8f8617cfddb6..a66db1efd25b 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -213,10 +213,6 @@ function TransactionItemRow({ } }, [transactionItem, translate, report]); - if (transactionItem.transactionID === '3710155799987794335') { - console.log('transactionItem', {transactionItem, originalAmount: (transactionItem.originalAmount ?? 0) * (transactionItem.report?.type === CONST.REPORT.TYPE.EXPENSE ? -1 : 1), reportType: transactionItem.report?.type}); - } - const columnComponent = useMemo( () => ({ [CONST.SEARCH.TABLE_COLUMNS.TYPE]: ( @@ -410,7 +406,7 @@ function TransactionItemRow({ style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT, undefined, isAmountColumnWide)]} > From 4b7e96de07dbb67dae4e81b8f24fc7b3df31ea7f Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 16:18:26 -0700 Subject: [PATCH 16/21] simplify code --- src/components/TransactionItemRow/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index a66db1efd25b..6bc76c2395a3 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -406,7 +406,7 @@ function TransactionItemRow({ style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT, undefined, isAmountColumnWide)]} > From f48a5a9524a684d466c8c51054286b65d6e08d74 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 16:19:23 -0700 Subject: [PATCH 17/21] fix negative sign --- src/components/TransactionItemRow/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index 6bc76c2395a3..069d37a72b02 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -213,6 +213,10 @@ function TransactionItemRow({ } }, [transactionItem, translate, report]); + if (transactionItem.transactionID === '3710155799987794335') { + console.log('transactionItem', {transactionItem, originalAmount: (transactionItem.originalAmount ?? 0) * (transactionItem.report?.type === CONST.REPORT.TYPE.EXPENSE ? -1 : 1), reportType: transactionItem.report?.type}); + } + const columnComponent = useMemo( () => ({ [CONST.SEARCH.TABLE_COLUMNS.TYPE]: ( @@ -406,7 +410,7 @@ function TransactionItemRow({ style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT, undefined, isAmountColumnWide)]} > From 3e2474a8ef525134434c71b04156c7fbcc11c81f Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 16:19:58 -0700 Subject: [PATCH 18/21] use util method --- src/components/TransactionItemRow/index.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index 069d37a72b02..8f9402b88236 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -20,7 +20,7 @@ import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import {isCategoryMissing} from '@libs/CategoryUtils'; -import {isSettled} from '@libs/ReportUtils'; +import {isSettled, isExpenseReport} from '@libs/ReportUtils'; import StringUtils from '@libs/StringUtils'; import { getDescription, @@ -213,10 +213,6 @@ function TransactionItemRow({ } }, [transactionItem, translate, report]); - if (transactionItem.transactionID === '3710155799987794335') { - console.log('transactionItem', {transactionItem, originalAmount: (transactionItem.originalAmount ?? 0) * (transactionItem.report?.type === CONST.REPORT.TYPE.EXPENSE ? -1 : 1), reportType: transactionItem.report?.type}); - } - const columnComponent = useMemo( () => ({ [CONST.SEARCH.TABLE_COLUMNS.TYPE]: ( @@ -410,7 +406,7 @@ function TransactionItemRow({ style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT, undefined, isAmountColumnWide)]} > From 01d44045be2407f770c4817795c50b6a2b74678a Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 16:34:06 -0700 Subject: [PATCH 19/21] fix sorting --- src/libs/SearchUIUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index c9c7a09233c1..d5b042c5a17f 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -1975,8 +1975,8 @@ function compareValues(a: unknown, b: unknown, sortOrder: SortOrder, sortBy: str } if (typeof a === 'number' && typeof b === 'number') { - const aValue = sortBy === CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT && !shouldCompareOriginalValue ? Math.abs(a) : a; - const bValue = sortBy === CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT && !shouldCompareOriginalValue ? Math.abs(b) : b; + const aValue = (sortBy === CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT || sortBy.toLowerCase() === CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT) && !shouldCompareOriginalValue ? Math.abs(a) : a; + const bValue = (sortBy === CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT || sortBy.toLowerCase() === CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT) && !shouldCompareOriginalValue ? Math.abs(b) : b; return isAsc ? aValue - bValue : bValue - aValue; } From 8a8b8216991d9567f83599831d21d4fd0a1d8408 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 16:39:36 -0700 Subject: [PATCH 20/21] fix prettier --- src/components/TransactionItemRow/index.tsx | 4 ++-- src/libs/SearchUIUtils.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index c68fa73bba29..01141f6f5524 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -10,8 +10,8 @@ import type {SearchColumnType, TableColumnSize} from '@components/Search/types'; import ActionCell from '@components/SelectionListWithSections/Search/ActionCell'; import DateCell from '@components/SelectionListWithSections/Search/DateCell'; import StatusCell from '@components/SelectionListWithSections/Search/StatusCell'; -import AmountCell from '@components/SelectionListWithSections/Search/TotalCell'; import TitleCell from '@components/SelectionListWithSections/Search/TitleCell'; +import AmountCell from '@components/SelectionListWithSections/Search/TotalCell'; import UserInfoCell from '@components/SelectionListWithSections/Search/UserInfoCell'; import Text from '@components/Text'; import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; @@ -21,7 +21,7 @@ import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import {isCategoryMissing} from '@libs/CategoryUtils'; -import {isSettled, isExpenseReport} from '@libs/ReportUtils'; +import {isExpenseReport, isSettled} from '@libs/ReportUtils'; import StringUtils from '@libs/StringUtils'; import { getDescription, diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index 76e094b924a3..180d487218a5 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -1998,8 +1998,10 @@ function compareValues(a: unknown, b: unknown, sortOrder: SortOrder, sortBy: str } if (typeof a === 'number' && typeof b === 'number') { - const aValue = (sortBy === CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT || sortBy.toLowerCase() === CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT) && !shouldCompareOriginalValue ? Math.abs(a) : a; - const bValue = (sortBy === CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT || sortBy.toLowerCase() === CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT) && !shouldCompareOriginalValue ? Math.abs(b) : b; + const aValue = + (sortBy === CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT || sortBy.toLowerCase() === CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT) && !shouldCompareOriginalValue ? Math.abs(a) : a; + const bValue = + (sortBy === CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT || sortBy.toLowerCase() === CONST.SEARCH.TABLE_COLUMNS.ORIGINAL_AMOUNT) && !shouldCompareOriginalValue ? Math.abs(b) : b; return isAsc ? aValue - bValue : bValue - aValue; } From 871d2f0a743b6db885b7c0f3be01105f99b55c95 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Dec 2025 20:00:48 -0700 Subject: [PATCH 21/21] fix prettier --- src/components/TransactionItemRow/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index 45c2ad1595a8..0b7cd7a70acd 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -10,8 +10,8 @@ import type {SearchColumnType, TableColumnSize} from '@components/Search/types'; import ActionCell from '@components/SelectionListWithSections/Search/ActionCell'; import DateCell from '@components/SelectionListWithSections/Search/DateCell'; import StatusCell from '@components/SelectionListWithSections/Search/StatusCell'; -import AmountCell from '@components/SelectionListWithSections/Search/TotalCell'; import TextCell from '@components/SelectionListWithSections/Search/TextCell'; +import AmountCell from '@components/SelectionListWithSections/Search/TotalCell'; import UserInfoCell from '@components/SelectionListWithSections/Search/UserInfoCell'; import Text from '@components/Text'; import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';