From 8d12248e954748a7bb795b988e3bb4dc396bc23a Mon Sep 17 00:00:00 2001 From: Shi Yao Wang Date: Thu, 19 May 2022 11:05:17 -0400 Subject: [PATCH] Bug 30802: Make numReturnedItemsToShow function properly Replaced the hardcoded 20 by the value of numReturnedItemsToShow to display the right number of items in check in. Test plan: 1- Make lots of checkouts, at least like 40 (I used the batchCheckouts feature) 2- Go to Circulation > Check in 3- Return 21 items The last 20 items returned will be displayed 4- Change numReturnedItemsToShow to 50 5- Return a couple more items Only the last 20 returned items are displayed 6- Change numReturnedItemsToShow to 10 7- Return a couple more items Only the last 10 returned items are displayed 8- Apply the patch 9- Change numReturnedItemsToShow back to 20 10- Do steps 1 to 7 again, but this time step 5 returns the right amount of items Signed-off-by: Katrin Fischer Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- circ/returns.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/circ/returns.pl b/circ/returns.pl index 4ba8812888..f146325ec6 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -95,6 +95,9 @@ my $forgivemanualholdsexpire = $query->param('forgivemanualholdsexpire'); my $overduecharges = (C4::Context->preference('finesMode') && C4::Context->preference('finesMode') eq 'production'); +#set up so only the last 8 returned items display (make for faster loading pages) +my $returned_counter = ( C4::Context->preference('numReturnedItemsToShow') ) ? C4::Context->preference('numReturnedItemsToShow') : 8; + # Set up the item stack .... my %returneditems; my %riduedate; @@ -104,7 +107,7 @@ foreach ( $query->param ) { my $counter; if (/ri-(\d*)/) { $counter = $1; - if ($counter > 20) { + if ($counter > $returned_counter) { next; } } @@ -741,8 +744,6 @@ foreach my $code ( keys %$messages ) { } $template->param( errmsgloop => \@errmsgloop ); -#set up so only the last 8 returned items display (make for faster loading pages) -my $returned_counter = ( C4::Context->preference('numReturnedItemsToShow') ) ? C4::Context->preference('numReturnedItemsToShow') : 8; my $count = 0; my @riloop; my $shelflocations = -- 2.39.5