|
Lines 167-173
if ( $ordernumber eq '' and defined $params->{'breedingid'}){
Link Here
|
| 167 |
} |
167 |
} |
| 168 |
|
168 |
|
| 169 |
|
169 |
|
| 170 |
my $cur = GetCurrency(); |
|
|
| 171 |
|
170 |
|
| 172 |
if ( $ordernumber eq '' ) { # create order |
171 |
if ( $ordernumber eq '' ) { # create order |
| 173 |
$new = 'yes'; |
172 |
$new = 'yes'; |
|
Lines 195-212
else { #modify order
Link Here
|
| 195 |
} |
194 |
} |
| 196 |
|
195 |
|
| 197 |
# get currencies (for change rates calcs if needed) |
196 |
# get currencies (for change rates calcs if needed) |
|
|
197 |
my $active_currency = GetCurrency(); |
| 198 |
my $default_currency; |
| 199 |
if (! $data->{currency} ) { # New order no currency set |
| 200 |
if ( $bookseller->{listprice} ) { |
| 201 |
$default_currency = $bookseller->{listprice}; |
| 202 |
} |
| 203 |
else { |
| 204 |
$default_currency = $active_currency->{currency}; |
| 205 |
} |
| 206 |
} |
| 207 |
|
| 198 |
my @rates = GetCurrencies(); |
208 |
my @rates = GetCurrencies(); |
| 199 |
my $count = scalar @rates; |
|
|
| 200 |
|
209 |
|
| 201 |
# ## @rates |
210 |
# ## @rates |
| 202 |
|
211 |
|
| 203 |
my @loop_currency = (); |
212 |
my @loop_currency = (); |
| 204 |
for ( my $i = 0 ; $i < $count ; $i++ ) { |
213 |
for my $curr ( @rates ) { |
| 205 |
my %line; |
214 |
my $selected; |
| 206 |
$line{currcode} = $rates[$i]->{'currency'}; |
215 |
if ($data->{currency} ) { |
| 207 |
$line{rate} = $rates[$i]->{'rate'}; |
216 |
$selected = $curr->{currency} eq $data->{currency}; |
| 208 |
$line{selected} = 1 if ($line{currcode} eq $data->{currency}); |
217 |
} |
| 209 |
push @loop_currency, \%line; |
218 |
else { |
|
|
219 |
$selected = $curr->{currency} eq $default_currency; |
| 220 |
} |
| 221 |
push @loop_currency, { |
| 222 |
currcode => $curr->{currency}, |
| 223 |
rate => $curr->{rate}, |
| 224 |
selected => $selected, |
| 225 |
} |
| 210 |
} |
226 |
} |
| 211 |
|
227 |
|
| 212 |
# build branches list |
228 |
# build branches list |
|
Lines 335-343
$template->param(
Link Here
|
| 335 |
listincgst => $bookseller->{'listincgst'}, |
351 |
listincgst => $bookseller->{'listincgst'}, |
| 336 |
invoiceincgst => $bookseller->{'invoiceincgst'}, |
352 |
invoiceincgst => $bookseller->{'invoiceincgst'}, |
| 337 |
name => $bookseller->{'name'}, |
353 |
name => $bookseller->{'name'}, |
| 338 |
cur_active_sym => $cur->{'symbol'}, |
354 |
cur_active_sym => $active_currency->{'symbol'}, |
| 339 |
cur_active => $cur->{'currency'}, |
355 |
cur_active => $active_currency->{'currency'}, |
| 340 |
# currency => $bookseller->{'listprice'} || $cur->{'currency'}, # eg: 'EUR' |
|
|
| 341 |
loop_currencies => \@loop_currency, |
356 |
loop_currencies => \@loop_currency, |
| 342 |
orderexists => ( $new eq 'yes' ) ? 0 : 1, |
357 |
orderexists => ( $new eq 'yes' ) ? 0 : 1, |
| 343 |
title => $data->{'title'}, |
358 |
title => $data->{'title'}, |
| 344 |
- |
|
|