From 78d446a5aa94ad17b925afaae33c28682b84eb13 Mon Sep 17 00:00:00 2001 From: Dysto coder Date: Wed, 19 Jun 2024 22:28:33 +0300 Subject: [PATCH 1/5] Add state type to TransactionListItemType alias --- src/types/onyx/SearchResults.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/types/onyx/SearchResults.ts b/src/types/onyx/SearchResults.ts index 676a1d3873d9e..f756d14c9036f 100644 --- a/src/types/onyx/SearchResults.ts +++ b/src/types/onyx/SearchResults.ts @@ -147,6 +147,9 @@ type SearchTransaction = { receipt?: { /** Source of the receipt */ source?: string; + + /** State of the receipt */ + state?: ValueOf; }; /** The transaction tag */ From 8fbd0f3142d8d581dcc641802c44df6337acda82 Mon Sep 17 00:00:00 2001 From: Dysto coder Date: Wed, 19 Jun 2024 23:02:40 +0300 Subject: [PATCH 2/5] Add condition in TotalCell to check if receipt is scanning --- .../SelectionList/Search/TransactionListItemRow.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/SelectionList/Search/TransactionListItemRow.tsx b/src/components/SelectionList/Search/TransactionListItemRow.tsx index c0fff452d1e54..ed476072597ac 100644 --- a/src/components/SelectionList/Search/TransactionListItemRow.tsx +++ b/src/components/SelectionList/Search/TransactionListItemRow.tsx @@ -123,12 +123,18 @@ function MerchantCell({transactionItem, showTooltip}: TransactionCellProps) { function TotalCell({showTooltip, isLargeScreenWidth, transactionItem, isChildListItem}: TotalCellProps) { const styles = useThemeStyles(); + const {translate} = useLocalize(); const currency = TransactionUtils.getCurrency(transactionItem); + let amount = CurrencyUtils.convertToDisplayString(transactionItem.formattedTotal, currency); + + if (TransactionUtils.hasReceipt(transactionItem) && TransactionUtils.isReceiptBeingScanned(transactionItem)) { + amount = translate('iou.receiptStatusTitle'); + } return ( ); From 0d5a8ea9ec99b82c3bc7d459f3560c56c70af646 Mon Sep 17 00:00:00 2001 From: Dysto coder Date: Wed, 19 Jun 2024 23:09:14 +0300 Subject: [PATCH 3/5] Add condition in MerchantCell to check if receipt is scanning --- .../SelectionList/Search/TransactionListItemRow.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/SelectionList/Search/TransactionListItemRow.tsx b/src/components/SelectionList/Search/TransactionListItemRow.tsx index ed476072597ac..ef89918c2c590 100644 --- a/src/components/SelectionList/Search/TransactionListItemRow.tsx +++ b/src/components/SelectionList/Search/TransactionListItemRow.tsx @@ -110,12 +110,18 @@ function DateCell({transactionItem, showTooltip, isLargeScreenWidth}: Transactio function MerchantCell({transactionItem, showTooltip}: TransactionCellProps) { const styles = useThemeStyles(); + const {translate} = useLocalize(); const description = TransactionUtils.getDescription(transactionItem); + let merchant = transactionItem.shouldShowMerchant ? transactionItem.formattedMerchant : description; + + if (TransactionUtils.hasReceipt(transactionItem) && TransactionUtils.isReceiptBeingScanned(transactionItem)) { + merchant = translate('iou.receiptStatusTitle'); + } return ( ); From 7f8ae24df7162fbb0dfd415127aabb2bd167f367 Mon Sep 17 00:00:00 2001 From: Dysto coder Date: Mon, 24 Jun 2024 21:10:53 +0300 Subject: [PATCH 4/5] Fix failing lint --- src/types/onyx/SearchResults.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/onyx/SearchResults.ts b/src/types/onyx/SearchResults.ts index f756d14c9036f..0c27d21d1a138 100644 --- a/src/types/onyx/SearchResults.ts +++ b/src/types/onyx/SearchResults.ts @@ -147,7 +147,7 @@ type SearchTransaction = { receipt?: { /** Source of the receipt */ source?: string; - + /** State of the receipt */ state?: ValueOf; }; From 888e64678ad6debce93b3c602901dd6106222e71 Mon Sep 17 00:00:00 2001 From: Dysto coder Date: Mon, 24 Jun 2024 23:04:06 +0300 Subject: [PATCH 5/5] Fix lint and typecheck failing --- src/components/SelectionList/Search/TransactionListItemRow.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/SelectionList/Search/TransactionListItemRow.tsx b/src/components/SelectionList/Search/TransactionListItemRow.tsx index 07398f90b65f5..452af82fb78f1 100644 --- a/src/components/SelectionList/Search/TransactionListItemRow.tsx +++ b/src/components/SelectionList/Search/TransactionListItemRow.tsx @@ -6,6 +6,7 @@ import * as Expensicons from '@components/Icon/Expensicons'; import ReceiptImage from '@components/ReceiptImage'; import type {TransactionListItemType} from '@components/SelectionList/types'; import TextWithTooltip from '@components/TextWithTooltip'; +import useLocalize from '@hooks/useLocalize'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles';