]> git.koha-community.org Git - koha.git/blob - acqui/updatesupplier.pl
HTL mod for till reconciliation.
[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('notes');
55 $data{'active'}=$input->param('status');
56 $data{'specialty'}=$input->param('publishers_imprints');
57 $data{'listprice'}=$input->param('list_currency');
58 $data{'invoiceprice'}=$input->param('invoice_currency');
59 $data{'gstreg'}=$input->param('gst');
60 $data{'listincgst'}=$input->param('list_gst');
61 $data{'invoiceincgst'}=$input->param('invoice_gst');
62 $data{'discount'}=$input->param('discount');
63 my $id=$input->param('id');
64 if ($data{'id'} != 0){
65   updatesup(\%data);
66 } else {
67   $id=insertsup(\%data);
68 }
69 #print startmenu('acquisitions');
70 #my ($count,@suppliers)=bookseller($supplier);
71
72 #print $input->dump;
73
74
75 #print endmenu('acquisitions');
76
77 #print endpage;
78
79 print $input->redirect("order.pl?supplier=$id");