From f31e39246a6a77e8e10ed89c066b1c42481541e4 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 19 Nov 2014 08:28:32 -0500 Subject: [PATCH] Bug 13299 - Add home library column to the holds ratios report It seems odd that only the holding libraries are listed on the holds ratios report, we should add the home libraries as well. Test Plan: 1) Apply this patch 2) Run the hold ratios report 3) Note the new home libraries column Signed-off-by: Heather Braum Signed-off-by: Jonathan Druart --- circ/reserveratios.pl | 45 ++++++++++--------- .../prog/en/modules/circ/reserveratios.tt | 4 +- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/circ/reserveratios.pl b/circ/reserveratios.pl index 724a4b91ff..c0e0062d6d 100755 --- a/circ/reserveratios.pl +++ b/circ/reserveratios.pl @@ -102,8 +102,10 @@ my $strsth = items.itemnumber, GROUP_CONCAT(DISTINCT items.itemcallnumber ORDER BY items.itemnumber SEPARATOR '
') as listcall, + GROUP_CONCAT(DISTINCT homebranch + ORDER BY items.itemnumber SEPARATOR '
') as homebranch_list, GROUP_CONCAT(DISTINCT holdingbranch - ORDER BY items.itemnumber SEPARATOR '
') as listbranch, + ORDER BY items.itemnumber SEPARATOR '
') as holdingbranch_list, GROUP_CONCAT(DISTINCT items.location ORDER BY items.itemnumber SEPARATOR '
') as l_location, GROUP_CONCAT(DISTINCT items.itype @@ -144,26 +146,27 @@ while ( my $data = $sth->fetchrow_hashref ) { push( @reservedata, { - reservedate => format_date( $data->{reservedate} ), - priority => $data->{priority}, - name => $data->{borrower}, - title => $data->{title}, - subtitle => $data->{subtitle}, - author => $data->{author}, - itemnum => $data->{itemnumber}, - biblionumber => $data->{biblionumber}, - holdingbranch => $data->{holdingbranch}, - listbranch => $data->{listbranch}, - branch => $data->{branch}, - itemcallnumber => $data->{itemcallnumber}, - location => $data->{l_location}, - itype => $data->{l_itype}, - reservecount => $data->{reservecount}, - itemcount => $data->{itemcount}, - ratiocalc => sprintf("%.0d", $ratio_atleast1 ? ($thisratio / $ratio) : $thisratio), - thisratio => sprintf("%.2f", $thisratio), - thisratio_atleast1 => ($thisratio >= 1) ? 1 : 0, - listcall => $data->{listcall} + reservedate => format_date( $data->{reservedate} ), + priority => $data->{priority}, + name => $data->{borrower}, + title => $data->{title}, + subtitle => $data->{subtitle}, + author => $data->{author}, + itemnum => $data->{itemnumber}, + biblionumber => $data->{biblionumber}, + holdingbranch => $data->{holdingbranch}, + homebranch_list => $data->{homebranch_list}, + holdingbranch_list => $data->{holdingbranch_list}, + branch => $data->{branch}, + itemcallnumber => $data->{itemcallnumber}, + location => $data->{l_location}, + itype => $data->{l_itype}, + reservecount => $data->{reservecount}, + itemcount => $data->{itemcount}, + ratiocalc => sprintf( "%.0d", $ratio_atleast1 ? ( $thisratio / $ratio ) : $thisratio ), + thisratio => sprintf( "%.2f", $thisratio ), + thisratio_atleast1 => ( $thisratio >= 1 ) ? 1 : 0, + listcall => $data->{listcall} } ); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt index 5583fd833c..80fe4aa82c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt @@ -55,6 +55,7 @@ Items Hold ratio Title + Home libraries Holding libraries Location Itype @@ -70,7 +71,8 @@

[% reserveloo.thisratio %]

[% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %][% reserveloo.title |html %] [% IF ( reserveloo.subtitle ) %][% FOREACH subtitl IN reserveloo.subtitle %][% subtitl.subfield %][% END %][% END %][% IF ( reserveloo.author ) %] by [% reserveloo.author %][% END %] -

[% reserveloo.listbranch %]

+

[% reserveloo.homebranch_list %]

+

[% reserveloo.holdingbranch_list %]

[% reserveloo.location %]

[% reserveloo.itype %]

[% reserveloo.listcall %]

-- 2.39.2