From 79c0fd029c788be9dbb2ee73e5a4fbf7f3bc627f Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 13 Mar 2008 17:18:17 -0500 Subject: [PATCH] fix crash when writing off fine that is not associated with an item Signed-off-by: Joshua Ferraro --- members/pay.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/members/pay.pl b/members/pay.pl index 6ea2c21716..31413bbc9e 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -186,6 +186,7 @@ sub writeoff { my ( $borrowernumber, $accountnum, $itemnum, $accounttype, $amount ) = @_; my $user = $input->remote_user; my $dbh = C4::Context->dbh; + 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=?" -- 2.39.5