Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3130,6 +3130,7 @@ ${
fullName: '有効な氏名を入力してください',
ownershipPercentage: '有効なパーセント数値を入力してください',
deletePaymentBankAccount: 'この銀行口座は、Expensify Card の支払いに使用されているため削除できません。この口座をそれでも削除したい場合は、Concierge までご連絡ください。',
sameDepositAndWithdrawalAccount: '入金口座と出金口座が同じです。',
},
},
addPersonalBankAccount: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3090,6 +3090,7 @@ ${
fullName: '请输入有效的全名',
ownershipPercentage: '请输入有效的百分比数字',
deletePaymentBankAccount: '此银行账户无法删除,因为它被用于 Expensify Card 付款。如果你仍然想删除此账户,请联系 Concierge。',
sameDepositAndWithdrawalAccount: '存款和取款账户相同。',
},
},
addPersonalBankAccount: {
Expand Down
8 changes: 7 additions & 1 deletion src/libs/ErrorUtils.ts
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down Expand Up @@ -99,6 +100,11 @@ function getLatestErrorMessageField<TOnyxData extends OnyxDataWithErrors>(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]};
}
Expand Down
4 changes: 4 additions & 0 deletions src/libs/TransactionPreviewUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
Loading