X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/20bb56c1d57dde9492fef150edbfe0149a07ff08..e1cb00366d40cc3a1b07e065b51ad39c84baf7e6:/bin/mozilla/io.pl diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 69e536c54..f8d73005a 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -197,6 +197,7 @@ sub display_row { # rows for $i (1 .. $numrows) { + my %column_data = (); # undo formatting map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(qty discount sellprice price_new price_old) unless ($form->{simple_save}); @@ -261,7 +262,7 @@ sub display_row { if ($form->{"id_$i"}) { my $ship_qty = $form->{"ship_$i"} * 1; $ship_qty *= $all_units->{$form->{"partunit_$i"}}->{factor}; - $ship_qty /= $all_units->{$form->{"unit_$i"}}->{factor}; + $ship_qty /= ( $all_units->{$form->{"unit_$i"}}->{factor} || 1 ); $column_data{ship} = $form->format_amount(\%myconfig, $form->round_amount($ship_qty, 2) * 1) . ' ' . $form->{"unit_$i"}; } @@ -336,6 +337,19 @@ sub display_row { if $form->{"id_$i"} && ($form->{type} =~ /^sales_/ || $form->{type} =~ /invoice/) && !$is_delivery_order; # / marge calculations ending +# calculate onhand + if ($form->{"id_$i"}) { + my $part = IC->get_basic_part_info(id => $form->{"id_$i"}); + my $onhand_color = 'color="#ff0000"' if $part->{onhand} < $part->{rop}; + push @ROW2, { value => sprintf "%s %s %s", + $locale->text('On Hand'), + $onhand_color, + $form->format_amount(\%myconfig, $part->{onhand}, 2), + $part->{unit} + }; + } +# / calculate onhand + my @hidden_vars; if ($is_delivery_order) {