From e1e787548e44231b8377ce9192545aee48719e9b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 17 Jan 2020 10:47:49 +0000 Subject: [PATCH] Bug 24436: Add handling for reserve transfer triggers To test: 1 - Place a hold for pickup at a different branch than you are signed in at on an item owned by current branch 2 - Check in the item 3 - Confirm the transfer 4 - Check the branchtransfers table and note the reason is 'Reserve' 5 - Set the preference CanMarkHoldsToPullAsLost to allow 6 - Place a hold on an item at branch you are singed in at 7 - Ensure you are not using strict sql modes (bug 22431) 8 - Go to Circulation->Holds to pull 9 - Mark hold as lost 10 - Check branchtransfers and confirm reason is "LostReserve" 11 - Check in item from step 1 at the correct branch 12 - Go to Circulation->Holds awaiting pickup 13 - Cancel the reserve 14 - Check branchtransfers and confirm reason is "CancelReserve" Signed-off-by: Nick Clemens --- C4/Reserves.pm | 3 ++- circ/pendingreserves.pl | 2 +- circ/waitingreserves.pl | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 27a9df7fad..b41b2d2504 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -587,7 +587,8 @@ sub GetOtherReserves { C4::Items::ModItemTransfer( $itemnumber, $item->holdingbranch, - $checkreserves->{'branchcode'} + $checkreserves->{'branchcode'}, + 'Reserve' ), ; } diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 9f62b28b22..dc30a7ac0f 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -102,7 +102,7 @@ if ( $op eq 'cancel_reserve' and $reserve_id ) { } $hold->cancel; if ( $item->homebranch ne $item->holdingbranch ) { - C4::Items::ModItemTransfer( $item->itemnumber, $item->holdingbranch, $item->homebranch ); + C4::Items::ModItemTransfer( $item->itemnumber, $item->holdingbranch, $item->homebranch, 'LostReserve' ); } if ( my $yaml = C4::Context->preference('UpdateItemWhenLostFromHoldList') ) { diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl index c78884f70e..abefc095e5 100755 --- a/circ/waitingreserves.pl +++ b/circ/waitingreserves.pl @@ -144,7 +144,7 @@ sub cancel { # if the document is not in his homebranch location and there is not reservation after, we transfer it if ($transfer && !$nextreservinfo) { - ModItemTransfer( $item, $fbr, $tbr ); + ModItemTransfer( $item, $fbr, $tbr, 'CancelReserve' ); } # if we have a result if ($nextreservinfo) { -- 2.20.1