3 #script to show suppliers and orders
4 #written by chris@katipo.co.nz 23/2/2000
6 # Copyright 2000-2002 Katipo Communications
8 # This file is part of Koha.
10 # Koha is free software; you can redistribute it and/or modify it under the
11 # terms of the GNU General Public License as published by the Free Software
12 # Foundation; either version 2 of the License, or (at your option) any later
15 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
17 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License along with
20 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
21 # Suite 330, Boston, MA 02111-1307 USA
31 this script displays the list of suppliers & orders like C<$supplier> given on input arg.
32 thus, this page brings differents features like to display supplier's details,
33 to add an order for a specific supplier or to just add a new supplier.
41 C<$supplier> is the suplier we have to search order.
46 C<OP> can be equals to 'close' if we have to close a basket before building the page.
50 the C<basket> we have to close if op is equal to 'close'.
59 use C4::Interface::CGI::Output;
65 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
67 template_name => "acqui/booksellers.tmpl",
71 flagsrequired => { acquisition => 1 },
77 my $supplier = $query->param('supplier');
79 my @suppliers = GetBookSeller($supplier);
80 my $count = scalar @suppliers;
82 # check if we have to "close" a basket before building page
83 my $op = $query->param('op');
84 my $basketno = $query->param('basketno');
85 if ( $op eq 'close' ) {
86 CloseBasket($basketno);
93 for ( my $i = 0 ; $i < $count ; $i++ ) {
94 my $orders = GetPendingOrders( $suppliers[$i]->{'id'} );
95 my $ordercount = scalar @$orders;
96 $ordcount+=$ordercount;
106 $line{supplierid} = $suppliers[$i]->{'id'};
107 $line{name} = $suppliers[$i]->{'name'};
108 $line{active} = $suppliers[$i]->{'active'};
109 $line{ordcount}=$ordercount;
111 foreach my $order(@$orders){
112 push @loop_basket, $order;
114 $line{loop_basket} = \@loop_basket;
115 push @loop_suppliers, \%line;
118 loop_suppliers => \@loop_suppliers,
119 supplier => $supplier,
121 intranetcolorstylesheet =>
122 C4::Context->preference("intranetcolorstylesheet"),
123 intranetstylesheet => C4::Context->preference("intranetstylesheet"),
124 IntranetNav => C4::Context->preference("IntranetNav"),
127 output_html_with_http_headers $query, $cookie, $template->output;