[Koha-patches] [PATCH] (Bug 3527) Removed unnecessary WHERE from UPDATE statement

J. David Bavousett dbavousett at ptfs.com
Wed Aug 12 17:07:54 CEST 2009


From: James Winter <winterj at arcadia.edu>

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.
---
 members/pay.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/members/pay.pl b/members/pay.pl
index 06ae687..8b40369 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;
-- 
1.5.6.5




More information about the Koha-patches mailing list