Skip to content

Commit

Permalink
Merge pull request #29689 from ygshbht/lhn-first-iou-expense-request-…
Browse files Browse the repository at this point in the history
…title-update

LHN OptionItem subtitle - If money request total is 0, say 'user owes…
  • Loading branch information
luacmartins authored Oct 19, 2023
2 parents fd169e2 + e4027e0 commit 4689719
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,8 @@ function getPolicyExpenseChatName(report, policy = undefined) {
* @returns {String}
*/
function getMoneyRequestReportName(report, policy = undefined) {
const formattedAmount = CurrencyUtils.convertToDisplayString(getMoneyRequestReimbursableTotal(report), report.currency);
const moneyRequestTotal = getMoneyRequestReimbursableTotal(report);
const formattedAmount = CurrencyUtils.convertToDisplayString(moneyRequestTotal, report.currency);
const payerName = isExpenseReport(report) ? getPolicyName(report, false, policy) : getDisplayNameForParticipant(report.managerID);
const payerPaidAmountMesssage = Localize.translateLocal('iou.payerPaidAmount', {
payer: payerName,
Expand All @@ -1449,7 +1450,7 @@ function getMoneyRequestReportName(report, policy = undefined) {
return Localize.translateLocal('iou.payerSpentAmount', {payer: payerName, amount: formattedAmount});
}

if (report.hasOutstandingIOU) {
if (report.hasOutstandingIOU || moneyRequestTotal === 0) {
return Localize.translateLocal('iou.payerOwesAmount', {payer: payerName, amount: formattedAmount});
}

Expand Down

0 comments on commit 4689719

Please sign in to comment.