Bug 12186 - Deduplicate TT code for account payments
Summary: Deduplicate TT code for account payments
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: paxed
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-05 10:02 UTC by paxed
Modified: 2023-07-15 19:13 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 12186: Deduplicate TT code for account payments (4.96 KB, patch)
2018-08-29 05:04 UTC, paxed
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2014-05-05 10:02:38 UTC
[% SWITCH line.accounttype %]
          [% CASE 'Pay' %]Payment,thanks
          [% CASE 'Pay00' %]Payment,thanks (cash via SIP2)
          ....

This SWITCH statement is duplicated in three different files:

intranet-tmpl/prog/en/modules/members/pay.tt
intranet-tmpl/prog/en/modules/members/boraccount.tt
opac-tmpl/prog/en/modules/opac-account.tt

It should be folded into a single macro or block.
Comment 1 Magnus Enger 2014-05-05 15:01:55 UTC
And there should probably be a space between "Payment" and "thanks"? 

  Payment, thanks

not 

  Payment,thanks
Comment 2 Katrin Fischer 2014-05-05 16:01:25 UTC
There are also bugs 12165 for adding the code to bootstrap and bug 12166. There are still some things that need to be added to the account descriptions before they will cover all cases.
Comment 3 paxed 2018-08-29 05:04:51 UTC
Created attachment 78241 [details] [review]
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.
Comment 4 David Nind 2020-02-08 01:15:00 UTC
Patch no longer applies 8-(

Looks to me like these files had a significant amount of change over the last year or so, so maybe this change is not required any more?
Comment 5 Katrin Fischer 2023-07-15 19:13:26 UTC
I believe this has been solved by other patches/developments. We have now 2 include files, one for OPAC and one for the staff interface:

koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc:        [%- CASE 'RESERVE_EXPIRED'  -%]<span>Hold waiting too long</span>
koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc:        [%- CASE 'RESERVE_EXPIRED'  -%]<span>Hold waiting too long</span>