From 8d81c5f718cdf72e0e8627a45683f3d13a7ea13f Mon Sep 17 00:00:00 2001 From: vv01f Date: Mon, 29 May 2023 12:28:45 +0200 Subject: [PATCH] entropie-tarif in Stufen low/high/costom ab 06/2023 --- kole.html | 73 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 20 deletions(-) diff --git a/kole.html b/kole.html index 31dc57c..5fa2769 100644 --- a/kole.html +++ b/kole.html @@ -62,41 +62,51 @@
- Eingangsgröße - + Eingangsgröße   
- -  € + +  €
- -  % + +  %
- -  € + +  €
- -  € + +  €
- -  % + +
- -  € + +  %
- -  € + +  € +
+
+ +  €
- +
@@ -109,10 +119,11 @@ var z=document.getElementById('z'); var eu=document.getElementById('eu'); var k=document.getElementById('k'); - var bb=document.getElementById('bb'); - var bn=document.getElementById('bn'); - var bk=document.getElementById('bk'); + var bb=document.getElementById('bb'); + 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();