Lines 173-179
if ( $ordernumber eq '' and defined $params->{'breedingid'}){
Link Here
|
173 |
} |
173 |
} |
174 |
|
174 |
|
175 |
|
175 |
|
176 |
my $cur = GetCurrency(); |
|
|
177 |
|
176 |
|
178 |
if ( $ordernumber eq '' ) { # create order |
177 |
if ( $ordernumber eq '' ) { # create order |
179 |
$new = 'yes'; |
178 |
$new = 'yes'; |
Lines 201-218
else { #modify order
Link Here
|
201 |
} |
200 |
} |
202 |
|
201 |
|
203 |
# get currencies (for change rates calcs if needed) |
202 |
# get currencies (for change rates calcs if needed) |
|
|
203 |
my $active_currency = GetCurrency(); |
204 |
my $default_currency; |
205 |
if (! $data->{currency} ) { # New order no currency set |
206 |
if ( $bookseller->{listprice} ) { |
207 |
$default_currency = $bookseller->{listprice}; |
208 |
} |
209 |
else { |
210 |
$default_currency = $active_currency->{currency}; |
211 |
} |
212 |
} |
213 |
|
204 |
my @rates = GetCurrencies(); |
214 |
my @rates = GetCurrencies(); |
205 |
my $count = scalar @rates; |
|
|
206 |
|
215 |
|
207 |
# ## @rates |
216 |
# ## @rates |
208 |
|
217 |
|
209 |
my @loop_currency = (); |
218 |
my @loop_currency = (); |
210 |
for ( my $i = 0 ; $i < $count ; $i++ ) { |
219 |
for my $curr ( @rates ) { |
211 |
my %line; |
220 |
my $selected; |
212 |
$line{currcode} = $rates[$i]->{'currency'}; |
221 |
if ($data->{currency} ) { |
213 |
$line{rate} = $rates[$i]->{'rate'}; |
222 |
$selected = $curr->{currency} eq $data->{currency}; |
214 |
$line{selected} = 1 if ($line{currcode} eq $data->{currency}); |
223 |
} |
215 |
push @loop_currency, \%line; |
224 |
else { |
|
|
225 |
$selected = $curr->{currency} eq $default_currency; |
226 |
} |
227 |
push @loop_currency, { |
228 |
currcode => $curr->{currency}, |
229 |
rate => $curr->{rate}, |
230 |
selected => $selected, |
231 |
} |
216 |
} |
232 |
} |
217 |
|
233 |
|
218 |
# build branches list |
234 |
# build branches list |
Lines 341-349
$template->param(
Link Here
|
341 |
listincgst => $bookseller->{'listincgst'}, |
357 |
listincgst => $bookseller->{'listincgst'}, |
342 |
invoiceincgst => $bookseller->{'invoiceincgst'}, |
358 |
invoiceincgst => $bookseller->{'invoiceincgst'}, |
343 |
name => $bookseller->{'name'}, |
359 |
name => $bookseller->{'name'}, |
344 |
cur_active_sym => $cur->{'symbol'}, |
360 |
cur_active_sym => $active_currency->{'symbol'}, |
345 |
cur_active => $cur->{'currency'}, |
361 |
cur_active => $active_currency->{'currency'}, |
346 |
# currency => $bookseller->{'listprice'} || $cur->{'currency'}, # eg: 'EUR' |
|
|
347 |
loop_currencies => \@loop_currency, |
362 |
loop_currencies => \@loop_currency, |
348 |
orderexists => ( $new eq 'yes' ) ? 0 : 1, |
363 |
orderexists => ( $new eq 'yes' ) ? 0 : 1, |
349 |
title => $data->{'title'}, |
364 |
title => $data->{'title'}, |
350 |
- |
|
|