X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=acqui%2Fneworderempty.pl;h=ac4a934c4ebe9aa62bbdcff1453f9743dd668813;hb=12c60fac6aa2d80bcaf4db23715191951432bfee;hp=103f98dc85b84ab2b765f381b7e8e249e3815141;hpb=f2feb685091151b1ea394d845f494fa4acee2c25;p=koha.git diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index 103f98dc85..ac4a934c4e 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -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'; @@ -146,7 +145,7 @@ for ( my $i = 0 ; $i < $count ; $i++ ) { my $itemtypes = GetItemTypes; my @itemtypesloop; -foreach my $thisitemtype (sort keys %$itemtypes) { +foreach my $thisitemtype (sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'}} keys %$itemtypes) { push @itemtypesloop, { itemtype => $itemtypes->{$thisitemtype}->{'itemtype'} , desc => $itemtypes->{$thisitemtype}->{'description'} } ; } @@ -157,7 +156,7 @@ my $onlymine=C4::Context->preference('IndependantBranches') && C4::Context->userenv->{branch}; my $branches = GetBranches($onlymine); my @branchloop; -foreach my $thisbranch ( sort keys %$branches ) { +foreach my $thisbranch ( sort {$branches->{$a}->{'branchname'} cmp $branches->{$b}->{'branchname'}} keys %$branches ) { my %row = ( value => $thisbranch, branchname => $branches->{$thisbranch}->{'branchname'}, @@ -186,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 ); @@ -263,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'},