Bugzilla – Attachment 111061 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), 3.08 KB, created by
Marcel de Rooy
on 2020-10-02 07:25:28 UTC
(
hide
)
Description:
Bug 24598: Complete transfer for hold if checked out
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-10-02 07:25:28 UTC
Size:
3.08 KB
patch
obsolete
>From 921580c34510904c550337d64eeaf1a188f799be 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 >Content-Type: text/plain; charset=utf-8 > >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> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Circulation.pm | 26 +++++++++++++++----------- > 1 file changed, 15 insertions(+), 11 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 5c05326123..aa917a9e2d 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1448,18 +1448,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.11.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