From 1f9c06984aa709d31346b1f8a538b9f598a0c720 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 4 Apr 2019 15:44:30 +0000 Subject: [PATCH] Bug 12166: Improve display of Reserve charges in patron account This patch makes changes to the way hold fees are recorded and displayed in the OPAC and staff client: - No English strings should be stored in the accountline description. - The accounttype code should be used to display what kind of charge it is. To test, apply the patch and go to the staff client: - Configure a patron category to have a hold fee. - Place one or more holds for a patron in that category. - On the patron's record, view Accounting -> Make a payment - There should be a separate column for "Account type" showing "Hold fee" for the hold charges. - There should be no "Res" or "Reserve Charge" text in the description column--just the title. - Switch to the "Transactions" tab. The display should be similar. - In the OPAC, log in as a patron who has hold fees on their account. - View the "your fines" page to confirm that the information is displayed correctly there as well. - Place a hold for a patron who incurs hold charges. - Log in to the self-checkout module as that patron and check out an item which will fulfill that hold. - The correct fine information should be saved to accountlines: A "Res" type with a description consisting only of the title. Signed-off-by: Katrin Fischer --- C4/Reserves.pm | 2 +- .../intranet-tmpl/prog/en/includes/accounts.inc | 1 + .../prog/en/modules/members/boraccount.tt | 9 +++--- .../intranet-tmpl/prog/en/modules/members/pay.tt | 32 ++++------------------ .../bootstrap/en/includes/account-table.inc | 12 +++++--- opac/sco/sco-main.pl | 2 +- 6 files changed, 22 insertions(+), 36 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 09d36288e3..a2eef2e42c 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -571,7 +571,7 @@ sub ChargeReserveFee { Koha::Account->new( { patron_id => $borrowernumber } )->add_debit( { amount => $fee, - description => "Reserve Charge - " . $title, + description => $title, note => undef, user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef, library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc index cf388239fb..28f5f94609 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc @@ -21,6 +21,7 @@ [%- CASE 'WO' -%]Writeoff [%- CASE 'C' -%]Credit [%- CASE 'CR' -%]Credit + [%- CASE 'Res' -%]Hold fee [%- CASE -%][% account.accounttype | html %] [%- END -%] [%- END -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt index 22b796e8e7..ceeccad1de 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -44,6 +44,7 @@ Date + Account type Description of charges Barcode Due date @@ -61,10 +62,10 @@ [% account.date |$KohaDates %] + [% PROCESS account_type_description account=account %] - [% PROCESS account_type_description account=account %] - [%- IF account.payment_type %], [% AuthorisedValues.GetByCode('PAYMENT_TYPE', account.payment_type) | html %][% END %] - [%- IF account.description %], [% account.description | html %][% END %] + [%- IF account.payment_type %][% AuthorisedValues.GetByCode('PAYMENT_TYPE', account.payment_type) | html %][% END %] + [%- IF account.description %][% account.description | html %][% END %]  [% IF ( account.itemnumber ) %][% account.item.biblio.title | html %][% END %] [% IF ( account.itemnumber ) %][% account.item.barcode | html %][% END %] [% IF ( account.issue_id ) %][% account.checkout.date_due | $KohaDates as_due_date => 1 %][% END %] @@ -89,7 +90,7 @@ [% END %] - Total due + Total due [% IF ( totalcredit ) %] [% total | $Price %] [% ELSE %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt index 7afd743acc..9d737bf614 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt @@ -7,6 +7,7 @@ [% USE ColumnsSettings %] [% USE KohaDates %] [% SET footerjs = 1 %] +[% PROCESS 'accounts.inc' %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › Make a payment for [% patron.firstname | html %] [% patron.surname | html %] [% INCLUDE 'doc-head-close.inc' %] @@ -44,13 +45,13 @@   Actions + Account type Description Date Barcode Due date Return date Payment note - Account type Amount Amount outstanding @@ -80,30 +81,10 @@ - [% SWITCH line.accounttype %] - [% CASE 'Pay' %]Payment, thanks - [% CASE 'Pay00' %]Payment, thanks (cash via SIP2) - [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2) - [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2) - [% CASE 'N' %]New card - [% CASE 'F' %]Fine - [% CASE 'A' %]Account management fee - [% CASE 'M' %]Sundry - [% CASE 'L' %]Lost item - [% CASE 'W' %]Writeoff - [% CASE 'FU' %]Accruing fine - [% CASE 'HE' %]Hold waiting too long - [% CASE 'Rent' %]Rental fee - [% CASE 'FOR' %]Forgiven - [% CASE 'LR' %]Lost item fee refund - [% CASE 'PF' %]Processing fee - [% CASE 'PAY' %]Payment - [% CASE 'WO' %]Writeoff - [% CASE 'C' %]Credit - [% CASE 'CR' %]Credit - [% CASE %][% line.accounttype | html %] - [%- END -%] - [%- IF line.description %], [% line.description | html %][% END %] + [% PROCESS account_type_description account=line %] + + + [%- IF line.description %][% line.description | html %][% END %] [% IF line.itemnumber %]([% line.item.biblio.title | html %])[% END %] @@ -128,7 +109,6 @@ Add note - [% line.accounttype | html %] [% line.amount | $Price %] [% line.amountoutstanding | $Price %] 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 a73da77196..68619d9783 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc @@ -8,6 +8,7 @@ [% IF ENABLE_OPAC_PAYMENTS %] [% END %] Date Description + Type Fine amount Amount outstanding @@ -48,10 +49,13 @@ [% CASE 'WO' %]Writeoff [% CASE 'C' %]Credit [% CASE 'CR' %]Credit + [%-CASE 'Res' %]Hold fee [% CASE %][% ACCOUNT_LINE.accounttype | html %] [%- END -%] - [%- IF ACCOUNT_LINE.payment_type %], [% AuthorisedValues.GetByCode('PAYMENT_TYPE', ACCOUNT_LINE.payment_type, 1) | html %][% END %] - [%- IF ACCOUNT_LINE.description %], [% ACCOUNT_LINE.description | html %][% END %] + + + [%- IF ACCOUNT_LINE.payment_type %][% AuthorisedValues.GetByCode('PAYMENT_TYPE', ACCOUNT_LINE.payment_type, 1) | html %][% END %] + [%- IF ACCOUNT_LINE.description %][% ACCOUNT_LINE.description | html %][% END %] [% IF ACCOUNT_LINE.title %]([% ACCOUNT_LINE.title | html %])[% END %] [% IF ( ACCOUNT_LINE.amountcredit ) %][% ELSE %][% END %][% ACCOUNT_LINE.amount | $Price %] @@ -63,9 +67,9 @@ [%- IF ENABLE_OPAC_PAYMENTS -%] - [%- SET COLSPAN = 4 -%] + [%- SET COLSPAN = 5 -%] [%- ELSE -%] - [%- SET COLSPAN = 3 -%] + [%- SET COLSPAN = 4 -%] [%- END -%] Total due [% total | $Price %] diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl index 7fd6ee8e40..50afc13e96 100755 --- a/opac/sco/sco-main.pl +++ b/opac/sco/sco-main.pl @@ -235,7 +235,7 @@ elsif ( $patron && ( $op eq 'checkout' || $op eq 'renew' ) ) { { borrowernumber => $borrower->{borrowernumber}, accounttype => 'Res', - description => 'Reserve Charge - ' . $item->biblio->title, + description => $item->biblio->title, date => $dtf->format_date(dt_from_string) } )->count, -- 2.11.0