fix: Clean-up some tax related bugs#94007
Conversation
… a workspace can’t be edited
…tailed view by default
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3469e8939f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7106d2110
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@MelvinBot review |
ReviewThe four fixes map cleanly to the four bugs in #94003, and I like how the My one real concern is the reliability of the
|
|
@MelvinBot Yes. The backend persists and returns |
|
Thanks for confirming — that clears my main concern. If the backend persists and returns That leaves just the smaller items, none blocking:
Otherwise the PR looks good to me — the four fixes map cleanly to the four bugs. 👍 |
|
While we're waiting for the backend fix (#94003 (comment)), I think it would be good for @truph01 to review this PR in parallel. |
Hi @dukenv0307, could you please check and confirm this backend behavior? |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7106d2110
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
My plate is full today, but I can check it tmr. I think we don't update |
trjExpensify
left a comment
There was a problem hiding this comment.
I created the parent issue for this. Thanks for jumping on it. 👍
|
@dmkt9 Could you help merge main? |
@dmkt9 Could you check this comment as well? |
Explanation of Change
This PR cleans up several tax display and editability issues by distinguishing between user-customized tax codes and platform/default tax identifiers.
A new
isTaxCodeCustomized()helper was added to PolicyUtils. It treats a tax code as user-customized only when its tax rate has a non-empty previousTaxCode, which lets the UI avoid exposing internal platform default tax IDs.Report table tax behavior was updated so Per Diem expenses no longer show tax name, tax code, or tax amount values. Tax code cells are now also hidden unless the tax code was actually customized by the user.
Search/report table column visibility was tightened so tax-related columns are not shown by default only because a transaction contains tax metadata. Tax rate, tax amount, and tax code columns now appear only when the user explicitly selects/customizes those columns.
Workspace tax editing was adjusted so default tax rates can still have their Name, Value, and Tax Code fields edited when the user has write access. The stricter
canEditTaxRatepermission remains used only for disabling or deleting tax rates, which preserves the existing restriction for protected/default rates while allowing field edits.The workspace tax code editor now shows an empty input for non-customized/default tax codes instead of pre-filling internal platform IDs, and saving behavior was updated so users can replace those defaults with their own tax code.
Unit coverage was added for
isTaxCodeCustomized()to verify that missing policies, missing tax codes, unknown tax rates, empty previousTaxCode, and customized tax codes are handled correctly.Fixed Issues
$ #94003
PROPOSAL:
Tests
Same as QA steps
Offline tests
Same as QA steps
QA Steps
Test 1:
Test 2:
Name,ValueandTax Codefields are editableTest 3:
Test 4:
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Test.1.mp4
Test.2.mp4
Test.3.mp4