(Bug 3527) Removed unnecessary WHERE from UPDATE statement

The WHERE in this statement selected a bunch of different accounttypes, mostly legacy items.
But for sub writeoff to be called in the first place, it must have been an account with a
positive amountoustanding already, and we have the borrowernumber and accountnumber, so this
WHERE was un-needed, and prevented writeoff of locally-defined manual invoice types.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
James Winter 2009-08-12 11:07:54 -04:00 committed by Galen Charlton
parent 13bef6756e
commit 898c269150

View file

@ -199,7 +199,7 @@ sub writeoff {
undef $itemnum unless $itemnum; # if no item is attached to fine, make sure to store it as a NULL
my $sth =
$dbh->prepare(
"Update accountlines set amountoutstanding=0 where (accounttype='Res' OR accounttype='FU' OR accounttype ='IP' OR accounttype='CH' OR accounttype='N' OR accounttype='F' OR accounttype='A' OR accounttype='M' OR accounttype='L' OR accounttype='RE' OR accounttype='RL') and accountno=? and borrowernumber=?"
"Update accountlines set amountoutstanding=0 where accountno=? and borrowernumber=?"
);
$sth->execute( $accountnum, $borrowernumber );
$sth->finish;