Bugzilla – Attachment 105907 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.02 KB, created by
Jonathan Druart
on 2020-06-16 11:53:44 UTC
(
hide
)
Description:
Bug 25760: (bug 15422 follow-up) Display record with hold ratio == 1
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-06-16 11:53:44 UTC
Size:
2.02 KB
patch
obsolete
>From c8665d794a20948aec59ea200be75e137369811f 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 >--- > circ/reserveratios.pl | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/circ/reserveratios.pl b/circ/reserveratios.pl >index 77117934d0..e34d1ab445 100755 >--- a/circ/reserveratios.pl >+++ b/circ/reserveratios.pl >@@ -158,8 +158,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, > { >@@ -183,7 +183,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.20.1
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