Closed lanitochka17 closed 5 months ago
Triggered auto assignment to @anmurali (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Job added to Upwork: https://www.upwork.com/jobs/~014b7a910d5416d07a
Platforms
in OP are ✅)Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif (External
)
USD instead of local currency shown when starting a split on a receipt
It looks to me like in the code below the currency is set to the constant USD on line 1310 & 1326 rather than the local currency being passed down in the startSplitBill function:
Instead of setting the currency to be a constant we could add a variable to the startSplitBill function like so:
function startSplitBill(participants, currentUserLogin, currentUserAccountID, comment, receipt, existingSplitChatReportID = '', currency = CONST.CURRENCY.USD) {
And then on the money request confirmation page, pass down the users local currency like so:
IOU.startSplitBill(
selectedParticipants,
props.currentUserPersonalDetails.login,
props.currentUserPersonalDetails.accountID,
trimmedComment,
receipt,
existingSplitChatReportID,
props.iou.currency
);
So that it reflects the local currency like in other areas
Split bill - Currency for split bill via Scan is USD instead of local currency
When splitting a bill, the optimistic transaction's currency is set to USD (line 1310).
In addition, the back end also sends us the currency as USD.
I propose two solutions.
First, add a currency
parameter at the end of the startSplitBill()
function.
function startSplitBill(participants, currentUserLogin, currentUserAccountID, comment, receipt, existingSplitChatReportID = '', currency) {
Next, pass the props.iou.currency
to startSplitBill()
method call in MoneyRequestConfirmPage
, similar to what happens in a regular money request.
IOU.startSplitBill(
selectedParticipants,
props.currentUserPersonalDetails.login,
props.currentUserPersonalDetails.accountID,
trimmedComment,
receipt,
existingSplitChatReportID,
props.iou.currency // <- Added
);
Finally, replace CONST.CURRENCY.USD
with this currency in splitTransaction
.
const splitTransaction = TransactionUtils.buildOptimisticTransaction(
0,
currency, // <- currency replaced
CONST.REPORT.SPLIT_REPORTID,
comment,
'',
'',
'',
CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT,
receiptObject,
filename,
);
This solution improves consistency with what happens in a regular money request.
Since we already have the current user's personal details, we can leverage this and replace CONST.CURRENCY.USD
with currentUserPersonalDetails.localCurrencyCode
.
const splitTransaction = TransactionUtils.buildOptimisticTransaction(
0,
currentUserPersonalDetails.localCurrencyCode, // <- currency replaced
CONST.REPORT.SPLIT_REPORTID,
comment,
'',
'',
'',
CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT,
receiptObject,
filename,
);
This second option has lesser changes.
Either of these solutions addresses the front end issue, but as you can see from the following video, the back end changes the currency back to USD, so a change will need to happen over there too.
Another indicator of a back end issue is if you test either of my proposed solutions offline, the currency stays at the local one.
Once you go back online, the currency is reverted back to USD.
I thought about making one of my two proposed solutions an alternative, but I figured I'd propose them together since the difference between them isn't that great.
@anmurali, @aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@anmurali, @aimane-chnaif 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
Current assignee @aimane-chnaif is eligible for the External assigner, not assigning anyone new.
@aimane-chnaif can you review proposals and pick one so we can proceed?
As backend also sends the currency as USD for scan transaction, first wanna confirm if it's intentional. 🎀 👀 🎀
Triggered auto assignment to @marcochavezf, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@marcochavezf @anmurali @aimane-chnaif 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!
@marcochavezf, @anmurali, @aimane-chnaif Huh... This is 4 days overdue. Who can take care of this?
Checking it out today
Oops I've been swamped with some higher priorities.
@marcochavezf @anmurali @aimane-chnaif this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!
@marcochavezf, @anmurali, @aimane-chnaif Whoops! This issue is 2 days overdue. Let's get this updated quick!
No update
No update, focused on other higher priority items atm
@marcochavezf @anmurali @aimane-chnaif this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:
Thanks!
Current assignee @aimane-chnaif is eligible for the Internal assigner, not assigning anyone new.
@marcochavezf, @anmurali, @aimane-chnaif Whoops! This issue is 2 days overdue. Let's get this updated quick!
@marcochavezf @anmurali @aimane-chnaif this issue is now 4 weeks old and preventing us from maintaining WAQ. This should now be your highest priority. Please post below what your plan is to get a PR in review ASAP. Thanks!
@marcochavezf, @anmurali, @aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@marcochavezf @anmurali @aimane-chnaif this issue is now 4 weeks old and preventing us from maintaining WAQ. This should now be your highest priority. Please post below what your plan is to get a PR in review ASAP. Thanks!
No update
No update, still addressing other daily items
No update
No update
Moving this to weekly to focus on wave7
No update, still focused on critical items for wave7
No update
No update
No update
Focused on wave issues, no update
No update, probably this GH can probably be part of VIP project
No update, focused on wave work
No update
Adding BZ backup but this is still lower priority than waves so makes sense
Triggered auto assignment to @laurenreidexpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Still focused on wave work. I'm going to move it to weekly meanwhile
No update, focused on critical and high-priority wave tasks
No update
No update, focused on higher priority tasks/bugs
I checked it out, and yes, we need a backend fix for this first. I created a few PRs to update the currency and quickly created a frontend PR to test the changes. The frontend PR includes part of the proposals from @sicarius97 and @Victor-Nyagudi, so we can split the compensation after the PR is deployed to production.
@marcochavezf please Assign me this issue for tracking payment
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.62-17 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-04-25. :confetti_ball:
For reference, here are some details about the assignees on this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
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: 1.3.84-7 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:
Issue found when executing PR https://github.com/Expensify/App/pull/29664
Action Performed:
Expected Result:
In Step 6, when editing the amount for split bill, the currency should be in the local currency
Actual Result:
In Step 6, when editing the amount for split bill, the currency is USD. While the currency in Manual split bill (Step 2) and 1:1 Scan request (Step 8) follows the local currency
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
https://github.com/Expensify/App/assets/78819774/8193c984-2317-4ba0-ba79-e8f1218dc1c8MacOS: Desktop
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @anmuraliIssue Owner
Current Issue Owner: @marcochavezf