- # get existing reserves .....
- my ($count,$reserves) = GetReservesFromBiblionumber($biblio);
- my $totalcount = $count;
- foreach my $res (@$reserves) {
- if ($res->{'found'} eq 'W') {
- $count--;
- }
- }
- my ($count2,@bibitems) = GetBiblioItemByBiblioNumber($biblio);
- my @itemresults = GetItemsInfo($subs->{'biblionumber'}, 'intra');
- my $branch = $itemresults[0]->{'holdingbranch'};
- my $branchname = GetBranchName($branch);
- my $const = 'o';
- my $notes;
- my $title = $subs->{'bibliotitle'};
- for(my $i=0;$i<$routing;$i++){
- my $sth = $dbh->prepare("SELECT * FROM reserves WHERE biblionumber = ? AND borrowernumber = ?");
- $sth->execute($biblio,$routinglist[$i]->{'borrowernumber'});
- my $data = $sth->fetchrow_hashref;
+ if (C4::Context->preference('RoutingListAddReserves')){
+ # get existing reserves .....
+ my ($count,$reserves) = GetReservesFromBiblionumber($biblio);
+ my $totalcount = $count;
+ foreach my $res (@$reserves) {
+ if ($res->{'found'} eq 'W') {
+ $count--;
+ }
+ }
+ my $const = 'o';
+ my $notes;
+ my $title = $subs->{'bibliotitle'};
+ for(my $i=0;$i<$routing;$i++){
+ my $sth = $dbh->prepare("SELECT * FROM reserves WHERE biblionumber = ? AND borrowernumber = ?");
+ $sth->execute($biblio,$routinglist[$i]->{'borrowernumber'});
+ my $data = $sth->fetchrow_hashref;