Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,7 @@ function MoneyRequestView({allReports, report, policy, shouldShowAnimatedBackgro
const hasRoute = hasRouteTransactionUtils(transactionBackup ?? transaction, isDistanceRequest);
const shouldDisplayTransactionAmount = ((isDistanceRequest && hasRoute) || !!transactionAmount) && transactionAmount !== undefined;
const formattedTransactionAmount = shouldDisplayTransactionAmount ? convertToDisplayString(transactionAmount, transactionCurrency) : '';
const formattedPerAttendeeAmount =
shouldDisplayTransactionAmount && ((hasReceipt && !isTransactionScanning && didReceiptScanSucceed) || isPerDiemRequest)
? convertToDisplayString(transactionAmount / (transactionAttendees?.length ?? 1), transactionCurrency)
: '';
const formattedPerAttendeeAmount = shouldDisplayTransactionAmount ? convertToDisplayString(transactionAmount / (transactionAttendees?.length ?? 1), transactionCurrency) : '';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@c3024 I removed is receipt scanning check because it prevents the per-person from being shown in case of replacing the receipt of receipt request. But the changed receipt value doesn't affect the amount of the transaction; the amount stays at the first set value so we should display the per-person as long as there is an amount to display.

@c3024 c3024 Jul 25, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It used to be like this but there was a PR that added this extra check for receipt scanning. I saw that when I was checking the proposals. I think this was added for cases of failed scan requests with invalid receipts. We should ensure that the flows that required this addition are not broken. I will try finding that PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But for failed receipt the amount if falsy so the current condition still works.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, that's correct. It looks like this PR added other checks to the existing shouldDisplayTransactionAmount only check. I tested all the cases mentioned there and have not found anything broken with this change. I think we can go with the standalone shouldDisplayTransactionAmount check. 🤞

const formattedOriginalAmount = transactionOriginalAmount && transactionOriginalCurrency && convertToDisplayString(transactionOriginalAmount, transactionOriginalCurrency);
const isCardTransaction = isCardTransactionTransactionUtils(transaction);
const cardProgramName = getCompanyCardDescription(transaction?.cardName, transaction?.cardID, cardList);
Expand Down