| 
      
            Lines 17-23
          
      
      
        Link Here
      
     | 
  
        
          | 17 | 
           | 
          17 | 
           | 
        
        
          | 18 | 
          use Modern::Perl;  | 
          18 | 
          use Modern::Perl;  | 
        
        
          | 19 | 
           | 
          19 | 
           | 
        
          
            
              | 20 | 
              use Test::More tests => 58;  | 
              20 | 
              use Test::More tests => 56;  | 
            
        
          | 21 | 
          use Test::MockModule;  | 
          21 | 
          use Test::MockModule;  | 
        
        
          | 22 | 
          use Test::Warn;  | 
          22 | 
          use Test::Warn;  | 
        
        
          | 23 | 
           | 
          23 | 
           | 
        
  
    | 
      
            Lines 540-569
          $item = GetItem($itemnumber);
      
      
        Link Here
      
     | 
  
        
          | 540 | 
           | 
          540 | 
           | 
        
        
          | 541 | 
          ok( C4::Reserves::IsAvailableForItemLevelRequest($item, $borrower), "Reserving a book on item level" );  | 
          541 | 
          ok( C4::Reserves::IsAvailableForItemLevelRequest($item, $borrower), "Reserving a book on item level" );  | 
        
        
          | 542 | 
           | 
          542 | 
           | 
        
            
              | 543 | 
              my $itype = C4::Reserves::_get_itype($item);  | 
               | 
               | 
            
            
              | 544 | 
              my $categorycode = $borrower->{categorycode}; | 
            
            
              | 545 | 
              my $holdingbranch = $item->{holdingbranch}; | 
            
            
              | 546 | 
              my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule(  | 
            
            
              | 547 | 
                  { | 
            
            
              | 548 | 
                      categorycode => $categorycode,  | 
            
            
              | 549 | 
                      itemtype     => $itype,  | 
            
            
              | 550 | 
                      branchcode   => $holdingbranch  | 
            
            
              | 551 | 
                  }  | 
            
            
              | 552 | 
              );  | 
            
            
              | 553 | 
               | 
            
            
              | 554 | 
              $dbh->do(  | 
            
            
              | 555 | 
                  "UPDATE issuingrules SET onshelfholds = 1 WHERE categorycode = ? AND itemtype= ? and branchcode = ?",  | 
            
            
              | 556 | 
                  undef,  | 
            
            
              | 557 | 
                  $issuing_rule->categorycode, $issuing_rule->itemtype, $issuing_rule->branchcode  | 
            
            
              | 558 | 
              );  | 
            
            
              | 559 | 
              ok( C4::Reserves::OnShelfHoldsAllowed($item, $borrower), "OnShelfHoldsAllowed() allowed" );  | 
            
            
              | 560 | 
              $dbh->do(  | 
            
            
              | 561 | 
                  "UPDATE issuingrules SET onshelfholds = 0 WHERE categorycode = ? AND itemtype= ? and branchcode = ?",  | 
            
            
              | 562 | 
                  undef,  | 
            
            
              | 563 | 
                  $issuing_rule->categorycode, $issuing_rule->itemtype, $issuing_rule->branchcode  | 
            
            
              | 564 | 
              );  | 
            
            
              | 565 | 
              ok( !C4::Reserves::OnShelfHoldsAllowed($item, $borrower), "OnShelfHoldsAllowed() disallowed" );  | 
            
            
              | 566 | 
               | 
            
        
          | 567 | 
          # tests for MoveReserve in relation to ConfirmFutureHolds (BZ 14526)  | 
          543 | 
          # tests for MoveReserve in relation to ConfirmFutureHolds (BZ 14526)  | 
        
        
          | 568 | 
          #   hold from A pos 1, today, no fut holds: MoveReserve should fill it  | 
          544 | 
          #   hold from A pos 1, today, no fut holds: MoveReserve should fill it  | 
        
        
          | 569 | 
          $dbh->do('DELETE FROM reserves', undef, ($bibnum)); | 
          545 | 
          $dbh->do('DELETE FROM reserves', undef, ($bibnum)); | 
        
            
              | 570 | 
              -   | 
               | 
               |