From f94e2eadafda02c6efc90e09e031bc281a4dff92 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 4 May 2026 18:43:12 -0700 Subject: [PATCH] Fix NetSuite invoice item display showing first item when preference unset When invoiceItemPreference is unset (or 'create'), only resolve selectedItem when the user has explicitly chosen 'select existing'. This prevents the findSelectedInvoiceItemWithDefaultSelect fallback-to-first-item behavior from causing the export settings UI to display the first NetSuite item (e.g. 'EST99999') instead of the intended 'Create one for me' label. --- .../netsuite/export/NetSuiteExportConfigurationPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/accounting/netsuite/export/NetSuiteExportConfigurationPage.tsx b/src/pages/workspace/accounting/netsuite/export/NetSuiteExportConfigurationPage.tsx index aa61ed334087..ec4d32e015d3 100644 --- a/src/pages/workspace/accounting/netsuite/export/NetSuiteExportConfigurationPage.tsx +++ b/src/pages/workspace/accounting/netsuite/export/NetSuiteExportConfigurationPage.tsx @@ -67,7 +67,7 @@ function NetSuiteExportConfigurationPage({policy}: WithPolicyConnectionsProps) { const {subsidiaryList, receivableList, taxAccountsList, items, payableList} = policy?.connections?.netsuite?.options?.data ?? {}; const selectedSubsidiary = (subsidiaryList ?? []).find((subsidiary) => subsidiary.internalID === config?.subsidiaryID); const selectedReceivable = findSelectedBankAccountWithDefaultSelect(receivableList, config?.receivableAccount); - const selectedItem = findSelectedInvoiceItemWithDefaultSelect(items, config?.invoiceItem); + const selectedItem = config?.invoiceItemPreference === CONST.NETSUITE_INVOICE_ITEM_PREFERENCE.SELECT ? findSelectedInvoiceItemWithDefaultSelect(items, config?.invoiceItem) : undefined; const travelPayableAccount = payableList?.find((account) => account.id === config?.travelInvoicingPayableAccountID); const workspaceAccountID = useWorkspaceAccountID(policyID);