App
App copied to clipboard
[$500] `Pay` button appears for the approved report
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 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: @JmillsExpensify Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1705978407170839
Action Performed:
- submit a expense report to approver
- Approve the expense report
Expected Result:
"pay" button should disappear
Actual Result:
"pay" button still appears
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
- [ ] Android: Native
- [ ] Android: mWeb Chrome
- [x] iOS: Native
- [ ] iOS: mWeb Safari
- [ ] MacOS: Chrome / Safari
- [ ] MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~01649969eb5b52cb20
- Upwork Job ID: 1750230674366476288
- Last Price Increase: 2024-01-24
Triggered auto assignment to @NicMendonca (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Job added to Upwork: https://www.upwork.com/jobs/~01649969eb5b52cb20
Triggered auto assignment to Contributor-plus team member for initial proposal review - @c3024 (External
)
Still seeing this daily
Proposal
Please re-state the problem that we are trying to solve in this issue.
Pay option is still appears after approving the expense.
What is the root cause of that problem?
It's simply because we don't hide the pay button when the expense is approved. https://github.com/Expensify/App/blob/0d0b0a8c9b073c30a9b54de15066789d17f7c718/src/components/MoneyReportHeader.tsx#L68-L71
What changes do you think we should make in order to solve the problem?
Hide the button when the expense is approved by adding !isApproved
condition to shouldShowPayButton
.
(we need to do this in ReportPreview too)
but how will the expense get paid if the pay button is hidden and it's not automatically reimbursed?
It is partially a duplicate of https://github.com/Expensify/App/issues/34951 where the Pay button should be hidden when auto-reimbursement is enabled, but we'd also need to check if the user is a Reimburser (not just an admin). Assigning myself to take it over.
Thanks for the proposal @bernhardoj, but this GH will be internal since it will require BE changes.
Current assignee @c3024 is eligible for the Internal assigner, not assigning anyone new.
@marcochavezf, @NicMendonca, @c3024 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Working on it
PRs up to only display the Pay button to the reimburser (and not all admins):
- https://github.com/Expensify/Web-Expensify/pull/40709
- https://github.com/Expensify/App/pull/35347
Starting leave so re-assigning!
Triggered auto assignment to @twisterdotcom (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Updated the App PR from latest main and mark it ready for review
⚠️ Looks like this issue was linked to a Deploy Blocker here
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
@marcochavezf, @twisterdotcom, @c3024 Whoops! This issue is 2 days overdue. Let's get this updated quick!
Is it? What do we need to do here?
Seems there's an edge case for indirect reimbursement
, discussing here
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.40-5 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
- https://github.com/Expensify/App/pull/35347
If no regressions arise, payment will be issued on 2024-02-20. :confetti_ball:
For reference, here are some details about the assignees on this issue:
- @c3024 requires payment (Needs manual offer from BZ)
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
- [ ] [@c3024] The PR that introduced the bug has been identified. Link to the PR:
- [ ] [@c3024] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
- [ ] [@c3024] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
- [ ] [@c3024] Determine if we should create a regression test for this bug.
- [ ] [@c3024] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
- [ ] [@twisterdotcom] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Coming from this convo, we'd need to update the Pay
button logic based on the reimbursement settings:
None - No pay button at all. The final report destination is either closed or approved based on “Submit & Close” or “Submit & Approve” mode.
Direct - Pay using Expensify shown to the admin that is configured for payment in the workspace (i.e the “assigned reimburser”)
Indirect - Pay elsewhere show to all admins
@c3024 want to handle this as well please?
Yes @twisterdotcom . Thanks
Also coming from the same convo, we want to simplify this condition in favor of the group policies (we will remove the free plan soon) cc @c3024
Also we'd need to update this condition for the report preview.
@marcochavezf you're working on a PR for this, correct?
Hi @c3024, I was wondering if you've had a chance to work on this? If not, no worries at all, I'm more than happy to take care of the pending changes by creating a PR today.
My bad, I misunderstood that I'd take this as C+ for review. 😄 I will make the PR right away.
Could you confirm these?
REIMBURSEMENT_YES: 'reimburseYes', = Direct
REIMBURSEMENT_NO: 'reimburseNo', = None
REIMBURSEMENT_MANUAL: 'reimburseManual', = Indirect
Also coming from the same convo, we want to simplify this condition in favor of the group policies (we will remove the free plan soon).
This means isPaidGroupPolicy
is always true henceforth, right?
@marcochavezf
Thanks @c3024, yeah the meaning of the reimbursement values is correct and also yes, the isPaidGroupPolicy
will be always true