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

[$250] Hold - Scanning expense can be approved as 0.00 amount and can not be edited #48590

Open
3 of 6 tasks
IuliiaHerets opened this issue Sep 4, 2024 · 29 comments
Open
3 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 4, 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.29-5
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4919126&group_by=cases:section_id&group_order=asc&group_id=309128
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

Precondition:

  1. Login as the owner of the workspace> Create a workspace
  2. Invite the approver and employee
    3.Navigate to more features> Enable "workflows"
  3. On the "Workflow" editor - enable "Add Approvals"
  4. Set the Approver account as the Approver

Steps:

  1. As employee, submit one manual and one scan expense to workspace chat
  2. As approver, hold the manual expense while other expense is still in scanning process
  3. As approver, partially approve the expense

Expected Result:

Approver should not be able to approve scanning expense

Actual Result:

Scanning expense can be approved as 0.00 amount and can not be edited when scanning complete and "Enter an amount" and "Enter an merchant" message appears

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6592611_1725437048240.Recording__3869.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021831749951127189835
  • Upwork Job ID: 1831749951127189835
  • Last Price Increase: 2024-09-19
Issue OwnerCurrent Issue Owner: @eVoloshchak
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 4, 2024
Copy link

melvin-bot bot commented Sep 4, 2024

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

@IuliiaHerets
Copy link
Author

@lschurr FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@lschurr lschurr 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/~021831749951127189835

@melvin-bot melvin-bot bot changed the title Hold - Scanning expense can be approved as 0.00 amount and can not be edited [$250] Hold - Scanning expense can be approved as 0.00 amount and can not be edited 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 - @eVoloshchak (External)

Copy link

melvin-bot bot commented Sep 10, 2024

@eVoloshchak, @lschurr Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot added the Overdue label Sep 10, 2024
Copy link

melvin-bot bot commented Sep 12, 2024

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

Copy link

melvin-bot bot commented Sep 12, 2024

@eVoloshchak, @lschurr Still overdue 6 days?! Let's take care of this!

@eVoloshchak
Copy link
Contributor

Not overdue, this is awaiting proposals

@melvin-bot melvin-bot bot removed the Overdue label Sep 15, 2024
@M00rish
Copy link
Contributor

M00rish commented Sep 17, 2024

Edited by proposal-police: This proposal was edited at 2024-09-17 11:50:43 UTC.

Proposal

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

Scanning expense can be approved as 0.00 amount and can not be edited

What is the root cause of that problem?

const shouldShowApproveButton = useMemo(() => IOU.canApproveIOU(iouReport, policy), [iouReport, policy]);

for the approval button we do not check if the unheldamount is not 0, so we don't approve it.

const shouldShowScanningSubtitle = numberOfScanningReceipts === 1 && numberOfRequests === 1;

if there are several money requests this check is going to return false, like in our case here, (there are two transactions so numberOfRequests is 2 ) and so the scanning subtitle is not shown.

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

for the approval button we need to check also if the unheld total is not 0:
const shouldShowApproveButton = useMemo(() => IOU.canApproveIOU(iouReport, policy) && Number(nonHeldAmount) !== 0, [iouReport, policy, nonHeldAmount] );

for the scanning subtitle we need to check as well if there's a scan still being done and unheldamount is 0 :

const shouldShowScanningSubtitle = (numberOfScanningReceipts === 1 && numberOfRequests === 1) || (numberOfScanningReceipts >= 1 && Number(nonHeldAmount) === 0);

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot melvin-bot bot added the Overdue label Sep 17, 2024
Copy link

melvin-bot bot commented Sep 17, 2024

📣 @M00rish! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@lschurr
Copy link
Contributor

lschurr commented Sep 17, 2024

@eVoloshchak could you check out this latest proposal?

@M00rish
Copy link
Contributor

M00rish commented Sep 17, 2024

Proposal is Updated

Copy link

melvin-bot bot commented Sep 18, 2024

@eVoloshchak, @lschurr Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Sep 19, 2024

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

Copy link

melvin-bot bot commented Sep 20, 2024

@eVoloshchak, @lschurr Eep! 4 days overdue now. Issues have feelings too...

@lschurr
Copy link
Contributor

lschurr commented Sep 20, 2024

@eVoloshchak can you look at the updated proposal?

@eVoloshchak
Copy link
Contributor

@M00rish's proposal looks good to me!

🎀👀🎀 C+ reviewed!

@melvin-bot melvin-bot bot removed the Overdue label Sep 23, 2024
Copy link

melvin-bot bot commented Sep 23, 2024

Triggered auto assignment to @grgia, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@grgia
Copy link
Contributor

grgia commented Sep 26, 2024

assigning @M00rish!

Could you move the proposed logic pertaining to showing the approval button into canApproveIOU instead of &&

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

melvin-bot bot commented Sep 26, 2024

The BZ member will need to manually hire M00rish for the Contributor role. Please store your Upwork details and apply to our Upwork job so this process is automatic in the future!

@melvin-bot melvin-bot bot removed the Overdue label Sep 26, 2024
@M00rish
Copy link
Contributor

M00rish commented Sep 30, 2024

Sure will do, I will raise a PR for review by tomorrow.

thanks!

@melvin-bot melvin-bot bot added the Overdue label Sep 30, 2024
@grgia
Copy link
Contributor

grgia commented Oct 1, 2024

@M00rish do you have an update on this?

@M00rish
Copy link
Contributor

M00rish commented Oct 1, 2024

I am working on it and wil update asap

Copy link

melvin-bot bot commented Oct 1, 2024

@eVoloshchak, @lschurr, @grgia, @M00rish Huh... This is 4 days overdue. Who can take care of this?

@M00rish
Copy link
Contributor

M00rish commented Oct 1, 2024

I encountered some issue with ios app will continue testing tomorrow

Copy link

melvin-bot bot commented Oct 3, 2024

@eVoloshchak, @lschurr, @grgia, @M00rish 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@M00rish
Copy link
Contributor

M00rish commented Oct 3, 2024

I tested on the ios platform, scaleway restricted my account and I am figuring it out with their support to test on Android as well, I apologize for the delay

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 Overdue labels Oct 6, 2024
@M00rish
Copy link
Contributor

M00rish commented Oct 6, 2024

PR is ready for review,

cc: @eVoloshchak @grgia

@ikevin127
Copy link
Contributor

ikevin127 commented Oct 22, 2024

@eVoloshchak @grgia I'm here to ask what was the logic behind the fix here, was it to not allow Approve while a scan expense is still scanning OR is it to not allow approval if the transaction amount is 0 ?

The expected result states:

Approver should not be able to approve scanning expense

Wdyt ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
No open projects
Status: Polish
Development

No branches or pull requests

6 participants