Bug 25010: Fix typo 'rewewal' in debit types
authorKatrin Fischer <katrin.fischer.83@web.de>
Thu, 26 Mar 2020 21:30:06 +0000 (21:30 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 3 Apr 2020 13:26:35 +0000 (14:26 +0100)
This fixes a typo in the debit type description of
RENT_DAILY_RENEW

1) Go to Administration > Debit types
2) Show all debit types
3) Check for the typo
4) Apply patch
5) Verify that the typo is gone
6) Check account_debit_types table for type:
   SELECT * FROM account_debit_types;
7) Run database update
8) Repeat and verify typo is gone

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

installer/data/mysql/account_debit_types.sql
installer/data/mysql/atomicupdate/bug_25010_rewewal.perl [new file with mode: 0644]
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc
koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc

index 671704b..4e70bab 100644 (file)
@@ -10,6 +10,6 @@ INSERT INTO account_debit_types ( code, description, can_be_invoiced, can_be_sol
 ('RENT', 'Rental fee', 0, 0, NULL, 1),
 ('RENT_DAILY', 'Daily rental fee', 0, 0, NULL, 1),
 ('RENT_RENEW', 'Renewal of rental item', 0, 0, NULL, 1),
-('RENT_DAILY_RENEW', 'Rewewal of daily rental item', 0, 0, NULL, 1),
+('RENT_DAILY_RENEW', 'Renewal of daily rental item', 0, 0, NULL, 1),
 ('RESERVE', 'Hold fee', 0, 0, NULL, 1),
 ('RESERVE_EXPIRED', 'Hold waiting too long', 0, 0, NULL, 1);
diff --git a/installer/data/mysql/atomicupdate/bug_25010_rewewal.perl b/installer/data/mysql/atomicupdate/bug_25010_rewewal.perl
new file mode 100644 (file)
index 0000000..bfac380
--- /dev/null
@@ -0,0 +1,8 @@
+$DBversion = 'XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+    # you can use $dbh here like:
+    $dbh->do( "UPDATE account_debit_types SET description = REPLACE(description,'Rewewal','Renewal') WHERE description like '%Rewewal%'" );
+
+    # Always end with this (adjust the bug info)
+    NewVersion( $DBversion, 25010, "Fix typo in account_debit_type description");
+}
index cfa0318..f5ef8e2 100755 (executable)
@@ -19781,7 +19781,7 @@ if ( CheckVersion($DBversion) ) {
               ('RENT', 'Rental fee', 0, NULL, 1),
               ('RENT_DAILY', 'Daily rental fee', 0, NULL, 1),
               ('RENT_RENEW', 'Renewal of rental item', 0, NULL, 1),
-              ('RENT_DAILY_RENEW', 'Rewewal of daily rental item', 0, NULL, 1),
+              ('RENT_DAILY_RENEW', 'Renewal of daily rental item', 0, NULL, 1),
               ('RESERVE', 'Hold fee', 0, NULL, 1)
         }
     );
index 172acc6..3e37c8d 100644 (file)
@@ -22,7 +22,7 @@
            [%- CASE 'RENT'             -%]Rental fee
            [%- CASE 'RENT_DAILY'       -%]Daily rental fee
            [%- CASE 'RENT_RENEW'       -%]Renewal of rental item
-           [%- CASE 'RENT_DAILY_RENEW' -%]Rewewal of daily 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
index a193b11..93f9eeb 100644 (file)
            [%- CASE 'RENT'             -%]Rental fee
            [%- CASE 'RENT_DAILY'       -%]Daily rental fee
            [%- CASE 'RENT_RENEW'       -%]Renewal of rental item
-           [%- CASE 'RENT_DAILY_RENEW' -%]Rewewal of daily 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 %]