From b473bf17830b418858849ec80f7c2660969ad044 Mon Sep 17 00:00:00 2001 From: justin Date: Wed, 29 Apr 2026 08:55:21 -0500 Subject: [PATCH] Fix pricing calculation: remove feedback loop in updatePrice wizard.addonFee was being subtracted and then recalculated each call, causing prices to accumulate/subtract randomly on checkbox toggle. Simplified to just sum base + checked addons + formation fees. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../order/fcc-carrier-registration/index.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/site/public/order/fcc-carrier-registration/index.html b/site/public/order/fcc-carrier-registration/index.html index f090a02..67fad25 100644 --- a/site/public/order/fcc-carrier-registration/index.html +++ b/site/public/order/fcc-carrier-registration/index.html @@ -467,20 +467,24 @@ select:focus,input:focus{outline:none;border-color:#1e3a5f;box-shadow:0 0 0 2px function updatePrice() { var total = wizard.baseFee; var details = ['Base: $1,299']; + + // Add-on fees from checked checkboxes document.querySelectorAll('[data-reg]').forEach(function(cb) { if (!cb.checked) return; var key = cb.dataset.reg; if (key === 'stir_shaken') { total += 49900; details.push('STIR/SHAKEN: +$499'); } if (key === 'ocn') { total += 265000; details.push('OCN: +$2,650'); } - if (key === 'state_puc') { total += 39900; details.push('State PUC: +$399'); } + if (key === 'state_puc') { total += 39900; details.push('State PUC: +$399/state'); } }); - total += wizard.formationFee + wizard.stateFee; - if (wizard.formationFee) details.push('Formation: +$' + ((wizard.formationFee + wizard.stateFee) / 100).toLocaleString()); - total -= wizard.addonFee; // discount placeholder + + // Formation fees (if new entity) + if (wizard.formationFee || wizard.stateFee) { + total += wizard.formationFee + wizard.stateFee; + details.push('Formation: +$' + ((wizard.formationFee + wizard.stateFee) / 100).toLocaleString()); + } document.getElementById('total-price').textContent = '$' + (total / 100).toLocaleString(); document.getElementById('price-detail').textContent = details.join(' · '); - wizard.addonFee = total - wizard.baseFee - wizard.formationFee - wizard.stateFee; } // ── Step 2 → 3 ──