From 7d8e8b0bf63807815280886f898553f76413a976 Mon Sep 17 00:00:00 2001 From: hdl Date: Tue, 24 Apr 2007 14:17:24 +0000 Subject: [PATCH] BugFixing : GetBorrowerAcctRecord now takes a date. --- C4/Members.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index c36aae7cc8..d04192933c 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -1109,20 +1109,21 @@ sub GetBorrowerAcctRecord { my @acctlines; my $numlines = 0; my $strsth = qq( - Select * from accountlines where -borrowernumber=? order by date desc,timestamp desc - ); +SELECT * +FROM accountlines +WHERE borrowernumber=?); my @bind = ($borrowernumber); if ($date && $date ne ''){ - $strsth.=" AND date < ?"; + $strsth.=" +AND date < ? "; push(@bind,$date); } - + $strsth.=" +ORDER BY date desc,timestamp DESC"; my $sth= $dbh->prepare( $strsth ); - $sth->execute( $borrowernumber); + $sth->execute( @bind ); my $total = 0; while ( my $data = $sth->fetchrow_hashref ) { - $acctlines[$numlines] = $data; $numlines++; $total += $data->{'amountoutstanding'}; -- 2.20.1