You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD #39616][$250] [Track Tax] - Tax does not show up in the Expense report when created offline #40051
Version Number: 1.4.62-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 Email or phone of affected tester (no customers):sustinov@applausemail.com Issue reported by: Applause - Internal Team
@abekkala FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
but here we forgot to consider the case when IOU is created Offline at this case when we call buildOptimisticTransaction we do not pass and store both values optimistically.
What changes do you think we should make in order to solve the problem?
We need to send additional props for tax rate and tax amount, this will be passed down to buildOptimisticTransaction via getMoneyRequestInformation, and then we will return the value of tax amount and rate stored optimistically so that we can see the rate and tax amount even in offline mode
One note is that we need to make sure that the optimistic taxAmount is the same as the taxAmount returned by BE. To do that, we need to format the taxAmount before passing it to buildOptimisticTransaction like below:
An additional bug is that, we do not have correct optimistic tax data when editing taxCode. When editing taxCode, we do not update the taxAmount accordingly. Solution: we can add check if the transactionChanges in here contains taxCode field. If it is, update the taxAmount as well. To do it, we can add the below logic to this:
changed the title [-]Tax - Tax does not show up in the IOU report when created offline[/-][+][$250] Tax - Tax does not show up in the IOU report when created offline[/+]on Apr 15, 2024
Thanks @GandalfGwaihir and @nkdengineer for the proposals
Both proposals are correct, and RCA is on point. @nkdengineer has added some extra details than @GandalfGwaihir for editing taxCode, but that is additional to the original issue. @GandalfGwaihir proposed a working solution first for the described issue, so in this case, we can go with user @GandalfGwaihir 's Proposal
changed the title [-][$250] Tax - Tax does not show up in the IOU report when created offline[/-][+][$250] Tax - Tax does not show up in the Expense report when created offline[/+]on Apr 18, 2024
👋 Just a heads up to make sure we distinguish between iouReport and expenseReport in the title and OP of the issue. A request to a workspace goes onto an expense report. Tax tracking is a feature of workspaces. You can't track tax on requests to individuals, that go on iou Reports.
changed the title [-][$250] Tax - Tax does not show up in the Expense report when created offline[/-][+][$250] [Track Tax] - Tax does not show up in the Expense report when created offline[/+]on Apr 18, 2024
@arosiclair More about this C+ comment: We have addtional bugs related to the tax flow in offline mode (mentioned in my proposal), should we plan to fix it in this issue? If not, I think we can go with the selected proposal
changed the title [-][$250] [Track Tax] - Tax does not show up in the Expense report when created offline[/-][+][HOLD #39616][$250] [Track Tax] - Tax does not show up in the Expense report when created offline[/+]on Apr 18, 2024
Activity
melvin-bot commentedon Apr 10, 2024
Triggered auto assignment to @abekkala (
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.lanitochka17 commentedon Apr 10, 2024
@abekkala FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
lanitochka17 commentedon Apr 10, 2024
We think that this bug might be related to #wave-collect - Release 1
allgandalf commentedon Apr 11, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Tax amount is not stored optimistically when we create IOU request offline
What is the root cause of that problem?
When we create the request offline, we call
IOU.requestMoneyand inrequestMoney, we build out a report optimistically :App/src/libs/TransactionUtils.ts
Lines 86 to 103 in 8ae5491
But in here we do not save the tax rate and tax amount optimistically , we only send them to the
BE:App/src/libs/actions/IOU.ts
Lines 2338 to 2352 in 8ae5491
but here we forgot to consider the case when
IOUis createdOfflineat this case when we callbuildOptimisticTransactionwe do not pass and store both values optimistically.What changes do you think we should make in order to solve the problem?
We need to send additional props for
tax rateandtax amount, this will be passed down tobuildOptimisticTransactionviagetMoneyRequestInformation, and then we will return the value of tax amount and rate stored optimistically so that we can see the rate and tax amount even in offline modeApp/src/libs/actions/IOU.ts
Line 2297 in 8ae5491
Result Video
Screen.Recording.2024-04-11.at.7.03.14.AM.mov
Note: Same approach would be followed for tax rate as well, in the video I have only implemented taxamount
nkdengineer commentedon Apr 11, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
taxCodeandtaxAmount, that leads to there is no tax data shown in offline mode.What changes do you think we should make in order to solve the problem?
We need to call getMoneyRequestInformation with additional params,
taxAmountandtaxCode.Then, in getMoneyRequestInformation, call buildOptimisticTransaction with these params,
taxAmountandtaxCode.Then in buildOptimisticTransaction, add these two params to here
One note is that we need to make sure that the optimistic
taxAmountis the same as thetaxAmountreturned by BE. To do that, we need to format thetaxAmountbefore passing it to buildOptimisticTransaction like below:taxCode. When editingtaxCode, we do not update thetaxAmountaccordingly. Solution: we can add check if thetransactionChangesin here containstaxCodefield. If it is, update thetaxAmountas well. To do it, we can add the below logic to this:failureDataandsuccessDataproperly.What alternative solutions did you explore? (Optional)
[-]Tax - Tax does not show up in the IOU report when created offline[/-][+][$250] Tax - Tax does not show up in the IOU report when created offline[/+]melvin-bot commentedon Apr 15, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01d25bb36f4e169f12
melvin-bot commentedon Apr 15, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jayeshmangwani (
External)5 remaining items
jayeshmangwani commentedon Apr 17, 2024
Thanks @GandalfGwaihir and @nkdengineer for the proposals
Both proposals are correct, and RCA is on point. @nkdengineer has added some extra details than @GandalfGwaihir for editing taxCode, but that is additional to the original issue. @GandalfGwaihir proposed a working solution first for the described issue, so in this case, we can go with user @GandalfGwaihir 's Proposal
🎀 👀 🎀 C+ reviewed
melvin-bot commentedon Apr 17, 2024
Triggered auto assignment to @arosiclair, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
[-][$250] Tax - Tax does not show up in the IOU report when created offline[/-][+][$250] Tax - Tax does not show up in the Expense report when created offline[/+]trjExpensify commentedon Apr 18, 2024
👋 Just a heads up to make sure we distinguish between
iouReportandexpenseReportin the title and OP of the issue. A request to a workspace goes onto anexpensereport. Tax tracking is a feature of workspaces. You can't track tax on requests to individuals, that go oniouReports.[-][$250] Tax - Tax does not show up in the Expense report when created offline[/-][+][$250] [Track Tax] - Tax does not show up in the Expense report when created offline[/+]trjExpensify commentedon Apr 18, 2024
CC: @MonilBhavsar as it's Track Tax related.
nkdengineer commentedon Apr 18, 2024
@arosiclair More about this C+ comment: We have addtional bugs related to the tax flow in offline mode (mentioned in my proposal), should we plan to fix it in this issue? If not, I think we can go with the selected proposal
MonilBhavsar commentedon Apr 18, 2024
This is dupe of implementation issue - #39616
[-][$250] [Track Tax] - Tax does not show up in the Expense report when created offline[/-][+][HOLD #39616][$250] [Track Tax] - Tax does not show up in the Expense report when created offline[/+]arosiclair commentedon Apr 18, 2024
Should we just close this then?
MonilBhavsar commentedon Apr 18, 2024
Let's close it 👍