Problem
After QuickBooks Desktop: add the currency conversion fee account setting and [Payment due @nyomanjyotisa] Use None and Save on the shipped FX account pickers merge, six currency conversion fee account pickers (QBO, Xero, NetSuite, Sage Intacct, Certinia, QBD) are the same ~100-line page. Each one wires useFxExpenseAccountPicker, buildList, useSelectionListSearch(searchableList, translate('common.noResultsFound')), and shouldShowListEmptyContent={!textInputOptions.value} the same way.
This was deferred from both PRs to avoid conflicts. TaduJR raised it in this review, and ishpaul777 agreed to a follow-up.
Proposed change
- Add a shared
src/pages/workspace/accounting/common/FxExpenseAccountSelectPage.tsx, modeled on TravelBillingPayableAccountSelectPage.tsx.
- Move each integration's picker onto it, keeping only the integration-specific parts (account list, selected value, update action, blocking conditions):
- Remove the
sourceAccountCount argument from buildList in useFxExpenseAccountPicker.ts. It always equals accountOptions.length at every call site.
Acceptance
- All six pickers keep today's behavior: None as the default top row, Save to persist, search, pending and error states, and deep-link blocking.
- Existing picker tests still pass.
Start this after both PRs above merge.
Problem
After QuickBooks Desktop: add the currency conversion fee account setting and [Payment due @nyomanjyotisa] Use None and Save on the shipped FX account pickers merge, six currency conversion fee account pickers (QBO, Xero, NetSuite, Sage Intacct, Certinia, QBD) are the same ~100-line page. Each one wires
useFxExpenseAccountPicker,buildList,useSelectionListSearch(searchableList, translate('common.noResultsFound')), andshouldShowListEmptyContent={!textInputOptions.value}the same way.This was deferred from both PRs to avoid conflicts.
TaduJRraised it in this review, andishpaul777agreed to a follow-up.Proposed change
src/pages/workspace/accounting/common/FxExpenseAccountSelectPage.tsx, modeled onTravelBillingPayableAccountSelectPage.tsx.QuickbooksFxExpenseAccountSelectPage.tsxXeroFxExpenseAccountSelectorPage.tsxNetSuiteFxExpenseAccountSelectPage.tsxSageIntacctFxExpenseAccountPage.tsxCertiniaFxExpenseAccountSelectPage.tsxDynamicQuickbooksDesktopFxExpenseAccountSelectPage.tsx(added by the QBD PR)sourceAccountCountargument frombuildListinuseFxExpenseAccountPicker.ts. It always equalsaccountOptions.lengthat every call site.Acceptance
Start this after both PRs above merge.