-my ( $total, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber);
-foreach my $accountline (@$accts) {
- if ( $accountline->{accounttype} ne 'F'
- && $accountline->{accounttype} ne 'FU' )
- {
- $accountline->{printtitle} = 1;
- }
-}
+my $total = $patron->account->balance;
+my $accts = Koha::Account::Lines->search(
+ { borrowernumber => $patron->borrowernumber, amountoutstanding => { '!=' => 0 } },
+ { order_by => { -desc => 'accountlines_id' } }
+);