@@ -, +, @@ with hold ratio greater than or equal to the value entered the title with 1 item with ratio 1 nothing otherwise titles with 1 or 2 items with ratio 1 title with 1 item for ratio 2 nothing with ratio 3 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 --- circ/reserveratios.pl | 6 +++--- koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) --- a/circ/reserveratios.pl +++ a/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})] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt @@ -112,10 +112,10 @@

[% IF ( reserveloo.thisratio_atleast1 ) %] - [% IF ( CAN_user_acquisition && basketno && booksellerid ) %] - [% reserveloo.ratiocalc | html %] to order + [% IF ( CAN_user_acquisition && basketno && booksellerid ) %] + [% reserveloo.copies_to_buy | html %] to order [% ELSE %] - [% reserveloo.ratiocalc | html %] to order + [% reserveloo.copies_to_buy | html %] to order [% END %] [% IF ( reserveloo.pendingorders ) %]
[% reserveloo.pendingorders | html %] pending[% END %] [% ELSE %] @@ -142,7 +142,7 @@

Refine results:

  1. - +
  2. --