diff --git a/src/languages/en.ts b/src/languages/en.ts index f4c7bdc6ee60..6688a0e26528 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -27,6 +27,7 @@ import type { SettleExpensifyCardParams, RequestAmountParams, SplitAmountParams, + DidSplitAmountMessageParams, AmountEachParams, PayerOwesAmountParams, PayerOwesParams, @@ -544,6 +545,7 @@ export default { requestAmount: ({amount}: RequestAmountParams) => `request ${amount}`, requestedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `requested ${formattedAmount}${comment ? ` for ${comment}` : ''}`, splitAmount: ({amount}: SplitAmountParams) => `split ${amount}`, + didSplitAmount: ({formattedAmount, comment}: DidSplitAmountMessageParams) => `split ${formattedAmount}${comment ? ` for ${comment}` : ''}`, amountEach: ({amount}: AmountEachParams) => `${amount} each`, payerOwesAmount: ({payer, amount}: PayerOwesAmountParams) => `${payer} owes ${amount}`, payerOwes: ({payer}: PayerOwesParams) => `${payer} owes: `, diff --git a/src/languages/es.ts b/src/languages/es.ts index 1bbb056e82ef..064d4f0e8cd0 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -27,6 +27,7 @@ import type { SettleExpensifyCardParams, RequestAmountParams, SplitAmountParams, + DidSplitAmountMessageParams, AmountEachParams, PayerOwesAmountParams, PayerOwesParams, @@ -536,6 +537,7 @@ export default { requestAmount: ({amount}: RequestAmountParams) => `solicitar ${amount}`, requestedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `solicité ${formattedAmount}${comment ? ` para ${comment}` : ''}`, splitAmount: ({amount}: SplitAmountParams) => `dividir ${amount}`, + didSplitAmount: ({formattedAmount, comment}: DidSplitAmountMessageParams) => `dividió ${formattedAmount}${comment ? ` para ${comment}` : ''}`, amountEach: ({amount}: AmountEachParams) => `${amount} cada uno`, payerOwesAmount: ({payer, amount}: PayerOwesAmountParams) => `${payer} debe ${amount}`, payerOwes: ({payer}: PayerOwesParams) => `${payer} debe: `, diff --git a/src/languages/types.ts b/src/languages/types.ts index 3ee504ccddd7..9560cd41b25f 100644 --- a/src/languages/types.ts +++ b/src/languages/types.ts @@ -106,6 +106,8 @@ type RequestedAmountMessageParams = {formattedAmount: string; comment: string}; type SplitAmountParams = {amount: number}; +type DidSplitAmountMessageParams = {formattedAmount: string; comment: string}; + type AmountEachParams = {amount: number}; type PayerOwesAmountParams = {payer: string; amount: number}; @@ -269,6 +271,7 @@ export type { RequestAmountParams, RequestedAmountMessageParams, SplitAmountParams, + DidSplitAmountMessageParams, AmountEachParams, PayerOwesAmountParams, PayerOwesParams, diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 84381b49aea2..85ee45c8724f 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -1515,6 +1515,17 @@ function getReportPreviewMessage(report, reportAction = {}, shouldConsiderReceip return reportActionMessage; } + if (!isIOUReport(report) && ReportActionsUtils.isSplitBillAction(reportAction)) { + // This covers group chats where the last action is a split bill action + const linkedTransaction = TransactionUtils.getLinkedTransaction(reportAction); + if (_.isEmpty(linkedTransaction)) { + return reportActionMessage; + } + const {amount, currency, comment} = getTransactionDetails(linkedTransaction); + const formattedAmount = CurrencyUtils.convertToDisplayString(amount, currency); + return Localize.translateLocal('iou.didSplitAmount', {formattedAmount, comment}); + } + const totalAmount = getMoneyRequestTotal(report); const payerName = isExpenseReport(report) ? getPolicyName(report) : getDisplayNameForParticipant(report.managerID, true); const formattedAmount = CurrencyUtils.convertToDisplayString(totalAmount, report.currency);