Bugzilla – Attachment 110890 Details for
Bug 24598
Hold not reset properly if checked out to another patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24598: Complete transfer for hold if checked out
Bug-24598-Complete-transfer-for-hold-if-checked-ou.patch (text/plain), 2.98 KB, created by
Fridolin Somers
on 2020-09-29 08:17:34 UTC
(
hide
)
Description:
Bug 24598: Complete transfer for hold if checked out
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2020-09-29 08:17:34 UTC
Size:
2.98 KB
patch
obsolete
>From 6f95f2a5e21836b412f3a8edd2693c7af58fa319 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 10 Aug 2020 15:51:17 +0200 >Subject: [PATCH] Bug 24598: Complete transfer for hold if checked out > >When an item that has triggered a hold is in transit to a library, >if the item is accidently shelved instead of scanned at the pickup library, >and then checked out to another patron, the holds shows the item still in transit >in the status, but says that it is waiting at the library, and the since date has vanished! > >Test plan: >1) Place an item at Library A on hold for Patron 1 of Library B with pickup library at Library B >2) Check in the item at Library A to trigger the hold transfer >3) At Library B, check out the item to Patron 2 (click Yes) >=> The hold is not marked as in transit and is back to priority 1 > >Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> >--- > C4/Circulation.pm | 26 +++++++++++++++----------- > 1 file changed, 15 insertions(+), 11 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index ed2b43f3d5..0a2e36d114 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1441,18 +1441,22 @@ sub AddIssue { > C4::Reserves::MoveReserve( $item_object->itemnumber, $borrower->{'borrowernumber'}, $cancelreserve ); > > # Starting process for transfer job (checking transfert and validate it if we have one) >- my ($datesent) = GetTransfers( $item_object->itemnumber ); >- if ($datesent) { >+ if ( my $transfer = $item_object->get_transfer ) { > # updating line of branchtranfert to finish it, and changing the to branch value, implement a comment for visibility of this case (maybe for stats ....) >- my $sth = $dbh->prepare( >- "UPDATE branchtransfers >- SET datearrived = now(), >- tobranch = ?, >- comments = 'Forced branchtransfer' >- WHERE itemnumber= ? AND datearrived IS NULL" >- ); >- $sth->execute( C4::Context->userenv->{'branch'}, >- $item_object->itemnumber ); >+ $transfer->set( >+ { >+ datearrived => dt_from_string, >+ tobranch => C4::Context->userenv->{branch}, >+ comments => 'Forced branchtransfer' >+ } >+ )->store; >+ if ( $transfer->reason eq 'Reserve' ) { >+ my $hold = $item_object->holds->search( { found => 'T' } )->next; >+ if ( $hold ) { # Is this really needed? >+ $hold->set( { found => undef } )->store; >+ C4::Reserves::ModReserveMinusPriority($item_object->itemnumber, $hold->reserve_id); >+ } >+ } > } > > # If automatic renewal wasn't selected while issuing, set the value according to the issuing rule. >-- >2.28.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 24598
:
108002
|
108003
|
110889
|
110890
|
111060
|
111061
|
111371