Skip to content

Commit

Permalink
Merge pull request Expensify#54031 from callstack-internal/fix/53694-…
Browse files Browse the repository at this point in the history
…invoice-report-title

Use reportName for invoice reports
  • Loading branch information
cristipaval authored Dec 18, 2024
2 parents b6ebedb + 34ab9b0 commit 1466c02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4074,11 +4074,7 @@ function getReportName(
}

if (isInvoiceReport(report)) {
if (!isInvoiceRoom(getReport(report?.chatReportID ?? ''))) {
return report?.reportName ?? getMoneyRequestReportName(report, policy, invoiceReceiverPolicy);
}

formattedName = getMoneyRequestReportName(report, policy, invoiceReceiverPolicy);
formattedName = report?.reportName ?? getMoneyRequestReportName(report, policy, invoiceReceiverPolicy);
}

if (isInvoiceRoom(report)) {
Expand Down
9 changes: 8 additions & 1 deletion src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2097,7 +2097,14 @@ function getSendInvoiceInformation(
}

// STEP 2: Create a new optimistic invoice report.
const optimisticInvoiceReport = ReportUtils.buildOptimisticInvoiceReport(chatReport.reportID, senderWorkspaceID, receiverAccountID, receiver.displayName ?? '', amount, currency);
const optimisticInvoiceReport = ReportUtils.buildOptimisticInvoiceReport(
chatReport.reportID,
senderWorkspaceID,
receiverAccountID,
receiver.displayName ?? (receiverParticipant as Participant)?.login ?? '',
amount,
currency,
);

// STEP 3: Build optimistic receipt and transaction
const receiptObject: Receipt = {};
Expand Down

0 comments on commit 1466c02

Please sign in to comment.