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

[Awaiting Payment Sept 24th] [$125] Pay elsewhere missing as a payment method when configured for direct reimbursement on a workspace #48657

Closed
6 tasks done
trjExpensify opened this issue Sep 5, 2024 · 26 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@trjExpensify
Copy link
Contributor

trjExpensify commented Sep 5, 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: v9.0.29-7
Reproducible in staging?: Y
Reproducible in production?: Y
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: @trjExpensify
Slack conversation: #36301 (comment)

Action Performed:

  1. Create a workspace
  2. Go to More features > Enable Workflows
  3. Go to Workflows > Enable approvals and payments
  4. Click Connect bank account and add a VBBA
  5. Submit an expense report on the workspace
  6. Go to the expense report
  7. Observe the Pay button

Expected Result:

The pay button should have an option to change it to Pay elsewhere to mark the report as manually reimbursed.

Actual Result:

The pay button does not have that option, only Pay $x using Expensify.

Workaround:

No

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

image image

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021831725635476300859
  • Upwork Job ID: 1831725635476300859
  • Last Price Increase: 2024-09-05
  • Automatic offers:
    • shubham1206agra | Contributor | 103842728
Issue OwnerCurrent Issue Owner: @trjExpensify
@trjExpensify trjExpensify added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 5, 2024
Copy link

melvin-bot bot commented Sep 5, 2024

Current assignee @trjExpensify is eligible for the Bug assigner, not assigning anyone new.

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Sep 5, 2024
Copy link

melvin-bot bot commented Sep 5, 2024

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

@melvin-bot melvin-bot bot changed the title Pay elsewhere missing as a payment method when configured for direct reimbursement on a workspace [$250] Pay elsewhere missing as a payment method when configured for direct reimbursement on a workspace Sep 5, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 5, 2024
Copy link

melvin-bot bot commented Sep 5, 2024

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

@mountiny mountiny changed the title [$250] Pay elsewhere missing as a payment method when configured for direct reimbursement on a workspace [$125] Pay elsewhere missing as a payment method when configured for direct reimbursement on a workspace Sep 5, 2024
Copy link

melvin-bot bot commented Sep 5, 2024

Upwork job price has been updated to $125

@nyomanjyotisa
Copy link
Contributor

Proposal

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

Pay elsewhere missing as a payment method when configured for direct reimbursement on a workspace

What is the root cause of that problem?

The shouldShowPayElsewhereOption here is return false because both !isPaidGroupPolicy and policy?.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_MANUAL are false

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

we displaying the VBBA option if both isExpenseReport and shouldShowPaywithExpensifyOption are true

So add another condition on shouldShowPayElsewhereOption to show it if both isExpenseReport and shouldShowPaywithExpensifyOption are true

const shouldShowPayElsewhereOption = (!isPaidGroupPolicy || policy?.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_MANUAL || (isExpenseReport && shouldShowPaywithExpensifyOption)) && !isInvoiceReport;

also we need to move the shouldShowPayElsewhereOption to inside paymentButtonOptions after isExpenseReport declaration

Result
image

What alternative solutions did you explore? (Optional)

@neonbhai
Copy link
Contributor

neonbhai commented Sep 5, 2024

Proposal

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

Pay elsewhere missing as a payment method when configured for direct reimbursement on a workspace

What is the root cause of that problem?

We only allow the Pay Elsewhere option when policy.reimbursementChoice is REIMBURSEMENT_MANUAL.

We now want to show the option when reimbursement choice is either Manual or REIMBURSEMENT_YES.

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

We will change the logic here:

const shouldShowPayElsewhereOption = (!isPaidGroupPolicy || policy?.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_MANUAL) && !isInvoiceReport;

to:

const shouldShowPayElsewhereOption = (!isPaidGroupPolicy || policy?.reimbursementChoice 
    	!== CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_NO) && !isInvoiceReport;

@Nodebrute
Copy link
Contributor

Proposal

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

Pay elsewhere missing as a payment method when configured for direct reimbursement on a workspace

What is the root cause of that problem?

Here we only show pay elsewhere only when policy?.reimbursementChoice is reimburseManual but when bank account is accounted the policy?.reimbursementChoice is reimburseYes

const shouldShowPayElsewhereOption = (!isPaidGroupPolicy || policy?.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_MANUAL) && !isInvoiceReport;

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

We don't need the policy?.reimbursementChoice check because in canIOUBePaid we already hide the button when policy?.reimbursementChoice === reimburseNo and for other two options we want to show pay elsewhere button

App/src/libs/actions/IOU.ts

Lines 6844 to 6846 in 8fc5e68

if (policy?.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_NO) {
return false;
}

We can change this code to

  const shouldShowPayElsewhereOption = !isPaidGroupPolicy || !isInvoiceReport;

What alternative solutions did you explore? (Optional)

Or we can change this to

  const shouldShowPayElsewhereOption =  !isInvoiceReport;

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 6, 2024
Copy link

melvin-bot bot commented Sep 6, 2024

📣 @shubham1206agra 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@mountiny
Copy link
Contributor

mountiny commented Sep 6, 2024

We chose @shubham1206agra to work on it based on internal slack discussion and clarification of the logic. Apologies for not making this cleaner before and losing some time then @shubham1206agra What is your ETA for a PR

Copy link

melvin-bot bot commented Sep 9, 2024

@trjExpensify, @mountiny, @shubham1206agra, @aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Sep 9, 2024
@trjExpensify
Copy link
Contributor Author

@shubham1206agra didn't you have a PR for this?

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 Overdue labels Sep 10, 2024
Copy link

melvin-bot bot commented Sep 17, 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.

@trjExpensify trjExpensify changed the title [$125] Pay elsewhere missing as a payment method when configured for direct reimbursement on a workspace [Awaiting Payment Sept 24th] [$125] Pay elsewhere missing as a payment method when configured for direct reimbursement on a workspace Sep 23, 2024
@trjExpensify trjExpensify added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Sep 23, 2024
@trjExpensify trjExpensify added Daily KSv2 and removed Weekly KSv2 Overdue labels Sep 23, 2024
@trjExpensify
Copy link
Contributor Author

Payment will be due tomorrow. 👍

@trjExpensify
Copy link
Contributor Author

Payment summary as follows:

Aimane, go ahead and request. @shubham1206agra please accept the offer, it's waiting on yah.

@trjExpensify
Copy link
Contributor Author

trjExpensify commented Sep 25, 2024

and Melvin, please feel free to jump in a lake.

@melvin-bot melvin-bot bot removed the Overdue label Sep 25, 2024
@trjExpensify
Copy link
Contributor Author

@shubham1206agra can you accept the offer so we can close this?

@shubham1206agra
Copy link
Contributor

@trjExpensify Accepted offer

@melvin-bot melvin-bot bot added Daily KSv2 and removed Daily KSv2 labels Sep 29, 2024
@aimane-chnaif
Copy link
Contributor

I am still using upwork

@trjExpensify
Copy link
Contributor Author

I am still using upwork

Oh really? Why so? You're in the list for NewDot. 🤔

@aimane-chnaif
Copy link
Contributor

yes I am eligible but I moved back to upwork

@trjExpensify
Copy link
Contributor Author

Got it. @mallenexpensify will work on getting that update. In the meantime, an offer has been sent.

Copy link

melvin-bot bot commented Oct 3, 2024

@trjExpensify @mountiny @shubham1206agra @aimane-chnaif this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

@trjExpensify
Copy link
Contributor Author

Paid, closing!

@aimane-chnaif
Copy link
Contributor

@trjExpensify Payment failed due to upwork bug. Can you please reopen?

@trjExpensify
Copy link
Contributor Author

I've paid a bonus to get around that. Let me know if that doesn't work.

@aimane-chnaif
Copy link
Contributor

Received bonus. Thanks

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

No branches or pull requests

7 participants