Bug 12495 - Include streetnumber in hold alert address
[koha_fer] / serials / routing-preview.pl
index 437c852..1e0bd09 100755 (executable)
@@ -71,8 +71,9 @@ if($ok){
 
        if (C4::Context->preference('RoutingListAddReserves')){
                # get existing reserves .....
-               my ($count,$reserves) = GetReservesFromBiblionumber($biblio);
-               my $totalcount = $count;
+        my $reserves = GetReservesFromBiblionumber({ biblionumber => $biblio });
+        my $count = scalar( @$reserves );
+        my $totalcount = $count;
                foreach my $res (@$reserves) {
                        if ($res->{'found'} eq 'W') {
                                $count--;
@@ -87,7 +88,12 @@ if($ok){
             my $reserve = $sth->fetchrow_hashref;
 
             if($routing->{borrowernumber} == $reserve->{borrowernumber}){
-                ModReserve($routing->{ranking},$biblio,$routing->{borrowernumber},$branch);
+                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);
         }