X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FCirculation.pm;h=237181fe1c769c70427a2104b6ec50755ed1e043;hb=be8a3ee8304d305a3f684a435a366d5b9ea69b27;hp=e190019ae1a78c8f4034bae5bab10bb1838e5ba9;hpb=042cba5db1ee7752304e2e03c9a7b239ffe88735;p=koha-ffzg.git diff --git a/C4/Circulation.pm b/C4/Circulation.pm index e190019ae1..237181fe1c 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2293,8 +2293,15 @@ sub AddReturn { $validTransfer = 1 if $transfer->reason eq 'Reserve'; } else { - $messages->{'WasTransfered'} = $transfer->tobranch; $messages->{'TransferTrigger'} = $transfer->reason; + if ( $transfer->frombranch eq $branch ) { + $transfer->transit; + $messages->{'WasTransfered'} = $transfer->tobranch; + } + else { + $messages->{'WrongTransfer'} = $transfer->tobranch; + $messages->{'WrongTransferItem'} = $item->itemnumber; + } } } } @@ -3161,7 +3168,8 @@ sub AddRenewal { $renews = ( $item_object->renewals || 0 ) + 1; $item_object->renewals($renews); $item_object->onloan($datedue); - $item_object->store({ log_action => 0 }); + # Don't index as we are in a transaction + $item_object->store({ log_action => 0, skip_record_index => 1 }); # Charge a new rental fee, if applicable my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); @@ -3246,6 +3254,9 @@ sub AddRenewal { } }); }); + # We index now, after the transaction is committed + my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); + $indexer->index_records( $item_object->biblionumber, "specialUpdate", "biblioserver" ); return $datedue; }