Skip to content

Commit

Permalink
Show payer name for paid iou/expense msg in LHN
Browse files Browse the repository at this point in the history
  • Loading branch information
huzaifa-99 committed Sep 13, 2023
1 parent 6a6328c commit 3816507
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,9 @@ export default {
waitingOnBankAccount: ({submitterDisplayName}: WaitingOnBankAccountParams) => `started settling up, payment is held until ${submitterDisplayName} adds a bank account`,
settledAfterAddedBankAccount: ({submitterDisplayName, amount}: SettledAfterAddedBankAccountParams) =>
`${submitterDisplayName} added a bank account. The ${amount} payment has been made.`,
paidElsewhereWithAmount: ({payer, amount}: PaidElsewhereWithAmountParams) => `${payer ? `${payer} ` : ''}paid ${amount} elsewhere`,
paidUsingPaypalWithAmount: ({payer, amount}: PaidUsingPaypalWithAmountParams) => `${payer ? `${payer} ` : ''}paid ${amount} using Paypal.me`,
paidWithExpensifyWithAmount: ({payer, amount}: PaidWithExpensifyWithAmountParams) => `${payer ? `${payer} ` : ''}paid ${amount} using Expensify`,
paidElsewhereWithAmount: ({payer, amount}: PaidElsewhereWithAmountParams) => `${payer} paid ${amount} elsewhere`,
paidUsingPaypalWithAmount: ({payer, amount}: PaidUsingPaypalWithAmountParams) => `${payer} paid ${amount} using Paypal.me`,
paidWithExpensifyWithAmount: ({payer, amount}: PaidWithExpensifyWithAmountParams) => `${payer} paid ${amount} using Expensify`,
noReimbursableExpenses: 'This report has an invalid amount',
pendingConversionMessage: "Total will update when you're back online",
changedTheRequest: 'changed the request',
Expand Down
6 changes: 3 additions & 3 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,9 @@ export default {
waitingOnBankAccount: ({submitterDisplayName}: WaitingOnBankAccountParams) => `inicio el pago, pero no se procesará hasta que ${submitterDisplayName} añada una cuenta bancaria`,
settledAfterAddedBankAccount: ({submitterDisplayName, amount}: SettledAfterAddedBankAccountParams) =>
`${submitterDisplayName} añadió una cuenta bancaria. El pago de ${amount} se ha realizado.`,
paidElsewhereWithAmount: ({payer, amount}: PaidElsewhereWithAmountParams) => `${payer ? `${payer} ` : ''}pagó ${amount} de otra forma`,
paidUsingPaypalWithAmount: ({payer, amount}: PaidUsingPaypalWithAmountParams) => `${payer ? `${payer} ` : ''}pagó ${amount} con PayPal.me`,
paidWithExpensifyWithAmount: ({payer, amount}: PaidWithExpensifyWithAmountParams) => `${payer ? `${payer} ` : ''}pagó ${amount} con Expensify`,
paidElsewhereWithAmount: ({payer, amount}: PaidElsewhereWithAmountParams) => `${payer} pagó ${amount} de otra forma`,
paidUsingPaypalWithAmount: ({payer, amount}: PaidUsingPaypalWithAmountParams) => `${payer} pagó ${amount} con PayPal.me`,
paidWithExpensifyWithAmount: ({payer, amount}: PaidWithExpensifyWithAmountParams) => `${payer} pagó ${amount} con Expensify`,
noReimbursableExpenses: 'El importe de este informe no es válido',
pendingConversionMessage: 'El total se actualizará cuando estés online',
changedTheRequest: 'cambió la solicitud',
Expand Down
2 changes: 1 addition & 1 deletion src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ function getLastMessageTextForReport(report) {
lastMessageTextFromReport = ReportUtils.getReportPreviewMessage(report, lastReportAction, true);
} else if (ReportActionUtils.isReportPreviewAction(lastReportAction)) {
const iouReport = ReportUtils.getReport(ReportActionUtils.getIOUReportIDFromReportActionPreview(lastReportAction));
lastMessageTextFromReport = ReportUtils.getReportPreviewMessage(iouReport, lastReportAction, false, false);
lastMessageTextFromReport = ReportUtils.getReportPreviewMessage(iouReport, lastReportAction, false);
} else if (ReportActionUtils.isModifiedExpenseAction(lastReportAction)) {
lastMessageTextFromReport = ReportUtils.getModifiedExpenseMessage(lastReportAction);
} else {
Expand Down
5 changes: 2 additions & 3 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1418,10 +1418,9 @@ function getTransactionReportName(reportAction) {
* @param {Object} report
* @param {Object} [reportAction={}] This can be either a report preview action or the IOU action
* @param {Boolean} [shouldConsiderReceiptBeingScanned=false]
* @param {Boolean} [shouldShowEmailForSettledIOU=true]
* @returns {String}
*/
function getReportPreviewMessage(report, reportAction = {}, shouldConsiderReceiptBeingScanned = false, shouldShowEmailForSettledIOU = true) {
function getReportPreviewMessage(report, reportAction = {}, shouldConsiderReceiptBeingScanned = false) {
const reportActionMessage = lodashGet(reportAction, 'message[0].html', '');

if (_.isEmpty(report) || !report.reportID) {
Expand Down Expand Up @@ -1457,7 +1456,7 @@ function getReportPreviewMessage(report, reportAction = {}, shouldConsiderReceip
) {
translatePhraseKey = 'iou.paidWithExpensifyWithAmount';
}
return Localize.translateLocal(translatePhraseKey, {amount: formattedAmount, payer: shouldShowEmailForSettledIOU && payerName});
return Localize.translateLocal(translatePhraseKey, {amount: formattedAmount, payer: payerName});
}

if (report.isWaitingOnBankAccount) {
Expand Down

0 comments on commit 3816507

Please sign in to comment.