Fix QBO company card vendor bill export showing credit card account list#97040
Fix QBO company card vendor bill export showing credit card account list#97040MelvinBot wants to merge 2 commits into
Conversation
Co-authored-by: Chavda Sachin <ChavdaSachin@users.noreply.github.com>
…t-mock assertions Co-authored-by: Chavda Sachin <ChavdaSachin@users.noreply.github.com>
|
Fixed the failing ESLint check and pushed to the branch ( What failed: The 3 new QBO test cases added to Fix: The 6 new violations are the standard test-mock assertions already grandfathered for this file's QBD block ( Verification
Note: the other red check, PR Author Checklist / checklist, is expected — it stays failing until the human co-author completes the checklist boxes and fills in the manual |
|
The fix for the failing ESLint check is already in — commit Current status on that commit: The only remaining red check is PR Author Checklist / checklist, which is expected — it stays failing until the human co-author ticks the checklist boxes and fills in the manual |
|
✅ All functional checks are now green. The ESLint check re-ran against my earlier fix (commit The only remaining red check is PR Author Checklist / checklist, which is expected — it stays failing until the human co-author completes the checklist boxes and fills in the manual |
Explanation of Change
On a QBO-connected workspace, when a company card's Export company card expenses as is set to Vendor bill, the per-card export account-selection screen (
DynamicWorkspaceCompanyCardAccountSelectCardPage) was showing the QBO credit card account list.Root cause: in
getExportMenuItem()the QBO branch already setsshouldShowMenuItem = falsefor a non-reimbursable vendor-bill destination (so the export row is correctly hidden on the card-details page), but the innerswitchthat builds the accountdatagroupedQUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.VENDOR_BILLinto the same case asCREDIT_CARD. Because both the reimbursable and non-reimbursable vendor-bill constants share the value'bill', the non-reimbursable vendor-bill destination matched the credit-card case and was assigneddata = creditCards. QBO per-card export has no vendor-bill account NVP (onlyquickbooks_online_export_account/..._debit), so a vendor-bill company card has no per-card account to select at all.Fix: route the non-reimbursable vendor-bill destination to the
defaultbranch (data = [],shouldShowMenuItem = false), so the account list now agrees with the flag the code already sets. This is scoped to the non-reimbursable vendor-bill case only —credit_card,debit_card, and the reimbursable-only vendor-bill fallback are left unchanged. It also closes a quieter data-corruption path where tapping an account on the stale page would write a credit-card account id onto a vendor-bill card.AI Tests
Run locally by MelvinBot on
Expensify/App:npm test -- tests/unit/CompanyCardExportTest.ts— ✅ 9 passed (added 3 QBO cases: credit card, debit card, and vendor bill).npm run typecheck-tsgo— ✅ passed.npm run fmt(oxfmt) — ✅ applied; only the two changed files were affected.Fixed Issues
$ #96846
PROPOSAL: #96846 (comment)
Tests
// TODO: The human co-author must complete/confirm the manual test steps below before marking this PR as "ready for review".
credit cardanddebit carddestinations still show their respective account lists.Offline tests
QA Steps
// TODO: The human co-author must fill out the QA steps before marking this PR as "ready for review".
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari