Fix für Bug 1395: Die bei der Einlagerung von Artikeln aus Lieferscheinen zum jeweili...
authorJan Büren <jan@lx-office-hosting.de>
Tue, 28 Dec 2010 10:54:21 +0000 (11:54 +0100)
committerJan Büren <jan@lx-office-hosting.de>
Tue, 28 Dec 2010 10:54:21 +0000 (11:54 +0100)
bin/mozilla/do.pl
bin/mozilla/wh.pl
templates/webpages/do/stock_in_form.html

index 0d5941c..bf76cdd 100644 (file)
@@ -1043,7 +1043,8 @@ sub display_stock_in_form {
   my $part_info  = IC->get_basic_part_info('id' => $form->{parts_id});
 
   my $units      = AM->retrieve_units(\%myconfig, $form);
-  my $units_data = AM->unit_select_data($units, undef, undef, $part_info->{unit});
+  # der zweite Parameter von unit_select_data gibt den default-Namen (selected) vor
+  my $units_data = AM->unit_select_data($units, $form->{do_unit}, undef, $part_info->{unit});
 
   $form->get_lists('warehouses' => { 'key'    => 'WAREHOUSES',
                                      'bins'   => 'BINS' });
index a55bf70..aa22c51 100644 (file)
@@ -85,7 +85,8 @@ sub transfer_warehouse_selection {
   show_no_warehouses_error() if (!scalar @{ $form->{WAREHOUSES} });
 
   my $units      = AM->retrieve_units(\%myconfig, $form);
-  $form->{UNITS} = AM->unit_select_data($units, $form->{unit}, 0, $form->{partunit});
+  # der zweite Parameter von unit_select_data gibt den default-Namen (selected) vor
+  $form->{UNITS} = AM->unit_select_data($units, $form->{partunit}, 0, $form->{partunit});
 
   if (scalar @{ $form->{WAREHOUSES} }) {
     $form->{warehouse_id} ||= $form->{WAREHOUSES}->[0]->{id};
index 238747e..0d5ea68 100644 (file)
      <td>
       <select name="unit_[% loop.count %]">
        [%- FOREACH unit = UNITS %]
-       <option[% IF unit.name == row.unit %] selected[% END %]>[% HTML.escape(unit.name) %]</option>
+       <option[% IF unit.selected %] selected[% END %]>[% HTML.escape(unit.name) %]</option>
        [%- END %]
       </select>
      </td>