From 9fe45dfe17f93bd106b5cf18c42779b9dbaccb93 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 4 Mar 2019 16:57:26 -0300 Subject: [PATCH] Bug 22219: Remove duplicated items in inventory (when skipping waiting holds) Test plan: 0/ Do not apply this patch 1/ Place several holds on a given item 2/ Use the inventory with the "skip waiting holds" option to list this item. It will be displayed several times 3/ Apply this patch and confirm that the item is now only displayed once Signed-off-by: Pierre-Marc Thibault Signed-off-by: Josef Moravec Signed-off-by: Nick Clemens (cherry picked from commit 08ea70c109ce3432b5dd1a781d126c7353fca3da) Signed-off-by: Martin Renvoize --- C4/Items.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 606ee5199e..0c4aed9bce 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -822,9 +822,9 @@ sub GetItemsForInventory { my $max_cnsort = GetClassSort($class_source,undef,$maxlocation); my $select_columns = q{ - SELECT items.itemnumber, barcode, itemcallnumber, title, author, biblio.biblionumber, biblio.frameworkcode, datelastseen, homebranch, location, notforloan, damaged, itemlost, withdrawn, stocknumber + SELECT DISTINCT(items.itemnumber), barcode, itemcallnumber, title, author, biblio.biblionumber, biblio.frameworkcode, datelastseen, homebranch, location, notforloan, damaged, itemlost, withdrawn, stocknumber }; - my $select_count = q{SELECT COUNT(*)}; + my $select_count = q{SELECT COUNT(DISTINCT(items.itemnumber))}; my $query = q{ FROM items LEFT JOIN biblio ON items.biblionumber = biblio.biblionumber -- 2.39.5