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 this script shows late orders for a specific supplier, branch and delay
34 To know on which supplier this script have to display late order.
37 To know the time boundary. Default value is 30 days.
40 To know on which branch this script have to display late order.
55 use C4::Branch; # GetBranches
58 my ($template, $loggedinuser, $cookie)
59 = get_template_and_user(
60 {template_name => "acqui/lateorders.tmpl",
64 flagsrequired => {acquisition => 1},
68 my $supplierid = $input->param('supplierid');
69 my $delay = $input->param('delay');
70 my $branch = $input->param('branch');
72 #default value for delay
73 $delay = 30 unless $delay;
75 my %supplierlist = GetBooksellersWithLateOrders($delay,$branch);
77 push @select_supplier,"";
78 foreach my $supplierid (keys %supplierlist){
79 push @select_supplier, $supplierid;
82 my $CGIsupplier=CGI::scrolling_list( -name => 'supplierid',
83 -values => \@select_supplier,
84 -default => $supplierid,
85 -labels => \%supplierlist,
90 $template->param(Supplier=>$supplierlist{$supplierid}) if ($supplierid);
92 my @lateorders = GetLateOrders($delay,$supplierid,$branch);
93 my $count = scalar @lateorders;
96 foreach my $lateorder (@lateorders){
97 $total+=$lateorder->{subtotal};
101 my $letters=GetLetters("claimacquisition");
102 foreach (keys %$letters){
103 push @letters ,{code=>$_,name=>$letters->{$_}};
106 $template->param(letters=>\@letters) if (@letters);
107 my $op=$input->param("op");
108 if ($op eq "send_alert"){
109 my @ordernums=$input->param("claim_for");
110 SendAlerts('claimacquisition',\@ordernums,$input->param("letter_code"));
113 $template->param(delay=>$delay) if ($delay);
115 CGIsupplier => $CGIsupplier,
116 lateorders => \@lateorders,
118 intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
120 output_html_with_http_headers $input, $cookie, $template->output;