From 4afa1ffdeed43b0aaa5e825f00c26aa24924830f Mon Sep 17 00:00:00 2001 From: Karl Burkhart Date: Thu, 17 Feb 2011 10:25:41 +0000 Subject: [PATCH] modified GetSearch: kann nach bestellpositionen gesucht werden --- include/wawi_bestellung.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/wawi_bestellung.class.php b/include/wawi_bestellung.class.php index 7fc85b359..3fac890ae 100644 --- a/include/wawi_bestellung.class.php +++ b/include/wawi_bestellung.class.php @@ -177,8 +177,11 @@ class wawi_bestellung extends basis_db * @param $filter_firma * @param $kostenstelle_id * @param $tag + * @param $zahlungstyp + * @param $tagNotExists + * @param $bestellposition */ - public function getAllSearch($bestellnr, $titel, $evon, $ebis, $bvon, $bbis, $firma_id, $oe_kurzbz, $konto_id, $mitarbeiter_uid, $rechnung, $filter_firma, $kostenstelle_id=null, $tag=null, $zahlungstyp=null, $tagNotExists=false) + public function getAllSearch($bestellnr, $titel, $evon, $ebis, $bvon, $bbis, $firma_id, $oe_kurzbz, $konto_id, $mitarbeiter_uid, $rechnung, $filter_firma, $kostenstelle_id=null, $tag=null, $zahlungstyp=null, $tagNotExists=false, $bestellposition=null) { $first = true; $qry = "SELECT distinct on (bestellung.bestellung_id) *, bestellung.updateamum as update, bestellung.updatevon as update_von, bestellung.insertamum as insert, bestellung.insertvon as insert_von @@ -243,6 +246,9 @@ class wawi_bestellung extends basis_db $qry.=' AND (NOT EXISTS (SELECT 1 FROM wawi.tbl_bestellungtag WHERE tag is not null AND bestellung_id=bestellung.bestellung_id) AND NOT EXISTS (SELECT 1 FROM wawi.tbl_bestelldetailtag JOIN wawi.tbl_bestelldetail USING(bestelldetail_id) WHERE tag is not null AND bestellung_id=bestellung.bestellung_id) )'; + if($bestellposition!='') + $qry.=" AND EXISTS (SELECT 1 FROM wawi.tbl_bestelldetail where UPPER(beschreibung) LIKE UPPER('%".addslashes($bestellposition)."%') AND bestellung_id=bestellung.bestellung_id)"; + if(!$this->db_query($qry)) { $this->errormsg = "Fehler bei der Datenbankabfrage.";