Skip to content

Allow clearing the Default Vendor by re-selecting it (CC/DC export only)#96227

Open
Beamanator wants to merge 3 commits into
mainfrom
beaman-clear-default-vendor
Open

Allow clearing the Default Vendor by re-selecting it (CC/DC export only)#96227
Beamanator wants to merge 3 commits into
mainfrom
beaman-clear-default-vendor

Conversation

@Beamanator

@Beamanator Beamanator commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

On accounting integrations where the non-reimbursable export destination is Credit Card / Debit Card, blank Default Vendor has a defined UX — expenses without a vendor export to "Credit Card Misc". But once a Default Vendor is set on those export paths, there's no way to clear it: tapping the currently-selected row is a silent no-op that just navigates back. This blocks vendor-matching CC beta testers who need to reset workspaces between test scenarios.

This change lets the user re-tap the currently-selected vendor to clear it, but only on the CC/DC export paths:

  • QBO shared QuickbooksNonReimbursableVendorSelectPage: gated on configKey === 'nonReimbursableCreditCardDefaultVendor'. The Bill entry point of the same shared page keeps its existing behavior.
  • Sage Intacct DynamicSageIntacctDefaultVendorPage: gated on settingName === CONST.SAGE_INTACCT_CONFIG.NON_REIMBURSABLE_CREDIT_CARD_VENDOR. The Bill and reimbursable variants keep their existing behavior.

Vendor Bill export paths are intentionally out of scope — blank on those integrations means "use the report submitter" and is set by disabling the parent Default Vendor toggle rather than by clearing the vendor from this list. QBD, NetSuite, and Certinia only support Vendor Bill export, so they're not touched.

Xero doesn't have a Default Vendor selector today; it will be added as part of the broader vendor-matching project.

Backend note: sending CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE ('NONE') for QBO's nonReimbursableCreditCardDefaultVendor field has precedent via the bulk updateQuickbooksCompanyCardExpenseAccount path. Sage Intacct's NON_REIMBURSABLE_CREDIT_CARD_VENDOR command being able to persist an empty string should be verified on the backend before merging.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/659748
PROPOSAL: https://github.com/Expensify/Expensify/issues/659748#issuecomment-4985966633

Tests

QBO — Credit Card export path:

  1. Open a workspace with QBO connected.
  2. Under the QBO Export settings, set the non-reimbursable export destination to Credit Card (or Debit Card).
  3. Enable the Default Vendor toggle and pick any vendor.
  4. Open the Default Vendor row again and tap the currently-selected vendor.
  5. Verify the vendor is now cleared — the row shows no default vendor and re-opening the selector shows no row highlighted.

QBO — Vendor Bill export path (regression check, should NOT toggle):

  1. Same workspace, change the non-reimbursable export destination to Vendor Bill.
  2. Enable the Default Vendor toggle and pick a vendor.
  3. Open the Default Vendor row and tap the currently-selected vendor.
  4. Verify tapping the currently-selected vendor does nothing — the vendor stays selected.

Sage Intacct — Credit Card Charge path:

  1. Open a workspace with Sage Intacct connected.
  2. Set the non-reimbursable export type to Credit Card Charge.
  3. Pick any Default Vendor.
  4. Re-open the Default Vendor list and tap the currently-selected vendor.
  5. Verify the vendor is now cleared.

Sage Intacct — Vendor Bill / Reimbursable paths (regression check, should NOT toggle):

  1. Same workspace, switch to non-reimbursable Vendor Bill (or open the reimbursable Default Vendor selector).
  2. Pick a Default Vendor and then tap it again in the selector.
  3. Verify the vendor stays selected — no clear.
  • Verify that no errors appear in the JS console

Offline tests

  1. On QBO with CC/DC export, set a Default Vendor while online.
  2. Turn off network connection.
  3. Tap the currently-selected vendor.
  4. Verify the row updates optimistically to a cleared state.
  5. Turn network back on and verify the change persists.

QA Steps

Same as tests.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (Vendor Bill regression check ensures the Bill path is untouched)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English.
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function
  • If new assets were added or existing ones were modified
  • If the PR modifies code that runs when editing or sending messages
  • If the PR modifies a generic component
  • If the PR modifies a component related to any of the existing Storybook stories
  • If the PR modifies a component or page that can be accessed by a direct deeplink
  • If the PR modifies the UI or modifies the form input styles
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Tapping the currently-selected vendor on any accounting integration's
Default Vendor selector now clears it. Previously the guarded update
call skipped this case, leaving no path to unset the field from the UI.

QBO and QBD send CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE; Sage Intacct,
Certinia, and NetSuite send an empty string.

Fixes Expensify/Expensify#659748
@Beamanator Beamanator requested review from a team as code owners July 15, 2026 22:51
@melvin-bot melvin-bot Bot requested a review from Eskalifer1 July 15, 2026 22:51
@melvin-bot

melvin-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

@Eskalifer1 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot Bot requested review from trjExpensify and removed request for a team July 15, 2026 22:51
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
...port/QuickbooksNonReimbursableVendorSelectPage.tsx 0.00% <0.00%> (ø)
...cct/export/DynamicSageIntacctDefaultVendorPage.tsx 0.00% <0.00%> (ø)
... and 128 files with indirect coverage changes

Comment thread src/pages/workspace/accounting/certinia/export/CertiniaDefaultVendorPage.tsx Outdated
@Beamanator

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: f037fc3d1b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@Beamanator Beamanator added the InternalQA This pull request required internal QA label Jul 15, 2026
@Beamanator

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 9c7dcfdcec

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@Eskalifer1

Copy link
Copy Markdown
Contributor

Hi @Beamanator, let me know when this is ready for review, thank you!

@Beamanator

Copy link
Copy Markdown
Contributor Author

Sounds good @Eskalifer1 - actually this requires being added to the vendorMatching beta and setting up an accounting integration, have you done that before? :D If not i can ask someone else!

@Eskalifer1

Copy link
Copy Markdown
Contributor

Oh, i hadn't done it before. Feel free to reassign. Thank you!

@Beamanator Beamanator requested review from mkhutornyi and removed request for Eskalifer1 July 16, 2026 14:22
@Beamanator

Copy link
Copy Markdown
Contributor Author

Thanks for the quick response @Eskalifer1 , and thanks @mkhutornyi for volunteering to take over!

@trjExpensify trjExpensify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, not sure about this. For export with vendor bills, you must have a vendor chosen for export. So I don't know why we'd let you deselect a vendor to have no vendor selected. CC: @heyjennahay

@Beamanator

Copy link
Copy Markdown
Contributor Author

minnnnteresting - @trjExpensify i'll tag you in slack here :D https://expensify.slack.com/archives/C03TME82F/p1784118449309309

if (row.value !== nonReimbursableBillDefaultVendor) {
updateQuickbooksDesktopNonReimbursableBillDefaultVendor(policyID, row.value, nonReimbursableBillDefaultVendor);
}
const newValue = row.value === nonReimbursableBillDefaultVendor ? (CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE as string) : row.value;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as string cast here looks unnecessary.

@Beamanator

Beamanator commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@mkhutornyi i'm so sorry, i just asked you to review but can you pause reviewing this one for now? Just will we get @trjExpensify 's comment(s) sorted 🙏 [we're discussing in slack]

@heyjennahay

Copy link
Copy Markdown
Contributor

My understanding of the way it works:

  1. if you have vendor bills selected as your export method and you leave the default vendor disabled (i.e. blank) then your export will use the report submitter as the vendor
  2. if you have credit card or debit card selected as your export method and you leave the default vendor blank then your expenses without a vendor will export to Credit Card Misc

So the system is actually built to handle no vendor being set for both export types and in fact, default vendor is disabled by default for vendor bills

image

Blank default vendor has a defined UX only on the CC/DC export path
(falls back to "Credit Card Misc"). For Vendor Bill export, blank
falls back to the report submitter and is set by disabling the parent
toggle, so re-tapping to clear is out of scope. Per team alignment on
https://expensify.slack.com/archives/C03TME82F/p1784118449309309, the
PR now covers:

- QBO shared page: gated on configKey === 'nonReimbursableCreditCardDefaultVendor'
- Sage Intacct: gated on settingName === NON_REIMBURSABLE_CREDIT_CARD_VENDOR

Reverts the QBD, NetSuite, and Certinia changes — those integrations
only support Vendor Bill export, not CC/DC.
@Beamanator Beamanator changed the title Allow clearing the Default Vendor by re-selecting it Allow clearing the Default Vendor by re-selecting it (CC/DC export only) Jul 16, 2026
@Beamanator

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: c429fc2e87

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@mkhutornyi

Copy link
Copy Markdown
Contributor

@MelvinBot review

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Reviewed the diff. The change is clean, minimal, and correctly scoped to the CC/DC export paths. One backend item to confirm before merge, plus a minor consistency nit.

✅ Looks good

⚠️ Confirm before merge — Sage Intacct empty-string persistence

The Sage clear sends vendorID: ''. The optimistic Onyx update handles '' fine, but unlike the QBO 'NONE' path there's no existing precedent for sending an empty vendor ID here. As the PR description already notes, the UpdateSageIntacctNonReimbursableExpensesCreditCardChargeExportDefaultVendor command needs to be confirmed to actually persist the cleared value on the backend — otherwise it'll optimistically clear and then silently revert on successData. Worth verifying against the API before this ships.

💡 Minor — use the constant for the QBO gate

The Sage side compares against a CONST, but the QBO side uses a bare string literal 'nonReimbursableCreditCardDefaultVendor'. There's already a matching constant — CONST.QUICKBOOKS_CONFIG.NON_REIMBURSABLE_CREDIT_CARD_DEFAULT_VENDOR — so using it keeps the two integrations consistent and stays in sync if the key is ever renamed. It's type-checked today, so this is low priority.

💡 Optional — tests

No unit tests were added (checklist item is unchecked). The three-way branch (clear on gated path / set / no-op on ungated path) is exactly the kind of logic a small test would lock in against regressions.

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

Labels

InternalQA This pull request required internal QA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants