(not defined $item->{'withdrawn'} or $item->{'withdrawn'} eq '')) {
$item->{'withdrawn'} = 0;
}
- if (exists $item->{'location'} && !$item->{'permanent_location'}) {
+ if (exists $item->{location}
+ and $item->{location} ne 'CART'
+ and $item->{location} ne 'PROC'
+ and not $item->{permanent_location}
+ ) {
$item->{'permanent_location'} = $item->{'location'};
}
if (exists $item->{'timestamp'}) {
subtest 'General Add, Get and Del tests' => sub {
- plan tests => 10;
+ plan tests => 14;
# Start transaction
$dbh->{AutoCommit} = 0;
is( $getitem->{location}, $location, "The location should not have been modified" );
is( $getitem->{permanent_location}, 'my permanent location', "The permanent_location should not have modified" );
+ ModItem({ location => $location }, $bibnum, $itemnumber);
+ $getitem = GetItem($itemnumber);
+ is( $getitem->{location}, $location, "The location should have been set to correct location" );
+ is( $getitem->{permanent_location}, $location, "The permanent_location should have been set to location" );
+
+ ModItem({ location => 'CART' }, $bibnum, $itemnumber);
+ $getitem = GetItem($itemnumber);
+ is( $getitem->{location}, 'CART', "The location should have been set to CART" );
+ is( $getitem->{permanent_location}, $location, "The permanent_location should not have been set to CART" );
+
$dbh->rollback;
};