koha-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-devel] CVS: koha/misc fines2.pl,1.1,1.2


From: Chris Cormack
Subject: [Koha-devel] CVS: koha/misc fines2.pl,1.1,1.2
Date: Sat Mar 16 18:32:02 2002

Update of /cvsroot/koha/koha/misc
In directory usw-pr-cvs1:/tmp/cvs-serv15021/misc

Modified Files:
        fines2.pl 
Log Message:
tidied up, less hlt specific now



Index: fines2.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/fines2.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** fines2.pl   26 Jan 2001 00:39:19 -0000      1.1
--- fines2.pl   17 Mar 2002 02:31:02 -0000      1.2
***************
*** 3,7 ****
  #script to keep total of number of issues;
  
! 
  use C4::Circulation::Fines;
  use Date::Manip;
--- 3,9 ----
  #script to keep total of number of issues;
  
! use C4::Database;
! use C4::Search;
! use C4::Circulation::Circ2;
  use C4::Circulation::Fines;
  use Date::Manip;
***************
*** 16,22 ****
  $year=$year+1900;
  my $date=Date_DaysSince1BC($mon,$mday,$year);
! #my $date=Date_DaysSince1BC(12,4,2000);
  my $bornum;
! 
  my $total=0;
  my $max=5;
--- 18,24 ----
  $year=$year+1900;
  my $date=Date_DaysSince1BC($mon,$mday,$year);
! #my $date=Date_DaysSince1BC(1,24,2002);
  my $bornum;
! #print $date;
  my $total=0;
  my $max=5;
***************
*** 38,47 ****
      if ($amount > 0){
        
UpdateFine($data->[$i]->{'itemnumber'},$data->[$i]->{'borrowernumber'},$amount,$type,$due);
!       if ($amount ==5){
  #           marklost();
!       }
!       print 
"$printout\t$borrower->{'cardnumber'}\t$borrower->{'categorycode'}\t$borrower->{'firstname'}\t$borrower->{'surname'}\t$data->[$i]->{'date_due'}\t$type\t$difference\t$borrower->{'emailaddress'}\t$borrower->{'phone'}\t$borrower->{'streetaddress'}\t$borrower->{'city'}\t$amount\n";
      } else {
  #      print "$borrower->{'cardnumber'}\t$borrower->{'categorycode'}\t0 
fine\n";
      }
  
--- 40,87 ----
      if ($amount > 0){
        
UpdateFine($data->[$i]->{'itemnumber'},$data->[$i]->{'borrowernumber'},$amount,$type,$due);
! #      if ($amount ==5){
  #           marklost();
! #      }
!        if ($borrower->{'categorycode'} eq 'C'){
!        my $dbh=C4Connect;
!        my $query="Select * from borrowers where 
borrowernumber='$borrower->{'guarantor'}'";
!        my $sth=$dbh->prepare($query);
!        $sth->execute;
!        my $tdata=$sth->fetchrow_hashref;
!        $sth->finish;
!        $dbh->disconnect;
!        $borrower->{'phone'}=$tdata->{'phone'};
!        }
!        print 
"$printout\t$borrower->{'cardnumber'}\t$borrower->{'categorycode'}\t$borrower->{'firstname'}\t$borrower->{'surname'}\t$data->[$i]->{'date_due'}\t$type\t$difference\t$borrower->{'emailaddress'}\t$borrower->{'phone'}\t$borrower->{'streetaddress'}\t$borrower->{'city'}\t$amount\n";
      } else {
  #      print "$borrower->{'cardnumber'}\t$borrower->{'categorycode'}\t0 
fine\n";
+     }
+     if ($difference >= 28){ 
+       my $borrower=BorType($data->[$i]->{'borrowernumber'});
+       if ($borrower->{'cardnumber'} ne ''){
+         my $cost=ReplacementCost($data->[$i]->{'itemnumber'});        
+       my $dbh=C4Connect;
+       my $env;
+       my 
$accountno=C4::Circulation::Circ2::getnextacctno($env,$data->[$i]->{'borrowernumber'},$dbh);
+       my $item=itemnodata($env,$dbh,$data->[$i]->{'itemnumber'});
+       if ($item->{'itemlost'} ne '1' && $item->{'itemlost'} ne '2' ){
+         $item->{'title'}=~ s/\'/\\'/g;
+         my $query="Insert into accountlines
+         (borrowernumber,itemnumber,accountno,date,amount,
+         description,accounttype,amountoutstanding) values
+         ($data->[$i]->{'borrowernumber'},$data->[$i]->{'itemnumber'},
+         '$accountno',now(),'$cost','Lost item $item->{'title'} 
$item->{'barcode'}','L','$cost')";
+         my $sth=$dbh->prepare($query);
+         $sth->execute;
+         $sth->finish;
+         $query="update items set itemlost=2 where 
itemnumber='$data->[$i]->{'itemnumber'}'";
+         $sth=$dbh->prepare($query);
+         $sth->execute;
+         $sth->finish;
+       } else {
+         
+       }
+       $dbh->disconnect;
+       }
      }
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]