Bugfix bei Datumsabfrageb

This commit is contained in:
Andreas Österreicher
2011-08-31 13:31:08 +00:00
parent a5899f61c8
commit cc96e40439
6 changed files with 11 additions and 10 deletions
+2 -1
View File
@@ -147,7 +147,8 @@ class geschaeftsjahr extends basis_db
*/
public function getakt()
{
$qry = "SELECT geschaeftsjahr_kurzbz FROM public.tbl_geschaeftsjahr WHERE start <= now() AND ende >= now()";
$qry = "SELECT geschaeftsjahr_kurzbz FROM public.tbl_geschaeftsjahr WHERE start <= CURRENT_DATE
AND ende >= CURRENT_DATE";
if(!$this->db_query($qry))
{
+2 -2
View File
@@ -202,10 +202,10 @@ class wawi_bestellung extends basis_db
$qry.= " AND UPPER(bestellung.titel) LIKE UPPER('%".addslashes($titel)."%')";
if ($evon != '')
$qry.= ' AND bestellung.insertamum > date('.$this->addslashes($evon).')';
$qry.= ' AND bestellung.insertamum::date >= date('.$this->addslashes($evon).')';
if ($ebis != '')
$qry.= ' AND bestellung.insertamum < '.$this->addslashes($ebis);
$qry.= ' AND bestellung.insertamum::date <= '.$this->addslashes($ebis);
if ($bvon != '')
$qry.= " AND status.bestellstatus_kurzbz = 'Bestellung' and status.datum > ".$this->addslashes($bvon);
+2 -2
View File
@@ -157,10 +157,10 @@ class wawi_rechnung extends basis_db
$qry.= ' AND tbl_rechnung.buchungsdatum <= '.$this->addslashes($buchungsdatum_bis);
if ($erstelldatum_von != '')
$qry.= ' AND tbl_bestellung.insertamum >= '.$this->addslashes($erstelldatum_von);
$qry.= ' AND tbl_bestellung.insertamum::date >= '.$this->addslashes($erstelldatum_von);
if ($erstelldatum_bis != '')
$qry.= ' AND tbl_bestellung.insertamum <= '.$this->addslashes($erstelldatum_bis);
$qry.= ' AND tbl_bestellung.insertamum::date <= '.$this->addslashes($erstelldatum_bis);
if ($bestelldatum_von != '')
$qry.= " AND status.bestellstatus_kurzbz = 'Bestellung' AND status.datum >= ".$this->addslashes($bestelldatum_von);
+1 -1
View File
@@ -140,7 +140,7 @@ if(isset($_POST['show']))
JOIN wawi.tbl_rechnung USING(bestellung_id)
JOIN wawi.tbl_rechnungsbetrag USING(rechnung_id)
WHERE
tbl_bestellung.insertamum>='$gj->start' AND tbl_bestellung.insertamum<'$gj->ende'
tbl_bestellung.insertamum::date>='$gj->start' AND tbl_bestellung.insertamum::date<='$gj->ende'
AND kostenstelle_id IN ($kstIN)
order by beschreibung
";
+2 -2
View File
@@ -159,7 +159,7 @@ $datum_obj = new datum();
wawi.tbl_bestellung
JOIN wawi.tbl_bestelldetail USING(bestellung_id)
WHERE
tbl_bestellung.insertamum>='".addslashes($vondatum)."' AND tbl_bestellung.insertamum<'".addslashes($endedatum)."'
tbl_bestellung.insertamum::date>='".addslashes($vondatum)."' AND tbl_bestellung.insertamum::date<='".addslashes($endedatum)."'
AND kostenstelle_id IN($kstIN)
GROUP BY kostenstelle_id
UNION
@@ -172,7 +172,7 @@ $datum_obj = new datum();
JOIN wawi.tbl_rechnung USING(bestellung_id)
JOIN wawi.tbl_rechnungsbetrag USING(rechnung_id)
WHERE
tbl_bestellung.insertamum>='".addslashes($vondatum)."' AND tbl_bestellung.insertamum<'".addslashes($endedatum)."'
tbl_bestellung.insertamum::date>='".addslashes($vondatum)."' AND tbl_bestellung.insertamum::date<='".addslashes($endedatum)."'
AND kostenstelle_id IN($kstIN)
GROUP BY kostenstelle_id
";
+2 -2
View File
@@ -93,7 +93,7 @@ if(isset($_POST['show']))
wawi.tbl_bestellung
JOIN wawi.tbl_bestelldetail USING(bestellung_id)
WHERE
tbl_bestellung.insertamum>='$gj->start' AND tbl_bestellung.insertamum<='$gj->ende'
tbl_bestellung.insertamum::date>='$gj->start' AND tbl_bestellung.insertamum::date<='$gj->ende'
AND
(
bestellung_id in (SELECT bestellung_id FROM wawi.tbl_bestellungtag WHERE bestellung_id=tbl_bestellung.bestellung_id)
@@ -148,7 +148,7 @@ if(isset($_POST['show']))
JOIN wawi.tbl_rechnung USING(bestellung_id)
JOIN wawi.tbl_rechnungsbetrag USING(rechnung_id)
WHERE
tbl_bestellung.insertamum>='$gj->start' AND tbl_bestellung.insertamum<'$gj->ende'
tbl_bestellung.insertamum::date>='$gj->start' AND tbl_bestellung.insertamum::date<='$gj->ende'
AND bestellung_id in (SELECT bestellung_id FROM wawi.tbl_bestellungtag WHERE bestellung_id=tbl_bestellung.bestellung_id)
AND kostenstelle_id IN ($kstIN)
";