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

IOU - An administrator cannot edit an unpaid IOU created by an employee #34181

Closed
6 tasks done
lanitochka17 opened this issue Jan 9, 2024 · 9 comments
Closed
6 tasks done
Assignees

Comments

@lanitochka17
Copy link

lanitochka17 commented Jan 9, 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: 1.4.23-0
Reproducible in staging?: Y
Reproducible in production?: N
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: Applause - Internal Team
Slack conversation:

Action Performed:

Preconditions:
In OldDot under admin, create a Collect group policy, enable categories and add 3 categories, add an employee to the policy.

  1. Open New Expensify app
  2. Log in to the employee's account
  3. Tap on the green plus button (FAB)
  4. Select Request money
  5. Select any currency and amount
  6. Click next
  7. Choose a group policy room
  8. Click on "Show more"
  9. Select a category and fill in the rest of the required data
  10. Complete the IOU request
  11. Re-login with the administrator account
  12. Navigate to the WS room where the IOU was sent
  13. Open the IOU created by the employee
  14. Try editing the IOU details

Expected Result:

The administrator should be able to edit an unpaid IOU created by an employee

Actual Result:

An administrator cannot edit an unpaid IOU created by an employee

Workaround:

Unknown

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

Bug6337039_1704827590387.Recording__1051.mp4

View all open jobs on GitHub

@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Jan 9, 2024
Copy link
Contributor

github-actions bot commented Jan 9, 2024

👋 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.

Copy link

melvin-bot bot commented Jan 9, 2024

Triggered auto assignment to @tgolen (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@unidev727
Copy link
Contributor

unidev727 commented Jan 9, 2024

Proposal

from: @unicorndev-727

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

IOU - An administrator cannot edit an unpaid IOU created by an employee

What is the root cause of that problem?

The root cause is that only isRequestor can edit if the report is not approved or settled here.

return !isReportApproved(moneyRequestReport) && !isSettled(moneyRequestReport?.reportID) && isRequestor;

This is derived from this #33633

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

We need to update like this.

return !isReportApproved(moneyRequestReport) && !isSettled(moneyRequestReport?.reportID) && (isRequestor || isAdmin || isManager);

What alternative solutions did you explore?

N/A

@tgolen tgolen assigned youssef-lr and unassigned tgolen Jan 9, 2024
@tgolen
Copy link
Contributor

tgolen commented Jan 9, 2024

@youssef-lr can you confirm this was a regression from your PR and if so, work on a fix for it? If you confirm it's not related to your PR, please assign it back to me. @unicorndev-727 thanks for the initial RCA!

@Pujan92
Copy link
Contributor

Pujan92 commented Jan 9, 2024

Is it intentional to not allow edit when the status is OPEN as I am seeing the comment in that PR.

App/src/libs/ReportUtils.ts

Lines 1896 to 1898 in 5d0931d

// Admin & managers can always edit coding fields such as tag, category, billable, etc. As long as the report has a state higher than OPEN.
if ((isAdmin || isManager) && !isDraftExpenseReport(moneyRequestReport)) {
return true;

@youssef-lr
Copy link
Contributor

Correct @Pujan92, the report is not submitted yet, so the admin shouldn't be able to edit it. cc @trjExpensify we can close this right?

@youssef-lr youssef-lr removed the DeployBlockerCash This issue or pull request should block deployment label Jan 9, 2024
@youssef-lr
Copy link
Contributor

Removing blocker for now, will wait for confirmation from Tom whether or not reports in Free policies can be edited by admins while they're still open.

@youssef-lr youssef-lr added Daily KSv2 and removed Hourly KSv2 labels Jan 9, 2024
@trjExpensify
Copy link
Contributor

trjExpensify commented Jan 9, 2024

How are there open reports on free workspaces, given that the report start out on processing? 😕

@youssef-lr
Copy link
Contributor

youssef-lr commented Jan 12, 2024

ah looks like this was tested on a Collect workspace, as per OP:

Preconditions:
In OldDot under admin, create a Collect group policy,

My I missed this. I think we're good here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants