From 95c165d5869c93e53d47aabbd1d5a376a44bda2d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 16 Jan 2020 16:40:10 +0000 Subject: [PATCH] Bug 24299: Record 'RotatingCollection' as a transfer trigger --- C4/Circulation.pm | 8 +++++--- C4/RotatingCollections.pm | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index fc7026f39c..90c114eaa6 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -251,7 +251,7 @@ sub decode { =head2 transferbook ($dotransfer, $messages, $iteminformation) = &transferbook($newbranch, - $barcode, $ignore_reserves); + $barcode, $ignore_reserves, $trigger); Transfers an item to a new branch. If the item is currently on loan, it is automatically returned before the actual transfer. @@ -262,6 +262,8 @@ C<$barcode> is the barcode of the item to be transferred. If C<$ignore_reserves> is true, C<&transferbook> ignores reserves. Otherwise, if an item is reserved, the transfer fails. +C<$trigger> is the enum value for what triggered the transfer. + Returns three values: =over @@ -303,7 +305,7 @@ The item was eligible to be transferred. Barring problems communicating with the =cut sub transferbook { - my ( $tbr, $barcode, $ignoreRs ) = @_; + my ( $tbr, $barcode, $ignoreRs, $trigger ) = @_; my $messages; my $dotransfer = 1; my $item = Koha::Items->find( { barcode => $barcode } ); @@ -360,7 +362,7 @@ sub transferbook { #actually do the transfer.... if ($dotransfer) { - ModItemTransfer( $itemnumber, $fbr, $tbr ); + ModItemTransfer( $itemnumber, $fbr, $tbr, $trigger ); # don't need to update MARC anymore, we do it in batch now $messages->{'WasTransfered'} = 1; diff --git a/C4/RotatingCollections.pm b/C4/RotatingCollections.pm index 709eaf2164..a4477fa9e5 100644 --- a/C4/RotatingCollections.pm +++ b/C4/RotatingCollections.pm @@ -446,11 +446,10 @@ sub TransferCollection { while ( my $item = $sth->fetchrow_hashref ) { my ($status) = CheckReserves( $item->{itemnumber} ); my @transfers = C4::Circulation::GetTransfers( $item->{itemnumber} ); - C4::Circulation::transferbook( $colBranchcode, $item->{barcode}, my $ignore_reserves = 1 ) unless ( $status eq 'Waiting' || @transfers ); + C4::Circulation::transferbook( $colBranchcode, $item->{barcode}, 1, 'RotatingCollection' ) unless ( $status eq 'Waiting' || @transfers ); } return 1; - } =head2 GetCollectionItemBranches -- 2.20.1