diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 31c980eb026c..4ec7b5f6b134 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -1829,6 +1829,7 @@ const CONST = { // The "Upgrade" is intentional as the 426 HTTP code means "Upgrade Required" and sent by the API. We use the "Update" language everywhere else in the front end when this gets returned. UPDATE_REQUIRED: 'Upgrade Required', INTEGRATION_MESSAGE_INVALID_CREDENTIALS: 'Invalid credentials', + BANK_ACCOUNT_SAME_DEPOSIT_AND_WITHDRAWAL_ERROR: 'The deposit and withdrawal accounts are the same.', }, ERROR_TYPE: { SOCKET: 'Expensify\\Auth\\Error\\Socket', diff --git a/src/languages/de.ts b/src/languages/de.ts index e56925d409b1..37de37f04629 100644 --- a/src/languages/de.ts +++ b/src/languages/de.ts @@ -3150,6 +3150,7 @@ ${ ownershipPercentage: 'Bitte gib eine gültige Prozentzahl ein', deletePaymentBankAccount: 'Dieses Bankkonto kann nicht gelöscht werden, weil es für Expensify Card-Zahlungen verwendet wird. Wenn Sie dieses Konto trotzdem löschen möchten, wenden Sie sich bitte an Concierge.', + sameDepositAndWithdrawalAccount: 'Die Einzahlungs- und Auszahlungskonten sind identisch.', }, }, addPersonalBankAccount: { diff --git a/src/languages/en.ts b/src/languages/en.ts index 6a002d035925..5018f98859d2 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3108,6 +3108,7 @@ const translations = { ownershipPercentage: 'Please enter a valid percentage number', deletePaymentBankAccount: "This bank account can't be deleted because it is used for Expensify Card payments. If you would still like to delete this account, please reach out to Concierge.", + sameDepositAndWithdrawalAccount: 'The deposit and withdrawal accounts are the same.', }, }, addPersonalBankAccount: { diff --git a/src/languages/es.ts b/src/languages/es.ts index 4c06ccacf50e..831e49f42087 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -2728,6 +2728,7 @@ ${amount} para ${merchant} - ${date}`, ownershipPercentage: 'Por favor, ingrese un número de porcentaje válido', deletePaymentBankAccount: 'Esta cuenta bancaria no se puede eliminar porque se utiliza para pagos con la tarjeta Expensify. Si aún deseas eliminar esta cuenta, por favor contacta con Concierge.', + sameDepositAndWithdrawalAccount: 'Las cuentas de depósito y retiro son las mismas.', }, }, addPersonalBankAccount: { diff --git a/src/languages/fr.ts b/src/languages/fr.ts index 0d47692e0c4e..1a49c5578376 100644 --- a/src/languages/fr.ts +++ b/src/languages/fr.ts @@ -3154,6 +3154,7 @@ ${ ownershipPercentage: 'Veuillez saisir un nombre de pourcentage valide', deletePaymentBankAccount: 'Ce compte bancaire ne peut pas être supprimé car il est utilisé pour les paiements par Expensify Card. Si vous souhaitez tout de même supprimer ce compte, veuillez contacter Concierge.', + sameDepositAndWithdrawalAccount: 'Les comptes de dépôt et de retrait sont identiques.', }, }, addPersonalBankAccount: { diff --git a/src/languages/it.ts b/src/languages/it.ts index f9bea7fe34f7..4b2cf5bb6dda 100644 --- a/src/languages/it.ts +++ b/src/languages/it.ts @@ -3137,6 +3137,7 @@ ${ ownershipPercentage: 'Inserisci un numero percentuale valido', deletePaymentBankAccount: 'Questo conto bancario non può essere eliminato perché viene utilizzato per i pagamenti con Expensify Card. Se desideri comunque eliminare questo conto, contatta Concierge.', + sameDepositAndWithdrawalAccount: 'I conti di deposito e di prelievo sono gli stessi.', }, }, addPersonalBankAccount: { diff --git a/src/languages/ja.ts b/src/languages/ja.ts index e5187230fd8f..d8fe748bc87a 100644 --- a/src/languages/ja.ts +++ b/src/languages/ja.ts @@ -3130,6 +3130,7 @@ ${ fullName: '有効な氏名を入力してください', ownershipPercentage: '有効なパーセント数値を入力してください', deletePaymentBankAccount: 'この銀行口座は、Expensify Card の支払いに使用されているため削除できません。この口座をそれでも削除したい場合は、Concierge までご連絡ください。', + sameDepositAndWithdrawalAccount: '入金口座と出金口座が同じです。', }, }, addPersonalBankAccount: { diff --git a/src/languages/nl.ts b/src/languages/nl.ts index e35c1a41abf7..4a4367e8cf69 100644 --- a/src/languages/nl.ts +++ b/src/languages/nl.ts @@ -3133,6 +3133,7 @@ ${ ownershipPercentage: 'Voer een geldig percentage in', deletePaymentBankAccount: 'Deze bankrekening kan niet worden verwijderd omdat deze wordt gebruikt voor Expensify Card-betalingen. Als je deze rekening toch wilt verwijderen, neem dan contact op met Concierge.', + sameDepositAndWithdrawalAccount: 'De stortings- en opnamerekeningen zijn hetzelfde.', }, }, addPersonalBankAccount: { diff --git a/src/languages/pl.ts b/src/languages/pl.ts index eeb656af087e..682f1c8fd687 100644 --- a/src/languages/pl.ts +++ b/src/languages/pl.ts @@ -3131,6 +3131,7 @@ ${ ownershipPercentage: 'Wprowadź prawidłową wartość procentową', deletePaymentBankAccount: 'To tego konta bankowego nie można usunąć, ponieważ jest używane do płatności Expensify Card. Jeśli mimo to chcesz usunąć to konto, skontaktuj się z Concierge.', + sameDepositAndWithdrawalAccount: 'Konto do wpłaty i konto do wypłaty są takie same.', }, }, addPersonalBankAccount: { diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts index e3c66772d78e..6f46cf904333 100644 --- a/src/languages/pt-BR.ts +++ b/src/languages/pt-BR.ts @@ -3131,6 +3131,7 @@ ${ ownershipPercentage: 'Insira um número de porcentagem válido', deletePaymentBankAccount: 'Esta conta bancária não pode ser excluída porque é usada para pagamentos do Expensify Card. Se ainda quiser excluir esta conta, entre em contato com a Concierge.', + sameDepositAndWithdrawalAccount: 'As contas de depósito e de saque são as mesmas.', }, }, addPersonalBankAccount: { diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts index 793eecd2c1df..861499672d04 100644 --- a/src/languages/zh-hans.ts +++ b/src/languages/zh-hans.ts @@ -3090,6 +3090,7 @@ ${ fullName: '请输入有效的全名', ownershipPercentage: '请输入有效的百分比数字', deletePaymentBankAccount: '此银行账户无法删除,因为它被用于 Expensify Card 付款。如果你仍然想删除此账户,请联系 Concierge。', + sameDepositAndWithdrawalAccount: '存款和取款账户相同。', }, }, addPersonalBankAccount: { diff --git a/src/libs/ErrorUtils.ts b/src/libs/ErrorUtils.ts index 22d748292f37..96499ade011a 100644 --- a/src/libs/ErrorUtils.ts +++ b/src/libs/ErrorUtils.ts @@ -1,13 +1,14 @@ import mapValues from 'lodash/mapValues'; import type {OnyxEntry} from 'react-native-onyx'; import CONST from '@src/CONST'; +import IntlStore from '@src/languages/IntlStore'; import type {TranslationPaths} from '@src/languages/types'; import type {ErrorFields, Errors, TranslationKeyError, TranslationKeyErrors} from '@src/types/onyx/OnyxCommon'; import type Response from '@src/types/onyx/Response'; import type {ReceiptError} from '@src/types/onyx/Transaction'; import DateUtils from './DateUtils'; // eslint-disable-next-line @typescript-eslint/no-deprecated -import {translateLocal} from './Localize'; +import {translate, translateLocal} from './Localize'; function getAuthenticateErrorMessage(response: Response): TranslationPaths { switch (response.jsonCode) { @@ -99,6 +100,11 @@ function getLatestErrorMessageField(onyxDa } const key = Object.keys(errors).sort().reverse().at(0) ?? ''; + const currentLocale = IntlStore.getCurrentLocale(); + + if (errors[key] === CONST.ERROR.BANK_ACCOUNT_SAME_DEPOSIT_AND_WITHDRAWAL_ERROR) { + return {key: translate(currentLocale, 'bankAccount.error.sameDepositAndWithdrawalAccount')}; + } return {key: errors[key]}; } diff --git a/src/libs/TransactionPreviewUtils.ts b/src/libs/TransactionPreviewUtils.ts index 7dc622cfa0e7..c766df40a641 100644 --- a/src/libs/TransactionPreviewUtils.ts +++ b/src/libs/TransactionPreviewUtils.ts @@ -289,6 +289,10 @@ function getTransactionPreviewTextAndTranslationPaths({ previewHeaderText = [{translationPath: 'iou.split'}]; } + if (RBRMessage?.text === CONST.ERROR.BANK_ACCOUNT_SAME_DEPOSIT_AND_WITHDRAWAL_ERROR) { + RBRMessage = {translationPath: 'bankAccount.error.sameDepositAndWithdrawalAccount'}; + } + RBRMessage ??= {text: ''}; if (!isCreatedMissing(transaction)) {