diff --git a/wawi/bestellung.php b/wawi/bestellung.php
index 0b16f6023..30fad1845 100644
--- a/wawi/bestellung.php
+++ b/wawi/bestellung.php
@@ -26,10 +26,12 @@ require_once '../include/firma.class.php';
require_once '../include/organisationseinheit.class.php';
require_once '../include/mitarbeiter.class.php';
require_once '../include/datum.class.php';
+require_once '../include/benutzerberechtigung.class.php';
require_once '../include/wawi_konto.class.php';
require_once '../include/wawi_bestellung.class.php';
require_once '../include/wawi_kostenstelle.class.php';
-require_once '../include/benutzerberechtigung.class.php';
+require_once '../include/wawi_bestelldetails.class.php';
+
$aktion ='';
if(isset($_POST['getKonto']))
@@ -59,17 +61,35 @@ if(isset($_POST['getFirma']))
$id = $_POST['id'];
if(isset($_POST['id']))
{
- $firma = new firma();
- $firma->get_firmaorganisationseinheit(null,$id);
- if(count($firma->result)>0)
+ if($_POST['id'] == 'opt_auswahl')
{
- foreach($firma->result as $fi)
+ // anzeige aller Firmen
+ $firmaAll = new firma();
+ $firmaAll->getAll();
+
+ echo "\n";
+ foreach ($firmaAll->result as $fi)
{
- echo '\n";
+ echo "\n";
}
+
+ }
+ else
+ {
+ // anzeige der Firmen die oe zugeordnet sind
+ $firma = new firma();
+ $firma->get_firmaorganisationseinheit(null,$id);
+ if(count($firma->result)>0)
+ {
+ echo "\n";
+ foreach($firma->result as $fi)
+ {
+ echo '\n";
+ }
+ }
+ else
+ echo "";
}
- else
- echo "";
}
else
echo "";
@@ -81,17 +101,34 @@ if(isset($_POST['getSearchKonto']))
$id = $_POST['id'];
if(isset($_POST['id']))
{
- $konto = new wawi_konto();
- $konto->getKontoFromOE($id);
- if(count($konto->result)>0)
+ if($_POST['id'] == 'opt_auswahl')
{
+ $konto = new wawi_konto();
+ $konto->getAll();
+ // anzeige aller Konten
+ echo "\n";
foreach($konto->result as $ko)
{
- echo '\n";
+ echo '\n";
+
}
}
else
- echo "";
+ {
+ // anzeige aller Konten die der Kostenstelle zugeordnet sind
+ $konto = new wawi_konto();
+ $konto->getKontoFromOE($id);
+ if(count($konto->result)>0)
+ {
+ echo "\n";
+ foreach($konto->result as $ko)
+ {
+ echo '\n";
+ }
+ }
+ else
+ echo "";
+ }
}
else
echo "";
@@ -150,36 +187,7 @@ if(isset($_POST['getSearchKonto']))
function formatItem(row)
{
return row[0] + "
" + row[1] + " ";
- }
-
- $(document).ready(function()
- {
- $('#firmenname').autocomplete('wawi_autocomplete.php',
- {
- minChars:2,
- matchSubset:1,matchContains:1,
- width:500,
- formatItem:formatItem,
- extraParams:{'work':'wawi_firma_search' }
- }).result(function(event, item) {
- $('#firma_id').val(item[1]);
- });
- });
-
- $(document).ready(function()
- {
- $('#mitarbeiter_name').autocomplete('wawi_autocomplete.php',
- {
- minChars:2,
- matchSubset:1,matchContains:1,
- width:500,
- formatItem:formatItem,
- extraParams:{'work':'wawi_mitarbeiter_search' }
- }).result(function(event, item) {
- $('#mitarbeiter_uid').val(item[1]);
- });
-
- });
+ }
function conf_del()
{
@@ -187,27 +195,69 @@ if(isset($_POST['getSearchKonto']))
}
$(function() {
- $( "#datepicker" ).datepicker($.datepicker.regional['de']);
+ $( "#datepicker_evon" ).datepicker($.datepicker.regional['de']);
});
$(function() {
- $( "#datepicker1" ).datepicker($.datepicker.regional['de']);
+ $( "#datepicker_ebis" ).datepicker($.datepicker.regional['de']);
});
$(function() {
- $( "#datepicker2" ).datepicker($.datepicker.regional['de']);
+ $( "#datepicker_bvon" ).datepicker($.datepicker.regional['de']);
});
$(function() {
- $( "#datepicker3" ).datepicker($.datepicker.regional['de']);
+ $( "#datepicker_bbis" ).datepicker($.datepicker.regional['de']);
+ });
+ $(function() {
+ $( "#datepicker_liefertermin" ).datepicker($.datepicker.regional['de']);
});
$(document).ready(function()
- {
- $("#myTable").tablesorter(
- {
- sortList: [[1,0]],
- widgets: ['zebra']
- });
- }
- );
+ {
+ $("#myTable").tablesorter(
+ {
+ sortList: [[1,0]],
+ widgets: ['zebra']
+ });
+
+ $('#aufteilung_link').click(function() {
+ $('#aufteilung').toggle();
+ return false;
+ });
+
+ $('#mitarbeiter_name').autocomplete('wawi_autocomplete.php',
+ {
+ minChars:2,
+ matchSubset:1,matchContains:1,
+ width:500,
+ formatItem:formatItem,
+ extraParams:{'work':'wawi_mitarbeiter_search' }
+ }).result(function(event, item) {
+ $('#mitarbeiter_uid').val(item[1]);
+ });
+
+ $('#firmenname').autocomplete('wawi_autocomplete.php',
+ {
+ minChars:2,
+ matchSubset:1,matchContains:1,
+ width:500,
+ formatItem:formatItem,
+ extraParams:{'work':'wawi_firma_search' }
+ }).result(function(event, item) {
+ $('#firma_id').val(item[1]);
+ });
+
+ });
+ function calcLine(id)
+ {
+ var zahl =
+ (eval(document.getElementById("preisprove_"+id).value) + ((document.getElementById("preisprove_"+id).value) * (document.getElementById("mwst_"+id).value) / 100))
+ * eval(document.getElementById("menge_"+id).value);
+ document.getElementById("brutto_"+id).value = zahl.toFixed(2);
+ }
+
+ function getMwst()
+ {
+
+ }
@@ -265,16 +315,16 @@ if($aktion == 'suche')
echo "\n";
echo "
\n";
echo "| Erstelldatum | \n";
- echo "von bis | \n";
+ echo "von bis | \n";
echo "
\n";
echo "\n";
echo "| Bestelldatum | \n";
- echo "von bis | \n";
+ echo "von bis | \n";
echo "
\n";
echo "\n";
echo "| Organisationseinheit: | \n";
echo " |
\n";
echo "\n";
echo "| Konto: | \n";
- echo " |