my $subscriptioninfos = GetSubscription($subscriptionids[$i]);
# Changing the status to "available" and the itemtype according to the previousitemtype db field
- ModItem({notforloan => 0, itype => $subscriptioninfos->{'previousitemtype'} }, undef, $itemnumber);
+ $serialitem->set(
+ {
+ notforloan => 0,
+ itype => $subscriptioninfos->{'previousitemtype'}
+ }
+ )->store;
}
}
}
#Rebuilding ALL the data for items into a hash
# parting them on $itemid.
my %itemhash;
- my $countdistinct;
+ my $countdistinct = 0;
my $range = scalar(@itemid);
for ( my $i = 0 ; $i < $range ; $i++ ) {
unless ( $itemhash{ $itemid[$i] } ) {
$itemhash{ $itemid[$i] }->{'serial'} = $newserial;
}
$itemhash{ $itemid[$i] }->{'bibnum'} = $bibnums[$countdistinct];
+ $itemhash{ $itemid[$i] }->{'num_copies'} = $num_copies[$countdistinct];
$countdistinct++;
}
push @{ $itemhash{ $itemid[$i] }->{'tags'} }, $tags[$i];
$field_values[$i];
push @{ $itemhash{ $itemid[$i] }->{'ind_tag'} }, $ind_tag[$i];
push @{ $itemhash{ $itemid[$i] }->{'indicator'} }, $indicator[$i];
- push @{ $itemhash{ $itemid[$i] }->{'num_copies'} }, $num_copies[$i];
}
foreach my $item ( keys %itemhash ) {
$itemhash{$item}->{'num_copies'} //= 1;
- for (my $copy = 0; $copy < $itemhash{$item}->{'num_copies'}[$index];){
+ for (my $copy = 0; $copy < $itemhash{$item}->{'num_copies'};){
# New Item
$copy++;
}
- } # num_copies for loop
+ } # if ( $item =~ /^N/ ) {
else {