@@ -, +, @@ --- C4/Accounts.pm | 18 ------------------ C4/ILSDI/Services.pm | 8 ++++---- t/db_dependent/Accounts.t | 1 - 3 files changed, 4 insertions(+), 23 deletions(-) --- a/C4/Accounts.pm +++ a/C4/Accounts.pm @@ -39,7 +39,6 @@ BEGIN { @EXPORT = qw( &manualinvoice &getnextacctno - &getcharges &chargelostitem &ReversePayment &purge_zero_balance_fees @@ -280,23 +279,6 @@ sub manualinvoice { return 0; } -sub getcharges { - 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 @results; - while ( my $data = $sth->fetchrow_hashref ) { - push @results,$data; - } - return (@results); -} - #FIXME: ReversePayment should be replaced with a Void Payment feature sub ReversePayment { my ($accountlines_id) = @_; --- a/C4/ILSDI/Services.pm +++ a/C4/ILSDI/Services.pm @@ -425,11 +425,11 @@ sub GetPatronInfo { # Fines management if ( $cgi->param('show_fines') && $cgi->param('show_fines') eq "1" ) { - my @charges; - for ( my $i = 1 ; my @charge = getcharges( $borrowernumber, undef, $i ) ; $i++ ) { - push( @charges, @charge ); + + my $account_lines = $patron->account->lines; + while (my $line = $account_lines->next ) { + push @{ $borrower->{fines}{fine} }, $line->unblessed; } - $borrower->{'fines'}->{'fine'} = \@charges; } # Reserves management --- a/t/db_dependent/Accounts.t +++ a/t/db_dependent/Accounts.t @@ -44,7 +44,6 @@ can_ok( 'C4::Accounts', getnextacctno chargelostitem manualinvoice - getcharges ReversePayment purge_zero_balance_fees ) ); --