bug 3161: don't display blank language chooser
[koha.git] / acqui / neworderempty.pl
index c9cfc07..df23586 100755 (executable)
@@ -94,7 +94,6 @@ my $suggestionid = $input->param('suggestionid');
 my $close        = $input->param('close');
 my $data;
 my $new;
-my $dbh = C4::Context->dbh;
 
 if ( $ordnum eq '' ) {    # create order
     $new = 'yes';
@@ -162,6 +161,7 @@ foreach my $thisbranch ( sort keys %$branches ) {
         value      => $thisbranch,
         branchname => $branches->{$thisbranch}->{'branchname'},
     );
+       $row{'selected'} = 1 if( $thisbranch eq $data->{branchcode}) ;
     push @branchloop, \%row;
 }
 $template->param( branchloop => \@branchloop , itypeloop => \@itemtypesloop );
@@ -185,10 +185,9 @@ my $CGIbookfund = CGI::scrolling_list(
     -name     => 'bookfund',
        -id       => 'bookfund',
     -values   => \@select_bookfund,
-    -default  => $data->{'bookfundid'},
+    -default  => ($data->{'bookfundid'} ? $data->{'bookfundid'} : $select_bookfund[0]),
     -labels   => \%select_bookfunds,
        #-size     => 1,
-       -tabindex =>'',
     -multiple => 0
 );
 
@@ -262,7 +261,7 @@ $template->param(
     nocalc           => $bookseller->{'nocalc'},
     name             => $bookseller->{'name'},
     currency         => $bookseller->{'listprice'},
-    gstrate          => C4::Context->preference("gist"),
+    gstrate          => C4::Context->preference("gist") || 0,
     loop_currencies  => \@loop_currency,
     orderexists      => ( $new eq 'yes' ) ? 0 : 1,
     title            => $data->{'title'},