@@ -, +, @@ --- C4/ILSDI/Services.pm | 5 +---- Koha/Account.pm | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) --- a/C4/ILSDI/Services.pm +++ a/C4/ILSDI/Services.pm @@ -426,10 +426,7 @@ sub GetPatronInfo { # Fines management if ( $cgi->param('show_fines') && $cgi->param('show_fines') eq "1" ) { - my $account_lines = Koha::Account::Lines->search({ - borrowernumber => $patron->borrowernumber, - }); - + my $account_lines = $patron->account->lines; while (my $line = $account_lines->next ) { push @{ $borrower->{fines}{fine} }, $line->unblessed; } --- a/Koha/Account.pm +++ a/Koha/Account.pm @@ -524,6 +524,26 @@ sub non_issues_charges { : 0; } +=head3 lines + +my $lines = $self->lines; + +Return all credits and debits for the user, outstanding or otherwise + +=cut + +sub lines { + my ($self) = @_; + + my $lines = Koha::Account::Lines->search( + { + borrowernumber => $self->{patron_id}, + } + ); + + return $lines; +} + 1; =head2 Name mappings --