From 7239f55308744f229d0b575c80192394f2637074 Mon Sep 17 00:00:00 2001 From: Scott Pouliot Date: Fri, 15 May 2026 16:05:07 -0400 Subject: [PATCH] Fix tax-exempt customers always charged tax in quote preview parseFloat('0') is falsy in JS, so '0 || pageMeta.taxPercent' was falling through to the company default rate even when the TaxPercent field was correctly set to 0 for a tax-exempt customer. Use an explicit field presence check instead. Co-Authored-By: Claude Sonnet 4.6 --- src/PowderCoating.Web/wwwroot/js/item-wizard.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PowderCoating.Web/wwwroot/js/item-wizard.js b/src/PowderCoating.Web/wwwroot/js/item-wizard.js index e1cffa1..cc4f0f6 100644 --- a/src/PowderCoating.Web/wwwroot/js/item-wizard.js +++ b/src/PowderCoating.Web/wwwroot/js/item-wizard.js @@ -2904,7 +2904,8 @@ async function runAutoPricing() { try { // Collect current form meta const customerId = parseInt(document.querySelector('[name="CustomerId"]')?.value) || null; - const taxPercent = parseFloat(document.querySelector('[name="TaxPercent"]')?.value) || pageMeta.taxPercent || 0; + const _taxField = document.querySelector('[name="TaxPercent"]'); + const taxPercent = _taxField ? parseFloat(_taxField.value) : (pageMeta.taxPercent ?? 0); const discountType = document.getElementById('discountTypeSelect')?.value || 'None'; const discountVal = parseFloat(document.getElementById('discountValueInput')?.value) || 0; const isRushJob = document.getElementById('IsRushJob')?.checked || false;