| Lines 180-188
          Top level function that turns reserves into tmp_holdsqueue and hold_fill_targets
      
      
        Link Here | 
        
          | 180 | sub CreateQueue { | 180 | sub CreateQueue { | 
        
          | 181 |     my $dbh   = C4::Context->dbh; | 181 |     my $dbh   = C4::Context->dbh; | 
        
          | 182 |  | 182 |  | 
            
              | 183 |     $dbh->do("DELETE FROM tmp_holdsqueue");  # clear the old table for new info |  |  | 
            
              | 184 |     $dbh->do("DELETE FROM hold_fill_targets"); | 
            
              | 185 |  | 
        
          | 186 |     my $total_bibs            = 0; | 183 |     my $total_bibs            = 0; | 
        
          | 187 |     my $total_requests        = 0; | 184 |     my $total_requests        = 0; | 
        
          | 188 |     my $total_available_items = 0; | 185 |     my $total_available_items = 0; | 
  
    | Lines 201-209
          sub CreateQueue {
      
      
        Link Here | 
        
          | 201 |  | 198 |  | 
        
          | 202 |     $branches_to_use = load_branches_to_pull_from($use_transport_cost_matrix); | 199 |     $branches_to_use = load_branches_to_pull_from($use_transport_cost_matrix); | 
        
          | 203 |  | 200 |  | 
          
            
              | 204 |     my $bibs_with_pending_requests = GetBibsWithPendingHoldRequests(); | 201 |     my $bibs_to_process = GetBibsWithPendingHoldRequests(); | 
        
          | 205 |  | 202 |  | 
        
          | 206 |     foreach my $biblionumber (@$bibs_with_pending_requests) { | 203 |     foreach my $biblionumber (@$bibs_with_pending_requests) { | 
            
              |  |  | 204 |         $dbh->do("DELETE FROM tmp_holdsqueue where biblionumber=?", undef, $biblionumber);  # clear the old table for new info | 
            
              | 205 |         $dbh->do("DELETE FROM hold_fill_targets where biblionumber=?", undef, $biblionumber); | 
            
              | 206 |  | 
        
          | 207 |         $total_bibs++; | 207 |         $total_bibs++; | 
        
          | 208 |         my $hold_requests   = GetPendingHoldRequestsForBib($biblionumber); | 208 |         my $hold_requests   = GetPendingHoldRequestsForBib($biblionumber); | 
        
          | 209 |         my $available_items = GetItemsAvailableToFillHoldRequestsForBib($biblionumber, $branches_to_use); | 209 |         my $available_items = GetItemsAvailableToFillHoldRequestsForBib($biblionumber, $branches_to_use); |