| 
      
            Lines 45-56
          my $data  = GetBiblioItemData($bi);
      
      
        Link Here
      
     | 
  
        
          | 45 | 
          my $homebranch    = $branches->{ $idata->{'homebranch'}    }->{'branchname'}; | 
          45 | 
          my $homebranch    = $branches->{ $idata->{'homebranch'}    }->{'branchname'}; | 
        
        
          | 46 | 
          my $holdingbranch = $branches->{ $idata->{'holdingbranch'} }->{'branchname'}; | 
          46 | 
          my $holdingbranch = $branches->{ $idata->{'holdingbranch'} }->{'branchname'}; | 
        
        
          | 47 | 
           | 
          47 | 
           | 
        
          
            
              | 48 | 
              my ( $lastmove, $message ) = lastmove($itm);  | 
              48 | 
              my $lastmove = lastmove($itm);  | 
            
        
          | 49 | 
           | 
          49 | 
           | 
        
        
          | 50 | 
          my $lastdate;  | 
          50 | 
          my $lastdate;  | 
        
        
          | 51 | 
          my $count;  | 
          51 | 
          my $count;  | 
        
        
          | 52 | 
          if ( not $lastmove ) { | 
          52 | 
          if ( not $lastmove ) { | 
        
            
              | 53 | 
              #    $lastdate = $message;  | 
               | 
               | 
            
        
          | 54 | 
              $count = issuessince( $itm, 0 );  | 
          53 | 
              $count = issuessince( $itm, 0 );  | 
        
        
          | 55 | 
          } else { | 
          54 | 
          } else { | 
        
        
          | 56 | 
              $lastdate = $lastmove->{'datearrived'}; | 
          55 | 
              $lastdate = $lastmove->{'datearrived'}; | 
        
  
    | 
      
            Lines 79-86
          foreach (@$branchloop) {
      
      
        Link Here
      
     | 
  
        
          | 79 | 
              $_->{seentime}   = $timechunk; | 
          78 | 
              $_->{seentime}   = $timechunk; | 
        
        
          | 80 | 
          }  | 
          79 | 
          }  | 
        
        
          | 81 | 
           | 
          80 | 
           | 
        
            
              | 82 | 
              ### $lastdate  | 
               | 
               | 
            
            
              | 83 | 
               | 
            
        
          | 84 | 
          $template->param(  | 
          81 | 
          $template->param(  | 
        
        
          | 85 | 
              biblionumber            => $biblionumber,  | 
          82 | 
              biblionumber            => $biblionumber,  | 
        
        
          | 86 | 
              title                   => $data->{'title'}, | 
          83 | 
              title                   => $data->{'title'}, | 
        
  
    | 
      
            Lines 112-125
          sub lastmove {
      
      
        Link Here
      
     | 
  
        
          | 112 | 
              );  | 
          109 | 
              );  | 
        
        
          | 113 | 
              $sth->execute($itemnumber);  | 
          110 | 
              $sth->execute($itemnumber);  | 
        
        
          | 114 | 
              my ($date) = $sth->fetchrow_array;  | 
          111 | 
              my ($date) = $sth->fetchrow_array;  | 
        
          
            
              | 115 | 
                  return ( 0, 1 ) if not $date;  | 
              112 | 
                  return 0 unless $date;  | 
            
        
          | 116 | 
              $sth = $dbh->prepare(  | 
          113 | 
              $sth = $dbh->prepare(  | 
        
        
          | 117 | 
          "SELECT * FROM branchtransfers WHERE branchtransfers.itemnumber=? and branchtransfers.datearrived=?"  | 
          114 | 
          "SELECT * FROM branchtransfers WHERE branchtransfers.itemnumber=? and branchtransfers.datearrived=?"  | 
        
        
          | 118 | 
              );  | 
          115 | 
              );  | 
        
        
          | 119 | 
              $sth->execute( $itemnumber, $date );  | 
          116 | 
              $sth->execute( $itemnumber, $date );  | 
        
        
          | 120 | 
              my ($data) = $sth->fetchrow_hashref;  | 
          117 | 
              my ($data) = $sth->fetchrow_hashref;  | 
        
          
            
              | 121 | 
                  return ( 0, 1 ) if not $data;  | 
              118 | 
                  return 0 unless $data;  | 
            
            
              | 122 | 
                  return ( $data, "" );  | 
              119 | 
                  return $data;  | 
            
        
          | 123 | 
          }  | 
          120 | 
          }  | 
        
        
          | 124 | 
           | 
          121 | 
           | 
        
        
          | 125 | 
          sub issuessince { | 
          122 | 
          sub issuessince { | 
        
  
    | 
      
            Lines 165-171
          sub lastseenat {
      
      
        Link Here
      
     | 
  
        
          | 165 | 
              "SELECT MAX(transfer) FROM (SELECT max(datearrived) AS transfer FROM branchtransfers WHERE itemnumber=? AND tobranch = ?  | 
          162 | 
              "SELECT MAX(transfer) FROM (SELECT max(datearrived) AS transfer FROM branchtransfers WHERE itemnumber=? AND tobranch = ?  | 
        
        
          | 166 | 
               UNION ALL  | 
          163 | 
               UNION ALL  | 
        
        
          | 167 | 
               SELECT max(datesent) AS transfer FROM branchtransfers WHERE itemnumber=? AND frombranch = ?  | 
          164 | 
               SELECT max(datesent) AS transfer FROM branchtransfers WHERE itemnumber=? AND frombranch = ?  | 
        
          
            
              | 168 | 
              	) tmp"  | 
              165 | 
                  ) tmp"  | 
            
        
          | 169 | 
              );  | 
          166 | 
              );  | 
        
        
          | 170 | 
              $sth->execute( $itm, $brc, $itm, $brc );  | 
          167 | 
              $sth->execute( $itm, $brc, $itm, $brc );  | 
        
        
          | 171 | 
              my ($date2) = $sth->fetchrow_array;  | 
          168 | 
              my ($date2) = $sth->fetchrow_array;  | 
        
  
    | 
      
            Lines 179-185
          sub lastseenat {
      
      
        Link Here
      
     | 
  
        
          | 179 | 
          sub slashdate { | 
          176 | 
          sub slashdate { | 
        
        
          | 180 | 
              my ($date) = @_;  | 
          177 | 
              my ($date) = @_;  | 
        
        
          | 181 | 
              $date or return;  | 
          178 | 
              $date or return;  | 
        
            
              | 182 | 
                  # warn "slashdate($date)...";  | 
               | 
               | 
            
        
          | 183 | 
              return (  | 
          179 | 
              return (  | 
        
        
          | 184 | 
                  format_date($date),  | 
          180 | 
                  format_date($date),  | 
        
        
          | 185 | 
                  substr($date,11,5)  | 
          181 | 
                  substr($date,11,5)  | 
        
            
              | 186 | 
              -   | 
               | 
               |