View | Details | Raw Unified | Return to bug 29658
Collapse All | Expand All

(-)a/acqui/cancelorder.pl (-2 / +11 lines)
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 )
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/cancelorder.tt (-1 / +5 lines)
Lines 62-67 Link Here
62
        [% ELSE %]
62
        [% ELSE %]
63
            <div class="dialog alert">
63
            <div class="dialog alert">
64
                An error has occurred.
64
                An error has occurred.
65
                [% IF error_order_already_cancelled %]
66
                    <p>The order has been cancelled already.</p>
67
                [% ELSIF error_order_not_found %]
68
                    <p>The order could not be found.</p>
69
                [% END %]
65
                [% IF ( error_delitem ) %]
70
                [% IF ( error_delitem ) %]
66
                    <p>The order has been cancelled, although one or more items could not have been deleted.</p>
71
                    <p>The order has been cancelled, although one or more items could not have been deleted.</p>
67
                [% END %]
72
                [% END %]
68
- 

Return to bug 29658