5 #script to recieve orders
6 #written by chris@katipo.co.nz 24/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 $id=$input->param('id');
39 my ($count,@booksellers)=bookseller($id);
40 my $invoice=$input->param('invoice');
41 my $freight=$input->param('freight');
42 my $gst=$input->param('gst');
43 my $date=localtime(time);
45 my ($template, $loggedinuser, $cookie)
46 = get_template_and_user({template_name => "acqui/recieve.tmpl",
50 flagsrequired => {acquisition => 1},
55 ($count,@results)=invoice($invoice);
57 ($count,@results)=getallorders($id);
66 for (my$i=0;$i<$count;$i++){
67 $total=($results[$i]->{'unitprice'} + $results[$i]->{'freight'}) * $results[$i]->{'quantityreceived'};
68 $results[$i]->{'unitprice'}+=0;
71 $line{color}='#ffffcc';
77 $line{basketno} = $results[$i]->{'basketno'};
78 $line{isbn} = $results[$i]->{'isbn'};
79 $line{ordernumber} = $results[$i]->{'ordernumber'};
80 $line{biblionumber} = $results[$i]->{'biblionumber'};
81 $line{invoice} = $invoice;
83 $line{title} = $results[$i]->{'title'};
84 $line{author} = $results[$i]->{'author'};
85 $line{unitprice} = $results[$i]->{'unitprice'};
86 $line{quantityrecieved} = $results[$i]->{'quantityreceived'};
87 $line{total} = $total;
89 push @loop_orders, \%line;
90 $totalprice+=$results[$i]->{'unitprice'};
91 $totalfreight+=$results[$i]->{'freight'};
92 $totalquantity+=$results[$i]->{'quantityreceived'};
96 $totalfreight=$freight;
97 $tototal=$tototal+$freight;
99 $template->param(invoice => $invoice,
100 user => $loggedinuser,
102 name => $booksellers[0]->{'name'},
108 loop_orders => \@loop_orders,
109 totalprice => $totalprice,
110 totalfreight => $totalfreight,
111 totalquantity => $totalquantity,
114 grandtot => $tototal+$gst,
116 output_html_with_http_headers $input, $cookie, $template->output;