From 1f2f12f799829ca16c8c5e2c9bfd2e3a5073a116 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 14 Jul 2025 06:48:06 +0000 Subject: [PATCH 01/16] Update version to 9.1.80-1 (cherry picked from commit 829f977e79f5a81c9081a651867667d6ceb2d162) (cherry-picked to staging by Beamanator) --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NotificationServiceExtension/Info.plist | 2 +- ios/ShareViewController/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index ef47429a34e03..0bb5bdb448a3b 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -114,8 +114,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1009018000 - versionName "9.1.80-0" + versionCode 1009018001 + versionName "9.1.80-1" // Supported language variants must be declared here to avoid from being removed during the compilation. // This also helps us to not include unnecessary language variants in the APK. resConfigs "en", "es" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 4038ff2025566..c229ccad8e99c 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -44,7 +44,7 @@ CFBundleVersion - 9.1.80.0 + 9.1.80.1 FullStory OrgId diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index bd5a36795ae1f..6d2912efb1b54 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 9.1.80 CFBundleVersion - 9.1.80.0 + 9.1.80.1 NSExtension NSExtensionPointIdentifier diff --git a/ios/ShareViewController/Info.plist b/ios/ShareViewController/Info.plist index 6747dfe8eb98f..53be59050694a 100644 --- a/ios/ShareViewController/Info.plist +++ b/ios/ShareViewController/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 9.1.80 CFBundleVersion - 9.1.80.0 + 9.1.80.1 NSExtension NSExtensionAttributes diff --git a/package-lock.json b/package-lock.json index 7b0008db1fafe..0f98d2dcee938 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "9.1.80-0", + "version": "9.1.80-1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "9.1.80-0", + "version": "9.1.80-1", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index b0d984352a4b0..b0ab2f4776932 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "9.1.80-0", + "version": "9.1.80-1", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 7a773edbad4df2adcbbac322ab0b0bb5f5711449 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 14 Jul 2025 06:48:49 +0000 Subject: [PATCH 02/16] Update Mobile-Expensify submodule version to 9.1.80-1 --- Mobile-Expensify | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mobile-Expensify b/Mobile-Expensify index 9b5d2969570a2..ee9c0c6f92381 160000 --- a/Mobile-Expensify +++ b/Mobile-Expensify @@ -1 +1 @@ -Subproject commit 9b5d2969570a267b0c20c8f3e9f2e3892b4043cc +Subproject commit ee9c0c6f9238144c119e57f1e1efb8cb94031a87 From 45a8ae4d5060264bbe95f5421123d25dfbfb995f Mon Sep 17 00:00:00 2001 From: Monil Bhavsar Date: Mon, 14 Jul 2025 09:14:09 +0530 Subject: [PATCH 03/16] Merge pull request #66011 from allgandalf/fix/65993 [CP Staging] [Fix]: Missing Copy on Tag Import Screen (cherry picked from commit ccd01b252fa07c93dbb5a79c41fe0ec50296c2b8) (cherry-picked to staging by Beamanator) --- src/components/ImportSpreadsheet.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/ImportSpreadsheet.tsx b/src/components/ImportSpreadsheet.tsx index bb2353c1338d0..f3b966d7e49c5 100644 --- a/src/components/ImportSpreadsheet.tsx +++ b/src/components/ImportSpreadsheet.tsx @@ -8,6 +8,7 @@ import useOnyx from '@hooks/useOnyx'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useThemeStyles from '@hooks/useThemeStyles'; import {setSpreadsheetData} from '@libs/actions/ImportSpreadsheet'; +import {setImportedSpreadsheetIsImportingMultiLevelTags} from '@libs/actions/Policy/Tag'; import {canUseTouchScreen} from '@libs/DeviceCapabilities'; import {splitExtensionFromFileName} from '@libs/fileDownload/FileUtils'; import Navigation from '@libs/Navigation/Navigation'; @@ -155,7 +156,9 @@ function ImportSpreadsheet({backTo, goTo}: ImportSpreadsheetProps) { {...panResponder.panHandlers} > {spreadsheet?.isImportingMultiLevelTags ? translate('spreadsheet.import') : translate('spreadsheet.upload')} - + + + {({openPicker}) => ( @@ -195,7 +198,12 @@ function ImportSpreadsheet({backTo, goTo}: ImportSpreadsheetProps) { Navigation.goBack(backTo)} + onBackButtonPress={() => { + if (spreadsheet?.isImportingMultiLevelTags) { + setImportedSpreadsheetIsImportingMultiLevelTags(false); + } + Navigation.goBack(backTo); + }} /> From b48888989b389ada1772996defe7aca0324f1479 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 14 Jul 2025 10:28:40 +0000 Subject: [PATCH 04/16] Update version to 9.1.80-2 (cherry picked from commit e1fd349aae635bc6e204801c35943c7342fa6845) (cherry-picked to staging by Beamanator) --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NotificationServiceExtension/Info.plist | 2 +- ios/ShareViewController/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 0bb5bdb448a3b..5b40e47545089 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -114,8 +114,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1009018001 - versionName "9.1.80-1" + versionCode 1009018002 + versionName "9.1.80-2" // Supported language variants must be declared here to avoid from being removed during the compilation. // This also helps us to not include unnecessary language variants in the APK. resConfigs "en", "es" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index c229ccad8e99c..79b9a3e13dc4b 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -44,7 +44,7 @@ CFBundleVersion - 9.1.80.1 + 9.1.80.2 FullStory OrgId diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index 6d2912efb1b54..2f2bac87be4d3 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 9.1.80 CFBundleVersion - 9.1.80.1 + 9.1.80.2 NSExtension NSExtensionPointIdentifier diff --git a/ios/ShareViewController/Info.plist b/ios/ShareViewController/Info.plist index 53be59050694a..5e1de76ae7752 100644 --- a/ios/ShareViewController/Info.plist +++ b/ios/ShareViewController/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 9.1.80 CFBundleVersion - 9.1.80.1 + 9.1.80.2 NSExtension NSExtensionAttributes diff --git a/package-lock.json b/package-lock.json index 0f98d2dcee938..b15ffcc9c49c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "9.1.80-1", + "version": "9.1.80-2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "9.1.80-1", + "version": "9.1.80-2", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index b0ab2f4776932..8260499bdf1af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "9.1.80-1", + "version": "9.1.80-2", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 1417addfc98a1d063e39d70b191f278ec817dfb3 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 14 Jul 2025 10:29:19 +0000 Subject: [PATCH 05/16] Update Mobile-Expensify submodule version to 9.1.80-2 --- Mobile-Expensify | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mobile-Expensify b/Mobile-Expensify index ee9c0c6f92381..7179f393df663 160000 --- a/Mobile-Expensify +++ b/Mobile-Expensify @@ -1 +1 @@ -Subproject commit ee9c0c6f9238144c119e57f1e1efb8cb94031a87 +Subproject commit 7179f393df663df8054d8c73f5a3ce2d1f4c98e9 From cc41bf10e8ba781ebe4397f71cde30de6ec00f28 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Mon, 14 Jul 2025 13:24:57 +0300 Subject: [PATCH 06/16] Merge pull request #66041 from s77rt/last-month-dev-again Lock `Last-month` posted date option behind dev (cherry picked from commit b0bad39c89c46d8f62322dc4a6eac1faaeca934a) (cherry-picked to staging by Beamanator) --- src/CONST/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 00bcc5976d4d9..12c74e013fd07 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -6393,8 +6393,7 @@ const CONST = { get FILTER_DATE_PRESETS() { return { // s77rt remove DEV lock - [this.SYNTAX_FILTER_KEYS.POSTED]: - (Config?.ENVIRONMENT ?? 'development') === 'development' ? [this.DATE_PRESETS.LAST_STATEMENT, this.DATE_PRESETS.LAST_MONTH] : [this.DATE_PRESETS.LAST_MONTH], + [this.SYNTAX_FILTER_KEYS.POSTED]: (Config?.ENVIRONMENT ?? 'development') === 'development' ? [this.DATE_PRESETS.LAST_STATEMENT, this.DATE_PRESETS.LAST_MONTH] : [], [this.SYNTAX_FILTER_KEYS.EXPORTED]: [this.DATE_PRESETS.NEVER], }; }, From 55b52aa614bff78f00e4502584c65a53e9fa56cc Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 14 Jul 2025 12:10:33 +0000 Subject: [PATCH 07/16] Update version to 9.1.80-3 (cherry picked from commit 8bbc00275d698c725836d177a45f965fc3bd883e) (cherry-picked to staging by grgia) --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NotificationServiceExtension/Info.plist | 2 +- ios/ShareViewController/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 5b40e47545089..64c67c353fffa 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -114,8 +114,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1009018002 - versionName "9.1.80-2" + versionCode 1009018003 + versionName "9.1.80-3" // Supported language variants must be declared here to avoid from being removed during the compilation. // This also helps us to not include unnecessary language variants in the APK. resConfigs "en", "es" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 79b9a3e13dc4b..061f3552f47a0 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -44,7 +44,7 @@ CFBundleVersion - 9.1.80.2 + 9.1.80.3 FullStory OrgId diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index 2f2bac87be4d3..dccfaa9f2d138 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 9.1.80 CFBundleVersion - 9.1.80.2 + 9.1.80.3 NSExtension NSExtensionPointIdentifier diff --git a/ios/ShareViewController/Info.plist b/ios/ShareViewController/Info.plist index 5e1de76ae7752..b2b65a50d1fd4 100644 --- a/ios/ShareViewController/Info.plist +++ b/ios/ShareViewController/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 9.1.80 CFBundleVersion - 9.1.80.2 + 9.1.80.3 NSExtension NSExtensionAttributes diff --git a/package-lock.json b/package-lock.json index b15ffcc9c49c1..ba91e01937d94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "9.1.80-2", + "version": "9.1.80-3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "9.1.80-2", + "version": "9.1.80-3", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 8260499bdf1af..6dd4daf29db1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "9.1.80-2", + "version": "9.1.80-3", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 8c4afcbc716d81b50a2e9136cb4236112c6710e8 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 14 Jul 2025 12:11:09 +0000 Subject: [PATCH 08/16] Update Mobile-Expensify submodule version to 9.1.80-3 --- Mobile-Expensify | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mobile-Expensify b/Mobile-Expensify index 7179f393df663..5c59ecf977f0f 160000 --- a/Mobile-Expensify +++ b/Mobile-Expensify @@ -1 +1 @@ -Subproject commit 7179f393df663df8054d8c73f5a3ce2d1f4c98e9 +Subproject commit 5c59ecf977f0ffaebf6cc265f2efc4931bed5040 From 82860f0685a53cd57b8baad94be16a40bf29e049 Mon Sep 17 00:00:00 2001 From: Georgia Monahan <38015950+grgia@users.noreply.github.com> Date: Mon, 14 Jul 2025 13:06:56 +0100 Subject: [PATCH 09/16] Merge pull request #66030 from getusha/fix-blockers fix: regressions after pay button standardization (cherry picked from commit 5c9a6149ff200e40a020a4584b0581b2197595c0) (cherry-picked to staging by grgia) --- src/components/KYCWall/BaseKYCWall.tsx | 2 +- src/components/SettlementButton/index.tsx | 8 +++--- src/languages/params.ts | 4 +-- src/libs/ReportUtils.ts | 30 +++++++++++++---------- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/components/KYCWall/BaseKYCWall.tsx b/src/components/KYCWall/BaseKYCWall.tsx index 3a7f8de9d94d1..69899c1692637 100644 --- a/src/components/KYCWall/BaseKYCWall.tsx +++ b/src/components/KYCWall/BaseKYCWall.tsx @@ -228,7 +228,7 @@ function KYCWall({ } // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - if (paymentMethod || policy) { + if ((paymentMethod || policy) && !hasActivatedWallet) { setShouldShowAddPaymentMenu(false); selectPaymentMethod(paymentMethod, policy); return; diff --git a/src/components/SettlementButton/index.tsx b/src/components/SettlementButton/index.tsx index 96e26966ee879..36f05a780dd4f 100644 --- a/src/components/SettlementButton/index.tsx +++ b/src/components/SettlementButton/index.tsx @@ -123,7 +123,7 @@ function SettlementButton({ const hasMultiplePolicies = !isExpenseReport && activeAdminPolicies.length > 1; const lastPaymentMethodRef = useRef(lastPaymentMethod); const formattedPaymentMethods = formatPaymentMethods(bankAccountList, fundList, styles); - const hasIntentToPay = formattedPaymentMethods.length === 1 && !lastPaymentMethod; + const hasIntentToPay = ((formattedPaymentMethods.length === 1 && isIOUReport(iouReport)) || !!policy?.achAccount) && !lastPaymentMethod; useEffect(() => { if (isLoadingLastPaymentMethod) { @@ -262,7 +262,7 @@ function SettlementButton({ if (personalBankAccountList.length && canUsePersonalBankAccount) { buttonOptions.push({ text: translate('iou.settleWallet', {formattedAmount: ''}), - value: CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT, + value: CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT, icon: Expensicons.Wallet, }); } else if (canUsePersonalBankAccount) { @@ -293,7 +293,7 @@ function SettlementButton({ activeAdminPolicies.forEach((activePolicy) => { const policyName = activePolicy.name; buttonOptions.push({ - text: translate('iou.payWithPolicy', {policyName: truncate(policyName, {length: 20}), formattedAmount: ''}), + text: translate('iou.payWithPolicy', {policyName: truncate(policyName, {length: CONST.ADDITIONAL_ALLOWED_CHARACTERS}), formattedAmount: ''}), icon: Expensicons.Building, value: activePolicy.id, shouldUpdateSelectedIndex: false, @@ -535,7 +535,7 @@ function SettlementButton({ }; const customText = getCustomText(); - const secondaryText = getSecondaryText(); + const secondaryText = truncate(getSecondaryText(), {length: CONST.FORM_CHARACTER_LIMIT}); const defaultSelectedIndex = paymentButtonOptions.findIndex((paymentOption) => { if (lastPaymentMethod === CONST.IOU.PAYMENT_TYPE.ELSEWHERE) { diff --git a/src/languages/params.ts b/src/languages/params.ts index 3e99dfa091b0e..4a6a9685582aa 100644 --- a/src/languages/params.ts +++ b/src/languages/params.ts @@ -138,8 +138,8 @@ type SettleExpensifyCardParams = { }; type BusinessBankAccountParams = { - amount: string; - last4Digits: string; + amount?: string; + last4Digits?: string; }; type WorkspaceRouteParams = { diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 4f1e2d5e49cf6..1eae7067e0efb 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -4559,7 +4559,7 @@ function getReportPreviewMessage( } const containsNonReimbursable = hasNonReimbursableTransactions(report.reportID); - const {totalDisplaySpend: totalAmount, reimbursableSpend} = getMoneyRequestSpendBreakdown(report); + const {totalDisplaySpend: totalAmount} = getMoneyRequestSpendBreakdown(report); const parentReport = getParentReport(report); const policyName = getPolicyName({report: parentReport ?? report, policy}); @@ -4593,7 +4593,6 @@ function getReportPreviewMessage( // Show Paid preview message if it's settled or if the amount is paid & stuck at receivers end for only chat reports. if (isSettled(report.reportID) || (report.isWaitingOnBankAccount && isPreviewMessageForParentChatReport)) { - const formattedReimbursableAmount = convertToDisplayString(reimbursableSpend, report.currency); // A settled report preview message can come in three formats "paid ... elsewhere" or "paid ... with Expensify" let translatePhraseKey: TranslationPaths = 'iou.paidElsewhere'; if (isPreviewMessageForParentChatReport) { @@ -4619,7 +4618,7 @@ function getReportPreviewMessage( const payerDisplayName = isPreviewMessageForParentChatReport ? payerName : actualPayerName; return translateLocal(translatePhraseKey, { - amount: formattedReimbursableAmount, + amount: '', payer: payerDisplayName ?? '', last4Digits: reportPolicy?.achAccount?.accountNumber?.slice(-4) ?? '', }); @@ -5134,11 +5133,20 @@ function getReportNameInternal({ if (isMoneyRequestAction(parentReportAction)) { const originalMessage = getOriginalMessage(parentReportAction); + const reportPolicy = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]; + const last4Digits = reportPolicy?.achAccount?.accountNumber.slice(-4) ?? ''; + if (originalMessage?.type === CONST.IOU.REPORT_ACTION_TYPE.PAY) { if (originalMessage.paymentType === CONST.IOU.PAYMENT_TYPE.ELSEWHERE) { return translateLocal('iou.paidElsewhere'); } - if (originalMessage.paymentType === CONST.IOU.PAYMENT_TYPE.VBBA || originalMessage.paymentType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY) { + if (originalMessage.paymentType === CONST.IOU.PAYMENT_TYPE.VBBA) { + if (originalMessage.automaticAction) { + return translateLocal('iou.automaticallyPaidWithBusinessBankAccount', {last4Digits}); + } + return translateLocal('iou.businessBankAccount', {last4Digits}); + } + if (originalMessage.paymentType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY) { if (originalMessage.automaticAction) { return translateLocal('iou.automaticallyPaidWithExpensify'); } @@ -9204,12 +9212,6 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry, let translationKey: TranslationPaths; if (originalMessage?.type === CONST.IOU.REPORT_ACTION_TYPE.PAY) { - // The `REPORT_ACTION_TYPE.PAY` action type is used for both fulfilling existing requests and sending money. To - // differentiate between these two scenarios, we check if the `originalMessage` contains the `IOUDetails` - // property. If it does, it indicates that this is a 'Pay someone' action. - const {amount, currency} = originalMessage?.IOUDetails ?? originalMessage ?? {}; - const formattedAmount = convertToDisplayString(Math.abs(amount), currency) ?? ''; - const reportPolicy = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]; const last4Digits = reportPolicy?.achAccount?.accountNumber.slice(-4) ?? ''; @@ -9220,11 +9222,13 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry, case CONST.IOU.PAYMENT_TYPE.EXPENSIFY: case CONST.IOU.PAYMENT_TYPE.VBBA: if (isInvoice) { - return translateLocal(payAsBusiness ? 'iou.settleInvoiceBusiness' : 'iou.settleInvoicePersonal', {amount: formattedAmount, last4Digits}); + return translateLocal(payAsBusiness ? 'iou.settleInvoiceBusiness' : 'iou.settleInvoicePersonal', {amount: '', last4Digits}); } translationKey = 'iou.businessBankAccount'; - if (automaticAction) { + if (automaticAction && originalMessage.paymentType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY) { translationKey = 'iou.automaticallyPaidWithExpensify'; + } else { + translationKey = 'iou.automaticallyPaidWithBusinessBankAccount'; } break; default: @@ -9232,7 +9236,7 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry, break; } - return translateLocal(translationKey, {amount: formattedAmount, payer: '', last4Digits}); + return translateLocal(translationKey, {amount: '', payer: '', last4Digits}); } const amount = getTransactionAmount(transaction, !isEmptyObject(iouReport) && isExpenseReport(iouReport)) ?? 0; From 65d104f451f25650c883cc32b7ad4a44c7dae054 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 14 Jul 2025 18:01:59 +0000 Subject: [PATCH 10/16] Update version to 9.1.80-4 (cherry picked from commit da2fcb8b0556c745bf2b131d57045941e5a7359f) (cherry-picked to staging by luacmartins) --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NotificationServiceExtension/Info.plist | 2 +- ios/ShareViewController/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 64c67c353fffa..39de1ae6e8626 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -114,8 +114,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1009018003 - versionName "9.1.80-3" + versionCode 1009018004 + versionName "9.1.80-4" // Supported language variants must be declared here to avoid from being removed during the compilation. // This also helps us to not include unnecessary language variants in the APK. resConfigs "en", "es" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 061f3552f47a0..a44fda7b307c7 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -44,7 +44,7 @@ CFBundleVersion - 9.1.80.3 + 9.1.80.4 FullStory OrgId diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index dccfaa9f2d138..4600edccb09fb 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 9.1.80 CFBundleVersion - 9.1.80.3 + 9.1.80.4 NSExtension NSExtensionPointIdentifier diff --git a/ios/ShareViewController/Info.plist b/ios/ShareViewController/Info.plist index b2b65a50d1fd4..dc0a178db4c4a 100644 --- a/ios/ShareViewController/Info.plist +++ b/ios/ShareViewController/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 9.1.80 CFBundleVersion - 9.1.80.3 + 9.1.80.4 NSExtension NSExtensionAttributes diff --git a/package-lock.json b/package-lock.json index ba91e01937d94..2db3b14fac09b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "9.1.80-3", + "version": "9.1.80-4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "9.1.80-3", + "version": "9.1.80-4", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 6dd4daf29db1f..8ed79b854a91e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "9.1.80-3", + "version": "9.1.80-4", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 2c34a586d7b5222a0489702c741acc42ddf7346e Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 14 Jul 2025 18:02:39 +0000 Subject: [PATCH 11/16] Update Mobile-Expensify submodule version to 9.1.80-4 --- Mobile-Expensify | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mobile-Expensify b/Mobile-Expensify index 5c59ecf977f0f..e8543ba39de09 160000 --- a/Mobile-Expensify +++ b/Mobile-Expensify @@ -1 +1 @@ -Subproject commit 5c59ecf977f0ffaebf6cc265f2efc4931bed5040 +Subproject commit e8543ba39de09ce14254009ffeb06754eff6d712 From beaa13332809ca094563c871c6ee3989a75e201b Mon Sep 17 00:00:00 2001 From: Rodrigo Lino da Costa <5201282+rlinoz@users.noreply.github.com> Date: Mon, 14 Jul 2025 13:47:15 -0300 Subject: [PATCH 12/16] Merge pull request #66062 from ganzz4/fix/65974 Fix: Report header shows "x expense" instead of "x for description" after removing merchant (cherry picked from commit ece1578441e570e67647aefd1db36a53751851a2) (cherry-picked to staging by luacmartins) --- src/libs/TransactionUtils/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libs/TransactionUtils/index.ts b/src/libs/TransactionUtils/index.ts index 516a60b8c8fb4..870605b7d7b6d 100644 --- a/src/libs/TransactionUtils/index.ts +++ b/src/libs/TransactionUtils/index.ts @@ -325,6 +325,10 @@ function hasReceiptSource(transaction: OnyxInputOrEntry): boolean { } function isMerchantMissing(transaction: OnyxEntry) { + if (transaction?.wasMerchantCleared) { + return true; + } + if (transaction?.modifiedMerchant && transaction.modifiedMerchant !== '') { return transaction.modifiedMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT; } From cfc8911609620ca847eba45f6cf6d84bcbebe9e0 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 14 Jul 2025 18:03:22 +0000 Subject: [PATCH 13/16] Update version to 9.1.80-5 (cherry picked from commit e804bfa52b8661d9eec294b21a7bf0a147f4baec) (cherry-picked to staging by luacmartins) --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NotificationServiceExtension/Info.plist | 2 +- ios/ShareViewController/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 39de1ae6e8626..1818fbd525ac9 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -114,8 +114,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1009018004 - versionName "9.1.80-4" + versionCode 1009018005 + versionName "9.1.80-5" // Supported language variants must be declared here to avoid from being removed during the compilation. // This also helps us to not include unnecessary language variants in the APK. resConfigs "en", "es" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index a44fda7b307c7..67be9a4fd30dc 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -44,7 +44,7 @@ CFBundleVersion - 9.1.80.4 + 9.1.80.5 FullStory OrgId diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index 4600edccb09fb..8be6c1ee4f754 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 9.1.80 CFBundleVersion - 9.1.80.4 + 9.1.80.5 NSExtension NSExtensionPointIdentifier diff --git a/ios/ShareViewController/Info.plist b/ios/ShareViewController/Info.plist index dc0a178db4c4a..dca30576934a5 100644 --- a/ios/ShareViewController/Info.plist +++ b/ios/ShareViewController/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 9.1.80 CFBundleVersion - 9.1.80.4 + 9.1.80.5 NSExtension NSExtensionAttributes diff --git a/package-lock.json b/package-lock.json index 2db3b14fac09b..bb2aa85244311 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "9.1.80-4", + "version": "9.1.80-5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "9.1.80-4", + "version": "9.1.80-5", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 8ed79b854a91e..4476e2c7493f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "9.1.80-4", + "version": "9.1.80-5", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From daa405001545546f3075ecfe9f26223077223194 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 14 Jul 2025 18:04:00 +0000 Subject: [PATCH 14/16] Update Mobile-Expensify submodule version to 9.1.80-5 --- Mobile-Expensify | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mobile-Expensify b/Mobile-Expensify index e8543ba39de09..ecdcef22fdef6 160000 --- a/Mobile-Expensify +++ b/Mobile-Expensify @@ -1 +1 @@ -Subproject commit e8543ba39de09ce14254009ffeb06754eff6d712 +Subproject commit ecdcef22fdef6f16c0b2435c5642edb61c3f1bc5 From 28f87187dbd0e28bef3e750405a82747b5097f43 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Mon, 14 Jul 2025 20:25:29 +0100 Subject: [PATCH 15/16] Revert "Merge pull request #66030 from getusha/fix-blockers" This reverts commit 82860f0685a53cd57b8baad94be16a40bf29e049. --- src/components/KYCWall/BaseKYCWall.tsx | 2 +- src/components/SettlementButton/index.tsx | 8 +++--- src/languages/params.ts | 4 +-- src/libs/ReportUtils.ts | 30 ++++++++++------------- 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/components/KYCWall/BaseKYCWall.tsx b/src/components/KYCWall/BaseKYCWall.tsx index 69899c1692637..3a7f8de9d94d1 100644 --- a/src/components/KYCWall/BaseKYCWall.tsx +++ b/src/components/KYCWall/BaseKYCWall.tsx @@ -228,7 +228,7 @@ function KYCWall({ } // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - if ((paymentMethod || policy) && !hasActivatedWallet) { + if (paymentMethod || policy) { setShouldShowAddPaymentMenu(false); selectPaymentMethod(paymentMethod, policy); return; diff --git a/src/components/SettlementButton/index.tsx b/src/components/SettlementButton/index.tsx index 36f05a780dd4f..96e26966ee879 100644 --- a/src/components/SettlementButton/index.tsx +++ b/src/components/SettlementButton/index.tsx @@ -123,7 +123,7 @@ function SettlementButton({ const hasMultiplePolicies = !isExpenseReport && activeAdminPolicies.length > 1; const lastPaymentMethodRef = useRef(lastPaymentMethod); const formattedPaymentMethods = formatPaymentMethods(bankAccountList, fundList, styles); - const hasIntentToPay = ((formattedPaymentMethods.length === 1 && isIOUReport(iouReport)) || !!policy?.achAccount) && !lastPaymentMethod; + const hasIntentToPay = formattedPaymentMethods.length === 1 && !lastPaymentMethod; useEffect(() => { if (isLoadingLastPaymentMethod) { @@ -262,7 +262,7 @@ function SettlementButton({ if (personalBankAccountList.length && canUsePersonalBankAccount) { buttonOptions.push({ text: translate('iou.settleWallet', {formattedAmount: ''}), - value: CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT, + value: CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT, icon: Expensicons.Wallet, }); } else if (canUsePersonalBankAccount) { @@ -293,7 +293,7 @@ function SettlementButton({ activeAdminPolicies.forEach((activePolicy) => { const policyName = activePolicy.name; buttonOptions.push({ - text: translate('iou.payWithPolicy', {policyName: truncate(policyName, {length: CONST.ADDITIONAL_ALLOWED_CHARACTERS}), formattedAmount: ''}), + text: translate('iou.payWithPolicy', {policyName: truncate(policyName, {length: 20}), formattedAmount: ''}), icon: Expensicons.Building, value: activePolicy.id, shouldUpdateSelectedIndex: false, @@ -535,7 +535,7 @@ function SettlementButton({ }; const customText = getCustomText(); - const secondaryText = truncate(getSecondaryText(), {length: CONST.FORM_CHARACTER_LIMIT}); + const secondaryText = getSecondaryText(); const defaultSelectedIndex = paymentButtonOptions.findIndex((paymentOption) => { if (lastPaymentMethod === CONST.IOU.PAYMENT_TYPE.ELSEWHERE) { diff --git a/src/languages/params.ts b/src/languages/params.ts index 4a6a9685582aa..3e99dfa091b0e 100644 --- a/src/languages/params.ts +++ b/src/languages/params.ts @@ -138,8 +138,8 @@ type SettleExpensifyCardParams = { }; type BusinessBankAccountParams = { - amount?: string; - last4Digits?: string; + amount: string; + last4Digits: string; }; type WorkspaceRouteParams = { diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 1eae7067e0efb..4f1e2d5e49cf6 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -4559,7 +4559,7 @@ function getReportPreviewMessage( } const containsNonReimbursable = hasNonReimbursableTransactions(report.reportID); - const {totalDisplaySpend: totalAmount} = getMoneyRequestSpendBreakdown(report); + const {totalDisplaySpend: totalAmount, reimbursableSpend} = getMoneyRequestSpendBreakdown(report); const parentReport = getParentReport(report); const policyName = getPolicyName({report: parentReport ?? report, policy}); @@ -4593,6 +4593,7 @@ function getReportPreviewMessage( // Show Paid preview message if it's settled or if the amount is paid & stuck at receivers end for only chat reports. if (isSettled(report.reportID) || (report.isWaitingOnBankAccount && isPreviewMessageForParentChatReport)) { + const formattedReimbursableAmount = convertToDisplayString(reimbursableSpend, report.currency); // A settled report preview message can come in three formats "paid ... elsewhere" or "paid ... with Expensify" let translatePhraseKey: TranslationPaths = 'iou.paidElsewhere'; if (isPreviewMessageForParentChatReport) { @@ -4618,7 +4619,7 @@ function getReportPreviewMessage( const payerDisplayName = isPreviewMessageForParentChatReport ? payerName : actualPayerName; return translateLocal(translatePhraseKey, { - amount: '', + amount: formattedReimbursableAmount, payer: payerDisplayName ?? '', last4Digits: reportPolicy?.achAccount?.accountNumber?.slice(-4) ?? '', }); @@ -5133,20 +5134,11 @@ function getReportNameInternal({ if (isMoneyRequestAction(parentReportAction)) { const originalMessage = getOriginalMessage(parentReportAction); - const reportPolicy = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]; - const last4Digits = reportPolicy?.achAccount?.accountNumber.slice(-4) ?? ''; - if (originalMessage?.type === CONST.IOU.REPORT_ACTION_TYPE.PAY) { if (originalMessage.paymentType === CONST.IOU.PAYMENT_TYPE.ELSEWHERE) { return translateLocal('iou.paidElsewhere'); } - if (originalMessage.paymentType === CONST.IOU.PAYMENT_TYPE.VBBA) { - if (originalMessage.automaticAction) { - return translateLocal('iou.automaticallyPaidWithBusinessBankAccount', {last4Digits}); - } - return translateLocal('iou.businessBankAccount', {last4Digits}); - } - if (originalMessage.paymentType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY) { + if (originalMessage.paymentType === CONST.IOU.PAYMENT_TYPE.VBBA || originalMessage.paymentType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY) { if (originalMessage.automaticAction) { return translateLocal('iou.automaticallyPaidWithExpensify'); } @@ -9212,6 +9204,12 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry, let translationKey: TranslationPaths; if (originalMessage?.type === CONST.IOU.REPORT_ACTION_TYPE.PAY) { + // The `REPORT_ACTION_TYPE.PAY` action type is used for both fulfilling existing requests and sending money. To + // differentiate between these two scenarios, we check if the `originalMessage` contains the `IOUDetails` + // property. If it does, it indicates that this is a 'Pay someone' action. + const {amount, currency} = originalMessage?.IOUDetails ?? originalMessage ?? {}; + const formattedAmount = convertToDisplayString(Math.abs(amount), currency) ?? ''; + const reportPolicy = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]; const last4Digits = reportPolicy?.achAccount?.accountNumber.slice(-4) ?? ''; @@ -9222,13 +9220,11 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry, case CONST.IOU.PAYMENT_TYPE.EXPENSIFY: case CONST.IOU.PAYMENT_TYPE.VBBA: if (isInvoice) { - return translateLocal(payAsBusiness ? 'iou.settleInvoiceBusiness' : 'iou.settleInvoicePersonal', {amount: '', last4Digits}); + return translateLocal(payAsBusiness ? 'iou.settleInvoiceBusiness' : 'iou.settleInvoicePersonal', {amount: formattedAmount, last4Digits}); } translationKey = 'iou.businessBankAccount'; - if (automaticAction && originalMessage.paymentType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY) { + if (automaticAction) { translationKey = 'iou.automaticallyPaidWithExpensify'; - } else { - translationKey = 'iou.automaticallyPaidWithBusinessBankAccount'; } break; default: @@ -9236,7 +9232,7 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry, break; } - return translateLocal(translationKey, {amount: '', payer: '', last4Digits}); + return translateLocal(translationKey, {amount: formattedAmount, payer: '', last4Digits}); } const amount = getTransactionAmount(transaction, !isEmptyObject(iouReport) && isExpenseReport(iouReport)) ?? 0; From e3346dc9d6823ac8ff5f7ba2b7c9350e52751a33 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Mon, 14 Jul 2025 20:26:40 +0100 Subject: [PATCH 16/16] Revert "Merge pull request #65296 from getusha/re-feat-standardize-pay-button" This reverts commit 8c5ab146e450e092ff2ae567b244a0bbe147b6ec, reversing changes made to 6905fe49d3fe05c486b2def5ecc92b9cf74c1f92. --- src/CONST/index.ts | 6 +- src/components/Button/index.tsx | 14 +- .../ButtonWithDropdownMenu/index.tsx | 45 +- .../ButtonWithDropdownMenu/types.ts | 11 - src/components/KYCWall/BaseKYCWall.tsx | 63 +- src/components/KYCWall/types.ts | 5 +- src/components/MoneyReportHeader.tsx | 3 +- src/components/PopoverMenu.tsx | 11 +- src/components/ProcessMoneyReportHoldMenu.tsx | 2 +- src/components/Search/index.tsx | 25 +- src/components/Search/types.ts | 3 +- .../SelectionList/Search/ActionCell.tsx | 64 +-- .../Search/ReportListItemHeader.tsx | 4 - .../Search/UserInfoAndActionButtonRow.tsx | 4 - src/components/SelectionList/types.ts | 3 - src/components/SettlementButton/index.tsx | 536 ++---------------- src/components/SettlementButton/types.ts | 8 +- src/components/TransactionItemRow/index.tsx | 6 - src/hooks/usePaymentOptions.ts | 23 +- src/languages/de.ts | 24 +- src/languages/en.ts | 24 +- src/languages/es.ts | 25 +- src/languages/fr.ts | 26 +- src/languages/it.ts | 25 +- src/languages/ja.ts | 25 +- src/languages/nl.ts | 25 +- src/languages/params.ts | 9 - src/languages/pl.ts | 25 +- src/languages/pt-BR.ts | 24 +- src/languages/zh-hans.ts | 24 +- .../MoveIOUReportToExistingPolicyParams.ts | 1 - ...UReportToPolicyAndInviteSubmitterParams.ts | 1 - src/libs/DebugUtils.ts | 4 - src/libs/IOUUtils.ts | 23 +- src/libs/MoneyRequestReportUtils.ts | 2 +- src/libs/PaymentUtils.ts | 2 +- src/libs/PolicyUtils.ts | 4 +- src/libs/ReportUtils.ts | 69 +-- src/libs/actions/BankAccounts.ts | 114 +--- src/libs/actions/IOU.ts | 43 +- src/libs/actions/Policy/Policy.ts | 56 -- .../resetUSDBankAccount.ts | 234 ++++---- src/libs/actions/Report.ts | 38 +- src/libs/actions/Search.ts | 53 +- .../home/report/PureReportActionItem.tsx | 15 - .../home/report/ReportActionItemMessage.tsx | 2 +- .../settings/Wallet/WalletPage/WalletPage.tsx | 5 +- .../TransactionPreviewContent.stories.tsx | 3 +- src/styles/index.ts | 24 - src/styles/utils/index.ts | 13 - src/types/onyx/LastPaymentMethod.ts | 32 +- src/types/onyx/OriginalMessage.ts | 6 - src/types/onyx/Report.ts | 2 +- src/types/onyx/ReportAction.ts | 6 - tests/actions/IOUTest.ts | 8 +- tests/unit/OnyxDerivedTest.ts | 3 +- 56 files changed, 316 insertions(+), 1539 deletions(-) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 12c74e013fd07..de0b76a440c57 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -6847,9 +6847,9 @@ const CONST = { }, LAST_PAYMENT_METHOD: { LAST_USED: 'lastUsed', - IOU: 'iou', - EXPENSE: 'expense', - INVOICE: 'invoice', + IOU: 'Iou', + EXPENSE: 'Expense', + INVOICE: 'Invoice', }, SKIPPABLE_COLLECTION_MEMBER_IDS: [String(DEFAULT_NUMBER_ID), '-1', 'undefined', 'null', 'NaN'] as string[], SETUP_SPECIALIST_LOGIN: 'Setup Specialist', diff --git a/src/components/Button/index.tsx b/src/components/Button/index.tsx index b7a62c7aa0631..d68eeebcaef07 100644 --- a/src/components/Button/index.tsx +++ b/src/components/Button/index.tsx @@ -310,19 +310,7 @@ function Button( const textComponent = secondLineText ? ( {primaryText} - - {secondLineText} - + {secondLineText} ) : ( primaryText diff --git a/src/components/ButtonWithDropdownMenu/index.tsx b/src/components/ButtonWithDropdownMenu/index.tsx index 65858e36cbe81..533e5615cf8e6 100644 --- a/src/components/ButtonWithDropdownMenu/index.tsx +++ b/src/components/ButtonWithDropdownMenu/index.tsx @@ -13,7 +13,6 @@ import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import mergeRefs from '@libs/mergeRefs'; -import variables from '@styles/variables'; import CONST from '@src/CONST'; import type {AnchorPosition} from '@src/styles'; import type {ButtonWithDropdownMenuProps} from './types'; @@ -51,10 +50,7 @@ function ButtonWithDropdownMenu({ testID, secondLineText = '', icon, - shouldPopoverUseScrollView = false, - containerStyles, shouldUseModalPaddingStyle = true, - shouldUseShortForm = false, shouldUseOptionIcon = false, }: ButtonWithDropdownMenuProps) { const theme = useTheme(); @@ -76,14 +72,9 @@ function ButtonWithDropdownMenu({ const areAllOptionsDisabled = options.every((option) => option.disabled); const innerStyleDropButton = StyleUtils.getDropDownButtonHeight(buttonSize); const isButtonSizeLarge = buttonSize === CONST.DROPDOWN_BUTTON_SIZE.LARGE; - const isButtonSizeSmall = buttonSize === CONST.DROPDOWN_BUTTON_SIZE.SMALL; const nullCheckRef = (ref: RefObject) => ref ?? null; const shouldShowButtonRightIcon = !!options.at(0)?.shouldShowButtonRightIcon; - useEffect(() => { - setSelectedItemIndex(defaultSelectedIndex); - }, [defaultSelectedIndex]); - useEffect(() => { if (!dropdownAnchor.current) { return; @@ -137,7 +128,6 @@ function ButtonWithDropdownMenu({ }, ); const splitButtonWrapperStyle = isSplitButton ? [styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter] : {}; - const isTextTooLong = customText && customText?.length > 6; const handlePress = useCallback( (event?: GestureResponderEvent | KeyboardEvent) => { @@ -167,13 +157,12 @@ function ButtonWithDropdownMenu({ large={buttonSize === CONST.DROPDOWN_BUTTON_SIZE.LARGE} medium={buttonSize === CONST.DROPDOWN_BUTTON_SIZE.MEDIUM} small={buttonSize === CONST.DROPDOWN_BUTTON_SIZE.SMALL} - innerStyles={[innerStyleDropButton, !isSplitButton && styles.dropDownButtonCartIconView, isTextTooLong && shouldUseShortForm && {...styles.pl2, ...styles.pr1}]} + innerStyles={[innerStyleDropButton, !isSplitButton && styles.dropDownButtonCartIconView]} enterKeyEventListenerPriority={enterKeyEventListenerPriority} iconRight={Expensicons.DownArrow} shouldShowRightIcon={!isSplitButton} isSplitButton={isSplitButton} testID={testID} - textStyles={[isTextTooLong && shouldUseShortForm ? {...styles.textExtraSmall, ...styles.textBold} : {}]} secondLineText={secondLineText} icon={icon} /> @@ -189,25 +178,16 @@ function ButtonWithDropdownMenu({ large={buttonSize === CONST.DROPDOWN_BUTTON_SIZE.LARGE} medium={buttonSize === CONST.DROPDOWN_BUTTON_SIZE.MEDIUM} small={buttonSize === CONST.DROPDOWN_BUTTON_SIZE.SMALL} - innerStyles={[styles.dropDownButtonCartIconContainerPadding, innerStyleDropButton, isButtonSizeSmall && styles.dropDownButtonCartIcon]} + innerStyles={[styles.dropDownButtonCartIconContainerPadding, innerStyleDropButton]} enterKeyEventListenerPriority={enterKeyEventListenerPriority} > - + @@ -257,27 +237,18 @@ function ButtonWithDropdownMenu({ shouldShowSelectedItemCheck={shouldShowSelectedItemCheck} // eslint-disable-next-line react-compiler/react-compiler anchorRef={nullCheckRef(dropdownAnchor)} + withoutOverlay + shouldUseScrollView scrollContainerStyle={!shouldUseModalPaddingStyle && isSmallScreenWidth && styles.pv4} - anchorAlignment={anchorAlignment} shouldUseModalPaddingStyle={shouldUseModalPaddingStyle} + anchorAlignment={anchorAlignment} headerText={menuHeaderText} - shouldUseScrollView={shouldPopoverUseScrollView} - containerStyles={containerStyles} menuItems={options.map((item, index) => ({ ...item, onSelected: item.onSelected - ? () => { - item.onSelected?.(); - if (item.shouldUpdateSelectedIndex) { - setSelectedItemIndex(index); - } - } + ? () => item.onSelected?.() : () => { onOptionSelected?.(item); - if (item.shouldUpdateSelectedIndex === false) { - return; - } - setSelectedItemIndex(index); }, shouldCallAfterModalHide: true, diff --git a/src/components/ButtonWithDropdownMenu/types.ts b/src/components/ButtonWithDropdownMenu/types.ts index 9f375c283eb41..2a638420108c8 100644 --- a/src/components/ButtonWithDropdownMenu/types.ts +++ b/src/components/ButtonWithDropdownMenu/types.ts @@ -41,8 +41,6 @@ type DropdownOption = { descriptionTextStyle?: StyleProp; wrapperStyle?: StyleProp; displayInDefaultIconColor?: boolean; - /** Whether the selected index should be updated when the option is selected even if we have onSelected callback */ - shouldUpdateSelectedIndex?: boolean; subMenuItems?: PopoverMenuItem[]; backButtonText?: string; avatarSize?: ValueOf; @@ -143,18 +141,9 @@ type ButtonWithDropdownMenuProps = { /** Icon for main button */ icon?: IconAsset; - /** Whether the popover content should be scrollable */ - shouldPopoverUseScrollView?: boolean; - - /** Container style to be applied to the popover of the dropdown menu */ - containerStyles?: StyleProp; - /** Whether to use modal padding style for the popover menu */ shouldUseModalPaddingStyle?: boolean; - /** Whether to use short form for the button */ - shouldUseShortForm?: boolean; - /** Whether to display the option icon when only one option is available */ shouldUseOptionIcon?: boolean; }; diff --git a/src/components/KYCWall/BaseKYCWall.tsx b/src/components/KYCWall/BaseKYCWall.tsx index 3a7f8de9d94d1..7f399546ad9df 100644 --- a/src/components/KYCWall/BaseKYCWall.tsx +++ b/src/components/KYCWall/BaseKYCWall.tsx @@ -5,20 +5,19 @@ import type {EmitterSubscription, GestureResponderEvent, View} from 'react-nativ import AddPaymentMethodMenu from '@components/AddPaymentMethodMenu'; import useOnyx from '@hooks/useOnyx'; import {openPersonalBankAccountSetupView} from '@libs/actions/BankAccounts'; -import {completePaymentOnboarding, savePreferredPaymentMethod} from '@libs/actions/IOU'; -import {moveIOUReportToPolicy, moveIOUReportToPolicyAndInviteSubmitter} from '@libs/actions/Report'; +import {completePaymentOnboarding} from '@libs/actions/IOU'; import getClickedTargetLocation from '@libs/getClickedTargetLocation'; import Log from '@libs/Log'; import Navigation from '@libs/Navigation/Navigation'; import {hasExpensifyPaymentMethod} from '@libs/PaymentUtils'; -import {getPolicyExpenseChat, isExpenseReport as isExpenseReportReportUtils, isIOUReport} from '@libs/ReportUtils'; +import {isExpenseReport as isExpenseReportReportUtils, isIOUReport} from '@libs/ReportUtils'; import {kycWallRef} from '@userActions/PaymentMethods'; import {createWorkspaceFromIOUPayment} from '@userActions/Policy/Policy'; import {setKYCWallSource} from '@userActions/Wallet'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; -import type {BankAccountList, Policy} from '@src/types/onyx'; +import type {BankAccountList} from '@src/types/onyx'; import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage'; import {getEmptyObject} from '@src/types/utils/EmptyObject'; import viewRef from '@src/types/utils/viewRef'; @@ -103,41 +102,16 @@ function KYCWall({ }, [getAnchorPosition]); const selectPaymentMethod = useCallback( - (paymentMethod?: PaymentMethod, policy?: Policy) => { - if (paymentMethod) { - onSelectPaymentMethod(paymentMethod); - } + (paymentMethod: PaymentMethod) => { + onSelectPaymentMethod(paymentMethod); if (paymentMethod === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) { openPersonalBankAccountSetupView(); } else if (paymentMethod === CONST.PAYMENT_METHODS.DEBIT_CARD) { Navigation.navigate(addDebitCardRoute ?? ROUTES.HOME); - } else if (paymentMethod === CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT || policy) { + } else if (paymentMethod === CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT) { if (iouReport && isIOUReport(iouReport)) { - if (policy) { - const policyExpenseChatReportID = getPolicyExpenseChat(iouReport.ownerAccountID, policy.id)?.reportID; - if (!policyExpenseChatReportID) { - const {policyExpenseChatReportID: newPolicyExpenseChatReportID} = moveIOUReportToPolicyAndInviteSubmitter(iouReport.reportID, policy.id) ?? {}; - savePreferredPaymentMethod(iouReport.policyID, policy.id, CONST.LAST_PAYMENT_METHOD.IOU); - Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(newPolicyExpenseChatReportID)); - } else { - moveIOUReportToPolicy(iouReport.reportID, policy.id, true); - savePreferredPaymentMethod(iouReport.policyID, policy.id, CONST.LAST_PAYMENT_METHOD.IOU); - Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(policyExpenseChatReportID)); - } - - if (policy?.achAccount) { - return; - } - // Navigate to the bank account set up flow for this specific policy - Navigation.navigate(ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute(policy.id)); - return; - } - const {policyID, workspaceChatReportID, reportPreviewReportActionID, adminsChatReportID} = createWorkspaceFromIOUPayment(iouReport) ?? {}; - if (policyID) { - savePreferredPaymentMethod(iouReport.policyID, policyID, CONST.LAST_PAYMENT_METHOD.IOU); - } completePaymentOnboarding(CONST.PAYMENT_SELECTED.BBA, adminsChatReportID, policyID); if (workspaceChatReportID) { Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(workspaceChatReportID, reportPreviewReportActionID)); @@ -145,6 +119,7 @@ function KYCWall({ // Navigate to the bank account set up flow for this specific policy Navigation.navigate(ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute(policyID)); + return; } Navigation.navigate(addBankAccountRoute); @@ -160,7 +135,7 @@ function KYCWall({ * */ const continueAction = useCallback( - (event?: GestureResponderEvent | KeyboardEvent, iouPaymentType?: PaymentMethodType, paymentMethod?: PaymentMethod, policy?: Policy) => { + (event?: GestureResponderEvent | KeyboardEvent, iouPaymentType?: PaymentMethodType) => { const currentSource = walletTerms?.source ?? source; /** @@ -194,19 +169,6 @@ function KYCWall({ return; } - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - if (paymentMethod || policy) { - setShouldShowAddPaymentMenu(false); - selectPaymentMethod(paymentMethod, policy); - return; - } - - if (iouPaymentType && isExpenseReport) { - setShouldShowAddPaymentMenu(false); - selectPaymentMethod(CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT); - return; - } - const clickedElementLocation = getClickedTargetLocation(targetElement as HTMLDivElement); const position = getAnchorPosition(clickedElementLocation); @@ -219,20 +181,13 @@ function KYCWall({ // Ask the user to upgrade to a gold wallet as this means they have not yet gone through our Know Your Customer (KYC) checks const hasActivatedWallet = userWallet?.tierName && [CONST.WALLET.TIER_NAME.GOLD, CONST.WALLET.TIER_NAME.PLATINUM].some((name) => name === userWallet.tierName); - if (!hasActivatedWallet && !policy) { + if (!hasActivatedWallet) { Log.info('[KYC Wallet] User does not have active wallet'); Navigation.navigate(enablePaymentsRoute); return; } - - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - if (paymentMethod || policy) { - setShouldShowAddPaymentMenu(false); - selectPaymentMethod(paymentMethod, policy); - return; - } } Log.info('[KYC Wallet] User has valid payment method and passed KYC checks or did not need them'); diff --git a/src/components/KYCWall/types.ts b/src/components/KYCWall/types.ts index 71c557a859e61..5214e5ea15b95 100644 --- a/src/components/KYCWall/types.ts +++ b/src/components/KYCWall/types.ts @@ -4,7 +4,7 @@ import type {OnyxEntry} from 'react-native-onyx'; import type {ValueOf} from 'type-fest'; import type CONST from '@src/CONST'; import type {Route} from '@src/ROUTES'; -import type {Policy, Report} from '@src/types/onyx'; +import type {Report} from '@src/types/onyx'; import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage'; import type AnchorAlignment from '@src/types/utils/AnchorAlignment'; @@ -63,9 +63,6 @@ type KYCWallProps = { /** Children to build the KYC */ children: (continueAction: (event: GestureResponderEvent | KeyboardEvent | undefined, method?: PaymentMethodType) => void, anchorRef: RefObject) => void; - - /** The policy used for payment */ - policy?: Policy; }; export type {AnchorPosition, KYCWallProps, PaymentMethod, DomRect, PaymentMethodType, Source}; diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index cd1b8be98ae1e..ceb80cfdb2ad3 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -338,7 +338,7 @@ function MoneyReportHeader({ payInvoice(type, chatReport, moneyRequestReport, payAsBusiness, methodID, paymentMethod); } else { startAnimation(); - payMoneyRequest(type, chatReport, moneyRequestReport, undefined, true); + payMoneyRequest(type, chatReport, moneyRequestReport, true); } }, [chatReport, isAnyTransactionOnHold, isDelegateAccessRestricted, showDelegateNoAccessModal, isInvoiceReport, moneyRequestReport, startAnimation], @@ -549,7 +549,6 @@ function MoneyReportHeader({ isPaidAnimationRunning={isPaidAnimationRunning} isApprovedAnimationRunning={isApprovedAnimationRunning} onAnimationFinish={stopAnimation} - formattedAmount={totalAmount} canIOUBePaid onlyShowPayElsewhere={onlyShowPayElsewhere} currency={moneyRequestReport?.currency} diff --git a/src/components/PopoverMenu.tsx b/src/components/PopoverMenu.tsx index 8fc6597848e5a..d0b725933b12a 100644 --- a/src/components/PopoverMenu.tsx +++ b/src/components/PopoverMenu.tsx @@ -312,10 +312,13 @@ function PopoverMenu({ } setFocusedIndex(menuIndex); }} - wrapperStyle={[ - StyleUtils.getItemBackgroundColorStyle(!!item.isSelected, focusedIndex === menuIndex, item.disabled ?? false, theme.activeComponentBG, theme.hoverComponentBG), - shouldUseScrollView && StyleUtils.getOptionMargin(menuIndex, currentMenuItems.length - 1), - ]} + wrapperStyle={StyleUtils.getItemBackgroundColorStyle( + !!item.isSelected, + focusedIndex === menuIndex, + item.disabled ?? false, + theme.activeComponentBG, + theme.hoverComponentBG, + )} shouldRemoveHoverBackground={item.isSelected} titleStyle={StyleSheet.flatten([styles.flex1, item.titleStyle])} // Spread other props dynamically diff --git a/src/components/ProcessMoneyReportHoldMenu.tsx b/src/components/ProcessMoneyReportHoldMenu.tsx index 0a155fa4c41bf..c803de7ea38e6 100644 --- a/src/components/ProcessMoneyReportHoldMenu.tsx +++ b/src/components/ProcessMoneyReportHoldMenu.tsx @@ -77,7 +77,7 @@ function ProcessMoneyReportHoldMenu({ if (startAnimation) { startAnimation(); } - payMoneyRequest(paymentType, chatReport, moneyRequestReport, undefined, full); + payMoneyRequest(paymentType, chatReport, moneyRequestReport, full); } onClose(); }; diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index 6cf5711216b0b..ad5adb26afcf9 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -81,22 +81,15 @@ function mapTransactionItemToSelectedEntry(item: TransactionListItemType, report ]; } -function mapToTransactionItemWithAdditionalInfo( - item: TransactionListItemType, - selectedTransactions: SelectedTransactions, - canSelectMultiple: boolean, - shouldAnimateInHighlight: boolean, - hash?: number, -) { - return {...item, shouldAnimateInHighlight, isSelected: selectedTransactions[item.keyForList]?.isSelected && canSelectMultiple, hash}; +function mapToTransactionItemWithAdditionalInfo(item: TransactionListItemType, selectedTransactions: SelectedTransactions, canSelectMultiple: boolean, shouldAnimateInHighlight: boolean) { + return {...item, shouldAnimateInHighlight, isSelected: selectedTransactions[item.keyForList]?.isSelected && canSelectMultiple}; } -function mapToItemWithAdditionalInfo(item: SearchListItem, selectedTransactions: SelectedTransactions, canSelectMultiple: boolean, shouldAnimateInHighlight: boolean, hash?: number) { +function mapToItemWithAdditionalInfo(item: SearchListItem, selectedTransactions: SelectedTransactions, canSelectMultiple: boolean, shouldAnimateInHighlight: boolean) { if (isTaskListItemType(item)) { return { ...item, shouldAnimateInHighlight, - hash, }; } @@ -104,22 +97,18 @@ function mapToItemWithAdditionalInfo(item: SearchListItem, selectedTransactions: return { ...item, shouldAnimateInHighlight, - hash, }; } return isTransactionListItemType(item) - ? mapToTransactionItemWithAdditionalInfo(item, selectedTransactions, canSelectMultiple, shouldAnimateInHighlight, hash) + ? mapToTransactionItemWithAdditionalInfo(item, selectedTransactions, canSelectMultiple, shouldAnimateInHighlight) : { ...item, shouldAnimateInHighlight, - transactions: item.transactions?.map((transaction) => - mapToTransactionItemWithAdditionalInfo(transaction, selectedTransactions, canSelectMultiple, shouldAnimateInHighlight, hash), - ), + transactions: item.transactions?.map((transaction) => mapToTransactionItemWithAdditionalInfo(transaction, selectedTransactions, canSelectMultiple, shouldAnimateInHighlight)), isSelected: item?.transactions?.length > 0 && item.transactions?.filter((t) => !isTransactionPendingDelete(t)).every((transaction) => selectedTransactions[transaction.keyForList]?.isSelected && canSelectMultiple), - hash, }; } @@ -506,9 +495,9 @@ function Search({queryJSON, searchResults, onSearchListScroll, contentContainerS // Determine if either the base key or any transaction key matches const shouldAnimateInHighlight = isBaseKeyMatch || isAnyTransactionMatch; - return mapToItemWithAdditionalInfo(item, selectedTransactions, canSelectMultiple, shouldAnimateInHighlight, hash); + return mapToItemWithAdditionalInfo(item, selectedTransactions, canSelectMultiple, shouldAnimateInHighlight); }), - [type, status, data, sortBy, sortOrder, groupBy, isChat, newSearchResultKey, selectedTransactions, canSelectMultiple, hash], + [type, status, data, sortBy, sortOrder, groupBy, isChat, newSearchResultKey, selectedTransactions, canSelectMultiple], ); const hasErrors = Object.keys(searchResults?.errors ?? {}).length > 0 && !isOffline; diff --git a/src/components/Search/types.ts b/src/components/Search/types.ts index 5961b4546142a..c9acfe9c2c4f0 100644 --- a/src/components/Search/types.ts +++ b/src/components/Search/types.ts @@ -1,5 +1,4 @@ import type {ValueOf} from 'type-fest'; -import type {PaymentMethodType} from '@components/KYCWall/types'; import type {ReportActionListItemType, TaskListItemType, TransactionGroupListItemType, TransactionListItemType} from '@components/SelectionList/types'; import type CONST from '@src/CONST'; import type {SearchDataTypes} from '@src/types/onyx/SearchResults'; @@ -52,7 +51,7 @@ type SelectedReports = { type PaymentData = { reportID: string; amount: number; - paymentType: PaymentMethodType; + paymentType: ValueOf; }; type SortOrder = ValueOf; diff --git a/src/components/SelectionList/Search/ActionCell.tsx b/src/components/SelectionList/Search/ActionCell.tsx index 1d1a0ecf96bf0..5dd54e8e52b79 100644 --- a/src/components/SelectionList/Search/ActionCell.tsx +++ b/src/components/SelectionList/Search/ActionCell.tsx @@ -1,25 +1,16 @@ -import React, {useCallback, useMemo} from 'react'; +import React from 'react'; import {View} from 'react-native'; -import type {OnyxEntry} from 'react-native-onyx'; import Badge from '@components/Badge'; import Button from '@components/Button'; import * as Expensicons from '@components/Icon/Expensicons'; -import type {PaymentMethodType} from '@components/KYCWall/types'; -import SettlementButton from '@components/SettlementButton'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; -import useOnyx from '@hooks/useOnyx'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; -import {getSnapshotIOUReport, payMoneyRequestOnSearch} from '@libs/actions/Search'; -import {getBankAccountRoute} from '@libs/ReportUtils'; import variables from '@styles/variables'; import CONST from '@src/CONST'; import type {TranslationPaths} from '@src/languages/types'; -import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES from '@src/ROUTES'; -import type {Report} from '@src/types/onyx'; import type {SearchTransactionAction} from '@src/types/onyx/SearchResults'; const actionTranslationsMap: Record = { @@ -40,10 +31,6 @@ type ActionCellProps = { isChildListItem?: boolean; parentAction?: string; isLoading?: boolean; - policyID?: string; - reportID?: string; - hash?: number; - amount?: number; }; function ActionCell({ @@ -54,10 +41,6 @@ function ActionCell({ isChildListItem = false, parentAction = '', isLoading = false, - policyID = '', - reportID = '', - hash, - amount, }: ActionCellProps) { const {translate} = useLocalize(); const theme = useTheme(); @@ -65,32 +48,8 @@ function ActionCell({ const StyleUtils = useStyleUtils(); const {isOffline} = useNetwork(); - const [iouReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {canBeMissing: true}); const text = isChildListItem ? translate(actionTranslationsMap[CONST.SEARCH.ACTION_TYPES.VIEW]) : translate(actionTranslationsMap[action]); const shouldUseViewAction = action === CONST.SEARCH.ACTION_TYPES.VIEW || (parentAction === CONST.SEARCH.ACTION_TYPES.PAID && action === CONST.SEARCH.ACTION_TYPES.PAID); - const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${iouReport?.chatReportID}`, {canBeMissing: true}); - const bankAccountRoute = getBankAccountRoute(chatReport); - - /** - * When we open the search page for the first time after clearing cache, - * the search snapshot is the only place where we can find the correct expense report. - */ - const snapshotIOUReport = useMemo(() => { - return !iouReport ? getSnapshotIOUReport(reportID, hash) : null; - }, [reportID, iouReport, hash]); - - const {currency} = iouReport ?? snapshotIOUReport ?? {}; - - const confirmPayment = useCallback( - (type: PaymentMethodType | undefined) => { - if (!type || !reportID || !hash || !amount) { - return; - } - - payMoneyRequestOnSearch(hash, [{amount, paymentType: type, reportID}]); - }, - [hash, amount, reportID], - ); if (!isChildListItem && ((parentAction !== CONST.SEARCH.ACTION_TYPES.PAID && action === CONST.SEARCH.ACTION_TYPES.PAID) || action === CONST.SEARCH.ACTION_TYPES.DONE)) { return ( @@ -135,27 +94,6 @@ function ActionCell({ ) : null; } - if (action === CONST.SEARCH.ACTION_TYPES.PAY) { - return ( - )} - enablePaymentsRoute={ROUTES.ENABLE_PAYMENTS} - addBankAccountRoute={bankAccountRoute} - onPress={confirmPayment} - style={[styles.w100]} - wrapperStyle={[styles.w100]} - shouldShowPersonalBankAccountOption={!policyID && !iouReport?.policyID} - isDisabled={isOffline} - isLoading={isLoading} - /> - ); - } - return (