5 #script to show suppliers and orders
6 #written by chris@katipo.co.nz 23/2/2000
9 # Copyright 2000-2002 Katipo Communications
11 # This file is part of Koha.
13 # Koha is free software; you can redistribute it and/or modify it under the
14 # terms of the GNU General Public License as published by the Free Software
15 # Foundation; either version 2 of the License, or (at your option) any later
18 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
19 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
20 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
22 # You should have received a copy of the GNU General Public License along with
23 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
24 # Suite 330, Boston, MA 02111-1307 USA
31 use C4::Interface::CGI::Output;
38 my ($template, $loggedinuser, $cookie)
39 = get_template_and_user({template_name => "bull/order.tmpl",
43 flagsrequired => {acquisition => 1},
47 my $supplier=$query->param('supplier');
48 my ($count,@suppliers)=bookseller($supplier);
53 for (my $i=0; $i<$count; $i++) {
54 my ($ordcount,$orders)=getorders($suppliers[$i]->{'id'});
63 $line{aqbooksellerid} =$suppliers[$i]->{'id'};
64 $line{name} = $suppliers[$i]->{'name'};
65 $line{active} = $suppliers[$i]->{'active'};
67 for (my $i2=0;$i2<$ordcount;$i2++){
69 $inner_line{basketno} =$orders->[$i2]->{'basketno'};
70 $inner_line{total} =$orders->[$i2]->{'count(*)'};
71 $inner_line{authorisedby} = $orders->[$i2]->{'authorisedby'};
72 $inner_line{creationdate} = format_date($orders->[$i2]->{'creationdate'});
73 $inner_line{closedate} = format_date($orders->[$i2]->{'closedate'});
74 push @loop_basket, \%inner_line;
76 $line{loop_basket} = \@loop_basket;
77 push @loop_suppliers, \%line;
79 $template->param(loop_suppliers => \@loop_suppliers,
80 supplier => $supplier,
83 output_html_with_http_headers $query, $cookie, $template->output;