From a9ac1eff7f2cfd87ccca976d14f34ac3c18ff0ca Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 10 Oct 2017 10:40:19 -0400 Subject: [PATCH] Bug 12768: Revert changes to getcharges Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- C4/Accounts.pm | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/C4/Accounts.pm b/C4/Accounts.pm index a59e263753..256f7b2eb5 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -299,22 +299,15 @@ sub manualinvoice { } sub getcharges { - my ( $borrowerno, $accountno ) = @_; - my $dbh = C4::Context->dbh; - - my @params; - - my $query = "SELECT * FROM accountlines WHERE borrowernumber = ?"; - push( @params, $borrowerno ); - - if ( $accountno ) { - $query .= " AND accountno = ?"; - push( @params, $accountno ); - } + my ( $borrowerno, $timestamp, $accountno ) = @_; + my $dbh = C4::Context->dbh; + my $timestamp2 = $timestamp - 1; + my $query = ""; + my $sth = $dbh->prepare( + "SELECT * FROM accountlines WHERE borrowernumber=? AND accountno = ?" + ); + $sth->execute( $borrowerno, $accountno ); - my $sth = $dbh->prepare( $query ); - $sth->execute( @params ); - my @results; while ( my $data = $sth->fetchrow_hashref ) { push @results,$data; -- 2.39.5