|
Lines 1852-1864
sub AddReturn {
Link Here
|
| 1852 |
$branch = C4::Context->userenv->{'branch'} unless $branch; # we trust userenv to be a safe fallback/default |
1852 |
$branch = C4::Context->userenv->{'branch'} unless $branch; # we trust userenv to be a safe fallback/default |
| 1853 |
my $messages; |
1853 |
my $messages; |
| 1854 |
my $borrower; |
1854 |
my $borrower; |
| 1855 |
my $biblio; |
|
|
| 1856 |
my $doreturn = 1; |
1855 |
my $doreturn = 1; |
| 1857 |
my $validTransfert = 0; |
1856 |
my $validTransfert = 0; |
| 1858 |
my $stat_type = 'return'; |
1857 |
my $stat_type = 'return'; |
| 1859 |
|
1858 |
|
| 1860 |
# get information on item |
1859 |
# get information on item |
| 1861 |
my $itemnumber = GetItemnumberFromBarcode( $barcode ); |
1860 |
my $item = GetItem( undef, $barcode ) |
|
|
1861 |
or die "GetItem( undef, $barcode ) failed"; |
| 1862 |
my $itemnumber = $item->{ itemnumber }; |
| 1863 |
my $biblio = GetBiblioData( $item->{ biblionumber } ); |
| 1864 |
my $itemtype = ( C4::Context->preference("item-level_itypes") ) |
| 1865 |
? $item->{ itype } |
| 1866 |
: $biblio->{ itemtype }; |
| 1867 |
|
| 1862 |
unless ($itemnumber) { |
1868 |
unless ($itemnumber) { |
| 1863 |
return (0, { BadBarcode => $barcode }); # no barcode means no item or borrower. bail out. |
1869 |
return (0, { BadBarcode => $barcode }); # no barcode means no item or borrower. bail out. |
| 1864 |
} |
1870 |
} |
|
Lines 1879-1886
sub AddReturn {
Link Here
|
| 1879 |
} |
1885 |
} |
| 1880 |
} |
1886 |
} |
| 1881 |
|
1887 |
|
| 1882 |
my $item = GetItem($itemnumber) or die "GetItem($itemnumber) failed"; |
|
|
| 1883 |
|
| 1884 |
if ( $item->{'location'} eq 'PROC' ) { |
1888 |
if ( $item->{'location'} eq 'PROC' ) { |
| 1885 |
if ( C4::Context->preference("InProcessingToShelvingCart") ) { |
1889 |
if ( C4::Context->preference("InProcessingToShelvingCart") ) { |
| 1886 |
$item->{'location'} = 'CART'; |
1890 |
$item->{'location'} = 'CART'; |
|
Lines 2113-2127
sub AddReturn {
Link Here
|
| 2113 |
} |
2117 |
} |
| 2114 |
|
2118 |
|
| 2115 |
# Record the fact that this book was returned. |
2119 |
# Record the fact that this book was returned. |
| 2116 |
# FIXME itemtype should record item level type, not bibliolevel type |
|
|
| 2117 |
UpdateStats({ |
2120 |
UpdateStats({ |
| 2118 |
branch => $branch, |
2121 |
branch => $branch, |
| 2119 |
type => $stat_type, |
2122 |
type => $stat_type, |
| 2120 |
itemnumber => $item->{'itemnumber'}, |
2123 |
itemnumber => $itemnumber, |
| 2121 |
itemtype => $biblio->{'itemtype'}, |
2124 |
itemtype => $itemtype, |
| 2122 |
borrowernumber => $borrowernumber, |
2125 |
borrowernumber => $borrowernumber, |
| 2123 |
ccode => $item->{'ccode'}} |
2126 |
ccode => $item->{ ccode } |
| 2124 |
); |
2127 |
}); |
| 2125 |
|
2128 |
|
| 2126 |
# Send a check-in slip. # NOTE: borrower may be undef. probably shouldn't try to send messages then. |
2129 |
# Send a check-in slip. # NOTE: borrower may be undef. probably shouldn't try to send messages then. |
| 2127 |
my $circulation_alert = 'C4::ItemCirculationAlertPreference'; |
2130 |
my $circulation_alert = 'C4::ItemCirculationAlertPreference'; |
| 2128 |
- |
|
|