From 97f5070b4f0f7350073d8eaf807571d4f2719c3d 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 --- C4/Items.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index a4ac0e9..611c63e 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -777,9 +777,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.7.4