From 4e07e5894d914d57acbc0e3638bc690b77e2b31f Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 13 May 2009 12:52:28 +0000 Subject: [PATCH] =?utf8?q?Erg=C3=A4nzung=20zu=20Jans=20Bugfix:=20Nur=20die?= =?utf8?q?jenigen=20Lagerpl=C3=A4tze=20anzeigen,=20die=20positiven=20Besta?= =?utf8?q?nd=20haben.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DO.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SL/DO.pm b/SL/DO.pm index cdb11b1aa..50905ec01 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -895,11 +895,11 @@ sub get_item_availability { FROM inventory i LEFT JOIN warehouse w ON (i.warehouse_id = w.id) LEFT JOIN bin b ON (i.bin_id = b.id) - WHERE (i.parts_id IN (| . join(', ', ('?') x scalar(@parts_ids)) . qq|))| . -# AND qty > 0 # das führt zu falschen warenbeständen, wenn man über lieferschein auslagert. @mb nochmal besprechen jb 12.5.09 - qq|GROUP BY i.warehouse_id, i.bin_id, i.chargenumber, i.parts_id, w.description, b.description - ORDER BY LOWER(w.description), LOWER(b.description), LOWER(i.chargenumber)|; - + WHERE (i.parts_id IN (| . join(', ', ('?') x scalar(@parts_ids)) . qq|)) + GROUP BY i.warehouse_id, i.bin_id, i.chargenumber, i.parts_id, w.description, b.description + HAVING SUM(qty) > 0 + ORDER BY LOWER(w.description), LOWER(b.description), LOWER(i.chargenumber) +|; my $contents = selectall_hashref_query($form, $form->get_standard_dbh($myconfig), $query, @parts_ids); $main::lxdebug->leave_sub(); -- 2.20.1