Bugfix for problems when shelving cart used without In Processing settings
To test, with InProcessingToShelvingCart off, NewItemsDefaultLocation blank,
and ReturnToShelvingCart on, create a new item. Check the contents of the
location and permanent_location fields in its item record -- the same value
should be in both. Then run the item through checkin, and look at those fields
again. The location field should now be set to CART while permanent_location
should still have the original value. After the cart_to_shelf cron job runs
with the proper timing, check the item record again. Both location and
permanent_location should again be identical.
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
itemnotes => undef,
itype => undef,
location => undef,
+ permanent_location => undef,
materials => undef,
notforloan => 0,
paidfor => undef,
holdingbranch = ?,
paidfor = ?,
location = ?,
+ permanent_location = ?,
onloan = ?,
issues = ?,
renewals = ?,
$item->{'holdingbranch'},
$item->{'paidfor'},
$item->{'location'},
+ $item->{'permanent_location'},
$item->{'onloan'},
$item->{'issues'},
$item->{'renewals'},
sub set_item_default_location {
my $itemnumber = shift;
+ my $item = GetItem( $itemnumber );
if ( C4::Context->preference('NewItemsDefaultLocation') ) {
- my $item = GetItem( $itemnumber );
$item->{'permanent_location'} = $item->{'location'};
$item->{'location'} = C4::Context->preference('NewItemsDefaultLocation');
ModItem( $item, undef, $itemnumber);
}
+ else {
+ $item->{'permanent_location'} = $item->{'location'} if !defined($item->{'permanent_location'});
+ ModItem( $item, undef, $itemnumber);
+ }
}
# NOTE: This code is subject to change in the future with the implemenation of ajax based autobarcode code