Skip to content

[Due for payment 2026-11-25] [$175] Expense - Report files is enable when all report contain non-reimbursable expense #104162

Open

Description

@nlemma

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.5.10-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://github.com/Expensify/Expensify/issues/602527
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Windows Windows 11 - Chrome

Action Performed:

Precondition:

  • Submission frequency is changed to Instantly.
  • Disable Approvals and Payments in Workflows settings.
  1. Go to workspace chat.
  2. Create two non-reimbursable expenses in two reports.
  3. Open both reports and retract them from More menu.
  4. Click + > Create expense > Manual.
  5. Enter amount > Next.
  6. On confirm page, observe Report field.

Expected Result:

Verify that report field is disabled when all reports contain non-reimbursable expense.

Actual Result:

Report field is enabled on the confirm page

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7262464_1789651509319.A-81608.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @Krishna2323

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 15, 2026
  2. MelvinBot commented on Oct 15, 2026

    @MelvinBot
    Contributor

    Issue Analysis

    Conclusion: This is expected behavior, not a bug. The regression test's expected result is wrong. You should close this issue and update the test step.

    Why: These exact steps were already handled in [Due for payment 2026-02-16] [$250] Expense - Report field opens a blank page when all reports contain non-reimbursable expense. Its fix, [CP Staging] fix Expense - Report field opens a blank page when all reports contain non-reimbursable expense, was a partial revert "to match production behavior." Its test step 7 says: "Verify that reports are available (this matches production behavior)." The regression test seems to have copied the original bug's expected result ("report field is disabled…") rather than the behavior the fix settled on.

    Recommended action:

    1. Close this issue as expected behavior.
    2. Change the regression test step 6–7 to: "Click the Report field. Verify both retracted reports are listed."
    Investigation details

    How the confirm page decides whether the Report field is enabled

    ReportField.tsx:116 enables the field when the user has more than one outstanding report. isReportOutstanding counts any Open report, and it doesn't check whether the expenses are reimbursable. After the retract, both reports are Open again, so the count is 2 and the field is enabled.

    Report picker

    IOURequestEditReportCommon.tsx:183-189 filters reports with canAddTransaction. That function excludes reports with only non-reimbursable expenses when the workspace uses Instant Submit plus Submit & Close (ReportUtils.ts:3143-3150). However, workspace admins and report managers skip this filter. The tester changed Workflows settings, so they are an admin and see both reports. That matches the behavior chosen in the fix above.

    Small, separate gap (optional)

    A workspace member who is neither an admin nor the report manager sees an enabled Report field. When they open it, the picker hides both reports and shows only "Create report." If you want to tighten this, have ReportField.tsx count reports with the same filter the picker uses. Do not add a blanket non-reimbursable exclusion. That would bring back the blank-page bug from #81608. The open PR fix: hide ineligible move report destinations also keeps retracted Open drafts as valid destinations.

    Not verified: I didn't reproduce this in the app. The conclusion is based on the code at b9a9521 and the PR history above.


    Next Steps: Reply with @MelvinBot <your feedback> to refine this analysis.


    view run

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 15, 2026
  4. melvin-bot commented on Oct 15, 2026

    @melvin-bot

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

  5. changed the title [-]Expense - Report files is enable when all report contain non-reimbursable expense[/-] [+][$175] Expense - Report files is enable when all report contain non-reimbursable expense[/+] on Oct 15, 2026
  6. melvin-bot commented on Oct 15, 2026

    @melvin-bot
  7. janiya2 commented on Oct 15, 2026

    @janiya2

    Contributor details
    Your Expensify account email: janithad2@gmail.com
    Upwork Profile Link: https://www.upwork.com/freelancers/janithad

    Proposal

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

    On the expense confirmation page, the Report field remains enabled/interactive when all existing reports in the workspace contain non-reimbursable expenses and have been retracted.


    What is the root cause of that problem?

    1. Analysis of Current Behavior vs Intended Production Behavior:

    This exact scenario was previously addressed in Issue #81608 and resolved in PR #81676 ("[CP Staging] fix Expense - Report field opens a blank page when all reports contain non-reimbursable expense").

    In PR #81676, the testing steps explicitly defined the expected behavior:

    Precondition:

    • Submission frequency is changed to Instantly.
    • Disable Approvals and Payments in Workflows settings.
    1. Go to workspace chat.
    2. Create two non-reimbursable expenses in two reports.
    3. Open both reports and retract them from More menu.
    4. Click + > Create expense > Manual.
    5. Enter amount > Next.
    6. On confirm page, click Report field.
    7. Verify that reports are available (this matches production behavior)

    When an expense report is retracted, its status resets to Open (CONST.REPORT.STATUS_NUM.OPEN). As long as the user has more than one open outstanding report, having the Report field enabled is intentional so the user can choose which open report to attach their expense to. The regression test in BrowserStack/TestRail (https://github.com/Expensify/Expensify/issues/602527) was based on the outdated expected result from before PR #81676 settled on matching production behavior.

    2. Code-level Root Cause (if the field is intended to be disabled):

    In src/components/MoneyRequestConfirmationList/sections/ReportField.tsx:113-116:

    const outstandingReports = useOutstandingReports(undefined, isFromGlobalCreate && !isPerDiemRequest ? undefined : policyID, ownerAccountID, false);
    
    const shouldReportBeEditable = (isUnreported ? outstandingReports.length >= 1 : outstandingReports.length > 1) && !isMoneyRequestReport(reportID);
    • useOutstandingReports counts all open reports via isReportOutstanding without verifying whether those reports can accept the current transaction type via canAddTransaction.
    • Even though IOURequestEditReportCommon.tsx uses canAddTransaction(report, rules, undefined, true) to filter report picker options, ReportField.tsx determines interactivity based purely on outstandingReports.length > 1.
    • For workspace admins (or report managers), IOURequestEditReportCommon.tsx:187-189 allows both retracted reports anyway (isReportPolicyAdmin || isReportManager), so both reports are visible and selectable when opening the picker.

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

    Approach 1: Close as Expected Behavior & Update Regression Test (Recommended)

    Since PR #81676 deliberately ensured reports are available and selectable to match production behavior, close this issue as expected behavior and update TestRail test case 602527 step 6–7 to:

    "On confirm page, click Report field. Verify both retracted reports are available to select."


    Approach 2: Align ReportField.tsx with canAddTransaction Eligibility Check

    If the product team specifically wants the Report field to be disabled whenever the user does not have more than 1 eligible destination report, update ReportField.tsx to filter outstandingReports against canAddTransaction:

    In src/components/MoneyRequestConfirmationList/sections/ReportField.tsx:

    --- a/src/components/MoneyRequestConfirmationList/sections/ReportField.tsx
    +++ b/src/components/MoneyRequestConfirmationList/sections/ReportField.tsx
    @@ -113,4 +113,8 @@ function ReportField({selectedParticipants, iouType, reportID, reportActionID,
         const outstandingReports = useOutstandingReports(undefined, isFromGlobalCreate && !isPerDiemRequest ? undefined : policyID, ownerAccountID, false);
    +    const eligibleOutstandingReports = useMemo(() => {
    +        return outstandingReports.filter((report) => canAddTransaction(report, rules, undefined, true));
    +    }, [outstandingReports, rules]);
    +
         // When creating an expense in an individual report, the report field becomes read-only
         // since the destination is already determined and there's no need to show a selectable list.
    -    const shouldReportBeEditable = (isUnreported ? outstandingReports.length >= 1 : outstandingReports.length > 1) && !isMoneyRequestReport(reportID);
    +    const shouldReportBeEditable = (isUnreported ? eligibleOutstandingReports.length >= 1 : eligibleOutstandingReports.length > 1) && !isMoneyRequestReport(reportID);

    What alternative solutions did you explore? (Optional)

  8. melvin-bot commented on Oct 15, 2026

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  9. jloa-dev commented on Oct 17, 2026

    @jloa-dev

    Contributor details
    Your Expensify account email: jloa.dev@gmail.com
    Upwork Profile Link: https://www.upwork.com/freelancers/~0163955a2ba22190aa

    Proposal

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

    On the expense confirmation page, the Report field remains interactive/clickable even when all outstanding reports for the workspace contain only non-reimbursable expenses (and cannot accept new transactions), leading to an interactive field that cannot attach to those reports.

    What is the root cause of that problem?

    In src/components/MoneyRequestConfirmationList/sections/ReportField.tsx (lines 113–116):

    const outstandingReports = useOutstandingReports(undefined, isFromGlobalCreate && !isPerDiemRequest ? undefined : policyID, ownerAccountID, false);
    const shouldReportBeEditable = (isUnreported ? outstandingReports.length >= 1 : outstandingReports.length > 1) && !isMoneyRequestReport(reportID);
    • useOutstandingReports returns all outstanding reports by checking open status, but it does NOT verify whether the user/expense is eligible to add transactions to those reports.
    • Under workspaces with instant submission and submit & close (or where existing reports contain only non-reimbursable expenses), ReportUtils.canAddTransaction(report, rules, undefined, true) returns false (lines 3102–3108 of ReportUtils.ts).
    • Consequently, while outstandingReports.length > 1 evaluates to true, none of those reports can actually accept the expense. ReportField incorrectly sets shouldReportBeEditable = true, leaving the field interactive when it should be disabled / read-only.

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

    1. In src/components/MoneyRequestConfirmationList/sections/ReportField.tsx:
      • Filter outstandingReports using canAddTransaction(report, rules, undefined, true) to obtain eligibleOutstandingReports.
      • Update shouldReportBeEditable to base its threshold on eligibleOutstandingReports:
    --- a/src/components/MoneyRequestConfirmationList/sections/ReportField.tsx
    +++ b/src/components/MoneyRequestConfirmationList/sections/ReportField.tsx
    @@ -9,7 +9,7 @@ import createDynamicRoute from '@libs/Navigation/helpers/dynamicRoutesUtils/crea
     import Navigation from '@libs/Navigation/Navigation';
     import Parser from '@libs/Parser';
     import {getReportName} from '@libs/ReportNameUtils';
    -import {generateReportID, getOutstandingReportsForUser, isMoneyRequestReport, isReportOutstanding, sortOutstandingReportsBySelected} from '@libs/ReportUtils';
    +import {canAddTransaction, generateReportID, getOutstandingReportsForUser, isMoneyRequestReport, isReportOutstanding, sortOutstandingReportsBySelected} from '@libs/ReportUtils';
     
     import CONST from '@src/CONST';
     import type {IOUAction, IOUType} from '@src/CONST';
    @@ -21,7 +21,7 @@ import type {Participant} from '@src/types/onyx/IOU';
     import type {OnyxEntry} from 'react-native-onyx';
     
     import {createOutstandingReportsForPolicySelector} from '@selectors/Report';
    -import React from 'react';
    +import React, {useMemo} from 'react';
     
     import ExpenseFieldRow from './ExpenseFieldRow';
     import {useExpenseFormLayout} from './ExpenseFormLayoutContext';
    @@ -111,9 +111,13 @@ function ReportField({selectedParticipants, iouType, reportID, reportActionID, a
         })();
     
         const outstandingReports = useOutstandingReports(undefined, isFromGlobalCreate && !isPerDiemRequest ? undefined : policyID, ownerAccountID, false);
    +    const eligibleOutstandingReports = useMemo(() => {
    +        return outstandingReports.filter((report) => canAddTransaction(report, rules, undefined, true));
    +    }, [outstandingReports, rules]);
    +
         // When creating an expense in an individual report, the report field becomes read-only
         // since the destination is already determined and there's no need to show a selectable list.
    -    const shouldReportBeEditable = (isUnreported ? outstandingReports.length >= 1 : outstandingReports.length > 1) && !isMoneyRequestReport(reportID);
    +    const shouldReportBeEditable = (isUnreported ? eligibleOutstandingReports.length >= 1 : eligibleOutstandingReports.length > 1) && !isMoneyRequestReport(reportID);
     
         const openReportPage = () => {
             if (!transactionID || !selectedReportID) {

    Pre-coded and tested in branch: fix/104162-report-field-non-reimbursable (https://github.com/jloa-dev/App/tree/fix/104162-report-field-non-reimbursable).

    What alternative solutions did you explore? (Optional)

    Filtering out non-reimbursable reports inside useOutstandingReports hook globally. However, that hook is shared by other flows (including search and workspace overview) where open reports need to be listed regardless of transaction eligibility. Filtering at the field level where interactivity is determined is cleaner and avoids side-effects.

  10. melvin-bot commented on Oct 17, 2026

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  11. sijo0218 commented on Oct 18, 2026

    @sijo0218

    Proposal

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

    On the expense confirmation page, the Report field appears interactive/clickable (shouldReportBeEditable = true) even when all existing outstanding reports in a workspace contain only non-reimbursable expenses (under Instant Submit and Submit & Close), leading to a state where opening the field displays no selectable reports for standard members.

    What is the root cause of that problem?

    There is a discrepancy between how ReportField.tsx determines interactivity and how IOURequestEditReportCommon.tsx determines report eligibility:

    1. In src/components/MoneyRequestConfirmationList/sections/ReportField.tsx (lines 114–116):

      const outstandingReports = useOutstandingReports(undefined, isFromGlobalCreate && !isPerDiemRequest ? undefined : policyID, ownerAccountID, false);
      const shouldReportBeEditable = (isUnreported ? outstandingReports.length >= 1 : outstandingReports.length > 1) && !isMoneyRequestReport(reportID);

      ReportField determines whether the field is editable purely by checking outstandingReports.length > 1 (where isReportOutstanding only checks if the report is open/submitted).

    2. In src/libs/ReportUtils.ts (lines 3143–3150):
      Under Instant Submit with Submit & Close policies, canAddTransaction(report, rules, undefined, true) returns false for reports that contain only non-reimbursable transactions (hasOnlyNonReimbursableTransactions).

    3. In src/pages/iou/request/step/IOURequestEditReportCommon.tsx (lines 183–189):
      When the user opens the report selection step, the list filters reports using:

      if (canAddTransaction(report, rules, undefined, true)) {
          return true;
      }
      const isReportPolicyAdmin = isPolicyAdmin(policy);
      const isReportManager = report.managerID === currentUserPersonalDetails.accountID;
      return isReportPolicyAdmin || isReportManager;
    4. For a standard employee who is neither an admin nor the report manager, IOURequestEditReportCommon filters out all non-reimbursable reports, leaving no existing reports to choose from. Yet on the confirmation page, ReportField evaluated shouldReportBeEditable = true, presenting a clickable control that has nowhere to navigate.

    Important note on previous fixes & permissions:
    Simply filtering outstandingReports by canAddTransaction(...) alone (as proposed elsewhere) causes a regression for Workspace Admins and Report Managers (who are authorized to add transactions to those reports, as handled in PR #81676 for issue #81608). Any eligibility check in ReportField must align with the exact predicate used in IOURequestEditReportCommon.tsx.

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

    1. In src/components/MoneyRequestConfirmationList/sections/ReportField.tsx:

      • Import usePolicy, useCurrentUserPersonalDetails, isPolicyAdmin, and canAddTransaction.
      • Filter outstandingReports to eligibleOutstandingReports using the identical authorization predicate as IOURequestEditReportCommon:
        const policy = usePolicy(policyID);
        const currentUserPersonalDetails = useCurrentUserPersonalDetails();
        
        const eligibleOutstandingReports = useMemo(() => {
            return outstandingReports.filter((report) => {
                if (!report) {
                    return false;
                }
                if (canAddTransaction(report, rules, undefined, true)) {
                    return true;
                }
                const isReportPolicyAdmin = isPolicyAdmin(policy);
                const isReportManager = report.managerID === currentUserPersonalDetails?.accountID;
                return isReportPolicyAdmin || isReportManager;
            });
        }, [outstandingReports, rules, policy, currentUserPersonalDetails?.accountID]);
        
        const shouldReportBeEditable = (isUnreported ? eligibleOutstandingReports.length >= 1 : eligibleOutstandingReports.length > 1) && !isMoneyRequestReport(reportID);
    2. Result:

    What alternative solutions did you explore? (Optional)

    • Filtering canAddTransaction without checking isPolicyAdmin || isReportManager: rejected because it incorrectly disables the field for admins who can manage and add to those reports.
    • Filtering within useOutstandingReports: rejected because useOutstandingReports is a shared hook used across search, workspace overview, and LHN, where non-reimbursable open reports must still be counted.

    Contributor details
    Your Expensify account email: sijo0218@gmail.com
    Upwork Profile Link: https://www.upwork.com/freelancers/~011091133bbb09cd1c

  12. 32 remaining items

  13. melvin-bot commented on Nov 10, 2026

    @melvin-bot

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

  14. melvin-bot commented on Nov 12, 2026

    @melvin-bot

    @deetergp @Krishna2323 this issue is now 4 weeks old, please consider:

    • Finding a contributor to fix the bug
    • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
    • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

    Thanks!

  15. melvin-bot commented on Nov 12, 2026

    @melvin-bot

    @Krishna2323 Eep! 4 days overdue now. Issues have feelings too...

  16. deetergp commented on Nov 18, 2026

    @deetergp
    Contributor

    PR 106275 merged on November 16. It makes the Report field offer only reports that can actually accept the new expense, while preserving the existing rules for moving expenses.

    Production deployment and manual QA still need confirmation before calling this complete.

  17. changed the title [-][$175] Expense - Report files is enable when all report contain non-reimbursable expense[/-] [+][Due for payment 2026-11-25] [$175] Expense - Report files is enable when all report contain non-reimbursable expense[/+] on Nov 18, 2026
  18. melvin-bot commented on Nov 18, 2026

    @melvin-bot

    @Krishna2323

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.41-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-11-25. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

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 contributorOverdue

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions