diff --git a/include/wawi_bestellung.class.php b/include/wawi_bestellung.class.php index fc50cb4b7..312002285 100644 --- a/include/wawi_bestellung.class.php +++ b/include/wawi_bestellung.class.php @@ -903,8 +903,8 @@ class wawi_bestellung extends basis_db left join wawi.tbl_bestellung_bestellstatus as s using (bestellung_id) where b.bestellung_id not in - (SELECT bestellung_id FROM wawi.tbl_bestellung_bestellstatus where bestellung_id=b.bestellung_id AND bestellstatus_kurzbz ='Bestellung') and bestellstatus_kurzbz = ('Abgeschickt') - and b.bestellung_id = b.bestellung_id and b.insertamum < CURRENT_DATE - '".$min." week'::interval AND b.insertamum > CURRENT_DATE - '".$max." week'::interval + (SELECT bestellung_id FROM wawi.tbl_bestellung_bestellstatus where bestellung_id=b.bestellung_id AND bestellstatus_kurzbz ='Bestellung') and (bestellstatus_kurzbz = ('Abgeschickt') OR bestellstatus_kurzbz = ('Freigegeben')) + and b.bestellung_id = b.bestellung_id and b.insertamum <= CURRENT_DATE - '".$min." week'::interval AND b.insertamum > CURRENT_DATE - '".$max." week'::interval ) order by bestellung_id";