3 # Copyright 2011 BibLibre SARL
4 # This file is part of Koha.
6 # Koha is free software; you can redistribute it and/or modify it under the
7 # terms of the GNU General Public License as published by the Free Software
8 # Foundation; either version 2 of the License, or (at your option) any later
11 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License along
16 # with Koha; if not, write to the Free Software Foundation, Inc.,
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 Ask confirmation for cancelling an order line
26 and add possibility to indicate a reason for cancellation
27 (saved in aqorders.notes)
39 my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
40 template_name => 'acqui/cancelorder.tt',
44 flagsrequired => { 'acquisition' => 'order_manage' },
48 my $action = $input->param('action');
49 my $ordernumber = $input->param('ordernumber');
50 my $biblionumber = $input->param('biblionumber');
51 my $referrer = $input->param('referrer') || $input->referer;
52 my $del_biblio = $input->param('del_biblio') ? 1 : 0;
54 if($action and $action eq "confirmcancel") {
55 my $reason = $input->param('reason');
56 my $error = DelOrder($biblionumber, $ordernumber, $del_biblio, $reason);
59 $template->param(error_delitem => 1) if $error->{'delitem'};
60 $template->param(error_delbiblio => 1) if $error->{'delbiblio'};
62 $template->param(success_cancelorder => 1);
64 $template->param(confirmcancel => 1);
68 ordernumber => $ordernumber,
69 biblionumber => $biblionumber,
70 referrer => $referrer,
71 del_biblio => $del_biblio,
74 output_html_with_http_headers $input, $cookie, $template->output;