Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.51k stars 2.87k forks source link

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

Closed trjExpensify closed 4 weeks ago

trjExpensify commented 1 month ago

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: https://github.com/Expensify/App/issues/36301#issuecomment-2329473649

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?

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
melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

Upwork job price has been updated to $125

nyomanjyotisa commented 1 month ago

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 commented 1 month ago

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:

https://github.com/Expensify/App/blob/e7bd29ad4a3f6cb4429fb383404f266791d42fa9/src/components/SettlementButton.tsx#L171 to:

const shouldShowPayElsewhereOption = (!isPaidGroupPolicy || policy?.reimbursementChoice 
        !== CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_NO) && !isInvoiceReport;
Nodebrute commented 1 month ago

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 https://github.com/Expensify/App/blob/cc1c7d066e178c0c4a74af044f2392c71eafaca3/src/components/SettlementButton.tsx#L171

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 https://github.com/Expensify/App/blob/8fc5e6867e6433c9b759e84409b8c4430b32c57b/src/libs/actions/IOU.ts#L6844-L6846

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[bot] commented 1 month ago

๐Ÿ“ฃ @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 commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

trjExpensify commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

โš ๏ธ 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 commented 1 month ago

Payment will be due tomorrow. ๐Ÿ‘

trjExpensify commented 1 month ago

Payment summary as follows:

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

trjExpensify commented 1 month ago

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

trjExpensify commented 1 month ago

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

shubham1206agra commented 1 month ago

@trjExpensify Accepted offer

aimane-chnaif commented 1 month ago

I am still using upwork

trjExpensify commented 1 month ago

I am still using upwork

Oh really? Why so? You're in the list for NewDot. ๐Ÿค”

aimane-chnaif commented 1 month ago

yes I am eligible but I moved back to upwork

trjExpensify commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

Thanks!

trjExpensify commented 4 weeks ago

Paid, closing!

aimane-chnaif commented 3 weeks ago

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

trjExpensify commented 3 weeks ago

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

aimane-chnaif commented 3 weeks ago

Received bonus. Thanks