show selling costs transparently in tooltip and label on result card

This commit is contained in:
Johannes
2026-03-20 02:48:30 +01:00
parent db4a25ece9
commit 767a2e4cfc
3 changed files with 4 additions and 0 deletions

View File

@@ -68,6 +68,7 @@ function run_simulation(p) {
cum_rent_arr.push(0); cum_rent_arr.push(0);
detail_arr.push({ detail_arr.push({
house_value: Math.round(home_value), house_value: Math.round(home_value),
selling_costs: Math.round(selling_costs_0),
mortgage_balance: Math.round(balance), mortgage_balance: Math.round(balance),
buyer_portfolio: Math.round(buyer_portfolio), buyer_portfolio: Math.round(buyer_portfolio),
yr_interest: 0, yr_interest: 0,
@@ -143,6 +144,7 @@ function run_simulation(p) {
cum_rent_arr.push(Math.round(cum_rent_cost)); cum_rent_arr.push(Math.round(cum_rent_cost));
detail_arr.push({ detail_arr.push({
house_value: Math.round(home_value), house_value: Math.round(home_value),
selling_costs: Math.round(selling_costs),
mortgage_balance: Math.round(balance), mortgage_balance: Math.round(balance),
buyer_portfolio: Math.round(buyer_portfolio), buyer_portfolio: Math.round(buyer_portfolio),
yr_interest: Math.round(yr_interest), yr_interest: Math.round(yr_interest),

View File

@@ -232,6 +232,7 @@
<div class="result-label">Nettovermögen Kauf</div> <div class="result-label">Nettovermögen Kauf</div>
<div class="result-value" id="res_buyer_nw"></div> <div class="result-value" id="res_buyer_nw"></div>
<div class="result-sub" id="res_buy_cost">Gesamtausgaben: —</div> <div class="result-sub" id="res_buy_cost">Gesamtausgaben: —</div>
<div class="result-sub" style="color:var(--text-hint)">inkl. Verkaufskosten</div>
</div> </div>
<div class="result-card rent-card"> <div class="result-card rent-card">
<div class="result-label">Nettovermögen Miete</div> <div class="result-label">Nettovermögen Miete</div>

1
ui.js
View File

@@ -193,6 +193,7 @@ const build_table = (result) => {
td_buy_nw.classList.add('has-tip'); td_buy_nw.classList.add('has-tip');
td_buy_nw.addEventListener('mouseenter', (e) => show_tooltip(e, [ td_buy_nw.addEventListener('mouseenter', (e) => show_tooltip(e, [
tip_row('Immobilienwert', d.house_value, '#f59e0b'), tip_row('Immobilienwert', d.house_value, '#f59e0b'),
tip_row('Verkaufskosten', -d.selling_costs, '#ef4444'),
tip_row('ETF-Portfolio', d.buyer_portfolio, '#f59e0b'), tip_row('ETF-Portfolio', d.buyer_portfolio, '#f59e0b'),
tip_row('Restschuld', -d.mortgage_balance, '#ef4444'), tip_row('Restschuld', -d.mortgage_balance, '#ef4444'),
].join('<br>'))); ].join('<br>')));