From 6330108fa99ae4219ced71837540e5323fd486c8 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Wed, 1 Mar 2023 14:55:38 +0000 Subject: [PATCH] Bug 32450: (QA follow-up) Fix QA test errors Exec flag added to atomic update file, trailing whitespaces removed Unit tests patched to remove duplicate variable names --- Koha/Account.pm | 2 +- .../mysql/atomicupdate/bug_32450-add_debit_type_flag.pl | 8 ++++---- t/db_dependent/Accounts.t | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) mode change 100644 => 100755 installer/data/mysql/atomicupdate/bug_32450-add_debit_type_flag.pl diff --git a/Koha/Account.pm b/Koha/Account.pm index 517138fe41f..515189ae7c8 100644 --- a/Koha/Account.pm +++ b/Koha/Account.pm @@ -709,7 +709,7 @@ Charges can be set as exempt from non-issue by editing the debit type in the Deb sub non_issues_charges { my ($self) = @_; - + my @blocking_debit_types = Koha::Account::DebitTypes->search({ restricts_checkouts => 1 }, { columns => 'code' })->get_column('code'); return $self->lines->search( diff --git a/installer/data/mysql/atomicupdate/bug_32450-add_debit_type_flag.pl b/installer/data/mysql/atomicupdate/bug_32450-add_debit_type_flag.pl old mode 100644 new mode 100755 index 91cd3dd20e5..404747061e7 --- a/installer/data/mysql/atomicupdate/bug_32450-add_debit_type_flag.pl +++ b/installer/data/mysql/atomicupdate/bug_32450-add_debit_type_flag.pl @@ -4,10 +4,10 @@ return { bug_number => "32450", description => "Create a database flag for whether a debit type should be included in the noissuescharge block on circulation and remove redundant sysprefs.", up => sub { - my ($args) = @_; + my ($args) = @_; my ($dbh, $out) = @$args{qw(dbh out)}; - if( !column_exists( 'account_debit_types', 'restricts_checkouts' ) ) { + if( !column_exists( 'account_debit_types', 'restricts_checkouts' ) ) { $dbh->do(q{ ALTER TABLE account_debit_types ADD COLUMN `restricts_checkouts` tinyint(1) NOT NULL DEFAULT 1 AFTER `archived` }); @@ -35,7 +35,7 @@ return { $sth->execute; my $exists = $sth->fetchrow(); $sth->finish; - + if($exists) { # If it exists, retrieve its value my $find_syspref_value = "SELECT value FROM systempreferences WHERE variable = '$_'"; @@ -66,7 +66,7 @@ return { # Delete syspref as it is no longer required and the value has been transferred to account_debit_types my $delete_redundant_syspref = "DELETE FROM systempreferences WHERE variable = '$_'"; $dbh->do($delete_redundant_syspref); - + } else { # If it doesn't exist then revert to default value in the database schema say $out "$_ was not found in this Koha instance, default value has been applied."; diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t index 7b8fbcf3bd7..df53e0704b4 100755 --- a/t/db_dependent/Accounts.t +++ b/t/db_dependent/Accounts.t @@ -835,16 +835,16 @@ subtest "Koha::Account::non_issues_charges tests" => sub { } )->store; - my ( $total, $non_issues_charges ) = ( $account->balance, $account->non_issues_charges ); - my $other_charges = $total - $non_issues_charges; + my ( $new_total, $new_non_issues_charges ) = ( $account->balance, $account->non_issues_charges ); + my $new_other_charges = $new_total - $new_non_issues_charges; is( $account->balance, $res + $rent + $manual + $print, 'Total charges should be Res + Rent + Manual + Print' ); - is( $non_issues_charges, 15, + is( $new_non_issues_charges, 15, 'All types except Print should count towards the non issue charge' ); - is( $other_charges, 4, 'There should be non-included charges for Print' ); + is( $new_other_charges, 4, 'There should be non-included charges for Print' ); }; -- 2.30.2