Skip to content
10 changes: 3 additions & 7 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1015,10 +1015,6 @@ function buildOptimisticIOUReport(ownerEmail, userEmail, total, chatReportID, cu
*/
function getIOUReportActionMessage(type, total, participants, comment, currency, paymentType = '', isSettlingUp = false) {
const amount = NumberFormatUtils.format(preferredLocale, total / 100, {style: 'currency', currency});
const displayNames = _.map(participants, participant => getDisplayNameForParticipant(participant.login, true));
const who = displayNames.length < 3
? displayNames.join(' and ')
: `${displayNames.slice(0, -1).join(', ')}, and ${_.last(displayNames)}`;
Comment thread
jasperhuangg marked this conversation as resolved.
Resolved
let paymentMethodMessage;
switch (paymentType) {
case CONST.IOU.PAYMENT_TYPE.EXPENSIFY:
Expand All @@ -1037,10 +1033,10 @@ function getIOUReportActionMessage(type, total, participants, comment, currency,
let iouMessage;
switch (type) {
case CONST.IOU.REPORT_ACTION_TYPE.CREATE:
iouMessage = `Requested ${amount} from ${who}${comment && ` for ${comment}`}`;
iouMessage = `Requested ${amount}${comment && ` for ${comment}`}`;
break;
case CONST.IOU.REPORT_ACTION_TYPE.SPLIT:
iouMessage = `Split ${amount} with ${who}${comment && ` for ${comment}`}`;
iouMessage = `Split ${amount}${comment && ` for ${comment}`}`;
break;
case CONST.IOU.REPORT_ACTION_TYPE.CANCEL:
iouMessage = `Cancelled the ${amount} request${comment && ` for ${comment}`}`;
Expand All @@ -1050,7 +1046,7 @@ function getIOUReportActionMessage(type, total, participants, comment, currency,
break;
case CONST.IOU.REPORT_ACTION_TYPE.PAY:
iouMessage = isSettlingUp
? `Settled up${paymentMethodMessage}`
? `Settled up ${amount}${paymentMethodMessage}`
: `Sent ${amount}${comment && ` for ${comment}`}${paymentMethodMessage}`;
break;
default:
Expand Down