Lines 1844-1856
sub AddReturn {
Link Here
|
1844 |
$branch = C4::Context->userenv->{'branch'} unless $branch; # we trust userenv to be a safe fallback/default |
1844 |
$branch = C4::Context->userenv->{'branch'} unless $branch; # we trust userenv to be a safe fallback/default |
1845 |
my $messages; |
1845 |
my $messages; |
1846 |
my $borrower; |
1846 |
my $borrower; |
1847 |
my $biblio; |
|
|
1848 |
my $doreturn = 1; |
1847 |
my $doreturn = 1; |
1849 |
my $validTransfert = 0; |
1848 |
my $validTransfert = 0; |
1850 |
my $stat_type = 'return'; |
1849 |
my $stat_type = 'return'; |
1851 |
|
1850 |
|
1852 |
# get information on item |
1851 |
# get information on item |
1853 |
my $itemnumber = GetItemnumberFromBarcode( $barcode ); |
1852 |
my $item = GetItem( undef, $barcode ) |
|
|
1853 |
or die "GetItem( undef, $barcode ) failed"; |
1854 |
my $itemnumber = $item->{ itemnumber }; |
1855 |
my $biblio = GetBiblioData( $item->{ biblionumber } ); |
1856 |
my $itemtype = ( C4::Context->preference("item-level_itypes") ) |
1857 |
? $item->{ itype } |
1858 |
: $biblio->{ itemtype }; |
1859 |
|
1854 |
unless ($itemnumber) { |
1860 |
unless ($itemnumber) { |
1855 |
return (0, { BadBarcode => $barcode }); # no barcode means no item or borrower. bail out. |
1861 |
return (0, { BadBarcode => $barcode }); # no barcode means no item or borrower. bail out. |
1856 |
} |
1862 |
} |
Lines 1871-1878
sub AddReturn {
Link Here
|
1871 |
} |
1877 |
} |
1872 |
} |
1878 |
} |
1873 |
|
1879 |
|
1874 |
my $item = GetItem($itemnumber) or die "GetItem($itemnumber) failed"; |
|
|
1875 |
|
1876 |
if ( $item->{'location'} eq 'PROC' ) { |
1880 |
if ( $item->{'location'} eq 'PROC' ) { |
1877 |
if ( C4::Context->preference("InProcessingToShelvingCart") ) { |
1881 |
if ( C4::Context->preference("InProcessingToShelvingCart") ) { |
1878 |
$item->{'location'} = 'CART'; |
1882 |
$item->{'location'} = 'CART'; |
Lines 2073-2087
sub AddReturn {
Link Here
|
2073 |
} |
2077 |
} |
2074 |
|
2078 |
|
2075 |
# Record the fact that this book was returned. |
2079 |
# Record the fact that this book was returned. |
2076 |
# FIXME itemtype should record item level type, not bibliolevel type |
|
|
2077 |
UpdateStats({ |
2080 |
UpdateStats({ |
2078 |
branch => $branch, |
2081 |
branch => $branch, |
2079 |
type => $stat_type, |
2082 |
type => $stat_type, |
2080 |
itemnumber => $item->{'itemnumber'}, |
2083 |
itemnumber => $itemnumber, |
2081 |
itemtype => $biblio->{'itemtype'}, |
2084 |
itemtype => $itemtype, |
2082 |
borrowernumber => $borrowernumber, |
2085 |
borrowernumber => $borrowernumber, |
2083 |
ccode => $item->{'ccode'}} |
2086 |
ccode => $item->{ ccode } |
2084 |
); |
2087 |
}); |
2085 |
|
2088 |
|
2086 |
# Send a check-in slip. # NOTE: borrower may be undef. probably shouldn't try to send messages then. |
2089 |
# Send a check-in slip. # NOTE: borrower may be undef. probably shouldn't try to send messages then. |
2087 |
my $circulation_alert = 'C4::ItemCirculationAlertPreference'; |
2090 |
my $circulation_alert = 'C4::ItemCirculationAlertPreference'; |
2088 |
- |
|
|