Skip to content

Hold option is available for paid expense in new expense report view #59894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from 2 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
3 changes: 2 additions & 1 deletion src/components/MoneyReportHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,9 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea

const anyTransactionOnHold = selectedTransactions.some(isOnHoldTransactionUtils);
const allTransactionOnHold = selectedTransactions.every(isOnHoldTransactionUtils);
const isReportApprovedAndPaid = moneyRequestReport?.stateNum === CONST.REPORT.STATE_NUM.APPROVED && moneyRequestReport?.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we just name this paid. You can use the isReportManuallyReimbursed method for that too

Suggested change
const isReportApprovedAndPaid = moneyRequestReport?.stateNum === CONST.REPORT.STATE_NUM.APPROVED && moneyRequestReport?.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
const isReportReimbursed = moneyRequestReport?.stateNum === CONST.REPORT.STATE_NUM.APPROVED && moneyRequestReport?.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;


if (!anyTransactionOnHold && selectedTransactions.length === 1) {
if (!anyTransactionOnHold && selectedTransactions.length === 1 && !isReportApprovedAndPaid) {
Copy link
Contributor

Choose a reason for hiding this comment

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

selectedTransactions.length === 1

Unrelated to this fix, why do we need to add this condition?

Copy link
Contributor

Choose a reason for hiding this comment

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

One more thing, should hold option be available for approved expenses in the new expense report view?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Responded in Slack

Copy link
Contributor Author

@sumo-slonik sumo-slonik Apr 10, 2025

Choose a reason for hiding this comment

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

We check if the length is 1 because the API accepts a maximum one transaction at a time on hold, and we’ve decided that sending in a loop is not a good solution.

options.push({
text: translate('iou.hold'),
icon: Expensicons.Stopwatch,
Expand Down
Loading