diff --git a/include/wawi_bestelldetail.class.php b/include/wawi_bestelldetail.class.php index 5b28e63df..7e7277e00 100644 --- a/include/wawi_bestelldetail.class.php +++ b/include/wawi_bestelldetail.class.php @@ -188,7 +188,16 @@ class wawi_bestelldetail extends basis_db $this->errormsg ="Artikelnummer fehlerhaft."; return false; } - + if(!is_numeric($this->preisprove)) + { + $this->errormsg="Ungültiger Preis eingegeben."; + return false; + } + if(!is_numeric($this->mwst) && $this->mwst != '') + { + $this->errormsg="Ungültige MWSt. eingegeben."; + return false; + } return true; } @@ -203,7 +212,7 @@ class wawi_bestelldetail extends basis_db return false; $mwst = ($this->mwst == '' ? '0':$this->mwst); - + $this->mwst = $mwst; if($this->new) { // insert diff --git a/include/wawi_rechnung.class.php b/include/wawi_rechnung.class.php index 5b5dba794..9ac9662d1 100644 --- a/include/wawi_rechnung.class.php +++ b/include/wawi_rechnung.class.php @@ -419,6 +419,18 @@ class wawi_rechnung extends basis_db */ public function save_betrag() { + if(!is_numeric($this->betrag)) + { + $this->errormsg = "Ungültiger Betrag."; + return false; + } + + if(!is_numeric($this->mwst)) + { + $this->errormsg = "Ungültiger Betrag."; + return false; + } + if($this->new) { $qry = 'BEGIN;INSERT INTO wawi.tbl_rechnungsbetrag(rechnung_id, mwst, betrag, bezeichnung) VALUES('. @@ -449,6 +461,7 @@ class wawi_rechnung extends basis_db { $this->rechnugnsbetrag_id=$row->id;+ $this->db_query('COMMIT;'); + return true; } else { diff --git a/system/vorlage_zip/diplomaSupp.odt b/system/vorlage_zip/diplomaSupp.odt new file mode 100755 index 000000000..8864962a4 Binary files /dev/null and b/system/vorlage_zip/diplomaSupp.odt differ diff --git a/wawi/bestellung.php b/wawi/bestellung.php index 302529f31..15929bf69 100644 --- a/wawi/bestellung.php +++ b/wawi/bestellung.php @@ -886,7 +886,7 @@ if($_GET['method']=='update') { // Update auf Bestellung $date = new datum(); - + $error = false; $save = false; $bestellung_id = $_GET['bestellung']; $bestellung_old = new wawi_bestellung(); @@ -1048,7 +1048,10 @@ if($_GET['method']=='update') $bestell_detail->new = true; } if(!$bestell_detail->save()) - echo $bestell_detail->errormsg; + { + echo ''.$bestell_detail->errormsg.''; + $error = true; + } } for($i=0; $i<$aufteilung_anzahl; $i++) @@ -1075,11 +1078,12 @@ if($_GET['method']=='update') } $aufteilung->saveAufteilung(); } - if($bestellung_new->save()) - { - $ausgabemsg.='Bestellung wurde erfolgreich gespeichert!
'; - $save = true; - } + if($error == false) + if($bestellung_new->save()) + { + $ausgabemsg.='Bestellung wurde erfolgreich gespeichert!
'; + $save = true; + } } } // Bestellung freigeben wird in gang gesetzt --> durch Abschick Button @@ -2021,8 +2025,8 @@ if($_GET['method']=='update') function checkNewRow(id, bestellung_id) { var betrag=""; + betrag = $("#preisprove_"+id).val(); - // Wenn der betrag nicht leer ist, // und die letzte reihe ist, // dann eine neue Zeile hinzufuegen @@ -2037,7 +2041,8 @@ if($_GET['method']=='update') document.getElementById("detail_anz").value = parseFloat(test) +1; hideTags2(); }); - } + } + return false; } @@ -2064,7 +2069,7 @@ if($_GET['method']=='update') function(data){ if(isNaN(data)) { - alert("Fehler:"+data); + alert("Ungültiger Preis eingetragen."); } }); } @@ -2078,7 +2083,7 @@ if($_GET['method']=='update') } else { - alert("Fehler:"+data); + alert("Ungültiger Preis eingetragen"); } }); } diff --git a/wawi/rechnung.php b/wawi/rechnung.php index fc36073e9..c71371e49 100644 --- a/wawi/rechnung.php +++ b/wawi/rechnung.php @@ -447,7 +447,7 @@ elseif($aktion == 'save') if(isset($_POST['transfer_datum']) && $rechte->isBerechtigt('wawi/rechnung_transfer', null, 'suid')) $rechnung->transfer_datum = $date->formatDatum($_POST['transfer_datum']); - + if($rechnung->save()) { foreach($betraege as $row) @@ -476,9 +476,10 @@ elseif($aktion == 'save') $rb->new=false; $rb->save_betrag(); + } } - + $ausgabemsg.='Daten wurden gespeichert!
'; $_GET['id']=$rechnung->rechnung_id; $aktion = 'update';