From 898c269150d32d21b6794db8b971128138aef2e9 Mon Sep 17 00:00:00 2001 From: James Winter Date: Wed, 12 Aug 2009 11:07:54 -0400 Subject: [PATCH] (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 --- members/pay.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/members/pay.pl b/members/pay.pl index 06ae687dd3..8b403691bd 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -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; -- 2.20.1