From 72e8737a750cc8ed5e9250ca9bb7748af478dd3b Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 29 Aug 2018 07:48:39 +0300 Subject: [PATCH] Bug 12186: Deduplicate TT code for account payments Instead of using the same accounttype switch statement multiple times, just use the accounttype include file. Test plan: 1) Apply patch 2) Go to Patron's Fines 3) in the Pay fines -tab, check that the description shows correctly 4) in the Account -tab, click on the "Print" after the entries and check that the description shows correctly, both for invoices and fees. Signed-off-by: Pasi Kallinen --- .../intranet-tmpl/prog/en/modules/members/pay.tt | 25 +--------------------- .../prog/en/modules/members/printfeercpt.tt | 15 +------------ .../prog/en/modules/members/printinvoice.tt | 15 +------------ 3 files changed, 3 insertions(+), 52 deletions(-) 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 ffac4d766c..0a47c24d6d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt @@ -76,30 +76,7 @@ - - [% 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 -%] + [% PROCESS 'accounttype.inc' account=line %] [%- IF line.description %], [% line.description | html %][% END %] [% IF line.title %]([% line.title | html %])[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt index 1ac29c900f..a5e5d0de5a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt @@ -49,20 +49,7 @@ [% FOREACH account IN accounts %] [% account.date | $KohaDates %] - - [% SWITCH account.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 %][% account.accounttype | html %] - [%- END -%] + [% PROCESS 'accounttype.inc' %] [%- IF account.description %], [% account.description | html %][% END %] [% account.note | html %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt index 2b1e066cc3..173a99e37f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt @@ -49,20 +49,7 @@ [% FOREACH account IN accounts %] [% account.date | $KohaDates%] - - [% SWITCH account.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 %][% account.accounttype | html %] - [%- END -%] + [% PROCESS 'accounttype.inc' %] [%- IF account.description %], [% account.description | html %][% END %] [% account.note | html %] -- 2.11.0