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
25 this script shows late orders for a specific supplier, branch and delay
33 To know on which supplier this script have to display late order.
36 To know the time boundary. Default value is 30 days.
39 To know on which branch this script have to display late order.
54 use C4
::Branch
; # GetBranches
57 my ($template, $loggedinuser, $cookie)
58 = get_template_and_user
(
59 {template_name
=> "acqui/lateorders.tmpl",
63 flagsrequired
=> {acquisition
=> 1},
67 my $supplierid = $input->param('supplierid');
68 my $delay = $input->param('delay');
69 my $branch = $input->param('branch');
71 #default value for delay
72 $delay = 30 unless $delay;
74 my %supplierlist = GetBooksellersWithLateOrders
($delay,$branch);
76 push @select_supplier,"";
77 foreach my $supplierid (keys %supplierlist){
78 push @select_supplier, $supplierid;
81 my $CGIsupplier=CGI
::scrolling_list
( -name
=> 'supplierid',
82 -values => \
@select_supplier,
83 -default => $supplierid,
84 -labels
=> \
%supplierlist,
89 $template->param(Supplier
=>$supplierlist{$supplierid}) if ($supplierid);
91 my @lateorders = GetLateOrders
($delay,$supplierid,$branch);
92 my $count = scalar @lateorders;
95 foreach my $lateorder (@lateorders){
96 $total+=$lateorder->{subtotal
};
100 my $letters=GetLetters
("claimacquisition");
101 foreach (keys %$letters){
102 push @letters ,{code
=>$_,name
=>$letters->{$_}};
105 $template->param(letters
=>\
@letters) if (@letters);
106 my $op=$input->param("op");
107 if ($op eq "send_alert"){
108 my @ordernums=$input->param("claim_for");
109 SendAlerts
('claimacquisition',\
@ordernums,$input->param("letter_code"));
112 $template->param(delay
=>$delay) if ($delay);
114 CGIsupplier
=> $CGIsupplier,
115 lateorders
=> \
@lateorders,
117 intranetcolorstylesheet
=> C4
::Context
->preference("intranetcolorstylesheet"),
119 output_html_with_http_headers
$input, $cookie, $template->output;