|
Lines 1383-1388
sub AddIssue {
Link Here
|
| 1383 |
} |
1383 |
} |
| 1384 |
); |
1384 |
); |
| 1385 |
|
1385 |
|
|
|
1386 |
if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART' ) { |
| 1387 |
## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart. |
| 1388 |
CartToShelf( $item->{'itemnumber'} ); |
| 1389 |
} |
| 1390 |
$item->{'issues'}++; |
| 1391 |
if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) { |
| 1392 |
UpdateTotalIssues($item->{'biblionumber'}, 1); |
| 1393 |
} |
| 1394 |
|
| 1386 |
if ( C4::Context->preference('ReturnToShelvingCart') ) { |
1395 |
if ( C4::Context->preference('ReturnToShelvingCart') ) { |
| 1387 |
# ReturnToShelvingCart is on, anything issued should be taken off the cart. |
1396 |
# ReturnToShelvingCart is on, anything issued should be taken off the cart. |
| 1388 |
CartToShelf( $item->{'itemnumber'} ); |
1397 |
CartToShelf( $item->{'itemnumber'} ); |
|
Lines 1852-1867
sub AddReturn {
Link Here
|
| 1852 |
} |
1861 |
} |
| 1853 |
} |
1862 |
} |
| 1854 |
|
1863 |
|
| 1855 |
if ( $item->{'location'} eq 'PROC' ) { |
1864 |
my $item = GetItem($itemnumber) or die "GetItem($itemnumber) failed"; |
| 1856 |
if ( C4::Context->preference("InProcessingToShelvingCart") ) { |
|
|
| 1857 |
$item->{'location'} = 'CART'; |
| 1858 |
} |
| 1859 |
else { |
| 1860 |
$item->{location} = $item->{permanent_location}; |
| 1861 |
} |
| 1862 |
|
| 1863 |
ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} ); |
| 1864 |
} |
| 1865 |
|
1865 |
|
| 1866 |
# full item data, but no borrowernumber or checkout info (no issue) |
1866 |
# full item data, but no borrowernumber or checkout info (no issue) |
| 1867 |
# we know GetItem should work because GetItemnumberFromBarcode worked |
1867 |
# we know GetItem should work because GetItemnumberFromBarcode worked |
|
Lines 1872-1877
sub AddReturn {
Link Here
|
| 1872 |
|
1872 |
|
| 1873 |
my $borrowernumber = $borrower->{'borrowernumber'} || undef; # we don't know if we had a borrower or not |
1873 |
my $borrowernumber = $borrower->{'borrowernumber'} || undef; # we don't know if we had a borrower or not |
| 1874 |
|
1874 |
|
|
|
1875 |
my $yaml = C4::Context->preference('UpdateItemLocationOnCheckin'); |
| 1876 |
if ($yaml) { |
| 1877 |
$yaml = "$yaml\n\n"; # YAML is strict on ending \n. Surplus does not hurt |
| 1878 |
my $rules; |
| 1879 |
eval { $rules = YAML::Load($yaml); }; |
| 1880 |
if ($@) { |
| 1881 |
warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@"; |
| 1882 |
} |
| 1883 |
else { |
| 1884 |
if (defined $rules->{_ALL_}) { |
| 1885 |
if ($rules->{_ALL_} eq '_PERM_') { $rules->{_ALL_} = $item->{permanent_location}; } |
| 1886 |
if ($rules->{_ALL_} eq '_BLANK_') { $rules->{_ALL_} = ''; } |
| 1887 |
if ( $item->{location} ne $rules->{_ALL_}) { |
| 1888 |
$messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{_ALL_} }; |
| 1889 |
ModItem( { location => $rules->{_ALL_} }, undef, $itemnumber ); |
| 1890 |
} |
| 1891 |
} |
| 1892 |
else { |
| 1893 |
foreach my $key ( keys %$rules ) { |
| 1894 |
if ( $rules->{$key} eq '_PERM_' ) { $rules->{$key} = $item->{permanent_location}; } |
| 1895 |
if ( $rules->{$key} eq '_BLANK_') { $rules->{$key} = '' ;} |
| 1896 |
if ( ($item->{location} eq $key && $item->{location} ne $rules->{$key}) || ($key eq '_BLANK_' && $item->{location} eq '' && $rules->{$key} ne '') ) { |
| 1897 |
$messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{$key} }; |
| 1898 |
ModItem( { location => $rules->{$key} }, undef, $itemnumber ); |
| 1899 |
last; |
| 1900 |
} |
| 1901 |
} |
| 1902 |
} |
| 1903 |
} |
| 1904 |
} |
| 1905 |
|
| 1875 |
my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin'); |
1906 |
my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin'); |
| 1876 |
if ($yaml) { |
1907 |
if ($yaml) { |
| 1877 |
$yaml = "$yaml\n\n"; # YAML is anal on ending \n. Surplus does not hurt |
1908 |
$yaml = "$yaml\n\n"; # YAML is anal on ending \n. Surplus does not hurt |
|
Lines 1980-1994
sub AddReturn {
Link Here
|
| 1980 |
); |
2011 |
); |
| 1981 |
$sth->execute( $item->{'itemnumber'} ); |
2012 |
$sth->execute( $item->{'itemnumber'} ); |
| 1982 |
# if we have a reservation with valid transfer, we can set it's status to 'W' |
2013 |
# if we have a reservation with valid transfer, we can set it's status to 'W' |
| 1983 |
ShelfToCart( $item->{'itemnumber'} ) if ( C4::Context->preference("ReturnToShelvingCart") ); |
|
|
| 1984 |
C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W'); |
2014 |
C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W'); |
| 1985 |
} else { |
2015 |
} else { |
| 1986 |
$messages->{'WrongTransfer'} = $tobranch; |
2016 |
$messages->{'WrongTransfer'} = $tobranch; |
| 1987 |
$messages->{'WrongTransferItem'} = $item->{'itemnumber'}; |
2017 |
$messages->{'WrongTransferItem'} = $item->{'itemnumber'}; |
| 1988 |
} |
2018 |
} |
| 1989 |
$validTransfert = 1; |
2019 |
$validTransfert = 1; |
| 1990 |
} else { |
|
|
| 1991 |
ShelfToCart( $item->{'itemnumber'} ) if ( C4::Context->preference("ReturnToShelvingCart") ); |
| 1992 |
} |
2020 |
} |
| 1993 |
|
2021 |
|
| 1994 |
# fix up the accounts..... |
2022 |
# fix up the accounts..... |