@@ -, +, @@ page --- 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(-) --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ a/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; } --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc +++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc @@ -9,14 +9,14 @@ Date Type Description - Fine amount + Amount Amount outstanding [% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %] - + 0 || ACCOUNT_LINE.amountoutstanding < 0 %]class="outstanding"[% END%]> [% IF ENABLE_OPAC_PAYMENTS %] [% IF ACCOUNT_LINE.amountoutstanding > 0 %] @@ -75,6 +75,52 @@ Total due [% total | $Price %] + [% IF outstanding_credits.total_outstanding < 0 %] + [% FOREACH outstanding_credit IN outstanding_credits %] + + [% IF ENABLE_OPAC_PAYMENTS %][% END %] + [% outstanding_credit.date | $KohaDates %] + + [% 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 -%] + + + [%- 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 %] + + [% outstanding_credit.amount * -1 | $Price %] + [% outstanding_credit.amountoutstanding * -1 | $Price %] + + [% END %] + + Total due if credit(s) applied: + [% total + outstanding_credits.total_outstanding | $Price %] + + [% END %] --- a/opac/opac-account.pl +++ a/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"); --