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
31 #print $input->header;
33 my $user=$input->remote_user;
35 my $biblionumber = $input->param('biblio');
36 my $ordnum=$input->param('ordnum');
37 my $quantrec=$input->param('quantityrec');
38 my $quantity=$input->param('quantity');
39 my $notes=$input->param('notes');
40 my $cost=$input->param('cost');
41 my $invoiceno=$input->param('invoice');
42 my $bibitemno=$input->param('biblioitemnum');
43 my $data=bibitemdata
($bibitemno);
44 my $publisher=$data->{'publishercode'};
45 my $pubdate=$data->{'publicationdate'};
46 my $class=$data->{'classification'};
47 my $dewey=$data->{'dewey'};
48 my $subclass=$data->{'subclass'};
50 my $size=$data->{'size'};
51 my $illus=$data->{'illus'};
52 my $pages=$data->{'pages'};
53 my $replacement=$input->param('rrp');
54 my $branch=$input->param('branch');
55 my $bookfund=$input->param('bookfund');
56 my $itemtype=$input->param('format');
57 my $isbn=$input->param('ISBN');
58 my $bookseller = $input->param('bookseller');
61 biblionumber
=> $biblionumber,
62 title
=> $input->param('title')?
$input->param('title'):"",
63 author
=> $input->param('author')?
$input->param('author'):"",
64 copyrightdate
=> $input->param('copyright')?
$input->param('copyright'):"",
65 series
=> $input->param('Series')?
$input->param('Series'):""
72 my $gst=$input->param('gst');
73 my $freight=$input->param('freight');
74 my $volinf=$input->param('volinf');
76 if ($itemtype =~ /REF/){
80 if ($itemtype =~ /PER/){
83 $bibitemno = &newbiblioitem
({
84 biblionumber
=> $biblionumber,
85 itemtype
=> $itemtype?
$itemtype:"",
86 isbn
=> $isbn?
$isbn:"",
87 volumeddesc
=> $volinf?
$volinf:"",
88 classification
=> $class?
$class:"" });
89 # print "here $bibitemno";
92 receiveorder
($biblionumber,$ordnum,$quantrec,$user,$cost,$invoiceno,$bibitemno,$freight,$bookfund);
95 biblioitemnumber
=> $bibitemno,
96 biblionumber
=> $biblionumber,
97 itemtype
=> $itemtype?
$itemtype:"",
98 isbn
=> $isbn?
$isbn:"",
99 publisher
=> $publisher?
$publisher:"",
100 publicationyear
=> $pubdate?
$pubdate:"",
101 class => $class?
$class:"",
102 dewey
=> $dewey?
$dewey:"",
103 subclass
=> $subclass?
$subclass:"",
104 illus
=> $illus?
$illus:"",
105 pages
=> $pages?
$pages:"",
106 volumeddesc
=> $volinf?
$volinf:"",
107 notes
=> $notes?
$notes:"",
108 size
=> $size?
$size:"" });
110 my $barcode=$input->param('barcode');
112 if ($barcode =~ /\,/){
113 @barcodes=split(/\,/,$barcode);
114 }elsif ($barcode =~ /\|/){
115 @barcodes=split(/\|/,$barcode);
117 $barcodes[0]=$barcode;
118 # print $input->header;
122 # print STDERR "************ biblionumber => $biblionumber\n";
123 my ($error) = newitems
({ biblioitemnumber
=> $bibitemno,
124 biblionumber
=> $biblionumber,
125 replacementprice
=> $replacement,
127 booksellerid
=> $bookseller,
128 homebranch
=> $branch,
132 if ($itemtype ne 'PER'){
133 print $input->redirect("/cgi-bin/koha/acqui/receive.pl?invoice=$invoiceno&id=$id&freight=$freight&gst=$gst");
135 print $input->redirect("/acquisitions/");
138 print $input->header;
142 print $input->header;
143 delorder
($biblionumber,$ordnum);
144 print $input->redirect("/acquisitions/");