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 <noreply@anthropic.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user