Heist-op-den-Berg, Populierenhof 10 – 10 appartementen

document.addEventListener('DOMContentLoaded', function () { const input = document.getElementById('gb-invest'); if (!input) return; // voorkomt errors als de simulator niet op de pagina staat const err = document.getElementById('gb-error'); const resetBtn = document.getElementById('gb-reset'); const elBedrag = document.getElementById('gb-bedrag'); const elBruto = document.getElementById('gb-bruto'); const elRV = document.getElementById('gb-rv'); const elBK = document.getElementById('gb-bk'); const elNetto = document.getElementById('gb-netto'); const elRend = document.getElementById('gb-rend'); const elNettoChip = document.getElementById('gb-netto-intrest'); const elRendChip = document.getElementById('gb-netto-rend'); function fmtEUR(n) { return new Intl.NumberFormat('nl-BE', { style: 'currency', currency: 'EUR' }).format(n); } function fmtPct(n) { return new Intl.NumberFormat('nl-BE', { style: 'percent', minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(n); } function calc() { const raw = Number(input.value || 0); const bedrag = isFinite(raw) ? raw : 0; if (bedrag < 10000) err.style.display = 'block'; else err.style.display = 'none'; const B = Math.max(10000, bedrag); const bruto = (B / 2 * 0.14) + (B / 2 * 0.045); const rv = bruto * 0.30; const bk = B * 0.025; const nettoIntrest = bruto - rv + bk; const nettoRend = nettoIntrest / B; elBedrag.textContent = fmtEUR(bedrag || 10000); elBruto.textContent = fmtEUR(bruto); elRV.textContent = fmtEUR(rv); elBK.textContent = fmtEUR(bk); elNetto.textContent = fmtEUR(nettoIntrest); elRend.textContent = fmtPct(nettoRend); elNettoChip.textContent = fmtEUR(nettoIntrest); elRendChip.textContent = fmtPct(nettoRend); } input.addEventListener('input', calc); resetBtn.addEventListener('click', function () { input.value = 10000; calc(); }); calc(); });