@@ -, +, @@ paycollect.pl - Add a $5 credit to a patron - Add a $1 fine - Go to the 'Pay fines' tab - Try to pay all fines (Observe you cannot do that) - Apply this patch - Reload - Sign off :-D --- members/pay.pl | 3 +-- members/paycollect.pl | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) --- a/members/pay.pl +++ a/members/pay.pl @@ -139,8 +139,7 @@ output_html_with_http_headers $input, $cookie, $template->output; sub add_accounts_to_template { my $patron = Koha::Patrons->find( $borrowernumber ); - my $total = $patron->account->balance; - my $account_lines = Koha::Account::Lines->search({ borrowernumber => $borrowernumber, amountoutstanding => { '!=' => 0 } }, { order_by => ['accounttype'] }); + my ( $total, $account_lines ) = Koha::Account->new( { patron_id => $borrowernumber } )->outstanding_debits; my @accounts; while ( my $account_line = $account_lines->next ) { $account_line = $account_line->unblessed; --- a/members/paycollect.pl +++ a/members/paycollect.pl @@ -59,8 +59,7 @@ my $category = $patron->category; my $user = $input->remote_user; my $branch = C4::Context->userenv->{'branch'}; - -my $total_due = $patron->account->balance; +my ( $total_due ) = Koha::Account->new( { patron_id => $borrowernumber } )->outstanding_debits; my $total_paid = $input->param('paid'); my $individual = $input->param('pay_individual'); --