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
[$250] [Track Tax] The tax amount of a manual IOU will be in negative format #41418
Version Number: 1.4.69-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
@alexpensify 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
// IOU requests cannot have negative values but they can be stored as negative values, let's return absolute value
if(!isFromExpenseReport){
returnMath.abs(transaction?.taxAmount??0);
}
// To avoid -0 being shown, lets only change the sign if the value is other than 0.
constamount=transaction?.taxAmount??0;
returnamount ? -amount : 0;
}
For an expense report, we negate the amount value. The reason is explained in the comment in getAmount, that is, the amount for the expense report is stored in negative value.
changed the title [-]Tax - The tax amount of a manual IOU will be in negative format[/-][+][$250] Tax - The tax amount of a manual IOU will be in negative format[/+]on May 3, 2024
Heads up, I will be offline until Tuesday, May 28, 2024, and will not actively watch over this GitHub during that period.
@greg-schroeder - Here is the payment summary - #41418 (comment). While I'm offline, I need help here completing the payment process after this one clears the 7-day period. Thanks!
Hmm. Honestly, I don't think we need to put this in the regression period for #42039 as the contributors in this issue aren't necessarily beholden to that code's performance. And any regressions will be handled by the authors of that PR. I'll pay out the offers for your work now @hoangzinh@bernhardoj
Activity
melvin-bot commentedon May 1, 2024
Triggered auto assignment to @alexpensify (
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 May 1, 2024
@alexpensify 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 May 1, 2024
We think that this bug might be related to #wave-collect - Release 1
bernhardoj commentedon May 2, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The tax amount is shown in negative value.
What is the root cause of that problem?
The tax amount is taken from
getTaxAmount.App/src/libs/TransactionUtils.ts
Lines 301 to 310 in 12042db
For an expense report, we negate the amount value. The reason is explained in the comment in
getAmount, that is, the amount for the expense report is stored in negative value.App/src/libs/TransactionUtils.ts
Lines 285 to 287 in 12042db
That's true, but it's only when the request is created.
App/src/libs/actions/IOU.ts
Lines 1817 to 1818 in c5a1f96
While we are creating the request, the amount is still in positive value, so negating it will give us a negative tax amount.
This doesn't happen on the amount page because we always return the absolute value.
App/src/pages/iou/request/step/IOURequestStepAmount.tsx
Line 287 in c5a1f96
What changes do you think we should make in order to solve the problem?
Do the same as what we did on the amount page, that is return the absolute value of the amount.
Math.abs(transactionDetails?.taxAmount)What alternative solutions did you explore? (Optional)
If we are creating a new request, don't negate the amount value.
[-]Tax - The tax amount of a manual IOU will be in negative format[/-][+][$250] Tax - The tax amount of a manual IOU will be in negative format[/+]melvin-bot commentedon May 3, 2024
Job added to Upwork: https://www.upwork.com/jobs/~010f30064172acce83
melvin-bot commentedon May 3, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (
External)28 remaining items
melvin-bot commentedon May 17, 2024
Triggered auto assignment to @greg-schroeder (
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.alexpensify commentedon May 17, 2024
Heads up, I will be offline until Tuesday, May 28, 2024, and will not actively watch over this GitHub during that period.
@greg-schroeder - Here is the payment summary - #41418 (comment). While I'm offline, I need help here completing the payment process after this one clears the 7-day period. Thanks!
greg-schroeder commentedon May 21, 2024
Hmm. Honestly, I don't think we need to put this in the regression period for #42039 as the contributors in this issue aren't necessarily beholden to that code's performance. And any regressions will be handled by the authors of that PR. I'll pay out the offers for your work now @hoangzinh @bernhardoj
alexpensify commentedon May 28, 2024
Thanks, @greg-schroeder, for your help here!
greg-schroeder commentedon May 28, 2024
i gotchu @alexpensify!