This commit is contained in:
Karl Burkhart
2010-11-24 16:15:32 +00:00
parent f814c5dc5a
commit ccafb55939
3 changed files with 191 additions and 3 deletions
+134
View File
@@ -0,0 +1,134 @@
<?php
/* Copyright (C) 2010 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Karl Burkhart <burkhart@technikum-wien.at>.
*/
/**
* Klasse WaWi Aufteilung
*/
require_once(dirname(__FILE__).'/basis_db.class.php');
class wawi_aufteilung extends basis_db
{
public $new; // bool
public $result = array(); // Aufteilungsobjekt array
public $aufteilung_id; // integer
public $kostenstelle_id; // integer
public $oe_kurzbz; // char
public $anteil; // float(5,2)
public $insertamum; // timestamp
public $insertvon; // char
public $updateamum; // timestamp
public $upatevon; // char
/**
*
* Enter description here ...
* @param unknown_type $aufteilung_id
*/
public function __construct($aufteilung_id=null)
{
parent::__construct();
if(!is_null($konto_id))
$this->load($konto_id);
}
/**
*
* Gibt die Aufteilung der übergebenen id zurück
* @param $aufteilung_id
*/
public function load($aufteilung_id)
{
if(!is_numeric($aufteilung_id))
{
$this->errormsg = "Ungültige aufteilung_id.";
return false;
}
$qry = "SELECT * FROM wawi.tbl_aufteilung_default WHERE aufteilung_id =".$aufteilung_id.';';
if($this->db_query($qry))
{
if($row = $this->db_fetch_object())
{
$this->aufteilung_id = $row->aufteilung_id;
$this->kostenstelle_id = $row->kostenstelle_id;
$this->oe_kurzbz = $row->oe_kurzbz;
$this->anteil = $row->anteil;
$this->insertamum = $row->insertamum;
$this->insertvon = $row->insertvon;
$this->updateamum = $row->updateamum;
$this->updatevon = $row->updatevon;
}
return true;
}
else
{
$this->errormsg = "Fehler bei der Abfrage aufgetreten.";
return false;
}
}
/**
*
* Gibt alle Aufteilungen zurück
*/
public function getAll()
{
$qry = "SELECT *`FROM wawi.tbl_aufteilung_default;";
if($this->db_query($qry))
{
if($row = $this->db_fetch_object())
{
$aufteilung = new wawi_aufteilung();
$aufteilung->aufteilung_id = $row->aufteilung_id;
$aufteilung->kostenstelle_id = $row->kostenstelle_id;
$aufteilung->oe_kurzbz = $row->oe_kurzbz;
$aufteilung->anteil = $row->anteil;
$aufteilung->insertamum = $row->insertamum;
$aufteilung->insertvon = $row->insertvon;
$aufteilung->updateamum = $row->upateamum;
$aufteilung->updatevon = $row->updatevon;
$this->result[] = $aufteilung;
}
return true;
}
else
{
$this->errormsg = "Fehler bei der Abfrage aufgetreten.";
return false;
}
}
public function getAufteilungFromKostenstelle($kostenstelle_id)
{
}
}
+44 -1
View File
@@ -288,8 +288,51 @@ class wawi_bestelldetail extends basis_db
return false;
}
return $this->bestelldetail_id;
}
public function getAllDetailsFromBestellung($bestell_id)
{
if(!is_numeric($bestell_id))
{
$this->errormsg ='Keine gültige Bestell ID.';
return false;
}
$qry = "SELECT * from wawi.tbl_bestelldetail as detail
where
detail.bestellung_id = ".$bestell_id.";";
if($this->db_query($qry))
{
while($row = $this->db_fetch_object())
{
$detail = new wawi_bestelldetail();
$detail->bestelldetail_id = $row->bestelldetail_id;
$detail->bestellung_id = $row->bestellung_id;
$detail->positoin = $row->position;
$detail->menge = $row->menge;
$detail->verpackungseinheit = $row->verpackungseinheit;
$detail->beschreibung = $row->beschreibung;
$detail->artikelnummer = $row->artikelnummer;
$detail->preisprove = $row->preisprove;
$detail->mwst = $row->mwst;
$detail->erhalten = $row->erhalten;
$detail->sort = $row->sort;
$detail->text = $row->text;
$detail->insertamum = $row->insertamum;
$detail->insertvon = $row->insertvon;
$detail->updateamum = $row->updateamum;
$detail->updatevon = $row->updatevon;
$this->result[] = $detail;
}
return true;
}
else
{
$this->errormsg = "Fehler bei der Abfrage.";
return false;
}
}
}
+13 -2
View File
@@ -86,7 +86,7 @@ class wawi_bestellung extends basis_db
if($row = $this->db_fetch_object())
{
$this->bestellung_id = $row->bestellung_id;
$this->besteller_uid = $row->besteller_id;
$this->besteller_uid = $row->besteller_uid;
$this->kostenstelle_id = $row->kostenstelle_id;
$this->konto_id = $row->konto_id;
$this->firma_id = $row->firma_id;
@@ -167,7 +167,7 @@ class wawi_bestellung extends basis_db
* @param $mitarbeiter_uid
* @param $rechnung
*/
public function getAllSearch($bestellnr, $titel, $evon, $ebis, $bvon, $bbis, $firma_id, $oe_kurzbz, $konto_id, $mitarbeiter_uid, $rechnung )
public function getAllSearch($bestellnr, $titel, $evon, $ebis, $bvon, $bbis, $firma_id, $oe_kurzbz, $konto_id, $mitarbeiter_uid, $rechnung, $filter_firma)
{
$first = true;
$qry = "SELECT distinct on (bestellung.bestellung_id) *, status.updateamum as update, bestellung.updatevon as update_von, bestellung.insertamum as insert, bestellung.insertvon as insert_von
@@ -255,6 +255,17 @@ class wawi_bestellung extends basis_db
$qry.= ' and ';
$qry.= ' bestellung.firma_id = '.$this->addslashes($firma_id);
}
if ($filter_firma != '')
{
if($first == true)
{
$qry.= 'where ';
$first = false;
}
else
$qry.= ' or ';
$qry.= ' bestellung.firma_id = '.$this->addslashes($filter_firma);
}
if ($oe_kurzbz != '')
{
if($first == true)