2023-03-28 01:12:30 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<style>
|
|
|
|
input[type='number']{text-align:right;}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<table>
|
2023-03-28 11:21:14 +02:00
|
|
|
<tr><td>Ausgangsbetrag:</td><td><input type="radio" name="b" value="e" id="bb" class="bb" checked="checked"/><label for="bb">Brutto</label><input type="radio" name="b" value="b" id="bn" class="bb"/><label for="bn">Netto</label><input type="radio" name="b" value="k" id="bk" class="bb"/><label for="bk">KoLe</label></td></tr>
|
|
|
|
<tr><td>Brutto</td><td><input type="number" step="0.01" id="e" value="100.00"/> €</td></tr>
|
2023-03-29 12:44:05 +02:00
|
|
|
<tr><td>Umsatzsteuersatz</td><td><input type="number" step="0.01" id="u" value="19.00"/> %</td></tr>
|
|
|
|
<tr><td>Umsatzsteuer</td><td><input type="number" step="0.01" id="us" value="0.00"/> €</td></tr>
|
2023-03-28 11:21:14 +02:00
|
|
|
<tr><td>Netto</td><td><input type="number" step="0.01" id="n" value="0.00"/> €</td></tr>
|
2023-03-29 12:44:05 +02:00
|
|
|
<tr><td>Entropieumlagesatz</td><td><input type="number" step="0.01" id="z" value="23.00"/> %</td></tr>
|
|
|
|
<tr><td>Entropieumlage</td><td><input type="number" step="0.01" id="eu" value="23.00"/> €</td></tr>
|
2023-03-28 11:21:14 +02:00
|
|
|
<tr><td>KoLe</td><td><input type="number" step="0.01" id="k" value="0.00"/> €</td></tr>
|
2023-03-28 01:12:30 +02:00
|
|
|
<tr><td> </td><td><input value="Berechnen" id="b" type="button"/></td></tr>
|
|
|
|
</table>
|
|
|
|
<script>
|
|
|
|
var e=document.getElementById('e');
|
|
|
|
var u=document.getElementById('u');
|
2023-03-29 12:44:05 +02:00
|
|
|
var us=document.getElementById('us');
|
2023-03-28 11:21:14 +02:00
|
|
|
var n=document.getElementById('n');
|
2023-03-28 01:12:30 +02:00
|
|
|
var z=document.getElementById('z');
|
2023-03-29 12:44:05 +02:00
|
|
|
var eu=document.getElementById('eu');
|
2023-03-28 01:12:30 +02:00
|
|
|
var k=document.getElementById('k');
|
2023-03-28 11:21:14 +02:00
|
|
|
var bb=document.getElementById('bb');
|
|
|
|
var bn=document.getElementById('bn');
|
2023-03-28 01:12:30 +02:00
|
|
|
var bk=document.getElementById('bk');
|
2023-03-28 11:21:14 +02:00
|
|
|
var s = document.getElementById('b');
|
2023-03-28 01:12:30 +02:00
|
|
|
|
2023-03-28 11:21:14 +02:00
|
|
|
function getFormFloat(f){
|
2023-03-28 11:27:14 +02:00
|
|
|
return parseFloat(f.value);
|
2023-03-28 11:21:14 +02:00
|
|
|
}
|
|
|
|
function roundCents(f){
|
|
|
|
return Math.round( f * 100 ) / 100;
|
|
|
|
}
|
|
|
|
|
|
|
|
s.addEventListener('click', function(){
|
2023-03-28 01:12:30 +02:00
|
|
|
if(bk.checked){
|
2023-03-28 11:21:14 +02:00
|
|
|
e.value = roundCents( getFormFloat(k) * ( 1 + getFormFloat(u) / 100 ) / ( 1 - getFormFloat(z) / 100 ) );
|
|
|
|
n.value = roundCents( getFormFloat(k) / ( 1 - getFormFloat(z) / 100 ) );
|
|
|
|
}else if(bb.checked){
|
|
|
|
k.value = roundCents( getFormFloat(e) / ( 1 + getFormFloat(u) / 100 ) * ( 1 - getFormFloat(z) / 100 ) );
|
|
|
|
n.value = roundCents( getFormFloat(e) / ( 1 + getFormFloat(u) / 100 ) );
|
|
|
|
}else if(bn.checked){
|
|
|
|
e.value = roundCents( getFormFloat(n) * ( 1 + getFormFloat(u) / 100 ) );
|
|
|
|
k.value = roundCents( getFormFloat(n) * ( 1 - getFormFloat(z) / 100 ) );
|
2023-03-28 01:12:30 +02:00
|
|
|
}
|
2023-03-29 12:44:05 +02:00
|
|
|
us.value = roundCents(e.value* getFormFloat(u) / 100 );
|
|
|
|
eu.value = roundCents(n.value* getFormFloat(z) / 100 );
|
2023-03-28 01:12:30 +02:00
|
|
|
});
|
2023-03-28 11:21:14 +02:00
|
|
|
e.addEventListener('change', function(){bb.checked = true;});
|
|
|
|
n.addEventListener('change', function(){bn.checked = true;});
|
|
|
|
k.addEventListener('change', function(){bk.checked = true;});
|
|
|
|
s.click();
|
2023-03-28 01:12:30 +02:00
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|