From 483c12a2f4b8655691ba13c68066bff56c757967 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 13 Nov 2013 14:57:55 +0100 Subject: [PATCH] Bug 11243: Supplier list should distinct canceled items On the supplier result list, the "Item count" columns contain the sum of all items ordered for a basket. But if an order is canceled, the item count is not really meaningful. This patch just adds, in parenthesis, the number of items canceled. Test plan: - create a basket and 3 orders with different number of items - cancel 1 order - verify on the supplier list that the number of items is correct and the number of canceled items is correct too. --- C4/Acquisition.pm | 3 +++ koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index aabc0ed..a9af527 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -638,6 +638,9 @@ sub GetBasketsInfosByBookseller { my $query = qq{ SELECT aqbasket.*, SUM(aqorders.quantity) AS total_items, + SUM( + IF ( aqorders.orderstatus = 'cancelled', aqorders.quantity, 0 ) + ) AS total_items_cancelled, COUNT(DISTINCT aqorders.biblionumber) AS total_biblios, SUM( IF(aqorders.datereceived IS NULL 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..f5f044c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt @@ -115,7 +115,12 @@ $(document).ready(function() { [% END %] [% basket.basketno %] [% basket.basketname %] - [% basket.total_items %] + + [% basket.total_items %] + [% IF basket.total_items_cancelled %] + ([% basket.total_items_cancelled %] cancelled) + [% END %] + [% basket.total_biblios %] [% basket.expected_items %] -- 1.7.10.4