| Lines 163-169
          $dbh->do("DELETE FROM items WHERE holdingbranch = '$borrower_branchcode'");
      
      
        Link Here | 
        
          | 163 | # Frst branch from StaticHoldsQueueWeight | 163 | # Frst branch from StaticHoldsQueueWeight | 
        
          | 164 | test_queue ('take from lowest cost branch', 0, $borrower_branchcode, $other_branches[0]); | 164 | test_queue ('take from lowest cost branch', 0, $borrower_branchcode, $other_branches[0]); | 
        
          | 165 | test_queue ('take from lowest cost branch', 1, $borrower_branchcode, $least_cost_branch_code); | 165 | test_queue ('take from lowest cost branch', 1, $borrower_branchcode, $least_cost_branch_code); | 
          
            
              | 166 | my $queue = C4::HoldsQueue::GetHoldsQueueItems({ branchlimit => $least_cost_branch_code}) || []; | 166 | my ( $queue, undef ) = C4::HoldsQueue::GetHoldsQueueItems( { branchlimit => $least_cost_branch_code } ); | 
        
          | 167 | my $queue_item = $queue->next; | 167 | my $queue_item = $queue->next; | 
        
          | 168 | ok( $queue_item | 168 | ok( $queue_item | 
        
          | 169 |  && $queue_item->pickbranch eq $borrower_branchcode | 169 |  && $queue_item->pickbranch eq $borrower_branchcode | 
  
    | Lines 1889-1895
          subtest 'Remove holds on check-in match' => sub {
      
      
        Link Here | 
        
          | 1889 | }; | 1889 | }; | 
        
          | 1890 |  | 1890 |  | 
        
          | 1891 | subtest "GetHoldsQueueItems" => sub { | 1891 | subtest "GetHoldsQueueItems" => sub { | 
          
            
              | 1892 |     plan tests => 4; | 1892 |     plan tests => 8; | 
        
          | 1893 |  | 1893 |  | 
        
          | 1894 |     $schema->storage->txn_begin; | 1894 |     $schema->storage->txn_begin; | 
        
          | 1895 |  | 1895 |  | 
  
    | Lines 1943-1969
          subtest "GetHoldsQueueItems" => sub {
      
      
        Link Here | 
        
          | 1943 |         ($itemnumber_3,$biblionumber_3,'','','',42,'','') | 1943 |         ($itemnumber_3,$biblionumber_3,'','','',42,'','') | 
        
          | 1944 |      " ); | 1944 |      " ); | 
        
          | 1945 |  | 1945 |  | 
          
            
              | 1946 |     my $queue_items = GetHoldsQueueItems(); | 1946 |     my ( $queue_items, $queue_count ) = GetHoldsQueueItems(); | 
        
          | 1947 |     is( $queue_items->count, $count + 3, 'Three items added to queue' ); | 1947 |     is( $queue_items->count, $count + 3, 'Three items added to queue' ); | 
            
              |  |  | 1948 |     is( $queue_count,        $count + 3, 'Correct count of items in queue' ); | 
        
          | 1948 |  | 1949 |  | 
          
            
              | 1949 |     $queue_items = GetHoldsQueueItems( { itemtypeslimit => $item_1->itype } ); | 1950 |     ( $queue_items, $queue_count ) = GetHoldsQueueItems( { itemtypeslimit => $item_1->itype } ); | 
            
              | 1950 |     is( $queue_items->count, | 1951 |     is( | 
            
              | 1951 |         3, 'Three items of same itemtype found when itemtypeslimit passed' ); | 1952 |         $queue_items->count, | 
            
              |  |  | 1953 |         3, 'Three items of same itemtype found when itemtypeslimit passed' | 
            
              | 1954 |     ); | 
            
              | 1955 |     is( $queue_count, $count + 3, 'Correct count of items in queue' ); | 
        
          | 1952 |  | 1956 |  | 
          
            
              | 1953 |     $queue_items = GetHoldsQueueItems( | 1957 |     ( $queue_items, $queue_count ) = | 
            
              | 1954 |         { itemtypeslimit => $item_1->itype, ccodeslimit => $item_2->ccode } ); | 1958 |         GetHoldsQueueItems( { itemtypeslimit => $item_1->itype, ccodeslimit => $item_2->ccode } ); | 
            
              | 1955 |     is( $queue_items->count, | 1959 |     is( | 
            
              | 1956 |         2, 'Two items of same collection found when ccodeslimit passed' ); | 1960 |         $queue_items->count, | 
            
              |  |  | 1961 |         2, 'Two items of same collection found when ccodeslimit passed' | 
            
              | 1962 |     ); | 
            
              | 1963 |     is( $queue_count, $count + 2, 'Correct count of items in queue' ); | 
        
          | 1957 |  | 1964 |  | 
          
            
              | 1958 |     $queue_items = GetHoldsQueueItems( | 1965 |     ( $queue_items, $queue_count ) = GetHoldsQueueItems( | 
        
          | 1959 |         { | 1966 |         { | 
        
          | 1960 |             itemtypeslimit => $item_1->itype, | 1967 |             itemtypeslimit => $item_1->itype, | 
        
          | 1961 |             ccodeslimit    => $item_2->ccode, | 1968 |             ccodeslimit    => $item_2->ccode, | 
        
          | 1962 |             locationslimit => $item_3->location | 1969 |             locationslimit => $item_3->location | 
        
          | 1963 |         } | 1970 |         } | 
        
          | 1964 |     ); | 1971 |     ); | 
          
            
              | 1965 |     is( scalar $queue_items->count, | 1972 |     is( | 
            
              | 1966 |         1, 'One item of shleving location found when locationslimit passed' ); | 1973 |         scalar $queue_items->count, | 
            
              |  |  | 1974 |         1, 'One item of shelving location found when locationslimit passed' | 
            
              | 1975 |     ); | 
            
              | 1976 |     is( $queue_count, $count + 1, 'Correct count of items in queue' ); | 
        
          | 1967 |  | 1977 |  | 
        
          | 1968 |     $schema->storage->txn_rollback; | 1978 |     $schema->storage->txn_rollback; | 
        
          | 1969 | }; | 1979 | }; | 
            
              | 1970 | -  |  |  |