Lines 56-65
my $delete_biblio = $input->param('del_biblio') ? 1 : 0;
Link Here
|
56 |
if( $action and $action eq "confirmcancel" ) { |
56 |
if( $action and $action eq "confirmcancel" ) { |
57 |
my $reason = $input->param('reason'); |
57 |
my $reason = $input->param('reason'); |
58 |
my $order = Koha::Acquisition::Orders->find($ordernumber); |
58 |
my $order = Koha::Acquisition::Orders->find($ordernumber); |
59 |
$order->cancel({ reason => $reason, delete_biblio => $delete_biblio }); |
59 |
my @messages; |
60 |
my @messages = @{ $order->messages }; |
60 |
if( $order && !$order->datecancellationprinted ) { |
|
|
61 |
$order->cancel({ reason => $reason, delete_biblio => $delete_biblio }); |
62 |
@messages = @{ $order->messages }; |
63 |
} else { # combining missing order and cancelled order |
64 |
push @messages, Koha::Object::Message->new({ message => 'error_already_cancelled', type => 'error' }); |
65 |
} |
61 |
|
66 |
|
62 |
if ( scalar @messages > 0 ) { |
67 |
if ( scalar @messages > 0 ) { |
|
|
68 |
$template->param( error_already_cancelled => 1) if $messages[0]->message eq 'error_already_cancelled'; |
63 |
$template->param( error_delitem => 1 ) |
69 |
$template->param( error_delitem => 1 ) |
64 |
if $messages[0]->message eq 'error_delitem'; |
70 |
if $messages[0]->message eq 'error_delitem'; |
65 |
$template->param( error_delbiblio => 1 ) |
71 |
$template->param( error_delbiblio => 1 ) |