Lines 122-131
if ( $op eq 'add_form' ) {
Link Here
|
122 |
|
122 |
|
123 |
my $searchcategory = GetAuthorisedValues("ITEMTYPECAT", $data->{'searchcategory'}); |
123 |
my $searchcategory = GetAuthorisedValues("ITEMTYPECAT", $data->{'searchcategory'}); |
124 |
|
124 |
|
|
|
125 |
my @gst_values = map { |
126 |
option => $_ + 0.0 |
127 |
}, split( '\|', C4::Context->preference("gist") ); |
128 |
|
125 |
$template->param( |
129 |
$template->param( |
126 |
itemtype => $itemtype, |
130 |
itemtype => $itemtype, |
127 |
description => $data->{'description'}, |
131 |
description => $data->{'description'}, |
128 |
rentalcharge => sprintf( "%.2f", $data->{'rentalcharge'} ), |
132 |
rentalcharge => sprintf( "%.2f", $data->{'rentalcharge'} ), |
|
|
133 |
gstrate => $data->{gstrate} ? $data->{gstrate}+0.0 : undef, |
134 |
gst_values => \@gst_values, |
129 |
notforloan => $data->{'notforloan'}, |
135 |
notforloan => $data->{'notforloan'}, |
130 |
imageurl => $data->{'imageurl'}, |
136 |
imageurl => $data->{'imageurl'}, |
131 |
template => C4::Context->preference('template'), |
137 |
template => C4::Context->preference('template'), |
Lines 155-160
elsif ( $op eq 'add_validate' ) {
Link Here
|
155 |
UPDATE itemtypes |
161 |
UPDATE itemtypes |
156 |
SET description = ? |
162 |
SET description = ? |
157 |
, rentalcharge = ? |
163 |
, rentalcharge = ? |
|
|
164 |
, gstrate = ? |
158 |
, notforloan = ? |
165 |
, notforloan = ? |
159 |
, imageurl = ? |
166 |
, imageurl = ? |
160 |
, summary = ? |
167 |
, summary = ? |
Lines 169-174
elsif ( $op eq 'add_validate' ) {
Link Here
|
169 |
$sth->execute( |
176 |
$sth->execute( |
170 |
$input->param('description'), |
177 |
$input->param('description'), |
171 |
$input->param('rentalcharge'), |
178 |
$input->param('rentalcharge'), |
|
|
179 |
$input->param('gstrate'), |
172 |
( $input->param('notforloan') ? 1 : 0 ), |
180 |
( $input->param('notforloan') ? 1 : 0 ), |
173 |
( |
181 |
( |
174 |
$input->param('image') eq 'removeImage' ? '' : ( |
182 |
$input->param('image') eq 'removeImage' ? '' : ( |
Lines 189-204
elsif ( $op eq 'add_validate' ) {
Link Here
|
189 |
elsif ( not $already_exists and not $is_a_modif ) { |
197 |
elsif ( not $already_exists and not $is_a_modif ) { |
190 |
my $query = " |
198 |
my $query = " |
191 |
INSERT INTO itemtypes |
199 |
INSERT INTO itemtypes |
192 |
(itemtype,description,rentalcharge, notforloan, imageurl, summary, checkinmsg, checkinmsgtype, sip_media_type, hideinopac, searchcategory) |
200 |
(itemtype,description,rentalcharge, gstrate, notforloan, imageurl, summary, checkinmsg, checkinmsgtype, sip_media_type, hideinopac, searchcategory) |
193 |
VALUES |
201 |
VALUES |
194 |
(?,?,?,?,?,?,?,?,?,?,?); |
202 |
(?,?,?,?,?,?,?,?,?,?,?,?); |
195 |
"; |
203 |
"; |
196 |
my $sth = $dbh->prepare($query); |
204 |
my $sth = $dbh->prepare($query); |
197 |
my $image = $input->param('image'); |
205 |
my $image = $input->param('image'); |
198 |
$sth->execute( |
206 |
$sth->execute( |
199 |
$input->param('itemtype'), |
207 |
$input->param('itemtype'), |
200 |
$input->param('description'), |
208 |
$input->param('description'), |
201 |
$input->param('rentalcharge'), |
209 |
$input->param('rentalcharge'), |
|
|
210 |
$input->param('gstrate'), |
202 |
$input->param('notforloan') ? 1 : 0, |
211 |
$input->param('notforloan') ? 1 : 0, |
203 |
$image eq 'removeImage' ? '' : |
212 |
$image eq 'removeImage' ? '' : |
204 |
$image eq 'remoteImage' ? $input->param('remoteImage') : |
213 |
$image eq 'remoteImage' ? $input->param('remoteImage') : |