Fehler in der Berechnung des angezeigten Lagerausgangs/Lagereingangs in Lieferscheinen.
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 19 Mar 2008 18:00:52 +0000 (18:00 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 19 Mar 2008 18:00:52 +0000 (18:00 +0000)
bin/mozilla/do.pl
bin/mozilla/io.pl

index 911c90e..2eee9ed 100644 (file)
@@ -756,6 +756,8 @@ sub calculate_stock_in_out {
     return '';
   }
 
+  AM->retrieve_all_units();
+
   my $in_out   = $form->{type} =~ /^sales/ ? 'out' : 'in';
   my $sinfo    = DO->unpack_stock_information('packed' => $form->{"stock_${in_out}_${i}"});
 
@@ -763,7 +765,7 @@ sub calculate_stock_in_out {
 
   my $content  = $form->format_amount_units('amount'      => $sum * 1,
                                             'part_unit'   => $form->{"partunit_$i"},
-                                            'amount_unit' => $units->{$form->{"partunit_$i"}}->{base_unit},
+                                            'amount_unit' => $all_units->{$form->{"partunit_$i"}}->{base_unit},
                                             'conv_units'  => 'convertible_not_smaller',
                                             'max_places'  => 2);
   $content    .= qq| <input type="button" onclick="open_stock_in_out_window('${in_out}', $i);" value="?">|;
index 4ae0956..a87e684 100644 (file)
@@ -122,6 +122,8 @@ sub display_row {
       $stock_in_out_title = $locale->text('Transfer To Stock');
       $stock_in_out       = 'in';
     }
+
+    retrieve_partunits();
   }
 
   # column_index
@@ -333,8 +335,6 @@ sub display_row {
       push @hidden_vars, "stock_${stock_in_out}_sum_qty", "stock_${stock_in_out}";
     }
 
-    push @hidden_vars, qw(partunit) if ($is_purchase);
-
     my @HIDDENS = map { value => $_}, (
           $cgi->hidden("-name" => "unit_old_$i", "-value" => $form->{"selected_unit_$i"}),
           $cgi->hidden("-name" => "price_new_$i", "-value" => $form->format_amount(\%myconfig, $form->{"price_new_$i"})),