From b62a793580292455e78dc21ca27df17e2748e95e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 13 Nov 2013 14:57:55 +0100 Subject: [PATCH] Bug 11243: make vendor list distinguish between active and canceled items On the vendor 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. Signed-off-by: Owen Leonard Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer Passes all tests and QA script. Note: In case the biblio was deleted when the order was cancelled, the number of biblios will be off. Signed-off-by: Galen Charlton --- C4/Acquisition.pm | 3 +++ .../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 c565db6e45..dbc2714733 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -635,6 +635,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 3fa12e23b2..1e90ebff06 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt @@ -116,7 +116,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 %] -- 2.39.5