From e54fa9a076a4d9f2d908e14f8e9010e922880c83 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 5 Mar 2021 11:44:42 +0100 Subject: [PATCH] Bug 27851: Use filter_by_todays_checkins in printslip.pl Test plan: No regression from bug 12224 test plan Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- members/printslip.pl | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/members/printslip.pl b/members/printslip.pl index c89765b65f..2d80f9c09d 100755 --- a/members/printslip.pl +++ b/members/printslip.pl @@ -84,22 +84,11 @@ if ( $print eq 'checkinslip' ) { my $checkinslip_branch = $session->param('branch') ? $session->param('branch') : $branch; # get today's checkins - my $dtf = Koha::Database->new->schema->storage->datetime_parser; - my $today = dt_from_string; - my $today_start = $today->clone->set( hour => 0, minute => 0, second => 0 ); - my $today_end = $today->clone->set( hour => 23, minute => 59, second => 0 ); - $today_start = $dtf->format_datetime( $today_start ); - $today_end = $dtf->format_datetime( $today_end ); - my @todays_checkins = $patron->old_checkouts->search({ - returndate => { - '>=' => $today_start, - '<=' => $today_end, - }, - branchcode => $checkinslip_branch, - }); + my @itemnumbers = $patron->old_checkouts->search( { branchcode => $checkinslip_branch } ) + ->filter_by_todays_checkins->get_column('itemnumber'); my %loops = ( - old_issues => [ map { $_->itemnumber } @todays_checkins ], + old_issues => \@itemnumbers, ); my $letter = C4::Letters::GetPreparedLetter( -- 2.39.5