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

(-)a/acqui/cancelorder.pl (-2 / +8 lines)
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 )
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/cancelorder.tt (-1 / +3 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_already_cancelled %]
66
                    <p>The order has been cancelled already.</p>
67
                [% END %]
65
                [% IF ( error_delitem ) %]
68
                [% IF ( error_delitem ) %]
66
                    <p>The order has been cancelled, although one or more items could not have been deleted.</p>
69
                    <p>The order has been cancelled, although one or more items could not have been deleted.</p>
67
                [% END %]
70
                [% END %]
68
- 

Return to bug 29658