Skip to content

Move the currency conversion fee account pickers onto a shared FxExpenseAccountSelectPage #102360

Description

@MelvinBot

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

  1. Add a shared src/pages/workspace/accounting/common/FxExpenseAccountSelectPage.tsx, modeled on TravelBillingPayableAccountSelectPage.tsx.
  2. Move each integration's picker onto it, keeping only the integration-specific parts (account list, selected value, update action, blocking conditions):
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions