@@ -18,12 +18,8 @@ function QuickbooksOutOfPocketExpenseConfigurationPage({policy}: WithPolicyConne
18
18
const { translate} = useLocalize ( ) ;
19
19
const styles = useThemeStyles ( ) ;
20
20
const policyID = policy ?. id ?? '' ;
21
- const { syncLocations, reimbursableExpensesAccount, reimbursableExpensesExportDestination, errorFields, syncTax, pendingFields} = policy ?. connections ?. quickbooksOnline ?. config ?? { } ;
22
- const isLocationEnabled = Boolean ( syncLocations && syncLocations !== CONST . INTEGRATION_ENTITY_MAP_TYPES . NONE ) ;
23
- const isTaxesEnabled = Boolean ( syncTax ) ;
24
- const shouldShowTaxError = isTaxesEnabled && reimbursableExpensesExportDestination === CONST . QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE . JOURNAL_ENTRY ;
25
- const shouldShowLocationError = isLocationEnabled && reimbursableExpensesExportDestination !== CONST . QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE . JOURNAL_ENTRY ;
26
- const hasErrors = Boolean ( errorFields ?. reimbursableExpensesExportDestination ) || shouldShowTaxError || shouldShowLocationError ;
21
+ const { reimbursableExpensesAccount, reimbursableExpensesExportDestination, errorFields, pendingFields} = policy ?. connections ?. quickbooksOnline ?. config ?? { } ;
22
+ const hasErrors = Boolean ( errorFields ?. reimbursableExpensesExportDestination ) ;
27
23
28
24
return (
29
25
< AccessOrNotFoundWrapper
@@ -37,7 +33,7 @@ function QuickbooksOutOfPocketExpenseConfigurationPage({policy}: WithPolicyConne
37
33
>
38
34
< HeaderWithBackButton title = { translate ( 'workspace.qbo.exportExpenses' ) } />
39
35
< ScrollView contentContainerStyle = { styles . pb2 } >
40
- { ! isLocationEnabled && < Text style = { [ styles . ph5 , styles . pb5 ] } > { translate ( 'workspace.qbo.exportOutOfPocketExpensesDescription' ) } </ Text > }
36
+ < Text style = { [ styles . ph5 , styles . pb5 ] } > { translate ( 'workspace.qbo.exportOutOfPocketExpensesDescription' ) } </ Text >
41
37
< OfflineWithFeedback pendingAction = { pendingFields ?. reimbursableExpensesExportDestination } >
42
38
< MenuItemWithTopDescription
43
39
title = { reimbursableExpensesExportDestination ? translate ( `workspace.qbo.accounts.${ reimbursableExpensesExportDestination } ` ) : undefined }
@@ -47,24 +43,22 @@ function QuickbooksOutOfPocketExpenseConfigurationPage({policy}: WithPolicyConne
47
43
brickRoadIndicator = { hasErrors ? CONST . BRICK_ROAD_INDICATOR_STATUS . ERROR : undefined }
48
44
shouldShowRightIcon
49
45
hintText = {
50
- reimbursableExpensesExportDestination === CONST . QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE . VENDOR_BILL && ! isLocationEnabled
46
+ reimbursableExpensesExportDestination === CONST . QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE . VENDOR_BILL
51
47
? translate ( 'workspace.qbo.exportVendorBillDescription' )
52
48
: undefined
53
49
}
54
50
/>
55
51
</ OfflineWithFeedback >
56
- { ! isLocationEnabled && (
57
- < OfflineWithFeedback pendingAction = { pendingFields ?. reimbursableExpensesAccount } >
58
- < MenuItemWithTopDescription
59
- title = { reimbursableExpensesAccount ?. name }
60
- description = { translate ( 'workspace.qbo.accountsPayable' ) }
61
- onPress = { ( ) => Navigation . navigate ( ROUTES . POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_EXPORT_OUT_OF_POCKET_EXPENSES_ACCOUNT_SELECT . getRoute ( policyID ) ) }
62
- brickRoadIndicator = { errorFields ?. exportAccount ? CONST . BRICK_ROAD_INDICATOR_STATUS . ERROR : undefined }
63
- shouldShowRightIcon
64
- errorText = { errorFields ?. exportAccount ? translate ( 'common.genericErrorMessage' ) : undefined }
65
- />
66
- </ OfflineWithFeedback >
67
- ) }
52
+ < OfflineWithFeedback pendingAction = { pendingFields ?. reimbursableExpensesAccount } >
53
+ < MenuItemWithTopDescription
54
+ title = { reimbursableExpensesAccount ?. name }
55
+ description = { translate ( 'workspace.qbo.accountsPayable' ) }
56
+ onPress = { ( ) => Navigation . navigate ( ROUTES . POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_EXPORT_OUT_OF_POCKET_EXPENSES_ACCOUNT_SELECT . getRoute ( policyID ) ) }
57
+ brickRoadIndicator = { errorFields ?. exportAccount ? CONST . BRICK_ROAD_INDICATOR_STATUS . ERROR : undefined }
58
+ shouldShowRightIcon
59
+ errorText = { errorFields ?. exportAccount ? translate ( 'common.genericErrorMessage' ) : undefined }
60
+ />
61
+ </ OfflineWithFeedback >
68
62
</ ScrollView >
69
63
</ ScreenWrapper >
70
64
</ AccessOrNotFoundWrapper >
0 commit comments