5 #script to show display basket of orders
6 #written by chris@katipo.co.nz 24/2/2000
8 # Copyright 2000-2002 Katipo Communications
10 # This file is part of Koha.
12 # Koha is free software; you can redistribute it and/or modify it under the
13 # terms of the GNU General Public License as published by the Free Software
14 # Foundation; either version 2 of the License, or (at your option) any later
17 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
18 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
19 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License along with
22 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
23 # Suite 330, Boston, MA 02111-1307 USA
30 this script shows the details for a bookseller given on input arg.
31 It allows to edit & save information about this bookseller.
38 To know the bookseller this script has to display details.
56 my $id=$query->param('supplierid');
57 my @booksellers = GetBookSeller($id) if $id;
58 my $count = scalar @booksellers;
59 my $op=$query->param('op') || "display";
61 my ($template, $loggedinuser, $cookie)
62 = get_template_and_user({template_name => "acqui/supplier.tmpl",
66 flagsrequired => {acquisition => 1},
70 #build array for currencies
71 if ($op eq "display"){
72 $template->param(id => $id,
73 name => $booksellers[0]->{'name'},
74 postal =>$booksellers[0]->{'postal'},
75 address1 => $booksellers[0]->{'address1'},
76 address2 => $booksellers[0]->{'address2'},
77 address3 => $booksellers[0]->{'address3'},
78 address4 => $booksellers[0]->{'address4'},
79 phone =>$booksellers[0]->{'phone'},
80 fax => $booksellers[0]->{'fax'},
81 url => $booksellers[0]->{'url'},
82 contact => $booksellers[0]->{'contact'},
83 contpos => $booksellers[0]->{'contpos'},
84 contphone => $booksellers[0]->{'contphone'},
85 contaltphone => $booksellers[0]->{'contaltphone'},
86 contfax => $booksellers[0]->{'contfax'},
87 contemail => $booksellers[0]->{'contemail'},
88 contnotes => $booksellers[0]->{'contnotes'},
89 notes => $booksellers[0]->{'notes'},
90 active => $booksellers[0]->{'active'},
91 specialty => $booksellers[0]->{'specialty'},
92 gstreg => $booksellers[0]->{'gstreg'},
93 listincgst => $booksellers[0]->{'listincgst'},
94 invoiceincgst => $booksellers[0]->{'invoiceincgst'},
95 discount => $booksellers[0]->{'discount'},
96 invoiceprice=>$booksellers[0]->{'invoiceprice'},
97 listprice=>$booksellers[0]->{'listprice'},
98 GST => C4::Context->preference("gist"),
99 basketcount =>$booksellers[0]->{'basketcount'},
101 } elsif ($op eq 'delete') {
103 print $query->redirect("/cgi-bin/koha/acqui/acqui-home.pl");
106 my @currencies = GetCurrencies();
107 my $count = scalar @currencies;
109 my @loop_pricescurrency;
110 my @loop_invoicecurrency;
111 for (my $i=0;$i<$count;$i++) {
112 if ($booksellers[0]->{'listprice'} eq $currencies[$i]->{'currency'}) {
113 push @loop_pricescurrency, { currency => "<option selected=\"selected\" value=\"$currencies[$i]->{'currency'}\">$currencies[$i]->{'currency'}</option>" };
115 push @loop_pricescurrency, { currency => "<option value=\"$currencies[$i]->{'currency'}\">$currencies[$i]->{'currency'}</option>"};
117 if ($booksellers[0]->{'invoiceprice'} eq $currencies[$i]->{'currency'}) {
118 push @loop_invoicecurrency, { currency => "<option selected=\"selected\" value=\"$currencies[$i]->{'currency'}\">$currencies[$i]->{'currency'}</option>"};
120 push @loop_invoicecurrency, { currency => "<option value=\"$currencies[$i]->{'currency'}\">$currencies[$i]->{'currency'}</option>"};
123 $template->param(id => $id,
124 name => $booksellers[0]->{'name'},
125 postal =>$booksellers[0]->{'postal'},
126 address1 => $booksellers[0]->{'address1'},
127 address2 => $booksellers[0]->{'address2'},
128 address3 => $booksellers[0]->{'address3'},
129 address4 => $booksellers[0]->{'address4'},
130 phone =>$booksellers[0]->{'phone'},
131 fax => $booksellers[0]->{'fax'},
132 url => $booksellers[0]->{'url'},
133 contact => $booksellers[0]->{'contact'},
134 contpos => $booksellers[0]->{'contpos'},
135 contphone => $booksellers[0]->{'contphone'},
136 contaltphone => $booksellers[0]->{'contaltphone'},
137 contfax => $booksellers[0]->{'contfax'},
138 contemail => $booksellers[0]->{'contemail'},
139 contnotes => $booksellers[0]->{'contnotes'},
140 notes => $booksellers[0]->{'notes'},
141 active => $booksellers[0]->{'active'},
142 specialty => $booksellers[0]->{'specialty'},
143 gstreg => $booksellers[0]->{'gstreg'},
144 listincgst => $booksellers[0]->{'listincgst'},
145 invoiceincgst => $booksellers[0]->{'invoiceincgst'},
146 discount => $booksellers[0]->{'discount'},
147 loop_pricescurrency => \@loop_pricescurrency,
148 loop_invoicecurrency => \@loop_invoicecurrency,
149 GST => C4::Context->preference("gist"),
153 output_html_with_http_headers $query, $cookie, $template->output;