diff --git a/wawi/bestellung.php b/wawi/bestellung.php index 34889e2cc..59eb8eba7 100644 --- a/wawi/bestellung.php +++ b/wawi/bestellung.php @@ -55,8 +55,7 @@ if(isset($_POST['getKonto'])) } } else - echo ""; - + echo ""; } else echo ""; @@ -79,7 +78,6 @@ if(isset($_POST['getFirma'])) { echo "\n"; } - } else { @@ -117,7 +115,6 @@ if(isset($_POST['getSearchKonto'])) foreach($konto->result as $ko) { echo '\n"; - } } else @@ -194,8 +191,7 @@ if(isset($_POST['deleteBtnStorno']) && isset($_POST['id'])) if($bestellstatus->setStorno()) echo $date->formatDatum($bestellstatus->datum, 'd.m.Y'); exit; -} - +} ?> " + row[1] + "
"; } - function conf_del() { return confirm('Diese Bestellung wirklich löschen?'); } - $(function() { $( "#datepicker_evon" ).datepicker($.datepicker.regional['de']); }); @@ -306,7 +300,6 @@ if(isset($_POST['deleteBtnStorno']) && isset($_POST['id'])) $('#firma_id').val(item[1]); }); }); - @@ -318,15 +311,12 @@ $user=get_uid(); $berechtigung_kurzbz='wawi/bestellung'; $rechte = new benutzerberechtigung(); $rechte->getBerechtigungen($user); - $kst=new wawi_kostenstelle(); $kst->loadArray($rechte->getKostenstelle($berechtigung_kurzbz)); - if (isset($_GET['method'])) $aktion = $_GET['method']; - - + if($aktion == 'suche') { if(!isset($_POST['submit'])) @@ -353,7 +343,6 @@ if($aktion == 'suche') { $suchdatum="01.09.".$datum['year']; } - echo "

Bestellung suchen

\n"; echo "
\n"; echo "\n"; @@ -476,6 +465,8 @@ if($aktion == 'suche') // Filter firma oder firma id werden angezeigt if($bestellung->getAllSearch($bestellnummer, $titel, $evon, $ebis, $bvon, $bbis, $firma_id, $oe_kurzbz, $filter_konto, $mitarbeiter_uid, $rechnung, $filter_firma)) { + $brutto = 0; + $gesamtpreis =0; $firma = new firma(); $date = new datum(); @@ -495,16 +486,17 @@ if($aktion == 'suche') foreach($bestellung->result as $row) { $brutto = $bestellung->getBrutto($row->bestellung_id); + $gesamtpreis +=$brutto; + $firmenname = ''; if(is_numeric($row->firma_id)) { $firma->load($row->firma_id); $firmenname = $firma->name; } - //Zeilen der Tabelle ausgeben echo "\n"; - echo ""; echo '\n"; echo '\n"; echo '\n"; @@ -514,10 +506,10 @@ if($aktion == 'suche') echo '\n"; echo '\n"; - echo "\n"; - + echo "\n"; } - echo "
bestellung_id\" title=\"Bearbeiten\"> bestellung_id\" onclick='return conf_del()' title='Löschen'> "; + echo " bestellung_id\" title=\"Bearbeiten\"> bestellung_id\" onclick='return conf_del()' title='Löschen'> bestellung_id\" title=\"Neue Rechnung\"> '.$row->bestell_nr."'.$row->bestellung_id."'.$firmenname."'.$row->titel."'.$row->updateamum.' '.$row->updatevon ."
\n"; + echo "\n"; + echo "Summe:".number_format($gesamtpreis,2)." €\n"; } else echo $bestellung->errormsg; @@ -531,7 +523,6 @@ if($aktion == 'suche') if(!$rechte->isberechtigt('wawi/bestellung',null, 'sui')) die('Sie haben keine Berechtigung zum Anlegen von Bestellungen'); - echo "

Neue Bestellung

"; echo "\n"; echo "\n"; @@ -570,7 +561,6 @@ if($aktion == 'suche') if(isset($_POST)) { // Die Bestellung wird gespeichert und die neue id zurückgegeben - var_dump($_POST); if(!$rechte->isberechtigt('wawi/bestellung',null, 'sui')) die('Sie haben keine Berechtigung zum Suchen von Bestellungen'); @@ -593,7 +583,6 @@ if($aktion == 'suche') $newBestellung->insertvon = $user; $newBestellung->updateamum = date('Y-m-d H:i:s'); $newBestellung->updatevon = $user; - $newBestellung->new = true; $newBestellung->freigegeben = false; @@ -615,7 +604,6 @@ if($aktion == 'suche') $id = (isset($_GET['id'])?$_GET['id']:null); $bestellung = new wawi_bestellung(); - if($bestellung->delete($id)) { echo 'Bestellung erfolgreich gelöscht.
'; @@ -656,8 +644,6 @@ if($aktion == 'suche') $status= new wawi_bestellstatus(); $bestell_tag = new wawi_tags(); - - $summe= 0; $konto_vorhanden = false; @@ -723,7 +709,6 @@ if($aktion == 'suche') echo '\n"; } echo "\n"; - echo "
Rechnungsadresse:\n"; - echo ' '; - echo "\n"; echo "

"; + // div Aufteilung --> kann ein und ausgeblendet werden - - echo "Aufteilung\n"; - + echo "
"; echo "
\n"; echo ""; echo "\n"; @@ -990,8 +962,6 @@ if($aktion == 'suche') $disabled =''; if($status->isStatiVorhanden($bestellung->bestellung_id, 'Storno') ) $disabled ='disabled'; - - } else { @@ -1036,7 +1006,6 @@ if($aktion == 'suche') $bestell_detail->updateamum = date('Y-m-d H:i:s'); $bestell_detail->updatevon = $user; $bestell_detail->new = false; - } else { @@ -1062,22 +1031,16 @@ if($aktion == 'suche') { echo $bestell_detail->errormsg; } - } if($bestellung_new->save()) { echo "erfolgreich gespeichert.

"; } - echo " Zurück zur Bestellung "; - - - + echo " Zurück zur Bestellung "; } } - - - + function getDetailRow($i, $bestelldetail_id='', $menge='', $ve='', $beschreibung='', $artikelnr='', $preisprove='', $mwst='', $brutto='') { echo "\n"; @@ -1090,7 +1053,7 @@ if($aktion == 'suche') echo "\n"; echo "\n"; echo "\n"; -/* $detail_tag = new wawi_tags(); + /* $detail_tag = new wawi_tags(); $detail_tag->GetTagsByBesteldetail($bestelldetail_id); $help = $detail_tag->GetStringTags(); */ echo ""; diff --git a/wawi/wawi_autocomplete.php b/wawi/wawi_autocomplete.php index f203670d5..5b9cd07b9 100644 --- a/wawi/wawi_autocomplete.php +++ b/wawi/wawi_autocomplete.php @@ -345,7 +345,7 @@ cellSeparator (default value: "|") $tags = new wawi_tags(); - if (!$tags->GetTagsByBestellung($bestell_id)) + if (!$tags->getAll()) exit($tags->errormsg."\n"); for ($i=0;$iresult);$i++)