From e05f671116543656691511c5dc4f5d74dadf1aae Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Mon, 6 Jun 2011 15:40:27 +0100 Subject: [PATCH] Bug 6469: Avoid compile time warninggs in C4::Accounts Content-Type: text/plain; charset="utf-8" $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