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

(-)a/C4/Circulation.pm (-13 / +15 lines)
Lines 1801-1813 sub AddReturn { Link Here
1801
    $branch = C4::Context->userenv->{'branch'} unless $branch;  # we trust userenv to be a safe fallback/default
1801
    $branch = C4::Context->userenv->{'branch'} unless $branch;  # we trust userenv to be a safe fallback/default
1802
    my $messages;
1802
    my $messages;
1803
    my $borrower;
1803
    my $borrower;
1804
    my $biblio;
1805
    my $doreturn       = 1;
1804
    my $doreturn       = 1;
1806
    my $validTransfert = 0;
1805
    my $validTransfert = 0;
1807
    my $stat_type = 'return';
1806
    my $stat_type = 'return';
1808
1807
1809
    # get information on item
1808
    # get information on item
1810
    my $itemnumber = GetItemnumberFromBarcode( $barcode );
1809
    my $item       = GetItem( undef, $barcode )
1810
        or die "GetItem( undef, $barcode ) failed";
1811
    my $itemnumber = $item->{ itemnumber };
1812
    my $biblio = GetBiblioData( $item->{ biblionumber } );
1813
    my $itemtype   = ( C4::Context->preference("item-level_itypes") )
1814
                        ? $item->{ itype }
1815
                        : $biblio->{ itemtype };
1816
1811
    unless ($itemnumber) {
1817
    unless ($itemnumber) {
1812
        return (0, { BadBarcode => $barcode }); # no barcode means no item or borrower.  bail out.
1818
        return (0, { BadBarcode => $barcode }); # no barcode means no item or borrower.  bail out.
1813
    }
1819
    }
Lines 1828-1835 sub AddReturn { Link Here
1828
        }
1834
        }
1829
    }
1835
    }
1830
1836
1831
    my $item = GetItem($itemnumber) or die "GetItem($itemnumber) failed";
1832
1833
    if ( $item->{'location'} eq 'PROC' ) {
1837
    if ( $item->{'location'} eq 'PROC' ) {
1834
        if ( C4::Context->preference("InProcessingToShelvingCart") ) {
1838
        if ( C4::Context->preference("InProcessingToShelvingCart") ) {
1835
            $item->{'location'} = 'CART';
1839
            $item->{'location'} = 'CART';
Lines 2048-2062 sub AddReturn { Link Here
2048
    }
2052
    }
2049
2053
2050
    # Record the fact that this book was returned.
2054
    # Record the fact that this book was returned.
2051
    # FIXME itemtype should record item level type, not bibliolevel type
2052
    UpdateStats({
2055
    UpdateStats({
2053
                branch => $branch,
2056
        branch         => $branch,
2054
                type => $stat_type,
2057
        type           => $stat_type,
2055
                itemnumber => $item->{'itemnumber'},
2058
        itemnumber     => $itemnumber,
2056
                itemtype => $biblio->{'itemtype'},
2059
        itemtype       => $itemtype,
2057
                borrowernumber => $borrowernumber,
2060
        borrowernumber => $borrowernumber,
2058
                ccode => $item->{'ccode'}}
2061
        ccode          => $item->{ ccode }
2059
    );
2062
    });
2060
2063
2061
    # Send a check-in slip. # NOTE: borrower may be undef.  probably shouldn't try to send messages then.
2064
    # Send a check-in slip. # NOTE: borrower may be undef.  probably shouldn't try to send messages then.
2062
    my $circulation_alert = 'C4::ItemCirculationAlertPreference';
2065
    my $circulation_alert = 'C4::ItemCirculationAlertPreference';
2063
- 

Return to bug 14598