Bugzilla – Attachment 36048 Details for
Bug 12847
Date comparisons in C4::Members::IssueSlip are broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED OFF] Bug 12847 - Date comparisons in C4::Members::IssueSlip are broken
SIGNED-OFF-Bug-12847---Date-comparisons-in-C4Membe.patch (text/plain), 2.32 KB, created by
Nick Clemens (kidclamp)
on 2015-02-19 19:15:02 UTC
(
hide
)
Description:
[SIGNED OFF] Bug 12847 - Date comparisons in C4::Members::IssueSlip are broken
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2015-02-19 19:15:02 UTC
Size:
2.32 KB
patch
obsolete
>From 15e1d6f250bd661b9fd2b945997d1febc83b63e3 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 29 Aug 2014 09:40:09 -0400 >Subject: [PATCH] [SIGNED OFF] Bug 12847 - Date comparisons in > C4::Members::IssueSlip are broken > >Test Plan: >1) Ensure you have the default Koha issue slip >2) Check out an item >3) Print the issue slip for that patron >4) Even though the item is not overdue, it will show in the 'Overdues' section >5) Apply this patch >6) Re-print the issue slip >7) The item should no longer be in the overdues section > >Signed-off-by: Nick <Nick@quechelibrary.org> >--- > C4/Members.pm | 24 ++++++++++++++++-------- > 1 file changed, 16 insertions(+), 8 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 4fb845d..dd30b67 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -2434,20 +2434,28 @@ sub DeleteMessage { > sub IssueSlip { > my ($branch, $borrowernumber, $quickslip) = @_; > >-# return unless ( C4::Context->boolean_preference('printcirculationslips') ); >- >- my $now = POSIX::strftime("%Y-%m-%d", localtime); >+ my $now = dt_from_string(); >+ $now->truncate( to => 'day' ); > > my $issueslist = GetPendingIssues($borrowernumber); >- foreach my $it (@$issueslist){ >- if ((substr $it->{'issuedate'}, 0, 10) eq $now || (substr $it->{'lastreneweddate'}, 0, 10) eq $now) { >+ foreach my $it (@$issueslist) { >+ >+ my $dt_issuedate = dt_from_string( $it->{'issuedate'} ); >+ $dt_issuedate->truncate( to => 'day' ); >+ my $dt_lastreneweddate = dt_from_string( $it->{'lastreneweddate'} ); >+ $dt_lastreneweddate->truncate( to => 'day' ); >+ my $dt_date_due = dt_from_string( $it->{'date_due'} ); >+ $dt_date_due->truncate( to => 'day' ); >+ >+ if ( $dt_issuedate == $now || $dt_lastreneweddate == $now ) { > $it->{'now'} = 1; > } >- elsif ((substr $it->{'date_due'}, 0, 10) le $now) { >+ elsif ( $dt_date_due < $now ) { > $it->{'overdue'} = 1; > } >- my $dt = dt_from_string( $it->{'date_due'} ); >- $it->{'date_due'} = output_pref( $dt );; >+ >+ # Recreate date_due as DateTime because we truncated the hours >+ $it->{'date_due'} = output_pref( dt_from_string( $it->{'date_due'} ) ); > } > my @issues = sort { $b->{'timestamp'} <=> $a->{'timestamp'} } @$issueslist; > >-- >1.7.10.4
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 12847
:
31280
|
31281
|
31286
|
35969
|
36048
|
36049
|
37908
|
37946
|
37992
|
38020
|
38302