Skip to content
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

Mark as cash appears in the expense report instead of the expense page #56498

Open
1 of 8 tasks
m-natarajan opened this issue Feb 7, 2025 · 4 comments
Open
1 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Needs Reproduction Reproducible steps needed

Comments

@m-natarajan
Copy link

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number:
Reproducible in staging?: needs reproduction
Reproducible in production?: needs reproduction
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @puneetlath
Slack conversation (hyperlinked to channel name): expense

Action Performed:

  1. Have a card expense report with more than 1
  2. Hold one of the expense
  3. Obseve the expense report

Expected Result:

Mark as cash should not appear in the expense report, should appear only in the expense

Actual Result:

Mark as cash appears in the report

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Please check the [orignal post in the slack](https://expensify.slack.com/archives/C06ML6X0W9L/p1738795695898019)

View all open jobs on GitHub

@m-natarajan m-natarajan added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Needs Reproduction Reproducible steps needed labels Feb 7, 2025
Copy link

melvin-bot bot commented Feb 7, 2025

Triggered auto assignment to @MitchExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@MelvinBot
Copy link

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

@nkdengineer
Copy link
Contributor

nkdengineer commented Feb 7, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-02-07 03:49:59 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

Mark as cash appears in the report

What is the root cause of that problem?

We always show the Mark as cash button if all transactions are pending RTER Violations then if two transactions are pending RTER Violations this button appears. But this button should only appear in the combined or transaction thread reports.

const shouldShowMarkAsCashButton =
hasAllPendingRTERViolations || (shouldShowBrokenConnectionViolation && (!isPolicyAdmin(policy) || isCurrentUserSubmitter(moneyRequestReport?.reportID)));

What changes do you think we should make in order to solve the problem?

We should add the check !!transactionThreadReportID here so it only shows the button if the report is the one expense report.

const shouldShowMarkAsCashButton =
        !!transactionThreadReportID &&
        (hasAllPendingRTERViolations || (shouldShowBrokenConnectionViolation && (!isPolicyAdmin(policy) || isCurrentUserSubmitter(moneyRequestReport?.reportID))));

const shouldShowMarkAsCashButton =
hasAllPendingRTERViolations || (shouldShowBrokenConnectionViolation && (!isPolicyAdmin(policy) || isCurrentUserSubmitter(moneyRequestReport?.reportID)));

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

This is an UI issue so I don't think we need to add the test. Or

What alternative solutions did you explore? (Optional)

NA

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@dominictb
Copy link
Contributor

dominictb commented Feb 7, 2025

@MitchExpensify I can reproduce this with these steps. I can take over.

  1. Create two expenses in an expense report
  2. Follow this PR Add markAsCash button with wired up action for dismissing the rter violation #41835 to mock data for RTER violation for two transactions above
  3. Do not reopen each transaction report because that would clear the mock data
  4. Then you can see the Mark as cash button appears in the header of the expense report with two transactions

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Needs Reproduction Reproducible steps needed
Projects
Status: No status
Development

No branches or pull requests

5 participants