From: Colin Campbell Date: Fri, 28 Sep 2012 10:48:18 +0000 (+0100) Subject: Bug 8841 Duedate should be set to end of expiry day X-Git-Url: http://git.rot13.org/?p=koha.git;a=commitdiff_plain;h=1c4125cd0ec8cca40dc23930f0676d94358b9868 Bug 8841 Duedate should be set to end of expiry day When reducing duedate to patron's expiry date it should be set to end of that day not 00:00 take account of the fact that the borrower expiry date will have no hours/minutes Signed-off-by: Kyle M Hall Signed-off-by: Paul Poulain --- diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 7485de55b2..6c3a8d4d66 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -3063,6 +3063,7 @@ sub CalcDateDue { # if ReturnBeforeExpiry ON the datedue can't be after borrower expirydate if ( C4::Context->preference('ReturnBeforeExpiry') ) { my $expiry_dt = dt_from_string( $borrower->{dateexpiry}, 'iso' ); + $expiry_dt->set( hour => 23, minute => 59); if ( DateTime->compare( $datedue, $expiry_dt ) == 1 ) { $datedue = $expiry_dt->clone; }