Skip to content

[Due for payment 2026-08-19] [$250] Clean-up some tax related bugs. #94003

Description

@trjExpensify

Spawned from here.


  • BUG: Tax showing in the report table on a Per Diem expense
  1. Create a workspace
  2. Enable Taxes
  3. Enable Per Diem > Add the per diem rates
  4. Create a normal expense with tax
  5. Create a per diem expense
  6. Go to the Spend > Expenses table. Enable the Tax rate and Tax column
  7. Observe the Tax column has a calculated value
  8. Open the report
  9. Observe the Tax rate column has a value
  10. Observe the Tax column has a value of $0.00

Expected results:
Per Diem expenses do not have tax applied on them, so there shouldn't be tax related values anywhere on this expense type in the table.

2026-06-19_01-52-21.mp4

Classic reference, no tax customUnits on this expense:

Image
  • BUG: The tax Name, Value and Tax Code fields of a default tax rate on a workspace can’t be edited.
  1. Create a workspace
  2. Enable Taxes
  3. Click on the default rate
  4. Observe the tax fields aren’t editable
  5. Close the RHP
  6. Click on the Settings button
  7. Change the workspace defaults to the other rate
  8. Close the RHP
  9. Click on the same tax rate from step 3 again
  10. Observe the fields are now editable

Expected results:
The Name, Value and Tax Code fields of the default rate should be editable.

2026-06-19_00-50-53.mp4

  • BUG: Tax code, Tax amount and Tax fields are showing in the report detailed view by default.
  1. Create a new account
  2. Create a workspace
  3. Enable taxes
  4. Create two expenses with tax
  5. Go to Spend > Expenses
  6. Observe no tax columns are in the table
  7. Open the expense report
  8. Observe the three tax columns are in the table.

Expected Result:

  • These columns shouldn’t appear automatically when the report has expenses with tax, they should just be available custom columns to add if the user wants to set those columns as their preferred default for the report view.
2026-06-19_02-43-52.mp4

  • BUG: Tax code platform default IDs are appearing in various places
  1. Create a workspace
  2. Enable Taxes
  3. Open up the tax rates in the table
  4. Observe the Tax Code field
  5. Create a couple of expenses with tax
  6. Go to Spend > Expenses
  7. Enable the Tax code column
  8. Observe the Tax code column doesn't appear in the table
  9. Go to the report
  10. Enable the Tax code column
  11. Observe the default tax code ID is displayed on the expense in the table.

Expected results:

Like Classic, we don't show these platform defaultIDs, only the user set Tax Code. (CC: @twisterdotcom as this was added as a column fairly recently).

Image Image Image

Classic reference:
Image

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

Activity

  1. self-assigned this
    on Jun 19, 2026
  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 19, 2026
  3. trjExpensify commented on Jun 19, 2026

    @trjExpensify
    ContributorAuthor

    @MelvinBot do not add the External label to this issue.

  4. added
    InternalRequires API changes or must be handled by Expensify staff
    on Jun 19, 2026
  5. MelvinBot commented on Jun 19, 2026

    @MelvinBot
    Contributor

    Issue Analysis

    All four bugs are confirmed in code at facfcc1. Three of them (#1, #3, #4) live in the tax-column rendering/visibility path (SearchUIUtils.ts + TransactionItemRowWide.tsx); #2 is independent (tax-rate edit page). Confidence: High on all four — each root cause was verified against the actual source.


    Bug 1 — Per Diem expenses show a Tax rate + $0.00 Tax column

    Root cause: The table cell renderer suppresses tax for time requests but never for per diem. In TransactionItemRowWide.tsx:489 (Tax rate), :498 (Tax code) and :516 (Tax amount), the guard is isTimeRequest(...) only. For a per diem row, getTaxName falls back to the policy's default tax rate (TransactionUtils/index.ts:2199-2214), so the Tax rate shows a calculated value and Tax shows $0.00. (The RHP MoneyRequestView already handles per diem correctly via isTaxTrackingEnabled.)

    Recommended fix: Add || isPerDiemRequest(transactionItem) alongside the existing isTimeRequest guard in those three cases (isPerDiemRequest is already exported from TransactionUtils). Optionally also exclude per-diem taxCode/taxAmount/taxValue from the column-visibility check at SearchUIUtils.ts:5826 so the column doesn't appear when all rows are per diem.


    Bug 2 — Name / Value / Tax Code of the default tax rate aren't editable

    Root cause: WorkspaceEditTaxPage.tsx:45 gates the Name/Value/Code edit menu items on canEditTaxRate, but PolicyUtils.canEditTaxRate is documented as "whether the tax rate can be deleted and disabled" and returns false for the default/foreign-default rate. Reusing that one flag makes the three edit fields non-interactive for the default rate. Switching the workspace default flips defaultExternalID, which is exactly why the repro fields become editable after changing the default.

    Recommended fix: Decouple the two concerns. Keep canEditTaxRate for the enable Switch (:117/119) and Delete item (:47), but gate the Name/Value/Code MenuItemWithTopDescription items (:131/137, :147/153, :163/181) on a new canEditTaxFields = !!canWriteTaxes && !!policy flag that does not include the default-rate check. Do not change the shared helper — WorkspaceTaxesPage.tsx correctly relies on it to block disabling/bulk-deleting the default rate.


    Bug 3 — Tax columns appear automatically in the single-report table view

    Root cause: Both the Spend > Expenses table and the report view call getColumnsToShow, but the data-presence block that auto-enables tax columns runs if (customResult || isExpenseReportView) (SearchUIUtils.ts:5814). The Expenses table passes neither, so it's skipped (correct). The report view passes isExpenseReportView: true, so the block always runs, and the bare per-transaction checks !!transaction.taxCode || !!transaction.taxAmount || !!transaction.taxValue (:5826-5833) force the three tax columns on. Tax columns are otherwise defined as optional custom columns, absent from the default sets.

    Recommended fix: Gate the per-transaction tax detection behind customResult so the default report view falls back to the seeded false for tax columns — i.e. only auto-show when the user has explicitly added them as custom columns. Verify the column picker at ReportDetailsColumnsPage.tsx still pre-checks correctly after the change.


    Bug 4 — Platform default tax-code IDs shown in the Tax code column

    Root cause: TransactionItemRowWide.tsx:498 renders transactionItem.taxCode raw. That field stores the platform-generated external ID (the id_{TAX_RATE_NAME} map key), not the user-set code attribute (Policy.ts:225-255). Classic shows only the user-set code (blank when unset). Note the Tax rate column right above resolves correctly via getTaxName; only Tax code uses the raw value.

    Recommended fix: Resolve through the policy tax map and show the user code, falling back to empty — e.g. a getTaxCodeForDisplay(policy, transaction) helper next to getTaxName returning transformedTaxRates(policy, transaction)[transaction.taxCode]?.code ?? ''. Also check the TAX_CODE sort path in SearchUIUtils.ts so it sorts on the resolved code.

    The sub-symptom "Tax code column doesn't appear in Spend > Expenses when toggled" is a separate gating issue at SearchUIUtils.ts:5831-5832 (column only auto-shows when customResult && isPolicyTaxEnabled or transaction.taxCode is set in that context) and should be confirmed separately.


    Scope note & verification
    • Each root cause above was confirmed by reading the cited lines at commit facfcc1c9e4fff22ace8b603be0f05a2d5fc76c6.
    • Bugs 1, 3, 4 share the tax-column subsystem (TransactionItemRowWide.tsx + getColumnsToShow in SearchUIUtils.ts), so a single PR could reasonably address all three; bug 2 is isolated to the tax-rate edit page.
    • Open product questions to confirm before merging: (a) per-diem tax should be fully blank everywhere (matches Classic); (b) Name/Value/Code editable on the default rate (matches Classic); (c) tax columns should be opt-in custom columns in the report view, not auto-shown.

    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/94003) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 19, 2026
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 19, 2026
  8. ahmdshrif commented on Jun 19, 2026

    @ahmdshrif
  9. melvin-bot commented on Jun 19, 2026

    @melvin-bot

    Current assignees @truph01 and @dmkt9 are eligible for the External assigner, not assigning anyone new.

  10. wildan-m commented on Jun 19, 2026

    @wildan-m
  11. changed the title [-]Clean-up some tax related bugs.[/-] [+][$250] Clean-up some tax related bugs.[/+] on Jun 19, 2026
  12. melvin-bot commented on Jun 19, 2026

    @melvin-bot
  13. 93 remaining items

  14. melvin-bot commented on Aug 18, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  15. mallenexpensify commented on Aug 20, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @dmkt9 paid $250 via NewDot
    Contributor+: @truph01 due $250 via NewDot

    @truph01 and @dmkt9 is the amount correct? If not, provide deets, will leave open for a bit.

  16. dmkt9 commented on Aug 21, 2026

    @dmkt9
    Contributor

    Contributor: @dukenv0307 due $250 via NewDot

    @mallenexpensify I think you meant to tag me here.

  17. mallenexpensify commented on Aug 21, 2026

    @mallenexpensify
    Contributor

    Thx @dmkt9 , apologies for the mix up. can you please accept the job below? Please reply here and tag me once you have.
    https://www.upwork.com/jobs/~022090906519670785006

  18. melvin-bot commented on Aug 21, 2026

    @melvin-bot

    @truph01 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  19. dmkt9 commented on Aug 24, 2026

    @dmkt9
    Contributor

    Thx @dmkt9 , apologies for the mix up. can you please accept the job below? Please reply here and tag me once you have.

    @mallenexpensify Thanks. I've accepted the offer.

  20. mallenexpensify commented on Aug 24, 2026

    @mallenexpensify
    Contributor

    @dmkt9 paid, summary updated above, inc. to correct tag for you. . Thx.

  21. garrettmknight commented on Sep 7, 2026

    @garrettmknight
    Contributor

    $250 approved for @truph01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2InternalRequires API changes or must be handled by Expensify staff

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions