Credits
--- a/opac/opac-account.pl
+++ a/opac/opac-account.pl
@@ -41,29 +41,14 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
my $patron = Koha::Patrons->find( $borrowernumber );
my $total = $patron->account->balance;
-my $accts = Koha::Account::Lines->search(
+my @accts = Koha::Account::Lines->search(
{ borrowernumber => $patron->borrowernumber },
{ order_by => { -desc => 'accountlines_id' } }
);
-my @accountlines;
-while ( my $line = $accts->next ) {
- my $accountline = $line->unblessed;
- $accountline->{'amount'} = sprintf( "%.2f", $accountline->{'amount'} || '0.00');
- if ( $accountline->{'amount'} >= 0 ) {
- $accountline->{'amountcredit'} = 1;
- }
- $accountline->{'amountoutstanding'} =
- sprintf( "%.2f", $accountline->{'amountoutstanding'} || '0.00' );
- if ( $accountline->{'amountoutstanding'} >= 0 ) {
- $accountline->{'amountoutstandingcredit'} = 1;
- }
- push @accountlines, $accountline;
-}
-
$template->param(
- ACCOUNT_LINES => \@accountlines,
- total => sprintf( "%.2f", $total ), # FIXME Use TT plugin Price
+ ACCOUNT_LINES => \@accts,
+ total => $total,
accountview => 1,
message => scalar $query->param('message') || q{},
message_value => scalar $query->param('message_value') || q{},
--- a/opac/opac-user.pl
+++ a/opac/opac-user.pl
@@ -120,12 +120,6 @@ if ( $userdebarred || $borr->{'gonenoaddress'} || $borr->{'lost'} ) {
}
my $amountoutstanding = $patron->account->balance;
-if ( $amountoutstanding > 5 ) {
- $borr->{'amountoverfive'} = 1;
-}
-if ( 5 >= $amountoutstanding && $amountoutstanding > 0 ) {
- $borr->{'amountoverzero'} = 1;
-}
my $no_renewal_amt = C4::Context->preference( 'OPACFineNoRenewals' );
$no_renewal_amt = undef unless looks_like_number( $no_renewal_amt );
@@ -141,11 +135,6 @@ if ( C4::Context->preference('OpacRenewalAllowed')
);
}
-if ( $amountoutstanding < 0 ) {
- $borr->{'amountlessthanzero'} = 1;
- $amountoutstanding = -1 * ( $amountoutstanding );
-}
-
# Warningdate is the date that the warning starts appearing
if ( $borr->{'dateexpiry'} && C4::Context->preference('NotifyBorrowerDeparture') ) {
my $days_to_expiry = Date_to_Days( $warning_year, $warning_month, $warning_day ) - Date_to_Days( $today_year, $today_month, $today_day );
--- a/opac/sco/sco-main.pl
+++ a/opac/sco/sco-main.pl
@@ -279,26 +279,11 @@ if ($borrower) {
}
my $total = $patron->account->balance;
- my $accts = Koha::Account::Lines->search(
+ my @accts = Koha::Account::Lines->search(
{ borrowernumber => $borrower->{borrowernumber} },
{ order_by => { -desc => 'accountlines_id' } }
);
- my @accountlines;
- while ( my $line = $accts->next ) {
- my $accountline = $line->unblessed;
- $accountline->{'amount'} = sprintf( "%.2f", $accountline->{'amount'} || '0.00');
- if ( $accountline->{'amount'} >= 0 ) {
- $accountline->{'amountcredit'} = 1;
- }
- $accountline->{'amountoutstanding'} =
- sprintf( "%.2f", $accountline->{'amountoutstanding'} || '0.00' );
- if ( $accountline->{'amountoutstanding'} >= 0 ) {
- $accountline->{'amountoutstandingcredit'} = 1;
- }
- push @accountlines, $accountline;
- }
-
my $holds = $patron->holds;
$template->param(
@@ -315,9 +300,9 @@ if ($borrower) {
borrowernumber => $borrower->{'borrowernumber'},
SuspendHoldsOpac => C4::Context->preference('SuspendHoldsOpac'),
AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
- showpriority => $show_priority,
- ACCOUNT_LINES => \@accountlines,
- total => sprintf( "%.2f", $total ),
+ howpriority => $show_priority,
+ ACCOUNT_LINES => \@accts,
+ total => $total,
);
my $patron_messages = Koha::Patron::Messages->search(
--