Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5e579516

Von Sven Schöling vor fast 15 Jahren hinzugefügt

display_row: Nachkommastellen korrekt berechnen.

Unterschiede anzeigen:

bin/mozilla/io.pl
245 245
    $column_data{"unit"} = AM->unit_select_html($all_units, "unit_$i", $this_unit, $form->{"id_$i"} ? $form->{"unit_$i"} : undef);
246 246
# / unit ending
247 247

  
248
    $form->{"sellprice_$i"} =~ /\.(\d+)/;
249
    my $decimalplaces = max 2, length $1;
248
    my $decimalplaces = ($form->{"sellprice_$i"} =~ /\.(\d+)/) ? max 2, length $1 : 2;
250 249

  
251 250
    my $price_factor   = $price_factors{$form->{"price_factor_id_$i"}} || 1;
252 251
    my $discount       = $form->round_amount($form->{"qty_$i"} * $form->{"sellprice_$i"} *        $form->{"discount_$i"}  / 100 / $price_factor, 2);
......
260 259
                                : $cgi->textfield(-name => "description_$i",   -size => 30, -value => $form->{"description_$i"}))
261 260
                                . $cgi->button(-value => $locale->text('L'), -onClick => "set_longdescription_window('longdescription_$i')");
262 261

  
263
    $form->{"qty_$i"} =~ /\.(\d+)/;
264
    my $qty_dec = length $1;
262
    my $qty_dec = ($form->{"qty_$i"} =~ /\.(\d+)/) ? length $1 : 2;
265 263

  
266 264
    $column_data{qty}  = $cgi->textfield(-name => "qty_$i", -size => 5, -value => $form->format_amount(\%myconfig, $form->{"qty_$i"}, $qty_dec));
267 265
    $column_data{qty} .= $cgi->button(-onclick => "calculate_qty_selection_window('qty_$i','alu_$i', 'formel_$i', $i)", -value => $locale->text('*/'))

Auch abrufbar als: Unified diff