From 24bbb0f40e8347f64d4cb6948c25c6bee1b8b9bc Mon Sep 17 00:00:00 2001
From: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Date: Fri, 16 Oct 2020 15:57:30 +0100
Subject: [PATCH] Bug 26697: Make account.inc consistent between staff and opac

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
---
 .../prog/en/includes/accounts.inc             | 28 +++++-----
 .../bootstrap/en/includes/account-table.inc   | 51 +------------------
 .../bootstrap/en/includes/accounts.inc        | 49 ++++++++++++++++++
 3 files changed, 64 insertions(+), 64 deletions(-)
 create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc
index 395d0783bc..abe382665e 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc
@@ -34,20 +34,6 @@
     </span>
 [%- END -%]
 
-[%- BLOCK offset_type_description -%]
-    [%- SWITCH account_offset.type -%]
-        [%- CASE 'Credit Applied' -%]<span>Credit applied</span>
-        [%- CASE 'Payment'        -%]<span>Payment</span>
-        [%- CASE 'Manual Credit'  -%]<span>Manual credit</span>
-        [%- CASE 'Manual Debit'   -%]<span>Manual invoice</span>
-        [%- CASE 'Lost Item'      -%]<span>Lost item returned</span>
-        [%- CASE 'Writeoff'       -%]<span>Writeoff</span>
-        [%- CASE 'Void Payment'   -%]<span>Void payment</span>
-        [%- CASE 'CANCELLATION'   -%]<span>Cancelled charge</span>
-        [%- CASE                  -%][% account_offset.type | html %]
-    [%- END -%]
-[%- END -%]
-
 [%- BLOCK account_status_description -%]
     [%- SWITCH account.status -%]
         [%- CASE 'UNRETURNED' -%]<span> (Accruing)</span>
@@ -61,3 +47,17 @@
         [%- CASE              -%]
     [%- END -%]
 [%- END -%]
+
+[%- BLOCK offset_type_description -%]
+    [%- SWITCH account_offset.type -%]
+        [%- CASE 'Credit Applied' -%]<span>Credit applied</span>
+        [%- CASE 'Payment'        -%]<span>Payment</span>
+        [%- CASE 'Manual Credit'  -%]<span>Manual credit</span>
+        [%- CASE 'Manual Debit'   -%]<span>Manual invoice</span>
+        [%- CASE 'Lost Item'      -%]<span>Lost item returned</span>
+        [%- CASE 'Writeoff'       -%]<span>Writeoff</span>
+        [%- CASE 'Void Payment'   -%]<span>Void payment</span>
+        [%- CASE 'CANCELLATION'   -%]<span>Cancelled charge</span>
+        [%- CASE                  -%][% account_offset.type | html %]
+    [%- END -%]
+[%- END -%]
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 9cd684d5c7..a3b6b935d5 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc
@@ -1,3 +1,4 @@
+[% PROCESS 'accounts.inc' %]
 <form method="post" action="opac-account-pay.pl" class="form-horizontal">
     [% IF ( ACCOUNT_LINES ) %]
         <table class="table table-bordered table-striped" id="finestable">
@@ -169,53 +170,3 @@
         </fieldset>
     [% END # /IF ENABLE_OPAC_PAYMENTS && DISPLAY_PAYMENT_BLOCK %]
 </form>
-
-[%- BLOCK account_type_description -%]
-    <span>
-        [%- IF account.credit_type_code -%]
-            [%- SWITCH account.credit_type_code -%]
-                [%- CASE 'PAYMENT'          -%]Payment
-                [%- CASE 'WRITEOFF'         -%]Writeoff
-                [%- CASE 'FORGIVEN'         -%]Forgiven
-                [%- CASE 'CREDIT'           -%]Credit
-                [%- CASE 'LOST_FOUND'       -%]Lost item fee refund
-                [%- CASE 'REFUND'           -%]Refund
-                [%- CASE 'CANCELLATION'     -%]Cancelled charge
-                [%- CASE                    -%][% account.credit_type.description | html %]
-            [%- END -%]
-        [%- ELSIF account.debit_type_code -%]
-            [%- SWITCH account.debit_type_code -%]
-                [%- CASE 'ACCOUNT'          -%]Account creation fee
-                [%- CASE 'ACCOUNT_RENEW'    -%]Account renewal fee
-                [%- CASE 'LOST'             -%]Lost item
-                [%- CASE 'MANUAL'           -%]Manual fee
-                [%- CASE 'NEW_CARD'         -%]New card
-                [%- CASE 'OVERDUE'          -%]Fine
-                [%- CASE 'PROCESSING'       -%]Lost item processing fee
-                [%- CASE 'RENT'             -%]Rental fee
-                [%- CASE 'RENT_DAILY'       -%]Daily rental fee
-                [%- CASE 'RENT_RENEW'       -%]Renewal of rental item
-                [%- CASE 'RENT_DAILY_RENEW' -%]Renewal of daily rental item
-                [%- CASE 'RESERVE'          -%]Hold fee
-                [%- CASE 'RESERVE_EXPIRED'  -%]Hold waiting too long
-                [%- CASE 'Payout'           -%]Payout
-                [%- CASE                    -%][% account.debit_type.description | html %]
-            [%- END -%]
-        [%- END -%]
-        [%- PROCESS account_status_description account=account -%]
-    </span>
-[%- END # /BLOCK account_type_description -%]
-
-[%- BLOCK account_status_description -%]
-    [%- SWITCH account.status -%]
-            [%- CASE 'UNRETURNED' -%]<span> (Accruing)</span>
-            [%- CASE 'RETURNED'   -%]<span> (Returned)</span>
-            [%- CASE 'REPLACED'   -%]<span> (Replaced)</span>
-            [%- CASE 'REFUNDED'   -%]<span> (Refunded)</span>
-            [%- CASE 'FORGIVEN'   -%]<span> (Forgiven)</span>
-            [%- CASE 'VOID'       -%]<span> (Voided)</span>
-            [%- CASE 'LOST'       -%]<span> (Lost)</span>
-            [%- CASE 'CANCELLED'  -%]<span> (Cancelled)</span>
-            [%- CASE              -%]
-        [%- END -%]
-[%- END -%]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc
new file mode 100644
index 0000000000..34ebc5d8ca
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc
@@ -0,0 +1,49 @@
+[%- BLOCK account_type_description -%]
+    <span>
+        [%- IF account.credit_type_code -%]
+            [%- SWITCH account.credit_type_code -%]
+                [%- CASE 'PAYMENT'          -%]Payment
+                [%- CASE 'WRITEOFF'         -%]Writeoff
+                [%- CASE 'FORGIVEN'         -%]Forgiven
+                [%- CASE 'CREDIT'           -%]Credit
+                [%- CASE 'LOST_FOUND'       -%]Lost item fee refund
+                [%- CASE 'REFUND'           -%]Refund
+                [%- CASE 'CANCELLATION'     -%]Cancelled charge
+                [%- CASE                    -%][% account.credit_type.description | html %]
+            [%- END -%]
+        [%- ELSIF account.debit_type_code -%]
+            [%- SWITCH account.debit_type_code -%]
+                [%- CASE 'ACCOUNT'          -%]Account creation fee
+                [%- CASE 'ACCOUNT_RENEW'    -%]Account renewal fee
+                [%- CASE 'LOST'             -%]Lost item
+                [%- CASE 'MANUAL'           -%]Manual fee
+                [%- CASE 'NEW_CARD'         -%]New card
+                [%- CASE 'OVERDUE'          -%]Fine
+                [%- CASE 'PROCESSING'       -%]Lost item processing fee
+                [%- CASE 'RENT'             -%]Rental fee
+                [%- CASE 'RENT_DAILY'       -%]Daily rental fee
+                [%- CASE 'RENT_RENEW'       -%]Renewal of rental item
+                [%- CASE 'RENT_DAILY_RENEW' -%]Renewal of daily rental item
+                [%- CASE 'RESERVE'          -%]Hold fee
+                [%- CASE 'RESERVE_EXPIRED'  -%]Hold waiting too long
+                [%- CASE 'Payout'           -%]Payout
+                [%- CASE                    -%][% account.debit_type.description | html %]
+            [%- END -%]
+        [%- END -%]
+        [%- PROCESS account_status_description account=account -%]
+    </span>
+[%- END -%]
+
+[%- BLOCK account_status_description -%]
+    [%- SWITCH account.status -%]
+            [%- CASE 'UNRETURNED' -%]<span> (Accruing)</span>
+            [%- CASE 'RETURNED'   -%]<span> (Returned)</span>
+            [%- CASE 'REPLACED'   -%]<span> (Replaced)</span>
+            [%- CASE 'REFUNDED'   -%]<span> (Refunded)</span>
+            [%- CASE 'FORGIVEN'   -%]<span> (Forgiven)</span>
+            [%- CASE 'VOID'       -%]<span> (Voided)</span>
+            [%- CASE 'LOST'       -%]<span> (Lost)</span>
+            [%- CASE 'CANCELLED'  -%]<span> (Cancelled)</span>
+            [%- CASE              -%]
+        [%- END -%]
+[%- END -%]
-- 
2.17.1