diff --git a/src/PowderCoating.Web/Controllers/InventoryController.cs b/src/PowderCoating.Web/Controllers/InventoryController.cs index 3ae5d49..a703431 100644 --- a/src/PowderCoating.Web/Controllers/InventoryController.cs +++ b/src/PowderCoating.Web/Controllers/InventoryController.cs @@ -946,7 +946,10 @@ public class InventoryController : Controller if (!string.IsNullOrWhiteSpace(urlMfr)) { aiResult = await _aiLookupService.LookupAsync(urlMfr, urlColor, null, urlPart); - if (aiResult.Success && aiResult.SpecPageUrl == null) + // The scanned QR URL is always the authoritative product page link — it came + // directly from the manufacturer's bag and is always fully-qualified. Overwrite + // whatever LookupAsync returned (which may be a scheme-less path from the template). + if (aiResult.Success) aiResult.SpecPageUrl = qrUrl; } else diff --git a/src/PowderCoating.Web/Views/Inventory/Details.cshtml b/src/PowderCoating.Web/Views/Inventory/Details.cshtml index f5926ce..8d6a116 100644 --- a/src/PowderCoating.Web/Views/Inventory/Details.cshtml +++ b/src/PowderCoating.Web/Views/Inventory/Details.cshtml @@ -5,6 +5,11 @@ ViewData["PageIcon"] = "bi-box-seam"; ViewData["PageHelpTitle"] = "Inventory Item"; ViewData["PageHelpContent"] = "Full detail for this inventory item. Stock Information shows current quantity and reorder thresholds — a Low Stock banner appears when quantity is at or below the Reorder Point. Pricing shows Unit Cost (what you paid), Average Cost (weighted average across purchases), and Total Stock Value. Use the Actions panel to edit, view jobs using this powder, or delete the item."; + + string SafeUrl(string? url) => + string.IsNullOrEmpty(url) ? "#" + : (url.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || url.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) + ? url : "http://" + url; } @section Styles { @@ -184,7 +189,7 @@
- + View on Manufacturer's Web Site
@@ -197,13 +202,13 @@