From 1896097ab094e5c3cc40b893e4a0bfd68d84261f Mon Sep 17 00:00:00 2001 From: Chavda Sachin Date: Mon, 18 May 2026 18:08:48 +0530 Subject: [PATCH 01/15] Add Certinia upgrade mapping and English prerequisites copy --- src/CONST/index.ts | 8 ++++++++ src/languages/en.ts | 26 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 7c18d7f37175..c6efbbee91c1 100644 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -8481,6 +8481,14 @@ const CONST = { description: `workspace.upgrade.${this.POLICY.CONNECTIONS.NAME.QBD}.description` as const, icon: 'QBDSquare', }, + [this.POLICY.CONNECTIONS.NAME.CERTINIA]: { + id: this.POLICY.CONNECTIONS.NAME.CERTINIA, + alias: 'certinia', + name: this.POLICY.CONNECTIONS.NAME_USER_FRIENDLY.financialforce, + title: `workspace.upgrade.${this.POLICY.CONNECTIONS.NAME.CERTINIA}.title` as const, + description: `workspace.upgrade.${this.POLICY.CONNECTIONS.NAME.CERTINIA}.description` as const, + icon: 'CertiniaSquare', + }, approvals: { id: 'approvals' as const, alias: 'approvals' as const, diff --git a/src/languages/en.ts b/src/languages/en.ts index 500ce46cc363..ee2b96397991 100644 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -4886,6 +4886,26 @@ const translations = { }, }, }, + certinia: { + title: 'Certinia', + prerequisites: { + title: 'Before you connect', + installBundle: 'For FFA Connections', + installBundleDescription: ({href}: {href: string}) => + `Install the Expensify bundle in Salesforce by clicking this link: Install FFA Expensify Bundle (Version 1.4)`, + installBundleConfirm: "I've installed the bundle", + setupContacts: 'Set up user and contacts', + setupContactsBullet1: + "Create both a User and a Contact for yourself if these don't already exist in Certinia making sure ine email matenes your primary emall in Expensify.\n\n", + setupContactsBullet2: + "Create contacts for each employee who will be submitting expense reports and for each report approver. Make sure each contact's email address corresponds with the email address on the employee's Expensify account.\n\n", + setupContactsBullet3: 'Set permission controls for your user for each contact/resource.\n\n', + setupContactsConfirm: "I've set up the user and contacts", + oauth: 'Log in through Salesforce', + oauthDescription: "To finish setup, you'll have to sign in through Salesforce and Certinia.\n\nUse the button below to continue.", + connectButton: 'Connect to Certinia', + }, + }, netsuite: { subsidiary: 'Subsidiary', subsidiarySelectDescription: "Choose the subsidiary in NetSuite that you'd like to import data from.", @@ -6705,6 +6725,12 @@ const translations = { onlyAvailableOnPlan: ({formattedPrice, hasTeam2025Pricing}: {formattedPrice: string; hasTeam2025Pricing: boolean}) => `Our QuickBooks Desktop integration is only available on the Control plan, starting at ${formattedPrice} ${hasTeam2025Pricing ? `per member per month.` : `per active member per month.`}`, }, + [CONST.POLICY.CONNECTIONS.NAME.CERTINIA]: { + title: 'Certinia', + description: `Enjoy automated syncing and reduce manual entries with the Expensify + Certinia integration. Align expense coding dimensions and tax sync with your Certinia setup for clearer financial visibility.`, + onlyAvailableOnPlan: ({formattedPrice, hasTeam2025Pricing}: {formattedPrice: string; hasTeam2025Pricing: boolean}) => + `Our Certinia integration is only available on the Control plan, starting at ${formattedPrice} ${hasTeam2025Pricing ? `per member per month.` : `per active member per month.`}`, + }, [CONST.UPGRADE_FEATURE_INTRO_MAPPING.approvals.id]: { title: 'Advanced Approvals', description: `If you want to add more layers of approval to the mix – or just make sure the largest expenses get another set of eyes – we’ve got you covered. Advanced approvals help you put the right checks in place at every level so you keep your team’s spend under control.`, From f909ea034b7fbdf3f95dd91c7f5c5ef452ceb9a4 Mon Sep 17 00:00:00 2001 From: Chavda Sachin Date: Mon, 18 May 2026 23:56:23 +0530 Subject: [PATCH 02/15] Add Certinia prerequisites wizard and existing connections pages --- .../CertiniaExistingConnectionsPage.tsx | 79 ++++++++++++++++ .../certinia/CertiniaPrerequisitesPage.tsx | 93 +++++++++++++++++++ .../CertiniaPrerequisitesStep.tsx | 78 ++++++++++++++++ 3 files changed, 250 insertions(+) create mode 100644 src/pages/workspace/accounting/certinia/CertiniaExistingConnectionsPage.tsx create mode 100644 src/pages/workspace/accounting/certinia/CertiniaPrerequisitesPage.tsx create mode 100644 src/pages/workspace/accounting/certinia/prerequisites/CertiniaPrerequisitesStep.tsx diff --git a/src/pages/workspace/accounting/certinia/CertiniaExistingConnectionsPage.tsx b/src/pages/workspace/accounting/certinia/CertiniaExistingConnectionsPage.tsx new file mode 100644 index 000000000000..682fd2fb80e2 --- /dev/null +++ b/src/pages/workspace/accounting/certinia/CertiniaExistingConnectionsPage.tsx @@ -0,0 +1,79 @@ +import React from 'react'; +import HeaderWithBackButton from '@components/HeaderWithBackButton'; +import MenuItem from '@components/MenuItem'; +import MenuItemList from '@components/MenuItemList'; +import ScreenWrapper from '@components/ScreenWrapper'; +import ScrollView from '@components/ScrollView'; +import Text from '@components/Text'; +import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; +import useLocalize from '@hooks/useLocalize'; +import useReusablePoliciesConnectedTo from '@hooks/useReusablePoliciesConnectedTo'; +import useThemeStyles from '@hooks/useThemeStyles'; +import {copyExistingPolicyConnection} from '@libs/actions/connections'; +import Navigation from '@libs/Navigation/Navigation'; +import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types'; +import type {SettingsNavigatorParamList} from '@libs/Navigation/types'; +import {getDefaultWorkspaceAvatar} from '@libs/ReportUtils'; +import variables from '@styles/variables'; +import CONST from '@src/CONST'; +import ROUTES from '@src/ROUTES'; +import SCREENS from '@src/SCREENS'; + +type CertiniaExistingConnectionsPageProps = PlatformStackScreenProps; + +function CertiniaExistingConnectionsPage({route}: CertiniaExistingConnectionsPageProps) { + const {translate, datetimeToRelative} = useLocalize(); + const styles = useThemeStyles(); + const icons = useMemoizedLazyExpensifyIcons(['LinkCopy']); + const policyID: string = route.params.policyID; + const {reusablePoliciesConnectedTo: reusablePoliciesConnectedToCertinia} = useReusablePoliciesConnectedTo(CONST.POLICY.CONNECTIONS.NAME.CERTINIA, policyID); + + const menuItems = reusablePoliciesConnectedToCertinia.map((policy) => { + const lastSuccessfulSyncDate = policy.connections?.financialforce?.lastSync?.successfulDate; + const date = lastSuccessfulSyncDate ? datetimeToRelative(lastSuccessfulSyncDate) : undefined; + return { + title: policy.name, + key: policy.id, + avatarID: policy.id, + icon: policy.avatarURL ? policy.avatarURL : getDefaultWorkspaceAvatar(policy.name), + iconType: CONST.ICON_TYPE_WORKSPACE, + shouldShowRightIcon: true, + description: date ? translate('workspace.common.lastSyncDate', CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY.financialforce, date) : translate('workspace.certinia.title'), + onPress: () => { + copyExistingPolicyConnection(policy.id, policyID, CONST.POLICY.CONNECTIONS.NAME.CERTINIA); + Navigation.dismissModal(); + }, + }; + }); + + return ( + + Navigation.goBack()} + /> + + {translate('workspace.common.existingConnectionsDescription', {connectionName: CONST.POLICY.CONNECTIONS.NAME.CERTINIA})} + Navigation.navigate(ROUTES.POLICY_ACCOUNTING_CERTINIA_PREREQUISITES.getRoute(policyID))} + /> + {translate('workspace.common.existingConnections')} + + + + ); +} + +export default CertiniaExistingConnectionsPage; diff --git a/src/pages/workspace/accounting/certinia/CertiniaPrerequisitesPage.tsx b/src/pages/workspace/accounting/certinia/CertiniaPrerequisitesPage.tsx new file mode 100644 index 000000000000..360f94bb8acc --- /dev/null +++ b/src/pages/workspace/accounting/certinia/CertiniaPrerequisitesPage.tsx @@ -0,0 +1,93 @@ +import React from 'react'; +import {View} from 'react-native'; +import ConnectionLayout from '@components/ConnectionLayout'; +import InteractiveStepSubPageHeader from '@components/InteractiveStepSubPageHeader'; +import useEnvironment from '@hooks/useEnvironment'; +import useOnyx from '@hooks/useOnyx'; +import useSubPage from '@hooks/useSubPage'; +import type {SubPageProps} from '@hooks/useSubPage/types'; +import useThemeStyles from '@hooks/useThemeStyles'; +import {isAuthenticationError} from '@libs/actions/connections'; +import {connectPolicyToFinancialForce} from '@libs/actions/connections/FinancialForce'; +import Navigation from '@libs/Navigation/Navigation'; +import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types'; +import type {SettingsNavigatorParamList} from '@libs/Navigation/types'; +import CONST from '@src/CONST'; +import ONYXKEYS from '@src/ONYXKEYS'; +import ROUTES from '@src/ROUTES'; +import SCREENS from '@src/SCREENS'; +import CertiniaPrerequisitesStep from './prerequisites/CertiniaPrerequisitesStep'; + +type CertiniaPrerequisitesStepExtraProps = SubPageProps & { + onConnect: () => void; +}; + +type CertiniaPrerequisitesPageProps = PlatformStackScreenProps; + +const pages = [ + {pageName: CONST.CERTINIA_PREREQUISITES.PAGE_NAME.INSTALL_BUNDLE, component: CertiniaPrerequisitesStep}, + {pageName: CONST.CERTINIA_PREREQUISITES.PAGE_NAME.SETUP_CONTACTS, component: CertiniaPrerequisitesStep}, + {pageName: CONST.CERTINIA_PREREQUISITES.PAGE_NAME.OAUTH, component: CertiniaPrerequisitesStep}, +]; + +function CertiniaPrerequisitesPage({route}: CertiniaPrerequisitesPageProps) { + const styles = useThemeStyles(); + const {environmentURL} = useEnvironment(); + const policyID: string = route.params.policyID; + const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`); + const config = policy?.connections?.financialforce?.config; + const shouldBeBlocked = !!config?.isConfigured && !isAuthenticationError(policy, CONST.POLICY.CONNECTIONS.NAME.CERTINIA); + + const handleConnect = () => { + connectPolicyToFinancialForce(policyID, false, environmentURL); + Navigation.dismissModal(); + }; + + const {CurrentPage, nextPage, prevPage, pageIndex, moveTo, currentPageName} = useSubPage({ + pages, + onFinished: handleConnect, + buildRoute: (pageName) => ROUTES.POLICY_ACCOUNTING_CERTINIA_PREREQUISITES.getRoute(policyID, pageName), + }); + + const handleBackButtonPress = () => { + if (pageIndex === 0) { + Navigation.goBack(); + return; + } + prevPage(); + }; + + return ( + + + + + + + ); +} + +export default CertiniaPrerequisitesPage; diff --git a/src/pages/workspace/accounting/certinia/prerequisites/CertiniaPrerequisitesStep.tsx b/src/pages/workspace/accounting/certinia/prerequisites/CertiniaPrerequisitesStep.tsx new file mode 100644 index 000000000000..036c948c9af0 --- /dev/null +++ b/src/pages/workspace/accounting/certinia/prerequisites/CertiniaPrerequisitesStep.tsx @@ -0,0 +1,78 @@ +import React from 'react'; +import {View} from 'react-native'; +import Button from '@components/Button'; +import FixedFooter from '@components/FixedFooter'; +import RenderHTML from '@components/RenderHTML'; +import Text from '@components/Text'; +import useLocalize from '@hooks/useLocalize'; +import type {SubPageProps} from '@hooks/useSubPage/types'; +import useThemeStyles from '@hooks/useThemeStyles'; +import CONST from '@src/CONST'; +import type {TranslationPaths} from '@src/languages/types'; + +type CertiniaPrerequisitesStepProps = SubPageProps & { + onConnect: () => void; +}; + +function CertiniaPrerequisitesStep({onNext, currentPageName, onConnect}: CertiniaPrerequisitesStepProps) { + const styles = useThemeStyles(); + const {translate} = useLocalize(); + + const isLastStep = currentPageName === CONST.CERTINIA_PREREQUISITES.PAGE_NAME.OAUTH; + + const pageNames = CONST.CERTINIA_PREREQUISITES.PAGE_NAME; + const titleKey = `workspace.certinia.prerequisites.${currentPageName}` as TranslationPaths; + const descriptionKey = `workspace.certinia.prerequisites.${currentPageName}Description` as TranslationPaths; + const buttonKey = isLastStep + ? ('workspace.certinia.prerequisites.connectButton' as TranslationPaths) + : (`workspace.certinia.prerequisites.${currentPageName}Confirm` as TranslationPaths); + + const bundleInstallHref = CONST.CERTINIA_FFA_BUNDLE_INSTALL_URL.PRODUCTION; + + return ( + + {translate(titleKey)} + {currentPageName === pageNames.INSTALL_BUNDLE ? ( + + + + ) : currentPageName === pageNames.SETUP_CONTACTS ? ( + + {[ + translate('workspace.certinia.prerequisites.setupContactsBullet1'), + translate('workspace.certinia.prerequisites.setupContactsBullet2'), + translate('workspace.certinia.prerequisites.setupContactsBullet3'), + ].map((bullet) => ( + + • + + {bullet} + + + ))} + + ) : ( + {translate(descriptionKey)} + )} + +