From e1fcab272b435b19539cf6ffc75d27ccbf086a86 Mon Sep 17 00:00:00 2001 From: Karl Burkhart Date: Wed, 2 Feb 2011 16:03:51 +0000 Subject: [PATCH] --- wawi/bestellung.php | 103 ++++++++++++++++++++++++++++---------------- 1 file changed, 66 insertions(+), 37 deletions(-) diff --git a/wawi/bestellung.php b/wawi/bestellung.php index 64dc23a57..c772ef0f8 100644 --- a/wawi/bestellung.php +++ b/wawi/bestellung.php @@ -211,6 +211,27 @@ if(isset($_POST['updateDetail'])) exit; } +if(isset($_POST['deleteBtnGeliefert']) && isset($_POST['id'])) +{ + $date = new datum(); + + $bestellstatus = new wawi_bestellstatus(); + $bestellstatus->bestellung_id = $_POST['id']; + $bestellstatus->bestellstatus_kurzbz = 'Lieferung'; + $bestellstatus->uid = $_POST['user_id']; + $bestellstatus->oe_kurzbz = ''; + $bestellstatus->datum = date('Y-m-d H:i:s'); + $bestellstatus->insertvon = $_POST['user_id']; + $bestellstatus->insertamum = date('Y-m-d H:i:s'); + $bestellstatus->updatevon = $_POST['user_id']; + $bestellstatus->updateamum = date('Y-m-d H:i:s'); + if($bestellstatus->save()) + echo $date->formatDatum($bestellstatus->datum, 'd.m.Y'); + else + echo $bestellstatus->errormsg; + exit; +} + if(isset($_POST['deleteBtnBestellt']) && isset($_POST['id'])) { $date = new datum(); @@ -1171,8 +1192,8 @@ if($aktion == 'suche') if($restBudget < 0) $alert = 'Ihr aktuelles Budget ist bereits überzogen.'; - echo "

Bearbeiten

$alert

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

Bearbeiten

$alert
"; + echo "bestellung_id\" method='post' name='editForm' id='editForm' onSubmit='document.getElementById(\"filter_kst\").disabled=false;'>\n"; echo "

Bestellnummer: ".$bestellung->bestell_nr.""; echo '

'; @@ -1186,10 +1207,10 @@ if($aktion == 'suche') echo "\n"; echo "\n"; echo "Firma: \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "Liefertermin:\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; $disabled = ''; @@ -1203,7 +1224,7 @@ if($aktion == 'suche') $selected = ''; if($ks->kostenstelle_id == $bestellung->kostenstelle_id) $selected = 'selected'; - echo "\n"; + echo "\n"; } echo "\n"; echo "Lieferadresse:\n"; @@ -1221,7 +1242,7 @@ if($aktion == 'suche') } echo "\n"; } - echo "\n"; + echo "\n"; echo "\n"; echo "Konto: \n"; echo "Rechnungsadresse:\n"; echo "\n"; echo "\n"; echo "Bemerkungen: \n"; - echo "\n"; + echo "\n"; echo "Status:\n"; echo "\n"; echo ""; @@ -1287,8 +1308,9 @@ if($aktion == 'suche') $disabled ='disabled'; } - echo ""; - + echo ""; + echo ""; + $disabled = ''; $rechte->getBerechtigungen($user); if($status->isStatiVorhanden($bestellung->bestellung_id, 'Abgeschickt')) { @@ -1296,7 +1318,7 @@ if($aktion == 'suche') } if($rechte->isberechtigt('wawi/storno',null, 'suid', $bestellung->kostenstelle_id)) { - echo ""; + echo ""; } echo"\n"; @@ -1387,7 +1409,7 @@ if($aktion == 'suche') $selected = "selected"; echo '\n"; } - echo "\n"; + echo "\n"; echo "Rest-Budget:\n"; $restBudget = sprintf('%01.2f',$restBudget); @@ -1437,7 +1459,7 @@ if($aktion == 'suche') echo ""; echo "Gesamtpreis/Brutto: € "; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -1518,6 +1540,19 @@ if($aktion == 'suche') document.editForm.filter_kst.disabled=true; }); + } + + // Status geliefert wird gesetzt + function deleteBtnGeliefert(bestellung_id) + { + $("#btn_bestellt").html(); + $.post("bestellung.php", {id: bestellung_id, user_id: uid, deleteBtnGeliefert: "true"}, + function(data){ + $("#btn_bestellt").html("Bestellt am: " +data); + document.editForm.filter_kst.disabled=true; + echo (document.editForm.geliefert.disabled); + }); + } // Status storno wird gesetzt @@ -1797,8 +1832,8 @@ if($aktion == 'suche') $aktBrutto = $bestellung->getBrutto($bestellung->bestellung_id); if($aktBrutto =='') $aktBrutto ="0"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "
Bestellschein generieren
"; echo "

"; @@ -1814,7 +1849,7 @@ if($aktion == 'suche') echo "
"; echo "
\n"; echo ""; - echo "\n"; + echo "\n"; $help = 0; $anteil = 0; $summe = 0; @@ -1840,7 +1875,7 @@ if($aktion == 'suche') if($stud->aktiv || $vorhanden) { $summe += $anteil; - echo "\n"; + echo "\n"; $help++; $anteil = 0; } @@ -1864,7 +1899,7 @@ if($aktion == 'suche') echo ""; echo "
".mb_strtoupper($stud->oe_kurzbz).": % ".mb_strtoupper($stud->oe_kurzbz).": %
"; echo "
"; - echo "

"; + echo "

"; echo ' "; - - echo ""; - echo "\n"; + echo ""; + echo ""; + echo "\n"; echo "\n"; + } \ No newline at end of file