From d3000c0091ff77095430e9a891e91a6720b2327a Mon Sep 17 00:00:00 2001 From: Mathieu Saby Date: Thu, 10 Oct 2013 21:18:39 +0200 Subject: [PATCH] Bug 9808: Show basketgroup information in baskets list on bookseller page Content-Type: text/plain; charset="utf-8" This patch adds a column for basketgroup information in the list of basket displayed for each bookseller. To test : 1. display the list of baskets of a bookseller, with some baskets included in basketgroups, and some other not 2. check a new column "Basket group" appears 3. If the basket belongs to a basket group, the following information must be displayed in new column : "Basketgroupname (basketgroupnumber)" 4. If the basket does not belong to a basket group, the new column must be void --- C4/Acquisition.pm | 8 +++++--- .../prog/en/modules/acqui/booksellers.tt | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index ed9c215..1dca2e2 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -590,7 +590,8 @@ sub GetBasketsInfosByBookseller { my $dbh = C4::Context->dbh; my $query = qq{ SELECT aqbasket.*, - SUM(aqorders.quantity) AS total_items, + aqbasketgroups.name as basketgroupname, + SUM(aqorders.quantity) AS total_items, COUNT(DISTINCT aqorders.biblionumber) AS total_biblios, SUM( IF(aqorders.datereceived IS NULL @@ -600,9 +601,10 @@ sub GetBasketsInfosByBookseller { ) AS expected_items FROM aqbasket LEFT JOIN aqorders ON aqorders.basketno = aqbasket.basketno - WHERE booksellerid = ?}; + LEFT JOIN aqbasketgroups ON aqbasket.basketgroupid = aqbasketgroups.id + WHERE aqbasket.booksellerid = ?}; if(!$allbaskets) { - $query.=" AND (closedate IS NULL OR (aqorders.quantity > aqorders.quantityreceived AND datecancellationprinted IS NULL))"; + $query.=" AND (aqbasket.closedate IS NULL OR (aqorders.quantity > aqorders.quantityreceived AND datecancellationprinted IS NULL))"; } $query.=" GROUP BY aqbasket.basketno"; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt index 3dae586..6234d8f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt @@ -97,6 +97,7 @@ $(document).ready(function() { No. Name + Basket group Item count Biblio count Items expected @@ -115,6 +116,7 @@ $(document).ready(function() { [% END %] [% basket.basketno %] [% basket.basketname %] + [% basket.basketgroupname %] ([% basket.basketgroupid %]) [% basket.total_items %] [% basket.total_biblios %] [% basket.expected_items %] -- 1.7.9.5