From 5d373a55f4aa185c7e86aa3d3b14cb689c31e849 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 3 Nov 2023 11:58:30 -0400 Subject: [PATCH] Bug 34938: (QA follow-up) Tidy code Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- circ/reserveratios.pl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/circ/reserveratios.pl b/circ/reserveratios.pl index 5a20c768e2..3152855639 100755 --- a/circ/reserveratios.pl +++ b/circ/reserveratios.pl @@ -151,9 +151,9 @@ $sth->execute(@query_params); my @reservedata; while ( my $data = $sth->fetchrow_hashref ) { - my $thisratio = $data->{reservecount} / $data->{itemcount}; - 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 + my $thisratio = $data->{reservecount} / $data->{itemcount}; + 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, { @@ -169,19 +169,19 @@ while ( my $data = $sth->fetchrow_hashref ) { itemnum => $data->{itemnumber}, biblionumber => $data->{biblionumber}, holdingbranch => $data->{holdingbranch}, - homebranch_list => [split('\|', $data->{homebranch_list})], - holdingbranch_list => [split('\|', $data->{holdingbranch_list})], + homebranch_list => [ split( '\|', $data->{homebranch_list} ) ], + holdingbranch_list => [ split( '\|', $data->{holdingbranch_list} ) ], branch => $data->{branch}, itemcallnumber => $data->{itemcallnumber}, - location => [split('\|', $data->{l_location})], - itype => [split('\|', $data->{l_itype})], - ccode => [split('\|', $data->{l_ccode})], + location => [ split( '\|', $data->{l_location} ) ], + itype => [ split( '\|', $data->{l_itype} ) ], + ccode => [ split( '\|', $data->{l_ccode} ) ], reservecount => $data->{reservecount}, itemcount => $data->{itemcount}, copies_to_buy => sprintf( "%d", $copies_to_buy ), - thisratio => sprintf( "%.2f", $thisratio ), + thisratio => sprintf( "%.2f", $thisratio ), thisratio_atleast1 => ( $thisratio >= 1 ) ? 1 : 0, - listcall => [split('\|', $data->{listcall})] + listcall => [ split( '\|', $data->{listcall} ) ] } ); } -- 2.39.5