From 3a5d5367f10fa1101e99748aadf0c076ebd9dea7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Sun, 25 Oct 2020 23:12:15 +0000 Subject: [PATCH] Bug 25596: DBRev 20.06.00.054 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_25596.perl | 25 ------------------ installer/data/mysql/updatedatabase.pl | 26 +++++++++++++++++++ 3 files changed, 27 insertions(+), 26 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_25596.perl diff --git a/Koha.pm b/Koha.pm index a9069e049d..440f6577db 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "20.06.00.053"; +$VERSION = "20.06.00.054"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_25596.perl b/installer/data/mysql/atomicupdate/bug_25596.perl deleted file mode 100644 index faa74934bd..0000000000 --- a/installer/data/mysql/atomicupdate/bug_25596.perl +++ /dev/null @@ -1,25 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if ( CheckVersion($DBversion) ) { - - $dbh->do( - qq{ - INSERT IGNORE INTO account_credit_types (code, description, can_be_added_manually, is_system) - VALUES - ('OVERPAYMENT', 'Overpayment refund', 0, 1) - } - ); - - $dbh->do( - qq{ - INSERT IGNORE INTO account_offset_types ( type ) VALUES ('Overpayment'); - } - ); - - $dbh->do( - qq{ - UPDATE accountlines SET credit_type_code = 'OVERPAYMENT' WHERE credit_type_code = 'CREDIT' AND description = 'Overpayment refund' - } - ); - - NewVersion( $DBversion, 25596, "Add OVERPAYMENT credit type" ); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 45f5ceef4a..2b312a4a09 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -23081,6 +23081,32 @@ if( CheckVersion( $DBversion ) ) { NewVersion( $DBversion, 26569, "Use gender neutral pronouns in system preference explanations" ); } +$DBversion = '20.06.00.054'; +if ( CheckVersion($DBversion) ) { + + $dbh->do( + qq{ + INSERT IGNORE INTO account_credit_types (code, description, can_be_added_manually, is_system) + VALUES + ('OVERPAYMENT', 'Overpayment refund', 0, 1) + } + ); + + $dbh->do( + qq{ + INSERT IGNORE INTO account_offset_types ( type ) VALUES ('Overpayment'); + } + ); + + $dbh->do( + qq{ + UPDATE accountlines SET credit_type_code = 'OVERPAYMENT' WHERE credit_type_code = 'CREDIT' AND description = 'Overpayment refund' + } + ); + + NewVersion( $DBversion, 25596, "Add OVERPAYMENT credit type" ); +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; -- 2.39.5