Bugzilla – Attachment 110063 Details for
Bug 25760
Holds ratio report is not reporting on records with 1 hold
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25760: (bug 15422 follow-up) Display record with hold ratio == 1
Bug-25760-bug-15422-follow-up-Display-record-with-.patch (text/plain), 2.08 KB, created by
ByWater Sandboxes
on 2020-09-14 15:09:11 UTC
(
hide
)
Description:
Bug 25760: (bug 15422 follow-up) Display record with hold ratio == 1
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2020-09-14 15:09:11 UTC
Size:
2.08 KB
patch
obsolete
>From 487730311eba243ce2df77ca2310be954bc48811 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 16 Jun 2020 13:46:11 +0200 >Subject: [PATCH] Bug 25760: (bug 15422 follow-up) Display record with hold > ratio == 1 > >If the hold ratio is 1 (ie. number of holds == number of copies), we >should display it if it's the value in the filter. > >Test plan: >1. Create bibliographic records with 1, 2 and 3 items >2. Place 1 hold on each of them >3. Go to the Hold ratios report and search with ratio = 1, 2 then 3 >4. Place another hold on each of the record >5. Repeat 3 >6. Make sure there is no regression in the test plan of bug 15422 > >Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> >--- > circ/reserveratios.pl | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/circ/reserveratios.pl b/circ/reserveratios.pl >index c673e869ed..322f2b3b0f 100755 >--- a/circ/reserveratios.pl >+++ b/circ/reserveratios.pl >@@ -157,8 +157,8 @@ $sth->execute(@query_params); > my @reservedata; > while ( my $data = $sth->fetchrow_hashref ) { > my $thisratio = $data->{reservecount} / $data->{itemcount}; >- my $ratiocalc = ceil($data->{reservecount}/$ratio - $data->{itemcount}); >- $ratiocalc >= 1 or next; # TODO: tighter targeting -- get ratio limit into SQL using HAVING clause >+ my $ratiocalc = $data->{reservecount}/$ratio - $data->{itemcount}; >+ $ratiocalc >= 0 or next; # TODO: tighter targeting -- get ratio limit into SQL using HAVING clause > push( > @reservedata, > { >@@ -182,7 +182,7 @@ while ( my $data = $sth->fetchrow_hashref ) { > itype => [split('\|', $data->{l_itype})], > reservecount => $data->{reservecount}, > itemcount => $data->{itemcount}, >- ratiocalc => sprintf( "%.0d", $ratiocalc ), >+ ratiocalc => sprintf( "%d", $ratiocalc ), > thisratio => sprintf( "%.2f", $thisratio ), > thisratio_atleast1 => ( $thisratio >= 1 ) ? 1 : 0, > listcall => [split('\|', $data->{listcall})] >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25760
:
105907
|
110053
|
110062
|
110063
|
110064
|
114978
|
119324
|
119385
|
120750
|
120774