Bug 30718: Pass DT to filter_by_lates
[srvgit] / acqui / cancelorder.pl
index 6278202..2d0d367 100755 (executable)
@@ -57,7 +57,7 @@ if( $action and $action eq "confirmcancel" ) {
     my $reason = $input->param('reason');
     my $order  = Koha::Acquisition::Orders->find($ordernumber);
     $order->cancel({ reason => $reason, delete_biblio => $delete_biblio });
-    my @messages = @{ $order->messages };
+    my @messages = @{ $order->object_messages };
 
     if ( scalar @messages > 0 ) {
         $template->param( error_delitem => 1 )
@@ -65,11 +65,11 @@ if( $action and $action eq "confirmcancel" ) {
         $template->param( error_delbiblio => 1 )
             if $messages[0]->message eq 'error_delbiblio';
     } else {
-        $template->param(success_cancelorder => 1);
         # Log the cancellation of the order
-        if (C4::Context->preference("AcqLog")) {
+        if (C4::Context->preference("AcquisitionLog")) {
             logaction('ACQUISITIONS', 'CANCEL_ORDER', $ordernumber);
         }
+        $template->param(success_cancelorder => 1);
     }
     $template->param(confirmcancel => 1);
 }