4 #script to show display basket of orders
6 # Copyright 2000-2002 Katipo Communications
7 # Copyright 2008-2009 BibLibre SARL
9 # This file is part of Koha.
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
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.
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
29 this script shows the details for a bookseller given on input arg.
30 It allows to edit & save information about this bookseller.
37 To know the bookseller this script has to display details.
54 my $id = $query->param('supplierid');
55 my @booksellers = GetBookSellerFromId($id) if $id;
56 my $count = scalar @booksellers;
57 my $op = $query->param('op') || "display";
58 my ($template, $loggedinuser, $cookie) = get_template_and_user(
59 { template_name => "acqui/supplier.tmpl",
63 flagsrequired => { acquisition => 'vendors_manage' },
67 my $GST = $booksellers[0]->{'gstrate'} || C4::Context->preference("gist");
69 #build array for currencies
70 if ($op eq "display") {
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 gstrate => $booksellers[0]->{'gstrate'},
96 discount => $booksellers[0]->{'discount'},
97 invoiceprice => $booksellers[0]->{'invoiceprice'},
98 listprice => $booksellers[0]->{'listprice'},
100 basketcount => $booksellers[0]->{'basketcount'},
103 elsif ($op eq 'delete') {
105 print $query->redirect("/cgi-bin/koha/acqui/acqui-home.pl");
108 my @currencies = GetCurrencies();
109 my $count = scalar @currencies;
111 my @loop_pricescurrency;
112 my @loop_invoicecurrency;
113 for (my $i=0;$i<$count;$i++) {
114 if ($booksellers[0]->{'listprice'} eq $currencies[$i]->{'currency'}) {
115 push @loop_pricescurrency, { currency => "<option selected=\"selected\" value=\"$currencies[$i]->{'currency'}\">$currencies[$i]->{'currency'}</option>" };
117 push @loop_pricescurrency, { currency => "<option value=\"$currencies[$i]->{'currency'}\">$currencies[$i]->{'currency'}</option>"};
119 if ($booksellers[0]->{'invoiceprice'} eq $currencies[$i]->{'currency'}) {
120 push @loop_invoicecurrency, { currency => "<option selected=\"selected\" value=\"$currencies[$i]->{'currency'}\">$currencies[$i]->{'currency'}</option>"};
122 push @loop_invoicecurrency, { currency => "<option value=\"$currencies[$i]->{'currency'}\">$currencies[$i]->{'currency'}</option>"};
125 my $GST = $booksellers[0]->{'gstrate'} || C4::Context->preference("gist");
129 name => $booksellers[0]->{'name'},
130 postal => $booksellers[0]->{'postal'},
131 address1 => $booksellers[0]->{'address1'},
132 address2 => $booksellers[0]->{'address2'},
133 address3 => $booksellers[0]->{'address3'},
134 address4 => $booksellers[0]->{'address4'},
135 phone => $booksellers[0]->{'phone'},
136 fax => $booksellers[0]->{'fax'},
137 url => $booksellers[0]->{'url'},
138 contact => $booksellers[0]->{'contact'},
139 contpos => $booksellers[0]->{'contpos'},
140 contphone => $booksellers[0]->{'contphone'},
141 contaltphone => $booksellers[0]->{'contaltphone'},
142 contfax => $booksellers[0]->{'contfax'},
143 contemail => $booksellers[0]->{'contemail'},
144 contnotes => $booksellers[0]->{'contnotes'},
145 notes => $booksellers[0]->{'notes'},
146 active => $booksellers[0]->{'active'},
147 specialty => $booksellers[0]->{'specialty'},
148 gstreg => $booksellers[0]->{'gstreg'},
149 listincgst => $booksellers[0]->{'listincgst'},
150 invoiceincgst => $booksellers[0]->{'invoiceincgst'},
151 gstrate => $booksellers[0]->{'gstrate'},
152 discount => $booksellers[0]->{'discount'},
153 loop_pricescurrency => \@loop_pricescurrency,
154 loop_invoicecurrency => \@loop_invoicecurrency,
159 output_html_with_http_headers $query, $cookie, $template->output;