diff --git a/C4/Letters.pm b/C4/Letters.pm index 8c9f5072f4..5673cbc234 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -324,6 +324,12 @@ sub SendAlerts { LEFT JOIN aqbooksellers ON subscription.aqbooksellerid=aqbooksellers.id WHERE serial.serialid IN ( }; + + if (!@$externalid){ + carp "No Order seleted"; + return { error => "no_order_seleted" }; + } + $strsth .= join( ",", @$externalid ) . ")"; my $sthorders = $dbh->prepare($strsth); $sthorders->execute; diff --git a/acqui/lateorders.pl b/acqui/lateorders.pl index d43dbbefaa..b68673f17f 100755 --- a/acqui/lateorders.pl +++ b/acqui/lateorders.pl @@ -116,6 +116,8 @@ if ($op and $op eq "send_alert"){ $template->param(error_claim => $@); } elsif ( ref $err and exists $err->{error} and $err->{error} eq "no_email" ) { $template->{VARS}->{'error_claim'} = "no_email"; + } elsif ( ref $err and exists $err->{error} and $err->{error} eq "no_order_seleted"){ + $template->{VARS}->{'error_claim'} = "no_order_seleted"; } else { $template->{VARS}->{'info_claim'} = 1; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt index efa0db6daf..d794d74f0b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt @@ -83,6 +83,8 @@ $(document).ready(function() { [% IF error_claim %] [% IF ( error_claim == "no_email" ) %]