Skip to content

[$375] Export option not showing for admins on workspaces who turn off payments #72517

Closed

Description

@m-natarajan

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: 9.2.30-0
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: @ryanldonato
Slack conversation (hyperlinked to channel name): #Convert

Action Performed:

  1. Create a workspace as a user
  2. Connect to QBO
  3. Turn off payments in Workflows
  4. Add another user you can log into, make them an admin
  5. Create/Submit/Approve a report and add an expense as the workspace owner
  6. Workspace owner will see an option to Export the report
  7. Observe as other admin

Expected Result:

Other admin also see the export option

Actual Result:

Export option only displayed for workspace owner not admin

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Recording.1762.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021978202711919656087
  • Upwork Job ID: 1978202711919656087
  • Last Price Increase: 2025-11-25
  • Automatic offers:
    • daledah | Contributor | 109316845
Issue OwnerCurrent Issue Owner: @Krishna2323

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 14, 2025
  2. melvin-bot commented on Oct 14, 2025

    @melvin-bot

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

  3. dmkt9 commented on Oct 14, 2025

    @dmkt9
    Contributor

    Proposal

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

    Export option only displayed for workspace owner not admin

    What is the root cause of that problem?

    1. We use the isExportAction helper to determine whether to show the export action for the primary button.

      if (isExportAction(report, policy, reportActions)) {
      return CONST.REPORT.PRIMARY_ACTIONS.EXPORT_TO_ACCOUNTING;
      }

    2. In isExportAction, the export action is hidden for users who are not preferred exporters.

      const isReportExporter = isPreferredExporter(policy);
      if (!isReportExporter) {
      return false;
      }

    3. In isPreferredExporter, even if the current user is an admin, they won’t see the export action if they’re not included in the preferred exporter list.

      App/src/libs/PolicyUtils.ts

      Lines 1522 to 1533 in 89c45c9

      function isPreferredExporter(policy: Policy) {
      const user = getCurrentUserEmail();
      const exporters = [
      policy.connections?.intacct?.config?.export?.exporter,
      policy.connections?.netsuite?.options?.config?.exporter,
      policy.connections?.quickbooksDesktop?.config?.export?.exporter,
      policy.connections?.quickbooksOnline?.config?.export?.exporter,
      policy.connections?.xero?.config?.export?.exporter,
      ];
      return exporters.some((exporter) => exporter && exporter === user);
      }

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

    We should allow admins to always see the export action:

    function isPreferredExporter(policy: Policy) {
        if (isPolicyAdmin(policy)) {
            return true;
        }

    function isPreferredExporter(policy: Policy) {

  4. daledah commented on Oct 14, 2025

    @daledah
    Contributor

    Proposal

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

    Export option only displayed for workspace owner not admin

    What is the root cause of that problem?

    We only show the export option preferredExporter here

    const isReportExporter = isPreferredExporter(policy);
    if (!isReportExporter) {
    return false;
    }

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

    We should update this condition to allow admin can export or we can update the condition like here

        const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
    
        const isReportExporter = isPreferredExporter(policy);
        if (!isReportExporter && !isAdmin) {
            return false;
        }
    

    note: we should not update the isPreferredExporter function because it uses in many places in app and can cause regressions

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    Update the test case of the getReportPrimaryAction function to cover this screnario

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 14, 2025
  6. changed the title [-]Export option not showing for admins on workspaces who turn off payments[/-] [+][$250] Export option not showing for admins on workspaces who turn off payments[/+] on Oct 14, 2025
  7. melvin-bot commented on Oct 14, 2025

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 14, 2025
  9. JmillsExpensify commented on Oct 14, 2025

    @JmillsExpensify
    Contributor

    Opening up for proposals.

  10. melvin-bot commented on Oct 14, 2025

    @melvin-bot

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

  11. melvin-bot commented on Oct 20, 2025

    @melvin-bot

    @rushatgabhane Huh... This is 4 days overdue. Who can take care of this?

  12. 56 remaining items

  13. mvtglobally commented on Nov 29, 2025

    @mvtglobally

    Issue not reproducible during KI retests. (First week)

  14. danielrvidal commented on Dec 1, 2025

    @danielrvidal
    Contributor

    So I think this one is done then and just waiting to be paid, right?

  15. lakchote commented on Dec 2, 2025

    @lakchote
    Contributor

    @danielrvidal yes, this is correct.

  16. melvin-bot commented on Dec 4, 2025

    @melvin-bot

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

  17. trjExpensify commented on Dec 5, 2025

    @trjExpensify
    Contributor

    approved $125 for @rushatgabhane

  18. Krishna2323 commented on Dec 5, 2025

    @Krishna2323
    Contributor

    BugZero Checklist:

    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: [No QA] Implement report primary action getter #57475 (comment)

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    • User has a workspace connect to QBO with auto-sync is disabled

    Test:

    1. Create a workspace as a user
    2. Connect to QBO
    3. Turn off payments in Workflows
    4. Add another user you can log into, make them an admin
    5. Create/Submit/Approve a report and add an expense as the workspace owner
    6. Workspace owner will see an option to Export the report
    7. Observe as other admin
    8. Verify that: Other admin also see the export option

    Do we agree 👍 or 👎

  19. Krishna2323 commented on Dec 5, 2025

    @Krishna2323
    Contributor

    The PR was deployed to production on 25 Nov.

    @trjExpensify the checklist is completed, please post the payment summary when you get a chance. Thank you!

  20. trjExpensify commented on Dec 8, 2025

    @trjExpensify
    Contributor

    @JmillsExpensify is the BZ on this, not me.

  21. Krishna2323 commented on Dec 10, 2025

    @Krishna2323
    Contributor

    @JmillsExpensify could you please post the payment summary when you get a chance? Thanks!

  22. JmillsExpensify commented on Dec 12, 2025

    @JmillsExpensify
    Contributor

    Payment summary:

  23. JmillsExpensify commented on Dec 12, 2025

    @JmillsExpensify
    Contributor

    Contributor paid and regression test created.

  24. Krishna2323 commented on Dec 29, 2025

    @Krishna2323
    Contributor

    Requested in ND.

  25. twisterdotcom commented on Dec 30, 2025

    @twisterdotcom
    Contributor

    @Krishna2323 has submitted payment for this report on ND here.

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

    Zapier Logs Run ID: 00040eee-00b0-a147-ac01-dae0da3add74
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions