From 7cbae3191617b79e9da08fb996188f3d0dce8bfe Mon Sep 17 00:00:00 2001 From: Scott Pouliot Date: Tue, 9 Jun 2026 08:58:09 -0400 Subject: [PATCH] Fix invoice ProjectName not pre-filling on edit; add to Details view Edit GET now falls back to job.ProjectName for invoices created before the column was added. Details view shows Project Name alongside Customer PO. Co-Authored-By: Claude Sonnet 4.6 --- src/PowderCoating.Web/Controllers/InvoicesController.cs | 2 +- src/PowderCoating.Web/Views/Invoices/Details.cshtml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/PowderCoating.Web/Controllers/InvoicesController.cs b/src/PowderCoating.Web/Controllers/InvoicesController.cs index ae1e984..2fcd0de 100644 --- a/src/PowderCoating.Web/Controllers/InvoicesController.cs +++ b/src/PowderCoating.Web/Controllers/InvoicesController.cs @@ -903,7 +903,7 @@ public class InvoicesController : Controller InternalNotes = invoice.InternalNotes, Terms = invoice.Terms, CustomerPO = invoice.CustomerPO, - ProjectName = invoice.ProjectName, + ProjectName = invoice.ProjectName ?? invoice.Job?.ProjectName, InvoiceItems = invoice.InvoiceItems .Where(i => !i.IsDeleted) .OrderBy(i => i.DisplayOrder) diff --git a/src/PowderCoating.Web/Views/Invoices/Details.cshtml b/src/PowderCoating.Web/Views/Invoices/Details.cshtml index a679cfe..b46004f 100644 --- a/src/PowderCoating.Web/Views/Invoices/Details.cshtml +++ b/src/PowderCoating.Web/Views/Invoices/Details.cshtml @@ -193,6 +193,13 @@

@Model.CustomerPO

} + @if (!string.IsNullOrWhiteSpace(Model.ProjectName)) + { +
+ +

@Model.ProjectName

+
+ } @if (!string.IsNullOrWhiteSpace(Model.ExternalReference)) {