3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free Software
7 # Foundation; either version 2 of the License, or (at your option) any later
10 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License along with
15 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
16 # Suite 330, Boston, MA 02111-1307 USA
26 use C4::Interface::CGI::Output;
31 my ($template, $loggedinuser, $cookie)
32 = get_template_and_user({template_name => "acqui/lateorders.tmpl",
36 flagsrequired => {acquisition => 1},
39 # my $title = $query->param('title');
40 # my $ISSN = $query->param('ISSN');
41 # my @subscriptions = GetSubscriptions($title,$ISSN);
43 my $supplierid = $query->param('supplierid');
44 my $delay = $query->param('delay');
45 my $branch = $query->param('branch');
47 $delay =($delay?$delay:30);
49 my %supplierlist = getsupplierlistwithlateorders($delay,$branch);
51 push @select_supplier,"";
52 foreach my $supplierid (keys %supplierlist){
53 push @select_supplier, $supplierid;
55 my $CGIsupplier=CGI::scrolling_list( -name => 'supplierid',
56 -values => \@select_supplier,
57 -default => $supplierid,
58 -labels => \%supplierlist,
63 $template->param(Supplier=>$supplierlist{$supplierid}) if ($supplierid);
65 my $branches = getbranches;
67 foreach my $thisbranch (sort keys %$branches) {
68 my %row =(value => $thisbranch,
69 branchname => $branches->{$thisbranch}->{'branchname'},
71 push @branchloop, \%row;
73 my $CGIbranch=CGI::scrolling_list( -name => 'branch',
74 -values => \@select_branches,
75 -labels => \%select_branches,
80 my ($count, @lateorders) = getlateorders($delay,$supplierid,$branch);
82 foreach my $lateorder (@lateorders){
83 $total+=$lateorder->{subtotal};
85 $template->param(delay=>$delay) if ($delay);
87 branchloop => \@branchloop,
88 CGIsupplier => $CGIsupplier,
89 lateorders => \@lateorders,
91 intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
93 output_html_with_http_headers $query, $cookie, $template->output;