diff --git a/wawi/bestellung.php b/wawi/bestellung.php index 9ebd67b30..656ac0804 100644 --- a/wawi/bestellung.php +++ b/wawi/bestellung.php @@ -152,6 +152,46 @@ if(isset($_POST['getDetailRow']) && isset($_POST['id'])) die('ID ungueltig'); } } + +if(isset($_POST['deleteBtnBestellt']) && isset($_POST['id'])) +{ + $date = new datum(); + + $bestellstatus = new wawi_bestellstatus(); + $bestellstatus->bestellung_id = $_POST['id']; + $bestellstatus->bestellstatus_kurzbz = 'Bestellung'; + //$bestellstatus->uid = $_POST['user']; + //$bestellstatus->oe_kurzbz = ? + $bestellstatus->datum = date('Y-m-d H:i:s'); + //$bestellstatus->insertvon = $user; + $bestellstatus->insertamum = date('Y-m-d H:i:s'); + //$bestellstatus->updatevon = $user; + $bestellstatus->updateamum = date('Y-m-d H:i:s'); + + if($bestellstatus->setBestellung()) + echo $date->formatDatum($bestellstatus->datum, 'd.m.Y'); + exit; +} + +if(isset($_POST['deleteBtnStorno']) && isset($_POST['id'])) +{ + $date = new datum(); + + $bestellstatus = new wawi_bestellstatus(); + $bestellstatus->bestellung_id = $_POST['id']; + $bestellstatus->bestellstatus_kurzbz = 'Bestellung'; + //$bestellstatus->uid = $_POST['user']; + //$bestellstatus->oe_kurzbz = ? + $bestellstatus->datum = date('Y-m-d H:i:s'); + //$bestellstatus->insertvon = $user; + $bestellstatus->insertamum = date('Y-m-d H:i:s'); + //$bestellstatus->updatevon = $user; + $bestellstatus->updateamum = date('Y-m-d H:i:s'); + + if($bestellstatus->setStorno()) + echo $date->formatDatum($bestellstatus->datum, 'd.m.Y'); + exit; +} ?> @@ -391,7 +431,7 @@ if($aktion == 'suche') else { // Suchergebnisse anzeigen - //var_dump($_POST); + var_dump($_POST); $bestellnummer = $_POST['bestellnr']; $titel = $_POST['titel']; $evon = $_POST['evon']; @@ -399,7 +439,10 @@ if($aktion == 'suche') $bvon = $_POST['bvon']; $bbis = $_POST['bbis']; $firma_id = $_POST['firma_id']; - $oe_kurzbz = $_POST['filter_oe_kurzbz']; + if($_POST['filter_oe_kurzbz'] == 'opt_auswahl') + $oe_kurzbz = ''; + else + $oe_kurzbz = $_POST['filter_oe_kurzbz']; $filter_konto = $_POST['filter_konto']; $mitarbeiter_uid = $_POST['mitarbeiter_uid']; $filter_firma = $_POST['filter_firma']; @@ -529,7 +572,7 @@ if($aktion == 'suche') $newBestellung->freigegeben = false; if (!$bestell_id = $newBestellung->save()) - echo $newBestellung->errormsg; + echo $newBestellung->errormsg; echo "Bestellung mit der ID ".$bestell_id." erfolgreich angelegt. "; echo " Link drücken "; } @@ -553,7 +596,7 @@ if($aktion == 'suche') else if($_GET['method']=='update') { $id = (isset($_GET['id'])?$_GET['id']:null); - + $bestellung = new wawi_bestellung(); $bestellung->load($id); $detail = new wawi_bestelldetail(); @@ -574,15 +617,16 @@ if($aktion == 'suche') $allStandorte->getStandorteWithTyp('Intern'); $status= new wawi_bestellstatus(); + $summe= 0; $konto_vorhanden = false; echo "

Bearbeiten

"; - echo "
\n"; + echo "\n"; echo "

Bestellnummer: ".$bestellung->bestell_nr."

"; //tabelle Bestelldetails - echo "\n"; + echo "
\n"; echo "\n"; echo "\n"; echo "\n"; @@ -656,7 +700,7 @@ if($aktion == 'suche') if(!$status->isStatiVorhanden($bestellung->bestellung_id, 'Bestellung')) { echo ""; - echo ""; + echo ""; echo ""; } else @@ -664,20 +708,19 @@ if($aktion == 'suche') echo "Bestellt am: ".$date->formatDatum($status->datum,'d.m.Y'); } - - - - - echo "\n"; echo "\n"; echo "\n"; echo"\n"; echo "
Titel:
Storniert:"; - if(!$status->isStatiVorhanden($bestellung->bestellung_id, 'Storno')) + $disabled=''; + if(!$status->isStatiVorhanden($bestellung->bestellung_id, 'Storno') ) { + if(!$status->isStatiVorhanden($bestellung->bestellung_id, 'Bestellung')) + $disabled = 'disabled'; echo ""; - echo ""; + echo ""; + echo ""; } else @@ -733,17 +776,33 @@ if($aktion == 'suche')