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

(-)a/C4/Circulation.pm (+3 lines)
Lines 1659-1670 sub AddReturn { Link Here
1659
            );
1659
            );
1660
            $sth->execute( $item->{'itemnumber'} );
1660
            $sth->execute( $item->{'itemnumber'} );
1661
            # if we have a reservation with valid transfer, we can set it's status to 'W'
1661
            # if we have a reservation with valid transfer, we can set it's status to 'W'
1662
            ShelfToCart( $item->{'itemnumber'} );
1662
            C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W');
1663
            C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W');
1663
        } else {
1664
        } else {
1664
            $messages->{'WrongTransfer'}     = $tobranch;
1665
            $messages->{'WrongTransfer'}     = $tobranch;
1665
            $messages->{'WrongTransferItem'} = $item->{'itemnumber'};
1666
            $messages->{'WrongTransferItem'} = $item->{'itemnumber'};
1666
        }
1667
        }
1667
        $validTransfert = 1;
1668
        $validTransfert = 1;
1669
    } else {
1670
        ShelfToCart( $item->{'itemnumber'} );
1668
    }
1671
    }
1669
1672
1670
    # fix up the accounts.....
1673
    # fix up the accounts.....
(-)a/C4/Items.pm (-5 / +33 lines)
Lines 48-54 BEGIN { Link Here
48
        AddItem
48
        AddItem
49
        AddItemBatchFromMarc
49
        AddItemBatchFromMarc
50
        ModItemFromMarc
50
        ModItemFromMarc
51
		Item2Marc
51
	Item2Marc
52
        ModItem
52
        ModItem
53
        ModDateLastSeen
53
        ModDateLastSeen
54
        ModItemTransfer
54
        ModItemTransfer
Lines 72-81 BEGIN { Link Here
72
        GetItemnumberFromBarcode
72
        GetItemnumberFromBarcode
73
        GetBarcodeFromItemnumber
73
        GetBarcodeFromItemnumber
74
        GetHiddenItemnumbers
74
        GetHiddenItemnumbers
75
		DelItemCheck
75
        DelItemCheck
76
		MoveItemFromBiblio 
76
	MoveItemFromBiblio 
77
		GetLatestAcquisitions
77
	GetLatestAcquisitions
78
78
        CartToShelf
79
        CartToShelf
80
        ShelfToCart
79
81
80
	GetAnalyticsCount
82
	GetAnalyticsCount
81
        GetItemHolds
83
        GetItemHolds
Lines 190-196 sub CartToShelf { Link Here
190
    }
192
    }
191
193
192
    my $item = GetItem($itemnumber);
194
    my $item = GetItem($itemnumber);
193
    $item->{location} = $item->{permanent_location};
195
    if ( $item->{location} eq 'CART' ) {
196
        $item->{location} = $item->{permanent_location};
197
        ModItem($item, undef, $itemnumber);
198
    }
199
}
200
201
=head2 ShelfToCart
202
203
  ShelfToCart($itemnumber);
204
205
Set the current shelving location of the item 
206
to shelving cart ('CART').
207
208
=cut
209
210
sub ShelfToCart {
211
    my ( $itemnumber ) = @_;
212
213
    unless ( $itemnumber ) {
214
        croak "FAILED ShelfToCart() - no itemnumber supplied";
215
    }
216
217
    my $item = GetItem($itemnumber);
218
    $item->{'location'} = 'CART';
194
    ModItem($item, undef, $itemnumber);
219
    ModItem($item, undef, $itemnumber);
195
}
220
}
196
221
Lines 542-547 sub ModItemTransfer { Link Here
542
567
543
    my $dbh = C4::Context->dbh;
568
    my $dbh = C4::Context->dbh;
544
569
570
    # Remove the 'shelving cart' location status if it is being used.
571
    CartToShelf( $itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") );
572
545
    #new entry in branchtransfers....
573
    #new entry in branchtransfers....
546
    my $sth = $dbh->prepare(
574
    my $sth = $dbh->prepare(
547
        "INSERT INTO branchtransfers (itemnumber, frombranch, datesent, tobranch)
575
        "INSERT INTO branchtransfers (itemnumber, frombranch, datesent, tobranch)
(-)a/circ/returns.pl (-7 lines)
Lines 212-223 if ($barcode) { Link Here
212
        }
212
        }
213
    }
213
    }
214
214
215
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
216
        my $item = GetItem( $itemnumber );
217
        $item->{'location'} = 'CART';
218
        ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
219
    }
220
221
#
215
#
222
# save the return
216
# save the return
223
#
217
#
224
- 

Return to bug 3701