Skip to content

Commit

Permalink
Merge pull request #36993 from dukenv0307/fix/33819
Browse files Browse the repository at this point in the history
Fix system paid message
  • Loading branch information
srikarparsi authored Feb 22, 2024
2 parents 6f28014 + 28375a3 commit 42f1c68
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2370,7 +2370,9 @@ function getReportPreviewMessage(
if (isSettled(report.reportID) || (report.isWaitingOnBankAccount && isPreviewMessageForParentChatReport)) {
// A settled report preview message can come in three formats "paid ... elsewhere" or "paid ... with Expensify"
let translatePhraseKey: TranslationPaths = 'iou.paidElsewhereWithAmount';
if (
if (isPreviewMessageForParentChatReport) {
translatePhraseKey = 'iou.payerPaidAmount';
} else if (
[CONST.IOU.PAYMENT_TYPE.VBBA, CONST.IOU.PAYMENT_TYPE.EXPENSIFY].some((paymentType) => paymentType === originalMessage?.paymentType) ||
!!reportActionMessage.match(/ (with Expensify|using Expensify)$/) ||
report.isWaitingOnBankAccount
Expand Down Expand Up @@ -4711,7 +4713,6 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry<ReportAction>)
// property. If it does, it indicates that this is a 'Send money' action.
const {amount, currency} = originalMessage.IOUDetails ?? originalMessage;
const formattedAmount = CurrencyUtils.convertToDisplayString(Math.abs(amount), currency) ?? '';
const payerName = isExpenseReport(iouReport) ? getPolicyName(iouReport) : getDisplayNameForParticipant(iouReport?.managerID, true);

switch (originalMessage.paymentType) {
case CONST.IOU.PAYMENT_TYPE.ELSEWHERE:
Expand All @@ -4725,7 +4726,7 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry<ReportAction>)
translationKey = 'iou.payerPaidAmount';
break;
}
return Localize.translateLocal(translationKey, {amount: formattedAmount, payer: payerName ?? ''});
return Localize.translateLocal(translationKey, {amount: formattedAmount, payer: ''});
}

const transaction = TransactionUtils.getTransaction(originalMessage.IOUTransactionID ?? '');
Expand Down

0 comments on commit 42f1c68

Please sign in to comment.