From 0f6eef5370f11dbd769d5679500cc3c25e484be8 Mon Sep 17 00:00:00 2001 From: Scott Pouliot Date: Wed, 17 Jun 2026 15:50:11 -0400 Subject: [PATCH] Show current catalog price and price-change nudge on inventory detail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Surfaces the synced CatalogReferencePrice on the inventory detail pricing card: "Current Catalog Price" (the price quotes use), with an info popover clarifying it doesn't affect Unit Cost or stock value, an "Updated " line, and a badge nudging when it differs from what they last paid ("Price up/down from $X last paid"). Adds CatalogReferencePrice/CatalogPriceUpdatedAt to InventoryItemDto (auto-mapped). Display only — no pricing/accounting impact. Co-Authored-By: Claude Opus 4.8 --- .../DTOs/Inventory/InventoryDtos.cs | 2 ++ .../Views/Inventory/Details.cshtml | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/src/PowderCoating.Application/DTOs/Inventory/InventoryDtos.cs b/src/PowderCoating.Application/DTOs/Inventory/InventoryDtos.cs index 61edd7d..9804d24 100644 --- a/src/PowderCoating.Application/DTOs/Inventory/InventoryDtos.cs +++ b/src/PowderCoating.Application/DTOs/Inventory/InventoryDtos.cs @@ -37,6 +37,8 @@ public class InventoryItemDto public decimal AverageCost { get; set; } public decimal LastPurchasePrice { get; set; } public DateTime? LastPurchaseDate { get; set; } + public decimal? CatalogReferencePrice { get; set; } + public DateTime? CatalogPriceUpdatedAt { get; set; } public int? PrimaryVendorId { get; set; } public string? PrimaryVendorName { get; set; } public string? VendorPartNumber { get; set; } diff --git a/src/PowderCoating.Web/Views/Inventory/Details.cshtml b/src/PowderCoating.Web/Views/Inventory/Details.cshtml index f448310..b3903ff 100644 --- a/src/PowderCoating.Web/Views/Inventory/Details.cshtml +++ b/src/PowderCoating.Web/Views/Inventory/Details.cshtml @@ -431,6 +431,41 @@

@((Model.QuantityOnHand * Model.UnitCost).ToString("C"))

+ @if (Model.CatalogReferencePrice.HasValue && Model.CatalogReferencePrice.Value > 0) + { +

+
+ +

+ @Model.CatalogReferencePrice.Value.ToString("C") + / @Model.UnitOfMeasure +

+ @{ + var catRef = Model.CatalogReferencePrice.Value; + var paidPrice = (Model.LastPurchaseDate.HasValue && Model.LastPurchasePrice > 0) + ? Model.LastPurchasePrice : Model.UnitCost; + } + @if (paidPrice > 0 && Math.Abs(catRef - paidPrice) >= 0.01m) + { + var priceUp = catRef > paidPrice; +
+ + + Price @(priceUp ? "up" : "down") from @paidPrice.ToString("C") last paid + +
+ } + @if (Model.CatalogPriceUpdatedAt.HasValue) + { +
Updated @Model.CatalogPriceUpdatedAt.Value.ToLocalTime().ToString("MMM d, yyyy")
+ } +
+ } @if (Model.LastPurchaseDate.HasValue) {