@@ -, +, @@ GetMemberAccountRecords circ/circulation.pl opac/opac-main.pl opac/opac-reserve.pl opac/opac-user.pl reserve/request.pl --- circ/circulation.pl | 2 +- opac/opac-main.pl | 4 +++- opac/opac-reserve.pl | 3 ++- opac/opac-user.pl | 4 +++- reserve/request.pl | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -543,7 +543,7 @@ foreach my $flag ( sort keys %$flags ) { my $amountold = $flags ? $flags->{'CHARGES'}->{'message'} || 0 : 0; $amountold =~ s/^.*\$//; # remove upto the $, if any -my ( $total, $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber ); +my $total = $patron ? $patron->account->balance : 0; if ( $patron && $patron->category->category_type eq 'C') { my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); --- a/opac/opac-main.pl +++ a/opac/opac-main.pl @@ -29,6 +29,7 @@ use C4::Members; use C4::Overdues; use Koha::Checkouts; use Koha::Holds; +use Koha::Patrons; my $input = new CGI; my $dbh = C4::Context->dbh; @@ -72,7 +73,8 @@ if ( defined $borrowernumber ){ my ( $overdues_count, $overdues ) = checkoverdues($borrowernumber); my $holds_pending = Koha::Holds->search({ borrowernumber => $borrowernumber, found => undef })->count; my $holds_waiting = Koha::Holds->search({ borrowernumber => $borrowernumber })->waiting->count; - my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber ); + my $patron = Koha::Patrons->find( $borrowernumber ); + my $total = $patron ? $patron->account->balance : 0; if ( $checkouts > 0 || $overdues_count > 0 || $holds_pending > 0 || $holds_waiting > 0 || $total > 0 ) { $template->param( dashboard_info => 1 ); --- a/opac/opac-reserve.pl +++ a/opac/opac-reserve.pl @@ -329,7 +329,8 @@ if ( $query->param('place_reserve') ) { my $noreserves = 0; my $maxoutstanding = C4::Context->preference("maxoutstanding"); $template->param( noreserve => 1 ) unless $maxoutstanding; -my ( $amountoutstanding ) = GetMemberAccountRecords($borrowernumber); +my $amountoutstanding = $patron ? $patron->account->balance : 0; + if ( $amountoutstanding && ($amountoutstanding > $maxoutstanding) ) { my $amount = sprintf "%.02f", $amountoutstanding; $template->param( message => 1 ); --- a/opac/opac-user.pl +++ a/opac/opac-user.pl @@ -116,7 +116,9 @@ if ( $userdebarred || $borr->{'gonenoaddress'} || $borr->{'lost'} ) { $canrenew = 0; } -my ( $amountoutstanding ) = GetMemberAccountRecords($borrowernumber); +my $patron = Koha::Patrons->find( $borrowernumber ); +my $amountoutstanding = $patron ? $patron->account->balance : 0; + if ( $amountoutstanding > 5 ) { $borr->{'amountoverfive'} = 1; } --- a/reserve/request.pl +++ a/reserve/request.pl @@ -198,7 +198,7 @@ if ($borrowernumber_hold && !$action) { messages => $messages, warnings => $warnings, restricted => $is_debarred, - amount_outstanding => GetMemberAccountRecords($patron->borrowernumber), + amount_outstanding => $patron->account->balance, ); } --