diff --git a/src/pages/workspace/accounting/intacct/advanced/SageIntacctAdvancedPage.tsx b/src/pages/workspace/accounting/intacct/advanced/SageIntacctAdvancedPage.tsx index e92957c2a814..7d653f3eebe6 100644 --- a/src/pages/workspace/accounting/intacct/advanced/SageIntacctAdvancedPage.tsx +++ b/src/pages/workspace/accounting/intacct/advanced/SageIntacctAdvancedPage.tsx @@ -47,6 +47,9 @@ function SageIntacctAdvancedPage({policy}: WithPolicyProps) { description: translate('workspace.sageIntacct.inviteEmployeesDescription'), isActive: !!importEmployees, onToggle: (enabled: boolean) => { + if (!policyID) { + return; + } updateSageIntacctImportEmployees(policyID, enabled); updateSageIntacctApprovalMode(policyID, enabled); }, @@ -62,6 +65,9 @@ function SageIntacctAdvancedPage({policy}: WithPolicyProps) { description: translate('workspace.sageIntacct.syncReimbursedReportsDescription'), isActive: !!sync?.syncReimbursedReports, onToggle: (enabled: boolean) => { + if (!policyID) { + return; + } updateSageIntacctSyncReimbursedReports(policyID, enabled); if (enabled && !sync?.reimbursementAccountID) { @@ -137,7 +143,7 @@ function SageIntacctAdvancedPage({policy}: WithPolicyProps) { pendingAction={settingsPendingAction([CONST.SAGE_INTACCT_CONFIG.REIMBURSEMENT_ACCOUNT_ID], pendingFields)} > Navigation.navigate(ROUTES.POLICY_ACCOUNTING_SAGE_INTACCT_PAYMENT_ACCOUNT.getRoute(policyID))} diff --git a/src/pages/workspace/accounting/intacct/export/SageIntacctExportPage.tsx b/src/pages/workspace/accounting/intacct/export/SageIntacctExportPage.tsx index 54423fab0250..223261c6547b 100644 --- a/src/pages/workspace/accounting/intacct/export/SageIntacctExportPage.tsx +++ b/src/pages/workspace/accounting/intacct/export/SageIntacctExportPage.tsx @@ -34,29 +34,25 @@ function SageIntacctExportPage({policy}: WithPolicyProps) { { description: translate('workspace.sageIntacct.preferredExporter'), action: !policyID ? undefined : () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_SAGE_INTACCT_PREFERRED_EXPORTER.getRoute(policyID, Navigation.getActiveRoute())), - title: exportConfig?.exporter ?? translate('workspace.sageIntacct.notConfigured'), + title: exportConfig?.exporter, subscribedSettings: [CONST.SAGE_INTACCT_CONFIG.EXPORTER], }, { description: translate('workspace.sageIntacct.exportDate.label'), action: !policyID ? undefined : () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_SAGE_INTACCT_EXPORT_DATE.getRoute(policyID, Navigation.getActiveRoute())), - title: exportConfig?.exportDate ? translate(`workspace.sageIntacct.exportDate.values.${exportConfig.exportDate}.label`) : translate(`workspace.sageIntacct.notConfigured`), + title: exportConfig?.exportDate ? translate(`workspace.sageIntacct.exportDate.values.${exportConfig.exportDate}.label`) : undefined, subscribedSettings: [CONST.SAGE_INTACCT_CONFIG.EXPORT_DATE], }, { description: translate('workspace.accounting.exportOutOfPocket'), action: !policyID ? undefined : () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_SAGE_INTACCT_REIMBURSABLE_EXPENSES.getRoute(policyID, Navigation.getActiveRoute())), - title: exportConfig?.reimbursable - ? translate(`workspace.sageIntacct.reimbursableExpenses.values.${exportConfig.reimbursable}`) - : translate('workspace.sageIntacct.notConfigured'), + title: exportConfig?.reimbursable ? translate(`workspace.sageIntacct.reimbursableExpenses.values.${exportConfig.reimbursable}`) : undefined, subscribedSettings: [CONST.SAGE_INTACCT_CONFIG.REIMBURSABLE, CONST.SAGE_INTACCT_CONFIG.REIMBURSABLE_VENDOR], }, { description: translate('workspace.accounting.exportCompanyCard'), action: !policyID ? undefined : () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_SAGE_INTACCT_NON_REIMBURSABLE_EXPENSES.getRoute(policyID, Navigation.getActiveRoute())), - title: exportConfig?.nonReimbursable - ? translate(`workspace.sageIntacct.nonReimbursableExpenses.values.${exportConfig.nonReimbursable}`) - : translate('workspace.sageIntacct.notConfigured'), + title: exportConfig?.nonReimbursable ? translate(`workspace.sageIntacct.nonReimbursableExpenses.values.${exportConfig.nonReimbursable}`) : undefined, subscribedSettings: [ CONST.SAGE_INTACCT_CONFIG.NON_REIMBURSABLE, CONST.SAGE_INTACCT_CONFIG.NON_REIMBURSABLE_ACCOUNT, diff --git a/src/pages/workspace/accounting/intacct/export/SageIntacctNonReimbursableExpensesPage.tsx b/src/pages/workspace/accounting/intacct/export/SageIntacctNonReimbursableExpensesPage.tsx index 185c4608d27d..a2f7c3834434 100644 --- a/src/pages/workspace/accounting/intacct/export/SageIntacctNonReimbursableExpensesPage.tsx +++ b/src/pages/workspace/accounting/intacct/export/SageIntacctNonReimbursableExpensesPage.tsx @@ -61,9 +61,7 @@ function SageIntacctNonReimbursableExpensesPage({policy}: WithPolicyConnectionsP const menuItems: ExtendedMenuItemWithSubscribedSettings[] = [ { type: 'menuitem', - title: config?.export.nonReimbursable - ? translate(`workspace.sageIntacct.nonReimbursableExpenses.values.${config?.export.nonReimbursable}`) - : translate('workspace.sageIntacct.notConfigured'), + title: config?.export.nonReimbursable ? translate(`workspace.sageIntacct.nonReimbursableExpenses.values.${config?.export.nonReimbursable}`) : undefined, description: translate('workspace.accounting.exportAs'), onPress: () => { if (!policyID) { @@ -75,7 +73,7 @@ function SageIntacctNonReimbursableExpensesPage({policy}: WithPolicyConnectionsP }, { type: 'menuitem', - title: config?.export.nonReimbursableAccount ? config.export.nonReimbursableAccount : translate('workspace.sageIntacct.notConfigured'), + title: config?.export.nonReimbursableAccount ? config.export.nonReimbursableAccount : undefined, description: translate('workspace.sageIntacct.creditCardAccount'), onPress: () => { if (!policyID) { @@ -118,7 +116,7 @@ function SageIntacctNonReimbursableExpensesPage({policy}: WithPolicyConnectionsP children: [ { type: 'menuitem', - title: defaultVendorName && defaultVendorName !== '' ? defaultVendorName : translate('workspace.sageIntacct.notConfigured'), + title: defaultVendorName && defaultVendorName !== '' ? defaultVendorName : undefined, description: translate('workspace.sageIntacct.defaultVendor'), onPress: () => { if (!policyID) { diff --git a/src/pages/workspace/accounting/intacct/export/SageIntacctReimbursableExpensesPage.tsx b/src/pages/workspace/accounting/intacct/export/SageIntacctReimbursableExpensesPage.tsx index 81b16d636444..1be5c6d51d31 100644 --- a/src/pages/workspace/accounting/intacct/export/SageIntacctReimbursableExpensesPage.tsx +++ b/src/pages/workspace/accounting/intacct/export/SageIntacctReimbursableExpensesPage.tsx @@ -57,7 +57,7 @@ function SageIntacctReimbursableExpensesPage({policy}: WithPolicyConnectionsProp const menuItems: ExtendedMenuItemWithSubscribedSettings[] = [ { type: 'menuitem', - title: reimbursable ? translate(`workspace.sageIntacct.reimbursableExpenses.values.${reimbursable}`) : translate('workspace.sageIntacct.notConfigured'), + title: reimbursable ? translate(`workspace.sageIntacct.reimbursableExpenses.values.${reimbursable}`) : undefined, description: translate('workspace.accounting.exportAs'), onPress: () => { if (!policyID) { @@ -94,7 +94,7 @@ function SageIntacctReimbursableExpensesPage({policy}: WithPolicyConnectionsProp children: [ { type: 'menuitem', - title: defaultVendorName && defaultVendorName !== '' ? defaultVendorName : translate('workspace.sageIntacct.notConfigured'), + title: defaultVendorName && defaultVendorName !== '' ? defaultVendorName : undefined, description: translate('workspace.sageIntacct.defaultVendor'), onPress: () => { if (!policyID) { diff --git a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopCompanyCardExpenseAccountPage.tsx b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopCompanyCardExpenseAccountPage.tsx index 493de1b32ec1..e6bef5071b5a 100644 --- a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopCompanyCardExpenseAccountPage.tsx +++ b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopCompanyCardExpenseAccountPage.tsx @@ -39,8 +39,8 @@ function QuickbooksDesktopCompanyCardExpenseAccountPage({policy}: WithPolicyConn const qbdReimbursableAccounts = getQBDReimbursableAccounts(policy?.connections?.quickbooksDesktop, nonReimbursable); // We use the logical OR (||) here instead of ?? because `nonReimbursableAccount` can be an empty string // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - return qbdReimbursableAccounts.find(({id}) => nonReimbursableAccount === id)?.name || qbdReimbursableAccounts.at(0)?.name || translate('workspace.qbd.notConfigured'); - }, [policy?.connections?.quickbooksDesktop, nonReimbursable, translate, nonReimbursableAccount]); + return qbdReimbursableAccounts.find(({id}) => nonReimbursableAccount === id)?.name || qbdReimbursableAccounts.at(0)?.name; + }, [policy?.connections?.quickbooksDesktop, nonReimbursable, nonReimbursableAccount]); const {isAccordionExpanded, shouldAnimateAccordionSection} = useAccordionAnimation(!!qbdConfig?.shouldAutoCreateVendor); diff --git a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopOutOfPocketExpenseConfigurationPage.tsx b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopOutOfPocketExpenseConfigurationPage.tsx index 8cadd46f201f..c5f426151e42 100644 --- a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopOutOfPocketExpenseConfigurationPage.tsx +++ b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopOutOfPocketExpenseConfigurationPage.tsx @@ -82,7 +82,7 @@ function QuickbooksDesktopOutOfPocketExpenseConfigurationPage({policy}: WithPoli { // We use the logical OR (||) here instead of ?? because `reimbursableAccount` can be an empty string // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - title: accountsList.find(({id}) => qbdConfig?.export.reimbursableAccount === id)?.name || accountsList.at(0)?.name || translate('workspace.qbd.notConfigured'), + title: accountsList.find(({id}) => qbdConfig?.export.reimbursableAccount === id)?.name || accountsList.at(0)?.name, description: accountDescription, onPress: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_EXPORT_OUT_OF_POCKET_EXPENSES_ACCOUNT_SELECT.getRoute(policyID, Navigation.getActiveRoute())), subscribedSettings: account, diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx index 7174d8239772..115452838cff 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx @@ -42,7 +42,7 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections subscribedSettings: [CONST.QUICKBOOKS_CONFIG.NON_REIMBURSABLE_EXPENSE_EXPORT_DESTINATION], }, { - title: qboConfig?.nonReimbursableExpensesAccount?.name ?? translate('workspace.qbo.notConfigured'), + title: qboConfig?.nonReimbursableExpensesAccount?.name, description: getQBONonReimbursableExportAccountType(qboConfig?.nonReimbursableExpensesExportDestination), onPress: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_ACCOUNT_SELECT.getRoute(policyID, Navigation.getActiveRoute())), subscribedSettings: [CONST.QUICKBOOKS_CONFIG.NON_REIMBURSABLE_EXPENSE_ACCOUNT], diff --git a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx index fd603a5b2634..1a18a4a5be3c 100644 --- a/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx +++ b/src/pages/workspace/accounting/qbo/export/QuickbooksOutOfPocketExpenseConfigurationPage.tsx @@ -81,7 +81,7 @@ function QuickbooksOutOfPocketExpenseConfigurationPage({policy}: WithPolicyConne brickRoadIndicator: areSettingsInErrorFields(accountOrExportDestination, qboConfig?.errorFields) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined, }, { - title: qboConfig?.reimbursableExpensesAccount?.name ?? translate('workspace.qbo.notConfigured'), + title: qboConfig?.reimbursableExpensesAccount?.name, description: accountDescription, onPress: () => { if (!policyID) { diff --git a/src/pages/workspace/accounting/xero/advanced/XeroAdvancedPage.tsx b/src/pages/workspace/accounting/xero/advanced/XeroAdvancedPage.tsx index ae70d3900da5..f8709fbc0133 100644 --- a/src/pages/workspace/accounting/xero/advanced/XeroAdvancedPage.tsx +++ b/src/pages/workspace/accounting/xero/advanced/XeroAdvancedPage.tsx @@ -37,9 +37,9 @@ function XeroAdvancedPage({policy}: WithPolicyConnectionsProps) { } const selectedAccount = (bankAccounts ?? []).find((bank) => bank.id === accountID); - return selectedAccount?.name ?? translate('workspace.xero.notConfigured'); + return selectedAccount?.name; }, - [bankAccounts, translate], + [bankAccounts], ); const selectedBankAccountName = getSelectedAccountName(invoiceCollectionsAccountID); @@ -101,7 +101,7 @@ function XeroAdvancedPage({policy}: WithPolicyConnectionsProps) {