Bugzilla – Attachment 90923 Details for
Bug 23115
Totals are unclear when a credit is involved on the OPAC 'Fines and charges' screen
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23115: Tweak display of totals on 'Fines and charges' page
Bug-23115-Tweak-display-of-totals-on-Fines-and-cha.patch (text/plain), 7.09 KB, created by
Nick Clemens (kidclamp)
on 2019-06-21 16:32:19 UTC
(
hide
)
Description:
Bug 23115: Tweak display of totals on 'Fines and charges' page
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-06-21 16:32:19 UTC
Size:
7.09 KB
patch
obsolete
>From c1e4d342f0299ac95a6a7afc26b4aa168daeed81 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 13 Jun 2019 11:42:02 +0100 >Subject: [PATCH] Bug 23115: Tweak display of totals on 'Fines and charges' > page > >This patch tweaks the display of totals on the OPAC 'Fines and charges' >page to clarify between the totals before and after applying credits. > >Test Plan: >1) Add some debts and credits to a patrons account >2) Look at the 'Fines and charges' page before applying the patch >3) Look at the 'Fines and charges' page after applying the patch >4) Varify the new layout is an improvment or not > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Nadine Pierre <nadine.pierre@inLibro.com> >Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> >--- > koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss | 8 +++- > .../bootstrap/en/includes/account-table.inc | 50 +++++++++++++++++++++- > opac/opac-account.pl | 20 +++++---- > 3 files changed, 66 insertions(+), 12 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >index 29fc16c452..b020e9f952 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >+++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >@@ -333,6 +333,12 @@ td { > background-color: #FFF; > } > >+tr { >+ &.outstanding { >+ font-style: italic; >+ } >+} >+ > td { > img { > max-width: none; >@@ -342,7 +348,7 @@ td { > color: #CC3333; > } > >- .sum { >+ &.sum { > background-color: #FFFFE5; > font-weight: bold; > } >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 e2bb1a1b36..b7378ab313 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >@@ -9,14 +9,14 @@ > <th class="title-string">Date</th> > <th>Type</th> > <th>Description</th> >- <th>Fine amount</th> >+ <th>Amount</th> > <th>Amount outstanding</th> > </tr> > </thead> > > <tbody> > [% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %] >- <tr> >+ <tr [% IF ACCOUNT_LINE.amountoutstanding > 0 || ACCOUNT_LINE.amountoutstanding < 0 %]class="outstanding"[% END%]> > [% IF ENABLE_OPAC_PAYMENTS %] > <td> > [% IF ACCOUNT_LINE.amountoutstanding > 0 %] >@@ -75,6 +75,52 @@ > <th class="sum" colspan="[% COLSPAN | html %]">Total due</th> > <td class="sum">[% total | $Price %]</td> > </tr> >+ [% IF outstanding_credits.total_outstanding < 0 %] >+ [% FOREACH outstanding_credit IN outstanding_credits %] >+ <tr [% IF outstanding_credit.amountoutstanding < 0 %]class="outstanding"[% END%]> >+ [% IF ENABLE_OPAC_PAYMENTS %]<td></td>[% END %] >+ <td><span title="[% outstanding_credit.date | html %]">[% outstanding_credit.date | $KohaDates %]</span></td> >+ <td> >+ [% SWITCH outstanding_credit.accounttype %] >+ [% CASE 'Pay' %]Payment >+ [% CASE 'Pay00' %]Payment (cash via SIP2) >+ [% CASE 'Pay01' %]Payment (VISA via SIP2) >+ [% CASE 'Pay02' %]Payment (credit card via SIP2) >+ [% CASE 'VOID' %]Voided >+ [% CASE 'N' %]New card >+ [% CASE 'OVERDUE' %]Fine >+ [% CASE 'A' %]Account management fee >+ [% CASE 'M' %]Sundry >+ [% CASE 'L' %]Lost item >+ [% CASE 'W' %]Writeoff >+ [% CASE 'HE' %]Hold waiting too long >+ [% CASE 'Rent' %]Rental fee >+ [% CASE 'FOR' %]Forgiven >+ [% CASE 'LR' %]Lost item fee refund >+ [% CASE 'PF' %]Lost item processing fee >+ [% CASE 'PAY' %]Payment >+ [% CASE 'WO' %]Writeoff >+ [% CASE 'C' %]Credit >+ [% CASE 'CR' %]Credit >+ [%-CASE 'Res' %]Hold fee >+ [% CASE %][% outstanding_credit.accounttype | html %] >+ [%- END -%] >+ [%- PROCESS account_status_description account=outstanding_credit -%] >+ </td> >+ <td> >+ [%- IF outstanding_credit.payment_type %][% AuthorisedValues.GetByCode('PAYMENT_TYPE', outstanding_credit.payment_type, 1) | html %][% END %] >+ [%- IF outstanding_credit.description %][% outstanding_credit.description | html %][% END %] >+ [% IF outstanding_credit.itemnumber %]([% outstanding_credit.item.biblio.title | html %])[% END %] >+ </td> >+ <td class="credit">[% outstanding_credit.amount * -1 | $Price %]</td> >+ <td class="credit">[% outstanding_credit.amountoutstanding * -1 | $Price %]</td> >+ </tr> >+ [% END %] >+ <tr> >+ <th class="sum" colspan="[% COLSPAN | html %]">Total due if credit(s) applied:</th> >+ <td class="sum">[% total + outstanding_credits.total_outstanding | $Price %]</td> >+ </tr> >+ [% END %] > </tfoot> > > </table> >diff --git a/opac/opac-account.pl b/opac/opac-account.pl >index 9c47e35755..d5677fc1b3 100755 >--- a/opac/opac-account.pl >+++ b/opac/opac-account.pl >@@ -41,17 +41,19 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > > my $patron = Koha::Patrons->find( $borrowernumber ); > my $account = $patron->account; >-my $total = $account->balance; >-my $accountlines = $account->lines; >+my $accountlines = $account->lines->search({ amountoutstanding => { '>=' => 0 }}); >+my $total_outstanding = $accountlines->total_outstanding; >+my $outstanding_credits = $account->outstanding_credits; > > $template->param( >- ACCOUNT_LINES => $accountlines, >- total => $total, >- accountview => 1, >- message => scalar $query->param('message') || q{}, >- message_value => scalar $query->param('message_value') || q{}, >- payment => scalar $query->param('payment') || q{}, >- payment_error => scalar $query->param('payment-error') || q{}, >+ ACCOUNT_LINES => $accountlines, >+ total => $total_outstanding, >+ outstanding_credits => $outstanding_credits, >+ accountview => 1, >+ message => scalar $query->param('message') || q{}, >+ message_value => scalar $query->param('message_value') || q{}, >+ payment => scalar $query->param('payment') || q{}, >+ payment_error => scalar $query->param('payment-error') || q{}, > ); > > my $plugins_enabled = C4::Context->preference('UseKohaPlugins') && C4::Context->config("enable_plugins"); >-- >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 23115
:
90564
|
90567
|
90604
|
90605
|
90616
|
90622
| 90923 |
90924
|
90925