diff --git a/Mobile-Expensify b/Mobile-Expensify
index 3774f3462625f..30ae4386db5fc 160000
--- a/Mobile-Expensify
+++ b/Mobile-Expensify
@@ -1 +1 @@
-Subproject commit 3774f3462625f841941e0f9291486e24ef0e9f2c
+Subproject commit 30ae4386db5fc9c506bc157c311ec96ab8af7191
diff --git a/android/app/build.gradle b/android/app/build.gradle
index e9f8b831d2483..72f663397b390 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 1009017205
- versionName "9.1.72-5"
+ versionCode 1009017206
+ versionName "9.1.72-6"
// 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 778d7e9de0e8b..037fe852bbf4a 100644
--- a/ios/NewExpensify/Info.plist
+++ b/ios/NewExpensify/Info.plist
@@ -44,7 +44,7 @@
CFBundleVersion
- 9.1.72.5
+ 9.1.72.6
FullStory
OrgId
diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist
index 8c3e2b81cea75..81746cff865fb 100644
--- a/ios/NotificationServiceExtension/Info.plist
+++ b/ios/NotificationServiceExtension/Info.plist
@@ -13,7 +13,7 @@
CFBundleShortVersionString
9.1.72
CFBundleVersion
- 9.1.72.5
+ 9.1.72.6
NSExtension
NSExtensionPointIdentifier
diff --git a/ios/ShareViewController/Info.plist b/ios/ShareViewController/Info.plist
index c093a2cb763b8..7016c8b5fa716 100644
--- a/ios/ShareViewController/Info.plist
+++ b/ios/ShareViewController/Info.plist
@@ -13,7 +13,7 @@
CFBundleShortVersionString
9.1.72
CFBundleVersion
- 9.1.72.5
+ 9.1.72.6
NSExtension
NSExtensionAttributes
diff --git a/package-lock.json b/package-lock.json
index 97a5a8f87fe15..54251513b3132 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "new.expensify",
- "version": "9.1.72-5",
+ "version": "9.1.72-6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "new.expensify",
- "version": "9.1.72-5",
+ "version": "9.1.72-6",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
diff --git a/package.json b/package.json
index 6d5a80354f582..1a8c2ba40ad0d 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
- "version": "9.1.72-5",
+ "version": "9.1.72-6",
"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 34333cfd9d577..e3467bbf663c7 100755
--- a/src/CONST/index.ts
+++ b/src/CONST/index.ts
@@ -6915,9 +6915,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 1b1af6c915081..dd4551fcd679a 100644
--- a/src/components/ButtonWithDropdownMenu/index.tsx
+++ b/src/components/ButtonWithDropdownMenu/index.tsx
@@ -50,8 +50,6 @@ function ButtonWithDropdownMenu({
testID,
secondLineText = '',
icon,
- shouldPopoverUseScrollView = false,
- containerStyles,
shouldUseModalPaddingStyle = true,
}: ButtonWithDropdownMenuProps) {
const theme = useTheme();
@@ -75,10 +73,6 @@ function ButtonWithDropdownMenu({
const isButtonSizeLarge = buttonSize === CONST.DROPDOWN_BUTTON_SIZE.LARGE;
const nullCheckRef = (ref: RefObject) => ref ?? null;
- useEffect(() => {
- setSelectedItemIndex(defaultSelectedIndex);
- }, [defaultSelectedIndex]);
-
useEffect(() => {
if (!dropdownAnchor.current) {
return;
@@ -238,27 +232,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 && typeof item.shouldUpdateSelectedIndex === 'boolean') {
- return;
- }
-
setSelectedItemIndex(index);
},
shouldCallAfterModalHide: true,
diff --git a/src/components/ButtonWithDropdownMenu/types.ts b/src/components/ButtonWithDropdownMenu/types.ts
index 82806a4d80748..395d445e100f0 100644
--- a/src/components/ButtonWithDropdownMenu/types.ts
+++ b/src/components/ButtonWithDropdownMenu/types.ts
@@ -40,8 +40,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;
@@ -142,12 +140,6 @@ 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;
};
diff --git a/src/components/Icon/BankIcons/index.native.ts b/src/components/Icon/BankIcons/index.native.ts
index 246eebb7357ca..aaf8456b27715 100644
--- a/src/components/Icon/BankIcons/index.native.ts
+++ b/src/components/Icon/BankIcons/index.native.ts
@@ -1,7 +1,7 @@
+import GenericBank from '@assets/images/bank-icons/generic-bank-account.svg';
import GenericBankCard from '@assets/images/cardicons/generic-bank-card.svg';
import type {BankIconParams} from '@components/Icon/BankIconsUtils';
import {getBankIconAsset, getBankNameKey} from '@components/Icon/BankIconsUtils';
-import {Bank} from '@components/Icon/Expensicons';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import type {BankIcon} from '@src/types/onyx/Bank';
@@ -11,7 +11,7 @@ import type {BankIcon} from '@src/types/onyx/Bank';
*/
export default function getBankIcon({styles, bankName, isCard = false}: BankIconParams): BankIcon {
const bankIcon: BankIcon = {
- icon: isCard ? GenericBankCard : Bank,
+ icon: isCard ? GenericBankCard : GenericBank,
};
if (bankName) {
const bankNameKey = getBankNameKey(bankName.toLowerCase());
diff --git a/src/components/KYCWall/BaseKYCWall.tsx b/src/components/KYCWall/BaseKYCWall.tsx
index efe19d75109ec..d2597b93746d5 100644
--- a/src/components/KYCWall/BaseKYCWall.tsx
+++ b/src/components/KYCWall/BaseKYCWall.tsx
@@ -5,20 +5,18 @@ 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 {Policy} from '@src/types/onyx';
import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage';
import viewRef from '@src/types/utils/viewRef';
import type {AnchorPosition, DomRect, KYCWallProps, PaymentMethod} from './types';
@@ -102,41 +100,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));
@@ -144,6 +117,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);
@@ -159,7 +133,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;
/**
@@ -196,13 +170,6 @@ function KYCWall({
const clickedElementLocation = getClickedTargetLocation(targetElement as HTMLDivElement);
const position = getAnchorPosition(clickedElementLocation);
- // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
- if (paymentMethod || policy) {
- setShouldShowAddPaymentMenu(false);
- selectPaymentMethod(paymentMethod, policy);
- return;
- }
-
setPositionAddPaymentMenu(position);
setShouldShowAddPaymentMenu(true);
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 7d66bc2486b47..af3e85941a0fc 100644
--- a/src/components/MoneyReportHeader.tsx
+++ b/src/components/MoneyReportHeader.tsx
@@ -317,7 +317,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],
@@ -583,7 +583,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 e4f5b0bb2ecb3..b5e7eff18aee0 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 0ea52920e6cb9..ad47dbc879297 100644
--- a/src/components/Search/index.tsx
+++ b/src/components/Search/index.tsx
@@ -79,22 +79,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,
};
}
@@ -102,22 +95,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,
};
}
@@ -516,7 +505,7 @@ function Search({queryJSON, currentSearchResults, lastNonEmptySearchResults, onS
// 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);
});
const hasErrors = Object.keys(searchResults?.errors ?? {}).length > 0 && !isOffline;
diff --git a/src/components/Search/types.ts b/src/components/Search/types.ts
index 6b514de95920d..221ce73b6c5b9 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 30d94f2d87088..5dd54e8e52b79 100644
--- a/src/components/SelectionList/Search/ActionCell.tsx
+++ b/src/components/SelectionList/Search/ActionCell.tsx
@@ -1,23 +1,16 @@
-import React, {useCallback} from 'react';
+import React from 'react';
import {View} from 'react-native';
-import {useOnyx} 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 useStyleUtils from '@hooks/useStyleUtils';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
-import {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 {SearchTransactionAction} from '@src/types/onyx/SearchResults';
const actionTranslationsMap: Record = {
@@ -38,10 +31,6 @@ type ActionCellProps = {
isChildListItem?: boolean;
parentAction?: string;
isLoading?: boolean;
- policyID?: string;
- reportID?: string;
- hash?: number;
- amount?: number;
};
function ActionCell({
@@ -52,10 +41,6 @@ function ActionCell({
isChildListItem = false,
parentAction = '',
isLoading = false,
- policyID = '',
- reportID = '',
- hash,
- amount,
}: ActionCellProps) {
const {translate} = useLocalize();
const theme = useTheme();
@@ -63,22 +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);
-
- 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 (
@@ -123,23 +94,6 @@ function ActionCell({
) : null;
}
- if (action === CONST.SEARCH.ACTION_TYPES.PAY) {
- return (
-
- );
- }
-
return (
)}
diff --git a/src/components/SelectionList/Search/UserInfoAndActionButtonRow.tsx b/src/components/SelectionList/Search/UserInfoAndActionButtonRow.tsx
index e67f42b007ebd..ef12633d27a8a 100644
--- a/src/components/SelectionList/Search/UserInfoAndActionButtonRow.tsx
+++ b/src/components/SelectionList/Search/UserInfoAndActionButtonRow.tsx
@@ -49,8 +49,6 @@ function UserInfoAndActionButtonRow({
goToItem={handleActionButtonPress}
isSelected={item.isSelected}
isLoading={item.isActionLoading}
- policyID={item.policyID}
- reportID={item.reportID}
/>
diff --git a/src/components/SelectionList/types.ts b/src/components/SelectionList/types.ts
index 7c0ce497d79a7..9635b57bee0cf 100644
--- a/src/components/SelectionList/types.ts
+++ b/src/components/SelectionList/types.ts
@@ -212,9 +212,6 @@ type ListItem = {
/** Boolean whether to display the right icon */
shouldShowRightIcon?: 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 6c306521a7cd0..f656772b82122 100644
--- a/src/components/SettlementButton/index.tsx
+++ b/src/components/SettlementButton/index.tsx
@@ -1,51 +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 React, {useContext} from 'react';
import {useOnyx} from 'react-native-onyx';
-import type {TupleToUnion} from 'type-fest';
import ButtonWithDropdownMenu from '@components/ButtonWithDropdownMenu';
-import * as Expensicons 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 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 = '',
@@ -81,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.
@@ -93,458 +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];
- // whether the user has single policy and the expense isn't inside a workspace
- const hasSinglePolicy = !policy && activeAdminPolicies.length === 1;
- const hasMultiplePolicies = !policy && 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) => ({
- text: formattedPaymentMethod?.title ?? '',
- description: formattedPaymentMethod?.description ?? '',
- icon: formattedPaymentMethod?.icon,
- shouldUpdateSelectedIndex: true,
- onSelected: () => {
- onPress(CONST.IOU.PAYMENT_TYPE.EXPENSIFY, payAsBusiness, formattedPaymentMethod.methodID, formattedPaymentMethod.accountType, undefined);
- },
- iconStyles: formattedPaymentMethod?.iconStyles,
- iconHeight: formattedPaymentMethod?.iconSize,
- iconWidth: formattedPaymentMethod?.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) => ({
- text: formattedPaymentMethod?.title ?? '',
- description: formattedPaymentMethod?.description ?? '',
- icon: formattedPaymentMethod?.icon,
- onSelected: () => onPress(CONST.IOU.PAYMENT_TYPE.EXPENSIFY, true, undefined),
- methodID: formattedPaymentMethod?.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 isExpenseReport = isExpenseReportUtil(iouReport);
- 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]);
- }
-
- 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,
- ]);
-
- 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 savePreferredPaymentMethod = (id: string, value: PaymentMethodType) => {
+ savePreferredPaymentMethodIOU(id, value, undefined);
+ };
return (
onPress(paymentType, undefined, undefined)}
+ onSuccessfulKYC={(paymentType) => onPress(paymentType)}
enablePaymentsRoute={enablePaymentsRoute}
addBankAccountRoute={addBankAccountRoute}
addDebitCardRoute={addDebitCardRoute}
@@ -552,32 +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}
- shouldPopoverUseScrollView={paymentButtonOptions.length > 5}
- containerStyles={paymentButtonOptions.length > 5 ? styles.settlementButtonListContainer : {}}
- wrapperStyle={[wrapperStyle, shouldUseShortForm && shouldUseSplitButton ? {minWidth: 90} : {}]}
+ 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 8d6ee8e3ba045..7bed783271338 100644
--- a/src/components/TransactionItemRow/index.tsx
+++ b/src/components/TransactionItemRow/index.tsx
@@ -80,9 +80,6 @@ type TransactionWithOptionalSearchFields = TransactionWithOptionalHighlight & {
/** Precomputed violations */
violations?: TransactionViolation[];
-
- /** Used to initiate payment from search page */
- hash?: number;
};
type TransactionItemRowProps = {
@@ -280,9 +277,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 adf45515700b5..65f3a26b30a23 100644
--- a/src/hooks/usePaymentOptions.ts
+++ b/src/hooks/usePaymentOptions.ts
@@ -3,6 +3,7 @@ import {useOnyx} from 'react-native-onyx';
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 = {}] = 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,
- value: CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT,
- shouldUpdateSelectedIndex: false,
+ [CONST.IOU.PAYMENT_TYPE.EXPENSIFY]: {
+ text: translate('iou.settleExpensify', {formattedAmount}),
+ icon: Expensicons.Wallet,
+ value: CONST.IOU.PAYMENT_TYPE.EXPENSIFY,
},
- [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.VBBA]: {
+ text: translate('iou.settleExpensify', {formattedAmount}),
+ icon: Expensicons.Wallet,
+ value: CONST.IOU.PAYMENT_TYPE.VBBA,
},
[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 2eb5a5949b4de..45a7a9277017a 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,
@@ -1115,18 +1113,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} mit Bankkonto ${last4Digits} bezahlt.`,
- 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`,
@@ -1162,8 +1152,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.',
@@ -1824,7 +1814,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',
@@ -2038,7 +2027,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 58a906db71edd..2780ff9466922 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,
@@ -1100,18 +1098,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) => `Paid ${amount} with bank account ${last4Digits}.`,
- 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`,
@@ -1146,8 +1136,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',
@@ -1800,7 +1790,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',
@@ -2010,7 +1999,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 b14d220097c51..a2efced3ac5ee 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,
@@ -1095,18 +1093,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) => `Pagó ${amount} con la cuenta bancaria ${last4Digits}.`,
- 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}`,
@@ -1141,8 +1131,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',
@@ -1799,7 +1789,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',
@@ -2010,7 +1999,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 39f1298757f4a..bbd5d330ca5b8 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,
@@ -1115,19 +1113,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) => `Payé ${amount} avec le compte bancaire ${last4Digits}.`,
- 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}`,
@@ -1163,8 +1152,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',
@@ -1824,7 +1813,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',
@@ -2039,7 +2027,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 c978531328562..086e57d7a1a4a 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,
@@ -1111,18 +1109,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) => `Pagato ${amount} con conto bancario ${last4Digits}.`,
- 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}`,
@@ -1158,8 +1148,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',
@@ -1816,7 +1806,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',
@@ -2029,7 +2018,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 4e6328b81a7ee..a3ea40273e112 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,
@@ -1114,18 +1112,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}を銀行口座(${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} 請求書を送信`,
@@ -1160,8 +1150,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: 'このレポートには無効な金額が含まれています',
@@ -1813,7 +1803,6 @@ const translations = {
enableWallet: 'ウォレットを有効にする',
addBankAccountToSendAndReceive: 'ワークスペースに提出した経費の払い戻しを受ける。',
addBankAccount: '銀行口座を追加',
- addDebitOrCreditCard: 'デビットカードまたはクレジットカードを追加',
assignedCards: '割り当てられたカード',
assignedCardsDescription: 'これらは、会社の支出を管理するためにワークスペース管理者によって割り当てられたカードです。',
expensifyCard: 'Expensify Card',
@@ -2022,7 +2011,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 09453c52ad530..7d70895b4805e 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,
@@ -1112,19 +1110,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} betaald via bankrekening ${last4Digits}.`,
- 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`,
@@ -1160,8 +1149,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.',
@@ -1817,7 +1806,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',
@@ -2030,7 +2018,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 c3bc702a42510..cfa08720a2780 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 RequestAmountParams = {amount: string};
type RequestedAmountMessageParams = {formattedAmount: string; comment?: string};
@@ -202,8 +197,6 @@ type TransferParams = {amount: string};
type InstantSummaryParams = {rate: string; minAmount: string};
-type BankAccountLastFourParams = {lastFour: string};
-
type NotYouParams = {user: string};
type DateShouldBeBeforeParams = {dateString: string};
@@ -1040,7 +1033,6 @@ export type {
SettlementDateParams,
PolicyExpenseChatNameParams,
YourPlanPriceValueParams,
- BusinessBankAccountParams,
NeedCategoryForExportToIntegrationParams,
UpdatedPolicyAuditRateParams,
UpdatedPolicyManualApprovalThresholdParams,
@@ -1054,7 +1046,6 @@ export type {
UpdatedPolicyCategoryExpenseLimitTypeParams,
UpdatedPolicyCategoryMaxAmountNoReceiptParams,
SubscriptionSettingsSummaryParams,
- BankAccountLastFourParams,
ReviewParams,
CreateExpensesParams,
CurrencyInputDisabledTextParams,
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index c1e2ec0bdf53a..06465bf0c432a 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,
@@ -1110,18 +1108,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) => `Zapłacono ${amount} z konta bankowego ${last4Digits}.`,
- 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}`,
@@ -1157,8 +1147,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ę',
@@ -1812,7 +1802,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',
@@ -2025,7 +2014,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 a6794f99d7600..37a5e63b8dd6a 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,
@@ -1112,18 +1110,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) => `Pago ${amount} com conta bancária ${last4Digits}.`,
- 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}`,
@@ -1159,8 +1149,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',
@@ -1815,7 +1805,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',
@@ -2028,7 +2017,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 293c3744fcd60..15779feb916f2 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,
@@ -1102,18 +1100,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) => `已用银行账户${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} 发票`,
@@ -1146,8 +1136,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: '此报告的金额无效',
@@ -1797,7 +1787,6 @@ const translations = {
enableWallet: '启用钱包',
addBankAccountToSendAndReceive: '获得报销您提交到工作区的费用。',
addBankAccount: '添加银行账户',
- addDebitOrCreditCard: '添加借记卡或信用卡',
assignedCards: '已分配的卡片',
assignedCardsDescription: '这些是由工作区管理员分配的卡片,用于管理公司支出。',
expensifyCard: 'Expensify Card',
@@ -2005,7 +1994,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 0ecd35986f825..2755d5f7eafcb 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 51d1f4c87716b..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,14 +216,6 @@ function shouldStartLocationPermissionFlow() {
);
}
-function getLastUsedPaymentMethod(policyID?: string): LastPaymentMethodType | undefined {
- if (!policyID) {
- return;
- }
-
- return lastUsedPaymentMethods?.[policyID] as LastPaymentMethodType;
-}
-
export {
calculateAmount,
insertTagIntoTransactionTagsString,
@@ -243,5 +228,4 @@ export {
formatCurrentUserToAttendee,
shouldStartLocationPermissionFlow,
navigateToParticipantPage,
- getLastUsedPaymentMethod,
};
diff --git a/src/libs/MoneyRequestReportUtils.ts b/src/libs/MoneyRequestReportUtils.ts
index 08e4e7455cbc0..21ca10749866f 100644
--- a/src/libs/MoneyRequestReportUtils.ts
+++ b/src/libs/MoneyRequestReportUtils.ts
@@ -147,7 +147,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/ReportUtils.ts b/src/libs/ReportUtils.ts
index a703d5c808adb..1867b355f2d40 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;
};
@@ -1564,10 +1562,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;
@@ -4577,11 +4571,7 @@ function getReportPreviewMessage(
});
}
- // This will be fixed as part of https://github.com/Expensify/Expensify/issues/507850
- // eslint-disable-next-line deprecation/deprecation
- const reportPolicy = getPolicy(report.policyID);
-
- let linkedTransaction;
+ let linkedTransaction: OnyxEntry;
if (!isEmptyObject(iouReportAction) && shouldConsiderScanningReceiptOrPendingRoute && iouReportAction && isMoneyRequestAction(iouReportAction)) {
linkedTransaction = getLinkedTransaction(iouReportAction);
}
@@ -4612,22 +4602,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) {
@@ -6155,22 +6136,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)
@@ -6211,14 +6179,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});
@@ -6269,8 +6230,6 @@ function buildOptimisticIOUReportAction(params: BuildOptimisticIOUReportActionPa
created = DateUtils.getDBTime(),
linkedExpenseReportAction,
isPersonalTrackingExpense = false,
- payAsBusiness,
- bankAccountID,
} = params;
const IOUReportID = isPersonalTrackingExpense ? undefined : iouReportID || generateReportID();
@@ -6282,8 +6241,6 @@ function buildOptimisticIOUReportAction(params: BuildOptimisticIOUReportActionPa
IOUTransactionID: transactionID,
IOUReportID,
type,
- payAsBusiness,
- bankAccountID,
};
const delegateAccountDetails = getPersonalDetailByEmail(delegateEmail);
@@ -6345,7 +6302,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));
@@ -9185,15 +9142,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
@@ -9202,21 +9157,13 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry,
const {amount, currency} = originalMessage?.IOUDetails ?? originalMessage ?? {};
const formattedAmount = convertToDisplayString(Math.abs(amount), currency) ?? '';
- // This will be fixed as part of https://github.com/Expensify/Expensify/issues/507850
- // eslint-disable-next-line deprecation/deprecation
- const reportPolicy = getPolicy(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';
}
@@ -9225,8 +9172,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;
@@ -11506,7 +11452,6 @@ export {
generateReportName,
navigateToLinkedReportAction,
buildOptimisticUnreportedTransactionAction,
- isBusinessInvoiceRoom,
buildOptimisticResolvedDuplicatesReportAction,
getTitleReportField,
getReportFieldsByPolicyID,
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 fa167349fb85c..27b3d3bfe44cb 100644
--- a/src/libs/actions/IOU.ts
+++ b/src/libs/actions/IOU.ts
@@ -838,12 +838,6 @@ Onyx.connect({
callback: (value) => (personalDetailsList = value),
});
-let lastUsedPaymentMethods: OnyxEntry;
-Onyx.connect({
- key: ONYXKEYS.NVP_LAST_PAYMENT_METHOD,
- callback: (value) => (lastUsedPaymentMethods = value),
-});
-
/**
* @private
* After finishing the action in RHP from the Inbox tab, besides dismissing the modal, we should open the report.
@@ -8760,8 +8754,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
@@ -8824,8 +8816,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)
@@ -8898,23 +8888,12 @@ function getPayMoneyRequestParams(
);
if (iouReport?.policyID) {
- const prevLastUsedPaymentMethod = (lastUsedPaymentMethods?.[iouReport.policyID] as OnyxTypes.LastPaymentMethodType)?.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,
+ },
});
}
@@ -10159,7 +10138,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;
@@ -10169,7 +10148,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.
@@ -10205,7 +10184,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);
@@ -10963,17 +10942,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 = lastUsedPaymentMethods?.[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 1dbad9859d189..1c61d7272feca 100644
--- a/src/libs/actions/Policy/Policy.ts
+++ b/src/libs/actions/Policy/Policy.ts
@@ -68,7 +68,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';
@@ -452,33 +451,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) {
@@ -2175,34 +2147,6 @@ function buildPolicyData(
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 a0286a152c5c7..90ec7c342e0ac 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,
@@ -4964,9 +4963,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
@@ -4979,7 +4977,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;
}
@@ -5124,24 +5122,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});
@@ -5152,7 +5136,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
@@ -5166,7 +5150,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)) {
@@ -5377,30 +5360,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 e132b7763ff00..9ed73498b7ee9 100644
--- a/src/libs/actions/Search.ts
+++ b/src/libs/actions/Search.ts
@@ -12,7 +12,7 @@ import {getMicroSecondOnyxErrorWithTranslationKey} from '@libs/ErrorUtils';
import fileDownload from '@libs/fileDownload';
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';
@@ -20,7 +20,6 @@ import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import FILTER_KEYS 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';
@@ -70,30 +69,18 @@ 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 = lastPaymentMethod?.[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;
+ let lastPolicyPaymentMethod = null;
+ if (typeof lastPaymentMethods?.[policyID] === 'string') {
+ lastPolicyPaymentMethod = lastPaymentMethods?.[policyID] as ValueOf;
+ } else {
+ lastPolicyPaymentMethod = (lastPaymentMethods?.[policyID] as LastPaymentMethodType)?.lastUsed.name as ValueOf;
}
- 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;
+ return lastPolicyPaymentMethod;
}
function getPayActionCallback(hash: number, item: TransactionListItemType | TransactionReportGroupListItemType, goToItem: () => void) {
@@ -464,5 +451,4 @@ export {
openSearchFiltersCardPage,
openSearchPage as openSearch,
getLastPolicyPaymentMethod,
- getLastPolicyBankAccountID,
};
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 be7d617f6946f..b11bb29e8adff 100644
--- a/src/pages/settings/Wallet/WalletPage/WalletPage.tsx
+++ b/src/pages/settings/Wallet/WalletPage/WalletPage.tsx
@@ -64,7 +64,6 @@ function WalletPage({shouldListenForResize = false}: WalletPageProps) {
const [walletTerms] = useOnyx(ONYXKEYS.WALLET_TERMS, {initialValue: {}, 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);
@@ -294,11 +293,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 00c2e8e1b15a9..dec9767558ef4 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 79a433db76d48..2d7a80b316b2c 100644
--- a/src/styles/index.ts
+++ b/src/styles/index.ts
@@ -4907,12 +4907,6 @@ const styles = (theme: ThemeColors) =>
height: is2FARequired ? variables.modalTopIconHeight : variables.modalTopBigIconHeight,
}),
- settlementButtonListContainer: {
- maxHeight: 500,
- paddingBottom: 0,
- paddingTop: 0,
- },
-
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 685bc2dfdd4ce..818719fa8f632 100644
--- a/tests/actions/IOUTest.ts
+++ b/tests/actions/IOUTest.ts
@@ -2472,7 +2472,7 @@ describe('actions/IOU', () => {
.then(() => {
mockFetch?.pause?.();
if (chatReport && iouReport) {
- payMoneyRequest(CONST.IOU.PAYMENT_TYPE.ELSEWHERE, chatReport, iouReport, undefined);
+ payMoneyRequest(CONST.IOU.PAYMENT_TYPE.ELSEWHERE, chatReport, iouReport);
}
return waitForBatchedUpdates();
})
@@ -2647,7 +2647,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();
})
@@ -2776,7 +2776,7 @@ describe('actions/IOU', () => {
.then(() => {
mockFetch?.fail?.();
if (chatReport && expenseReport) {
- payMoneyRequest('ACH', chatReport, expenseReport, undefined);
+ payMoneyRequest('ACH', chatReport, expenseReport);
}
return waitForBatchedUpdates();
})
@@ -2817,7 +2817,7 @@ describe('actions/IOU', () => {
jest.advanceTimersByTime(10);
// When paying the IOU report
- payMoneyRequest(CONST.IOU.PAYMENT_TYPE.ELSEWHERE, chatReport, iouReport, undefined);
+ payMoneyRequest(CONST.IOU.PAYMENT_TYPE.ELSEWHERE, chatReport, iouReport);
await waitForBatchedUpdates();
@@ -2916,7 +2916,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(() => {
@@ -2991,7 +2991,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 4e2f736a2b69a..9940b363f28da 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',