this file has been changed by parcel.pl
[koha.git] / acqui / updatesupplier.pl
1 #!/usr/bin/perl
2
3 #script to show suppliers and orders
4 #written by chris@katipo.co.nz 23/2/2000
5
6
7 # Copyright 2000-2002 Katipo Communications
8 #
9 # This file is part of Koha.
10 #
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
14 # version.
15 #
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.
19 #
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
23
24 use C4::Acquisition;
25 use C4::Biblio;
26 use C4::Output;
27 use CGI;
28 use strict;
29
30 my $input=new CGI;
31 #print $input->header();
32 my $supplier=$input->param('supplier');
33 #print startpage;
34 my %data;
35 $data{'id'}=$input->param('id');
36
37 $data{'name'}=$input->param('company');
38 $data{'postal'}=$input->param('company_postal');
39 my $address=$input->param('physical');
40 my @addresses=split('\n',$address);
41 $data{'address1'}=$addresses[0];
42 $data{'address2'}=$addresses[1];
43 $data{'address3'}=$addresses[2];
44 $data{'address4'}=$addresses[3];
45 $data{'phone'}=$input->param('company_phone');
46 $data{'fax'}=$input->param('company_fax');
47 $data{'url'}=$input->param('website');
48 $data{'contact'}=$input->param('company_contact_name');
49 $data{'contpos'}=$input->param('company_contact_position');
50 $data{'contphone'}=$input->param('contact_phone');
51 $data{'contaltphone'}=$input->param('contact_phone_2');
52 $data{'contfax'}=$input->param('contact_fax');
53 $data{'contemail'}=$input->param('company_email');
54 $data{'contnotes'}=$input->param('contact_notes');
55 warn "".$data{'contnotes'};
56 $data{'notes'}=$input->param('notes');
57 $data{'active'}=$input->param('status');
58 $data{'specialty'}=$input->param('publishers_imprints');
59 $data{'listprice'}=$input->param('list_currency');
60 $data{'invoiceprice'}=$input->param('invoice_currency');
61 $data{'gstreg'}=$input->param('gst');
62 $data{'listincgst'}=$input->param('list_gst');
63 $data{'invoiceincgst'}=$input->param('invoice_gst');
64 $data{'discount'}=$input->param('discount');
65 my $id=$input->param('id');
66 if ($data{'id'} != 0){
67   updatesup(\%data);
68 } else {
69   $id=insertsup(\%data);
70 }
71 #print startmenu('acquisitions');
72 #my ($count,@suppliers)=bookseller($supplier);
73
74 #print $input->dump;
75
76
77 #print endmenu('acquisitions');
78
79 #print endpage;
80
81 print $input->redirect("order.pl?supplier=$id");