From 3d176eb543e739a0fd4dca94720e4bfdabf4a42e Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Wed, 17 Dec 2025 11:07:59 -0700 Subject: [PATCH 1/7] add card column --- src/CONST/index.ts | 2 ++ .../SelectionListWithSections/SearchTableHeader.tsx | 5 +++++ src/components/TransactionItemRow/index.tsx | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 4daf3831e086..bc5ffdc599c3 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -6698,6 +6698,7 @@ const CONST = { MERCHANT: this.TABLE_COLUMNS.MERCHANT, FROM: this.TABLE_COLUMNS.FROM, TO: this.TABLE_COLUMNS.TO, + CARD: this.TABLE_COLUMNS.CARD, CATEGORY: this.TABLE_COLUMNS.CATEGORY, TAG: this.TABLE_COLUMNS.TAG, ORIGINAL_AMOUNT: this.TABLE_COLUMNS.ORIGINAL_AMOUNT, @@ -6799,6 +6800,7 @@ const CONST = { DESCRIPTION: 'description', FROM: 'from', TO: 'to', + CARD: 'card', CATEGORY: 'category', TAG: 'tag', ORIGINAL_AMOUNT: 'originalamount', diff --git a/src/components/SelectionListWithSections/SearchTableHeader.tsx b/src/components/SelectionListWithSections/SearchTableHeader.tsx index 969777397f3e..d86f6939b171 100644 --- a/src/components/SelectionListWithSections/SearchTableHeader.tsx +++ b/src/components/SelectionListWithSections/SearchTableHeader.tsx @@ -66,6 +66,11 @@ const getExpenseHeaders = (groupBy?: SearchGroupBy): SearchColumnConfig[] => [ translationKey: 'common.to', canBeMissing: true, }, + { + columnName: CONST.SEARCH.TABLE_COLUMNS.CARD, + translationKey: 'common.card', + canBeMissing: true, + }, { columnName: CONST.SEARCH.TABLE_COLUMNS.CARD, translationKey: 'common.card', diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index 0b7cd7a70acd..e52d6830f313 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -410,6 +410,14 @@ function TransactionItemRow({ )} ), + [CONST.SEARCH.TABLE_COLUMNS.CARD]: ( + + + + ), [CONST.SEARCH.TABLE_COLUMNS.COMMENTS]: ( Date: Wed, 17 Dec 2025 11:11:54 -0700 Subject: [PATCH 2/7] add more logic --- src/CONST/index.ts | 1 - src/libs/SearchUIUtils.ts | 11 +++++++++++ src/styles/utils/index.ts | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index bc5ffdc599c3..944b78e2ca6a 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -6815,7 +6815,6 @@ const CONST = { ASSIGNEE: 'assignee', IN: 'in', COMMENTS: 'comments', - CARD: 'card', WITHDRAWAL_ID: 'withdrawalID', AVATAR: 'avatar', STATUS: 'status', diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index ef8d7e439db6..fa514302620c 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -2061,6 +2061,14 @@ function getSortedTransactionData( }); } + if (sortBy === CONST.SEARCH.TABLE_COLUMNS.CARD) { + return data.sort((a, b) => { + const aValue = "A"; + const bValue = 'B'; + return compareValues(aValue, bValue, sortOrder, sortBy, localeCompare); + }); + } + if (sortBy === CONST.SEARCH.TABLE_COLUMNS.STATUS) { return data.sort((a, b) => { const aReport = a.report; @@ -2318,6 +2326,8 @@ function getSearchColumnTranslationKey(columnId: SearchCustomColumnIds): Transla return 'common.title'; case CONST.SEARCH.TABLE_COLUMNS.STATUS: return 'common.status'; + case CONST.SEARCH.TABLE_COLUMNS.CARD: + return 'common.card'; case CONST.SEARCH.TABLE_COLUMNS.REPORT_ID: return 'common.longID'; case CONST.SEARCH.TABLE_COLUMNS.BASE_62_REPORT_ID: @@ -2781,6 +2791,7 @@ function getColumnsToShow( [CONST.SEARCH.TABLE_COLUMNS.DESCRIPTION]: false, [CONST.SEARCH.TABLE_COLUMNS.FROM]: false, [CONST.SEARCH.TABLE_COLUMNS.TO]: false, + [CONST.SEARCH.TABLE_COLUMNS.CARD]: false, [CONST.SEARCH.TABLE_COLUMNS.CATEGORY]: false, [CONST.SEARCH.TABLE_COLUMNS.TAG]: false, [CONST.SEARCH.TABLE_COLUMNS.REIMBURSABLE]: false, diff --git a/src/styles/utils/index.ts b/src/styles/utils/index.ts index 1cf3a8a0d344..1a7b934c69ae 100644 --- a/src/styles/utils/index.ts +++ b/src/styles/utils/index.ts @@ -1779,6 +1779,7 @@ const createStyleUtils = (theme: ThemeColors, styles: ThemeStyles) => ({ case CONST.SEARCH.TABLE_COLUMNS.ACTION: columnWidth = {...getWidthStyle(variables.w80), ...styles.alignItemsCenter}; break; + case CONST.SEARCH.TABLE_COLUMNS.CARD: case CONST.SEARCH.TABLE_COLUMNS.REPORT_ID: case CONST.SEARCH.TABLE_COLUMNS.BASE_62_REPORT_ID: case CONST.SEARCH.TABLE_COLUMNS.MERCHANT: From 22d47994a44172cac44cd0d92605415ba78c6f61 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Wed, 17 Dec 2025 11:16:43 -0700 Subject: [PATCH 3/7] rm dupe --- src/CONST/index.ts | 2 +- .../SelectionListWithSections/SearchTableHeader.tsx | 4 ---- src/components/TransactionItemRow/index.tsx | 1 + src/libs/SearchUIUtils.ts | 1 + 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 944b78e2ca6a..2b519382eb5d 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -6800,7 +6800,6 @@ const CONST = { DESCRIPTION: 'description', FROM: 'from', TO: 'to', - CARD: 'card', CATEGORY: 'category', TAG: 'tag', ORIGINAL_AMOUNT: 'originalamount', @@ -6815,6 +6814,7 @@ const CONST = { ASSIGNEE: 'assignee', IN: 'in', COMMENTS: 'comments', + CARD: 'card', WITHDRAWAL_ID: 'withdrawalID', AVATAR: 'avatar', STATUS: 'status', diff --git a/src/components/SelectionListWithSections/SearchTableHeader.tsx b/src/components/SelectionListWithSections/SearchTableHeader.tsx index d86f6939b171..c1d2ca7e7d91 100644 --- a/src/components/SelectionListWithSections/SearchTableHeader.tsx +++ b/src/components/SelectionListWithSections/SearchTableHeader.tsx @@ -71,10 +71,6 @@ const getExpenseHeaders = (groupBy?: SearchGroupBy): SearchColumnConfig[] => [ translationKey: 'common.card', canBeMissing: true, }, - { - columnName: CONST.SEARCH.TABLE_COLUMNS.CARD, - translationKey: 'common.card', - }, { columnName: CONST.SEARCH.TABLE_COLUMNS.CATEGORY, translationKey: 'common.category', diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index e52d6830f313..3a11ad824a55 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -415,6 +415,7 @@ function TransactionItemRow({ key={CONST.SEARCH.TABLE_COLUMNS.CARD} style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.CARD)]} > + {/* TODO## */} ), diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index fa514302620c..b7cf2f998634 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -2062,6 +2062,7 @@ function getSortedTransactionData( } if (sortBy === CONST.SEARCH.TABLE_COLUMNS.CARD) { + // TODO## return data.sort((a, b) => { const aValue = "A"; const bValue = 'B'; From 4b295e0c522a876767b1fd7a36fc786af2cd5994 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Wed, 17 Dec 2025 11:17:08 -0700 Subject: [PATCH 4/7] rm unnecessary key --- src/components/SelectionListWithSections/SearchTableHeader.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/SelectionListWithSections/SearchTableHeader.tsx b/src/components/SelectionListWithSections/SearchTableHeader.tsx index c1d2ca7e7d91..969777397f3e 100644 --- a/src/components/SelectionListWithSections/SearchTableHeader.tsx +++ b/src/components/SelectionListWithSections/SearchTableHeader.tsx @@ -69,7 +69,6 @@ const getExpenseHeaders = (groupBy?: SearchGroupBy): SearchColumnConfig[] => [ { columnName: CONST.SEARCH.TABLE_COLUMNS.CARD, translationKey: 'common.card', - canBeMissing: true, }, { columnName: CONST.SEARCH.TABLE_COLUMNS.CATEGORY, From 8e5dd9d3ba0b464fb1cd065f423dd4a38b218ba7 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Wed, 17 Dec 2025 11:19:21 -0700 Subject: [PATCH 5/7] rm useless columns from task --- src/libs/SearchUIUtils.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index b7cf2f998634..115f7437333e 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -2764,7 +2764,6 @@ function getColumnsToShow( [CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT]: false, [CONST.SEARCH.TABLE_COLUMNS.COMMENTS]: false, [CONST.SEARCH.TABLE_COLUMNS.TYPE]: false, - [CONST.SEARCH.TABLE_COLUMNS.CARD]: false, [CONST.SEARCH.TABLE_COLUMNS.WITHDRAWAL_ID]: false, }; } From 93748701ce85806d43117c4dba37fc0816864b3c Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Wed, 17 Dec 2025 12:38:30 -0700 Subject: [PATCH 6/7] update sorting --- src/components/TransactionItemRow/index.tsx | 3 +-- src/libs/SearchUIUtils.ts | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index 3a11ad824a55..81c752c3ddc0 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -415,8 +415,7 @@ function TransactionItemRow({ key={CONST.SEARCH.TABLE_COLUMNS.CARD} style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.CARD)]} > - {/* TODO## */} - + ), [CONST.SEARCH.TABLE_COLUMNS.COMMENTS]: ( diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index 115f7437333e..1d23da0c610a 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -151,7 +151,6 @@ const transactionColumnNamesToSortingProperty: TransactionSorting = { [CONST.SEARCH.TABLE_COLUMNS.TYPE]: null, [CONST.SEARCH.TABLE_COLUMNS.ACTION]: 'action' as const, [CONST.SEARCH.TABLE_COLUMNS.DESCRIPTION]: 'comment' as const, - [CONST.SEARCH.TABLE_COLUMNS.TAX_AMOUNT]: null, [CONST.SEARCH.TABLE_COLUMNS.RECEIPT]: null, }; @@ -2062,10 +2061,9 @@ function getSortedTransactionData( } if (sortBy === CONST.SEARCH.TABLE_COLUMNS.CARD) { - // TODO## return data.sort((a, b) => { - const aValue = "A"; - const bValue = 'B'; + const aValue = a.cardName === CONST.EXPENSE.TYPE.CASH_CARD_NAME ? '' : a.cardName ?? ''; + const bValue = b.cardName === CONST.EXPENSE.TYPE.CASH_CARD_NAME ? '' : b.cardName ?? ''; return compareValues(aValue, bValue, sortOrder, sortBy, localeCompare); }); } From 293d25f8802b7f1477bdb5cd12d8b44d91fa0de6 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Wed, 17 Dec 2025 12:44:59 -0700 Subject: [PATCH 7/7] fix sorting --- src/components/TransactionItemRow/index.tsx | 2 +- src/libs/SearchUIUtils.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx index 81c752c3ddc0..5a3a7ae93979 100644 --- a/src/components/TransactionItemRow/index.tsx +++ b/src/components/TransactionItemRow/index.tsx @@ -415,7 +415,7 @@ function TransactionItemRow({ key={CONST.SEARCH.TABLE_COLUMNS.CARD} style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.CARD)]} > - + ), [CONST.SEARCH.TABLE_COLUMNS.COMMENTS]: ( diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index 1d23da0c610a..6d2ba50128c3 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -2062,8 +2062,8 @@ function getSortedTransactionData( if (sortBy === CONST.SEARCH.TABLE_COLUMNS.CARD) { return data.sort((a, b) => { - const aValue = a.cardName === CONST.EXPENSE.TYPE.CASH_CARD_NAME ? '' : a.cardName ?? ''; - const bValue = b.cardName === CONST.EXPENSE.TYPE.CASH_CARD_NAME ? '' : b.cardName ?? ''; + const aValue = a.cardName === CONST.EXPENSE.TYPE.CASH_CARD_NAME ? '' : (a.cardName ?? ''); + const bValue = b.cardName === CONST.EXPENSE.TYPE.CASH_CARD_NAME ? '' : (b.cardName ?? ''); return compareValues(aValue, bValue, sortOrder, sortBy, localeCompare); }); }