From 46b2328990248eca4bc1675a0dd7a5c3a797b275 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Thu, 25 Apr 2019 08:28:13 +0000 Subject: [PATCH] Bug 22511: (QA follow-up) Refactor status description in templates Test plan: Before this patch, some accounttypes does not show status (for example voided payment) After this patch, the status is always generated - defaults to empty string This behaviour should be same in intranet and opac In OPAC templates there was even bug (used variable account instead of ACCOUNt_LINE), so the status was not shown at all Signed-off-by: Josef Moravec Signed-off-by: Martin Renvoize --- .../prog/en/includes/accounts.inc | 43 ++++++++++--------- .../bootstrap/en/includes/account-table.inc | 17 ++++---- 2 files changed, 31 insertions(+), 29 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc index a37fd3a941..9b1be90c05 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc @@ -1,27 +1,28 @@ [%- BLOCK account_type_description -%] [%- SWITCH account.accounttype -%] - [%- CASE 'Pay' -%]Payment - [%- CASE 'Pay00' -%]Payment (cash via SIP2) - [%- CASE 'Pay01' -%]Payment (VISA via SIP2) - [%- CASE 'Pay02' -%]Payment (credit card via SIP2) - [%- CASE 'N' -%]New card - [%- CASE 'OVERDUE' -%]Fine[%- PROCESS account_status_description account=account -%] - [%- CASE 'A' -%]Account management fee - [%- CASE 'M' -%]Sundry - [%- CASE 'L' -%]Lost item - [%- CASE 'W' -%]Writeoff[%- PROCESS account_status_description account=account -%] - [%- CASE 'HE' -%]Hold waiting too long - [%- CASE 'Rent' -%]Rental fee - [%- CASE 'FOR' -%]Forgiven[%- PROCESS account_status_description account=account -%] - [%- CASE 'LR' -%]Lost item fee refund[%- PROCESS account_status_description account=account -%] - [%- CASE 'PF' -%]Lost item processing fee[%- PROCESS account_status_description account=account -%] - [%- CASE 'PAY' -%]Payment[%- PROCESS account_status_description account=account -%] - [%- CASE 'WO' -%]Writeoff[%- PROCESS account_status_description account=account -%] - [%- CASE 'C' -%]Credit[%- PROCESS account_status_description account=account -%] - [%- CASE 'CR' -%]Credit[%- PROCESS account_status_description account=account -%] - [%- CASE 'Res' -%]Hold fee - [%- CASE -%][% account.accounttype | html %] + [%- CASE 'Pay' -%]Payment + [%- CASE 'Pay00' -%]Payment (cash via SIP2) + [%- CASE 'Pay01' -%]Payment (VISA via SIP2) + [%- CASE 'Pay02' -%]Payment (credit card via SIP2) + [%- 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 -%][% account.accounttype | html %] [%- END -%] + [%- PROCESS account_status_description account=account -%] [%- END -%] [%- BLOCK offset_type_description -%] 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 11e5d0a58d..e2bb1a1b36 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc @@ -35,23 +35,24 @@ [% CASE 'Pay02' %]Payment (credit card via SIP2) [% CASE 'VOID' %]Voided [% CASE 'N' %]New card - [% CASE 'OVERDUE' %]Fine[%- PROCESS account_status_description account=account -%] + [% CASE 'OVERDUE' %]Fine [% CASE 'A' %]Account management fee [% CASE 'M' %]Sundry [% CASE 'L' %]Lost item - [% CASE 'W' %]Writeoff[%- PROCESS account_status_description account=account -%] + [% CASE 'W' %]Writeoff [% CASE 'HE' %]Hold waiting too long [% CASE 'Rent' %]Rental fee - [% CASE 'FOR' %]Forgiven[%- PROCESS account_status_description account=account -%] - [% CASE 'LR' %]Lost item fee refund[%- PROCESS account_status_description account=account -%] + [% CASE 'FOR' %]Forgiven + [% CASE 'LR' %]Lost item fee refund [% CASE 'PF' %]Lost item processing fee - [% CASE 'PAY' %]Payment[%- PROCESS account_status_description account=account -%] - [% CASE 'WO' %]Writeoff[%- PROCESS account_status_description account=account -%] - [% CASE 'C' %]Credit[%- PROCESS account_status_description account=account -%] - [% CASE 'CR' %]Credit[%- PROCESS account_status_description account=account -%] + [% CASE 'PAY' %]Payment + [% CASE 'WO' %]Writeoff + [% CASE 'C' %]Credit + [% CASE 'CR' %]Credit [%-CASE 'Res' %]Hold fee [% CASE %][% ACCOUNT_LINE.accounttype | html %] [%- END -%] + [%- PROCESS account_status_description account=ACCOUNT_LINE -%] [%- IF ACCOUNT_LINE.payment_type %][% AuthorisedValues.GetByCode('PAYMENT_TYPE', ACCOUNT_LINE.payment_type, 1) | html %][% END %] -- 2.20.1