Lines 18-27
package Koha::Old::Checkouts;
Link Here
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Koha::Database; |
20 |
use Koha::Database; |
|
|
21 |
use Koha::DateUtils qw( dt_from_string ); |
21 |
use Koha::Old::Checkout; |
22 |
use Koha::Old::Checkout; |
22 |
|
23 |
|
23 |
use base qw(Koha::Objects); |
24 |
use base qw(Koha::Objects); |
24 |
|
25 |
|
|
|
26 |
sub filter_by_todays_checkins { |
27 |
my ( $self ) = @_; |
28 |
|
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({ |
36 |
returndate => { |
37 |
'>=' => $today_start, |
38 |
'<=' => $today_end, |
39 |
}, |
40 |
}); |
41 |
} |
42 |
|
25 |
sub _type { |
43 |
sub _type { |
26 |
return 'OldIssue'; |
44 |
return 'OldIssue'; |
27 |
} |
45 |
} |
28 |
- |
|
|