Fix quote preview not recalculating when tax-exempt customer is selected

When a customer was changed to/from a tax-exempt customer, the hidden
TaxPercent field was correctly updated to 0 but the live pricing preview
was not re-run, so the display showed a stale total with tax applied.
Selecting a tax-exempt customer now immediately triggers a recalc so
the on-screen total matches the amount that will be saved.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-15 15:58:20 -04:00
parent 051c86810e
commit 09e077897b
@@ -604,6 +604,8 @@
if (taxField) {
taxField.value = exemptIds.has(customerId) ? 0 : (meta.companyTaxPercent ?? meta.taxPercent);
}
// Recalculate the live preview so it reflects the updated tax rate immediately
if (typeof scheduleAutoPricing === 'function') scheduleAutoPricing();
const noEmail = customerId > 0 && noEmailIds.has(customerId);
const emailSection = document.getElementById('emailNotifySection');