Repository navigation
[Payment due @huult] feat: Add Intuit Enterprise Suite integration #97637
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
Merged
lakchote
merged 28 commits into
Expensify:main
from
ShridharGoel:feat/ies-integration-option
Aug 5, 2026
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
e31147b
feat(accounting): add Intuit Enterprise Suite
ShridharGoel ef35707
feat(accounting): add sandbox connect option
ShridharGoel 61e845e
refactor(accounting): separate display names
ShridharGoel 5ffd639
feat(accounting): gate IES behind beta
ShridharGoel db8f9ef
refactor(accounting): clarify IES visibility
ShridharGoel b30df77
fix(accounting): resolve IES CI errors
ShridharGoel 3faf98c
Merge remote-tracking branch 'origin/main' into codex/pr-97637-ci-fix
ShridharGoel 6f38c2b
fix(localization): use Greek display names
ShridharGoel 30e0a14
fix(localization): add Greek accounting labels
ShridharGoel 91fbde0
test(accounting): update QBO setup arguments
ShridharGoel bfaaa28
Merge remote-tracking branch 'origin/main' into feat/ies-integration-…
ShridharGoel 11c10b9
fix: guard QBO connection initialization
ShridharGoel 3af7b5d
fix: separate QBO selection identity
ShridharGoel dc025f1
fix(accounting): limit sandbox connection menu
ShridharGoel bf928b5
fix(accounting): stop reopening connect popover
ShridharGoel f94f12b
fix(accounting): label IES sync progress
ShridharGoel 227c79a
fix(accounting): prevent IES label flicker
ShridharGoel 7a02216
fix(accounting): label IES settings
ShridharGoel 6056247
fix(accounting): label IES imported data
ShridharGoel e3f019f
fix(accounting): stabilize IES UI updates
ShridharGoel 127e5a8
fix(accounting): narrow IES route param type
ShridharGoel 8340cfc
fix(accounting): resolve IES type errors
ShridharGoel 7b2758b
Update BaseConnectToQuickbooksOnlineFlow.tsx
ShridharGoel 62f83a3
fix(accounting): preserve translation key types
ShridharGoel 44e1fc6
test(accounting): cover QBO connection flow
ShridharGoel 3b2f8b2
fix(accounting): show IES connection labels
ShridharGoel 15a4633
test(accounting): fix connection flow lint
ShridharGoel d3f35aa
test(accounting): use locale functions directly
ShridharGoel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
src/components/ConnectToQuickbooksOnlineFlow/BaseConnectToQuickbooksOnlineFlow.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| /** | ||
| * Shared QuickBooks Online and Intuit Enterprise Suite connection flow. | ||
| * Development environments can select a production or sandbox connection before starting the platform-specific flow. | ||
| */ | ||
| import PopoverMenu from '@components/PopoverMenu'; | ||
|
|
||
| import useEnvironment from '@hooks/useEnvironment'; | ||
| import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useOnyx from '@hooks/useOnyx'; | ||
| import usePopoverPosition from '@hooks/usePopoverPosition'; | ||
|
|
||
| import {isAuthenticationError} from '@libs/actions/connections'; | ||
|
|
||
| import {useAccountingState} from '@pages/workspace/accounting/AccountingContext'; | ||
|
|
||
| import type {AnchorPosition} from '@styles/index'; | ||
|
|
||
| import {enablePolicyTaxes} from '@userActions/Policy/Policy'; | ||
|
|
||
| import CONST from '@src/CONST'; | ||
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
|
|
||
| import React, {useEffect, useLayoutEffect, useRef, useState} from 'react'; | ||
|
|
||
| import type {ConnectToQuickbooksOnlineFlowProps} from './types'; | ||
|
|
||
| type BaseConnectToQuickbooksOnlineFlowProps = ConnectToQuickbooksOnlineFlowProps & { | ||
| onConnect: (isSandbox: boolean) => void; | ||
| }; | ||
|
|
||
| const anchorAlignment = { | ||
| horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT, | ||
| vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP, | ||
| }; | ||
|
|
||
| function BaseConnectToQuickbooksOnlineFlow({policyID, isIntuitEnterpriseSuite, onConnect}: BaseConnectToQuickbooksOnlineFlowProps) { | ||
| const {environment} = useEnvironment(); | ||
| const {translate} = useLocalize(); | ||
| const {popoverAnchorRefs} = useAccountingState(); | ||
| const {calculatePopoverPosition} = usePopoverPosition(); | ||
| const icons = useMemoizedLazyExpensifyIcons(['LinkCopy']); | ||
| const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`); | ||
| const isAuthError = isAuthenticationError(policy, CONST.POLICY.CONNECTIONS.NAME.QBO); | ||
| const shouldShowConnectionOptions = !!isIntuitEnterpriseSuite && environment === CONST.ENVIRONMENT.DEV && !isAuthError; | ||
| const [isConnectionOptionsPopoverOpen, setIsConnectionOptionsPopoverOpen] = useState(shouldShowConnectionOptions); | ||
| const [connectionOptionsPopoverPosition, setConnectionOptionsPopoverPosition] = useState<AnchorPosition | null>(null); | ||
| const didInitialize = useRef(false); | ||
| const integrationKey = isIntuitEnterpriseSuite ? CONST.POLICY.CONNECTIONS.ACCOUNTING_INTEGRATION_ALIASES.INTUIT_ENTERPRISE_SUITE : CONST.POLICY.CONNECTIONS.NAME.QBO; | ||
| const connectionButtonRef = popoverAnchorRefs?.current?.[integrationKey]; | ||
|
|
||
| const selectConnection = (isSandbox: boolean) => { | ||
| onConnect(isSandbox); | ||
| setIsConnectionOptionsPopoverOpen(false); | ||
| }; | ||
|
|
||
| useEffect(() => { | ||
|
ShridharGoel marked this conversation as resolved.
Resolved
|
||
| if (didInitialize.current) { | ||
| return; | ||
| } | ||
| didInitialize.current = true; | ||
|
|
||
| // Since QBO doesn't support Taxes, we should disable them from the LHN when connecting to QBO | ||
| enablePolicyTaxes(policyID, false); | ||
| // Reconnect starts from the overflow menu, so there is no connection button to anchor this popover to. | ||
| if (!shouldShowConnectionOptions) { | ||
| onConnect(false); | ||
| } | ||
| }, [onConnect, policyID, shouldShowConnectionOptions]); | ||
|
|
||
| useLayoutEffect(() => { | ||
| if (!isConnectionOptionsPopoverOpen) { | ||
| return; | ||
| } | ||
| calculatePopoverPosition(connectionButtonRef, anchorAlignment).then(setConnectionOptionsPopoverPosition); | ||
| }, [isConnectionOptionsPopoverOpen, calculatePopoverPosition, connectionButtonRef]); | ||
|
|
||
| if (!connectionOptionsPopoverPosition) { | ||
| return null; | ||
| } | ||
|
|
||
| return ( | ||
| <PopoverMenu | ||
| isVisible={isConnectionOptionsPopoverOpen} | ||
| onClose={() => setIsConnectionOptionsPopoverOpen(false)} | ||
| menuItems={[ | ||
| { | ||
| icon: icons.LinkCopy, | ||
| text: translate('workspace.accounting.setup'), | ||
| onSelected: () => selectConnection(false), | ||
| }, | ||
| { | ||
| icon: icons.LinkCopy, | ||
| text: translate('workspace.accounting.connectToSandbox'), | ||
| onSelected: () => selectConnection(true), | ||
| }, | ||
| ]} | ||
| anchorPosition={connectionOptionsPopoverPosition} | ||
| anchorAlignment={anchorAlignment} | ||
| anchorRef={connectionButtonRef} | ||
| /> | ||
| ); | ||
| } | ||
|
|
||
| export default BaseConnectToQuickbooksOnlineFlow; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.