Bug 22511: (QA follow-up) Refactor status description in templates
authorJosef Moravec <josef.moravec@gmail.com>
Thu, 25 Apr 2019 08:28:13 +0000 (08:28 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 25 Apr 2019 11:02:14 +0000 (11:02 +0000)
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 <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc
koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc

index a37fd3a..9b1be90 100644 (file)
@@ -1,27 +1,28 @@
 [%- BLOCK account_type_description -%]
     [%- SWITCH account.accounttype -%]
-        [%- CASE 'Pay'     -%]<span>Payment</span>
-        [%- CASE 'Pay00'   -%]<span>Payment (cash via SIP2)</span>
-        [%- CASE 'Pay01'   -%]<span>Payment (VISA via SIP2)</span>
-        [%- CASE 'Pay02'   -%]<span>Payment (credit card via SIP2)</span>
-        [%- CASE 'N'       -%]<span>New card</span>
-        [%- CASE 'OVERDUE' -%]<span>Fine[%- PROCESS account_status_description account=account -%]</span>
-        [%- CASE 'A'       -%]<span>Account management fee</span>
-        [%- CASE 'M'       -%]<span>Sundry</span>
-        [%- CASE 'L'       -%]<span>Lost item</span>
-        [%- CASE 'W'       -%]<span>Writeoff[%- PROCESS account_status_description account=account -%]</span>
-        [%- CASE 'HE'      -%]<span>Hold waiting too long</span>
-        [%- CASE 'Rent'    -%]<span>Rental fee</span>
-        [%- CASE 'FOR'     -%]<span>Forgiven[%- PROCESS account_status_description account=account -%]</span>
-        [%- CASE 'LR'      -%]<span>Lost item fee refund[%- PROCESS account_status_description account=account -%]</span>
-        [%- CASE 'PF'      -%]<span>Lost item processing fee[%- PROCESS account_status_description account=account -%]</span>
-        [%- CASE 'PAY'     -%]<span>Payment[%- PROCESS account_status_description account=account -%]</span>
-        [%- CASE 'WO'      -%]<span>Writeoff[%- PROCESS account_status_description account=account -%]</span>
-        [%- CASE 'C'       -%]<span>Credit[%- PROCESS account_status_description account=account -%]</span>
-        [%- CASE 'CR'      -%]<span>Credit[%- PROCESS account_status_description account=account -%]</span>
-        [%- CASE 'Res'     -%]<span>Hold fee</span>
-        [%- CASE           -%][% account.accounttype | html %]
+        [%- CASE 'Pay'     -%]<span>Payment
+        [%- CASE 'Pay00'   -%]<span>Payment (cash via SIP2)
+        [%- CASE 'Pay01'   -%]<span>Payment (VISA via SIP2)
+        [%- CASE 'Pay02'   -%]<span>Payment (credit card via SIP2)
+        [%- CASE 'N'       -%]<span>New card
+        [%- CASE 'OVERDUE' -%]<span>Fine
+        [%- CASE 'A'       -%]<span>Account management fee
+        [%- CASE 'M'       -%]<span>Sundry
+        [%- CASE 'L'       -%]<span>Lost item
+        [%- CASE 'W'       -%]<span>Writeoff
+        [%- CASE 'HE'      -%]<span>Hold waiting too long
+        [%- CASE 'Rent'    -%]<span>Rental fee
+        [%- CASE 'FOR'     -%]<span>Forgiven
+        [%- CASE 'LR'      -%]<span>Lost item fee refund
+        [%- CASE 'PF'      -%]<span>Lost item processing fee
+        [%- CASE 'PAY'     -%]<span>Payment
+        [%- CASE 'WO'      -%]<span>Writeoff
+        [%- CASE 'C'       -%]<span>Credit
+        [%- CASE 'CR'      -%]<span>Credit
+        [%- CASE 'Res'     -%]<span>Hold fee
+        [%- CASE           -%]<span>[% account.accounttype | html %]
     [%- END -%]
+    [%- PROCESS account_status_description account=account -%]</span>
 [%- END -%]
 
 [%- BLOCK offset_type_description -%]
index 11e5d0a..e2bb1a1 100644 (file)
                         [% 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 -%]
                     </td>
                     <td>
                         [%- IF ACCOUNT_LINE.payment_type %][% AuthorisedValues.GetByCode('PAYMENT_TYPE', ACCOUNT_LINE.payment_type, 1) | html %][% END %]