Bug 26418: Fix translatability of REFUND credit type
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 9 Sep 2020 14:34:13 +0000 (15:34 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 28 Sep 2020 13:07:27 +0000 (15:07 +0200)
The description of REFUND type accountline credits introduced with the "issue refund" feature is not translatable.

To test:
- Make sure a language with a complete translation is installed
- Switch to the language
- Go to any user account
- Add a manual invoice
- Pay it off fully or partially
- Click on "issue refund"
- Confirm the refund
- Check the description of the line in the patron account is not translated.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc
koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc
pos/register.pl

index 3e37c8d..62ea570 100644 (file)
@@ -7,7 +7,7 @@
             [%- CASE 'FORGIVEN'         -%]Forgiven
             [%- CASE 'CREDIT'           -%]Credit
             [%- CASE 'LOST_FOUND'       -%]Lost item fee refund
-            [%- CASE 'Refund'           -%]Refund
+            [%- CASE 'REFUND'           -%]Refund
             [%- CASE                    -%][% account.credit_type.description | html %]
         [%- END -%]
     [%- ELSIF account.debit_type_code -%]
index dc3444d..54fd662 100644 (file)
                 [%- CASE 'FORGIVEN'         -%]Forgiven
                 [%- CASE 'CREDIT'           -%]Credit
                 [%- CASE 'LOST_FOUND'       -%]Lost item fee refund
+                [%- CASE 'REFUND'           -%]Refund
                 [%- 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                    -%][% account.debit_type.description | html %]
-        [%- END -%]
+            [%- 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                    -%][% account.debit_type.description | html %]
+            [%- END -%]
         [%- END -%]
-        [%- SWITCH account.status -%]
+        [%- 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 'LOST'       -%]<span> (Lost)</span>
             [%- CASE              -%]
         [%- END -%]
-    </span>
-[%- END # /BLOCK account_type_description -%]
+[%- END -%]
index e73f3c1..97d6d63 100755 (executable)
@@ -127,7 +127,7 @@ else {
 
                     my $refund = $accountline->reduce(
                         {
-                            reduction_type => 'Refund',
+                            reduction_type => 'REFUND',
                             branch         => $library_id,
                             staff_id       => $logged_in_user->id,
                             interface      => 'intranet',