Standardlagerplätze in Part sortiert anzeigen
authorJan Büren <jan@kivitendo.de>
Thu, 21 Jan 2021 07:11:20 +0000 (08:11 +0100)
committerJan Büren <jan@kivitendo.de>
Thu, 21 Jan 2021 07:11:20 +0000 (08:11 +0100)
SL/Controller/Part.pm

index f589a71..a0ff1e7 100644 (file)
@@ -556,7 +556,7 @@ sub action_warehouse_changed {
     die unless ref($self->warehouse) eq 'SL::DB::Warehouse';
 
     if ( $self->warehouse->id and @{$self->warehouse->bins} ) {
-      $self->bin($self->warehouse->bins->[0]);
+      $self->bin($self->warehouse->bins_sorted->[0]);
       $self->js
         ->html('#bin', $self->build_bin_select)
         ->focus('#part_bin_id');
@@ -889,7 +889,7 @@ sub parse_form_customerprices {
 }
 
 sub build_bin_select {
-  select_tag('part.bin_id', [ $_[0]->warehouse->bins ],
+  select_tag('part.bin_id', [ @{ $_[0]->warehouse->bins_sorted } ],
     title_key => 'description',
     default   => $_[0]->bin->id,
   );