Skip to content

Per diem - Merchant field opens and can be edited when submitting from self DM #80291

Closed

Description

@mitarachim

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.3.7-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #76595
Email or phone of affected tester (no customers): jsiodjosjdnisojso@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.1 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Workspace has per diem rates.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create a per diem expense.
  4. Open the per diem expense.
  5. Go to self DM.
  6. Open the unreported per diem expense.
  7. Click Report > Remove from report/
  8. Click on the report header > Submit it to someone.
  9. Change the merchant > Next.
  10. On confirm page, click Create expense.
  11. Open the per diem expense.

Expected Result:

In Step 8, merchant field should not appear because merchant is fixed for per diem expense.

Actual Result:

In Step 8, merchant field opens and can be edited.
In Step 10, the new merchant is not reflected in the submitted per diem expense.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7056011_1769123580974.8.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Jan 22, 2026
  2. melvin-bot commented on Jan 22, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #76595

  3. melvin-bot commented on Jan 22, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. melvin-bot commented on Jan 22, 2026

    @melvin-bot

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

  5. github-actions commented on Jan 22, 2026

    @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.
  6. OSBotify commented on Jan 22, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #76595 - "Update create transaction Manual flow to ask for merchant after asking for amount" by @nkdengineer (High confidence)
    Related Issues: Original feature request in #76050

    Recommendation: REVERT

    PR #76595 should be reverted. The PR adds a merchant step to the manual expense creation flow but fails to exclude per diem expenses, which have a fixed merchant that cannot be edited.

    Labels: Kept DeployBlockerCash (App PR caused the issue), removed DeployBlocker (not a backend issue)

    Detailed Analysis

    Evidence

    PR #76595 was merged on 2026-01-22 and is included in the current staging deploy (version 9.3.7-0). The issue was caught during regression testing and is reproducible on staging.

    The PR modified the expense creation flow to add a merchant step after the amount step for manual expenses. The changes affected:

    • src/libs/IOUUtils.ts - Added shouldRequireMerchant() function
    • src/pages/iou/request/step/IOURequestStepAmount.tsx - Added navigation to merchant step
    • src/pages/iou/request/step/IOURequestStepParticipants.tsx - Added merchant step logic when moving from self DM
    • src/pages/iou/request/step/IOURequestStepMerchant.tsx - Updated merchant step navigation

    Verification

    I verified that per diem expenses are affected by checking:

    1. File: src/libs/ReportUtils.ts (lines 4736-4741)

      • Contains explicit logic preventing merchant editing for per diem expenses:
      if (
          (fieldToEdit === CONST.EDIT_REQUEST_FIELD.AMOUNT || 
           fieldToEdit === CONST.EDIT_REQUEST_FIELD.CURRENCY || 
           fieldToEdit === CONST.EDIT_REQUEST_FIELD.MERCHANT) &&
          isPerDiemRequest(transaction)
      ) {
          return false;  // Cannot edit merchant for per diem
      }
    2. File: src/libs/actions/IOU/index.ts

      • Per diem merchant is computed automatically via computePerDiemExpenseMerchant() based on destination and dates
      • The merchant format is: "Destination, Start Date, End Date"

    Root Cause

    PR #76595 added logic to show the merchant step when creating/submitting manual expenses to workspaces. However, the shouldRequireMerchant() function (added in the PR) does not check if the transaction is a per diem request before requiring the merchant step.

    Per diem expenses have these characteristics:

    • Merchant is automatically computed from destination and date range
    • Merchant field is read-only and cannot be edited (enforced by canEditFieldOfMoneyRequest)
    • Merchant should never be shown as an editable field

    When submitting a per diem expense from self DM to a workspace (reproduction step 8), the new logic incorrectly navigates to the merchant editing screen. Because per diem merchants are read-only, any user input is ignored, causing confusion where:

    • User can type a new merchant (step 9)
    • The new merchant is not saved/reflected in the final expense (step 10)

    Test Case 7 in PR #76595

    The PR actually includes Test Case 7 which covers "Self DM Expense - Move to Workspace (Without Merchant)" but it only tested regular manual expenses, not per diem expenses. The test missed this edge case.

  7. cead22 commented on Jan 23, 2026

    @cead22
    Contributor

    We reverted the offending PR and CP'd it to staging. @mitarachim Can you please re-test and reopen this if the issue persists? Thanks

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.EngineeringHourlyKSv2ReviewingHas a PR in review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions