Fix inline edit not updating pricing breakdown on Job Details
Jobs/PatchItem now returns the full breakdown (itemsSubtotal, subtotalBeforeDiscount, subtotalAfterDiscount, taxAmount) so all rows in the pricing card update live without a page refresh. Added data-pb attributes to the matching spans in the pricing panel. Updated window.inlineItemEdit.totals config for jobs to map each response key to its DOM selector. updateTotals in inline-item-edit.js is now fully generic — cfg.totals keys must match server response property names directly, eliminating the old hardcoded tax/taxAmount and balance/balanceDue mismatches. Updated Quote and Invoice configs accordingly (tax→taxAmount, balance→balanceDue). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1458,9 +1458,9 @@
|
||||
canEdit: @Json.Serialize(canEdit),
|
||||
totals: {
|
||||
subtotal: '#inv-subtotal',
|
||||
tax: '#inv-tax',
|
||||
taxAmount: '#inv-tax',
|
||||
total: '#inv-total',
|
||||
balance: '#inv-balance'
|
||||
balanceDue: '#inv-balance'
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1611,7 +1611,7 @@
|
||||
}
|
||||
<div class="d-flex justify-content-between small fw-semibold border-top pt-1 mt-1">
|
||||
<span>Items subtotal</span>
|
||||
<span>@jobPb.ItemsSubtotal.ToString("C")</span>
|
||||
<span data-pb="itemsSubtotal">@jobPb.ItemsSubtotal.ToString("C")</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1660,7 +1660,7 @@
|
||||
</div>
|
||||
<div class="d-flex justify-content-between small mb-1">
|
||||
<span class="text-muted">Subtotal</span>
|
||||
<span>@jobPb.SubtotalBeforeDiscount.ToString("C")</span>
|
||||
<span data-pb="subtotalBeforeDiscount">@jobPb.SubtotalBeforeDiscount.ToString("C")</span>
|
||||
</div>
|
||||
@if (jobPb.DiscountAmount > 0)
|
||||
{
|
||||
@@ -1670,7 +1670,7 @@
|
||||
</div>
|
||||
<div class="d-flex justify-content-between small mb-1">
|
||||
<span class="text-muted">After discount</span>
|
||||
<span>@jobPb.SubtotalAfterDiscount.ToString("C")</span>
|
||||
<span data-pb="subtotalAfterDiscount">@jobPb.SubtotalAfterDiscount.ToString("C")</span>
|
||||
</div>
|
||||
}
|
||||
@if (jobPb.RushFee > 0)
|
||||
@@ -1684,7 +1684,7 @@
|
||||
{
|
||||
<div class="d-flex justify-content-between small mb-1">
|
||||
<span class="text-muted">Tax (@jobPb.TaxPercent.ToString("G29")%)</span>
|
||||
<span>@jobPb.TaxAmount.ToString("C")</span>
|
||||
<span data-pb="taxAmount">@jobPb.TaxAmount.ToString("C")</span>
|
||||
</div>
|
||||
}
|
||||
<div class="d-flex justify-content-between fw-bold border-top pt-2 mt-1">
|
||||
@@ -2422,7 +2422,11 @@
|
||||
patchUrl: '@Url.Action("PatchItem", "Jobs")',
|
||||
canEdit: true,
|
||||
totals: {
|
||||
finalPrice: '.job-final-price-display'
|
||||
itemsSubtotal: '[data-pb="itemsSubtotal"]',
|
||||
subtotalBeforeDiscount: '[data-pb="subtotalBeforeDiscount"]',
|
||||
subtotalAfterDiscount: '[data-pb="subtotalAfterDiscount"]',
|
||||
taxAmount: '[data-pb="taxAmount"]',
|
||||
finalPrice: '.job-final-price-display'
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -2268,9 +2268,9 @@
|
||||
patchUrl: '@Url.Action("PatchItem", "Quotes")',
|
||||
canEdit: true,
|
||||
totals: {
|
||||
subtotal: '#quote-subtotal',
|
||||
tax: '#quote-tax',
|
||||
total: '#quote-total'
|
||||
subtotal: '#quote-subtotal',
|
||||
taxAmount: '#quote-tax',
|
||||
total: '#quote-total'
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user