ffzg/recall_notices.pl: added --interval and --dedup
[koha.git] / opac / opac-reserve.pl
index e896975..aeb88ca 100755 (executable)
@@ -101,7 +101,7 @@ if ( $patron->category->effective_BlockExpiredPatronOpacActions ) {
 # Pass through any reserve charge
 my $reservefee = $patron->category->reservefee;
 if ( $reservefee > 0){
-    $template->param( RESERVE_CHARGE => sprintf("%.2f",$reservefee));
+    $template->param( RESERVE_CHARGE => $reservefee);
 }
 
 my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } };
@@ -173,6 +173,7 @@ foreach my $biblioNumber (@biblionumbers) {
 
     # Compute the priority rank.
     my $biblio = Koha::Biblios->find( $biblioNumber );
+    $biblioData->{object} = $biblio;
     my $holds = $biblio->holds;
     my $rank = $holds->count;
     $biblioData->{reservecount} = 1;    # new reserve
@@ -390,7 +391,6 @@ $template->param('item_level_itypes' => $itemLevelTypes);
 
 foreach my $biblioNum (@biblionumbers) {
 
-    my @not_available_at = ();
     my $record = GetMarcBiblio({ biblionumber => $biblioNum });
     # Init the bib item with the choices for branch pickup
     my %biblioLoopIter;
@@ -402,6 +402,12 @@ foreach my $biblioNum (@biblionumbers) {
         &get_out($query, $cookie, $template->output);
     }
 
+    my @not_available_at = ();
+    my $biblio = $biblioData->{object};
+    foreach my $library ( $pickup_locations->as_list ) {
+        push( @not_available_at, $library->branchcode ) unless $biblio->can_be_transferred({ to => $library });
+    }
+
     my $frameworkcode = GetFrameworkCode( $biblioData->{biblionumber} );
     $biblioLoopIter{biblionumber} = $biblioData->{biblionumber};
     $biblioLoopIter{title} = $biblioData->{title};