Bugzilla – Attachment 117837 Details for
Bug 27851
Add Koha::Old::Checkouts->filter_by_todays_checkins method
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27851: Add Koha::Old::Checkouts->filter_by_todays_checkins
Bug-27851-Add-KohaOldCheckouts-filterbytodayscheck.patch (text/plain), 1.54 KB, created by
Martin Renvoize (ashimema)
on 2021-03-05 12:16:03 UTC
(
hide
)
Description:
Bug 27851: Add Koha::Old::Checkouts->filter_by_todays_checkins
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-03-05 12:16:03 UTC
Size:
1.54 KB
patch
obsolete
>From e62fd0ae396acb3320649fc026c46d93b8991674 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 5 Mar 2021 11:43:46 +0100 >Subject: [PATCH] Bug 27851: Add > Koha::Old::Checkouts->filter_by_todays_checkins > >The logic for this code is handled at two different places (and in 2 >different ways). >Better to centralize and provide tests > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Old/Checkouts.pm | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > >diff --git a/Koha/Old/Checkouts.pm b/Koha/Old/Checkouts.pm >index af598efab1..ec8b223907 100644 >--- a/Koha/Old/Checkouts.pm >+++ b/Koha/Old/Checkouts.pm >@@ -18,10 +18,28 @@ package Koha::Old::Checkouts; > use Modern::Perl; > > use Koha::Database; >+use Koha::DateUtils qw( dt_from_string ); > use Koha::Old::Checkout; > > use base qw(Koha::Objects); > >+sub filter_by_todays_checkins { >+ my ( $self ) = @_; >+ >+ 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 => 59 ); >+ $today_start = $dtf->format_datetime( $today_start ); >+ $today_end = $dtf->format_datetime( $today_end ); >+ return $self->search({ >+ returndate => { >+ '>=' => $today_start, >+ '<=' => $today_end, >+ }, >+ }); >+} >+ > sub _type { > return 'OldIssue'; > } >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27851
:
117800
|
117801
|
117802
|
117803
|
117822
|
117823
|
117824
|
117825
|
117826
|
117827
|
117828
|
117836
| 117837 |
117838
|
117839