Open IuliiaHerets opened 3 days ago
Triggered auto assignment to @puneetlath (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.
@puneetlath 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
Edited by proposal-police: This proposal was edited at 2024-10-17 16:32:06 UTC.
Track expense - Edited amount is not reflected correctly in amount editor on confirmation page
We are taking the modifiedAmount from the trackExpense when we create draft transaction on submit it to someone
https://github.com/Expensify/App/blob/4a25c36e50b58ef9e5ba8b63cf32132f95a0b005/src/libs/ReportUtils.ts#L8037-L8046
So in IOUStepAmountPage we only update only amount
(not modifiedAmount
) of the transaction if the action is not editing
https://github.com/Expensify/App/blob/4a25c36e50b58ef9e5ba8b63cf32132f95a0b005/src/pages/iou/request/step/IOURequestStepAmount.tsx#L170
So in confirmation page we will see this new amount we updated but when reopen the amount page it will show us modifiedAmount
which has not been updated
https://github.com/Expensify/App/blob/4a25c36e50b58ef9e5ba8b63cf32132f95a0b005/src/libs/TransactionUtils/index.ts#L337-L340
it prioritize modifiedAmount
if over amount
if it exists
We should mimic the setup we have for create expense (because submit it to someone
is basically creating an expense from an existing some sort of expense template) so when we create a draft transaction increateDraftTransactionAndNavigateToParticipantSelector
whether it is for submit, categorize or share we should reset modifiedAmount to undefined
so that IOURequestStepAmount
will have one source of truth amount
same as what we have for creation of a new request.
We need to reset modifiedAmount on the draft transaction here
currency,
modifiedAmount: undefined,
Edited by proposal-police: This proposal was edited at 2024-10-17 15:50:45 UTC.
The amount is $20, while it shows $30 on the confirmation page.
If the original amount is 100
When editing the track expense to 200, we will update modifiedAmount: -200, amount: -100
We're showing the amount
on confirmation page
But on amount page, we use modifiedAmount
We should update modifiedAmount
if it's the draft transaction in
function setMoneyRequestAmount(transactionID: string, amount: number, currency: string, shouldShowOriginalAmount = false) {
Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {amount, currency, shouldShowOriginalAmount, modifiedAmount: amount});
}
NA
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.50-0 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers): applausetester+kh081006@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
The amount will remain the same, which is $30.
Actual Result:
The amount is $20, while it shows $30 on the confirmation page.
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/29c581a1-214a-462b-a91a-3cbfe5530c2f
View all open jobs on GitHub