diff --git a/site/public/order/dot-compliance/index.html b/site/public/order/dot-compliance/index.html index dbce69b..22b2f13 100644 --- a/site/public/order/dot-compliance/index.html +++ b/site/public/order/dot-compliance/index.html @@ -485,8 +485,31 @@ function updateTotal() { discountAmt = Math.min(activeDiscount.discount_value * 100, discountable); } - var html = '
' + selected.length + ' service' + (selected.length > 1 ? 's' : '') + '' + usd(svcTotal) + '
'; - if (govTotal > 0) html += '
Government fees (passthrough)' + usd(govTotal) + '
'; + // Build itemized list + var html = ''; + checkboxes.forEach(function(cb) { + if (!cb.checked) return; + var price = parseInt(cb.dataset.price) || 0; + var gov = parseInt(cb.dataset.govfee) || 0; + var slug = cb.dataset.slug; + var label = cb.closest("label"); + var name = label ? (label.querySelector(".font-semibold.text-gray-900") || {}).textContent || slug : slug; + var canDiscount = !nonDiscountable[slug] && activeDiscount; + var itemDiscount = 0; + if (canDiscount && activeDiscount.discount_type === "percent") { + itemDiscount = Math.round(price * activeDiscount.discount_value / 100); + } + html += '
' + name + ''; + if (itemDiscount > 0) { + html += '' + usd(price) + ' -' + usd(itemDiscount) + ''; + } else { + html += '' + usd(price) + ''; + } + html += '
'; + if (gov > 0) html += '
Gov fee' + usd(gov) + '
'; + }); + + if (govTotal > 0) html += '
Government fees' + usd(govTotal) + '
'; if (discountAmt > 0) { html += '
' + activeDiscount.code + ' (' + activeDiscount.discount_value + '% off)-' + usd(discountAmt) + '
'; }