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 offer a interface to search among order.
32 if the script has to filter the results on title.
35 if the script has to filter the results on author.
38 if the script has to filter the results on supplier.
41 to filter on started date.
44 to filter on ended date.
52 use C4
::Auth
; # get_template_and_user
59 my $title = $input->param( 'title');
60 my $author = $input->param('author');
61 my $name = $input->param( 'name' );
62 my $from_placed_on = C4
::Dates
->new($input->param('from'));
63 my $to_placed_on = C4
::Dates
->new($input->param( 'to'));
65 my $dbh = C4
::Context
->dbh;
66 my ( $template, $loggedinuser, $cookie ) = get_template_and_user
(
68 template_name
=> "acqui/histsearch.tmpl",
72 flagsrequired
=> { acquisition
=> 1 },
77 my $from_iso = C4
::Dates
->new($input->param('from'))->output('iso') if $input->param('from');
78 my $to_iso = C4
::Dates
->new($input->param('to'))->output('iso') if $input->param('iso');
79 my ( $order_loop, $total_qty, $total_price, $total_qtyreceived ) =
80 &GetHistory
( $title, $author, $name, $from_iso, $to_iso );
83 suggestions_loop
=> $order_loop,
84 total_qty
=> $total_qty,
85 total_qtyreceived
=> $total_qtyreceived,
86 total_price
=> sprintf( "%.2f", $total_price ),
87 numresults
=> scalar(@
$order_loop),
91 from_placed_on
=> $from_placed_on->output('syspref'),
92 to_placed_on
=> $to_placed_on->output('syspref'),
93 DHTMLcalendar_dateformat
=> C4
::Dates
->DHTMLcalendar(),
94 dateformat
=> C4
::Dates
->new()->format(),
95 debug
=> $debug || $input->param('debug') || 0,
98 output_html_with_http_headers
$input, $cookie, $template->output;