Adding a status description.
[koha.git] / acqui / histsearch.pl
blob661341548175ce07d8f7abcbb41f41afbd983bb8
1 #!/usr/bin/perl
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
8 # version.
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
18 # $Id$
20 =head1 NAME
22 histsearch.pl
24 =head1 DESCRIPTION
26 this script offer a interface to search among order.
28 =head1 CGI PARAMETERS
30 =over 4
32 =item title
33 if the script has to filter the results on title.
35 =item author
36 if the script has to filter the results on author.
38 =item name
39 if the script has to filter the results on supplier.
41 =item fromplacedon
42 to filter on started date.
44 =item toplacedon
45 to filter on ended date.
47 =back
49 =cut
51 use strict;
52 require Exporter;
53 use CGI;
54 use C4::Auth; # get_template_and_user
55 use C4::Output;
56 use C4::Acquisition;
58 my $input = new CGI;
59 my $title = $input->param('title');
60 my $author = $input->param('author');
61 my $name = $input->param('name');
62 my $from_placed_on = $input->param('fromplacedon');
63 my $to_placed_on = $input->param('toplacedon');
65 my $dbh = C4::Context->dbh;
66 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
68 template_name => "acqui/histsearch.tmpl",
69 query => $input,
70 type => "intranet",
71 authnotrequired => 0,
72 flagsrequired => { acquisition => 1 },
73 debug => 1,
77 my ( $order_loop, $total_qty, $total_price, $total_qtyreceived ) =
78 &GetHistory( $title, $author, $name, $from_placed_on, $to_placed_on );
80 $template->param(
81 suggestions_loop => $order_loop,
82 total_qty => $total_qty,
83 total_qtyreceived => $total_qtyreceived,
84 total_price => sprintf( "%.2f", $total_price ),
85 numresults => scalar(@$order_loop),
86 title => $title,
87 author => $author,
88 name => $name,
89 from_placed_on => $from_placed_on,
90 to_placed_on => $to_placed_on,
91 intranetcolorstylesheet =>
92 C4::Context->preference("intranetcolorstylesheet"),
93 intranetstylesheet => C4::Context->preference("intranetstylesheet"),
94 IntranetNav => C4::Context->preference("IntranetNav"),
97 output_html_with_http_headers $input, $cookie, $template->output;