X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fio.pl;h=d799a0c1c382cb0195a179f90aef02a392fd7bb8;hb=fe73e0d261229f181e8133283b530509773d2151;hp=6ab92cff078798676983fd19aa209ce5fad4ee7d;hpb=a0a30f41301f5f52c26febd9366182be858e54bb;p=kivitendo-erp.git diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 6ab92cff0..d799a0c1c 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -245,8 +245,7 @@ sub display_row { $column_data{"unit"} = AM->unit_select_html($all_units, "unit_$i", $this_unit, $form->{"id_$i"} ? $form->{"unit_$i"} : undef); # / unit ending - $form->{"sellprice_$i"} =~ /\.(\d+)/; - my $decimalplaces = max 2, length $1; + my $decimalplaces = ($form->{"sellprice_$i"} =~ /\.(\d+)/) ? max 2, length $1 : 2; my $price_factor = $price_factors{$form->{"price_factor_id_$i"}} || 1; my $discount = $form->round_amount($form->{"qty_$i"} * $form->{"sellprice_$i"} * $form->{"discount_$i"} / 100 / $price_factor, 2); @@ -260,8 +259,7 @@ sub display_row { : $cgi->textfield(-name => "description_$i", -size => 30, -value => $form->{"description_$i"})) . $cgi->button(-value => $locale->text('L'), -onClick => "set_longdescription_window('longdescription_$i')"); - $form->{"qty_$i"} =~ /\.(\d+)/; - my $qty_dec = length $1; + my $qty_dec = ($form->{"qty_$i"} =~ /\.(\d+)/) ? length $1 : 2; $column_data{qty} = $cgi->textfield(-name => "qty_$i", -size => 5, -value => $form->format_amount(\%myconfig, $form->{"qty_$i"}, $qty_dec)); $column_data{qty} .= $cgi->button(-onclick => "calculate_qty_selection_window('qty_$i','alu_$i', 'formel_$i', $i)", -value => $locale->text('*/')) @@ -1210,7 +1208,7 @@ sub print_options { ); my %template_vars = ( - display_copies => scalar @{ $form->{printers} } && $main::latex_templates && $form->{media} ne 'email', + display_copies => scalar @{ $form->{printers} || [] } && $main::latex_templates && $form->{media} ne 'email', display_remove_draft => (!$form->{id} && $form->{draft_id}), display_groupitems => !$dont_display_groupitems{$form->{type}}, groupitems_checked => $form->{groupitems} ? "checked" : '',