From 79c8c7e6a447306853be6e08d86732acf2497438 Mon Sep 17 00:00:00 2001 From: Scott Pouliot Date: Sat, 16 May 2026 21:46:48 -0400 Subject: [PATCH] Add manufacturer to Log Material item combobox Shows manufacturer name as muted secondary text in each dropdown row and includes it in the search filter, so users can find a powder by brand when multiple items share a similar name. Co-Authored-By: Claude Sonnet 4.6 --- src/PowderCoating.Web/Controllers/JobsController.cs | 2 +- src/PowderCoating.Web/Views/Jobs/Details.cshtml | 2 +- src/PowderCoating.Web/wwwroot/js/log-material.js | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/PowderCoating.Web/Controllers/JobsController.cs b/src/PowderCoating.Web/Controllers/JobsController.cs index 536df6a..b7f9840 100644 --- a/src/PowderCoating.Web/Controllers/JobsController.cs +++ b/src/PowderCoating.Web/Controllers/JobsController.cs @@ -501,7 +501,7 @@ public class JobsController : Controller // Inventory items for the manual log-material modal var inventoryItemsForModal = (await _unitOfWork.InventoryItems.GetAllAsync()) .OrderBy(i => i.Name) - .Select(i => new { i.Id, i.Name, i.UnitOfMeasure, i.QuantityOnHand }) + .Select(i => new { i.Id, i.Name, i.Manufacturer, i.UnitOfMeasure, i.QuantityOnHand }) .ToList(); ViewBag.InventoryItemsForModal = System.Text.Json.JsonSerializer.Serialize( inventoryItemsForModal, diff --git a/src/PowderCoating.Web/Views/Jobs/Details.cshtml b/src/PowderCoating.Web/Views/Jobs/Details.cshtml index 58da562..87746fd 100644 --- a/src/PowderCoating.Web/Views/Jobs/Details.cshtml +++ b/src/PowderCoating.Web/Views/Jobs/Details.cshtml @@ -1108,7 +1108,7 @@
diff --git a/src/PowderCoating.Web/wwwroot/js/log-material.js b/src/PowderCoating.Web/wwwroot/js/log-material.js index 7cc506a..e4c1b1c 100644 --- a/src/PowderCoating.Web/wwwroot/js/log-material.js +++ b/src/PowderCoating.Web/wwwroot/js/log-material.js @@ -40,6 +40,7 @@ if (!dd) return; const filtered = query ? _items.filter(it => it.name.toLowerCase().includes(query) || + (it.manufacturer && it.manufacturer.toLowerCase().includes(query)) || (it.unitOfMeasure && it.unitOfMeasure.toLowerCase().includes(query))) : _items; if (filtered.length === 0) { @@ -48,6 +49,7 @@ } dd.innerHTML = filtered.map(it => { const label = it.name + (it.unitOfMeasure ? ' (' + it.unitOfMeasure + ')' : ''); + const mfr = it.manufacturer ? `${escLm(it.manufacturer)}` : ''; return `
- ${escLm(label)} + ${escLm(label)}${mfr}
`; }).join(''); }