View | Details | Raw Unified | Return to bug 18606
Collapse All | Expand All

(-)a/Koha/RotatingCollection.pm (-5 / +12 lines)
Lines 23-28 use Carp; Link Here
23
23
24
use Koha::Database;
24
use Koha::Database;
25
use Koha::Exceptions;
25
use Koha::Exceptions;
26
use Koha::Holds;
26
use Koha::Items;
27
use Koha::Items;
27
use Koha::RotatingCollection::Trackings;
28
use Koha::RotatingCollection::Trackings;
28
29
Lines 62-68 $collection->add_item( $itemnumber ); Link Here
62
63
63
throws
64
throws
64
    Koha::Exceptions::MissingParameter
65
    Koha::Exceptions::MissingParameter
65
    Koha::Exceptions::WrongParameter
66
    Koha::Exceptions::DuplicateObject
67
    Koha::Exceptions::ObjectNotFound
66
68
67
=cut
69
=cut
68
70
Lines 74-79 sub add_item { Link Here
74
    Koha::Exceptions::DuplicateObject->throw
76
    Koha::Exceptions::DuplicateObject->throw
75
        if Koha::RotatingCollection::Trackings->search( { itemnumber => $itemnumber } )->count;
77
        if Koha::RotatingCollection::Trackings->search( { itemnumber => $itemnumber } )->count;
76
78
79
    Koha::Exceptions::ObjectNotFound->throw if not Koha::Items->find( $itemnumber );
80
77
    my $col_tracking = Koha::RotatingCollection::Tracking->new(
81
    my $col_tracking = Koha::RotatingCollection::Tracking->new(
78
        {
82
        {
79
            colId => $self->colId,
83
            colId => $self->colId,
Lines 126-135 sub transfer { Link Here
126
130
127
    $self->colBranchcode( $branchcode )->store;
131
    $self->colBranchcode( $branchcode )->store;
128
132
129
    for ( my $item = $self->items ) {
133
    my $items = $self->items;
130
        my ( $status ) = C4::Reserves::CheckReserves( $item->itemnumber );
134
    while ( my $item = $items->next ) {
131
        my @transfers = C4::Circulation::GetTransfers( $item->itemnumber );
135
        my $holds = Koha::Holds->search( {
132
        C4::Circulation::transferbook( $branchcode, $item->barcode, my $ignore_reserves = 1 ) unless ( $status eq 'Waiting' || @transfers );
136
            itemnumber => $item->itemnumber,
137
            found      => 'W',
138
        } );
139
        C4::Circulation::transferbook( $branchcode, $item->barcode, my $ignore_reserves = 1 ) unless ( $holds->count || $item->get_transfer );
133
    }
140
    }
134
}
141
}
135
142
(-)a/circ/returns.pl (-2 / +3 lines)
Lines 645-651 $itemnumber = GetItemnumberFromBarcode( $barcode ); Link Here
645
if ( $itemnumber ) {
645
if ( $itemnumber ) {
646
    my $item = Koha::Items->find( $itemnumber );
646
    my $item = Koha::Items->find( $itemnumber );
647
    my $holdingBranch = $item->holdingbranch;
647
    my $holdingBranch = $item->holdingbranch;
648
    my $collectionBranch = $item->rotating_collection->colBranchcode;
648
    my $collection = $item->rotating_collection;
649
    my $collectionBranch;
650
    $collectionBranch = $collection->colBranchcode if $collection;
649
    if ( $holdingBranch and $collectionBranch and ( $holdingBranch ne $collectionBranch ) ) {
651
    if ( $holdingBranch and $collectionBranch and ( $holdingBranch ne $collectionBranch ) ) {
650
        $template->param(
652
        $template->param(
651
          collectionItemNeedsTransferred => 1,
653
          collectionItemNeedsTransferred => 1,
652
- 

Return to bug 18606