8 use C4::Interface::CGI::Output;
13 my ($template, $loggedinuser, $cookie)
14 = get_template_and_user({template_name => "acqui/lateorders.tmpl",
18 flagsrequired => {acquisition => 1},
21 # my $title = $query->param('title');
22 # my $ISSN = $query->param('ISSN');
23 # my @subscriptions = getsubscriptions($title,$ISSN);
25 my $supplierid = $query->param('supplierid');
26 my $delay = $query->param('delay');
27 my $branch = $query->param('branch');
29 $delay =($delay?$delay:30);
31 my %supplierlist = getsupplierlistwithlateorders($delay,$branch);
33 push @select_supplier,"";
34 foreach my $supplierid (keys %supplierlist){
35 push @select_supplier, $supplierid;
37 my $CGIsupplier=CGI::scrolling_list( -name => 'supplierid',
38 -values => \@select_supplier,
39 -default => $supplierid,
40 -labels => \%supplierlist,
44 $template->param(Supplier=>$supplierlist{$supplierid}) if ($supplierid);
48 push @select_branches,"";
49 $select_branches{""}="";
50 my ($count, @branches) = branches();
51 #branches is IndependantBranches aware
52 foreach my $branch (@branches){
53 push @select_branches, $branch->{branchcode};
54 $select_branches{$branch->{branchcode}}=$branch->{branchname};
56 my $CGIbranch=CGI::scrolling_list( -name => 'branch',
57 -values => \@select_branches,
58 -labels => \%select_branches,
62 my ($count, @lateorders) = getlateorders($delay,$supplierid,$branch);
64 foreach my $lateorder (@lateorders){
65 $total+=$lateorder->{subtotal};
67 $template->param(delay=>$delay) if ($delay);
69 CGIbranch => $CGIbranch,
70 CGIsupplier => $CGIsupplier,
71 lateorders => \@lateorders,
74 output_html_with_http_headers $query, $cookie, $template->output;