Bugzilla – Attachment 117818 Details for
Bug 12224
Allow easy printing of patron check-in slip
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12224: Some code improvements
Bug-12224-Some-code-improvements.patch (text/plain), 2.80 KB, created by
Katrin Fischer
on 2021-03-05 11:35:33 UTC
(
hide
)
Description:
Bug 12224: Some code improvements
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2021-03-05 11:35:33 UTC
Size:
2.80 KB
patch
obsolete
>From 9e4c8dfc504b4d7e78f7733045a632e32513fc4b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 3 Mar 2021 16:44:52 +0100 >Subject: [PATCH] Bug 12224: Some code improvements > >* Use Koha::Patrons->old_checkouts >* perltidy >* Make sure $today_start and $today_end will always be on the same day >(we never know!) > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > members/printslip.pl | 27 ++++++++++++++------------- > 1 file changed, 14 insertions(+), 13 deletions(-) > >diff --git a/members/printslip.pl b/members/printslip.pl >index da6ed8130f..c89765b65f 100755 >--- a/members/printslip.pl >+++ b/members/printslip.pl >@@ -84,16 +84,17 @@ if ( $print eq 'checkinslip' ) { > my $checkinslip_branch = $session->param('branch') ? $session->param('branch') : $branch; > > # get today's checkins >- my $today_start = dt_from_string->set( hour => 0, minute => 0, second => 0 ); >- my $today_end = dt_from_string->set( hour => 23, minute => 59, second => 0 ); >- $today_start = Koha::Database->new->schema->storage->datetime_parser->format_datetime( $today_start ); >- $today_end = Koha::Database->new->schema->storage->datetime_parser->format_datetime( $today_end ); >- my @todays_checkins = Koha::Old::Checkouts->search({ >+ 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, > }, >- borrowernumber => $borrowernumber, > branchcode => $checkinslip_branch, > }); > >@@ -102,19 +103,19 @@ if ( $print eq 'checkinslip' ) { > ); > > my $letter = C4::Letters::GetPreparedLetter( >- module => 'circulation', >+ module => 'circulation', > letter_code => 'CHECKINSLIP', >- branchcode => $checkinslip_branch, >- lang => $patron->lang, >- tables => { >- branches => $checkinslip_branch, >+ branchcode => $checkinslip_branch, >+ lang => $patron->lang, >+ tables => { >+ branches => $checkinslip_branch, > borrowers => $borrowernumber, > }, >- loops => \%loops, >+ loops => \%loops, > message_transport_type => 'print' > ); > >- $slip = $letter->{content}; >+ $slip = $letter->{content}; > $is_html = $letter->{is_html}; > > } elsif (my $letter = IssueSlip ($session->param('branch') || $branch, $borrowernumber, $print eq "qslip")) { >-- >2.11.0
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 12224
:
28194
|
29693
|
41819
|
41820
|
44574
|
44576
|
44582
|
44584
|
91476
|
91477
|
91478
|
96970
|
96972
|
110308
|
110395
|
110396
|
110403
|
110404
|
110516
|
110529
|
110530
|
110531
|
110576
|
110577
|
110578
|
114121
|
114122
|
114123
|
114124
|
116135
|
116482
|
116485
|
116486
|
116487
|
116488
|
116489
|
117245
|
117246
|
117247
|
117248
|
117249
|
117250
|
117620
|
117812
|
117813
|
117814
|
117815
|
117816
|
117817
| 117818 |
117819