koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] CVS: koha pay.pl,1.8,1.8.2.1


From: MJ Ray
Subject: [Koha-cvs] CVS: koha pay.pl,1.8,1.8.2.1
Date: Thu, 08 Jan 2004 09:11:50 -0800

Update of /cvsroot/koha/koha
In directory sc8-pr-cvs1:/tmp/cvs-serv13509

Modified Files:
      Tag: rel_2_0
        pay.pl 
Log Message:
DBI call fix for bug 662.

Index: pay.pl
===================================================================
RCS file: /cvsroot/koha/koha/pay.pl,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -C2 -r1.8 -r1.8.2.1
*** pay.pl      6 Feb 2003 06:32:57 -0000       1.8
--- pay.pl      8 Jan 2004 17:11:48 -0000       1.8.2.1
***************
*** 158,183 ****
        my $dbh = C4::Context->dbh;
        my $env;
!       my $query="Update accountlines set amountoutstanding=0 where ";
        if ($accounttype eq 'Res'){
!               $query.="accounttype='Res' and accountno='$accountnum' and 
borrowernumber='$bornum'";
        } else {
!               $query.="accounttype='$accounttype' and itemnumber='$itemnum' 
and borrowernumber='$bornum'";
        }
-       my $sth=$dbh->prepare($query);
-       #  print $query;
-       $sth->execute;
        $sth->finish;
!       $query="select max(accountno) from accountlines";
!       $sth=$dbh->prepare($query);
        $sth->execute;
        my $account=$sth->fetchrow_hashref;
        $sth->finish;
        $account->{'max(accountno)'}++;
!       $query="insert into accountlines 
(borrowernumber,accountno,itemnumber,date,amount,description,accounttype)
!                                               values 
('$bornum','$account->{'max(accountno)'}','$itemnum',now(),'$amount','Writeoff','W')";
!       $sth=$dbh->prepare($query);
!       $sth->execute;
        $sth->finish;
-       #  print $query;
        UpdateStats($env,$user,'writeoff',$amount,'','','',$bornum);
  }
--- 158,179 ----
        my $dbh = C4::Context->dbh;
        my $env;
!       my $sth;
        if ($accounttype eq 'Res'){
!               $sth=$dbh->prepare("Update accountlines set amountoutstanding=0 
where accounttype='Res' and accountno=? and borrowernumber=?");
!               $sth->execute($accountnum,$bornum);
        } else {
!               $sth=$dbh->prepare("Update accountlines set amountoutstanding=0 
where accounttype=? and itemnumber=? and borrowernumber=?");
!               $sth->execute($accounttype,$itemnum,$bornum);
        }
        $sth->finish;
!       $sth=$dbh->prepare("select max(accountno) from accountlines");
        $sth->execute;
        my $account=$sth->fetchrow_hashref;
        $sth->finish;
        $account->{'max(accountno)'}++;
!       $sth=$dbh->prepare("insert into accountlines 
(borrowernumber,accountno,itemnumber,date,amount,description,accounttype)
!                                               values 
(?,?,?,now(),?,'Writeoff','W')");
!       $sth->execute($bornum,$account->{'max(accountno)'},$itemnum,$amount);
        $sth->finish;
        UpdateStats($env,$user,'writeoff',$amount,'','','',$bornum);
  }




reply via email to

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