3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # Koha is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with Koha; if not, see <http://www.gnu.org/licenses>.
27 my ($template, $loggedinuser, $cookie) = get_template_and_user({
28 template_name => "acqui/csv/lateorders.tt",
31 flagsrequired => {acquisition => 'order_receive'},
33 my @ordernumbers = $input->multi_param('ordernumber');
36 for my $ordernumber ( @ordernumbers ) {
37 my $order = GetOrder $ordernumber;
39 orderdate => $order->{orderdate},
40 latesince => $order->{latesince},
41 estimateddeliverydate => $order->{estimateddeliverydate},
42 supplier => $order->{supplier},
43 supplierid => $order->{supplierid},
44 title => $order->{title},
45 author => $order->{author},
46 publisher => $order->{publisher},
47 unitpricesupplier => $order->{unitpricesupplier},
48 quantity_to_receive => $order->{quantity_to_receive},
49 subtotal => $order->{subtotal},
50 budget => $order->{budget},
51 basketname => $order->{basketname},
52 basketno => $order->{basketno},
53 claims_count => $order->{claims_count},
54 claimed_date => $order->{claimed_date},
61 -attachment => 'lateorders.csv',
63 $template->param( orders => \@orders );
64 for my $line ( split '\n', $template->output ) {
65 print "$line\n" unless $line =~ m|^\s*$|;