[$250] Tax - Tax is no longer valid error shown in IOU details after editing tax rate value
If you havenโt already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.2.34-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Action Performed:
- Sign in to ND
- Create a workspace, enable Taxes in More features
- Open Taxes page, add a new tax rate, setting the tax value to something greater than 0
- Navigate to the workspace chat and create an expense, selecting the tax rate from step 3
- Verify that the tax rate and tax amount are displayed correctly in the expense details
- Navigate to the workspace settings and change the value for the used tax rate
- Navigate to the expense details and observe the Tax field and the Tax amount field
Expected Result:
The previous tax rate and amount are displayed in the Tax field and Tax amount field for the existing expense details after updating the tax value. There is an error on the rate tax rate field telling you it's no longer valid. Changing the tax rate resolves the error and updates the amount.
Actual Result:
dTax field shows the updated value, but there is an error "Tax no longer valid". The tax amount does not change accordingly to a new value. After selecting a different tax rate and returning to the updated one the error is not shown and the amount is calculated correctly
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
- [ ] Android: App
- [ ] Android: mWeb Chrome
- [x] iOS: App
- [x] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [x] Windows: Chrome
- [x] MacOS: Chrome / Safari
- [x] MacOS: Desktop
Platforms Tested:
On which of our officially supported platforms was this issue tested:- [ ] Android: App
- [ ] Android: mWeb Chrome
- [ ] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [ ] Windows: Chrome
- [ ] MacOS: Chrome / Safari
- [ ] MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/user-attachments/assets/2a9a456d-0d7d-422b-b508-153d56934df9
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021981443480364943722
- Upwork Job ID: 1981443480364943722
- Last Price Increase: 2025-12-18
- Automatic offers:
- huult | Contributor | 109911258
Issue Owner
Current Issue Owner: @Issue Owner
Current Issue Owner: @thesahindia
Triggered auto assignment to @joekaufmanexpensify (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.
@zsgreenwald @heyjennahay @MonilBhavsar I see you worked on tax tracking. Is this a bug? I am not sure we want to automatically update the tax amount for existing expenses if you change the rate.
Perhaps the bug is that we do update the tax rate for existing expenses, and we should instead show the prior rate + amount (with the violation) unless you change the toggle the rate or something?
Hmm I'm not sure if we actually considered this scenario.
If the tax rate use is disabled then I would expect to see the "Rate not valid" violation
Given the underlying tax rate itself is still active and just the amount is changed, I would expect that for editable expenses, the tax amount would be updated
Testing this in OldDot it also seems totally broken ๐
- The tax rate IS updated but to a totally random one, neither the existing or the default
- The tax amount isn't updated
- The default tax message incorrectly states the default rate is one other than the one set in the workspace
My gut tells me that if a rate is changing that the user will create a new tax rate rather than modify the existing one which is probably why we never came across this bug before.
That said, I think we should treat the "old" version of the rate like an invalid tax rate so:
- Flag tax rate as being invalid
- Don't change the amount
- Flag the tax amount as also being invalid (maybe?)
- To resolve, the user should re-select the rate from the list then we set the "new" version of the tax rate and re-calculate the tax amount Which is effectively what we do now in ND.
The alternative is that we just update according to the new tax rate amount on expenses where it is allowed (i.e. prior to approval) and don't show that the expense had a different one applied. As long as updates are restricted to editable expenses then I don't think it's a huge problem and maybe would remove some confusion from users.
Thoughts @joekaufmanexpensify @MonilBhavsar @zsgreenwald ?
Proposal
Please re-state the problem that we are trying to solve in this issue.
Update tax amount when tax rate was changed.
What is the root cause of that problem?
When the report information is displayed, we consider it to reflect the updated transaction. However, we do not input the updated transaction. App/blob/main/src/components/ReportActionItem/MoneyRequestView.tsx Line 117
function MoneyRequestView({
allReports,
report,
expensePolicy,
shouldShowAnimatedBackground,
readonly = false,
updatedTransaction,
isFromReviewDuplicates = false,
mergeTransactionID,
}: MoneyRequestViewProps) {
App/blob/main/src/pages/home/report/ReportActionItemContentCreated.tsx Line 184
<MoneyRequestView
allReports={allReports}
report={transactionThreadReport}
expensePolicy={policy}
shouldShowAnimatedBackground={false}
/>
What changes do you think we should make in order to solve the problem?
We need to input the updated transaction
What alternative solutions did you explore? (Optional)
๐ฃ @hasib711! ๐ฃ Hey, it seems we donโt have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~015950e9572980f803
โ Contributor details stored successfully. Thank you for contributing to Expensify!
That said, I think we should treat the "old" version of the rate like an invalid tax rate so:
- Flag tax rate as being invalid
- Don't change the amount
- Flag the tax amount as also being invalid (maybe?)
- To resolve, the user should re-select the rate from the list then we set the "new" version of the tax rate and re-calculate the
- tax amount. Which is effectively what we do now in ND.
This makes sense to me and is what I was thinking here. To do this, we'd just need to not change the tax rate / amount on existing expenses when you update the rate, and continue showing the violation.
Updated OP to reflect that
Job added to Upwork: https://www.upwork.com/jobs/~021981443480364943722
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia (External)
Awaiting proposal review from @thesahindia
We need to input the updated transaction
Could you explain your solution?
Please read the contributing.md and check the closed issues to understand the process.
sorry, late to the party
I tried reproducing the bug on newDot
- As a user, created an expense with a tax rate 10%
- As an admin, update the %age value from 10% to 11%
- The expense now displays -
- Tax rate as 11% (which I think is bug, it should display 10%) โ ๏ธ
- Tax amount is unchanged i.e. it shows tax amount corresponding to 10% rate which seems correct
- Tax no longer valid violation is displayed, which also seems correct
So I think the expected behavior is to just display the "10%" rate that user selected previously, instead of displaying updated 11% rate. That sounds right?
๐จ Edited by proposal-police: This proposal was edited at 2025-11-05 02:39:35 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Tax is no longer valid error shown in IOU details after editing tax rate value
What is the root cause of that problem?
When a tax rate value is updated in the workspace settings, the open report should return taxOutOfPolicy for any expense that still uses the old tax rate value.
https://github.com/Expensify/App/blob/b21370a0b258d950391207257024990425bc6b74/src/components/ReportActionItem/MoneyRequestView.tsx#L825
https://github.com/Expensify/App/blob/e27727ec98340f8439b225f440dd6de39e1aafac/src/libs/Violations/ViolationsUtils.ts#L562-L563
What changes do you think we should make in order to solve the problem?
To resolve this issue, we should display the previously selected tax and show an error message in the money request view. In the tax picker, the previously selected tax should appear as a disabled option.
Please implement it following the test branch.
Test branch
The POC is provided here:
https://github.com/user-attachments/assets/0ea687f0-62de-406b-ada6-8ade630bea2a
Note: Since we don't store the tax name in the transaction, when a tax is deleted from the policy we can no longer retrieve the tax name, only the tax code and tax value. To resolve this issue, we need the backend to include the tax name in the transaction so that we can display it properly.
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
So I think the expected behavior is to just display the "10%" rate that user selected previously, instead of displaying updated 11% rate. That sounds right?
Yep, exactly @MonilBhavsar. The user then selects a new rate to clear the violation, after which we update the amount as well.
Sounds good, thanks! ๐
I'll assign myself here
What should happen when the tax name or tax id changes?
And what should happen in the picker after the tax name or rate has changed? I think nothing should be selected in the picker.
https://github.com/user-attachments/assets/4935ac5d-d582-456b-8de9-ced00a10b610
Also If we stay on the expense report page and the tax rate changes, the error won't appear, it needs to be re rendered. This needs to fixed as well
What should happen when the tax name or tax id changes?
In OldDot, if you change the name (but not the tax rate value) we just update the name on any expenses where that tax rate is selected with no error. I feel like it is fine to do that here too, but curious if @heyjennahay and @MonilBhavsar agree?
Mind sharing what you mean by tax ID @thesahindia ?
And what should happen in the picker after the tax name or rate has changed? I think nothing should be selected in the picker.
I shared opinion in tax name above. For rate, aren't we going to keep the prior tax rate selected, but show an error. Then, offer show the new tax rate value as an option in the picker to change to?
Also If we stay on the expense report page and the tax rate changes, the error won't appear, it needs to be re rendered. This needs to fixed as well
SGTM ๐
Agree with Joe, If only name is changed, we display the new name and corresponding rate If the %age value is changed, tax rate is deleted, we display the previously selected %age value only, with violation.
๐ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐ธ
Mind sharing what you mean by tax ID @thesahindia ?
Ahh my bad I meant tax code
Waiting for updated proposals.
@thesahindia My proposal matches the expected behavior without any updates:
- If only the tax name changes โ update the displayed name without showing an error.
- If the value (%) changes or the tax rate is deleted โ display the old tax value with the error message โTax no longer validโ.
- The user can select a new tax rate to clear the error, and the system will then update the corresponding amount
@MonilBhavsar @joekaufmanexpensify @thesahindia this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
could you opine on that @thesahindia ?
For rate, aren't we going to keep the prior tax rate selected, but show an error. Then, offer show the new tax rate value as an option in the picker to change to?
Also If we stay on the expense report page and the tax rate changes, the error won't appear, it needs to be re rendered. This needs to fixed as well
@huult, please read these points.
Proposal updated
For rate, aren't we going to keep the prior tax rate selected, but show an error. Then, offer show the new tax rate value as an option in the picker to change to?
https://github.com/user-attachments/assets/9e0351d5-ebc5-40c4-a272-876e91eff75d
Also If we stay on the expense report page and the tax rate changes, the error won't appear, it needs to be re rendered. This needs to fixed as well
https://github.com/user-attachments/assets/d6316e1f-fe95-4ad9-89b0-cf59d605e3f6
๐ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐ธ