Bug 12768: Revert changes to getcharges

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Kyle M Hall 2017-10-10 10:40:19 -04:00 committed by Jonathan Druart
parent c1620ece00
commit a9ac1eff7f
1 changed files with 8 additions and 15 deletions

View File

@ -299,22 +299,15 @@ sub manualinvoice {
}
sub getcharges {
my ( $borrowerno, $accountno ) = @_;
my $dbh = C4::Context->dbh;
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 @params;
my $query = "SELECT * FROM accountlines WHERE borrowernumber = ?";
push( @params, $borrowerno );
if ( $accountno ) {
$query .= " AND accountno = ?";
push( @params, $accountno );
}
my $sth = $dbh->prepare( $query );
$sth->execute( @params );
my @results;
while ( my $data = $sth->fetchrow_hashref ) {
push @results,$data;