Lines 56-63
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->object_messages }; |
60 |
if( !$order ) { |
|
|
61 |
push @messages, Koha::Object::Message->new({ message => 'error_order_not_found', type => 'error' }); |
62 |
$template->param( error_order_not_found => 1 ); |
63 |
} elsif( $order->datecancellationprinted ) { |
64 |
push @messages, Koha::Object::Message->new({ message => 'error_order_already_cancelled', type => 'error' }); |
65 |
$template->param( error_order_already_cancelled => 1 ); |
66 |
} else { |
67 |
$order->cancel({ reason => $reason, delete_biblio => $delete_biblio }); |
68 |
@messages = @{ $order->object_messages }; |
69 |
} |
61 |
|
70 |
|
62 |
if ( scalar @messages > 0 ) { |
71 |
if ( scalar @messages > 0 ) { |
63 |
$template->param( error_delitem => 1 ) |
72 |
$template->param( error_delitem => 1 ) |