Bugzilla – Attachment 87131 Details for
Bug 22588
Simplify getting account information in opac and self checkout module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22588: (follow-up) Simplify getting accounts even more
Bug-22588-follow-up-Simplify-getting-accounts-even.patch (text/plain), 3.66 KB, created by
Josef Moravec
on 2019-03-28 09:01:51 UTC
(
hide
)
Description:
Bug 22588: (follow-up) Simplify getting accounts even more
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2019-03-28 09:01:51 UTC
Size:
3.66 KB
patch
obsolete
>From 65779c608ad24de0bdf8163de3c14433ae8fe297 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Thu, 28 Mar 2019 08:53:46 +0000 >Subject: [PATCH] Bug 22588: (follow-up) Simplify getting accounts even more > >--- > koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc | 4 ++-- > opac/opac-account.pl | 10 ++++------ > opac/sco/sco-main.pl | 10 ++++------ > 3 files changed, 10 insertions(+), 14 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >index 37c99765fc..cc377f935a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >@@ -66,8 +66,8 @@ > [%- IF ACCOUNT_LINE.description %], [% ACCOUNT_LINE.description | html %][% END %] > [% IF ACCOUNT_LINE.itemnumber %]([% ACCOUNT_LINE.item.biblio.title | html %])[% END %] > </td> >- [% IF ( ACCOUNT_LINE.amount <= 0 ) %]<td class="credit">[% ACCOUNT_LINE.amount * -1 | $Price %][% ELSE %]<td class="debit">[% ACCOUNT_LINE.amount | $Price %][% END %]</td> >- [% IF ( ACCOUNT_LINE.amountoutstanding <= 0 ) %]<td class="credit">[% ACCOUNT_LINE.amountoutstanding * -1 | $Price %][% ELSE %]<td class="debit">[% ACCOUNT_LINE.amountoutstanding | $Price %][% END %]</td> >+ [% IF ( ACCOUNT_LINE.is_credit ) %]<td class="credit">[% ACCOUNT_LINE.amount * -1 | $Price %][% ELSE %]<td class="debit">[% ACCOUNT_LINE.amount | $Price %][% END %]</td> >+ [% IF ( ACCOUNT_LINE.is_credit ) %]<td class="credit">[% ACCOUNT_LINE.amountoutstanding * -1 | $Price %][% ELSE %]<td class="debit">[% ACCOUNT_LINE.amountoutstanding | $Price %][% END %]</td> > </tr> > [% END %] > </tbody> >diff --git a/opac/opac-account.pl b/opac/opac-account.pl >index 4e4d789a4d..9c47e35755 100755 >--- a/opac/opac-account.pl >+++ b/opac/opac-account.pl >@@ -40,14 +40,12 @@ 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( >- { borrowernumber => $patron->borrowernumber }, >- { order_by => { -desc => 'accountlines_id' } } >-); >+my $account = $patron->account; >+my $total = $account->balance; >+my $accountlines = $account->lines; > > $template->param( >- ACCOUNT_LINES => \@accts, >+ ACCOUNT_LINES => $accountlines, > total => $total, > accountview => 1, > message => scalar $query->param('message') || q{}, >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index 46e84ce55a..36c957bfb0 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -277,11 +277,9 @@ if ($borrower) { > m/priority/ and $show_priority = 1; > } > >- my $total = $patron->account->balance; >- my @accts = Koha::Account::Lines->search( >- { borrowernumber => $borrower->{borrowernumber} }, >- { order_by => { -desc => 'accountlines_id' } } >- ); >+ my $account = $patron->account; >+ my $total = $account->balance; >+ my $accountlines = $account->lines; > > my $holds = $patron->holds; > >@@ -300,7 +298,7 @@ if ($borrower) { > SuspendHoldsOpac => C4::Context->preference('SuspendHoldsOpac'), > AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'), > howpriority => $show_priority, >- ACCOUNT_LINES => \@accts, >+ ACCOUNT_LINES => $accountlines, > total => $total, > ); > >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22588
:
87049
|
87065
|
87131
|
87350
|
87351
|
88021
|
88022