[Koha-patches] [PATCH] Bug 6469: Avoid compile time warninggs in C4::Accounts

Colin Campbell colin.campbell at ptfs-europe.com
Mon Jun 6 16:44:21 CEST 2011


$sth was redeclared in the same scope. Overwriting its value
with the return from prepare is adequate

removed some tab/space mixed indents from the SQL strings
---
 C4/Accounts.pm |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/C4/Accounts.pm b/C4/Accounts.pm
index 7bddd1a..fd834b6 100644
--- a/C4/Accounts.pm
+++ b/C4/Accounts.pm
@@ -169,10 +169,10 @@ sub makepayment {
     my $data = $sth->fetchrow_hashref;
     $sth->finish;
 
-    my $sth = $dbh->prepare("UPDATE accountlines
-			        SET amountoutstanding = 0
-			      WHERE borrowernumber = ?
-				AND accountno = ?");
+    $sth = $dbh->prepare('UPDATE accountlines
+        SET amountoutstanding = 0
+        WHERE borrowernumber = ?
+        AND accountno = ?');
     $sth->execute($borrowernumber, $accountno);
 
     #  print $updquery;
@@ -185,10 +185,10 @@ sub makepayment {
 
     # create new line
     my $payment = 0 - $amount;
-    my $sth = $dbh->prepare("INSERT INTO accountlines
-					 (borrowernumber, accountno, date, amount,
-					  description, accounttype, amountoutstanding)
-				  VALUES (?,?,now(),?,?,'Pay',0)");
+    $sth = $dbh->prepare("INSERT INTO accountlines
+           (borrowernumber, accountno, date, amount,
+            description, accounttype, amountoutstanding)
+            VALUES (?,?,now(),?,?,'Pay',0)");
     $sth->execute($borrowernumber, $nextaccntno, $payment, "Payment,thanks - $user");
 
     # FIXME - The second argument to &UpdateStats is supposed to be the
-- 
1.7.5.2



More information about the Koha-patches mailing list