From 27aa4e0ea6bc0de92bd42e3035f2bc6ab04aa08e Mon Sep 17 00:00:00 2001 From: Scott Pouliot Date: Sat, 16 May 2026 11:41:47 -0400 Subject: [PATCH] Invoice create: show discount row in totals, allow negative line items - Add "Discount Applied" display row (red, hidden when zero) between subtotal and tax so users can see the discount being deducted at a glance - Remove min="0" from UnitPrice and TotalPrice inputs (server-rendered and JS template) so negative adjustment lines can be entered without form rejection Co-Authored-By: Claude Sonnet 4.6 --- .../Views/Invoices/Create.cshtml | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/PowderCoating.Web/Views/Invoices/Create.cshtml b/src/PowderCoating.Web/Views/Invoices/Create.cshtml index 44e67e5..fbc8ccc 100644 --- a/src/PowderCoating.Web/Views/Invoices/Create.cshtml +++ b/src/PowderCoating.Web/Views/Invoices/Create.cshtml @@ -283,13 +283,13 @@ @@ -371,6 +371,10 @@ +
+ Discount Applied + −$0.00 +
@@ -725,13 +729,13 @@ @@ -797,6 +801,15 @@ const total = taxableAmount + tax; document.getElementById('displaySubtotal').textContent = formatCurrency(subtotal); + const discountRow = document.getElementById('discountRow'); + if (discountRow) { + if (discount > 0) { + document.getElementById('displayDiscount').textContent = '−' + formatCurrency(discount); + discountRow.classList.remove('d-none'); + } else { + discountRow.classList.add('d-none'); + } + } document.getElementById('displayTax').textContent = formatCurrency(tax); document.getElementById('displayTotal').textContent = formatCurrency(total); }