-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
224 lines (202 loc) · 7.88 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>§ 13 RVG - Wertgebühren</title>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css"
integrity="sha384-XGjxtQfXaH2tnPFa9x+ruJTuLE3Aa6LhHSWRr1XeTyhezb4abCG4ccI5AkVDxqC+" crossorigin="anonymous">
</head>
<body>
<div class="container mt-5">
<h2 class="text-center"><a href="https://www.gesetze-im-internet.de/rvg/__13.html" target="_blank">§ 13 RVG -
Wertgebühren</a></h2>
Wenn sich die Gebühren nach dem Gegenstandswert richten, beträgt bei einem Gegenstandswert bis 500 Euro die Gebühr 49
Euro. Die Gebühr erhöht sich bei einem
<table class="table table-bordered table-striped mt-4">
<thead class="thead-dark">
<tr>
<th>Gegenstandswert bis … Euro</th>
<th>für jeden angefangenen Betrag von weiteren … Euro</th>
<th>um … Euro</th>
</tr>
</thead>
<tbody>
<tr>
<td>2 000</td>
<td>500</td>
<td>39</td>
</tr>
<tr>
<td>10 000</td>
<td>1 000</td>
<td>56</td>
</tr>
<tr>
<td>25 000</td>
<td>3 000</td>
<td>52</td>
</tr>
<tr>
<td>50 000</td>
<td>5 000</td>
<td>81</td>
</tr>
<tr>
<td>200 000</td>
<td>15 000</td>
<td>94</td>
</tr>
<tr>
<td>500 000</td>
<td>30 000</td>
<td>132</td>
</tr>
<tr>
<td>über 500 000</td>
<td>50 000</td>
<td>165</td>
</tr>
</tbody>
</table>
<!-- Inline Form -->
<form id="calculatorForm" class="form-inline justify-content-center mt-4">
<div class="form-group mb-2">
<label for="amount" class="sr-only">Gegenstandswert</label>
<input type="range" class="form-range" id="amount" value="350000" step="500" min="0" max="1000000"
required oninput="update()" onchange="update()">
</div>
<div class="form-group mb-2">
<label for="factor" class="sr-only">Faktor</label>
<input type="range" class="form-range" id="factor" value="1.3" step="0.1" min="0.8" max="2.0"
required oninput="update()" onchange="update()">
</div>
</form>
<table class="table table-bordered table-striped mt-4">
<tbody>
<tr>
<th style="width:20%">Gegenstandswert</th>
<td id="amountValue">-</td>
</tr>
<tr>
<th>Faktor</th>
<td id="factorValue">-</td>
</tr>
<tr>
<th>Gebühren</th>
<td id="result">-</td>
</tr>
</tbody>
</table>
<!-- Chart Canvas -->
<div class="mt-4">
<canvas id="resultChart"></canvas>
</div>
<div class="container">
<footer class="py-3 my-4">
<p class="text-center text-body-secondary">Stand: November 2024 |
<a href="https://github.com/herrdommel/13-RVG" target="_blank">
<i class="icon bi bi-github"></i> <span>herrdommel/13-RVG</span></a>
</p>
</footer>
</div>
</div>
<!-- ChartJS -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.umd.min.js"
integrity="sha384-Sse/HDqcypGpyTDpvZOJNnG0TT3feGQUkF9H+mnRvic+LjR+K1NhTt8f51KIQ3v3"
crossorigin="anonymous"></script>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
crossorigin="anonymous"></script>
<!-- JavaScript for calculation -->
<script>
const rules = {
500: () => 49,
2_000: (amount = 2_000) => Math.ceil((amount - 500) / 500) * 39 + rules[500](),
10_000: (amount = 10_000) => Math.ceil((amount - 2_000) / 1_000) * 56 + rules[2_000](),
25_000: (amount = 25_000) => Math.ceil((amount - 10_000) / 3_000) * 52 + rules[10_000](),
50_000: (amount = 50_000) => Math.ceil((amount - 25_000) / 5_000) * 81 + rules[25_000](),
200_000: (amount = 200_000) => Math.ceil((amount - 50_000) / 15_000) * 94 + rules[50_000](),
500_000: (amount = 500_000) => Math.ceil((amount - 200_000) / 30_000) * 132 + rules[200_000](),
rest: (amount) => Math.ceil((amount - 500_000) / 50_000) * 165 + rules[500_000]()
};
const processCalculationRules = (amount) => {
if (amount >= 500_000) {
return rules.rest(amount);
} else if (amount >= 200_000) {
return rules[500_000](amount);
} else if (amount >= 50_000) {
return rules[200_000](amount);
} else if (amount > 25_000) {
return rules[50_000](amount);
} else if (amount > 10_000) {
return rules[25_000](amount);
} else if (amount > 2_000) {
return rules[10_000](amount);
} else if (amount > 500) {
return rules[2_000](amount);
} else {
return rules[500](amount);
}
};
const adjustSteps = (amount, input = document.getElementById("amount")) => {
if (amount > 50_000) input.setAttribute("step", "10000");
else if (amount > 10_000) input.setAttribute("step", "1000");
else input.setAttribute("step", "100");
};
const getAmount = () => parseInt(document.getElementById("amount").value);
const getFactor = () => parseFloat(document.getElementById("factor").value);
const currencyFormatter = new Intl.NumberFormat("de-DE", { style: "currency", currency: "EUR" });
// Initialize Chart.js
const amounts = [];
const results = [];
let amount = 500;
let step = 500;
while (amount <= 1_000_000) {
amounts.push(amount);
results.push(processCalculationRules(amount).toFixed(2));
amount += step;
if (amount >= 500_000) step = 50_000;
else if (amount >= 200_000) step = 30_000;
else if (amount >= 50_000) step = 15_000;
else if (amount >= 25_000) step = 5_000;
else if (amount >= 10_000) step = 3_000;
else if (amount >= 2_000) step = 1_000;
}
const ctx = document.getElementById("resultChart");
const chart = new Chart(ctx, {
type: "line",
data: {
labels: amounts, // X-axis labels
datasets: [
{ label: "Gebühren bei Faktor 1.0", data: results },
{ label: "Gebühren bei Faktor 0.8", data: results.map(r => r * 0.8) },
{ label: "Gebühren bei Faktor 1.3", data: results.map(r => r * 1.3) },
{ label: "Gebühren bei Faktor 1.6", data: results.map(r => r * 1.6) }
]
},
options: {
scales: {
x: { title: { display: true, text: "Gegenstandswert" } },
y: { title: { display: true, text: "Gebühren" } }
}
}
});
function update() {
const amount = getAmount();
const factor = getFactor();
const result = processCalculationRules(amount) * factor;
adjustSteps(amount);
// Display result
document.getElementById("amountValue").textContent = currencyFormatter.format(amount);
document.getElementById("factorValue").textContent = factor.toFixed(1);
document.getElementById("result").innerText = currencyFormatter.format(result);
}
update();
</script>
</body>
</html>