diff --git a/Mobile-Expensify b/Mobile-Expensify
index 9b5d2969570a2..ecdcef22fdef6 160000
--- a/Mobile-Expensify
+++ b/Mobile-Expensify
@@ -1 +1 @@
-Subproject commit 9b5d2969570a267b0c20c8f3e9f2e3892b4043cc
+Subproject commit ecdcef22fdef6f16c0b2435c5642edb61c3f1bc5
diff --git a/android/app/build.gradle b/android/app/build.gradle
index ef47429a34e03..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 1009018000
- versionName "9.1.80-0"
+ 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 4038ff2025566..67be9a4fd30dc 100644
--- a/ios/NewExpensify/Info.plist
+++ b/ios/NewExpensify/Info.plist
@@ -44,7 +44,7 @@
CFBundleVersion
- 9.1.80.0
+ 9.1.80.5
FullStory
OrgId
diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist
index bd5a36795ae1f..8be6c1ee4f754 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.5
NSExtension
NSExtensionPointIdentifier
diff --git a/ios/ShareViewController/Info.plist b/ios/ShareViewController/Info.plist
index 6747dfe8eb98f..dca30576934a5 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.5
NSExtension
NSExtensionAttributes
diff --git a/package-lock.json b/package-lock.json
index 7b0008db1fafe..bb2aa85244311 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-5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "new.expensify",
- "version": "9.1.80-0",
+ "version": "9.1.80-5",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
diff --git a/package.json b/package.json
index b0d984352a4b0..4476e2c7493f0 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
- "version": "9.1.80-0",
+ "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.",
diff --git a/src/CONST/index.ts b/src/CONST/index.ts
index 00bcc5976d4d9..de0b76a440c57 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],
};
},
@@ -6848,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/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);
+ }}
/>
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 (
)}
diff --git a/src/components/SelectionList/Search/UserInfoAndActionButtonRow.tsx b/src/components/SelectionList/Search/UserInfoAndActionButtonRow.tsx
index eb45c4ca05f6a..ef12633d27a8a 100644
--- a/src/components/SelectionList/Search/UserInfoAndActionButtonRow.tsx
+++ b/src/components/SelectionList/Search/UserInfoAndActionButtonRow.tsx
@@ -49,10 +49,6 @@ function UserInfoAndActionButtonRow({
goToItem={handleActionButtonPress}
isSelected={item.isSelected}
isLoading={item.isActionLoading}
- policyID={item.policyID}
- reportID={item.reportID}
- hash={item.hash}
- amount={(item as TransactionListItemType)?.amount}
/>
diff --git a/src/components/SelectionList/types.ts b/src/components/SelectionList/types.ts
index c2b0da6191ac1..c5bf7c2ef225d 100644
--- a/src/components/SelectionList/types.ts
+++ b/src/components/SelectionList/types.ts
@@ -215,9 +215,6 @@ type ListItem = {
/** Whether product training tooltips can be displayed */
canShowProductTrainingTooltip?: boolean;
-
- /** Used to initiate payment from search page */
- hash?: number;
};
type TransactionListItemType = ListItem &
diff --git a/src/components/SettlementButton/index.tsx b/src/components/SettlementButton/index.tsx
index 96e26966ee879..871cf29b7b904 100644
--- a/src/components/SettlementButton/index.tsx
+++ b/src/components/SettlementButton/index.tsx
@@ -1,52 +1,24 @@
-import isEmpty from 'lodash/isEmpty';
-import truncate from 'lodash/truncate';
-import React, {useCallback, useContext, useEffect, useMemo, useRef} from 'react';
-import type {GestureResponderEvent} from 'react-native';
-import type {TupleToUnion} from 'type-fest';
+import React, {useContext} from 'react';
import ButtonWithDropdownMenu from '@components/ButtonWithDropdownMenu';
-import * as Expensicons from '@components/Icon/Expensicons';
-import {Bank} from '@components/Icon/Expensicons';
+import type {DropdownOption, PaymentType} from '@components/ButtonWithDropdownMenu/types';
import KYCWall from '@components/KYCWall';
-import type {PaymentMethod} from '@components/KYCWall/types';
import {LockedAccountContext} from '@components/LockedAccountModalProvider';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useOnyx from '@hooks/useOnyx';
-import useThemeStyles from '@hooks/useThemeStyles';
-import {isCurrencySupportedForDirectReimbursement} from '@libs/actions/Policy/Policy';
-import {getCurrentUserAccountID} from '@libs/actions/Report';
-import {getLastPolicyBankAccountID, getLastPolicyPaymentMethod} from '@libs/actions/Search';
-import Navigation from '@libs/Navigation/Navigation';
-import {formatPaymentMethods} from '@libs/PaymentUtils';
+import usePaymentOptions from '@hooks/usePaymentOptions';
+import {selectPaymentType} from '@libs/PaymentUtils';
+import type {KYCFlowEvent, TriggerKYCFlow} from '@libs/PaymentUtils';
import getPolicyEmployeeAccountIDs from '@libs/PolicyEmployeeListUtils';
-import {getActiveAdminWorkspaces, hasVBBA} from '@libs/PolicyUtils';
-import {hasRequestFromCurrentAccount} from '@libs/ReportActionsUtils';
-import {
- doesReportBelongToWorkspace,
- isBusinessInvoiceRoom,
- isExpenseReport as isExpenseReportUtil,
- isIndividualInvoiceRoom as isIndividualInvoiceRoomUtil,
- isInvoiceReport as isInvoiceReportUtil,
- isIOUReport,
-} from '@libs/ReportUtils';
-import {shouldRestrictUserBillableActions} from '@libs/SubscriptionUtils';
-import {setPersonalBankAccountContinueKYCOnSuccess} from '@userActions/BankAccounts';
-import {approveMoneyRequest, savePreferredPaymentMethod as savePreferredPaymentMethodIOU} from '@userActions/IOU';
+import {doesReportBelongToWorkspace, isInvoiceReport as isInvoiceReportUtil} from '@libs/ReportUtils';
+import {savePreferredPaymentMethod as savePreferredPaymentMethodIOU} from '@userActions/IOU';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
-import type {AccountData, BankAccount, LastPaymentMethodType, Policy} from '@src/types/onyx';
import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
-import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';
import type SettlementButtonProps from './types';
-type KYCFlowEvent = GestureResponderEvent | KeyboardEvent | undefined;
-
-type TriggerKYCFlow = (event: KYCFlowEvent, iouPaymentType: PaymentMethodType, paymentMethod?: PaymentMethod, policy?: Policy) => void;
-
-type CurrencyType = TupleToUnion;
-
function SettlementButton({
addDebitCardRoute = ROUTES.IOU_SEND_ADD_DEBIT_CARD,
addBankAccountRoute = '',
@@ -82,10 +54,7 @@ function SettlementButton({
onPaymentOptionsHide,
onlyShowPayElsewhere,
wrapperStyle,
- shouldUseShortForm = false,
- hasOnlyHeldExpenses = false,
}: SettlementButtonProps) {
- const styles = useThemeStyles();
const {translate} = useLocalize();
const {isOffline} = useNetwork();
// The app would crash due to subscribing to the entire report collection if chatReportID is an empty string. So we should have a fallback ID here.
@@ -94,471 +63,42 @@ function SettlementButton({
const [isUserValidated] = useOnyx(ONYXKEYS.ACCOUNT, {selector: (account) => account?.validated, canBeMissing: true});
const policyEmployeeAccountIDs = policyID ? getPolicyEmployeeAccountIDs(policyID) : [];
const reportBelongsToWorkspace = policyID ? doesReportBelongToWorkspace(chatReport, policyEmployeeAccountIDs, policyID) : false;
- const policyIDKey = reportBelongsToWorkspace ? policyID : (iouReport?.policyID ?? CONST.POLICY.ID_FAKE);
- const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET, {canBeMissing: true});
- const hasActivatedWallet = ([CONST.WALLET.TIER_NAME.GOLD, CONST.WALLET.TIER_NAME.PLATINUM] as string[]).includes(userWallet?.tierName ?? '');
-
- const [lastPaymentMethod, lastPaymentMethodResult] = useOnyx(ONYXKEYS.NVP_LAST_PAYMENT_METHOD, {
- canBeMissing: true,
- selector: (paymentMethod) => getLastPolicyPaymentMethod(policyIDKey, paymentMethod, iouReport?.type as keyof LastPaymentMethodType, isIOUReport(iouReport)),
- });
-
- const lastBankAccountID = getLastPolicyBankAccountID(policyIDKey, iouReport?.type as keyof LastPaymentMethodType);
- const [fundList = {}] = useOnyx(ONYXKEYS.FUND_LIST, {canBeMissing: true});
- const [policies] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {canBeMissing: true});
- const currentUserAccountID = getCurrentUserAccountID().toString();
- const activeAdminPolicies = getActiveAdminWorkspaces(policies, currentUserAccountID).sort((a, b) => (a.name || '').localeCompare(b.name || ''));
- const reportID = iouReport?.reportID;
-
- const hasPreferredPaymentMethod = !!lastPaymentMethod;
- const isLoadingLastPaymentMethod = isLoadingOnyxValue(lastPaymentMethodResult);
- const policy = policies?.[`${ONYXKEYS.COLLECTION.POLICY}${policyID}`];
- const isLastPaymentPolicy = !Object.values({...CONST.PAYMENT_METHODS, ...CONST.IOU.PAYMENT_TYPE}).includes(lastPaymentMethod as PaymentMethod);
- const lastPaymentPolicy = isLastPaymentPolicy ? policies?.[`${ONYXKEYS.COLLECTION.POLICY}${lastPaymentMethod}`] : undefined;
- const [bankAccountList = {}] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST, {canBeMissing: true});
- const bankAccount = bankAccountList[lastBankAccountID ?? CONST.DEFAULT_NUMBER_ID];
- const isExpenseReport = isExpenseReportUtil(iouReport);
- // whether the user has single policy and the expense is p2p
- const hasSinglePolicy = !isExpenseReport && activeAdminPolicies.length === 1;
- const hasMultiplePolicies = !isExpenseReport && activeAdminPolicies.length > 1;
- const lastPaymentMethodRef = useRef(lastPaymentMethod);
- const formattedPaymentMethods = formatPaymentMethods(bankAccountList, fundList, styles);
- const hasIntentToPay = formattedPaymentMethods.length === 1 && !lastPaymentMethod;
-
- useEffect(() => {
- if (isLoadingLastPaymentMethod) {
- return;
- }
- lastPaymentMethodRef.current = lastPaymentMethod;
- // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
- }, [isLoadingLastPaymentMethod]);
-
+ const policyIDKey = reportBelongsToWorkspace ? policyID : CONST.POLICY.ID_FAKE;
+ const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {canBeMissing: false});
const isInvoiceReport = (!isEmptyObject(iouReport) && isInvoiceReportUtil(iouReport)) || false;
const {isAccountLocked, showLockedAccountModal} = useContext(LockedAccountContext);
- const shouldShowPayWithExpensifyOption = !shouldHidePaymentOptions;
- const shouldShowPayElsewhereOption = !shouldHidePaymentOptions && !isInvoiceReport;
-
- const getPaymentSubitems = useCallback(
- (payAsBusiness: boolean) => {
- const requiredAccountType = payAsBusiness ? CONST.BANK_ACCOUNT.TYPE.BUSINESS : CONST.BANK_ACCOUNT.TYPE.PERSONAL;
-
- return formattedPaymentMethods
- .filter((method) => {
- const accountData = method?.accountData as AccountData;
- return accountData?.type === requiredAccountType;
- })
- .map((formattedPaymentMethod) => {
- const {icon, iconStyles, iconSize, title, description, accountType, methodID} = formattedPaymentMethod ?? {};
-
- return {
- text: title ?? '',
- description: description ?? '',
- icon: typeof icon === 'number' ? Bank : icon,
- shouldUpdateSelectedIndex: true,
- onSelected: () => {
- onPress(CONST.IOU.PAYMENT_TYPE.EXPENSIFY, payAsBusiness, methodID, accountType, undefined);
- },
- iconStyles,
- iconHeight: iconSize,
- iconWidth: iconSize,
- value: CONST.IOU.PAYMENT_TYPE.EXPENSIFY,
- };
- });
- },
- [formattedPaymentMethods, onPress],
- );
-
- function getLatestBankAccountItem() {
- if (!hasVBBA(policy?.id)) {
- return;
- }
- const policyBankAccounts = formattedPaymentMethods.filter((method) => method.methodID === policy?.achAccount?.bankAccountID);
-
- return policyBankAccounts.map((formattedPaymentMethod) => {
- const {icon, title, description, methodID} = formattedPaymentMethod ?? {};
-
- return {
- text: title ?? '',
- description: description ?? '',
- icon: typeof icon === 'number' ? Bank : icon,
- onSelected: () => onPress(CONST.IOU.PAYMENT_TYPE.EXPENSIFY, true, undefined),
- methodID,
- value: CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT,
- };
- });
- }
-
- function getLatestPersonalBankAccount() {
- return formattedPaymentMethods.filter((ba) => (ba.accountData as AccountData)?.type === CONST.BANK_ACCOUNT.TYPE.PERSONAL);
- }
-
- const getLastPaymentMethodType = () => {
- if (isInvoiceReport) {
- return CONST.LAST_PAYMENT_METHOD.INVOICE;
- }
-
- if (policy) {
- return CONST.LAST_PAYMENT_METHOD.EXPENSE;
- }
-
- return CONST.LAST_PAYMENT_METHOD.IOU;
- };
-
- const savePreferredPaymentMethod = (id: string, value: string) => {
- savePreferredPaymentMethodIOU(id, value, getLastPaymentMethodType());
- };
- const personalBankAccountList = getLatestPersonalBankAccount();
- const latestBankItem = getLatestBankAccountItem();
-
- const paymentButtonOptions = useMemo(() => {
- const buttonOptions = [];
- const paymentMethods = {
- [CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT]: {
- text: hasActivatedWallet ? translate('iou.settleWallet', {formattedAmount: ''}) : translate('iou.settlePersonal', {formattedAmount: ''}),
- icon: Expensicons.User,
- value: CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT,
- shouldUpdateSelectedIndex: false,
- },
- [CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT]: {
- text: translate('iou.settleBusiness', {formattedAmount: ''}),
- icon: Expensicons.Building,
- value: CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT,
- shouldUpdateSelectedIndex: false,
- },
- [CONST.IOU.PAYMENT_TYPE.ELSEWHERE]: {
- text: translate('iou.payElsewhere', {formattedAmount: onlyShowPayElsewhere ? formattedAmount : ''}),
- icon: Expensicons.CheckCircle,
- value: CONST.IOU.PAYMENT_TYPE.ELSEWHERE,
- shouldUpdateSelectedIndex: false,
- },
- };
-
- const approveButtonOption = {
- text: translate('iou.approve', {formattedAmount}),
- icon: Expensicons.ThumbsUp,
- value: CONST.IOU.REPORT_ACTION_TYPE.APPROVE,
- disabled: !!shouldDisableApproveButton,
- };
-
- const canUseWallet = !isExpenseReport && !isInvoiceReport && currency === CONST.CURRENCY.USD;
- const canUseBusinessBankAccount = isExpenseReport || (isIOUReport(iouReport) && reportID && !hasRequestFromCurrentAccount(reportID, Number(currentUserAccountID) ?? -1));
-
- const canUsePersonalBankAccount = shouldShowPersonalBankAccountOption || isIOUReport;
-
- const isPersonalOnlyOption = canUsePersonalBankAccount && !canUseBusinessBankAccount;
-
- // Only show the Approve button if the user cannot pay the expense
- if (shouldHidePaymentOptions && shouldShowApproveButton) {
- return [approveButtonOption];
- }
-
- if (onlyShowPayElsewhere) {
- return [paymentMethods[CONST.IOU.PAYMENT_TYPE.ELSEWHERE]];
- }
-
- // To achieve the one tap pay experience we need to choose the correct payment type as default.
- if (canUseWallet) {
- if (personalBankAccountList.length && canUsePersonalBankAccount) {
- buttonOptions.push({
- text: translate('iou.settleWallet', {formattedAmount: ''}),
- value: CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT,
- icon: Expensicons.Wallet,
- });
- } else if (canUsePersonalBankAccount) {
- buttonOptions.push(paymentMethods[CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT]);
- }
-
- if (activeAdminPolicies.length === 0 && !isPersonalOnlyOption) {
- buttonOptions.push(paymentMethods[CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT]);
- }
- }
-
- const shouldShowBusinessBankAccountOptions = isExpenseReport && shouldShowPayWithExpensifyOption && !isPersonalOnlyOption;
-
- if (shouldShowBusinessBankAccountOptions) {
- if (!isEmpty(latestBankItem) && latestBankItem) {
- buttonOptions.push({
- text: latestBankItem.at(0)?.text ?? '',
- icon: latestBankItem.at(0)?.icon,
- value: CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT,
- description: latestBankItem.at(0)?.description,
- });
- } else {
- buttonOptions.push(paymentMethods[CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT]);
- }
- }
-
- if ((hasMultiplePolicies || hasSinglePolicy) && canUseWallet && !isPersonalOnlyOption) {
- activeAdminPolicies.forEach((activePolicy) => {
- const policyName = activePolicy.name;
- buttonOptions.push({
- text: translate('iou.payWithPolicy', {policyName: truncate(policyName, {length: 20}), formattedAmount: ''}),
- icon: Expensicons.Building,
- value: activePolicy.id,
- shouldUpdateSelectedIndex: false,
- });
- });
- }
-
- if (shouldShowPayElsewhereOption) {
- buttonOptions.push({
- ...paymentMethods[CONST.IOU.PAYMENT_TYPE.ELSEWHERE],
- ...(!buttonOptions.length && shouldUseShortForm ? {text: translate('iou.pay')} : {}),
- });
- }
-
- if (isInvoiceReport) {
- const isCurrencySupported = isCurrencySupportedForDirectReimbursement(currency as CurrencyType);
- const getInvoicesOptions = (payAsBusiness: boolean) => {
- return [
- ...(isCurrencySupported ? getPaymentSubitems(payAsBusiness) : []),
- {
- text: translate('workspace.invoices.paymentMethods.addBankAccount'),
- icon: Expensicons.Bank,
- onSelected: () => Navigation.navigate(addBankAccountRoute),
- value: CONST.IOU.PAYMENT_TYPE.EXPENSIFY,
- },
- {
- text: translate('iou.payElsewhere', {formattedAmount: ''}),
- icon: Expensicons.Cash,
- value: CONST.IOU.PAYMENT_TYPE.ELSEWHERE,
- shouldUpdateSelectedIndex: true,
- onSelected: () => {
- onPress(CONST.IOU.PAYMENT_TYPE.ELSEWHERE, payAsBusiness, undefined);
- savePreferredPaymentMethod(policyIDKey, CONST.IOU.PAYMENT_TYPE.ELSEWHERE);
- },
- },
- ];
- };
-
- if (isIndividualInvoiceRoomUtil(chatReport) || shouldUseShortForm) {
- buttonOptions.push({
- text: translate('iou.settlePersonal', {formattedAmount}),
- icon: Expensicons.User,
- value: hasIntentToPay ? CONST.IOU.PAYMENT_TYPE.EXPENSIFY : (lastPaymentMethod ?? CONST.IOU.PAYMENT_TYPE.ELSEWHERE),
- backButtonText: translate('iou.individual'),
- subMenuItems: getInvoicesOptions(false),
- });
- buttonOptions.push({
- text: translate('iou.settleBusiness', {formattedAmount}),
- icon: Expensicons.Building,
- value: hasIntentToPay ? CONST.IOU.PAYMENT_TYPE.EXPENSIFY : (lastPaymentMethod ?? CONST.IOU.PAYMENT_TYPE.ELSEWHERE),
- backButtonText: translate('iou.business'),
- subMenuItems: getInvoicesOptions(true),
- });
- } else {
- // If there is pay as business option, we should show the submenu items instead.
- buttonOptions.push(...getInvoicesOptions(true));
- }
- }
-
- if (shouldShowApproveButton) {
- buttonOptions.push(approveButtonOption);
- }
-
- return buttonOptions;
- // We don't want to reorder the options when the preferred payment method changes while the button is still visible except for component initialization when the last payment method is not initialized yet.
- // We need to be sure that onPress should be wrapped in an useCallback to prevent unnecessary updates.
- // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
- }, [
- isLoadingLastPaymentMethod,
+ const paymentButtonOptions = usePaymentOptions({
+ addBankAccountRoute,
+ currency,
iouReport,
- translate,
+ chatReportID,
formattedAmount,
- shouldDisableApproveButton,
- isInvoiceReport,
- currency,
+ policyID,
+ onPress,
shouldHidePaymentOptions,
shouldShowApproveButton,
- shouldShowPayWithExpensifyOption,
- shouldShowPayElsewhereOption,
- chatReport,
- onPress,
+ shouldDisableApproveButton,
onlyShowPayElsewhere,
- latestBankItem,
- activeAdminPolicies,
- ]);
-
- const selectPaymentType = (event: KYCFlowEvent, iouPaymentType: PaymentMethodType) => {
- if (policy && shouldRestrictUserBillableActions(policy.id)) {
- Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(policy.id));
- return;
- }
-
- if (iouPaymentType === CONST.IOU.REPORT_ACTION_TYPE.APPROVE) {
- if (confirmApproval) {
- confirmApproval();
- } else {
- approveMoneyRequest(iouReport);
- }
- return;
- }
- if (isInvoiceReport) {
- // if user has intent to pay, we should get the only bank account information to pay the invoice.
- if (hasIntentToPay) {
- const currentBankInformation = formattedPaymentMethods.at(0) as BankAccount;
- onPress(
- CONST.IOU.PAYMENT_TYPE.EXPENSIFY,
- currentBankInformation.accountType !== CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT,
- currentBankInformation.methodID,
- currentBankInformation.accountType,
- undefined,
- );
- return;
- }
-
- const isBusinessInvoice = isBusinessInvoiceRoom(chatReport);
- if (iouPaymentType === CONST.IOU.PAYMENT_TYPE.ELSEWHERE) {
- onPress(iouPaymentType, isBusinessInvoice);
- return;
- }
- onPress(
- iouPaymentType,
- isBusinessInvoice,
- lastBankAccountID,
- isBusinessInvoice ? CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT : CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT,
- policyIDKey,
- );
- } else {
- onPress(iouPaymentType, false);
- }
- };
-
- const selectPaymentMethod = (event: KYCFlowEvent, triggerKYCFlow: TriggerKYCFlow, paymentMethod?: PaymentMethod, selectedPolicy?: Policy) => {
- if (!isUserValidated) {
- Navigation.navigate(ROUTES.SETTINGS_CONTACT_METHOD_VERIFY_ACCOUNT.getRoute(Navigation.getActiveRoute()));
- return;
- }
-
- if (policy && shouldRestrictUserBillableActions(policy.id)) {
- Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(policy.id));
- return;
- }
-
- let paymentType;
- switch (paymentMethod) {
- case CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT:
- paymentType = CONST.IOU.PAYMENT_TYPE.EXPENSIFY;
- break;
- case CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT:
- paymentType = CONST.IOU.PAYMENT_TYPE.VBBA;
- break;
- default:
- paymentType = CONST.IOU.PAYMENT_TYPE.ELSEWHERE;
- }
- triggerKYCFlow(event, paymentType, paymentMethod, selectedPolicy ?? lastPaymentPolicy);
- if (paymentType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY || paymentType === CONST.IOU.PAYMENT_TYPE.VBBA) {
- setPersonalBankAccountContinueKYCOnSuccess(ROUTES.ENABLE_PAYMENTS);
- }
- };
-
- const getCustomText = () => {
- if (shouldUseShortForm) {
- return translate('iou.pay');
- }
-
- if (lastPaymentMethod === CONST.IOU.PAYMENT_TYPE.ELSEWHERE) {
- return translate('iou.payElsewhere', {formattedAmount});
- }
-
- return translate('iou.settlePayment', {formattedAmount});
- };
-
- const getSecondaryText = (): string | undefined => {
- if (
- shouldUseShortForm ||
- lastPaymentMethod === CONST.IOU.PAYMENT_TYPE.ELSEWHERE ||
- (paymentButtonOptions.length === 1 && paymentButtonOptions.every((option) => option.value === CONST.IOU.PAYMENT_TYPE.ELSEWHERE)) ||
- (shouldHidePaymentOptions && (shouldShowApproveButton || onlyShowPayElsewhere))
- ) {
- return undefined;
- }
-
- if (lastPaymentPolicy) {
- return lastPaymentPolicy.name;
- }
-
- const bankAccountToDisplay = hasIntentToPay ? (formattedPaymentMethods.at(0) as BankAccount) : bankAccount;
- if (lastPaymentMethod === CONST.IOU.PAYMENT_TYPE.EXPENSIFY || (hasIntentToPay && isInvoiceReportUtil(iouReport))) {
- if (bankAccountToDisplay && isInvoiceReportUtil(iouReport)) {
- const translationKey = bankAccountToDisplay.accountData?.type === CONST.BANK_ACCOUNT.TYPE.BUSINESS ? 'iou.invoiceBusinessBank' : 'iou.invoicePersonalBank';
- return translate(translationKey, {lastFour: bankAccountToDisplay?.accountData?.accountNumber?.slice(-4) ?? ''});
- }
-
- if (!personalBankAccountList.length) {
- return;
- }
-
- return translate('common.wallet');
- }
-
- if ((lastPaymentMethod === CONST.IOU.PAYMENT_TYPE.VBBA || hasIntentToPay) && !!policy?.achAccount) {
- if (policy?.achAccount?.accountNumber) {
- return translate('paymentMethodList.bankAccountLastFour', {lastFour: policy?.achAccount?.accountNumber?.slice(-4)});
- }
-
- if (!bankAccountToDisplay?.accountData?.accountNumber) {
- return;
- }
-
- return translate('paymentMethodList.bankAccountLastFour', {lastFour: bankAccountToDisplay?.accountData?.accountNumber?.slice(-4)});
- }
-
- if (bankAccount?.accountData?.type === CONST.BANK_ACCOUNT.TYPE.BUSINESS && isExpenseReportUtil(iouReport)) {
- return translate('paymentMethodList.bankAccountLastFour', {lastFour: bankAccount?.accountData?.accountNumber?.slice(-4) ?? ''});
- }
+ });
- return undefined;
- };
+ const filteredPaymentOptions = paymentButtonOptions.filter((option) => option.value !== undefined) as Array>;
- const handlePaymentSelection = (
- event: GestureResponderEvent | KeyboardEvent | undefined,
- selectedOption: PaymentMethodType | PaymentMethod,
- triggerKYCFlow: (event: GestureResponderEvent | KeyboardEvent | undefined, method?: PaymentMethodType) => void,
- ) => {
+ const onPaymentSelect = (event: KYCFlowEvent, iouPaymentType: PaymentMethodType, triggerKYCFlow: TriggerKYCFlow) => {
if (isAccountLocked) {
showLockedAccountModal();
return;
}
-
- const isPaymentMethod = Object.values(CONST.PAYMENT_METHODS).includes(selectedOption as PaymentMethod);
- const shouldSelectPaymentMethod = (isPaymentMethod ?? lastPaymentPolicy ?? !isEmpty(latestBankItem)) && !shouldShowApproveButton && !shouldHidePaymentOptions;
- const selectedPolicy = activeAdminPolicies.find((activePolicy) => activePolicy.id === selectedOption);
-
- if (!!selectedPolicy || shouldSelectPaymentMethod) {
- selectPaymentMethod(event, triggerKYCFlow, selectedOption as PaymentMethod, selectedPolicy);
- return;
- }
-
- selectPaymentType(event, selectedOption as PaymentMethodType);
+ selectPaymentType(event, iouPaymentType, triggerKYCFlow, policy, onPress, isUserValidated, confirmApproval, iouReport);
};
- const customText = getCustomText();
- const secondaryText = getSecondaryText();
-
- const defaultSelectedIndex = paymentButtonOptions.findIndex((paymentOption) => {
- if (lastPaymentMethod === CONST.IOU.PAYMENT_TYPE.ELSEWHERE) {
- return paymentOption.value === CONST.IOU.PAYMENT_TYPE.ELSEWHERE;
- }
-
- if (latestBankItem?.length) {
- return paymentOption.value === latestBankItem.at(0)?.value;
- }
-
- if (lastPaymentPolicy?.id) {
- return paymentOption.value === lastPaymentPolicy.id;
- }
-
- return false;
- });
-
- const shouldUseSplitButton = hasPreferredPaymentMethod || !!lastPaymentPolicy || ((isInvoiceReport || isExpenseReportUtil(iouReport)) && hasIntentToPay);
- const shouldLimitWidth = shouldUseShortForm && shouldUseSplitButton && !paymentButtonOptions.length;
+ const savePreferredPaymentMethod = (id: string, value: PaymentMethodType) => {
+ savePreferredPaymentMethodIOU(id, value, undefined);
+ };
return (
onPress(paymentType, undefined, undefined)}
+ onSuccessfulKYC={(paymentType) => onPress(paymentType)}
enablePaymentsRoute={enablePaymentsRoute}
addBankAccountRoute={addBankAccountRoute}
addDebitCardRoute={addDebitCardRoute}
@@ -566,33 +106,33 @@ function SettlementButton({
source={CONST.KYC_WALL_SOURCE.REPORT}
chatReportID={chatReportID}
iouReport={iouReport}
- policy={lastPaymentPolicy}
anchorAlignment={kycWallAnchorAlignment}
shouldShowPersonalBankAccountOption={shouldShowPersonalBankAccountOption}
>
{(triggerKYCFlow, buttonRef) => (
-
+
onOptionsMenuShow={onPaymentOptionsShow}
onOptionsMenuHide={onPaymentOptionsHide}
buttonRef={buttonRef}
shouldAlwaysShowDropdownMenu={isInvoiceReport && !onlyShowPayElsewhere}
- customText={customText}
+ customText={isInvoiceReport ? translate('iou.settlePayment', {formattedAmount}) : undefined}
menuHeaderText={isInvoiceReport ? translate('workspace.invoices.paymentMethods.chooseInvoiceMethod') : undefined}
- isSplitButton={shouldUseSplitButton}
+ isSplitButton={!isInvoiceReport}
isDisabled={isDisabled}
isLoading={isLoading}
- defaultSelectedIndex={defaultSelectedIndex !== -1 ? defaultSelectedIndex : 0}
- onPress={(event, iouPaymentType) => handlePaymentSelection(event, iouPaymentType, triggerKYCFlow)}
- success={!hasOnlyHeldExpenses}
- secondLineText={secondaryText}
+ onPress={(event, iouPaymentType) => {
+ onPaymentSelect(event, iouPaymentType, triggerKYCFlow);
+ }}
pressOnEnter={pressOnEnter}
- options={paymentButtonOptions}
- onOptionSelected={(option) => handlePaymentSelection(undefined, option.value, triggerKYCFlow)}
+ options={filteredPaymentOptions}
+ onOptionSelected={(option) => {
+ if (policyID === '-1') {
+ return;
+ }
+ savePreferredPaymentMethod(policyIDKey, option.value);
+ }}
style={style}
- shouldUseShortForm={shouldUseShortForm}
- shouldPopoverUseScrollView={paymentButtonOptions.length > 5}
- containerStyles={paymentButtonOptions.length > 5 ? styles.settlementButtonListContainer : {}}
- wrapperStyle={[wrapperStyle, shouldLimitWidth ? styles.settlementButtonShortFormWidth : {}]}
+ wrapperStyle={wrapperStyle}
disabledStyle={disabledStyle}
buttonSize={buttonSize}
anchorAlignment={paymentMethodDropdownAnchorAlignment}
diff --git a/src/components/SettlementButton/types.ts b/src/components/SettlementButton/types.ts
index 212be067e01e8..9fe5758ea0489 100644
--- a/src/components/SettlementButton/types.ts
+++ b/src/components/SettlementButton/types.ts
@@ -12,7 +12,7 @@ type EnablePaymentsRoute = typeof ROUTES.ENABLE_PAYMENTS | typeof ROUTES.IOU_SEN
type SettlementButtonProps = {
/** Callback to execute when this button is pressed. Receives a single payment type argument. */
- onPress: (paymentType: PaymentMethodType | undefined, payAsBusiness?: boolean, methodID?: number, paymentMethod?: PaymentMethod | undefined, policyID?: string) => void;
+ onPress: (paymentType?: PaymentMethodType, payAsBusiness?: boolean, methodID?: number, paymentMethod?: PaymentMethod) => void;
/** Callback when the payment options popover is shown */
onPaymentOptionsShow?: () => void;
@@ -94,12 +94,6 @@ type SettlementButtonProps = {
/** Whether we only show pay elsewhere button */
onlyShowPayElsewhere?: boolean;
-
- /** Whether to use short form for the button */
- shouldUseShortForm?: boolean;
-
- /** Whether we the report has only held expenses */
- hasOnlyHeldExpenses?: boolean;
};
export default SettlementButtonProps;
diff --git a/src/components/TransactionItemRow/index.tsx b/src/components/TransactionItemRow/index.tsx
index e1800106186c6..aec7002ad4ebe 100644
--- a/src/components/TransactionItemRow/index.tsx
+++ b/src/components/TransactionItemRow/index.tsx
@@ -81,9 +81,6 @@ type TransactionWithOptionalSearchFields = TransactionWithOptionalHighlight & {
/** Precomputed violations */
violations?: TransactionViolation[];
-
- /** Used to initiate payment from search page */
- hash?: number;
};
type TransactionItemRowProps = {
@@ -286,9 +283,6 @@ function TransactionItemRow({
parentAction={transactionItem.parentTransactionID}
goToItem={onButtonPress}
isLoading={isActionLoading}
- reportID={transactionItem.reportID}
- hash={transactionItem.hash}
- amount={transactionItem.amount}
/>
)}
diff --git a/src/hooks/usePaymentOptions.ts b/src/hooks/usePaymentOptions.ts
index e6c95b7ca7ab6..40dc90c922d99 100644
--- a/src/hooks/usePaymentOptions.ts
+++ b/src/hooks/usePaymentOptions.ts
@@ -2,6 +2,7 @@ import {useEffect, useMemo, useRef} from 'react';
import type {TupleToUnion} from 'type-fest';
import * as Expensicons from '@components/Icon/Expensicons';
import type SettlementButtonProps from '@components/SettlementButton/types';
+import type {PaymentOrApproveOption} from '@libs/PaymentUtils';
import {formatPaymentMethods} from '@libs/PaymentUtils';
import getPolicyEmployeeAccountIDs from '@libs/PolicyEmployeeListUtils';
import {
@@ -55,7 +56,7 @@ function usePaymentOptions({
shouldShowApproveButton = false,
shouldDisableApproveButton = false,
onlyShowPayElsewhere,
-}: UsePaymentOptionsProps) {
+}: UsePaymentOptionsProps): PaymentOrApproveOption[] {
const styles = useThemeStyles();
const {translate} = useLocalize();
@@ -77,8 +78,6 @@ function usePaymentOptions({
return (paymentMethod?.[policyIDKey] as LastPaymentMethodType)?.lastUsed.name;
},
});
- const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET, {canBeMissing: true});
- const hasActivatedWallet = ([CONST.WALLET.TIER_NAME.GOLD, CONST.WALLET.TIER_NAME.PLATINUM] as string[]).includes(userWallet?.tierName ?? '');
const isLoadingLastPaymentMethod = isLoadingOnyxValue(lastPaymentMethodResult);
const [bankAccountList = getEmptyObject()] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST, {canBeMissing: true});
@@ -100,17 +99,15 @@ function usePaymentOptions({
const buttonOptions = [];
const isExpenseReport = isExpenseReportUtil(iouReport);
const paymentMethods = {
- [CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT]: {
- text: hasActivatedWallet ? translate('iou.settleWallet', {formattedAmount: ''}) : translate('iou.settlePersonal', {formattedAmount: ''}),
- icon: Expensicons.User,
+ [CONST.IOU.PAYMENT_TYPE.EXPENSIFY]: {
+ text: translate('iou.settleExpensify', {formattedAmount}),
+ icon: Expensicons.Wallet,
value: CONST.IOU.PAYMENT_TYPE.EXPENSIFY,
- shouldUpdateSelectedIndex: false,
},
- [CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT]: {
- text: translate('iou.settleBusiness', {formattedAmount: ''}),
- icon: Expensicons.Building,
+ [CONST.IOU.PAYMENT_TYPE.VBBA]: {
+ text: translate('iou.settleExpensify', {formattedAmount}),
+ icon: Expensicons.Wallet,
value: CONST.IOU.PAYMENT_TYPE.VBBA,
- shouldUpdateSelectedIndex: false,
},
[CONST.IOU.PAYMENT_TYPE.ELSEWHERE]: {
text: translate('iou.payElsewhere', {formattedAmount}),
@@ -137,10 +134,10 @@ function usePaymentOptions({
// To achieve the one tap pay experience we need to choose the correct payment type as default.
if (canUseWallet) {
- buttonOptions.push(paymentMethods[CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT]);
+ buttonOptions.push(paymentMethods[CONST.IOU.PAYMENT_TYPE.EXPENSIFY]);
}
if (isExpenseReport && shouldShowPayWithExpensifyOption) {
- buttonOptions.push(paymentMethods[CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT]);
+ buttonOptions.push(paymentMethods[CONST.IOU.PAYMENT_TYPE.VBBA]);
}
if (shouldShowPayElsewhereOption) {
buttonOptions.push(paymentMethods[CONST.IOU.PAYMENT_TYPE.ELSEWHERE]);
diff --git a/src/languages/de.ts b/src/languages/de.ts
index b3cb0b72274c9..dc5522ed9a98a 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -35,7 +35,6 @@ import type {
AuthenticationErrorParams,
AutoPayApprovedReportsLimitErrorParams,
BadgeFreeTrialParams,
- BankAccountLastFourParams,
BeginningOfChatHistoryAdminRoomPartOneParams,
BeginningOfChatHistoryAnnounceRoomPartOneParams,
BeginningOfChatHistoryDomainRoomPartOneParams,
@@ -46,7 +45,6 @@ import type {
BillingBannerInsufficientFundsParams,
BillingBannerOwnerAmountOwedOverdueParams,
BillingBannerSubtitleWithDateParams,
- BusinessBankAccountParams,
BusinessTaxIDParams,
CanceledRequestParams,
CardEndingParams,
@@ -1131,20 +1129,10 @@ const translations = {
individual: 'Individuum',
business: 'Geschäft',
settleExpensify: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Bezahle ${formattedAmount} mit Expensify` : `Mit Expensify bezahlen`),
- settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Bezahle ${formattedAmount} als Privatperson` : `Mit Privatkonto bezahlen`),
- settleWallet: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Bezahle ${formattedAmount} mit Wallet` : `Mit Wallet bezahlen`),
+ settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Zahlen Sie ${formattedAmount} als Einzelperson` : `Als Einzelperson bezahlen`),
settlePayment: ({formattedAmount}: SettleExpensifyCardParams) => `Zahlen Sie ${formattedAmount}`,
- settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Bezahle ${formattedAmount} als Unternehmen` : `Mit Geschäftskonto bezahlen`),
- payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `${formattedAmount} als bezahlt markieren` : `Als bezahlt markieren`),
- settleInvoicePersonal: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `${amount} mit Privatkonto ${last4Digits} bezahlt` : `Mit Privatkonto bezahlt`),
- settleInvoiceBusiness: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `${amount} mit Geschäftskonto ${last4Digits} bezahlt` : `Mit Geschäftskonto bezahlt`),
- payWithPolicy: ({formattedAmount, policyName}: SettleExpensifyCardParams & {policyName: string}) =>
- formattedAmount ? `${formattedAmount} über ${policyName} bezahlen` : `Über ${policyName} bezahlen`,
- businessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `${amount} mit Bankkonto ${last4Digits} bezahlt.` : `mit Bankkonto ${last4Digits} bezahlt.`),
- automaticallyPaidWithBusinessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) =>
- `heeft ${amount} betaald met bankrekening ${last4Digits}. via werkruimte regels`,
- invoicePersonalBank: ({lastFour}: BankAccountLastFourParams) => `Privatkonto • ${lastFour}`,
- invoiceBusinessBank: ({lastFour}: BankAccountLastFourParams) => `Geschäftskonto • ${lastFour}`,
+ settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Zahlen Sie ${formattedAmount} als Unternehmen` : `Als Unternehmen bezahlen`),
+ payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Zahle ${formattedAmount} anderswo` : `Anderswo bezahlen`),
nextStep: 'Nächste Schritte',
finished: 'Fertiggestellt',
sendInvoice: ({amount}: RequestAmountParams) => `Sende ${amount} Rechnung`,
@@ -1179,8 +1167,8 @@ const translations = {
`hat die Zahlung von ${amount} storniert, weil ${submitterDisplayName} ihre Expensify Wallet nicht innerhalb von 30 Tagen aktiviert hat`,
settledAfterAddedBankAccount: ({submitterDisplayName, amount}: SettledAfterAddedBankAccountParams) =>
`${submitterDisplayName} hat ein Bankkonto hinzugefügt. Die Zahlung von ${amount} wurde geleistet.`,
- paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''}als bezahlt markiert`,
- paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''}mit Wallet bezahlt`,
+ paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''}woanders bezahlt`,
+ paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''} mit Expensify bezahlt`,
automaticallyPaidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) =>
`${payer ? `${payer} ` : ''} mit Expensify über Arbeitsbereichsregeln bezahlt`,
noReimbursableExpenses: 'Dieser Bericht hat einen ungültigen Betrag.',
@@ -1842,7 +1830,6 @@ const translations = {
enableWallet: 'Wallet aktivieren',
addBankAccountToSendAndReceive: 'Erhalten Sie eine Rückerstattung für Ausgaben, die Sie an einen Arbeitsbereich einreichen.',
addBankAccount: 'Bankkonto hinzufügen',
- addDebitOrCreditCard: 'Debit- oder Kreditkarte hinzufügen',
assignedCards: 'Zugewiesene Karten',
assignedCardsDescription: 'Dies sind Karten, die von einem Workspace-Admin zugewiesen wurden, um die Ausgaben des Unternehmens zu verwalten.',
expensifyCard: 'Expensify Card',
@@ -2056,7 +2043,6 @@ const translations = {
cardLastFour: 'Karte endet mit',
addFirstPaymentMethod: 'Fügen Sie eine Zahlungsmethode hinzu, um Zahlungen direkt in der App zu senden und zu empfangen.',
defaultPaymentMethod: 'Standardmäßig',
- bankAccountLastFour: ({lastFour}: BankAccountLastFourParams) => `Bankkonto • ${lastFour}`,
},
preferencesPage: {
appSection: {
diff --git a/src/languages/en.ts b/src/languages/en.ts
index 88209b9608e76..d5d45f7bc3aa7 100755
--- a/src/languages/en.ts
+++ b/src/languages/en.ts
@@ -23,7 +23,6 @@ import type {
AuthenticationErrorParams,
AutoPayApprovedReportsLimitErrorParams,
BadgeFreeTrialParams,
- BankAccountLastFourParams,
BeginningOfChatHistoryAdminRoomPartOneParams,
BeginningOfChatHistoryAnnounceRoomPartOneParams,
BeginningOfChatHistoryDomainRoomPartOneParams,
@@ -34,7 +33,6 @@ import type {
BillingBannerInsufficientFundsParams,
BillingBannerOwnerAmountOwedOverdueParams,
BillingBannerSubtitleWithDateParams,
- BusinessBankAccountParams,
BusinessTaxIDParams,
CanceledRequestParams,
CardEndingParams,
@@ -1116,20 +1114,10 @@ const translations = {
individual: 'Individual',
business: 'Business',
settleExpensify: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pay ${formattedAmount} with Expensify` : `Pay with Expensify`),
- settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pay ${formattedAmount} as an individual` : `Pay with personal account`),
- settleWallet: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pay ${formattedAmount} with wallet` : `Pay with wallet`),
+ settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pay ${formattedAmount} as an individual` : `Pay as an individual`),
settlePayment: ({formattedAmount}: SettleExpensifyCardParams) => `Pay ${formattedAmount}`,
- settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pay ${formattedAmount} as a business` : `Pay with business account`),
- payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Mark ${formattedAmount} as paid` : `Mark as paid`),
- settleInvoicePersonal: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `Paid ${amount} with personal account ${last4Digits}` : `Paid with personal account`),
- settleInvoiceBusiness: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `Paid ${amount} with business account ${last4Digits}` : `Paid with business account`),
- payWithPolicy: ({formattedAmount, policyName}: SettleExpensifyCardParams & {policyName: string}) =>
- formattedAmount ? `Pay ${formattedAmount} via ${policyName}` : `Pay via ${policyName}`,
- businessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `Paid ${amount} with bank account ${last4Digits}` : `Paid with bank account ${last4Digits}`),
- automaticallyPaidWithBusinessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) =>
- `paid ${amount ? `${amount} ` : ''}with bank account ${last4Digits} via workspace rules`,
- invoicePersonalBank: ({lastFour}: BankAccountLastFourParams) => `Personal account • ${lastFour}`,
- invoiceBusinessBank: ({lastFour}: BankAccountLastFourParams) => `Business Account • ${lastFour}`,
+ settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pay ${formattedAmount} as a business` : `Pay as a business`),
+ payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pay ${formattedAmount} elsewhere` : `Pay elsewhere`),
nextStep: 'Next steps',
finished: 'Finished',
sendInvoice: ({amount}: RequestAmountParams) => `Send ${amount} invoice`,
@@ -1164,8 +1152,8 @@ const translations = {
`canceled the ${amount} payment, because ${submitterDisplayName} did not enable their Expensify Wallet within 30 days`,
settledAfterAddedBankAccount: ({submitterDisplayName, amount}: SettledAfterAddedBankAccountParams) =>
`${submitterDisplayName} added a bank account. The ${amount} payment has been made.`,
- paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''}marked as paid`,
- paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''}paid with wallet`,
+ paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''}paid elsewhere`,
+ paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''}paid with Expensify`,
automaticallyPaidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) =>
`${payer ? `${payer} ` : ''}paid with Expensify via workspace rules`,
noReimbursableExpenses: 'This report has an invalid amount',
@@ -1819,7 +1807,6 @@ const translations = {
enableWallet: 'Enable wallet',
addBankAccountToSendAndReceive: 'Get paid back for expenses you submit to a workspace.',
addBankAccount: 'Add bank account',
- addDebitOrCreditCard: 'Add debit or credit card',
assignedCards: 'Assigned cards',
assignedCardsDescription: 'These are cards assigned by a workspace admin to manage company spend.',
expensifyCard: 'Expensify Card',
@@ -2029,7 +2016,6 @@ const translations = {
cardLastFour: 'Card ending in',
addFirstPaymentMethod: 'Add a payment method to send and receive payments directly in the app.',
defaultPaymentMethod: 'Default',
- bankAccountLastFour: ({lastFour}: BankAccountLastFourParams) => `Bank Account • ${lastFour}`,
},
preferencesPage: {
appSection: {
diff --git a/src/languages/es.ts b/src/languages/es.ts
index b530260d6eaa1..2a693be466170 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -22,7 +22,6 @@ import type {
AuthenticationErrorParams,
AutoPayApprovedReportsLimitErrorParams,
BadgeFreeTrialParams,
- BankAccountLastFourParams,
BeginningOfChatHistoryAdminRoomPartOneParams,
BeginningOfChatHistoryAnnounceRoomPartOneParams,
BeginningOfChatHistoryDomainRoomPartOneParams,
@@ -33,7 +32,6 @@ import type {
BillingBannerInsufficientFundsParams,
BillingBannerOwnerAmountOwedOverdueParams,
BillingBannerSubtitleWithDateParams,
- BusinessBankAccountParams,
BusinessTaxIDParams,
CanceledRequestParams,
CardEndingParams,
@@ -1111,21 +1109,10 @@ const translations = {
individual: 'Individual',
business: 'Empresa',
settleExpensify: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pagar ${formattedAmount} con Expensify` : `Pagar con Expensify`),
- settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pago ${formattedAmount} como individuo` : `Pago con cuenta personal`),
- settleWallet: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pagar ${formattedAmount} con billetera` : `con billetera`),
+ settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pago ${formattedAmount} como individuo` : `Pago individual`),
settlePayment: ({formattedAmount}: SettleExpensifyCardParams) => `Pagar ${formattedAmount}`,
- settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pagar ${formattedAmount} como negocio` : `Pago con cuenta empresarial`),
- payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Marcar ${formattedAmount} como pagado` : `Marcar como pagado`),
- settleInvoicePersonal: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `Pagado ${amount} con cuenta personal ${last4Digits}` : `Pagado con cuenta personal`),
- settleInvoiceBusiness: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `Pagado ${amount} con cuenta de empresa ${last4Digits}` : `Pagado con cuenta de empresa`),
- payWithPolicy: ({formattedAmount, policyName}: SettleExpensifyCardParams & {policyName: string}) =>
- formattedAmount ? `Pay ${formattedAmount} via ${policyName}` : `Pay via ${policyName}`,
- businessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) =>
- amount ? `Pagó ${amount} con la cuenta bancaria ${last4Digits}.` : `Pagó con la cuenta bancaria ${last4Digits}`,
- automaticallyPaidWithBusinessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) =>
- `pagado ${amount ? `${amount} ` : ''}con la cuenta bancaria terminada en ${last4Digits} vía reglas del espacio de trabajo`,
- invoicePersonalBank: ({lastFour}: BankAccountLastFourParams) => `Cuenta personal • ${lastFour}`,
- invoiceBusinessBank: ({lastFour}: BankAccountLastFourParams) => `Cuenta de empresa • ${lastFour}`,
+ settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pagar ${formattedAmount} como negocio` : `Pagar como empresa`),
+ payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pagar ${formattedAmount} de otra forma` : `Pagar de otra forma`),
nextStep: 'Pasos siguientes',
finished: 'Finalizado',
sendInvoice: ({amount}: RequestAmountParams) => `Enviar factura de ${amount}`,
@@ -1160,8 +1147,8 @@ const translations = {
`canceló el pago ${amount}, porque ${submitterDisplayName} no habilitó tu Billetera Expensify en un plazo de 30 días.`,
settledAfterAddedBankAccount: ({submitterDisplayName, amount}: SettledAfterAddedBankAccountParams) =>
`${submitterDisplayName} añadió una cuenta bancaria. El pago de ${amount} se ha realizado.`,
- paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''}marcó como pagado`,
- paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''}pagó con la billetera`,
+ paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''}pagó de otra forma`,
+ paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''}pagó con Expensify`,
automaticallyPaidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) =>
`${payer ? `${payer} ` : ''}pagó con Expensify via reglas del espacio de trabajo`,
noReimbursableExpenses: 'El importe de este informe no es válido',
@@ -1819,7 +1806,6 @@ const translations = {
enableWallet: 'Habilitar billetera',
addBankAccountToSendAndReceive: 'Recibe el reembolso de los gastos que envíes a un espacio de trabajo.',
addBankAccount: 'Añadir cuenta bancaria',
- addDebitOrCreditCard: 'Añadir tarjeta de débito o crédito',
assignedCards: 'Tarjetas asignadas',
assignedCardsDescription: 'Son tarjetas asignadas por un administrador del espacio de trabajo para gestionar los gastos de la empresa.',
expensifyCard: 'Tarjeta Expensify',
@@ -2030,7 +2016,6 @@ const translations = {
cardLastFour: 'Tarjeta terminada en',
addFirstPaymentMethod: 'Añade un método de pago para enviar y recibir pagos directamente desde la aplicación.',
defaultPaymentMethod: 'Predeterminado',
- bankAccountLastFour: ({lastFour}: BankAccountLastFourParams) => `Cuenta bancaria • ${lastFour}`,
},
preferencesPage: {
appSection: {
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 09a2dc391e012..28ae1c4875a46 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -35,7 +35,6 @@ import type {
AuthenticationErrorParams,
AutoPayApprovedReportsLimitErrorParams,
BadgeFreeTrialParams,
- BankAccountLastFourParams,
BeginningOfChatHistoryAdminRoomPartOneParams,
BeginningOfChatHistoryAnnounceRoomPartOneParams,
BeginningOfChatHistoryDomainRoomPartOneParams,
@@ -46,7 +45,6 @@ import type {
BillingBannerInsufficientFundsParams,
BillingBannerOwnerAmountOwedOverdueParams,
BillingBannerSubtitleWithDateParams,
- BusinessBankAccountParams,
BusinessTaxIDParams,
CanceledRequestParams,
CardEndingParams,
@@ -1132,22 +1130,10 @@ const translations = {
individual: 'Individuel',
business: 'Entreprise',
settleExpensify: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Payer ${formattedAmount} avec Expensify` : `Payer avec Expensify`),
- settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Payer ${formattedAmount} en tant qu'individu` : `Payer avec un compte personnel`),
- settleWallet: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Payer ${formattedAmount} avec le portefeuille` : `Payer avec le portefeuille`),
+ settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Payer ${formattedAmount} en tant qu'individu` : `Payer en tant qu'individu`),
settlePayment: ({formattedAmount}: SettleExpensifyCardParams) => `Payer ${formattedAmount}`,
- settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Payer ${formattedAmount} en tant qu'entreprise` : `Payer avec un compte professionnel`),
- payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Marquer ${formattedAmount} comme payé` : `Marquer comme payé`),
- settleInvoicePersonal: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `Payé ${amount} avec le compte personnel ${last4Digits}` : `Payé avec le compte personnel`),
- settleInvoiceBusiness: ({amount, last4Digits}: BusinessBankAccountParams) =>
- amount ? `Payé ${amount} avec le compte professionnel ${last4Digits}` : `Payé avec le compte professionnel`,
- payWithPolicy: ({formattedAmount, policyName}: SettleExpensifyCardParams & {policyName: string}) =>
- formattedAmount ? `Payer ${formattedAmount} via ${policyName}` : `Payer via ${policyName}`,
- businessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) =>
- amount ? `Payé ${amount} avec le compte bancaire ${last4Digits}.` : `Payé avec le compte bancaire ${last4Digits}`,
- automaticallyPaidWithBusinessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) =>
- `payé ${amount ? `${amount} ` : ''}avec le compte bancaire se terminant par ${last4Digits} via les règles de l’espace de travail`,
- invoicePersonalBank: ({lastFour}: BankAccountLastFourParams) => `Compte personnel • ${lastFour}`,
- invoiceBusinessBank: ({lastFour}: BankAccountLastFourParams) => `Compte professionnel • ${lastFour}`,
+ settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Payer ${formattedAmount} en tant qu'entreprise` : `Payer en tant qu'entreprise`),
+ payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Payer ${formattedAmount} ailleurs` : `Payer ailleurs`),
nextStep: 'Étapes suivantes',
finished: 'Terminé',
sendInvoice: ({amount}: RequestAmountParams) => `Envoyer une facture de ${amount}`,
@@ -1182,8 +1168,8 @@ const translations = {
`a annulé le paiement de ${amount}, car ${submitterDisplayName} n'a pas activé leur Expensify Wallet dans les 30 jours`,
settledAfterAddedBankAccount: ({submitterDisplayName, amount}: SettledAfterAddedBankAccountParams) =>
`${submitterDisplayName} a ajouté un compte bancaire. Le paiement de ${amount} a été effectué.`,
- paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''}marqué comme payé`,
- paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''}payé avec le portefeuille`,
+ paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''} payé ailleurs`,
+ paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''} payé avec Expensify`,
automaticallyPaidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) =>
`${payer ? `${payer} ` : ''} payé avec Expensify via les règles de l'espace de travail`,
noReimbursableExpenses: 'Ce rapport contient un montant invalide',
@@ -1844,7 +1830,6 @@ const translations = {
enableWallet: 'Activer le portefeuille',
addBankAccountToSendAndReceive: 'Soyez remboursé pour les dépenses que vous soumettez à un espace de travail.',
addBankAccount: 'Ajouter un compte bancaire',
- addDebitOrCreditCard: 'Ajouter une carte de débit ou de crédit',
assignedCards: 'Cartes assignées',
assignedCardsDescription: "Ce sont des cartes attribuées par un administrateur d'espace de travail pour gérer les dépenses de l'entreprise.",
expensifyCard: 'Expensify Card',
@@ -2059,7 +2044,6 @@ const translations = {
cardLastFour: 'Carte se terminant par',
addFirstPaymentMethod: "Ajoutez un mode de paiement pour envoyer et recevoir des paiements directement dans l'application.",
defaultPaymentMethod: 'Par défaut',
- bankAccountLastFour: ({lastFour}: BankAccountLastFourParams) => `Bank Account • ${lastFour}`,
},
preferencesPage: {
appSection: {
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 87d2096fdd4b0..65e4de7df36c8 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -35,7 +35,6 @@ import type {
AuthenticationErrorParams,
AutoPayApprovedReportsLimitErrorParams,
BadgeFreeTrialParams,
- BankAccountLastFourParams,
BeginningOfChatHistoryAdminRoomPartOneParams,
BeginningOfChatHistoryAnnounceRoomPartOneParams,
BeginningOfChatHistoryDomainRoomPartOneParams,
@@ -46,7 +45,6 @@ import type {
BillingBannerInsufficientFundsParams,
BillingBannerOwnerAmountOwedOverdueParams,
BillingBannerSubtitleWithDateParams,
- BusinessBankAccountParams,
BusinessTaxIDParams,
CanceledRequestParams,
CardEndingParams,
@@ -1127,21 +1125,10 @@ const translations = {
individual: 'Individuale',
business: 'Business',
settleExpensify: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Paga ${formattedAmount} con Expensify` : `Paga con Expensify`),
- settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Paga ${formattedAmount} come individuo` : `Paga con conto personale`),
- settleWallet: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Paga ${formattedAmount} con portafoglio` : `Paga con portafoglio`),
+ settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Paga ${formattedAmount} come individuo` : `Paga come individuo`),
settlePayment: ({formattedAmount}: SettleExpensifyCardParams) => `Paga ${formattedAmount}`,
- settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Paga ${formattedAmount} come azienda` : `Paga con conto aziendale`),
- payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Segna ${formattedAmount} come pagato` : `Segna come pagato`),
- settleInvoicePersonal: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `Pagato ${amount} con conto personale ${last4Digits}` : `Pagato con conto personale`),
- settleInvoiceBusiness: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `Pagato ${amount} con conto aziendale ${last4Digits}` : `Pagato con conto aziendale`),
- payWithPolicy: ({formattedAmount, policyName}: SettleExpensifyCardParams & {policyName: string}) =>
- formattedAmount ? `Paga ${formattedAmount} tramite ${policyName}` : `Paga tramite ${policyName}`,
- businessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) =>
- amount ? `Pagato ${amount} con conto bancario ${last4Digits}` : `Pagato con conto bancario ${last4Digits}`,
- automaticallyPaidWithBusinessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) =>
- `pagato ${amount ? `${amount} ` : ''}con il conto bancario terminante con ${last4Digits} tramite le regole dello spazio di lavoro`,
- invoicePersonalBank: ({lastFour}: BankAccountLastFourParams) => `Conto personale • ${lastFour}`,
- invoiceBusinessBank: ({lastFour}: BankAccountLastFourParams) => `Conto aziendale • ${lastFour}`,
+ settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Paga ${formattedAmount} come azienda` : `Paga come un'azienda`),
+ payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Paga ${formattedAmount} altrove` : `Paga altrove`),
nextStep: 'Prossimi passi',
finished: 'Finito',
sendInvoice: ({amount}: RequestAmountParams) => `Invia fattura di ${amount}`,
@@ -1176,8 +1163,8 @@ const translations = {
`annullato il pagamento di ${amount}, perché ${submitterDisplayName} non ha attivato il loro Expensify Wallet entro 30 giorni`,
settledAfterAddedBankAccount: ({submitterDisplayName, amount}: SettledAfterAddedBankAccountParams) =>
`${submitterDisplayName} ha aggiunto un conto bancario. Il pagamento di ${amount} è stato effettuato.`,
- paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''}segnato come pagato`,
- paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''}pagato con portafoglio`,
+ paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''}pagato altrove`,
+ paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''} pagato con Expensify`,
automaticallyPaidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) =>
`${payer ? `${payer} ` : ''} ha pagato con Expensify tramite regole dello spazio di lavoro`,
noReimbursableExpenses: 'Questo rapporto ha un importo non valido',
@@ -1835,7 +1822,6 @@ const translations = {
enableWallet: 'Abilita portafoglio',
addBankAccountToSendAndReceive: "Ricevi il rimborso per le spese che invii a un'area di lavoro.",
addBankAccount: 'Aggiungi conto bancario',
- addDebitOrCreditCard: 'Aggiungi carta di debito o di credito',
assignedCards: 'Carte assegnate',
assignedCardsDescription: 'Queste sono carte assegnate da un amministratore del workspace per gestire le spese aziendali.',
expensifyCard: 'Expensify Card',
@@ -2048,7 +2034,6 @@ const translations = {
cardLastFour: 'Carta che termina con',
addFirstPaymentMethod: "Aggiungi un metodo di pagamento per inviare e ricevere pagamenti direttamente nell'app.",
defaultPaymentMethod: 'Predefinito',
- bankAccountLastFour: ({lastFour}: BankAccountLastFourParams) => `Conto bancario • ${lastFour}`,
},
preferencesPage: {
appSection: {
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 8d844d98f0643..f54b36334b8be 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -35,7 +35,6 @@ import type {
AuthenticationErrorParams,
AutoPayApprovedReportsLimitErrorParams,
BadgeFreeTrialParams,
- BankAccountLastFourParams,
BeginningOfChatHistoryAdminRoomPartOneParams,
BeginningOfChatHistoryAnnounceRoomPartOneParams,
BeginningOfChatHistoryDomainRoomPartOneParams,
@@ -46,7 +45,6 @@ import type {
BillingBannerInsufficientFundsParams,
BillingBannerOwnerAmountOwedOverdueParams,
BillingBannerSubtitleWithDateParams,
- BusinessBankAccountParams,
BusinessTaxIDParams,
CanceledRequestParams,
CardEndingParams,
@@ -1130,21 +1128,10 @@ const translations = {
individual: '個人',
business: 'ビジネス',
settleExpensify: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Expensifyで${formattedAmount}を支払う` : `Expensifyで支払う`),
- settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `${formattedAmount}を個人として支払う` : `個人口座で支払う`),
- settleWallet: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `ウォレットで${formattedAmount}を支払う` : `ウォレットで支払う`),
+ settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `個人として${formattedAmount}を支払う` : `個人として支払う`),
settlePayment: ({formattedAmount}: SettleExpensifyCardParams) => `${formattedAmount}を支払う`,
- settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `${formattedAmount}をビジネスとして支払う` : `ビジネス口座で支払う`),
- payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `${formattedAmount}を支払い済みにマーク` : `支払い済みにマーク`),
- settleInvoicePersonal: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `${amount}を個人口座(${last4Digits})で支払い済み` : `個人口座で支払い済み`),
- settleInvoiceBusiness: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `${amount}をビジネス口座(${last4Digits})で支払い済み` : `ビジネス口座で支払い済み`),
- payWithPolicy: ({formattedAmount, policyName}: SettleExpensifyCardParams & {policyName: string}) =>
- formattedAmount ? `${policyName}経由で${formattedAmount}を支払う` : `${policyName}経由で支払う`,
- businessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) =>
- amount ? `${amount}を銀行口座(${last4Digits})で支払い済み` : `を銀行口座(${last4Digits})で支払い済み`,
- automaticallyPaidWithBusinessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) =>
- `${amount}円が銀行口座(下4桁:${last4Digits})で支払われました ワークスペースのルールによる`,
- invoicePersonalBank: ({lastFour}: BankAccountLastFourParams) => `個人口座・${lastFour}`,
- invoiceBusinessBank: ({lastFour}: BankAccountLastFourParams) => `ビジネス口座・${lastFour}`,
+ settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `${formattedAmount} をビジネスとして支払う` : `ビジネスとして支払う`),
+ payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `他の場所で${formattedAmount}を支払う` : `他の場所で支払う`),
nextStep: '次のステップ',
finished: '完了',
sendInvoice: ({amount}: RequestAmountParams) => `${amount} 請求書を送信`,
@@ -1179,8 +1166,8 @@ const translations = {
`${submitterDisplayName}が30日以内にExpensifyウォレットを有効にしなかったため、${amount}の支払いをキャンセルしました。`,
settledAfterAddedBankAccount: ({submitterDisplayName, amount}: SettledAfterAddedBankAccountParams) =>
`${submitterDisplayName}が銀行口座を追加しました。${amount}の支払いが行われました。`,
- paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''}支払い済みにマークされました`,
- paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''}ウォレットで支払い済み`,
+ paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''}は他で支払われました`,
+ paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''}はExpensifyで支払いました`,
automaticallyPaidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) =>
`${payer ? `${payer} ` : ''}はワークスペースルールを通じてExpensifyで支払いました。`,
noReimbursableExpenses: 'このレポートには無効な金額が含まれています',
@@ -1833,7 +1820,6 @@ const translations = {
enableWallet: 'ウォレットを有効にする',
addBankAccountToSendAndReceive: 'ワークスペースに提出した経費の払い戻しを受ける。',
addBankAccount: '銀行口座を追加',
- addDebitOrCreditCard: 'デビットカードまたはクレジットカードを追加',
assignedCards: '割り当てられたカード',
assignedCardsDescription: 'これらは、会社の支出を管理するためにワークスペース管理者によって割り当てられたカードです。',
expensifyCard: 'Expensify Card',
@@ -2042,7 +2028,6 @@ const translations = {
cardLastFour: '末尾が',
addFirstPaymentMethod: 'アプリ内で直接送受金を行うために支払い方法を追加してください。',
defaultPaymentMethod: 'デフォルト',
- bankAccountLastFour: ({lastFour}: BankAccountLastFourParams) => `銀行口座・${lastFour}`,
},
preferencesPage: {
appSection: {
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 72cebf6c43967..46f4d5c6c3001 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -35,7 +35,6 @@ import type {
AuthenticationErrorParams,
AutoPayApprovedReportsLimitErrorParams,
BadgeFreeTrialParams,
- BankAccountLastFourParams,
BeginningOfChatHistoryAdminRoomPartOneParams,
BeginningOfChatHistoryAnnounceRoomPartOneParams,
BeginningOfChatHistoryDomainRoomPartOneParams,
@@ -46,7 +45,6 @@ import type {
BillingBannerInsufficientFundsParams,
BillingBannerOwnerAmountOwedOverdueParams,
BillingBannerSubtitleWithDateParams,
- BusinessBankAccountParams,
BusinessTaxIDParams,
CanceledRequestParams,
CardEndingParams,
@@ -1128,21 +1126,10 @@ const translations = {
individual: 'Individuueel',
business: 'Business',
settleExpensify: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Betaal ${formattedAmount} met Expensify` : `Betaal met Expensify`),
- settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Betaal ${formattedAmount} als individu` : `Betalen met persoonlijke rekening`),
- settleWallet: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Betaal ${formattedAmount} met wallet` : `Betalen met wallet`),
+ settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Betaal ${formattedAmount} als individu` : `Betaal als individu`),
settlePayment: ({formattedAmount}: SettleExpensifyCardParams) => `Betaal ${formattedAmount}`,
- settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Betaal ${formattedAmount} als bedrijf` : `Betalen met zakelijke rekening`),
- payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `${formattedAmount} als betaald markeren` : `Markeren als betaald`),
- settleInvoicePersonal: ({amount, last4Digits}: BusinessBankAccountParams) =>
- amount ? `${amount} betaald met persoonlijke rekening ${last4Digits}` : `Betaald met persoonlijke rekening`,
- settleInvoiceBusiness: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `${amount} betaald met zakelijke rekening ${last4Digits}` : `Betaald met zakelijke rekening`),
- payWithPolicy: ({formattedAmount, policyName}: SettleExpensifyCardParams & {policyName: string}) =>
- formattedAmount ? `Betaal ${formattedAmount} via ${policyName}` : `Betalen via ${policyName}`,
- businessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `${amount} betaald via bankrekening ${last4Digits}` : `betaald via bankrekening ${last4Digits}`),
- automaticallyPaidWithBusinessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) =>
- `${amount} betaald met bankrekening eindigend op ${last4Digits} via werkruimte regels`,
- invoicePersonalBank: ({lastFour}: BankAccountLastFourParams) => `Persoonlijke rekening • ${lastFour}`,
- invoiceBusinessBank: ({lastFour}: BankAccountLastFourParams) => `Zakelijke rekening • ${lastFour}`,
+ settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Betaal ${formattedAmount} als een bedrijf` : `Betalen als een bedrijf`),
+ payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Betaal ${formattedAmount} ergens anders` : `Elders betalen`),
nextStep: 'Volgende stappen',
finished: 'Voltooid',
sendInvoice: ({amount}: RequestAmountParams) => `Verstuur ${amount} factuur`,
@@ -1177,8 +1164,8 @@ const translations = {
`heeft de betaling van ${amount} geannuleerd, omdat ${submitterDisplayName} hun Expensify Wallet niet binnen 30 dagen heeft geactiveerd.`,
settledAfterAddedBankAccount: ({submitterDisplayName, amount}: SettledAfterAddedBankAccountParams) =>
`${submitterDisplayName} heeft een bankrekening toegevoegd. De betaling van ${amount} is gedaan.`,
- paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''}gemarkeerd als betaald`,
- paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''}betaald met wallet`,
+ paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''} elders betaald`,
+ paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''}betaald met Expensify`,
automaticallyPaidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) =>
`${payer ? `${payer} ` : ''}betaald met Expensify via werkruimte regels`,
noReimbursableExpenses: 'Dit rapport heeft een ongeldig bedrag.',
@@ -1835,7 +1822,6 @@ const translations = {
enableWallet: 'Portemonnee inschakelen',
addBankAccountToSendAndReceive: 'Word terugbetaald voor uitgaven die je indient bij een werkruimte.',
addBankAccount: 'Bankrekening toevoegen',
- addDebitOrCreditCard: 'Debet- of creditcard toevoegen',
assignedCards: 'Toegewezen kaarten',
assignedCardsDescription: 'Dit zijn kaarten die door een werkruimtebeheerder zijn toegewezen om de uitgaven van het bedrijf te beheren.',
expensifyCard: 'Expensify Card',
@@ -2048,7 +2034,6 @@ const translations = {
cardLastFour: 'Kaart eindigend op',
addFirstPaymentMethod: 'Voeg een betaalmethode toe om betalingen direct in de app te verzenden en ontvangen.',
defaultPaymentMethod: 'Standaard',
- bankAccountLastFour: ({lastFour}: BankAccountLastFourParams) => `Bankrekening • ${lastFour}`,
},
preferencesPage: {
appSection: {
diff --git a/src/languages/params.ts b/src/languages/params.ts
index 3e99dfa091b0e..6a21f85f0ce69 100644
--- a/src/languages/params.ts
+++ b/src/languages/params.ts
@@ -137,11 +137,6 @@ type SettleExpensifyCardParams = {
formattedAmount: string;
};
-type BusinessBankAccountParams = {
- amount: string;
- last4Digits: string;
-};
-
type WorkspaceRouteParams = {
workspaceRoute: string;
};
@@ -206,8 +201,6 @@ type TransferParams = {amount: string};
type InstantSummaryParams = {rate: string; minAmount: string};
-type BankAccountLastFourParams = {lastFour: string};
-
type NotYouParams = {user: string};
type DateShouldBeBeforeParams = {dateString: string};
@@ -1049,7 +1042,6 @@ export type {
SettlementDateParams,
PolicyExpenseChatNameParams,
YourPlanPriceValueParams,
- BusinessBankAccountParams,
NeedCategoryForExportToIntegrationParams,
UpdatedPolicyAuditRateParams,
UpdatedPolicyManualApprovalThresholdParams,
@@ -1063,7 +1055,6 @@ export type {
UpdatedPolicyCategoryExpenseLimitTypeParams,
UpdatedPolicyCategoryMaxAmountNoReceiptParams,
SubscriptionSettingsSummaryParams,
- BankAccountLastFourParams,
ReviewParams,
CreateExpensesParams,
CurrencyInputDisabledTextParams,
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 0834ef13dfdcd..407aa9d487cb4 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -35,7 +35,6 @@ import type {
AuthenticationErrorParams,
AutoPayApprovedReportsLimitErrorParams,
BadgeFreeTrialParams,
- BankAccountLastFourParams,
BeginningOfChatHistoryAdminRoomPartOneParams,
BeginningOfChatHistoryAnnounceRoomPartOneParams,
BeginningOfChatHistoryDomainRoomPartOneParams,
@@ -46,7 +45,6 @@ import type {
BillingBannerInsufficientFundsParams,
BillingBannerOwnerAmountOwedOverdueParams,
BillingBannerSubtitleWithDateParams,
- BusinessBankAccountParams,
BusinessTaxIDParams,
CanceledRequestParams,
CardEndingParams,
@@ -1126,21 +1124,10 @@ const translations = {
individual: 'Indywidualny',
business: 'Biznes',
settleExpensify: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Zapłać ${formattedAmount} za pomocą Expensify` : `Zapłać z Expensify`),
- settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Zapłać ${formattedAmount} jako osoba prywatna` : `Zapłać z konta osobistego`),
- settleWallet: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Zapłać ${formattedAmount} portfelem` : `Zapłać portfelem`),
+ settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Zapłać ${formattedAmount} jako osoba prywatna` : `Płać jako osoba prywatna`),
settlePayment: ({formattedAmount}: SettleExpensifyCardParams) => `Zapłać ${formattedAmount}`,
- settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Zapłać ${formattedAmount} jako firma` : `Zapłać z konta firmowego`),
- payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Oznacz ${formattedAmount} jako zapłacone` : `Oznacz jako zapłacone`),
- settleInvoicePersonal: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `Zapłacono ${amount} z konta osobistego ${last4Digits}` : `Zapłacono z konta osobistego`),
- settleInvoiceBusiness: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `Zapłacono ${amount} z konta firmowego ${last4Digits}` : `Zapłacono z konta firmowego`),
- payWithPolicy: ({formattedAmount, policyName}: SettleExpensifyCardParams & {policyName: string}) =>
- formattedAmount ? `Zapłać ${formattedAmount} przez ${policyName}` : `Zapłać przez ${policyName}`,
- businessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) =>
- amount ? `Zapłacono ${amount} z konta bankowego ${last4Digits}` : `Zapłacono z konta bankowego ${last4Digits}`,
- automaticallyPaidWithBusinessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) =>
- `zapłacono ${amount ? `${amount} ` : ''}z konta bankowego o numerze kończącym się na ${last4Digits} przez zasady przestrzeni roboczej`,
- invoicePersonalBank: ({lastFour}: BankAccountLastFourParams) => `Konto osobiste • ${lastFour}`,
- invoiceBusinessBank: ({lastFour}: BankAccountLastFourParams) => `Konto firmowe • ${lastFour}`,
+ settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Zapłać ${formattedAmount} jako firma` : `Płać jako firma`),
+ payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Zapłać ${formattedAmount} gdzie indziej` : `Zapłać gdzie indziej`),
nextStep: 'Następne kroki',
finished: 'Zakończono',
sendInvoice: ({amount}: RequestAmountParams) => `Wyślij fakturę na kwotę ${amount}`,
@@ -1175,8 +1162,8 @@ const translations = {
`anulowano płatność w wysokości ${amount}, ponieważ ${submitterDisplayName} nie aktywował swojego Portfela Expensify w ciągu 30 dni`,
settledAfterAddedBankAccount: ({submitterDisplayName, amount}: SettledAfterAddedBankAccountParams) =>
`${submitterDisplayName} dodał konto bankowe. Płatność w wysokości ${amount} została dokonana.`,
- paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''}oznaczono jako zapłacone`,
- paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''}zapłacono portfelem`,
+ paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''}zapłacono gdzie indziej`,
+ paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''}zapłacono za pomocą Expensify`,
automaticallyPaidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) =>
`${payer ? `${payer} ` : ''}zapłacono z Expensify za pomocą zasad przestrzeni roboczej`,
noReimbursableExpenses: 'Ten raport ma nieprawidłową kwotę',
@@ -1831,7 +1818,6 @@ const translations = {
enableWallet: 'Włącz portfel',
addBankAccountToSendAndReceive: 'Otrzymaj zwrot kosztów za wydatki, które zgłaszasz do przestrzeni roboczej.',
addBankAccount: 'Dodaj konto bankowe',
- addDebitOrCreditCard: 'Dodaj kartę debetową lub kredytową',
assignedCards: 'Przypisane karty',
assignedCardsDescription: 'Są to karty przypisane przez administratora przestrzeni roboczej do zarządzania wydatkami firmy.',
expensifyCard: 'Expensify Card',
@@ -2044,7 +2030,6 @@ const translations = {
cardLastFour: 'Karta kończąca się na',
addFirstPaymentMethod: 'Dodaj metodę płatności, aby wysyłać i odbierać płatności bezpośrednio w aplikacji.',
defaultPaymentMethod: 'Domyślny',
- bankAccountLastFour: ({lastFour}: BankAccountLastFourParams) => `Konto bankowe • ${lastFour}`,
},
preferencesPage: {
appSection: {
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 818263b182ca8..34ce9dcddddc3 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -35,7 +35,6 @@ import type {
AuthenticationErrorParams,
AutoPayApprovedReportsLimitErrorParams,
BadgeFreeTrialParams,
- BankAccountLastFourParams,
BeginningOfChatHistoryAdminRoomPartOneParams,
BeginningOfChatHistoryAnnounceRoomPartOneParams,
BeginningOfChatHistoryDomainRoomPartOneParams,
@@ -46,7 +45,6 @@ import type {
BillingBannerInsufficientFundsParams,
BillingBannerOwnerAmountOwedOverdueParams,
BillingBannerSubtitleWithDateParams,
- BusinessBankAccountParams,
BusinessTaxIDParams,
CanceledRequestParams,
CardEndingParams,
@@ -1128,20 +1126,10 @@ const translations = {
individual: 'Individual',
business: 'Negócio',
settleExpensify: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pague ${formattedAmount} com Expensify` : `Pague com Expensify`),
- settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pagar ${formattedAmount} como indivíduo` : `Pagar com conta pessoal`),
- settleWallet: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pagar ${formattedAmount} com carteira` : `Pagar com carteira`),
+ settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pagar ${formattedAmount} como indivíduo` : `Pagar como indivíduo`),
settlePayment: ({formattedAmount}: SettleExpensifyCardParams) => `Pagar ${formattedAmount}`,
- settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pagar ${formattedAmount} como empresa` : `Pagar com conta empresarial`),
- payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Marcar ${formattedAmount} como pago` : `Marcar como pago`),
- settleInvoicePersonal: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `Pago ${amount} com conta pessoal ${last4Digits}` : `Pago com conta pessoal`),
- settleInvoiceBusiness: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `Pago ${amount} com conta empresarial ${last4Digits}` : `Pago com conta empresarial`),
- payWithPolicy: ({formattedAmount, policyName}: SettleExpensifyCardParams & {policyName: string}) =>
- formattedAmount ? `Pagar ${formattedAmount} via ${policyName}` : `Pagar via ${policyName}`,
- businessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `Pago ${amount} com conta bancária ${last4Digits}` : `Pago com conta bancária ${last4Digits}`),
- automaticallyPaidWithBusinessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) =>
- `pago ${amount ? `${amount} ` : ''}com a conta bancária terminada em ${last4Digits} via regras do espaço de trabalho`,
- invoicePersonalBank: ({lastFour}: BankAccountLastFourParams) => `Conta pessoal • ${lastFour}`,
- invoiceBusinessBank: ({lastFour}: BankAccountLastFourParams) => `Conta empresarial • ${lastFour}`,
+ settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pague ${formattedAmount} como uma empresa` : `Pagar como empresa`),
+ payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pague ${formattedAmount} em outro lugar` : `Pague em outro lugar`),
nextStep: 'Próximos passos',
finished: 'Concluído',
sendInvoice: ({amount}: RequestAmountParams) => `Enviar fatura de ${amount}`,
@@ -1176,8 +1164,8 @@ const translations = {
`cancelou o pagamento de ${amount}, porque ${submitterDisplayName} não ativou sua Expensify Wallet dentro de 30 dias`,
settledAfterAddedBankAccount: ({submitterDisplayName, amount}: SettledAfterAddedBankAccountParams) =>
`${submitterDisplayName} adicionou uma conta bancária. O pagamento de ${amount} foi realizado.`,
- paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''}marcado como pago`,
- paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''}pago com carteira`,
+ paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''} pago em outro lugar`,
+ paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''} pagou com Expensify`,
automaticallyPaidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) =>
`${payer ? `${payer} ` : ''} pagou com Expensify via regras do workspace`,
noReimbursableExpenses: 'Este relatório possui um valor inválido',
@@ -1833,7 +1821,6 @@ const translations = {
enableWallet: 'Ativar carteira',
addBankAccountToSendAndReceive: 'Receba reembolso pelas despesas que você enviar para um espaço de trabalho.',
addBankAccount: 'Adicionar conta bancária',
- addDebitOrCreditCard: 'Adicionar cartão de débito ou crédito',
assignedCards: 'Cartões atribuídos',
assignedCardsDescription: 'Estes são cartões atribuídos por um administrador de espaço de trabalho para gerenciar os gastos da empresa.',
expensifyCard: 'Expensify Card',
@@ -2046,7 +2033,6 @@ const translations = {
cardLastFour: 'Cartão terminando em',
addFirstPaymentMethod: 'Adicione um método de pagamento para enviar e receber pagamentos diretamente no aplicativo.',
defaultPaymentMethod: 'Padrão',
- bankAccountLastFour: ({lastFour}: BankAccountLastFourParams) => `Conta bancária • ${lastFour}`,
},
preferencesPage: {
appSection: {
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 0232685662818..23f795dfabce3 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -35,7 +35,6 @@ import type {
AuthenticationErrorParams,
AutoPayApprovedReportsLimitErrorParams,
BadgeFreeTrialParams,
- BankAccountLastFourParams,
BeginningOfChatHistoryAdminRoomPartOneParams,
BeginningOfChatHistoryAnnounceRoomPartOneParams,
BeginningOfChatHistoryDomainRoomPartOneParams,
@@ -46,7 +45,6 @@ import type {
BillingBannerInsufficientFundsParams,
BillingBannerOwnerAmountOwedOverdueParams,
BillingBannerSubtitleWithDateParams,
- BusinessBankAccountParams,
BusinessTaxIDParams,
CanceledRequestParams,
CardEndingParams,
@@ -1118,20 +1116,10 @@ const translations = {
individual: '个人',
business: '商务',
settleExpensify: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `使用 Expensify 支付 ${formattedAmount}` : `使用Expensify支付`),
- settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `以个人身份支付${formattedAmount}` : `用个人账户支付`),
- settleWallet: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `用钱包支付${formattedAmount}` : `用钱包支付`),
+ settlePersonal: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `以个人身份支付${formattedAmount}` : `以个人身份支付`),
settlePayment: ({formattedAmount}: SettleExpensifyCardParams) => `支付 ${formattedAmount}`,
- settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `以企业身份支付${formattedAmount}` : `用企业账户支付`),
- payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `标记${formattedAmount}为已支付` : `标记为已支付`),
- settleInvoicePersonal: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `已用个人账户${last4Digits}支付${amount}` : `已用个人账户支付`),
- settleInvoiceBusiness: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `已用企业账户${last4Digits}支付${amount}` : `已用企业账户支付`),
- payWithPolicy: ({formattedAmount, policyName}: SettleExpensifyCardParams & {policyName: string}) =>
- formattedAmount ? `通过${policyName}支付${formattedAmount}` : `通过${policyName}支付`,
- businessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) => (amount ? `已用银行账户${last4Digits}支付${amount} ` : `已用银行账户${last4Digits}支付 `),
- automaticallyPaidWithBusinessBankAccount: ({amount, last4Digits}: BusinessBankAccountParams) =>
- `已使用尾号为${last4Digits}的银行账户支付${amount} 通过工作区规则`,
- invoicePersonalBank: ({lastFour}: BankAccountLastFourParams) => `个人账户 • ${lastFour}`,
- invoiceBusinessBank: ({lastFour}: BankAccountLastFourParams) => `企业账户 • ${lastFour}`,
+ settleBusiness: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `以企业身份支付${formattedAmount}` : `以企业身份支付`),
+ payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `在其他地方支付${formattedAmount}` : `在其他地方支付`),
nextStep: '下一步',
finished: '完成',
sendInvoice: ({amount}: RequestAmountParams) => `发送 ${amount} 发票`,
@@ -1164,8 +1152,8 @@ const translations = {
adminCanceledRequest: ({manager}: AdminCanceledRequestParams) => `${manager ? `${manager}: ` : ''}取消了付款`,
canceledRequest: ({amount, submitterDisplayName}: CanceledRequestParams) => `取消了${amount}付款,因为${submitterDisplayName}在30天内未启用他们的Expensify Wallet。`,
settledAfterAddedBankAccount: ({submitterDisplayName, amount}: SettledAfterAddedBankAccountParams) => `${submitterDisplayName} 添加了一个银行账户。${amount} 付款已完成。`,
- paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''}已标记为已支付`,
- paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''}已用钱包支付`,
+ paidElsewhere: ({payer}: PaidElsewhereParams = {}) => `${payer ? `${payer} ` : ''}在其他地方支付`,
+ paidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) => `${payer ? `${payer} ` : ''}通过Expensify支付`,
automaticallyPaidWithExpensify: ({payer}: PaidWithExpensifyParams = {}) =>
`${payer ? `${payer} ` : ''}通过工作区规则使用Expensify支付`,
noReimbursableExpenses: '此报告的金额无效',
@@ -1816,7 +1804,6 @@ const translations = {
enableWallet: '启用钱包',
addBankAccountToSendAndReceive: '获得报销您提交到工作区的费用。',
addBankAccount: '添加银行账户',
- addDebitOrCreditCard: '添加借记卡或信用卡',
assignedCards: '已分配的卡片',
assignedCardsDescription: '这些是由工作区管理员分配的卡片,用于管理公司支出。',
expensifyCard: 'Expensify Card',
@@ -2024,7 +2011,6 @@ const translations = {
cardLastFour: '卡号末尾为',
addFirstPaymentMethod: '添加支付方式以便直接在应用中发送和接收付款。',
defaultPaymentMethod: '默认',
- bankAccountLastFour: ({lastFour}: BankAccountLastFourParams) => `银行账户 • ${lastFour}`,
},
preferencesPage: {
appSection: {
diff --git a/src/libs/API/parameters/MoveIOUReportToExistingPolicyParams.ts b/src/libs/API/parameters/MoveIOUReportToExistingPolicyParams.ts
index de125c916e8c1..a72c7ff4f5521 100644
--- a/src/libs/API/parameters/MoveIOUReportToExistingPolicyParams.ts
+++ b/src/libs/API/parameters/MoveIOUReportToExistingPolicyParams.ts
@@ -2,7 +2,6 @@ type MoveIOUReportToExistingPolicyParams = {
iouReportID: string;
policyID: string;
changePolicyReportActionID: string;
- dmMovedReportActionID: string;
};
export default MoveIOUReportToExistingPolicyParams;
diff --git a/src/libs/API/parameters/MoveIOUReportToPolicyAndInviteSubmitterParams.ts b/src/libs/API/parameters/MoveIOUReportToPolicyAndInviteSubmitterParams.ts
index 9595493ec9bb1..4868b9d60ab80 100644
--- a/src/libs/API/parameters/MoveIOUReportToPolicyAndInviteSubmitterParams.ts
+++ b/src/libs/API/parameters/MoveIOUReportToPolicyAndInviteSubmitterParams.ts
@@ -4,7 +4,6 @@ type MoveIOUReportToPolicyAndInviteSubmitterParams = {
policyExpenseChatReportID: string;
policyExpenseCreatedReportActionID: string;
changePolicyReportActionID: string;
- dmMovedReportActionID: string;
};
export default MoveIOUReportToPolicyAndInviteSubmitterParams;
diff --git a/src/libs/DebugUtils.ts b/src/libs/DebugUtils.ts
index 5b8ba052f5497..466d187ff6a89 100644
--- a/src/libs/DebugUtils.ts
+++ b/src/libs/DebugUtils.ts
@@ -817,8 +817,6 @@ function validateReportActionDraftProperty(key: keyof ReportAction, value: strin
...CONST.REPORT.ACTIONABLE_REPORT_MENTION_WHISPER_RESOLUTION,
},
deleted: 'string',
- bankAccountID: 'string',
- payAsBusiness: 'string',
}),
() =>
validateObject>(value, {
@@ -902,8 +900,6 @@ function validateReportActionDraftProperty(key: keyof ReportAction, value: strin
expenseReportID: 'string',
resolution: 'string',
deleted: 'string',
- bankAccountID: 'string',
- payAsBusiness: 'string',
}),
);
}
diff --git a/src/libs/IOUUtils.ts b/src/libs/IOUUtils.ts
index a9687da48c583..e7b50ef35c791 100644
--- a/src/libs/IOUUtils.ts
+++ b/src/libs/IOUUtils.ts
@@ -1,11 +1,10 @@
import Onyx from 'react-native-onyx';
-import type {OnyxEntry} from 'react-native-onyx';
import type {ValueOf} from 'type-fest';
import type {IOUAction, IOUType} from '@src/CONST';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
-import type {LastPaymentMethod, LastPaymentMethodType, OnyxInputOrEntry, PersonalDetails, Report} from '@src/types/onyx';
+import type {OnyxInputOrEntry, PersonalDetails, Report} from '@src/types/onyx';
import type {Attendee} from '@src/types/onyx/IOU';
import type {IOURequestType} from './actions/IOU';
import {getCurrencyUnit} from './CurrencyUtils';
@@ -21,12 +20,6 @@ Onyx.connect({
callback: (val) => (lastLocationPermissionPrompt = val ?? ''),
});
-let lastUsedPaymentMethods: OnyxEntry;
-Onyx.connect({
- key: ONYXKEYS.NVP_LAST_PAYMENT_METHOD,
- callback: (value) => (lastUsedPaymentMethods = value),
-});
-
function navigateToStartMoneyRequestStep(requestType: IOURequestType, iouType: IOUType, transactionID: string, reportID: string, iouAction?: IOUAction): void {
if (iouAction === CONST.IOU.ACTION.CATEGORIZE || iouAction === CONST.IOU.ACTION.SUBMIT || iouAction === CONST.IOU.ACTION.SHARE) {
Navigation.goBack();
@@ -223,18 +216,6 @@ function shouldStartLocationPermissionFlow() {
);
}
-function getLastUsedPaymentMethods() {
- return lastUsedPaymentMethods;
-}
-
-function getLastUsedPaymentMethod(policyID?: string): LastPaymentMethodType | undefined {
- if (!policyID) {
- return;
- }
-
- return lastUsedPaymentMethods?.[policyID] as LastPaymentMethodType;
-}
-
export {
calculateAmount,
insertTagIntoTransactionTagsString,
@@ -247,6 +228,4 @@ export {
formatCurrentUserToAttendee,
shouldStartLocationPermissionFlow,
navigateToParticipantPage,
- getLastUsedPaymentMethods,
- getLastUsedPaymentMethod,
};
diff --git a/src/libs/MoneyRequestReportUtils.ts b/src/libs/MoneyRequestReportUtils.ts
index e3874de8a2533..8e637da4959d4 100644
--- a/src/libs/MoneyRequestReportUtils.ts
+++ b/src/libs/MoneyRequestReportUtils.ts
@@ -142,7 +142,7 @@ const getTotalAmountForIOUReportPreviewButton = (report: OnyxEntry, poli
}
// We shouldn't display the nonHeldAmount as the default option if it's not valid since we cannot pay partially in this case
- if (hasHeldExpensesReportUtils(report?.reportID) && canAllowSettlement && hasValidNonHeldAmount && !hasOnlyHeldExpenses) {
+ if (hasHeldExpensesReportUtils(report?.reportID) && canAllowSettlement && hasValidNonHeldAmount) {
return nonHeldAmount;
}
diff --git a/src/libs/PaymentUtils.ts b/src/libs/PaymentUtils.ts
index ef9abddd2b7b6..97b35e51c311a 100644
--- a/src/libs/PaymentUtils.ts
+++ b/src/libs/PaymentUtils.ts
@@ -159,7 +159,7 @@ const isSecondaryActionAPaymentOption = (item: PopoverMenuItem): item is Payment
return false;
}
const payment = item.value as SecondaryActionOption['value'] | PaymentOrApproveOption['value'];
- const isPaymentInArray = Object.values({...CONST.IOU.PAYMENT_TYPE, ...CONST.PAYMENT_METHODS}).filter((type) => type === payment);
+ const isPaymentInArray = Object.values(CONST.IOU.PAYMENT_TYPE).filter((type) => type === payment);
return isPaymentInArray.length > 0;
};
diff --git a/src/libs/PolicyUtils.ts b/src/libs/PolicyUtils.ts
index e4abd2304f661..d189dafd71108 100644
--- a/src/libs/PolicyUtils.ts
+++ b/src/libs/PolicyUtils.ts
@@ -256,9 +256,7 @@ function getPolicyRole(policy: OnyxInputOrEntry | SearchPolicy, currentU
return;
}
- const employeeRole = policy?.employeeList?.[currentUserLogin];
-
- return typeof employeeRole === 'string' ? employeeRole : employeeRole?.role;
+ return policy?.employeeList?.[currentUserLogin]?.role;
}
function getPolicyNameByID(policyID: string): string {
diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts
index 4f1e2d5e49cf6..a64ad53028311 100644
--- a/src/libs/ReportUtils.ts
+++ b/src/libs/ReportUtils.ts
@@ -372,8 +372,6 @@ type BuildOptimisticIOUReportActionParams = {
isOwnPolicyExpenseChat?: boolean;
created?: string;
linkedExpenseReportAction?: OnyxEntry;
- payAsBusiness?: boolean;
- bankAccountID?: number | undefined;
isPersonalTrackingExpense?: boolean;
};
@@ -1561,10 +1559,6 @@ function isIndividualInvoiceRoom(report: OnyxEntry): boolean {
return isInvoiceRoom(report) && report?.invoiceReceiver?.type === CONST.REPORT.INVOICE_RECEIVER_TYPE.INDIVIDUAL;
}
-function isBusinessInvoiceRoom(report: OnyxEntry): boolean {
- return isInvoiceRoom(report) && report?.invoiceReceiver?.type === CONST.REPORT.INVOICE_RECEIVER_TYPE.BUSINESS;
-}
-
function isCurrentUserInvoiceReceiver(report: OnyxEntry): boolean {
if (report?.invoiceReceiver?.type === CONST.REPORT.INVOICE_RECEIVER_TYPE.INDIVIDUAL) {
return currentUserAccountID === report.invoiceReceiver.accountID;
@@ -4574,9 +4568,7 @@ function getReportPreviewMessage(
});
}
- const reportPolicy = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`];
-
- let linkedTransaction;
+ let linkedTransaction: OnyxEntry;
if (!isEmptyObject(iouReportAction) && shouldConsiderScanningReceiptOrPendingRoute && iouReportAction && isMoneyRequestAction(iouReportAction)) {
linkedTransaction = getLinkedTransaction(iouReportAction);
}
@@ -4607,22 +4599,13 @@ function getReportPreviewMessage(
if (originalMessage?.automaticAction) {
translatePhraseKey = 'iou.automaticallyPaidWithExpensify';
}
-
- if (originalMessage?.paymentType === CONST.IOU.PAYMENT_TYPE.VBBA) {
- translatePhraseKey = 'iou.businessBankAccount';
- }
}
let actualPayerName = report.managerID === currentUserAccountID ? '' : getDisplayNameForParticipant({accountID: report.managerID, shouldUseShortForm: true});
-
actualPayerName = actualPayerName && isForListPreview && !isPreviewMessageForParentChatReport ? `${actualPayerName}:` : actualPayerName;
const payerDisplayName = isPreviewMessageForParentChatReport ? payerName : actualPayerName;
- return translateLocal(translatePhraseKey, {
- amount: formattedReimbursableAmount,
- payer: payerDisplayName ?? '',
- last4Digits: reportPolicy?.achAccount?.accountNumber?.slice(-4) ?? '',
- });
+ return translateLocal(translatePhraseKey, {amount: formattedReimbursableAmount, payer: payerDisplayName ?? ''});
}
if (report.isWaitingOnBankAccount) {
@@ -6157,22 +6140,9 @@ function getPolicyChangeMessage(action: ReportAction) {
* @param currency - IOU currency
* @param paymentType - IOU paymentMethodType. Can be oneOf(Elsewhere, Expensify)
* @param isSettlingUp - Whether we are settling up an IOU
- * @param bankAccountID - Bank account ID
- * @param payAsBusiness - Whether the payment is made as a business
*/
-function getIOUReportActionMessage(
- iouReportID: string,
- type: string,
- total: number,
- comment: string,
- currency: string,
- paymentType = '',
- isSettlingUp = false,
- bankAccountID?: number | undefined,
- payAsBusiness = false,
-): Message[] {
+function getIOUReportActionMessage(iouReportID: string, type: string, total: number, comment: string, currency: string, paymentType = '', isSettlingUp = false): Message[] {
const report = getReportOrDraftReport(iouReportID);
- const isInvoice = isInvoiceReport(report);
const amount =
type === CONST.IOU.REPORT_ACTION_TYPE.PAY && !isEmptyObject(report)
? convertToDisplayString(getMoneyRequestSpendBreakdown(report).totalDisplaySpend, currency)
@@ -6213,14 +6183,7 @@ function getIOUReportActionMessage(
iouMessage = `deleted the ${amount} expense${comment && ` for ${comment}`}`;
break;
case CONST.IOU.REPORT_ACTION_TYPE.PAY:
- if (isInvoice && isSettlingUp) {
- iouMessage =
- paymentType === CONST.IOU.PAYMENT_TYPE.ELSEWHERE
- ? translateLocal('iou.payElsewhere', {formattedAmount: amount})
- : translateLocal(payAsBusiness ? 'iou.settleInvoiceBusiness' : 'iou.settleInvoicePersonal', {amount, last4Digits: String(bankAccountID).slice(-4)});
- } else {
- iouMessage = isSettlingUp ? `paid ${amount}${paymentMethodMessage}` : `sent ${amount}${comment && ` for ${comment}`}${paymentMethodMessage}`;
- }
+ iouMessage = isSettlingUp ? `paid ${amount}${paymentMethodMessage}` : `sent ${amount}${comment && ` for ${comment}`}${paymentMethodMessage}`;
break;
case CONST.REPORT.ACTIONS.TYPE.SUBMITTED:
iouMessage = translateLocal('iou.expenseAmount', {formattedAmount: amount});
@@ -6271,8 +6234,6 @@ function buildOptimisticIOUReportAction(params: BuildOptimisticIOUReportActionPa
created = DateUtils.getDBTime(),
linkedExpenseReportAction,
isPersonalTrackingExpense = false,
- payAsBusiness,
- bankAccountID,
} = params;
const IOUReportID = isPersonalTrackingExpense ? undefined : iouReportID || generateReportID();
@@ -6284,8 +6245,6 @@ function buildOptimisticIOUReportAction(params: BuildOptimisticIOUReportActionPa
IOUTransactionID: transactionID,
IOUReportID,
type,
- payAsBusiness,
- bankAccountID,
};
const delegateAccountDetails = getPersonalDetailByEmail(delegateEmail);
@@ -6347,7 +6306,7 @@ function buildOptimisticIOUReportAction(params: BuildOptimisticIOUReportActionPa
},
],
avatar: getCurrentUserAvatar(),
- message: getIOUReportActionMessage(iouReportID, type, amount, comment, currency, paymentType, isSettlingUp, bankAccountID, payAsBusiness),
+ message: getIOUReportActionMessage(iouReportID, type, amount, comment, currency, paymentType, isSettlingUp),
};
const managerMcTestParticipant = participants.find((participant) => isSelectedManagerMcTest(participant.login));
@@ -9193,15 +9152,13 @@ function getTaskAssigneeChatOnyxData(
/**
* Return iou report action display message
*/
-function getIOUReportActionDisplayMessage(reportAction: OnyxEntry, transaction?: OnyxEntry, report?: Report): string {
+function getIOUReportActionDisplayMessage(reportAction: OnyxEntry, transaction?: OnyxEntry): string {
if (!isMoneyRequestAction(reportAction)) {
return '';
}
const originalMessage = getOriginalMessage(reportAction);
- const {IOUReportID, automaticAction, payAsBusiness} = originalMessage ?? {};
+ const {IOUReportID, automaticAction} = originalMessage ?? {};
const iouReport = getReportOrDraftReport(IOUReportID);
- const isInvoice = isInvoiceReport(iouReport);
-
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
@@ -9210,19 +9167,13 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry,
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) ?? '';
-
switch (originalMessage.paymentType) {
case CONST.IOU.PAYMENT_TYPE.ELSEWHERE:
translationKey = hasMissingInvoiceBankAccount(IOUReportID) ? 'iou.payerSettledWithMissingBankAccount' : 'iou.paidElsewhere';
break;
case CONST.IOU.PAYMENT_TYPE.EXPENSIFY:
case CONST.IOU.PAYMENT_TYPE.VBBA:
- if (isInvoice) {
- return translateLocal(payAsBusiness ? 'iou.settleInvoiceBusiness' : 'iou.settleInvoicePersonal', {amount: formattedAmount, last4Digits});
- }
- translationKey = 'iou.businessBankAccount';
+ translationKey = 'iou.paidWithExpensify';
if (automaticAction) {
translationKey = 'iou.automaticallyPaidWithExpensify';
}
@@ -9231,8 +9182,7 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry,
translationKey = 'iou.payerPaidAmount';
break;
}
-
- return translateLocal(translationKey, {amount: formattedAmount, payer: '', last4Digits});
+ return translateLocal(translationKey, {amount: formattedAmount, payer: ''});
}
const amount = getTransactionAmount(transaction, !isEmptyObject(iouReport) && isExpenseReport(iouReport)) ?? 0;
@@ -11492,7 +11442,6 @@ export {
generateReportName,
navigateToLinkedReportAction,
buildOptimisticUnreportedTransactionAction,
- isBusinessInvoiceRoom,
buildOptimisticResolvedDuplicatesReportAction,
getTitleReportField,
getReportFieldsByPolicyID,
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;
}
diff --git a/src/libs/actions/BankAccounts.ts b/src/libs/actions/BankAccounts.ts
index 5bd7d61393e07..7775adf878628 100644
--- a/src/libs/actions/BankAccounts.ts
+++ b/src/libs/actions/BankAccounts.ts
@@ -17,10 +17,8 @@ import type {SaveCorpayOnboardingCompanyDetails} from '@libs/API/parameters/Save
import type SaveCorpayOnboardingDirectorInformationParams from '@libs/API/parameters/SaveCorpayOnboardingDirectorInformationParams';
import {READ_COMMANDS, SIDE_EFFECT_REQUEST_COMMANDS, WRITE_COMMANDS} from '@libs/API/types';
import {getMicroSecondOnyxErrorWithTranslationKey} from '@libs/ErrorUtils';
-import {getLastUsedPaymentMethod} from '@libs/IOUUtils';
import {translateLocal} from '@libs/Localize';
import Navigation from '@libs/Navigation/Navigation';
-import {getPersonalPolicy} from '@libs/PolicyUtils';
import CONST from '@src/CONST';
import type {Country} from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
@@ -28,7 +26,6 @@ import ROUTES from '@src/ROUTES';
import type {Route} from '@src/ROUTES';
import type {InternationalBankAccountForm, PersonalBankAccountForm} from '@src/types/form';
import type {ACHContractStepProps, BeneficialOwnersStepProps, CompanyStepProps, ReimbursementAccountForm, RequestorStepProps} from '@src/types/form/ReimbursementAccountForm';
-import type {LastPaymentMethod, LastPaymentMethodType} from '@src/types/onyx';
import type PlaidBankAccount from '@src/types/onyx/PlaidBankAccount';
import type {BankAccountStep, ReimbursementAccountStep, ReimbursementAccountSubStep} from '@src/types/onyx/ReimbursementAccount';
import type {OnyxData} from '@src/types/onyx/Request';
@@ -196,27 +193,7 @@ function connectBankAccountWithPlaid(bankAccountID: number, selectedPlaidBankAcc
policyID,
};
- const onyxData = getVBBADataForOnyx();
- const lastUsedPaymentMethod = getLastUsedPaymentMethod(policyID);
-
- if (!lastUsedPaymentMethod?.expense?.name) {
- onyxData.successData?.push({
- onyxMethod: Onyx.METHOD.MERGE,
- key: ONYXKEYS.NVP_LAST_PAYMENT_METHOD,
- value: {
- [policyID]: {
- expense: {
- name: CONST.IOU.PAYMENT_TYPE.VBBA,
- },
- lastUsed: {
- name: lastUsedPaymentMethod?.lastUsed?.name ?? CONST.IOU.PAYMENT_TYPE.VBBA,
- },
- },
- },
- });
- }
-
- API.write(WRITE_COMMANDS.CONNECT_BANK_ACCOUNT_WITH_PLAID, parameters, onyxData);
+ API.write(WRITE_COMMANDS.CONNECT_BANK_ACCOUNT_WITH_PLAID, parameters, getVBBADataForOnyx());
}
/**
@@ -242,9 +219,6 @@ function addPersonalBankAccount(account: PlaidBankAccount, policyID?: string, so
parameters.source = source;
}
- const personalPolicy = getPersonalPolicy();
- const lastUsedPaymentMethod = getLastUsedPaymentMethod(personalPolicy?.id);
-
const onyxData: OnyxData = {
optimisticData: [
{
@@ -287,52 +261,12 @@ function addPersonalBankAccount(account: PlaidBankAccount, policyID?: string, so
],
};
- if (personalPolicy?.id && !lastUsedPaymentMethod) {
- onyxData.optimisticData?.push({
- onyxMethod: Onyx.METHOD.MERGE,
- key: ONYXKEYS.NVP_LAST_PAYMENT_METHOD,
- value: {
- [personalPolicy?.id]: {
- iou: {
- name: CONST.IOU.PAYMENT_TYPE.EXPENSIFY,
- },
- lastUsed: {
- name: CONST.IOU.PAYMENT_TYPE.EXPENSIFY,
- },
- },
- },
- });
- onyxData.successData?.push({
- onyxMethod: Onyx.METHOD.MERGE,
- key: ONYXKEYS.NVP_LAST_PAYMENT_METHOD,
- value: {
- [personalPolicy?.id]: {
- iou: {
- name: CONST.IOU.PAYMENT_TYPE.EXPENSIFY,
- },
- lastUsed: {
- name: CONST.IOU.PAYMENT_TYPE.EXPENSIFY,
- },
- },
- },
- });
- onyxData.failureData?.push({
- onyxMethod: Onyx.METHOD.MERGE,
- key: ONYXKEYS.NVP_LAST_PAYMENT_METHOD,
- value: {
- [personalPolicy?.id]: null,
- },
- });
- }
-
API.write(WRITE_COMMANDS.ADD_PERSONAL_BANK_ACCOUNT, parameters, onyxData);
}
-function deletePaymentBankAccount(bankAccountID: number, lastUsedPaymentMethods?: LastPaymentMethod) {
+function deletePaymentBankAccount(bankAccountID: number) {
const parameters: DeletePaymentBankAccountParams = {bankAccountID};
- const personalPolicy = getPersonalPolicy();
-
const onyxData: OnyxData = {
optimisticData: [
{
@@ -353,50 +287,6 @@ function deletePaymentBankAccount(bankAccountID: number, lastUsedPaymentMethods?
],
};
- Object.keys(lastUsedPaymentMethods ?? {}).forEach((paymentMethodID) => {
- const lastUsedPaymentMethod = lastUsedPaymentMethods?.[paymentMethodID] as LastPaymentMethodType;
-
- if (personalPolicy?.id === paymentMethodID && lastUsedPaymentMethod.iou.name === CONST.IOU.PAYMENT_TYPE.EXPENSIFY) {
- const revertedLastUsedPaymentMethod = lastUsedPaymentMethod.lastUsed.name !== CONST.IOU.PAYMENT_TYPE.EXPENSIFY ? lastUsedPaymentMethod.lastUsed.name : null;
-
- onyxData.successData?.push({
- onyxMethod: Onyx.METHOD.MERGE,
- key: ONYXKEYS.NVP_LAST_PAYMENT_METHOD,
- value: {
- [personalPolicy?.id]: revertedLastUsedPaymentMethod,
- },
- });
-
- onyxData.failureData?.push({
- onyxMethod: Onyx.METHOD.MERGE,
- key: ONYXKEYS.NVP_LAST_PAYMENT_METHOD,
- value: {
- [personalPolicy?.id]: lastUsedPaymentMethod.iou.name,
- },
- });
- }
-
- if (lastUsedPaymentMethod?.expense?.name === CONST.IOU.PAYMENT_TYPE.VBBA) {
- const revertedLastUsedPaymentMethod = lastUsedPaymentMethod.lastUsed.name !== CONST.IOU.PAYMENT_TYPE.VBBA ? lastUsedPaymentMethod.lastUsed.name : null;
-
- onyxData.successData?.push({
- onyxMethod: Onyx.METHOD.MERGE,
- key: ONYXKEYS.NVP_LAST_PAYMENT_METHOD,
- value: {
- [paymentMethodID]: revertedLastUsedPaymentMethod,
- },
- });
-
- onyxData.failureData?.push({
- onyxMethod: Onyx.METHOD.MERGE,
- key: ONYXKEYS.NVP_LAST_PAYMENT_METHOD,
- value: {
- [paymentMethodID]: lastUsedPaymentMethod.expense.name,
- },
- });
- }
- });
-
API.write(WRITE_COMMANDS.DELETE_PAYMENT_BANK_ACCOUNT, parameters, onyxData);
}
diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts
index 42b2f7e5ae41b..26350aad97662 100644
--- a/src/libs/actions/IOU.ts
+++ b/src/libs/actions/IOU.ts
@@ -48,7 +48,6 @@ import GoogleTagManager from '@libs/GoogleTagManager';
import {
calculateAmount as calculateIOUAmount,
formatCurrentUserToAttendee,
- getLastUsedPaymentMethod,
isMovingTransactionFromTrackExpense as isMovingTransactionFromTrackExpenseIOUUtils,
navigateToStartMoneyRequestStep,
updateIOUOwnerAndTotal,
@@ -8802,8 +8801,6 @@ function getPayMoneyRequestParams(
paymentMethodType: PaymentMethodType,
full: boolean,
payAsBusiness?: boolean,
- bankAccountID?: number,
- paymentPolicyID?: string | undefined,
): PayMoneyRequestData {
const isInvoiceReport = isInvoiceReportReportUtils(iouReport);
// This will be fixed as part of https://github.com/Expensify/Expensify/issues/507850
@@ -8870,8 +8867,6 @@ function getPayMoneyRequestParams(
paymentType: paymentMethodType,
iouReportID: iouReport?.reportID,
isSettlingUp: true,
- payAsBusiness,
- bankAccountID,
});
// In some instances, the report preview action might not be available to the payer (only whispered to the requestor)
@@ -8944,24 +8939,12 @@ function getPayMoneyRequestParams(
);
if (iouReport?.policyID) {
- const lastUsedPaymentMethod = (getLastUsedPaymentMethod(iouReport.policyID) ?? {}) as OnyxTypes.LastPaymentMethodType;
- const prevLastUsedPaymentMethod = lastUsedPaymentMethod?.lastUsed?.name;
- const usedPaymentOption = paymentPolicyID ?? paymentMethodType;
-
- const optimisticLastPaymentMethod = {
- [iouReport.policyID]: {
- ...(iouReport.type ? {[iouReport.type]: {name: usedPaymentOption}} : {}),
- ...(isInvoiceReport ? {invoice: {name: paymentMethodType, bankAccountID}} : {}),
- lastUsed: {
- name: prevLastUsedPaymentMethod !== usedPaymentOption && !!prevLastUsedPaymentMethod ? prevLastUsedPaymentMethod : usedPaymentOption,
- },
- },
- };
-
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.NVP_LAST_PAYMENT_METHOD,
- value: optimisticLastPaymentMethod,
+ value: {
+ [iouReport.policyID]: paymentMethodType,
+ },
});
}
@@ -10206,7 +10189,7 @@ function completePaymentOnboarding(paymentSelected: ValueOf, paymentPolicyID?: string, full = true) {
+function payMoneyRequest(paymentType: PaymentMethodType, chatReport: OnyxTypes.Report, iouReport: OnyxEntry, full = true) {
if (chatReport.policyID && shouldRestrictUserBillableActions(chatReport.policyID)) {
Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(chatReport.policyID));
return;
@@ -10216,7 +10199,7 @@ function payMoneyRequest(paymentType: PaymentMethodType, chatReport: OnyxTypes.R
completePaymentOnboarding(paymentSelected);
const recipient = {accountID: iouReport?.ownerAccountID ?? CONST.DEFAULT_NUMBER_ID};
- const {params, optimisticData, successData, failureData} = getPayMoneyRequestParams(chatReport, iouReport, recipient, paymentType, full, undefined, undefined, paymentPolicyID);
+ const {params, optimisticData, successData, failureData} = getPayMoneyRequestParams(chatReport, iouReport, recipient, paymentType, full);
// For now, we need to call the PayMoneyRequestWithWallet API since PayMoneyRequest was not updated to work with
// Expensify Wallets.
@@ -10252,7 +10235,7 @@ function payInvoice(
ownerEmail,
policyName,
},
- } = getPayMoneyRequestParams(chatReport, invoiceReport, recipient, paymentMethodType, true, payAsBusiness, methodID);
+ } = getPayMoneyRequestParams(chatReport, invoiceReport, recipient, paymentMethodType, true, payAsBusiness);
const paymentSelected = paymentMethodType === CONST.IOU.PAYMENT_TYPE.VBBA ? CONST.IOU.PAYMENT_SELECTED.BBA : CONST.IOU.PAYMENT_SELECTED.PBA;
completePaymentOnboarding(paymentSelected);
@@ -11014,17 +10997,9 @@ function checkIfScanFileCanBeRead(
return readFileAsync(receiptPath.toString(), receiptFilename, onSuccess, onFailure, receiptType);
}
-/** Save the preferred payment method for a policy or personal DM */
-function savePreferredPaymentMethod(policyID: string | undefined, paymentMethod: string, type: ValueOf | undefined) {
- if (!policyID) {
- return;
- }
-
- // to make it easier to revert to the previous last payment method, we will save it to this key
- const prevPaymentMethod = (getLastUsedPaymentMethod(policyID) ?? {}) as OnyxTypes.LastPaymentMethodType;
- Onyx.merge(`${ONYXKEYS.NVP_LAST_PAYMENT_METHOD}`, {
- [policyID]: type ? {[type]: {name: paymentMethod}, [CONST.LAST_PAYMENT_METHOD.LAST_USED]: {name: prevPaymentMethod?.lastUsed?.name ?? paymentMethod}} : paymentMethod,
- });
+/** Save the preferred payment method for a policy */
+function savePreferredPaymentMethod(policyID: string, paymentMethod: PaymentMethodType, type: ValueOf | undefined) {
+ Onyx.merge(`${ONYXKEYS.NVP_LAST_PAYMENT_METHOD}`, {[policyID]: type ? {[type]: paymentMethod, [CONST.LAST_PAYMENT_METHOD.LAST_USED]: {name: paymentMethod}} : paymentMethod});
}
/** Get report policy id of IOU request */
diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts
index 460b8085c45f3..61ff0823a49ed 100644
--- a/src/libs/actions/Policy/Policy.ts
+++ b/src/libs/actions/Policy/Policy.ts
@@ -67,7 +67,6 @@ import * as ErrorUtils from '@libs/ErrorUtils';
import {createFile} from '@libs/fileDownload/FileUtils';
import getIsNarrowLayout from '@libs/getIsNarrowLayout';
import GoogleTagManager from '@libs/GoogleTagManager';
-import {getLastUsedPaymentMethod} from '@libs/IOUUtils';
import {translate, translateLocal} from '@libs/Localize';
import Log from '@libs/Log';
import * as NetworkStore from '@libs/Network/NetworkStore';
@@ -465,33 +464,6 @@ function deleteWorkspace(policyID: string, policyName: string) {
},
});
- Object.values(allReports ?? {})
- .filter((iouReport) => iouReport?.type === CONST.REPORT.TYPE.IOU)
- .forEach((iouReport) => {
- const lastUsedPaymentMethod = getLastUsedPaymentMethod(iouReport?.policyID);
-
- if (!lastUsedPaymentMethod || !iouReport?.policyID) {
- return;
- }
-
- if (lastUsedPaymentMethod?.iou?.name === policyID) {
- optimisticData.push({
- onyxMethod: Onyx.METHOD.MERGE,
- key: ONYXKEYS.NVP_LAST_PAYMENT_METHOD,
- value: {
- [iouReport?.policyID]: {
- iou: {
- name: policyID !== lastUsedPaymentMethod?.iou?.name ? lastUsedPaymentMethod?.iou?.name : '',
- },
- lastUsed: {
- name: policyID !== lastUsedPaymentMethod?.iou?.name ? lastUsedPaymentMethod?.iou?.name : '',
- },
- },
- },
- });
- }
- });
-
if (report?.iouReportID) {
const reportTransactions = ReportUtils.getReportTransactions(report.iouReportID);
for (const transaction of reportTransactions) {
@@ -2201,34 +2173,6 @@ function buildPolicyData(options: BuildPolicyDataOptions = {}) {
successData.push(...optimisticCategoriesData.successData);
}
- if (getAdminPolicies().length === 0) {
- Object.values(allReports ?? {})
- .filter((iouReport) => iouReport?.type === CONST.REPORT.TYPE.IOU)
- .forEach((iouReport) => {
- const lastUsedPaymentMethod = getLastUsedPaymentMethod(iouReport?.policyID);
-
- // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
- if (lastUsedPaymentMethod?.iou?.name || !iouReport?.policyID) {
- return;
- }
-
- successData.push({
- onyxMethod: Onyx.METHOD.MERGE,
- key: ONYXKEYS.NVP_LAST_PAYMENT_METHOD,
- value: {
- [iouReport?.policyID]: {
- iou: {
- name: policyID,
- },
- lastUsed: {
- name: policyID,
- },
- },
- },
- });
- });
- }
-
// We need to clone the file to prevent non-indexable errors.
const clonedFile = file ? (createFile(file) as File) : undefined;
diff --git a/src/libs/actions/ReimbursementAccount/resetUSDBankAccount.ts b/src/libs/actions/ReimbursementAccount/resetUSDBankAccount.ts
index e88606bc1a806..e014db04386f7 100644
--- a/src/libs/actions/ReimbursementAccount/resetUSDBankAccount.ts
+++ b/src/libs/actions/ReimbursementAccount/resetUSDBankAccount.ts
@@ -2,12 +2,10 @@ import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import Onyx from 'react-native-onyx';
import * as API from '@libs/API';
import {WRITE_COMMANDS} from '@libs/API/types';
-import {getLastUsedPaymentMethod} from '@libs/IOUUtils';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import INPUT_IDS from '@src/types/form/ReimbursementAccountForm';
import type * as OnyxTypes from '@src/types/onyx';
-import type {OnyxData} from '@src/types/onyx/Request';
let allPolicies: OnyxCollection;
Onyx.connect({
@@ -28,142 +26,120 @@ function resetUSDBankAccount(bankAccountID: number | undefined, session: OnyxEnt
}
const policy = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${policyID}`] ?? ({} as OnyxTypes.Policy);
- const lastUsedPaymentMethod = getLastUsedPaymentMethod(policy.id);
- const isLastUsedPaymentMethodBBA = lastUsedPaymentMethod?.expense?.name === CONST.IOU.PAYMENT_TYPE.VBBA;
- const isPreviousLastUsedPaymentMethodBBA = lastUsedPaymentMethod?.lastUsed?.name === CONST.IOU.PAYMENT_TYPE.VBBA;
- const onyxData: OnyxData = {
- optimisticData: [
- {
- onyxMethod: Onyx.METHOD.MERGE,
- key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
- value: {
- shouldShowResetModal: false,
- isLoading: true,
- pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
- achData: null,
+ API.write(
+ WRITE_COMMANDS.RESTART_BANK_ACCOUNT_SETUP,
+ {
+ bankAccountID,
+ ownerEmail: session.email,
+ policyID,
+ },
+ {
+ optimisticData: [
+ {
+ onyxMethod: Onyx.METHOD.MERGE,
+ key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
+ value: {
+ shouldShowResetModal: false,
+ isLoading: true,
+ pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
+ achData: null,
+ },
},
- },
- {
- onyxMethod: Onyx.METHOD.MERGE,
- key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
- value: {
- achAccount: null,
+ {
+ onyxMethod: Onyx.METHOD.MERGE,
+ key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
+ value: {
+ achAccount: null,
+ },
},
- },
- ],
- successData: [
- {
- onyxMethod: Onyx.METHOD.SET,
- key: ONYXKEYS.ONFIDO_TOKEN,
- value: '',
- },
- {
- onyxMethod: Onyx.METHOD.SET,
- key: ONYXKEYS.ONFIDO_APPLICANT_ID,
- value: '',
- },
- {
- onyxMethod: Onyx.METHOD.SET,
- key: ONYXKEYS.PLAID_DATA,
- value: CONST.PLAID.DEFAULT_DATA,
- },
- {
- onyxMethod: Onyx.METHOD.SET,
- key: ONYXKEYS.PLAID_LINK_TOKEN,
- value: '',
- },
- {
- onyxMethod: Onyx.METHOD.SET,
- key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
- value: CONST.REIMBURSEMENT_ACCOUNT.DEFAULT_DATA,
- },
- {
- onyxMethod: Onyx.METHOD.SET,
- key: ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM_DRAFT,
- value: {
- [INPUT_IDS.BENEFICIAL_OWNER_INFO_STEP.OWNS_MORE_THAN_25_PERCENT]: false,
- [INPUT_IDS.BENEFICIAL_OWNER_INFO_STEP.HAS_OTHER_BENEFICIAL_OWNERS]: false,
- [INPUT_IDS.BENEFICIAL_OWNER_INFO_STEP.BENEFICIAL_OWNERS]: '',
- [INPUT_IDS.BANK_INFO_STEP.ACCOUNT_NUMBER]: '',
- [INPUT_IDS.BANK_INFO_STEP.ROUTING_NUMBER]: '',
- [INPUT_IDS.BANK_INFO_STEP.PLAID_ACCOUNT_ID]: '',
- [INPUT_IDS.BANK_INFO_STEP.PLAID_MASK]: '',
- [INPUT_IDS.BUSINESS_INFO_STEP.COMPANY_NAME]: '',
- [INPUT_IDS.BUSINESS_INFO_STEP.STREET]: '',
- [INPUT_IDS.BUSINESS_INFO_STEP.CITY]: '',
- [INPUT_IDS.BUSINESS_INFO_STEP.STATE]: '',
- [INPUT_IDS.BUSINESS_INFO_STEP.ZIP_CODE]: '',
- [INPUT_IDS.BUSINESS_INFO_STEP.COMPANY_PHONE]: '',
- [INPUT_IDS.BUSINESS_INFO_STEP.COMPANY_WEBSITE]: undefined,
- [INPUT_IDS.BUSINESS_INFO_STEP.COMPANY_TAX_ID]: '',
- [INPUT_IDS.BUSINESS_INFO_STEP.INCORPORATION_TYPE]: '',
- [INPUT_IDS.BUSINESS_INFO_STEP.INCORPORATION_DATE]: '',
- [INPUT_IDS.BUSINESS_INFO_STEP.INCORPORATION_STATE]: '',
- [INPUT_IDS.BUSINESS_INFO_STEP.HAS_NO_CONNECTION_TO_CANNABIS]: false,
- [INPUT_IDS.PERSONAL_INFO_STEP.FIRST_NAME]: '',
- [INPUT_IDS.PERSONAL_INFO_STEP.LAST_NAME]: '',
- [INPUT_IDS.PERSONAL_INFO_STEP.STREET]: '',
- [INPUT_IDS.PERSONAL_INFO_STEP.CITY]: '',
- [INPUT_IDS.PERSONAL_INFO_STEP.STATE]: '',
- [INPUT_IDS.PERSONAL_INFO_STEP.ZIP_CODE]: '',
- [INPUT_IDS.PERSONAL_INFO_STEP.IS_ONFIDO_SETUP_COMPLETE]: false,
- [INPUT_IDS.PERSONAL_INFO_STEP.DOB]: '',
- [INPUT_IDS.PERSONAL_INFO_STEP.SSN_LAST_4]: '',
- [INPUT_IDS.COMPLETE_VERIFICATION.ACCEPT_TERMS_AND_CONDITIONS]: false,
- [INPUT_IDS.COMPLETE_VERIFICATION.CERTIFY_TRUE_INFORMATION]: false,
- [INPUT_IDS.COMPLETE_VERIFICATION.IS_AUTHORIZED_TO_USE_BANK_ACCOUNT]: false,
- [INPUT_IDS.BANK_INFO_STEP.IS_SAVINGS]: false,
- [INPUT_IDS.BANK_INFO_STEP.BANK_NAME]: '',
- [INPUT_IDS.BANK_INFO_STEP.PLAID_ACCESS_TOKEN]: '',
- [INPUT_IDS.BANK_INFO_STEP.SELECTED_PLAID_ACCOUNT_ID]: '',
- [INPUT_IDS.AMOUNT1]: '',
- [INPUT_IDS.AMOUNT2]: '',
- [INPUT_IDS.AMOUNT3]: '',
+ ],
+ successData: [
+ {
+ onyxMethod: Onyx.METHOD.SET,
+ key: ONYXKEYS.ONFIDO_TOKEN,
+ value: '',
},
- },
- ],
- failureData: [
- {
- onyxMethod: Onyx.METHOD.MERGE,
- key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
- value: {isLoading: false, pendingAction: null},
- },
- {
- onyxMethod: Onyx.METHOD.MERGE,
- key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
- value: {
- achAccount: policy?.achAccount,
+ {
+ onyxMethod: Onyx.METHOD.SET,
+ key: ONYXKEYS.ONFIDO_APPLICANT_ID,
+ value: '',
},
- },
- ],
- };
-
- if (isLastUsedPaymentMethodBBA && policyID) {
- onyxData.successData?.push({
- onyxMethod: Onyx.METHOD.MERGE,
- key: ONYXKEYS.NVP_LAST_PAYMENT_METHOD,
- value: {
- [policyID]: {
- expense: {
- name: isPreviousLastUsedPaymentMethodBBA ? '' : lastUsedPaymentMethod?.lastUsed.name,
+ {
+ onyxMethod: Onyx.METHOD.SET,
+ key: ONYXKEYS.PLAID_DATA,
+ value: CONST.PLAID.DEFAULT_DATA,
+ },
+ {
+ onyxMethod: Onyx.METHOD.SET,
+ key: ONYXKEYS.PLAID_LINK_TOKEN,
+ value: '',
+ },
+ {
+ onyxMethod: Onyx.METHOD.SET,
+ key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
+ value: CONST.REIMBURSEMENT_ACCOUNT.DEFAULT_DATA,
+ },
+ {
+ onyxMethod: Onyx.METHOD.SET,
+ key: ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM_DRAFT,
+ value: {
+ [INPUT_IDS.BENEFICIAL_OWNER_INFO_STEP.OWNS_MORE_THAN_25_PERCENT]: false,
+ [INPUT_IDS.BENEFICIAL_OWNER_INFO_STEP.HAS_OTHER_BENEFICIAL_OWNERS]: false,
+ [INPUT_IDS.BENEFICIAL_OWNER_INFO_STEP.BENEFICIAL_OWNERS]: '',
+ [INPUT_IDS.BANK_INFO_STEP.ACCOUNT_NUMBER]: '',
+ [INPUT_IDS.BANK_INFO_STEP.ROUTING_NUMBER]: '',
+ [INPUT_IDS.BANK_INFO_STEP.PLAID_ACCOUNT_ID]: '',
+ [INPUT_IDS.BANK_INFO_STEP.PLAID_MASK]: '',
+ [INPUT_IDS.BUSINESS_INFO_STEP.COMPANY_NAME]: '',
+ [INPUT_IDS.BUSINESS_INFO_STEP.STREET]: '',
+ [INPUT_IDS.BUSINESS_INFO_STEP.CITY]: '',
+ [INPUT_IDS.BUSINESS_INFO_STEP.STATE]: '',
+ [INPUT_IDS.BUSINESS_INFO_STEP.ZIP_CODE]: '',
+ [INPUT_IDS.BUSINESS_INFO_STEP.COMPANY_PHONE]: '',
+ [INPUT_IDS.BUSINESS_INFO_STEP.COMPANY_WEBSITE]: undefined,
+ [INPUT_IDS.BUSINESS_INFO_STEP.COMPANY_TAX_ID]: '',
+ [INPUT_IDS.BUSINESS_INFO_STEP.INCORPORATION_TYPE]: '',
+ [INPUT_IDS.BUSINESS_INFO_STEP.INCORPORATION_DATE]: '',
+ [INPUT_IDS.BUSINESS_INFO_STEP.INCORPORATION_STATE]: '',
+ [INPUT_IDS.BUSINESS_INFO_STEP.HAS_NO_CONNECTION_TO_CANNABIS]: false,
+ [INPUT_IDS.PERSONAL_INFO_STEP.FIRST_NAME]: '',
+ [INPUT_IDS.PERSONAL_INFO_STEP.LAST_NAME]: '',
+ [INPUT_IDS.PERSONAL_INFO_STEP.STREET]: '',
+ [INPUT_IDS.PERSONAL_INFO_STEP.CITY]: '',
+ [INPUT_IDS.PERSONAL_INFO_STEP.STATE]: '',
+ [INPUT_IDS.PERSONAL_INFO_STEP.ZIP_CODE]: '',
+ [INPUT_IDS.PERSONAL_INFO_STEP.IS_ONFIDO_SETUP_COMPLETE]: false,
+ [INPUT_IDS.PERSONAL_INFO_STEP.DOB]: '',
+ [INPUT_IDS.PERSONAL_INFO_STEP.SSN_LAST_4]: '',
+ [INPUT_IDS.COMPLETE_VERIFICATION.ACCEPT_TERMS_AND_CONDITIONS]: false,
+ [INPUT_IDS.COMPLETE_VERIFICATION.CERTIFY_TRUE_INFORMATION]: false,
+ [INPUT_IDS.COMPLETE_VERIFICATION.IS_AUTHORIZED_TO_USE_BANK_ACCOUNT]: false,
+ [INPUT_IDS.BANK_INFO_STEP.IS_SAVINGS]: false,
+ [INPUT_IDS.BANK_INFO_STEP.BANK_NAME]: '',
+ [INPUT_IDS.BANK_INFO_STEP.PLAID_ACCESS_TOKEN]: '',
+ [INPUT_IDS.BANK_INFO_STEP.SELECTED_PLAID_ACCOUNT_ID]: '',
+ [INPUT_IDS.AMOUNT1]: '',
+ [INPUT_IDS.AMOUNT2]: '',
+ [INPUT_IDS.AMOUNT3]: '',
},
- lastUsed: {
- name: isPreviousLastUsedPaymentMethodBBA ? '' : lastUsedPaymentMethod?.lastUsed.name,
+ },
+ ],
+ failureData: [
+ {
+ onyxMethod: Onyx.METHOD.MERGE,
+ key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
+ value: {isLoading: false, pendingAction: null},
+ },
+ {
+ onyxMethod: Onyx.METHOD.MERGE,
+ key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
+ value: {
+ achAccount: policy?.achAccount,
},
},
- },
- });
- }
-
- API.write(
- WRITE_COMMANDS.RESTART_BANK_ACCOUNT_SETUP,
- {
- bankAccountID,
- ownerEmail: session.email,
- policyID,
+ ],
},
- onyxData,
);
}
diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts
index 4fad51b2f95f5..b51731deb8cdc 100644
--- a/src/libs/actions/Report.ts
+++ b/src/libs/actions/Report.ts
@@ -105,7 +105,6 @@ import {
buildOptimisticExportIntegrationAction,
buildOptimisticGroupChatReport,
buildOptimisticIOUReportAction,
- buildOptimisticMovedReportAction,
buildOptimisticRenamedRoomReportAction,
buildOptimisticReportPreview,
buildOptimisticRoomDescriptionUpdatedReportAction,
@@ -4974,9 +4973,8 @@ function deleteAppReport(reportID: string | undefined) {
* Moves an IOU report to a policy by converting it to an expense report
* @param reportID - The ID of the IOU report to move
* @param policyID - The ID of the policy to move the report to
- * @param isFromSettlementButton - Whether the action is from report preview
*/
-function moveIOUReportToPolicy(reportID: string, policyID: string, isFromSettlementButton?: boolean) {
+function moveIOUReportToPolicy(reportID: string, policyID: string) {
const iouReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];
// This will be fixed as part of https://github.com/Expensify/Expensify/issues/507850
// eslint-disable-next-line deprecation/deprecation
@@ -4989,7 +4987,7 @@ function moveIOUReportToPolicy(reportID: string, policyID: string, isFromSettlem
const isReimbursed = isReportManuallyReimbursed(iouReport);
// We do not want to create negative amount expenses
- if (!isReimbursed && ReportActionsUtils.hasRequestFromCurrentAccount(reportID, iouReport.managerID ?? CONST.DEFAULT_NUMBER_ID) && !isFromSettlementButton) {
+ if (!isReimbursed && ReportActionsUtils.hasRequestFromCurrentAccount(reportID, iouReport.managerID ?? CONST.DEFAULT_NUMBER_ID)) {
return;
}
@@ -5134,24 +5132,10 @@ function moveIOUReportToPolicy(reportID: string, policyID: string, isFromSettlem
},
});
- // Create the MOVED report action and add it to the DM chat which indicates to the user where the report has been moved
- const movedReportAction = buildOptimisticMovedReportAction(iouReport.policyID, policyID, expenseChatReportId, iouReportID, policyName);
- optimisticData.push({
- onyxMethod: Onyx.METHOD.MERGE,
- key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${oldChatReportID}`,
- value: {[movedReportAction.reportActionID]: movedReportAction},
- });
- failureData.push({
- onyxMethod: Onyx.METHOD.MERGE,
- key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${oldChatReportID}`,
- value: {[movedReportAction.reportActionID]: null},
- });
-
const parameters: MoveIOUReportToExistingPolicyParams = {
iouReportID,
policyID,
changePolicyReportActionID: changePolicyReportAction.reportActionID,
- dmMovedReportActionID: movedReportAction.reportActionID,
};
API.write(WRITE_COMMANDS.MOVE_IOU_REPORT_TO_EXISTING_POLICY, parameters, {optimisticData, successData, failureData});
@@ -5162,7 +5146,7 @@ function moveIOUReportToPolicy(reportID: string, policyID: string, isFromSettlem
* @param reportID - The ID of the IOU report to move
* @param policyID - The ID of the policy to move the report to
*/
-function moveIOUReportToPolicyAndInviteSubmitter(reportID: string, policyID: string): {policyExpenseChatReportID?: string} | undefined {
+function moveIOUReportToPolicyAndInviteSubmitter(reportID: string, policyID: string) {
const iouReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];
// This will be fixed as part of https://github.com/Expensify/Expensify/issues/507850
// eslint-disable-next-line deprecation/deprecation
@@ -5176,7 +5160,6 @@ function moveIOUReportToPolicyAndInviteSubmitter(reportID: string, policyID: str
const submitterAccountID = iouReport.ownerAccountID;
const submitterEmail = PersonalDetailsUtils.getLoginByAccountID(submitterAccountID ?? CONST.DEFAULT_NUMBER_ID);
const submitterLogin = PhoneNumber.addSMSDomainIfPhoneNumber(submitterEmail);
- const iouReportID = iouReport.reportID;
// This flow only works for admins moving an IOU report to a policy where the submitter is NOT yet a member of the policy
if (!isPolicyAdmin || !isIOUReportUsingReport(iouReport) || !submitterAccountID || !submitterEmail || isPolicyMember(submitterLogin, policyID)) {
@@ -5387,30 +5370,15 @@ function moveIOUReportToPolicyAndInviteSubmitter(reportID: string, policyID: str
},
});
- // Create the MOVED report action and add it to the DM chat which indicates to the user where the report has been moved
- const movedReportAction = buildOptimisticMovedReportAction(iouReport.policyID, policyID, optimisticPolicyExpenseChatReportID, iouReportID, policy.name);
- optimisticData.push({
- onyxMethod: Onyx.METHOD.MERGE,
- key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${oldChatReportID}`,
- value: {[movedReportAction.reportActionID]: movedReportAction},
- });
- failureData.push({
- onyxMethod: Onyx.METHOD.MERGE,
- key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${oldChatReportID}`,
- value: {[movedReportAction.reportActionID]: null},
- });
-
const parameters: MoveIOUReportToPolicyAndInviteSubmitterParams = {
iouReportID: reportID,
policyID,
policyExpenseChatReportID: optimisticPolicyExpenseChatReportID ?? String(CONST.DEFAULT_NUMBER_ID),
policyExpenseCreatedReportActionID: optimisticPolicyExpenseChatCreatedReportActionID ?? String(CONST.DEFAULT_NUMBER_ID),
changePolicyReportActionID: changePolicyReportAction.reportActionID,
- dmMovedReportActionID: movedReportAction.reportActionID,
};
API.write(WRITE_COMMANDS.MOVE_IOU_REPORT_TO_POLICY_AND_INVITE_SUBMITTER, parameters, {optimisticData, successData, failureData});
- return {policyExpenseChatReportID: optimisticPolicyExpenseChatReportID};
}
/**
diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts
index b15a9b60c0892..8b8a335563cf5 100644
--- a/src/libs/actions/Search.ts
+++ b/src/libs/actions/Search.ts
@@ -10,10 +10,9 @@ import {READ_COMMANDS, SIDE_EFFECT_REQUEST_COMMANDS, WRITE_COMMANDS} from '@libs
import {getCommandURL} from '@libs/ApiUtils';
import {getMicroSecondOnyxErrorWithTranslationKey} from '@libs/ErrorUtils';
import fileDownload from '@libs/fileDownload';
-import {getLastUsedPaymentMethod, getLastUsedPaymentMethods} from '@libs/IOUUtils';
import enhanceParameters from '@libs/Network/enhanceParameters';
import {rand64} from '@libs/NumberUtils';
-import {getPersonalPolicy, getSubmitToAccountID} from '@libs/PolicyUtils';
+import {getSubmitToAccountID} from '@libs/PolicyUtils';
import {hasHeldExpenses} from '@libs/ReportUtils';
import {isTransactionGroupListItemType, isTransactionListItemType} from '@libs/SearchUIUtils';
import playSound, {SOUNDS} from '@libs/Sound';
@@ -22,10 +21,17 @@ import ONYXKEYS from '@src/ONYXKEYS';
import {FILTER_KEYS} from '@src/types/form/SearchAdvancedFiltersForm';
import type {SearchAdvancedFiltersForm} from '@src/types/form/SearchAdvancedFiltersForm';
import type {LastPaymentMethod, LastPaymentMethodType, SearchResults} from '@src/types/onyx';
-import type {PaymentInformation} from '@src/types/onyx/LastPaymentMethod';
import type {SearchPolicy, SearchReport, SearchTransaction} from '@src/types/onyx/SearchResults';
import type Nullable from '@src/types/utils/Nullable';
+let lastPaymentMethod: OnyxEntry;
+Onyx.connect({
+ key: ONYXKEYS.NVP_LAST_PAYMENT_METHOD,
+ callback: (val) => {
+ lastPaymentMethod = val;
+ },
+});
+
let allSnapshots: OnyxCollection;
Onyx.connect({
key: ONYXKEYS.COLLECTION.SNAPSHOT,
@@ -64,43 +70,22 @@ function handleActionButtonPress(hash: number, item: TransactionListItemType | T
}
}
-function getLastPolicyBankAccountID(policyID: string | undefined, reportType: keyof LastPaymentMethodType = 'lastUsed'): number | undefined {
+function getLastPolicyPaymentMethod(policyID: string | undefined, lastPaymentMethods: OnyxEntry) {
if (!policyID) {
- return undefined;
+ return null;
}
- const lastPolicyPaymentMethod = getLastUsedPaymentMethod(policyID);
- return typeof lastPolicyPaymentMethod === 'string' ? undefined : (lastPolicyPaymentMethod?.[reportType] as PaymentInformation)?.bankAccountID;
-}
-
-function getLastPolicyPaymentMethod(
- policyID: string | undefined,
- lastPaymentMethods: OnyxEntry,
- reportType: keyof LastPaymentMethodType = 'lastUsed',
- isIOUReport?: boolean,
-): ValueOf | undefined {
- if (!policyID) {
- return undefined;
- }
-
- const personalPolicy = getPersonalPolicy();
-
- const lastPolicyPaymentMethod = lastPaymentMethods?.[policyID] ?? (isIOUReport && personalPolicy ? lastPaymentMethods?.[personalPolicy.id] : undefined);
- const result = typeof lastPolicyPaymentMethod === 'string' ? lastPolicyPaymentMethod : (lastPolicyPaymentMethod?.[reportType] as PaymentInformation)?.name;
-
- return result as ValueOf | undefined;
-}
-
-function getSnapshotIOUReport(reportID?: string, hash?: number) {
- if (!reportID || !hash) {
- return;
+ let lastPolicyPaymentMethod = null;
+ if (typeof lastPaymentMethods?.[policyID] === 'string') {
+ lastPolicyPaymentMethod = lastPaymentMethods?.[policyID] as ValueOf;
+ } else {
+ lastPolicyPaymentMethod = (lastPaymentMethods?.[policyID] as LastPaymentMethodType)?.lastUsed.name as ValueOf;
}
- return allSnapshots?.[`${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`]?.data?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];
+ return lastPolicyPaymentMethod;
}
function getPayActionCallback(hash: number, item: TransactionListItemType | TransactionReportGroupListItemType, goToItem: () => void) {
- const lastPaymentMethods = (getLastUsedPaymentMethods() ?? {}) as OnyxEntry;
- const lastPolicyPaymentMethod = getLastPolicyPaymentMethod(item.policyID, lastPaymentMethods);
+ const lastPolicyPaymentMethod = getLastPolicyPaymentMethod(item.policyID, lastPaymentMethod);
if (!lastPolicyPaymentMethod) {
goToItem();
@@ -477,6 +462,4 @@ export {
openSearchFiltersCardPage,
openSearchPage as openSearch,
getLastPolicyPaymentMethod,
- getLastPolicyBankAccountID,
- getSnapshotIOUReport,
};
diff --git a/src/pages/home/report/PureReportActionItem.tsx b/src/pages/home/report/PureReportActionItem.tsx
index e96cc18f60bad..5b78faad7dbd6 100644
--- a/src/pages/home/report/PureReportActionItem.tsx
+++ b/src/pages/home/report/PureReportActionItem.tsx
@@ -1027,23 +1027,8 @@ function PureReportActionItem({
} else if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.IOU) && getOriginalMessage(action)?.type === CONST.IOU.REPORT_ACTION_TYPE.PAY) {
const wasAutoPaid = getOriginalMessage(action)?.automaticAction ?? false;
const paymentType = getOriginalMessage(action)?.paymentType;
-
if (paymentType === CONST.IOU.PAYMENT_TYPE.ELSEWHERE) {
children = ;
- } else if (paymentType === CONST.IOU.PAYMENT_TYPE.VBBA) {
- const last4Digits = policy?.achAccount?.accountNumber?.slice(-4) ?? '';
-
- if (wasAutoPaid) {
- const translation = translate('iou.automaticallyPaidWithBusinessBankAccount', {amount: '', last4Digits});
-
- children = (
-
- ${translation}`} />
-
- );
- } else {
- children = ;
- }
} else if (wasAutoPaid) {
children = (
diff --git a/src/pages/home/report/ReportActionItemMessage.tsx b/src/pages/home/report/ReportActionItemMessage.tsx
index 82dfe86cb2a6a..74cf5ec2944b2 100644
--- a/src/pages/home/report/ReportActionItemMessage.tsx
+++ b/src/pages/home/report/ReportActionItemMessage.tsx
@@ -91,7 +91,7 @@ function ReportActionItemMessage({action, displayAsGroup, reportID, style, isHid
const originalMessage = action.actionName === CONST.REPORT.ACTIONS.TYPE.IOU ? getOriginalMessage(action) : null;
const iouReportID = originalMessage?.IOUReportID;
if (iouReportID) {
- iouMessage = getIOUReportActionDisplayMessage(action, transaction, report);
+ iouMessage = getIOUReportActionDisplayMessage(action, transaction);
}
}
diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.tsx b/src/pages/settings/Wallet/WalletPage/WalletPage.tsx
index ab224114a0016..66623d40319ac 100644
--- a/src/pages/settings/Wallet/WalletPage/WalletPage.tsx
+++ b/src/pages/settings/Wallet/WalletPage/WalletPage.tsx
@@ -65,7 +65,6 @@ function WalletPage({shouldListenForResize = false}: WalletPageProps) {
const [walletTerms = getEmptyObject()] = useOnyx(ONYXKEYS.WALLET_TERMS, {canBeMissing: true});
const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP, {canBeMissing: false});
const [userAccount] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
- const [lastUsedPaymentMethods] = useOnyx(ONYXKEYS.NVP_LAST_PAYMENT_METHOD, {canBeMissing: true});
const isUserValidated = userAccount?.validated ?? false;
const {isActingAsDelegate, showDelegateNoAccessModal} = useContext(DelegateNoAccessContext);
const {isAccountLocked, showLockedAccountModal} = useContext(LockedAccountContext);
@@ -295,11 +294,11 @@ function WalletPage({shouldListenForResize = false}: WalletPageProps) {
const bankAccountID = paymentMethod.selectedPaymentMethod.bankAccountID;
const fundID = paymentMethod.selectedPaymentMethod.fundID;
if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT && bankAccountID) {
- deletePaymentBankAccount(bankAccountID, lastUsedPaymentMethods);
+ deletePaymentBankAccount(bankAccountID);
} else if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.DEBIT_CARD && fundID) {
deletePaymentCard(fundID);
}
- }, [paymentMethod.selectedPaymentMethod.bankAccountID, paymentMethod.selectedPaymentMethod.fundID, paymentMethod.selectedPaymentMethodType, lastUsedPaymentMethods]);
+ }, [paymentMethod.selectedPaymentMethod.bankAccountID, paymentMethod.selectedPaymentMethod.fundID, paymentMethod.selectedPaymentMethodType]);
/**
* Navigate to the appropriate page after completing the KYC flow, depending on what initiated it
diff --git a/src/stories/TransactionPreviewContent.stories.tsx b/src/stories/TransactionPreviewContent.stories.tsx
index 032d0845c588b..30853d8c5b84a 100644
--- a/src/stories/TransactionPreviewContent.stories.tsx
+++ b/src/stories/TransactionPreviewContent.stories.tsx
@@ -2,7 +2,6 @@ import type {InputType} from '@storybook/csf';
import type {Meta, StoryFn} from '@storybook/react';
import React from 'react';
import {View} from 'react-native';
-import type {ValueOf} from 'type-fest';
import TransactionPreviewContent from '@components/ReportActionItem/TransactionPreview/TransactionPreviewContent';
import type {TransactionPreviewContentProps} from '@components/ReportActionItem/TransactionPreview/types';
import ThemeProvider from '@components/ThemeProvider';
@@ -28,7 +27,7 @@ const modifiedTransaction = ({category, tag, merchant = '', amount = 1000, hold
hold: hold ? 'true' : undefined,
},
});
-const iouReportWithModifiedType = (type: ValueOf) => ({...iouReportR14932, type});
+const iouReportWithModifiedType = (type: string) => ({...iouReportR14932, type});
const actionWithModifiedPendingAction = (pendingAction: PendingAction) => ({...actionR14932, pendingAction});
const disabledProperties = [
diff --git a/src/styles/index.ts b/src/styles/index.ts
index 16a8731d95bbf..ebc96b08f3d7e 100644
--- a/src/styles/index.ts
+++ b/src/styles/index.ts
@@ -450,11 +450,6 @@ const styles = (theme: ThemeColors) =>
fontSize: variables.fontSizeSmall,
},
- textExtraSmall: {
- ...FontUtils.fontFamily.platform.EXP_NEUE,
- fontSize: variables.fontSizeExtraSmall,
- },
-
textMicro: {
...FontUtils.fontFamily.platform.EXP_NEUE,
fontSize: variables.fontSizeSmall,
@@ -4728,15 +4723,6 @@ const styles = (theme: ThemeColors) =>
paddingLeft: 0,
},
- dropDownButtonCartIcon: {
- minWidth: 22,
- },
-
- dropDownSmallButtonArrowContain: {
- marginLeft: 3,
- marginRight: 6,
- },
-
dropDownMediumButtonArrowContain: {
marginLeft: 12,
marginRight: 16,
@@ -4950,16 +4936,6 @@ const styles = (theme: ThemeColors) =>
height: is2FARequired ? variables.modalTopIconHeight : variables.modalTopBigIconHeight,
}),
- settlementButtonListContainer: {
- maxHeight: 500,
- paddingBottom: 0,
- paddingTop: 0,
- },
-
- settlementButtonShortFormWidth: {
- minWidth: 90,
- },
-
moneyRequestViewImage: {
...spacing.mh5,
overflow: 'hidden',
diff --git a/src/styles/utils/index.ts b/src/styles/utils/index.ts
index 259a49becfcf2..df52b0c094166 100644
--- a/src/styles/utils/index.ts
+++ b/src/styles/utils/index.ts
@@ -1217,18 +1217,6 @@ function getItemBackgroundColorStyle(isSelected: boolean, isFocused: boolean, is
return {};
}
-function getOptionMargin(itemIndex: number, itemsLen: number) {
- if (itemIndex === itemsLen && itemsLen > 5) {
- return {marginBottom: 16};
- }
-
- if (itemIndex === 0 && itemsLen > 5) {
- return {marginTop: 16};
- }
-
- return {};
-}
-
const staticStyleUtils = {
positioning,
searchHeaderDefaultOffset,
@@ -1312,7 +1300,6 @@ const staticStyleUtils = {
getItemBackgroundColorStyle,
getNavigationBarType,
getSuccessReportCardLostIllustrationStyle,
- getOptionMargin,
};
const createStyleUtils = (theme: ThemeColors, styles: ThemeStyles) => ({
diff --git a/src/types/onyx/LastPaymentMethod.ts b/src/types/onyx/LastPaymentMethod.ts
index 0338c7c6a7efe..00a4cd475415a 100644
--- a/src/types/onyx/LastPaymentMethod.ts
+++ b/src/types/onyx/LastPaymentMethod.ts
@@ -1,28 +1,30 @@
-/**
- * PaymentInformation object
- */
-type PaymentInformation = {
- /** The name of the */
- name: string;
- /** The bank account id of the last payment method */
- bankAccountID?: number;
-};
-
/**
* The new lastPaymentMethod object
*/
type LastPaymentMethodType = {
/** The default last payment method */
- lastUsed: PaymentInformation;
+ lastUsed: {
+ /** The name of the last payment method */
+ name: string;
+ };
/** The lastPaymentMethod of an IOU */
- iou: PaymentInformation;
+ Iou: {
+ /** The name of the last payment method */
+ name: string;
+ };
/** The lastPaymentMethod of an Expense */
- expense: PaymentInformation;
+ Expense: {
+ /** The name of the last payment method */
+ name: string;
+ };
/** The lastPaymentMethod of an Invoice */
- invoice: string | PaymentInformation;
+ Invoice: {
+ /** The name of the last payment method */
+ name: string;
+ };
};
/** Record of last payment methods, indexed by policy id */
type LastPaymentMethod = Record;
-export type {LastPaymentMethodType, LastPaymentMethod, PaymentInformation};
+export type {LastPaymentMethodType, LastPaymentMethod};
diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts
index 9671ca610893b..09cd4797b973c 100644
--- a/src/types/onyx/OriginalMessage.ts
+++ b/src/types/onyx/OriginalMessage.ts
@@ -74,12 +74,6 @@ type OriginalMessageIOU = {
/** Collection of accountIDs of users mentioned in message */
whisperedTo?: number[];
-
- /** Where the invoice is paid with business account or not */
- payAsBusiness?: boolean;
-
- /** The bank account id */
- bankAccountID?: number;
};
/** Names of moderation decisions */
diff --git a/src/types/onyx/Report.ts b/src/types/onyx/Report.ts
index fc31d4e7498f9..b6ba318ab743a 100644
--- a/src/types/onyx/Report.ts
+++ b/src/types/onyx/Report.ts
@@ -135,7 +135,7 @@ type Report = OnyxCommon.OnyxValueWithOfflineFeedback<
writeCapability?: WriteCapability;
/** The report type */
- type?: ValueOf | ValueOf | ValueOf;
+ type?: string;
/** The report visibility */
visibility?: RoomVisibility;
diff --git a/src/types/onyx/ReportAction.ts b/src/types/onyx/ReportAction.ts
index 417de849917ad..5667284fdba17 100644
--- a/src/types/onyx/ReportAction.ts
+++ b/src/types/onyx/ReportAction.ts
@@ -80,12 +80,6 @@ type Message = {
/** The time this report action was deleted */
deleted?: string;
-
- /** The bank account id that was used to pay the invoice */
- bankAccountID?: number | undefined;
-
- /** Whether the invoice was paid with business account or not */
- payAsBusiness?: boolean;
};
/** Model of image */
diff --git a/tests/actions/IOUTest.ts b/tests/actions/IOUTest.ts
index 9c4f1a007c403..44e392cca16f6 100644
--- a/tests/actions/IOUTest.ts
+++ b/tests/actions/IOUTest.ts
@@ -2648,7 +2648,7 @@ describe('actions/IOU', () => {
)
.then(() => {
if (chatReport && expenseReport) {
- payMoneyRequest(CONST.IOU.PAYMENT_TYPE.VBBA, chatReport, expenseReport, undefined);
+ payMoneyRequest(CONST.IOU.PAYMENT_TYPE.VBBA, chatReport, expenseReport);
}
return waitForBatchedUpdates();
})
@@ -2777,7 +2777,7 @@ describe('actions/IOU', () => {
.then(() => {
mockFetch?.fail?.();
if (chatReport && expenseReport) {
- payMoneyRequest('ACH', chatReport, expenseReport, undefined);
+ payMoneyRequest('ACH', chatReport, expenseReport);
}
return waitForBatchedUpdates();
})
@@ -2917,7 +2917,7 @@ describe('actions/IOU', () => {
})
.then(() => {
// When partially paying an iou report from the chat report via the report preview
- payMoneyRequest(CONST.IOU.PAYMENT_TYPE.ELSEWHERE, {reportID: topMostReportID}, iouReport, undefined, false);
+ payMoneyRequest(CONST.IOU.PAYMENT_TYPE.ELSEWHERE, {reportID: topMostReportID}, iouReport, false);
return waitForBatchedUpdates();
})
.then(() => {
@@ -2992,7 +2992,7 @@ describe('actions/IOU', () => {
.then(() => {
// When the expense report is paid elsewhere (but really, any payment option would work)
if (chatReport && expenseReport) {
- payMoneyRequest(CONST.IOU.PAYMENT_TYPE.ELSEWHERE, chatReport, expenseReport, undefined);
+ payMoneyRequest(CONST.IOU.PAYMENT_TYPE.ELSEWHERE, chatReport, expenseReport);
}
return waitForBatchedUpdates();
})
diff --git a/tests/unit/OnyxDerivedTest.ts b/tests/unit/OnyxDerivedTest.ts
index cd6c960f22246..1adbb5b6635cd 100644
--- a/tests/unit/OnyxDerivedTest.ts
+++ b/tests/unit/OnyxDerivedTest.ts
@@ -4,7 +4,6 @@ import OnyxUtils from 'react-native-onyx/dist/OnyxUtils';
import initOnyxDerivedValues from '@userActions/OnyxDerived';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
-import type {Report} from '@src/types/onyx';
import type {ReportActions} from '@src/types/onyx/ReportAction';
import {createRandomReport} from '../utils/collections/reports';
import waitForBatchedUpdates from '../utils/waitForBatchedUpdates';
@@ -20,7 +19,7 @@ describe('OnyxDerived', () => {
});
describe('reportAttributes', () => {
- const mockReport: Report = {
+ const mockReport = {
reportID: `test_1`,
reportName: 'Test Report',
type: 'chat',