From 833bea0c8628adb345cae9167e55bf528b6b1635 Mon Sep 17 00:00:00 2001 From: Karl Burkhart Date: Mon, 10 Jan 2011 13:28:02 +0000 Subject: [PATCH] --- wawi/bestellung.php | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/wawi/bestellung.php b/wawi/bestellung.php index c912fc17c..caea7b499 100644 --- a/wawi/bestellung.php +++ b/wawi/bestellung.php @@ -1032,6 +1032,35 @@ if($aktion == 'suche') summe(); } + function calcNetto(id) + { + var brutto=0; + + var menge = $("#menge_"+id).val(); + var brutto = $("#brutto_"+id).val(); + var mwst = $("#mwst_"+id).val(); + + if(brutto!="" && mwst!="" && menge!="") + { + brutto = brutto.replace(",","."); + mwst = mwst.replace(",","."); + menge = parseFloat(menge); + brutto = parseFloat(brutto); + mwst = parseFloat(mwst); + + // Nettopreis berechnen + var netto = brutto/(100+mwst)*100; + var netto = netto / menge; + + //auf 2 Nachkommastellen runden + netto = Math.round(netto*100)/100; + netto.toFixed(2); + $("#preisprove_"+id).val(netto); + } + summe(); + } + + /* Berechnet die gesamte Brutto Summe für eine Bestellung */ @@ -1610,7 +1639,7 @@ if($aktion == 'suche') echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; $detail_tag = new tags(); $detail_tag->GetTagsByBestelldetail($bestelldetail_id); $help = $detail_tag->GetStringTags();