3 # Copyright 2021 Aleisha Amohia <aleisha@catalyst.net.nz>
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # Koha is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with Koha; if not, see <http://www.gnu.org/licenses>.
26 Modify just the estimated delivery date of an individual order when
38 use Koha::Acquisition::Booksellers;
42 my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
43 template_name => 'acqui/moddeliverydate.tt',
46 flagsrequired => { 'acquisition' => '*' },
50 my $op = $input->param('op');
51 my $ordernumber = $input->param('ordernumber');
52 my $referrer = $input->param('referrer') || $input->referer();
53 my $order = GetOrder($ordernumber);
54 my $basket = GetBasket($order->{basketno});
55 my $bookseller = Koha::Acquisition::Booksellers->find( $basket->{booksellerid} );
57 if($op and $op eq 'save') {
58 my $estimated_delivery_date = $input->param('estimated_delivery_date');
59 $order->{'estimated_delivery_date'} = dt_from_string( $estimated_delivery_date );
61 print $input->redirect($referrer);
65 estimated_delivery_date => $order->{'estimated_delivery_date'}
70 $template->param($op => 1);
74 basketname => $basket->{'basketname'},
75 basketno => $order->{basketno},
76 booksellerid => $bookseller->id,
77 booksellername => $bookseller->name,
78 ordernumber => $ordernumber,
79 referrer => $referrer,
83 output_html_with_http_headers $input, $cookie, $template->output;