Inline item editing on Job Details with live pricing and costing updates

- PatchItem: add case-insensitive JSON deserialization; add legacy fallback
  that computes a live breakdown from job items when PricingBreakdownJson is null
- PatchItem: return itemsSubtotal, subtotalBeforeDiscount, subtotalAfterDiscount,
  taxAmount in JSON response for immediate DOM updates
- GetCostingBreakdown: use job.FinalPrice as revenue (not invoice total) so
  costing figures reflect inline edits before an invoice exists
- Details.cshtml: add data-pb attributes to visible pricing rows; add
  job-final-price-display class to visible Total element
- Details.cshtml: wire afterSave callback to call costing.load() after each edit
- inline-item-edit.js: add afterSave hook in commit(); clean up debug logging
- Help docs: add Inline Price Editing sections to Jobs, Quotes, and Invoices
  help articles; add inline editing + job costing revenue notes to AI knowledge base

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-20 23:56:36 -04:00
parent ec925f9e08
commit 1bb07162cd
7 changed files with 122 additions and 24 deletions
@@ -78,6 +78,32 @@
</div>
</section>
<section id="inline-price-editing" class="mb-5">
<h2 class="h4 fw-bold border-bottom pb-2 mb-3">
<i class="bi bi-pencil-square text-primary me-2"></i>Inline Price Editing
</h2>
<p>
While an invoice is in <strong>Draft</strong> status, you can edit line item prices,
quantities, and descriptions directly on the Invoice Details page &mdash; without
opening the full Edit form.
</p>
<ol class="mb-3">
<li class="mb-2">Click a <strong>unit price</strong>, <strong>quantity</strong>, or <strong>description</strong> cell. The cell turns into an input field.</li>
<li class="mb-2">Type the new value.</li>
<li class="mb-2">Press <kbd>Enter</kbd> or click anywhere outside the field to save. Press <kbd>Esc</kbd> to cancel.</li>
</ol>
<p>
The line total and the invoice grand total update immediately without reloading the page.
</p>
<div class="alert alert-permanent alert-secondary d-flex gap-2 mb-0" role="alert">
<i class="bi bi-info-circle flex-shrink-0 mt-1"></i>
<div>
Once an invoice is marked <strong>Sent</strong>, line items are locked and inline
editing is disabled. To correct a sent invoice, void it and create a new one.
</div>
</div>
</section>
<section id="invoice-statuses" class="mb-5">
<h2 class="h4 fw-bold border-bottom pb-2 mb-3">
<i class="bi bi-tag text-primary me-2"></i>Invoice Statuses
@@ -309,6 +309,35 @@
</div>
</section>
<section id="inline-price-editing" class="mb-5">
<h2 class="h4 fw-bold border-bottom pb-2 mb-3">
<i class="bi bi-pencil-square text-primary me-2"></i>Inline Price Editing
</h2>
<p>
On the Job Details page you can edit any item&rsquo;s unit price, quantity, or description
directly in the table &mdash; without opening the full Edit form.
</p>
<ol class="mb-3">
<li class="mb-2">Click a <strong>unit price</strong>, <strong>quantity</strong>, or <strong>description</strong> cell in the Items table. The cell turns into an input field.</li>
<li class="mb-2">Type the new value.</li>
<li class="mb-2">Press <kbd>Enter</kbd> or click anywhere outside the field to save. Press <kbd>Esc</kbd> to cancel without saving.</li>
</ol>
<p>
After saving, the line total updates immediately and the pricing summary card (Items
Subtotal, Subtotal, Tax, and Grand Total) refreshes &mdash; no page reload required.
The <strong>Job Costing</strong> card also recalculates automatically so your
profit margin estimate stays current.
</p>
<div class="alert alert-permanent alert-info d-flex gap-2 mb-0" role="alert">
<i class="bi bi-info-circle-fill flex-shrink-0 mt-1"></i>
<div>
The <strong>Job Costing</strong> section calculates revenue from the job&rsquo;s
current Final Price &mdash; not from the linked invoice total. Inline price edits
are reflected in the costing analysis immediately, even before an invoice is created.
</div>
</div>
</section>
<section id="converting-from-quote" class="mb-5">
<h2 class="h4 fw-bold border-bottom pb-2 mb-3">
<i class="bi bi-arrow-left-right text-primary me-2"></i>Converting from a Quote
@@ -213,6 +213,25 @@
</div>
</section>
<section id="inline-price-editing" class="mb-5">
<h2 class="h4 fw-bold border-bottom pb-2 mb-3">
<i class="bi bi-pencil-square text-primary me-2"></i>Inline Price Editing
</h2>
<p>
On the Quote Details page you can edit any item&rsquo;s unit price, quantity, or
description directly in the table without opening the full Edit form.
</p>
<ol class="mb-3">
<li class="mb-2">Click a <strong>unit price</strong>, <strong>quantity</strong>, or <strong>description</strong> cell in the Items table. The cell turns into an input field.</li>
<li class="mb-2">Type the new value.</li>
<li class="mb-2">Press <kbd>Enter</kbd> or click outside the field to save. Press <kbd>Esc</kbd> to cancel without saving.</li>
</ol>
<p>
The pricing summary (subtotal, discount, tax, and grand total) updates immediately
&mdash; no page reload required.
</p>
</section>
<section id="quote-statuses" class="mb-5">
<h2 class="h4 fw-bold border-bottom pb-2 mb-3">
<i class="bi bi-tag text-primary me-2"></i>Quote Statuses