-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New Feature: "When to export" selector for auto-sync for NetSuite #51949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| }, | ||
| }, | ||
| accountingMethods: { | ||
| label: 'Cuándo Exportar', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aimane-chnaif can you please confirm these translations, I'm yet to be added in the open source channel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@twilight2294 Here's updated copies:
English: (- added in out of pocket)
When to Export
Choose when to export the expenses:
Accrual
Cash
Out-of-pocket expenses will export when final approved
Out-of-pocket expenses will export when paid
Sync NetSuite and Expensify automatically, every day. Export finalized report in realtime
Spanish:
Cuándo Exportar
Elige cuándo exportar los gastos:
Devengo
Efectivo
Los gastos por cuenta propia se exportarán cuando estén aprobados definitivamente
Los gastos por cuenta propia se exportarán cuando estén pagados
Sincroniza NetSuite y Expensify automáticamente, todos los días. Exporta el informe finalizado en tiempo real.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the help, it's late here, I will update tomorrow
|
|
||
| const selectExpenseReportApprovalLevel = useCallback( | ||
| (row: MenuListItem) => { | ||
| // if (row.value !== config?.syncOptions.exportReportsTo) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for the API to be named, i will update this after that
578bb81 to
fc05e8f
Compare
fc05e8f to
1f8b718
Compare
|
pushed, verified commit! |
|
@twilight2294 Why is there a need to force-push here? |
|
There are TS and Lint errors also. Please address them. |
I was waiting for the API info, I should have it ready for review today |
I somehow commited the code but it was in unverified status, so i had to update the GPG key and make the commit verified |
|
@twilight2294 I will review it in some time. |
|
Done, thanks :) |
|
Also @rojiphil I am still not sure about this comment, for the very first time when we enable the toggle, we have to set the value of accountingMethod to CASH otherwise it will be undefined on the BE untill the user selectes it manually (We only set it to cash on the frontend if accountingMethod is undefined. we need BE changes for that (though it shouldn't block this PR) |
rojiphil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@twilight2294 Thanks for the PR. I have left some review comments. Please have a look.
src/CONST.ts
Outdated
| NETSUITE_ACCOUNTING_METHODS: { | ||
| ACCRUAL: 'ACCRUAL', | ||
| CASH: 'CASH', | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the constants defined in Expensify Common though: Expensify/expensify-common#817
As mentioned in the OP of the issue mentioned above, let us make use of the consts from there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yuwenmemon do we want to use CONST from the common repo ? I think it's better to define it here in App repo, but let me know if there is a reason to use it from upstream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it is already defined in expensify-common, let us use it as we should only have a single source of truth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rojiphil we already import a CONST in that same file, how do we import the new consts from the upstream repo ?

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not use this?
Line 1 in 2ef91b8
| import {CONST as COMMON_CONST} from 'expensify-common'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh i was unaware of that updating now, thanks for the help
src/pages/workspace/accounting/netsuite/advanced/NetSuiteAccountingMethodPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/netsuite/advanced/NetSuiteAccountingMethodPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/netsuite/advanced/NetSuiteAutoSyncPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/netsuite/advanced/NetSuiteAutoSyncPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/netsuite/advanced/NetSuiteAdvancedPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/netsuite/advanced/NetSuiteAdvancedPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/netsuite/advanced/NetSuiteAutoSyncPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/netsuite/advanced/NetSuiteAutoSyncPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/netsuite/advanced/NetSuiteAccountingMethodPage.tsx
Outdated
Show resolved
Hide resolved
I am not sure if I get the problem here. Let me explain as I understand and confirm. When we enable Also, enabling or disabling the @yuwenmemon @dannymcclain Is the above understanding correct? |
|
Sure, I will work on the feedback today 👍 |
No it considers it as |
Updated, thanks, can you test this now 😄 |
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / Safari51949-web-safari-001.mp4Android: Native51949-android-native-001.mp4iOS: mWeb Safari51949-mweb-safari-001.mp4Android: mWeb Chrome51949-mweb-chrome-001.mp4iOS: Native51949-ios-native-001.mp4MacOS: Desktop51949-desktop-001.mp4 |
rojiphil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @twilight2294 for all the changes.
@yuwenmemon Changes LGTM and works well too.
Over to you for review. Thanks.
|
@twilight2294 Just found out an issue during offline testing as demonstrated in the test video below. Here, the auto sync status i.e. @yuwenmemon Please hold review until this is integrated too. 51949-offline-issue.mp4 |
|
I will fix this today/tomorrow for sure, thanks for pointing out |
|
@rojiphil what should be the behaviour on Screen.Recording.2024-11-11.at.2.40.41.PM.movFYI it's a bit difficult to put the hint text in pending state on |
| pendingAction={settingsPendingAction( | ||
| item.subscribedSettings, | ||
| item.subscribedSettings?.includes(CONST.NETSUITE_CONFIG.AUTO_SYNC) ? autoSyncConfig?.pendingFields : config?.pendingFields, | ||
| )} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to do this because we set the pendingFields for AUTO_SYNC in autoSyncConfig and not config, do let me know if you have more doubts about this implementation @rojiphil
When the 51949-greying-issue.mp4 |
|
Thanks, I will update shortly |
|
Working on the fix now |
|
@rojiphil can you test again, all should work good now! |
rojiphil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @twilight2294 for the changes.
@yuwenmemon LGTM and works well in offline too.
All yours for review. Thanks
51949-web-safari-offline-001.mp4
| if (row.value !== config?.accountingMethod) { | ||
| Connections.updateNetSuiteAccountingMethod(policyID, row.value, config?.accountingMethod ?? COMMON_CONST.INTEGRATIONS.ACCOUNTING_METHOD.CASH); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB: Add a comment here explaining why we're defaulting to CASH
|
Tested as well, works great! Thanks! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/yuwenmemon in version: 9.0.63-1 🚀
|
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 9.0.63-3 🚀
|
Explanation of Change
Adding a new feature "When to export" selector for auto-sync for NetSuite
Fixed Issues
$ #51512
PROPOSAL: #51512 (comment)
Tests
Precondition: Workspace is connected to Netsuite Accounting method.
when to exportappears.Verify that: you are navigated back to the previous page
Verify that: if we select
CASHas option then the hint text below auto-sync option should be:Out-of-pocket expenses will export when paidand if we selectACCURALas option then the hind text should be:Out-of-pocket expenses will export when final approved.Offline tests
Precondition: Workspace is connected to Netsuite Accounting method.
when to exportappears.Verify that: you are navigated back to the previous page
Verify that: if we select
CASHas option then the hint text below auto-sync option should be:Out-of-pocket expenses will export when paidand if we selectACCURALas option then the hind text should be:Out-of-pocket expenses will export when final approved.QA Steps
Precondition: Workspace is connected to Netsuite Accounting method.
when to exportappears.Verify that: you are navigated back to the previous page
Verify that: if we select
CASHas option then the hint text below auto-sync option should be:Out-of-pocket expenses will export when paidand if we selectACCURALas option then the hind text should be:Out-of-pocket expenses will export when final approved.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2024-11-06.at.10.46.28.AM.mov
Android: mWeb Chrome
Screen.Recording.2024-11-06.at.10.48.41.AM.mov
iOS: Native
Screen.Recording.2024-11-06.at.10.59.51.AM.mov
iOS: mWeb Safari
Screen.Recording.2024-11-06.at.10.57.55.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2024-11-06.at.9.54.47.AM.mov
MacOS: Desktop
Screen.Recording.2024-11-06.at.10.03.02.AM.mov