5 #script to show suppliers and orders
6 #written by chris@katipo.co.nz 23/2/2000
8 # Copyright 2000-2002 Katipo Communications
10 # This file is part of Koha.
12 # Koha is free software; you can redistribute it and/or modify it under the
13 # terms of the GNU General Public License as published by the Free Software
14 # Foundation; either version 2 of the License, or (at your option) any later
17 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
18 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
19 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License along with
22 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
23 # Suite 330, Boston, MA 02111-1307 USA
30 use C4::Interface::CGI::Output;
37 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
39 template_name => "acqui/order.tmpl",
43 flagsrequired => { acquisition => 1 },
48 my $supplier = $query->param('supplier');
49 my ( $count, @suppliers ) = bookseller($supplier);
51 # check if we have to "close" a basket before building page
52 my $op = $query->param('op');
53 my $basket = $query->param('basket');
54 if ( $op eq 'close' ) {
61 for ( my $i = 0 ; $i < $count ; $i++ ) {
62 my ( $ordcount, $orders ) = getorders( $suppliers[$i]->{'id'} );
72 $line{supplierid} = $suppliers[$i]->{'id'};
73 $line{name} = $suppliers[$i]->{'name'};
74 $line{active} = $suppliers[$i]->{'active'};
76 for ( my $i2 = 0 ; $i2 < $ordcount ; $i2++ ) {
78 $inner_line{basketno} = $orders->[$i2]->{'basketno'};
79 $inner_line{total} = $orders->[$i2]->{'count(*)'};
80 $inner_line{authorisedby} = $orders->[$i2]->{'authorisedby'};
81 $inner_line{surname} = $orders->[$i2]->{'firstname'};
82 $inner_line{firstname} = $orders->[$i2]->{'surname'};
83 $inner_line{creationdate} =
84 format_date( $orders->[$i2]->{'creationdate'} );
85 $inner_line{closedate} = format_date( $orders->[$i2]->{'closedate'} );
86 push @loop_basket, \%inner_line;
88 $line{loop_basket} = \@loop_basket;
89 push @loop_suppliers, \%line;
92 loop_suppliers => \@loop_suppliers,
93 supplier => $supplier,
95 intranetcolorstylesheet =>
96 C4::Context->preference("intranetcolorstylesheet"),
97 intranetstylesheet => C4::Context->preference("intranetstylesheet"),
98 IntranetNav => C4::Context->preference("IntranetNav"),
101 output_html_with_http_headers $query, $cookie, $template->output;