Bugzilla – Attachment 80715 Details for
Bug 21572
Allow checkout an item with pending hold that is not yet in waiting state
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21572: Remove unnecessary SIP checkout code regarding holds
Bug-21572-Remove-unnecessary-SIP-checkout-code-reg.patch (text/plain), 4.11 KB, created by
Joonas Kylmälä
on 2018-10-17 14:27:07 UTC
(
hide
)
Description:
Bug 21572: Remove unnecessary SIP checkout code regarding holds
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2018-10-17 14:27:07 UTC
Size:
4.11 KB
patch
obsolete
>From 0b5514528cf521facc367035a9acfb950029ea03 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@helsinki.fi> >Date: Wed, 17 Oct 2018 12:45:55 +0000 >Subject: [PATCH] Bug 21572: Remove unnecessary SIP checkout code regarding > holds > >The loop that checks whether "Item is on hold shelf for another patron" >is already done in C4::Circulation::CanBookBeIssued() so we don't have >to do it again but just trust it to tell us the confirmation message >"RESERVE_WAITING" when it is someone else's hold that the patron tries >to checkout. > >This removes also the message "Item was reserved for you." since it >could have have never appeared since RESERVED confirmation message comes >only when the item is reserved to another patron. > >To test: > 1. Apply patch > 2. Have a biblio record with one item A > 3. Make a hold on item A for patron Y (bib level or item, doesn't matter) > 4. Check in item A in intranet so that it goes to Waiting status > 5. Try to checkout item A for patron X with the SIP server > 6. Checkout should fail with message "Item is on hold shelf for another > patron." > > 1. Apply patch > 2. Have a biblio record with two items A and B > 3. Make a hold on item A for patron Y (bib level or item, doesn't matter) > 4. Check in item A in intranet so that it goes to Waiting status > 5. Try to checkout item B for patron X with the SIP server > 6. Checkout should succeed > > 1. Apply patch > 2. Make sure AllowItemsOnHoldCheckout is set "Don't allow" > 3. Have a biblio record with one item A > 4. Make a hold on item A for patron Y (bib level or item, doesn't matter) > 5. Try to checkout item A for patron X with the SIP server > 6. Checkout should fail with message "Item is reserved for another > patron upon return." >--- > C4/SIP/ILS/Transaction/Checkout.pm | 25 ++++++++----------------- > 1 file changed, 8 insertions(+), 17 deletions(-) > >diff --git a/C4/SIP/ILS/Transaction/Checkout.pm b/C4/SIP/ILS/Transaction/Checkout.pm >index e05166a1a8..1fa988ac43 100644 >--- a/C4/SIP/ILS/Transaction/Checkout.pm >+++ b/C4/SIP/ILS/Transaction/Checkout.pm >@@ -71,14 +71,14 @@ sub do_checkout { > foreach my $confirmation (keys %{$needsconfirmation}) { > if ($confirmation eq 'RENEW_ISSUE'){ > $self->screen_msg("Item already checked out to you: renewing item."); >- } elsif ($confirmation eq 'RESERVED' or $confirmation eq 'RESERVE_WAITING') { >- my $x = $self->{item}->available($patron_barcode); >- if ($x) { >- $self->screen_msg("Item was reserved for you."); >- } else { >- $self->screen_msg("Item is reserved for another patron upon return."); >- $noerror = 0; >- } >+ } elsif ($confirmation eq 'RESERVED') { >+ $self->screen_msg("Item is reserved for another patron upon return."); >+ $noerror = 0; >+ last; >+ } elsif ($confirmation eq 'RESERVE_WAITING') { >+ $self->screen_msg("Item is on hold shelf for another patron."); >+ $noerror = 0; >+ last; > } elsif ($confirmation eq 'ISSUED_TO_ANOTHER') { > $self->screen_msg("Item already checked out to another patron. Please return item for check-in."); > $noerror = 0; >@@ -105,15 +105,6 @@ sub do_checkout { > } > } > my $itemnumber = $self->{item}->{itemnumber}; >- foreach (@$shelf) { >- $debug and warn "shelf has ($_->{itemnumber} for $_->{borrowernumber}). this is ($itemnumber, $self->{patron}->{borrowernumber})"; >- ($_->{itemnumber} eq $itemnumber) or next; # skip it if not this item >- ($_->{borrowernumber} == $self->{patron}->{borrowernumber}) and last; >- # if item was waiting for this patron, we're done. AddIssue takes care of the "W" hold. >- $debug and warn "Item is on hold shelf for another patron."; >- $self->screen_msg("Item is on hold shelf for another patron."); >- $noerror = 0; >- } > my ($fee, undef) = GetIssuingCharges($itemnumber, $self->{patron}->{borrowernumber}); > if ( $fee > 0 ) { > $self->{sip_fee_type} = '06'; >-- >2.17.1
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 21572
:
80714
| 80715