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"),
101 my @currencies = GetCurrencies();
102 my $count = scalar @currencies;
104 my @loop_pricescurrency;
105 my @loop_invoicecurrency;
106 for (my $i=0;$i<$count;$i++) {
107 if ($booksellers[0]->{'listprice'} eq $currencies[$i]->{'currency'}) {
108 push @loop_pricescurrency, { currency => "<option selected=\"selected\" value=\"$currencies[$i]->{'currency'}\">$currencies[$i]->{'currency'}</option>" };
110 push @loop_pricescurrency, { currency => "<option value=\"$currencies[$i]->{'currency'}\">$currencies[$i]->{'currency'}</option>"};
112 if ($booksellers[0]->{'invoiceprice'} eq $currencies[$i]->{'currency'}) {
113 push @loop_invoicecurrency, { currency => "<option selected=\"selected\" value=\"$currencies[$i]->{'currency'}\">$currencies[$i]->{'currency'}</option>"};
115 push @loop_invoicecurrency, { currency => "<option value=\"$currencies[$i]->{'currency'}\">$currencies[$i]->{'currency'}</option>"};
118 $template->param(id => $id,
119 name => $booksellers[0]->{'name'},
120 postal =>$booksellers[0]->{'postal'},
121 address1 => $booksellers[0]->{'address1'},
122 address2 => $booksellers[0]->{'address2'},
123 address3 => $booksellers[0]->{'address3'},
124 address4 => $booksellers[0]->{'address4'},
125 phone =>$booksellers[0]->{'phone'},
126 fax => $booksellers[0]->{'fax'},
127 url => $booksellers[0]->{'url'},
128 contact => $booksellers[0]->{'contact'},
129 contpos => $booksellers[0]->{'contpos'},
130 contphone => $booksellers[0]->{'contphone'},
131 contaltphone => $booksellers[0]->{'contaltphone'},
132 contfax => $booksellers[0]->{'contfax'},
133 contemail => $booksellers[0]->{'contemail'},
134 contnotes => $booksellers[0]->{'contnotes'},
135 notes => $booksellers[0]->{'notes'},
136 active => $booksellers[0]->{'active'},
137 specialty => $booksellers[0]->{'specialty'},
138 gstreg => $booksellers[0]->{'gstreg'},
139 listincgst => $booksellers[0]->{'listincgst'},
140 invoiceincgst => $booksellers[0]->{'invoiceincgst'},
141 discount => $booksellers[0]->{'discount'},
142 loop_pricescurrency => \@loop_pricescurrency,
143 loop_invoicecurrency => \@loop_invoicecurrency,
144 GST => C4::Context->preference("gist"),
148 output_html_with_http_headers $query, $cookie, $template->output;