| 
      
            Lines 156-162
          unless ( $enddate ) {
      
      
        Link Here
      
     | 
  
        
          | 156 | 
          # building query parameters  | 
          156 | 
          # building query parameters  | 
        
        
          | 157 | 
          my %where = (  | 
          157 | 
          my %where = (  | 
        
        
          | 158 | 
              'me.found' => undef,  | 
          158 | 
              'me.found' => undef,  | 
        
          
            
              | 159 | 
                  'me.priority' => 1,  | 
              159 | 
                  'me.priority' => { '!=' => 0 }, | 
            
        
          | 160 | 
              'me.suspend' => 0,  | 
          160 | 
              'me.suspend' => 0,  | 
        
        
          | 161 | 
              'itembib.itemlost' => 0,  | 
          161 | 
              'itembib.itemlost' => 0,  | 
        
        
          | 162 | 
              'itembib.withdrawn' => 0,  | 
          162 | 
              'itembib.withdrawn' => 0,  | 
        
  
    | 
      
            Lines 188-194
          if ( C4::Context->preference('IndependentBranches') ){
      
      
        Link Here
      
     | 
  
        
          | 188 | 
          # get all distinct unfulfilled reserves  | 
          188 | 
          # get all distinct unfulfilled reserves  | 
        
        
          | 189 | 
          my $holds = Koha::Holds->search(  | 
          189 | 
          my $holds = Koha::Holds->search(  | 
        
        
          | 190 | 
              { %where }, | 
          190 | 
              { %where }, | 
        
          
            
              | 191 | 
                  { join => 'itembib', distinct  => 1, columns => qw[me.biblionumber] } | 
              191 | 
                  { join => 'itembib', distinct => 1, columns => qw[me.biblionumber] } | 
            
        
          | 192 | 
          );  | 
          192 | 
          );  | 
        
        
          | 193 | 
          my @biblionumbers = $holds->get_column('biblionumber'); | 
          193 | 
          my @biblionumbers = $holds->get_column('biblionumber'); | 
        
        
          | 194 | 
           | 
          194 | 
           | 
        
  
    | 
      
            Lines 202-208
          if ( $holds->count ) {
      
      
        Link Here
      
     | 
  
        
          | 202 | 
          # patrons count per biblio  | 
          202 | 
          # patrons count per biblio  | 
        
        
          | 203 | 
          my $patrons_count = { | 
          203 | 
          my $patrons_count = { | 
        
        
          | 204 | 
              map { $_->{biblionumber} => $_->{patrons_count} } @{ Koha::Holds->search( | 
          204 | 
              map { $_->{biblionumber} => $_->{patrons_count} } @{ Koha::Holds->search( | 
        
          
            
              | 205 | 
                          {}, | 
              205 | 
                          { 'suspend' => 0 }, | 
            
        
          | 206 | 
                      { | 
          206 | 
                      { | 
        
        
          | 207 | 
                          select   => [ 'biblionumber', { count => { distinct => 'borrowernumber' } } ], | 
          207 | 
                          select   => [ 'biblionumber', { count => { distinct => 'borrowernumber' } } ], | 
        
        
          | 208 | 
                          as       => [qw( biblionumber patrons_count )],  | 
          208 | 
                          as       => [qw( biblionumber patrons_count )],  | 
        
  
    | 
      
            Lines 235-241
          my $all_holds = {
      
      
        Link Here
      
     | 
  
        
          | 235 | 
           | 
          235 | 
           | 
        
        
          | 236 | 
          # make final holds_info array and fill with info  | 
          236 | 
          # make final holds_info array and fill with info  | 
        
        
          | 237 | 
          my @holds_info;  | 
          237 | 
          my @holds_info;  | 
        
            
               | 
               | 
              238 | 
              my $seen = {}; | 
            
        
          | 238 | 
          foreach my $bibnum ( @biblionumbers ){ | 
          239 | 
          foreach my $bibnum ( @biblionumbers ){ | 
        
            
               | 
               | 
              240 | 
                  # Skip this record if it's already been handled  | 
            
            
              | 241 | 
                  next if $seen->{$bibnum}; | 
            
            
              | 242 | 
                  $seen->{$bibnum} = 1; | 
            
        
          | 239 | 
           | 
          243 | 
           | 
        
        
          | 240 | 
              my $hold_info;  | 
          244 | 
              my $hold_info;  | 
        
        
          | 241 | 
              my $items = $all_items->{$bibnum}; | 
          245 | 
              my $items = $all_items->{$bibnum}; | 
        
            
              | 242 | 
              -   | 
               | 
               |