Bugzilla – Attachment 162973 Details for
Bug 35394
Correct the message displayed when attempting to checkout an item during it's booking period
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35394: Correction to booked items logic
Bug-35394-Correction-to-booked-items-logic.patch (text/plain), 2.71 KB, created by
Martin Renvoize (ashimema)
on 2024-03-08 15:43:04 UTC
(
hide
)
Description:
Bug 35394: Correction to booked items logic
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-03-08 15:43:04 UTC
Size:
2.71 KB
patch
obsolete
>From cff3abc291938c2dc90a4bfe6b470b906acd7a94 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 8 Mar 2024 15:25:10 +0000 >Subject: [PATCH] Bug 35394: Correction to booked items logic > >This patch fixes the overly extreme message that was designed to appeared >when someone tried to check out a booked item to the wrong user. >However, the message never appeared due to a logic error within >CanBookBeIssued which this patch also resolved. > >Test plan >1) Make an item bookable >2) Add a booking for the item to patron A from tomorrow >3) In the database, update the booking start_date to today (or wait a > day before the next step) >4) Attempt to check the book out to patron B. > Note that you are displayed with the new message 'The item is booked > for another patron' and you are unable to check the item out. >--- > C4/Circulation.pm | 17 ++++++++++------- > .../prog/en/modules/circ/circulation.tt | 2 +- > 2 files changed, 11 insertions(+), 8 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 2d2b61f6fca..84f5f603f79 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1262,14 +1262,17 @@ sub CanBookBeIssued { > } > } > >- # Booking starts before due date, reduce loan? >- elsif ( $duedate > dt_from_string( $booking->start_date ) ) { >- $needsconfirmation{'BOOKED_TO_ANOTHER'} = $booking; >- } >- >- # Loan falls inside booking >+ # Booked to another patron > else { >- $issuingimpossible{'BOOKED_TO_ANOTHER'} = $booking; >+ # Booking starts before due date, reduce loan? >+ if ( $now < dt_from_string( $booking->start_date ) && $duedate > dt_from_string( $booking->start_date ) ) { >+ $needsconfirmation{'BOOKED_TO_ANOTHER'} = $booking; >+ } >+ >+ # Loan falls inside booking >+ else { >+ $issuingimpossible{'BOOKED_TO_ANOTHER'} = $booking; >+ } > } > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 54c4da8d898..c7ba4c0bdf8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -612,7 +612,7 @@ > [% END %] > > [% IF ( BOOKED_TO_ANOTHER ) %] >- <li>!!A booking exists!!</li> >+ <li>The item is booked for another patron</li> > [% END %] > </ul> > </div> <!-- /#circ_impossible --> >-- >2.44.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 35394
:
162973
|
162979
|
164998
|
165172