Bug 24711: Don't add logout input to login form
[koha-ffzg.git] / acqui / lateorders.pl
index 9febcf6..5dc9ea6 100755 (executable)
@@ -53,6 +53,7 @@ use C4::Context;
 use C4::Acquisition;
 use C4::Letters;
 use Koha::DateUtils;
+use Koha::Acquisition::Orders;
 
 my $input = new CGI;
 my ($template, $loggedinuser, $cookie) = get_template_and_user(
@@ -111,12 +112,12 @@ if ($op and $op eq "send_alert"){
         }
     };
 
-    if ( $@ ) {
-        $template->param(error_claim => $@);
-    } elsif ( ref $err and exists $err->{error} and $err->{error} eq "no_email" ) {
+    if ( 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_selected"){
         $template->{VARS}->{'error_claim'} = "no_order_selected";
+    } elsif ( $@ or ref $err and exists $err->{error} ) {
+        $template->param(error_claim => $@ || $err->{error});
     } else {
         $template->{VARS}->{'info_claim'} = 1;
     }