Skip to content

"Itemized receipt required" appears on distance expense when map receipt cannot be replaced #80568

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.9-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: #73939
Email or phone of affected tester (no customers): soindjonsidjiosjods@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:

  • Rules are enabled.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Categories.
  3. Click Advertising.
  4. Click "Require receipts over" and select "Always require receipts".
  5. Click "Require itemized receipts over" and select "Always require itemized receipts".
  6. Go to self DM.
  7. Create a Map distance expense.
  8. Open the distance expense.
  9. Click Report > Create report.
  10. Click Rate > select any rate.
  11. Click Category > select Advertising.
  12. Go back to main workspace chat.
  13. Open the distance expense.
  14. Might need to reopen distance expense again for "Itemized receipt required" to appear.

Expected Result:

"Itemized receipt required" will not appear on distance expense because user cannot replace the map receipt.

Actual Result:

"Itemized receipt required" appears on distance expense when user cannot replace the map receipt.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7058899_1769475318737.4.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 27, 2026
  2. melvin-bot commented on Jan 27, 2026

    @melvin-bot

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

  3. melvin-bot commented on Jan 27, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jan 27, 2026

    @melvin-bot

    Triggered auto assignment to @kadiealexander (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 27, 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 27, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #73939 - "Add itemized receipt requirement settings for workspace and category rules" by @abzokhattab (High confidence)
    Related Issues: None

    Recommendation: REVERT

    PR #73939 should be reverted because it introduces a violation that incorrectly applies to distance expenses, which have map receipts that cannot be replaced by users.

    Labels: Removing DeployBlocker label (backend is not affected). Keeping DeployBlockerCash (App deploy is blocked).

    Detailed Analysis

    Evidence

    PR #73939 introduced the itemized receipt requirement feature, adding new violation logic to flag expenses that exceed a threshold and require itemized receipts. However, the implementation did not account for distance expenses, which have auto-generated map receipts that users cannot replace.

    From the reproduction steps:

    1. Set category rule: "Always require itemized receipts"
    2. Create a map distance expense
    3. Assign it to that category
    4. The violation appears even though users cannot replace the map receipt

    Verification

    The bug is in /home/runner/work/App/App/src/libs/Violations/ViolationsUtils.ts at line 434:

    const isEligibleForItemizedReceiptViolation = canCalculateAmountViolations && !isInvoiceTransaction && !TransactionUtils.hasReceipt(updatedTransaction) && isControlPolicy;

    This logic checks if the transaction is eligible for the itemized receipt violation. However, it does not exclude distance requests. On line 397, isDistanceRequest is already calculated but not used in this check.

    Distance transactions always have a map receipt that cannot be replaced, so they should never be subject to itemized receipt requirements.

    Root Cause

    The itemized receipt violation logic added in PR #73939 applies to all transaction types without excluding distance expenses. Distance expenses have map receipts with receipt.state = "OPEN", which means hasReceipt() returns true. However, even though they have a receipt, users cannot upload an itemized receipt to replace the map.

    The fix would be to add && !isDistanceRequest to the eligibility check on line 434, similar to how other violation types exclude distance requests (e.g., hasMissingSmartscanFields on line 1486 of TransactionUtils).

  7. abzokhattab commented on Jan 27, 2026

    @abzokhattab
    Contributor

    I am struggling to reproduce the issue is there any step i am missing @mitarachim

    Screen.Recording.2026-01-27.at.04.42.07.mov
  8. mitarachim commented on Jan 27, 2026

    @mitarachim
    Author

    Hello @abzokhattab i still able to reproduce issue with follow original steps

    Screen.Recording.2026-01-27.at.10.49.11.AM.mov
  9. abzokhattab commented on Jan 27, 2026

    @abzokhattab
    Contributor

    On it today

  10. dangrous commented on Jan 27, 2026

    @dangrous
    Contributor

    Thanks @abzokhattab! I think this may be backend though - I probably need to filter out distance receipts from getting the violation? (If so, I think it's not an App deploy blocker)

  11. dangrous commented on Jan 27, 2026

    @dangrous
    Contributor

    weird I'm not able to reproduce this locally, even following the steps in the issue. However, I've created a PR that should (?) fix it. Let me know if you notice anything front end, though, @abzokhattab

  12. abzokhattab commented on Jan 27, 2026

    @abzokhattab
    Contributor

    I reproduced it with a new account @dangrous, yeah it does look to be a backend issue if we are disabling it for the normal receipt on the backend lets do the same for the itemised ones

    Screen.Recording.2026-01-27.at.16.30.32.mov
  13. dangrous commented on Jan 27, 2026

    @dangrous
    Contributor

    yeah i think we autogenerate a receipt in the backend for distance requests, which is why it doesn't get flagged as receipt required. However, it has no line items, so it gets hit with itemized receipt required. My PR should fix it, but I'll remove the blocker label here if there's no front end change needed!

    I don't think this edge case is enough to make us revert the FE PR

  14. dangrous commented on Jan 28, 2026

    @dangrous
    Contributor

    This is on prod, will request a re-test

  15. m-natarajan commented on Jan 28, 2026

    @m-natarajan

    This issue is not reproducible on Windows 11 / Chrome, Xiaomi Poco F5 / Android 13,iPhone 12 mini / iOS 26.2 in v9.3.10-3

    1000175576.mp4
    Repro80568iOS.mp4
    bandicam.2026-01-29.00-12-17-571.mp4
  16. dangrous commented on Jan 28, 2026

    @dangrous
    Contributor

    perfect! i will close this; i dont think payment is required.

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

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions