[$250] Expensify Card - Settlement account is blank when second admin accesses the page
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.0.65-4 Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team
Action Performed:
Precondition:
- Expensify Card feature is enabled.
- Bank account is set up in the workspace.
- Go to staging.new.expensify.com
- Go to workspace settings > Members.
- Invite another user and promote to admin.
- Log in as admin.
- Go to workspace settings > Expensify Card.
- Click Settings.
- Click Settlement account.
Expected Result:
Settlement account will not be blank.
Actual Result:
Settlement account is blank when second admin accesses the page.
Workaround:
Unknown
Platforms:
- [x] Android: Standalone
- [x] Android: HybridApp
- [x] Android: mWeb Chrome
- [x] iOS: Standalone
- [x] iOS: HybridApp
- [x] iOS: mWeb Safari
- [x] MacOS: Chrome / Safari
- [x] MacOS: Desktop
Screenshots/Videos
https://github.com/user-attachments/assets/d7bd26a6-98f5-44c6-9dc6-8e0a764f467d
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021861520764980845600
- Upwork Job ID: 1861520764980845600
- Last Price Increase: 2024-12-03
- Automatic offers:
- DylanDylann | Contributor | 105192011
Issue Owner
Current Issue Owner: @mountiny
Triggered auto assignment to @JmillsExpensify (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.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Settlement account is blank when second admin accesses the page
What is the root cause of that problem?
Currently on the expensify cards settings page, we get the current users personal bank account details:
https://github.com/Expensify/App/blob/51e25af3df2eef49c2ac87e0aef816099f9d3747/src/pages/workspace/expensifyCard/WorkspaceCardSettingsPage.tsx#L31
https://github.com/Expensify/App/blob/51e25af3df2eef49c2ac87e0aef816099f9d3747/src/ONYXKEYS.ts#L262-L263
Hence we do not see current bank selected.
But here we need the current policy account details and not individual, hence from admin account the field is shown as blank.
What changes do you think we should make in order to solve the problem?
To fix it, firstly we should get the bank account data from policy?.achAccount and then display that in the settings page:
- So in
WorkspaceCardSettingsPage: https://github.com/Expensify/App/blob/51e25af3df2eef49c2ac87e0aef816099f9d3747/src/pages/workspace/expensifyCard/WorkspaceCardSettingsPage.tsx#L25 https://github.com/Expensify/App/blob/51e25af3df2eef49c2ac87e0aef816099f9d3747/src/pages/workspace/expensifyCard/WorkspaceCardSettingsPage.tsx#L38
We need to get the achAccount data and get the bank account number from there:
const bankAccountNumber = policy?.achAccount?.accountNumber ?? '';
- Then in
WorkspaceSettlementAccountPage, we have multiple options.
a) Either disable this page for admins, This is because now we will get the admin's bank accounts rather than the owners.
b) If we want to allow the settlement accounts to be changed to the admins bank account then the current implementation works, but with a catch that if there is no bank account added by the admin then we should show an empty RHP stating that please add a bank account.
I think option A is more appropriate here given that we do not want the admin to add their own bank account
What alternative solutions did you explore? (Optional)
@JmillsExpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
Job added to Upwork: https://www.upwork.com/jobs/~021861520764980845600
Opening up to the community
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 (External)
@JmillsExpensify, @eh2077 Huh... This is 4 days overdue. Who can take care of this?
@eh2077 can you please review my proposal here
@twilight2294 I have trouble to setup Expensify Card. Can you share steps to setup Expensify Card?
Connect this bank account and then assign expensify cards from workspace. that's all i did to reproduce this issue
I managed to reproduce the bug.
@twilight2294 's proposal looks good to me. Let's go with their proposal!
🎀👀🎀 C+ reviewed
Triggered auto assignment to @Beamanator, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@eh2077 Sorry, I am not sure that policy?.achAccount is existing
Coincidentally I'm also following this because it's part of the Expensify Card feature which I've been in charge of since the beginning.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
achAccount
@DylanDylann don't worry i have checked thoroughly it exists below: https://github.com/Expensify/App/blob/01d5233e80a4d4dbe87e6b1e85fdea5dc3c10136/src/types/onyx/Policy.ts#L1801-L1802
We already use a similar check here: https://github.com/Expensify/App/blob/01d5233e80a4d4dbe87e6b1e85fdea5dc3c10136/src/libs/NextStepUtils.ts#L96
My solutions solves this bug efficiently , @Beamanator can you assign me here please as per summary by C+. Also if you have any doubts then let me know, i can answer then
@DylanDylann don't worry i have checked thoroughly it exists below:
I don't see it in my workspace. Could you screenshot achAccount data?
I think that the verified bank account linked to the policy doesn't mean a settled bank account on an Expensify card.Please correct me If I am wrong
I don't see it in my workspace. Could you screenshot achAccount data?
You should check if your workspace is connected to bank account first in order to see achAccount
I tested the solution locally and it works great, so maybe a problem with your setup
@DylanDylann I'm definitely interested in your expertise here if you've been working on Expensify Card features / fixes for a while - do you know an internal Expensify coder who could help us resolve this matter?
cc @mountiny
@twilight2294 I think that @DylanDylann is right, you could have different bank accounts as the reimbursement account setup in the workflows page and as the settlement bank account for the Expensify card.
@Beamanator I can assign to myself if that is ok since I was leading this project
I think that its expected that if you are admin who is not owner of any vbba, you do not see the bank accounts there. So maybe we could show something like you do not have access to any VBBA
So maybe we could show something like you do not have access to any VBBA
Where exactly ? on the settings page ? or we should hide it completely ?
Hiding it completely would be appropriate right ? as we do not have the value present, we can only display the text below it and hide option above it:
We can check if the current user has BANK_ACCOUNT_LIST (VBBA account) present and then conditionally render the option (have to check if that is allowed on the backend
Started a thread here
@twilight2294 we need to discuss this internally first to know the right expectations
Thank you for taking over, kind sir @mountiny 🙏
@DylanDylann Would you like take over this as C+ as you have more context about the feature? Thanks 🙏
@eh2077 IMO, this issue may need to be fixed on the BE side, I can help to take over it and follow the discussion
@twilight2294 we need to discuss this internally first to know the right expectations
Okay, I will update the proposal when the expected result is updated, thanks