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
33 my $user=$input->remote_user;
34 my $biblionumber = $input->param('biblionumber');
35 my $biblioitemnumber=$input->param('biblioitemnumber');
36 my $ordnum=$input->param('ordnum');
37 my $origquantityrec=$input->param('origquantityrec');
38 my $quantityrec=$input->param('quantityrec');
39 my $quantity=$input->param('quantity');
40 my $cost=$input->param('cost');
41 my $invoiceno=$input->param('invoice');
42 my $datereceived=$input->param('datereceived');
43 my $replacement=$input->param('rrp');
44 my $gst=$input->param('gst');
45 my $freight=$input->param('freight');
46 my $supplierid = $input->param('supplierid');
47 my @branch=$input->param('homebranch');
48 my @barcode=$input->param('barcode');
49 my @ccode=$input->param('ccode');
50 my @itemtype=$input->param('itemtype');
51 my @location=$input->param('location');
53 # if ($quantityrec != 0){
54 # $cost /= $quantityrec;
57 if ($quantityrec > $origquantityrec ) {
58 # save the quantity recieved.
59 $datereceived = ModReceiveOrder($biblionumber,$ordnum,$quantityrec,$user,$cost,$invoiceno,$datereceived,$freight,$replacement);
60 # create items if the user has entered barcodes
61 # my @barcodes=split(/\,| |\|/,$barcode);
62 # foreach barcode provided, build the item MARC::Record and create the item
63 foreach my $bc (@barcode) {
64 my $itemRecord = TransformKohaToMarc({
65 "items.replacementprice" => $replacement,
66 "items.price" => $cost,
67 "items.booksellerid" => $supplierid,
68 "items.homebranch" => $branch[$cnt],
69 "items.holdingbranch" => $branch[$cnt],
70 "items.barcode" => $barcode[$cnt],
71 "items.ccode" => $ccode[$cnt],
72 "items.itype" => $itemtype[$cnt],
73 "items.location" => $location[$cnt],
74 "items.loan" => 0, });
75 AddItem($itemRecord,$biblionumber);
78 print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoice=$invoiceno&supplierid=$supplierid&freight=$freight&gst=$gst&datereceived=$datereceived");
80 # print $input->header;
81 # #delorder($biblionumber,$ordnum);
82 # print $input->redirect("/acquisitions/");