Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -833,9 +833,9 @@ const SettingsModalStackNavigator = createModalStackNavigator<SettingsNavigatorP
[SCREENS.WORKSPACE.ACCOUNTING.ZOHO_BOOKS_EXPENSIFY_CARD_SETTLEMENT_ACCOUNT]: () =>
require<ReactComponentModule>('../../../../pages/workspace/accounting/zohoBooks/advanced/ZohoBooksExpensifyCardSettlementAccountPage').default,
[SCREENS.WORKSPACE.ACCOUNTING.ZOHO_BOOKS_TRAVEL_BILLING_SETTLEMENT_ACCOUNT]: () =>
require<ReactComponentModule>('../../../../pages/workspace/accounting/zohoBooks/advanced/ZohoBooksTravelInvoicingSettlementAccountPage').default,
require<ReactComponentModule>('../../../../pages/workspace/accounting/zohoBooks/advanced/ZohoBooksTravelBillingSettlementAccountPage').default,
[SCREENS.WORKSPACE.ACCOUNTING.ZOHO_BOOKS_TRAVEL_BILLING_PAYABLE_ACCOUNT]: () =>
require<ReactComponentModule>('../../../../pages/workspace/accounting/zohoBooks/advanced/ZohoBooksTravelInvoicingPayableAccountPage').default,
require<ReactComponentModule>('../../../../pages/workspace/accounting/zohoBooks/advanced/ZohoBooksTravelBillingPayableAccountPage').default,
[SCREENS.WORKSPACE.ACCOUNTING.ZOHO_BOOKS_IMPORT]: () => require<ReactComponentModule>('../../../../pages/workspace/accounting/zohoBooks/import/ZohoBooksImportPage').default,
[SCREENS.WORKSPACE.ACCOUNTING.ZOHO_BOOKS_EXPORT]: () => require<ReactComponentModule>('../../../../pages/workspace/accounting/zohoBooks/export/ZohoBooksExportPage').default,
[SCREENS.WORKSPACE.ACCOUNTING.ZOHO_BOOKS_PREFERRED_EXPORTER]: () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ function ZohoBooksAdvancedPage({policy}: WithPolicyConnectionsProps) {
const syncExpensifyCardSettlements = zohoBooksConfig?.sync?.syncExpensifyCardSettlements ?? true;
const settlementsBankAccount = zohoBooksData?.bankAccounts?.find((account) => account.id === zohoBooksConfig?.sync?.settlementsBankAccountID);
const syncTravelInvoicingSettlements = zohoBooksConfig?.sync?.syncTravelInvoicingSettlements ?? true;
const travelInvoicingSettlementsBankAccount = zohoBooksData?.bankAccounts?.find((account) => account.id === zohoBooksConfig?.sync?.travelInvoicingSettlementsBankAccountID);
const travelInvoicingPayableAccount = zohoBooksData?.accounts?.find((account) => account.id === zohoBooksConfig?.export?.travelInvoicingPayableAccountID);
const travelBillingSettlementsBankAccount = zohoBooksData?.bankAccounts?.find((account) => account.id === zohoBooksConfig?.sync?.travelInvoicingSettlementsBankAccountID);
const travelBillingPayableAccount = zohoBooksData?.accounts?.find((account) => account.id === zohoBooksConfig?.export?.travelInvoicingPayableAccountID);
const allCardSettings = useExpensifyCardFeeds(policyID);
const isExpensifyCardsEnabled = Object.values(allCardSettings ?? {})?.some((cardSetting) => isExpensifyCardFullySetUp(policy, cardSetting));
const travelBillingFundID = useTravelBillingFundID(policyID);
Expand All @@ -71,7 +71,7 @@ function ZohoBooksAdvancedPage({policy}: WithPolicyConnectionsProps) {
useAccordionAnimation(syncReimbursedReports);
const {isAccordionExpanded: isSyncExpensifyCardSettlementsAccordionExpanded, shouldAnimateAccordionSection: shouldAnimateSyncExpensifyCardSettlementsAccordionSection} =
useAccordionAnimation(syncExpensifyCardSettlements);
const {isAccordionExpanded: isSyncTravelInvoicingSettlementsAccordionExpanded, shouldAnimateAccordionSection: shouldAnimateSyncTravelInvoicingSettlementsAccordionSection} =
const {isAccordionExpanded: isSyncTravelBillingSettlementsAccordionExpanded, shouldAnimateAccordionSection: shouldAnimateSyncTravelBillingSettlementsAccordionSection} =
useAccordionAnimation(syncTravelInvoicingSettlements);

return (
Expand Down Expand Up @@ -203,15 +203,15 @@ function ZohoBooksAdvancedPage({policy}: WithPolicyConnectionsProps) {
onCloseError={() => policyID && clearZohoBooksErrorField(policyID, CONST.ZOHO_BOOKS_CONFIG.SYNC_TRAVEL_BILLING_SETTLEMENTS)}
/>
<Accordion
isExpanded={isSyncTravelInvoicingSettlementsAccordionExpanded}
isToggleTriggered={shouldAnimateSyncTravelInvoicingSettlementsAccordionSection}
isExpanded={isSyncTravelBillingSettlementsAccordionExpanded}
isToggleTriggered={shouldAnimateSyncTravelBillingSettlementsAccordionSection}
>
<OfflineWithFeedback pendingAction={settingsPendingAction([CONST.ZOHO_BOOKS_CONFIG.TRAVEL_BILLING_SETTLEMENTS_BANK_ACCOUNT_ID], zohoBooksConfig?.pendingFields)}>
<MenuItemField
sentryLabel={CONST.SENTRY_LABEL.WORKSPACE.ACCOUNTING.ZOHO_BOOKS.TRAVEL_BILLING_SETTLEMENT_ACCOUNT}
name={translate('workspace.zohoBooks.travelBillingSettlementAccount.label')}
onPress={() => (policyID ? Navigation.navigate(ROUTES.POLICY_ACCOUNTING_ZOHO_BOOKS_TRAVEL_BILLING_SETTLEMENT_ACCOUNT.getRoute(policyID)) : undefined)}
value={travelInvoicingSettlementsBankAccount?.name}
value={travelBillingSettlementsBankAccount?.name}
>
{areSettingsInErrorFields([CONST.ZOHO_BOOKS_CONFIG.TRAVEL_BILLING_SETTLEMENTS_BANK_ACCOUNT_ID], zohoBooksConfig?.errorFields) && (
<MenuItem.BrickRoadIndicator status={CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR} />
Expand All @@ -223,7 +223,7 @@ function ZohoBooksAdvancedPage({policy}: WithPolicyConnectionsProps) {
sentryLabel={CONST.SENTRY_LABEL.WORKSPACE.ACCOUNTING.ZOHO_BOOKS.TRAVEL_BILLING_PAYABLE_ACCOUNT}
name={translate('workspace.zohoBooks.travelBillingPayableAccount.label')}
onPress={() => (policyID ? Navigation.navigate(ROUTES.POLICY_ACCOUNTING_ZOHO_BOOKS_TRAVEL_BILLING_PAYABLE_ACCOUNT.getRoute(policyID)) : undefined)}
value={travelInvoicingPayableAccount?.name}
value={travelBillingPayableAccount?.name}
>
{areSettingsInErrorFields([CONST.ZOHO_BOOKS_CONFIG.TRAVEL_BILLING_PAYABLE_ACCOUNT_ID], zohoBooksConfig?.errorFields) && (
<MenuItem.BrickRoadIndicator status={CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import ROUTES from '@src/ROUTES';

import React from 'react';

function ZohoBooksTravelInvoicingPayableAccountPage({policy}: WithPolicyConnectionsProps) {
function ZohoBooksTravelBillingPayableAccountPage({policy}: WithPolicyConnectionsProps) {
const policyID = policy?.id ?? String(CONST.DEFAULT_NUMBER_ID);
const zohoBooksConfig = policy?.connections?.zohoBooks?.config;
const zohoBooksData = policy?.connections?.zohoBooks?.data;
Expand Down Expand Up @@ -65,7 +65,7 @@ function ZohoBooksTravelInvoicingPayableAccountPage({policy}: WithPolicyConnecti
accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.PAID]}
shouldBeBlocked={shouldBeBlocked}
title="workspace.zohoBooks.travelBillingPayableAccount.label"
displayName="ZohoBooksTravelInvoicingPayableAccountSelectPage"
displayName="ZohoBooksTravelBillingPayableAccountSelectPage"
data={data}
connectionName={CONST.POLICY.CONNECTIONS.NAME.ZOHO_BOOKS}
emptyStateTitle="workspace.zohoBooks.noAccountsFound"
Expand All @@ -79,4 +79,4 @@ function ZohoBooksTravelInvoicingPayableAccountPage({policy}: WithPolicyConnecti
);
}

export default withPolicyConnections(ZohoBooksTravelInvoicingPayableAccountPage);
export default withPolicyConnections(ZohoBooksTravelBillingPayableAccountPage);
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type AccountListItem = ListItem & {
value: ZohoBooksBankAccount['id'];
};

function ZohoBooksTravelInvoicingSettlementAccountPage({policy}: WithPolicyConnectionsProps) {
function ZohoBooksTravelBillingSettlementAccountPage({policy}: WithPolicyConnectionsProps) {
const {translate} = useLocalize();
const styles = useThemeStyles();
const illustrations = useMemoizedLazyIllustrations(['Telescope']);
Expand Down Expand Up @@ -87,7 +87,7 @@ function ZohoBooksTravelInvoicingSettlementAccountPage({policy}: WithPolicyConne
/>
);

const setTravelInvoicingSettlementsAccount = (item: AccountListItem) => {
const setTravelBillingSettlementsAccount = (item: AccountListItem) => {
if (item.value !== travelInvoicingSettlementsBankAccountID && policyID) {
updateZohoBooksTravelBillingSettlementsAccount(policyID, item.value, travelInvoicingSettlementsBankAccountID);
}
Expand All @@ -100,14 +100,14 @@ function ZohoBooksTravelInvoicingSettlementAccountPage({policy}: WithPolicyConne
accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.PAID]}
featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED}
shouldBeBlocked={shouldBeBlocked}
displayName="ZohoBooksTravelInvoicingSettlementAccountPage"
displayName="ZohoBooksTravelBillingSettlementAccountPage"
title="workspace.zohoBooks.travelBillingSettlementAccount.label"
data={filteredData}
textInputOptions={textInputOptions}
headerContent={headerContent}
listEmptyContent={listEmptyContent}
shouldShowListEmptyContent={!textInputOptions.value}
onSelectRow={setTravelInvoicingSettlementsAccount}
onSelectRow={setTravelBillingSettlementsAccount}
shouldSingleExecuteRowSelect
initiallyFocusedOptionKey={travelInvoicingSettlementsBankAccountID}
onBackButtonPress={() => Navigation.goBack(backPath)}
Expand All @@ -120,4 +120,4 @@ function ZohoBooksTravelInvoicingSettlementAccountPage({policy}: WithPolicyConne
);
}

export default withPolicyConnections(ZohoBooksTravelInvoicingSettlementAccountPage);
export default withPolicyConnections(ZohoBooksTravelBillingSettlementAccountPage);
Loading