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-08-19] [$250] Send invoice - Hold option is present for invoice and the invoice cannot be held #45518

Closed
5 tasks done
m-natarajan opened this issue Jul 16, 2024 · 34 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Jul 16, 2024

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: 9.0.7-4
Reproducible in staging?: y
Reproducible in production?: no
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4728016
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: applause internal team
Slack conversation:

Action Performed:

Precondition:

  • User has received invoice.
  • The following steps will be performed by the invoice receiver.
  1. Go to staging.new.expensify.com
  2. Go to invoice chat.
  3. Click on the invoice preview.
  4. Click on the report header.
  5. Click Hold.
  6. Enter a reason and save it.

Expected Result:

There should be no Hold option for invoice.

Actual Result:

Hold option is present for invoice and the invoice cannot be held.

Workaround:

unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • [x iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6544135_1721145772156.20240717_000026.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0178cd3e6d26424c8a
  • Upwork Job ID: 1813589312856914205
  • Last Price Increase: 2024-08-08
  • Automatic offers:
    • ishpaul777 | Reviewer | 103157119
Issue OwnerCurrent Issue Owner: @ishpaul777
@m-natarajan m-natarajan added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Jul 16, 2024
Copy link

melvin-bot bot commented Jul 16, 2024

Triggered auto assignment to @Beamanator (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Jul 16, 2024

Triggered auto assignment to @stephanieelliott (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.

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Jul 16, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@neonbhai
Copy link
Contributor

neonbhai commented Jul 16, 2024

Proposal

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

Hold option is shown for invoice requests

What is the root cause of that problem?

From PR #44880

shouldShowHoldAction here does not account for invoice reports

const shouldShowHoldAction =
caseID !== CASES.DEFAULT &&
(canHoldUnholdReportAction.canHoldRequest || canHoldUnholdReportAction.canUnholdRequest) &&
!ReportUtils.isArchivedRoom(transactionThreadReportID ? report : parentReport, parentReportNameValuePairs);

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

We should not show Hold option for invoice reports. We will add a check for !ReportUtils.isInvoiceReport(report) in shouldShowHoldAction

@etCoderDysto
Copy link
Contributor

etCoderDysto commented Jul 16, 2024

Proposal

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

Hold option is present for invoice and the invoice cannot be held

What is the root cause of that problem?

We are referencing isPolicyAdmin function that is declared here, rather making isPolicyAdmin() function call. Therefore canModifyStatus is true for invoice recipient.

const canModifyStatus = !isTrackExpenseMoneyReport && (isPolicyAdmin || isActionOwner || isApprover);

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

  • We should check if the user is a policy admin by calling isPolicyAdmin function.
const isAdmin = isPolicyAdmin(moneyRequestReport?.policyID ?? '-1', allPolicies);
  • use isAdmin in place of isPolicyAdmin

What alternative solutions did you explore? (Optional)

Result:
For invoice scenario

Invoice.mp4

For admin for a workspace scenario

Admin.mp4

@rafecolton
Copy link
Member

Seems like we are already enforcing non-holding of invoices on the back-end due to the error shown in the video. So I think that means this is only a front-end issue where we need to not show the button. @neonbhai's solution sounds simplest to me, but it's possible I'm missing some nuance about how invoices work.

@etCoderDysto
Copy link
Contributor

@cead22
Copy link
Contributor

cead22 commented Jul 16, 2024

I agree this is a front end issue, so removing the deploy blocker label

@cead22 cead22 removed the DeployBlocker Indicates it should block deploying the API label Jul 16, 2024
@chiragsalian
Copy link
Contributor

chiragsalian commented Jul 16, 2024

nice, i was just looking here and agree. it looks like a frontend issue and not a blocker for backend.

@thienlnam
Copy link
Contributor

Going to remove the blocker - this is a new feature and I don't think invoices on NewDot are really used yet

@thienlnam thienlnam added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Jul 16, 2024
@neonbhai
Copy link
Contributor

Seems like we are already enforcing non-holding of invoices on the back-end due to the error shown in the video. So I think that means this is only a front-end issue where we need to not show the button. @neonbhai's solution sounds simplest to me, but it's possible I'm missing some nuance about how invoices work.

@rafecolton hi, production does not show Hold option to either the workspace admin, send or receiver of an invoice. We should be fine to hide it from the Report Details Page

@cdOut
Copy link
Contributor

cdOut commented Jul 17, 2024

I’m already working on a PR to clean up hold/unhold logic, I could handle this case there unless there are any objections against it.

@stephanieelliott stephanieelliott added the External Added to denote the issue can be worked on by a contributor label Jul 17, 2024
@melvin-bot melvin-bot bot changed the title Send invoice - Hold option is present for invoice and the invoice cannot be held [$250] Send invoice - Hold option is present for invoice and the invoice cannot be held Jul 17, 2024
Copy link

melvin-bot bot commented Jul 17, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0178cd3e6d26424c8a

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 17, 2024
@cdOut
Copy link
Contributor

cdOut commented Jul 29, 2024

Will be sent for a re-review today and should be merged in a few days max.

@stephanieelliott
Copy link
Contributor

stephanieelliott commented Jul 30, 2024

Just linking the PR for easy ref: #45151

Copy link

melvin-bot bot commented Aug 1, 2024

@Beamanator, @stephanieelliott, @cdOut, @ishpaul777 Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Aug 1, 2024
@cdOut
Copy link
Contributor

cdOut commented Aug 1, 2024

PR is currently being re-reviewed.

@ishpaul777
Copy link
Contributor

Thanks for update 🙏

@melvin-bot melvin-bot bot removed the Overdue label Aug 1, 2024
@ishpaul777
Copy link
Contributor

PR is in works #45151

Copy link

melvin-bot bot commented Aug 8, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@trjExpensify trjExpensify changed the title [$250] Send invoice - Hold option is present for invoice and the invoice cannot be held [Hold #44573] [$250] Send invoice - Hold option is present for invoice and the invoice cannot be held Aug 8, 2024
@melvin-bot melvin-bot bot added the Overdue label Aug 8, 2024
@ishpaul777
Copy link
Contributor

#45151 WIP

@melvin-bot melvin-bot bot removed the Overdue label Aug 9, 2024
Copy link

melvin-bot bot commented Aug 12, 2024

⚠️ 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.

@melvin-bot melvin-bot bot added the Overdue label Aug 12, 2024
@ishpaul777
Copy link
Contributor

PR is merged and on staging

@melvin-bot melvin-bot bot removed the Overdue label Aug 12, 2024
@stephanieelliott stephanieelliott added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Aug 14, 2024
@stephanieelliott
Copy link
Contributor

Ok seems this was deployed to prod on 8/12 per this comment: #45151 (comment)

Updating for 7 day hold with payment pending labels.

@stephanieelliott stephanieelliott added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Aug 16, 2024
@stephanieelliott stephanieelliott changed the title [Hold #44573] [$250] Send invoice - Hold option is present for invoice and the invoice cannot be held [HOLD for payment 2024-08-19] [$250] Send invoice - Hold option is present for invoice and the invoice cannot be held Aug 16, 2024
@ishpaul777
Copy link
Contributor

No payment required here i was not involved in PR

@stephanieelliott
Copy link
Contributor

Summarizing payment on this issue:

  • Contributor: @cdOut - no payment due (agenty)
  • Contributor+: @ishpaul777 - no payment/no review required

Upwork job is here: https://www.upwork.com/jobs/~0178cd3e6d26424c8a

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. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
No open projects
Status: Done
Development

No branches or pull requests