Long is the road to MARC..
[wip/koha-chris_n.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 use C4::Catalogue;
7 use C4::Biblio;
8 use C4::Output;
9 use CGI;
10 use strict;
11
12 my $input=new CGI;
13 #print $input->header();
14 my $supplier=$input->param('supplier');
15 #print startpage;
16 my %data;
17 $data{'id'}=$input->param('id');
18
19 $data{'name'}=$input->param('company');
20 $data{'name'}=~ s/\'/\\\'/g;
21 $data{'postal'}=$input->param('company_postal');
22 my $address=$input->param('physical');
23 my @addresses=split('\n',$address);
24 $data{'address1'}=$addresses[0];
25 $data{'address2'}=$addresses[1];
26 $data{'address3'}=$addresses[2];
27 $data{'address4'}=$addresses[3];
28 $data{'phone'}=$input->param('company_phone');
29 $data{'fax'}=$input->param('company_fax');
30 $data{'url'}=$input->param('website');
31 $data{'contact'}=$input->param('company_contact_name');
32 $data{'contpos'}=$input->param('company_contact_position');
33 $data{'contphone'}=$input->param('contact_phone');
34 $data{'contaltphone'}=$input->param('contact_phone_2');
35 $data{'contfax'}=$input->param('contact_fax');
36 $data{'contemail'}=$input->param('company_email');
37 $data{'contnotes'}=$input->param('notes');
38 $data{'active'}=$input->param('status');
39 $data{'specialty'}=$input->param('publishers_imprints');
40 $data{'listprice'}=$input->param('list_currency');
41 $data{'invoiceprice'}=$input->param('invoice_currency');
42 $data{'gstreg'}=$input->param('gst');
43 $data{'listincgst'}=$input->param('list_gst');
44 $data{'invoiceincgst'}=$input->param('invoice_gst');
45 $data{'discount'}=$input->param('discount');
46 my $id=$input->param('id');
47 if ($data{'id'} != 0){
48   updatesup(\%data);
49 } else {
50   $id=insertsup(\%data);
51 }
52 #print startmenu('acquisitions');
53 #my ($count,@suppliers)=bookseller($supplier);
54
55 #print $input->dump;
56
57
58 #print endmenu('acquisitions');
59
60 #print endpage;
61
62 print $input->redirect("order.pl?supplier=$id");