diff --git a/circ/circulation.pl b/circ/circulation.pl index c7d42bb708..8441cc2c4f 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -362,19 +362,17 @@ if (@$barcodes) { } if ( $issuingimpossible->{'STATS'} ) { - $template->param( STATS => 1 ); + my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ) = + AddReturn( $item->barcode, C4::Context->userenv->{'branch'}, undef, undef, 1 ); - if ( $item->onloan ) { - my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ) = - AddReturn( $item->barcode, C4::Context->userenv->{'branch'}, undef, undef, 1 ); + $template->param( + STATS => 1, + CHECKEDIN => $stats_return, + MESSAGES => $stats_messages, + ITEM => $stats_iteminformation, + BORROWER => $stats_borrower, + ); - $template->param( - CHECKEDIN => $stats_return, - MESSAGES => $stats_messages, - ITEM => $stats_iteminformation, - BORROWER => $stats_borrower, - ); - } } # Fix for bug 7494: optional checkout-time fallback search for a book