From 36db911da09f83131f82db6f8ed50ec1ad2f0029 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 14 Dec 2017 07:03:39 -0500 Subject: [PATCH] Bug 19812: Fix confusing holds count values in "Already received" table In acqui/parcel.pl both the "Pending orders" and "Already received" tables show how many holds there are for the given record. However, the count of holds in the "Pending orders" table confuses librarians because it only lists holds for the particular items in the orderline. Due to that, the holds column may show 0 holds even if there are a dozen record level holds for that bib! This is not what librarians seem to expect, instead it seems that the same total holds in the "Pending orders" table would be preferred. Test Plan: 1) Find an invoice with an item in the "Already received" table 2) Add one or more record level holds to the record 3) Note the holds column does not count those holds 4) Apply this patch 5) Note the holds column now shows total holds and holds for just those ordered items Signed-off-by: Kyle M Hall Signed-off-by: Nancy Keener Signed-off-by: Marcel de Rooy Bug 19812: (QA follow-up) Swap sides for total and item holds Bug 19812: (QA follow-up) If 0 holds show '0' not '0 / 0' Bug 19812: (QA follow-up) Remove unnecessary line Signed-off-by: Jonathan Druart --- acqui/parcel.pl | 4 ++-- .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/acqui/parcel.pl b/acqui/parcel.pl index 5bec6f1324..ec7332dfe9 100755 --- a/acqui/parcel.pl +++ b/acqui/parcel.pl @@ -138,10 +138,10 @@ for my $order ( @orders ) { my %line = %{ $order }; $line{invoice} = $invoice->{invoicenumber}; - $line{holds} = 0; my @itemnumbers = GetItemnumbersFromOrder( $order->{ordernumber} ); my $biblio = Koha::Biblios->find( $line{biblionumber} ); - $line{holds} = $biblio ? $biblio->current_holds->search( + $line{total_holds} = $biblio ? $biblio->holds->count : 0; + $line{item_holds} = $biblio ? $biblio->current_holds->search( { itemnumber => { -in => \@itemnumbers }, } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt index 2790d5a849..863dbd2eb3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -219,7 +219,7 @@ Basket Basket group Order line - Holds + Holds Summary View record Quantity @@ -281,8 +281,14 @@ [% END %] - [% IF order.holds > 0 %] - [% order.holds %] + [% IF order.total_holds > 0 %] + [% IF order.item_holds > 0 %] + [% order.item_holds %] + [% ELSE %] + 0 + [% END %] + / + [% order.total_holds %] [% ELSE %] 0 [% END %] -- 2.39.5