5 #script to show display basket of 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
29 use C4::Interface::CGI::Output;
36 my $supplierid=$input->param('supplierid');
37 my $order=$input->param('orderby') || "datereceived desc";
38 my $startfrom=$input->param('startfrom');
39 my $code=$input->param('filter');
40 my $datefrom=$input->param('datefrom');
41 my $dateto=$input->param('dateto');
42 my $resultsperpage = $input->param('resultsperpage');
44 my ($count,@booksellers)=bookseller($supplierid);
46 my ($template, $loggedinuser, $cookie)
47 = get_template_and_user({template_name => "acqui/recieveorder.tmpl",
51 flagsrequired => {acquisition => 1},
56 $resultsperpage = 20 unless ($resultsperpage);
57 my ($count,@results)=getparcels($supplierid, $order, $code,$datefrom,$dateto);
59 # multi page display gestion
60 $startfrom=0 unless ($startfrom);
61 if ($count>$resultsperpage){
63 my $displayprev=$startfrom;
64 if(($count - ($startfrom+$resultsperpage)) > 0 ) {
69 if ($count>$resultsperpage) {
70 for (my $i=1; $i<$count/$resultsperpage+1; $i++) {
73 ($startfrom/$resultsperpage==($i-1)) && ($highlight=1);
74 push @numbers, { number => $i,
75 highlight => $highlight ,
76 # searchdata=> "test",
77 startfrom => ($i-1)*$resultsperpage};
82 my $from = $startfrom*$resultsperpage+1;
85 if($count < (($startfrom+1)*$resultsperpage))
89 $to = (($startfrom+1)*$resultsperpage);
91 $template->param(numbers=>\@numbers,
92 displaynext=>$displaynext,
93 displayprev=>$displayprev,
94 nextstartfrom=>(($startfrom+$resultsperpage<$count)?$startfrom+$resultsperpage:$count),
95 prevstartfrom=>(($startfrom-$resultsperpage>0)?$startfrom-$resultsperpage:0)
101 for (my $i=$startfrom;$i<=($startfrom+$resultsperpage-1<$count-1?$startfrom+$resultsperpage-1:$count-1);$i++){
102 ### startfrom: $startfrom
103 ### resultsperpage: $resultsperpage
105 ### code: $results[$i]->{booksellerinvoicenumber}
106 ### datereceived: $results[$i]->{datereceived}
110 $cell{code}=$results[$i]->{booksellerinvoicenumber};
111 $cell{nullcode}=$results[$i]->{booksellerinvoicenumber} eq "NULL";
112 $cell{emptycode}=$results[$i]->{booksellerinvoicenumber} eq '';
113 $cell{raw_datereceived}=$results[$i]->{datereceived};
114 $cell{datereceived}=format_date($results[$i]->{datereceived});
115 $cell{bibcount}=$results[$i]->{biblio};
116 $cell{reccount}=$results[$i]->{itemsreceived};
117 $cell{itemcount}=$results[$i]->{itemsexpected};
118 $cell{hilighted} = $hilighted%2;
120 push @loopres, \%cell;
122 $template->param(searchresults=>\@loopres, count=>$count) if ($count);
123 $template->param(orderby=>$order, filter=>$code, datefrom=>$datefrom,dateto=>$dateto, resultsperpage=>$resultsperpage);
125 name => $booksellers[0]->{'name'},
126 supplierid => $supplierid,
127 intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
128 intranetstylesheet => C4::Context->preference("intranetstylesheet"),
129 IntranetNav => C4::Context->preference("IntranetNav"),
132 output_html_with_http_headers $input, $cookie, $template->output;