From d688e4e03bdf80ea408cf89d5710d2dc1ef3cd7e Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 18 Jun 2018 16:58:59 +0100 Subject: [PATCH] Bug 11897: (follow-up) Default to 'replyto' and fallback on 'from' In recent koha's, branchemail isn't necessarily an email address the branch has access to. Reply-to however should always be accessible and as such this patch uses that in preference to 'From'. --- Koha/StockRotationStage.pm | 12 +++++++++--- misc/cronjobs/stockrotation.pl | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Koha/StockRotationStage.pm b/Koha/StockRotationStage.pm index eadb71686e..dc76ba83f6 100644 --- a/Koha/StockRotationStage.pm +++ b/Koha/StockRotationStage.pm @@ -333,7 +333,9 @@ sub investigate { $report->{branched}->{$stagebranchcode} = { code => $stagebranchcode, name => $stagebranch->branchname, - email => $stagebranch->branchemail, + email => $stagebranch->branchreplyto + ? $stagebranch->branchreplyto + : $stagebranch->branchemail, phone => $stagebranch->branchphone, items => [], log => [], @@ -355,7 +357,9 @@ sub investigate { $report->{branched}->{$branchcode} = { code => $branchcode, name => $branch->branchname, - email => $branch->branchemail, + email => $stagebranch->branchreplyto + ? $stagebranch->branchreplyto + : $stagebranch->branchemail, phone => $branch->branchphone, items => [], log => [], @@ -371,7 +375,9 @@ sub investigate { $report->{branched}->{$branchcode} = { code => $branchcode, name => $branch->branchname, - email => $branch->branchemail, + email => $stagebranch->branchreplyto + ? $stagebranch->branchreplyto + : $stagebranch->branchemail, phone => $branch->branchphone, items => [], log => [], diff --git a/misc/cronjobs/stockrotation.pl b/misc/cronjobs/stockrotation.pl index c4f276720c..a6cd0c12b1 100755 --- a/misc/cronjobs/stockrotation.pl +++ b/misc/cronjobs/stockrotation.pl @@ -110,6 +110,7 @@ database updates have been performed."). use Modern::Perl; use Getopt::Long qw/HelpMessage :config gnu_getopt/; use C4::Context; +use C4::Letters; use Koha::StockRotationRotas; my $admin_email = ''; -- 2.17.1