Bug 28136: Handle Transferred status for ResFound
authorNick Clemens <nick@bywatersolutions.com>
Mon, 12 Apr 2021 14:18:20 +0000 (14:18 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 14 Apr 2021 14:07:55 +0000 (16:07 +0200)
bug 25690 added a new 'Transferred' status to 'ResFound', this status
needs to be handled in circ/returns.pl

To test:
1 - Place a hold on an item at Branch B for pickup at Branch A
2 - Check in the item at Branch B - confirm hold and transfer
3 - Check in the item at Branch A - nothing happens?
4 - Apply patch
5 - Checkin in the item at Branch A - hold popup appears
6 - Clear the hold and place it again
7 - Set system preference 'HoldsAutoFill' to do
8 - Check in the item at Branch B - hold is found and confirmed
9 - Check in the item at Branch A - hold is found and confirmed

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
circ/returns.pl

index b58e340..28c0b83 100755 (executable)
@@ -417,7 +417,7 @@ if ( $messages->{'ResFound'}) {
     my $patron = Koha::Patrons->find( $reserve->{borrowernumber} );
     my $holdmsgpreferences =  C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $reserve->{'borrowernumber'}, message_name   => 'Hold_Filled' } );
     my $branchCheck = ( $userenv_branch eq $reserve->{branchcode} );
-    if ( $reserve->{'ResFound'} eq "Reserved" && C4::Context->preference('HoldsAutoFill') ) {
+    if ( ( $reserve->{'ResFound'} eq "Reserved" || $reserve->{'ResFound'} eq "Transferred" ) && C4::Context->preference('HoldsAutoFill') ) {
         my $item = Koha::Items->find( $itemnumber );
         my $biblio = $item->biblio;
 
@@ -443,7 +443,7 @@ if ( $messages->{'ResFound'}) {
         $template->param(
             waiting      => $branchCheck ? 1 : undef,
         );
-    } elsif ( $reserve->{'ResFound'} eq "Reserved" || $reserve->{'ResFound'} eq "Processing" ) {
+    } elsif ( $reserve->{'ResFound'} eq "Reserved" || $reserve->{'ResFound'} eq "Processing" || $reserve->{'ResFound'} eq "Transferred" ) {
         $template->param(
             intransit    => $branchCheck ? undef : 1,
             transfertodo => $branchCheck ? undef : 1,