| 
      
            Lines 1421-1427
          sub AddIssue {
      
      
        Link Here
      
     | 
  
        
          | 1421 | 
                              datelastborrowed => DateTime->now( time_zone => C4::Context->tz() )->ymd(),  | 
          1421 | 
                              datelastborrowed => DateTime->now( time_zone => C4::Context->tz() )->ymd(),  | 
        
        
          | 1422 | 
                          },  | 
          1422 | 
                          },  | 
        
        
          | 1423 | 
                          $item->{'biblionumber'}, | 
          1423 | 
                          $item->{'biblionumber'}, | 
        
          
            
              | 1424 | 
                              $item->{'itemnumber'} | 
              1424 | 
                              $item->{'itemnumber'}, | 
            
            
               | 
               | 
              1425 | 
                              0  | 
            
        
          | 1425 | 
                      );  | 
          1426 | 
                      );  | 
        
        
          | 1426 | 
                      ModDateLastSeen( $item->{'itemnumber'} ); | 
          1427 | 
                      ModDateLastSeen( $item->{'itemnumber'} ); | 
        
        
          | 1427 | 
           | 
          1428 | 
           | 
        
  
    | 
      
            Lines 1863-1869
          sub AddReturn {
      
      
        Link Here
      
     | 
  
        
          | 1863 | 
                      $item->{location} = $item->{permanent_location}; | 
          1864 | 
                      $item->{location} = $item->{permanent_location}; | 
        
        
          | 1864 | 
                  }  | 
          1865 | 
                  }  | 
        
        
          | 1865 | 
           | 
          1866 | 
           | 
        
          
            
              | 1866 | 
                      ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} ); | 
              1867 | 
                      ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'}, 0 ); | 
            
        
          | 1867 | 
              }  | 
          1868 | 
              }  | 
        
        
          | 1868 | 
           | 
          1869 | 
           | 
        
        
          | 1869 | 
                  # full item data, but no borrowernumber or checkout info (no issue)  | 
          1870 | 
                  # full item data, but no borrowernumber or checkout info (no issue)  | 
        
  
    | 
      
            Lines 1887-1893
          sub AddReturn {
      
      
        Link Here
      
     | 
  
        
          | 1887 | 
                      foreach my $key ( keys %$rules ) { | 
          1888 | 
                      foreach my $key ( keys %$rules ) { | 
        
        
          | 1888 | 
                          if ( $item->{notforloan} eq $key ) { | 
          1889 | 
                          if ( $item->{notforloan} eq $key ) { | 
        
        
          | 1889 | 
                              $messages->{'NotForLoanStatusUpdated'} = { from => $item->{notforloan}, to => $rules->{$key} }; | 
          1890 | 
                              $messages->{'NotForLoanStatusUpdated'} = { from => $item->{notforloan}, to => $rules->{$key} }; | 
        
          
            
              | 1890 | 
                                  ModItem( { notforloan => $rules->{$key} }, undef, $itemnumber ); | 
              1891 | 
                                  ModItem( { notforloan => $rules->{$key} }, undef, $itemnumber, 0 ); | 
            
        
          | 1891 | 
                              last;  | 
          1892 | 
                              last;  | 
        
        
          | 1892 | 
                          }  | 
          1893 | 
                          }  | 
        
        
          | 1893 | 
                      }  | 
          1894 | 
                      }  | 
        
  
    | 
      
            Lines 1959-1965
          sub AddReturn {
      
      
        Link Here
      
     | 
  
        
          | 1959 | 
           | 
          1960 | 
           | 
        
        
          | 1960 | 
                  }  | 
          1961 | 
                  }  | 
        
        
          | 1961 | 
           | 
          1962 | 
           | 
        
          
            
              | 1962 | 
                      ModItem({ onloan => undef }, $issue->{'biblionumber'}, $item->{'itemnumber'}); | 
              1963 | 
                      ModItem({ onloan => undef }, $issue->{'biblionumber'}, $item->{'itemnumber'}, 0 ); | 
            
        
          | 1963 | 
              }  | 
          1964 | 
              }  | 
        
        
          | 1964 | 
           | 
          1965 | 
           | 
        
        
          | 1965 | 
              # the holdingbranch is updated if the document is returned to another location.  | 
          1966 | 
              # the holdingbranch is updated if the document is returned to another location.  | 
        
  
    | 
      
            Lines 2200-2206
          sub MarkIssueReturned {
      
      
        Link Here
      
     | 
  
        
          | 2200 | 
           | 
          2201 | 
           | 
        
        
          | 2201 | 
                  $dbh->do(q|DELETE FROM issues WHERE issue_id = ?|, undef, $issue_id);  | 
          2202 | 
                  $dbh->do(q|DELETE FROM issues WHERE issue_id = ?|, undef, $issue_id);  | 
        
        
          | 2202 | 
           | 
          2203 | 
           | 
        
          
            
              | 2203 | 
                      ModItem( { 'onloan' => undef }, undef, $itemnumber ); | 
              2204 | 
                      ModItem( { 'onloan' => undef }, undef, $itemnumber, 0 ); | 
            
        
          | 2204 | 
           | 
          2205 | 
           | 
        
        
          | 2205 | 
                  if ( C4::Context->preference('StoreLastBorrower') ) { | 
          2206 | 
                  if ( C4::Context->preference('StoreLastBorrower') ) { | 
        
        
          | 2206 | 
                      my $item = Koha::Items->find( $itemnumber );  | 
          2207 | 
                      my $item = Koha::Items->find( $itemnumber );  | 
        
  
    | 
      
            Lines 2437-2443
          sub _FixAccountForLostAndReturned {
      
      
        Link Here
      
     | 
  
        
          | 2437 | 
                  }  | 
          2438 | 
                  }  | 
        
        
          | 2438 | 
              );  | 
          2439 | 
              );  | 
        
        
          | 2439 | 
           | 
          2440 | 
           | 
        
          
            
              | 2440 | 
                  ModItem( { paidfor => '' }, undef, $itemnumber ); | 
              2441 | 
                  ModItem( { paidfor => '' }, undef, $itemnumber, 0 ); | 
            
        
          | 2441 | 
           | 
          2442 | 
           | 
        
        
          | 2442 | 
              return $credit_id;  | 
          2443 | 
              return $credit_id;  | 
        
        
          | 2443 | 
          }  | 
          2444 | 
          }  | 
        
  
    | 
      
            Lines 2894-2900
          sub AddRenewal {
      
      
        Link Here
      
     | 
  
        
          | 2894 | 
           | 
          2895 | 
           | 
        
        
          | 2895 | 
              # Update the renewal count on the item, and tell zebra to reindex  | 
          2896 | 
              # Update the renewal count on the item, and tell zebra to reindex  | 
        
        
          | 2896 | 
              $renews = $biblio->{'renewals'} + 1; | 
          2897 | 
              $renews = $biblio->{'renewals'} + 1; | 
        
          
            
              | 2897 | 
                  ModItem({ renewals => $renews, onloan => $datedue->strftime('%Y-%m-%d %H:%M')}, $biblio->{'biblionumber'}, $itemnumber); | 
              2898 | 
                  ModItem({ renewals => $renews, onloan => $datedue->strftime('%Y-%m-%d %H:%M')}, $biblio->{'biblionumber'}, $itemnumber, 0); | 
            
        
          | 2898 | 
           | 
          2899 | 
           | 
        
        
          | 2899 | 
              # Charge a new rental fee, if applicable?  | 
          2900 | 
              # Charge a new rental fee, if applicable?  | 
        
        
          | 2900 | 
              my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber );  | 
          2901 | 
              my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber );  | 
        
  
    | 
      
            Lines 3760-3766
          sub ProcessOfflineReturn {
      
      
        Link Here
      
     | 
  
        
          | 3760 | 
                      ModItem(  | 
          3761 | 
                      ModItem(  | 
        
        
          | 3761 | 
                          { renewals => 0, onloan => undef }, | 
          3762 | 
                          { renewals => 0, onloan => undef }, | 
        
        
          | 3762 | 
                          $issue->{'biblionumber'}, | 
          3763 | 
                          $issue->{'biblionumber'}, | 
        
          
            
              | 3763 | 
                              $itemnumber  | 
              3764 | 
                              $itemnumber,  | 
            
            
               | 
               | 
              3765 | 
                              0  | 
            
        
          | 3764 | 
                      );  | 
          3766 | 
                      );  | 
        
        
          | 3765 | 
                      return "Success.";  | 
          3767 | 
                      return "Success.";  | 
        
        
          | 3766 | 
                  } else { | 
          3768 | 
                  } else { |