From 9305c66c0b73bf8831a976815b54160429adc0c1 Mon Sep 17 00:00:00 2001 From: Emmi Takkinen Date: Mon, 6 Jul 2020 10:03:27 +0300 Subject: [PATCH 4/5] Bug 13961: Fix QA issues This patch fixes following QA issues: FAIL C4/Letters.pm FAIL critic # Variables::ProhibitConditionalDeclarations: Got 1 violation(s). FAIL t/db_dependent/Letters.t FAIL critic # Variables::ProhibitConditionalDeclarations: Got 1 violation(s). Sponsored-by: Koha-Suomi Oy --- C4/Letters.pm | 2 +- t/db_dependent/Letters.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index b5f62da3e2..cd9285219c 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -670,7 +670,7 @@ sub GetPreparedLetter { $letter->{content} =~ s/<>/$OPACBaseURL/go; my $active_currency = Koha::Acquisition::Currencies->get_active; - my $currency_format = $active_currency->currency if defined($active_currency); + my $currency_format = (defined($active_currency)) ? $active_currency->currency : undef; my $borrowernumber = $tables->{borrowers}; my $lines = Koha::Account::Lines->search({ borrowernumber => $borrowernumber }); diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t index 98de56e443..9269d3d183 100755 --- a/t/db_dependent/Letters.t +++ b/t/db_dependent/Letters.t @@ -377,7 +377,7 @@ $account->add_debit({ amount => 15, interface => 'test', type => 'OVERDUE'})->st my $lines = Koha::Account::Lines->search({ borrowernumber => $borrowernumber }); my $totalfine = $lines->total_outstanding; my $active_currency = Koha::Acquisition::Currencies->get_active; -my $currency_format = $active_currency->currency if defined($active_currency); +my $currency_format = (defined($active_currency)) ? $active_currency->currency : undef; my $totalfine_formatted = currency_format($currency_format, "$totalfine", FMT_SYMBOL); $totalfine_formatted = sprintf("%.2f", $totalfine) unless $totalfine_formatted; -- 2.25.1