Merge branch 'master' of ssh://git-jbueren@lx-office.linet-services.de/~/lx-office-erp
authorJan Büren <jan@lx-office-hosting.de>
Tue, 28 Dec 2010 10:55:57 +0000 (11:55 +0100)
committerJan Büren <jan@lx-office-hosting.de>
Tue, 28 Dec 2010 10:55:57 +0000 (11:55 +0100)
bin/mozilla/do.pl
bin/mozilla/wh.pl
templates/webpages/do/stock_in_form.html

index 2b1bdd9..120606a 100644 (file)
@@ -1044,7 +1044,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 c990e63..fc34ba6 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>