Bug 6503 - Variable $sth is declared 3 times (with keyword "my") in "makepayment" sub of "Accounts.pm"
In the code available today (14-Jun-2011), in Koha git's "master" branch,
the file "Accounts.pm" (in the "C4" directory) has the variable "$sth"
declared 3 times in the "makepayment" sub. This causes the following
warnings to appear when running "make test" in Koha installation, for
several tests:
t/Heading.t ......................... "my" variable $sth masks earlier declaration
in same scope at kohaclone/blib/PERL_MODULE_DIR/C4/Accounts.pm line 172.
"my" variable $sth masks earlier declaration in same scope at
kohaclone/blib/PERL_MODULE_DIR/C4/Accounts.pm line 188.
[...]
t/ILSDI_Services.t .................. "my" variable $sth masks earlier declaration
in same scope at kohaclone/blib/PERL_MODULE_DIR/C4/Accounts.pm line 172.
"my" variable $sth masks earlier declaration in same scope
at kohaclone/blib/PERL_MODULE_DIR/C4/Accounts.pm line 188.
[...etc...]
Therefore, I'm removing the "my" keyword from the declarations of "$sth"
in lines 172 and 188 of "Accounts.pm".
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit 71d22ab827)
Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
This commit is contained in:
parent
d397e16eb3
commit
a5d777bd3f
|
|
@ -169,7 +169,7 @@ sub makepayment {
|
|||
my $data = $sth->fetchrow_hashref;
|
||||
$sth->finish;
|
||||
|
||||
my $sth = $dbh->prepare("UPDATE accountlines
|
||||
$sth = $dbh->prepare("UPDATE accountlines
|
||||
SET amountoutstanding = 0
|
||||
WHERE borrowernumber = ?
|
||||
AND accountno = ?");
|
||||
|
|
@ -185,7 +185,7 @@ sub makepayment {
|
|||
|
||||
# create new line
|
||||
my $payment = 0 - $amount;
|
||||
my $sth = $dbh->prepare("INSERT INTO accountlines
|
||||
$sth = $dbh->prepare("INSERT INTO accountlines
|
||||
(borrowernumber, accountno, date, amount,
|
||||
description, accounttype, amountoutstanding)
|
||||
VALUES (?,?,now(),?,?,'Pay',0)");
|
||||
|
|
|
|||
Loading…
Reference in New Issue