Bugzilla – Attachment 120750 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: [Alternate] (bug 15422 follow-up) Display record with hold ratio greater than or equal to the value entered
Bug-25760-Alternate-bug-15422-follow-up-Display-re.patch (text/plain), 5.42 KB, created by
Katrin Fischer
on 2021-05-09 15:11:52 UTC
(
hide
)
Description:
Bug 25760: [Alternate] (bug 15422 follow-up) Display record with hold ratio greater than or equal to the value entered
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2021-05-09 15:11:52 UTC
Size:
5.42 KB
patch
obsolete
>From 51c3d5358b44c5a1762878ed261e55d8c0c84288 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 8 Jan 2021 20:12:28 +0000 >Subject: [PATCH] Bug 25760: [Alternate] (bug 15422 follow-up) Display record > with hold ratio greater than or equal to the value entered > >On bug 15422 we made it so that only holds with copies to buy to acheive the holds ratio >showed > >Users have reported that they want to see record where there are 0 copies to buy i.e. >the holds ration matches the value entered > >This patch changes the criteria for returning holds to be if the ratio for a given title >is equal to or greater then the ratio specified in the form > >I also renamed 'ratiocalc' to 'copies_to_buy' since that is what is contains > >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. You expect to see: > the title with 1 item with ratio 1 > nothing otherwise >5. Place another hold on each of the record >6. Repeat 3 you expect to see: > titles with 1 or 2 items with ratio 1 > title with 1 item for ratio 2 > nothing with ratio 3 >7. Place another hold on each of the record >8. Repeat 3 you expect to see: > titles with 1 or 2 or 3 items with ratio 1 > title with 1 item or 2 items for ratio 2 > nothing with ratio 3 >9. Make sure there is no regression in the test plan of bug 15422 > >Comments from Frank Hansen: > >Some comments. >When I adding the third hold on each record in step 7, It will result in >the following result: > >titles with 1 or 2 or 3 items with ratio 1 >title with 1 items with ratio 2 because the title with 2 items will get >a ratio of 1.50 and not 2. >title with 1 items with with ratio 3 > >Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se> >Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> >--- > circ/reserveratios.pl | 6 +++--- > koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt | 8 ++++---- > 2 files changed, 7 insertions(+), 7 deletions(-) > >diff --git a/circ/reserveratios.pl b/circ/reserveratios.pl >index 47b0375387..ed57613d5a 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 $copies_to_buy = ceil($data->{reservecount}/$ratio - $data->{itemcount}); >+ $thisratio >= $ratio 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 ), >+ copies_to_buy => sprintf( "%d", $copies_to_buy ), > thisratio => sprintf( "%.2f", $thisratio ), > thisratio_atleast1 => ( $thisratio >= 1 ) ? 1 : 0, > listcall => [split('\|', $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 3d89e82fe2..6f049439ca 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt >@@ -112,10 +112,10 @@ > <td class="actions"> > <p> > [% IF ( reserveloo.thisratio_atleast1 ) %] >- [% IF ( CAN_user_acquisition && basketno && booksellerid ) %]<!-- [% reserveloo.ratiocalc | html %] --> >- <a href="/cgi-bin/koha/acqui/neworderempty.pl?biblionumber=[% reserveloo.biblionumber | uri %]&booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&rr_quantity_to_order=[% reserveloo.ratiocalc | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% reserveloo.ratiocalc | html %] to order</a> >+ [% IF ( CAN_user_acquisition && basketno && booksellerid ) %]<!-- [% reserveloo.copies_to_buy | html %] --> >+ <a href="/cgi-bin/koha/acqui/neworderempty.pl?biblionumber=[% reserveloo.biblionumber | uri %]&booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&rr_quantity_to_order=[% reserveloo.copies_to_buy | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% reserveloo.copies_to_buy | html %] to order</a> > [% ELSE %] >- <strong>[% reserveloo.ratiocalc | html %] to order</strong> >+ <strong>[% reserveloo.copies_to_buy | html %] to order</strong> > [% END %] > [% IF ( reserveloo.pendingorders ) %]<br><strong>[% reserveloo.pendingorders | html %] pending</strong>[% END %] > [% ELSE %] >@@ -142,7 +142,7 @@ > <h4>Refine results:</h4> > <ol> > <li> >- <label for="ratio">Hold ratio:</label> >+ <label for="ratio">Hold ratio (greater than or equal to):</label> > <input type="text" size="5" id="ratio" name="ratio" value="[% ratio | html %]" /> > </li> > >-- >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