Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
2.99k stars 2.5k forks source link

[Wave Collect][Xero] Import tracking categories #41441

Closed mananjadhav closed 1 week ago

mananjadhav commented 2 weeks ago

Details

Fixed Issues

$ https://github.com/Expensify/App/issues/39732 PROPOSAL:

Tests

Pre-requisite:

  1. Xero account setup in an existing workspace.
  2. You need to have 2 tracking categories named "Region" and "Cost centers", to set their mapping.
  3. On your Xero account, select the Demo company organization.
  4. Go to Accounting > Advanced, select "Tracking categories".
  5. You should see something named "Region", in reality it can be any name that's why you must show/hide the option depending on the name of the tracking category.
  6. Add a new tracking category named "Cost centers".

https://github.com/Expensify/App/assets/3069065/48094376-10db-4e18-b4fa-586d0a4ee134

Steps

  1. Login with a user who already has the Xero account setup.
  2. Go to Workspace having Xero connection -> Accounting -> Import.
  3. Click on Tracking Categories
  4. Verify that you're able to see Import toggle switch.
  5. If the import toggle is off, then you shouldn't see any other option in the page.
  6. Switch the Import to On, in the data you can verify that policy_<policyID>.connections.xero.config.importTrackingCategories is set to true. On switching off, it is set to false.
  7. Once turned on you should see two items Map Xero cost centers to and Map Xero regions to.
  8. Click on each of the menu items and perform the following steps: a. You should see the title of the page as the Map Xero <fieldname> to. b. You should see two options Xero contact default and Tags as two menu items. c. On selecting any one of the options, you should be redirected back to the tracking categories page, and the selected option should show up against each field title. d. In policy_<policyID>.connections.xero.mappings.trackingCategory_<trackingCategoryId> you should see the selected value , ie, DEFAULT for Xero contact default and TAG for Tags. e. The trackingCategoryId should be based on the id field of policy_<policyID>.connections.xero.trackingCategories.name matched to cost centers and regions respectively.

For all the data verification related info, go to Chrom Dev Tools -> Application -> Storage -> OnyxDB -> Search for your policy_. Check out the data in the connections object as shown in the screenshot below.

image

Offline tests

Same as Tests.

QA Steps

Same as Tests.

PR Author Checklist

Screenshots/Videos

Android: Native https://github.com/Expensify/App/assets/3069065/bc492e12-81d7-4662-ab37-602b690fd9d5
Android: mWeb Chrome https://github.com/Expensify/App/assets/3069065/a34a23fd-fd59-48cb-8fb3-28e257b015bf
iOS: Native https://github.com/Expensify/App/assets/3069065/104b5d0b-bda5-449e-adaa-57f088a07e44
iOS: mWeb Safari https://github.com/Expensify/App/assets/3069065/51a1aa66-97e3-4803-ba41-620924d35b6d
MacOS: Chrome / Safari https://github.com/Expensify/App/assets/3069065/ea3dd2f9-3147-4921-b0ff-d748c80bb12e
MacOS: Desktop https://github.com/Expensify/App/assets/3069065/28197ed0-3d81-40d0-ace1-12e36ba1caac
mananjadhav commented 1 week ago

On Hold for https://github.com/Expensify/App/pull/41561. Waiting for ConnectionLayout padding fix to get merged so that I can create the screencasts for the mapping screens.

melvin-bot[bot] commented 1 week ago

@fedirjh Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

mananjadhav commented 1 week ago

@Expensify/design For your review.

rushatgabhane commented 1 week ago

@mananjadhav i can't see cost center and region

image

mananjadhav commented 1 week ago

@rushatgabhane Did you check the pre-requisite in the Test steps? and did you try to select the Demo company ?

Pre-requisite:

  1. Xero account setup in an existing workspace.
  2. You need to have 2 tracking categories named "Region" and "Cost centers", to set their mapping.
  3. On your Xero account, select the Demo company organization.
  4. Go to Accounting > Advanced, select "Tracking categories".
  5. You should see something named "Region", in reality it can be any name that's why you must show/hide the option depending on the name of the tracking category.
  6. Add a new tracking category named "Cost centers".
lakchote commented 1 week ago

@mananjadhav i can't see cost center and region

To follow up with @mananjadhav, please see this discussion for context on how to enable them.

mananjadhav commented 1 week ago

@lakchote I didn't understand what you meant? The link also doesn't take me to any specific thread. I already added the pre-requisite on how to add them based on your instructions in slack. Is there anything else that's expected from me?

shawnborton commented 1 week ago

Design-wise this looks good to me.

mananjadhav commented 1 week ago

This is because the category options are hardcoded to Tags and Default. But I selected Report Field

Got it. We'll be adding this in future. But at the moment I think it should show blank here then? @trjExpensify @lakchote ?

rushatgabhane commented 1 week ago

Reviewer Checklist

Screenshots/Videos

Android: Native image
Android: mWeb Chrome
iOS: Native https://github.com/Expensify/App/assets/29673073/a29cbc4f-ae61-42d4-b3d2-021428080824
iOS: mWeb Safari image https://github.com/Expensify/App/assets/29673073/18ce3882-fe6a-4f51-9989-52745e968bb2
MacOS: Chrome / Safari https://github.com/Expensify/App/assets/29673073/fd061085-fcf1-4919-9d1a-8ccc1c2224c3 image
MacOS: Desktop image
lakchote commented 1 week ago

@lakchote I didn't understand what you meant? The link also doesn't take me to any specific thread. I already added the pre-requisite on how to add them based on your instructions in slack. Is there anything else that's expected from me?

It was meant for @rushatgabhane to help him enable mapping options.

This is because the category options are hardcoded to Tags and Default. But I selected Report Field

Got it. We'll be adding this in future. But at the moment I think it should show blank here then? @trjExpensify @lakchote ?

Report field will be added once we'll port Control workspaces to NewDot. It's a Control feature.

I'd move in favour of showing blank there in the meantime.

mananjadhav commented 1 week ago

Thanks for the comment @lakchote. I'll push an update in a while for the Report field.

mananjadhav commented 1 week ago

@rushatgabhane @lakchote Added a fix to show blank for the report field. I didn't refactor too much because we are anyway going remove it later.

Screenshot 2024-05-07 at 9 47 39β€―PM
OSBotify commented 1 week ago

:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

lakchote commented 1 week ago

I have merged by mistake (since we're on merge freeze). Since it's behind beta, and it should not influence any user behaviour we don't need to revert it.

I've created a new xero-merge-freeze branch for the next Xero PRs, people will need to use it as a base instead of main in the meantime to not block progress.

OSBotify commented 1 week ago

πŸš€ Deployed to staging by https://github.com/lakchote in version: 1.4.72-0 πŸš€

platform result
πŸ€– android πŸ€– success βœ…
πŸ–₯ desktop πŸ–₯ success βœ…
🍎 iOS 🍎 success βœ…
πŸ•Έ web πŸ•Έ success βœ…
lanitochka17 commented 1 week ago

Tell us about PR Pre-props: step 4 cannot be completed because we do not see "Tracking categories" Go to Accounting > Advanced, select Tracking Categories. How do we set up an account to complete these steps? thank you in advance

https://github.com/Expensify/App/assets/78819774/4d56ce08-77d3-4a7d-b3fb-1de2ec19d8b4

mananjadhav commented 1 week ago

@lanitochka17 Did you try the steps mentioned in the pre-requisites? Please find attached video on navigating through Xero. You should see Demo Company when you create a new account on Xero, and use that for syncing when you test it.

https://github.com/Expensify/App/assets/3069065/48094376-10db-4e18-b4fa-586d0a4ee134

m-natarajan commented 1 week ago

@mananjadhav Thanks for sharing the video again. I have a question, How to verify the PR step 6 and 8.d and e? Is this can only be done internally?

mananjadhav commented 1 week ago

You should be able to view this in the application data onyxdb in Chrom Dev tools. I've added a note in the steps along with the screenshot.

OSBotify commented 5 days ago

πŸš€ Deployed to production by https://github.com/Beamanator in version: 1.4.72-1 πŸš€

platform result
πŸ€– android πŸ€– success βœ…
πŸ–₯ desktop πŸ–₯ success βœ…
🍎 iOS 🍎 success βœ…
πŸ•Έ web πŸ•Έ success βœ