koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] CVS: koha/C4 Accounts2.pm,1.14,1.15


From: Andrew Arensburger
Subject: [Koha-cvs] CVS: koha/C4 Accounts2.pm,1.14,1.15
Date: Sat, 05 Oct 2002 16:57:42 -0700

Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv17547

Modified Files:
        Accounts2.pm 
Log Message:
Replaced several prepare()/execute()/finish() sequences with do().


Index: Accounts2.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Accounts2.pm,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** Accounts2.pm        5 Oct 2002 09:48:03 -0000       1.14
--- Accounts2.pm        5 Oct 2002 23:57:39 -0000       1.15
***************
*** 162,187 ****
    my $data=$sth->fetchrow_hashref;
    $sth->finish;
!   # FIXME - This prepare/execute/finish sequence could be done with
!   # $dbh->do(), no?
!   my $updquery="Update accountlines set amountoutstanding=0 where
!   borrowernumber=$bornumber and accountno=$accountno";
!   $sth=$dbh->prepare($updquery);
!   $sth->execute;
!   $sth->finish;
  #  print $updquery;
!   $updquery = "insert into accountoffsets
!   (borrowernumber, accountno, offsetaccount,  offsetamount)
!   values ($bornumber,$accountno,$nextaccntno,$newamtos)";
!   my $usth = $dbh->prepare($updquery);
!   $usth->execute;
!   $usth->finish;
    # create new line
    my $payment=0-$amount;
!   $updquery = "insert into accountlines
!   (borrowernumber, 
accountno,date,amount,description,accounttype,amountoutstanding)
!   values ($bornumber,$nextaccntno,now(),$payment,'Payment,thanks - $user', 
'Pay',0)";
!   $usth = $dbh->prepare($updquery);
!   $usth->execute;
!   $usth->finish;
    # FIXME - The second argument to &UpdateStats is supposed to be the
    # branch code.
--- 162,191 ----
    my $data=$sth->fetchrow_hashref;
    $sth->finish;
! 
!   $dbh->do(<<EOT);
!       UPDATE  accountlines
!       SET     amountoutstanding = 0
!       WHERE   borrowernumber = $bornumber
!         AND   accountno = $accountno
! EOT
! 
  #  print $updquery;
!   $dbh->do(<<EOT);
!       INSERT INTO     accountoffsets
!                       (borrowernumber, accountno, offsetaccount,
!                        offsetamount)
!       VALUES          ($bornumber, $accountno, $nextaccntno, $newamtos)
! EOT
! 
    # create new line
    my $payment=0-$amount;
!   $dbh->do(<<EOT);
!       INSERT INTO     accountlines
!                       (borrowernumber, accountno, date, amount,
!                        description, accounttype, amountoutstanding)
!       VALUES          ($bornumber, $nextaccntno, now(), $payment,
!                       'Payment,thanks - $user', 'Pay', 0)
! EOT
! 
    # FIXME - The second argument to &UpdateStats is supposed to be the
    # branch code.
***************
*** 242,252 ****
    my $outstanding=$data->{'amountoutstanding'}+$diff;
    $sth->finish;
!   # FIXME - Use $dbh->do();
!   $query="Update accountlines set 
amount='$amount',amountoutstanding='$outstanding' where
!           borrowernumber=$borrowernumber and accountno=$accountno";
!    $sth=$dbh->prepare($query);
! #   print $query;
!    $sth->execute;
!    $sth->finish;
   }
  
--- 246,257 ----
    my $outstanding=$data->{'amountoutstanding'}+$diff;
    $sth->finish;
! 
!   $dbh->do(<<EOT);
!       UPDATE  accountlines
!       SET     amount = '$amount',
!               amountoutstanding = '$outstanding'
!       WHERE   borrowernumber = $borrowernumber
!         AND   accountno = $accountno
! EOT
   }
  
***************
*** 316,332 ****
      $desc.=" ".$itemnum;
      $desc=$dbh->quote($desc);
!     # FIXME - Use $dbh->do();
!     $insert="insert into accountlines 
(borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,itemnumber)
!     values 
($bornum,$accountno,now(),'$amount',$desc,'$type','$amountleft','$data->{'itemnumber'}')";
    } else {
!       $desc=$dbh->quote($desc);
!     # FIXME - Use $dbh->do();
!     $insert="insert into accountlines 
(borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding)
!     values ($bornum,$accountno,now(),'$amount',$desc,'$type','$amountleft')";
    }
- 
-   my $sth=$dbh->prepare($insert);
-   $sth->execute;
-   $sth->finish;
  }
  
--- 321,343 ----
      $desc.=" ".$itemnum;
      $desc=$dbh->quote($desc);
!     $dbh->do(<<EOT);
!       INSERT INTO     accountlines
!                       (borrowernumber, accountno, date, amount,
!                        description, accounttype, amountoutstanding,
!                        itemnumber)
!       VALUES          ($bornum, $accountno, now(), '$amount',
!                        $desc, '$type', '$amountleft',
!                        '$data->{'itemnumber'}')
! EOT
    } else {
!     $desc=$dbh->quote($desc);
!     $dbh->do(<<EOT);
!       INSERT INTO     accountlines
!                       (borrowernumber, accountno, date, amount,
!                        description, accounttype, amountoutstanding)
!       VALUES          ($bornum, $accountno, now(), '$amount',
!                        $desc, '$type', '$amountleft')
! EOT
    }
  }
  




reply via email to

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