3 #script to add a new item and to mark orders as received
4 #written 1/3/00 by chris@katipo.co.nz
7 # Copyright 2000-2002 Katipo Communications
9 # This file is part of Koha.
11 # Koha is free software; you can redistribute it and/or modify it under the
12 # terms of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
16 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
17 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
18 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License along with
21 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
22 # Suite 330, Boston, MA 02111-1307 USA
32 my $user=$input->remote_user;
33 my $biblionumber = $input->param('biblio');
34 my $ordnum=$input->param('ordnum');
35 my $quantrec=$input->param('quantityrec');
36 my $quantity=$input->param('quantity');
37 my $notes=$input->param('notes');
38 my $cost=$input->param('cost');
39 my $invoiceno=$input->param('invoice');
40 my $bibitemno=$input->param('biblioitemnum');
41 my $data=bibitemdata($bibitemno);
42 my $publisher=$data->{'publishercode'};
43 my $pubdate=$data->{'publicationdate'};
44 my $class=$data->{'classification'};
45 my $dewey=$data->{'dewey'};
46 my $subclass=$data->{'subclass'};
48 my $size=$data->{'size'};
49 my $illus=$data->{'illus'};
50 my $pages=$data->{'pages'};
51 my $replacement=$input->param('rrp');
52 my $branch=$input->param('branch');
53 my $bookfund=$input->param('bookfund');
54 my $itemtype=$input->param('format');
55 my $isbn=$input->param('ISBN');
56 my $bookseller = $input->param('bookseller');
59 biblionumber => $biblionumber,
60 title => $input->param('title')?$input->param('title'):"",
61 author => $input->param('author')?$input->param('author'):"",
62 copyrightdate => $input->param('copyright')?$input->param('copyright'):"",
63 series => $input->param('Series')?$input->param('Series'):""
70 my $gst=$input->param('gst');
71 my $freight=$input->param('freight');
72 my $volinf=$input->param('volinf');
74 if ($itemtype =~ /REF/){
78 if ($itemtype =~ /PER/){
80 $bibitemno = &newbiblioitem({
81 biblionumber => $biblionumber,
82 itemtype => $itemtype?$itemtype:"",
83 isbn => $isbn?$isbn:"",
84 volumeddesc => $volinf?$volinf:"",
85 classification => $class?$class:"" });
87 warn "qty : $quantity";
89 receiveorder($biblionumber,$ordnum,$quantrec,$user,$cost,$invoiceno,$bibitemno,$freight,$bookfund);
92 biblioitemnumber => $bibitemno,
93 biblionumber => $biblionumber,
94 itemtype => $itemtype?$itemtype:"",
95 isbn => $isbn?$isbn:"",
96 publisher => $publisher?$publisher:"",
97 publicationyear => $pubdate?$pubdate:"",
98 class => $class?$class:"",
99 dewey => $dewey?$dewey:"",
100 subclass => $subclass?$subclass:"",
101 illus => $illus?$illus:"",
102 pages => $pages?$pages:"",
103 volumeddesc => $volinf?$volinf:"",
104 notes => $notes?$notes:"",
105 size => $size?$size:"" });
106 my $barcode=$input->param('barcode');
108 if ($barcode =~ /\,/){
109 @barcodes=split(/\,/,$barcode);
110 }elsif ($barcode =~ /\|/){
111 @barcodes=split(/\|/,$barcode);
113 $barcodes[0]=$barcode;
115 my ($error) = newitems({ biblioitemnumber => $bibitemno,
116 biblionumber => $biblionumber,
117 replacementprice => $replacement,
119 booksellerid => $bookseller,
120 homebranch => $branch,
124 if ($itemtype ne 'PER'){
125 print $input->redirect("/cgi-bin/koha/acqui/receive.pl?invoice=$invoiceno&id=$id&freight=$freight&gst=$gst");
127 print $input->redirect("/acquisitions/");
130 print $input->header;
134 print $input->header;
135 delorder($biblionumber,$ordnum);
136 print $input->redirect("/acquisitions/");