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

[HOLD for payment 2024-03-14] [HOLD for payment #36814] [$500] [Collect approvers] Pay button appears for the approved report #34951

Closed
1 of 6 tasks
kavimuru opened this issue Jan 23, 2024 · 41 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Internal Requires API changes or must be handled by Expensify staff Weekly KSv2

Comments

@kavimuru
Copy link

kavimuru commented Jan 23, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com 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:

  1. submit a expense report to approver
  2. 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
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01649969eb5b52cb20
  • Upwork Job ID: 1750230674366476288
  • Last Price Increase: 2024-01-24
@kavimuru kavimuru added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Jan 23, 2024
Copy link

melvin-bot bot commented Jan 23, 2024

Triggered auto assignment to @NicMendonca (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@NicMendonca NicMendonca added External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed labels Jan 24, 2024
Copy link

melvin-bot bot commented Jan 24, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01649969eb5b52cb20

@melvin-bot melvin-bot bot changed the title Pay button appears for the approved report [$500] Pay button appears for the approved report Jan 24, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 24, 2024
Copy link

melvin-bot bot commented Jan 24, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @c3024 (External)

@JmillsExpensify
Copy link

Still seeing this daily

@bernhardoj
Copy link
Contributor

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.

const shouldShowPayButton = useMemo(
() => isPayer && !isDraft && !isSettled && !moneyRequestReport.isWaitingOnBankAccount && reimbursableTotal !== 0 && !ReportUtils.isArchivedRoom(chatReport) && !isAutoReimbursable,
[isPayer, isDraft, isSettled, moneyRequestReport, reimbursableTotal, chatReport, isAutoReimbursable],
);

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?

@marcochavezf
Copy link
Contributor

It is partially a duplicate of #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.

@marcochavezf marcochavezf self-assigned this Jan 25, 2024
@marcochavezf
Copy link
Contributor

Thanks for the proposal @bernhardoj, but this GH will be internal since it will require BE changes.

@marcochavezf marcochavezf added Internal Requires API changes or must be handled by Expensify staff and removed External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Jan 25, 2024
Copy link

melvin-bot bot commented Jan 25, 2024

Current assignee @c3024 is eligible for the Internal assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added the Overdue label Jan 29, 2024
Copy link

melvin-bot bot commented Jan 29, 2024

@marcochavezf, @NicMendonca, @c3024 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@marcochavezf
Copy link
Contributor

Working on it

@melvin-bot melvin-bot bot removed the Overdue label Jan 29, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jan 30, 2024
@marcochavezf
Copy link
Contributor

marcochavezf commented Jan 30, 2024

PRs up to only display the Pay button to the reimburser (and not all admins):

@marcochavezf
Copy link
Contributor

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.

@c3024
Copy link
Contributor

c3024 commented Feb 19, 2024

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

@marcochavezf
Copy link
Contributor

Thanks @c3024, yeah the meaning of the reimbursement values is correct and also yes, the isPaidGroupPolicy will be always true

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Feb 20, 2024

This comment was marked as outdated.

@twisterdotcom
Copy link
Contributor

I think we are going to wait for the follow up PR. @c3024 can you share your Upwork profile link for me?

@twisterdotcom
Copy link
Contributor

twisterdotcom commented Feb 20, 2024

@marcochavezf this was just an edge case we didn't consider, is that correct? Not a regression or failure in testing? if so, I'm thinking this deserves then the full payment of $500, and we can just add a small $250 bonus for the extra edge case handling?

@twisterdotcom twisterdotcom changed the title [HOLD for payment 2024-02-20] [$500] Pay button appears for the approved report [HOLD for payment #36814] [$500] Pay button appears for the approved report Feb 20, 2024
@aimane-chnaif
Copy link
Contributor

The original PR was reverted anyway

@marcochavezf
Copy link
Contributor

Yup, it was an edge case that required more discussion and was reverted to unblock the deployment at that moment

@twisterdotcom
Copy link
Contributor

Hmm okay, so we'll just do one payment of $500, because this is a fix for something that required reverting. The original solution didn't consider the edge cases.

@marcochavezf
Copy link
Contributor

Waiting for this PR to be merged.

@trjExpensify trjExpensify changed the title [HOLD for payment #36814] [$500] Pay button appears for the approved report [HOLD for payment #36814] [$500] [Collect approvers] Pay button appears for the approved report Mar 5, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Mar 7, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment #36814] [$500] [Collect approvers] Pay button appears for the approved report [HOLD for payment 2024-03-14] [HOLD for payment #36814] [$500] [Collect approvers] Pay button appears for the approved report Mar 7, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 7, 2024
Copy link

melvin-bot bot commented Mar 7, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Mar 7, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.48-0 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-03-14. 🎊

For reference, here are some details about the assignees on this issue:

  • @c3024 requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Mar 7, 2024

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:

Copy link

melvin-bot bot commented Mar 14, 2024

Payment Summary

Upwork Job

BugZero Checklist (@twisterdotcom)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1750230674366476288/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Internal Requires API changes or must be handled by Expensify staff Weekly KSv2
Projects
Archived in project
Development

No branches or pull requests

9 participants