Skip to content

Commit

Permalink
Merge pull request #44691 from gijoe0295/gijoe/44297
Browse files Browse the repository at this point in the history
Update copy based on accounting integration
  • Loading branch information
Beamanator authored Jul 2, 2024
2 parents dfbdce7 + d9cc695 commit adb04ff
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2081,6 +2081,7 @@ export default {
accountsPayableDescription: 'Choose where to create vendor bills.',
bankAccount: 'Bank account',
bankAccountDescription: 'Choose where to send checks from.',
creditCardAccount: 'Credit card account',
companyCardsLocationEnabledDescription:
"QuickBooks Online doesn't support locations on vendor bill exports. As you have locations enabled on your workspace, this export option is unavailable.",
outOfPocketTaxEnabledDescription:
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2098,6 +2098,7 @@ export default {
accountsPayableDescription: 'Elige dónde crear las facturas de proveedores.',
bankAccount: 'Cuenta bancaria',
bankAccountDescription: 'Elige desde dónde enviar los cheques.',
creditCardAccount: 'Cuenta de la tarjeta de crédito',
companyCardsLocationEnabledDescription:
'QuickBooks Online no permite lugares en las exportaciones de facturas de proveedores. Como tienes activadas los lugares en tu espacio de trabajo, esta opción de exportación no está disponible.',
exportOutOfPocketExpensesDescription: 'Establezca cómo se exportan los gastos de bolsillo a QuickBooks Online.',
Expand Down
19 changes: 19 additions & 0 deletions src/libs/ConnectionUtils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import CONST from '@src/CONST';
import type {QBONonReimbursableExportAccountType} from '@src/types/onyx/Policy';
import {translateLocal} from './Localize';

function getQBONonReimbursableExportAccountType(exportDestination: QBONonReimbursableExportAccountType | undefined): string {
switch (exportDestination) {
case CONST.QUICKBOOKS_NON_REIMBURSABLE_EXPORT_ACCOUNT_TYPE.DEBIT_CARD:
return translateLocal('workspace.qbo.bankAccount');
case CONST.QUICKBOOKS_NON_REIMBURSABLE_EXPORT_ACCOUNT_TYPE.CREDIT_CARD:
return translateLocal('workspace.qbo.creditCardAccount');
case CONST.QUICKBOOKS_NON_REIMBURSABLE_EXPORT_ACCOUNT_TYPE.VENDOR_BILL:
return translateLocal('workspace.qbo.accountsPayable');
default:
return translateLocal('workspace.qbo.account');
}
}

// eslint-disable-next-line import/prefer-default-export
export {getQBONonReimbursableExportAccountType};
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import * as Connections from '@libs/actions/connections';
import * as ConnectionUtils from '@libs/ConnectionUtils';
import Navigation from '@navigation/Navigation';
import AccessOrNotFoundWrapper from '@pages/workspace/AccessOrNotFoundWrapper';
import type {WithPolicyConnectionsProps} from '@pages/workspace/withPolicyConnections';
Expand Down Expand Up @@ -51,11 +52,7 @@ function QuickbooksCompanyCardExpenseAccountPage({policy}: WithPolicyConnections
<OfflineWithFeedback pendingAction={pendingFields?.nonReimbursableExpensesAccount}>
<MenuItemWithTopDescription
title={nonReimbursableExpensesAccount?.name}
description={
nonReimbursableExpensesExportDestination === CONST.QUICKBOOKS_NON_REIMBURSABLE_EXPORT_ACCOUNT_TYPE.VENDOR_BILL
? translate('workspace.qbo.accountsPayable')
: translate('workspace.qbo.account')
}
description={ConnectionUtils.getQBONonReimbursableExportAccountType(nonReimbursableExpensesExportDestination)}
errorText={errorFields?.nonReimbursableExpensesAccount ? translate('common.genericErrorMessage') : undefined}
onPress={() => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_ACCOUNT_SELECT.getRoute(policyID))}
brickRoadIndicator={errorFields?.nonReimbursableExpensesAccount ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import * as Connections from '@libs/actions/connections';
import * as ConnectionUtils from '@libs/ConnectionUtils';
import Navigation from '@navigation/Navigation';
import AccessOrNotFoundWrapper from '@pages/workspace/AccessOrNotFoundWrapper';
import type {WithPolicyConnectionsProps} from '@pages/workspace/withPolicyConnections';
Expand Down Expand Up @@ -86,13 +87,7 @@ function QuickbooksCompanyCardExpenseAccountSelectPage({policy}: WithPolicyConne
featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED}
>
<ScreenWrapper testID={QuickbooksCompanyCardExpenseAccountSelectPage.displayName}>
<HeaderWithBackButton
title={
nonReimbursableExpensesExportDestination === CONST.QUICKBOOKS_NON_REIMBURSABLE_EXPORT_ACCOUNT_TYPE.VENDOR_BILL
? translate('workspace.qbo.accountsPayable')
: translate('workspace.qbo.account')
}
/>
<HeaderWithBackButton title={ConnectionUtils.getQBONonReimbursableExportAccountType(nonReimbursableExpensesExportDestination)} />
<SelectionList
headerContent={
nonReimbursableExpensesExportDestination ? (
Expand Down

0 comments on commit adb04ff

Please sign in to comment.