From cefdf3e35c8e0b766e425c66da514c325de0a1d6 Mon Sep 17 00:00:00 2001 From: Scott Pouliot Date: Thu, 14 May 2026 19:12:28 -0400 Subject: [PATCH] Add remaining-weight input mode to inventory scan/usage page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Users can now toggle between 'Amount Used' and 'Remaining Weight' on the QR scan page. In remaining-weight mode, usage is calculated as (current stock - remaining) before submit — no controller changes needed. Includes live hint showing calculated usage and new balance as they type, with validation preventing negative usage or remaining > current stock. Co-Authored-By: Claude Sonnet 4.6 --- .../Views/Inventory/Scan.cshtml | 105 +++++++++++++++++- 1 file changed, 100 insertions(+), 5 deletions(-) diff --git a/src/PowderCoating.Web/Views/Inventory/Scan.cshtml b/src/PowderCoating.Web/Views/Inventory/Scan.cshtml index 2ac6e3f..cd2c226 100644 --- a/src/PowderCoating.Web/Views/Inventory/Scan.cshtml +++ b/src/PowderCoating.Web/Views/Inventory/Scan.cshtml @@ -168,6 +168,23 @@ } .reason-pill.selected { border-color: var(--purple); background: #f3effe; color: var(--purple); font-weight: 600; } + /* ── Input mode toggle ───────────────────────── */ + .mode-toggle { display: flex; border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 18px; } + .mode-btn { + flex: 1; + padding: 10px 8px; + background: #fff; + border: none; + font-size: 13px; + font-weight: 600; + color: var(--muted); + cursor: pointer; + text-align: center; + transition: background .15s, color .15s; + } + .mode-btn.active { background: var(--purple); color: #fff; } + .mode-btn:first-child { border-right: 1.5px solid var(--border); } + /* ── Submit / Cancel ─────────────────────────── */ .btn-submit { width: 100%; @@ -309,12 +326,28 @@

2. Enter Quantity

-
+ +
+ + +
+ + +
+ min="0" step="any" placeholder="0" inputmode="decimal" + oninvalid="this.setCustomValidity('')" />
+ + +
@@ -346,6 +379,21 @@