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

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

Return to bug 14598