Skip to content

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

Closed

Description

@lanitochka17

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: 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

Activity

  1. github-actions commented on Jan 9, 2024

    @github-actions
    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.
  2. melvin-bot commented on Jan 9, 2024

    @melvin-bot

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

  3. unidev727 commented on Jan 9, 2024

    @unidev727
    Contributor

    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

  4. assigned and unassigned on Jan 9, 2024
  5. tgolen commented on Jan 9, 2024

    @tgolen
    Contributor

    @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!

  6. Pujan92 commented on Jan 9, 2024

    @Pujan92
    Contributor

    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;

  7. youssef-lr commented on Jan 9, 2024

    @youssef-lr
    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?

  8. youssef-lr commented on Jan 9, 2024

    @youssef-lr
    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.

  9. trjExpensify commented on Jan 9, 2024

    @trjExpensify
    Contributor

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

  10. youssef-lr commented on Jan 12, 2024

    @youssef-lr
    Contributor

    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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions