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

(-)a/C4/Circulation.pm (-13 / +15 lines)
Lines 1745-1757 sub AddReturn { Link Here
1745
    $branch = C4::Context->userenv->{'branch'} unless $branch;  # we trust userenv to be a safe fallback/default
1745
    $branch = C4::Context->userenv->{'branch'} unless $branch;  # we trust userenv to be a safe fallback/default
1746
    my $messages;
1746
    my $messages;
1747
    my $borrower;
1747
    my $borrower;
1748
    my $biblio;
1749
    my $doreturn       = 1;
1748
    my $doreturn       = 1;
1750
    my $validTransfert = 0;
1749
    my $validTransfert = 0;
1751
    my $stat_type = 'return';
1750
    my $stat_type = 'return';
1752
1751
1753
    # get information on item
1752
    # get information on item
1754
    my $itemnumber = GetItemnumberFromBarcode( $barcode );
1753
    my $item       = GetItem( undef, $barcode )
1754
        or die "GetItem( undef, $barcode ) failed";
1755
    my $itemnumber = $item->{ itemnumber };
1756
    my $biblio = GetBiblioData( $item->{ biblionumber } );
1757
    my $itemtype   = ( C4::Context->preference("item-level_itypes") )
1758
                        ? $item->{ itype }
1759
                        : $biblio->{ itemtype };
1760
1755
    unless ($itemnumber) {
1761
    unless ($itemnumber) {
1756
        return (0, { BadBarcode => $barcode }); # no barcode means no item or borrower.  bail out.
1762
        return (0, { BadBarcode => $barcode }); # no barcode means no item or borrower.  bail out.
1757
    }
1763
    }
Lines 1772-1779 sub AddReturn { Link Here
1772
        }
1778
        }
1773
    }
1779
    }
1774
1780
1775
    my $item = GetItem($itemnumber) or die "GetItem($itemnumber) failed";
1776
1777
    if ( $item->{'location'} eq 'PROC' ) {
1781
    if ( $item->{'location'} eq 'PROC' ) {
1778
        if ( C4::Context->preference("InProcessingToShelvingCart") ) {
1782
        if ( C4::Context->preference("InProcessingToShelvingCart") ) {
1779
            $item->{'location'} = 'CART';
1783
            $item->{'location'} = 'CART';
Lines 1992-2006 sub AddReturn { Link Here
1992
    }
1996
    }
1993
1997
1994
    # Record the fact that this book was returned.
1998
    # Record the fact that this book was returned.
1995
    # FIXME itemtype should record item level type, not bibliolevel type
1996
    UpdateStats({
1999
    UpdateStats({
1997
                branch => $branch,
2000
        branch         => $branch,
1998
                type => $stat_type,
2001
        type           => $stat_type,
1999
                itemnumber => $item->{'itemnumber'},
2002
        itemnumber     => $itemnumber,
2000
                itemtype => $biblio->{'itemtype'},
2003
        itemtype       => $itemtype,
2001
                borrowernumber => $borrowernumber,
2004
        borrowernumber => $borrowernumber,
2002
                ccode => $item->{'ccode'}}
2005
        ccode          => $item->{ ccode }
2003
    );
2006
    });
2004
2007
2005
    # Send a check-in slip. # NOTE: borrower may be undef.  probably shouldn't try to send messages then.
2008
    # Send a check-in slip. # NOTE: borrower may be undef.  probably shouldn't try to send messages then.
2006
    my $circulation_alert = 'C4::ItemCirculationAlertPreference';
2009
    my $circulation_alert = 'C4::ItemCirculationAlertPreference';
2007
- 

Return to bug 14598