entropie-tarif in Stufen low/high/costom ab 06/2023

This commit is contained in:
vv01f 2023-05-29 12:28:45 +02:00
parent dba18241e0
commit 8d81c5f718

View File

@ -62,41 +62,51 @@
<fieldset>
<legend></legend>
<section class="radiogroup">
<legend>Eingangsgröße</legend>
<input accesskey="b" type="radio" name="b" value="e" id="bb" class="bb" checked="checked"/><label for="bb"><u>B</u>rutto</label><input accesskey="n" type="radio" name="b" value="b" id="bn" class="bb"/><label for="bn"><u>N</u>etto</label><input accesskey="k" type="radio" name="b" value="k" id="bk" class="bb"/><label for="bk"><u>K</u>oLe</label>
<legend>Eingangsgröße</legend><!--
--><input accesskey="b" type="radio" name="b" value="e" id="bb" class="bb" checked="checked"/>&nbsp;<label for="bb"><u>B</u>rutto</label><!--
--><input accesskey="n" type="radio" name="b" value="b" id="bn" class="bb"/>&nbsp;<label for="bn"><u>N</u>etto</label><!--
--><input accesskey="k" type="radio" name="b" value="k" id="bk" class="bb"/>&nbsp;<label for="bk"><u>K</u>oLe</label>
</section>
<section>
<div>
<label for="e">Br<u>u</u>tto</label>
<input accesskey="u" type="number" step="0.01" id="e" value="100.00"/>&thinsp;
<label for="e">Br<u>u</u>tto</label>
<input accesskey="u" type="number" step="0.01" id="e" value="100.00"/>&thinsp;
</div>
<div>
<label for="u">Umsatzsteuersatz</label>
<input type="number" step="0.01" id="u" value="19.00"/>&thinsp;%
<label for="u">Umsatzsteuersatz</label>
<input type="number" step="0.01" id="u" value="19.00"/>&thinsp;%
</div>
<div>
<label for="us">Umsatzsteuer</label>
<input readonly="readonly" type="number" step="0.01" id="us" value="0.00"/>&thinsp;
<label for="us">Umsatzsteuer</label>
<input readonly="readonly" type="number" step="0.01" id="us" value="0.00"/>&thinsp;
</div>
<div>
<label for="n">N<u>e</u>tto</label>
<input accesskey="e" type="number" step="0.01" id="n" value="0.00"/>&thinsp;
<label for="n">N<u>e</u>tto</label>
<input accesskey="e" type="number" step="0.01" id="n" value="0.00"/>&thinsp;
</div>
<div>
<label for="z">Entropieumlagesatz</label>
<input type="number" step="0.01" id="z" value="23.00"/>&thinsp;%
<label for="ec">Entropie-Tarif</label><!-- ggf. künftig Grundlage wie Handbuch/Dokumentation verlinken -->
<select id="ec">
<option value="l" accesskey="l" name="low">Umsatz &leq;1.000&nbsp;</option><!-- low: <=1 TEUR -->
<option value="h" accesskey="h" name="high">Umsatz &gt;1.000&nbsp;</option><!-- high: >1 TEUR -->
<option value="c" accesskey="c" name="custom">nach&nbsp;Vereinbarung</option><!-- custom: separate agreement -->
</select>
</div>
<div>
<label for="eu">Entropieumlage</label>
<input readonly="readonly" type="number" step="0.01" id="eu" value="23.00"/>&thinsp;
<label for="z">Entropieumlagesatz</label>
<input type="number" step="0.01" id="z" value="23.00"/>&thinsp;%
</div>
<div>
<label for="k">K<u>o</u>Le</label>
<input accesskey="o" type="number" step="0.01" id="k" value="0.00"/>&thinsp;
<label for="eu">Entropieumlage</label>
<input readonly="readonly" type="number" step="0.01" id="eu" value="23.00"/>&thinsp;
</div>
<div>
<label for="k">K<u>o</u>Le</label>
<input accesskey="o" type="number" step="0.01" id="k" value="0.00"/>&thinsp;
</div>
</section>
<section>
<button accesskey="c" id="b" type="button">Bere<u>c</u>hnen</button>
<button accesskey="r" id="b" type="button">Be<u>r</u>echnen</button>
</section>
</fieldset>
@ -113,6 +123,7 @@
var bn=document.getElementById('bn');
var bk=document.getElementById('bk');
var s = document.getElementById('b');
var c = document.getElementById('ec');
function getFormFloat(f){
return parseFloat(f.value);
@ -122,6 +133,8 @@
}
s.addEventListener('click', function(){
c.selectedIndex=0;
z.disabled=true;
if(bk.checked){
e.value = roundCents( getFormFloat(k) * ( 1 + getFormFloat(u) / 100 ) / ( 1 - getFormFloat(z) / 100 ) );
n.value = roundCents( getFormFloat(k) / ( 1 - getFormFloat(z) / 100 ) );
@ -137,6 +150,26 @@
});
e.addEventListener('change', function(){bb.checked = true;});
n.addEventListener('change', function(){bn.checked = true;});
c.addEventListener('change', function(){
var selInd=this.selectedIndex;
console.log('Entropie-Tarif: '+selInd+'('+z.disabled+': '+z.value+')');
switch(selInd){
case 0: //low: <1.000 EUR revenue
//23.0 %
z.value='23.00';
z.disabled=true;
break;;
case 1: //high: >1.000 EUR revenue
//11.5 %
z.disabled=true;
z.value='11.50';
break;;
case 2: //custom: according toseparate agreement
z.disabled=false;
//~ z.focus();
break;;
}
});
s.click();
</script>
</div>