Bugzilla – Attachment 93670 Details for
Bug 15422
Number of items to order on holds ratio report will not fulfill the holds ratio
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15422: Correct calculation of holds ratio report
Bug-15422-Correct-calculation-of-holds-ratio-repor.patch (text/plain), 2.66 KB, created by
Katrin Fischer
on 2019-10-04 07:53:58 UTC
(
hide
)
Description:
Bug 15422: Correct calculation of holds ratio report
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-10-04 07:53:58 UTC
Size:
2.66 KB
patch
obsolete
>From 546cd0df20faa88d23cb27f8ea4771dcce7a9deb Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 29 Nov 2018 02:07:18 +0000 >Subject: [PATCH] Bug 15422: Correct calculation of holds ratio report > >See comment 1 for a detailed explanation of current calculations and >needed calculations > >Also removes an unnecessary variable > >To test: > 1 - Place 4 holds on a biblio with one item > 2 - go to /cgi-bin/koha/circ/reserveratios.pl (Circulation->Holds > ratios) > 3 - Run with 'Hold ratio'=3, it says order 1, ok > 4 - Run with HR=4, it says order 1, wrong > 5 - Run with HR=2, it syas order 2, wrong > 6 - Run with HR=.5, it syas order 4, wrong > 7 - Apply patch > 8 - Run with HR=3, order 1, OK > 9 - Run with HR=4, item does not appear (0 to order), OK >10 - Run with HR=2, order 1, OK >11 - Run with HR=.5, order 7, OK > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > circ/reserveratios.pl | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > >diff --git a/circ/reserveratios.pl b/circ/reserveratios.pl >index ae9cf1863f..1beb559217 100755 >--- a/circ/reserveratios.pl >+++ b/circ/reserveratios.pl >@@ -151,12 +151,11 @@ $template->param(sql => $strsth); > my $sth = $dbh->prepare($strsth); > $sth->execute(@query_params); > >-my $ratio_atleast1 = ($ratio >= 1) ? 1 : 0; > my @reservedata; > while ( my $data = $sth->fetchrow_hashref ) { > my $thisratio = $data->{reservecount} / $data->{itemcount}; >- my $ratiocalc = ($thisratio / $ratio); >- ($thisratio / $ratio) >= 1 or next; # TODO: tighter targeting -- get ratio limit into SQL using HAVING clause >+ my $ratiocalc = $data->{reservecount}/$ratio - $data->{itemcount}; >+ $ratiocalc >= 1 or next; # TODO: tighter targeting -- get ratio limit into SQL using HAVING clause > push( > @reservedata, > { >@@ -180,7 +179,7 @@ while ( my $data = $sth->fetchrow_hashref ) { > itype => [split('\|', $data->{l_itype})], > reservecount => $data->{reservecount}, > itemcount => $data->{itemcount}, >- ratiocalc => sprintf( "%.0d", $ratio_atleast1 ? ( $thisratio / $ratio ) : $thisratio ), >+ ratiocalc => sprintf( "%.0d", $ratiocalc ), > thisratio => sprintf( "%.2f", $thisratio ), > thisratio_atleast1 => ( $thisratio >= 1 ) ? 1 : 0, > listcall => [split('\|', $data->{listcall})] >@@ -194,7 +193,6 @@ for my $rd ( @reservedata ) { > } > > $template->param( >- ratio_atleast1 => $ratio_atleast1, > todaysdate => $todaysdate, > from => $startdate, > to => $enddate, >-- >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 15422
:
82718
|
82842
|
82873
|
82874
|
92145
|
92146
| 93670 |
93671