Bugzilla – Attachment 159807 Details for
Bug 35559
Can't change the pickup date of holds on the last day of expiration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35559 - Allow the change of expiration date on the last day of expiration
Bug-35559---Allow-the-change-of-expiration-date-on.patch (text/plain), 1.84 KB, created by
Peter Vashchuk
on 2023-12-13 15:10:26 UTC
(
hide
)
Description:
Bug 35559 - Allow the change of expiration date on the last day of expiration
Filename:
MIME Type:
Creator:
Peter Vashchuk
Created:
2023-12-13 15:10:26 UTC
Size:
1.84 KB
patch
obsolete
>From 2ddd46d3d24ad8e90dfe0aca35b8033a7db86a28 Mon Sep 17 00:00:00 2001 >From: Petro Vashchuk <stalkernoid@gmail.com> >Date: Wed, 13 Dec 2023 17:09:35 +0200 >Subject: [PATCH] Bug 35559 - Allow the change of expiration date on the last > day of expiration > >The result of this comparison will almost never be 0 as it requires the dates to be same down to a second: >DateTime->compare( dt_from_string( $res->expirationdate ), dt_from_string() ) == -1 >This patch fixes it. > >To reproduce: >1) Create or use existing hold that is awaiting pickup. >2) Set it's expiration date to today. (if you can't do it through koha interface, edit it in the database or wait for tomorrow to come) >3) Check that you can't change the expiration date anymore as it says "Expired: %date%" >4) Apply the patch >5) Check that you can change the expiration date >--- > reserve/request.pl | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/reserve/request.pl b/reserve/request.pl >index 186b3faff5..8415b2a4a9 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -621,8 +621,12 @@ if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) > } > } > $reserve{'expirationdate'} = $res->expirationdate; >+ >+ my $today = dt_from_string()->truncate(to => 'day'); >+ my $expirationdate = dt_from_string( $res->expirationdate )->truncate(to => 'day'); > $reserve{'expired'} = 1 >- if ( DateTime->compare( dt_from_string( $res->expirationdate ), dt_from_string() ) == -1 ); >+ if ( DateTime->compare( $expirationdate, $today ) == -1 ); >+ > $reserve{'date'} = $res->reservedate; > $reserve{'borrowernumber'} = $res->borrowernumber(); > $reserve{'biblionumber'} = $res->biblionumber(); >-- >2.42.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 35559
:
159807
|
163742
|
163743
|
165909