1 package Koha::Old::Checkouts;
3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # Koha is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with Koha; if not, see <http://www.gnu.org/licenses>.
21 use Koha::DateUtils qw( dt_from_string );
22 use Koha::Old::Checkout;
24 use base qw(Koha::Objects);
26 sub filter_by_todays_checkins {
29 my $dtf = Koha::Database->new->schema->storage->datetime_parser;
30 my $today = dt_from_string;
31 my $today_start = $today->clone->set( hour => 0, minute => 0, second => 0 );
32 my $today_end = $today->clone->set( hour => 23, minute => 59, second => 59 );
33 $today_start = $dtf->format_datetime( $today_start );
34 $today_end = $dtf->format_datetime( $today_end );
35 return $self->search({
48 return 'Koha::Old::Checkout';