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. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
1ace57be46
commit
1ebd742e08
|
|
@ -1248,17 +1248,18 @@ sub CanBookBeIssued {
|
|||
} else {
|
||||
$alerts{'BOOKED'} = $booking;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
# Loan falls inside booking
|
||||
if ( $now > $booking_start ) {
|
||||
$issuingimpossible{'BOOKED_TO_ANOTHER'} = $booking;
|
||||
# Booked to another patron
|
||||
else {
|
||||
# Booking starts before due date, reduce loan?
|
||||
if ( $now < $booking_start && $duedate > $booking_start ) {
|
||||
$needsconfirmation{'BOOKED_TO_ANOTHER'} = $booking;
|
||||
}
|
||||
|
||||
# Booking starts before due date, reduce loan?
|
||||
# Loan falls inside booking
|
||||
else {
|
||||
$needsconfirmation{'BOOKED_TO_ANOTHER'} = $booking;
|
||||
$issuingimpossible{'BOOKED_TO_ANOTHER'} = $booking;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue