From 1f96934b6ff48963ac06387651ee5b51d1a984b2 Mon Sep 17 00:00:00 2001 From: Emmi Takkinen Date: Mon, 6 Jul 2020 10:03:27 +0300 Subject: [PATCH 1/2] 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 49cd51f85d..8951374b62 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -634,7 +634,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 cd917a6dec..9d65217ed5 100644 --- a/t/db_dependent/Letters.t +++ b/t/db_dependent/Letters.t @@ -365,7 +365,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.17.1