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) {