Feat - [Unreported] Add distance rate to the distance expenses tracked in selfDM#84136
Feat - [Unreported] Add distance rate to the distance expenses tracked in selfDM#84136FitseTLT wants to merge 10 commits intoExpensify:mainfrom
Conversation
…FitseTLT/feat-apply-policyForMovingExpenses-for-rate-field-for-track-distance-expenses""
|
@parasharrajat Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ad2443ed89
ℹ️ 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".
| const hasPendingWaypoints = 'waypoints' in transactionChanges; | ||
| const hasModifiedDistanceRate = 'customUnitRateID' in transactionChanges; | ||
| if (transaction && updatedTransaction && (hasPendingWaypoints || hasModifiedDistanceRate)) { | ||
| if (transaction && updatedTransaction && hasPendingWaypoints) { |
There was a problem hiding this comment.
Clear draft when persisting distance-rate changes
By dropping hasModifiedDistanceRate from this cleanup condition, successful track-expense rate edits no longer remove TRANSACTION_DRAFT entries. That leaves stale draft customUnitRateID/distance-unit data around, and later submit/share/categorize flows can read those drafts (via shouldUseTransactionDraft) instead of the persisted transaction, causing users to move or submit expenses with the wrong rate data.
Useful? React with 👍 / 👎.
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.
|
|
@parasharrajat can you review today? |
|
Yes in testing |
trjExpensify
left a comment
There was a problem hiding this comment.
Core PR for a WN project. 👍
Explanation of Change
Fixed Issues
$ #72230
$ #84010
$ #84013
$ #84006
$ #83964
$ #83955
$ #83990
PROPOSAL:
Tests
I) User with no group workspace
Creation flow
Edit flow
II) User with a group workspace set as the default workspace
III) User with multiple group workspaces that have the personal policy set as the default one
NOTE: To have such a user, you have to go to OldDot and make the personal policy the default workspace from there
Creation flow
Edit flow
Precondition:
Workspace distance unit must be different from personal distance unit.
Precondition:
Enable distance rates.
Change distance unit to Kilometers.
Precondition:
Enable Taxes and Distance rates.
Add two tax rates - 5% and 10 %.
Add a new distance rates - 1.00 / mile.
Enable Track tax in Distance rates settings.
Assign 5% tax rate to 0.725 / mile (default rate) with any tax reclaimable amount.
Assign 10% tax rate to 1.00 / mile with any tax reclaimable amount.
tax no longer validerror will not show and the expense can be created without issue.Precondition:
Enable Taxes and Distance rates.
Add two tax rates - 5% and 10 %.
Add two distance rates - 1.00 / mile and 2.00 / mile.
Enable Track tax in Distance rates settings.
Assign 5% tax rate to 1.00 / mile with any tax reclaimable amount.
Assign 10% tax rate to 2.00 / mile with any tax reclaimable amount.
Precondition:
Workspace has at least two distance rates.
Precondition:
Disable Submissions in Workflows settings.
Offline tests
Same as above
QA Steps
Same as above
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.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
2025-12-06.00-56-10.mp4
Android: mWeb Chrome
2025-12-03.17-53-59.mp4
iOS: Native
2025-12-03.19-40-55.mp4
iOS: mWeb Safari
2025-12-03.17-52-46.mp4
MacOS: Chrome / Safari
2025-12-03.17-52-02.mp4
2026-03-05.22-39-48.mp4
2026-03-05.22-31-40.mp4