- # warn "$routinglist[$i]->{'borrowernumber'} is the same as $data->{'borrowernumber'}";
- if($routinglist[$i]->{'borrowernumber'} == $data->{'borrowernumber'}){
- ModReserve($routinglist[$i]->{'ranking'},$biblio,$routinglist[$i]->{'borrowernumber'},$branch);
- } else {
- AddReserve($branch,$routinglist[$i]->{'borrowernumber'},$biblio,$const,\@bibitems,$routinglist[$i]->{'ranking'},'',$notes,$title);
- }
- }
+ if($routing->{borrowernumber} == $reserve->{borrowernumber}){
+ ModReserve({
+ rank => $routing->{ranking},
+ biblionumber => $biblio,
+ borrowernumber => $routing->{borrowernumber},
+ branchcode => $branch
+ });
+ } else {
+ AddReserve($branch,$routing->{borrowernumber},$biblio,$const,\@bibitems,$routing->{ranking}, undef, undef, $notes,$title);
+ }
+ }