Skip to content

[Due for payment 2026-06-26] [Due for payment 2026-06-23] [$250] Company Card - Default value missing on NetSuite vendor bill export row #91420

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: v9.3.79-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/TR-32105/folder/13176706/41236846/1432273661
Email or phone of affected tester (no customers): applausetester+ccardfeed@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Windows 11 / Chrome
App Component: Workspace Settings

Action Performed:

Preconditions

Steps:

  1. Click on any assigned card to the account applausetester+ccardfeed@applause.expensifail.com
  2. Observe NetSuite vendor bills export row
  3. Click the NetSuite vendor bills export row
  4. Click a different account other than default card
  5. Click the NetSuite vendor bills export row again
  6. Click Default Card"

Expected Result:

  • in step 2, a default value of default card should be displayed on NetSuite vendor bills export row
  • in step 3, "Default Card" should be selected before user choose different account
  • in step 6, after clicking "Default Card", the account should be displayed on NetSuite vendor bills export row

Actual Result:

  • in step 2, a default value of default card is missing on NetSuite vendor bills export row
  • in step 3, "Default Card" isn't selected before user choose different account
  • in step 6, after clicking "Default Card", the account isn't displayed on NetSuite vendor bills export row

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7160357_1779427565942.vendor_netsuite.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7160357

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. applause-bot commented on May 22, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/6a549c014156326f01f1462bbd26ecb3fd0103b9b5644824cfaed5b54857e66c

  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 22, 2026
  3. MelvinBot commented on May 22, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    In utils.tsx:168-171, the isDefaultTitle flag for the NetSuite VENDOR_BILL case requires config?.defaultVendor to be truthy:

    isDefaultTitle = !!(
        defaultAccount &&  // ← requires defaultVendor to exist
        (!companyCard?.nameValuePairs?.netsuite_export_vendor || ...)
    );

    When no default vendor is configured in the workspace's NetSuite settings, isDefaultTitle is always false. The fallback selectedVendor lookup also fails because no real vendor has id === 'default', so title resolves to undefined and the row appears blank.

    The same bug exists in the JOURNAL_ENTRY case at lines 189-193.

    What changes do you think we should make in order to solve the problem?

    Align the NetSuite isDefaultTitle logic with the Sage Intacct pattern at lines 241-243, which does not require a default account to exist:

    For VENDOR_BILL (line 168-171), change to:

    isDefaultTitle = !!(
        companyCard?.nameValuePairs?.netsuite_export_vendor === CONST.COMPANY_CARDS.DEFAULT_EXPORT_TYPE || 
        !companyCard?.nameValuePairs?.netsuite_export_vendor
    );
    

    Apply the same fix to JOURNAL_ENTRY (lines 189-193):

    isDefaultTitle = !!(
        companyCard?.nameValuePairs?.netsuite_export_payable_account === CONST.COMPANY_CARDS.DEFAULT_EXPORT_TYPE || 
        !companyCard?.nameValuePairs?.netsuite_export_payable_account
    );
    

    This ensures "Default card" displays when no card-specific vendor/account is selected, regardless of whether a workspace-level default vendor exists.

    Related issues

    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 22, 2026
  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 22, 2026
  6. yusufdeveloper2903 commented on May 22, 2026

    @yusufdeveloper2903
    Contributor

    Proposal

    What is the root cause of that problem?

    The NetSuite vendor bill export row for company cards doesn't display a default value ("Default Card") when no explicit value has been saved. The selector likely checks for a stored value but falls back to an empty/undefined state instead of falling back to a DEFAULT_CARD constant or equivalent default string when the value is absent.

    What changes do you think we should make in order to solve the problem?

    I'd look at the NetSuite company card export options page, likely around src/pages/workspace/accounting/netsuite/export/ or a similar path. The fix involves ensuring the vendor bill export field defaults to DEFAULT_CARD (or the equivalent CONST value) when no value is stored in Onyx.

    - const vendorBillsExportAccount = config?.vendorBillsExportAccount;
    + const vendorBillsExportAccount = config?.vendorBillsExportAccount ?? CONST.NETSUITE.DEFAULT_CARD;

    And in the picker/selector, the selected value comparison should treat the DEFAULT_CARD sentinel as a valid selectable option so it renders correctly and can be re-selected:

    - value={vendorBillsExportAccount}
    + value={vendorBillsExportAccount ?? CONST.NETSUITE.DEFAULT_CARD}

    This ensures (a) the row displays "Default Card" when nothing is saved, (b) "Default Card" is pre-selected when opening the picker with no saved value, and (c) choosing "Default Card" explicitly saves/clears the value and reflects back on the row.

    What alternative solutions did you explore?

    An alternative is to treat an empty string as the default and map it to "Default Card" in the display layer only — but I think explicitly using the CONST default is cleaner and less error-prone across the codebase.

  7. MobileMage commented on May 22, 2026

    @MobileMage
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When a company card is connected to a NetSuite workspace with vendor bill export configured, the vendor bill export row on the card details page shows no title (blank) instead of "Default Card", and the "Default Card" option is not pre-selected when the user opens the account selector.

    What is the root cause of that problem?

    In getExportMenuItem inside src/pages/workspace/companyCards/utils.tsx, the VENDOR_BILL branch of the NetSuite switch sets defaultAccount = config?.defaultVendor. The field config.defaultVendor is the reimbursable default vendor for out-of-pocket expenses — it is not reliably set for non-reimbursable (company card) vendor bill export, so defaultAccount ends up undefined. Because isDefaultTitle is computed as !!(defaultAccount && ...), when defaultAccount is undefined the expression evaluates to false regardless of what is stored in companyCard?.nameValuePairs?.netsuite_export_vendor. As a result, isDefaultTitle is always false for cards where no reimbursable default vendor is configured, title is never set to defaultCard, and the selected entry in the picker list is never marked as the "Default Card" row.

    case CONST.NETSUITE_EXPORT_DESTINATION.VENDOR_BILL: {
    const vendors = policy?.connections?.netsuite?.options.data.vendors;
    defaultAccount = config?.defaultVendor;
    isDefaultTitle = !!(
    defaultAccount &&
    (!companyCard?.nameValuePairs?.netsuite_export_vendor || companyCard?.nameValuePairs?.netsuite_export_vendor === CONST.COMPANY_CARDS.DEFAULT_EXPORT_TYPE)
    );
    const selectedVendor = vendors?.find(({id}) => id === (companyCard?.nameValuePairs?.netsuite_export_vendor ?? defaultAccount));
    title = isDefaultTitle ? defaultCard : selectedVendor?.name;
    const resultData = (vendors ?? []).length > 0 ? [defaultMenuItem, ...(vendors ?? [])] : vendors;
    data = (resultData ?? []).map(({id, name}) => {
    return {
    value: id,
    text: name,
    keyForList: id,
    isSelected: isDefaultTitle ? name === defaultCard : selectedVendor?.id === id,
    };
    });
    exportType = CONST.COMPANY_CARDS.EXPORT_CARD_TYPES.NVP_NETSUITE_EXPORT_VENDOR;
    break;

    What changes do you think we should make in order to solve the problem?

    The isDefaultTitle check for the VENDOR_BILL case should not depend solely on defaultAccount being truthy. A card whose netsuite_export_vendor nameValuePair is either absent or equal to CONST.COMPANY_CARDS.DEFAULT_EXPORT_TYPE should always display "Default Card", whether or not a workspace-level default vendor is configured. The fix is to decouple the two conditions: set isDefaultTitle to true when companyCard?.nameValuePairs?.netsuite_export_vendor is falsy or equals CONST.COMPANY_CARDS.DEFAULT_EXPORT_TYPE, and only additionally require defaultAccount to be truthy when you want to fall back to showing the workspace default vendor name. This mirrors the pattern already used in the JOURNAL_ENTRY branch and in the QBO/Xero/QBD cases in the same file. Concretely, in src/pages/workspace/companyCards/utils.tsx within the NETSUITE → VENDOR_BILL case, change isDefaultTitle to !!(defaultAccount && (!netsuite_export_vendor || netsuite_export_vendor === DEFAULT_EXPORT_TYPE)) should become !!((!netsuite_export_vendor || netsuite_export_vendor === CONST.COMPANY_CARDS.DEFAULT_EXPORT_TYPE)), and set title to defaultCard when isDefaultTitle is true (even when defaultAccount is absent), mirroring how the Xero case always shows defaultCard for the default selection. The isSelected mapping for the picker list entries should likewise use isDefaultTitle to mark the "Default Card" row whenever no specific vendor has been chosen.

    What alternative solutions did you explore? (Optional)

    N/A

  8. Abdukhamid000 commented on May 22, 2026

    @Abdukhamid000
    Contributor

    Proposal

    What is the root cause of that problem?

    In [pages/workspace/companyCards/utils.tsx:165-184](https://github.com/Expensify/App/blob/main/src/pages/workspace/companyCards/utils.tsx#L165-L184), the NetSuite VENDOR_BILL branch only shows "Default Card" when the workspace itself has a defaultVendor configured:

    defaultAccount = config?.defaultVendor;
    isDefaultTitle = !!(
        defaultAccount &&
        (!companyCard?.nameValuePairs?.netsuite_export_vendor ||
            companyCard?.nameValuePairs?.netsuite_export_vendor === CONST.COMPANY_CARDS.DEFAULT_EXPORT_TYPE)
    );
    const selectedVendor = vendors?.find(({id}) => id === (companyCard?.nameValuePairs?.netsuite_export_vendor ?? defaultAccount));
    title = isDefaultTitle ? defaultCard : selectedVendor?.name;

    On the test workspace config.defaultVendor is not set, so defaultAccount is falsy → isDefaultTitle is always false → it falls through to selectedVendor?.name. In every step of the repro:

    • Step 2 (fresh card): netsuite_export_vendor is undefined, defaultAccount is undefined, selectedVendor resolves to nothing → title is empty.
    • Step 3 (selector opens): the same isDefaultTitle drives isSelected: name === defaultCard, so the "Default Card" row is never marked selected.
    • Step 6 (user explicitly picks "Default Card"): nameValuePairs.netsuite_export_vendor is now DEFAULT_EXPORT_TYPE, but defaultAccount is still undefined → isDefaultTitle is still false → selectedVendor = vendors.find(id => id === DEFAULT_EXPORT_TYPE) returns nothing → title stays empty.

    Tying "show Default Card" to the workspace having a configured default vendor is the wrong gate. The card's own nameValuePairs.netsuite_export_vendor value is what tells us the user intends the default — whether or not the workspace has actually set one yet.

    What changes do you think we should make in order to solve the problem?

    Drop the defaultAccount && precondition from isDefaultTitle in the VENDOR_BILL branch ([utils.tsx:168-171](https://github.com/Expensify/App/blob/main/src/pages/workspace/companyCards/utils.tsx#L168-L171)):

    -isDefaultTitle = !!(
    -    defaultAccount &&
    -    (!companyCard?.nameValuePairs?.netsuite_export_vendor || companyCard?.nameValuePairs?.netsuite_export_vendor === CONST.COMPANY_CARDS.DEFAULT_EXPORT_TYPE)
    -);
    +isDefaultTitle =
    +    !companyCard?.nameValuePairs?.netsuite_export_vendor ||
    +    companyCard?.nameValuePairs?.netsuite_export_vendor === CONST.COMPANY_CARDS.DEFAULT_EXPORT_TYPE;

    This fixes all three QA expectations in one shot: the row title becomes "Default Card", the selector pre-selects the "Default Card" row, and selecting it again keeps the title populated.

    The JOURNAL_ENTRY branch right below ([utils.tsx:189-193](https://github.com/Expensify/App/blob/main/src/pages/workspace/companyCards/utils.tsx#L189-L193)) has the identical pattern keyed on config?.payableAcct. Apply the same one-line trim there to keep the two NetSuite cases consistent and pre-empt the same bug surfacing on the journal-entry export.

    What alternative solutions did you explore?

    • Ensure config.defaultVendor is populated server-side on every workspace. The cleaner long-term answer, but it's a backend/data-migration job and doesn't help users who already have a workspace in this state. Removing the client-side coupling is the surgical fix.
    • Only show "Default Card" as the title and not in the selector list when defaultVendor is unset. Adds a special case for "nothing to default to" without changing the underlying mismatch. The card-level nameValuePairs is the source of truth for "user picked default"; reading it directly is simpler than carrying two states.
  9. melvin-bot commented on May 22, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @FitseTLT (External)

  10. David-2002065 commented on May 22, 2026

    @David-2002065
    Contributor

    Proposal

    What is the root cause of that problem?

    The NetSuite vendor bill export row on the company card details page is rendered from getExportMenuItem, and in the VENDOR_BILL case isDefaultTitle is gated on defaultAccount (the connection-level config?.defaultVendor):

    https://github.com/Expensify/App/blob/main/src/pages/workspace/companyCards/utils.tsx#L165-L184

    isDefaultTitle = !!(
        defaultAccount &&
        (!companyCard?.nameValuePairs?.netsuite_export_vendor || companyCard?.nameValuePairs?.netsuite_export_vendor === CONST.COMPANY_CARDS.DEFAULT_EXPORT_TYPE)
    );
    ...
    title = isDefaultTitle ? defaultCard : selectedVendor?.name;

    When the NetSuite connection has no connection-level default vendor configured, defaultAccount is undefined, so isDefaultTitle is false even though the card has no specific vendor assigned (or is explicitly set to "Default Card", i.e. netsuite_export_vendor === 'default').

    With isDefaultTitle === false, title falls through to selectedVendor?.name. But selectedVendor is vendors.find(({id}) => id === (companyCard?.nameValuePairs?.netsuite_export_vendor ?? defaultAccount)) — and 'default' (or undefined) matches no real vendor id, so selectedVendor is undefined and title becomes undefined. That is why the row shows no value (step 2 / step 6), and on the select page no row gets isSelected: true, so "Default Card" isn't highlighted (step 3).

    This is inconsistent with the Sage Intacct vendor bill case, which derives isDefaultTitle purely from the card NVP and does not require a connection-level default to be set:

    https://github.com/Expensify/App/blob/main/src/pages/workspace/companyCards/utils.tsx#L241-L243

    What changes do you think we should make in order to solve the problem?

    In the NetSuite VENDOR_BILL case of getExportMenuItem, stop gating isDefaultTitle on defaultAccount, so "Default Card" is treated as the default whenever the card has no specific vendor assigned — matching the Sage Intacct behavior:

    -                    isDefaultTitle = !!(
    -                        defaultAccount &&
    -                        (!companyCard?.nameValuePairs?.netsuite_export_vendor || companyCard?.nameValuePairs?.netsuite_export_vendor === CONST.COMPANY_CARDS.DEFAULT_EXPORT_TYPE)
    -                    );
    +                    isDefaultTitle =
    +                        !companyCard?.nameValuePairs?.netsuite_export_vendor ||
    +                        companyCard?.nameValuePairs?.netsuite_export_vendor === CONST.COMPANY_CARDS.DEFAULT_EXPORT_TYPE;

    With this, title becomes defaultCard and the "Default Card" list row gets isSelected: true whenever the card export is unset or 'default', fixing steps 2, 3 and 6. defaultAccount is still used as the fallback for selectedVendor, so the real-vendor path is unaffected.

    The NetSuite JOURNAL_ENTRY case directly below has the identical defaultAccount && gate (against config?.payableAcct):

    https://github.com/Expensify/App/blob/main/src/pages/workspace/companyCards/utils.tsx#L189-L193

    It has the same latent bug when no connection-level payable account is configured, so the same change should be applied there for consistency.

    What alternative solutions did you explore? (Optional)

    • Fall back title to defaultCard when selectedVendor is undefined. This would patch the empty title on the details page but leaves the select page broken — no row would still get isSelected: true, so "Default Card" wouldn't be highlighted (step 3). Fixing isDefaultTitle at the single source covers both surfaces.
    • Keep the gate and require a connection-level default vendor to be configured. That's a workspace configuration change, not a code fix, and the UI still needs to render a sensible value when no connection default exists — the bug repros in production today precisely in that state.
  11. changed the title [-]Company Card - Default value missing on NetSuite vendor bill export row[/-] [+][$250] Company Card - Default value missing on NetSuite vendor bill export row[/+] on May 22, 2026
  12. melvin-bot commented on May 22, 2026

    @melvin-bot
  13. 47 remaining items

  14. melvin-bot commented on Jun 19, 2026

    @melvin-bot

    @FitseTLT Whoops! This issue is 2 days overdue. Let's get this updated quick!

  15. FitseTLT commented on Jun 22, 2026

    @FitseTLT
    Contributor

    BugZero Checklist:

    Regression Test Proposal

    Precondition:

    Test:

    1. Connect to NetSuite on "Company Cards tests - DO NOT DELETE!" workspace
    2. Click on any assigned card to the account applausetester+ccardfeed@applause.expensifail.com
    3. Observe NetSuite vendor bills export row
    4. Verify the default value of Default card is displayed on NetSuite vendor bills export row
    5. Click the NetSuite vendor bills export row
    6. Click a different account other than default card
    7. Click the NetSuite vendor bills export row again
    8. Click Default Card
    9. Verify that "Default Card" is displayed on NetSuite vendor bills export row
    10. Go to Accounting > Export > Export company cards as and select journal entries
    11. And perform the above steps for Journal entries too.
    12. For all accounting integrations, verify that the default item label of the company card export row matches the Export company cards as setting:
    • "Default vendor" → vendor bills export
    • "Default account" → journal entries / check export
    • "Default card" → card export

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-7a98-a353-8947-a9863b350124
  16. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Jun 22, 2026
  17. melvin-bot commented on Jun 25, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  18. mallenexpensify commented on Jun 28, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @FitseTLT due $250 via NewDot

    ^ Test case created. Thx

  19. flaviadefaria commented on Jul 29, 2026

    @flaviadefaria
    Contributor

    Approved: @FitseTLT due $250 via NewDot

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions