Bug 7509: Added index on items itemcallnumber
[koha_gimpoz] / suggestion / suggestion.pl
index 18f71b0..272ca6f 100755 (executable)
@@ -307,13 +307,21 @@ $template->param( "statusselected_$$suggestion_ref{'STATUS'}" =>1);
 # get currencies and rates
 my @rates = GetCurrencies();
 my $count = scalar @rates;
+my $active_currency = GetCurrency();
+my $selected_currency;
+if ($$suggestion_ref{'currency'}) {
+    $selected_currency = $$suggestion_ref{'currency'};
+}
+else {
+    $selected_currency = $active_currency->{currency};
+}
 
 my @loop_currency = ();
 for ( my $i = 0 ; $i < $count ; $i++ ) {
     my %line;
     $line{currcode} = $rates[$i]->{'currency'};
     $line{rate}     = $rates[$i]->{'rate'};
-       $line{selected} = 1 if ($$suggestion_ref{'currency'} && $line{'currcode'} eq $$suggestion_ref{'currency'});
+       $line{selected} = 1 if ($line{'currcode'} eq $selected_currency);
     push @loop_currency, \%line;
 }